diff --git a/snapshots/master/demos/android/energy-monitor.apk b/snapshots/master/demos/android/energy-monitor.apk index a72e4f0a4..7c6c97874 100644 Binary files a/snapshots/master/demos/android/energy-monitor.apk and b/snapshots/master/demos/android/energy-monitor.apk differ diff --git a/snapshots/master/demos/android/todo_lib.apk b/snapshots/master/demos/android/todo_lib.apk index cd2cdff64..4729f56d2 100644 Binary files a/snapshots/master/demos/android/todo_lib.apk and b/snapshots/master/demos/android/todo_lib.apk differ diff --git a/snapshots/master/demos/carousel/pkg/carousel.d.ts b/snapshots/master/demos/carousel/pkg/carousel.d.ts index 05104d091..ab628931e 100644 --- a/snapshots/master/demos/carousel/pkg/carousel.d.ts +++ b/snapshots/master/demos/carousel/pkg/carousel.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/carousel/pkg/carousel.js b/snapshots/master/demos/carousel/pkg/carousel.js index 1d80966eb..de97d7ae5 100644 --- a/snapshots/master/demos/carousel/pkg/carousel.js +++ b/snapshots/master/demos/carousel/pkg/carousel.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1630,11 +1630,7 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1145 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 137, __wbg_adapter_26); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_closure_wrapper1147 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1146 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 137, __wbg_adapter_26); return addHeapObject(ret); }; @@ -1650,43 +1646,47 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 137, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4371 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1151 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 137, __wbg_adapter_26); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_closure_wrapper4369 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5599 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5597 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5632 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5630 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5643 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5641 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5675 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5673 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5690 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5688 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5704 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5702 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5731 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5729 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5739 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5737 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5749 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5747 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm index 1aaa597a8..511829b66 100644 Binary files a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm and b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm differ diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts index c10a5d7ba..3c20d6282 100644 --- a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts +++ b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts index 0710728e7..24fe288ff 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00e387392714d45d: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ea2aa9c7aa77c9e: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js index eb936021d..1fb0529b3 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00e387392714d45d(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ea2aa9c7aa77c9e(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1684,63 +1684,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7800 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7799 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7802 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7801 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7804 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7803 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7806 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7805 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7808 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7807 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9364 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9361 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9366 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9363 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9370 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9367 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9375 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9372 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9377 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9374 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9386 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9383 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9389 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9386 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9396 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9393 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9404 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9401 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10068 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10065 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4046, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm index 990da44e6..bf4bb1b47 100644 Binary files a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm and b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm differ diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts index bc0ed3021..0a8131467 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00e387392714d45d(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ea2aa9c7aa77c9e(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts b/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts index 37af6cc66..91bb5476c 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js index fd6271a64..0c8ca92ae 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1682,27 +1682,27 @@ function __wbg_get_imports() { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11418 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11417 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11433 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11432 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11447 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11446 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11474 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11473 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11482 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11481 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11492 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11491 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm index c02ee6b8a..51d78c8ae 100644 Binary files a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts index 37aecd834..667d8d069 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts b/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts index 37af6cc66..91bb5476c 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js index c6c215960..d2c705a22 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1646,11 +1646,7 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6599 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3056, __wbg_adapter_26); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_closure_wrapper6601 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6600 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3056, __wbg_adapter_26); return addHeapObject(ret); }; @@ -1666,6 +1662,10 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 3056, __wbg_adapter_26); return addHeapObject(ret); }; + imports.wbg.__wbindgen_closure_wrapper6605 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3056, __wbg_adapter_26); + return addHeapObject(ret); + }; imports.wbg.__wbindgen_closure_wrapper9829 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); @@ -1682,27 +1682,27 @@ function __wbg_get_imports() { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11133 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11132 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11148 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11147 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11162 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11161 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11189 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11188 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11197 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11196 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11207 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11206 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3307, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm index ebad564a3..a4a1e087d 100644 Binary files a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts index 37aecd834..667d8d069 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts b/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts index 37af6cc66..91bb5476c 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery.js b/snapshots/master/demos/gallery/pkg/fluent/gallery.js index eec34de1b..768aec948 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.js +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1682,27 +1682,27 @@ function __wbg_get_imports() { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10237 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10236 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10252 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10251 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10266 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10265 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10293 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10292 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10301 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10300 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10311 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10310 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm index f64dffaaa..37f1715fa 100644 Binary files a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts index 37aecd834..667d8d069 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery.d.ts b/snapshots/master/demos/gallery/pkg/material/gallery.d.ts index 37af6cc66..91bb5476c 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/material/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery.js b/snapshots/master/demos/gallery/pkg/material/gallery.js index 81f949693..2433cdcfc 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.js +++ b/snapshots/master/demos/gallery/pkg/material/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1682,27 +1682,27 @@ function __wbg_get_imports() { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9698 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9697 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9713 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9712 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9727 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9726 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9754 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9753 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9762 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9761 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9772 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9771 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm index 2e6a3c138..48329fb6f 100644 Binary files a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts index 37aecd834..667d8d069 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6b75c11e8a567b49(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h078852af0a67a26c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts b/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts index 6bcf70e32..0c69b3b3b 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter.js b/snapshots/master/demos/imagefilter/pkg/imagefilter.js index fcc2d5aa9..52ae6ada4 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.js +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1650,43 +1650,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 264, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4656 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4652 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5884 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5880 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5917 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5913 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5928 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5924 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5960 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5956 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5975 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5971 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5989 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5985 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6016 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6012 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6024 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6020 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6034 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6030 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm index 79ac17521..283959795 100644 Binary files a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm and b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm differ diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts index 4e7e3b515..c4f4bed2d 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/memory/pkg/memory.d.ts b/snapshots/master/demos/memory/pkg/memory.d.ts index 6bcf70e32..0c69b3b3b 100644 --- a/snapshots/master/demos/memory/pkg/memory.d.ts +++ b/snapshots/master/demos/memory/pkg/memory.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/memory/pkg/memory.js b/snapshots/master/demos/memory/pkg/memory.js index 3b28dcd0f..188a3b1f1 100644 --- a/snapshots/master/demos/memory/pkg/memory.js +++ b/snapshots/master/demos/memory/pkg/memory.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_30(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1707,43 +1707,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 103, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4357 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4355 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5585 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5583 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5618 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5616 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5629 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5627 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5661 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5659 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5676 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5674 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5690 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5688 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5717 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5715 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_57); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5725 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5723 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5735 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5733 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm b/snapshots/master/demos/memory/pkg/memory_bg.wasm index 2ad8e9de4..726362137 100644 Binary files a/snapshots/master/demos/memory/pkg/memory_bg.wasm and b/snapshots/master/demos/memory/pkg/memory_bg.wasm differ diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts b/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts index 4e7e3b515..c4f4bed2d 100644 --- a/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts +++ b/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts index 6bcf70e32..0c69b3b3b 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js index 0ad415211..9bb7c2ff9 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1643,63 +1643,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1130 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1129 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 160, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1132 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1131 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 160, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1133 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1132 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 160, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1134 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1133 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 160, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1135 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1134 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 160, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4460 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4459 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5688 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5687 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5721 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5720 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5732 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5731 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5764 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5762 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5779 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5777 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5793 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5791 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5820 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5818 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5828 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5826 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5838 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5836 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm index 040e05dac..9e1851dca 100644 Binary files a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm and b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm differ diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts index 4e7e3b515..c4f4bed2d 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/plotter/pkg/plotter.d.ts b/snapshots/master/demos/plotter/pkg/plotter.d.ts index 6bcf70e32..0c69b3b3b 100644 --- a/snapshots/master/demos/plotter/pkg/plotter.d.ts +++ b/snapshots/master/demos/plotter/pkg/plotter.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/plotter/pkg/plotter.js b/snapshots/master/demos/plotter/pkg/plotter.js index 871f5ab87..841bc4e0b 100644 --- a/snapshots/master/demos/plotter/pkg/plotter.js +++ b/snapshots/master/demos/plotter/pkg/plotter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1629,63 +1629,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper991 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper989 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper993 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper991 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper994 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper992 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper995 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper993 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper996 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper994 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3553 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3550 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4782 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4779 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4815 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4812 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4826 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4823 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4858 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4855 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4873 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4870 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4887 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4884 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4914 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4911 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4922 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4919 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4932 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4929 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm index aef9d781b..6077a62e4 100644 Binary files a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm and b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm differ diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts index 4e7e3b515..c4f4bed2d 100644 --- a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts +++ b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts index 0dbe1f556..f2429f0c5 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3391d29f51bc725c: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71cc8419bc116754: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js index 340a65732..4c36b2619 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3391d29f51bc725c(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71cc8419bc116754(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1688,43 +1688,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6053 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6051 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6055 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6053 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6059 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6057 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6064 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6062 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6066 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6064 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6075 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6073 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6078 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6076 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6085 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6083 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6093 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6091 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2611, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6757 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6755 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2657, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm index afe9f1ace..e6c49188d 100644 Binary files a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm and b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts index b834a0442..90af1218d 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3391d29f51bc725c(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71cc8419bc116754(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts index 6bcf70e32..0c69b3b3b 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js index 613295c78..336b1d0bb 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1649,43 +1649,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 628, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5368 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5364 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6596 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6592 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6629 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6625 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6640 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6636 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6672 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6668 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6687 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6683 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6701 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6697 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6728 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6724 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6736 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6732 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6746 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6742 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm index 33cb3b09e..5e8fe20f4 100644 Binary files a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm and b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts index 4e7e3b515..c4f4bed2d 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b6dd3d83685a7df(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2df2bb44f00996cc(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1962a275ae97145c(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12c1ebc45e36ecbe(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h028b050b60049bd3(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts index 68bac8e83..954c4d6b5 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0a027166809b6a67: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30421eeb78935679: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30f2c68baad937ee: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d4b21a05f4ff94e: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e12d702d4930d81: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js index af0a2f6ba..ec9d91332 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_30(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0a027166809b6a67(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30421eeb78935679(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1687,63 +1687,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1388 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1390 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1390 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1392 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1391 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1393 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1392 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1394 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1393 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1395 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4797 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4794 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6035 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6032 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6068 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6065 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6074 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6071 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6082 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6079 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6094 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6091 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6100 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6097 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6104 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6101 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6150 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6147 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_59); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6194 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6191 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm index 04e9b4796..cf73437a6 100644 Binary files a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm and b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm differ diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts index 5f194997c..400a12e1f 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0a027166809b6a67(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30421eeb78935679(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30f2c68baad937ee(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d4b21a05f4ff94e(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0e12d702d4930d81(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts index d0dccfc5e..e147b142c 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1cec9184ece27a17: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f53232cc088ef03: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js index 73b68219c..5d7d17620 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1cec9184ece27a17(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f53232cc088ef03(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1684,63 +1684,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5095 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5096 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5097 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5098 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5099 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5100 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5101 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5102 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5103 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5104 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6660 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6659 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6662 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6661 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6666 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6665 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6671 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6670 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6673 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6672 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6682 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6681 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6685 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6684 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6692 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6691 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6700 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6699 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7364 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7363 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2767, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm index f2e647942..5824cbca8 100644 Binary files a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm and b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm differ diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts index 21ac721bb..d586e5f9f 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1cec9184ece27a17(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f53232cc088ef03(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/todo/pkg/todo_lib.d.ts b/snapshots/master/demos/todo/pkg/todo_lib.d.ts index 317170c66..c88619854 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib.d.ts +++ b/snapshots/master/demos/todo/pkg/todo_lib.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h01c9089c5abff425: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h35713475e18c1690: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/todo/pkg/todo_lib.js b/snapshots/master/demos/todo/pkg/todo_lib.js index 698413f5f..7ba558624 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib.js +++ b/snapshots/master/demos/todo/pkg/todo_lib.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h01c9089c5abff425(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h35713475e18c1690(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1688,43 +1688,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 897, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3886 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3884 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3888 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3886 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3892 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3890 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3897 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3895 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3899 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3897 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3908 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3906 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3911 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3909 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3918 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3916 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3926 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3924 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4590 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4588 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1493, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm index 75f326169..6215495a8 100644 Binary files a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm and b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm differ diff --git a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts index a99ff5fd9..65241ee41 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts +++ b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h01c9089c5abff425(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h35713475e18c1690(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts b/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts index 4ab63beb9..255cbe6b3 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h374e9341748e604a: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a2448eb5e7b24ae: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo.js b/snapshots/master/demos/weather-demo/pkg/weather_demo.js index 9ecdca9c2..9d4928bd3 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo.js +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h374e9341748e604a(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a2448eb5e7b24ae(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1699,63 +1699,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4786 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4785 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1910, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4788 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4787 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1910, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4790 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4789 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1910, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4792 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4791 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1910, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4794 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4793 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1910, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6350 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6352 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6352 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6354 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6356 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6358 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6361 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6363 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6363 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6365 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6372 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6374 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6375 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6377 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6382 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6384 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6390 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6392 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7054 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7056 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2505, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm index 78bce7e4c..8480855c3 100644 Binary files a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm and b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm differ diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts index 3365283c7..a38eb783c 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h374e9341748e604a(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a2448eb5e7b24ae(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1095abee5f56300d(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h154faefaa8507649(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hce62806cc3d2eb9f(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/docs/cpp/_sources/cmake.md.txt b/snapshots/master/docs/cpp/_sources/cmake.md.txt index e6bf5b97b..74c97b4d2 100644 --- a/snapshots/master/docs/cpp/_sources/cmake.md.txt +++ b/snapshots/master/docs/cpp/_sources/cmake.md.txt @@ -49,7 +49,7 @@ In the next section you will learn how to use the installed library in your appl First you need to install the prerequisites: * Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). If you already - have Rust installed, make sure that it's at least version 1.73 or newer. You can check which version you have installed + have Rust installed, make sure that it's at least version 1.77 or newer. You can check which version you have installed by running `rustc --version`. Once this is done, you should have the `rustc` compiler and the `cargo` build system installed in your path. You can either choose to compile Slint from source along with your application or include Slint as an external CMake package. diff --git a/snapshots/master/docs/cpp/_sources/mcu/generic.md.txt b/snapshots/master/docs/cpp/_sources/mcu/generic.md.txt index faa17ea0c..247655c5b 100644 --- a/snapshots/master/docs/cpp/_sources/mcu/generic.md.txt +++ b/snapshots/master/docs/cpp/_sources/mcu/generic.md.txt @@ -9,7 +9,7 @@ following generic instructions on what's needed to compile and use Slint. ## Prerequisites * Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). If you already - have Rust installed, make sure that it's at least version 1.73 or newer. You can check which version you have installed + have Rust installed, make sure that it's at least version 1.77 or newer. You can check which version you have installed by running `rustc --version`. Once this is done, you should have the `rustc` compiler and the `cargo` build system installed in your path. * A C++ cross-compiler compiler that supports C++20. @@ -44,7 +44,7 @@ cmake -DRust_CARGO_TARGET=thumbv7em-none-eabihf -DSLINT_FEATURE_FREESTANDING=ON ``` ## Next Steps - + - Check out the [](../getting_started.md) instructions for a generic "Hello World" with C++. - Study the [](../api/library_root), in particular the `slint::platform` namespace for writing a Slint platform integration to handle touch input and render pixel, which you diff --git a/snapshots/master/docs/cpp/api/library_root.html b/snapshots/master/docs/cpp/api/library_root.html index bb9d1a95f..f6175b3bf 100644 --- a/snapshots/master/docs/cpp/api/library_root.html +++ b/snapshots/master/docs/cpp/api/library_root.html @@ -436,7 +436,7 @@

Class Hierarchy
  • diff --git a/snapshots/master/docs/cpp/cmake.html b/snapshots/master/docs/cpp/cmake.html index 7869667f8..3f5e37557 100644 --- a/snapshots/master/docs/cpp/cmake.html +++ b/snapshots/master/docs/cpp/cmake.html @@ -461,7 +461,7 @@

    Build From Sources
  • Install Rust by following the Rust Getting Started Guide. If you already -have Rust installed, make sure that it’s at least version 1.73 or newer. You can check which version you have installed +have Rust installed, make sure that it’s at least version 1.77 or newer. You can check which version you have installed by running rustc --version. Once this is done, you should have the rustc compiler and the cargo build system installed in your path.

  • You can either choose to compile Slint from source along with your application or include Slint as an external CMake package.

    diff --git a/snapshots/master/docs/cpp/mcu/generic.html b/snapshots/master/docs/cpp/mcu/generic.html index 8d223ffab..12cbb4f19 100644 --- a/snapshots/master/docs/cpp/mcu/generic.html +++ b/snapshots/master/docs/cpp/mcu/generic.html @@ -423,7 +423,7 @@

    Generic MCU Environment Setup

    Returns void

    Returns void

    Returns void

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/classes/CompileError.html b/snapshots/master/docs/node/classes/CompileError.html index 115ef518c..436e30c5c 100644 --- a/snapshots/master/docs/node/classes/CompileError.html +++ b/snapshots/master/docs/node/classes/CompileError.html @@ -1,5 +1,5 @@ CompileError | slint-ui

    Class CompileError

    Represents an errors that can be emitted by the compiler.

    -

    Hierarchy

    • Error
      • CompileError

    Constructors

    Hierarchy

    • Error
      • CompileError

    Constructors

    Properties

    cause? diagnostics message @@ -11,8 +11,8 @@

    Constructors

    • Creates a new CompileError.

      Parameters

      • message: string

        human-readable description of the error.

      • diagnostics: Diagnostic[]

        represent a list of diagnostic items emitted while compiling .slint code.

        -

      Returns CompileError

    Properties

    cause?: unknown
    diagnostics: Diagnostic[]

    List of Diagnostic items emitted while compiling .slint code.

    -
    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err, stackTraces) => any)

    Optional override for formatting stack traces

    +

    Returns CompileError

    Properties

    cause?: unknown
    diagnostics: Diagnostic[]

    List of Diagnostic items emitted while compiling .slint code.

    +
    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err, stackTraces) => any)

    Optional override for formatting stack traces

    Type declaration

      • (err, stackTraces): any
      • Parameters

        • err: Error
        • stackTraces: CallSite[]

        Returns any

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      Parameters

      • targetObject: object
      • Optional constructorOpt: Function

      Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/classes/Model.html b/snapshots/master/docs/node/classes/Model.html index d0ccf967f..bf166dc64 100644 --- a/snapshots/master/docs/node/classes/Model.html +++ b/snapshots/master/docs/node/classes/Model.html @@ -6,7 +6,7 @@

    Example

    As an example let's see the implementation of ArrayModel

    export class ArrayModel<T> extends Model<T> {
    private a: Array<T>

    constructor(arr: Array<T>) {
    super();
    this.a = arr;
    }

    rowCount() {
    return this.a.length;
    }

    rowData(row: number) {
    return this.a[row];
    }

    setRowData(row: number, data: T) {
    this.a[row] = data;
    this.notifyRowDataChanged(row);
    }

    push(...values: T[]) {
    let size = this.a.length;
    Array.prototype.push.apply(this.a, values);
    this.notifyRowAdded(size, arguments.length);
    }

    remove(index: number, size: number) {
    let r = this.a.splice(index, size);
    this.notifyRowRemoved(index, size);
    }

    get length(): number {
    return this.a.length;
    }

    values(): IterableIterator<T> {
    return this.a.values();
    }

    entries(): IterableIterator<[number, T]> {
    return this.a.entries()
    }
    }
    -

    Hierarchy (view full)

    Implements

    Constructors

    Hierarchy (view full)

    Implements

    • Iterable<T>

    Constructors

    Methods

    • Returns Iterator<T, any, undefined>

    • Notifies the view that the complete data must be reload.

      -

      Returns void

    • Notifies the view that multiple rows are added to the model.

      +

    Constructors

    Methods

    Returns void

    Returns void

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadFile.html b/snapshots/master/docs/node/functions/loadFile.html index 425ef84b7..63908e0df 100644 --- a/snapshots/master/docs/node/functions/loadFile.html +++ b/snapshots/master/docs/node/functions/loadFile.html @@ -15,4 +15,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

    Throws

    CompileError if errors occur during compilation.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadSource.html b/snapshots/master/docs/node/functions/loadSource.html index 40cdf5478..5e7591c28 100644 --- a/snapshots/master/docs/node/functions/loadSource.html +++ b/snapshots/master/docs/node/functions/loadSource.html @@ -13,4 +13,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

    Throws

    CompileError if errors occur during compilation.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/quitEventLoop.html b/snapshots/master/docs/node/functions/quitEventLoop.html index f8f5e3842..f43757f41 100644 --- a/snapshots/master/docs/node/functions/quitEventLoop.html +++ b/snapshots/master/docs/node/functions/quitEventLoop.html @@ -1,3 +1,3 @@ quitEventLoop | slint-ui

    Function quitEventLoop

    • Stops a spinning event loop. This function returns immediately, and the promise returned from run_event_loop() will resolve in a later tick of the nodejs event loop.

      -

      Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/runEventLoop.html b/snapshots/master/docs/node/functions/runEventLoop.html index 3fc60c989..6419b9d92 100644 --- a/snapshots/master/docs/node/functions/runEventLoop.html +++ b/snapshots/master/docs/node/functions/runEventLoop.html @@ -2,4 +2,4 @@

    If the event loop is already running, then this function returns the same promise as from the earlier invocation.

    Parameters

    Returns Promise<unknown>

    \ No newline at end of file +

    Returns Promise<unknown>

    \ No newline at end of file diff --git a/snapshots/master/docs/node/index.html b/snapshots/master/docs/node/index.html index edb73f898..bae8bdaa7 100644 --- a/snapshots/master/docs/node/index.html +++ b/snapshots/master/docs/node/index.html @@ -21,8 +21,7 @@

    Building from Source

    Slint-node comes with pre-built binaries for macOS, Linux, and Windows. If you'd like to use Slint-node on a system without pre-built binaries, you need to additional software:

    Getting Started (Node.js)

      @@ -188,7 +187,7 @@

      Arrays and Models

      Array properties can be set from JavaScript by passing either Array objects or implementations of the Model interface.

      -

      When passing a JavaScript Array object, the contents of the array are copied. Any changes to the JavaScript afterwards will not be visible on the Slint side.

      +

      When passing a JavaScript Array object, the contents of the array are copied. Any changes to the JavaScript afterwards will not be visible on the Slint side.

      Reading a Slint array property from JavaScript will always return a @{link Model}.

      component.model = [1, 2, 3];
      // component.model.push(4); // does not work, because assignment creates a copy.
      // Use re-assignment instead.
      component.model = component.model.concat(4);
      diff --git a/snapshots/master/docs/node/interfaces/ComponentHandle.html b/snapshots/master/docs/node/interfaces/ComponentHandle.html index 6d69fa668..6ac15aeea 100644 --- a/snapshots/master/docs/node/interfaces/ComponentHandle.html +++ b/snapshots/master/docs/node/interfaces/ComponentHandle.html @@ -1,16 +1,16 @@ ComponentHandle | slint-ui

      Interface ComponentHandle

      This interface describes the public API of a Slint component that is common to all instances. Use this to show() the window on the screen, access the window and subsequent window properties, or start the Slint event loop with run().

      -
      interface ComponentHandle {
          get window(): Window;
          hide(): any;
          run(): Promise<unknown>;
          show(): any;
      }

      Accessors

      interface ComponentHandle {
          get window(): Window;
          hide(): any;
          run(): Promise<unknown>;
          show(): any;
      }

      Accessors

      Methods

      Accessors

      • get window(): Window
      • Returns the Window associated with this component instance. The window API can be used to control different aspects of the integration into the windowing system, such as the position on the screen.

        -

        Returns Window

      Methods

      • Hides the component's window, so that it is not visible anymore.

        -

        Returns any

      • Shows the window and runs the event loop. The returned promise is resolved when the event loop +

        Returns Window

      Methods

      • Hides the component's window, so that it is not visible anymore.

        +

        Returns any

      • Shows the window and runs the event loop. The returned promise is resolved when the event loop is terminated, for example when the last window was closed, or quitEventLoop was called.

        This function is a convenience for calling show, followed by runEventLoop, and hide when the event loop's promise is resolved.

        -

        Returns Promise<unknown>

      • Shows the component's window on the screen.

        -

        Returns any

      \ No newline at end of file +

      Returns Promise<unknown>

      \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ImageData.html b/snapshots/master/docs/node/interfaces/ImageData.html index dcfd09f9c..3b485c7cc 100644 --- a/snapshots/master/docs/node/interfaces/ImageData.html +++ b/snapshots/master/docs/node/interfaces/ImageData.html @@ -1,12 +1,12 @@ ImageData | slint-ui

      Interface ImageData

      An image data type that can be displayed by the Image element.

      This interface is inspired by the web ImageData interface.

      -
      interface ImageData {
          path?: string;
          get data(): Uint8Array;
          get height(): number;
          get width(): number;
      }

      Properties

      interface ImageData {
          path?: string;
          get data(): Uint8Array;
          get height(): number;
          get width(): number;
      }

      Properties

      Accessors

      Properties

      path?: string

      Returns the path of the image, if it was loaded from disk. Otherwise the property is undefined.

      -

      Accessors

      • get data(): Uint8Array
      • Returns the image as buffer.

        -

        Returns Uint8Array

      • get height(): number
      • Returns the height of the image in pixels.

        -

        Returns number

      • get width(): number
      • Returns the width of the image in pixels.

        -

        Returns number

      \ No newline at end of file +

      Accessors

      • get data(): Uint8Array
      • Returns the image as buffer.

        +

        Returns Uint8Array

      • get height(): number
      • Returns the height of the image in pixels.

        +

        Returns number

      • get width(): number
      • Returns the width of the image in pixels.

        +

        Returns number

      \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/LoadFileOptions.html b/snapshots/master/docs/node/interfaces/LoadFileOptions.html index 9f6ecf8ba..f279f8ee6 100644 --- a/snapshots/master/docs/node/interfaces/LoadFileOptions.html +++ b/snapshots/master/docs/node/interfaces/LoadFileOptions.html @@ -1,10 +1,10 @@ LoadFileOptions | slint-ui

      Interface LoadFileOptions

      LoadFileOptions are used to defines different optional parameters that can be used to configure the compiler.

      -
      interface LoadFileOptions {
          includePaths?: string[];
          libraryPaths?: Record<string, string>;
          quiet?: boolean;
          style?: string;
      }

      Properties

      interface LoadFileOptions {
          includePaths?: string[];
          libraryPaths?: Record<string, string>;
          quiet?: boolean;
          style?: string;
      }

      Properties

      includePaths?: string[]

      Sets the include paths used for looking up .slint imports to the specified vector of paths.

      -
      libraryPaths?: Record<string, string>

      Sets library paths used for looking up @library imports to the specified map of library names to paths.

      -
      quiet?: boolean

      If set to true warnings from the compiler will not be printed to the console.

      -
      style?: string

      Sets the widget style the compiler is currently using when compiling .slint files.

      -
      \ No newline at end of file +
      libraryPaths?: Record<string, string>

      Sets library paths used for looking up @library imports to the specified map of library names to paths.

      +
      quiet?: boolean

      If set to true warnings from the compiler will not be printed to the console.

      +
      style?: string

      Sets the widget style the compiler is currently using when compiling .slint files.

      +
      \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Point.html b/snapshots/master/docs/node/interfaces/Point.html index 966b7960c..f95f661d1 100644 --- a/snapshots/master/docs/node/interfaces/Point.html +++ b/snapshots/master/docs/node/interfaces/Point.html @@ -1,6 +1,6 @@ Point | slint-ui

      Interface Point

      Represents a two-dimensional point.

      -
      interface Point {
          x: number;
          y: number;
      }

      Properties

      x +
      interface Point {
          x: number;
          y: number;
      }

      Properties

      x y

      Properties

      x: number

      Defines the x coordinate of the point.

      -
      y: number

      Defines the y coordinate of the point.

      -
      \ No newline at end of file +
      y: number

      Defines the y coordinate of the point.

      +
      \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Size.html b/snapshots/master/docs/node/interfaces/Size.html index 6354ed840..29d97bebd 100644 --- a/snapshots/master/docs/node/interfaces/Size.html +++ b/snapshots/master/docs/node/interfaces/Size.html @@ -1,6 +1,6 @@ Size | slint-ui

      Interface Size

      Represents a two-dimensional size.

      -
      interface Size {
          height: number;
          width: number;
      }

      Properties

      interface Size {
          height: number;
          width: number;
      }

      Properties

      Properties

      height: number

      Defines the height length of the size.

      -
      width: number

      Defines the width length of the size.

      -
      \ No newline at end of file +
      width: number

      Defines the width length of the size.

      +
      \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Window.html b/snapshots/master/docs/node/interfaces/Window.html index b5569dd59..9f7b01643 100644 --- a/snapshots/master/docs/node/interfaces/Window.html +++ b/snapshots/master/docs/node/interfaces/Window.html @@ -1,7 +1,7 @@ Window | slint-ui

      Interface Window

      This type represents a window towards the windowing system, that's used to render the scene of a component. It provides API to control windowing system specific aspects such as the position on the screen.

      -
      interface Window {
          fullscreen: boolean;
          logicalPosition: Point;
          logicalSize: Size;
          maximized: boolean;
          minimized: boolean;
          physicalPosition: Point;
          physicalSize: Size;
          get visible(): boolean;
          hide(): void;
          requestRedraw(): void;
          show(): void;
      }

      Properties

      interface Window {
          fullscreen: boolean;
          logicalPosition: Point;
          logicalSize: Size;
          maximized: boolean;
          minimized: boolean;
          physicalPosition: Point;
          physicalSize: Size;
          get visible(): boolean;
          hide(): void;
          requestRedraw(): void;
          show(): void;
      }

      Properties

      fullscreen: boolean

      Gets or sets the window's fullscreen state *

      -
      logicalPosition: Point

      Gets or sets the logical position of the window on the screen.

      -
      logicalSize: Size

      Gets or sets the logical size of the window on the screen,

      -
      maximized: boolean

      Gets or sets the window's maximized state *

      -
      minimized: boolean

      Gets or sets teh window's minimized state *

      -
      physicalPosition: Point

      Gets or sets the physical position of the window on the screen.

      -
      physicalSize: Size

      Gets or sets the physical size of the window on the screen,

      -

      Accessors

      • get visible(): boolean
      • Returns the visibility state of the window. This function can return false even if you previously called show() +

      logicalPosition: Point

      Gets or sets the logical position of the window on the screen.

      +
      logicalSize: Size

      Gets or sets the logical size of the window on the screen,

      +
      maximized: boolean

      Gets or sets the window's maximized state *

      +
      minimized: boolean

      Gets or sets teh window's minimized state *

      +
      physicalPosition: Point

      Gets or sets the physical position of the window on the screen.

      +
      physicalSize: Size

      Gets or sets the physical size of the window on the screen,

      +

      Accessors

      • get visible(): boolean
      • Returns the visibility state of the window. This function can return false even if you previously called show() on it, for example if the user minimized the window.

        -

        Returns boolean

      Methods

      • Hides the window, so that it is not visible anymore.

        -

        Returns void

      • Issues a request to the windowing system to re-render the contents of the window.

        -

        Returns void

      • Shows the window on the screen. An additional strong reference on the +

        Returns boolean

      Methods

      • Hides the window, so that it is not visible anymore.

        +

        Returns void

      • Issues a request to the windowing system to re-render the contents of the window.

        +

        Returns void

      • Shows the window on the screen. An additional strong reference on the associated component is maintained while the window is visible.

        -

        Returns void

      \ No newline at end of file +

      Returns void

      \ No newline at end of file diff --git a/snapshots/master/docs/rust/help.html b/snapshots/master/docs/rust/help.html index 071be4644..b247ded44 100644 --- a/snapshots/master/docs/rust/help.html +++ b/snapshots/master/docs/rust/help.html @@ -1,4 +1,4 @@ -Help

      Rustdoc help

      Back
      \ No newline at end of file +

      Rustdoc help

      Back
      \ No newline at end of file diff --git a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html index 85814839e..b4652187e 100644 --- a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html +++ b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html @@ -1,4 +1,4 @@ -List of all items in this crate

      Rustdoc settings

      Back
      \ No newline at end of file +

      Rustdoc settings

      Back
      \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint/all.html b/snapshots/master/docs/rust/slint/all.html index cfcd669a9..9c7522f24 100644 --- a/snapshots/master/docs/rust/slint/all.html +++ b/snapshots/master/docs/rust/slint/all.html @@ -1,4 +1,4 @@ -List of all items in this crate
      slint

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { +
      slint

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
      Expand description

      The platform encountered a fatal error.

      This error typically indicates an issue with initialization or connecting to the windowing system.

      This can be constructed from a String:

      @@ -141,8 +141,8 @@ is not implemented for the current platform.

      §

      SetPlatformError(SetPlatformError)

      There is already a platform set from another thread.

      §

      Other(String)

      Another platform-specific error occurred

      -
      §

      OtherError(Box<dyn Error + Send + Sync>)

      Another platform-specific error occurred.

      -

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Send + Sync>> for PlatformError

      §

      fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where +
      §

      OtherError(Box<dyn Error + Sync + Send>)

      Another platform-specific error occurred.

      +

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Sync + Send>> for PlatformError

      §

      fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where T: 'static + ?Sized,

      source§

      fn type_id(&self) -> TypeId

      Gets the TypeId of self. Read more
      source§

      impl<T> Borrow<T> for T
      where T: ?Sized,

      source§

      fn borrow(&self) -> &T

      Immutably borrows from an owned value. Read more
      source§

      impl<T> BorrowMut<T> for T
      where T: ?Sized,

      source§

      fn borrow_mut(&mut self) -> &mut T

      Mutably borrows from an owned value. Read more
      §

      impl<T> Downcast for T
      where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

      §

      fn as_any(&self) -> &(dyn Any + 'static)

      Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
      §

      fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

      Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
      §

      impl<T> DowncastSync for T
      where - T: Any + Send + Sync,

      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
      source§

      impl<T> From<T> for T

      source§

      fn from(t: T) -> T

      Returns the argument unchanged.

      §

      impl<T> Instrument for T

      §

      fn instrument(self, span: Span) -> Instrumented<Self>

      Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
      §

      fn in_current_span(self) -> Instrumented<Self>

      Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint/enum.RenderingState.html b/snapshots/master/docs/rust/slint/enum.RenderingState.html index d40c1ac87..2324dcfb7 100644 --- a/snapshots/master/docs/rust/slint/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint - Rust
      slint::platform

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { +
      slint::platform

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
      Expand description

      The platform encountered a fatal error.

      This error typically indicates an issue with initialization or connecting to the windowing system.

      This can be constructed from a String:

      @@ -141,8 +141,8 @@ is not implemented for the current platform.

      §

      SetPlatformError(SetPlatformError)

      There is already a platform set from another thread.

      §

      Other(String)

      Another platform-specific error occurred

      -
      §

      OtherError(Box<dyn Error + Send + Sync>)

      Another platform-specific error occurred.

      -

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Send + Sync>> for PlatformError

      §

      fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where +
      §

      OtherError(Box<dyn Error + Sync + Send>)

      Another platform-specific error occurred.

      +

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Sync + Send>> for PlatformError

      §

      fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where T: 'static + ?Sized,

      source§

      fn type_id(&self) -> TypeId

      Gets the TypeId of self. Read more
      source§

      impl<T> Borrow<T> for T
      where T: ?Sized,

      source§

      fn borrow(&self) -> &T

      Immutably borrows from an owned value. Read more
      source§

      impl<T> BorrowMut<T> for T
      where T: ?Sized,

      source§

      fn borrow_mut(&mut self) -> &mut T

      Mutably borrows from an owned value. Read more
      §

      impl<T> Downcast for T
      where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

      §

      fn as_any(&self) -> &(dyn Any + 'static)

      Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
      §

      fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

      Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
      §

      impl<T> DowncastSync for T
      where - T: Any + Send + Sync,

      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
      source§

      impl<T> From<T> for T

      source§

      fn from(t: T) -> T

      Returns the argument unchanged.

      §

      impl<T> Instrument for T

      §

      fn instrument(self, span: Span) -> Instrumented<Self>

      Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
      §

      fn in_current_span(self) -> Instrumented<Self>

      Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html index 0d886fd03..54264a9ee 100644 --- a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html +++ b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html @@ -1,4 +1,4 @@ -PointerEventButton in slint::platform - Rust
      slint::platform::femtovg_renderer

      Trait OpenGLInterface

      pub unsafe trait OpenGLInterface {
           // Required methods
      -    fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
      -    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
      +    fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
      +    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
           fn resize(
               &self,
               width: NonZero<u32>,
               height: NonZero<u32>,
      -    ) -> Result<(), Box<dyn Error + Send + Sync>>;
      +    ) -> Result<(), Box<dyn Error + Sync + Send>>;
           fn get_proc_address(&self, name: &CStr) -> *const c_void;
       }
      Expand description

      This trait describes the interface GPU accelerated renderers in Slint require to render with OpenGL.

      It serves the purpose to ensure that the OpenGL context is current before running any OpenGL @@ -137,15 +137,15 @@

      §Safety

      This trait is unsafe because an implementation of get_proc_address could return dangling pointers. In practice an implementation of this trait should just forward to the EGL/WGL/CGL C library that implements EGL/CGL/WGL.

      -

      Required Methods§

      fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>

      Ensures that the OpenGL context is current when returning from this function.

      -

      fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>

      This function is called by the renderers when all OpenGL commands have been issued and +

      Required Methods§

      fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>

      Ensures that the OpenGL context is current when returning from this function.

      +

      fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>

      This function is called by the renderers when all OpenGL commands have been issued and the back buffer is reading for on-screen presentation. Typically implementations forward this to platform specific APIs such as eglSwapBuffers.

      fn resize( &self, width: NonZero<u32>, height: NonZero<u32>, -) -> Result<(), Box<dyn Error + Send + Sync>>

      This function is called by the renderers when the surface needs to be resized, typically +) -> Result<(), Box<dyn Error + Sync + Send>>

      This function is called by the renderers when the surface needs to be resized, typically in response to the windowing system notifying of a change in the window system. For most implementations this is a no-op, with the exception for wayland for example.

      fn get_proc_address(&self, name: &CStr) -> *const c_void

      Returns the address of the OpenGL function specified by name, or a null pointer if the diff --git a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html index eb9f7d1a9..95868bd2b 100644 --- a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html +++ b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html @@ -1,4 +1,4 @@ -duration_until_next_timer_update in slint::platform - Rust

      slint_interpreter

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { +
      slint_interpreter

      Enum PlatformError

      #[non_exhaustive]
      pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
      Expand description

      The platform encountered a fatal error.

      This error typically indicates an issue with initialization or connecting to the windowing system.

      This can be constructed from a String:

      @@ -141,8 +141,8 @@ is not implemented for the current platform.

      §

      SetPlatformError(SetPlatformError)

      There is already a platform set from another thread.

      §

      Other(String)

      Another platform-specific error occurred

      -
      §

      OtherError(Box<dyn Error + Send + Sync>)

      Another platform-specific error occurred.

      -

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Send + Sync>> for PlatformError

      §

      fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where +
      §

      OtherError(Box<dyn Error + Sync + Send>)

      Another platform-specific error occurred.

      +

      Trait Implementations§

      §

      impl Debug for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Display for PlatformError

      §

      fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

      Formats the value using the given formatter. Read more
      §

      impl Error for PlatformError

      §

      fn source(&self) -> Option<&(dyn Error + 'static)>

      Returns the lower-level source of this error, if any. Read more
      1.81.0 · source§

      fn description(&self) -> &str

      👎Deprecated since 1.42.0: use the Display impl or to_string()
      1.81.0 · source§

      fn cause(&self) -> Option<&dyn Error>

      👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
      source§

      fn provide<'a>(&'a self, request: &mut Request<'a>)

      🔬This is a nightly-only experimental API. (error_generic_member_access)
      Provides type-based access to context intended for error reports. Read more
      §

      impl From<&str> for PlatformError

      §

      fn from(value: &str) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<Box<dyn Error + Sync + Send>> for PlatformError

      §

      fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

      Converts to this type from the input type.
      §

      impl From<String> for PlatformError

      §

      fn from(value: String) -> PlatformError

      Converts to this type from the input type.

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where T: 'static + ?Sized,

      source§

      fn type_id(&self) -> TypeId

      Gets the TypeId of self. Read more
      source§

      impl<T> Borrow<T> for T
      where T: ?Sized,

      source§

      fn borrow(&self) -> &T

      Immutably borrows from an owned value. Read more
      source§

      impl<T> BorrowMut<T> for T
      where T: ?Sized,

      source§

      fn borrow_mut(&mut self) -> &mut T

      Mutably borrows from an owned value. Read more
      §

      impl<T> Downcast for T
      where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

      §

      fn as_any(&self) -> &(dyn Any + 'static)

      Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
      §

      fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

      Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
      §

      impl<T> DowncastSync for T
      where - T: Any + Send + Sync,

      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
      §

      fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

      Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
      source§

      impl<T> From<T> for T

      source§

      fn from(t: T) -> T

      Returns the argument unchanged.

      §

      impl<T> Instrument for T

      §

      fn instrument(self, span: Span) -> Instrumented<Self>

      Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
      §

      fn in_current_span(self) -> Instrumented<Self>

      Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html index 30ff191ae..e1c07bd22 100644 --- a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint_interpreter - Rust"),typeof Ut!="string"&&!_r(Ut))if(typeof Ut.toString=="function"){if(Ut=Ut.toString(),typeof Ut!="string")throw n5("dirty is not a string, aborting")}else throw n5("toString is not a function");if(!e.isSupported)return Ut;if(gs||Mo(G),e.removed=[],typeof Ut=="string"&&(to=!1),to){if(Ut.nodeName){const je=nr(Ut.nodeName);if(!Oe[je]||Gn[je])throw n5("root node is forbidden and cannot be sanitized in-place")}}else if(Ut instanceof a)de=yc(""),L=de.ownerDocument.importNode(Ut,!0),L.nodeType===1&&L.nodeName==="BODY"||L.nodeName==="HTML"?de=L:de.appendChild(L);else{if(!Hn&&!ba&&!ki&&Ut.indexOf("<")===-1)return C&&gh?C.createHTML(Ut):Ut;if(de=yc(Ut),!de)return Hn?null:gh?y:""}de&&ir&&sr(de.firstChild);const H=Ou(to?Ut:de);for(;ne=H.nextNode();)mn(ne)||(ne.content instanceof o&&Ei(ne.content),Ht(ne));if(to)return Ut;if(Hn){if(vc)for(R=k.call(de.ownerDocument);de.firstChild;)R.appendChild(de.firstChild);else R=de;return(Nt.shadowroot||Nt.shadowrootmode)&&(R=N.call(t,R,!0)),R}let ie=ki?de.outerHTML:de.innerHTML;return ki&&Oe["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Fm(nje,de.ownerDocument.doctype.name)&&(ie=" -`+ie),ba&&(ie=Ww(ie,U," "),ie=Ww(ie,J," "),ie=Ww(ie,j," ")),C&&gh?C.createHTML(ie):ie},e.setConfig=function(Ut){Mo(Ut),gs=!0},e.clearConfig=function(){Rs=null,gs=!1},e.isValidAttribute=function(Ut,G,de){Rs||Mo({});const L=nr(Ut),ne=nr(G);return ve(L,ne,de)},e.addHook=function(Ut,G){typeof G=="function"&&(z[Ut]=z[Ut]||[],i5(z[Ut],G))},e.removeHook=function(Ut){if(z[Ut])return d2e(z[Ut])},e.removeHooks=function(Ut){z[Ut]&&(z[Ut]=[])},e.removeAllHooks=function(){z={}},e}var rMe=sje();const oje=rMe.sanitize,rje=rMe.addHook,aje=rMe.removeHook;function Ed(n){return jle(n,0)}function jle(n,e){switch(typeof n){case"object":return n===null?_E(349,e):Array.isArray(n)?Eut(n,e):xut(n,e);case"string":return aMe(n,e);case"boolean":return Aut(n,e);case"number":return _E(n,e);case"undefined":return _E(937,e);default:return _E(617,e)}}function _E(n,e){return(e<<5)-e+n|0}function Aut(n,e){return _E(n?433:863,e)}function aMe(n,e){e=_E(149417,e);for(let t=0,i=n.length;tjle(i,t),e)}function xut(n,e){return e=_E(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=aMe(i,t),jle(n[i],t)),e)}var tv;(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(tv||(tv={}));function Mge(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function m2e(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):Dut((n>>>0).toString(16),e/4)}const nae=class nae{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(tv.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let c=r;if(wl(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=tv.BLOCK_SIZE&&(this._step(),t-=tv.BLOCK_SIZE,this._totalLen+=tv.BLOCK_SIZE,e[0]=e[tv.BLOCK_SIZE+0],e[1]=e[tv.BLOCK_SIZE+1],e[2]=e[tv.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,tv.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),s5(this._h0)+s5(this._h1)+s5(this._h2)+s5(this._h3)+s5(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,m2e(this._buff,this._buffLen),this._buffLen>56&&(this._step(),m2e(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=nae._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,Mge(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=s&o|~s&r,l=1518500249):h<40?(c=s^o^r,l=1859775393):h<60?(c=s&o|s&r|o&r,l=2400959708):(c=s^o^r,l=3395469782),d=Mge(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=Mge(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};nae._bigBlock32=new DataView(new ArrayBuffer(320));let Rve=nae;const{registerWindow:Vli,getWindow:gt,getDocument:zli,getWindows:N9,getWindowsCount:kut,getWindowId:FU,getWindowById:vZ,hasWindow:$li,onDidRegisterWindow:Vb,onWillUnregisterWindow:Iut,onDidUnregisterWindow:Lut}=function(){const n=new Map;Aht(yi,1);const e={window:yi,disposables:new Z};n.set(yi.vscodeWindowId,e);const t=new I,i=new I,s=new I;function o(r,a){return(typeof r=="number"?n.get(r):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(r){if(n.has(r.vscodeWindowId))return $.None;const a=new Z,c={window:r,disposables:a.add(new Z)};return n.set(r.vscodeWindowId,c),a.add(Ee(()=>{n.delete(r.vscodeWindowId),i.fire(r)})),a.add(pe(r,xe.BEFORE_UNLOAD,()=>{s.fire(r)})),t.fire(c),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return n.has(r)},getWindowById:o,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=r;return c?.view?c.view.window:yi},getDocument(r){return gt(r).document}}}();function Yo(n){for(;n.firstChild;)n.firstChild.remove()}class Tut{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function pe(n,e,t,i){return new Tut(n,e,t,i)}function cje(n,e){return function(t){return e(new yu(n,t))}}function Rut(n){return function(e){return n(new os(e))}}const Xo=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=cje(gt(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Rut(i)),pe(e,t,o,s)},Mut=function(e,t,i){const s=cje(gt(e),t);return Nut(e,s,i)};function Nut(n,e,t){return pe(n,I_&&sMe.pointerEvents?xe.POINTER_DOWN:xe.MOUSE_DOWN,e,t)}function UB(n,e,t){return AW(n,e,t)}class d$ extends ZQe{constructor(e,t){super(e,t)}}let wZ,xd;function Put(n,e,t,i){let s=0;const o=n.setInterval(()=>{s++,(s>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{n.clearInterval(o)});return r}class sQ extends nQ{constructor(e){super(),this.defaultTarget=e&>(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Nge{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const n=new Map,e=new Map,t=new Map,i=new Map,s=o=>{t.set(o,!1);const r=n.get(o)??[];for(e.set(o,r),n.set(o,[]),i.set(o,!0);r.length>0;)r.sort(Nge.sort),r.shift().execute();i.set(o,!1)};xd=(o,r,a=0)=>{const c=FU(o),l=new Nge(r,a);let d=n.get(c);return d||(d=[],n.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>s(c))),l},wZ=(o,r,a)=>{const c=FU(o);if(i.get(c)){const l=new Nge(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return xd(o,r,a)}})();const Fut=8,Out=function(n,e){return e};class But extends ${constructor(e,t,i,s=Out,o=Fut){super();let r=null,a=0;const c=this._register(new O_),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(pe(e,t,d=>{r=s(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function Wut(n,e,t,i,s){return new But(n,e,t,i,s)}function Kle(n){return gt(n).getComputedStyle(n,null)}function uw(n,e){const t=gt(n),i=t.document;if(n!==i.body)return new Tn(n.clientWidth,n.clientHeight);if(I_&&t?.visualViewport)return new Tn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new Tn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Tn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Tn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ha{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=Kle(e),o=s?s.getPropertyValue(t):"0";return ha.convertToPixels(e,o)}static getBorderLeftWidth(e){return ha.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ha.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ha.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ha.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ha.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ha.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ha.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ha.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ha.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ha.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ha.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ha.getDimension(e,"margin-bottom","marginBottom")}}const KT=class KT{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new KT(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof KT?e:new KT(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};KT.None=new KT(0,0);let Tn=KT;function bZ(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=hje(n)?null:Kle(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=ha.getBorderLeftWidth(n),t+=ha.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Hut(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function ia(n){const e=n.getBoundingClientRect(),t=gt(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function lje(n){let e=n,t=1;do{const i=Kle(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function du(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.offsetWidth+e}function h$(n){const e=ha.getBorderLeftWidth(n)+ha.getBorderRightWidth(n),t=ha.getPaddingLeft(n)+ha.getPaddingRight(n);return n.offsetWidth-e-t}function Uut(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.scrollWidth+e}function cMe(n){const e=ha.getBorderTopWidth(n)+ha.getBorderBottomWidth(n),t=ha.getPaddingTop(n)+ha.getPaddingBottom(n);return n.offsetHeight-e-t}function Zf(n){const e=ha.getMarginTop(n)+ha.getMarginBottom(n);return n.offsetHeight+e}function Vut(n,e){if(n===null)return 0;const t=bZ(n),i=bZ(e);return t.left-i.left}function zut(n,e){const t=e.map(s=>Math.max(Uut(s),du(s))+Vut(s,n)||0);return Math.max(...t)}function al(n,e){return!!e?.contains(n)}const dje="parentFlowToElementId";function $ut(n,e){n.dataset[dje]=e.id}function Gut(n){const e=n.dataset[dje];return typeof e=="string"?n.ownerDocument.getElementById(e):null}function qut(n,e){let t=n;for(;t;){if(t===e)return!0;if(Ra(t)){const i=Gut(t);if(i){t=i;continue}}t=t.parentNode}return!1}function Qut(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function GY(n,e,t){return!!Qut(n,e,t)}function hje(n){return n&&!!n.host&&!!n.mode}function P9(n){return!!cF(n)}function cF(n){for(;n.parentNode;){if(n===n.ownerDocument?.body)return null;n=n.parentNode}return hje(n)?n:null}function xl(){let n=Kg().activeElement;for(;n?.shadowRoot;)n=n.shadowRoot.activeElement;return n}function kw(n){return xl()===n}function lMe(n){return al(xl(),n)}function jut(n){return n.ownerDocument===Kg()}function Kg(){return kut()<=1?yi.document:Array.from(N9()).map(({window:e})=>e.document).find(e=>e.hasFocus())??yi.document}function ax(){return Kg().defaultView?.window??yi}const dMe=new Map;function uje(){return new Kut}class Kut{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=od(yi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function od(n=yi.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),n.appendChild(i),t&&t.add(Ee(()=>n.removeChild(i))),n===yi.document.head){const s=new Set;dMe.set(i,s);for(const{window:o,disposables:r}of N9()){if(o===yi)continue;const a=r.add(Yut(i,s,o));t?.add(a)}}return i}function Yut(n,e,t){const i=new Z,s=n.cloneNode(!0);t.document.head.appendChild(s),i.add(Ee(()=>t.document.head.removeChild(s)));for(const o of fje(n))s.sheet?.insertRule(o.cssText,s.sheet?.cssRules.length);return i.add(Jut.observe(n,i,{childList:!0})(()=>{s.textContent=n.textContent})),e.add(s),i.add(Ee(()=>e.delete(s))),i}const Jut=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));const s=Ed(t);let o=i.get(s);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(n,t);const c=o={users:1,observer:a,onDidMutate:r.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(r.dispose(),a.disconnect(),i?.delete(s),i?.size===0&&this.mutationObservers.delete(n))})),i.set(s,o)}return o.onDidMutate}};let Pge=null;function gje(){return Pge||(Pge=od()),Pge}function fje(n){return n?.sheet?.rules?n.sheet.rules:n?.sheet?.cssRules?n.sheet.cssRules:[]}function Kp(n,e,t=gje()){if(!(!t||!e)){t.sheet?.insertRule(`${n} {${e}}`,0);for(const i of dMe.get(t)??[])Kp(n,e,i)}}function vE(n,e=gje()){if(!e)return;const t=fje(e),i=[];for(let s=0;s=0;s--)e.sheet?.deleteRule(i[s]);for(const s of dMe.get(e)??[])vE(n,s)}function Xut(n){return typeof n.selectorText=="string"}function Ra(n){return n instanceof HTMLElement||n instanceof gt(n).HTMLElement}function _2e(n){return n instanceof HTMLAnchorElement||n instanceof gt(n).HTMLAnchorElement}function Zut(n){return n instanceof HTMLTextAreaElement||n instanceof gt(n).HTMLTextAreaElement}function egt(n){return n instanceof HTMLInputElement||n instanceof gt(n).HTMLInputElement}function hMe(n){return n instanceof MouseEvent||n instanceof gt(n).MouseEvent}function Sv(n){return n instanceof KeyboardEvent||n instanceof gt(n).KeyboardEvent}function tgt(n){return n instanceof DragEvent||n instanceof gt(n).DragEvent}const xe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:dM?"webkitAnimationStart":"animationstart",ANIMATION_END:dM?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dM?"webkitAnimationIteration":"animationiteration"};function igt(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const un={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function ngt(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function sgt(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class CZ extends ${static hasFocusWithin(e){if(Ra(e)){const t=cF(e),i=t?t.activeElement:e.ownerDocument.activeElement;return al(i,e)}else{const t=e;return al(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event;let t=CZ.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Ra(e)?gt(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{CZ.hasFocusWithin(e)!==t&&(t?o():s())},this._register(pe(e,xe.FOCUS,s,!0)),this._register(pe(e,xe.BLUR,o,!0)),Ra(e)&&(this._register(pe(e,xe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(pe(e,xe.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Dd(n){return new CZ(n)}function pje(n,e){return n.after(e),e}function he(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Yle(n,e){return n.insertBefore(e,n.firstChild),e}function _a(n,...e){n.innerText="",he(n,...e)}const ogt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var F9;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(F9||(F9={}));function mje(n,e,t,...i){const s=ogt.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==F9.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?r[a]=c:a==="selected"?c&&r.setAttribute(a,"true"):r.setAttribute(a,c))}),r.append(...i),r}function we(n,e,...t){return mje(F9.HTML,n,e,...t)}we.SVG=function(n,e,...t){return mje(F9.SVG,n,e,...t)};function _je(n,...e){n?Oh(...e):Jl(...e)}function Oh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Jl(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function v2e(n,e){const t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function vje(n){yi.open(n,"_blank","noopener")}function rgt(n,e){const t=()=>{e(),i=xd(n,t)};let i=xd(n,t);return Ee(()=>i.dispose())}T9.setPreferredWebSchema(/^https:/.test(yi.location.href)?"https":"http");function uf(n){return n?`url('${lp.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function qY(n){return`'${n.replace(/'/g,"%27")}'`}function hS(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=hS(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function agt(n,e){let t;if(P.isUri(n))t=n.toString(!0);else{const o=new Blob([n]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=ax(),s=document.createElement("a");i.document.body.appendChild(s),s.download=e,s.href=t,s.click(),setTimeout(()=>i.document.body.removeChild(s))}function cgt(){return new Promise(n=>{const e=ax(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,T.once(T.fromDOMEventEmitter(t,"input"))(()=>{n(t.files??void 0)}),t.click(),setTimeout(()=>e.document.body.removeChild(t))})}var u$;(function(n){n[n.DOCUMENT=1]="DOCUMENT",n[n.BROWSER=2]="BROWSER"})(u$||(u$={}));function lgt(n){return n.document.fullscreenElement||n.document.webkitFullscreenElement||n.document.webkitIsFullScreen?{mode:u$.DOCUMENT,guess:!1}:n.innerHeight===n.screen.height?{mode:u$.BROWSER,guess:!1}:(ei||jr)&&n.outerHeight===n.screen.height&&n.outerWidth===n.screen.width?{mode:u$.BROWSER,guess:!0}:null}function dgt(n,e=!1){const t=document.createElement("a");return rje("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ee(()=>{aje("afterSanitizeAttributes")})}_e.http,_e.https,_e.command;const hgt=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);function ugt(n){const e=new Uint16Array(n.length);for(let s=0;sthis.registerListeners(e,t),{window:yi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(pe(e,"keydown",i=>{if(i.defaultPrevented)return;const s=new os(i);if(!(s.keyCode===E.Alt&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(s.keyCode!==E.Alt)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(pe(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(pe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(pe(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Nb.instance||(Nb.instance=new Nb),Nb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class yZ extends ${constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(pe(this.element,xe.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(pe(this.element,xe.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(pe(this.element,xe.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(pe(this.element,xe.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(pe(this.element,xe.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(pe(this.element,xe.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(pe(this.element,xe.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const ggt=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function di(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=ggt.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const l of s.groups.class.split("."))l!==""&&a.push(l);if(t.className!==void 0)for(const l of t.className.split("."))l!==""&&a.push(l);a.length>0&&(r.className=a.join(" "));const c={};if(s.groups.name&&(c[s.groups.name]=r),i)for(const l of i)Ra(l)?r.appendChild(l):typeof l=="string"?r.append(l):"root"in l&&(Object.assign(c,l),r.appendChild(l.root));for(const[l,d]of Object.entries(t))if(l!=="className")if(l==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(w2e(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(w2e(l),d.toString());return c.root=r,c}function w2e(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class fgt extends ${constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class pgt extends ${get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new fgt(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s}}class mgt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=FU(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=xU(new pgt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),xU(T.once(Lut)(({vscodeWindowId:s})=>{s===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const B9=new mgt;class wje{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Ep(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Ep(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Ep(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Ep(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Ep(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Ep(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Ep(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=Ep(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=Ep(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=Ep(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=Ep(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Ep(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Ep(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Ep(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Ep(n){return typeof n=="number"?`${n}px`:n}function ks(n){return new wje(n)}function Sd(n,e){n instanceof wje?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}var Wc;(function(n){n[n.Regular=0]="Regular",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold"})(Wc||(Wc={}));class _gt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class uMe{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Sd(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Sd(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Sd(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===Wc.Regular&&(a=t),r.type===Wc.Bold&&(a=i),r.type===Wc.Italic&&(a=s),a.appendChild(document.createElement("br"));const c=document.createElement("span");uMe._render(c,r),a.appendChild(c),o.push(c)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let s=!1;for(const o of i)o.isTrusted||(s=!0,t.remove(o));s&&this._onDidChange.fire()}serializeFontInfo(e){return this._ensureCache(e).getValues().filter(i=>i.isTrusted)}restoreFontInfo(e,t){for(const i of t){if(i.version!==bje)continue;const s=new QY(i,!1);this._writeToCache(e,s,s)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let s=this._actualReadFontInfo(e,t);(s.typicalHalfwidthCharacterWidth<=2||s.typicalFullwidthCharacterWidth<=2||s.spaceWidth<=2||s.maxDigitWidth<=2)&&(s=new QY({pixelRatio:B9.getInstance(e).value,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontSize:s.fontSize,fontFeatureSettings:s.fontFeatureSettings,fontVariationSettings:s.fontVariationSettings,lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,isMonospace:s.isMonospace,typicalHalfwidthCharacterWidth:Math.max(s.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(s.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:s.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(s.spaceWidth,5),middotWidth:Math.max(s.middotWidth,5),wsmiddotWidth:Math.max(s.wsmiddotWidth,5),maxDigitWidth:Math.max(s.maxDigitWidth,5)},!1)),this._writeToCache(e,t,s)}return i.get(t)}_createRequest(e,t,i,s){const o=new _gt(e,t);return i.push(o),s?.push(o),o}_actualReadFontInfo(e,t){const i=[],s=[],o=this._createRequest("n",Wc.Regular,i,s),r=this._createRequest("m",Wc.Regular,i,null),a=this._createRequest(" ",Wc.Regular,i,s),c=this._createRequest("0",Wc.Regular,i,s),l=this._createRequest("1",Wc.Regular,i,s),d=this._createRequest("2",Wc.Regular,i,s),h=this._createRequest("3",Wc.Regular,i,s),u=this._createRequest("4",Wc.Regular,i,s),f=this._createRequest("5",Wc.Regular,i,s),p=this._createRequest("6",Wc.Regular,i,s),m=this._createRequest("7",Wc.Regular,i,s),v=this._createRequest("8",Wc.Regular,i,s),w=this._createRequest("9",Wc.Regular,i,s),b=this._createRequest("→",Wc.Regular,i,s),C=this._createRequest("→",Wc.Regular,i,null),y=this._createRequest("·",Wc.Regular,i,s),S=this._createRequest("⸱",Wc.Regular,i,null),M="|/-_ilm%";for(let U=0,J=M.length;U.001){F=!1;break}}let z=!0;return F&&C.width!==N&&(z=!1),C.width>b.width&&(z=!1),new QY({pixelRatio:B9.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:F,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:y.width,wsmiddotWidth:S.width,maxDigitWidth:k},!0)}}class Cgt{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const Mve=new bgt;var Ov;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Ov||(Ov={}));const be=ae("instantiationService");function ygt(n,e,t){e[Ov.DI_TARGET]===e?e[Ov.DI_DEPENDENCIES].push({id:n,index:t}):(e[Ov.DI_DEPENDENCIES]=[{id:n,index:t}],e[Ov.DI_TARGET]=e)}function ae(n){if(Ov.serviceIds.has(n))return Ov.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ygt(e,t,s)};return e.toString=()=>n,Ov.serviceIds.set(n,e),e}const jt=ae("codeEditorService"),Ai=ae("modelService"),Rn=ae("textModelService");function D(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function _(n,e){return function(t,i){e(t,i,n)}}const Sgt="vs/base/common/actions";class xn extends ${constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class gw extends ${constructor(){super(...arguments),this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const z8=class z8{constructor(){this.id=z8.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new z8,...i]:t=i);return t}async run(){}};z8.ID="vs.actions.separator";let Kr=z8;class u1{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}async run(){}}const sae=class sae extends xn{constructor(){super(sae.ID,g(Sgt,0,"(empty)"),void 0,!1)}};sae.ID="vs.actions.empty";let Nve=sae;function _l(n){return{id:n.id,label:n.label,tooltip:n.tooltip??n.label,class:n.class,enabled:n.enabled??!0,checked:n.checked,run:async(...e)=>n.run(...e)}}var OU;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(OU||(OU={}));function b2e(n){return{id:n}}var $e;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(Ce.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}n.asClassNameArray=t;function i(u){return t(u).join(" ")}n.asClassName=i;function s(u){return"."+t(u).join(".")}n.asCSSSelector=s;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||OU.isThemeColor(u.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}n.fromString=a;function c(u){return{id:u}}n.fromId=c;function l(u,f){let p=u.id;const m=p.lastIndexOf("~");return m!==-1&&(p=p.substring(0,m)),f&&(p=`${p}~${f}`),{id:p}}n.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}n.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}n.isEqual=h})($e||($e={}));const ji=ae("commandService"),yt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const r=[];for(const c of n.metadata.args)r.push(c.constraint);const a=n.handler;n.handler=function(c,...l){return Uct(l,r),a(c,...l)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new td,this._commands.set(t,i));const s=i.unshift(n),o=Ee(()=>{s(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return yt.registerCommand(n,(t,...i)=>t.get(ji).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return fi.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};yt.registerCommand("noop",()=>{});const Pe=ae("contextKeyService");function sm(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function oQ(n,e="Unreachable"){throw new Error(e)}function Agt(n,e="unexpected state"){if(!n)throw new cn(`Assertion Failed: ${e}`)}function C2e(n){n||bt(new cn("Soft Assertion Failed"))}function fw(n){if(!n()){debugger;n(),bt(new cn("Assertion Failed"))}}function gz(n,e){let t=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Dgt)),this._cachedMergedKeybindings.slice(0)}}const xr=new gMe,xgt={EditorModes:"platform.keybindingsRegistry"};it.add(xgt.EditorModes,xr);function Dgt(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var jY;function lR(n){return n.command!==void 0}function kgt(n){return n.submenu!==void 0}const te=class te{static for(e){return te._instances.get(e)??new te(e)}constructor(e){if(te._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);te._instances.set(e,this),this.id=e}};te._instances=new Map,te.CommandPalette=new te("CommandPalette"),te.DebugBreakpointsContext=new te("DebugBreakpointsContext"),te.DebugCallStackContext=new te("DebugCallStackContext"),te.DebugConsoleContext=new te("DebugConsoleContext"),te.DebugVariablesContext=new te("DebugVariablesContext"),te.NotebookVariablesContext=new te("NotebookVariablesContext"),te.DebugHoverContext=new te("DebugHoverContext"),te.DebugWatchContext=new te("DebugWatchContext"),te.DebugToolBar=new te("DebugToolBar"),te.DebugToolBarStop=new te("DebugToolBarStop"),te.EditorContext=new te("EditorContext"),te.SimpleEditorContext=new te("SimpleEditorContext"),te.EditorContent=new te("EditorContent"),te.EditorLineNumberContext=new te("EditorLineNumberContext"),te.EditorContextCopy=new te("EditorContextCopy"),te.EditorContextPeek=new te("EditorContextPeek"),te.EditorContextShare=new te("EditorContextShare"),te.EditorTitle=new te("EditorTitle"),te.EditorTitleRun=new te("EditorTitleRun"),te.EditorTitleContext=new te("EditorTitleContext"),te.EditorTitleContextShare=new te("EditorTitleContextShare"),te.EmptyEditorGroup=new te("EmptyEditorGroup"),te.EmptyEditorGroupContext=new te("EmptyEditorGroupContext"),te.EditorTabsBarContext=new te("EditorTabsBarContext"),te.EditorTabsBarShowTabsSubmenu=new te("EditorTabsBarShowTabsSubmenu"),te.EditorTabsBarShowTabsZenModeSubmenu=new te("EditorTabsBarShowTabsZenModeSubmenu"),te.EditorActionsPositionSubmenu=new te("EditorActionsPositionSubmenu"),te.ExplorerContext=new te("ExplorerContext"),te.ExplorerContextShare=new te("ExplorerContextShare"),te.ExtensionContext=new te("ExtensionContext"),te.GlobalActivity=new te("GlobalActivity"),te.CommandCenter=new te("CommandCenter"),te.CommandCenterCenter=new te("CommandCenterCenter"),te.LayoutControlMenuSubmenu=new te("LayoutControlMenuSubmenu"),te.LayoutControlMenu=new te("LayoutControlMenu"),te.MenubarMainMenu=new te("MenubarMainMenu"),te.MenubarAppearanceMenu=new te("MenubarAppearanceMenu"),te.MenubarDebugMenu=new te("MenubarDebugMenu"),te.MenubarEditMenu=new te("MenubarEditMenu"),te.MenubarCopy=new te("MenubarCopy"),te.MenubarFileMenu=new te("MenubarFileMenu"),te.MenubarGoMenu=new te("MenubarGoMenu"),te.MenubarHelpMenu=new te("MenubarHelpMenu"),te.MenubarLayoutMenu=new te("MenubarLayoutMenu"),te.MenubarNewBreakpointMenu=new te("MenubarNewBreakpointMenu"),te.PanelAlignmentMenu=new te("PanelAlignmentMenu"),te.PanelPositionMenu=new te("PanelPositionMenu"),te.ActivityBarPositionMenu=new te("ActivityBarPositionMenu"),te.MenubarPreferencesMenu=new te("MenubarPreferencesMenu"),te.MenubarRecentMenu=new te("MenubarRecentMenu"),te.MenubarSelectionMenu=new te("MenubarSelectionMenu"),te.MenubarShare=new te("MenubarShare"),te.MenubarSwitchEditorMenu=new te("MenubarSwitchEditorMenu"),te.MenubarSwitchGroupMenu=new te("MenubarSwitchGroupMenu"),te.MenubarTerminalMenu=new te("MenubarTerminalMenu"),te.MenubarViewMenu=new te("MenubarViewMenu"),te.MenubarHomeMenu=new te("MenubarHomeMenu"),te.OpenEditorsContext=new te("OpenEditorsContext"),te.OpenEditorsContextShare=new te("OpenEditorsContextShare"),te.ProblemsPanelContext=new te("ProblemsPanelContext"),te.SCMInputBox=new te("SCMInputBox"),te.SCMChangesSeparator=new te("SCMChangesSeparator"),te.SCMIncomingChanges=new te("SCMIncomingChanges"),te.SCMIncomingChangesContext=new te("SCMIncomingChangesContext"),te.SCMIncomingChangesSetting=new te("SCMIncomingChangesSetting"),te.SCMOutgoingChanges=new te("SCMOutgoingChanges"),te.SCMOutgoingChangesContext=new te("SCMOutgoingChangesContext"),te.SCMOutgoingChangesSetting=new te("SCMOutgoingChangesSetting"),te.SCMIncomingChangesAllChangesContext=new te("SCMIncomingChangesAllChangesContext"),te.SCMIncomingChangesHistoryItemContext=new te("SCMIncomingChangesHistoryItemContext"),te.SCMOutgoingChangesAllChangesContext=new te("SCMOutgoingChangesAllChangesContext"),te.SCMOutgoingChangesHistoryItemContext=new te("SCMOutgoingChangesHistoryItemContext"),te.SCMChangeContext=new te("SCMChangeContext"),te.SCMResourceContext=new te("SCMResourceContext"),te.SCMResourceContextShare=new te("SCMResourceContextShare"),te.SCMResourceFolderContext=new te("SCMResourceFolderContext"),te.SCMResourceGroupContext=new te("SCMResourceGroupContext"),te.SCMSourceControl=new te("SCMSourceControl"),te.SCMSourceControlInline=new te("SCMSourceControlInline"),te.SCMSourceControlTitle=new te("SCMSourceControlTitle"),te.SCMTitle=new te("SCMTitle"),te.SearchContext=new te("SearchContext"),te.SearchActionMenu=new te("SearchActionContext"),te.StatusBarWindowIndicatorMenu=new te("StatusBarWindowIndicatorMenu"),te.StatusBarRemoteIndicatorMenu=new te("StatusBarRemoteIndicatorMenu"),te.StickyScrollContext=new te("StickyScrollContext"),te.TestItem=new te("TestItem"),te.TestItemGutter=new te("TestItemGutter"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TouchBarContext=new te("TouchBarContext"),te.TitleBarContext=new te("TitleBarContext"),te.TitleBarTitleContext=new te("TitleBarTitleContext"),te.TunnelContext=new te("TunnelContext"),te.TunnelPrivacy=new te("TunnelPrivacy"),te.TunnelProtocol=new te("TunnelProtocol"),te.TunnelPortInline=new te("TunnelInline"),te.TunnelTitle=new te("TunnelTitle"),te.TunnelLocalAddressInline=new te("TunnelLocalAddressInline"),te.TunnelOriginInline=new te("TunnelOriginInline"),te.ViewItemContext=new te("ViewItemContext"),te.ViewContainerTitle=new te("ViewContainerTitle"),te.ViewContainerTitleContext=new te("ViewContainerTitleContext"),te.ViewTitle=new te("ViewTitle"),te.ViewTitleContext=new te("ViewTitleContext"),te.CommentEditorActions=new te("CommentEditorActions"),te.CommentThreadTitle=new te("CommentThreadTitle"),te.CommentThreadActions=new te("CommentThreadActions"),te.CommentThreadAdditionalActions=new te("CommentThreadAdditionalActions"),te.CommentThreadTitleContext=new te("CommentThreadTitleContext"),te.CommentThreadCommentContext=new te("CommentThreadCommentContext"),te.CommentTitle=new te("CommentTitle"),te.CommentActions=new te("CommentActions"),te.CommentsViewThreadActions=new te("CommentsViewThreadActions"),te.InteractiveToolbar=new te("InteractiveToolbar"),te.InteractiveCellTitle=new te("InteractiveCellTitle"),te.InteractiveCellDelete=new te("InteractiveCellDelete"),te.InteractiveCellExecute=new te("InteractiveCellExecute"),te.InteractiveInputExecute=new te("InteractiveInputExecute"),te.IssueReporter=new te("IssueReporter"),te.NotebookToolbar=new te("NotebookToolbar"),te.NotebookStickyScrollContext=new te("NotebookStickyScrollContext"),te.NotebookCellTitle=new te("NotebookCellTitle"),te.NotebookCellDelete=new te("NotebookCellDelete"),te.NotebookCellInsert=new te("NotebookCellInsert"),te.NotebookCellBetween=new te("NotebookCellBetween"),te.NotebookCellListTop=new te("NotebookCellTop"),te.NotebookCellExecute=new te("NotebookCellExecute"),te.NotebookCellExecuteGoTo=new te("NotebookCellExecuteGoTo"),te.NotebookCellExecutePrimary=new te("NotebookCellExecutePrimary"),te.NotebookDiffCellInputTitle=new te("NotebookDiffCellInputTitle"),te.NotebookDiffCellMetadataTitle=new te("NotebookDiffCellMetadataTitle"),te.NotebookDiffCellOutputsTitle=new te("NotebookDiffCellOutputsTitle"),te.NotebookOutputToolbar=new te("NotebookOutputToolbar"),te.NotebookOutlineFilter=new te("NotebookOutlineFilter"),te.NotebookOutlineActionMenu=new te("NotebookOutlineActionMenu"),te.NotebookEditorLayoutConfigure=new te("NotebookEditorLayoutConfigure"),te.NotebookKernelSource=new te("NotebookKernelSource"),te.BulkEditTitle=new te("BulkEditTitle"),te.BulkEditContext=new te("BulkEditContext"),te.TimelineItemContext=new te("TimelineItemContext"),te.TimelineTitle=new te("TimelineTitle"),te.TimelineTitleContext=new te("TimelineTitleContext"),te.TimelineFilterSubMenu=new te("TimelineFilterSubMenu"),te.AccountsContext=new te("AccountsContext"),te.SidebarTitle=new te("SidebarTitle"),te.PanelTitle=new te("PanelTitle"),te.AuxiliaryBarTitle=new te("AuxiliaryBarTitle"),te.AuxiliaryBarHeader=new te("AuxiliaryBarHeader"),te.TerminalInstanceContext=new te("TerminalInstanceContext"),te.TerminalEditorInstanceContext=new te("TerminalEditorInstanceContext"),te.TerminalNewDropdownContext=new te("TerminalNewDropdownContext"),te.TerminalTabContext=new te("TerminalTabContext"),te.TerminalTabEmptyAreaContext=new te("TerminalTabEmptyAreaContext"),te.TerminalStickyScrollContext=new te("TerminalStickyScrollContext"),te.WebviewContext=new te("WebviewContext"),te.InlineCompletionsActions=new te("InlineCompletionsActions"),te.InlineEditActions=new te("InlineEditActions"),te.NewFile=new te("NewFile"),te.MergeInput1Toolbar=new te("MergeToolbar1Toolbar"),te.MergeInput2Toolbar=new te("MergeToolbar2Toolbar"),te.MergeBaseToolbar=new te("MergeBaseToolbar"),te.MergeInputResultToolbar=new te("MergeToolbarResultToolbar"),te.InlineSuggestionToolbar=new te("InlineSuggestionToolbar"),te.InlineEditToolbar=new te("InlineEditToolbar"),te.ChatContext=new te("ChatContext"),te.ChatCodeBlock=new te("ChatCodeblock"),te.ChatCompareBlock=new te("ChatCompareBlock"),te.ChatMessageTitle=new te("ChatMessageTitle"),te.ChatExecute=new te("ChatExecute"),te.ChatExecuteSecondary=new te("ChatExecuteSecondary"),te.ChatInputSide=new te("ChatInputSide"),te.AccessibleView=new te("AccessibleView"),te.MultiDiffEditorFileToolbar=new te("MultiDiffEditorFileToolbar"),te.DiffEditorHunkToolbar=new te("DiffEditorHunkToolbar"),te.DiffEditorSelectionToolbar=new te("DiffEditorSelectionToolbar");let Te=te;const $8=class $8{static for(e){let t=this._all.get(e);return t||(t=new $8(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof $8&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};$8._all=new Map;let vT=$8;const Xs=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new wlt({merge:vT.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(vT.for(Te.CommandPalette)),Ee(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(vT.for(Te.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new td,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(vT.for(n)),Ee(()=>{i(),this._onDidChangeMenu.fire(vT.for(n))})}appendMenuItems(n){const e=new Z;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===Te.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)lR(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class uS extends u1{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let id=jY=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r,a){this.hideActions=s,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=jY.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&$e.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=$e.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new jY(t,void 0,i,s,void 0,r,a):void 0,this._options=i,this.class=c&&$e.asClassName(c)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};id=jY=D([_(5,Pe),_(6,ji)],id);class pi{constructor(e){this.desc=e}}function At(n){const e=[],t=new n,{f1:i,menu:s,keybinding:o,...r}=t.desc;if(yt.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(yt.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(s))for(const a of s)e.push(Xs.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else s&&e.push(Xs.appendMenuItem(s.id,{command:{...r,precondition:s.precondition===null?void 0:r.precondition},...s}));if(i&&(e.push(Xs.appendMenuItem(Te.CommandPalette,{command:r,when:r.precondition})),e.push(Xs.addCommand(r))),Array.isArray(o))for(const a of o)e.push(xr.registerKeybindingRule({...a,id:r.id,when:r.precondition?ge.and(r.precondition,a.when):a.when}));else o&&e.push(xr.registerKeybindingRule({...o,id:r.id,when:r.precondition?ge.and(r.precondition,o.when):o.when}));return{dispose(){St(e)}}}const rn=ae("telemetryService"),Igt=ae("customEndpointTelemetryService"),Ze=ae("logService"),wp=ae("loggerService"),BU="vs/editor/browser/editorExtensions";var mi;(function(n){n[n.Eager=0]="Eager",n[n.AfterFirstRender=1]="AfterFirstRender",n[n.BeforeFirstInteraction=2]="BeforeFirstInteraction",n[n.Eventually=3]="Eventually",n[n.Lazy=4]="Lazy"})(mi||(mi={}));let Jle=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=ge.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};xr.registerKeybindingRule(s)}}yt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Xs.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class Z1 extends Jle{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Pe).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return Jc.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class lt extends Jc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=Te.EditorContext),s.title||(s.title=e.label),s.when=ge.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(lt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(rn).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class yje extends lt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Pe),a=o.get(Ze);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(o,s,...t)})}}function nA(n,e){yt.registerCommand(n,function(t,...i){const s=t.get(be),[o,r]=i;Bt(P.isUri(o)),Bt(oe.isIPosition(r));const a=t.get(Ai).getModel(o);if(a){const c=oe.lift(r);return s.invokeFunction(e,a,c,...i.slice(2))}return t.get(Rn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=s.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function Ke(n){return om.INSTANCE.registerEditorCommand(n),n}function Fe(n){const e=new n;return om.INSTANCE.registerEditorAction(e),e}function Sje(n){return om.INSTANCE.registerEditorAction(n),n}function Lgt(n){om.INSTANCE.registerEditorAction(n)}function vn(n,e,t){om.INSTANCE.registerEditorContribution(n,e,t)}function Aje(n,e){om.INSTANCE.registerDiffEditorContribution(n,e)}var b_;(function(n){function e(r){return om.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return om.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return om.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return om.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return om.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(b_||(b_={}));const Tgt={EditorCommonContributions:"editor.contributions"},oae=class oae{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}registerDiffEditorContribution(e,t){this.diffEditorContributions.push({id:e,ctor:t})}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};oae.INSTANCE=new oae;let om=oae;it.add(Tgt.EditorCommonContributions,om.INSTANCE);function rQ(n){return n.register(),n}const Eje=rQ(new Z1({id:"undo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyZ},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,0,"&&Undo"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,1,"Undo"),order:1}]}));rQ(new Cje(Eje,{id:"default:undo",precondition:void 0}));const xje=rQ(new Z1({id:"redo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyY,secondary:[V.CtrlCmd|V.Shift|E.KeyZ],mac:{primary:V.CtrlCmd|V.Shift|E.KeyZ}},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,2,"&&Redo"),order:2},{menuId:Te.CommandPalette,group:"",title:g(BU,3,"Redo"),order:1}]}));rQ(new Cje(xje,{id:"default:redo",precondition:void 0}));const Rgt=rQ(new Z1({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:null,primary:V.CtrlCmd|E.KeyA},menuOpts:[{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(BU,4,"&&Select All"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,5,"Select All"),order:1}]})),Mgt="$initialize";let y2e=!1;function Pve(n){Jn&&(y2e||(y2e=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}var qp;(function(n){n[n.Request=0]="Request",n[n.Reply=1]="Reply",n[n.SubscribeEvent=2]="SubscribeEvent",n[n.Event=3]="Event",n[n.UnsubscribeEvent=4]="UnsubscribeEvent"})(qp||(qp={}));class Ngt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=qp.Request}}class S2e{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=qp.Reply}}class Pgt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=qp.SubscribeEvent}}class Fgt{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=qp.Event}}class Ogt{constructor(e,t){this.vsWorker=e,this.req=t,this.type=qp.UnsubscribeEvent}}class Bgt{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new Ngt(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Pgt(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Ogt(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case qp.Reply:return this._handleReplyMessage(e);case qp.Request:return this._handleRequestMessage(e);case qp.SubscribeEvent:return this._handleSubscribeEventMessage(e);case qp.Event:return this._handleEventMessage(e);case qp.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new S2e(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=EU(s.detail)),this._send(new S2e(this._workerId,t,void 0,EU(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new Fgt(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===qp.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{s?.(l)})),this._protocol=new Bgt({sendMessage:(l,d)=>{this._worker.postMessage(l,d)},handleMessage:(l,d)=>{if(typeof i[l]!="function")return Promise.reject(new Error("Missing method "+l+" on main thread host."));try{return Promise.resolve(i[l].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(l,d)=>{if(kje(l)){const h=i[l].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${l} on main thread host.`);return h}if(Dje(l)){const h=i[l];if(typeof h!="function")throw new Error(`Missing event ${l} on main thread host.`);return h}throw new Error(`Malformed event name ${l}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const r=BRe(i);this._onModuleLoaded=this._protocol.sendMessage(Mgt,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(l,d)=>this._request(l,d),c=(l,d)=>this._protocol.listen(l,d);this._lazyProxy=new Promise((l,d)=>{s=d,this._onModuleLoaded.then(h=>{l(Hgt(h,a,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function Dje(n){return n[0]==="o"&&n[1]==="n"&&fy(n.charCodeAt(2))}function kje(n){return/^onDynamic/.test(n)&&fy(n.charCodeAt(9))}function Hgt(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(kje(r)){o[r]=s(r);continue}if(Dje(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function Jx(n,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(i){bt(i);return}try{return yi.trustedTypes?.createPolicy(n,e)}catch(i){bt(i);return}}const A2e=Jx("defaultWorkerFactory",{createScriptURL:n=>n});function Ugt(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(A2e?A2e.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Vgt(n){return typeof n.then=="function"}class zgt extends ${constructor(e,t,i,s,o){super(),this.id=t,this.label=i;const r=Ugt(i);Vgt(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){s(c.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",o),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(s){bt(s),bt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:s}))}})}}const rae=class rae{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++rae.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new zgt(e,s,this._label||"anonymous"+s,t,o=>{Pve(o),this._webWorkerFailedBeforeError=o,i(o)})}};rae.LAST_WORKER_ID=0;let Fve=rae;var qa;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(qa||(qa={}));class Oge{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew Oge(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Oge({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Oge({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> - `,YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `,YT.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` - `;let Ove=YT;function dR(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),s=n.getLanguageId(i);let o=i;for(;o+10&&n.getLanguageId(r-1)===s;)r--;return new Ggt(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class Ggt{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}var Bve;(function(n){n[n.value=3]="value"})(Bve||(Bve={}));function EC(n){return(n&Bve.value)!==0}function KY(n){const e=n;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Bge(n){const e=n;return e?KY(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function Xx(n,e){return new qgt(n,e)}class qgt{constructor(e,t){this.reducer=e,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?bt(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let i;switch(e){case"data":i=this.listeners.data;break;case"end":i=this.listeners.end;break;case"error":i=this.listeners.error;break}if(i){const s=i.indexOf(t);s>=0&&i.splice(s,1)}}flowData(){if(this.buffer.data.length>0){const e=this.reducer(this.buffer.data);this.emitData(e),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(i=>i())}}flowErrors(){if(this.listeners.error.length>0){for(const e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}function Qgt(n,e){const t=[];let i;for(;(i=n.read())!==null;)t.push(i);return e(t)}function jgt(n,e,t){const i=[];let s;for(;(s=n.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof s<"u"){const o=s;return s=void 0,o}return n.read()}}}function fMe(n,e){return new Promise((t,i)=>{const s=[];hO(n,{onData:o=>{e&&s.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(s):void 0)}})})}function hO(n,e,t){n.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),n.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),n.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function Kgt(n,e){return new Promise((t,i)=>{const s=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return s.dispose(),n.pause(),t({stream:n,buffer:o,ended:!1})},a=l=>(s.dispose(),i(l)),c=()=>(s.dispose(),t({stream:n,buffer:o,ended:!0}));s.add(Ee(()=>n.removeListener("error",a))),n.on("error",a),s.add(Ee(()=>n.removeListener("end",c))),n.on("end",c),s.add(Ee(()=>n.removeListener("data",r))),n.on("data",r)})}function Ygt(n,e){const t=Xx(e);return t.end(n),t}function Jgt(n){let e=!1;return{read:()=>e?null:(e=!0,n)}}function Xgt(n,e,t){const i=Xx(t);return hO(n,{onData:s=>i.write(e.data(s)),onError:s=>i.error(e.error?e.error(s):s),onEnd:()=>i.end()}),i}const wj=typeof Buffer<"u",Zgt=new Ya(()=>new Uint8Array(256));let Wge,Hge;class ze{static alloc(e){return wj?new ze(Buffer.allocUnsafe(e)):new ze(new Uint8Array(e))}static wrap(e){return wj&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new ze(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&wj?new ze(Buffer.from(e)):(Wge||(Wge=new TextEncoder),new ze(Wge.encode(e)))}static fromByteArray(e){const t=ze.alloc(e.length);for(let i=0,s=e.length;i"u"){t=0;for(let o=0,r=e.length;os-t)return-1;const o=Zgt.value;o.fill(e.length);for(let l=0;l>>0|n[e+1]<<8>>>0}function ift(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Bg(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function Wg(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function nft(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0|n[e+2]<<16>>>0|n[e+3]<<24>>>0}function sft(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255,e=e>>>8,n[t+2]=e&255,e=e>>>8,n[t+3]=e&255}function Wve(n,e){return n[e]}function Hve(n,e,t){n[t]=e}function oft(n){return Qgt(n,e=>ze.concat(e))}function Ije(n){return Jgt(n)}function II(n){return fMe(n,e=>ze.concat(e))}async function rft(n){return n.ended?ze.concat(n.buffer):ze.concat([...n.buffer,await II(n.stream)])}function aQ(n){return Ygt(n,e=>ze.concat(e))}function Lje(n){return Xx(e=>ze.concat(e),n)}function Tje(n){let e=0,t=0,i=0;const s=new Uint8Array(Math.floor(n.length/4*3)),o=a=>{switch(t){case 3:s[i++]=e|a,t=0;break;case 2:s[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:s[i++]=e|a>>>4,e=a<<4,t=2;break;default:e=a<<2,t=1}};for(let a=0;a=65&&c<=90)o(c-65);else if(c>=97&&c<=122)o(c-97+26);else if(c>=48&&c<=57)o(c-48+52);else if(c===43||c===45)o(62);else if(c===47||c===95)o(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${n[a]}`)}}const r=i;for(;t>0;)o(0);return ze.wrap(s).slice(0,r)}const aft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function pMe({buffer:n},e=!0,t=!1){const i=t?cft:aft;let s="";const o=n.byteLength%3;let r=0;for(;r>>2],s+=i[(a<<4|c>>>4)&63],s+=i[(c<<2|l>>>6)&63],s+=i[l&63]}if(o===1){const a=n[r+0];s+=i[a>>>2],s+=i[a<<4&63],e&&(s+="==")}else if(o===2){const a=n[r+0],c=n[r+1];s+=i[a>>>2],s+=i[(a<<4|c>>>4)&63],s+=i[c<<2&63],e&&(s+="=")}return s}let Uge;function Rje(){return Uge||(Uge=new TextDecoder("UTF-16LE")),Uge}let Vge;function lft(){return Vge||(Vge=new TextDecoder("UTF-16BE")),Vge}let zge;function Mje(){return zge||(zge=VRe()?Rje():lft()),zge}function dft(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?hft(n,e,t):Rje().decode(i)}function hft(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[c,l]=r,[d,h]=a;return c===d||c===h||l===d||l===h},s=(r,a)=>{const c=Math.min(r,a),l=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:c})}return o}class gft{constructor(e,t){this._richEditBracketsBrand=void 0;const i=uft(t);this.brackets=i.map((s,o)=>new SZ(e,o,s.open,s.close,fft(s.open,s.close,i,o),pft(s.open,s.close,i,o))),this.forwardRegex=mft(this.brackets),this.reversedRegex=_ft(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Nje(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function Pje(n,e){return n.length-e.length}function Xle(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function fft(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return Mje().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class Y_{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=s+r;return new O(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,s,o){const a=mMe(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const c=s+r;return new O(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class wft{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return Tc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(EC(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Y_.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const c=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}var Pb;(function(n){n[n.INCREASE_MASK=1]="INCREASE_MASK",n[n.DECREASE_MASK=2]="DECREASE_MASK",n[n.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",n[n.UNINDENT_MASK=8]="UNINDENT_MASK"})(Pb||(Pb={}));function bj(n){return n.global&&(n.lastIndex=0),!0}class bft{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&bj(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&bj(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&bj(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&bj(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=Pb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=Pb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=Pb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=Pb.UNINDENT_MASK),t}}class VB{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=VB._createOpenBracketRegExp(t[0]),s=VB._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=ed.Advanced)for(let o=0,r=this._regExpRules.length;ol.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=ed.Brackets&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=ed.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function xft(n){return n.replace(/[\[\]]/g,"")}const eL={JSONContribution:"base.contributions.json"};function Dft(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class kft{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Dft(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}}const Ift=new kft;it.add(eL.JSONContribution,Ift);const my="vs/platform/configuration/common/configurationRegistry";var E2e;(function(n){n.Multiline="multilineText",n.Singleline="singlelineText"})(E2e||(E2e={}));const Cs={Configuration:"base.contributions.configuration"};var ut;(function(n){n[n.APPLICATION=1]="APPLICATION",n[n.MACHINE=2]="MACHINE",n[n.WINDOW=3]="WINDOW",n[n.RESOURCE=4]="RESOURCE",n[n.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",n[n.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(ut||(ut={}));const Wf={properties:{},patternProperties:{}},l3={properties:{},patternProperties:{}},zB={properties:{},patternProperties:{}},nE={properties:{},patternProperties:{}},sE={properties:{},patternProperties:{}},vb={properties:{},patternProperties:{}},ED="vscode://schemas/settings/resourceLanguage",Hje="vscode://schemas/settings/configurationDefaults",Cj=it.as(eL.JSONContribution);class Lft{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new I,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new I,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:g(my,0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){const i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){const i=[];for(const{overrides:s,source:o}of e)for(const r in s)if(t.add(r),dp.test(r)){const a=this.configurationDefaultsOverrides.get(r),c=a?.valuesSources??new Map;if(o)for(const u of Object.keys(s[r]))c.set(u,o);const l={...a?.value||{},...s[r]};this.configurationDefaultsOverrides.set(r,{source:o,value:l,valuesSources:c});const d=xft(r),h={type:"object",default:l,description:g(my,1,"Configure settings to be overridden for the {0} language.",d),$ref:ED,defaultDefaultValue:l,source:$t(o)?void 0:o,defaultValueSource:o};i.push(...H9(r)),this.configurationProperties[r]=h,this.defaultLanguageConfigurationOverridesNode.properties[r]=h}else{this.configurationDefaultsOverrides.set(r,{value:s[r],source:o});const a=this.configurationProperties[r];a&&(this.updatePropertyDefaultValue(r,a),this.updateSchema(r,a))}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){const t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(const{overrides:i,source:s}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o),a=$t(s)?s:s?.id,c=$t(r?.source)?r?.source:r?.source?.id;if(a===c)if(t.add(o),this.configurationDefaultsOverrides.delete(o),dp.test(o))delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o];else{const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}}this.updateOverridePropertyPatternKey()}deltaConfiguration(e){let t=!1;const i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}doDeregisterConfigurations(e,t){const i=s=>{if(s.properties)for(const o in s.properties){t.add(o);const r=this.configurationProperties[o];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[o],this.removeFromSchema(o,s.properties[o])}s.allOf?.forEach(o=>i(o))};for(const s of e){i(s);const o=this.configurationContributors.indexOf(s);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,s,o=ut.WINDOW,r){o=hc(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&$je(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),dp.test(l)?d.scope=void 0:(d.scope=hc(d.scope)?o:d.scope,d.restricted=hc(d.restricted)?!!s?.includes(l):d.restricted),a[l].hasOwnProperty("included")&&!a[l].included){this.excludedConfigurationProperties[l]=a[l],delete a[l];continue}else this.configurationProperties[l]=a[l],a[l].policy?.name&&this.policyConfigurations.set(a[l].policy.name,l);!a[l].deprecationMessage&&a[l].markdownDeprecationMessage&&(a[l].deprecationMessage=a[l].markdownDeprecationMessage),r.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,s,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getConfigurationDefaultsOverrides(){return this.configurationDefaultsOverrides}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Wf.properties[e]=t,t.scope){case ut.APPLICATION:l3.properties[e]=t;break;case ut.MACHINE:zB.properties[e]=t;break;case ut.MACHINE_OVERRIDABLE:nE.properties[e]=t;break;case ut.WINDOW:sE.properties[e]=t;break;case ut.RESOURCE:vb.properties[e]=t;break;case ut.LANGUAGE_OVERRIDABLE:vb.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Wf.properties[e],t.scope){case ut.APPLICATION:delete l3.properties[e];break;case ut.MACHINE:delete zB.properties[e];break;case ut.MACHINE_OVERRIDABLE:delete nE.properties[e];break;case ut.WINDOW:delete sE.properties[e];break;case ut.RESOURCE:case ut.LANGUAGE_OVERRIDABLE:delete vb.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};this.updatePropertyDefaultValue(t,i),Wf.properties[t]=i,l3.properties[t]=i,zB.properties[t]=i,nE.properties[t]=i,sE.properties[t]=i,vb.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};Wf.patternProperties[KD]=e,l3.patternProperties[KD]=e,zB.patternProperties[KD]=e,nE.patternProperties[KD]=e,sE.patternProperties[KD]=e,vb.patternProperties[KD]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i?.value,o=i?.source;ll(s)&&(s=t.defaultDefaultValue,o=void 0),ll(s)&&(s=zje(t.type)),t.default=s,t.defaultValueSource=o}}const Uje="\\[([^\\]]+)\\]",x2e=new RegExp(Uje,"g"),KD=`^(${Uje})+$`,dp=new RegExp(KD);function H9(n){const e=[];if(dp.test(n)){let t=x2e.exec(n);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=x2e.exec(n)}}return Tc(e)}function Vje(n){return n.reduce((e,t)=>`${e}[${t}]`,"")}function zje(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const g$=new Lft;it.add(Cs.Configuration,g$);function $je(n,e){return n.trim()?dp.test(n)?g(my,5,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):g$.getConfigurationProperties()[n]!==void 0?g(my,6,"Cannot register '{0}'. This property is already registered.",n):e.policy?.name&&g$.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(my,7,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,e.policy?.name,g$.getPolicyConfigurations().get(e.policy?.name)):null:g(my,4,"Cannot register an empty property")}function Tft(){const n=[],e=g$.getConfigurationProperties();for(const t of Object.keys(e))n.push([t,e[t].scope]);return n.push(["launch",ut.RESOURCE]),n.push(["task",ut.RESOURCE]),n}const Rft="vs/editor/common/languages/modesRegistry",Mft={ModesRegistry:"editor.modesRegistry"};class Nft{constructor(){this._onDidChangeLanguages=new I,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const c=new Set;return{info:new Fft(this,a,c),closing:c}}),o=new tZ(a=>{const c=new Set,l=new Set;return{info:new Oft(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?D2e(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.openingColorized.add(l.info),d.opening.add(l.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,c])=>[a,c.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,c])=>[a,c.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return cQ(t,e)}}function D2e(n){return n.filter(([e,t])=>e!==""&&t!=="")}class qje{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Fft extends qje{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Oft extends qje{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}class Gge{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const lo=ae("languageConfigurationService");let Vve=class extends ${constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Uft),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(zve));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Gge(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Gge(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new Gge(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Bft(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Vve=D([_(0,Re),_(1,Di)],Vve);function Bft(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new EW(n,{});s=new EW(n,{})}const o=Wft(s.languageId,t),r=jje([s.underlyingConfig,o]);return new EW(s.languageId,r)}const zve={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Wft(n,e){const t=e.getValue(zve.brackets,{overrideIdentifier:n}),i=e.getValue(zve.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:k2e(t),colorizedBracketPairs:k2e(i)}}function k2e(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Qje(n,e,t){const i=n.getLineContent(e);let s=Uo(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}class Hft{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new I2e(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let s=0;se.configuration)))}}function jje(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class I2e{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class L2e{constructor(e){this.languageId=e}}class Uft extends ${constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Yc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new Hft(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new L2e(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new L2e(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class EW{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new VB(this.underlyingConfig):null,this.comments=EW._handleComments(this.underlyingConfig),this.characterPair=new Ove(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||jRe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new bft(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Pft(e,this.underlyingConfig)}getWordDefinition(){return zq(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new gft(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new wft(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new $gt(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ce(lo,Vve,Yt.Delayed);class xD{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class T2e{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new xD(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Zn.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Zn.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class wy{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=wy._getElements(e),[a,c,l]=wy._getElements(t);this._hasStrings=r&&l,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(wy._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let h;return i<=s?(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new xD(e,0,i,s-i+1)]):e<=t?(BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[new xD(e,t-e+1,i,0)]):(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,s,r,a,o),l=r[0],d=a[0];if(c!==null)return c;if(!o[0]){const h=this.ComputeDiffRecursive(e,l,i,d,o);let u=[];return o[0]?u=[new xD(l+1,t-(l+1)+1,d+1,s-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,s,o),this.ConcatenateChanges(h,u)}return[new xD(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){let C=null,y=null,S=new R2e,M=t,k=i,F=f[0]-v[0]-s,N=Zn.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const U=F+e;U===M||U=0&&(l=this.m_forwardHistory[z],e=l[0],M=1,k=l.length-1)}while(--z>=-1);if(C=S.getReverseChanges(),b[0]){let U=f[0]+1,J=v[0]+1;if(C!==null&&C.length>0){const j=C[C.length-1];U=Math.max(U,j.getOriginalEnd()),J=Math.max(J,j.getModifiedEnd())}y=[new xD(U,u-U+1,J,m-J+1)]}else{S=new R2e,M=r,k=a,F=f[0]-v[0]-c,N=Zn.MAX_SAFE_SMALL_INTEGER,z=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const U=F+o;U===M||U=d[U+1]?(h=d[U+1]-1,p=h-F-c,h>N&&S.MarkNextChange(),N=h+1,S.AddOriginalElement(h+1,p+1),F=U+1-o):(h=d[U-1],p=h-F-c,h>N&&S.MarkNextChange(),N=h,S.AddModifiedElement(h+1,p+1),F=U-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],M=1,k=d.length-1)}while(--z>=-1);y=S.getChanges()}return this.ConcatenateChanges(C,y)}ComputeRecursionPoint(e,t,i,s,o,r,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(s-i),m=p+1,v=new Int32Array(m),w=new Int32Array(m),b=s-i,C=t-e,y=e-i,S=t-s,k=(C-b)%2===0;v[b]=e,w[C]=t,a[0]=!1;for(let F=1;F<=p/2+1;F++){let N=0,z=0;d=this.ClipDiagonalBound(b-F,F,b,m),h=this.ClipDiagonalBound(b+F,F,b,m);for(let J=d;J<=h;J+=2){J===d||JN+z&&(N=c,z=l),!k&&Math.abs(J-C)<=F-1&&c>=w[J])return o[0]=c,r[0]=l,j<=w[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}const U=(N-e+(z-i)-F)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,U))return a[0]=!0,o[0]=N,r[0]=z,U>0&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):(e++,i++,[new xD(e,t-e+1,i,s-i+1)]);u=this.ClipDiagonalBound(C-F,F,C,m),f=this.ClipDiagonalBound(C+F,F,C,m);for(let J=u;J<=f;J+=2){J===u||J=w[J+1]?c=w[J+1]-1:c=w[J-1],l=c-(J-C)-S;const j=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(w[J]=c,k&&Math.abs(J-b)<=F&&c<=v[J])return o[0]=c,r[0]=l,j>=v[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}if(F<=bA.MaxDifferencesHistory){let J=new Int32Array(h-d+2);J[0]=b-d+1,WO.Copy2(v,d,J,1,h-d+1),this.m_forwardHistory.push(J),J=new Int32Array(f-u+2),J[0]=C-u+1,WO.Copy2(w,u,J,1,f-u+1),this.m_reverseHistory.push(J)}}return this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const h=e[t-1];s=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let c=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,f=i.modifiedStart-h;if(ul&&(l=m,c=h)}i.originalStart-=c,i.modifiedStart-=c;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>c&&(c=f,l=h,d=u)}return c>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return WO.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],WO.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return WO.Copy(e,0,s,0,e.length),WO.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(BO.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),BO.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new xD(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=PO(e),t=PO(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=PO(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new Kje(s,e-r)}}class $ft{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Kje(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Uq(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var f$;(function(n){n[n.False=0]="False",n[n.True=1]="True"})(f$||(f$={}));class EZ{constructor(){this._actual=new pz(f$.False)}add(e){this._actual.set(e,f$.True)}has(e){return this._actual.get(e)===f$.True}clear(){return this._actual.clear()}}var Bi;(function(n){n[n.Invalid=0]="Invalid",n[n.Start=1]="Start",n[n.H=2]="H",n[n.HT=3]="HT",n[n.HTT=4]="HTT",n[n.HTTP=5]="HTTP",n[n.F=6]="F",n[n.FI=7]="FI",n[n.FIL=8]="FIL",n[n.BeforeColon=9]="BeforeColon",n[n.AfterColon=10]="AfterColon",n[n.AlmostThere=11]="AlmostThere",n[n.End=12]="End",n[n.Accept=13]="Accept",n[n.LastKnownState=14]="LastKnownState"})(Bi||(Bi={}));class Gft{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const s=new Gft(i,t,Bi.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Bi.Invalid:this._states.get(e,t)}}let qge=null;function qft(){return qge===null&&(qge=new Jje([[Bi.Start,Q.h,Bi.H],[Bi.Start,Q.H,Bi.H],[Bi.Start,Q.f,Bi.F],[Bi.Start,Q.F,Bi.F],[Bi.H,Q.t,Bi.HT],[Bi.H,Q.T,Bi.HT],[Bi.HT,Q.t,Bi.HTT],[Bi.HT,Q.T,Bi.HTT],[Bi.HTT,Q.p,Bi.HTTP],[Bi.HTT,Q.P,Bi.HTTP],[Bi.HTTP,Q.s,Bi.BeforeColon],[Bi.HTTP,Q.S,Bi.BeforeColon],[Bi.HTTP,Q.Colon,Bi.AfterColon],[Bi.F,Q.i,Bi.FI],[Bi.F,Q.I,Bi.FI],[Bi.FI,Q.l,Bi.FIL],[Bi.FI,Q.L,Bi.FIL],[Bi.FIL,Q.e,Bi.BeforeColon],[Bi.FIL,Q.E,Bi.BeforeColon],[Bi.BeforeColon,Q.Colon,Bi.AfterColon],[Bi.AfterColon,Q.Slash,Bi.AlmostThere],[Bi.AlmostThere,Q.Slash,Bi.End]])),qge}var rc;(function(n){n[n.None=0]="None",n[n.ForceTermination=1]="ForceTermination",n[n.CannotEndIn=2]="CannotEndIn"})(rc||(rc={}));let r5=null;function Qft(){if(r5===null){r5=new pz(rc.None);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),c=t.charCodeAt(r);(a===Q.OpenParen&&c===Q.CloseParen||a===Q.OpenSquareBracket&&c===Q.CloseSquareBracket||a===Q.OpenCurlyBrace&&c===Q.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=qft()){const i=Qft(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),c=a.length;let l=0,d=0,h=0,u=Bi.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}};aae.INSTANCE=new aae;let $ve=aae;var da;(function(n){n[n.Regular=0]="Regular",n[n.Whitespace=1]="Whitespace",n[n.WordSeparator=2]="WordSeparator"})(da||(da={}));class Kft extends pz{constructor(e,t){super(da.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,s=e.length;it)break;i=s}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=vQe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Jft(t,this.wordSeparators?R_(this.wordSeparators,[]):null,i?this.searchString:null)}}function Xje(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===Q.n||s===Q.r||s===Q.W)return!0}}return!1}function wT(n,e,t){if(!t)return new z9(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class yj{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new $B(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,c=0;s?(c=s.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-c;l=a+r.length+f}else l=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(l);return new O(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,xo.LF),c=e.getEOL()===`\r -`?new N2e(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=wT(this._getMultilineMatchRange(e,r,a,c,h.index,h[0]),h,s),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,s,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let l=t.startLineNumber+1;l=c))return o;return o}const d=new $B(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[o++]=wT(new O(i,h.index+1+s,i,h.index+1+h[0].length+s),h,a),o>=c))return o;while(h);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new $B(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new oe(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new O(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),xo.LF),l=e.getEOL()===`\r -`?new N2e(c):null;i.reset(t.column-1);const d=i.next(c);return d?wT(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,s);if(c)return c;for(let l=1;l<=o;l++){const d=(r+l-1)%o,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,s);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new $B(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new O(1,1,t.lineNumber,t.column),i,s,10*Zft);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new oe(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,s);if(c)return c;for(let l=1;l<=o;l++){const d=(o+r-l-1)%o,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,s);if(u)return u}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function ept(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==da.Regular||o===Q.CarriageReturn||o===Q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==da.Regular)return!0}return!1}function tpt(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==da.Regular||o===Q.CarriageReturn||o===Q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==da.Regular)return!0}return!1}function _Me(n,e,t,i,s){return ept(n,e,t,i,s)&&tpt(n,e,t,i,s)}class $B{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){nZ(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||_Me(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class vMe{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new P2e(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${ipt(Array.from(a))}`,"g");const l=new $B(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=s,w=o;v<=w;v++){const b=e.getLineContent(v),C=b.length;l.reset(0);do if(u=l.next(b),u){let y=u.index,S=u.index+u[0].length;if(y>0){const N=b.charCodeAt(y-1);wl(N)&&y--}if(S+1=1e3){h=!0;break e}d.push(new O(v,y+1,v,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new P2e(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Hg.None:return null;case Hg.Invisible:return{kind:Wv.Invisible};case Hg.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=C9.getLocales().filter(c=>!C9.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:Wv.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Hg.NonBasicASCII:return{kind:Wv.NonBasicAscii}}}}function ipt(n,e){return`[${Iu(n.map(i=>String.fromCodePoint(i)).join(""))}]`}var Wv;(function(n){n[n.Ambiguous=0]="Ambiguous",n[n.Invisible=1]="Invisible",n[n.NonBasicAscii=2]="NonBasicAscii"})(Wv||(Wv={}));class P2e{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=C9.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of aM.codePoints)F2e(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return Hg.None;if(this.options.nonBasicASCII)return Hg.NonBasicASCII;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=qq(r);s=s||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!aM.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?Hg.None:this.options.invisibleCharacters&&!F2e(e)&&aM.isInvisibleCharacter(i)?Hg.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Hg.Ambiguous:Hg.None}}function F2e(n){return n===" "||n===` -`||n===" "}var Hg;(function(n){n[n.None=0]="None",n[n.NonBasicASCII=1]="NonBasicASCII",n[n.Invisible=2]="Invisible",n[n.Ambiguous=3]="Ambiguous"})(Hg||(Hg={}));class JY{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Zle{constructor(e,t){this.lineRangeMapping=e,this.changes=t}flip(){return new Zle(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}}class hi{static addRange(e,t){let i=0;for(;it))return new hi(e,t)}static ofLength(e){return new hi(0,e)}static ofStartAndLength(e,t){return new hi(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new cn(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new hi(this.start+e,this.endExclusive+e)}deltaStart(e){return new hi(this.start+e,this.endExclusive)}deltaEnd(e){return new hi(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new cn(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new cn(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){const t=[];for(let i=this.start;ie.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}let bi=class kp{static fromRange(e){return new kp(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new kp(e.startLineNumber,e.endLineNumber+1)}static subtract(e,t){return t?e.startLineNumbert)throw new cn(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=wU(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=vU(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=vU(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new bi(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new h_(t)}subtractFrom(e){const t=bU(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=wU(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new h_([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new bi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}const $m=class $m{static lengthDiffNonNegative(e,t){return t.isLessThan(e)?$m.zero:e.lineCount===t.lineCount?new $m(0,t.columnCount-e.columnCount):new $m(t.lineCount-e.lineCount,t.columnCount)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new $m(0,t.column-e.column):new $m(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return $m.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const s of e)s===` -`?(t++,i=0):i++;return new $m(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new $m(this.lineCount,this.columnCount+e.columnCount):new $m(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new O(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new O(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new O(1,1,this.lineCount+1,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new oe(e.lineNumber,e.column+this.columnCount):new oe(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};$m.zero=new $m(0,0);let gf=$m;class npt{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;to<=e),i=t+1,s=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,s)}getRange(e){return O.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return gf.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new gf(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let WU=class XY{static single(e,t){return new XY([new ug(e,t)])}constructor(e){this.edits=e,fw(()=>gz(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}normalize(){const e=[];for(const t of this.edits)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(t.range.getStartPosition())){const i=e[e.length-1];e[e.length-1]=new ug(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new XY(e)}mapPosition(e){let t=0,i=0,s=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=gf.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?s:0)),d=c.addToPosition(l);return Sj(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?s+=c.columnCount-(a.column-1):s+=c.columnCount-(a.column-r.column):s=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?s:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const s=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return Sj(s,o)}inverseMapPosition(e,t){return this.inverse(t).mapPosition(e)}inverseMapRange(e,t){return this.inverse(t).mapRange(e)}apply(e){let t="",i=new oe(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),c=r.getEndPosition(),l=Sj(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const s=Sj(i,e.endPositionExclusive);return s.isEmpty()||(t+=e.getValueOfRange(s)),t}applyToString(e){const t=new spt(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new XY(this.edits.map((i,s)=>new ug(t[s],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,s=0;for(const o of this.edits){const r=gf.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?s:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,s=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class ug{constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}function Sj(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return O.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new cn("start must be before end");return new O(n.lineNumber,n.column,e.lineNumber,e.column)}class Zje{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class spt extends Zje{constructor(e){super(),this.value=e,this._t=new npt(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let $b=class pB{static inverse(e,t,i){const s=[];let o=1,r=1;for(const c of e){const l=new pB(new bi(o,c.original.startLineNumber),new bi(r,c.modified.startLineNumber));l.modified.isEmpty||s.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new pB(new bi(o,t+1),new bi(r,i+1));return a.modified.isEmpty||s.push(a),s}static clip(e,t,i){const s=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&s.push(new pB(r,a))}return s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new pB(this.modified,this.original)}join(e){return new pB(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new fS(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new cn("not a valid diff");return new fS(new O(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new O(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new fS(new O(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new O(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}},pw=class ZY extends $b{static fromRangeMappings(e){const t=bi.join(e.map(s=>bi.fromRangeInclusive(s.originalRange))),i=bi.join(e.map(s=>bi.fromRangeInclusive(s.modifiedRange)));return new ZY(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new ZY(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new ZY(this.original,this.modified,[this.toRangeMapping()])}},fS=class eKe{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new eKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new ug(this.originalRange,t)}};const opt=3;class rpt{computeDiff(e,t,i){const o=new iKe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const c of o.changes){let l;c.originalEndLineNumber===0?l=new bi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new bi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new bi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new bi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new pw(l,d,c.charChanges?.map(u=>new fS(new O(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new O(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new pw(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return fw(()=>gz(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===Q.LineFeed?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===Q.LineFeed?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===Q.LineFeed?1:this._columns[e]+1)}}class xW{constructor(e,t,i,s,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),c=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new xW(s,o,r,a,c,l,d,h)}}function cpt(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),p=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=tKe(f,p,o,!0).changes;a&&(m=cpt(m)),u=[];for(let v=0,w=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),w=f.charCodeAt(m-2);if(v!==w)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,p,r+1,1,m)}{let p=qve(u,1),m=qve(f,1);const v=u.length+1,w=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(ml.fromOffsetPairs(s?s.getEndExclusives():wE.zero,o?o.getStarts():new wE(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new ml(new hi(e.offset1,t.offset1),new hi(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new ml(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new ml(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new ml(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new ml(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new ml(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new ml(t,i)}getStarts(){return new wE(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new wE(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const JT=class JT{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new JT(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};JT.zero=new JT(0,0),JT.max=new JT(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let wE=JT;const cae=class cae{isValid(){return!0}};cae.instance=new cae;let $9=cae;class lpt{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new cn("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class jge{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function Qve(n){return n===Q.Space||n===Q.Tab}const G8=class G8{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let s=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(b+=a.get(p-1,m-1)),b+=s?s(p,m):1):b=-1;const C=Math.max(v,w,b);if(C===b){const y=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,y+1),r.set(p,m,3)}else C===v?(a.set(p,m,0),r.set(p,m,1)):C===w&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,C)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new ml(new hi(p+1,l),new hi(m+1,d))),l=p,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),c.reverse(),new cx(c,!1)}}class nKe{compute(e,t,i=$9.instance){if(e.length===0||t.length===0)return cx.trivial(e,t);const s=e,o=t;function r(m,v){for(;ms.length||y>o.length)continue;const S=r(C,y);c.set(d,S);const M=C===w?l.get(d+1):l.get(d-1);if(l.set(d,S!==C?new W2e(M,C,y,S-C):M),c.get(d)===s.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=s.length,p=o.length;for(;;){const m=h?h.x+h.length:0,v=h?h.y+h.length:0;if((m!==f||v!==p)&&u.push(new ml(new hi(m,f),new hi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new cx(u,!1)}}class W2e{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class hpt{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class upt{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class kZ{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new hi(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=U2e(e>0?this.elements[e-1]:-1),i=U2e(ei<=e);return new oe(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return O.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!Kge(this.elements[e]))return;let t=e;for(;t>0&&Kge(this.elements[t-1]);)t--;let i=e;for(;is<=e.start)??0,i=xct(this.firstCharOffsetByLine,s=>e.endExclusive<=s)??this.elements.length;return new hi(t,i)}}function Kge(n){return n>=Q.a&&n<=Q.z||n>=Q.A&&n<=Q.Z||n>=Q.Digit0&&n<=Q.Digit9}var zc;(function(n){n[n.WordLower=0]="WordLower",n[n.WordUpper=1]="WordUpper",n[n.WordNumber=2]="WordNumber",n[n.End=3]="End",n[n.Other=4]="Other",n[n.Separator=5]="Separator",n[n.Space=6]="Space",n[n.LineBreakCR=7]="LineBreakCR",n[n.LineBreakLF=8]="LineBreakLF"})(zc||(zc={}));const gpt={[zc.WordLower]:0,[zc.WordUpper]:0,[zc.WordNumber]:0,[zc.End]:10,[zc.Other]:2,[zc.Separator]:30,[zc.Space]:3,[zc.LineBreakCR]:10,[zc.LineBreakLF]:10};function H2e(n){return gpt[n]}function U2e(n){return n===Q.LineFeed?zc.LineBreakLF:n===Q.CarriageReturn?zc.LineBreakCR:Qve(n)?zc.Space:n>=Q.a&&n<=Q.z?zc.WordLower:n>=Q.A&&n<=Q.Z?zc.WordUpper:n>=Q.Digit0&&n<=Q.Digit9?zc.WordNumber:n===-1?zc.End:n===Q.Comma||n===Q.Semicolon?zc.Separator:zc.Other}function fpt(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=mpt(n,e,t,o);if(!o.isValid())return[];const c=n.filter(d=>!a.has(d)),l=_pt(c,i,s,e,t,o);return u_e(r,l),r=vpt(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` -`).length>=15&&ppt(h,f=>f.length>=2)>=2}),r=wpt(n,r),r}function ppt(n,e){let t=0;for(const i of n)e(i)&&t++;return t}function mpt(n,e,t,i){const s=[],o=n.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new DZ(c.original,e,c)),r=new Set(n.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new DZ(c.modified,t,c))),a=new Set;for(const c of o){let l=-1,d;for(const h of r){const u=c.computeSimilarity(h);u>l&&(l=u,d=h)}if(l>.9&&d&&(r.delete(d),s.push(new $b(c.range,d.range)),a.add(c.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function _pt(n,e,t,i,s,o){const r=[],a=new Vq;for(const u of n)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,cg));for(const u of n){let f=[];for(let p=u.modified.startLineNumber;p{for(const y of f)if(y.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){y.originalLineRange=new bi(y.originalLineRange.startLineNumber,b.endLineNumberExclusive),y.modifiedLineRange=new bi(y.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),w.push(y);return}const C={modifiedLineRange:v,originalLineRange:b};c.push(C),w.push(C)}),f=w}if(!o.isValid())return[]}c.sort(Kqe(El(u=>u.modifiedLineRange.length,cg)));const l=new h_,d=new h_;for(const u of c){const f=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,p=l.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(f),v=p.getIntersection(m);for(const w of v.ranges){if(w.length<3)continue;const b=w,C=w.delta(-f);r.push(new $b(C,b)),l.addRange(b),d.addRange(C)}}r.sort(El(u=>u.original.startLineNumber,cg));const h=new jX(n);for(let u=0;uM.original.startLineNumber<=f.original.startLineNumber),m=vU(n,M=>M.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-p.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),w=h.findLastMonotonous(M=>M.original.startLineNumberM.modified.startLineNumberi.length||k>s.length||l.contains(k)||d.contains(M)||!V2e(i[M-1],s[k-1],o))break}y>0&&(d.addRange(new bi(f.original.startLineNumber-y,f.original.startLineNumber)),l.addRange(new bi(f.modified.startLineNumber-y,f.modified.startLineNumber)));let S;for(S=0;Si.length||k>s.length||l.contains(k)||d.contains(M)||!V2e(i[M-1],s[k-1],o))break}S>0&&(d.addRange(new bi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),l.addRange(new bi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(y>0||S>0)&&(r[u]=new $b(new bi(f.original.startLineNumber-y,f.original.endLineNumberExclusive+S),new bi(f.modified.startLineNumber-y,f.modified.endLineNumberExclusive+S)))}return r}function V2e(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new nKe().compute(new kZ([n],new hi(0,1),!1),new kZ([e],new hi(0,1),!1),t);let o=0;const r=ml.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(h=>{Qve(n.charCodeAt(h))||o++});function a(d){let h=0;for(let u=0;ue.length?n:e);return o/c>.6&&c>10}function vpt(n){if(n.length===0)return n;n.sort(El(t=>t.original.startLineNumber,cg));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function wpt(n,e){const t=new jX(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(l))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function bpt(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+al&&(l=p,c=d)}return n.delta(c)}function Cpt(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new ml(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function ypt(n,e,t){const i=ml.invert(t,n.length),s=[];let o=new wE(0,0);function r(c,l){if(c.offset10;){const v=i[0];if(!(v.seq1Range.intersects(u.seq1Range)||v.seq2Range.intersects(u.seq2Range)))break;const b=n.findWordContaining(v.seq1Range.start),C=e.findWordContaining(v.seq2Range.start),y=new ml(b,C),S=y.intersect(v);if(p+=S.seq1Range.length,m+=S.seq2Range.length,u=u.join(y),u.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}p+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&s.push(u),o=u.getEndExclusives()}for(;i.length>0;){const c=i.shift();c.seq1Range.isEmpty||(r(c.getStarts(),c),r(c.getEndExclusives().delta(-1),c))}return Spt(t,s)}function Spt(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function Apt(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const c=i[a],l=r[r.length-1];d(l,c)?(o=!0,r[r.length-1]=r[r.length-1].join(c)):r.push(c)}i=r}while(s++<10&&o);return i}function Ept(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let c=1;c5||m.length>500)return!1;const w=n.getText(m).trim();if(w.length>20||w.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),C=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),S=f.seq2Range.length,M=n.countLinesIn(p.seq1Range),k=p.seq1Range.length,F=e.countLinesIn(p.seq2Range),N=p.seq2Range.length,z=2*40+50;function U(J){return Math.min(J,z)}return Math.pow(Math.pow(U(b*40+C),1.5)+Math.pow(U(y*40+S),1.5),1.5)+Math.pow(Math.pow(U(M*40+k),1.5)+Math.pow(U(F*40+N),1.5),1.5)>(z**1.5)**1.5*1.3};const l=i[c],d=a[a.length-1];h(d,l)?(o=!0,a[a.length-1]=a[a.length-1].join(l)):a.push(l)}i=a}while(s++<10&&o);const r=[];return Nct(i,(a,c,l)=>{let d=c;function h(w){return w.length>0&&w.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const u=n.extendToFullLines(c.seq1Range),f=n.getText(new hi(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=n.getText(new hi(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=ml.fromOffsetPairs(a?a.getEndExclusives():wE.zero,l?l.getStarts():wE.max),v=d.intersect(m);r.length>0&&v.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(v):r.push(v)}),r}class G2e{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:q2e(this.lines[e-1]),i=e===this.lines.length?0:q2e(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function q2e(n){let e=0;for(;eS===M))return new JY([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new JY([new pw(new bi(1,e.length+1),new bi(1,t.length+1),[new fS(new O(1,1,e.length,e[e.length-1].length+1),new O(1,1,t.length,t[t.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?$9.instance:new lpt(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let M=r.get(S);return M===void 0&&(M=r.size,r.set(S,M)),M}const c=e.map(S=>a(S.trim())),l=t.map(S=>a(S.trim())),d=new G2e(c,e),h=new G2e(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,s,(S,M)=>e[S]===t[M]?t[M].length===0?.1:1+Math.log(1+t[M].length):.99):this.myersDiffingAlgorithm.compute(d,h,s);let f=u.diffs,p=u.hitTimeout;f=jve(d,h,f),f=Apt(d,h,f);const m=[],v=S=>{if(o)for(let M=0;MS.seq1Range.start-w===S.seq2Range.start-b);const M=S.seq1Range.start-w;v(M),w=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const k=this.refineDiff(e,t,S,s,o);k.hitTimeout&&(p=!0);for(const F of k.mappings)m.push(F)}v(e.length-w);const C=Q2e(m,e,t);let y=[];return i.computeMoves&&(y=this.computeMoves(C,e,t,c,l,s,o)),fw(()=>{function S(k,F){if(k.lineNumber<1||k.lineNumber>F.length)return!1;const N=F[k.lineNumber-1];return!(k.column<1||k.column>N.length+1)}function M(k,F){return!(k.startLineNumber<1||k.startLineNumber>F.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>F.length+1)}for(const k of C){if(!k.innerChanges)return!1;for(const F of k.innerChanges)if(!(S(F.modifiedRange.getStartPosition(),t)&&S(F.modifiedRange.getEndPosition(),t)&&S(F.originalRange.getStartPosition(),e)&&S(F.originalRange.getEndPosition(),e)))return!1;if(!M(k.modified,t)||!M(k.original,e))return!1}return!0}),new JY(C,y,p)}computeMoves(e,t,i,s,o,r,a){return fpt(e,t,i,s,o,r).map(d=>{const h=this.refineDiff(t,i,new ml(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=Q2e(h.mappings,t,i,!0);return new Zle(d,u)})}refineDiff(e,t,i,s,o){const r=new kZ(e,i.seq1Range,o),a=new kZ(t,i.seq2Range,o),c=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let l=c.diffs;return l=jve(r,a,l),l=ypt(r,a,l),l=Cpt(r,a,l),l=Ept(r,a,l),{mappings:l.map(h=>new fS(r.translateRange(h.seq1Range),a.translateRange(h.seq2Range))),hitTimeout:c.hitTimeout}}}function Q2e(n,e,t,i=!1){const s=[];for(const o of PRe(n.map(r=>xpt(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new pw(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return fw(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||t.length-s[s.length-1].modified.endLineNumberExclusive!==e.length-s[s.length-1].original.endLineNumberExclusive)?!1:gz(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new bi(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new bi(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new pw(o,r,[n])}const Yge={getLegacy:()=>new rpt,getDefault:()=>new sKe};function LI(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class gn{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Av{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.l=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let c=0,l=0;const d=(a+r)/2,h=r-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),r){case t:c=(i-s)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,c;if(i===0)r=a=c=s;else{const l=s<.5?s*(1+i):s+i-s*i,d=2*s-l;r=Av._hue2rgb(d,l,t+1/3),a=Av._hue2rgb(d,l,t),c=Av._hue2rgb(d,l,t-1/3)}return new gn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class Ky{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.v=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-s)/a%6+6)%6:o===i?l=(s-t)/a+2:l=(t-i)/a+4,new Ky(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),c=s-r;let[l,d,h]=[0,0,0];return t<60?(l=r,d=a):t<120?(l=a,d=r):t<180?(d=r,h=a):t<240?(d=a,h=r):t<300?(l=a,h=r):t<=360&&(l=r,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new gn(l,d,h,o)}}var Fo;let fe=(Fo=class{static fromHex(e){return Fo.Format.CSS.parseHex(e)||Fo.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Av.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Ky.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof gn)this.rgba=e;else if(e instanceof Av)this._hsla=e,this.rgba=Av.toRGBA(e);else if(e instanceof Ky)this._hsva=e,this.rgba=Ky.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&gn.equals(this.rgba,e.rgba)&&Av.equals(this.hsla,e.hsla)&&Ky.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Fo._relativeLuminanceForComponent(this.rgba.r),t=Fo._relativeLuminanceForComponent(this.rgba.g),i=Fo._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return LI(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}getContrastRatio(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return tFo._flatten(s,i));return Fo._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new Fo(new gn(i*t.rgba.r+e.rgba.a*e.rgba.r,i*t.rgba.g+e.rgba.a*e.rgba.g,i*t.rgba.b+e.rgba.a*e.rgba.b))}toString(){return this._toString||(this._toString=Fo.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-s)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(s-o)/s,e.darken(i)}},Fo.white=new Fo(new gn(255,255,255,1)),Fo.black=new Fo(new gn(0,0,0,1)),Fo.red=new Fo(new gn(255,0,0,1)),Fo.blue=new Fo(new gn(0,0,255,1)),Fo.green=new Fo(new gn(0,255,0,1)),Fo.cyan=new Fo(new gn(0,255,255,1)),Fo.lightgrey=new Fo(new gn(211,211,211,1)),Fo.transparent=new Fo(new gn(0,0,0,0)),Fo);(function(n){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:n.Format.CSS.formatRGBA(f)}t.formatRGB=i;function s(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=s;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(f)}t.formatHSL=o;function r(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(f){const p=f.toString(16);return p.length!==2?"0"+p:p}function c(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=c;function l(f,p=!1){return p&&f.rgba.a===1?n.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=l;function d(f){return f.isOpaque()?n.Format.CSS.formatHex(f):n.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==Q.Hash)return null;if(p===7){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new n(new gn(m,v,w,1))}if(p===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),b=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new n(new gn(m,v,w,b/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3));return new n(new gn(16*m+m,16*v+v,16*w+w))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3)),b=u(f.charCodeAt(4));return new n(new gn(16*m+m,16*v+v,16*w+w,(16*b+b)/255))}return null}t.parseHex=h;function u(f){switch(f){case Q.Digit0:return 0;case Q.Digit1:return 1;case Q.Digit2:return 2;case Q.Digit3:return 3;case Q.Digit4:return 4;case Q.Digit5:return 5;case Q.Digit6:return 6;case Q.Digit7:return 7;case Q.Digit8:return 8;case Q.Digit9:return 9;case Q.a:return 10;case Q.A:return 10;case Q.b:return 11;case Q.B:return 11;case Q.c:return 12;case Q.C:return 12;case Q.d:return 13;case Q.D:return 13;case Q.e:return 14;case Q.E:return 14;case Q.f:return 15;case Q.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(fe||(fe={}));function oKe(n){const e=[];for(const t of n){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function bMe(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function a5(n,e){const t=e.index,i=e[0].length;if(!t)return;const s=n.positionAt(t);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+i}}function Dpt(n,e){if(!n)return;const t=fe.Format.CSS.parseHex(e);if(t)return{range:n,color:bMe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function j2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s);return{range:n,color:bMe(o[0],o[1],o[2],t?o[3]:1)}}function K2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s),r=new fe(new Av(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:bMe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function c5(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function kpt(n){const e=[],i=c5(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const s of i){const o=s.filter(l=>l!==void 0),r=o[1],a=o[2];if(!a)continue;let c;if(r==="rgb"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!1)}else if(r==="rgba"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!0)}else if(r==="hsl"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!1)}else if(r==="hsla"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!0)}else r==="#"&&(c=Dpt(a5(n,s),r+a));c&&e.push(c)}return e}function Ipt(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:kpt(n)}const Y2e=new RegExp("\\bMARK:\\s*(.*)$","d"),Lpt=/^-+|-+$/g;function Tpt(n,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=Rpt(n,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=Mpt(n);t=t.concat(i)}return t}function Rpt(n,e){const t=[],i=n.getLineCount();for(let s=1;s<=i;s++){const o=n.getLineContent(s),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:s,startColumn:r[0].length+1,endLineNumber:s,endColumn:o.length+1};if(a.endColumn>a.startColumn){const c={range:a,...rKe(o.substring(r[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function Mpt(n){const e=[],t=n.getLineCount();for(let i=1;i<=t;i++){const s=n.getLineContent(i);Npt(s,i,e)}return e}function Npt(n,e,t){Y2e.lastIndex=0;const i=Y2e.exec(n);if(i){const s=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:s,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...rKe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function rKe(n){n=n.trim();const e=n.startsWith("-");return n=n.replace(Lpt,""),{text:n,hasSeparatorLine:e}}class Ppt extends Yje{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}const dk=class dk{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new Ppt(P.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const s=this._getModel(e);return s?vMe.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Tpt(i,t):[]}async computeDiff(e,t,i,s){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:dk.computeDiff(o,r,i,s)}static computeDiff(e,t,i,s){const o=s==="advanced"?Yge.getDefault():Yge.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),c=o.computeDiff(r,a,i),l=c.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])])}return{identical:l,quitEarly:c.hitTimeout,changes:d(c.changes),moves:c.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const s=this._getModel(e),o=this._getModel(t);if(!s||!o)return null;const r=s.getLinesContent(),a=o.getLinesContent();return new iKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return O.compareRangesUsingStarts(c.range,l.range);const d=c.range?0:1,h=l.range?0:1;return d-h});let a=0;for(let c=1;cdk._diffLimit){o.push({range:c,text:l});continue}const u=Vft(h,l,i),f=s.offsetAt(O.lift(c).getStartPosition());for(const p of u){const m=s.positionAt(f+p.originalStart),v=s.positionAt(f+p.originalStart+p.originalLength),w={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};s.getValueInRange(w.range)!==w.text&&o.push(w)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return O.compareRangesUsingStarts(a.range,c.range);const l=a.range?0:1,d=c.range?0:1;return l-d});for(let{range:a,text:c,eol:l}of t){let m=function(w,b){return new oe(w.lineNumber+b.lineNumber-1,b.lineNumber===1?w.column+b.column-1:b.column)},v=function(w,b){const C=[];for(let y=b.startLineNumber;y<=b.endLineNumber;y++){const S=w[y-1];y===b.startLineNumber&&y===b.endLineNumber?C.push(S.substring(b.startColumn-1,b.endColumn-1)):y===b.startLineNumber?C.push(S.substring(b.startColumn-1)):y===b.endLineNumber?C.push(S.substring(0,b.endColumn-1)):C.push(S)}return C};if(typeof l=="number"&&(r=l),O.isEmpty(a)&&!c)continue;const d=s.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,s.eol),d===c)continue;if(Math.max(c.length,d.length)>dk._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Yge.getDefault().computeDiff(h,u,i),p=O.lift(a).getStartPosition();for(const w of f.changes)if(w.innerChanges)for(const b of w.innerChanges)o.push({range:O.fromPositions(m(p,b.originalRange.getStartPosition()),m(p,b.originalRange.getEndPosition())),text:v(u,b.modifiedRange).join(s.eol)});else throw new cn("The experimental diff algorithm always produces inner changes")}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?jft(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Ipt(t):null}async textualSuggest(e,t,i,s){const o=new ao,r=new RegExp(i,s),a=new Set;e:for(const c of e){const l=this._getModel(c);if(l){for(const d of l.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>dk._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,s){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let c=t.startLineNumber;cthis._host.fhr(a,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(BRe(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}};dk._diffLimit=1e5,dk._suggestionsLimit=1e4;let IZ=dk;typeof importScripts=="function"&&(globalThis.monaco=WQe());const dl=ae("textResourceConfigurationService"),CMe=ae("textResourcePropertiesService"),ht=ae("ILanguageFeaturesService"),J2e=60*1e3,X2e=5*60*1e3;function FC(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Kve=class extends ${constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new Opt(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>FC(this._modelService,r.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(r.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new Fpt(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return FC(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,s){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Zle(new $b(new bi(c[0],c[1]),new bi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new pw(new bi(l[0],l[1]),new bi(l[2],l[3]),l[4]?.map(d=>new fS(new O(d[0],d[1],d[2],d[3]),new O(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return FC(this._modelService,e)&&FC(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(s=>s.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const s=ao.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,Ta(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const i=ao.create(),s=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(bt(o),this.computeMoreMinimalEdits(e,t,!0)));return s.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),s}else return Promise.resolve(void 0)}canNavigateValueSet(e){return FC(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return FC(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};Kve=D([_(0,Ai),_(1,dl),_(2,Ze),_(3,lo),_(4,ht)],Kve);class Fpt{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const s=[];if(i.wordBasedSuggestions==="currentDocument")FC(this._modelService,e.uri)&&s.push(e.uri);else for(const h of this._modelService.getModels())FC(this._modelService,h.uri)&&(h===e?s.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&s.push(h.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new O(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):O.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(s,r?.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Ne.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class Opt extends ${constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new sQ).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(X2e/2),yi),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>X2e&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new yMe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Bpt extends ${constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new nQ;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(J2e/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)St(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>J2e&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Z;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],St(t)}}class Z2e{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Jge{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class yMe extends ${constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Fve(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Wgt(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Jge(this)))}catch(e){Pve(e),this._worker=new Z2e(new IZ(new Jge(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Pve(e),this._worker=new Z2e(new IZ(new Jge(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Bpt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(rx()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(s=>s.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeHumanReadableDiff(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const s=await this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,c=r.flags;return s.navigateValueSet(e.toString(),t,i,a,c)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function Wpt(n,e,t){return new Hpt(n,e,t)}class Hpt extends yMe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?BRe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,c)=>e.fmr(a,c),o=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var vt;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(vt||(vt={}));function Upt(n){return n&&typeof n.id=="string"}const mz={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Uc;(function(n){n.CompositionStart="compositionStart",n.CompositionEnd="compositionEnd",n.Type="type",n.ReplacePreviousChar="replacePreviousChar",n.CompositionType="compositionType",n.Paste="paste",n.Cut="cut"})(Uc||(Uc={}));const G9=new class{clone(){return this}equals(n){return this===n}};function aKe(n,e){return new iMe([new A9(0,"",n)],e)}function SMe(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<$i.LANGUAGEID_OFFSET|Ar.Other<<$i.TOKEN_TYPE_OFFSET|ar.None<<$i.FONT_STYLE_OFFSET|Ad.DefaultForeground<<$i.FOREGROUND_OFFSET|Ad.DefaultBackground<<$i.BACKGROUND_OFFSET)>>>0,new $le(t,e===null?G9:e)}const PA=class PA{static createEmpty(e,t){const i=PA.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new PA(s,e,t)}static createFromTextAndMetadata(e,t){let i=0,s="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,s+=r;return new PA(new Uint32Array(o),s,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof PA?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Xf.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Xf.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Xf.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Xf.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Xf.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Xf.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PA.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new AMe(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(s.length,l),r=c.offset}s+=c.text,o.push(s.length,c.tokenMetadata),i++}else break}return new PA(new Uint32Array(o),s,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;let lh=PA;class AMe{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof AMe?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),s=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(s-this._endOffset))),o}forEach(e){for(let t=0;tt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ls(e.data,t.data)}static equalsArr(e,t){return Ls(e,t,q9.equals)}}class ig{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[c++]=new ig(Math.max(1,l.startColumn-s+1),Math.min(r+1,l.endColumn-s+1),l.className,l.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Mc.Regular||l.type===Mc.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:s;o[r++]=new ig(h,u,l.inlineClassName,l.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ig._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class Gpt{static normalize(e,t){if(t.length===0)return[];const i=[],s=new LZ;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);wl(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);wl(m)&&d--}const f=l-1,p=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(p,h,u)}return s.consumeLowerThan(Zn.MAX_SAFE_SMALL_INTEGER,o,i),i}}const lKe="vs/editor/common/viewLayout/viewLineRenderer";var rm;(function(n){n[n.None=0]="None",n[n.Boundary=1]="Boundary",n[n.Selection=2]="Selection",n[n.Trailing=3]="Trailing",n[n.All=4]="All"})(rm||(rm={}));let dKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class tL{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(ig.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?rm.All:v==="boundary"?rm.Boundary:v==="selection"?rm.Selection:v==="trailing"?rm.Trailing:rm.None,this.renderControlCharacters=w,this.fontLigatures=b,this.selectionsOnLine=C&&C.sort((M,k)=>M.startOffset>>OC.PART_INDEX_OFFSET}static getCharIndex(e){return(e&OC.CHAR_INDEX_MASK)>>>OC.CHAR_INDEX_OFFSET}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=mv.getPartIndex(t),s=mv.getCharIndex(t);return new hKe(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===s)return m;v>s?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===s)return o;if(c===s)return r;const l=mv.getPartIndex(a),d=mv.getCharIndex(a),h=mv.getPartIndex(c);let u;l!==h?u=t:u=mv.getCharIndex(c);const f=i-d,p=u-i;return f<=p?o:r}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,s=nf.None;for(const r of n.lineDecorations)(r.type===Mc.Before||r.type===Mc.After)&&(e.appendString(''),r.type===Mc.Before&&(s|=nf.Before,t++),r.type===Mc.After&&(s|=nf.After,i++));e.appendString("");const o=new mv(1,t+i);return o.setColumnInfo(1,t,0,0),new Yve(o,!1,s)}return e.appendString(""),new Yve(new mv(0,0),!1,nf.None)}return emt(jpt(n),e)}class qpt{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function ede(n){const e=new fz(1e4),t=lQ(n,e);return new qpt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Qpt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=c,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=u,this.spaceWidth=f,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=v}}function jpt(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,c=n.lineDecorations.length;a0&&(o[r++]=new Xl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=s){const f=e?DU(n.substring(a,s)):!1;o[r++]=new Xl(s,h,0,f);break}const u=e?DU(n.substring(a,d)):!1;o[r++]=new Xl(d,h,0,u),a=d}return o}var bT;(function(n){n[n.LongToken=50]="LongToken"})(bT||(bT={}));function Ypt(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=bT.LongToken&&(s[o++]=new Xl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(s[o++]=new Xl(l,d,h,u))}else s[o++]=c;i=l}else for(let r=0,a=e.length;rbT.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/bT.LongToken);for(let m=1;m=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Jpt(n,e){const t=[];let i=new Xl(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new Xl(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Xl(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new Xl(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Xpt(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,c=n.useMonospaceOptimizations,l=n.selectionsOnLine,d=n.renderWhitespace===rm.Boundary,h=n.renderWhitespace===rm.Trailing,u=n.renderSpaceWidth!==n.spaceWidth,f=[];let p=0,m=0,v=i[m].type,w=i[m].containsRTL,b=i[m].endIndex;const C=i.length;let y=!1,S=Eu(e),M;S===-1?(y=!0,S=t,M=t):M=Zv(e);let k=!1,F=0,N=l&&l[F],z=a%r;for(let J=o;J=N.endOffset&&(F++,N=l&&l[F]);let re;if(JM)re=!0;else if(j===Q.Tab)re=!0;else if(j===Q.Space)if(d)if(k)re=!0;else{const me=J+1J),re&&h&&(re=y||J>M),re&&w&&J>=S&&J<=M&&(re=!1),k){if(!re||!c&&z>=r){if(u){const me=p>0?f[p-1].endIndex:o;for(let De=me+1;De<=J;De++)f[p++]=new Xl(De,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(J,"mtkw",Yy.IS_WHITESPACE,!1);z=z%r}}else(J===b||re&&J>o)&&(f[p++]=new Xl(J,v,0,w),z=z%r);for(j===Q.Tab?z=r:c1(j)?z+=2:z++,k=re;J===b&&(m++,m0?e.charCodeAt(t-1):Q.Null,j=t>1?e.charCodeAt(t-2):Q.Null;J===Q.Space&&j!==Q.Space&&j!==Q.Tab||(U=!0)}else U=!0;if(U)if(u){const J=p>0?f[p-1].endIndex:o;for(let j=J+1;j<=t;j++)f[p++]=new Xl(j,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(t,"mtkw",Yy.IS_WHITESPACE,!1);else f[p++]=new Xl(t,v,0,w);return f}function Zpt(n,e,t,i){i.sort(ig.compare);const s=Gpt.normalize(n,i),o=s.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=b.startOffset,a[c++]=new Xl(l,m,v,w)),b.endOffset+1<=p)l=b.endOffset+1,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w),r++;else{l=p,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w);break}}p>l&&(l=p,a[c++]=new Xl(l,m,v,w))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let N=0,z=l.length;N=d&&(wt+=Ji)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*Tt)),e.appendString('px"')),e.appendASCIICharCode(Q.GreaterThan);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ji=2;Ji<=Nt;Ji++)e.appendCharCode(160)}else wt=2,Nt=1,e.appendCharCode(m),e.appendCharCode(8204);M+=wt,k+=Nt,y>=d&&(S+=Nt)}}else for(e.appendASCIICharCode(Q.GreaterThan);y=d&&(S+=wt)}Qe?F++:F=0,y>=r&&!C&&U.isPseudoAfter()&&(C=!0,b.setColumnInfo(y+1,N,M,k)),e.appendString("")}return C||b.setColumnInfo(r+1,l.length-1,M,k),a&&(e.appendString(''),e.appendString(g(lKe,0,"Show more ({0})",imt(c))),e.appendString("")),e.appendString(""),new Yve(b,f,s)}function tmt(n){return n.toString(16).toUpperCase().padStart(4,"0")}function imt(n){return n<1024?g(lKe,1,"{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}var nmt=".monaco-aria-container{left:-999em;position:absolute}";Ct(nmt,{});const iWe=2e4;let CT,eJ,Jve,tJ,Xve;function smt(n){CT=document.createElement("div"),CT.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};eJ=e(),Jve=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};tJ=t(),Xve=t(),n.appendChild(CT)}function sa(n){CT&&(eJ.textContent!==n?(Yo(Jve),TZ(eJ,n)):(Yo(eJ),TZ(Jve,n)))}function Cu(n){CT&&(tJ.textContent!==n?(Yo(Xve),TZ(tJ,n)):(Yo(tJ),TZ(Xve,n)))}function TZ(n,e){Yo(n),e.length>iWe&&(e=e.substr(0,iWe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const xMe=ae("markerDecorationsService");var uH;let RZ=(uH=class{constructor(e,t){}dispose(){}},uH.ID="editor.contrib.markerDecorations",uH);RZ=D([_(1,xMe)],RZ);vn(RZ.ID,RZ,mi.Eager);var omt='::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);overflow:visible;position:relative}.monaco-editor,.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);border:1px solid var(--vscode-editor-rangeHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);border:1px solid var(--vscode-editor-symbolHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{overflow:hidden;position:relative}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .margin-view-overlays>div,.monaco-editor .view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{background:var(--vscode-editorError-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{background:var(--vscode-editorWarning-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{background:var(--vscode-editorInfo-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground,inherit)}';Ct(omt,{});class gKe extends ${constructor(e,t){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{xd(gt(this._referenceDomElement),()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}const O2=class O2{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=O2._read(e,this.key),i=o=>O2._read(e,o),s=(o,r)=>O2._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}};O2.items=[];let Q9=O2;function uC(n,e){Q9.items.push(new Q9(n,e))}function bp(n,e){uC(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function rmt(n){Q9.items.forEach(e=>e.apply(n))}bp("wordWrap",[[!0,"on"],[!1,"off"]]);bp("lineNumbers",[[!0,"on"],[!1,"off"]]);bp("cursorBlinking",[["visible","solid"]]);bp("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);bp("renderLineHighlight",[[!0,"line"],[!1,"none"]]);bp("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);bp("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);bp("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("autoIndent",[[!1,"advanced"],[!0,"full"]]);bp("matchBrackets",[[!0,"always"],[!1,"never"]]);bp("renderFinalNewline",[[!0,"on"],[!1,"off"]]);bp("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);bp("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);bp("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);uC("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});uC("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});uC("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const amt={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};uC("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(amt))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});uC("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});uC("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});uC("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});uC("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1;const s={};for(const o of Object.entries(n))typeof o[1]=="boolean"?(i=!0,s[o[0]]=o[1]?"explicit":"never"):s[o[0]]=o[1];i&&t("codeActionsOnSave",s)}});uC("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});uC("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});class cmt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new I,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const g1=new cmt,Ur=ae("accessibilityService");let Zve=class extends ${constructor(e,t,i,s,o,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new I),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new IQe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new gKe(o,s.dimension)),this._targetWindowId=gt(o).vscodeWindowId,this._rawOptions=nWe(s),this._validatedOptions=oE.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(d_.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(g1.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Mve.onDidChange(()=>this._recomputeOptions())),this._register(B9.getInstance(gt(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=oE.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Wk.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:g1.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return oE.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:dmt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:dM||pp,pixelRatio:B9.getInstance(vZ(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Kd.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Mve.readFontInfo(vZ(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=nWe(e);oE.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=oE.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=lmt(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};Zve=D([_(5,Ur)],Zve);function lmt(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function dmt(n){let e="";return!TS&&!HQe&&(e+="no-user-select "),TS&&(e+="no-minimap-shadow ",e+="enable-user-select "),ei&&(e+="mac "),n&&(e+="standalone "),e}class hmt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class umt{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class oE{static validateOptions(e){const t=new hmt;for(const i of HB){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new umt;for(const s of HB)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ls(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!oE._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of HB){const r=!oE._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new kQe(i):null}static applyUpdate(e,t){let i=!1;for(const s of HB)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function nWe(n){const e=Vs(n);return rmt(e),e}var Hk;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},s={...e};let o=0,r;(function(F){F[F.Before=0]="Before",F[F.InProgress=1]="InProgress",F[F.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){b(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}n.onKeyDown=c;function l(){a.keydown===r.InProgress&&(performance.mark("keydown/end"),a.keydown=r.Finished)}function d(){performance.mark("input/start"),a.input=r.InProgress,w()}n.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}n.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){b()}n.onKeyUp=f;function p(){b()}n.onSelectionChange=p;function m(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Before&&(performance.mark("render/start"),a.render=r.InProgress,queueMicrotask(v),w())}n.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function w(){setTimeout(b)}function b(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Finished&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),C("keydown",e),C("input",t),C("render",i),C("inputlatency",s),o++,y())}function C(F,N){const z=performance.getEntriesByName(F)[0].duration;N.total+=z,N.min=Math.min(N.min,z),N.max=Math.max(N.max,z)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),a.keydown=r.Before,a.input=r.Before,a.render=r.Before}function S(){if(o===0)return;const F={keydown:M(e),input:M(t),render:M(i),total:M(s),sampleCount:o};return k(e),k(t),k(i),k(s),o=0,F}n.getAndClearMeasurements=S;function M(F){return{average:F.total/o,max:F.max,min:F.min}}function k(F){F.total=0,F.min=Number.MAX_VALUE,F.max=0}})(Hk||(Hk={}));var hs;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(hs||(hs={}));var Yf;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(Yf||(Yf={}));var Mt;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Mt||(Mt={}));function Ka(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.ICodeEditor:!1}function ew(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.IDiffEditor:!1}function HU(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function _z(n){return Ka(n)?n:ew(n)?n.getModifiedEditor():HU(n)&&Ka(n.activeCodeEditor)?n.activeCodeEditor:null}function gmt(n){return Ka(n)||ew(n)?n:null}class vz{constructor(){this._hooks=new Z,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=gt(e)}this._hooks.add(pe(r,xe.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(pe(r,xe.POINTER_UP,a=>this.stopMonitoring(!0)))}}function tde(n){return`--vscode-${n.replace(/\./g,"-")}`}function Ye(n){return`var(${tde(n)})`}function ewe(n,e){return`var(${tde(n)}, ${e})`}var zg;(function(n){n[n.Darken=0]="Darken",n[n.Lighten=1]="Lighten",n[n.Transparent=2]="Transparent",n[n.Opaque=3]="Opaque",n[n.OneOf=4]="OneOf",n[n.LessProminent=5]="LessProminent",n[n.IfDefinedThenElse=6]="IfDefinedThenElse"})(zg||(zg={}));const DMe={ColorContribution:"base.contributions.colors"};class fmt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),s&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}deregisterColor(e){delete this.colorsById[e],delete this.colorSchema.properties[e];const t=this.colorReferenceSchema.enum.indexOf(e);t!==-1&&(this.colorReferenceSchema.enum.splice(t,1),this.colorReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChangeSchema.fire()}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return iv(s,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const ide=new fmt;it.add(DMe.ColorContribution,ide);function B(n,e,t,i,s){return ide.registerColor(n,e,t,i,s)}function pmt(n,e){switch(n.op){case zg.Darken:return iv(n.value,e)?.darken(n.factor);case zg.Lighten:return iv(n.value,e)?.lighten(n.factor);case zg.Transparent:return iv(n.value,e)?.transparent(n.factor);case zg.Opaque:{const t=iv(n.background,e);return t?iv(n.value,e)?.makeOpaque(t):iv(n.value,e)}case zg.OneOf:for(const t of n.values){const i=iv(t,e);if(i)return i}return;case zg.IfDefinedThenElse:return iv(e.defines(n.if)?n.then:n.else,e);case zg.LessProminent:{const t=iv(n.value,e);if(!t)return;const i=iv(n.background,e);return i?t.isDarkerThan(i)?fe.getLighterColor(t,i,n.factor).transparent(n.transparency):fe.getDarkerColor(t,i,n.factor).transparent(n.transparency):t.transparent(n.factor*n.transparency)}default:throw oQ()}}function Em(n,e){return{op:zg.Darken,value:n,factor:e}}function tw(n,e){return{op:zg.Lighten,value:n,factor:e}}function Ie(n,e){return{op:zg.Transparent,value:n,factor:e}}function sWe(n,e){return{op:zg.Opaque,value:n,background:e}}function j9(...n){return{op:zg.OneOf,values:n}}function mmt(n,e,t){return{op:zg.IfDefinedThenElse,if:n,then:e,else:t}}function oWe(n,e,t,i){return{op:zg.LessProminent,value:n,background:e,factor:t,transparency:i}}function iv(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?fe.fromHex(n):e.getColor(n);if(n instanceof fe)return n;if(typeof n=="object")return pmt(n,e)}}const fKe="vscode://schemas/workbench-colors",pKe=it.as(eL.JSONContribution);pKe.registerSchema(fKe,ide.getColorSchema());const rWe=new yn(()=>pKe.notifySchemaChanged(fKe),200);ide.onDidChangeSchema(()=>{rWe.isScheduled()||rWe.schedule()});const vg="vs/platform/theme/common/colors/baseColors",Ge=B("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,0,"Overall foreground color. This color is only used if not overridden by a component.")),aWe=B("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(vg,1,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),cWe=B("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(vg,2,"Overall foreground color for error messages. This color is only used if not overridden by a component."));B("descriptionForeground",{light:"#717171",dark:Ie(Ge,.7),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(vg,3,"Foreground color for description text providing additional information, for example for a label."));const Jy=B("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,4,"The default color for icons in the workbench.")),Zd=B("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(vg,5,"Overall border color for focused elements. This color is only used if not overridden by a component.")),ft=B("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(vg,6,"An extra border around elements to separate them from others for greater contrast.")),co=B("contrastActiveBorder",{light:null,dark:null,hcDark:Zd,hcLight:Zd},g(vg,7,"An extra border around active elements to separate them from others for greater contrast."));B("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},g(vg,8,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const GB=B("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,9,"Foreground color for links in text.")),_mt=B("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,10,"Foreground color for links in text when clicked on and on mouse hover."));B("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:fe.black,hcLight:"#292929"},g(vg,11,"Color for text separators."));B("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(vg,12,"Foreground color for preformatted text segments."));B("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(vg,13,"Background color for preformatted text segments."));const vmt=B("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(vg,14,"Background color for block quotes in text.")),wmt=B("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:fe.white,hcLight:"#292929"},g(vg,15,"Border color for block quotes in text."));B("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:fe.black,hcLight:"#F2F2F2"},g(vg,16,"Background color for code blocks in text."));const iL="vs/platform/theme/common/colors/miscColors";B("sash.hoverBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(iL,0,"Border color of active sashes."));const kW=B("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:fe.black,hcLight:"#0F4A85"},g(iL,1,"Badge background color. Badges are small information labels, e.g. for search results count.")),kMe=B("badge.foreground",{dark:fe.white,light:"#333",hcDark:fe.white,hcLight:fe.white},g(iL,2,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),p_=B("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(iL,3,"Scrollbar shadow to indicate that the view is scrolled.")),d3=B("scrollbarSlider.background",{dark:fe.fromHex("#797979").transparent(.4),light:fe.fromHex("#646464").transparent(.4),hcDark:Ie(ft,.6),hcLight:Ie(ft,.4)},g(iL,4,"Scrollbar slider background color.")),h3=B("scrollbarSlider.hoverBackground",{dark:fe.fromHex("#646464").transparent(.7),light:fe.fromHex("#646464").transparent(.7),hcDark:Ie(ft,.8),hcLight:Ie(ft,.8)},g(iL,5,"Scrollbar slider background color when hovering.")),u3=B("scrollbarSlider.activeBackground",{dark:fe.fromHex("#BFBFBF").transparent(.4),light:fe.fromHex("#000000").transparent(.6),hcDark:ft,hcLight:ft},g(iL,6,"Scrollbar slider background color when clicked on.")),bmt=B("progressBar.background",{dark:fe.fromHex("#0E70C0"),light:fe.fromHex("#0E70C0"),hcDark:ft,hcLight:ft},g(iL,7,"Background color of the progress bar that can show for long running operations.")),Pt="vs/platform/theme/common/colors/editorColors",us=B("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:fe.black,hcLight:fe.white},g(Pt,0,"Editor background color.")),Nc=B("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:fe.white,hcLight:Ge},g(Pt,1,"Editor default foreground color."));B("editorStickyScroll.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,2,"Background color of sticky scroll in the editor"));B("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Pt,3,"Background color of sticky scroll on hover in the editor"));B("editorStickyScroll.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,4,"Border color of sticky scroll in the editor"));B("editorStickyScroll.shadow",{dark:p_,light:p_,hcDark:p_,hcLight:p_},g(Pt,5," Shadow color of sticky scroll in the editor"));const Zs=B("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:fe.white},g(Pt,6,"Background color of editor widgets, such as find/replace.")),ng=B("editorWidget.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Pt,7,"Foreground color of editor widgets, such as find/replace.")),sg=B("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ft,hcLight:ft},g(Pt,8,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));B("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,9,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));B("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,10,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Vh=B("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(Pt,11,"Foreground color of error squigglies in the editor.")),Cmt=B("editorError.border",{dark:null,light:null,hcDark:fe.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(Pt,12,"If set, color of double underlines for errors in the editor.")),Aj=B("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,13,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),qc=B("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(Pt,14,"Foreground color of warning squigglies in the editor.")),K9=B("editorWarning.border",{dark:null,light:null,hcDark:fe.fromHex("#FFCC00").transparent(.8),hcLight:fe.fromHex("#FFCC00").transparent(.8)},g(Pt,15,"If set, color of double underlines for warnings in the editor."));B("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,16,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Qc=B("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(Pt,17,"Foreground color of info squigglies in the editor.")),Y9=B("editorInfo.border",{dark:null,light:null,hcDark:fe.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(Pt,18,"If set, color of double underlines for infos in the editor.")),ymt=B("editorHint.foreground",{dark:fe.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(Pt,19,"Foreground color of hint squigglies in the editor."));B("editorHint.border",{dark:null,light:null,hcDark:fe.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(Pt,20,"If set, color of double underlines for hints in the editor."));const Smt=B("editorLink.activeForeground",{dark:"#4E94CE",light:fe.blue,hcDark:fe.cyan,hcLight:"#292929"},g(Pt,21,"Color of active links.")),Hv=B("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(Pt,22,"Color of the editor selection.")),Amt=B("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:fe.white},g(Pt,23,"Color of the selected text for high contrast.")),mKe=B("editor.inactiveSelectionBackground",{light:Ie(Hv,.5),dark:Ie(Hv,.5),hcDark:Ie(Hv,.7),hcLight:Ie(Hv,.5)},g(Pt,24,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),IMe=B("editor.selectionHighlightBackground",{light:oWe(Hv,us,.3,.6),dark:oWe(Hv,us,.3,.6),hcDark:null,hcLight:null},g(Pt,25,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,26,"Border color for regions with the same content as the selection."));const lWe=B("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(Pt,27,"Color of the current search match.")),Emt=B("editor.findMatchForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,28,"Text color of the current search match.")),Fb=B("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(Pt,29,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),xmt=B("editor.findMatchHighlightForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,30,"Foreground color of the other search matches."),!0);B("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(Pt,31,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.findMatchBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,32,"Border color of the current search match."));const Uk=B("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,33,"Border color of the other search matches.")),Dmt=B("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ie(co,.4),hcLight:Ie(co,.4)},g(Pt,34,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Vk=B("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(Pt,35,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),MZ=B("editorHoverWidget.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,36,"Background color of the editor hover."));B("editorHoverWidget.foreground",{light:ng,dark:ng,hcDark:ng,hcLight:ng},g(Pt,37,"Foreground color of the editor hover."));const _Ke=B("editorHoverWidget.border",{light:sg,dark:sg,hcDark:sg,hcLight:sg},g(Pt,38,"Border color of the editor hover."));B("editorHoverWidget.statusBarBackground",{dark:tw(MZ,.2),light:Em(MZ,.05),hcDark:Zs,hcLight:Zs},g(Pt,39,"Background color of the editor hover status bar."));const bE=B("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:fe.white,hcLight:fe.black},g(Pt,40,"Foreground color of inline hints")),CE=B("editorInlayHint.background",{dark:Ie(kW,.1),light:Ie(kW,.1),hcDark:Ie(fe.white,.1),hcLight:Ie(kW,.1)},g(Pt,41,"Background color of inline hints")),kmt=B("editorInlayHint.typeForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,42,"Foreground color of inline hints for types")),Imt=B("editorInlayHint.typeBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,43,"Background color of inline hints for types")),Lmt=B("editorInlayHint.parameterForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,44,"Foreground color of inline hints for parameters")),Tmt=B("editorInlayHint.parameterBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,45,"Background color of inline hints for parameters")),Ej=B("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(Pt,46,"The color used for the lightbulb actions icon."));B("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(Pt,47,"The color used for the lightbulb auto fix actions icon."));B("editorLightBulbAi.foreground",{dark:Ej,light:Ej,hcDark:Ej,hcLight:Ej},g(Pt,48,"The color used for the lightbulb AI icon."));B("editor.snippetTabstopHighlightBackground",{dark:new fe(new gn(124,124,124,.3)),light:new fe(new gn(10,50,100,.2)),hcDark:new fe(new gn(124,124,124,.3)),hcLight:new fe(new gn(10,50,100,.2))},g(Pt,49,"Highlight background color of a snippet tabstop."));B("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,50,"Highlight border color of a snippet tabstop."));B("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,51,"Highlight background color of the final tabstop of a snippet."));B("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new fe(new gn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(Pt,52,"Highlight border color of the final tabstop of a snippet."));const twe=new fe(new gn(155,185,85,.2)),iwe=new fe(new gn(255,0,0,.2)),m_=B("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(Pt,53,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),yE=B("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(Pt,54,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.insertedLineBackground",{dark:twe,light:twe,hcDark:null,hcLight:null},g(Pt,55,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.removedLineBackground",{dark:iwe,light:iwe,hcDark:null,hcLight:null},g(Pt,56,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,57,"Background color for the margin where lines got inserted."));B("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,58,"Background color for the margin where lines got removed."));const Rmt=B("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,59,"Diff overview ruler foreground for inserted content.")),Mmt=B("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,60,"Diff overview ruler foreground for removed content."));B("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(Pt,61,"Outline color for the text that got inserted."));B("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(Pt,62,"Outline color for text that got removed."));B("diffEditor.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,63,"Border color between the two text editors."));B("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(Pt,64,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));B("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},g(Pt,65,"The background color of unchanged blocks in the diff editor."));B("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},g(Pt,66,"The foreground color of unchanged blocks in the diff editor."));B("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(Pt,67,"The background color of unchanged code in the diff editor."));const __=B("widget.shadow",{dark:Ie(fe.black,.36),light:Ie(fe.black,.16),hcDark:null,hcLight:null},g(Pt,68,"Shadow color of widgets such as find/replace inside the editor.")),UU=B("widget.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,69,"Border color of widgets such as find/replace inside the editor.")),NZ=B("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(Pt,70,"Toolbar background when hovering over actions using the mouse"));B("toolbar.hoverOutline",{dark:null,light:null,hcDark:co,hcLight:co},g(Pt,71,"Toolbar outline when hovering over actions using the mouse"));B("toolbar.activeBackground",{dark:tw(NZ,.1),light:Em(NZ,.1),hcDark:null,hcLight:null},g(Pt,72,"Toolbar background when holding the mouse over actions"));const Nmt=B("breadcrumb.foreground",{light:Ie(Ge,.8),dark:Ie(Ge,.8),hcDark:Ie(Ge,.8),hcLight:Ie(Ge,.8)},g(Pt,73,"Color of focused breadcrumb items.")),Pmt=B("breadcrumb.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,74,"Background color of breadcrumb items.")),dWe=B("breadcrumb.focusForeground",{light:Em(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,73,"Color of focused breadcrumb items.")),Fmt=B("breadcrumb.activeSelectionForeground",{light:Em(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,75,"Color of selected breadcrumb items."));B("breadcrumbPicker.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,76,"Background color of breadcrumb item picker."));const vKe=.5,hWe=fe.fromHex("#40C8AE").transparent(vKe),uWe=fe.fromHex("#40A6FF").transparent(vKe),gWe=fe.fromHex("#606060").transparent(.4),Uv=.4,VU=1,qB=B("merge.currentHeaderBackground",{dark:hWe,light:hWe,hcDark:null,hcLight:null},g(Pt,77,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.currentContentBackground",{dark:Ie(qB,Uv),light:Ie(qB,Uv),hcDark:Ie(qB,Uv),hcLight:Ie(qB,Uv)},g(Pt,78,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const QB=B("merge.incomingHeaderBackground",{dark:uWe,light:uWe,hcDark:null,hcLight:null},g(Pt,79,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.incomingContentBackground",{dark:Ie(QB,Uv),light:Ie(QB,Uv),hcDark:Ie(QB,Uv),hcLight:Ie(QB,Uv)},g(Pt,80,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const jB=B("merge.commonHeaderBackground",{dark:gWe,light:gWe,hcDark:null,hcLight:null},g(Pt,81,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.commonContentBackground",{dark:Ie(jB,Uv),light:Ie(jB,Uv),hcDark:Ie(jB,Uv),hcLight:Ie(jB,Uv)},g(Pt,82,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const zU=B("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(Pt,83,"Border color on headers and the splitter in inline merge-conflicts."));B("editorOverviewRuler.currentContentForeground",{dark:Ie(qB,VU),light:Ie(qB,VU),hcDark:zU,hcLight:zU},g(Pt,84,"Current overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.incomingContentForeground",{dark:Ie(QB,VU),light:Ie(QB,VU),hcDark:zU,hcLight:zU},g(Pt,85,"Incoming overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.commonContentForeground",{dark:Ie(jB,VU),light:Ie(jB,VU),hcDark:zU,hcLight:zU},g(Pt,86,"Common ancestor overview ruler foreground for inline merge-conflicts."));const m$=B("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(Pt,87,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),g3=B("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(Pt,88,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Omt=B("problemsErrorIcon.foreground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(Pt,89,"The color used for the problems error icon.")),Bmt=B("problemsWarningIcon.foreground",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(Pt,90,"The color used for the problems warning icon.")),Wmt=B("problemsInfoIcon.foreground",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},g(Pt,91,"The color used for the problems info icon.")),gC="vs/platform/theme/common/colors/minimapColors",KB=B("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(gC,0,"Minimap marker color for find matches."),!0),nde=B("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,1,"Minimap marker color for repeating editor selections."),!0),fWe=B("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,2,"Minimap marker color for the editor selection."),!0),Hmt=B("minimap.infoHighlight",{dark:Qc,light:Qc,hcDark:Y9,hcLight:Y9},g(gC,3,"Minimap marker color for infos.")),Umt=B("minimap.warningHighlight",{dark:qc,light:qc,hcDark:K9,hcLight:K9},g(gC,4,"Minimap marker color for warnings.")),Vmt=B("minimap.errorHighlight",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(gC,5,"Minimap marker color for errors.")),zmt=B("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},g(gC,6,"Minimap background color.")),$mt=B("minimap.foregroundOpacity",{dark:fe.fromHex("#000f"),light:fe.fromHex("#000f"),hcDark:fe.fromHex("#000f"),hcLight:fe.fromHex("#000f")},g(gC,7,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));B("minimapSlider.background",{light:Ie(d3,.5),dark:Ie(d3,.5),hcDark:Ie(d3,.5),hcLight:Ie(d3,.5)},g(gC,8,"Minimap slider background color."));B("minimapSlider.hoverBackground",{light:Ie(h3,.5),dark:Ie(h3,.5),hcDark:Ie(h3,.5),hcLight:Ie(h3,.5)},g(gC,9,"Minimap slider background color when hovering."));B("minimapSlider.activeBackground",{light:Ie(u3,.5),dark:Ie(u3,.5),hcDark:Ie(u3,.5),hcLight:Ie(u3,.5)},g(gC,10,"Minimap slider background color when clicked on."));const nL="vs/platform/theme/common/colors/chartsColors";B("charts.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(nL,0,"The foreground color used in charts."));B("charts.lines",{dark:Ie(Ge,.5),light:Ie(Ge,.5),hcDark:Ie(Ge,.5),hcLight:Ie(Ge,.5)},g(nL,1,"The color used for horizontal lines in charts."));B("charts.red",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(nL,2,"The red color used in chart visualizations."));B("charts.blue",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},g(nL,3,"The blue color used in chart visualizations."));B("charts.yellow",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(nL,4,"The yellow color used in chart visualizations."));B("charts.orange",{dark:KB,light:KB,hcDark:KB,hcLight:KB},g(nL,5,"The orange color used in chart visualizations."));B("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(nL,6,"The green color used in chart visualizations."));B("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(nL,7,"The purple color used in chart visualizations."));const Lo="vs/platform/theme/common/colors/inputColors",SE=B("input.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,0,"Input box background.")),wKe=B("input.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Lo,1,"Input box foreground.")),_$=B("input.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Lo,2,"Input box border.")),LMe=B("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ft,hcLight:ft},g(Lo,3,"Border color of activated options in input fields."));B("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(Lo,4,"Background color of activated options in input fields."));const hR=B("inputOption.activeBackground",{dark:Ie(Zd,.4),light:Ie(Zd,.2),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,5,"Background hover color of options in input fields.")),TMe=B("inputOption.activeForeground",{dark:fe.white,light:fe.black,hcDark:Ge,hcLight:Ge},g(Lo,6,"Foreground color of activated options in input fields.")),xj=B("input.placeholderForeground",{light:Ie(Ge,.5),dark:Ie(Ge,.5),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(Lo,7,"Input box foreground color for placeholder text.")),Gmt=B("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:fe.black,hcLight:fe.white},g(Lo,8,"Input validation background color for information severity.")),qmt=B("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,9,"Input validation foreground color for information severity.")),Qmt=B("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ft,hcLight:ft},g(Lo,10,"Input validation border color for information severity.")),jmt=B("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:fe.black,hcLight:fe.white},g(Lo,11,"Input validation background color for warning severity.")),Kmt=B("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,12,"Input validation foreground color for warning severity.")),Ymt=B("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ft,hcLight:ft},g(Lo,13,"Input validation border color for warning severity.")),bKe=B("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:fe.black,hcLight:fe.white},g(Lo,14,"Input validation background color for error severity.")),CKe=B("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,15,"Input validation foreground color for error severity.")),yKe=B("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Lo,16,"Input validation border color for error severity.")),Xy=B("dropdown.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,17,"Dropdown background.")),Jmt=B("dropdown.listBackground",{dark:null,light:null,hcDark:fe.black,hcLight:fe.white},g(Lo,18,"Dropdown list background.")),AE=B("dropdown.foreground",{dark:"#F0F0F0",light:Ge,hcDark:fe.white,hcLight:Ge},g(Lo,19,"Dropdown foreground.")),YB=B("dropdown.border",{dark:Xy,light:"#CECECE",hcDark:ft,hcLight:ft},g(Lo,20,"Dropdown border.")),Zy=B("button.foreground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:fe.white},g(Lo,21,"Button foreground color.")),f3=B("button.separator",{dark:Ie(Zy,.4),light:Ie(Zy,.4),hcDark:Ie(Zy,.4),hcLight:Ie(Zy,.4)},g(Lo,22,"Button separator color.")),eS=B("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(Lo,23,"Button background color.")),J9=B("button.hoverBackground",{dark:tw(eS,.2),light:Em(eS,.2),hcDark:eS,hcLight:eS},g(Lo,24,"Button background color when hovering.")),Xmt=B("button.border",{dark:ft,light:ft,hcDark:ft,hcLight:ft},g(Lo,25,"Button border color.")),Zmt=B("button.secondaryForeground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:Ge},g(Lo,26,"Secondary button foreground color.")),nwe=B("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:fe.white},g(Lo,27,"Secondary button background color.")),e_t=B("button.secondaryHoverBackground",{dark:tw(nwe,.2),light:Em(nwe,.2),hcDark:null,hcLight:null},g(Lo,28,"Secondary button background color when hovering.")),t_t=B("checkbox.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(Lo,29,"Background color of checkbox widget."));B("checkbox.selectBackground",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Lo,30,"Background color of checkbox widget when the element it's in is selected."));const i_t=B("checkbox.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(Lo,31,"Foreground color of checkbox widget.")),n_t=B("checkbox.border",{dark:YB,light:YB,hcDark:YB,hcLight:YB},g(Lo,32,"Border color of checkbox widget."));B("checkbox.selectBorder",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(Lo,33,"Border color of checkbox widget when the element it's in is selected."));const s_t=B("keybindingLabel.background",{dark:new fe(new gn(128,128,128,.17)),light:new fe(new gn(221,221,221,.4)),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,34,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),o_t=B("keybindingLabel.foreground",{dark:fe.fromHex("#CCCCCC"),light:fe.fromHex("#555555"),hcDark:fe.white,hcLight:Ge},g(Lo,35,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),r_t=B("keybindingLabel.border",{dark:new fe(new gn(51,51,51,.6)),light:new fe(new gn(204,204,204,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:ft},g(Lo,36,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),a_t=B("keybindingLabel.bottomBorder",{dark:new fe(new gn(68,68,68,.6)),light:new fe(new gn(187,187,187,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:Ge},g(Lo,37,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Yr="vs/platform/theme/common/colors/listColors",c_t=B("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),l_t=B("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,1,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),swe=B("list.focusOutline",{dark:Zd,light:Zd,hcDark:co,hcLight:co},g(Yr,2,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),d_t=B("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,3,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),v_=B("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,4,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),um=B("list.activeSelectionForeground",{dark:fe.white,light:fe.white,hcDark:null,hcLight:null},g(Yr,5,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),p3=B("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,6,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),owe=B("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,7,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),h_t=B("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,8,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),u_t=B("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,9,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),g_t=B("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,10,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),f_t=B("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,11,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),SKe=B("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:fe.white.transparent(.1),hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,12,"List/Tree background when hovering over items using the mouse.")),AKe=B("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,13,"List/Tree foreground when hovering over items using the mouse.")),p_t=B("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(Yr,14,"List/Tree drag and drop background when moving items over other items when using the mouse.")),m_t=B("list.dropBetweenBackground",{dark:Jy,light:Jy,hcDark:null,hcLight:null},g(Yr,15,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Vv=B("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Zd,hcLight:Zd},g(Yr,16,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Dj=B("list.focusHighlightForeground",{dark:Vv,light:mmt(v_,Vv,"#BBE7FF"),hcDark:Vv,hcLight:Vv},g(Yr,17,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),__t=B("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(Yr,18,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),pWe=B("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(Yr,19,"Foreground color of list items containing errors."));B("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(Yr,20,"Foreground color of list items containing warnings."));const v_t=B("listFilterWidget.background",{light:Em(Zs,0),dark:tw(Zs,0),hcDark:Zs,hcLight:Zs},g(Yr,21,"Background color of the type filter widget in lists and trees.")),w_t=B("listFilterWidget.outline",{dark:fe.transparent,light:fe.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(Yr,22,"Outline color of the type filter widget in lists and trees.")),b_t=B("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Yr,23,"Outline color of the type filter widget in lists and trees, when there are no matches.")),C_t=B("listFilterWidget.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Yr,24,"Shadow color of the type filter widget in lists and trees."));B("list.filterMatchBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Yr,25,"Background color of the filtered match."));B("list.filterMatchBorder",{dark:Uk,light:Uk,hcDark:ft,hcLight:co},g(Yr,26,"Border color of the filtered match."));const y_t=B("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(Yr,27,"List/Tree foreground color for items that are deemphasized.")),uR=B("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(Yr,28,"Tree stroke color for the indentation guides.")),S_t=B("tree.inactiveIndentGuidesStroke",{dark:Ie(uR,.4),light:Ie(uR,.4),hcDark:Ie(uR,.4),hcLight:Ie(uR,.4)},g(Yr,29,"Tree stroke color for the indentation guides that are not active.")),A_t=B("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(Yr,30,"Table border color between columns.")),E_t=B("tree.tableOddRowsBackground",{dark:Ie(Ge,.04),light:Ie(Ge,.04),hcDark:null,hcLight:null},g(Yr,31,"Background color for odd table rows.")),uO="vs/platform/theme/common/colors/menuColors",x_t=B("menu.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(uO,0,"Border color of menus.")),D_t=B("menu.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(uO,1,"Foreground color of menu items.")),k_t=B("menu.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(uO,2,"Background color of menu items.")),I_t=B("menu.selectionForeground",{dark:um,light:um,hcDark:um,hcLight:um},g(uO,3,"Foreground color of the selected menu item in menus.")),L_t=B("menu.selectionBackground",{dark:v_,light:v_,hcDark:v_,hcLight:v_},g(uO,4,"Background color of the selected menu item in menus.")),T_t=B("menu.selectionBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(uO,5,"Border color of the selected menu item in menus.")),R_t=B("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ft,hcLight:ft},g(uO,6,"Color of a separator menu item in menus.")),Zx="vs/platform/theme/common/colors/quickpickColors",mWe=B("quickInput.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Zx,0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),M_t=B("quickInput.foreground",{dark:ng,light:ng,hcDark:ng,hcLight:ng},g(Zx,1,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),N_t=B("quickInputTitle.background",{dark:new fe(new gn(255,255,255,.105)),light:new fe(new gn(0,0,0,.06)),hcDark:"#000000",hcLight:fe.white},g(Zx,2,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),EKe=B("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,3,"Quick picker color for grouping labels.")),P_t=B("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,4,"Quick picker color for grouping borders.")),_We=B("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,g(Zx,5,"Please use quickInputList.focusBackground instead")),zk=B("quickInputList.focusForeground",{dark:um,light:um,hcDark:um,hcLight:um},g(Zx,6,"Quick picker foreground color for the focused item.")),JB=B("quickInputList.focusIconForeground",{dark:p3,light:p3,hcDark:p3,hcLight:p3},g(Zx,7,"Quick picker icon foreground color for the focused item.")),$k=B("quickInputList.focusBackground",{dark:j9(_We,v_),light:j9(_We,v_),hcDark:null,hcLight:null},g(Zx,8,"Quick picker background color for the focused item.")),RMe="vs/platform/theme/common/colors/searchColors";B("search.resultsInfoForeground",{light:Ge,dark:Ie(Ge,.65),hcDark:Ge,hcLight:Ge},g(RMe,0,"Color of the text in the search viewlet's completion message."));B("searchEditor.findMatchBackground",{light:Ie(Fb,.66),dark:Ie(Fb,.66),hcDark:Fb,hcLight:Fb},g(RMe,1,"Color of the Search Editor query matches."));B("searchEditor.findMatchBorder",{light:Ie(Uk,.66),dark:Ie(Uk,.66),hcDark:Uk,hcLight:Uk},g(RMe,2,"Border color of the Search Editor query matches."));class sde{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new xKe(this.x-e.scrollX,this.y-e.scrollY)}}class xKe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new sde(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class F_t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class O_t{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function MMe(n){const e=ia(n);return new F_t(e.left,e.top,e.width,e.height)}function NMe(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new O_t(o,r)}class f1 extends yu{constructor(e,t,i){super(gt(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new sde(this.posx,this.posy),this.editorPos=MMe(i),this.relativePos=NMe(i,this.editorPos,this.pos)}}class B_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return pe(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return pe(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return pe(e,xe.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return pe(e,xe.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return pe(e,"mousemove",i=>t(this._create(i)))}}class W_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return pe(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return pe(e,xe.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return pe(e,"pointermove",i=>t(this._create(i)))}}class H_t extends ${constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new vz),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Xo(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new f1(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const lae=class lae{constructor(e){this._editor=e,this._instanceId=++lae._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new yn(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new U_t(t,`dyn-rule-${this._instanceId}-${s}`,P9(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};lae._idPool=0;let PZ=lae;class U_t{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=od(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const s in t){const o=t[s];let r;typeof o=="object"?r=Ye(o.id):r=o;const a=V_t(s);i+=` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class nct extends cr{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(x.minimap,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:g(142,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:g(143,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[g(144,"The minimap has the same size as the editor contents (and might scroll)."),g(145,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),g(146,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:g(147,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:g(148,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:g(149,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:g(150,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:g(151,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:g(152,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:g(153,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:g(154,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:g(155,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:g(156,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),autohide:Et(t.autohide,this.defaultValue.autohide),size:Kr(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Kr(t.side,this.defaultValue.side,["right","left"]),showSlider:Kr(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Et(t.renderCharacters,this.defaultValue.renderCharacters),scale:bo.clampedInt(t.scale,1,1,3),maxColumn:bo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:Et(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:Et(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:ip.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:ip.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function sct(s){return s==="ctrlCmd"?Qt?"metaKey":"ctrlKey":"altKey"}class oct extends cr{constructor(){super(x.padding,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:g(157,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:g(158,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:bo.clampedInt(t.top,0,0,1e3),bottom:bo.clampedInt(t.bottom,0,0,1e3)}}}class rct extends cr{constructor(){const e={enabled:!0,cycle:!0};super(x.parameterHints,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:g(159,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:g(160,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),cycle:Et(t.cycle,this.defaultValue.cycle)}}}class act extends q7{constructor(){super(x.pixelRatio)}compute(e,t,i){return e.pixelRatio}}class cct extends cr{constructor(){super(x.placeholder,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class lct extends cr{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[g(161,"Quick suggestions show inside the suggest widget"),g(162,"Quick suggestions show as ghost text"),g(163,"Quick suggestions are disabled")]}];super(x.quickSuggestions,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:g(164,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:g(165,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:g(166,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:g(167,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const l=e?"on":"off";return{comments:l,strings:l,other:l}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let r,a,c;return typeof t=="boolean"?r=t?"on":"off":r=Kr(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Kr(i,this.defaultValue.comments,o),typeof n=="boolean"?c=n?"on":"off":c=Kr(n,this.defaultValue.strings,o),{other:r,comments:a,strings:c}}}var wr;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(wr||(wr={}));class dct extends cr{constructor(){super(x.lineNumbers,"lineNumbers",{renderType:wr.On,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[g(168,"Line numbers are not rendered."),g(169,"Line numbers are rendered as absolute number."),g(170,"Line numbers are rendered as distance in lines to cursor position."),g(171,"Line numbers are rendered every 10 lines.")],default:"on",description:g(172,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=wr.Custom,i=e):e==="interval"?t=wr.Interval:e==="relative"?t=wr.Relative:e==="on"?t=wr.On:t=wr.Off),{renderType:t,renderFn:i}}}function Rj(s){const e=s.get(x.renderValidationDecorations);return e==="editable"?s.get(x.readOnly):e!=="on"}class hct extends cr{constructor(){const e=[],t={type:"number",description:g(173,"Number of monospace characters at which this editor ruler will render.")};super(x.rulers,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:g(174,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:g(175,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:bo.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:bo.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class uct extends cr{constructor(){super(x.readOnlyMessage,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function LFe(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return Co.Hidden;case"visible":return Co.Visible;default:return Co.Auto}}let gct=class extends cr{constructor(){const e={vertical:Co.Auto,horizontal:Co.Auto,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(x.scrollbar,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(176,"The vertical scrollbar will be visible only when necessary."),g(177,"The vertical scrollbar will always be visible."),g(178,"The vertical scrollbar will always be hidden.")],default:"auto",description:g(179,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(180,"The horizontal scrollbar will be visible only when necessary."),g(181,"The horizontal scrollbar will always be visible."),g(182,"The horizontal scrollbar will always be hidden.")],default:"auto",description:g(183,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:g(184,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:g(185,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:g(186,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:g(187,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=bo.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=bo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:bo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:LFe(t.vertical,this.defaultValue.vertical),horizontal:LFe(t.horizontal,this.defaultValue.horizontal),useShadows:Et(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Et(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Et(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Et(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Et(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:bo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:bo.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Et(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Et(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const kf="inUntrustedWorkspace",Mu={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class fct extends cr{constructor(){const e={nonBasicASCII:kf,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:kf,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(x.unicodeHighlighting,"unicodeHighlight",e,{[Mu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kf],default:e.nonBasicASCII,description:g(188,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Mu.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:g(189,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Mu.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:g(190,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Mu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kf],default:e.includeComments,description:g(191,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Mu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kf],default:e.includeStrings,description:g(192,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Mu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g(193,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Mu.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:g(194,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Ys(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Ys(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new JV(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:DO(t.nonBasicASCII,kf,[!0,!1,kf]),invisibleCharacters:Et(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Et(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:DO(t.includeComments,kf,[!0,!1,kf]),includeStrings:DO(t.includeStrings,kf,[!0,!1,kf]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[n,o]of Object.entries(e))o===!0&&(i[n]=!0);return i}}class pct extends cr{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(x.inlineSuggest,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:g(195,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(196,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),g(197,"Show the inline suggestion toolbar when hovering over an inline suggestion."),g(198,"Never show the inline suggestion toolbar.")],description:g(199,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:g(200,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:g(201,"Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),mode:Kr(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Kr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Et(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Et(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:bh.string(t.fontFamily,this.defaultValue.fontFamily)}}}class mct extends cr{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(x.inlineEdit,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:g(202,"Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(203,"Show the inline edit toolbar whenever an inline suggestion is shown."),g(204,"Show the inline edit toolbar when hovering over an inline suggestion."),g(205,"Never show the inline edit toolbar.")],description:g(206,"Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:g(207,"Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),showToolbar:Kr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:bh.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:Et(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class _ct extends cr{constructor(){const e={enabled:Vd.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Vd.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(x.bracketPairColorization,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(208,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:g(209,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Et(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class vct extends cr{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(x.guides,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(210,"Enables bracket pair guides."),g(211,"Enables bracket pair guides only for the active bracket pair."),g(212,"Disables bracket pair guides.")],default:e.bracketPairs,description:g(213,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(214,"Enables horizontal guides as addition to vertical bracket pair guides."),g(215,"Enables horizontal guides only for the active bracket pair."),g(216,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:g(217,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:g(218,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:g(219,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[g(220,"Highlights the active indent guide."),g(221,"Highlights the active indent guide even if bracket guides are highlighted."),g(222,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:g(223,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:DO(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:DO(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Et(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Et(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:DO(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function DO(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class bct extends cr{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(x.suggest,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[g(224,"Insert suggestion without overwriting text right of the cursor."),g(225,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:g(226,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:g(227,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:g(228,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:g(229,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[g(230,"Always select a suggestion when automatically triggering IntelliSense."),g(231,"Never select a suggestion when automatically triggering IntelliSense."),g(232,"Select a suggestion only when triggering IntelliSense from a trigger character."),g(233,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:g(234,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:g(235,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:g(236,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:g(237,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:g(238,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:g(239,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:g(240,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:g(241,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:g(242,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:g(243,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:g(244,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:g(245,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:g(246,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:g(247,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:g(248,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:g(249,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:g(250,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:g(251,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:g(252,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:g(253,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:g(254,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:g(255,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:g(256,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:g(257,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:g(258,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:g(259,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:g(260,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:g(261,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:g(262,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:g(263,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:g(264,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:g(265,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:g(266,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:g(267,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:g(268,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:g(269,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:g(270,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:g(271,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Kr(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Et(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Et(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Et(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Et(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Kr(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Et(t.showIcons,this.defaultValue.showIcons),showStatusBar:Et(t.showStatusBar,this.defaultValue.showStatusBar),preview:Et(t.preview,this.defaultValue.preview),previewMode:Kr(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Et(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Et(t.showMethods,this.defaultValue.showMethods),showFunctions:Et(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Et(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Et(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Et(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Et(t.showFields,this.defaultValue.showFields),showVariables:Et(t.showVariables,this.defaultValue.showVariables),showClasses:Et(t.showClasses,this.defaultValue.showClasses),showStructs:Et(t.showStructs,this.defaultValue.showStructs),showInterfaces:Et(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Et(t.showModules,this.defaultValue.showModules),showProperties:Et(t.showProperties,this.defaultValue.showProperties),showEvents:Et(t.showEvents,this.defaultValue.showEvents),showOperators:Et(t.showOperators,this.defaultValue.showOperators),showUnits:Et(t.showUnits,this.defaultValue.showUnits),showValues:Et(t.showValues,this.defaultValue.showValues),showConstants:Et(t.showConstants,this.defaultValue.showConstants),showEnums:Et(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Et(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Et(t.showKeywords,this.defaultValue.showKeywords),showWords:Et(t.showWords,this.defaultValue.showWords),showColors:Et(t.showColors,this.defaultValue.showColors),showFiles:Et(t.showFiles,this.defaultValue.showFiles),showReferences:Et(t.showReferences,this.defaultValue.showReferences),showFolders:Et(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Et(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Et(t.showSnippets,this.defaultValue.showSnippets),showUsers:Et(t.showUsers,this.defaultValue.showUsers),showIssues:Et(t.showIssues,this.defaultValue.showIssues)}}}class wct extends cr{constructor(){super(x.smartSelect,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:g(272,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:g(273,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Et(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Et(e.selectSubwords,this.defaultValue.selectSubwords)}}}class yct extends cr{constructor(){const e=[];super(x.wordSegmenterLocales,"wordSegmenterLocales",e,{anyOf:[{description:g(274,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:g(274,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}var Nu;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(Nu||(Nu={}));class Cct extends cr{constructor(){super(x.wrappingIndent,"wrappingIndent",Nu.Same,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[g(275,"No indentation. Wrapped lines begin at column 1."),g(276,"Wrapped lines get the same indentation as the parent."),g(277,"Wrapped lines get +1 indentation toward the parent."),g(278,"Wrapped lines get +2 indentation toward the parent.")],description:g(279,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return Nu.None;case"same":return Nu.Same;case"indent":return Nu.Indent;case"deepIndent":return Nu.DeepIndent}return Nu.Same}compute(e,t,i){return t.get(x.accessibilitySupport)===Jl.Enabled?Nu.None:i}}class Sct extends q7{constructor(){super(x.wrappingInfo)}compute(e,t,i){const n=t.get(x.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class Act extends cr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(x.dropIntoEditor,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(280,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:g(281,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[g(282,"Show the drop selector widget after a file is dropped into the editor."),g(283,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),showDropSelector:Kr(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Ect extends cr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(x.pasteAs,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(284,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:g(285,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[g(286,"Show the paste selector widget after content is pasted into the editor."),g(287,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),showPasteSelector:Kr(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const xct="Consolas, 'Courier New', monospace",Dct="Menlo, Monaco, 'Courier New', monospace",kct="'Droid Sans Mono', 'monospace', monospace",cd={fontFamily:Qt?Dct:pr?kct:xct,fontWeight:"normal",fontSize:Qt?12:14,lineHeight:0,letterSpacing:0},JP=[];function Ue(s){return JP[s.id]=s,s}var x;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.placeholder=88]="placeholder",s[s.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",s[s.quickSuggestions=90]="quickSuggestions",s[s.quickSuggestionsDelay=91]="quickSuggestionsDelay",s[s.readOnly=92]="readOnly",s[s.readOnlyMessage=93]="readOnlyMessage",s[s.renameOnType=94]="renameOnType",s[s.renderControlCharacters=95]="renderControlCharacters",s[s.renderFinalNewline=96]="renderFinalNewline",s[s.renderLineHighlight=97]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=99]="renderValidationDecorations",s[s.renderWhitespace=100]="renderWhitespace",s[s.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",s[s.roundedSelection=102]="roundedSelection",s[s.rulers=103]="rulers",s[s.scrollbar=104]="scrollbar",s[s.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=106]="scrollBeyondLastLine",s[s.scrollPredominantAxis=107]="scrollPredominantAxis",s[s.selectionClipboard=108]="selectionClipboard",s[s.selectionHighlight=109]="selectionHighlight",s[s.selectOnLineNumbers=110]="selectOnLineNumbers",s[s.showFoldingControls=111]="showFoldingControls",s[s.showUnused=112]="showUnused",s[s.snippetSuggestions=113]="snippetSuggestions",s[s.smartSelect=114]="smartSelect",s[s.smoothScrolling=115]="smoothScrolling",s[s.stickyScroll=116]="stickyScroll",s[s.stickyTabStops=117]="stickyTabStops",s[s.stopRenderingLineAfter=118]="stopRenderingLineAfter",s[s.suggest=119]="suggest",s[s.suggestFontSize=120]="suggestFontSize",s[s.suggestLineHeight=121]="suggestLineHeight",s[s.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",s[s.suggestSelection=123]="suggestSelection",s[s.tabCompletion=124]="tabCompletion",s[s.tabIndex=125]="tabIndex",s[s.unicodeHighlighting=126]="unicodeHighlighting",s[s.unusualLineTerminators=127]="unusualLineTerminators",s[s.useShadowDOM=128]="useShadowDOM",s[s.useTabStops=129]="useTabStops",s[s.wordBreak=130]="wordBreak",s[s.wordSegmenterLocales=131]="wordSegmenterLocales",s[s.wordSeparators=132]="wordSeparators",s[s.wordWrap=133]="wordWrap",s[s.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=136]="wordWrapColumn",s[s.wordWrapOverride1=137]="wordWrapOverride1",s[s.wordWrapOverride2=138]="wordWrapOverride2",s[s.wrappingIndent=139]="wrappingIndent",s[s.wrappingStrategy=140]="wrappingStrategy",s[s.showDeprecated=141]="showDeprecated",s[s.inlayHints=142]="inlayHints",s[s.editorClassName=143]="editorClassName",s[s.pixelRatio=144]="pixelRatio",s[s.tabFocusMode=145]="tabFocusMode",s[s.layoutInfo=146]="layoutInfo",s[s.wrappingInfo=147]="wrappingInfo",s[s.defaultColorDecorators=148]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(x||(x={}));const wh={acceptSuggestionOnCommitCharacter:Ue(new Ln(x.acceptSuggestionOnCommitCharacter,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:g(288,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Ue(new Br(x.acceptSuggestionOnEnter,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",g(289,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:g(290,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Ue(new Wat),accessibilityPageSize:Ue(new bo(x.accessibilityPageSize,"accessibilityPageSize",10,1,Un.MAX_SAFE_SMALL_INTEGER,{description:g(291,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Ue(new bh(x.ariaLabel,"ariaLabel",g(292,"Editor content"))),ariaRequired:Ue(new Ln(x.ariaRequired,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ue(new Ln(x.screenReaderAnnounceInlineSuggestion,"screenReaderAnnounceInlineSuggestion",!0,{description:g(293,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ue(new Br(x.autoClosingBrackets,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(294,"Use language configurations to determine when to autoclose brackets."),g(295,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:g(296,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Ue(new Br(x.autoClosingComments,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(297,"Use language configurations to determine when to autoclose comments."),g(298,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:g(299,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Ue(new Br(x.autoClosingDelete,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",g(300,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:g(301,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Ue(new Br(x.autoClosingOvertype,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",g(302,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:g(303,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Ue(new Br(x.autoClosingQuotes,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(304,"Use language configurations to determine when to autoclose quotes."),g(305,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:g(306,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Ue(new yG(x.autoIndent,"autoIndent",ll.Full,"full",["none","keep","brackets","advanced","full"],Bat,{enumDescriptions:[g(307,"The editor will not insert indentation automatically."),g(308,"The editor will keep the current line's indentation."),g(309,"The editor will keep the current line's indentation and honor language defined brackets."),g(310,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),g(311,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:g(312,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Ue(new Ln(x.automaticLayout,"automaticLayout",!1)),autoSurround:Ue(new Br(x.autoSurround,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[g(313,"Use language configurations to determine when to automatically surround selections."),g(314,"Surround with quotes but not brackets."),g(315,"Surround with brackets but not quotes."),""],description:g(316,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Ue(new _ct),bracketPairGuides:Ue(new vct),stickyTabStops:Ue(new Ln(x.stickyTabStops,"stickyTabStops",!1,{description:g(317,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Ue(new Ln(x.codeLens,"codeLens",!0,{description:g(318,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ue(new bh(x.codeLensFontFamily,"codeLensFontFamily","",{description:g(319,"Controls the font family for CodeLens.")})),codeLensFontSize:Ue(new bo(x.codeLensFontSize,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:g(320,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Ue(new Ln(x.colorDecorators,"colorDecorators",!0,{description:g(321,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ue(new Br(x.colorDecoratorsActivatedOn,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[g(322,"Make the color picker appear both on click and hover of the color decorator"),g(323,"Make the color picker appear on hover of the color decorator"),g(324,"Make the color picker appear on click of the color decorator")],description:g(325,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Ue(new bo(x.colorDecoratorsLimit,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:g(326,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Ue(new Ln(x.columnSelection,"columnSelection",!1,{description:g(327,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ue(new Hat),contextmenu:Ue(new Ln(x.contextmenu,"contextmenu",!0)),copyWithSyntaxHighlighting:Ue(new Ln(x.copyWithSyntaxHighlighting,"copyWithSyntaxHighlighting",!0,{description:g(328,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ue(new yG(x.cursorBlinking,"cursorBlinking",Rd.Blink,"blink",["blink","smooth","phase","expand","solid"],Uat,{description:g(329,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ue(new Br(x.cursorSmoothCaretAnimation,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[g(330,"Smooth caret animation is disabled."),g(331,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),g(332,"Smooth caret animation is always enabled.")],description:g(333,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Ue(new yG(x.cursorStyle,"cursorStyle",qr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],zat,{description:g(334,"Controls the cursor style.")})),cursorSurroundingLines:Ue(new bo(x.cursorSurroundingLines,"cursorSurroundingLines",0,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(335,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Ue(new Br(x.cursorSurroundingLinesStyle,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[g(336,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),g(337,"`cursorSurroundingLines` is enforced always.")],markdownDescription:g(338,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Ue(new bo(x.cursorWidth,"cursorWidth",0,0,Un.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(339,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ue(new Ln(x.disableLayerHinting,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ue(new Ln(x.disableMonospaceOptimizations,"disableMonospaceOptimizations",!1)),domReadOnly:Ue(new Ln(x.domReadOnly,"domReadOnly",!1)),dragAndDrop:Ue(new Ln(x.dragAndDrop,"dragAndDrop",!0,{description:g(340,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ue(new Gat),dropIntoEditor:Ue(new Act),stickyScroll:Ue(new Zat),experimentalWhitespaceRendering:Ue(new Br(x.experimentalWhitespaceRendering,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[g(341,"Use a new rendering method with svgs."),g(342,"Use a new rendering method with font characters."),g(343,"Use the stable rendering method.")],description:g(344,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Ue(new bh(x.extraEditorClassName,"extraEditorClassName","")),fastScrollSensitivity:Ue(new ip(x.fastScrollSensitivity,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:g(345,"Scrolling speed multiplier when pressing `Alt`.")})),find:Ue(new Kat),fixedOverflowWidgets:Ue(new Ln(x.fixedOverflowWidgets,"fixedOverflowWidgets",!1)),folding:Ue(new Ln(x.folding,"folding",!0,{description:g(346,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Ue(new Br(x.foldingStrategy,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[g(347,"Use a language-specific folding strategy if available, else the indentation-based one."),g(348,"Use the indentation-based folding strategy.")],description:g(349,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Ue(new Ln(x.foldingHighlight,"foldingHighlight",!0,{description:g(350,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ue(new Ln(x.foldingImportsByDefault,"foldingImportsByDefault",!1,{description:g(351,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ue(new bo(x.foldingMaximumRegions,"foldingMaximumRegions",5e3,10,65e3,{description:g(352,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Ue(new Ln(x.unfoldOnClickAfterEndOfLine,"unfoldOnClickAfterEndOfLine",!1,{description:g(353,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ue(new bh(x.fontFamily,"fontFamily",cd.fontFamily,{description:g(354,"Controls the font family.")})),fontInfo:Ue(new qat),fontLigatures2:Ue(new Lk),fontSize:Ue(new Qat),fontWeight:Ue(new nfe),fontVariations:Ue(new p8),formatOnPaste:Ue(new Ln(x.formatOnPaste,"formatOnPaste",!1,{description:g(355,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Ue(new Ln(x.formatOnType,"formatOnType",!1,{description:g(356,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ue(new Ln(x.glyphMargin,"glyphMargin",!0,{description:g(357,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Ue(new jat),hideCursorInOverviewRuler:Ue(new Ln(x.hideCursorInOverviewRuler,"hideCursorInOverviewRuler",!1,{description:g(358,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ue(new Yat),inDiffEditor:Ue(new Ln(x.inDiffEditor,"inDiffEditor",!1)),letterSpacing:Ue(new ip(x.letterSpacing,"letterSpacing",cd.letterSpacing,s=>ip.clamp(s,-5,20),{description:g(359,"Controls the letter spacing in pixels.")})),lightbulb:Ue(new Xat),lineDecorationsWidth:Ue(new tct),lineHeight:Ue(new ict),lineNumbers:Ue(new dct),lineNumbersMinChars:Ue(new bo(x.lineNumbersMinChars,"lineNumbersMinChars",5,1,300)),linkedEditing:Ue(new Ln(x.linkedEditing,"linkedEditing",!1,{description:g(360,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Ue(new Ln(x.links,"links",!0,{description:g(361,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ue(new Br(x.matchBrackets,"matchBrackets","always",["always","near","never"],{description:g(362,"Highlight matching brackets.")})),minimap:Ue(new nct),mouseStyle:Ue(new Br(x.mouseStyle,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ue(new ip(x.mouseWheelScrollSensitivity,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:g(363,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Ue(new Ln(x.mouseWheelZoom,"mouseWheelZoom",!1,{markdownDescription:Qt?g(364,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):g(365,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Ue(new Ln(x.multiCursorMergeOverlapping,"multiCursorMergeOverlapping",!0,{description:g(366,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ue(new yG(x.multiCursorModifier,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],sct,{markdownEnumDescriptions:[g(367,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(368,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:g(369,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Ue(new Br(x.multiCursorPaste,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[g(370,"Each cursor pastes a single line of the text."),g(371,"Each cursor pastes the full text.")],markdownDescription:g(372,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Ue(new bo(x.multiCursorLimit,"multiCursorLimit",1e4,1,1e5,{markdownDescription:g(373,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Ue(new Br(x.occurrencesHighlight,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[g(374,"Does not highlight occurrences."),g(375,"Highlights occurrences only in the current file."),g(376,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:g(377,"Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Ue(new Ln(x.overviewRulerBorder,"overviewRulerBorder",!0,{description:g(378,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ue(new bo(x.overviewRulerLanes,"overviewRulerLanes",3,0,3)),padding:Ue(new oct),pasteAs:Ue(new Ect),parameterHints:Ue(new rct),peekWidgetDefaultFocus:Ue(new Br(x.peekWidgetDefaultFocus,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[g(379,"Focus the tree when opening peek"),g(380,"Focus the editor when opening peek")],description:g(381,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:Ue(new cct),definitionLinkOpensInPeek:Ue(new Ln(x.definitionLinkOpensInPeek,"definitionLinkOpensInPeek",!1,{description:g(382,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ue(new lct),quickSuggestionsDelay:Ue(new bo(x.quickSuggestionsDelay,"quickSuggestionsDelay",10,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(383,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ue(new Ln(x.readOnly,"readOnly",!1)),readOnlyMessage:Ue(new uct),renameOnType:Ue(new Ln(x.renameOnType,"renameOnType",!1,{description:g(384,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:g(385,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ue(new Ln(x.renderControlCharacters,"renderControlCharacters",!0,{description:g(386,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ue(new Br(x.renderFinalNewline,"renderFinalNewline",pr?"dimmed":"on",["off","on","dimmed"],{description:g(387,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Ue(new Br(x.renderLineHighlight,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",g(388,"Highlights both the gutter and the current line.")],description:g(389,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Ue(new Ln(x.renderLineHighlightOnlyWhenFocus,"renderLineHighlightOnlyWhenFocus",!1,{description:g(390,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ue(new Br(x.renderValidationDecorations,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ue(new Br(x.renderWhitespace,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",g(391,"Render whitespace characters except for single spaces between words."),g(392,"Render whitespace characters only on selected text."),g(393,"Render only trailing whitespace characters."),""],description:g(394,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Ue(new bo(x.revealHorizontalRightPadding,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ue(new Ln(x.roundedSelection,"roundedSelection",!0,{description:g(395,"Controls whether selections should have rounded corners.")})),rulers:Ue(new hct),scrollbar:Ue(new gct),scrollBeyondLastColumn:Ue(new bo(x.scrollBeyondLastColumn,"scrollBeyondLastColumn",4,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(396,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ue(new Ln(x.scrollBeyondLastLine,"scrollBeyondLastLine",!0,{description:g(397,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ue(new Ln(x.scrollPredominantAxis,"scrollPredominantAxis",!0,{description:g(398,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Ue(new Ln(x.selectionClipboard,"selectionClipboard",!0,{description:g(399,"Controls whether the Linux primary clipboard should be supported."),included:pr})),selectionHighlight:Ue(new Ln(x.selectionHighlight,"selectionHighlight",!0,{description:g(400,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ue(new Ln(x.selectOnLineNumbers,"selectOnLineNumbers",!0)),showFoldingControls:Ue(new Br(x.showFoldingControls,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[g(401,"Always show the folding controls."),g(402,"Never show the folding controls and reduce the gutter size."),g(403,"Only show the folding controls when the mouse is over the gutter.")],description:g(404,"Controls when the folding controls on the gutter are shown.")})),showUnused:Ue(new Ln(x.showUnused,"showUnused",!0,{description:g(405,"Controls fading out of unused code.")})),showDeprecated:Ue(new Ln(x.showDeprecated,"showDeprecated",!0,{description:g(406,"Controls strikethrough deprecated variables.")})),inlayHints:Ue(new ect),snippetSuggestions:Ue(new Br(x.snippetSuggestions,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[g(407,"Show snippet suggestions on top of other suggestions."),g(408,"Show snippet suggestions below other suggestions."),g(409,"Show snippets suggestions with other suggestions."),g(410,"Do not show snippet suggestions.")],description:g(411,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Ue(new wct),smoothScrolling:Ue(new Ln(x.smoothScrolling,"smoothScrolling",!1,{description:g(412,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ue(new bo(x.stopRenderingLineAfter,"stopRenderingLineAfter",1e4,-1,Un.MAX_SAFE_SMALL_INTEGER)),suggest:Ue(new bct),inlineSuggest:Ue(new pct),inlineEdit:Ue(new mct),inlineCompletionsAccessibilityVerbose:Ue(new Ln(x.inlineCompletionsAccessibilityVerbose,"inlineCompletionsAccessibilityVerbose",!1,{description:g(413,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Ue(new bo(x.suggestFontSize,"suggestFontSize",0,0,1e3,{markdownDescription:g(414,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Ue(new bo(x.suggestLineHeight,"suggestLineHeight",0,0,1e3,{markdownDescription:g(415,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Ue(new Ln(x.suggestOnTriggerCharacters,"suggestOnTriggerCharacters",!0,{description:g(416,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ue(new Br(x.suggestSelection,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[g(417,"Always select the first suggestion."),g(418,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),g(419,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:g(420,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Ue(new Br(x.tabCompletion,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[g(421,"Tab complete will insert the best matching suggestion when pressing tab."),g(422,"Disable tab completions."),g(423,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:g(424,"Enables tab completions.")})),tabIndex:Ue(new bo(x.tabIndex,"tabIndex",0,-1,Un.MAX_SAFE_SMALL_INTEGER)),unicodeHighlight:Ue(new fct),unusualLineTerminators:Ue(new Br(x.unusualLineTerminators,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[g(425,"Unusual line terminators are automatically removed."),g(426,"Unusual line terminators are ignored."),g(427,"Unusual line terminators prompt to be removed.")],description:g(428,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Ue(new Ln(x.useShadowDOM,"useShadowDOM",!0)),useTabStops:Ue(new Ln(x.useTabStops,"useTabStops",!0,{description:g(429,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Ue(new Br(x.wordBreak,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[g(430,"Use the default line break rule."),g(431,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:g(432,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Ue(new yct),wordSeparators:Ue(new bh(x.wordSeparators,"wordSeparators",U6e,{description:g(433,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ue(new Br(x.wordWrap,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[g(434,"Lines will never wrap."),g(435,"Lines will wrap at the viewport width."),g(436,"Lines will wrap at `#editor.wordWrapColumn#`."),g(437,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:g(438,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Ue(new bh(x.wordWrapBreakAfterCharacters,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ue(new bh(x.wordWrapBreakBeforeCharacters,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ue(new bo(x.wordWrapColumn,"wordWrapColumn",80,1,Un.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(439,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Ue(new Br(x.wordWrapOverride1,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ue(new Br(x.wordWrapOverride2,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ue(new $at),defaultColorDecorators:Ue(new Ln(x.defaultColorDecorators,"defaultColorDecorators",!1,{markdownDescription:g(440,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ue(new act),tabFocusMode:Ue(new Ln(x.tabFocusMode,"tabFocusMode",!1,{markdownDescription:g(441,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ue(new xO),wrappingInfo:Ue(new Sct),wrappingIndent:Ue(new Cct),wrappingStrategy:Ue(new Jat)};var S;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(S||(S={}));var X;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.None=0]="None",s[s.Hyper=1]="Hyper",s[s.Super=2]="Super",s[s.Fn=3]="Fn",s[s.FnLock=4]="FnLock",s[s.Suspend=5]="Suspend",s[s.Resume=6]="Resume",s[s.Turbo=7]="Turbo",s[s.Sleep=8]="Sleep",s[s.WakeUp=9]="WakeUp",s[s.KeyA=10]="KeyA",s[s.KeyB=11]="KeyB",s[s.KeyC=12]="KeyC",s[s.KeyD=13]="KeyD",s[s.KeyE=14]="KeyE",s[s.KeyF=15]="KeyF",s[s.KeyG=16]="KeyG",s[s.KeyH=17]="KeyH",s[s.KeyI=18]="KeyI",s[s.KeyJ=19]="KeyJ",s[s.KeyK=20]="KeyK",s[s.KeyL=21]="KeyL",s[s.KeyM=22]="KeyM",s[s.KeyN=23]="KeyN",s[s.KeyO=24]="KeyO",s[s.KeyP=25]="KeyP",s[s.KeyQ=26]="KeyQ",s[s.KeyR=27]="KeyR",s[s.KeyS=28]="KeyS",s[s.KeyT=29]="KeyT",s[s.KeyU=30]="KeyU",s[s.KeyV=31]="KeyV",s[s.KeyW=32]="KeyW",s[s.KeyX=33]="KeyX",s[s.KeyY=34]="KeyY",s[s.KeyZ=35]="KeyZ",s[s.Digit1=36]="Digit1",s[s.Digit2=37]="Digit2",s[s.Digit3=38]="Digit3",s[s.Digit4=39]="Digit4",s[s.Digit5=40]="Digit5",s[s.Digit6=41]="Digit6",s[s.Digit7=42]="Digit7",s[s.Digit8=43]="Digit8",s[s.Digit9=44]="Digit9",s[s.Digit0=45]="Digit0",s[s.Enter=46]="Enter",s[s.Escape=47]="Escape",s[s.Backspace=48]="Backspace",s[s.Tab=49]="Tab",s[s.Space=50]="Space",s[s.Minus=51]="Minus",s[s.Equal=52]="Equal",s[s.BracketLeft=53]="BracketLeft",s[s.BracketRight=54]="BracketRight",s[s.Backslash=55]="Backslash",s[s.IntlHash=56]="IntlHash",s[s.Semicolon=57]="Semicolon",s[s.Quote=58]="Quote",s[s.Backquote=59]="Backquote",s[s.Comma=60]="Comma",s[s.Period=61]="Period",s[s.Slash=62]="Slash",s[s.CapsLock=63]="CapsLock",s[s.F1=64]="F1",s[s.F2=65]="F2",s[s.F3=66]="F3",s[s.F4=67]="F4",s[s.F5=68]="F5",s[s.F6=69]="F6",s[s.F7=70]="F7",s[s.F8=71]="F8",s[s.F9=72]="F9",s[s.F10=73]="F10",s[s.F11=74]="F11",s[s.F12=75]="F12",s[s.PrintScreen=76]="PrintScreen",s[s.ScrollLock=77]="ScrollLock",s[s.Pause=78]="Pause",s[s.Insert=79]="Insert",s[s.Home=80]="Home",s[s.PageUp=81]="PageUp",s[s.Delete=82]="Delete",s[s.End=83]="End",s[s.PageDown=84]="PageDown",s[s.ArrowRight=85]="ArrowRight",s[s.ArrowLeft=86]="ArrowLeft",s[s.ArrowDown=87]="ArrowDown",s[s.ArrowUp=88]="ArrowUp",s[s.NumLock=89]="NumLock",s[s.NumpadDivide=90]="NumpadDivide",s[s.NumpadMultiply=91]="NumpadMultiply",s[s.NumpadSubtract=92]="NumpadSubtract",s[s.NumpadAdd=93]="NumpadAdd",s[s.NumpadEnter=94]="NumpadEnter",s[s.Numpad1=95]="Numpad1",s[s.Numpad2=96]="Numpad2",s[s.Numpad3=97]="Numpad3",s[s.Numpad4=98]="Numpad4",s[s.Numpad5=99]="Numpad5",s[s.Numpad6=100]="Numpad6",s[s.Numpad7=101]="Numpad7",s[s.Numpad8=102]="Numpad8",s[s.Numpad9=103]="Numpad9",s[s.Numpad0=104]="Numpad0",s[s.NumpadDecimal=105]="NumpadDecimal",s[s.IntlBackslash=106]="IntlBackslash",s[s.ContextMenu=107]="ContextMenu",s[s.Power=108]="Power",s[s.NumpadEqual=109]="NumpadEqual",s[s.F13=110]="F13",s[s.F14=111]="F14",s[s.F15=112]="F15",s[s.F16=113]="F16",s[s.F17=114]="F17",s[s.F18=115]="F18",s[s.F19=116]="F19",s[s.F20=117]="F20",s[s.F21=118]="F21",s[s.F22=119]="F22",s[s.F23=120]="F23",s[s.F24=121]="F24",s[s.Open=122]="Open",s[s.Help=123]="Help",s[s.Select=124]="Select",s[s.Again=125]="Again",s[s.Undo=126]="Undo",s[s.Cut=127]="Cut",s[s.Copy=128]="Copy",s[s.Paste=129]="Paste",s[s.Find=130]="Find",s[s.AudioVolumeMute=131]="AudioVolumeMute",s[s.AudioVolumeUp=132]="AudioVolumeUp",s[s.AudioVolumeDown=133]="AudioVolumeDown",s[s.NumpadComma=134]="NumpadComma",s[s.IntlRo=135]="IntlRo",s[s.KanaMode=136]="KanaMode",s[s.IntlYen=137]="IntlYen",s[s.Convert=138]="Convert",s[s.NonConvert=139]="NonConvert",s[s.Lang1=140]="Lang1",s[s.Lang2=141]="Lang2",s[s.Lang3=142]="Lang3",s[s.Lang4=143]="Lang4",s[s.Lang5=144]="Lang5",s[s.Abort=145]="Abort",s[s.Props=146]="Props",s[s.NumpadParenLeft=147]="NumpadParenLeft",s[s.NumpadParenRight=148]="NumpadParenRight",s[s.NumpadBackspace=149]="NumpadBackspace",s[s.NumpadMemoryStore=150]="NumpadMemoryStore",s[s.NumpadMemoryRecall=151]="NumpadMemoryRecall",s[s.NumpadMemoryClear=152]="NumpadMemoryClear",s[s.NumpadMemoryAdd=153]="NumpadMemoryAdd",s[s.NumpadMemorySubtract=154]="NumpadMemorySubtract",s[s.NumpadClear=155]="NumpadClear",s[s.NumpadClearEntry=156]="NumpadClearEntry",s[s.ControlLeft=157]="ControlLeft",s[s.ShiftLeft=158]="ShiftLeft",s[s.AltLeft=159]="AltLeft",s[s.MetaLeft=160]="MetaLeft",s[s.ControlRight=161]="ControlRight",s[s.ShiftRight=162]="ShiftRight",s[s.AltRight=163]="AltRight",s[s.MetaRight=164]="MetaRight",s[s.BrightnessUp=165]="BrightnessUp",s[s.BrightnessDown=166]="BrightnessDown",s[s.MediaPlay=167]="MediaPlay",s[s.MediaRecord=168]="MediaRecord",s[s.MediaFastForward=169]="MediaFastForward",s[s.MediaRewind=170]="MediaRewind",s[s.MediaTrackNext=171]="MediaTrackNext",s[s.MediaTrackPrevious=172]="MediaTrackPrevious",s[s.MediaStop=173]="MediaStop",s[s.Eject=174]="Eject",s[s.MediaPlayPause=175]="MediaPlayPause",s[s.MediaSelect=176]="MediaSelect",s[s.LaunchMail=177]="LaunchMail",s[s.LaunchApp2=178]="LaunchApp2",s[s.LaunchApp1=179]="LaunchApp1",s[s.SelectTask=180]="SelectTask",s[s.LaunchScreenSaver=181]="LaunchScreenSaver",s[s.BrowserSearch=182]="BrowserSearch",s[s.BrowserHome=183]="BrowserHome",s[s.BrowserBack=184]="BrowserBack",s[s.BrowserForward=185]="BrowserForward",s[s.BrowserStop=186]="BrowserStop",s[s.BrowserRefresh=187]="BrowserRefresh",s[s.BrowserFavorites=188]="BrowserFavorites",s[s.ZoomToggle=189]="ZoomToggle",s[s.MailReply=190]="MailReply",s[s.MailForward=191]="MailForward",s[s.MailSend=192]="MailSend",s[s.MAX_VALUE=193]="MAX_VALUE"})(X||(X={}));class tTe{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||S.Unknown}}const hq=new tTe,sfe=new tTe,ofe=new tTe,sGe=new Array(230),rfe={},oGe=[],rGe=Object.create(null),aGe=Object.create(null),Vp={lowerCaseToEnum:s=>aGe[s]||X.None,toEnum:s=>rGe[s]||X.None,toString:s=>oGe[s]||"None"},Vg=[],m8=[];for(let s=0;s<=X.MAX_VALUE;s++)Vg[s]=S.DependsOnKbLayout;for(let s=0;s<=S.MAX_VALUE;s++)m8[s]=X.DependsOnKbLayout;(function(){const s="",e=[[1,X.None,"None",S.Unknown,"unknown",0,"VK_UNKNOWN",s,s],[1,X.Hyper,"Hyper",S.Unknown,s,0,s,s,s],[1,X.Super,"Super",S.Unknown,s,0,s,s,s],[1,X.Fn,"Fn",S.Unknown,s,0,s,s,s],[1,X.FnLock,"FnLock",S.Unknown,s,0,s,s,s],[1,X.Suspend,"Suspend",S.Unknown,s,0,s,s,s],[1,X.Resume,"Resume",S.Unknown,s,0,s,s,s],[1,X.Turbo,"Turbo",S.Unknown,s,0,s,s,s],[1,X.Sleep,"Sleep",S.Unknown,s,0,"VK_SLEEP",s,s],[1,X.WakeUp,"WakeUp",S.Unknown,s,0,s,s,s],[0,X.KeyA,"KeyA",S.KeyA,"A",65,"VK_A",s,s],[0,X.KeyB,"KeyB",S.KeyB,"B",66,"VK_B",s,s],[0,X.KeyC,"KeyC",S.KeyC,"C",67,"VK_C",s,s],[0,X.KeyD,"KeyD",S.KeyD,"D",68,"VK_D",s,s],[0,X.KeyE,"KeyE",S.KeyE,"E",69,"VK_E",s,s],[0,X.KeyF,"KeyF",S.KeyF,"F",70,"VK_F",s,s],[0,X.KeyG,"KeyG",S.KeyG,"G",71,"VK_G",s,s],[0,X.KeyH,"KeyH",S.KeyH,"H",72,"VK_H",s,s],[0,X.KeyI,"KeyI",S.KeyI,"I",73,"VK_I",s,s],[0,X.KeyJ,"KeyJ",S.KeyJ,"J",74,"VK_J",s,s],[0,X.KeyK,"KeyK",S.KeyK,"K",75,"VK_K",s,s],[0,X.KeyL,"KeyL",S.KeyL,"L",76,"VK_L",s,s],[0,X.KeyM,"KeyM",S.KeyM,"M",77,"VK_M",s,s],[0,X.KeyN,"KeyN",S.KeyN,"N",78,"VK_N",s,s],[0,X.KeyO,"KeyO",S.KeyO,"O",79,"VK_O",s,s],[0,X.KeyP,"KeyP",S.KeyP,"P",80,"VK_P",s,s],[0,X.KeyQ,"KeyQ",S.KeyQ,"Q",81,"VK_Q",s,s],[0,X.KeyR,"KeyR",S.KeyR,"R",82,"VK_R",s,s],[0,X.KeyS,"KeyS",S.KeyS,"S",83,"VK_S",s,s],[0,X.KeyT,"KeyT",S.KeyT,"T",84,"VK_T",s,s],[0,X.KeyU,"KeyU",S.KeyU,"U",85,"VK_U",s,s],[0,X.KeyV,"KeyV",S.KeyV,"V",86,"VK_V",s,s],[0,X.KeyW,"KeyW",S.KeyW,"W",87,"VK_W",s,s],[0,X.KeyX,"KeyX",S.KeyX,"X",88,"VK_X",s,s],[0,X.KeyY,"KeyY",S.KeyY,"Y",89,"VK_Y",s,s],[0,X.KeyZ,"KeyZ",S.KeyZ,"Z",90,"VK_Z",s,s],[0,X.Digit1,"Digit1",S.Digit1,"1",49,"VK_1",s,s],[0,X.Digit2,"Digit2",S.Digit2,"2",50,"VK_2",s,s],[0,X.Digit3,"Digit3",S.Digit3,"3",51,"VK_3",s,s],[0,X.Digit4,"Digit4",S.Digit4,"4",52,"VK_4",s,s],[0,X.Digit5,"Digit5",S.Digit5,"5",53,"VK_5",s,s],[0,X.Digit6,"Digit6",S.Digit6,"6",54,"VK_6",s,s],[0,X.Digit7,"Digit7",S.Digit7,"7",55,"VK_7",s,s],[0,X.Digit8,"Digit8",S.Digit8,"8",56,"VK_8",s,s],[0,X.Digit9,"Digit9",S.Digit9,"9",57,"VK_9",s,s],[0,X.Digit0,"Digit0",S.Digit0,"0",48,"VK_0",s,s],[1,X.Enter,"Enter",S.Enter,"Enter",13,"VK_RETURN",s,s],[1,X.Escape,"Escape",S.Escape,"Escape",27,"VK_ESCAPE",s,s],[1,X.Backspace,"Backspace",S.Backspace,"Backspace",8,"VK_BACK",s,s],[1,X.Tab,"Tab",S.Tab,"Tab",9,"VK_TAB",s,s],[1,X.Space,"Space",S.Space,"Space",32,"VK_SPACE",s,s],[0,X.Minus,"Minus",S.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,X.Equal,"Equal",S.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,X.BracketLeft,"BracketLeft",S.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,X.BracketRight,"BracketRight",S.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,X.Backslash,"Backslash",S.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,X.IntlHash,"IntlHash",S.Unknown,s,0,s,s,s],[0,X.Semicolon,"Semicolon",S.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,X.Quote,"Quote",S.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,X.Backquote,"Backquote",S.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,X.Comma,"Comma",S.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,X.Period,"Period",S.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,X.Slash,"Slash",S.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,X.CapsLock,"CapsLock",S.CapsLock,"CapsLock",20,"VK_CAPITAL",s,s],[1,X.F1,"F1",S.F1,"F1",112,"VK_F1",s,s],[1,X.F2,"F2",S.F2,"F2",113,"VK_F2",s,s],[1,X.F3,"F3",S.F3,"F3",114,"VK_F3",s,s],[1,X.F4,"F4",S.F4,"F4",115,"VK_F4",s,s],[1,X.F5,"F5",S.F5,"F5",116,"VK_F5",s,s],[1,X.F6,"F6",S.F6,"F6",117,"VK_F6",s,s],[1,X.F7,"F7",S.F7,"F7",118,"VK_F7",s,s],[1,X.F8,"F8",S.F8,"F8",119,"VK_F8",s,s],[1,X.F9,"F9",S.F9,"F9",120,"VK_F9",s,s],[1,X.F10,"F10",S.F10,"F10",121,"VK_F10",s,s],[1,X.F11,"F11",S.F11,"F11",122,"VK_F11",s,s],[1,X.F12,"F12",S.F12,"F12",123,"VK_F12",s,s],[1,X.PrintScreen,"PrintScreen",S.Unknown,s,0,s,s,s],[1,X.ScrollLock,"ScrollLock",S.ScrollLock,"ScrollLock",145,"VK_SCROLL",s,s],[1,X.Pause,"Pause",S.PauseBreak,"PauseBreak",19,"VK_PAUSE",s,s],[1,X.Insert,"Insert",S.Insert,"Insert",45,"VK_INSERT",s,s],[1,X.Home,"Home",S.Home,"Home",36,"VK_HOME",s,s],[1,X.PageUp,"PageUp",S.PageUp,"PageUp",33,"VK_PRIOR",s,s],[1,X.Delete,"Delete",S.Delete,"Delete",46,"VK_DELETE",s,s],[1,X.End,"End",S.End,"End",35,"VK_END",s,s],[1,X.PageDown,"PageDown",S.PageDown,"PageDown",34,"VK_NEXT",s,s],[1,X.ArrowRight,"ArrowRight",S.RightArrow,"RightArrow",39,"VK_RIGHT","Right",s],[1,X.ArrowLeft,"ArrowLeft",S.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",s],[1,X.ArrowDown,"ArrowDown",S.DownArrow,"DownArrow",40,"VK_DOWN","Down",s],[1,X.ArrowUp,"ArrowUp",S.UpArrow,"UpArrow",38,"VK_UP","Up",s],[1,X.NumLock,"NumLock",S.NumLock,"NumLock",144,"VK_NUMLOCK",s,s],[1,X.NumpadDivide,"NumpadDivide",S.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE",s,s],[1,X.NumpadMultiply,"NumpadMultiply",S.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY",s,s],[1,X.NumpadSubtract,"NumpadSubtract",S.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT",s,s],[1,X.NumpadAdd,"NumpadAdd",S.NumpadAdd,"NumPad_Add",107,"VK_ADD",s,s],[1,X.NumpadEnter,"NumpadEnter",S.Enter,s,0,s,s,s],[1,X.Numpad1,"Numpad1",S.Numpad1,"NumPad1",97,"VK_NUMPAD1",s,s],[1,X.Numpad2,"Numpad2",S.Numpad2,"NumPad2",98,"VK_NUMPAD2",s,s],[1,X.Numpad3,"Numpad3",S.Numpad3,"NumPad3",99,"VK_NUMPAD3",s,s],[1,X.Numpad4,"Numpad4",S.Numpad4,"NumPad4",100,"VK_NUMPAD4",s,s],[1,X.Numpad5,"Numpad5",S.Numpad5,"NumPad5",101,"VK_NUMPAD5",s,s],[1,X.Numpad6,"Numpad6",S.Numpad6,"NumPad6",102,"VK_NUMPAD6",s,s],[1,X.Numpad7,"Numpad7",S.Numpad7,"NumPad7",103,"VK_NUMPAD7",s,s],[1,X.Numpad8,"Numpad8",S.Numpad8,"NumPad8",104,"VK_NUMPAD8",s,s],[1,X.Numpad9,"Numpad9",S.Numpad9,"NumPad9",105,"VK_NUMPAD9",s,s],[1,X.Numpad0,"Numpad0",S.Numpad0,"NumPad0",96,"VK_NUMPAD0",s,s],[1,X.NumpadDecimal,"NumpadDecimal",S.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL",s,s],[0,X.IntlBackslash,"IntlBackslash",S.IntlBackslash,"OEM_102",226,"VK_OEM_102",s,s],[1,X.ContextMenu,"ContextMenu",S.ContextMenu,"ContextMenu",93,s,s,s],[1,X.Power,"Power",S.Unknown,s,0,s,s,s],[1,X.NumpadEqual,"NumpadEqual",S.Unknown,s,0,s,s,s],[1,X.F13,"F13",S.F13,"F13",124,"VK_F13",s,s],[1,X.F14,"F14",S.F14,"F14",125,"VK_F14",s,s],[1,X.F15,"F15",S.F15,"F15",126,"VK_F15",s,s],[1,X.F16,"F16",S.F16,"F16",127,"VK_F16",s,s],[1,X.F17,"F17",S.F17,"F17",128,"VK_F17",s,s],[1,X.F18,"F18",S.F18,"F18",129,"VK_F18",s,s],[1,X.F19,"F19",S.F19,"F19",130,"VK_F19",s,s],[1,X.F20,"F20",S.F20,"F20",131,"VK_F20",s,s],[1,X.F21,"F21",S.F21,"F21",132,"VK_F21",s,s],[1,X.F22,"F22",S.F22,"F22",133,"VK_F22",s,s],[1,X.F23,"F23",S.F23,"F23",134,"VK_F23",s,s],[1,X.F24,"F24",S.F24,"F24",135,"VK_F24",s,s],[1,X.Open,"Open",S.Unknown,s,0,s,s,s],[1,X.Help,"Help",S.Unknown,s,0,s,s,s],[1,X.Select,"Select",S.Unknown,s,0,s,s,s],[1,X.Again,"Again",S.Unknown,s,0,s,s,s],[1,X.Undo,"Undo",S.Unknown,s,0,s,s,s],[1,X.Cut,"Cut",S.Unknown,s,0,s,s,s],[1,X.Copy,"Copy",S.Unknown,s,0,s,s,s],[1,X.Paste,"Paste",S.Unknown,s,0,s,s,s],[1,X.Find,"Find",S.Unknown,s,0,s,s,s],[1,X.AudioVolumeMute,"AudioVolumeMute",S.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE",s,s],[1,X.AudioVolumeUp,"AudioVolumeUp",S.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP",s,s],[1,X.AudioVolumeDown,"AudioVolumeDown",S.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN",s,s],[1,X.NumpadComma,"NumpadComma",S.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR",s,s],[0,X.IntlRo,"IntlRo",S.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1",s,s],[1,X.KanaMode,"KanaMode",S.Unknown,s,0,s,s,s],[0,X.IntlYen,"IntlYen",S.Unknown,s,0,s,s,s],[1,X.Convert,"Convert",S.Unknown,s,0,s,s,s],[1,X.NonConvert,"NonConvert",S.Unknown,s,0,s,s,s],[1,X.Lang1,"Lang1",S.Unknown,s,0,s,s,s],[1,X.Lang2,"Lang2",S.Unknown,s,0,s,s,s],[1,X.Lang3,"Lang3",S.Unknown,s,0,s,s,s],[1,X.Lang4,"Lang4",S.Unknown,s,0,s,s,s],[1,X.Lang5,"Lang5",S.Unknown,s,0,s,s,s],[1,X.Abort,"Abort",S.Unknown,s,0,s,s,s],[1,X.Props,"Props",S.Unknown,s,0,s,s,s],[1,X.NumpadParenLeft,"NumpadParenLeft",S.Unknown,s,0,s,s,s],[1,X.NumpadParenRight,"NumpadParenRight",S.Unknown,s,0,s,s,s],[1,X.NumpadBackspace,"NumpadBackspace",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryStore,"NumpadMemoryStore",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryRecall,"NumpadMemoryRecall",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryClear,"NumpadMemoryClear",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryAdd,"NumpadMemoryAdd",S.Unknown,s,0,s,s,s],[1,X.NumpadMemorySubtract,"NumpadMemorySubtract",S.Unknown,s,0,s,s,s],[1,X.NumpadClear,"NumpadClear",S.Clear,"Clear",12,"VK_CLEAR",s,s],[1,X.NumpadClearEntry,"NumpadClearEntry",S.Unknown,s,0,s,s,s],[1,X.None,s,S.Ctrl,"Ctrl",17,"VK_CONTROL",s,s],[1,X.None,s,S.Shift,"Shift",16,"VK_SHIFT",s,s],[1,X.None,s,S.Alt,"Alt",18,"VK_MENU",s,s],[1,X.None,s,S.Meta,"Meta",91,"VK_COMMAND",s,s],[1,X.ControlLeft,"ControlLeft",S.Ctrl,s,0,"VK_LCONTROL",s,s],[1,X.ShiftLeft,"ShiftLeft",S.Shift,s,0,"VK_LSHIFT",s,s],[1,X.AltLeft,"AltLeft",S.Alt,s,0,"VK_LMENU",s,s],[1,X.MetaLeft,"MetaLeft",S.Meta,s,0,"VK_LWIN",s,s],[1,X.ControlRight,"ControlRight",S.Ctrl,s,0,"VK_RCONTROL",s,s],[1,X.ShiftRight,"ShiftRight",S.Shift,s,0,"VK_RSHIFT",s,s],[1,X.AltRight,"AltRight",S.Alt,s,0,"VK_RMENU",s,s],[1,X.MetaRight,"MetaRight",S.Meta,s,0,"VK_RWIN",s,s],[1,X.BrightnessUp,"BrightnessUp",S.Unknown,s,0,s,s,s],[1,X.BrightnessDown,"BrightnessDown",S.Unknown,s,0,s,s,s],[1,X.MediaPlay,"MediaPlay",S.Unknown,s,0,s,s,s],[1,X.MediaRecord,"MediaRecord",S.Unknown,s,0,s,s,s],[1,X.MediaFastForward,"MediaFastForward",S.Unknown,s,0,s,s,s],[1,X.MediaRewind,"MediaRewind",S.Unknown,s,0,s,s,s],[1,X.MediaTrackNext,"MediaTrackNext",S.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",s,s],[1,X.MediaTrackPrevious,"MediaTrackPrevious",S.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",s,s],[1,X.MediaStop,"MediaStop",S.MediaStop,"MediaStop",178,"VK_MEDIA_STOP",s,s],[1,X.Eject,"Eject",S.Unknown,s,0,s,s,s],[1,X.MediaPlayPause,"MediaPlayPause",S.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",s,s],[1,X.MediaSelect,"MediaSelect",S.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",s,s],[1,X.LaunchMail,"LaunchMail",S.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",s,s],[1,X.LaunchApp2,"LaunchApp2",S.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",s,s],[1,X.LaunchApp1,"LaunchApp1",S.Unknown,s,0,"VK_MEDIA_LAUNCH_APP1",s,s],[1,X.SelectTask,"SelectTask",S.Unknown,s,0,s,s,s],[1,X.LaunchScreenSaver,"LaunchScreenSaver",S.Unknown,s,0,s,s,s],[1,X.BrowserSearch,"BrowserSearch",S.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH",s,s],[1,X.BrowserHome,"BrowserHome",S.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME",s,s],[1,X.BrowserBack,"BrowserBack",S.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK",s,s],[1,X.BrowserForward,"BrowserForward",S.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD",s,s],[1,X.BrowserStop,"BrowserStop",S.Unknown,s,0,"VK_BROWSER_STOP",s,s],[1,X.BrowserRefresh,"BrowserRefresh",S.Unknown,s,0,"VK_BROWSER_REFRESH",s,s],[1,X.BrowserFavorites,"BrowserFavorites",S.Unknown,s,0,"VK_BROWSER_FAVORITES",s,s],[1,X.ZoomToggle,"ZoomToggle",S.Unknown,s,0,s,s,s],[1,X.MailReply,"MailReply",S.Unknown,s,0,s,s,s],[1,X.MailForward,"MailForward",S.Unknown,s,0,s,s,s],[1,X.MailSend,"MailSend",S.Unknown,s,0,s,s,s],[1,X.None,s,S.KEY_IN_COMPOSITION,"KeyInComposition",229,s,s,s],[1,X.None,s,S.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2",s,s],[1,X.None,s,S.OEM_8,"OEM_8",223,"VK_OEM_8",s,s],[1,X.None,s,S.Unknown,s,0,"VK_KANA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HANGUL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_JUNJA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_FINAL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HANJA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_KANJI",s,s],[1,X.None,s,S.Unknown,s,0,"VK_CONVERT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_NONCONVERT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ACCEPT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_MODECHANGE",s,s],[1,X.None,s,S.Unknown,s,0,"VK_SELECT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PRINT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EXECUTE",s,s],[1,X.None,s,S.Unknown,s,0,"VK_SNAPSHOT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HELP",s,s],[1,X.None,s,S.Unknown,s,0,"VK_APPS",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PROCESSKEY",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PACKET",s,s],[1,X.None,s,S.Unknown,s,0,"VK_DBE_SBCSCHAR",s,s],[1,X.None,s,S.Unknown,s,0,"VK_DBE_DBCSCHAR",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ATTN",s,s],[1,X.None,s,S.Unknown,s,0,"VK_CRSEL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EXSEL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EREOF",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PLAY",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ZOOM",s,s],[1,X.None,s,S.Unknown,s,0,"VK_NONAME",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PA1",s,s],[1,X.None,s,S.Unknown,s,0,"VK_OEM_CLEAR",s,s]],t=[],i=[];for(const n of e){const[o,r,a,c,l,d,h,u,f]=n;if(i[r]||(i[r]=!0,oGe[r]=a,rGe[a]=r,aGe[a.toLowerCase()]=r,o&&(Vg[r]=c,c!==S.Unknown&&c!==S.Enter&&c!==S.Ctrl&&c!==S.Shift&&c!==S.Alt&&c!==S.Meta&&(m8[c]=r))),!t[c]){if(t[c]=!0,!l)throw new Error(`String representation missing for key code ${c} around scan code ${a}`);hq.define(c,l),sfe.define(c,u||l),ofe.define(c,f||u||l)}d&&(sGe[d]=c),h&&(rfe[h]=c)}m8[S.Enter]=X.Enter})();var Ia;(function(s){function e(a){return hq.keyCodeToStr(a)}s.toString=e;function t(a){return hq.strToKeyCode(a)}s.fromString=t;function i(a){return sfe.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return ofe.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return sfe.strToKeyCode(a)||ofe.strToKeyCode(a)}s.fromUserSettings=o;function r(a){if(a>=S.Numpad0&&a<=S.NumpadDivide)return null;switch(a){case S.UpArrow:return"Up";case S.DownArrow:return"Down";case S.LeftArrow:return"Left";case S.RightArrow:return"Right"}return hq.keyCodeToStr(a)}s.toElectronAccelerator=r})(Ia||(Ia={}));var U;(function(s){s[s.CtrlCmd=2048]="CtrlCmd",s[s.Shift=1024]="Shift",s[s.Alt=512]="Alt",s[s.WinCtrl=256]="WinCtrl"})(U||(U={}));function rr(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var ws;(function(s){s[s.Uri=1]="Uri",s[s.Regexp=2]="Regexp",s[s.ScmResource=3]="ScmResource",s[s.ScmResourceGroup=4]="ScmResourceGroup",s[s.ScmProvider=5]="ScmProvider",s[s.CommentController=6]="CommentController",s[s.CommentThread=7]="CommentThread",s[s.CommentThreadInstance=8]="CommentThreadInstance",s[s.CommentThreadReply=9]="CommentThreadReply",s[s.CommentNode=10]="CommentNode",s[s.CommentThreadNode=11]="CommentThreadNode",s[s.TimelineActionContext=12]="TimelineActionContext",s[s.NotebookCellActionContext=13]="NotebookCellActionContext",s[s.NotebookActionContext=14]="NotebookActionContext",s[s.TerminalContext=15]="TerminalContext",s[s.TestItemContext=16]="TestItemContext",s[s.Date=17]="Date",s[s.TestMessageMenuArgs=18]="TestMessageMenuArgs"})(ws||(ws={}));var RFe={};let mT;const vde=globalThis.vscode;if(typeof vde<"u"&&typeof vde.process<"u"){const s=vde.process;mT={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?mT={get platform(){return process.platform},get arch(){return process.arch},get env(){return RFe},cwd(){return RFe.VSCODE_CWD||process.cwd()}}:mT={get platform(){return Qn?"win32":Qt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const x2=mT.cwd,D2=mT.env,cGe=mT.platform,Ict=mT.arch,Tct=65,Lct=97,Rct=90,Mct=122,Yx=46,lh=47,Sf=92,cE=58,Nct=63;class lGe extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function Pct(s,e){if(s===null||typeof s!="object")throw new lGe(e,"Object",s)}function il(s,e){if(typeof s!="string")throw new lGe(e,"string",s)}const rv=cGe==="win32";function Os(s){return s===lh||s===Sf}function afe(s){return s===lh}function lE(s){return s>=Tct&&s<=Rct||s>=Lct&&s<=Mct}function Mj(s,e,t,i){let n="",o=0,r=-1,a=0,c=0;for(let l=0;l<=s.length;++l){if(l2){const d=n.lastIndexOf(t);d===-1?(n="",o=0):(n=n.slice(0,d),o=n.length-1-n.lastIndexOf(t)),r=l,a=0;continue}else if(n.length!==0){n="",o=0,r=l,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",o=2)}else n.length>0?n+=`${t}${s.slice(r+1,l)}`:n=s.slice(r+1,l),o=l-r-1;r=l,a=0}else c===Yx&&a!==-1?++a:a=-1}return n}function Fct(s){return s?`${s[0]==="."?"":"."}${s}`:""}function dGe(s,e){Pct(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${Fct(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const cc={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let o;if(n>=0){if(o=s[n],il(o,`paths[${n}]`),o.length===0)continue}else e.length===0?o=x2():(o=D2[`=${e}`]||x2(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Sf)&&(o=`${e}\\`));const r=o.length;let a=0,c="",l=!1;const d=o.charCodeAt(0);if(r===1)Os(d)&&(a=1,l=!0);else if(Os(d))if(l=!0,Os(o.charCodeAt(1))){let h=2,u=h;for(;h2&&Os(o.charCodeAt(2))&&(l=!0,a=3));if(c.length>0)if(e.length>0){if(c.toLowerCase()!==e.toLowerCase())continue}else e=c;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=l,l&&e.length>0)break}return t=Mj(t,!i,"\\",Os),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){il(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const o=s.charCodeAt(0);if(e===1)return afe(o)?"\\":s;if(Os(o))if(n=!0,Os(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Os(s.charCodeAt(2))&&(n=!0,t=3));let r=t0&&Os(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){il(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return Os(t)||e>2&&lE(t)&&s.charCodeAt(1)===cE&&Os(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&Os(t.charCodeAt(0))){++n;const o=t.length;o>1&&Os(t.charCodeAt(1))&&(++n,o>2&&(Os(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return cc.normalize(e)},relative(s,e){if(il(s,"from"),il(e,"to"),s===e)return"";const t=cc.resolve(s),i=cc.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;nn&&s.charCodeAt(o-1)===Sf;)o--;const r=o-n;let a=0;for(;aa&&e.charCodeAt(c-1)===Sf;)c--;const l=c-a,d=rd){if(e.charCodeAt(a+u)===Sf)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>d&&(s.charCodeAt(n+u)===Sf?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=n+h+1;u<=o;++u)(u===o||s.charCodeAt(u)===Sf)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${i.slice(a,c)}`:(i.charCodeAt(a)===Sf&&++a,i.slice(a,c))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=cc.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===Sf){if(e.charCodeAt(1)===Sf){const t=e.charCodeAt(2);if(t!==Nct&&t!==Yx)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(lE(e.charCodeAt(0))&&e.charCodeAt(1)===cE&&e.charCodeAt(2)===Sf)return`\\\\?\\${e}`;return s},dirname(s){il(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return Os(n)?s:".";if(Os(n)){if(t=i=1,Os(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Os(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(Os(s.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return s.slice(0,o)},basename(s,e){e!==void 0&&il(e,"suffix"),il(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&lE(s.charCodeAt(0))&&s.charCodeAt(1)===cE&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=t;--o){const c=s.charCodeAt(o);if(Os(c)){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=t;--o)if(Os(s.charCodeAt(o))){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){il(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===cE&&lE(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const c=s.charCodeAt(a);if(Os(c)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),c===Yx?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":s.slice(t,n)},format:dGe.bind(null,"\\"),parse(s){il(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let i=0,n=s.charCodeAt(0);if(t===1)return Os(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(Os(n)){if(i=1,Os(s.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=s.slice(0,i));let o=-1,r=i,a=-1,c=!0,l=s.length-1,d=0;for(;l>=i;--l){if(n=s.charCodeAt(l),Os(n)){if(!c){r=l+1;break}continue}a===-1&&(c=!1,a=l+1),n===Yx?o===-1?o=l:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=s.slice(r,a):(e.name=s.slice(r,o),e.base=s.slice(r,a),e.ext=s.slice(o,a))),r>0&&r!==i?e.dir=s.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Oct=(()=>{if(rv){const s=/\\/g;return()=>{const e=x2().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>x2()})(),Vi={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:Oct();il(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===lh)}return e=Mj(e,!t,"/",afe),t?`/${e}`:e.length>0?e:"."},normalize(s){if(il(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===lh,t=s.charCodeAt(s.length-1)===lh;return s=Mj(s,!e,"/",afe),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return il(s,"path"),s.length>0&&s.charCodeAt(0)===lh},join(...s){if(s.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Vi.normalize(e)},relative(s,e){if(il(s,"from"),il(e,"to"),s===e||(s=Vi.resolve(s),e=Vi.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,o=1,r=e.length-o,a=na){if(e.charCodeAt(o+l)===lh)return e.slice(o+l+1);if(l===0)return e.slice(o+l)}else n>a&&(s.charCodeAt(t+l)===lh?c=l:l===0&&(c=0));let d="";for(l=t+c+1;l<=i;++l)(l===i||s.charCodeAt(l)===lh)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+c)}`},toNamespacedPath(s){return s},dirname(s){if(il(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===lh;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===lh){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&il(e,"ext"),il(s,"path");let t=0,i=-1,n=!0,o;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=0;--o){const c=s.charCodeAt(o);if(c===lh){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=0;--o)if(s.charCodeAt(o)===lh){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){il(s,"path");let e=-1,t=0,i=-1,n=!0,o=0;for(let r=s.length-1;r>=0;--r){const a=s.charCodeAt(r);if(a===lh){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===Yx?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":s.slice(e,i)},format:dGe.bind(null,"/"),parse(s){il(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===lh;let i;t?(e.root="/",i=1):i=0;let n=-1,o=0,r=-1,a=!0,c=s.length-1,l=0;for(;c>=i;--c){const d=s.charCodeAt(c);if(d===lh){if(!a){o=c+1;break}continue}r===-1&&(a=!1,r=c+1),d===Yx?n===-1?n=c:l!==1&&(l=1):n!==-1&&(l=-1)}if(r!==-1){const d=o===0&&t?1:o;n===-1||l===0||l===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(d,r):(e.name=s.slice(d,n),e.base=s.slice(d,r),e.ext=s.slice(n,r))}return o>0?e.dir=s.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Vi.win32=cc.win32=cc;Vi.posix=cc.posix=Vi;const Rk=rv?cc.normalize:Vi.normalize,pM=rv?cc.isAbsolute:Vi.isAbsolute,cfe=rv?cc.join:Vi.join,Bct=rv?cc.resolve:Vi.resolve,k2=rv?cc.relative:Vi.relative,Cb=rv?cc.dirname:Vi.dirname,Ko=rv?cc.basename:Vi.basename,Gy=rv?cc.extname:Vi.extname,Wct=rv?cc.parse:Vi.parse,ou=rv?cc.sep:Vi.sep;rv?cc.delimiter:Vi.delimiter;const Hct=/^\w[\w\d+.-]*$/,Uct=/^\//,Vct=/^\/\//;function zct(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!Hct.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!Uct.test(s.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Vct.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function $ct(s,e){return!s&&!e?"file":s}function Gct(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Gv&&(e=Gv+e):e=Gv;break}return e}const Ea="",Gv="/",Kct=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;let N=class uq{static isUri(e){return e instanceof uq?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||Ea,this.authority=e.authority||Ea,this.path=e.path||Ea,this.query=e.query||Ea,this.fragment=e.fragment||Ea):(this.scheme=$ct(e,r),this.authority=t||Ea,this.path=Gct(this.scheme,i||Ea),this.query=n||Ea,this.fragment=o||Ea,zct(this,r))}get fsPath(){return Nj(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Ea),i===void 0?i=this.authority:i===null&&(i=Ea),n===void 0?n=this.path:n===null&&(n=Ea),o===void 0?o=this.query:o===null&&(o=Ea),r===void 0?r=this.fragment:r===null&&(r=Ea),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new ZN(t,i,n,o,r)}static parse(e,t=!1){const i=Kct.exec(e);return i?new ZN(i[2]||Ea,CG(i[4]||Ea),CG(i[5]||Ea),CG(i[7]||Ea),CG(i[9]||Ea),t):new ZN(Ea,Ea,Ea,Ea,Ea)}static file(e){let t=Ea;if(Qn&&(e=e.replace(/\\/g,Gv)),e[0]===Gv&&e[1]===Gv){const i=e.indexOf(Gv,2);i===-1?(t=e.substring(2),e=Gv):(t=e.substring(2,i),e=e.substring(i)||Gv)}return new ZN("file",t,e,Ea,Ea)}static from(e,t){return new ZN(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Qn&&e.scheme==="file"?i=uq.file(cc.join(Nj(e,!0),...t)).path:i=Vi.join(e.path,...t),e.with({path:i})}toString(e=!1){return dfe(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof uq)return e;{const t=new ZN(e);return t._formatted=e.external??null,t._fsPath=e._sep===hGe?e.fsPath??null:null,t}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};function lfe(s){return!s||typeof s!="object"?!1:typeof s.scheme=="string"&&(typeof s.authority=="string"||typeof s.authority>"u")&&(typeof s.path=="string"||typeof s.path>"u")&&(typeof s.query=="string"||typeof s.query>"u")&&(typeof s.fragment=="string"||typeof s.fragment>"u")}const hGe=Qn?1:void 0;let ZN=class extends N{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Nj(this,!1)),this._fsPath}toString(e=!1){return e?dfe(this,!0):(this._formatted||(this._formatted=dfe(this,!1)),this._formatted)}toJSON(){const e={$mid:ws.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=hGe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const uGe={[B.Colon]:"%3A",[B.Slash]:"%2F",[B.QuestionMark]:"%3F",[B.Hash]:"%23",[B.OpenSquareBracket]:"%5B",[B.CloseSquareBracket]:"%5D",[B.AtSign]:"%40",[B.ExclamationMark]:"%21",[B.DollarSign]:"%24",[B.Ampersand]:"%26",[B.SingleQuote]:"%27",[B.OpenParen]:"%28",[B.CloseParen]:"%29",[B.Asterisk]:"%2A",[B.Plus]:"%2B",[B.Comma]:"%2C",[B.Semicolon]:"%3B",[B.Equals]:"%3D",[B.Space]:"%20"};function MFe(s,e,t){let i,n=-1;for(let o=0;o=B.a&&r<=B.z||r>=B.A&&r<=B.Z||r>=B.Digit0&&r<=B.Digit9||r===B.Dash||r===B.Period||r===B.Underline||r===B.Tilde||e&&r===B.Slash||t&&r===B.OpenSquareBracket||t&&r===B.CloseSquareBracket||t&&r===B.Colon)n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i!==void 0&&(i+=s.charAt(o));else{i===void 0&&(i=s.substr(0,o));const a=uGe[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i+=a):n===-1&&(n=o)}}return n!==-1&&(i+=encodeURIComponent(s.substring(n))),i!==void 0?i:s}function qct(s){let e;for(let t=0;t1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===B.Slash&&(s.path.charCodeAt(1)>=B.A&&s.path.charCodeAt(1)<=B.Z||s.path.charCodeAt(1)>=B.a&&s.path.charCodeAt(1)<=B.z)&&s.path.charCodeAt(2)===B.Colon?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,Qn&&(t=t.replace(/\//g,"\\")),t}function dfe(s,e){const t=e?qct:MFe;let i="",{scheme:n,authority:o,path:r,query:a,fragment:c}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=Gv,i+=Gv),o){let l=o.indexOf("@");if(l!==-1){const d=o.substr(0,l);o=o.substr(l+1),l=d.lastIndexOf(":"),l===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,l),!1,!1),i+=":",i+=t(d.substr(l+1),!1,!0)),i+="@"}o=o.toLowerCase(),l=o.lastIndexOf(":"),l===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,l),!1,!0),i+=o.substr(l))}if(r){if(r.length>=3&&r.charCodeAt(0)===B.Slash&&r.charCodeAt(2)===B.Colon){const l=r.charCodeAt(1);l>=B.A&&l<=B.Z&&(r=`/${String.fromCharCode(l+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===B.Colon){const l=r.charCodeAt(0);l>=B.A&&l<=B.Z&&(r=`${String.fromCharCode(l+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),c&&(i+="#",i+=e?c:MFe(c,!1,!1)),i}function gGe(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+gGe(s.substr(3)):s}}const NFe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function CG(s){return s.match(NFe)?s.replace(NFe,e=>gGe(e)):s}let oe=class e0{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new e0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return e0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return e0.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return _l.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return _l.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return _l.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return _l.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return _l.plusRange(this,e)}static plusRange(e,t){let i,n,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new _l(i,n,o,r)}intersectRanges(e){return _l.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,c=t.startColumn,l=t.endLineNumber,d=t.endColumn;return il?(o=l,r=d):o===l&&(r=Math.min(r,d)),i>o||i===o&&n>r?null:new _l(i,n,o,r)}equalsRange(e){return _l.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return _l.getEndPosition(this)}static getEndPosition(e){return new oe(e.endLineNumber,e.endColumn)}getStartPosition(){return _l.getStartPosition(this)}static getStartPosition(e){return new oe(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new _l(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new _l(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return _l.collapseToStart(this)}static collapseToStart(e){return new _l(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return _l.collapseToEnd(this)}static collapseToEnd(e){return new _l(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new _l(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new _l(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new _l(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var c_;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(c_||(c_={}));let dt=class Fm extends F{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Fm.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?c_.LTR:c_.RTL}setEndPosition(e,t){return this.getDirection()===c_.LTR?new Fm(this.startLineNumber,this.startColumn,e,t):new Fm(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new oe(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new oe(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===c_.LTR?new Fm(e,t,this.endLineNumber,this.endColumn):new Fm(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Fm(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===c_.LTR?new Fm(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Fm(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Fm(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i>>Hi.LANGUAGEID_OFFSET}static getTokenType(e){return(e&Hi.TOKEN_TYPE_MASK)>>>Hi.TOKEN_TYPE_OFFSET}static containsBalancedBrackets(e){return(e&Hi.BALANCED_BRACKETS_MASK)!==0}static getFontStyle(e){return(e&Hi.FONT_STYLE_MASK)>>>Hi.FONT_STYLE_OFFSET}static getForeground(e){return(e&Hi.FOREGROUND_MASK)>>>Hi.FOREGROUND_OFFSET}static getBackground(e){return(e&Hi.BACKGROUND_MASK)>>>Hi.BACKGROUND_OFFSET}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&Vo.Italic&&(i+=" mtki"),n&Vo.Bold&&(i+=" mtkb"),n&Vo.Underline&&(i+=" mtku"),n&Vo.Strikethrough&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;n&Vo.Italic&&(o+="font-style: italic;"),n&Vo.Bold&&(o+="font-weight: bold;");let r="";return n&Vo.Underline&&(r+=" underline"),n&Vo.Strikethrough&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&Vo.Italic),bold:!!(i&Vo.Bold),underline:!!(i&Vo.Underline),strikethrough:!!(i&Vo.Strikethrough)}}}let Yct=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Ee(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new Jct(this,e,t);return this._factories.set(e,i),Ee(()=>{const n=this._factories.get(e);!n||n!==i||(this._factories.delete(e),n.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Tl.DefaultBackground?this._colorMap[Tl.DefaultBackground]:null}};class Jct extends V{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let _8=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class iTe{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class Lre{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Mc;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Mc||(Mc={}));var Me;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(Me||(Me={}));var v8;(function(s){const e=new Map;e.set(Me.Method,ve.symbolMethod),e.set(Me.Function,ve.symbolFunction),e.set(Me.Constructor,ve.symbolConstructor),e.set(Me.Field,ve.symbolField),e.set(Me.Variable,ve.symbolVariable),e.set(Me.Class,ve.symbolClass),e.set(Me.Struct,ve.symbolStruct),e.set(Me.Interface,ve.symbolInterface),e.set(Me.Module,ve.symbolModule),e.set(Me.Property,ve.symbolProperty),e.set(Me.Event,ve.symbolEvent),e.set(Me.Operator,ve.symbolOperator),e.set(Me.Unit,ve.symbolUnit),e.set(Me.Value,ve.symbolValue),e.set(Me.Enum,ve.symbolEnum),e.set(Me.Constant,ve.symbolConstant),e.set(Me.Enum,ve.symbolEnum),e.set(Me.EnumMember,ve.symbolEnumMember),e.set(Me.Keyword,ve.symbolKeyword),e.set(Me.Snippet,ve.symbolSnippet),e.set(Me.Text,ve.symbolText),e.set(Me.Color,ve.symbolColor),e.set(Me.File,ve.symbolFile),e.set(Me.Reference,ve.symbolReference),e.set(Me.Customcolor,ve.symbolCustomColor),e.set(Me.Folder,ve.symbolFolder),e.set(Me.TypeParameter,ve.symbolTypeParameter),e.set(Me.User,ve.account),e.set(Me.Issue,ve.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=ve.symbolProperty),r}s.toIcon=t;const i=new Map;i.set("method",Me.Method),i.set("function",Me.Function),i.set("constructor",Me.Constructor),i.set("field",Me.Field),i.set("variable",Me.Variable),i.set("class",Me.Class),i.set("struct",Me.Struct),i.set("interface",Me.Interface),i.set("module",Me.Module),i.set("property",Me.Property),i.set("event",Me.Event),i.set("operator",Me.Operator),i.set("unit",Me.Unit),i.set("value",Me.Value),i.set("constant",Me.Constant),i.set("enum",Me.Enum),i.set("enum-member",Me.EnumMember),i.set("enumMember",Me.EnumMember),i.set("keyword",Me.Keyword),i.set("snippet",Me.Snippet),i.set("text",Me.Text),i.set("color",Me.Color),i.set("file",Me.File),i.set("reference",Me.Reference),i.set("customcolor",Me.Customcolor),i.set("folder",Me.Folder),i.set("type-parameter",Me.TypeParameter),i.set("typeParameter",Me.TypeParameter),i.set("account",Me.User),i.set("issue",Me.Issue);function n(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=Me.Property),a}s.fromString=n})(v8||(v8={}));var I2;(function(s){s[s.Deprecated=1]="Deprecated"})(I2||(I2={}));var Yg;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(Yg||(Yg={}));var Jx;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(Jx||(Jx={}));var Ku;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(Ku||(Ku={}));var em;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(em||(em={}));class pGe{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return F.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Ch;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(Ch||(Ch={}));var b8;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(b8||(b8={}));var Dy;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Dy||(Dy={}));var w8;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(w8||(w8={}));function mGe(s){return s&&N.isUri(s.uri)&&F.isIRange(s.range)&&(F.isIRange(s.originSelectionRange)||F.isIRange(s.targetSelectionRange))}var pt;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(pt||(pt={}));const Xct={[pt.Array]:g(1658,"array"),[pt.Boolean]:g(1659,"boolean"),[pt.Class]:g(1660,"class"),[pt.Constant]:g(1661,"constant"),[pt.Constructor]:g(1662,"constructor"),[pt.Enum]:g(1663,"enumeration"),[pt.EnumMember]:g(1664,"enumeration member"),[pt.Event]:g(1665,"event"),[pt.Field]:g(1666,"field"),[pt.File]:g(1667,"file"),[pt.Function]:g(1668,"function"),[pt.Interface]:g(1669,"interface"),[pt.Key]:g(1670,"key"),[pt.Method]:g(1671,"method"),[pt.Module]:g(1672,"module"),[pt.Namespace]:g(1673,"namespace"),[pt.Null]:g(1674,"null"),[pt.Number]:g(1675,"number"),[pt.Object]:g(1676,"object"),[pt.Operator]:g(1677,"operator"),[pt.Package]:g(1678,"package"),[pt.Property]:g(1679,"property"),[pt.String]:g(1680,"string"),[pt.Struct]:g(1681,"struct"),[pt.TypeParameter]:g(1682,"type parameter"),[pt.Variable]:g(1683,"variable")};function Zct(s,e){return g(1684,"{0} ({1})",s,Xct[e])}var y8;(function(s){s[s.Deprecated=1]="Deprecated"})(y8||(y8={}));var Pj;(function(s){const e=new Map;e.set(pt.File,ve.symbolFile),e.set(pt.Module,ve.symbolModule),e.set(pt.Namespace,ve.symbolNamespace),e.set(pt.Package,ve.symbolPackage),e.set(pt.Class,ve.symbolClass),e.set(pt.Method,ve.symbolMethod),e.set(pt.Property,ve.symbolProperty),e.set(pt.Field,ve.symbolField),e.set(pt.Constructor,ve.symbolConstructor),e.set(pt.Enum,ve.symbolEnum),e.set(pt.Interface,ve.symbolInterface),e.set(pt.Function,ve.symbolFunction),e.set(pt.Variable,ve.symbolVariable),e.set(pt.Constant,ve.symbolConstant),e.set(pt.String,ve.symbolString),e.set(pt.Number,ve.symbolNumber),e.set(pt.Boolean,ve.symbolBoolean),e.set(pt.Array,ve.symbolArray),e.set(pt.Object,ve.symbolObject),e.set(pt.Key,ve.symbolKey),e.set(pt.Null,ve.symbolNull),e.set(pt.EnumMember,ve.symbolEnumMember),e.set(pt.Struct,ve.symbolStruct),e.set(pt.Event,ve.symbolEvent),e.set(pt.Operator,ve.symbolOperator),e.set(pt.TypeParameter,ve.symbolTypeParameter);function t(i){let n=e.get(i);return n||(console.info("No codicon found for SymbolKind "+i),n=ve.symbolProperty),n}s.toIcon=t})(Pj||(Pj={}));let nTe=class{static asEditOperation(e){return Zn.replace(F.lift(e.range),e.text)}};var Mg;let l_=(Mg=class{static fromValue(e){switch(e){case"comment":return Mg.Comment;case"imports":return Mg.Imports;case"region":return Mg.Region}return new Mg(e)}constructor(e){this.value=e}},Mg.Comment=new Mg("comment"),Mg.Imports=new Mg("imports"),Mg.Region=new Mg("region"),Mg);var ufe;(function(s){s[s.AIGenerated=1]="AIGenerated"})(ufe||(ufe={}));var mM;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(mM||(mM={}));var Fj;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(Fj||(Fj={}));var Lc;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(Lc||(Lc={}));var ru;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(ru||(ru={}));var Xx;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(Xx||(Xx={}));var T2;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(T2||(T2={}));var Oj;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Oj||(Oj={}));class elt{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const Ta=new Yct;var PFe;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(PFe||(PFe={}));var L2;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(L2||(L2={}));var gfe;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(gfe||(gfe={}));var ffe;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(ffe||(ffe={}));var pfe;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(pfe||(pfe={}));var mfe;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(mfe||(mfe={}));var _fe;(function(s){s[s.Deprecated=1]="Deprecated"})(_fe||(_fe={}));var vfe;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(vfe||(vfe={}));var bfe;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(bfe||(bfe={}));var wfe;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(wfe||(wfe={}));var yfe;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(yfe||(yfe={}));var Cfe;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(Cfe||(Cfe={}));var Sfe;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(Sfe||(Sfe={}));var Afe;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.placeholder=88]="placeholder",s[s.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",s[s.quickSuggestions=90]="quickSuggestions",s[s.quickSuggestionsDelay=91]="quickSuggestionsDelay",s[s.readOnly=92]="readOnly",s[s.readOnlyMessage=93]="readOnlyMessage",s[s.renameOnType=94]="renameOnType",s[s.renderControlCharacters=95]="renderControlCharacters",s[s.renderFinalNewline=96]="renderFinalNewline",s[s.renderLineHighlight=97]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=99]="renderValidationDecorations",s[s.renderWhitespace=100]="renderWhitespace",s[s.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",s[s.roundedSelection=102]="roundedSelection",s[s.rulers=103]="rulers",s[s.scrollbar=104]="scrollbar",s[s.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=106]="scrollBeyondLastLine",s[s.scrollPredominantAxis=107]="scrollPredominantAxis",s[s.selectionClipboard=108]="selectionClipboard",s[s.selectionHighlight=109]="selectionHighlight",s[s.selectOnLineNumbers=110]="selectOnLineNumbers",s[s.showFoldingControls=111]="showFoldingControls",s[s.showUnused=112]="showUnused",s[s.snippetSuggestions=113]="snippetSuggestions",s[s.smartSelect=114]="smartSelect",s[s.smoothScrolling=115]="smoothScrolling",s[s.stickyScroll=116]="stickyScroll",s[s.stickyTabStops=117]="stickyTabStops",s[s.stopRenderingLineAfter=118]="stopRenderingLineAfter",s[s.suggest=119]="suggest",s[s.suggestFontSize=120]="suggestFontSize",s[s.suggestLineHeight=121]="suggestLineHeight",s[s.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",s[s.suggestSelection=123]="suggestSelection",s[s.tabCompletion=124]="tabCompletion",s[s.tabIndex=125]="tabIndex",s[s.unicodeHighlighting=126]="unicodeHighlighting",s[s.unusualLineTerminators=127]="unusualLineTerminators",s[s.useShadowDOM=128]="useShadowDOM",s[s.useTabStops=129]="useTabStops",s[s.wordBreak=130]="wordBreak",s[s.wordSegmenterLocales=131]="wordSegmenterLocales",s[s.wordSeparators=132]="wordSeparators",s[s.wordWrap=133]="wordWrap",s[s.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=136]="wordWrapColumn",s[s.wordWrapOverride1=137]="wordWrapOverride1",s[s.wordWrapOverride2=138]="wordWrapOverride2",s[s.wrappingIndent=139]="wrappingIndent",s[s.wrappingStrategy=140]="wrappingStrategy",s[s.showDeprecated=141]="showDeprecated",s[s.inlayHints=142]="inlayHints",s[s.editorClassName=143]="editorClassName",s[s.pixelRatio=144]="pixelRatio",s[s.tabFocusMode=145]="tabFocusMode",s[s.layoutInfo=146]="layoutInfo",s[s.wrappingInfo=147]="wrappingInfo",s[s.defaultColorDecorators=148]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(Afe||(Afe={}));var Efe;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(Efe||(Efe={}));var xfe;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(xfe||(xfe={}));var Dfe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(Dfe||(Dfe={}));var kfe;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(kfe||(kfe={}));var Ife;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Ife||(Ife={}));var Tfe;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(Tfe||(Tfe={}));var Lfe;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Lfe||(Lfe={}));var Rfe;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(Rfe||(Rfe={}));var Mfe;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Mfe||(Mfe={}));var Nfe;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(Nfe||(Nfe={}));var Pfe;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Pfe||(Pfe={}));var Ffe;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(Ffe||(Ffe={}));var Ofe;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(Ofe||(Ofe={}));var Bfe;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(Bfe||(Bfe={}));var Wfe;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Wfe||(Wfe={}));var Hfe;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Hfe||(Hfe={}));var Ufe;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Ufe||(Ufe={}));var Vfe;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(Vfe||(Vfe={}));var zfe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(zfe||(zfe={}));var $fe;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})($fe||($fe={}));var Gfe;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.None=2]="None",s[s.LeftOfInjectedText=3]="LeftOfInjectedText",s[s.RightOfInjectedText=4]="RightOfInjectedText"})(Gfe||(Gfe={}));var Kfe;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(Kfe||(Kfe={}));var qfe;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(qfe||(qfe={}));var Qfe;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(Qfe||(Qfe={}));var jfe;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(jfe||(jfe={}));var Yfe;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(Yfe||(Yfe={}));var Jfe;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(Jfe||(Jfe={}));var Xfe;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Xfe||(Xfe={}));var Zfe;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(Zfe||(Zfe={}));var epe;(function(s){s[s.Deprecated=1]="Deprecated"})(epe||(epe={}));var tpe;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(tpe||(tpe={}));var ipe;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(ipe||(ipe={}));var npe;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(npe||(npe={}));var spe;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(spe||(spe={}));const VF=class VF{static chord(e,t){return rr(e,t)}};VF.CtrlCmd=U.CtrlCmd,VF.Shift=U.Shift,VF.Alt=U.Alt,VF.WinCtrl=U.WinCtrl;let ope=VF;function _Ge(){return{editor:void 0,languages:void 0,CancellationTokenSource:ci,Emitter:I,KeyCode:Nfe,KeyMod:ope,Position:oe,Range:F,Selection:dt,SelectionDirection:Yfe,MarkerSeverity:Pfe,MarkerTag:Ffe,Uri:N,Token:_8}}function tlt(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const si=window;function ilt(s){return s===si?!1:typeof s?.vscodeWindowId=="number"}var FFe=[],t4=[];function ut(s,e){if(s&&typeof document<"u"){var t,i=e.prepend===!0?"prepend":"append",n=e.singleTag===!0,o=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var r=FFe.indexOf(o);r===-1&&(r=FFe.push(o)-1,t4[r]={}),t=t4[r]&&t4[r][i]?t4[r][i]:t4[r][i]=a()}else t=a();s.charCodeAt(0)===65279&&(s=s.substring(1)),t.styleSheet?t.styleSheet.cssText+=s:t.appendChild(document.createTextNode(s))}function a(){var c=document.createElement("style");if(c.setAttribute("type","text/css"),e.attributes)for(var l=Object.keys(e.attributes),d=0;d=0,vT=_U.indexOf("AppleWebKit")>=0,Q7=_U.indexOf("Chrome")>=0,Ky=!Q7&&_U.indexOf("Safari")>=0,bGe=!Q7&&!Ky&&vT;_U.indexOf("Electron/")>=0;const OFe=_U.indexOf("Android")>=0;let gq=!1;if(typeof si.matchMedia=="function"){const s=si.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=si.matchMedia("(display-mode: fullscreen)");gq=s.matches,Bj(si,s,({matches:t})=>{gq&&e.matches||(gq=t)})}function wGe(){return gq}var Zx;(function(s){s[s.Always=0]="Always",s[s.FullScreen=1]="FullScreen",s[s.None=2]="None"})(Zx||(Zx={}));const kO={clipboard:{writeText:ad||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:ad||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:ad||wGe()?Zx.Always:navigator.keyboard||Ky?Zx.FullScreen:Zx.None,touch:"ontouchstart"in si||navigator.maxTouchPoints>0,pointerEvents:si.PointerEvent&&("ontouchstart"in si||navigator.maxTouchPoints>0)};var N0;(function(s){s[s.CtrlCmd=2048]="CtrlCmd",s[s.Shift=1024]="Shift",s[s.Alt=512]="Alt",s[s.WinCtrl=256]="WinCtrl",s[s.KeyCode=255]="KeyCode"})(N0||(N0={}));function ape(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new IO([SG(t,e),SG(i,e)]):new IO([SG(t,e)])}else{const t=[];for(let i=0;ii.toString(16).padStart(2,"0")).join("");return BigInt(`0x${t}`).toString(32).padStart(52,"0")}class Eh{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=flt.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class _M{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(Q7){const o=navigator.userAgent.match(/Chrome\/(\d+)/);n=(o?parseInt(o[1]):123)<=122}if(e){const o=e,r=e,a=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")n?this.deltaY=o.wheelDeltaY/(120*a):this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS<"u"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?rf&&!Qt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")Ky&&Qn?this.deltaX=-(o.wheelDeltaX/120):n?this.deltaX=o.wheelDeltaX/(120*a):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS<"u"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?rf&&!Qt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}function dE(s){return s===B.Slash||s===B.Backslash}function S8(s){return s.replace(/[\\/]/g,Vi.sep)}function _lt(s){return s.indexOf("/")===-1&&(s=S8(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function WFe(s,e=Vi.sep){if(!s)return"";const t=s.length,i=s.charCodeAt(0);if(dE(i)){if(dE(s.charCodeAt(1))&&!dE(s.charCodeAt(2))){let o=3;const r=o;for(;o\|]/g,wlt=/[/]/g,ylt=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function Clt(s,e=Qn){const t=e?blt:wlt;return!(!s||s.length===0||/^\s+$/.test(s)||(t.lastIndex=0,t.test(s))||e&&ylt.test(s)||s==="."||s===".."||e&&s[s.length-1]==="."||e&&s.length!==s.trim().length||s.length>255)}function Slt(s,e,t){const i=s===e;return!t||i?i:!s||!e?!1:ua(s,e)}function Wj(s,e,t,i=ou){if(s===e)return!0;if(!s||!e||e.length>s.length)return!1;if(t){if(!W7(s,e))return!1;if(e.length===s.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,s.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function yGe(s){return s>=B.A&&s<=B.Z||s>=B.a&&s<=B.z}function CGe(s,e=Qn){return e?yGe(s.charCodeAt(0))&&s.charCodeAt(1)===B.Colon:!1}function Alt(s,e=Qn){return CGe(s,e)?s[0]:void 0}function SGe(s,e,t){return e.length>s.length?-1:s===e?0:(t&&(s=s.toLowerCase(),e=e.toLowerCase()),s.indexOf(e))}function AGe(s){const e=s.split(":");let t,i,n;for(const o of e){const r=Number(o);lc(r)?i===void 0?i=r:n===void 0&&(n=r):t=t?[t,o].join(":"):o}if(!t)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:t,line:i!==void 0?i:void 0,column:n!==void 0?n:i!==void 0?1:void 0}}var pe;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",s.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",s.vscodeChatSesssion="vscode-chat-editor",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting"})(pe||(pe={}));function AA(s,e){return N.isUri(s)?ua(s.scheme,e):W7(s,e+":")}function A8(s,...e){return e.some(t=>AA(s,t))}const Elt="tkn";class xlt{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=Dlt(e,t)}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Vi.join(this._serverRootPath,pe.vscodeRemoteResource)}set(e,t,i){this._hosts[e]=t,this._ports[e]=i}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return vt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${Elt}=${encodeURIComponent(o)}`),N.from({scheme:Wn?this._preferredWebSchema:pe.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const E8=new xlt;function Dlt(s,e){return Vi.join(e??"/",`${s.quality??"oss"}-${s.commit??"dev"}`)}const klt="vscode-app",zF=class zF{constructor(){this.staticBrowserUris=new ui,this.appResourcePathUrls=new Map,this.moduleContentProvider=new Map}registerModuleContentProvider(e,t){this.moduleContentProvider.set(e,t)}toModuleContent(e){return this.moduleContentProvider.get(e)()}registerAppResourcePathUrl(e,t){this.appResourcePathUrls.set(e,t)}toUrl(e){let t=this.appResourcePathUrls.get(e);return typeof t=="function"&&(t=t()),new URL(t??e,globalThis.location?.href??import.meta.url).toString()}asBrowserUri(e){const t=this.toUri(e,{toUrl:this.toUrl.bind(this)});return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===pe.vscodeRemote?E8.rewrite(e):e.scheme===pe.file&&(ad||Art===`${pe.vscodeFileResource}://${zF.FALLBACK_AUTHORITY}`)?e.with({scheme:pe.vscodeFileResource,authority:e.authority||zF.FALLBACK_AUTHORITY,query:null,fragment:null}):this.staticBrowserUris.get(e)??e}asFileUri(e){const t=this.toUri(e,{toUrl:this.toUrl.bind(this)});return this.uriToFileUri(t)}uriToFileUri(e){return e.scheme===pe.vscodeFileResource?e.with({scheme:pe.file,authority:e.authority!==zF.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e,t){return N.isUri(e)?e:N.parse(t.toUrl(e))}registerStaticBrowserUri(e,t){return this.staticBrowserUris.set(e,t),Ee(()=>{this.staticBrowserUris.get(e)===t&&this.staticBrowserUris.delete(e)})}getRegisteredBrowserUris(){return this.staticBrowserUris.keys()}};zF.FALLBACK_AUTHORITY=klt;let cpe=zF;const ef=new cpe;var lpe;(function(s){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);s.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:N.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(o,r,a){if(!globalThis.crossOriginIsolated)return;const c=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,c):o[t]=c}s.addSearchParam=n})(lpe||(lpe={}));function Zm(s){return Nj(s,!0)}class xN{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:gm(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}ignorePathCasing(e){return this._ignorePathCasing(e)}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===pe.file)return Wj(Zm(e),Zm(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(R2(e.authority,t.authority))return Wj(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return N.joinPath(e,...t)}basenameOrAuthority(e){return _i(e)||e.authority}basename(e){return Vi.basename(e.path)}extname(e){return Vi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===pe.file?t=N.file(Cb(Zm(e))).path:(t=Vi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==B.Slash&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===pe.file?t=N.file(Rk(Zm(e))).path:t=Vi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!R2(e.authority,t.authority))return;if(e.scheme===pe.file){const o=k2(Zm(e),Zm(t));return Qn?S8(o):o}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,n.length);oWFe(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===B.Slash&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ou){return UFe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ou){let i=!1;if(e.scheme===pe.file){const n=Zm(e);i=n!==void 0&&n.length===WFe(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===B.Slash}return!i&&!UFe(e,t)?e.with({path:e.path+"/"}):e}}const xn=new xN(()=>!1),EGe=new xN(s=>s.scheme===pe.file?!pr:!0),Rre=new xN(s=>!0),ji=xn.isEqual.bind(xn),qy=xn.isEqualOrParent.bind(xn);xn.getComparisonKey.bind(xn);const EA=xn.basenameOrAuthority.bind(xn),_i=xn.basename.bind(xn),vU=xn.extname.bind(xn),Lr=xn.dirname.bind(xn),Pt=xn.joinPath.bind(xn),xGe=xn.normalizePath.bind(xn),DN=xn.relativePath.bind(xn),HFe=xn.resolvePath.bind(xn),DGe=xn.isAbsolutePath.bind(xn),R2=xn.isEqualAuthority.bind(xn),UFe=xn.hasTrailingPathSeparator.bind(xn),VFe=xn.removeTrailingPathSeparator.bind(xn);xn.addTrailingPathSeparator.bind(xn);function Ilt(s,e){const t=[];for(let i=0;ir===i?!1:qy(n,e(o)))||t.push(s[i])}return t}var Mk;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,c]=r.split(":");a&&c&&i.set(a,c)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(s.META_DATA_MIME,o),i}s.parseMetaData=e})(Mk||(Mk={}));function x8(s,e,t){if(e){let i=s.path;return i&&i[0]!==Vi.sep&&(i=Vi.sep+i),s.with({scheme:t,authority:e,path:i})}return s.with({scheme:t})}const kGe=Symbol("MicrotaskDelay");function Qy(s){return!!s&&typeof s.then=="function"}function Rr(s){const e=new ci,t=s(e.token),i=new Promise((n,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),o(new Ma)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),n(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return i.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function U_(s,e,t){return new Promise((i,n)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});s.then(i,n).finally(()=>o.dispose())})}function Mre(s,e){return new Promise((t,i)=>{const n=e.onCancellationRequested(()=>{n.dispose(),i(new Ma)});s.then(t,i).finally(()=>n.dispose())})}function IGe(s,e,t){let i;const n=setTimeout(()=>{i?.(void 0)},e);return Promise.race([s.finally(()=>clearTimeout(n)),new Promise(o=>i=o)])}function jh(s){return new Promise((e,t)=>{const i=s();Qy(i)?i.then(e,t):e(i)})}function M2(){let s,e;return{promise:new Promise((i,n)=>{s=i,e=n}),resolve:s,reject:e}}class j7{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.isDisposed=!0}}class Tlt{constructor(){this.promiseMap=new Map}queue(e,t){const n=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===n&&this.promiseMap.delete(e)});return this.promiseMap.set(e,n),n}}const Llt=(s,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Rlt=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};let Mh=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((n,o)=>{this.doResolve=n,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===kGe?Rlt(i):Llt(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Ma),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};class Y7{constructor(e){this.delayer=new Mh(e),this.throttler=new j7}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}class qd{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}function Sr(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{o.dispose(),t()},s),o=e.onCancellationRequested(()=>{clearTimeout(n),o.dispose(),i(new Ma)})}):Rr(t=>Sr(s,t))}function jy(s,e=0,t){const i=setTimeout(()=>{s(),t&&n.dispose()},e),n=Ee(()=>{clearTimeout(i),t?.deleteAndLeak(n)});return t?.add(n),n}function Nre(s,e=i=>!!i,t=null){let i=0;const n=s.length,o=()=>{if(i>=n)return Promise.resolve(t);const r=s[i++];return Promise.resolve(r()).then(c=>e(c)?Promise.resolve(c):o())};return o()}class dpe{constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new I}whenIdle(){return this.size>0?M.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((t,i)=>{this.outstandingPromises.push({factory:e,c:t,e:i}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}}let bI=class extends dpe{constructor(){super(1)}};class sTe{constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;const e=new dc;return this.drainers.add(e),e.p}isDrained(){for(const[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=xn){const i=t.getComparisonKey(e);return this.queues.get(i)?.size??0}queueFor(e,t,i=xn){const n=i.getComparisonKey(e);let o=this.queues.get(n);if(!o){o=new bI;const r=this.drainListenerCount++,a=M.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(n),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(r),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new mo),this.drainListeners.set(r,a),this.queues.set(n,o)}return o.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(const e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(const[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}}class Cm{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ni("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ni("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class J7{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Ni("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=Ee(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class cn{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}class TGe extends cn{constructor(e,t){super(e,t),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){const e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}}let N2,TO;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?TO=(s,e)=>{V1e(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:TO=(s,e,t)=>{const i=s.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,s.cancelIdleCallback(i))}}},N2=s=>TO(globalThis,s)})();class LGe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=TO(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class hpe extends LGe{constructor(e){super(globalThis,e)}}class RGe{isRunning(e){return typeof e=="number"?this._running?.taskId===e:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(e,t,i){return this._running={taskId:e,cancel:()=>i?.(),promise:t},t.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),t}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{const{promise:t,resolve:i,reject:n}=M2();this._queued={run:e,promise:t,promiseResolve:i,promiseReject:n}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var P0;(function(s){s[s.Resolved=0]="Resolved",s[s.Rejected=1]="Rejected"})(P0||(P0={}));class dc{get isRejected(){return this.outcome?.outcome===P0.Rejected}get isResolved(){return this.outcome?.outcome===P0.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===P0.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:P0.Resolved,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:P0.Rejected,value:e},t()})}cancel(){return this.error(new Ma)}}var Zs;(function(s){async function e(i){let n;const o=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return o}s.settled=e;function t(i){return new Promise(async(n,o)=>{try{await i(n,o)}catch(r){o(r)}})}s.withAsyncBody=t})(Zs||(Zs={}));class Mlt{get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(t=>(this._value=t,this._isResolved=!0,t),t=>{throw this._error=t,this._isResolved=!0,t})}requireValue(){if(!this._isResolved)throw new Ni("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}class Nlt{constructor(e){this._compute=e,this._promise=new ya(()=>new Mlt(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}}var xv;(function(s){s[s.Initial=0]="Initial",s[s.DoneOK=1]="DoneOK",s[s.DoneError=2]="DoneError"})(xv||(xv={}));const Ag=class Ag{static fromArray(e){return new Ag(t=>{t.emitMany(e)})}static fromPromise(e){return new Ag(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Ag(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Ag(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}constructor(e,t){this._state=xv.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new I,queueMicrotask(async()=>{const i={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(i)),this.resolve()}catch(n){this.reject(n)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===xv.DoneError)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new Ag(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return Ag.map(this,e)}static filter(e,t){return new Ag(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return Ag.filter(this,e)}static coalesce(e){return Ag.filter(e,t=>!!t)}coalesce(){return Ag.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return Ag.toPromise(this)}emitOne(e){this._state===xv.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===xv.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===xv.Initial&&(this._state=xv.DoneOK,this._onStateChanged.fire())}reject(e){this._state===xv.Initial&&(this._state=xv.DoneError,this._error=e,this._onStateChanged.fire())}};Ag.EMPTY=Ag.fromArray([]);let Qd=Ag;class Plt extends Qd{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Flt(s){const e=new ci,t=s(e.token);return new Plt(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new Ma)});try{for await(const o of t){if(e.token.isCancellationRequested)return;i.emitOne(o)}n.dispose(),e.dispose()}catch(o){n.dispose(),e.dispose(),i.reject(o)}})}class P2{constructor(e){this._deferred=new dc,this._asyncIterable=new Qd(n=>{if(t){n.reject(t);return}return i&&n.emitMany(i),this._errorFn=o=>n.reject(o),this._emitFn=o=>n.emitOne(o),this._deferred.p},e);let t,i;this._emitFn=n=>{i||(i=[]),i.push(n)},this._errorFn=n=>{t||(t=n)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitFn(e)}}const{entries:MGe,setPrototypeOf:zFe,isFrozen:Olt,getPrototypeOf:Blt,getOwnPropertyDescriptor:Wlt}=Object;let{freeze:af,seal:Ib,create:Hlt}=Object,{apply:upe,construct:gpe}=typeof Reflect<"u"&&Reflect;upe||(upe=function(e,t,i){return e.apply(t,i)});af||(af=function(e){return e});Ib||(Ib=function(e){return e});gpe||(gpe=function(e,t){return new e(...t)});const Ult=V_(Array.prototype.forEach),$Fe=V_(Array.prototype.pop),i4=V_(Array.prototype.push),fq=V_(String.prototype.toLowerCase),bde=V_(String.prototype.toString),Vlt=V_(String.prototype.match),uv=V_(String.prototype.replace),zlt=V_(String.prototype.indexOf),$lt=V_(String.prototype.trim),Ap=V_(RegExp.prototype.test),n4=Glt(TypeError);function V_(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n/gm),Ylt=Ib(/\${[\w\W]*}/gm),Jlt=Ib(/^data-[\-\w.\u00B7-\uFFFF]/),Xlt=Ib(/^aria-[\-\w]+$/),NGe=Ib(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zlt=Ib(/^(?:\w+script|data):/i),edt=Ib(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),PGe=Ib(/^html$/i);var jFe=Object.freeze({__proto__:null,MUSTACHE_EXPR:Qlt,ERB_EXPR:jlt,TMPLIT_EXPR:Ylt,DATA_ATTR:Jlt,ARIA_ATTR:Xlt,IS_ALLOWED_URI:NGe,IS_SCRIPT_OR_DATA:Zlt,ATTR_WHITESPACE:edt,DOCTYPE_NAME:PGe});const tdt=()=>typeof window>"u"?null:window,idt=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function FGe(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tdt();const e=Ot=>FGe(Ot);if(e.version="3.0.5",e.removed=[],!s||!s.document||s.document.nodeType!==9)return e.isSupported=!1,e;const t=s.document,i=t.currentScript;let{document:n}=s;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:c,NodeFilter:l,NamedNodeMap:d=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=s,p=c.prototype,m=AG(p,"cloneNode"),v=AG(p,"nextSibling"),b=AG(p,"childNodes"),w=AG(p,"parentNode");if(typeof r=="function"){const Ot=n.createElement("template");Ot.content&&Ot.content.ownerDocument&&(n=Ot.content.ownerDocument)}let y,C="";const{implementation:A,createNodeIterator:L,createDocumentFragment:k,getElementsByTagName:P}=n,{importNode:R}=t;let z={};e.isSupported=typeof MGe=="function"&&typeof w=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:Y,TMPLIT_EXPR:j,DATA_ATTR:ne,ARIA_ATTR:ge,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Oe}=jFe;let{IS_ALLOWED_URI:yt}=jFe,Ne=null;const lt=Gs({},[...GFe,...wde,...yde,...Cde,...KFe]);let xt=null;const Ji=Gs({},[...qFe,...Sde,...QFe,...EG]);let Ii=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ns=null,zs=null,Pn=!0,Xr=!0,ds=!1,Zo=!0,Zr=!1,Di=!1,ss=!1,Oo=!1,Tn=!1,Ba=!1,vd=!1,Fn=!0,th=!1;const pc="user-content-";let zc=!0,$s=!1,tc={},fl=null;const ih=Gs({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let gg=null;const mc=Gs({},["audio","video","img","source","image","track"]);let $c=null;const nh=Gs({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dc="http://www.w3.org/1998/Math/MathML",pl="http://www.w3.org/2000/svg",ic="http://www.w3.org/1999/xhtml";let Or=ic,ml=!1,sh=null;const oh=Gs({},[Dc,pl,ic],bde);let Gc;const Kc=["application/xhtml+xml","text/html"],Wa="text/html";let Bo,Is=null;const kc=n.createElement("form"),Nh=function(K){return K instanceof RegExp||K instanceof Function},be=function(K){if(!(Is&&Is===K)){if((!K||typeof K!="object")&&(K={}),K=eP(K),Gc=Kc.indexOf(K.PARSER_MEDIA_TYPE)===-1?Gc=Wa:Gc=K.PARSER_MEDIA_TYPE,Bo=Gc==="application/xhtml+xml"?bde:fq,Ne="ALLOWED_TAGS"in K?Gs({},K.ALLOWED_TAGS,Bo):lt,xt="ALLOWED_ATTR"in K?Gs({},K.ALLOWED_ATTR,Bo):Ji,sh="ALLOWED_NAMESPACES"in K?Gs({},K.ALLOWED_NAMESPACES,bde):oh,$c="ADD_URI_SAFE_ATTR"in K?Gs(eP(nh),K.ADD_URI_SAFE_ATTR,Bo):nh,gg="ADD_DATA_URI_TAGS"in K?Gs(eP(mc),K.ADD_DATA_URI_TAGS,Bo):mc,fl="FORBID_CONTENTS"in K?Gs({},K.FORBID_CONTENTS,Bo):ih,ns="FORBID_TAGS"in K?Gs({},K.FORBID_TAGS,Bo):{},zs="FORBID_ATTR"in K?Gs({},K.FORBID_ATTR,Bo):{},tc="USE_PROFILES"in K?K.USE_PROFILES:!1,Pn=K.ALLOW_ARIA_ATTR!==!1,Xr=K.ALLOW_DATA_ATTR!==!1,ds=K.ALLOW_UNKNOWN_PROTOCOLS||!1,Zo=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Zr=K.SAFE_FOR_TEMPLATES||!1,Di=K.WHOLE_DOCUMENT||!1,Tn=K.RETURN_DOM||!1,Ba=K.RETURN_DOM_FRAGMENT||!1,vd=K.RETURN_TRUSTED_TYPE||!1,Oo=K.FORCE_BODY||!1,Fn=K.SANITIZE_DOM!==!1,th=K.SANITIZE_NAMED_PROPS||!1,zc=K.KEEP_CONTENT!==!1,$s=K.IN_PLACE||!1,yt=K.ALLOWED_URI_REGEXP||NGe,Or=K.NAMESPACE||ic,Ii=K.CUSTOM_ELEMENT_HANDLING||{},K.CUSTOM_ELEMENT_HANDLING&&Nh(K.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ii.tagNameCheck=K.CUSTOM_ELEMENT_HANDLING.tagNameCheck),K.CUSTOM_ELEMENT_HANDLING&&Nh(K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ii.attributeNameCheck=K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ii.allowCustomizedBuiltInElements=K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Zr&&(Xr=!1),Ba&&(Tn=!0),tc&&(Ne=Gs({},[...KFe]),xt=[],tc.html===!0&&(Gs(Ne,GFe),Gs(xt,qFe)),tc.svg===!0&&(Gs(Ne,wde),Gs(xt,Sde),Gs(xt,EG)),tc.svgFilters===!0&&(Gs(Ne,yde),Gs(xt,Sde),Gs(xt,EG)),tc.mathMl===!0&&(Gs(Ne,Cde),Gs(xt,QFe),Gs(xt,EG))),K.ADD_TAGS&&(Ne===lt&&(Ne=eP(Ne)),Gs(Ne,K.ADD_TAGS,Bo)),K.ADD_ATTR&&(xt===Ji&&(xt=eP(xt)),Gs(xt,K.ADD_ATTR,Bo)),K.ADD_URI_SAFE_ATTR&&Gs($c,K.ADD_URI_SAFE_ATTR,Bo),K.FORBID_CONTENTS&&(fl===ih&&(fl=eP(fl)),Gs(fl,K.FORBID_CONTENTS,Bo)),zc&&(Ne["#text"]=!0),Di&&Gs(Ne,["html","head","body"]),Ne.table&&(Gs(Ne,["tbody"]),delete ns.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw n4('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw n4('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=K.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=idt(f,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));af&&af(K),Is=K}},Aa=Gs({},["mi","mo","mn","ms","mtext"]),ee=Gs({},["foreignobject","desc","title","annotation-xml"]),xe=Gs({},["title","style","font","a","script"]),gt=Gs({},wde);Gs(gt,yde),Gs(gt,Klt);const zn=Gs({},Cde);Gs(zn,qlt);const Cs=function(K){let de=w(K);(!de||!de.tagName)&&(de={namespaceURI:Or,tagName:"template"});const T=fq(K.tagName),ie=fq(de.tagName);return sh[K.namespaceURI]?K.namespaceURI===pl?de.namespaceURI===ic?T==="svg":de.namespaceURI===Dc?T==="svg"&&(ie==="annotation-xml"||Aa[ie]):!!gt[T]:K.namespaceURI===Dc?de.namespaceURI===ic?T==="math":de.namespaceURI===pl?T==="math"&&ee[ie]:!!zn[T]:K.namespaceURI===ic?de.namespaceURI===pl&&!ee[ie]||de.namespaceURI===Dc&&!Aa[ie]?!1:!zn[T]&&(xe[T]||!gt[T]):!!(Gc==="application/xhtml+xml"&&sh[K.namespaceURI]):!1},Wo=function(K){i4(e.removed,{element:K});try{K.parentNode.removeChild(K)}catch{K.remove()}},Ha=function(K,de){try{i4(e.removed,{attribute:de.getAttributeNode(K),from:de})}catch{i4(e.removed,{attribute:null,from:de})}if(de.removeAttribute(K),K==="is"&&!xt[K])if(Tn||Ba)try{Wo(de)}catch{}else try{de.setAttribute(K,"")}catch{}},ea=function(K){let de,T;if(Oo)K=""+K;else{const O=Vlt(K,/^[\r\n\t ]+/);T=O&&O[0]}Gc==="application/xhtml+xml"&&Or===ic&&(K=''+K+"");const ie=y?y.createHTML(K):K;if(Or===ic)try{de=new u().parseFromString(ie,Gc)}catch{}if(!de||!de.documentElement){de=A.createDocument(Or,"template",null);try{de.documentElement.innerHTML=ml?C:ie}catch{}}const ye=de.body||de.documentElement;return K&&T&&ye.insertBefore(n.createTextNode(T),ye.childNodes[0]||null),Or===ic?P.call(de,Di?"html":"body")[0]:Di?de.documentElement:ye},Ph=function(K){return L.call(K.ownerDocument||K,K,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},le=function(K){return K instanceof h&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof d)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},dr=function(K){return typeof a=="object"?K instanceof a:K&&typeof K=="object"&&typeof K.nodeType=="number"&&typeof K.nodeName=="string"},io=function(K,de,T){z[K]&&Ult(z[K],ie=>{ie.call(e,de,T,Is)})},un=function(K){let de;if(io("beforeSanitizeElements",K,null),le(K))return Wo(K),!0;const T=Bo(K.nodeName);if(io("uponSanitizeElement",K,{tagName:T,allowedTags:Ne}),K.hasChildNodes()&&!dr(K.firstElementChild)&&(!dr(K.content)||!dr(K.content.firstElementChild))&&Ap(/<[/\w]/g,K.innerHTML)&&Ap(/<[/\w]/g,K.textContent))return Wo(K),!0;if(!Ne[T]||ns[T]){if(!ns[T]&&rt(T)&&(Ii.tagNameCheck instanceof RegExp&&Ap(Ii.tagNameCheck,T)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(T)))return!1;if(zc&&!fl[T]){const ie=w(K)||K.parentNode,ye=b(K)||K.childNodes;if(ye&&ie){const O=ye.length;for(let $=O-1;$>=0;--$)ie.insertBefore(m(ye[$],!0),v(K))}}return Wo(K),!0}return K instanceof c&&!Cs(K)||(T==="noscript"||T==="noembed"||T==="noframes")&&Ap(/<\/no(script|embed|frames)/i,K.innerHTML)?(Wo(K),!0):(Zr&&K.nodeType===3&&(de=K.textContent,de=uv(de,G," "),de=uv(de,Y," "),de=uv(de,j," "),K.textContent!==de&&(i4(e.removed,{element:K.cloneNode()}),K.textContent=de)),io("afterSanitizeElements",K,null),!1)},Se=function(K,de,T){if(Fn&&(de==="id"||de==="name")&&(T in n||T in kc))return!1;if(!(Xr&&!zs[de]&&Ap(ne,de))){if(!(Pn&&Ap(ge,de))){if(!xt[de]||zs[de]){if(!(rt(K)&&(Ii.tagNameCheck instanceof RegExp&&Ap(Ii.tagNameCheck,K)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(K))&&(Ii.attributeNameCheck instanceof RegExp&&Ap(Ii.attributeNameCheck,de)||Ii.attributeNameCheck instanceof Function&&Ii.attributeNameCheck(de))||de==="is"&&Ii.allowCustomizedBuiltInElements&&(Ii.tagNameCheck instanceof RegExp&&Ap(Ii.tagNameCheck,T)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(T))))return!1}else if(!$c[de]){if(!Ap(yt,uv(T,Oe,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&K!=="script"&&zlt(T,"data:")===0&&gg[K])){if(!(ds&&!Ap(De,uv(T,Oe,"")))){if(T)return!1}}}}}}return!0},rt=function(K){return K.indexOf("-")>0},Ft=function(K){let de,T,ie,ye;io("beforeSanitizeAttributes",K,null);const{attributes:O}=K;if(!O)return;const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xt};for(ye=O.length;ye--;){de=O[ye];const{name:se,namespaceURI:Ke}=de;if(T=se==="value"?de.value:$lt(de.value),ie=Bo(se),$.attrName=ie,$.attrValue=T,$.keepAttr=!0,$.forceKeepAttr=void 0,io("uponSanitizeAttribute",K,$),T=$.attrValue,$.forceKeepAttr||(Ha(se,K),!$.keepAttr))continue;if(!Zo&&Ap(/\/>/i,T)){Ha(se,K);continue}Zr&&(T=uv(T,G," "),T=uv(T,Y," "),T=uv(T,j," "));const Bi=Bo(K.nodeName);if(Se(Bi,ie,T)){if(th&&(ie==="id"||ie==="name")&&(Ha(se,K),T=pc+T),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ke)switch(f.getAttributeType(Bi,ie)){case"TrustedHTML":{T=y.createHTML(T);break}case"TrustedScriptURL":{T=y.createScriptURL(T);break}}try{Ke?K.setAttributeNS(Ke,se,T):K.setAttribute(se,T),$Fe(e.removed)}catch{}}}io("afterSanitizeAttributes",K,null)},Ci=function Ot(K){let de;const T=Ph(K);for(io("beforeSanitizeShadowDOM",K,null);de=T.nextNode();)io("uponSanitizeShadowNode",de,null),!un(de)&&(de.content instanceof o&&Ot(de.content),Ft(de));io("afterSanitizeShadowDOM",K,null)};return e.sanitize=function(Ot){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de,T,ie,ye;if(ml=!Ot,ml&&(Ot=""),typeof Ot!="string"&&!dr(Ot))if(typeof Ot.toString=="function"){if(Ot=Ot.toString(),typeof Ot!="string")throw n4("dirty is not a string, aborting")}else throw n4("toString is not a function");if(!e.isSupported)return Ot;if(ss||be(K),e.removed=[],typeof Ot=="string"&&($s=!1),$s){if(Ot.nodeName){const se=Bo(Ot.nodeName);if(!Ne[se]||ns[se])throw n4("root node is forbidden and cannot be sanitized in-place")}}else if(Ot instanceof a)de=ea(""),T=de.ownerDocument.importNode(Ot,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?de=T:de.appendChild(T);else{if(!Tn&&!Zr&&!Di&&Ot.indexOf("<")===-1)return y&&vd?y.createHTML(Ot):Ot;if(de=ea(Ot),!de)return Tn?null:vd?C:""}de&&Oo&&Wo(de.firstChild);const O=Ph($s?Ot:de);for(;ie=O.nextNode();)un(ie)||(ie.content instanceof o&&Ci(ie.content),Ft(ie));if($s)return Ot;if(Tn){if(Ba)for(ye=k.call(de.ownerDocument);de.firstChild;)ye.appendChild(de.firstChild);else ye=de;return(xt.shadowroot||xt.shadowrootmode)&&(ye=R.call(t,ye,!0)),ye}let $=Di?de.outerHTML:de.innerHTML;return Di&&Ne["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Ap(PGe,de.ownerDocument.doctype.name)&&($=" +`+$),Zr&&($=uv($,G," "),$=uv($,Y," "),$=uv($,j," ")),y&&vd?y.createHTML($):$},e.setConfig=function(Ot){be(Ot),ss=!0},e.clearConfig=function(){Is=null,ss=!1},e.isValidAttribute=function(Ot,K,de){Is||be({});const T=Bo(Ot),ie=Bo(K);return Se(T,ie,de)},e.addHook=function(Ot,K){typeof K=="function"&&(z[Ot]=z[Ot]||[],i4(z[Ot],K))},e.removeHook=function(Ot){if(z[Ot])return $Fe(z[Ot])},e.removeHooks=function(Ot){z[Ot]&&(z[Ot]=[])},e.removeAllHooks=function(){z={}},e}var oTe=FGe();const OGe=oTe.sanitize,BGe=oTe.addHook,WGe=oTe.removeHook;function Wc(s){return Pre(s,0)}function Pre(s,e){switch(typeof s){case"object":return s===null?yS(349,e):Array.isArray(s)?sdt(s,e):odt(s,e);case"string":return rTe(s,e);case"boolean":return ndt(s,e);case"number":return yS(s,e);case"undefined":return yS(937,e);default:return yS(617,e)}}function yS(s,e){return(e<<5)-e+s|0}function ndt(s,e){return yS(s?433:863,e)}function rTe(s,e){e=yS(149417,e);for(let t=0,i=s.length;tPre(i,t),e)}function odt(s,e){return e=yS(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=rTe(i,t),Pre(s[i],t)),e)}var Um;(function(s){s[s.BLOCK_SIZE=64]="BLOCK_SIZE",s[s.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(Um||(Um={}));function Ade(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function YFe(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):rdt((s>>>0).toString(16),e/4)}const Wne=class Wne{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(Um.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let n=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let c=r;if(Pc(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=Um.BLOCK_SIZE&&(this._step(),t-=Um.BLOCK_SIZE,this._totalLen+=Um.BLOCK_SIZE,e[0]=e[Um.BLOCK_SIZE+0],e[1]=e[Um.BLOCK_SIZE+1],e[2]=e[Um.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,Um.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),s4(this._h0)+s4(this._h1)+s4(this._h2)+s4(this._h3)+s4(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,YFe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),YFe(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=Wne._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,Ade(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,n=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=n&o|~n&r,l=1518500249):h<40?(c=n^o^r,l=1859775393):h<60?(c=n&o|n&r|o&r,l=2400959708):(c=n^o^r,l=3395469782),d=Ade(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=Ade(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};Wne._bigBlock32=new DataView(new ArrayBuffer(320));let fpe=Wne;function Ka(s,e,t){return Math.min(Math.max(s,e),t)}function JFe(s,e){return(e+s%e)%e}class adt{constructor(){this._next=0}getNext(){return this._next++}}class aTe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class cdt{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n{s.delete(r.vscodeWindowId),i.fire(r)})),a.add(ue(r,ke.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(c),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return s.has(r)},getWindowById:o,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=r;return c?.view?c.view.window:si},getDocument(r){return ct(r).document}}}();function Ms(s){for(;s.firstChild;)s.firstChild.remove()}class udt{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function ue(s,e,t,i){return new udt(s,e,t,i)}function HGe(s,e){return function(t){return e(new Eh(s,t))}}function gdt(s){return function(e){return s(new En(e))}}const Ro=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=HGe(ct(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=gdt(i)),ue(e,t,o,n)},fdt=function(e,t,i){const n=HGe(ct(e),t);return pdt(e,n,i)};function pdt(s,e,t){return ue(s,dm&&kO.pointerEvents?ke.POINTER_DOWN:ke.MOUSE_DOWN,e,t)}function XP(s,e,t){return TO(s,e,t)}class XV extends LGe{constructor(e,t){super(e,t)}}let Uj,Ll;function mdt(s,e,t,i){let n=0;const o=s.setInterval(()=>{n++,(n>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{s.clearInterval(o)});return r}class X7 extends J7{constructor(e){super(),this.defaultTarget=e&&ct(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Ede{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){vt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,i=new Map,n=o=>{t.set(o,!1);const r=s.get(o)??[];for(e.set(o,r),s.set(o,[]),i.set(o,!0);r.length>0;)r.sort(Ede.sort),r.shift().execute();i.set(o,!1)};Ll=(o,r,a=0)=>{const c=F2(o),l=new Ede(r,a);let d=s.get(c);return d||(d=[],s.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>n(c))),l},Uj=(o,r,a)=>{const c=F2(o);if(i.get(c)){const l=new Ede(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return Ll(o,r,a)}})();const _dt=8,vdt=function(s,e){return e};class bdt extends V{constructor(e,t,i,n=vdt,o=_dt){super();let r=null,a=0;const c=this._register(new Cm),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(ue(e,t,d=>{r=n(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function wdt(s,e,t,i,n){return new bdt(s,e,t,i,n)}function Fre(s){return ct(s).getComputedStyle(s,null)}function z_(s,e){const t=ct(s),i=t.document;if(s!==i.body)return new bn(s.clientWidth,s.clientHeight);if(dm&&t?.visualViewport)return new bn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new bn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new bn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new bn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class $r{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Fre(e),o=n?n.getPropertyValue(t):"0";return $r.convertToPixels(e,o)}static getBorderLeftWidth(e){return $r.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return $r.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return $r.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return $r.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return $r.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return $r.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return $r.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return $r.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return $r.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return $r.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return $r.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return $r.getDimension(e,"margin-bottom","marginBottom")}}const u1=class u1{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new u1(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof u1?e:new u1(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};u1.None=new u1(0,0);let bn=u1;function Vj(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const n=$Ge(s)?null:Fre(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=$r.getBorderLeftWidth(s),t+=$r.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function UGe(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function Cr(s){const e=s.getBoundingClientRect(),t=ct(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function VGe(s){let e=s,t=1;do{const i=Fre(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Pd(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.offsetWidth+e}function ZV(s){const e=$r.getBorderLeftWidth(s)+$r.getBorderRightWidth(s),t=$r.getPaddingLeft(s)+$r.getPaddingRight(s);return s.offsetWidth-e-t}function ydt(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.scrollWidth+e}function cTe(s){const e=$r.getBorderTopWidth(s)+$r.getBorderBottomWidth(s),t=$r.getPaddingTop(s)+$r.getPaddingBottom(s);return s.offsetHeight-e-t}function fb(s){const e=$r.getMarginTop(s)+$r.getMarginBottom(s);return s.offsetHeight+e}function Cdt(s,e){if(s===null)return 0;const t=Vj(s),i=Vj(e);return t.left-i.left}function Sdt(s,e){const t=e.map(n=>Math.max(ydt(n),Pd(n))+Cdt(n,s)||0);return Math.max(...t)}function wc(s,e){return!!e?.contains(s)}const zGe="parentFlowToElementId";function Adt(s,e){s.dataset[zGe]=e.id}function Edt(s){const e=s.dataset[zGe];return typeof e=="string"?s.ownerDocument.getElementById(e):null}function xdt(s,e){let t=s;for(;t;){if(t===e)return!0;if(Yr(t)){const i=Edt(t);if(i){t=i;continue}}t=t.parentNode}return!1}function Ddt(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function pq(s,e,t){return!!Ddt(s,e,t)}function $Ge(s){return s&&!!s.host&&!!s.mode}function k8(s){return!!vM(s)}function vM(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return $Ge(s)?s:null}function Bc(){let s=Hu().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function av(s){return Bc()===s}function lTe(s){return wc(Bc(),s)}function kdt(s){return s.ownerDocument===Hu()}function Hu(){return ldt()<=1?si.document:Array.from(D8()).map(({window:e})=>e.document).find(e=>e.hasFocus())??si.document}function ky(){return Hu().defaultView?.window??si}const dTe=new Map;function GGe(){return new Idt}class Idt{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=gl(si.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function gl(s=si.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),s.appendChild(i),t&&t.add(Ee(()=>i.remove())),s===si.document.head){const n=new Set;dTe.set(i,n);for(const{window:o,disposables:r}of D8()){if(o===si)continue;const a=r.add(Tdt(i,n,o));t?.add(a)}}return i}function Tdt(s,e,t){const i=new Z,n=s.cloneNode(!0);t.document.head.appendChild(n),i.add(Ee(()=>n.remove()));for(const o of qGe(s))n.sheet?.insertRule(o.cssText,n.sheet?.cssRules.length);return i.add(Ldt.observe(s,i,{childList:!0})(()=>{n.textContent=s.textContent})),e.add(n),i.add(Ee(()=>e.delete(n))),i}const Ldt=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));const n=Wc(t);let o=i.get(n);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(s,t);const c=o={users:1,observer:a,onDidMutate:r.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(r.dispose(),a.disconnect(),i?.delete(n),i?.size===0&&this.mutationObservers.delete(s))})),i.set(n,o)}return o.onDidMutate}};let xde=null;function KGe(){return xde||(xde=gl()),xde}function qGe(s){return s?.sheet?.rules?s.sheet.rules:s?.sheet?.cssRules?s.sheet.cssRules:[]}function Uf(s,e,t=KGe()){if(!(!t||!e)){t.sheet?.insertRule(`${s} {${e}}`,0);for(const i of dTe.get(t)??[])Uf(s,e,i)}}function CS(s,e=KGe()){if(!e)return;const t=qGe(e),i=[];for(let n=0;n=0;n--)e.sheet?.deleteRule(i[n]);for(const n of dTe.get(e)??[])CS(s,n)}function Rdt(s){return typeof s.selectorText=="string"}function Yr(s){return s instanceof HTMLElement||s instanceof ct(s).HTMLElement}function XFe(s){return s instanceof HTMLAnchorElement||s instanceof ct(s).HTMLAnchorElement}function Mdt(s){return s instanceof HTMLTextAreaElement||s instanceof ct(s).HTMLTextAreaElement}function Ndt(s){return s instanceof HTMLInputElement||s instanceof ct(s).HTMLInputElement}function Pdt(s){return s instanceof SVGElement||s instanceof ct(s).SVGElement}function hTe(s){return s instanceof MouseEvent||s instanceof ct(s).MouseEvent}function d_(s){return s instanceof KeyboardEvent||s instanceof ct(s).KeyboardEvent}function Fdt(s){return s instanceof DragEvent||s instanceof ct(s).DragEvent}const ke={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:vT?"webkitAnimationStart":"animationstart",ANIMATION_END:vT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:vT?"webkitAnimationIteration":"animationiteration"};function Odt(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const en={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function Bdt(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function Wdt(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class zj extends V{static hasFocusWithin(e){if(Yr(e)){const t=vM(e),i=t?t.activeElement:e.ownerDocument.activeElement;return wc(i,e)}else{const t=e;return wc(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event;let t=zj.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Yr(e)?ct(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{zj.hasFocusWithin(e)!==t&&(t?o():n())},this._register(ue(e,ke.FOCUS,n,!0)),this._register(ue(e,ke.BLUR,o,!0)),Yr(e)&&(this._register(ue(e,ke.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ue(e,ke.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Ac(s){return new zj(s)}function QGe(s,e){return s.after(e),e}function re(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Ore(s,e){return s.insertBefore(e,s.firstChild),e}function aa(s,...e){s.innerText="",re(s,...e)}const Hdt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var I8;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(I8||(I8={}));function jGe(s,e,t,...i){const n=Hdt.exec(e);if(!n)throw new Error("Bad use of emmet");const o=n[1]||"div";let r;return s!==I8.HTML?r=document.createElementNS(s,o):r=document.createElement(o),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?r[a]=c:a==="selected"?c&&r.setAttribute(a,"true"):r.setAttribute(a,c))}),r.append(...i),r}function fe(s,e,...t){return jGe(I8.HTML,s,e,...t)}fe.SVG=function(s,e,...t){return jGe(I8.SVG,s,e,...t)};function uTe(s,...e){s?Yh(...e):zd(...e)}function Yh(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function zd(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function ZFe(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function YGe(s){si.open(s,"_blank","noopener")}function Udt(s,e){const t=()=>{e(),i=Ll(s,t)};let i=Ll(s,t);return Ee(()=>i.dispose())}E8.setPreferredWebSchema(/^https:/.test(si.location.href)?"https":"http");function Zu(s){return s?`url('${ef.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function mq(s){return`'${s.replace(/'/g,"%27")}'`}function Iy(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Iy(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function Vdt(s,e){let t;if(N.isUri(s))t=s.toString(!0);else{const o=new Blob([s]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=ky(),n=document.createElement("a");i.document.body.appendChild(n),n.download=e,n.href=t,n.click(),setTimeout(()=>n.remove())}function zdt(){return new Promise(s=>{const e=ky(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,M.once(M.fromDOMEventEmitter(t,"input"))(()=>{s(t.files??void 0)}),t.click(),setTimeout(()=>t.remove())})}var e5;(function(s){s[s.DOCUMENT=1]="DOCUMENT",s[s.BROWSER=2]="BROWSER"})(e5||(e5={}));function $dt(s){return s.document.fullscreenElement||s.document.webkitFullscreenElement||s.document.webkitIsFullScreen?{mode:e5.DOCUMENT,guess:!1}:s.innerHeight===s.screen.height?{mode:e5.BROWSER,guess:!1}:(Qt||pr)&&s.outerHeight===s.screen.height&&s.outerWidth===s.screen.width?{mode:e5.BROWSER,guess:!0}:null}function Gdt(s,e=!1){const t=document.createElement("a");return BGe("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const o=i.getAttribute(n);if(n==="href"&&o.startsWith("#"))continue;if(t.href=o,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ee(()=>{WGe("afterSanitizeAttributes")})}pe.http,pe.https,pe.command;const Kdt=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);function qdt(s){const e=new Uint16Array(s.length);for(let n=0;nthis.registerListeners(e,t),{window:si,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ue(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new En(i);if(!(n.keyCode===S.Alt&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(n.keyCode!==S.Alt)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(ue(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(ue(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ue(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return pb.instance||(pb.instance=new pb),pb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class $j extends V{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ue(this.element,ke.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(ue(this.element,ke.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(ue(this.element,ke.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(ue(this.element,ke.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(ue(this.element,ke.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(ue(this.element,ke.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(ue(this.element,ke.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const JGe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Bt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=JGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElement(o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.groups.class.split("."))l!==""&&a.push(l);if(t.className!==void 0)for(const l of t.className.split("."))l!==""&&a.push(l);a.length>0&&(r.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(l)?r.appendChild(l):typeof l=="string"?r.append(l):"root"in l&&(Object.assign(c,l),r.appendChild(l.root));for(const[l,d]of Object.entries(t))if(l!=="className")if(l==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(Gj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(Gj(l),d.toString());return c.root=r,c}function tP(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=JGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElementNS("http://www.w3.org/2000/svg",o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.groups.class.split("."))l!==""&&a.push(l);if(t.className!==void 0)for(const l of t.className.split("."))l!==""&&a.push(l);a.length>0&&(r.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(l)?r.appendChild(l):typeof l=="string"?r.append(l):"root"in l&&(Object.assign(c,l),r.appendChild(l.root));for(const[l,d]of Object.entries(t))if(l!=="className")if(l==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(Gj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(Gj(l),d.toString());return c.root=r,c}function Gj(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Qdt extends V{constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class jdt extends V{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new Qdt(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class Ydt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=F2(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=A2(new jdt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),A2(M.once(hdt)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const L8=new Ydt;class XGe{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=wf(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=wf(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=wf(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=wf(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=wf(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=wf(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=wf(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=wf(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=wf(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=wf(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=wf(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=wf(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=wf(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=wf(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function wf(s){return typeof s=="number"?`${s}px`:s}function ls(s){return new XGe(s)}function Dl(s,e){s instanceof XGe?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}var sc;(function(s){s[s.Regular=0]="Regular",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold"})(sc||(sc={}));class Jdt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class gTe{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Dl(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Dl(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Dl(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const r of this._requests){let a;r.type===sc.Regular&&(a=t),r.type===sc.Bold&&(a=i),r.type===sc.Italic&&(a=n),a.appendChild(document.createElement("br"));const c=document.createElement("span");gTe._render(c,r),a.appendChild(c),o.push(c)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&this._onDidChange.fire()}serializeFontInfo(e){return this._ensureCache(e).getValues().filter(i=>i.isTrusted)}restoreFontInfo(e,t){for(const i of t){if(i.version!==ZGe)continue;const n=new _q(i,!1);this._writeToCache(e,n,n)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new _q({pixelRatio:L8.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return i.get(t)}_createRequest(e,t,i,n){const o=new Jdt(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",sc.Regular,i,n),r=this._createRequest("m",sc.Regular,i,null),a=this._createRequest(" ",sc.Regular,i,n),c=this._createRequest("0",sc.Regular,i,n),l=this._createRequest("1",sc.Regular,i,n),d=this._createRequest("2",sc.Regular,i,n),h=this._createRequest("3",sc.Regular,i,n),u=this._createRequest("4",sc.Regular,i,n),f=this._createRequest("5",sc.Regular,i,n),p=this._createRequest("6",sc.Regular,i,n),m=this._createRequest("7",sc.Regular,i,n),v=this._createRequest("8",sc.Regular,i,n),b=this._createRequest("9",sc.Regular,i,n),w=this._createRequest("→",sc.Regular,i,n),y=this._createRequest("→",sc.Regular,i,null),C=this._createRequest("·",sc.Regular,i,n),A=this._createRequest("⸱",sc.Regular,i,null),L="|/-_ilm%";for(let G=0,Y=L.length;G.001){P=!1;break}}let z=!0;return P&&y.width!==R&&(z=!1),y.width>w.width&&(z=!1),new _q({pixelRatio:L8.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:P,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:A.width,maxDigitWidth:k},!0)}}class tht{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const ppe=new eht;var b_;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(b_||(b_={}));const we=ae("instantiationService");function iht(s,e,t){e[b_.DI_TARGET]===e?e[b_.DI_DEPENDENCIES].push({id:s,index:t}):(e[b_.DI_DEPENDENCIES]=[{id:s,index:t}],e[b_.DI_TARGET]=e)}function ae(s){if(b_.serviceIds.has(s))return b_.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iht(e,t,n)};return e.toString=()=>s,b_.serviceIds.set(s,e),e}const Kt=ae("codeEditorService"),gi=ae("modelService"),fn=ae("textModelService");function nht(s){return!!s.textEditorModel}function D(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function _(s,e){return function(t,i){e(t,i,s)}}class rn extends V{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class $_ extends V{constructor(){super(...arguments),this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const Mz=class Mz{constructor(){this.id=Mz.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Mz,...i]:t=i);return t}async run(){}};Mz.ID="vs.actions.separator";let Ar=Mz;class Nk{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}const Hne=class Hne extends rn{constructor(){super(Hne.ID,g(1610,"(empty)"),void 0,!1)}};Hne.ID="vs.actions.empty";let mpe=Hne;function rl(s){return{id:s.id,label:s.label,tooltip:s.tooltip??s.label,class:s.class,enabled:s.enabled??!0,checked:s.checked,run:async(...e)=>s.run(...e)}}var O2;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(O2||(O2={}));function eOe(s){return{id:s}}var We;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(ve.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}s.asClassNameArray=t;function i(u){return t(u).join(" ")}s.asClassName=i;function n(u){return"."+t(u).join(".")}s.asCSSSelector=n;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||O2.isThemeColor(u.color))}s.isThemeIcon=o;const r=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}s.fromString=a;function c(u){return{id:u}}s.fromId=c;function l(u,f){let p=u.id;const m=p.lastIndexOf("~");return m!==-1&&(p=p.substring(0,m)),f&&(p=`${p}~${f}`),{id:p}}s.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}s.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}s.isEqual=h})(We||(We={}));const vi=ae("commandService"),_t=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const r=[];for(const c of s.metadata.args)r.push(c.constraint);const a=s.handler;s.handler=function(c,...l){return mrt(l,r),a(c,...l)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new hl,this._commands.set(t,i));const n=i.unshift(s),o=Ee(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return _t.registerCommand(s,(t,...i)=>t.get(vi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return hi.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};_t.registerCommand("noop",()=>{});const Le=ae("contextKeyService");function Yf(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Z7(s,e="Unreachable"){throw new Error(e)}function tOe(s){s||vt(new Ni("Soft Assertion Failed"))}function G_(s){if(!s()){debugger;s(),vt(new Ni("Assertion Failed"))}}function bU(s,e){let t=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(rht)),this._cachedMergedKeybindings.slice(0)}}const So=new fTe,oht={EditorModes:"platform.keybindingsRegistry"};Qe.add(oht.EditorModes,So);function rht(s,e){if(s.weight1!==e.weight1)return s.weight1-e.weight1;if(s.command&&e.command){if(s.commande.command)return 1}return s.weight2-e.weight2}var vq;function bT(s){return s.command!==void 0}function aht(s){return s.submenu!==void 0}const te=class te{static for(e){return te._instances.get(e)??new te(e)}constructor(e){if(te._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);te._instances.set(e,this),this.id=e}};te._instances=new Map,te.CommandPalette=new te("CommandPalette"),te.DebugBreakpointsContext=new te("DebugBreakpointsContext"),te.DebugCallStackContext=new te("DebugCallStackContext"),te.DebugConsoleContext=new te("DebugConsoleContext"),te.DebugVariablesContext=new te("DebugVariablesContext"),te.NotebookVariablesContext=new te("NotebookVariablesContext"),te.DebugHoverContext=new te("DebugHoverContext"),te.DebugWatchContext=new te("DebugWatchContext"),te.DebugToolBar=new te("DebugToolBar"),te.DebugToolBarStop=new te("DebugToolBarStop"),te.DebugCallStackToolbar=new te("DebugCallStackToolbar"),te.EditorContext=new te("EditorContext"),te.SimpleEditorContext=new te("SimpleEditorContext"),te.EditorContent=new te("EditorContent"),te.EditorLineNumberContext=new te("EditorLineNumberContext"),te.EditorContextCopy=new te("EditorContextCopy"),te.EditorContextPeek=new te("EditorContextPeek"),te.EditorContextShare=new te("EditorContextShare"),te.EditorTitle=new te("EditorTitle"),te.EditorTitleRun=new te("EditorTitleRun"),te.EditorTitleContext=new te("EditorTitleContext"),te.EditorTitleContextShare=new te("EditorTitleContextShare"),te.EmptyEditorGroup=new te("EmptyEditorGroup"),te.EmptyEditorGroupContext=new te("EmptyEditorGroupContext"),te.EditorTabsBarContext=new te("EditorTabsBarContext"),te.EditorTabsBarShowTabsSubmenu=new te("EditorTabsBarShowTabsSubmenu"),te.EditorTabsBarShowTabsZenModeSubmenu=new te("EditorTabsBarShowTabsZenModeSubmenu"),te.EditorActionsPositionSubmenu=new te("EditorActionsPositionSubmenu"),te.ExplorerContext=new te("ExplorerContext"),te.ExplorerContextShare=new te("ExplorerContextShare"),te.ExtensionContext=new te("ExtensionContext"),te.GlobalActivity=new te("GlobalActivity"),te.CommandCenter=new te("CommandCenter"),te.CommandCenterCenter=new te("CommandCenterCenter"),te.LayoutControlMenuSubmenu=new te("LayoutControlMenuSubmenu"),te.LayoutControlMenu=new te("LayoutControlMenu"),te.MenubarMainMenu=new te("MenubarMainMenu"),te.MenubarAppearanceMenu=new te("MenubarAppearanceMenu"),te.MenubarDebugMenu=new te("MenubarDebugMenu"),te.MenubarEditMenu=new te("MenubarEditMenu"),te.MenubarCopy=new te("MenubarCopy"),te.MenubarFileMenu=new te("MenubarFileMenu"),te.MenubarGoMenu=new te("MenubarGoMenu"),te.MenubarHelpMenu=new te("MenubarHelpMenu"),te.MenubarLayoutMenu=new te("MenubarLayoutMenu"),te.MenubarNewBreakpointMenu=new te("MenubarNewBreakpointMenu"),te.PanelAlignmentMenu=new te("PanelAlignmentMenu"),te.PanelPositionMenu=new te("PanelPositionMenu"),te.ActivityBarPositionMenu=new te("ActivityBarPositionMenu"),te.MenubarPreferencesMenu=new te("MenubarPreferencesMenu"),te.MenubarRecentMenu=new te("MenubarRecentMenu"),te.MenubarSelectionMenu=new te("MenubarSelectionMenu"),te.MenubarShare=new te("MenubarShare"),te.MenubarSwitchEditorMenu=new te("MenubarSwitchEditorMenu"),te.MenubarSwitchGroupMenu=new te("MenubarSwitchGroupMenu"),te.MenubarTerminalMenu=new te("MenubarTerminalMenu"),te.MenubarViewMenu=new te("MenubarViewMenu"),te.MenubarHomeMenu=new te("MenubarHomeMenu"),te.OpenEditorsContext=new te("OpenEditorsContext"),te.OpenEditorsContextShare=new te("OpenEditorsContextShare"),te.ProblemsPanelContext=new te("ProblemsPanelContext"),te.SCMInputBox=new te("SCMInputBox"),te.SCMChangesSeparator=new te("SCMChangesSeparator"),te.SCMChangesContext=new te("SCMChangesContext"),te.SCMIncomingChanges=new te("SCMIncomingChanges"),te.SCMIncomingChangesContext=new te("SCMIncomingChangesContext"),te.SCMIncomingChangesSetting=new te("SCMIncomingChangesSetting"),te.SCMOutgoingChanges=new te("SCMOutgoingChanges"),te.SCMOutgoingChangesContext=new te("SCMOutgoingChangesContext"),te.SCMOutgoingChangesSetting=new te("SCMOutgoingChangesSetting"),te.SCMIncomingChangesAllChangesContext=new te("SCMIncomingChangesAllChangesContext"),te.SCMIncomingChangesHistoryItemContext=new te("SCMIncomingChangesHistoryItemContext"),te.SCMOutgoingChangesAllChangesContext=new te("SCMOutgoingChangesAllChangesContext"),te.SCMOutgoingChangesHistoryItemContext=new te("SCMOutgoingChangesHistoryItemContext"),te.SCMChangeContext=new te("SCMChangeContext"),te.SCMResourceContext=new te("SCMResourceContext"),te.SCMResourceContextShare=new te("SCMResourceContextShare"),te.SCMResourceFolderContext=new te("SCMResourceFolderContext"),te.SCMResourceGroupContext=new te("SCMResourceGroupContext"),te.SCMSourceControl=new te("SCMSourceControl"),te.SCMSourceControlInline=new te("SCMSourceControlInline"),te.SCMSourceControlTitle=new te("SCMSourceControlTitle"),te.SCMTitle=new te("SCMTitle"),te.SearchContext=new te("SearchContext"),te.SearchActionMenu=new te("SearchActionContext"),te.StatusBarWindowIndicatorMenu=new te("StatusBarWindowIndicatorMenu"),te.StatusBarRemoteIndicatorMenu=new te("StatusBarRemoteIndicatorMenu"),te.StickyScrollContext=new te("StickyScrollContext"),te.TestItem=new te("TestItem"),te.TestItemGutter=new te("TestItemGutter"),te.TestProfilesContext=new te("TestProfilesContext"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TestCallStack=new te("TestCallStack"),te.TouchBarContext=new te("TouchBarContext"),te.TitleBarContext=new te("TitleBarContext"),te.TitleBarTitleContext=new te("TitleBarTitleContext"),te.TunnelContext=new te("TunnelContext"),te.TunnelPrivacy=new te("TunnelPrivacy"),te.TunnelProtocol=new te("TunnelProtocol"),te.TunnelPortInline=new te("TunnelInline"),te.TunnelTitle=new te("TunnelTitle"),te.TunnelLocalAddressInline=new te("TunnelLocalAddressInline"),te.TunnelOriginInline=new te("TunnelOriginInline"),te.ViewItemContext=new te("ViewItemContext"),te.ViewContainerTitle=new te("ViewContainerTitle"),te.ViewContainerTitleContext=new te("ViewContainerTitleContext"),te.ViewTitle=new te("ViewTitle"),te.ViewTitleContext=new te("ViewTitleContext"),te.CommentEditorActions=new te("CommentEditorActions"),te.CommentThreadTitle=new te("CommentThreadTitle"),te.CommentThreadActions=new te("CommentThreadActions"),te.CommentThreadAdditionalActions=new te("CommentThreadAdditionalActions"),te.CommentThreadTitleContext=new te("CommentThreadTitleContext"),te.CommentThreadCommentContext=new te("CommentThreadCommentContext"),te.CommentTitle=new te("CommentTitle"),te.CommentActions=new te("CommentActions"),te.CommentsViewThreadActions=new te("CommentsViewThreadActions"),te.InteractiveToolbar=new te("InteractiveToolbar"),te.InteractiveCellTitle=new te("InteractiveCellTitle"),te.InteractiveCellDelete=new te("InteractiveCellDelete"),te.InteractiveCellExecute=new te("InteractiveCellExecute"),te.InteractiveInputExecute=new te("InteractiveInputExecute"),te.InteractiveInputConfig=new te("InteractiveInputConfig"),te.ReplInputExecute=new te("ReplInputExecute"),te.IssueReporter=new te("IssueReporter"),te.NotebookToolbar=new te("NotebookToolbar"),te.NotebookStickyScrollContext=new te("NotebookStickyScrollContext"),te.NotebookCellTitle=new te("NotebookCellTitle"),te.NotebookCellDelete=new te("NotebookCellDelete"),te.NotebookCellInsert=new te("NotebookCellInsert"),te.NotebookCellBetween=new te("NotebookCellBetween"),te.NotebookCellListTop=new te("NotebookCellTop"),te.NotebookCellExecute=new te("NotebookCellExecute"),te.NotebookCellExecuteGoTo=new te("NotebookCellExecuteGoTo"),te.NotebookCellExecutePrimary=new te("NotebookCellExecutePrimary"),te.NotebookDiffCellInputTitle=new te("NotebookDiffCellInputTitle"),te.NotebookDiffCellMetadataTitle=new te("NotebookDiffCellMetadataTitle"),te.NotebookDiffCellOutputsTitle=new te("NotebookDiffCellOutputsTitle"),te.NotebookOutputToolbar=new te("NotebookOutputToolbar"),te.NotebookOutlineFilter=new te("NotebookOutlineFilter"),te.NotebookOutlineActionMenu=new te("NotebookOutlineActionMenu"),te.NotebookEditorLayoutConfigure=new te("NotebookEditorLayoutConfigure"),te.NotebookKernelSource=new te("NotebookKernelSource"),te.BulkEditTitle=new te("BulkEditTitle"),te.BulkEditContext=new te("BulkEditContext"),te.TimelineItemContext=new te("TimelineItemContext"),te.TimelineTitle=new te("TimelineTitle"),te.TimelineTitleContext=new te("TimelineTitleContext"),te.TimelineFilterSubMenu=new te("TimelineFilterSubMenu"),te.AccountsContext=new te("AccountsContext"),te.SidebarTitle=new te("SidebarTitle"),te.PanelTitle=new te("PanelTitle"),te.AuxiliaryBarTitle=new te("AuxiliaryBarTitle"),te.AuxiliaryBarHeader=new te("AuxiliaryBarHeader"),te.TerminalInstanceContext=new te("TerminalInstanceContext"),te.TerminalEditorInstanceContext=new te("TerminalEditorInstanceContext"),te.TerminalNewDropdownContext=new te("TerminalNewDropdownContext"),te.TerminalTabContext=new te("TerminalTabContext"),te.TerminalTabEmptyAreaContext=new te("TerminalTabEmptyAreaContext"),te.TerminalStickyScrollContext=new te("TerminalStickyScrollContext"),te.WebviewContext=new te("WebviewContext"),te.InlineCompletionsActions=new te("InlineCompletionsActions"),te.InlineEditsActions=new te("InlineEditsActions"),te.InlineEditActions=new te("InlineEditActions"),te.NewFile=new te("NewFile"),te.MergeInput1Toolbar=new te("MergeToolbar1Toolbar"),te.MergeInput2Toolbar=new te("MergeToolbar2Toolbar"),te.MergeBaseToolbar=new te("MergeBaseToolbar"),te.MergeInputResultToolbar=new te("MergeToolbarResultToolbar"),te.InlineSuggestionToolbar=new te("InlineSuggestionToolbar"),te.InlineEditToolbar=new te("InlineEditToolbar"),te.ChatContext=new te("ChatContext"),te.ChatCodeBlock=new te("ChatCodeblock"),te.ChatCompareBlock=new te("ChatCompareBlock"),te.ChatMessageTitle=new te("ChatMessageTitle"),te.ChatExecute=new te("ChatExecute"),te.ChatExecuteSecondary=new te("ChatExecuteSecondary"),te.ChatInputSide=new te("ChatInputSide"),te.AccessibleView=new te("AccessibleView"),te.MultiDiffEditorFileToolbar=new te("MultiDiffEditorFileToolbar"),te.DiffEditorHunkToolbar=new te("DiffEditorHunkToolbar"),te.DiffEditorSelectionToolbar=new te("DiffEditorSelectionToolbar");let _e=te;const Nz=class Nz{static for(e){let t=this._all.get(e);return t||(t=new Nz(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Nz&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Nz._all=new Map;let F0=Nz;const jn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new jrt({merge:F0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(F0.for(_e.CommandPalette)),Ee(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(F0.for(_e.CommandPalette))})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){let t=this._menuItems.get(s);t||(t=new hl,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(F0.for(s)),Ee(()=>{i(),this._onDidChangeMenu.fire(F0.for(s))})}appendMenuItems(s){const e=new Z;for(const{id:t,item:i}of s)e.add(this.appendMenuItem(t,i));return e}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===_e.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)bT(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class Ty extends Nk{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let Sc=vq=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,n,o,r,a){this.hideActions=n,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=vq.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&We.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=We.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new vq(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=c&&We.asClassName(c)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};Sc=vq=D([_(5,Le),_(6,vi)],Sc);class li{constructor(e){this.desc=e}}function At(s){const e=[],t=new s,{f1:i,menu:n,keybinding:o,...r}=t.desc;if(_t.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(_t.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(n))for(const a of n)e.push(jn.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(jn.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(jn.appendMenuItem(_e.CommandPalette,{command:r,when:r.precondition})),e.push(jn.addCommand(r))),Array.isArray(o))for(const a of o)e.push(So.registerKeybindingRule({...a,id:r.id,when:r.precondition?he.and(r.precondition,a.when):a.when}));else o&&e.push(So.registerKeybindingRule({...o,id:r.id,when:r.precondition?he.and(r.precondition,o.when):o.when}));return{dispose(){bt(e)}}}const Yi=ae("telemetryService"),cht=ae("customEndpointTelemetryService"),Ge=ae("logService"),uf=ae("loggerService");var ri;(function(s){s[s.Eager=0]="Eager",s[s.AfterFirstRender=1]="AfterFirstRender",s[s.BeforeFirstInteraction=2]="BeforeFirstInteraction",s[s.Eventually=3]="Eventually",s[s.Lazy=4]="Lazy"})(ri||(ri={}));let Bre=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=he.and(i,this.precondition):i=this.precondition);const n={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};So.registerKeybindingRule(n)}}_t.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){jn.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class wI extends Bre{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Le).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return hc.runEditorCommand(e,t,this.precondition,(i,n,o)=>this.runEditorCommand(i,n,o))}}class tt extends hc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=_e.EditorContext),n.title||(n.title=e.label),n.when=he.and(e.precondition,n.when),n}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(tt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Yi).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class tKe extends tt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Le),a=o.get(Ge);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(o,n,...t)})}}function rg(s,e){_t.registerCommand(s,function(t,...i){const n=t.get(we),[o,r]=i;Tt(N.isUri(o)),Tt(oe.isIPosition(r));const a=t.get(gi).getModel(o);if(a){const c=oe.lift(r);return n.invokeFunction(e,a,c,...i.slice(2))}return t.get(fn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=n.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function qe(s){return Jf.INSTANCE.registerEditorCommand(s),s}function Re(s){const e=new s;return Jf.INSTANCE.registerEditorAction(e),e}function iKe(s){return Jf.INSTANCE.registerEditorAction(s),s}function lht(s){Jf.INSTANCE.registerEditorAction(s)}function on(s,e,t){Jf.INSTANCE.registerEditorContribution(s,e,t)}function nKe(s,e){Jf.INSTANCE.registerDiffEditorContribution(s,e)}var ap;(function(s){function e(r){return Jf.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return Jf.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return Jf.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return Jf.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return Jf.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(ap||(ap={}));const dht={EditorCommonContributions:"editor.contributions"},Une=class Une{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}registerDiffEditorContribution(e,t){this.diffEditorContributions.push({id:e,ctor:t})}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};Une.INSTANCE=new Une;let Jf=Une;Qe.add(dht.EditorCommonContributions,Jf.INSTANCE);function e6(s){return s.register(),s}const sKe=e6(new wI({id:"undo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyZ},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(550,"&&Undo"),order:1},{menuId:_e.CommandPalette,group:"",title:g(551,"Undo"),order:1}]}));e6(new eKe(sKe,{id:"default:undo",precondition:void 0}));const oKe=e6(new wI({id:"redo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyY,secondary:[U.CtrlCmd|U.Shift|S.KeyZ],mac:{primary:U.CtrlCmd|U.Shift|S.KeyZ}},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(552,"&&Redo"),order:2},{menuId:_e.CommandPalette,group:"",title:g(553,"Redo"),order:1}]}));e6(new eKe(oKe,{id:"default:redo",precondition:void 0}));const hht=e6(new wI({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:null,primary:U.CtrlCmd|S.KeyA},menuOpts:[{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(554,"&&Select All"),order:1},{menuId:_e.CommandPalette,group:"",title:g(555,"Select All"),order:1}]})),uht="$initialize";let iOe=!1;function _pe(s){Wn&&(iOe||(iOe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(s.message))}var Wf;(function(s){s[s.Request=0]="Request",s[s.Reply=1]="Reply",s[s.SubscribeEvent=2]="SubscribeEvent",s[s.Event=3]="Event",s[s.UnsubscribeEvent=4]="UnsubscribeEvent"})(Wf||(Wf={}));class ght{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=Wf.Request}}class nOe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=Wf.Reply}}class fht{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=Wf.SubscribeEvent}}class pht{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=Wf.Event}}class mht{constructor(e,t){this.vsWorker=e,this.req=t,this.type=Wf.UnsubscribeEvent}}class _ht{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new ght(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new fht(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new mht(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case Wf.Reply:return this._handleReplyMessage(e);case Wf.Request:return this._handleRequestMessage(e);case Wf.SubscribeEvent:return this._handleSubscribeEventMessage(e);case Wf.Event:return this._handleEventMessage(e);case Wf.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(n=>{this._send(new nOe(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=SA(n.detail)),this._send(new nOe(this._workerId,t,void 0,SA(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new pht(this._workerId,t,n))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===Wf.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{n?.(l)})),this._protocol=new _ht({sendMessage:(l,d)=>{this._worker.postMessage(l,d)},handleMessage:(l,d)=>{if(typeof i[l]!="function")return Promise.reject(new Error("Missing method "+l+" on main thread host."));try{return Promise.resolve(i[l].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(l,d)=>{if(aKe(l)){const h=i[l].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${l} on main thread host.`);return h}if(rKe(l)){const h=i[l];if(typeof h!="function")throw new Error(`Missing event ${l} on main thread host.`);return h}throw new Error(`Malformed event name ${l}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const r=W1e(i);this._onModuleLoaded=this._protocol.sendMessage(uht,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(l,d)=>this._request(l,d),c=(l,d)=>this._protocol.listen(l,d);this._lazyProxy=new Promise((l,d)=>{n=d,this._onModuleLoaded.then(h=>{l(bht(h,a,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function rKe(s){return s[0]==="o"&&s[1]==="n"&&Ow(s.charCodeAt(2))}function aKe(s){return/^onDynamic/.test(s)&&Ow(s.charCodeAt(9))}function bht(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)},o={};for(const r of s){if(aKe(r)){o[r]=n(r);continue}if(rKe(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function QA(s,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(s,e)}catch(i){vt(i);return}try{return globalThis.trustedTypes?.createPolicy(s,e)}catch(i){vt(i);return}}let Kj;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?Kj=globalThis.workerttPolicy:Kj=QA("defaultWorkerFactory",{createScriptURL:s=>s});function wht(s){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",s);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",s);return new Worker(Kj?Kj.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function yht(s){return typeof s.then=="function"}class Cht extends V{constructor(e,t,i,n,o){super(),this.id=t,this.label=i;const r=wht(i);yht(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){n(c.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",o),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){vt(n),vt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}})}}const Vne=class Vne{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++Vne.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Cht(e,n,this._label||"anonymous"+n,t,o=>{_pe(o),this._webWorkerFailedBeforeError=o,i(o)})}};Vne.LAST_WORKER_ID=0;let vpe=Vne;var yr;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(yr||(yr={}));class kde{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew kde(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new kde({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new kde({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `,g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `,g1.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` + `;let bpe=g1;function E1(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let o=i;for(;o+10&&s.getLanguageId(r-1)===n;)r--;return new Aht(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class Aht{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}var wpe;(function(s){s[s.value=3]="value"})(wpe||(wpe={}));function Zb(s){return(s&wpe.value)!==0}function bq(s){const e=s;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Ide(s){const e=s;return e?bq(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function jA(s,e){return new Eht(s,e)}class Eht{constructor(e,t){this.reducer=e,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?vt(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let i;switch(e){case"data":i=this.listeners.data;break;case"end":i=this.listeners.end;break;case"error":i=this.listeners.error;break}if(i){const n=i.indexOf(t);n>=0&&i.splice(n,1)}}flowData(){if(this.buffer.data.length>0){const e=this.reducer(this.buffer.data);this.emitData(e),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(i=>i())}}flowErrors(){if(this.listeners.error.length>0){for(const e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}function xht(s,e){const t=[];let i;for(;(i=s.read())!==null;)t.push(i);return e(t)}function Dht(s,e,t){const i=[];let n;for(;(n=s.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof n<"u"){const o=n;return n=void 0,o}return s.read()}}}function pTe(s,e){return new Promise((t,i)=>{const n=[];kN(s,{onData:o=>{e&&n.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(n):void 0)}})})}function kN(s,e,t){s.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),s.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),s.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function kht(s,e){return new Promise((t,i)=>{const n=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return n.dispose(),s.pause(),t({stream:s,buffer:o,ended:!1})},a=l=>(n.dispose(),i(l)),c=()=>(n.dispose(),t({stream:s,buffer:o,ended:!0}));n.add(Ee(()=>s.removeListener("error",a))),s.on("error",a),n.add(Ee(()=>s.removeListener("end",c))),s.on("end",c),n.add(Ee(()=>s.removeListener("data",r))),s.on("data",r)})}function Iht(s,e){const t=jA(e);return t.end(s),t}function Tht(s){let e=!1;return{read:()=>e?null:(e=!0,s)}}function Lht(s,e,t){const i=jA(t);return kN(s,{onData:n=>i.write(e.data(n)),onError:n=>i.error(e.error?e.error(n):n),onEnd:()=>i.end()}),i}const xG=typeof Buffer<"u",Rht=new ya(()=>new Uint8Array(256));let Tde,Lde;class $e{static alloc(e){return xG?new $e(Buffer.allocUnsafe(e)):new $e(new Uint8Array(e))}static wrap(e){return xG&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new $e(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&xG?new $e(Buffer.from(e)):(Tde||(Tde=new TextEncoder),new $e(Tde.encode(e)))}static fromByteArray(e){const t=$e.alloc(e.length);for(let i=0,n=e.length;i"u"){t=0;for(let o=0,r=e.length;on-t)return-1;const o=Rht.value;o.fill(e.length);for(let l=0;l>>0|s[e+1]<<8>>>0}function Pht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Iu(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function Tu(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function Fht(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0|s[e+2]<<16>>>0|s[e+3]<<24>>>0}function Oht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255,e=e>>>8,s[t+2]=e&255,e=e>>>8,s[t+3]=e&255}function ype(s,e){return s[e]}function Cpe(s,e,t){s[t]=e}function Bht(s){return xht(s,e=>$e.concat(e))}function cKe(s){return Tht(s)}function eD(s){return pTe(s,e=>$e.concat(e))}async function Wht(s){return s.ended?$e.concat(s.buffer):$e.concat([...s.buffer,await eD(s.stream)])}function t6(s){return Iht(s,e=>$e.concat(e))}function lKe(s){return jA(e=>$e.concat(e),s)}function dKe(s){let e=0,t=0,i=0;const n=new Uint8Array(Math.floor(s.length/4*3)),o=a=>{switch(t){case 3:n[i++]=e|a,t=0;break;case 2:n[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:n[i++]=e|a>>>4,e=a<<4,t=2;break;default:e=a<<2,t=1}};for(let a=0;a=65&&c<=90)o(c-65);else if(c>=97&&c<=122)o(c-97+26);else if(c>=48&&c<=57)o(c-48+52);else if(c===43||c===45)o(62);else if(c===47||c===95)o(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${s[a]}`)}}const r=i;for(;t>0;)o(0);return $e.wrap(n).slice(0,r)}const Hht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function mTe({buffer:s},e=!0,t=!1){const i=t?Uht:Hht;let n="";const o=s.byteLength%3;let r=0;for(;r>>2],n+=i[(a<<4|c>>>4)&63],n+=i[(c<<2|l>>>6)&63],n+=i[l&63]}if(o===1){const a=s[r+0];n+=i[a>>>2],n+=i[a<<4&63],e&&(n+="==")}else if(o===2){const a=s[r+0],c=s[r+1];n+=i[a>>>2],n+=i[(a<<4|c>>>4)&63],n+=i[c<<2&63],e&&(n+="=")}return n}let Rde;function hKe(){return Rde||(Rde=new TextDecoder("UTF-16LE")),Rde}let Mde;function Vht(){return Mde||(Mde=new TextDecoder("UTF-16BE")),Mde}let Nde;function uKe(){return Nde||(Nde=z1e()?hKe():Vht()),Nde}function zht(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?$ht(s,e,t):hKe().decode(i)}function $ht(s,e,t){const i=[];let n=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[c,l]=r,[d,h]=a;return c===d||c===h||l===d||l===h},n=(r,a)=>{const c=Math.min(r,a),l=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:c})}return o}class Kht{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Ght(t);this.brackets=i.map((n,o)=>new qj(e,o,n.open,n.close,qht(n.open,n.close,i,o),Qht(n.open,n.close,i,o))),this.forwardRegex=jht(this.brackets),this.reversedRegex=Yht(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function gKe(s,e,t,i){for(let n=0,o=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function fKe(s,e){return s.length-e.length}function Wre(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function qht(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o=0;r--)n[o++]=i.charCodeAt(r);return uKe().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Om{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=n+r;return new F(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,n,o){const a=_Te(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const c=n+r;return new F(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class Xht{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const n=i.charAt(i.length-1);e.push(n)}return ja(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Zb(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Om.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const c=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}var mb;(function(s){s[s.INCREASE_MASK=1]="INCREASE_MASK",s[s.DECREASE_MASK=2]="DECREASE_MASK",s[s.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",s[s.UNINDENT_MASK=8]="UNINDENT_MASK"})(mb||(mb={}));function DG(s){return s.global&&(s.lastIndex=0),!0}class Zht{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&DG(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&DG(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&DG(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&DG(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=mb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=mb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=mb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=mb.UNINDENT_MASK),t}}class ZP{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=ZP._createOpenBracketRegExp(t[0]),n=ZP._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=ll.Advanced)for(let o=0,r=this._regExpRules.length;ol.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=ll.Brackets&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o=ll.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function out(s){return s.replace(/[\[\]]/g,"")}function rut(s){let e=!1;const t=new Map,i=new Map;if(aut(s,d=>{if(s===d)return!0;const h=JSON.stringify(d);if(h.length<30)return!0;const u=t.get(h);if(!u){const f={schemas:[d]};return t.set(h,f),i.set(d,f),!0}return u.schemas.push(d),i.set(d,u),e=!0,!1}),t.clear(),!e)return JSON.stringify(s);let o="$defs";for(;s.hasOwnProperty(o);)o+="_";const r=[];function a(d){return JSON.stringify(d,(h,u)=>{if(u!==d){const f=i.get(u);if(f&&f.schemas.length>1)return f.id||(f.id=`_${r.length}`,r.push(f.schemas[0])),{$ref:`#/${o}/${f.id}`}}return u})}const c=a(s),l=[];for(let d=0;d{for(const l of c)iP(l)&&r.push(l)},i=(...c)=>{for(const l of c)if(iP(l))for(const d in l){const h=l[d];iP(h)&&r.push(h)}},n=(...c)=>{for(const l of c)if(Array.isArray(l))for(const d of l)iP(d)&&r.push(d)},o=c=>{if(Array.isArray(c))for(const l of c)iP(l)&&r.push(l);else iP(c)&&r.push(c)},r=[s];let a=r.pop();for(;a;)e(a)&&(t(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),i(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),n(a.anyOf,a.allOf,a.oneOf,a.prefixItems),o(a.items)),a=r.pop()}const YA={JSONContribution:"base.contributions.json"};function cut(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class lut{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[cut(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){const t=this.schemasById[e];return t?rut(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}}const dut=new lut;Qe.add(YA.JSONContribution,dut);var sOe;(function(s){s.Multiline="multilineText",s.Singleline="singlelineText"})(sOe||(sOe={}));const Nn={Configuration:"base.contributions.configuration"};var at;(function(s){s[s.APPLICATION=1]="APPLICATION",s[s.MACHINE=2]="MACHINE",s[s.WINDOW=3]="WINDOW",s[s.RESOURCE=4]="RESOURCE",s[s.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",s[s.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(at||(at={}));const Dg={properties:{},patternProperties:{}},X4={properties:{},patternProperties:{}},eF={properties:{},patternProperties:{}},aS={properties:{},patternProperties:{}},cS={properties:{},patternProperties:{}},qv={properties:{},patternProperties:{}},bE="vscode://schemas/settings/resourceLanguage",bKe="vscode://schemas/settings/configurationDefaults",kG=Qe.as(YA.JSONContribution);class hut{constructor(){this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=new I,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new I,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:g(472,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},kG.registerSchema(bE,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),kG.registerSchema(bE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),kG.registerSchema(bE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){const i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),kG.registerSchema(bE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:o}of e)for(const r in n){t.add(r);const a=this.configurationDefaultsOverrides.get(r)??this.configurationDefaultsOverrides.set(r,{configurationDefaultOverrides:[]}).get(r),c=n[r];if(a.configurationDefaultOverrides.push({value:c,source:o}),tf.test(r)){const l=this.mergeDefaultConfigurationsForOverrideIdentifier(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(r,l,o),i.push(...M8(r))}else{const l=this.mergeDefaultConfigurationsForConfigurationProperty(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l;const d=this.configurationProperties[r];d&&(this.updatePropertyDefaultValue(r,d),this.updateSchema(r,d))}}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){const t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(const i of e){const n=this.registeredConfigurationDefaults.indexOf(i);n!==-1&&this.registeredConfigurationDefaults.splice(n,1)}for(const{overrides:i,source:n}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o);if(!r)continue;const a=r.configurationDefaultOverrides.findIndex(c=>n?c.source?.id===n.id:c.value===i[o]);if(a!==-1){if(r.configurationDefaultOverrides.splice(a,1),r.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(o),tf.test(o)){let c;for(const l of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l.value,l.source,c);c&&!CA(c.value)?(r.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,n)):(this.configurationDefaultsOverrides.delete(o),delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o])}else{let c;for(const d of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(o,d.value,d.source,c);r.configurationDefaultOverrideValue=c;const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}t.add(o)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,i){const n={type:"object",default:t.value,description:g(473,"Configure settings to be overridden for the {0} language.",out(e)),$ref:bE,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const o=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const c=t[a];if(kn(c)&&(Ya(o[a])||kn(o[a]))){if(o[a]={...o[a]??{},...c},i)for(const d in c)r.set(`${a}.${d}`,i)}else o[a]=c,i?r.set(a,i):r.delete(a)}return{value:o,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const o=this.configurationProperties[e],r=n?.value??o?.defaultDefaultValue;let a=i;if(kn(t)&&(o!==void 0&&o.type==="object"||o===void 0&&(Ya(r)||kn(r)))){if(a=n?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const l in t)i&&a.set(`${e}.${l}`,i);t={...kn(r)?r:{},...t}}return{value:t,source:a}}deltaConfiguration(e){let t=!1;const i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}doDeregisterConfigurations(e,t){const i=n=>{if(n.properties)for(const o in n.properties){t.add(o);const r=this.configurationProperties[o];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[o],this.removeFromSchema(o,n.properties[o])}n.allOf?.forEach(o=>i(o))};for(const n of e){i(n);const o=this.configurationContributors.indexOf(n);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,n,o=at.WINDOW,r){o=ra(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&SKe(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),tf.test(l)?d.scope=void 0:(d.scope=ra(d.scope)?o:d.scope,d.restricted=ra(d.restricted)?!!n?.includes(l):d.restricted),a[l].hasOwnProperty("included")&&!a[l].included){this.excludedConfigurationProperties[l]=a[l],delete a[l];continue}else this.configurationProperties[l]=a[l],a[l].policy?.name&&this.policyConfigurations.set(a[l].policy.name,l);!a[l].deprecationMessage&&a[l].markdownDeprecationMessage&&(a[l].deprecationMessage=a[l].markdownDeprecationMessage),r.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,n,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){const e=new Map;for(const[t,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&e.set(t,i.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Dg.properties[e]=t,t.scope){case at.APPLICATION:X4.properties[e]=t;break;case at.MACHINE:eF.properties[e]=t;break;case at.MACHINE_OVERRIDABLE:aS.properties[e]=t;break;case at.WINDOW:cS.properties[e]=t;break;case at.RESOURCE:qv.properties[e]=t;break;case at.LANGUAGE_OVERRIDABLE:qv.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Dg.properties[e],t.scope){case at.APPLICATION:delete X4.properties[e];break;case at.MACHINE:delete eF.properties[e];break;case at.MACHINE_OVERRIDABLE:delete aS.properties[e];break;case at.WINDOW:delete cS.properties[e];break;case at.RESOURCE:case at.LANGUAGE_OVERRIDABLE:delete qv.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:bE};this.updatePropertyDefaultValue(t,i),Dg.properties[t]=i,X4.properties[t]=i,eF.properties[t]=i,aS.properties[t]=i,cS.properties[t]=i,qv.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:bE};Dg.patternProperties[IE]=e,X4.patternProperties[IE]=e,eF.patternProperties[IE]=e,aS.patternProperties[IE]=e,cS.patternProperties[IE]=e,qv.patternProperties[IE]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,o;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,o=i.source),Ya(n)&&(n=t.defaultDefaultValue,o=void 0),Ya(n)&&(n=CKe(t.type)),t.default=n,t.defaultValueSource=o}}const wKe="\\[([^\\]]+)\\]",oOe=new RegExp(wKe,"g"),IE=`^(${wKe})+$`,tf=new RegExp(IE);function M8(s){const e=[];if(tf.test(s)){let t=oOe.exec(s);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=oOe.exec(s)}}return ja(e)}function yKe(s){return s.reduce((e,t)=>`${e}[${t}]`,"")}function CKe(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const t5=new hut;Qe.add(Nn.Configuration,t5);function SKe(s,e){return s.trim()?tf.test(s)?g(477,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):t5.getConfigurationProperties()[s]!==void 0?g(478,"Cannot register '{0}'. This property is already registered.",s):e.policy?.name&&t5.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(479,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",s,e.policy?.name,t5.getPolicyConfigurations().get(e.policy?.name)):null:g(476,"Cannot register an empty property")}function uut(){const s=[],e=t5.getConfigurationProperties();for(const t of Object.keys(e))s.push([t,e[t].scope]);return s.push(["launch",at.RESOURCE]),s.push(["task",at.RESOURCE]),s}function AKe(s){const e={};for(const t of s){const i=t.properties;if(kn(i))for(const n in i)e[n]=i[n];t.allOf&&Object.assign(e,AKe(t.allOf))}return e}function gut(s){switch(s){case"application":return at.APPLICATION;case"machine":return at.MACHINE;case"resource":return at.RESOURCE;case"machine-overridable":return at.MACHINE_OVERRIDABLE;case"language-overridable":return at.LANGUAGE_OVERRIDABLE;default:return at.WINDOW}}const fut={ModesRegistry:"editor.modesRegistry"};class put{constructor(){this._onDidChangeLanguages=new I,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const c=new Set;return{info:new _ut(this,a,c),closing:c}}),o=new xj(a=>{const c=new Set,l=new Set;return{info:new vut(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=n.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?rOe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=n.get(a),d=o.get(c);l.closing.add(d.info),d.openingColorized.add(l.info),d.opening.add(l.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,c])=>[a,c.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,c])=>[a,c.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return i6(t,e)}}function rOe(s){return s.filter(([e,t])=>e!==""&&t!=="")}class xKe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class _ut extends xKe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class vut extends xKe{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}class Fde{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Vs=ae("languageConfigurationService");let Ape=class extends V{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Cut),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Epe));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Fde(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Fde(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new Fde(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=but(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Ape=D([_(0,Te),_(1,xi)],Ape);function but(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new LO(s,{});n=new LO(s,{})}const o=wut(n.languageId,t),r=kKe([n.underlyingConfig,o]);return new LO(n.languageId,r)}const Epe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function wut(s,e){const t=e.getValue(Epe.brackets,{overrideIdentifier:s}),i=e.getValue(Epe.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:aOe(t),colorizedBracketPairs:aOe(i)}}function aOe(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function DKe(s,e,t){const i=s.getLineContent(e);let n=ho(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class yut{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new cOe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let n=0;ne.configuration)))}}function kKe(s){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of s)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class cOe{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class lOe{constructor(e){this.languageId=e}}class Cut extends V{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Ca,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new yut(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new lOe(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new lOe(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class LO{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new ZP(this.underlyingConfig):null,this.comments=LO._handleComments(this.underlyingConfig),this.characterPair=new bpe(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||j1e,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Zht(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new mut(e,this.underlyingConfig)}getWordDefinition(){return O7(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Kht(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Xht(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Sht(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}ce(Vs,Ape,qt.Delayed);class wE{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class dOe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new wE(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Un.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Un.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Vw{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=Vw._getElements(e),[a,c,l]=Vw._getElements(t);this._hasStrings=r&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Vw._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(nP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new wE(e,0,i,n-i+1)]):e<=t?(nP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new wE(e,t-e+1,i,0)]):(nP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),nP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,n,r,a,o),l=r[0],d=a[0];if(c!==null)return c;if(!o[0]){const h=this.ComputeDiffRecursive(e,l,i,d,o);let u=[];return o[0]?u=[new wE(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(h,u)}return[new wE(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){let y=null,C=null,A=new hOe,L=t,k=i,P=f[0]-v[0]-n,R=Un.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const G=P+e;G===L||G=0&&(l=this.m_forwardHistory[z],e=l[0],L=1,k=l.length-1)}while(--z>=-1);if(y=A.getReverseChanges(),w[0]){let G=f[0]+1,Y=v[0]+1;if(y!==null&&y.length>0){const j=y[y.length-1];G=Math.max(G,j.getOriginalEnd()),Y=Math.max(Y,j.getModifiedEnd())}C=[new wE(G,u-G+1,Y,m-Y+1)]}else{A=new hOe,L=r,k=a,P=f[0]-v[0]-c,R=Un.MAX_SAFE_SMALL_INTEGER,z=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const G=P+o;G===L||G=d[G+1]?(h=d[G+1]-1,p=h-P-c,h>R&&A.MarkNextChange(),R=h+1,A.AddOriginalElement(h+1,p+1),P=G+1-o):(h=d[G-1],p=h-P-c,h>R&&A.MarkNextChange(),R=h,A.AddModifiedElement(h+1,p+1),P=G-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],L=1,k=d.length-1)}while(--z>=-1);C=A.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,n,o,r,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(n-i),m=p+1,v=new Int32Array(m),b=new Int32Array(m),w=n-i,y=t-e,C=e-i,A=t-n,k=(y-w)%2===0;v[w]=e,b[y]=t,a[0]=!1;for(let P=1;P<=p/2+1;P++){let R=0,z=0;d=this.ClipDiagonalBound(w-P,P,w,m),h=this.ClipDiagonalBound(w+P,P,w,m);for(let Y=d;Y<=h;Y+=2){Y===d||YR+z&&(R=c,z=l),!k&&Math.abs(Y-y)<=P-1&&c>=b[Y])return o[0]=c,r[0]=l,j<=b[Y]&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}const G=(R-e+(z-i)-P)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(R,G))return a[0]=!0,o[0]=R,r[0]=z,G>0&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):(e++,i++,[new wE(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(y-P,P,y,m),f=this.ClipDiagonalBound(y+P,P,y,m);for(let Y=u;Y<=f;Y+=2){Y===u||Y=b[Y+1]?c=b[Y+1]-1:c=b[Y-1],l=c-(Y-y)-A;const j=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(b[Y]=c,k&&Math.abs(Y-w)<=P&&c<=v[Y])return o[0]=c,r[0]=l,j>=v[Y]&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}if(P<=EC.MaxDifferencesHistory){let Y=new Int32Array(h-d+2);Y[0]=w-d+1,sP.Copy2(v,d,Y,1,h-d+1),this.m_forwardHistory.push(Y),Y=new Int32Array(f-u+2),Y[0]=y-u+1,sP.Copy2(b,u,Y,1,f-u+1),this.m_reverseHistory.push(Y)}}return this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let c=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,f=i.modifiedStart-h;if(ul&&(l=m,c=h)}i.originalStart-=c,i.modifiedStart-=c;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>c&&(c=f,l=h,d=u)}return c>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return sP.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],sP.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return sP.Copy(e,0,n,0,e.length),sP.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(nP.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),nP.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new wE(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=XN(e),t=XN(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=XN(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e=o)t=n+1;else break;return new IKe(n,e-r)}}class Eut{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new IKe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=N7(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var i5;(function(s){s[s.False=0]="False",s[s.True=1]="True"})(i5||(i5={}));class jj{constructor(){this._actual=new yU(i5.False)}add(e){this._actual.set(e,i5.True)}has(e){return this._actual.get(e)===i5.True}clear(){return this._actual.clear()}}var Ri;(function(s){s[s.Invalid=0]="Invalid",s[s.Start=1]="Start",s[s.H=2]="H",s[s.HT=3]="HT",s[s.HTT=4]="HTT",s[s.HTTP=5]="HTTP",s[s.F=6]="F",s[s.FI=7]="FI",s[s.FIL=8]="FIL",s[s.BeforeColon=9]="BeforeColon",s[s.AfterColon=10]="AfterColon",s[s.AlmostThere=11]="AlmostThere",s[s.End=12]="End",s[s.Accept=13]="Accept",s[s.LastKnownState=14]="LastKnownState"})(Ri||(Ri={}));class xut{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const n=new xut(i,t,Ri.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Ri.Invalid:this._states.get(e,t)}}let Ode=null;function Dut(){return Ode===null&&(Ode=new LKe([[Ri.Start,B.h,Ri.H],[Ri.Start,B.H,Ri.H],[Ri.Start,B.f,Ri.F],[Ri.Start,B.F,Ri.F],[Ri.H,B.t,Ri.HT],[Ri.H,B.T,Ri.HT],[Ri.HT,B.t,Ri.HTT],[Ri.HT,B.T,Ri.HTT],[Ri.HTT,B.p,Ri.HTTP],[Ri.HTT,B.P,Ri.HTTP],[Ri.HTTP,B.s,Ri.BeforeColon],[Ri.HTTP,B.S,Ri.BeforeColon],[Ri.HTTP,B.Colon,Ri.AfterColon],[Ri.F,B.i,Ri.FI],[Ri.F,B.I,Ri.FI],[Ri.FI,B.l,Ri.FIL],[Ri.FI,B.L,Ri.FIL],[Ri.FIL,B.e,Ri.BeforeColon],[Ri.FIL,B.E,Ri.BeforeColon],[Ri.BeforeColon,B.Colon,Ri.AfterColon],[Ri.AfterColon,B.Slash,Ri.AlmostThere],[Ri.AlmostThere,B.Slash,Ri.End]])),Ode}var xa;(function(s){s[s.None=0]="None",s[s.ForceTermination=1]="ForceTermination",s[s.CannotEndIn=2]="CannotEndIn"})(xa||(xa={}));let r4=null;function kut(){if(r4===null){r4=new yU(xa.None);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),c=t.charCodeAt(r);(a===B.OpenParen&&c===B.CloseParen||a===B.OpenSquareBracket&&c===B.CloseSquareBracket||a===B.OpenCurlyBrace&&c===B.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=Dut()){const i=kut(),n=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),c=a.length;let l=0,d=0,h=0,u=Ri.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}};zne.INSTANCE=new zne;let xpe=zne;var zr;(function(s){s[s.Regular=0]="Regular",s[s.Whitespace=1]="Whitespace",s[s.WordSeparator=2]="WordSeparator"})(zr||(zr={}));class Tut extends yU{constructor(e,t){super(zr.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=K6e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Rut(t,this.wordSeparators?fm(this.wordSeparators,[]):null,i?this.searchString:null)}}function RKe(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e=t)break;const n=s.charCodeAt(e);if(n===B.n||n===B.r||n===B.W)return!0}}return!1}function O0(s,e,t){if(!t)return new F8(s,null);const i=[];for(let n=0,o=e.length;n>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class IG{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new tF(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,c=0;n?(c=n.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(n){const f=n.findLineFeedCountBeforeOffset(o+r.length)-c;l=a+r.length+f}else l=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(l);return new F(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,go.LF),c=e.getEOL()===`\r +`?new gOe(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=O0(this._getMultilineMatchRange(e,r,a,c,h.index,h[0]),h,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let l=t.startLineNumber+1;l=c))return o;return o}const d=new tF(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[o++]=O0(new F(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),o>=c))return o;while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new tF(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new oe(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new F(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),go.LF),l=e.getEOL()===`\r +`?new gOe(c):null;i.reset(t.column-1);const d=i.next(c);return d?O0(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,n);if(c)return c;for(let l=1;l<=o;l++){const d=(r+l-1)%o,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?O0(new F(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new tF(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new F(1,1,t.lineNumber,t.column),i,n,10*Nut);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new oe(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,n);if(c)return c;for(let l=1;l<=o;l++){const d=(o+r-l-1)%o,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=O0(new F(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function Put(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==zr.Regular)return!0}return!1}function Fut(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==zr.Regular)return!0}return!1}function vTe(s,e,t,i,n){return Put(s,e,t,i,n)&&Fut(s,e,t,i,n)}class tF{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){kj(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||vTe(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class bTe{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new fOe(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${Out(Array.from(a))}`,"g");const l=new tF(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=n,b=o;v<=b;v++){const w=e.getLineContent(v),y=w.length;l.reset(0);do if(u=l.next(w),u){let C=u.index,A=u.index+u[0].length;if(C>0){const R=w.charCodeAt(C-1);Pc(R)&&C--}if(A+1=1e3){h=!0;break e}d.push(new F(v,C+1,v,A+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new fOe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Lu.None:return null;case Lu.Invisible:return{kind:y_.Invisible};case Lu.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=g8.getLocales().filter(c=>!g8.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:y_.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Lu.NonBasicASCII:return{kind:y_.NonBasicAscii}}}}function Out(s,e){return`[${Rh(s.map(i=>String.fromCodePoint(i)).join(""))}]`}var y_;(function(s){s[s.Ambiguous=0]="Ambiguous",s[s.Invisible=1]="Invisible",s[s.NonBasicAscii=2]="NonBasicAscii"})(y_||(y_={}));class fOe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=g8.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of pT.codePoints)pOe(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return Lu.None;if(this.options.nonBasicASCII)return Lu.NonBasicASCII;let n=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=H7(r);n=n||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!pT.isInvisibleCharacter(a)&&(o=!0)}return!n&&o?Lu.None:this.options.invisibleCharacters&&!pOe(e)&&pT.isInvisibleCharacter(i)?Lu.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Lu.Ambiguous:Lu.None}}function pOe(s){return s===" "||s===` +`||s===" "}var Lu;(function(s){s[s.None=0]="None",s[s.NonBasicASCII=1]="NonBasicASCII",s[s.Invisible=2]="Invisible",s[s.Ambiguous=3]="Ambiguous"})(Lu||(Lu={}));class yq{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Hre{constructor(e,t){this.lineRangeMapping=e,this.changes=t}flip(){return new Hre(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}}class mi{static addRange(e,t){let i=0;for(;it))return new mi(e,t)}static ofLength(e){return new mi(0,e)}static ofStartAndLength(e,t){return new mi(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ni(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new mi(this.start+e,this.endExclusive+e)}deltaStart(e){return new mi(this.start+e,this.endExclusive)}deltaEnd(e){return new mi(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Ni(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ni(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){const t=[];for(let i=this.start;ie.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}let pi=class Af{static fromRange(e){return new Af(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new Af(e.startLineNumber,e.endLineNumber+1)}static subtract(e,t){return t?e.startLineNumbert)throw new Ni(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=b2(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=v2(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=v2(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,n=0,o=null;for(;i=r.startLineNumber?o=new pi(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new jp(t)}subtractFrom(e){const t=w2(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=b2(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new jp([e]);const n=[];let o=e.startLineNumber;for(let r=t;ro&&n.push(new pi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}const kp=class kp{static lengthDiffNonNegative(e,t){return t.isLessThan(e)?kp.zero:e.lineCount===t.lineCount?new kp(0,t.columnCount-e.columnCount):new kp(t.lineCount-e.lineCount,t.columnCount)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new kp(0,t.column-e.column):new kp(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return kp.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` +`?(t++,i=0):i++;return new kp(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new kp(this.lineCount,this.columnCount+e.columnCount):new kp(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new F(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new F(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new F(1,1,this.lineCount+1,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new oe(e.lineNumber,e.column+this.columnCount):new oe(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};kp.zero=new kp(0,0);let eg=kp;class But{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;to<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,n)}getRange(e){return F.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return eg.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new eg(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let B2=class Cq{static single(e,t){return new Cq([new au(e,t)])}constructor(e){this.edits=e,G_(()=>bU(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}normalize(){const e=[];for(const t of this.edits)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(t.range.getStartPosition())){const i=e[e.length-1];e[e.length-1]=new au(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new Cq(e)}mapPosition(e){let t=0,i=0,n=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=eg.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=c.addToPosition(l);return TG(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?n+=c.columnCount-(a.column-1):n+=c.columnCount-(a.column-r.column):n=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return TG(n,o)}inverseMapPosition(e,t){return this.inverse(t).mapPosition(e)}inverseMapRange(e,t){return this.inverse(t).mapRange(e)}apply(e){let t="",i=new oe(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),c=r.getEndPosition(),l=TG(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const n=TG(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new Wut(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new Cq(this.edits.map((i,n)=>new au(t[n],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=eg.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,n=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class au{constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}function TG(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return F.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Ni("start must be before end");return new F(s.lineNumber,s.column,e.lineNumber,e.column)}class MKe{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class Wut extends MKe{constructor(e){super(),this.value=e,this._t=new But(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let L_=class TP{static inverse(e,t,i){const n=[];let o=1,r=1;for(const c of e){const l=new TP(new pi(o,c.original.startLineNumber),new pi(r,c.modified.startLineNumber));l.modified.isEmpty||n.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new TP(new pi(o,t+1),new pi(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new TP(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new TP(this.modified,this.original)}join(e){return new TP(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new Gp(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ni("not a valid diff");return new Gp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Gp(new F(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new F(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(mOe(this.original.endLineNumberExclusive,e)&&mOe(this.modified.endLineNumberExclusive,t))return new Gp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Gp(F.fromPositions(new oe(this.original.startLineNumber,1),oP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(new oe(this.modified.startLineNumber,1),oP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Gp(F.fromPositions(oP(new oe(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),oP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(oP(new oe(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),oP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ni}};function oP(s,e){if(s.lineNumber<1)return new oe(1,1);if(s.lineNumber>e.length)return new oe(e.length,e[e.length-1].length+1);const t=e[s.lineNumber-1];return s.column>t.length+1?new oe(s.lineNumber,t.length+1):s}function mOe(s,e){return s>=1&&s<=e.length}let q_=class Sq extends L_{static fromRangeMappings(e){const t=pi.join(e.map(n=>pi.fromRangeInclusive(n.originalRange))),i=pi.join(e.map(n=>pi.fromRangeInclusive(n.modifiedRange)));return new Sq(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new Sq(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Sq(this.original,this.modified,[this.toRangeMapping()])}},Gp=class NKe{static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new NKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new au(this.originalRange,t)}};const Hut=3;class Uut{computeDiff(e,t,i){const o=new FKe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const c of o.changes){let l;c.originalEndLineNumber===0?l=new pi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new pi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new pi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new pi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new q_(l,d,c.charChanges?.map(u=>new Gp(new F(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new F(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new q_(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return G_(()=>bU(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===B.LineFeed?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===B.LineFeed?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===B.LineFeed?1:this._columns[e]+1)}}class RO{constructor(e,t,i,n,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),c=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new RO(n,o,r,a,c,l,d,h)}}function zut(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),p=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=PKe(f,p,o,!0).changes;a&&(m=zut(m)),u=[];for(let v=0,b=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),b=f.charCodeAt(m-2);if(v!==b)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,p,r+1,1,m)}{let p=kpe(u,1),m=kpe(f,1);const v=u.length+1,b=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(Rc.fromOffsetPairs(n?n.getEndExclusives():SS.zero,o?o.getStarts():new SS(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Rc(new mi(e.offset1,t.offset1),new mi(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ni("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Rc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Rc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Rc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Rc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Rc(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new Rc(t,i)}getStarts(){return new SS(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new SS(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const f1=class f1{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new f1(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};f1.zero=new f1(0,0),f1.max=new f1(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let SS=f1;const $ne=class $ne{isValid(){return!0}};$ne.instance=new $ne;let O8=$ne;class $ut{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ni("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Wde{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function Ipe(s){return s===B.Space||s===B.Tab}const Pz=class Pz{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(w+=a.get(p-1,m-1)),w+=n?n(p,m):1):w=-1;const y=Math.max(v,b,w);if(y===w){const C=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,C+1),r.set(p,m,3)}else y===v?(a.set(p,m,0),r.set(p,m,1)):y===b&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,y)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new Rc(new mi(p+1,l),new mi(m+1,d))),l=p,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),c.reverse(),new XS(c,!1)}}class OKe{compute(e,t,i=O8.instance){if(e.length===0||t.length===0)return XS.trivial(e,t);const n=e,o=t;function r(m,v){for(;mn.length||C>o.length)continue;const A=r(y,C);c.set(d,A);const L=y===b?l.get(d+1):l.get(d-1);if(l.set(d,A!==y?new bOe(L,y,C,A-y):L),c.get(d)===n.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=n.length,p=o.length;for(;;){const m=h?h.x+h.length:0,v=h?h.y+h.length:0;if((m!==f||v!==p)&&u.push(new Rc(new mi(m,f),new mi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new XS(u,!1)}}class bOe{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class Kut{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class qut{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class Xj{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let o=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,o=o.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const l=o.trimStart();a=o.length-l.length,o=l.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const c=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,o.length):o.length;for(let l=0;lString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=yOe(e>0?this.elements[e-1]:-1),i=yOe(eo<=e),n=e-this.firstElementOffsetByLineIdx[i];return new oe(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(n===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?F.fromPositions(i,i):F.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!Hde(this.elements[e]))return;let t=e;for(;t>0&&Hde(this.elements[t-1]);)t--;let i=e;for(;in<=e.start)??0,i=irt(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new mi(t,i)}}function Hde(s){return s>=B.a&&s<=B.z||s>=B.A&&s<=B.Z||s>=B.Digit0&&s<=B.Digit9}var ac;(function(s){s[s.WordLower=0]="WordLower",s[s.WordUpper=1]="WordUpper",s[s.WordNumber=2]="WordNumber",s[s.End=3]="End",s[s.Other=4]="Other",s[s.Separator=5]="Separator",s[s.Space=6]="Space",s[s.LineBreakCR=7]="LineBreakCR",s[s.LineBreakLF=8]="LineBreakLF"})(ac||(ac={}));const Qut={[ac.WordLower]:0,[ac.WordUpper]:0,[ac.WordNumber]:0,[ac.End]:10,[ac.Other]:2,[ac.Separator]:30,[ac.Space]:3,[ac.LineBreakCR]:10,[ac.LineBreakLF]:10};function wOe(s){return Qut[s]}function yOe(s){return s===B.LineFeed?ac.LineBreakLF:s===B.CarriageReturn?ac.LineBreakCR:Ipe(s)?ac.Space:s>=B.a&&s<=B.z?ac.WordLower:s>=B.A&&s<=B.Z?ac.WordUpper:s>=B.Digit0&&s<=B.Digit9?ac.WordNumber:s===-1?ac.End:s===B.Comma||s===B.Semicolon?ac.Separator:ac.Other}function jut(s,e,t,i,n,o){let{moves:r,excludedChanges:a}=Jut(s,e,t,o);if(!o.isValid())return[];const c=s.filter(d=>!a.has(d)),l=Xut(c,i,n,e,t,o);return $ge(r,l),r=Zut(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` +`).length>=15&&Yut(h,f=>f.length>=2)>=2}),r=egt(s,r),r}function Yut(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function Jut(s,e,t,i){const n=[],o=s.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new Jj(c.original,e,c)),r=new Set(s.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new Jj(c.modified,t,c))),a=new Set;for(const c of o){let l=-1,d;for(const h of r){const u=c.computeSimilarity(h);u>l&&(l=u,d=h)}if(l>.9&&d&&(r.delete(d),n.push(new L_(c.range,d.range)),a.add(c.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function Xut(s,e,t,i,n,o){const r=[],a=new P7;for(const u of s)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,nu));for(const u of s){let f=[];for(let p=u.modified.startLineNumber;p{for(const C of f)if(C.originalLineRange.endLineNumberExclusive+1===w.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){C.originalLineRange=new pi(C.originalLineRange.startLineNumber,w.endLineNumberExclusive),C.modifiedLineRange=new pi(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),b.push(C);return}const y={modifiedLineRange:v,originalLineRange:w};c.push(y),b.push(y)}),f=b}if(!o.isValid())return[]}c.sort(S6e(Cc(u=>u.modifiedLineRange.length,nu)));const l=new jp,d=new jp;for(const u of c){const f=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,p=l.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(f),v=p.getIntersection(m);for(const b of v.ranges){if(b.length<3)continue;const w=b,y=b.delta(-f);r.push(new L_(y,w)),l.addRange(w),d.addRange(y)}}r.sort(Cc(u=>u.original.startLineNumber,nu));const h=new vj(s);for(let u=0;uL.original.startLineNumber<=f.original.startLineNumber),m=v2(s,L=>L.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-p.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||k>n.length||l.contains(k)||d.contains(L)||!COe(i[L-1],n[k-1],o))break}C>0&&(d.addRange(new pi(f.original.startLineNumber-C,f.original.startLineNumber)),l.addRange(new pi(f.modified.startLineNumber-C,f.modified.startLineNumber)));let A;for(A=0;Ai.length||k>n.length||l.contains(k)||d.contains(L)||!COe(i[L-1],n[k-1],o))break}A>0&&(d.addRange(new pi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+A)),l.addRange(new pi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+A))),(C>0||A>0)&&(r[u]=new L_(new pi(f.original.startLineNumber-C,f.original.endLineNumberExclusive+A),new pi(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+A)))}return r}function COe(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new OKe().compute(new Xj([s],new F(1,1,1,s.length),!1),new Xj([e],new F(1,1,1,e.length),!1),t);let o=0;const r=Rc.invert(n.diffs,s.length);for(const d of r)d.seq1Range.forEach(h=>{Ipe(s.charCodeAt(h))||o++});function a(d){let h=0;for(let u=0;ue.length?s:e);return o/c>.6&&c>10}function Zut(s){if(s.length===0)return s;s.sort(Cc(t=>t.original.startLineNumber,nu));const e=[s[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function egt(s,e){const t=new vj(s);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(l))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function tgt(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&s.seq2Range.start-r>=n.start&&t.isStronglyEqual(s.seq2Range.start-r,s.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;s.seq1Range.start+al&&(l=p,c=d)}return s.delta(c)}function igt(s,e,t){const i=[];for(const n of t){const o=i[i.length-1];if(!o){i.push(n);continue}n.seq1Range.start-o.seq1Range.endExclusive<=2||n.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new Rc(o.seq1Range.join(n.seq1Range),o.seq2Range.join(n.seq2Range)):i.push(n)}return i}function ngt(s,e,t){const i=Rc.invert(t,s.length),n=[];let o=new SS(0,0);function r(c,l){if(c.offset10;){const v=i[0];if(!(v.seq1Range.intersects(u.seq1Range)||v.seq2Range.intersects(u.seq2Range)))break;const w=s.findWordContaining(v.seq1Range.start),y=e.findWordContaining(v.seq2Range.start),C=new Rc(w,y),A=C.intersect(v);if(p+=A.seq1Range.length,m+=A.seq2Range.length,u=u.join(C),u.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}p+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&n.push(u),o=u.getEndExclusives()}for(;i.length>0;){const c=i.shift();c.seq1Range.isEmpty||(r(c.getStarts(),c),r(c.getEndExclusives().delta(-1),c))}return sgt(t,n)}function sgt(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let o;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function ogt(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const c=i[a],l=r[r.length-1];d(l,c)?(o=!0,r[r.length-1]=r[r.length-1].join(c)):r.push(c)}i=r}while(n++<10&&o);return i}function rgt(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const a=[i[0]];for(let c=1;c5||m.length>500)return!1;const b=s.getText(m).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const w=s.countLinesIn(f.seq1Range),y=f.seq1Range.length,C=e.countLinesIn(f.seq2Range),A=f.seq2Range.length,L=s.countLinesIn(p.seq1Range),k=p.seq1Range.length,P=e.countLinesIn(p.seq2Range),R=p.seq2Range.length,z=2*40+50;function G(Y){return Math.min(Y,z)}return Math.pow(Math.pow(G(w*40+y),1.5)+Math.pow(G(C*40+A),1.5),1.5)+Math.pow(Math.pow(G(L*40+k),1.5)+Math.pow(G(P*40+R),1.5),1.5)>(z**1.5)**1.5*1.3};const l=i[c],d=a[a.length-1];h(d,l)?(o=!0,a[a.length-1]=a[a.length-1].join(l)):a.push(l)}i=a}while(n++<10&&o);const r=[];return drt(i,(a,c,l)=>{let d=c;function h(b){return b.length>0&&b.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const u=s.extendToFullLines(c.seq1Range),f=s.getText(new mi(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=s.getText(new mi(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=Rc.fromOffsetPairs(a?a.getEndExclusives():SS.zero,l?l.getStarts():SS.max),v=d.intersect(m);r.length>0&&v.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(v):r.push(v)}),r}class EOe{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:xOe(this.lines[e-1]),i=e===this.lines.length?0:xOe(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function xOe(s){let e=0;for(;eA===L))return new yq([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new yq([new q_(new pi(1,e.length+1),new pi(1,t.length+1),[new Gp(new F(1,1,e.length,e[e.length-1].length+1),new F(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?O8.instance:new $ut(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(A){let L=r.get(A);return L===void 0&&(L=r.size,r.set(A,L)),L}const c=e.map(A=>a(A.trim())),l=t.map(A=>a(A.trim())),d=new EOe(c,e),h=new EOe(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(A,L)=>e[A]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let f=u.diffs,p=u.hitTimeout;f=Tpe(d,h,f),f=ogt(d,h,f);const m=[],v=A=>{if(o)for(let L=0;LA.seq1Range.start-b===A.seq2Range.start-w);const L=A.seq1Range.start-b;v(L),b=A.seq1Range.endExclusive,w=A.seq2Range.endExclusive;const k=this.refineDiff(e,t,A,n,o);k.hitTimeout&&(p=!0);for(const P of k.mappings)m.push(P)}v(e.length-b);const y=DOe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,c,l,n,o)),G_(()=>{function A(k,P){if(k.lineNumber<1||k.lineNumber>P.length)return!1;const R=P[k.lineNumber-1];return!(k.column<1||k.column>R.length+1)}function L(k,P){return!(k.startLineNumber<1||k.startLineNumber>P.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>P.length+1)}for(const k of y){if(!k.innerChanges)return!1;for(const P of k.innerChanges)if(!(A(P.modifiedRange.getStartPosition(),t)&&A(P.modifiedRange.getEndPosition(),t)&&A(P.originalRange.getStartPosition(),e)&&A(P.originalRange.getEndPosition(),e)))return!1;if(!L(k.modified,t)||!L(k.original,e))return!1}return!0}),new yq(y,C,p)}computeMoves(e,t,i,n,o,r,a){return jut(e,t,i,n,o,r).map(d=>{const h=this.refineDiff(t,i,new Rc(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=DOe(h.mappings,t,i,!0);return new Hre(d,u)})}refineDiff(e,t,i,n,o){const a=cgt(i).toRangeMapping2(e,t),c=new Xj(e,a.originalRange,o),l=new Xj(t,a.modifiedRange,o),d=c.length+l.length<500?this.dynamicProgrammingDiffing.compute(c,l,n):this.myersDiffingAlgorithm.compute(c,l,n);let h=d.diffs;return h=Tpe(c,l,h),h=ngt(c,l,h),h=igt(c,l,h),h=rgt(c,l,h),{mappings:h.map(f=>new Gp(c.translateRange(f.seq1Range),l.translateRange(f.seq2Range))),hitTimeout:d.hitTimeout}}}function DOe(s,e,t,i=!1){const n=[];for(const o of P1e(s.map(r=>agt(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new q_(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return G_(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:bU(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1);const o=new pi(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),r=new pi(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new q_(o,r,[s])}function cgt(s){return new L_(new pi(s.seq1Range.start+1,s.seq1Range.endExclusive+1),new pi(s.seq2Range.start+1,s.seq2Range.endExclusive+1))}const Ude={getLegacy:()=>new Uut,getDefault:()=>new BKe};function tD(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class dn{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=tD(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class h_{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=tD(Math.max(Math.min(1,t),0),3),this.l=tD(Math.max(Math.min(1,i),0),3),this.a=tD(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let c=0,l=0;const d=(a+r)/2,h=r-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),r){case t:c=(i-n)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let r,a,c;if(i===0)r=a=c=n;else{const l=n<.5?n*(1+i):n+i-n*i,d=2*n-l;r=h_._hue2rgb(d,l,t+1/3),a=h_._hue2rgb(d,l,t),c=h_._hue2rgb(d,l,t-1/3)}return new dn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class fy{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=tD(Math.max(Math.min(1,t),0),3),this.v=tD(Math.max(Math.min(1,i),0),3),this.a=tD(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-n)/a%6+6)%6:o===i?l=(n-t)/a+2:l=(t-i)/a+4,new fy(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),c=n-r;let[l,d,h]=[0,0,0];return t<60?(l=r,d=a):t<120?(l=a,d=r):t<180?(d=r,h=a):t<240?(d=a,h=r):t<300?(l=a,h=r):t<=360&&(l=r,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new dn(l,d,h,o)}}var _o;let me=(_o=class{static fromHex(e){return _o.Format.CSS.parseHex(e)||_o.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:h_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:fy.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof dn)this.rgba=e;else if(e instanceof h_)this._hsla=e,this.rgba=h_.toRGBA(e);else if(e instanceof fy)this._hsva=e,this.rgba=fy.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&dn.equals(this.rgba,e.rgba)&&h_.equals(this.hsla,e.hsla)&&fy.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=_o._relativeLuminanceForComponent(this.rgba.r),t=_o._relativeLuminanceForComponent(this.rgba.g),i=_o._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return tD(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}getContrastRatio(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t_o._flatten(n,i));return _o._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new _o(new dn(i*t.rgba.r+e.rgba.a*e.rgba.r,i*t.rgba.g+e.rgba.a*e.rgba.g,i*t.rgba.b+e.rgba.a*e.rgba.b))}toString(){return this._toString||(this._toString=_o.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(n-o)/n,e.darken(i)}},_o.white=new _o(new dn(255,255,255,1)),_o.black=new _o(new dn(0,0,0,1)),_o.red=new _o(new dn(255,0,0,1)),_o.blue=new _o(new dn(0,0,255,1)),_o.green=new _o(new dn(0,255,0,1)),_o.cyan=new _o(new dn(0,255,255,1)),_o.lightgrey=new _o(new dn(211,211,211,1)),_o.transparent=new _o(new dn(0,0,0,0)),_o);(function(s){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:s.Format.CSS.formatRGBA(f)}t.formatRGB=i;function n(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=n;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:s.Format.CSS.formatHSLA(f)}t.formatHSL=o;function r(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(f){const p=f.toString(16);return p.length!==2?"0"+p:p}function c(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=c;function l(f,p=!1){return p&&f.rgba.a===1?s.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=l;function d(f){return f.isOpaque()?s.Format.CSS.formatHex(f):s.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==B.Hash)return null;if(p===7){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new s(new dn(m,v,b,1))}if(p===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),w=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new s(new dn(m,v,b,w/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3));return new s(new dn(16*m+m,16*v+v,16*b+b))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3)),w=u(f.charCodeAt(4));return new s(new dn(16*m+m,16*v+v,16*b+b,(16*w+w)/255))}return null}t.parseHex=h;function u(f){switch(f){case B.Digit0:return 0;case B.Digit1:return 1;case B.Digit2:return 2;case B.Digit3:return 3;case B.Digit4:return 4;case B.Digit5:return 5;case B.Digit6:return 6;case B.Digit7:return 7;case B.Digit8:return 8;case B.Digit9:return 9;case B.a:return 10;case B.A:return 10;case B.b:return 11;case B.B:return 11;case B.c:return 12;case B.C:return 12;case B.d:return 13;case B.D:return 13;case B.e:return 14;case B.E:return 14;case B.f:return 15;case B.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(s.Format||(s.Format={}))})(me||(me={}));function WKe(s){const e=[];for(const t of s){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function yTe(s,e,t,i){return{red:s/255,blue:t/255,green:e/255,alpha:i}}function a4(s,e){const t=e.index,i=e[0].length;if(!t)return;const n=s.positionAt(t);return{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:n.lineNumber,endColumn:n.column+i}}function lgt(s,e){if(!s)return;const t=me.Format.CSS.parseHex(e);if(t)return{range:s,color:yTe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function kOe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=WKe(n);return{range:s,color:yTe(o[0],o[1],o[2],t?o[3]:1)}}function IOe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=WKe(n),r=new me(new h_(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:s,color:yTe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function c4(s,e){return typeof s=="string"?[...s.matchAll(e)]:s.findMatches(e)}function dgt(s){const e=[],i=c4(s,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const o=n.filter(l=>l!==void 0),r=o[1],a=o[2];if(!a)continue;let c;if(r==="rgb"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;c=kOe(a4(s,n),c4(a,l),!1)}else if(r==="rgba"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=kOe(a4(s,n),c4(a,l),!0)}else if(r==="hsl"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;c=IOe(a4(s,n),c4(a,l),!1)}else if(r==="hsla"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=IOe(a4(s,n),c4(a,l),!0)}else r==="#"&&(c=lgt(a4(s,n),r+a));c&&e.push(c)}return e}function hgt(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:dgt(s)}const TOe=new RegExp("\\bMARK:\\s*(.*)$","d"),ugt=/^-+|-+$/g;function ggt(s,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=fgt(s,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=pgt(s);t=t.concat(i)}return t}function fgt(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const o=s.getLineContent(n),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:o.length+1};if(a.endColumn>a.startColumn){const c={range:a,...HKe(o.substring(r[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function pgt(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);mgt(n,i,e)}return e}function mgt(s,e,t){TOe.lastIndex=0;const i=TOe.exec(s);if(i){const n=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...HKe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function HKe(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(ugt,""),{text:s,hasSeparatorLine:e}}class _gt extends TKe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}const VE=class VE{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new _gt(N.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?bTe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?ggt(i,t):[]}async computeDiff(e,t,i,n){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:VE.computeDiff(o,r,i,n)}static computeDiff(e,t,i,n){const o=n==="advanced"?Ude.getDefault():Ude.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),c=o.computeDiff(r,a,i),l=c.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])])}return{identical:l,quitEarly:c.hitTimeout,changes:d(c.changes),moves:c.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const n=this._getModel(e),o=this._getModel(t);if(!n||!o)return null;const r=n.getLinesContent(),a=o.getLinesContent();return new FKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return F.compareRangesUsingStarts(c.range,l.range);const d=c.range?0:1,h=l.range?0:1;return d-h});let a=0;for(let c=1;cVE._diffLimit){o.push({range:c,text:l});continue}const u=Sut(h,l,i),f=n.offsetAt(F.lift(c).getStartPosition());for(const p of u){const m=n.positionAt(f+p.originalStart),v=n.positionAt(f+p.originalStart+p.originalLength),b={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};n.getValueInRange(b.range)!==b.text&&o.push(b)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return F.compareRangesUsingStarts(a.range,c.range);const l=a.range?0:1,d=c.range?0:1;return l-d});for(let{range:a,text:c,eol:l}of t){let m=function(b,w){return new oe(b.lineNumber+w.lineNumber-1,w.lineNumber===1?b.column+w.column-1:w.column)},v=function(b,w){const y=[];for(let C=w.startLineNumber;C<=w.endLineNumber;C++){const A=b[C-1];C===w.startLineNumber&&C===w.endLineNumber?y.push(A.substring(w.startColumn-1,w.endColumn-1)):C===w.startLineNumber?y.push(A.substring(w.startColumn-1)):C===w.endLineNumber?y.push(A.substring(0,w.endColumn-1)):y.push(A)}return y};if(typeof l=="number"&&(r=l),F.isEmpty(a)&&!c)continue;const d=n.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,n.eol),d===c)continue;if(Math.max(c.length,d.length)>VE._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Ude.getDefault().computeDiff(h,u,i),p=F.lift(a).getStartPosition();for(const b of f.changes)if(b.innerChanges)for(const w of b.innerChanges)o.push({range:F.fromPositions(m(p,w.originalRange.getStartPosition()),m(p,w.originalRange.getEndPosition())),text:v(u,w.modifiedRange).join(n.eol)});else throw new Ni("The experimental diff algorithm always produces inner changes")}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?Iut(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?hgt(t):null}async textualSuggest(e,t,i,n){const o=new js,r=new RegExp(i,n),a=new Set;e:for(const c of e){const l=this._getModel(c);if(l){for(const d of l.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>VE._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let c=t.startLineNumber;cthis._host.fhr(a,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(W1e(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}};VE._diffLimit=1e5,VE._suggestionsLimit=1e4;let Zj=VE;typeof importScripts=="function"&&(globalThis.monaco=_Ge());const Ec=ae("textResourceConfigurationService"),CTe=ae("textResourcePropertiesService"),it=ae("ILanguageFeaturesService"),LOe=60*1e3,ROe=5*60*1e3;function cw(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Lpe=class extends V{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new bgt(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>cw(this._modelService,r.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(r.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new vgt(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return cw(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,n));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Hre(new L_(new pi(c[0],c[1]),new pi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new q_(new pi(l[0],l[1]),new pi(l[2],l[3]),l[4]?.map(d=>new Gp(new F(d[0],d[1],d[2],d[3]),new F(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return cw(this._modelService,e)&&cw(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(n=>n.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(eo(t)){if(!cw(this._modelService,e))return Promise.resolve(t);const n=js.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,Sr(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(eo(t)){if(!cw(this._modelService,e))return Promise.resolve(t);const i=js.create(),n=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(vt(o),this.computeMoreMinimalEdits(e,t,!0)));return n.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),n}else return Promise.resolve(void 0)}canNavigateValueSet(e){return cw(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return cw(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};Lpe=D([_(0,gi),_(1,Ec),_(2,Ge),_(3,Vs),_(4,it)],Lpe);class vgt{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const n=[];if(i.wordBasedSuggestions==="currentDocument")cw(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())cw(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&n.push(h.uri));if(n.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new F(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):F.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,r?.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Me.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class bgt extends V{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new X7).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(ROe/2),si),this._register(this._modelService.onModelRemoved(n=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>ROe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new STe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class wgt extends V{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new J7;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(LOe/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)bt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>LOe&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Z;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],bt(t)}}class MOe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Vde{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class STe extends V{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new vpe(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new vht(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Vde(this)))}catch(e){_pe(e),this._worker=new MOe(new Zj(new Vde(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(_pe(e),this._worker=new MOe(new Zj(new Vde(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new wgt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(xy()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(n=>n.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeHumanReadableDiff(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const n=await this._withSyncedResources(e),o=i.source,r=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,c=r.flags;return n.navigateValueSet(e.toString(),t,i,a,c)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function ygt(s,e,t){return new Cgt(s,e,t)}class Cgt extends STe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?W1e(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,c)=>e.fmr(a,c),o=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},r={};for(const a of i)r[a]=o(a,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var mt;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(mt||(mt={}));function Sgt(s){return s&&typeof s.id=="string"}const CU={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var oc;(function(s){s.CompositionStart="compositionStart",s.CompositionEnd="compositionEnd",s.Type="type",s.ReplacePreviousChar="replacePreviousChar",s.CompositionType="compositionType",s.Paste="paste",s.Cut="cut"})(oc||(oc={}));const B8=new class{clone(){return this}equals(s){return this===s}};function UKe(s,e){return new iTe([new _8(0,"",s)],e)}function ATe(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<>>0,new Lre(t,e===null?B8:e)}const HC=class HC{static createEmpty(e,t){const i=HC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new HC(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,n+=r;return new HC(new Uint32Array(o),n,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof HC?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let r=n;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Kv.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Kv.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Kv.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Kv.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Kv.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Kv.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return HC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new ETe(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(n.length,l),r=c.offset}n+=c.text,o.push(n.length,c.tokenMetadata),i++}else break}return new HC(new Uint32Array(o),n,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;let gd=HC;class ETe{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof ETe?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(n-this._endOffset))),o}forEach(e){for(let t=0;tt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&is(e.data,t.data)}static equalsArr(e,t){return is(e,t,W8.equals)}}class eu{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o=o||(a[c++]=new eu(Math.max(1,l.startColumn-n+1),Math.min(r+1,l.endColumn-n+1),l.className,l.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Ja.Regular||l.type===Ja.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;o[r++]=new eu(h,u,l.inlineClassName,l.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=eu._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class Dgt{static normalize(e,t){if(t.length===0)return[];const i=[],n=new eY;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);Pc(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);Pc(m)&&d--}const f=l-1,p=d-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(p,h,u)}return n.consumeLowerThan(Un.MAX_SAFE_SMALL_INTEGER,o,i),i}}var Xf;(function(s){s[s.None=0]="None",s[s.Boundary=1]="Boundary",s[s.Selection=2]="Selection",s[s.Trailing=3]="Trailing",s[s.All=4]="All"})(Xf||(Xf={}));let zKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class yI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(eu.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?Xf.All:v==="boundary"?Xf.Boundary:v==="selection"?Xf.Selection:v==="trailing"?Xf.Trailing:Xf.None,this.renderControlCharacters=b,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((L,k)=>L.startOffset>>lw.PART_INDEX_OFFSET}static getCharIndex(e){return(e&lw.CHAR_INDEX_MASK)>>>lw.CHAR_INDEX_OFFSET}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=n_.getPartIndex(t),n=n_.getCharIndex(t);return new $Ke(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===n)return m;v>n?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===n)return o;if(c===n)return r;const l=n_.getPartIndex(a),d=n_.getCharIndex(a),h=n_.getPartIndex(c);let u;l!==h?u=t:u=n_.getCharIndex(c);const f=i-d,p=u-i;return f<=p?o:r}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,n=qu.None;for(const r of s.lineDecorations)(r.type===Ja.Before||r.type===Ja.After)&&(e.appendString(''),r.type===Ja.Before&&(n|=qu.Before,t++),r.type===Ja.After&&(n|=qu.After,i++));e.appendString("");const o=new n_(1,t+i);return o.setColumnInfo(1,t,0,0),new Rpe(o,!1,n)}return e.appendString(""),new Rpe(new n_(0,0),!1,qu.None)}return Fgt(Tgt(s),e)}class kgt{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Ure(s){const e=new wU(1e4),t=n6(s,e);return new kgt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Igt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=c,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=u,this.spaceWidth=f,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=v}}function Tgt(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,c=s.lineDecorations.length;a0&&(o[r++]=new al(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=n){const f=e?E2(s.substring(a,n)):!1;o[r++]=new al(n,h,0,f);break}const u=e?E2(s.substring(a,d)):!1;o[r++]=new al(d,h,0,u),a=d}return o}var B0;(function(s){s[s.LongToken=50]="LongToken"})(B0||(B0={}));function Rgt(s,e,t){let i=0;const n=[];let o=0;if(t)for(let r=0,a=e.length;r=B0.LongToken&&(n[o++]=new al(f+1,d,h,u),p=f+1,f=-1);p!==l&&(n[o++]=new al(l,d,h,u))}else n[o++]=c;i=l}else for(let r=0,a=e.length;rB0.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/B0.LongToken);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function Mgt(s,e){const t=[];let i=new al(0,"",0,!1),n=0;for(const o of e){const r=o.endIndex;for(;ni.endIndex&&(i=new al(n,o.type,o.metadata,o.containsRTL),t.push(i)),i=new al(n+1,"mtkcontrol",o.metadata,!1),t.push(i))}n>i.endIndex&&(i=new al(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Ngt(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,c=s.useMonospaceOptimizations,l=s.selectionsOnLine,d=s.renderWhitespace===Xf.Boundary,h=s.renderWhitespace===Xf.Trailing,u=s.renderSpaceWidth!==s.spaceWidth,f=[];let p=0,m=0,v=i[m].type,b=i[m].containsRTL,w=i[m].endIndex;const y=i.length;let C=!1,A=kh(e),L;A===-1?(C=!0,A=t,L=t):L=T_(e);let k=!1,P=0,R=l&&l[P],z=a%r;for(let Y=o;Y=R.endOffset&&(P++,R=l&&l[P]);let ne;if(YL)ne=!0;else if(j===B.Tab)ne=!0;else if(j===B.Space)if(d)if(k)ne=!0;else{const ge=Y+1Y),ne&&h&&(ne=C||Y>L),ne&&b&&Y>=A&&Y<=L&&(ne=!1),k){if(!ne||!c&&z>=r){if(u){const ge=p>0?f[p-1].endIndex:o;for(let De=ge+1;De<=Y;De++)f[p++]=new al(De,"mtkw",py.IS_WHITESPACE,!1)}else f[p++]=new al(Y,"mtkw",py.IS_WHITESPACE,!1);z=z%r}}else(Y===w||ne&&Y>o)&&(f[p++]=new al(Y,v,0,b),z=z%r);for(j===B.Tab?z=r:Tk(j)?z+=2:z++,k=ne;Y===w&&(m++,m0?e.charCodeAt(t-1):B.Null,j=t>1?e.charCodeAt(t-2):B.Null;Y===B.Space&&j!==B.Space&&j!==B.Tab||(G=!0)}else G=!0;if(G)if(u){const Y=p>0?f[p-1].endIndex:o;for(let j=Y+1;j<=t;j++)f[p++]=new al(j,"mtkw",py.IS_WHITESPACE,!1)}else f[p++]=new al(t,"mtkw",py.IS_WHITESPACE,!1);else f[p++]=new al(t,v,0,b);return f}function Pgt(s,e,t,i){i.sort(eu.compare);const n=Dgt.normalize(s,i),o=n.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=w.startOffset,a[c++]=new al(l,m,v,b)),w.endOffset+1<=p)l=w.endOffset+1,a[c++]=new al(l,m+" "+w.className,v|w.metadata,b),r++;else{l=p,a[c++]=new al(l,m+" "+w.className,v|w.metadata,b);break}}p>l&&(l=p,a[c++]=new al(l,m,v,b))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let R=0,z=l.length;R=d&&(lt+=Ji)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*yt)),e.appendString('px"')),e.appendASCIICharCode(B.GreaterThan);C1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ji=2;Ji<=xt;Ji++)e.appendCharCode(160)}else lt=2,xt=1,e.appendCharCode(m),e.appendCharCode(8204);L+=lt,k+=xt,C>=d&&(A+=xt)}}else for(e.appendASCIICharCode(B.GreaterThan);C=d&&(A+=lt)}Oe?P++:P=0,C>=r&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(C+1,R,L,k)),e.appendString("")}return y||w.setColumnInfo(r+1,l.length-1,L,k),a&&(e.appendString(''),e.appendString(g(9364,"Show more ({0})",Bgt(c))),e.appendString("")),e.appendString(""),new Rpe(w,f,n)}function Ogt(s){return s.toString(16).toUpperCase().padStart(4,"0")}function Bgt(s){return s<1024?g(9365,"{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}var Wgt=".monaco-aria-container{left:-999em;position:absolute}";ut(Wgt,{});const FOe=2e4;let W0,Aq,Mpe,Eq,Npe;function Hgt(s){W0=document.createElement("div"),W0.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),W0.appendChild(i),i};Aq=e(),Mpe=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),W0.appendChild(i),i};Eq=t(),Npe=t(),s.appendChild(W0)}function Mr(s){W0&&(Aq.textContent!==s?(Ms(Mpe),tY(Aq,s)):(Ms(Aq),tY(Mpe,s)))}function Ah(s){W0&&(Eq.textContent!==s?(Ms(Npe),tY(Eq,s)):(Ms(Eq),tY(Npe,s)))}function tY(s,e){Ms(s),e.length>FOe&&(e=e.substr(0,FOe)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const DTe=ae("markerDecorationsService");var fB;let iY=(fB=class{constructor(e,t){}dispose(){}},fB.ID="editor.contrib.markerDecorations",fB);iY=D([_(1,DTe)],iY);on(iY.ID,iY,ri.Eager);var Ugt='::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);overflow:visible;overflow-wrap:normal;position:relative}.monaco-editor,.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);border:1px solid var(--vscode-editor-rangeHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);border:1px solid var(--vscode-editor-symbolHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{overflow:hidden;position:relative}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .margin-view-overlays>div,.monaco-editor .view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{background:var(--vscode-editorError-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{background:var(--vscode-editorWarning-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{background:var(--vscode-editorInfo-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground,inherit)}';ut(Ugt,{});class KKe extends V{constructor(e,t){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ll(ct(this._referenceDomElement),()=>{n=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}const $F=class $F{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=$F._read(e,this.key),i=o=>$F._read(e,o),n=(o,r)=>$F._write(e,o,r);this.migrate(t,i,n)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}};$F.items=[];let H8=$F;function Ub(s,e){H8.items.push(new H8(s,e))}function ff(s,e){Ub(s,(t,i,n)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){n(s,r);return}}})}function Vgt(s){H8.items.forEach(e=>e.apply(s))}ff("wordWrap",[[!0,"on"],[!1,"off"]]);ff("lineNumbers",[[!0,"on"],[!1,"off"]]);ff("cursorBlinking",[["visible","solid"]]);ff("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);ff("renderLineHighlight",[[!0,"line"],[!1,"none"]]);ff("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);ff("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);ff("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ff("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ff("autoIndent",[[!1,"advanced"],[!0,"full"]]);ff("matchBrackets",[[!0,"always"],[!1,"never"]]);ff("renderFinalNewline",[[!0,"on"],[!1,"off"]]);ff("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);ff("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);ff("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Ub("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Ub("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});Ub("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const zgt={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};Ub("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(zgt))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Ub("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Ub("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});Ub("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});Ub("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const o of Object.entries(s))typeof o[1]=="boolean"?(i=!0,n[o[0]]=o[1]?"explicit":"never"):n[o[0]]=o[1];i&&t("codeActionsOnSave",n)}});Ub("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});Ub("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class $gt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new I,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Pk=new $gt,mr=ae("accessibilityService");let Ppe=class extends V{constructor(e,t,i,n,o,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new I),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new nGe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new KKe(o,n.dimension)),this._targetWindowId=ct(o).vscodeWindowId,this._rawOptions=OOe(n),this._validatedOptions=lS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(Qp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Pk.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(ppe.onDidChange(()=>this._recomputeOptions())),this._register(L8.getInstance(ct(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=lS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=wx.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Pk.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return lS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:Kgt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:vT||rf,pixelRatio:L8.getInstance(Hj(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Jl.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return ppe.readFontInfo(Hj(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=OOe(e);lS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=lS.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=Ggt(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};Ppe=D([_(5,mr)],Ppe);function Ggt(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function Kgt(s){let e="";return!Ky&&!bGe&&(e+="no-user-select "),Ky&&(e+="no-minimap-shadow ",e+="enable-user-select "),Qt&&(e+="mac "),s&&(e+="standalone "),e}class qgt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Qgt{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class lS{static validateOptions(e){const t=new qgt;for(const i of JP){const n=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Qgt;for(const n of JP)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?is(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!lS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of JP){const r=!lS._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new iGe(i):null}static applyUpdate(e,t){let i=!1;for(const n of JP)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function OOe(s){const e=xs(s);return Vgt(e),e}var yx;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let o=0,r;(function(P){P[P.Before=0]="Before",P[P.InProgress=1]="InProgress",P[P.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){w(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}s.onKeyDown=c;function l(){a.keydown===r.InProgress&&(performance.mark("keydown/end"),a.keydown=r.Finished)}function d(){performance.mark("input/start"),a.input=r.InProgress,b()}s.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}s.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){w()}s.onKeyUp=f;function p(){w()}s.onSelectionChange=p;function m(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Before&&(performance.mark("render/start"),a.render=r.InProgress,queueMicrotask(v),b())}s.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function b(){setTimeout(w)}function w(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Finished&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),y("keydown",e),y("input",t),y("render",i),y("inputlatency",n),o++,C())}function y(P,R){const z=performance.getEntriesByName(P)[0].duration;R.total+=z,R.min=Math.min(R.min,z),R.max=Math.max(R.max,z)}function C(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),a.keydown=r.Before,a.input=r.Before,a.render=r.Before}function A(){if(o===0)return;const P={keydown:L(e),input:L(t),render:L(i),total:L(n),sampleCount:o};return k(e),k(t),k(i),k(n),o=0,P}s.getAndClearMeasurements=A;function L(P){return{average:P.total/o,max:P.max,min:P.min}}function k(P){P.total=0,P.min=Number.MAX_VALUE,P.max=0}})(yx||(yx={}));var es;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(es||(es={}));var Wg;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(Wg||(Wg={}));var Rt;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Rt||(Rt={}));function Qr(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===CU.ICodeEditor:!1}function im(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===CU.IDiffEditor:!1}function W2(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function s6(s){return Qr(s)?s:im(s)?s.getModifiedEditor():W2(s)&&Qr(s.activeCodeEditor)?s.activeCodeEditor:null}function jgt(s){return Qr(s)||im(s)?s:null}class SU{constructor(){this._hooks=new Z,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=ct(e)}this._hooks.add(ue(r,ke.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(r,ke.POINTER_UP,a=>this.stopMonitoring(!0)))}}function Vre(s){return`--vscode-${s.replace(/\./g,"-")}`}function ze(s){return`var(${Vre(s)})`}function Fpe(s,e){return`var(${Vre(s)}, ${e})`}var Pu;(function(s){s[s.Darken=0]="Darken",s[s.Lighten=1]="Lighten",s[s.Transparent=2]="Transparent",s[s.Opaque=3]="Opaque",s[s.OneOf=4]="OneOf",s[s.LessProminent=5]="LessProminent",s[s.IfDefinedThenElse=6]="IfDefinedThenElse"})(Pu||(Pu={}));function Ygt(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const kTe={ColorContribution:"base.contributions.colors"},Jgt="default";class Xgt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}notifyThemeUpdate(e){for(const t of Object.keys(this.colorsById)){const i=e.getColor(t);i&&(this.colorSchema.properties[t].oneOf[0].defaultSnippets[0].body=`\${1:${i.toString()}}`)}this._onDidChangeSchema.fire()}registerColor(e,t,i,n=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),n&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=g(1694,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={oneOf:[a,{type:"string",const:Jgt,description:g(1695,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}deregisterColor(e){delete this.colorsById[e],delete this.colorSchema.properties[e];const t=this.colorReferenceSchema.enum.indexOf(e);t!==-1&&(this.colorReferenceSchema.enum.splice(t,1),this.colorReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChangeSchema.fire()}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i?.defaults){const n=Ygt(i.defaults)?i.defaults[t.type]:i.defaults;return _v(n,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const zre=new Xgt;Qe.add(kTe.ColorContribution,zre);function W(s,e,t,i,n){return zre.registerColor(s,e,t,i,n)}function Zgt(s,e){switch(s.op){case Pu.Darken:return _v(s.value,e)?.darken(s.factor);case Pu.Lighten:return _v(s.value,e)?.lighten(s.factor);case Pu.Transparent:return _v(s.value,e)?.transparent(s.factor);case Pu.Opaque:{const t=_v(s.background,e);return t?_v(s.value,e)?.makeOpaque(t):_v(s.value,e)}case Pu.OneOf:for(const t of s.values){const i=_v(t,e);if(i)return i}return;case Pu.IfDefinedThenElse:return _v(e.defines(s.if)?s.then:s.else,e);case Pu.LessProminent:{const t=_v(s.value,e);if(!t)return;const i=_v(s.background,e);return i?t.isDarkerThan(i)?me.getLighterColor(t,i,s.factor).transparent(s.transparency):me.getDarkerColor(t,i,s.factor).transparent(s.transparency):t.transparent(s.factor*s.transparency)}default:throw Z7()}}function pp(s,e){return{op:Pu.Darken,value:s,factor:e}}function R_(s,e){return{op:Pu.Lighten,value:s,factor:e}}function st(s,e){return{op:Pu.Transparent,value:s,factor:e}}function BOe(s,e){return{op:Pu.Opaque,value:s,background:e}}function U8(...s){return{op:Pu.OneOf,values:s}}function eft(s,e,t){return{op:Pu.IfDefinedThenElse,if:s,then:e,else:t}}function WOe(s,e,t,i){return{op:Pu.LessProminent,value:s,background:e,factor:t,transparency:i}}function _v(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?me.fromHex(s):e.getColor(s);if(s instanceof me)return s;if(typeof s=="object")return Zgt(s,e)}}const qKe="vscode://schemas/workbench-colors",QKe=Qe.as(YA.JSONContribution);QKe.registerSchema(qKe,zre.getColorSchema());const HOe=new cn(()=>QKe.notifySchemaChanged(qKe),200);zre.onDidChangeSchema(()=>{HOe.isScheduled()||HOe.schedule()});const zi=W("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(1696,"Overall foreground color. This color is only used if not overridden by a component.")),UOe=W("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(1697,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),VOe=W("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(1698,"Overall foreground color for error messages. This color is only used if not overridden by a component."));W("descriptionForeground",{light:"#717171",dark:st(zi,.7),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1699,"Foreground color for description text providing additional information, for example for a label."));const nY=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1700,"The default color for icons in the workbench.")),mp=W("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(1701,"Overall border color for focused elements. This color is only used if not overridden by a component.")),wt=W("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(1702,"An extra border around elements to separate them from others for greater contrast.")),Js=W("contrastActiveBorder",{light:null,dark:null,hcDark:mp,hcLight:mp},g(1703,"An extra border around active elements to separate them from others for greater contrast."));W("selection.background",null,g(1704,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const ITe=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1705,"Foreground color for links in text.")),tft=W("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1706,"Foreground color for links in text when clicked on and on mouse hover."));W("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:me.black,hcLight:"#292929"},g(1707,"Color for text separators."));W("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(1708,"Foreground color for preformatted text segments."));W("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(1709,"Background color for preformatted text segments."));const ift=W("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1710,"Background color for block quotes in text.")),nft=W("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:me.white,hcLight:"#292929"},g(1711,"Border color for block quotes in text."));W("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:me.black,hcLight:"#F2F2F2"},g(1712,"Background color for code blocks in text."));W("sash.hoverBorder",mp,g(1908,"Border color of active sashes."));const yT=W("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:me.black,hcLight:"#0F4A85"},g(1909,"Badge background color. Badges are small information labels, e.g. for search results count.")),$re=W("badge.foreground",{dark:me.white,light:"#333",hcDark:me.white,hcLight:me.white},g(1910,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),o6=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(1911,"Scrollbar shadow to indicate that the view is scrolled.")),jKe=W("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:st(wt,.6),hcLight:st(wt,.4)},g(1912,"Scrollbar slider background color.")),YKe=W("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:st(wt,.8),hcLight:st(wt,.8)},g(1913,"Scrollbar slider background color when hovering.")),JKe=W("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:wt,hcLight:wt},g(1914,"Scrollbar slider background color when clicked on.")),sft=W("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:wt,hcLight:wt},g(1915,"Background color of the progress bar that can show for long running operations.")),Hc=W("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},g(1721,"Editor background color.")),Rl=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:zi},g(1722,"Editor default foreground color."));W("editorStickyScroll.background",Hc,g(1723,"Background color of sticky scroll in the editor"));W("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1724,"Background color of sticky scroll on hover in the editor"));W("editorStickyScroll.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1725,"Border color of sticky scroll in the editor"));W("editorStickyScroll.shadow",o6,g(1726," Shadow color of sticky scroll in the editor"));const xh=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},g(1727,"Background color of editor widgets, such as find/replace.")),IN=W("editorWidget.foreground",zi,g(1728,"Foreground color of editor widgets, such as find/replace.")),r6=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:wt,hcLight:wt},g(1729,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));W("editorWidget.resizeBorder",null,g(1730,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));W("editorError.background",null,g(1731,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const TN=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1732,"Foreground color of error squigglies in the editor.")),oft=W("editorError.border",{dark:null,light:null,hcDark:me.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(1733,"If set, color of double underlines for errors in the editor.")),rft=W("editorWarning.background",null,g(1734,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),pm=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1735,"Foreground color of warning squigglies in the editor.")),V8=W("editorWarning.border",{dark:null,light:null,hcDark:me.fromHex("#FFCC00").transparent(.8),hcLight:me.fromHex("#FFCC00").transparent(.8)},g(1736,"If set, color of double underlines for warnings in the editor."));W("editorInfo.background",null,g(1737,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const mm=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1738,"Foreground color of info squigglies in the editor.")),z8=W("editorInfo.border",{dark:null,light:null,hcDark:me.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(1739,"If set, color of double underlines for infos in the editor.")),aft=W("editorHint.foreground",{dark:me.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(1740,"Foreground color of hint squigglies in the editor."));W("editorHint.border",{dark:null,light:null,hcDark:me.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(1741,"If set, color of double underlines for hints in the editor."));const cft=W("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},g(1742,"Color of active links.")),AS=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1743,"Color of the editor selection.")),lft=W("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},g(1744,"Color of the selected text for high contrast.")),XKe=W("editor.inactiveSelectionBackground",{light:st(AS,.5),dark:st(AS,.5),hcDark:st(AS,.7),hcLight:st(AS,.5)},g(1745,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),TTe=W("editor.selectionHighlightBackground",{light:WOe(AS,Hc,.3,.6),dark:WOe(AS,Hc,.3,.6),hcDark:null,hcLight:null},g(1746,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1747,"Border color for regions with the same content as the selection."));const zOe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1748,"Color of the current search match.")),dft=W("editor.findMatchForeground",null,g(1749,"Text color of the current search match.")),_b=W("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(1750,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),hft=W("editor.findMatchHighlightForeground",null,g(1751,"Foreground color of the other search matches."),!0);W("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(1752,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.findMatchBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1753,"Border color of the current search match."));const Cx=W("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1754,"Border color of the other search matches.")),uft=W("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:st(Js,.4),hcLight:st(Js,.4)},g(1755,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gft=W("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(1756,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),sY=W("editorHoverWidget.background",xh,g(1757,"Background color of the editor hover."));W("editorHoverWidget.foreground",IN,g(1758,"Foreground color of the editor hover."));const ZKe=W("editorHoverWidget.border",r6,g(1759,"Border color of the editor hover."));W("editorHoverWidget.statusBarBackground",{dark:R_(sY,.2),light:pp(sY,.05),hcDark:xh,hcLight:xh},g(1760,"Background color of the editor hover status bar."));const LTe=W("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},g(1761,"Foreground color of inline hints")),RTe=W("editorInlayHint.background",{dark:st(yT,.1),light:st(yT,.1),hcDark:st(me.white,.1),hcLight:st(yT,.1)},g(1762,"Background color of inline hints")),fft=W("editorInlayHint.typeForeground",LTe,g(1763,"Foreground color of inline hints for types")),pft=W("editorInlayHint.typeBackground",RTe,g(1764,"Background color of inline hints for types")),mft=W("editorInlayHint.parameterForeground",LTe,g(1765,"Foreground color of inline hints for parameters")),_ft=W("editorInlayHint.parameterBackground",RTe,g(1766,"Background color of inline hints for parameters")),vft=W("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(1767,"The color used for the lightbulb actions icon."));W("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(1768,"The color used for the lightbulb auto fix actions icon."));W("editorLightBulbAi.foreground",vft,g(1769,"The color used for the lightbulb AI icon."));W("editor.snippetTabstopHighlightBackground",{dark:new me(new dn(124,124,124,.3)),light:new me(new dn(10,50,100,.2)),hcDark:new me(new dn(124,124,124,.3)),hcLight:new me(new dn(10,50,100,.2))},g(1770,"Highlight background color of a snippet tabstop."));W("editor.snippetTabstopHighlightBorder",null,g(1771,"Highlight border color of a snippet tabstop."));W("editor.snippetFinalTabstopHighlightBackground",null,g(1772,"Highlight background color of the final tabstop of a snippet."));W("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new me(new dn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1773,"Highlight border color of the final tabstop of a snippet."));const Ope=new me(new dn(155,185,85,.2)),Bpe=new me(new dn(255,0,0,.2)),my=W("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(1774,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),iF=W("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(1775,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.insertedLineBackground",{dark:Ope,light:Ope,hcDark:null,hcLight:null},g(1776,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.removedLineBackground",{dark:Bpe,light:Bpe,hcDark:null,hcLight:null},g(1777,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditorGutter.insertedLineBackground",null,g(1778,"Background color for the margin where lines got inserted."));W("diffEditorGutter.removedLineBackground",null,g(1779,"Background color for the margin where lines got removed."));const bft=W("diffEditorOverview.insertedForeground",null,g(1780,"Diff overview ruler foreground for inserted content.")),wft=W("diffEditorOverview.removedForeground",null,g(1781,"Diff overview ruler foreground for removed content."));W("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(1782,"Outline color for the text that got inserted."));W("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(1783,"Outline color for text that got removed."));W("diffEditor.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1784,"Border color between the two text editors."));W("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(1785,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));W("diffEditor.unchangedRegionBackground","sideBar.background",g(1786,"The background color of unchanged blocks in the diff editor."));W("diffEditor.unchangedRegionForeground","foreground",g(1787,"The foreground color of unchanged blocks in the diff editor."));W("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(1788,"The background color of unchanged code in the diff editor."));const CI=W("widget.shadow",{dark:st(me.black,.36),light:st(me.black,.16),hcDark:null,hcLight:null},g(1789,"Shadow color of widgets such as find/replace inside the editor.")),H2=W("widget.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1790,"Border color of widgets such as find/replace inside the editor.")),oY=W("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(1791,"Toolbar background when hovering over actions using the mouse"));W("toolbar.hoverOutline",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1792,"Toolbar outline when hovering over actions using the mouse"));W("toolbar.activeBackground",{dark:R_(oY,.1),light:pp(oY,.1),hcDark:null,hcLight:null},g(1793,"Toolbar background when holding the mouse over actions"));const yft=W("breadcrumb.foreground",st(zi,.8),g(1794,"Color of focused breadcrumb items.")),Cft=W("breadcrumb.background",Hc,g(1795,"Background color of breadcrumb items.")),$Oe=W("breadcrumb.focusForeground",{light:pp(zi,.2),dark:R_(zi,.1),hcDark:R_(zi,.1),hcLight:R_(zi,.1)},g(1794,"Color of focused breadcrumb items.")),Sft=W("breadcrumb.activeSelectionForeground",{light:pp(zi,.2),dark:R_(zi,.1),hcDark:R_(zi,.1),hcLight:R_(zi,.1)},g(1796,"Color of selected breadcrumb items."));W("breadcrumbPicker.background",xh,g(1797,"Background color of breadcrumb item picker."));const eqe=.5,GOe=me.fromHex("#40C8AE").transparent(eqe),KOe=me.fromHex("#40A6FF").transparent(eqe),qOe=me.fromHex("#606060").transparent(.4),MTe=.4,U2=1,Wpe=W("merge.currentHeaderBackground",{dark:GOe,light:GOe,hcDark:null,hcLight:null},g(1798,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.currentContentBackground",st(Wpe,MTe),g(1799,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Hpe=W("merge.incomingHeaderBackground",{dark:KOe,light:KOe,hcDark:null,hcLight:null},g(1800,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.incomingContentBackground",st(Hpe,MTe),g(1801,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Upe=W("merge.commonHeaderBackground",{dark:qOe,light:qOe,hcDark:null,hcLight:null},g(1802,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.commonContentBackground",st(Upe,MTe),g(1803,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const V2=W("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(1804,"Border color on headers and the splitter in inline merge-conflicts."));W("editorOverviewRuler.currentContentForeground",{dark:st(Wpe,U2),light:st(Wpe,U2),hcDark:V2,hcLight:V2},g(1805,"Current overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.incomingContentForeground",{dark:st(Hpe,U2),light:st(Hpe,U2),hcDark:V2,hcLight:V2},g(1806,"Incoming overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.commonContentForeground",{dark:st(Upe,U2),light:st(Upe,U2),hcDark:V2,hcLight:V2},g(1807,"Common ancestor overview ruler foreground for inline merge-conflicts."));const s5=W("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(1808,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),tqe=W("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",g(1809,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Aft=W("problemsErrorIcon.foreground",TN,g(1810,"The color used for the problems error icon.")),Eft=W("problemsWarningIcon.foreground",pm,g(1811,"The color used for the problems warning icon.")),xft=W("problemsInfoIcon.foreground",mm,g(1812,"The color used for the problems info icon.")),Vpe=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1897,"Minimap marker color for find matches."),!0),Gre=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1898,"Minimap marker color for repeating editor selections."),!0),QOe=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1899,"Minimap marker color for the editor selection."),!0),Dft=W("minimap.infoHighlight",{dark:mm,light:mm,hcDark:z8,hcLight:z8},g(1900,"Minimap marker color for infos.")),kft=W("minimap.warningHighlight",{dark:pm,light:pm,hcDark:V8,hcLight:V8},g(1901,"Minimap marker color for warnings.")),Ift=W("minimap.errorHighlight",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(1902,"Minimap marker color for errors.")),Tft=W("minimap.background",null,g(1903,"Minimap background color.")),Lft=W("minimap.foregroundOpacity",me.fromHex("#000f"),g(1904,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));W("minimapSlider.background",st(jKe,.5),g(1905,"Minimap slider background color."));W("minimapSlider.hoverBackground",st(YKe,.5),g(1906,"Minimap slider background color when hovering."));W("minimapSlider.activeBackground",st(JKe,.5),g(1907,"Minimap slider background color when clicked on."));W("charts.foreground",zi,g(1713,"The foreground color used in charts."));W("charts.lines",st(zi,.5),g(1714,"The color used for horizontal lines in charts."));W("charts.red",TN,g(1715,"The red color used in chart visualizations."));W("charts.blue",mm,g(1716,"The blue color used in chart visualizations."));W("charts.yellow",pm,g(1717,"The yellow color used in chart visualizations."));W("charts.orange",Vpe,g(1718,"The orange color used in chart visualizations."));W("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(1719,"The green color used in chart visualizations."));W("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(1720,"The purple color used in chart visualizations."));const z2=W("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1813,"Input box background.")),iqe=W("input.foreground",zi,g(1814,"Input box foreground.")),o5=W("input.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1815,"Input box border.")),Kre=W("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:wt,hcLight:wt},g(1816,"Border color of activated options in input fields.")),Rft=W("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1817,"Background color of activated options in input fields.")),a6=W("inputOption.activeBackground",{dark:st(mp,.4),light:st(mp,.2),hcDark:me.transparent,hcLight:me.transparent},g(1818,"Background hover color of options in input fields.")),qre=W("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:zi,hcLight:zi},g(1819,"Foreground color of activated options in input fields.")),Mft=W("input.placeholderForeground",{light:st(zi,.5),dark:st(zi,.5),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1820,"Input box foreground color for placeholder text.")),Nft=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},g(1821,"Input validation background color for information severity.")),Pft=W("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1822,"Input validation foreground color for information severity.")),Fft=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:wt,hcLight:wt},g(1823,"Input validation border color for information severity.")),Oft=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},g(1824,"Input validation background color for warning severity.")),Bft=W("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1825,"Input validation foreground color for warning severity.")),Wft=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:wt,hcLight:wt},g(1826,"Input validation border color for warning severity.")),nqe=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},g(1827,"Input validation background color for error severity.")),sqe=W("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1828,"Input validation foreground color for error severity.")),oqe=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1829,"Input validation border color for error severity.")),Qre=W("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1830,"Dropdown background.")),Hft=W("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},g(1831,"Dropdown list background.")),NTe=W("dropdown.foreground",{dark:"#F0F0F0",light:zi,hcDark:me.white,hcLight:zi},g(1832,"Dropdown foreground.")),PTe=W("dropdown.border",{dark:Qre,light:"#CECECE",hcDark:wt,hcLight:wt},g(1833,"Dropdown border.")),bM=W("button.foreground",me.white,g(1834,"Button foreground color.")),rqe=W("button.separator",st(bM,.4),g(1835,"Button separator color.")),_y=W("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(1836,"Button background color.")),$8=W("button.hoverBackground",{dark:R_(_y,.2),light:pp(_y,.2),hcDark:_y,hcLight:_y},g(1837,"Button background color when hovering.")),Uft=W("button.border",wt,g(1838,"Button border color.")),Vft=W("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:zi},g(1839,"Secondary button foreground color.")),zpe=W("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},g(1840,"Secondary button background color.")),zft=W("button.secondaryHoverBackground",{dark:R_(zpe,.2),light:pp(zpe,.2),hcDark:null,hcLight:null},g(1841,"Secondary button background color when hovering.")),Z4=W("radio.activeForeground",qre,g(1842,"Foreground color of active radio option.")),$ft=W("radio.activeBackground",a6,g(1843,"Background color of active radio option.")),Gft=W("radio.activeBorder",Kre,g(1844,"Border color of the active radio option.")),Kft=W("radio.inactiveForeground",null,g(1845,"Foreground color of inactive radio option.")),qft=W("radio.inactiveBackground",null,g(1846,"Background color of inactive radio option.")),Qft=W("radio.inactiveBorder",{light:st(Z4,.2),dark:st(Z4,.2),hcDark:st(Z4,.4),hcLight:st(Z4,.2)},g(1847,"Border color of the inactive radio option.")),jft=W("radio.inactiveHoverBackground",Rft,g(1848,"Background color of inactive active radio option when hovering.")),Yft=W("checkbox.background",Qre,g(1849,"Background color of checkbox widget."));W("checkbox.selectBackground",xh,g(1850,"Background color of checkbox widget when the element it's in is selected."));const Jft=W("checkbox.foreground",NTe,g(1851,"Foreground color of checkbox widget.")),Xft=W("checkbox.border",PTe,g(1852,"Border color of checkbox widget."));W("checkbox.selectBorder",nY,g(1853,"Border color of checkbox widget when the element it's in is selected."));const Zft=W("keybindingLabel.background",{dark:new me(new dn(128,128,128,.17)),light:new me(new dn(221,221,221,.4)),hcDark:me.transparent,hcLight:me.transparent},g(1854,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),ept=W("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:zi},g(1855,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),tpt=W("keybindingLabel.border",{dark:new me(new dn(51,51,51,.6)),light:new me(new dn(204,204,204,.4)),hcDark:new me(new dn(111,195,223)),hcLight:wt},g(1856,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),ipt=W("keybindingLabel.bottomBorder",{dark:new me(new dn(68,68,68,.6)),light:new me(new dn(187,187,187,.4)),hcDark:new me(new dn(111,195,223)),hcLight:zi},g(1857,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),npt=W("list.focusBackground",null,g(1858,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),spt=W("list.focusForeground",null,g(1859,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),$pe=W("list.focusOutline",{dark:mp,light:mp,hcDark:Js,hcLight:Js},g(1860,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),opt=W("list.focusAndSelectionOutline",null,g(1861,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),vy=W("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1862,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),G8=W("list.activeSelectionForeground",{dark:me.white,light:me.white,hcDark:null,hcLight:null},g(1863,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),aqe=W("list.activeSelectionIconForeground",null,g(1864,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Gpe=W("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1865,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),rpt=W("list.inactiveSelectionForeground",null,g(1866,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),apt=W("list.inactiveSelectionIconForeground",null,g(1867,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),cpt=W("list.inactiveFocusBackground",null,g(1868,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),lpt=W("list.inactiveFocusOutline",null,g(1869,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),cqe=W("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:me.white.transparent(.1),hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1870,"List/Tree background when hovering over items using the mouse.")),lqe=W("list.hoverForeground",null,g(1871,"List/Tree foreground when hovering over items using the mouse.")),dpt=W("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(1872,"List/Tree drag and drop background when moving items over other items when using the mouse.")),hpt=W("list.dropBetweenBackground",{dark:nY,light:nY,hcDark:null,hcLight:null},g(1873,"List/Tree drag and drop border color when moving items between items when using the mouse.")),nF=W("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:mp,hcLight:mp},g(1874,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),upt=W("list.focusHighlightForeground",{dark:nF,light:eft(vy,nF,"#BBE7FF"),hcDark:nF,hcLight:nF},g(1875,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),gpt=W("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(1876,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),jOe=W("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(1877,"Foreground color of list items containing errors."));W("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(1878,"Foreground color of list items containing warnings."));const fpt=W("listFilterWidget.background",{light:pp(xh,0),dark:R_(xh,0),hcDark:xh,hcLight:xh},g(1879,"Background color of the type filter widget in lists and trees.")),ppt=W("listFilterWidget.outline",{dark:me.transparent,light:me.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(1880,"Outline color of the type filter widget in lists and trees.")),mpt=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1881,"Outline color of the type filter widget in lists and trees, when there are no matches.")),_pt=W("listFilterWidget.shadow",CI,g(1882,"Shadow color of the type filter widget in lists and trees."));W("list.filterMatchBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(1883,"Background color of the filtered match."));W("list.filterMatchBorder",{dark:Cx,light:Cx,hcDark:wt,hcLight:Js},g(1884,"Border color of the filtered match."));const vpt=W("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1885,"List/Tree foreground color for items that are deemphasized.")),rY=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1886,"Tree stroke color for the indentation guides.")),bpt=W("tree.inactiveIndentGuidesStroke",st(rY,.4),g(1887,"Tree stroke color for the indentation guides that are not active.")),wpt=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1888,"Table border color between columns.")),ypt=W("tree.tableOddRowsBackground",{dark:st(zi,.04),light:st(zi,.04),hcDark:null,hcLight:null},g(1889,"Background color for odd table rows.")),Cpt=W("menu.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1890,"Border color of menus.")),Spt=W("menu.foreground",NTe,g(1891,"Foreground color of menu items.")),Apt=W("menu.background",Qre,g(1892,"Background color of menu items.")),Ept=W("menu.selectionForeground",G8,g(1893,"Foreground color of the selected menu item in menus.")),xpt=W("menu.selectionBackground",vy,g(1894,"Background color of the selected menu item in menus.")),Dpt=W("menu.selectionBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1895,"Border color of the selected menu item in menus.")),kpt=W("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:wt,hcLight:wt},g(1896,"Color of a separator menu item in menus.")),YOe=W("quickInput.background",xh,g(1916,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Ipt=W("quickInput.foreground",IN,g(1917,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Tpt=W("quickInputTitle.background",{dark:new me(new dn(255,255,255,.105)),light:new me(new dn(0,0,0,.06)),hcDark:"#000000",hcLight:me.white},g(1918,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),dqe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},g(1919,"Quick picker color for grouping labels.")),Lpt=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},g(1920,"Quick picker color for grouping borders.")),JOe=W("quickInput.list.focusBackground",null,"",void 0,g(1921,"Please use quickInputList.focusBackground instead")),K8=W("quickInputList.focusForeground",G8,g(1922,"Quick picker foreground color for the focused item.")),FTe=W("quickInputList.focusIconForeground",aqe,g(1923,"Quick picker icon foreground color for the focused item.")),q8=W("quickInputList.focusBackground",{dark:U8(JOe,vy),light:U8(JOe,vy),hcDark:null,hcLight:null},g(1924,"Quick picker background color for the focused item."));W("search.resultsInfoForeground",{light:zi,dark:st(zi,.65),hcDark:zi,hcLight:zi},g(1925,"Color of the text in the search viewlet's completion message."));W("searchEditor.findMatchBackground",{light:st(_b,.66),dark:st(_b,.66),hcDark:_b,hcLight:_b},g(1926,"Color of the Search Editor query matches."));W("searchEditor.findMatchBorder",{light:st(Cx,.66),dark:st(Cx,.66),hcDark:Cx,hcLight:Cx},g(1927,"Border color of the Search Editor query matches."));class jre{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new hqe(this.x-e.scrollX,this.y-e.scrollY)}}class hqe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new jre(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class Rpt{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Mpt{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function OTe(s){const e=Cr(s);return new Rpt(e.left,e.top,e.width,e.height)}function BTe(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/n;return new Mpt(o,r)}class Fk extends Eh{constructor(e,t,i){super(ct(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new jre(this.posx,this.posy),this.editorPos=OTe(i),this.relativePos=BTe(i,this.editorPos,this.pos)}}class Npt{constructor(e){this._editorViewDomNode=e}_create(e){return new Fk(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ue(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ue(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ue(e,ke.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return ue(e,ke.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return ue(e,"mousemove",i=>t(this._create(i)))}}class Ppt{constructor(e){this._editorViewDomNode=e}_create(e){return new Fk(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ue(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return ue(e,ke.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return ue(e,"pointermove",i=>t(this._create(i)))}}class Fpt extends V{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new SU),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Ro(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new Fk(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const Gne=class Gne{constructor(e){this._editor=e,this._instanceId=++Gne._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new cn(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new Opt(t,`dyn-rule-${this._instanceId}-${n}`,k8(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};Gne._idPool=0;let aY=Gne;class Opt{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=gl(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const o=t[n];let r;typeof o=="object"?r=ze(o.id):r=o;const a=Bpt(n);i+=` ${a}: ${r};`}return i+=` -}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function V_t(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var yo;(function(n){n[n.ViewCompositionStart=0]="ViewCompositionStart",n[n.ViewCompositionEnd=1]="ViewCompositionEnd",n[n.ViewConfigurationChanged=2]="ViewConfigurationChanged",n[n.ViewCursorStateChanged=3]="ViewCursorStateChanged",n[n.ViewDecorationsChanged=4]="ViewDecorationsChanged",n[n.ViewFlushed=5]="ViewFlushed",n[n.ViewFocusChanged=6]="ViewFocusChanged",n[n.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",n[n.ViewLineMappingChanged=8]="ViewLineMappingChanged",n[n.ViewLinesChanged=9]="ViewLinesChanged",n[n.ViewLinesDeleted=10]="ViewLinesDeleted",n[n.ViewLinesInserted=11]="ViewLinesInserted",n[n.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",n[n.ViewScrollChanged=13]="ViewScrollChanged",n[n.ViewThemeChanged=14]="ViewThemeChanged",n[n.ViewTokensChanged=15]="ViewTokensChanged",n[n.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",n[n.ViewZonesChanged=17]="ViewZonesChanged"})(yo||(yo={}));class z_t{constructor(){this.type=yo.ViewCompositionStart}}class $_t{constructor(){this.type=yo.ViewCompositionEnd}}class G_t{constructor(e){this.type=yo.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class q_t{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=yo.ViewCursorStateChanged}}class vL{constructor(e){this.type=yo.ViewDecorationsChanged,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class kj{constructor(){this.type=yo.ViewFlushed}}class Q_t{constructor(e){this.type=yo.ViewFocusChanged,this.isFocused=e}}class j_t{constructor(){this.type=yo.ViewLanguageConfigurationChanged}}class Ij{constructor(){this.type=yo.ViewLineMappingChanged}}class DKe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=yo.ViewLinesChanged}}class rwe{constructor(e,t){this.type=yo.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class awe{constructor(e,t){this.type=yo.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var Ns;(function(n){n[n.Simple=0]="Simple",n[n.Center=1]="Center",n[n.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",n[n.Top=3]="Top",n[n.Bottom=4]="Bottom",n[n.NearTop=5]="NearTop",n[n.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(Ns||(Ns={}));class v${constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=yo.ViewRevealRangeRequest}}class K_t{constructor(e){this.type=yo.ViewScrollChanged,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Y_t{constructor(e){this.theme=e,this.type=yo.ViewThemeChanged}}class J_t{constructor(e){this.type=yo.ViewTokensChanged,this.ranges=e}}class X_t{constructor(){this.type=yo.ViewTokensColorsChanged}}let Z_t=class{constructor(){this.type=yo.ViewZonesChanged}};class dQ extends ${constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,s){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=s}}class ode{static from(e){const t=new Array(e.length);for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),s=Math.min(c,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=Zn.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[s].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Zn.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=Zn.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(l,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}var sf;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(sf||(sf={}));function pS(n){return n===sf.HIGH_CONTRAST_DARK||n===sf.HIGH_CONTRAST_LIGHT}function rde(n){return n===sf.DARK||n===sf.HIGH_CONTRAST_DARK}const svt=function(){return rf?!0:!(jr||pp||TS)}();let IW=!0;class wWe{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(x.fontInfo);i.get(x.experimentalWhitespaceRendering)==="off"?this.renderWhitespace=i.get(x.renderWhitespace):this.renderWhitespace="none",this.renderControlCharacters=i.get(x.renderControlCharacters),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(x.lineHeight),this.stopRenderingLineAfter=i.get(x.stopRenderingLineAfter),this.fontLigatures=i.get(x.fontLigatures)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}const dae=class dae{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ks(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return pS(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=s.getViewLineRenderingData(e),a=this._options,c=ig.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(pS(a.themeType)||this._options.renderWhitespace==="selection"){const f=s.selections;for(const p of f){if(p.endLineNumbere)continue;const m=p.startLineNumber===e?p.startColumn:r.minColumn,v=p.endLineNumber===e?p.endColumn:r.maxColumn;m');const h=lQ(d,o);o.appendString("
      ");let u=null;return IW&&svt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===nf.None&&(u=new Lj(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=IKe(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Lj:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Lj?this._renderedViewLine.monospaceAssumptionsAreValid():IW}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Lj&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new vWe(!0,[new uM(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new vWe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};dae.CLASS_NAME="view-line";let rE=dae;var CA;(function(n){n[n.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(CA||(CA={}));class Lj{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/CA.MaxMonospaceDistance);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),IW=!1)}return IW}toSlowRenderedLine(){return IKe(this.domNode,this.input,this._characterMapping,!1,nf.None)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new uM(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=CA.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const s=Math.floor((t-1)/CA.MaxMonospaceDistance)-1,o=(s+1)*CA.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(o),c=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(c-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=iJ.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return PMe(this._characterMapping,e,t)}}class kKe{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new uM(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new uM(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===nf.None||this._containsForeignElements===nf.After)return 0;if(this._containsForeignElements===nf.Before)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const c=iJ.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===nf.None)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getHorizontalOffset(i),l=Math.round(this.input.spaceWidth*c);if(Math.abs(l-a)<=1)return l}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new uM(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return PMe(this._characterMapping,e,t)}}class ovt extends kKe{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===Da.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===Da.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===Da.OverflowingOverlayWidgets}}class $U{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(x.lineHeight),this.stickyTabStops=s.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=s.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return $U.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,c=null;return i.afterLineNumber!==o&&(c=new oe(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new oe(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=r:r===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,ru._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class dvt extends lvt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Xb.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,s,o){super(e,t,i,s),this.hitTestResult=new Ya(()=>ru.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?Mt.CONTENT_VIEW_ZONE:Mt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return Bu.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=c[Math.floor(o/e.lineHeight)],t.fulfillMargin(Mt.GUTTER_GLYPH_MARGIN,s,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Mt.GUTTER_LINE_NUMBERS,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Mt.GUTTER_LINE_DECORATIONS,s,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Bu.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),bWe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const s=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(s);return t.fulfillContentEmpty(new oe(s,o),bWe)}if(Bu.isStrictChildOfViewLines(t.targetPath)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(s)===0){const r=e.getLineWidth(s),a=Xge(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(s,1),a)}const o=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>=o){const r=Xge(t.mouseContentHorizontalOffset-o),a=new oe(s,e.viewModel.getLineMaxColumn(s));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===gM.Content?ru.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Bu.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new oe(s,o))}}return null}static _hitTestScrollbar(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return ru._getMouseColumn(s,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const w=Xge(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(s,w)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(s);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const w=e.visibleRangeForPosition(r,a-1);w&&h.push({offset:w.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(aw.offset-b.offset);const f=t.pos.toClientCoordinates(gt(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let w=1;wo)){const a=Math.floor((s+o)/2);let c=t.pos.y+(a-t.mouseVerticalOffset);c<=t.editorPos.y&&(c=t.editorPos.y+1),c>=t.editorPos.y+t.editorPos.height&&(c=t.editorPos.y+t.editorPos.height-1);const l=new sde(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(gt(e.viewDomNode)));if(d.type===gM.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=cF(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=hvt(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new DD;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,r,s.startOffset):new DD(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,o,o.textContent.length):new DD(o)}return new DD}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new DD(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===rE.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return yT.createFromDOMInfo(e,c,0)}else if(a===rE.CLASS_NAME)return yT.createFromDOMInfo(e,i.offsetNode,0)}return new DD(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=X9.atomicPosition(i,e.column-1,s,TI.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new DD;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))),i.type===gM.Content){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,jo.None);(s||!o.equals(i.position))&&(i=new LKe(o,i.spanNode,s))}return i}}function hvt(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=gt(s),a=r.getComputedStyle(s,null).getPropertyValue("font-style"),c=r.getComputedStyle(s,null).getPropertyValue("font-variant"),l=r.getComputedStyle(s,null).getPropertyValue("font-weight"),d=r.getComputedStyle(s,null).getPropertyValue("font-size"),h=r.getComputedStyle(s,null).getPropertyValue("line-height"),u=r.getComputedStyle(s,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=s.innerText;let m=o.left,v=0,w;if(e>o.left+o.width)v=p.length;else{const b=cwe.getInstance();for(let C=0;C{t.add(pe(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(pe(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(pe(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:yi,disposables:this._store}))}static addTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in yi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Bd.HOLD_DELAY&&Math.abs(c.initialPageX-Mf(c.rollingPageX))<30&&Math.abs(c.initialPageY-Mf(c.rollingPageY))<30){const d=this.newGestureEvent(Eo.Contextmenu,c.initialTarget);d.pageX=Mf(c.rollingPageX),d.pageY=Mf(c.rollingPageY),this.dispatchEvent(d)}else if(s===1){const d=Mf(c.rollingPageX),h=Mf(c.rollingPageY),u=Mf(c.rollingTimestamps)-c.rollingTimestamps[0],f=d-c.rollingPageX[0],p=h-c.rollingPageY[0],m=[...this.targets].filter(v=>c.initialTarget instanceof Node&&v.contains(c.initialTarget));this.inertia(e,m,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(p)/u,p>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(Eo.End,c.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Eo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Bd.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Eo.Change||e.type===Eo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let s=0,o=e.initialTarget;for(;o&&o!==i;)s++,o=o.parentElement;t.push([s,i])}t.sort((i,s)=>i[0]-s[0]);for(const[i,s]of t)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,s,o,r,a,c,l){this.handle=xd(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;s+=Bd.SCROLL_FRICTION*h,a+=Bd.SCROLL_FRICTION*h,s>0&&(p=!1,u=o*s*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(Eo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,s,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Bd.SCROLL_FRICTION=-.005,Bd.HOLD_DELAY=700,Bd.CLEAR_TAP_COUNT_TIME=400;let dh=Bd;function uvt(n,e,t){let i=0;for(let o=0;o!0,fvt=()=>!1,pvt=n=>n===" "||n===" ";class HO{static shouldRecreate(e){return e.hasChanged(x.layoutInfo)||e.hasChanged(x.wordSeparators)||e.hasChanged(x.emptySelectionClipboard)||e.hasChanged(x.multiCursorMergeOverlapping)||e.hasChanged(x.multiCursorPaste)||e.hasChanged(x.multiCursorLimit)||e.hasChanged(x.autoClosingBrackets)||e.hasChanged(x.autoClosingComments)||e.hasChanged(x.autoClosingQuotes)||e.hasChanged(x.autoClosingDelete)||e.hasChanged(x.autoClosingOvertype)||e.hasChanged(x.autoSurround)||e.hasChanged(x.useTabStops)||e.hasChanged(x.fontInfo)||e.hasChanged(x.readOnly)||e.hasChanged(x.wordSegmenterLocales)}constructor(e,t,i,s){this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(x.layoutInfo),a=o.get(x.fontInfo);this.readOnly=o.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(x.useTabStops),this.wordSeparators=o.get(x.wordSeparators),this.emptySelectionClipboard=o.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=o.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=o.get(x.multiCursorPaste),this.multiCursorLimit=o.get(x.multiCursorLimit),this.autoClosingBrackets=o.get(x.autoClosingBrackets),this.autoClosingComments=o.get(x.autoClosingComments),this.autoClosingQuotes=o.get(x.autoClosingQuotes),this.autoClosingDelete=o.get(x.autoClosingDelete),this.autoClosingOvertype=o.get(x.autoClosingOvertype),this.autoSurround=o.get(x.autoSurround),this.autoIndent=o.get(x.autoIndent),this.wordSegmenterLocales=o.get(x.wordSegmenterLocales),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=dR(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return FMe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return pvt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return gvt;case"never":return fvt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Ic.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Ic.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}let zn=class TKe{static fromModelState(e){return new mvt(e)}static fromViewState(e){return new _vt(e)}static fromModelSelection(e){const t=mt.liftSelection(e),i=new bd(O.fromPositions(t.getSelectionStart()),Qu.Simple,0,t.getPosition(),0);return TKe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,l=s>r,d=sr||ws||v0&&s--,ST.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=o;c<=r;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new oe(c,l));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-wQe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new oe(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=X9.atomicPosition(o,t.column-1,i,TI.Left);if(r!==-1&&r+1>=s)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?Ws.leftPositionAtomicSoftTabs(t,i,e.tabSize):Ws.leftPosition(t,i);return new Zge(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(Ws.clipPositionColumn(c,t),jo.Left),d=Ws.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,Ws.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-Ic.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),c!==void 0){const p=new oe(i,s),m=t.normalizePosition(p,c);o=o+(s-m.column),i=m.lineNumber,s=m.column}return new Zge(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,jo.RightOfInjectedText)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=Ws.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),jo.None).lineNumber>r)break;while(c++<10&&r+c1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=s.get(f);if(!p)return!1;if(kD(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const w of p)w.open===f&&w.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let w=!1;for(let b=0,C=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Eu(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const c=i.visibleColumnFromColumn(t,s),l=Ic.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,l);return new O(s.lineNumber,d,s.lineNumber,s.column)}}return O.fromPositions(lF.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zlt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new oe(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>oe.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&o?.endLineNumber!==l.lineNumber?(d=l.lineNumber-1,h=t.getLineMaxColumn(l.lineNumber-1),u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber)):(d=l.lineNumber,h=1,u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber));const p=new O(d,h,u,f);o=p,p.isEmpty()?s[r]=null:s[r]=new zd(p,"")}else s[r]=null;else s[r]=new zd(c,"")}return new Lg(Cr.Other,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Hi;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(Hi||(Hi={}));var Jr;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Separator=2]="Separator"})(Jr||(Jr={}));var Ds;(function(n){n[n.WordStart=0]="WordStart",n[n.WordStartFast=1]="WordStartFast",n[n.WordEnd=2]="WordEnd",n[n.WordAccessibility=3]="WordAccessibility"})(Ds||(Ds={}));class Es{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:Jr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=Jr.None;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,c);if(c===da.Regular){if(s===Jr.Separator)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Regular}else if(c===da.WordSeparator){if(s===Jr.Regular)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Separator}else if(c===da.Whitespace&&s!==Jr.None)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1))}return s!==Jr.None?this._createWord(e,s,da.Whitespace,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=t.findNextIntlWordAtOrAfterOffset(e,s),r=e.length;for(let a=s;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===da.Whitespace||i===Jr.Regular&&c===da.WordSeparator||i===Jr.Separator&&c===da.Regular)return r+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Es._findPreviousWordOnLine(e,t,new oe(o,r));if(s===Ds.WordStart)return new oe(o,a?a.start+1:1);if(s===Ds.WordStartFast)return a&&a.wordType===Jr.Separator&&a.end-a.start===1&&a.nextCharClass===da.Regular&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.start+1:1);if(s===Ds.WordAccessibility){for(;a&&a.wordType===Jr.Separator;)a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1));return new oe(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new oe(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a===Q.Underline&&c!==Q.Underline)return new oe(i,r);if(a===Q.Dash&&c!==Q.Dash)return new oe(i,r);if((Bk(a)||gj(a))&&fy(c))return new oe(i,r);if(fy(a)&&fy(c)&&r+1=c.start+1&&(c=Es._findNextWordOnLine(e,t,new oe(o,c.end+1))),c?r=c.start+1:r=t.getLineMaxColumn(o);return new oe(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?l=1:(c--,l=s.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=Es._findPreviousWordOnLine(i,s,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=s.getLineMaxColumn(c))),new O(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===Q.Space||i===Q.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new O(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new O(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(s,u-2);)u--;return a(u,f)},l=Es._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=Es._findNextWordOnLine(e,t,i);return d&&r(d)?c(d):l&&d?a(l.end+1,d.start+1):l?a(l.start+1,l.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Es._moveWordPartLeft(e,i);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=u.start+1&&(u=Es._findNextWordOnLine(i,s,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class ud{static addCursorDown(e,t,i){const s=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),zn.fromModelState(new bd(new O(r.lineNumber,1,d,h),Qu.Line,0,new oe(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),zn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return zn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return zn.fromModelState(Es.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new zn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return zn.fromViewState(new bd(new O(i,s,i,s),Qu.Simple,0,new oe(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===Qu.Word)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===Qu.Line)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return zn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case Wi.Direction.Left:return r===Wi.Unit.HalfLine?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case Wi.Direction.Right:return r===Wi.Unit.HalfLine?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case Wi.Direction.Up:return r===Wi.Unit.WrappedLine?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case Wi.Direction.Down:return r===Wi.Unit.WrappedLine?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case Wi.Direction.PrevBlankLine:return r===Wi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Wi.Direction.NextBlankLine:return r===Wi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Wi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,s);case Wi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case Wi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,s);case Wi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,s);case Wi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Wi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Wi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Wi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Wi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:ozn.fromViewState(Ws.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;ozn.fromViewState(Ws.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;o0}}function Bpt(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var ao;(function(s){s[s.ViewCompositionStart=0]="ViewCompositionStart",s[s.ViewCompositionEnd=1]="ViewCompositionEnd",s[s.ViewConfigurationChanged=2]="ViewConfigurationChanged",s[s.ViewCursorStateChanged=3]="ViewCursorStateChanged",s[s.ViewDecorationsChanged=4]="ViewDecorationsChanged",s[s.ViewFlushed=5]="ViewFlushed",s[s.ViewFocusChanged=6]="ViewFocusChanged",s[s.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",s[s.ViewLineMappingChanged=8]="ViewLineMappingChanged",s[s.ViewLinesChanged=9]="ViewLinesChanged",s[s.ViewLinesDeleted=10]="ViewLinesDeleted",s[s.ViewLinesInserted=11]="ViewLinesInserted",s[s.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",s[s.ViewScrollChanged=13]="ViewScrollChanged",s[s.ViewThemeChanged=14]="ViewThemeChanged",s[s.ViewTokensChanged=15]="ViewTokensChanged",s[s.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",s[s.ViewZonesChanged=17]="ViewZonesChanged"})(ao||(ao={}));class Wpt{constructor(){this.type=ao.ViewCompositionStart}}class Hpt{constructor(){this.type=ao.ViewCompositionEnd}}class Upt{constructor(e){this.type=ao.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Vpt{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=ao.ViewCursorStateChanged}}class NI{constructor(e){this.type=ao.ViewDecorationsChanged,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class LG{constructor(){this.type=ao.ViewFlushed}}class zpt{constructor(e){this.type=ao.ViewFocusChanged,this.isFocused=e}}class $pt{constructor(){this.type=ao.ViewLanguageConfigurationChanged}}class RG{constructor(){this.type=ao.ViewLineMappingChanged}}class uqe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=ao.ViewLinesChanged}}class Kpe{constructor(e,t){this.type=ao.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class qpe{constructor(e,t){this.type=ao.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var _s;(function(s){s[s.Simple=0]="Simple",s[s.Center=1]="Center",s[s.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",s[s.Top=3]="Top",s[s.Bottom=4]="Bottom",s[s.NearTop=5]="NearTop",s[s.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(_s||(_s={}));class r5{constructor(e,t,i,n,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=ao.ViewRevealRangeRequest}}class Gpt{constructor(e){this.type=ao.ViewScrollChanged,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Kpt{constructor(e){this.theme=e,this.type=ao.ViewThemeChanged}}class qpt{constructor(e){this.type=ao.ViewTokensChanged,this.ranges=e}}class Qpt{constructor(){this.type=ao.ViewTokensColorsChanged}}let jpt=class{constructor(){this.type=ao.ViewZonesChanged}};class c6 extends V{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class Yre{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),n=Math.min(c,Math.max(0,n)),t===n&&i===o&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&o===0&&(n--,o=Un.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[n].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Un.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&n>0&&(d=e.children[n-1].firstChild,o=Un.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(l,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}var Jg;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(Jg||(Jg={}));function Ry(s){return s===Jg.HIGH_CONTRAST_DARK||s===Jg.HIGH_CONTRAST_LIGHT}function Jre(s){return s===Jg.DARK||s===Jg.HIGH_CONTRAST_DARK}const emt=function(){return ad?!0:!(pr||rf||Ky)}();let NO=!0;class ZOe{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(x.fontInfo);i.get(x.experimentalWhitespaceRendering)==="off"?this.renderWhitespace=i.get(x.renderWhitespace):this.renderWhitespace="none",this.renderControlCharacters=i.get(x.renderControlCharacters),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(x.lineHeight),this.stopRenderingLineAfter=i.get(x.stopRenderingLineAfter),this.fontLigatures=i.get(x.fontLigatures)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}const Kne=class Kne{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ls(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Ry(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,c=eu.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Ry(a.themeType)||this._options.renderWhitespace==="selection"){const f=n.selections;for(const p of f){if(p.endLineNumbere)continue;const m=p.startLineNumber===e?p.startColumn:r.minColumn,v=p.endLineNumber===e?p.endColumn:r.maxColumn;m');const h=n6(d,o);o.appendString("
      ");let u=null;return NO&&emt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===qu.None&&(u=new MG(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=fqe(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof MG:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof MG?this._renderedViewLine.monospaceAssumptionsAreValid():NO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof MG&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new XOe(!0,[new CT(this.getWidth(n),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new XOe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};Kne.CLASS_NAME="view-line";let dS=Kne;var xC;(function(s){s[s.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(xC||(xC={}));class MG{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/xC.MaxMonospaceDistance);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),NO=!1)}return NO}toSlowRenderedLine(){return fqe(this.domNode,this.input,this._characterMapping,!1,qu.None)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new CT(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=xC.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const n=Math.floor((t-1)/xC.MaxMonospaceDistance)-1,o=(n+1)*xC.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=r)),r===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(o),c=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(c-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=xq.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return WTe(this._characterMapping,e,t)}}class gqe{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new CT(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new CT(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===qu.None||this._containsForeignElements===qu.After)return 0;if(this._containsForeignElements===qu.Before)return this.getWidth(n);const o=this._getReadingTarget(e);return o.firstChild?(n.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const c=xq.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===qu.None)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),r=xq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getHorizontalOffset(i),l=Math.round(this.input.spaceWidth*c);if(Math.abs(l-a)<=1)return l}return a}_readRawVisibleRangesForRange(e,t,i,n){if(t===1&&i===this._characterMapping.length)return[new CT(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return xq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return WTe(this._characterMapping,e,t)}}class tmt extends gqe{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===sa.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===sa.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===sa.OverflowingOverlayWidgets}}class wM{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.overflowWidgetsDomNode=t.overflowWidgetsDomNode??null,this.lineHeight=n.get(x.lineHeight),this.stickyTabStops=n.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=n.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return wM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,c=null;return i.afterLineNumber!==o&&(c=new oe(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new oe(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=r:r===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Dd._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class eBe extends omt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&this._targetElement&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Tb.collect(this.target,this._targetElement)),this._targetPathCacheValue}constructor(e,t,i,n,o,r=null){super(e,t,i,n),this.hitTestResult=new ya(()=>Dd.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._targetElement=null,this._ctx=e,this._eventTarget=o,this._targetElement=r;const a=!!this._eventTarget;this._useHitTestTarget=!a}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?Rt.CONTENT_VIEW_ZONE:Rt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Fh.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=c[Math.floor(o/e.lineHeight)],t.fulfillMargin(Rt.GUTTER_GLYPH_MARGIN,n,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Rt.GUTTER_LINE_NUMBERS,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Rt.GUTTER_LINE_DECORATIONS,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Fh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),tBe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new oe(n,o),tBe)}if(Fh.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const r=e.getLineWidth(n),a=zde(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(n,1),a)}const o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=o){const r=zde(t.mouseContentHorizontalOffset-o),a=new oe(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===ST.Content?Dd.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Fh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Fh.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new oe(n,o))}}return null}static _hitTestScrollbar(e,t){if(Fh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Dd._getMouseColumn(n,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const b=zde(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(n,b)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const b=e.visibleRangeForPosition(r,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(ab.offset-w.offset);const f=t.pos.toClientCoordinates(ct(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let b=1;bo)){const a=Math.floor((n+o)/2);let c=t.pos.y+(a-t.mouseVerticalOffset);c<=t.editorPos.y&&(c=t.editorPos.y+1),c>=t.editorPos.y+t.editorPos.height&&(c=t.editorPos.y+t.editorPos.height-1);const l=new jre(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(ct(e.viewDomNode)));if(d.type===ST.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=vM(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=rmt(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new yE;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===dS.CLASS_NAME?H0.createFromDOMInfo(e,r,n.startOffset):new yE(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===dS.CLASS_NAME?H0.createFromDOMInfo(e,o,o.textContent.length):new yE(o)}return new yE}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===dS.CLASS_NAME?H0.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new yE(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===dS.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return H0.createFromDOMInfo(e,c,0)}else if(a===dS.CLASS_NAME)return H0.createFromDOMInfo(e,i.offsetNode,0)}return new yE(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Q8.atomicPosition(i,e.column-1,n,iD.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new yE;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))),i.type===ST.Content){const n=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,Io.None);(n||!o.equals(i.position))&&(i=new pqe(o,i.spanNode,n))}return i}}function rmt(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=ct(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),c=r.getComputedStyle(n,null).getPropertyValue("font-variant"),l=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),h=r.getComputedStyle(n,null).getPropertyValue("line-height"),u=r.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=n.innerText;let m=o.left,v=0,b;if(e>o.left+o.width)v=p.length;else{const w=Qpe.getInstance();for(let y=0;y{t.add(ue(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(ue(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(ue(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:si,disposables:this._store}))}static addTarget(e){if(!zl.isTouchDevice())return V.None;zl.INSTANCE||(zl.INSTANCE=A2(new zl));const t=zl.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!zl.isTouchDevice())return V.None;zl.INSTANCE||(zl.INSTANCE=A2(new zl));const t=zl.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in si||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=zl.HOLD_DELAY&&Math.abs(c.initialPageX-Cg(c.rollingPageX))<30&&Math.abs(c.initialPageY-Cg(c.rollingPageY))<30){const d=this.newGestureEvent(uo.Contextmenu,c.initialTarget);d.pageX=Cg(c.rollingPageX),d.pageY=Cg(c.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=Cg(c.rollingPageX),h=Cg(c.rollingPageY),u=Cg(c.rollingTimestamps)-c.rollingTimestamps[0],f=d-c.rollingPageX[0],p=h-c.rollingPageY[0],m=[...this.targets].filter(v=>c.initialTarget instanceof Node&&v.contains(c.initialTarget));this.inertia(e,m,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(p)/u,p>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(uo.End,c.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===uo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>zl.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===uo.Change||e.type===uo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,o,r,a,c,l){this.handle=Ll(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;n+=zl.SCROLL_FRICTION*h,a+=zl.SCROLL_FRICTION*h,n>0&&(p=!1,u=o*n*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(uo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,n,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};zl.SCROLL_FRICTION=-.005,zl.HOLD_DELAY=700,zl.CLEAR_TAP_COUNT_TIME=400;let fd=zl;function amt(s,e,t){let i=0;for(let o=0;o!0,lmt=()=>!1,dmt=s=>s===" "||s===" ";class rP{static shouldRecreate(e){return e.hasChanged(x.layoutInfo)||e.hasChanged(x.wordSeparators)||e.hasChanged(x.emptySelectionClipboard)||e.hasChanged(x.multiCursorMergeOverlapping)||e.hasChanged(x.multiCursorPaste)||e.hasChanged(x.multiCursorLimit)||e.hasChanged(x.autoClosingBrackets)||e.hasChanged(x.autoClosingComments)||e.hasChanged(x.autoClosingQuotes)||e.hasChanged(x.autoClosingDelete)||e.hasChanged(x.autoClosingOvertype)||e.hasChanged(x.autoSurround)||e.hasChanged(x.useTabStops)||e.hasChanged(x.fontInfo)||e.hasChanged(x.readOnly)||e.hasChanged(x.wordSegmenterLocales)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(x.layoutInfo),a=o.get(x.fontInfo);this.readOnly=o.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(x.useTabStops),this.wordSeparators=o.get(x.wordSeparators),this.emptySelectionClipboard=o.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=o.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=o.get(x.multiCursorPaste),this.multiCursorLimit=o.get(x.multiCursorLimit),this.autoClosingBrackets=o.get(x.autoClosingBrackets),this.autoClosingComments=o.get(x.autoClosingComments),this.autoClosingQuotes=o.get(x.autoClosingQuotes),this.autoClosingDelete=o.get(x.autoClosingDelete),this.autoClosingOvertype=o.get(x.autoClosingOvertype),this.autoSurround=o.get(x.autoSurround),this.autoIndent=o.get(x.autoIndent),this.wordSegmenterLocales=o.get(x.wordSegmenterLocales),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=E1(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return HTe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return dmt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return cmt;case"never":return lmt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return qa.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=qa.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(nr?r:n}}let Rn=class mqe{static fromModelState(e){return new hmt(e)}static fromViewState(e){return new umt(e)}static fromModelSelection(e){const t=dt.liftSelection(e),i=new El(F.fromPositions(t.getSelectionStart()),Vh.Simple,0,t.getPosition(),0);return mqe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,l=n>r,d=nr||bn||v0&&n--,U0.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=o;c<=r;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new oe(c,l));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-q6e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new oe(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Q8.atomicPosition(o,t.column-1,i,iD.Left);if(r!==-1&&r+1>=n)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?As.leftPositionAtomicSoftTabs(t,i,e.tabSize):As.leftPosition(t,i);return new $de(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(As.clipPositionColumn(c,t),Io.Left),d=As.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,As.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-qa.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),c!==void 0){const p=new oe(i,n),m=t.normalizePosition(p,c);o=o+(n-m.column),i=m.lineNumber,n=m.column}return new $de(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a,Io.RightOfInjectedText)}static moveDown(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=As.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),Io.None).lineNumber>r)break;while(c++<10&&r+c1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=n.get(f);if(!p)return!1;if(Ok(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const b of p)b.open===f&&b.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let b=!1;for(let w=0,y=a.length;w1){const o=t.getLineContent(n.lineNumber),r=kh(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const c=i.visibleColumnFromColumn(t,n),l=qa.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,l);return new F(n.lineNumber,d,n.lineNumber,n.column)}}return F.fromPositions(yM.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=wat(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new oe(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let o=null;i.sort((r,a)=>oe.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&o?.endLineNumber!==l.lineNumber?(d=l.lineNumber-1,h=t.getLineMaxColumn(l.lineNumber-1),u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber)):(d=l.lineNumber,h=1,u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber));const p=new F(d,h,u,f);o=p,p.isEmpty()?n[r]=null:n[r]=new td(p,"")}else n[r]=null;else n[r]=new td(c,"")}return new tg(sr.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Oi;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(Oi||(Oi={}));var xr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Separator=2]="Separator"})(xr||(xr={}));var gs;(function(s){s[s.WordStart=0]="WordStart",s[s.WordStartFast=1]="WordStartFast",s[s.WordEnd=2]="WordEnd",s[s.WordAccessibility=3]="WordAccessibility"})(gs||(gs={}));class hs{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:xr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=xr.None;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,c);if(c===zr.Regular){if(n===xr.Separator)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Regular}else if(c===zr.WordSeparator){if(n===xr.Regular)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Separator}else if(c===zr.Whitespace&&n!==xr.None)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==xr.None?this._createWord(e,n,zr.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===zr.Whitespace||i===xr.Regular&&c===zr.WordSeparator||i===xr.Separator&&c===zr.Regular)return r+1}return 0}static moveWordLeft(e,t,i,n,o){let r=i.lineNumber,a=i.column;a===1&&r>1&&(r=r-1,a=t.getLineMaxColumn(r));let c=hs._findPreviousWordOnLine(e,t,new oe(r,a));if(n===gs.WordStart)return new oe(r,c?c.start+1:1);if(n===gs.WordStartFast)return!o&&c&&c.wordType===xr.Separator&&c.end-c.start===1&&c.nextCharClass===zr.Regular&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.start+1:1);if(n===gs.WordAccessibility){for(;c&&c.wordType===xr.Separator;)c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1));return new oe(r,c?c.start+1:1)}return c&&a<=c.end+1&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new oe(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a===B.Underline&&c!==B.Underline)return new oe(i,r);if(a===B.Dash&&c!==B.Dash)return new oe(i,r);if((bx(a)||wG(a))&&Ow(c))return new oe(i,r);if(Ow(a)&&Ow(c)&&r+1=c.start+1&&(c=hs._findNextWordOnLine(e,t,new oe(o,c.end+1))),c?r=c.start+1:r=t.getLineMaxColumn(o);return new oe(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(c--,l=n.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=hs._findPreviousWordOnLine(i,n,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=n.getLineMaxColumn(c))),new F(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===B.Space||i===B.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new F(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new F(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,f)},l=hs._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=hs._findNextWordOnLine(e,t,i);return d&&r(d)?c(d):l&&d?a(l.end+1,d.start+1):l?a(l.start+1,l.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=hs._moveWordPartLeft(e,i);return new F(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=u.start+1&&(u=hs._findNextWordOnLine(i,n,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class bl{static addCursorDown(e,t,i){const n=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),Rn.fromModelState(new El(new F(r.lineNumber,1,d,h),Vh.Line,0,new oe(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),Rn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return Rn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Rn.fromModelState(hs.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Rn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Rn.fromViewState(new El(new F(i,n,i,n),Vh.Simple,0,new oe(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(t.modelState.selectionStartKind===Vh.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===Vh.Line)return this.line(e,t,i,n,o)}const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Rn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case Mi.Direction.Left:return r===Mi.Unit.HalfLine?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case Mi.Direction.Right:return r===Mi.Unit.HalfLine?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case Mi.Direction.Up:return r===Mi.Unit.WrappedLine?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case Mi.Direction.Down:return r===Mi.Unit.WrappedLine?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case Mi.Direction.PrevBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.NextBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case Mi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case Mi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Mi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:oRn.fromViewState(As.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,r=t.length;oRn.fromViewState(As.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,r=t.length;o{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return dR(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),s=dR(i,e.startColumn-1),o=lh.createEmpty("",s.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(s.firstCharOffset===0))return o;const l=t(r);if(!(s.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class RKe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=Uo(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const s=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(s).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===Ar.String||c===Ar.RegEx||c===Ar.Comment,i=e.getLanguageId(0),o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(o,""));const h=e.getMetadata(c);r.push({text:d,metadata:h})}),lh.createFromTextAndMetadata(r,e.languageIdCodec)}}function HMe(n,e){n.tokenization.forceTokenization(e.lineNumber);const t=n.tokenization.getLineTokens(e.lineNumber),i=dR(t,e.column-1),s=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!s&&!o}function LW(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const s=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(s);if(!o)return null;const a=new WMe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(n,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===qa.Indent&&(f=" "+f):u===qa.Indent||u===qa.IndentOutdent?f=" ":f="";let m=Qje(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var sJ;const efe=Object.create(null);function wL(n,e){if(e<=0)return"";efe[n]||(efe[n]=["",n]);const t=efe[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let u_=sJ=class{static unshiftIndent(e,t,i,s,o){const r=Ic.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=Ic.prevIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=Ic.prevRenderTabStop(r,i)/i;return wL(a,l)}}static shiftIndent(e,t,i,s,o){const r=Ic.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=Ic.nextIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=Ic.nextRenderTabStop(r,i)/i;return wL(a,l)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let h=i;h<=s;h++,l=d){d=0;const u=e.getLineContent(h);let f=Eu(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!c&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&Ic.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=LW(this._opts.autoIndent,e,new O(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let w=0,b=v.appendText.length;w1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(s)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function cde(n,e,t,i=!0,s){if(n0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=Cvt(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:qa.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:null,line:a}}else{if(a===1)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(Pb.INCREASE_MASK|Pb.DECREASE_MASK))&&l&Pb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:Uo(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:Uo(e.getLineContent(d)),action:qa.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:Uo(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Uo(e.getLineContent(d)),action:null,line:d}}return{indentation:Uo(e.getLineContent(1)),action:null,line:1}}}function w$(n,e,t,i,s,o){if(nn.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function Avt(n,e,t){return{tokenization:{getLineTokens:s=>s===e?t:n.tokenization.getLineTokens(s),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(s,o)=>n.getLanguageIdAtPosition(s,o)},getLineContent:s=>s===e?t.getLineContent():n.getLineContent(s)}}class Zr{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Zv(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=LW(e.autoIndent,t,new O(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return s&&(s===qa.Indent&&(o=Zr.shiftIndent(e,o)),s===qa.Outdent&&(o=Zr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),c=e.indentSize,l=c-a%c;for(let d=0;dthis._compositionType(i,d,o,r,a,c));return new Lg(Cr.TypingOther,l,{shouldPushStackElementBefore:Mj(e,Cr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-s),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new O(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new nJ(d,i,0,r)}static _typeCommand(e,t,i){return i?new Tj(e,t,!0):new zd(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===ed.None)return Zr._typeCommand(s,` -`,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===ed.Keep){const c=t.getLineContent(s.startLineNumber),l=Uo(c).substring(0,s.startColumn-1);return Zr._typeCommand(s,` -`+e.normalizeIndentation(l),i)}const o=LW(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===qa.None)return Zr._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===qa.Indent)return Zr._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===qa.IndentOutdent){const c=e.normalizeIndentation(o.indentation),l=e.normalizeIndentation(o.indentation+o.appendText),d=` + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},s.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},s.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(o){if(!o.to)return null;let r;switch(o.to){case s.RawDirection.Left:r=i.Left;break;case s.RawDirection.Right:r=i.Right;break;case s.RawDirection.Up:r=i.Up;break;case s.RawDirection.Down:r=i.Down;break;case s.RawDirection.PrevBlankLine:r=i.PrevBlankLine;break;case s.RawDirection.NextBlankLine:r=i.NextBlankLine;break;case s.RawDirection.WrappedLineStart:r=i.WrappedLineStart;break;case s.RawDirection.WrappedLineFirstNonWhitespaceCharacter:r=i.WrappedLineFirstNonWhitespaceCharacter;break;case s.RawDirection.WrappedLineColumnCenter:r=i.WrappedLineColumnCenter;break;case s.RawDirection.WrappedLineEnd:r=i.WrappedLineEnd;break;case s.RawDirection.WrappedLineLastNonWhitespaceCharacter:r=i.WrappedLineLastNonWhitespaceCharacter;break;case s.RawDirection.ViewPortTop:r=i.ViewPortTop;break;case s.RawDirection.ViewPortBottom:r=i.ViewPortBottom;break;case s.RawDirection.ViewPortCenter:r=i.ViewPortCenter;break;case s.RawDirection.ViewPortIfOutside:r=i.ViewPortIfOutside;break;default:return null}let a=n.None;switch(o.by){case s.RawUnit.Line:a=n.Line;break;case s.RawUnit.WrappedLine:a=n.WrappedLine;break;case s.RawUnit.Character:a=n.Character;break;case s.RawUnit.HalfLine:a=n.HalfLine;break}return{direction:r,unit:a,select:!!o.select,value:o.value||1}}s.parse=t;let i;(function(o){o[o.Left=0]="Left",o[o.Right=1]="Right",o[o.Up=2]="Up",o[o.Down=3]="Down",o[o.PrevBlankLine=4]="PrevBlankLine",o[o.NextBlankLine=5]="NextBlankLine",o[o.WrappedLineStart=6]="WrappedLineStart",o[o.WrappedLineFirstNonWhitespaceCharacter=7]="WrappedLineFirstNonWhitespaceCharacter",o[o.WrappedLineColumnCenter=8]="WrappedLineColumnCenter",o[o.WrappedLineEnd=9]="WrappedLineEnd",o[o.WrappedLineLastNonWhitespaceCharacter=10]="WrappedLineLastNonWhitespaceCharacter",o[o.ViewPortTop=11]="ViewPortTop",o[o.ViewPortCenter=12]="ViewPortCenter",o[o.ViewPortBottom=13]="ViewPortBottom",o[o.ViewPortIfOutside=14]="ViewPortIfOutside"})(i=s.Direction||(s.Direction={}));let n;(function(o){o[o.None=0]="None",o[o.Line=1]="Line",o[o.WrappedLine=2]="WrappedLine",o[o.Character=3]="Character",o[o.HalfLine=4]="HalfLine"})(n=s.Unit||(s.Unit={}))})(Mi||(Mi={}));class VTe{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new _qe(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class zTe{constructor(e,t){this.model=e,this.indentationLineProcessor=new _qe(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=E1(t,e.startColumn-1);let n;if($Te(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,c=a+r;n=t.sliceAndInflate(a,c,0)}else{const r=e.startColumn-1;n=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=E1(i,t.column-1),o=t.column-1-n.firstCharOffset,r=n.firstCharOffset+o,a=n.firstCharOffset+n.getLineLength(),c=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(c)}_getProcessedPreviousLineTokens(e){const t=f=>{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return E1(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=E1(i,e.startColumn-1),o=gd.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return o;const l=t(r);if(!(n.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class _qe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=ho(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===nr.String||c===nr.RegEx||c===nr.Comment,i=e.getLanguageId(0),o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(o,""));const h=e.getMetadata(c);r.push({text:d,metadata:h})}),gd.createFromTextAndMetadata(r,e.languageIdCodec)}}function $Te(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=E1(t,e.column-1),n=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!n&&!o}function PO(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(n);if(!o)return null;const a=new zTe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(s,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===yr.Indent&&(f=" "+f):u===yr.Indent||u===yr.IndentOutdent?f=" ":f="";let m=DKe(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var kq;const Gde=Object.create(null);function PI(s,e){if(e<=0)return"";Gde[s]||(Gde[s]=["",s]);const t=Gde[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let _m=kq=class{static unshiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=PI(" ",n),l=qa.prevIndentTabStop(r,n)/n;return PI(a,l)}else{const a=" ",l=qa.prevRenderTabStop(r,i)/i;return PI(a,l)}}static shiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=PI(" ",n),l=qa.nextIndentTabStop(r,n)/n;return PI(a,l)}else{const a=" ",l=qa.nextRenderTabStop(r,i)/i;return PI(a,l)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let h=i;h<=n;h++,l=d){d=0;const u=e.getLineContent(h);let f=kh(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!c&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&qa.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=PO(this._opts.autoIndent,e,new F(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let b=0,w=v.appendText.length;b1){let n,o=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return o;const r=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){o=n;continue}return n}}return-1}function j8(s,e,t,i=!0,n){if(s0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=mmt(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:ho(c),action:yr.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:ho(c),action:null,line:a}}else{if(a===1)return{indentation:ho(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(mb.INCREASE_MASK|mb.DECREASE_MASK))&&l&mb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:ho(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ho(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:ho(e.getLineContent(d)),action:yr.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:ho(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:ho(e.getLineContent(d)),action:null,line:d}}return{indentation:ho(e.getLineContent(1)),action:null,line:1}}}function a5(s,e,t,i,n,o){if(s0){const b=e.getLineContent(v);if(l.shouldIndentNextLine(b)&&l.shouldIncrease(m)){const y=j8(r,e,t.startLineNumber,!1,o)?.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),A=ho(C),k=n.shiftIndent(y)===A,P=/^\s*$/.test(p),R=s.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),G=R&&R.length>0&&P;if(k&&G)return y}}}return null}function vqe(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function bmt(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,o)=>s.getLanguageIdAtPosition(n,o)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class wmt{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){const r=[];for(const c of i){const l=this._findActualIndentationForSelection(e,t,c,n);if(l===null)return;r.push({selection:c,indentation:l})}const a=jpe.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,r,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndenttae(e,a),unshiftIndent:a=>Y8(e,a)},e.languageConfigurationService);if(o===null)return null;const r=DKe(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(r)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){const r=i.map(({selection:c,indentation:l})=>{if(o!==null){const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!1);return new Lmt(d,c,n,o)}else{const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!0);return t0(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new tg(sr.TypingOther,r,a)}static _getEditFromIndentationAndSelection(e,t,i,n,o,r=!0){const a=n.startLineNumber,c=t.getLineFirstNonWhitespaceColumn(a);let l=e.normalizeIndentation(i);if(c!==0){const h=t.getLineContent(a);l+=h.substring(c-1,n.startColumn-1)}return l+=r?o:"",{range:new F(a,1,n.endLineNumber,n.endColumn),text:l}}}class ymt{static getEdits(e,t,i,n,o,r){if(bqe(t,i,n,o,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let o=0,r=t.length;onew td(new F(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new tg(sr.TypingOther,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class jpe{static getEdits(e,t,i,n,o,r){if(!r){const a=this.getAutoClosingPairClose(e,t,i,n,o);if(a!==null)return this._runAutoClosingOpenCharType(i,n,o,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const o=[];for(let r=0,a=e.length;r{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(p=>new oe(p.lineNumber,p.beforeColumn)),n);if(!a)return null;let c,l;if(Ok(n)?(c=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(c=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(c=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),c==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let f=!0;for(const p of r){const{lineNumber:m,beforeColumn:v,afterColumn:b}=p,w=t.getLineContent(m),y=w.substring(0,v-1),C=w.substring(b-1);if(C.startsWith(u)||(f=!1),C.length>0){const P=C.charAt(0);if(!this._isBeforeClosingBrace(e,C)&&!l(P))return null}if(a.open.length===1&&(n==="'"||n==='"')&&c!=="always"){const P=fm(e.wordSeparators,[]);if(y.length>0){const R=y.charCodeAt(y.length-1);if(P.get(R)===zr.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const A=t.tokenization.getLineTokens(m),L=E1(A,v-1);if(!a.shouldAutoClose(L,v-L.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const P=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(P))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let c=!0;for(const l of i)if(t.getValueInRange(new F(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+n!==a.open){c=!1;break}c&&(r=a)}return r}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(c=>t.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}}class Smt{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let o=0,r=t.length;o=ed.Full){const c=yvt(e.autoIndent,t,s,{unshiftIndent:l=>Zr.unshiftIndent(e,l),shiftIndent:l=>Zr.shiftIndent(e,l),normalizeIndentation:l=>e.normalizeIndentation(l)},e.languageConfigurationService);if(c){let l=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,h=t.getLineContent(s.endLineNumber),u=Eu(h);if(u>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,u+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new Tj(s,` -`+e.normalizeIndentation(c.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(l=Math.ceil(l/e.indentSize)),f=Math.min(l+1-e.normalizeIndentation(c.afterEnter).length-1,0)),new nJ(s,` -`+e.normalizeIndentation(c.afterEnter),0,f,!0)}}}return Zr._typeCommand(s,` -`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndentZr.shiftIndent(e,a),unshiftIndent:a=>Zr.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(l.column-2):Q.Null)===Q.Backslash&&u)return!1;if(e.autoClosingOvertype==="auto"){let p=!1;for(let m=0,v=s.length;mt.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let c=!0;for(const l of i)if(t.getValueInRange(new O(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+s!==a.open){c=!1;break}c&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const p of i)if(!p.isEmpty())return null;const r=i.map(p=>{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-s.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(p=>new oe(p.lineNumber,p.beforeColumn)),s);if(!a)return null;let c,l;if(kD(s)?(c=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(c=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(c=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),c==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let f=!0;for(const p of r){const{lineNumber:m,beforeColumn:v,afterColumn:w}=p,b=t.getLineContent(m),C=b.substring(0,v-1),y=b.substring(w-1);if(y.startsWith(u)||(f=!1),y.length>0){const F=y.charAt(0);if(!Zr._isBeforeClosingBrace(e,y)&&!l(F))return null}if(a.open.length===1&&(s==="'"||s==='"')&&c!=="always"){const F=R_(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(F.get(N)===da.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const S=t.tokenization.getLineTokens(m),M=dR(S,v-1);if(!a.shouldAutoClose(M,v-M.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const F=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(F))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const c=[];for(let l=0,d=s.length;lnew zd(new O(u.positionLineNumber,u.positionColumn,u.positionLineNumber,u.positionColumn+1),"",!1));return new Lg(Cr.TypingOther,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,c,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,c,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` -`){const d=[];for(let h=0,u=o.length;h{const s=t.get(jt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=xl();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(jt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var mS;(function(n){n[n.Regular=0]="Regular",n[n.Minimal=1]="Minimal",n[n.None=2]="None"})(mS||(mS={}));var Ul;(function(n){class e extends Sa{constructor(C){super(C),this._inSelectionMode=C.inSelectionMode}runCoreEditorCommand(C,y){if(!y.position)return;C.model.pushStackElement(),C.setCursorStates(y.source,Hi.Explicit,[ud.moveTo(C,C.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==mS.None&&C.revealAllCursors(y.source,!0,!0)}}n.MoveTo=Ke(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Ke(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Sa{runCoreEditorCommand(C,y){C.model.pushStackElement();const S=this._getColumnSelectResult(C,C.getPrimaryCursorState(),C.getCursorColumnSelectData(),y);S!==null&&(C.setCursorStates(y.source,Hi.Explicit,S.viewStates.map(M=>zn.fromViewState(M))),C.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?C.revealTopMostCursor(y.source):C.revealBottomMostCursor(y.source))}}n.ColumnSelect=Ke(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,C,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const M=b.model.validatePosition(S.position),k=b.coordinatesConverter.validateViewPosition(new oe(S.viewPosition.lineNumber,S.viewPosition.column),M),F=S.doColumnSelect?y.fromViewLineNumber:k.lineNumber,N=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return ST.columnSelect(b.cursorConfig,b,F,N,k.lineNumber,S.mouseColumn-1)}}),n.CursorColumnSelectLeft=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectLeft(b.cursorConfig,b,y)}}),n.CursorColumnSelectRight=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectRight(b.cursorConfig,b,y)}});class i extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectUp(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectUp=Ke(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.UpArrow,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Ke(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageUp,linux:{primary:0}}}));class s extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectDown(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectDown=Ke(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.DownArrow,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Ke(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageDown,linux:{primary:0}}}));class o extends Sa{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Wi.metadata})}runCoreEditorCommand(C,y){const S=Wi.parse(y);S&&this._runCursorMove(C,y.source,S)}_runCursorMove(C,y,S){C.model.pushStackElement(),C.setCursorStates(y,Hi.Explicit,o._move(C,C.getCursorStates(),S)),C.revealAllCursors(y,!0)}static _move(C,y,S){const M=S.select,k=S.value;switch(S.direction){case Wi.Direction.Left:case Wi.Direction.Right:case Wi.Direction.Up:case Wi.Direction.Down:case Wi.Direction.PrevBlankLine:case Wi.Direction.NextBlankLine:case Wi.Direction.WrappedLineStart:case Wi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Wi.Direction.WrappedLineColumnCenter:case Wi.Direction.WrappedLineEnd:case Wi.Direction.WrappedLineLastNonWhitespaceCharacter:return ud.simpleMove(C,y,S.direction,M,k,S.unit);case Wi.Direction.ViewPortTop:case Wi.Direction.ViewPortBottom:case Wi.Direction.ViewPortCenter:case Wi.Direction.ViewPortIfOutside:return ud.viewportMove(C,y,S.direction,M,k);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Ke(new o);let r;(function(b){b[b.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends Sa{constructor(C){super(C),this._staticArgs=C.args}runCoreEditorCommand(C,y){let S=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||C.cursorConfig.pageSize}),C.model.pushStackElement(),C.setCursorStates(y.source,Hi.Explicit,ud.simpleMove(C,C.getCursorStates(),S.direction,S.select,S.value,S.unit)),C.revealAllCursors(y.source,!0)}}n.CursorLeft=Ke(new a({args:{direction:Wi.Direction.Left,unit:Wi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.LeftArrow,mac:{primary:E.LeftArrow,secondary:[V.WinCtrl|E.KeyB]}}})),n.CursorLeftSelect=Ke(new a({args:{direction:Wi.Direction.Left,unit:Wi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.LeftArrow}})),n.CursorRight=Ke(new a({args:{direction:Wi.Direction.Right,unit:Wi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.RightArrow,mac:{primary:E.RightArrow,secondary:[V.WinCtrl|E.KeyF]}}})),n.CursorRightSelect=Ke(new a({args:{direction:Wi.Direction.Right,unit:Wi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.RightArrow}})),n.CursorUp=Ke(new a({args:{direction:Wi.Direction.Up,unit:Wi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.UpArrow,mac:{primary:E.UpArrow,secondary:[V.WinCtrl|E.KeyP]}}})),n.CursorUpSelect=Ke(new a({args:{direction:Wi.Direction.Up,unit:Wi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow],mac:{primary:V.Shift|E.UpArrow},linux:{primary:V.Shift|E.UpArrow}}})),n.CursorPageUp=Ke(new a({args:{direction:Wi.Direction.Up,unit:Wi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageUp}})),n.CursorPageUpSelect=Ke(new a({args:{direction:Wi.Direction.Up,unit:Wi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageUp}})),n.CursorDown=Ke(new a({args:{direction:Wi.Direction.Down,unit:Wi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.DownArrow,mac:{primary:E.DownArrow,secondary:[V.WinCtrl|E.KeyN]}}})),n.CursorDownSelect=Ke(new a({args:{direction:Wi.Direction.Down,unit:Wi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow],mac:{primary:V.Shift|E.DownArrow},linux:{primary:V.Shift|E.DownArrow}}})),n.CursorPageDown=Ke(new a({args:{direction:Wi.Direction.Down,unit:Wi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageDown}})),n.CursorPageDownSelect=Ke(new a({args:{direction:Wi.Direction.Down,unit:Wi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageDown}})),n.CreateCursor=Ke(new class extends Sa{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,C){if(!C.position)return;let y;C.wholeLine?y=ud.line(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition):y=ud.moveTo(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition);const S=b.getCursorStates();if(S.length>1){const M=y.modelState?y.modelState.position:null,k=y.viewState?y.viewState.position:null;for(let F=0,N=S.length;Fk&&(M=k);const F=new O(M,1,M,b.model.getLineMaxColumn(M));let N=Ns.Simple;if(y.at)switch(y.at){case XB.RawAtArgument.Top:N=Ns.Top;break;case XB.RawAtArgument.Center:N=Ns.Center;break;case XB.RawAtArgument.Bottom:N=Ns.Bottom;break}const z=b.coordinatesConverter.convertModelRangeToViewRange(F);b.revealRange(C.source,!1,z,N,vt.Smooth)}}),n.SelectAll=new class extends lwe{constructor(){super(Rgt)}runDOMCommand(b){pp&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,C,y){const S=C._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(b,C){b.model.pushStackElement(),b.setCursorStates("keyboard",Hi.Explicit,[ud.selectAll(b,b.getPrimaryCursorState())])}},n.SetSelection=Ke(new class extends Sa{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,C){C.selection&&(b.model.pushStackElement(),b.setCursorStates(C.source,Hi.Explicit,[zn.fromModelSelection(C.selection)]))}})})(Ul||(Ul={}));const xvt=ge.and(X.textInputFocus,X.columnSelection);function wz(n,e){xr.registerKeybindingRule({id:n,primary:e,when:xvt,weight:fs+1})}wz(Ul.CursorColumnSelectLeft.id,V.Shift|E.LeftArrow);wz(Ul.CursorColumnSelectRight.id,V.Shift|E.RightArrow);wz(Ul.CursorColumnSelectUp.id,V.Shift|E.UpArrow);wz(Ul.CursorColumnSelectPageUp.id,V.Shift|E.PageUp);wz(Ul.CursorColumnSelectDown.id,V.Shift|E.DownArrow);wz(Ul.CursorColumnSelectPageDown.id,V.Shift|E.PageDown);function SWe(n){return n.register(),n}var TW;(function(n){class e extends Jc{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Ke(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:X.writable,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyO}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Ke(new class extends e{constructor(){super({id:"outdent",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:V.Shift|E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Ke(new class extends e{constructor(){super({id:"tab",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Ke(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Backspace,secondary:[V.Shift|E.Backspace],mac:{primary:E.Backspace,secondary:[V.Shift|E.Backspace,V.WinCtrl|E.KeyH,V.WinCtrl|E.Backspace]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingLeft)}}),n.DeleteRight=Ke(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Delete,mac:{primary:E.Delete,secondary:[V.WinCtrl|E.KeyD,V.WinCtrl|E.Delete]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingRight)}}),n.Undo=new class extends lwe{constructor(){super(Eje)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},n.Redo=new class extends lwe{constructor(){super(xje)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(TW||(TW={}));class AWe extends Jle{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(jt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function gO(n,e){SWe(new AWe("default:"+n,n)),SWe(new AWe(n,n,e))}gO(Uc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});gO(Uc.ReplacePreviousChar);gO(Uc.CompositionType);gO(Uc.CompositionStart);gO(Uc.CompositionEnd);gO(Uc.Paste);gO(Uc.Cut);let wg=class extends ${onclick(e,t){this._register(pe(e,xe.CLICK,i=>t(new yu(gt(e),i))))}onmousedown(e,t){this._register(pe(e,xe.MOUSE_DOWN,i=>t(new yu(gt(e),i))))}onmouseover(e,t){this._register(pe(e,xe.MOUSE_OVER,i=>t(new yu(gt(e),i))))}onmouseleave(e,t){this._register(pe(e,xe.MOUSE_LEAVE,i=>t(new yu(gt(e),i))))}onkeydown(e,t){this._register(pe(e,xe.KEY_DOWN,i=>t(new os(i))))}onkeyup(e,t){this._register(pe(e,xe.KEY_UP,i=>t(new os(i))))}oninput(e,t){this._register(pe(e,xe.INPUT,t))}onblur(e,t){this._register(pe(e,xe.BLUR,t))}onfocus(e,t){this._register(pe(e,xe.FOCUS,t))}onchange(e,t){this._register(pe(e,xe.CHANGE,t))}ignoreGesture(e){return dh.ignoreTarget(e)}};const GU=11;class Dvt extends wg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...$e.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=GU+"px",this.domNode.style.height=GU+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new vz),this._register(Xo(this.bgDomNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Xo(this.domNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new sQ),this._pointerdownScheduleRepeatTimer=this._register(new O_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,gt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class kvt extends ${constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new O_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===zo.Hidden?!1:this._visibility===zo.Visible?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Ivt=140;class PKe extends wg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new kvt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new vz),this._shouldRender=!0,this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(pe(this.domNode.domNode,xe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Dvt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ks(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(pe(this.slider.domNode,xe.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=ia(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Is&&a>Ivt){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Lvt=20;class qU{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new qU(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=s>0&&s>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(Lvt,Math.floor(i*a/s))),d=(a-l)/(s-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=qU._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new aF(null,1,0))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new aF(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===zo.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Rvt extends PKe{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new qU(t.verticalHasArrows?t.arrowSize:0,t.vertical===zo.Hidden?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-GU)/2,a=(t.verticalScrollbarSize-GU)/2;this._createArrow({className:"scra",icon:Ce.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,1))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Mvt=".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{background:transparent;opacity:1;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{display:none;position:absolute}.monaco-scrollable-element>.shadow.top{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;display:block;height:3px;left:3px;top:0;width:100%}.monaco-scrollable-element>.shadow.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;display:block;height:100%;left:0;top:3px;width:3px}.monaco-scrollable-element>.shadow.top-left-corner{display:block;height:3px;left:0;top:0;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}";Ct(Mvt,{});const Nvt=500,EWe=50;class Pvt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const hae=class hae{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,s=this._rear;do{const o=s===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(eQ){const t=gt(e.browserEvent),i=xht(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let s=null;const o=new Pvt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,s)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const s=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(s,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(s,r),h=Math.max(o,a);d%c===0&&h%l===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};hae.INSTANCE=new hae;let FZ=hae;class UMe extends wg{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new I),this.onWillScroll=this._onWillScroll.event,e.style.overflow="hidden",this._options=Fvt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Rvt(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Tvt(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ks(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ks(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ks(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new O_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=St(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ei&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new aF(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=St(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new aF(s))};this._mouseWheelToDispose.push(pe(this._listenOnDomNode,xe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=FZ.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+o===0?r=o=0:Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!ei&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(o){const d=EWe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=EWe*r,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Nvt)}}class FKe extends UMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class hQ extends UMe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class bz extends UMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function Fvt(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:zo.Auto,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:zo.Auto,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,ei&&(e.className+=" mac"),e}class VMe extends dQ{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new ru(this._context,i),this._mouseDownOperation=this._register(new Ovt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const s=new B_t(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=pe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new f1(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(pe(this.viewHelper.viewDomNode,xe.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=FZ.INSTANCE;let t=0,i=d_.getZoomLevel(),s=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new aF(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=d_.getZoomLevel(),h=l.deltaY>0?1:-1;d_.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=d_.getZoomLevel(),s=a(c),o=0),t=Date.now(),o+=l.deltaY,s&&(d_.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(pe(this.viewHelper.viewDomNode,xe.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return ei?(c.metaKey||c.ctrlKey)&&!c.shiftKey&&!c.altKey:c.ctrlKey&&!c.metaKey&&!c.shiftKey&&!c.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(x.layoutInfo)){const t=this._context.configuration.options.get(x.layoutInfo).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new xKe(e,t).toPageCoordinates(gt(this.viewHelper.viewDomNode)),o=MMe(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=NMe(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=cF(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(c){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}_onMouseWheel(e){this.viewController.emitMouseWheel(e)}}class Ovt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new H_t(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Bvt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new dwe,this._currentSelection=new mt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===Mt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,mS.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Mt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(x.readOnly)&&o.get(x.dragAndDrop)&&!o.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===Mt.CONTENT_TEXT&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);Sv(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,mS.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=s.getCurrentScrollTop()+e.relativePos.y,l=$U.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return hu.createOutsideEditor(o,h,"below",a)}const d=s.getLineNumberAtVerticalOffset(c);return hu.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return hu.createOutsideEditor(o,new oe(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===Mt.CONTENT_VIEW_ZONE||s.type===Mt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return hu.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===Mt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Bvt extends ${constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Wvt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Wvt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=xd(gt(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(x.lineHeight),t=this._context.configuration.options.get(x.layoutInfo).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(x.lineHeight),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let c;{const l=MMe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new sde(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=NMe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,mS.None),this._animationFrameDisposable=xd(gt(c.element),()=>this._execute())}}const uae=class uae{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>uae.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};uae.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let dwe=uae;class oi{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}const B2=class B2{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new B2(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new B2(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const s=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,s,-1)}if(e>=this.selectionEnd){const s=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,s,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(LS(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(iZ(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,c=e.selectionEnd-s,l=t.selectionStart-s,d=t.selectionEnd-s;if(l===d){const u=e.selectionStart-s;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=c-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(LS(e.value,t.value),e.selectionEnd),s=Math.min(iZ(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}};B2.EMPTY=new B2("",0,0,null,void 0);let kh=B2;class ZB{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new O(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=ZB._getPageOfLine(t.startLineNumber,i),a=ZB._getRangeForPage(r,i),c=ZB._getPageOfLine(t.endLineNumber,i),l=ZB._getRangeForPage(c,i);let d=a.intersectRanges(new O(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,xo.LF)>500){const w=e.modifyPosition(d.getEndPosition(),-500);d=O.fromPositions(w,d.getEndPosition())}const h=e.getValueInRange(d,xo.LF),u=e.getLineCount(),f=e.getLineMaxColumn(u);let p=l.intersectRanges(new O(t.endLineNumber,t.endColumn,u,f));if(s&&e.getValueLengthInRange(p,xo.LF)>500){const w=e.modifyPosition(p.getStartPosition(),500);p=O.fromPositions(p.getStartPosition(),w)}const m=e.getValueInRange(p,xo.LF);let v;if(r===c||r+1===c)v=e.getValueInRange(t,xo.LF);else{const w=a.intersectRanges(t),b=l.intersectRanges(t);v=e.getValueInRange(w,xo.LF)+"…"+e.getValueInRange(b,xo.LF)}return s&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new kh(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var OZ;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(OZ||(OZ={}));const hwe={forceCopyWithSyntaxHighlighting:!1},gae=class gae{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};gae.INSTANCE=new gae;let Z9=gae;class Hvt{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let uwe=class extends ${get textAreaState(){return this._textAreaState}constructor(e,t,i,s,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new I),this.onCut=this._onCut.event,this._onPaste=this._register(new I),this.onPaste=this._onPaste.event,this._onType=this._register(new I),this.onType=this._onType.event,this._onCompositionStart=this._register(new I),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new I),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new I),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new I),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Dn),this._asyncTriggerCut=this._register(new yn(()=>this._onCut.fire(),0)),this._textAreaState=kh.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(T.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new yn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(c=>{const l=new os(c);(l.keyCode===E.KEY_IN_COMPOSITION||this._currentComposition&&l.keyCode===E.Backspace)&&l.stopPropagation(),l.equals(E.Escape)&&l.preventDefault(),a=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(c=>{const l=new os(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new Hvt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===Pr.Macintosh&&a&&a.equals(E.KEY_IN_COMPOSITION)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===c.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){l.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:c.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:c.data});return}this._onCompositionStart.fire({data:c.data})})),this._register(this._textArea.onCompositionUpdate(c=>{const l=this._currentComposition;if(!l)return;if(this._browser.isAndroid){const h=kh.readFromTextArea(this._textArea,this._textAreaState),u=kh.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=kh.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(c)})),this._register(this._textArea.onCompositionEnd(c=>{const l=this._currentComposition;if(!l)return;if(this._currentComposition=null,this._browser.isAndroid){const h=kh.readFromTextArea(this._textArea,this._textAreaState),u=kh.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=kh.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const l=kh.readFromTextArea(this._textArea,this._textAreaState),d=kh.deduceInput(this._textAreaState,l,this._OS===Pr.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(wl(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=l,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(c=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(c),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(c=>{this._ensureClipboardGetsEditorSelection(c)})),this._register(this._textArea.onPaste(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),c.preventDefault(),!c.clipboardData)return;let[l,d]=gwe.getTextData(c.clipboardData);l&&(d=d||Z9.INSTANCE.get(l),this._onPaste.fire({text:l,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const c=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!c&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new yn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_initializeFromTest(){this._hasFocus=!0,this._textAreaState=kh.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return pe(this._textArea.ownerDocument,"selectionchange",t=>{if(Hk.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),c=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===c)return;const l=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(c),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new mt(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Z9.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,i),e.preventDefault(),e.clipboardData&&gwe.setTextData(e.clipboardData,t.text,t.html,i)}};uwe=D([_(4,Ur),_(5,Ze)],uwe);const gwe={getTextData(n){const e=n.getData(Js.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Js.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class Uvt extends ${get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new oi(this._actual,"keydown")).event,this.onKeyPress=this._register(new oi(this._actual,"keypress")).event,this.onKeyUp=this._register(new oi(this._actual,"keyup")).event,this.onCompositionStart=this._register(new oi(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new oi(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new oi(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new oi(this._actual,"beforeinput")).event,this.onInput=this._register(new oi(this._actual,"input")).event,this.onCut=this._register(new oi(this._actual,"cut")).event,this.onCopy=this._register(new oi(this._actual,"copy")).event,this.onPaste=this._register(new oi(this._actual,"paste")).event,this.onFocus=this._register(new oi(this._actual,"focus")).event,this.onBlur=this._register(new oi(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Hk.onKeyDown())),this._register(this.onBeforeInput(()=>Hk.onBeforeInput())),this._register(this.onInput(()=>Hk.onInput())),this._register(this.onKeyUp(()=>Hk.onKeyUp())),this._register(pe(this._actual,OZ.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=cF(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?xl()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let o=null;const r=cF(s);r?o=r.activeElement:o=xl();const a=gt(o),c=o===s,l=s.selectionStart,d=s.selectionEnd;if(c&&l===t&&d===i){pp&&a.parent!==a&&s.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),pp&&a.parent!==a&&s.focus();return}try{const h=ngt(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),sgt(s,h)}catch{}}}class Vvt extends VMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,o=>this.onTap(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,o=>this.onChange(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,o=>this._onContextMenu(new f1(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(pe(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new W_t(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:mS.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Mt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class zvt extends VMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,s=>this.onTap(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,s=>this.onChange(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,s=>this._onContextMenu(new f1(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(OZ.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,mS.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class $vt extends ${constructor(e,t,i){super(),(I_||Zct&&sQe)&&sMe.pointerEvents?this.handler=this._register(new Vvt(e,t,i)):yi.TouchEvent?this.handler=this._register(new zvt(e,t,i)):this.handler=this._register(new VMe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Gvt=".monaco-editor .inputarea{background-color:transparent;border:none;color:transparent;margin:0;min-height:0;min-width:0;outline:none!important;overflow:hidden;padding:0;position:absolute;resize:none;z-index:-10}.monaco-editor .inputarea.ime-input{caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground);z-index:10}";Ct(Gvt,{});var qvt=".monaco-editor .margin-view-overlays .line-numbers{bottom:0;box-sizing:border-box;cursor:default;display:inline-block;font-variant-numeric:tabular-nums;position:absolute;text-align:right;vertical-align:middle}.monaco-editor .relative-current-line-number{display:inline-block;text-align:left;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}";Ct(qvt,{});class fO extends dQ{}function Nr(n){return{id:n}}function fwe(n){switch(n){case sf.DARK:return"vs-dark";case sf.HIGH_CONTRAST_DARK:return"hc-black";case sf.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const OKe={ThemingContribution:"base.contributions.theming"};class Qvt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new I}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ee(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}get onThemingParticipantAdded(){return this.onThemingParticipantAddedEmitter.event}getThemingParticipants(){return this.themingParticipants}}const BKe=new Qvt;it.add(OKe.ThemingContribution,BKe);function Lm(n){return BKe.onColorThemeChange(n)}class zMe extends ${constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}getColor(e,t){let i=this.theme.getColor(e);return i&&t&&(i=t(i,this.theme)),i?i.toString():null}}const Ci="vs/editor/common/core/editorColorRegistry",WKe=B("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,0,"Background color for the highlight of line at the cursor position.")),xWe=B("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ft},g(Ci,1,"Background color for the border around the line at the cursor position."));B("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(Ci,2,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,3,"Background color of the border around highlighted ranges."));B("editor.symbolHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Ci,4,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,5,"Background color of the border around highlighted symbols."));const tS=B("editorCursor.foreground",{dark:"#AEAFAD",light:fe.black,hcDark:fe.white,hcLight:"#0F4A85"},g(Ci,6,"Color of the editor cursor.")),EE=B("editorCursor.background",null,g(Ci,7,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),HKe=B("editorMultiCursor.primary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,8,"Color of the primary editor cursor when multiple cursors are present.")),jvt=B("editorMultiCursor.primary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,9,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),UKe=B("editorMultiCursor.secondary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,10,"Color of secondary editor cursors when multiple cursors are present.")),Kvt=B("editorMultiCursor.secondary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,11,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),xE=B("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(Ci,12,"Color of whitespace characters in the editor.")),Yvt=B("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:fe.white,hcLight:"#292929"},g(Ci,13,"Color of editor line numbers.")),Nj=B("editorIndentGuide.background",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,14,"Color of the editor indentation guides."),!1,g(Ci,15,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Pj=B("editorIndentGuide.activeBackground",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,16,"Color of the active editor indentation guides."),!1,g(Ci,17,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),uQ=B("editorIndentGuide.background1",{dark:Nj,light:Nj,hcDark:Nj,hcLight:Nj},g(Ci,18,"Color of the editor indentation guides (1).")),Jvt=B("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,19,"Color of the editor indentation guides (2).")),Xvt=B("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,20,"Color of the editor indentation guides (3).")),Zvt=B("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,21,"Color of the editor indentation guides (4).")),ewt=B("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,22,"Color of the editor indentation guides (5).")),twt=B("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,23,"Color of the editor indentation guides (6).")),gQ=B("editorIndentGuide.activeBackground1",{dark:Pj,light:Pj,hcDark:Pj,hcLight:Pj},g(Ci,24,"Color of the active editor indentation guides (1).")),iwt=B("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,25,"Color of the active editor indentation guides (2).")),nwt=B("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,26,"Color of the active editor indentation guides (3).")),swt=B("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,27,"Color of the active editor indentation guides (4).")),owt=B("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,28,"Color of the active editor indentation guides (5).")),rwt=B("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,29,"Color of the active editor indentation guides (6).")),Fj=B("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:co,hcLight:co},g(Ci,30,"Color of editor active line number"),!1,g(Ci,31,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));B("editorLineNumber.activeForeground",{dark:Fj,light:Fj,hcDark:Fj,hcLight:Fj},g(Ci,30,"Color of editor active line number"));const awt=B("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,32,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));B("editorRuler.foreground",{dark:"#5A5A5A",light:fe.lightgrey,hcDark:fe.white,hcLight:"#292929"},g(Ci,33,"Color of the editor rulers."));B("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(Ci,34,"Foreground color of editor CodeLens"));B("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(Ci,35,"Background color behind matching brackets"));B("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ft,hcLight:ft},g(Ci,36,"Color for matching brackets boxes"));const cwt=B("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(Ci,37,"Color of the overview ruler border.")),lwt=B("editorOverviewRuler.background",null,g(Ci,38,"Background color of the editor overview ruler."));B("editorGutter.background",{dark:us,light:us,hcDark:us,hcLight:us},g(Ci,39,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));B("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:ft},g(Ci,40,"Border color of unnecessary (unused) source code in the editor."));const dwt=B("editorUnnecessaryCode.opacity",{dark:fe.fromHex("#000a"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,41,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));B("editorGhostText.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:fe.fromHex("#292929").transparent(.8)},g(Ci,42,"Border color of ghost text in the editor."));B("editorGhostText.foreground",{dark:fe.fromHex("#ffffff56"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,43,"Foreground color of the ghost text in the editor."));B("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,44,"Background color of the ghost text in the editor."));const Oj=new fe(new gn(0,122,204,.6)),VKe=B("editorOverviewRuler.rangeHighlightForeground",{dark:Oj,light:Oj,hcDark:Oj,hcLight:Oj},g(Ci,45,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hwt=B("editorOverviewRuler.errorForeground",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(Ci,46,"Overview ruler marker color for errors.")),uwt=B("editorOverviewRuler.warningForeground",{dark:qc,light:qc,hcDark:K9,hcLight:K9},g(Ci,47,"Overview ruler marker color for warnings.")),gwt=B("editorOverviewRuler.infoForeground",{dark:Qc,light:Qc,hcDark:Y9,hcLight:Y9},g(Ci,48,"Overview ruler marker color for infos.")),zKe=B("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(Ci,49,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),$Ke=B("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(Ci,50,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),GKe=B("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(Ci,51,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),qKe=B("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,52,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),QKe=B("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,53,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),jKe=B("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,54,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),fwt=B("editorBracketHighlight.unexpectedBracket.foreground",{dark:new fe(new gn(255,18,18,.8)),light:new fe(new gn(255,18,18,.8)),hcDark:new fe(new gn(255,50,50,1)),hcLight:""},g(Ci,55,"Foreground color of unexpected brackets.")),pwt=B("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,56,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),mwt=B("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,57,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),_wt=B("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,58,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),vwt=B("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,59,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),wwt=B("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,60,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),bwt=B("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,61,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Cwt=B("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,62,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),ywt=B("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,63,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Swt=B("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,64,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Awt=B("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,65,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Ewt=B("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,66,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),xwt=B("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,67,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));B("editorUnicodeHighlight.border",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(Ci,68,"Border color used to highlight unicode characters."));B("editorUnicodeHighlight.background",{dark:Aj,light:Aj,hcDark:Aj,hcLight:Aj},g(Ci,69,"Background color used to highlight unicode characters."));Lm((n,e)=>{const t=n.getColor(us),i=n.getColor(WKe),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});const fae=class fae extends fO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new oe(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(x.lineHeight);const t=e.get(x.lineNumbers);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(x.renderFinalNewline);const i=e.get(x.layoutInfo);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===Qr.Relative||this._renderLineNumbers===Qr.Interval)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===Qr.Relative){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}if(this._renderLineNumbers===Qr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const s=this._context.viewModel.getLineCount();return i===s?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===Qr.Off){this._renderResult=null;return}const t=jr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>O.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=s;l++){const d=l-i;let h=this._getLineRenderLineNumber(l),u="";for(;r${h}
      `}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};fae.CLASS_NAME="line-numbers";let BZ=fae;Lm((n,e)=>{const t=n.getColor(Yvt),i=n.getColor(awt);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});var Dwt=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";Ct(Dwt,{});const W2=class W2 extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(W2.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ks(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(W2.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};W2.CLASS_NAME="glyph-margin",W2.OUTER_CLASS_NAME="margin";let WZ=W2;var kwt=".monaco-mouse-cursor-text{cursor:text}";Ct(kwt,{});const lx="monaco-mouse-cursor-text";class Iwt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const b$=new Iwt,ti=ae("keybindingService"),l5="vs/editor/browser/controller/textAreaHandler";class Lwt{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new oe(this.modelLineNumber,this.distanceToModelLineStart+1),i=new oe(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:Ad.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const nfe=pp;let pwe=class extends Cp{constructor(e,t,i,s,o){super(e),this._keybindingService=s,this._instantiationService=o,this._primaryCursorPosition=new oe(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(x.layoutInfo);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(x.fontInfo),this._lineHeight=r.get(x.lineHeight),this._emptySelectionClipboard=r.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new mt(1,1,1,1)],this._modelSelections=[new mt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ks(document.createElement("textarea")),Xb.write(this.textArea,Da.TextArea),this.textArea.setClassName(`inputarea ${lx}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(x.tabIndex))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",g(l5,0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ks(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,f)=>this._context.viewModel.getValueInRange(u,f),getValueLengthInRange:(u,f)=>this._context.viewModel.getValueLengthInRange(u,f),modifyPosition:(u,f)=>this._context.viewModel.modifyPosition(u,f)},d={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Is),f=this._context.viewModel.model.getEOL(),p=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(u)?u:null,v=Array.isArray(u)?u.join(f):u;let w,b=null;if(hwe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const C=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(w=C.html,b=C.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:w,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===Kd.Disabled){const u=this._selections[0];if(ei&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new kh(m,m.length,m.length,O.fromPositions(p),0)}if(ei&&!u.isEmpty()&&l.getValueLengthInRange(u,xo.TextDefined)<500){const p=l.getValueInRange(u,xo.TextDefined);return new kh(p,0,p.length,u,0)}if(TS&&!u.isEmpty()){const p="vscode-placeholder";return new kh(p,0,p.length,null,void 0)}return kh.EMPTY}if(n2e){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new kh(p,m,m,O.fromPositions(f),0)}return kh.EMPTY}return ZB.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Kd.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Uvt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(uwe,d,h,$c,{isAndroid:n2e,isChrome:eQ,isFirefox:pp,isSafari:TS})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let f=!1,p=null,m=null;u.metadata&&(f=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,p=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,m=u.metadata.mode),this._viewController.paste(u.text,f,p,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:v}=(()=>{const b=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),C=b.lastIndexOf(` -`),y=b.substring(C+1),S=y.lastIndexOf(" "),M=y.length-S-1,k=p.getStartPosition(),F=Math.min(k.column-1,M),N=k.column-1-F,z=y.substring(0,y.length-F),{tabSize:U}=this._context.viewModel.model.getOptions(),J=Twt(this.textArea.domNode.ownerDocument,z,this._fontInfo,U);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:J}})(),{distanceToModelLineEnd:w}=(()=>{const b=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),C=b.indexOf(` -`),y=C===-1?b:b.substring(0,C),S=y.indexOf(" "),M=S===-1?y.length:y.length-S-1,k=p.getEndPosition(),F=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,M);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-F}})();this._context.viewModel.revealRange("keyboard",!0,O.fromPositions(this._selections[0].getStartPosition()),Ns.Simple,vt.Immediate),this._visibleTextArea=new Lwt(this._context,p.startLineNumber,m,v,w),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${lx} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${lx}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(b$.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=R_(t,[]);let o=!0,r=e.column,a=!0,c=e.column,l=0;for(;l<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==da.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);s.get(d)!==da.Regular?a=!1:c++}l++}return[i.substring(r-1,c-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=R_(this._context.configuration.options.get(x.wordSeparators),[]);let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==da.Regular||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wl(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Kd.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),s=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(l5,1,"The editor is not accessible at this time.");return i?g(l5,2,"{0} To enable screen reader optimized mode, use {1}",r,i):s?g(l5,3,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?g(l5,4,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,o):r}return e.get(x.ariaLabel)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(x.accessibilitySupport);const t=e.get(x.accessibilityPageSize);this._accessibilitySupport===Kd.Enabled&&t===_u.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(x.layoutInfo).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==Kd.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=nfe?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(x.fontInfo),this._lineHeight=t.get(x.lineHeight),this._emptySelectionClipboard=t.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=t.get(x.copyWithSyntaxHighlighting),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(x.tabIndex))),(e.hasChanged(x.domReadOnly)||e.hasChanged(x.readOnly))&&this._ensureReadOnlyAttribute(),e.hasChanged(x.accessibilitySupport)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!b$.enabled||e.get(x.domReadOnly)&&e.get(x.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new oe(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,s=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&s&&s.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let l=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=s.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewModel.getViewLineData(o.lineNumber),f=u.tokens.findTokenIndexAtOffset(o.column-1),p=u.tokens.findTokenIndexAtOffset(r.column-1),m=f===p,v=this._visibleTextArea.definePresentation(m?u.tokens.getPresentation(f):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=l,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:this._lineHeight,useCover:!1,color:(dc.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(ei||this._accessibilitySupport===Kd.Enabled){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:nfe?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` -`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:nfe?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Sd(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?fe.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(x.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+WZ.OUTER_CLASS_NAME):s.get(x.lineNumbers).renderType!==Qr.Off?i.setClassName("monaco-editor-background textAreaCover "+BZ.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};pwe=D([_(3,ti),_(4,be)],pwe);function Twt(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Sd(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}class Rwt{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ul.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Ul.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ul.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Ul.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Ul.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ul.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ul.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ul.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ul.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ul.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ul.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ul.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ul.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ul.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class KKe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new cn("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let c=i;c<=s;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=l,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let h=0;hi)continue;const c=Math.max(t,a.fromLineNumber),l=Math.min(i,a.toLineNumber);for(let d=c;d<=l;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),s=!0}}return s}}class YKe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new KKe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ks(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(x.layoutInfo)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),c=o.linesLength-1-r+1;c>0&&(this._removeLinesAfter(o,c),o.linesLength-=c)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=r+c;a[c].layoutLine(l,s[l-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let c=t;c<=i;c++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const c=e.lines[a];s[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");FA._ttPolicy&&(t=FA._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;oe}),FA._sb=new fz(1e5);let mwe=FA;class JKe extends Cp{constructor(e){super(e),this._visibleLines=new YKe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);Sd(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),o.appendString(r),o.appendString("
      "),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class Nwt extends JKe{constructor(e){super(e);const i=this._context.configuration.options.get(x.layoutInfo);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Pwt extends JKe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Sd(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;Sd(this.domNode,t.get(x.fontInfo));const i=t.get(x.layoutInfo);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class lde{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return lde.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===Mt.GUTTER_VIEW_ZONE||i.type===Mt.CONTENT_VIEW_ZONE)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new oe(e.afterLineNumber,1)).lineNumber}}}var Fwt=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";Ct(Fwt,{});class Owt extends Cp{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(x.layoutInfo),s=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==s&&(this.contentWidth=s,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const s of i){if(!s.options.blockClassName)continue;let o=this.blocks[t];o||(o=this.blocks[t]=ks(document.createElement("div")),this.domNode.appendChild(o));let r,a;s.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!0),a=s.range.isEmpty()&&!s.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0));const[c,l,d,h]=s.options.blockPadding??[0,0,0,0];o.setClassName("blockDecorations-block "+s.options.blockClassName),o.setLeft(this.contentLeft-h),o.setWidth(this.contentWidth+h+l),o.setTop(r-e.scrollTop-c),o.setHeight(a-r+c+d),t++}for(let s=t;s0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,c=s.viewportHeight-a,l=o-i,d=r>=i,h=a,u=c>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const u=h-(c-s);h-=u,i-=u}if(h=m,b=h+i<=u.height-v;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(d,m),fitsBelow:b,belowTop:h,left:p}:{fitsAbove:w,aboveTop:o,fitsBelow:b,belowTop:r,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new h5(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=o(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,s=o(i,this._affinity,this._lineHeight);return{primary:t,secondary:s};function o(r,a,c){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const d=r.column===1&&a===jo.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop;return new DWe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(x.fontInfo);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&sfe(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&sfe(this._actual.afterRender,this._actual,this._renderData.position)}};class d5{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class h5{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class DWe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function sfe(n,e,...t){try{return n.call(e,...t)}catch{return null}}var Hwt=`.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{box-sizing:border-box;display:block;height:100%;left:0;position:absolute;top:0}.monaco-editor +`+c;return i?new Dq(n,d,!0):new cY(n,d,-1,l.length-c.length,!0)}else if(o.indentAction===yr.Outdent){const c=Y8(e,o.indentation);return t0(n,` +`+e.normalizeIndentation(c+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=ho(r).substring(0,n.startColumn-1);if(e.autoIndent>=ll.Full){const c=_mt(e.autoIndent,t,n,{unshiftIndent:l=>Y8(e,l),shiftIndent:l=>tae(e,l),normalizeIndentation:l=>e.normalizeIndentation(l)},e.languageConfigurationService);if(c){let l=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=kh(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Dq(n,` +`+e.normalizeIndentation(c.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(l=Math.ceil(l/e.indentSize)),f=Math.min(l+1-e.normalizeIndentation(c.afterEnter).length-1,0)),new cY(n,` +`+e.normalizeIndentation(c.afterEnter),0,f,!0)}}}return t0(n,` +`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;othis._compositionType(i,d,o,r,a,c));return new tg(sr.TypingOther,l,{shouldPushStackElementBefore:eae(e,sr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-n),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new F(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new cY(d,i,0,r)}}class kmt{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(T_(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=PO(e.autoIndent,t,new F(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return n&&(n===yr.Indent&&(o=tae(e,o)),n===yr.Outdent&&(o=Y8(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),c=e.indentSize,l=c-a%c;for(let d=0;d2?l.charCodeAt(c.column-2):B.Null)===B.Backslash&&h)return!1;if(s.autoClosingOvertype==="auto"){let f=!1;for(let p=0,m=i.length;p{const n=t.get(Kt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Bc();return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Kt).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var My;(function(s){s[s.Regular=0]="Regular",s[s.Minimal=1]="Minimal",s[s.None=2]="None"})(My||(My={}));var Zc;(function(s){class e extends ia{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,C){if(!C.position)return;y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,[bl.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==My.None&&y.revealAllCursors(C.source,!0,!0)}}s.MoveTo=qe(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=qe(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ia{runCoreEditorCommand(y,C){y.model.pushStackElement();const A=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),C);A!==null&&(y.setCursorStates(C.source,Oi.Explicit,A.viewStates.map(L=>Rn.fromViewState(L))),y.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:A.fromLineNumber,fromViewVisualColumn:A.fromVisualColumn,toViewLineNumber:A.toLineNumber,toViewVisualColumn:A.toVisualColumn}),A.reversed?y.revealTopMostCursor(C.source):y.revealBottomMostCursor(C.source))}}s.ColumnSelect=qe(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(w,y,C,A){if(typeof A.position>"u"||typeof A.viewPosition>"u"||typeof A.mouseColumn>"u")return null;const L=w.model.validatePosition(A.position),k=w.coordinatesConverter.validateViewPosition(new oe(A.viewPosition.lineNumber,A.viewPosition.column),L),P=A.doColumnSelect?C.fromViewLineNumber:k.lineNumber,R=A.doColumnSelect?C.fromViewVisualColumn:A.mouseColumn-1;return U0.columnSelect(w.cursorConfig,w,P,R,k.lineNumber,A.mouseColumn-1)}}),s.CursorColumnSelectLeft=qe(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return U0.columnSelectLeft(w.cursorConfig,w,C)}}),s.CursorColumnSelectRight=qe(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return U0.columnSelectRight(w.cursorConfig,w,C)}});class i extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return U0.columnSelectUp(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectUp=qe(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.UpArrow,linux:{primary:0}}})),s.CursorColumnSelectPageUp=qe(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageUp,linux:{primary:0}}}));class n extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return U0.columnSelectDown(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectDown=qe(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.DownArrow,linux:{primary:0}}})),s.CursorColumnSelectPageDown=qe(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageDown,linux:{primary:0}}}));class o extends ia{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Mi.metadata})}runCoreEditorCommand(y,C){const A=Mi.parse(C);A&&this._runCursorMove(y,C.source,A)}_runCursorMove(y,C,A){y.model.pushStackElement(),y.setCursorStates(C,Oi.Explicit,o._move(y,y.getCursorStates(),A)),y.revealAllCursors(C,!0)}static _move(y,C,A){const L=A.select,k=A.value;switch(A.direction){case Mi.Direction.Left:case Mi.Direction.Right:case Mi.Direction.Up:case Mi.Direction.Down:case Mi.Direction.PrevBlankLine:case Mi.Direction.NextBlankLine:case Mi.Direction.WrappedLineStart:case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Mi.Direction.WrappedLineColumnCenter:case Mi.Direction.WrappedLineEnd:case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return bl.simpleMove(y,C,A.direction,L,k,A.unit);case Mi.Direction.ViewPortTop:case Mi.Direction.ViewPortBottom:case Mi.Direction.ViewPortCenter:case Mi.Direction.ViewPortIfOutside:return bl.viewportMove(y,C,A.direction,L,k);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=qe(new o);let r;(function(w){w[w.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends ia{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,C){let A=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(A={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||y.cursorConfig.pageSize}),y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,bl.simpleMove(y,y.getCursorStates(),A.direction,A.select,A.value,A.unit)),y.revealAllCursors(C.source,!0)}}s.CursorLeft=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.LeftArrow,mac:{primary:S.LeftArrow,secondary:[U.WinCtrl|S.KeyB]}}})),s.CursorLeftSelect=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.LeftArrow}})),s.CursorRight=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.RightArrow,mac:{primary:S.RightArrow,secondary:[U.WinCtrl|S.KeyF]}}})),s.CursorRightSelect=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.RightArrow}})),s.CursorUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.UpArrow,mac:{primary:S.UpArrow,secondary:[U.WinCtrl|S.KeyP]}}})),s.CursorUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow],mac:{primary:U.Shift|S.UpArrow},linux:{primary:U.Shift|S.UpArrow}}})),s.CursorPageUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageUp}})),s.CursorPageUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageUp}})),s.CursorDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.DownArrow,mac:{primary:S.DownArrow,secondary:[U.WinCtrl|S.KeyN]}}})),s.CursorDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow],mac:{primary:U.Shift|S.DownArrow},linux:{primary:U.Shift|S.DownArrow}}})),s.CursorPageDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageDown}})),s.CursorPageDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageDown}})),s.CreateCursor=qe(new class extends ia{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,y){if(!y.position)return;let C;y.wholeLine?C=bl.line(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition):C=bl.moveTo(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition);const A=w.getCursorStates();if(A.length>1){const L=C.modelState?C.modelState.position:null,k=C.viewState?C.viewState.position:null;for(let P=0,R=A.length;Pk&&(L=k);const P=new F(L,1,L,w.model.getLineMaxColumn(L));let R=_s.Simple;if(C.at)switch(C.at){case sF.RawAtArgument.Top:R=_s.Top;break;case sF.RawAtArgument.Center:R=_s.Center;break;case sF.RawAtArgument.Bottom:R=_s.Bottom;break}const z=w.coordinatesConverter.convertModelRangeToViewRange(P);w.revealRange(y.source,!1,z,R,mt.Smooth)}}),s.SelectAll=new class extends Ype{constructor(){super(hht)}runDOMCommand(w){rf&&(w.focus(),w.select()),w.ownerDocument.execCommand("selectAll")}runEditorCommand(w,y,C){const A=y._getViewModel();A&&this.runCoreEditorCommand(A,C)}runCoreEditorCommand(w,y){w.model.pushStackElement(),w.setCursorStates("keyboard",Oi.Explicit,[bl.selectAll(w,w.getPrimaryCursorState())])}},s.SetSelection=qe(new class extends ia{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,y){y.selection&&(w.model.pushStackElement(),w.setCursorStates(y.source,Oi.Explicit,[Rn.fromModelSelection(y.selection)]))}})})(Zc||(Zc={}));const Mmt=he.and(J.textInputFocus,J.columnSelection);function AU(s,e){So.registerKeybindingRule({id:s,primary:e,when:Mmt,weight:os+1})}AU(Zc.CursorColumnSelectLeft.id,U.Shift|S.LeftArrow);AU(Zc.CursorColumnSelectRight.id,U.Shift|S.RightArrow);AU(Zc.CursorColumnSelectUp.id,U.Shift|S.UpArrow);AU(Zc.CursorColumnSelectPageUp.id,U.Shift|S.PageUp);AU(Zc.CursorColumnSelectDown.id,U.Shift|S.DownArrow);AU(Zc.CursorColumnSelectPageDown.id,U.Shift|S.PageDown);function sBe(s){return s.register(),s}var FO;(function(s){class e extends hc{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=qe(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:J.writable,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyO}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Zre.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=qe(new class extends e{constructor(){super({id:"outdent",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:U.Shift|S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,JE.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=qe(new class extends e{constructor(){super({id:"tab",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,JE.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=qe(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Backspace,secondary:[U.Shift|S.Backspace],mac:{primary:S.Backspace,secondary:[U.Shift|S.Backspace,U.WinCtrl|S.KeyH,U.WinCtrl|S.Backspace]}}})}runCoreEditingCommand(t,i,n){const[o,r]=yM.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(sr.DeletingLeft)}}),s.DeleteRight=qe(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Delete,mac:{primary:S.Delete,secondary:[U.WinCtrl|S.KeyD,U.WinCtrl|S.Delete]}}})}runCoreEditingCommand(t,i,n){const[o,r]=yM.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(sr.DeletingRight)}}),s.Undo=new class extends Ype{constructor(){super(sKe)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},s.Redo=new class extends Ype{constructor(){super(oKe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(FO||(FO={}));class oBe extends Bre{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Kt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function LN(s,e){sBe(new oBe("default:"+s,s)),sBe(new oBe(s,s,e))}LN(oc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});LN(oc.ReplacePreviousChar);LN(oc.CompositionType);LN(oc.CompositionStart);LN(oc.CompositionEnd);LN(oc.Paste);LN(oc.Cut);let pd=class extends V{onclick(e,t){this._register(ue(e,ke.CLICK,i=>t(new Eh(ct(e),i))))}onmousedown(e,t){this._register(ue(e,ke.MOUSE_DOWN,i=>t(new Eh(ct(e),i))))}onmouseover(e,t){this._register(ue(e,ke.MOUSE_OVER,i=>t(new Eh(ct(e),i))))}onmouseleave(e,t){this._register(ue(e,ke.MOUSE_LEAVE,i=>t(new Eh(ct(e),i))))}onkeydown(e,t){this._register(ue(e,ke.KEY_DOWN,i=>t(new En(i))))}onkeyup(e,t){this._register(ue(e,ke.KEY_UP,i=>t(new En(i))))}oninput(e,t){this._register(ue(e,ke.INPUT,t))}onblur(e,t){this._register(ue(e,ke.BLUR,t))}onfocus(e,t){this._register(ue(e,ke.FOCUS,t))}onchange(e,t){this._register(ue(e,ke.CHANGE,t))}ignoreGesture(e){return fd.ignoreTarget(e)}};const $2=11;class Nmt extends pd{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...We.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=$2+"px",this.domNode.style.height=$2+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new SU),this._register(Ro(this.bgDomNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ro(this.domNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new X7),this._pointerdownScheduleRepeatTimer=this._register(new Cm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ct(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Pmt extends V{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Cm)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===Co.Hidden?!1:this._visibility===Co.Visible?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Fmt=140;class yqe extends pd{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Pmt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new SU),this._shouldRender=!0,this.domNode=ls(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ue(this.domNode.domNode,ke.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Nmt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ls(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,ke.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Cr(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Qn&&a>Fmt){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Omt=20;class G2{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new G2(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=n>0&&n>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(Omt,Math.floor(i*a/n))),d=(a-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=G2._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new _M(null,1,0))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new _M(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===Co.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===Co.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Wmt extends yqe{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new G2(t.verticalHasArrows?t.arrowSize:0,t.vertical===Co.Hidden?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-$2)/2,a=(t.verticalScrollbarSize-$2)/2;this._createArrow({className:"scra",icon:ve.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new _M(null,0,1))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new _M(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===Co.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Hmt=".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{background:transparent;opacity:1;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{display:none;position:absolute}.monaco-scrollable-element>.shadow.top{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;display:block;height:3px;left:3px;top:0;width:100%}.monaco-scrollable-element>.shadow.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;display:block;height:100%;left:0;top:3px;width:3px}.monaco-scrollable-element>.shadow.top-left-corner{display:block;height:3px;left:0;top:0;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}";ut(Hmt,{});const Umt=500,rBe=50;class Vmt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const qne=class qne{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,n=this._rear;do{const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(Q7){const t=ct(e.browserEvent),i=nlt(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null;const o=new Vmt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(n,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(n,r),h=Math.max(o,a);d%c===0&&h%l===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};qne.INSTANCE=new qne;let lY=qne;class qTe extends pd{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new I),this.onWillScroll=this._onWillScroll.event,e.style.overflow="hidden",this._options=zmt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Wmt(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Bmt(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ls(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ls(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ls(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Cm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=bt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Qt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new _M(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=bt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new _M(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,ke.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=lY.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+o===0?r=o=0:Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!Qt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(o){const d=rBe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=rBe*r,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Umt)}}class Cqe extends qTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new yN({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class l6 extends qTe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class EU extends qTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new yN({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function zmt(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:Co.Auto,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:Co.Auto,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,Qt&&(e.className+=" mac"),e}class QTe extends c6{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._mouseOnOverflowWidgetsDomNode=!1,this._mouseOnViewDomNode=!1,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Dd(this._context,i),this._mouseDownOperation=this._register(new $mt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(a,c)=>this._createMouseTargetForView(a,c),a=>this._getMouseColumn(a))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const n=new Npt(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,a=>this._onContextMenu(a,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!0,this._onMouseMoveOverView(a),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ue(this.viewHelper.viewDomNode.ownerDocument,"mousemove",c=>{this.viewHelper.viewDomNode.contains(c.target)||(this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(new Fk(c,!1,this.viewHelper.viewDomNode))},0))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,a=>this._onMouseUp(a))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(a)},0)}));const o=this.viewHelper.overflowWidgetsDomNode;o&&(this._register(n.onMouseMove(o,a=>{this._mouseOnOverflowWidgetsDomNode=!0,this._mouseLeaveMonitor?.dispose(),this._mouseLeaveMonitor=null,this._onMouseMoveOverOverflowWidgetsDomNode(a)})),this._register(n.onMouseLeave(o,a=>{this._mouseOnOverflowWidgetsDomNode=!1,setTimeout(()=>{this._mouseOnViewDomNode||this._onMouseLeave(a)},0)})));let r=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(a,c)=>{r=c})),this._register(ue(this.viewHelper.viewDomNode,ke.POINTER_UP,a=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,a=>this._onMouseDown(a,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=lY.INSTANCE;let t=0,i=Qp.getZoomLevel(),n=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new _M(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=Qp.getZoomLevel(),h=l.deltaY>0?1:-1;Qp.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=Qp.getZoomLevel(),n=a(c),o=0),t=Date.now(),o+=l.deltaY,n&&(Qp.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(ue(this.viewHelper.viewDomNode,ke.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return Qt?(c.metaKey||c.ctrlKey)&&!c.shiftKey&&!c.altKey:c.ctrlKey&&!c.metaKey&&!c.shiftKey&&!c.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(x.layoutInfo)){const t=this._context.configuration.options.get(x.layoutInfo).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const n=new hqe(e,t).toPageCoordinates(ct(this.viewHelper.viewDomNode)),o=OTe(this.viewHelper.viewDomNode);if(n.yo.y+o.height||n.xo.x+o.width)return null;const r=BTe(this.viewHelper.viewDomNode,o,n);return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),o,n,r,null)}_createMouseTargetForView(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=vM(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_createMouseTargetForOverflowWidgetsDomNode(e){return this.mouseTargetFactory.createMouseTargetForOverflowWidgetsDomNode(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,e.target)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTargetForView(e,t)})}_onMouseMoveOverView(e){this._onMouseMove(e,this._createMouseTargetForView(e,!0))}_onMouseMoveOverOverflowWidgetsDomNode(e){this._onMouseMove(e,this._createMouseTargetForOverflowWidgetsDomNode(e))}_onMouseMove(e,t){this._shouldIgnoreMouseMoveEvent(e)||this.viewController.emitMouseMove({event:e,target:t})}_shouldIgnoreMouseMoveEvent(e){return this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(c){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}_onMouseWheel(e){this.viewController.emitMouseWheel(e)}}class $mt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Fpt(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Gmt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new Jpe,this._currentSelection=new dt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===Rt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,My.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Rt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(x.readOnly)&&o.get(x.dragAndDrop)&&!o.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===Rt.CONTENT_TEXT&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);d_(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,My.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=n.getCurrentScrollTop()+e.relativePos.y,l=wM.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return uh.createOutsideEditor(o,h,"below",a)}const d=n.getLineNumberAtVerticalOffset(c);return uh.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return uh.createOutsideEditor(o,new oe(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===Rt.CONTENT_VIEW_ZONE||n.type===Rt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return uh.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===Rt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Gmt extends V{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Kmt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Kmt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=Ll(ct(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(x.lineHeight),t=this._context.configuration.options.get(x.layoutInfo).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(x.lineHeight),t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let c;{const l=OTe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new jre(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=BTe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTargetForView(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=uh.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=uh.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,My.None),this._animationFrameDisposable=Ll(ct(c.element),()=>this._execute())}}const Qne=class Qne{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>Qne.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};Qne.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let Jpe=Qne;class ii{get event(){return this.emitter.event}constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}const GF=class GF{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new GF(i,n,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new GF(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min($y(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(Dj(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,c=e.selectionEnd-n,l=t.selectionStart-n,d=t.selectionEnd-n;if(l===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=c-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min($y(e.value,t.value),e.selectionEnd),n=Math.min(Dj(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}};GF.EMPTY=new GF("",0,0,null,void 0);let Nd=GF;class oF{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new F(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=oF._getPageOfLine(t.startLineNumber,i),a=oF._getRangeForPage(r,i),c=oF._getPageOfLine(t.endLineNumber,i),l=oF._getRangeForPage(c,i);let d=a.intersectRanges(new F(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,go.LF)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=F.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,go.LF),u=e.getLineCount(),f=e.getLineMaxColumn(u);let p=l.intersectRanges(new F(t.endLineNumber,t.endColumn,u,f));if(n&&e.getValueLengthInRange(p,go.LF)>500){const b=e.modifyPosition(p.getStartPosition(),500);p=F.fromPositions(p.getStartPosition(),b)}const m=e.getValueInRange(p,go.LF);let v;if(r===c||r+1===c)v=e.getValueInRange(t,go.LF);else{const b=a.intersectRanges(t),w=l.intersectRanges(t);v=e.getValueInRange(b,go.LF)+"…"+e.getValueInRange(w,go.LF)}return n&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new Nd(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var dY;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(dY||(dY={}));const Xpe={forceCopyWithSyntaxHighlighting:!1},jne=class jne{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};jne.INSTANCE=new jne;let J8=jne;class qmt{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let Zpe=class extends V{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new I),this.onCut=this._onCut.event,this._onPaste=this._register(new I),this.onPaste=this._onPaste.event,this._onType=this._register(new I),this.onType=this._onType.event,this._onCompositionStart=this._register(new I),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new I),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new I),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new I),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new wn),this._asyncTriggerCut=this._register(new cn(()=>this._onCut.fire(),0)),this._textAreaState=Nd.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(M.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new cn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(c=>{const l=new En(c);(l.keyCode===S.KEY_IN_COMPOSITION||this._currentComposition&&l.keyCode===S.Backspace)&&l.stopPropagation(),l.equals(S.Escape)&&l.preventDefault(),a=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(c=>{const l=new En(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new qmt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===Ds.Macintosh&&a&&a.equals(S.KEY_IN_COMPOSITION)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===c.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){l.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:c.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:c.data});return}this._onCompositionStart.fire({data:c.data})})),this._register(this._textArea.onCompositionUpdate(c=>{const l=this._currentComposition;if(!l)return;if(this._browser.isAndroid){const h=Nd.readFromTextArea(this._textArea,this._textAreaState),u=Nd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Nd.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(c)})),this._register(this._textArea.onCompositionEnd(c=>{const l=this._currentComposition;if(!l)return;if(this._currentComposition=null,this._browser.isAndroid){const h=Nd.readFromTextArea(this._textArea,this._textAreaState),u=Nd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Nd.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const l=Nd.readFromTextArea(this._textArea,this._textAreaState),d=Nd.deduceInput(this._textAreaState,l,this._OS===Ds.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(Pc(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=l,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(c=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(c),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(c=>{this._ensureClipboardGetsEditorSelection(c)})),this._register(this._textArea.onPaste(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),c.preventDefault(),!c.clipboardData)return;let[l,d]=eme.getTextData(c.clipboardData);l&&(d=d||J8.INSTANCE.get(l),this._onPaste.fire({text:l,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const c=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!c&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new cn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_initializeFromTest(){this._hasFocus=!0,this._textAreaState=Nd.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return ue(this._textArea.ownerDocument,"selectionchange",t=>{if(yx.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),c=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===c)return;const l=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(c),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new dt(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};J8.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&eme.setTextData(e.clipboardData,t.text,t.html,i)}};Zpe=D([_(4,mr),_(5,Ge)],Zpe);const eme={getTextData(s){const e=s.getData(Us.text);let t=null;const i=s.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(` +`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Us.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class Qmt extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ii(this._actual,"keydown")).event,this.onKeyPress=this._register(new ii(this._actual,"keypress")).event,this.onKeyUp=this._register(new ii(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ii(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ii(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ii(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ii(this._actual,"beforeinput")).event,this.onInput=this._register(new ii(this._actual,"input")).event,this.onCut=this._register(new ii(this._actual,"cut")).event,this.onCopy=this._register(new ii(this._actual,"copy")).event,this.onPaste=this._register(new ii(this._actual,"paste")).event,this.onFocus=this._register(new ii(this._actual,"focus")).event,this.onBlur=this._register(new ii(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>yx.onKeyDown())),this._register(this.onBeforeInput(()=>yx.onBeforeInput())),this._register(this.onInput(()=>yx.onInput())),this._register(this.onKeyUp(()=>yx.onKeyUp())),this._register(ue(this._actual,dY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=vM(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Bc()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const r=vM(n);r?o=r.activeElement:o=Bc();const a=ct(o),c=o===n,l=n.selectionStart,d=n.selectionEnd;if(c&&l===t&&d===i){rf&&a.parent!==a&&n.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),rf&&a.parent!==a&&n.focus();return}try{const h=Bdt(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),Wdt(n,h)}catch{}}}class jmt extends QTe{constructor(e,t,i){super(e,t,i),this._register(fd.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,o=>this.onTap(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,o=>this.onChange(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,o=>this._onContextMenu(new Fk(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ue(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new Ppt(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMoveOverView(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTargetForView(new Fk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:My.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Rt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class Ymt extends QTe{constructor(e,t,i){super(e,t,i),this._register(fd.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,n=>this.onTap(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,n=>this.onChange(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,n=>this._onContextMenu(new Fk(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTargetForView(new Fk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(dY.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,My.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Jmt extends V{constructor(e,t,i){super(),(dm||Drt&&L6e)&&kO.pointerEvents?this.handler=this._register(new jmt(e,t,i)):si.TouchEvent?this.handler=this._register(new Ymt(e,t,i)):this.handler=this._register(new QTe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Xmt=".monaco-editor .inputarea{background-color:transparent;border:none;color:transparent;margin:0;min-height:0;min-width:0;outline:none!important;overflow:hidden;padding:0;position:absolute;resize:none;z-index:-10}.monaco-editor .inputarea.ime-input{caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground);z-index:10}";ut(Xmt,{});var Zmt=".monaco-editor .margin-view-overlays .line-numbers{bottom:0;box-sizing:border-box;cursor:default;display:inline-block;font-variant-numeric:tabular-nums;position:absolute;text-align:right;vertical-align:middle}.monaco-editor .relative-current-line-number{display:inline-block;text-align:left;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}";ut(Zmt,{});class RN extends c6{}function $o(s){return{id:s}}function tme(s){switch(s){case Jg.DARK:return"vs-dark";case Jg.HIGH_CONTRAST_DARK:return"hc-black";case Jg.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Sqe={ThemingContribution:"base.contributions.theming"};class e_t{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new I}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ee(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}get onThemingParticipantAdded(){return this.onThemingParticipantAddedEmitter.event}getThemingParticipants(){return this.themingParticipants}}const Aqe=new e_t;Qe.add(Sqe.ThemingContribution,Aqe);function Cp(s){return Aqe.onColorThemeChange(s)}class jTe extends V{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}getColor(e,t){let i=this.theme.getColor(e);return i&&t&&(i=t(i,this.theme)),i?i.toString():null}}const Eqe=W("editor.lineHighlightBackground",null,g(4890,"Background color for the highlight of line at the cursor position.")),aBe=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:wt},g(4891,"Background color for the border around the line at the cursor position."));W("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(4892,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4893,"Background color of the border around highlighted ranges."));W("editor.symbolHighlightBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(4894,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4895,"Background color of the border around highlighted symbols."));const iae=W("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},g(4896,"Color of the editor cursor.")),YTe=W("editorCursor.background",null,g(4897,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),xqe=W("editorMultiCursor.primary.foreground",iae,g(4898,"Color of the primary editor cursor when multiple cursors are present.")),t_t=W("editorMultiCursor.primary.background",YTe,g(4899,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),Dqe=W("editorMultiCursor.secondary.foreground",iae,g(4900,"Color of secondary editor cursors when multiple cursors are present.")),i_t=W("editorMultiCursor.secondary.background",YTe,g(4901,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),JTe=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(4902,"Color of whitespace characters in the editor.")),n_t=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},g(4903,"Color of editor line numbers.")),s_t=W("editorIndentGuide.background",JTe,g(4904,"Color of the editor indentation guides."),!1,g(4905,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),o_t=W("editorIndentGuide.activeBackground",JTe,g(4906,"Color of the active editor indentation guides."),!1,g(4907,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),d6=W("editorIndentGuide.background1",s_t,g(4908,"Color of the editor indentation guides (1).")),r_t=W("editorIndentGuide.background2","#00000000",g(4909,"Color of the editor indentation guides (2).")),a_t=W("editorIndentGuide.background3","#00000000",g(4910,"Color of the editor indentation guides (3).")),c_t=W("editorIndentGuide.background4","#00000000",g(4911,"Color of the editor indentation guides (4).")),l_t=W("editorIndentGuide.background5","#00000000",g(4912,"Color of the editor indentation guides (5).")),d_t=W("editorIndentGuide.background6","#00000000",g(4913,"Color of the editor indentation guides (6).")),h6=W("editorIndentGuide.activeBackground1",o_t,g(4914,"Color of the active editor indentation guides (1).")),h_t=W("editorIndentGuide.activeBackground2","#00000000",g(4915,"Color of the active editor indentation guides (2).")),u_t=W("editorIndentGuide.activeBackground3","#00000000",g(4916,"Color of the active editor indentation guides (3).")),g_t=W("editorIndentGuide.activeBackground4","#00000000",g(4917,"Color of the active editor indentation guides (4).")),f_t=W("editorIndentGuide.activeBackground5","#00000000",g(4918,"Color of the active editor indentation guides (5).")),p_t=W("editorIndentGuide.activeBackground6","#00000000",g(4919,"Color of the active editor indentation guides (6).")),m_t=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Js,hcLight:Js},g(4920,"Color of editor active line number"),!1,g(4921,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));W("editorLineNumber.activeForeground",m_t,g(4920,"Color of editor active line number"));const __t=W("editorLineNumber.dimmedForeground",null,g(4922,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));W("editorRuler.foreground",{dark:"#5A5A5A",light:me.lightgrey,hcDark:me.white,hcLight:"#292929"},g(4923,"Color of the editor rulers."));W("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(4924,"Foreground color of editor CodeLens"));W("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(4925,"Background color behind matching brackets"));W("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:wt,hcLight:wt},g(4926,"Color for matching brackets boxes"));const kqe=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(4927,"Color of the overview ruler border.")),v_t=W("editorOverviewRuler.background",null,g(4928,"Background color of the editor overview ruler."));W("editorGutter.background",Hc,g(4929,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));W("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:wt},g(4930,"Border color of unnecessary (unused) source code in the editor."));const b_t=W("editorUnnecessaryCode.opacity",{dark:me.fromHex("#000a"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4931,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));W("editorGhostText.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:me.fromHex("#292929").transparent(.8)},g(4932,"Border color of ghost text in the editor."));const w_t=W("editorGhostText.foreground",{dark:me.fromHex("#ffffff56"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4933,"Foreground color of the ghost text in the editor."));W("editorGhostText.background",null,g(4934,"Background color of the ghost text in the editor."));const y_t=new me(new dn(0,122,204,.6)),Iqe=W("editorOverviewRuler.rangeHighlightForeground",y_t,g(4935,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Tqe=W("editorOverviewRuler.errorForeground",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(4936,"Overview ruler marker color for errors.")),C_t=W("editorOverviewRuler.warningForeground",{dark:pm,light:pm,hcDark:V8,hcLight:V8},g(4937,"Overview ruler marker color for warnings.")),Lqe=W("editorOverviewRuler.infoForeground",{dark:mm,light:mm,hcDark:z8,hcLight:z8},g(4938,"Overview ruler marker color for infos.")),Rqe=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(4939,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Mqe=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(4940,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Nqe=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(4941,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Pqe=W("editorBracketHighlight.foreground4","#00000000",g(4942,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Fqe=W("editorBracketHighlight.foreground5","#00000000",g(4943,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Oqe=W("editorBracketHighlight.foreground6","#00000000",g(4944,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),S_t=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new dn(255,18,18,.8)),light:new me(new dn(255,18,18,.8)),hcDark:new me(new dn(255,50,50,1)),hcLight:""},g(4945,"Foreground color of unexpected brackets.")),A_t=W("editorBracketPairGuide.background1","#00000000",g(4946,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),E_t=W("editorBracketPairGuide.background2","#00000000",g(4947,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),x_t=W("editorBracketPairGuide.background3","#00000000",g(4948,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),D_t=W("editorBracketPairGuide.background4","#00000000",g(4949,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),k_t=W("editorBracketPairGuide.background5","#00000000",g(4950,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),I_t=W("editorBracketPairGuide.background6","#00000000",g(4951,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),T_t=W("editorBracketPairGuide.activeBackground1","#00000000",g(4952,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),L_t=W("editorBracketPairGuide.activeBackground2","#00000000",g(4953,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),R_t=W("editorBracketPairGuide.activeBackground3","#00000000",g(4954,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),M_t=W("editorBracketPairGuide.activeBackground4","#00000000",g(4955,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),N_t=W("editorBracketPairGuide.activeBackground5","#00000000",g(4956,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),P_t=W("editorBracketPairGuide.activeBackground6","#00000000",g(4957,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));W("editorUnicodeHighlight.border",pm,g(4958,"Border color used to highlight unicode characters."));W("editorUnicodeHighlight.background",rft,g(4959,"Background color used to highlight unicode characters."));Cp((s,e)=>{const t=s.getColor(Hc),i=s.getColor(Eqe),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});const Yne=class Yne extends RN{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new oe(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(x.lineHeight);const t=e.get(x.lineNumbers);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(x.renderFinalNewline);const i=e.get(x.layoutInfo);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===wr.Relative||this._renderLineNumbers===wr.Interval)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===wr.Relative){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===wr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===wr.Off){this._renderResult=null;return}const t=pr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>F.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=n;l++){const d=l-i;let h=this._getLineRenderLineNumber(l),u="";for(;r${h}
      `}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};Yne.CLASS_NAME="line-numbers";let hY=Yne;Cp((s,e)=>{const t=s.getColor(n_t),i=s.getColor(__t);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});var F_t=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";ut(F_t,{});const KF=class KF extends pf{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ls(document.createElement("div")),this._domNode.setClassName(KF.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ls(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(KF.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};KF.CLASS_NAME="glyph-margin",KF.OUTER_CLASS_NAME="margin";let uY=KF;var O_t=".monaco-mouse-cursor-text{cursor:text}";ut(O_t,{});const ZS="monaco-mouse-cursor-text";class B_t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const c5=new B_t,Ut=ae("keybindingService");class W_t{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new oe(this.modelLineNumber,this.distanceToModelLineStart+1),i=new oe(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:Tl.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const Kde=rf;let ime=class extends pf{constructor(e,t,i,n,o){super(e),this._keybindingService=n,this._instantiationService=o,this._primaryCursorPosition=new oe(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(x.layoutInfo);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(x.fontInfo),this._lineHeight=r.get(x.lineHeight),this._emptySelectionClipboard=r.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new dt(1,1,1,1)],this._modelSelections=[new dt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ls(document.createElement("textarea")),Tb.write(this.textArea,sa.TextArea),this.textArea.setClassName(`inputarea ${ZS}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(x.tabIndex))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",g(9840,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ls(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,f)=>this._context.viewModel.getValueInRange(u,f),getValueLengthInRange:(u,f)=>this._context.viewModel.getValueLengthInRange(u,f),modifyPosition:(u,f)=>this._context.viewModel.modifyPosition(u,f)},d={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Qn),f=this._context.viewModel.model.getEOL(),p=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(u)?u:null,v=Array.isArray(u)?u.join(f):u;let b,w=null;if(Xpe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(b=y.html,w=y.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:b,mode:w}},getScreenReaderContent:()=>{if(this._accessibilitySupport===Jl.Disabled){const u=this._selections[0];if(Qt&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new Nd(m,m.length,m.length,F.fromPositions(p),0)}if(Qt&&!u.isEmpty()&&l.getValueLengthInRange(u,go.TextDefined)<500){const p=l.getValueInRange(u,go.TextDefined);return new Nd(p,0,p.length,u,0)}if(Ky&&!u.isEmpty()){const p="vscode-placeholder";return new Nd(p,0,p.length,null,void 0)}return Nd.EMPTY}if(OFe){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Nd(p,m,m,F.fromPositions(f),0)}return Nd.EMPTY}return oF.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Jl.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Qmt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(Zpe,d,h,po,{isAndroid:OFe,isChrome:Q7,isFirefox:rf,isSafari:Ky})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let f=!1,p=null,m=null;u.metadata&&(f=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,p=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,m=u.metadata.mode),this._viewController.paste(u.text,f,p,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:v}=(()=>{const w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=w.lastIndexOf(` +`),C=w.substring(y+1),A=C.lastIndexOf(" "),L=C.length-A-1,k=p.getStartPosition(),P=Math.min(k.column-1,L),R=k.column-1-P,z=C.substring(0,C.length-P),{tabSize:G}=this._context.viewModel.model.getOptions(),Y=H_t(this.textArea.domNode.ownerDocument,z,this._fontInfo,G);return{distanceToModelLineStart:R,widthOfHiddenTextBefore:Y}})(),{distanceToModelLineEnd:b}=(()=>{const w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=w.indexOf(` +`),C=y===-1?w:w.substring(0,y),A=C.indexOf(" "),L=A===-1?C.length:C.length-A-1,k=p.getEndPosition(),P=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-P}})();this._context.viewModel.revealRange("keyboard",!0,F.fromPositions(this._selections[0].getStartPosition()),_s.Simple,mt.Immediate),this._visibleTextArea=new W_t(this._context,p.startLineNumber,m,v,b),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${ZS} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${ZS}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(c5.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=fm(t,[]);let o=!0,r=e.column,a=!0,c=e.column,l=0;for(;l<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);n.get(d)!==zr.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);n.get(d)!==zr.Regular?a=!1:c++}l++}return[i.substring(r-1,c-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=fm(this._context.configuration.options.get(x.wordSeparators),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==zr.Regular||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Pc(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Jl.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(9841,"The editor is not accessible at this time.");return i?g(9842,"{0} To enable screen reader optimized mode, use {1}",r,i):n?g(9843,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,n):o?g(9844,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,o):r}return e.get(x.ariaLabel)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(x.accessibilitySupport);const t=e.get(x.accessibilityPageSize);this._accessibilitySupport===Jl.Enabled&&t===wh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(x.layoutInfo).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==Jl.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Kde?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(x.fontInfo),this._lineHeight=t.get(x.lineHeight),this._emptySelectionClipboard=t.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=t.get(x.copyWithSyntaxHighlighting),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(x.tabIndex))),(e.hasChanged(x.domReadOnly)||e.hasChanged(x.readOnly))&&this._ensureReadOnlyAttribute(),e.hasChanged(x.accessibilitySupport)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!c5.enabled||e.get(x.domReadOnly)&&e.get(x.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new oe(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,n=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&n&&n.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let l=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=n.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewModel.getViewLineData(o.lineNumber),f=u.tokens.findTokenIndexAtOffset(o.column-1),p=u.tokens.findTokenIndexAtOffset(r.column-1),m=f===p,v=this._visibleTextArea.definePresentation(m?u.tokens.getPresentation(f):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=l,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:this._lineHeight,useCover:!1,color:(Ta.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(Qt||this._accessibilitySupport===Jl.Enabled){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:Kde?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:Kde?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Dl(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?me.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(x.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+uY.OUTER_CLASS_NAME):n.get(x.lineNumbers).renderType!==wr.Off?i.setClassName("monaco-editor-background textAreaCover "+hY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};ime=D([_(3,Ut),_(4,we)],ime);function H_t(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");Dl(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return n.remove(),r}class U_t{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Zc.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Zc.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Zc.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Zc.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Zc.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Zc.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Zc.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Zc.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Zc.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Zc.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Zc.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Zc.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Zc.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Zc.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class Bqe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Ni("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,r=0;for(let c=i;c<=n;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=l,r=1):r++)}if(e=n&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let h=0;hi)continue;const c=Math.max(t,a.fromLineNumber),l=Math.min(i,a.toLineNumber);for(let d=c;d<=l;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),n=!0}}return n}}class Wqe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Bqe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ls(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(x.layoutInfo)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),c=o.linesLength-1-r+1;c>0&&(this._removeLinesAfter(o,c),o.linesLength-=c)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=r+c;a[c].layoutLine(l,n[l-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,o){const r=[];let a=0;for(let c=t;c<=i;c++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const c=e.lines[a];n[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");UC._ttPolicy&&(t=UC._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),UC._sb=new wU(1e5);let nme=UC;class Hqe extends pf{constructor(e){super(e),this._visibleLines=new Wqe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);Dl(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,n=t.length;i'),o.appendString(r),o.appendString("
      "),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class z_t extends Hqe{constructor(e){super(e);const i=this._context.configuration.options.get(x.layoutInfo);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class $_t extends Hqe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Dl(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;Dl(this.domNode,t.get(x.fontInfo));const i=t.get(x.layoutInfo);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class nae{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return nae.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===Rt.GUTTER_VIEW_ZONE||i.type===Rt.CONTENT_VIEW_ZONE)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new oe(e.afterLineNumber,1)).lineNumber}}}var G_t=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";ut(G_t,{});class K_t extends pf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ls(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(x.layoutInfo),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let o=this.blocks[t];o||(o=this.blocks[t]=ls(document.createElement("div")),this.domNode.appendChild(o));let r,a;n.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),a=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[c,l,d,h]=n.options.blockPadding??[0,0,0,0];o.setClassName("blockDecorations-block "+n.options.blockClassName),o.setLeft(this.contentLeft-h),o.setWidth(this.contentWidth+h+l),o.setTop(r-e.scrollTop-c),o.setHeight(a-r+c+d),t++}for(let n=t;n0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,r=o,a=e.top+e.height,c=n.viewportHeight-a,l=o-i,d=r>=i,h=a,u=c>=i;let f=e.left;return f+t>n.scrollLeft+n.viewportWidth&&(f=n.scrollLeft+n.viewportWidth-t),fc){const u=h-(c-n);h-=u,i-=u}if(h=m,w=h+i<=u.height-v;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,m),fitsBelow:w,belowTop:h,left:p}:{fitsAbove:b,aboveTop:o,fitsBelow:w,belowTop:r,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d4(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=o(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,n=o(i,this._affinity,this._lineHeight);return{primary:t,secondary:n};function o(r,a,c){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const d=r.column===1&&a===Io.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop;return new cBe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(x.fontInfo);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&qde(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&qde(this._actual.afterRender,this._actual,this._renderData.position)}};class l4{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class d4{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class cBe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function qde(s,e,...t){try{return s.call(e,...t)}catch{return null}}var j_t=`.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{box-sizing:border-box;display:block;height:100%;left:0;position:absolute;top:0}.monaco-editor .margin-view-overlays - .current-line.current-line-margin.current-line-margin-both{border-right:0}`;Ct(Hwt,{});class XKe extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new mt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),Ls(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=[];for(let r=t;r<=i;r++){const a=r-t;s[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new oe(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new oe(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new oe(l,this._context.viewModel.model.getLineMaxColumn(l))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let p=u;p<=f;p++){const m=p-t;s[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;s[a]=o}this._renderData=s}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Uwt extends XKe{_renderOne(e,t){return`
      `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Vwt extends XKe{_renderOne(e,t){return`
      `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Lm((n,e)=>{const t=n.getColor(WKe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(xWe)){const i=n.getColor(xWe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),pS(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});var zwt=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";Ct(zwt,{});class $wt extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let c=0,l=t.length;c{if(c.options.zIndexl.options.zIndex)return 1;const d=c.options.className,h=l.options.className;return dh?1:O.compareRangesUsingStarts(c.range,l.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let c=o;c<=r;c++){const l=c-o;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r
      ',d=Math.max(c.range.startLineNumber,s),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-s;i[f]+=l}}}_renderNormalDecorations(e,t,i){const s=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=w}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Gwt extends Cp{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(x.scrollbar),a=o.get(x.mouseWheelScrollSensitivity),c=o.get(x.fastScrollSensitivity),l=o.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+fwe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new hQ(t.domNode,d,this._context.viewLayout.getScrollable())),Xb.write(this.scrollbar.getDomNode(),Da.ScrollableElement),this.scrollbarDomNode=ks(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(u,f,p)=>{const m={};{const v=u.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,u.scrollTop=0)}if(p){const v=u.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,u.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,vt.Immediate)};this._register(pe(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(pe(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(pe(s.domNode,"scroll",u=>h(s.domNode,!0,!1))),this._register(pe(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(x.layoutInfo);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(x.minimap).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(x.scrollbar)||e.hasChanged(x.mouseWheelScrollSensitivity)||e.hasChanged(x.fastScrollSensitivity)){const t=this._context.configuration.options,i=t.get(x.scrollbar),s=t.get(x.mouseWheelScrollSensitivity),o=t.get(x.fastScrollSensitivity),r=t.get(x.scrollPredominantAxis),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+fwe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var qwt=".monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{align-items:center;display:flex;justify-content:center;position:absolute}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}";Ct(qwt,{});class _we{constructor(e,t,i,s,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=s,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Qwt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class jwt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class ZKe extends fO{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const c=a-e;s[c]=new jwt}if(i.length===0)return s;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNames)continue;const l=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(o.preference.lane);t.push(new Jwt(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.laneIndex===s.laneIndex?i.zIndex===s.zIndex?s.type===i.type?i.type===fM.Decoration&&s.type===fM.Decoration?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.laneIndex===s.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===fM.Decoration){const a=[];for(const c of o){if(c.zIndex!==r.zIndex||c.type!==r.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var fM;(function(n){n[n.Decoration=0]="Decoration",n[n.Widget=1]="Widget"})(fM||(fM={}));class Ywt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=s,this.type=fM.Decoration}accept(e){return new Xwt(this.lineNumber,this.laneIndex,e)}}class Jwt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=s,this.type=fM.Widget}}class Xwt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var Zwt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";Ct(Zwt,{});class eYe extends ${constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function dde(n,e){let t=0,i=0;const s=n.length;for(;is)throw new cn("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,c=-1,l=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,c=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){a=F,c=N;break}}}if(l===-2){l=-1,d=-1;for(let F=k;F=0){l=F,d=N;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){u=F,f=N;break}}}if(p!==-1&&(p===-2||p=0){p=F,m=N;break}}}};let w=0,b=!0,C=0,y=!0,S=0,M=0;for(let k=0;b||y;k++){const F=e-k,N=e+k;k>1&&(F<1||F1&&(N>s||N>i)&&(y=!1),k>5e4&&(b=!1,y=!1);let z=-1;if(b&&F>=1){const J=this._computeIndentLevel(F-1);J>=0?(l=F-1,d=J,z=Math.ceil(J/this.textModel.getOptions().indentSize)):(h(F),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let U=-1;if(y&&N<=s){const J=this._computeIndentLevel(N-1);J>=0?(u=N-1,f=J,U=Math.ceil(J/this.textModel.getOptions().indentSize)):(v(N),U=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){M=z;continue}if(k===1){if(N<=s&&U>=0&&M+1===U){b=!1,w=N,C=N,S=U;continue}if(F>=1&&z>=0&&z-1===M){y=!1,w=F,C=F,S=z;continue}if(w=e,C=e,S=M,S===0)return{startLineNumber:w,endLineNumber:C,indent:S}}b&&(z>=S?w=F:b=!1),y&&(U>=S?C=N:y=!1)}return{startLineNumber:w,endLineNumber:C,indent:S}}getLinesBracketGuides(e,t,i,s){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new O(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(O.fromPositions(i)).toArray()).filter(u=>O.strictContainsPosition(u.range,i));c=t1(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new tYe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!s.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(s.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===pM.Enabled||s.horizontalGuides===pM.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new gR(-1,h.openingBracketRange.getEndPosition().column,f,new C$(!1,m.column),-1,-1));continue}const w=this.getVisibleColumnFromPosition(m),b=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(b,w,h.minVisibleColumnIndentation+1);let y=!1;Eu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&b>C&&o[p.lineNumber-e].push(new gR(C,-1,f,new C$(!1,p.column),-1,-1)),m.lineNumber<=t&&w>C&&o[m.lineNumber-e].push(new gR(C,-1,f,new C$(!y,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return Ic.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let c=-2,l=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const f=u-e,p=this._computeIndentLevel(u-1);if(p>=0){c=u-1,l=p,a[f]=Math.ceil(p/s.indentSize);continue}if(c===-2){c=-1,l=-1;for(let m=u-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){c=m,l=v;break}}}if(d!==-1&&(d===-2||d=0){d=m,h=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,l,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:ts||this._maxIndentLeft>0&&p>this._maxIndentLeft)break;const m=f.horizontalLine?f.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",v=f.horizontalLine?(e.visibleRangeForPosition(new oe(c,f.horizontalLine.endColumn))?.left??p+this._spaceWidth)-p:this._spaceWidth;h+=`
      `}a[l]=h}this._renderResult=a}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?pM.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?pM.EnabledForActive:pM.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,c=h.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const f=s?s[h-e]:[],p=new DS(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const w=(v-1)*l+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(y=>y.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function UO(n){if(!(n&&n.isTransparent()))return n}Lm((n,e)=>{const t=[{bracketColor:zKe,guideColor:pwt,guideColorActive:Cwt},{bracketColor:$Ke,guideColor:mwt,guideColorActive:ywt},{bracketColor:GKe,guideColor:_wt,guideColorActive:Swt},{bracketColor:qKe,guideColor:vwt,guideColorActive:Awt},{bracketColor:QKe,guideColor:wwt,guideColorActive:Ewt},{bracketColor:jKe,guideColor:bwt,guideColorActive:xwt}],i=new tYe,s=[{indentColor:uQ,indentColorActive:gQ},{indentColor:Jvt,indentColorActive:iwt},{indentColor:Xvt,indentColorActive:nwt},{indentColor:Zvt,indentColorActive:swt},{indentColor:ewt,indentColorActive:owt},{indentColor:twt,indentColorActive:rwt}],o=t.map(a=>{const c=n.getColor(a.bracketColor),l=n.getColor(a.guideColor),d=n.getColor(a.guideColorActive),h=UO(UO(l)??c?.transparent(.3)),u=UO(UO(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(yl),r=s.map(a=>{const c=n.getColor(a.indentColor),l=n.getColor(a.indentColorActive),d=UO(c),h=UO(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(yl);if(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${c.indentColor}; --indent-color-active: ${c.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});var ibt=".mtkcontrol{background:#960000!important;color:#fff!important}.mtkoverflow{background-color:var(--vscode-button-background,var(--vscode-editor-background));border-color:var(--vscode-contrastBorder);border-radius:2px;border-style:solid;border-width:1px;color:var(--vscode-button-foreground,var(--vscode-editor-foreground));cursor:pointer;padding:4px}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:auto;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{bottom:0;position:absolute;top:0}.monaco-editor .mtkw,.monaco-editor .mtkz{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block}";Ct(ibt,{});class ofe{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class nbt{constructor(){this._currentVisibleRange=new O(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class sbt{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class obt{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new yn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new nbt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(x.stickyScroll).enabled,this._maxNumberStickyLines=s.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new rE(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(x.wrappingInfo)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(x.fontInfo),s=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(x.revealHorizontalRightPadding),this._cursorSurroundingLines=t.get(x.cursorSurroundingLines),this._cursorSurroundingLinesStyle=t.get(x.cursorSurroundingLinesStyle),this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._stickyScrollEnabled=t.get(x.stickyScroll).enabled,this._maxNumberStickyLines=t.get(x.stickyScroll).maxLineCount,Sd(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new wWe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new sbt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new obt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?vt.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new oe(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new ofe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=O.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new ofe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(s.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=s.startLineNumber;h<=s.endLineNumber;h++){if(hd)continue;const u=h===s.startLineNumber?s.startColumn:1,f=h!==s.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):s.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const s=new ofe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new nvt(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),jr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let w=o[0].startLineNumber,b=o[0].endLineNumber;for(let C=1,y=o.length;Cc){if(!d)return-1;v=h}else if(r===Ns.NearTop||r===Ns.NearTopIfOutsideViewport)if(r===Ns.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=Math.max(5*this._lineHeight,c*.2),b=h-w,C=u-c;v=Math.max(C,b)}else if(r===Ns.Center||r===Ns.CenterIfOutsideViewport)if(r===Ns.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=(h+u)/2;v=Math.max(0,w-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===Ns.Top,r===Ns.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=Zn.MAX_SAFE_SMALL_INTEGER,a=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const d of l.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const d=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(r=Math.max(0,r-pae.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}};pae.HORIZONTAL_EXTRA_PX=30;let vwe=pae;var rbt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";Ct(rbt,{});class abt extends ZKe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(x.layoutInfo);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=s[d].getDecorations();let u="";for(const f of h){let p='
      ';o[a]=l}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var dbt=".monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{left:-6px;position:absolute;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{left:-1px;position:absolute;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}";Ct(dbt,{});const hk=class hk{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=hk._clamp(e),this.g=hk._clamp(t),this.b=hk._clamp(i),this.a=hk._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};hk.Empty=new hk(0,0,0,0);let dx=hk;var Bn;(function(n){n[n.START_CH_CODE=32]="START_CH_CODE",n[n.END_CH_CODE=126]="END_CH_CODE",n[n.UNKNOWN_CODE=65533]="UNKNOWN_CODE",n[n.CHAR_COUNT=96]="CHAR_COUNT",n[n.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",n[n.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",n[n.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",n[n.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",n[n.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",n[n.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Bn||(Bn={}));const hbt=(()=>{const n=[];for(let e=Bn.START_CH_CODE;e<=Bn.END_CH_CODE;e++)n.push(e);return n.push(Bn.UNKNOWN_CODE),n})(),ubt=(n,e)=>(n-=Bn.START_CH_CODE,n<0||n>Bn.CHAR_COUNT?e<=2?(n+Bn.CHAR_COUNT)%Bn.CHAR_COUNT:Bn.CHAR_COUNT-1:n),mae=class mae extends ${static getInstance(){return this._INSTANCE||(this._INSTANCE=xU(new mae)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(dc.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=dc.getColorMap();if(!e){this._colors=[dx.Empty],this._backgroundIsLight=!0;return}this._colors=[dx.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Ad.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};mae._INSTANCE=null;let HZ=mae;class e7{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=e7.soften(e,12/15),this.charDataLight=e7.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=ubt(s,l),w=e.width*Bn.RGBA_CHANNELS_CNT,b=a.r,C=a.g,y=a.b,S=o.r-b,M=o.g-C,k=o.b-y,F=Math.max(r,c),N=e.data;let z=v*u*f,U=i*w+t*Bn.RGBA_CHANNELS_CNT;for(let J=0;Je.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*Bn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,w=s.r-p,b=s.g-m,C=s.b-v,y=p+w*f,S=m+b*f,M=v+C*f,k=Math.max(o,a),F=e.data;let N=i*u+t*Bn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=kWe[n[t]]<<4|kWe[n[t+1]]&15;return e},LWe={1:cw(()=>IWe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:cw(()=>IWe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class y${static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return LWe[e]?i=new e7(LWe[e](),e):i=y$.createFromSampleData(y$.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height=`${Bn.SAMPLED_CHAR_HEIGHT}px`,t.height=Bn.SAMPLED_CHAR_HEIGHT,t.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,t.style.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Bn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let s=0;for(const o of hbt)i.fillText(String.fromCharCode(o),s,Bn.SAMPLED_CHAR_HEIGHT/2),s+=Bn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,Bn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Bn.SAMPLED_CHAR_HEIGHT*Bn.SAMPLED_CHAR_WIDTH*Bn.RGBA_CHANNELS_CNT*Bn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const s=y$._downsample(e,t);return new e7(s,t)}static _downsampleChar(e,t,i,s,o){const r=Bn.BASE_CHAR_WIDTH*o,a=Bn.BASE_CHAR_HEIGHT*o;let c=s,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dy$.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Ad.DefaultBackground),this.backgroundColor=RW._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=RW._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(zmt);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor($mt);return t?dx._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Nc);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class S${constructor(e,t,i,s,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=c,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,c,l,d,h){const u=e.pixelRatio,f=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let M=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(M+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/M)),F=Math.max(0,e.minimapHeight-k),N=F/(d-o),z=l*N,U=F>0,J=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new S$(l,d,U,N,z,k,j,1,Math.min(a,J))}let v;if(r&&i!==a){const M=i-t+1;v=Math.floor(M*f/u)}else{const M=o/m;v=Math.floor(M*f/u)}const w=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const M=o/m;b=Math.max(b,M-1)}let C;if(b>0){const M=o/m;C=(w+a+b-M-1)*f/u}else C=Math.max(0,(w+a)*f/u-v);C=Math.min(e.minimapHeight-v,C);const y=C/(d-o),S=l*y;if(p>=w+a+b){const M=C>0;return new S$(l,d,M,y,S,v,w,1,a)}else{let M;t>1?M=t+w:M=Math.max(1,l/m);let k,F=Math.max(1,Math.floor(M-S*u/f));Fl&&(F=Math.min(F,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?U=(t-F+k+z)*f/u:U=l/e.paddingTop*(k+z)*f/u,new S$(l,d,!0,y,U,v,k,F,N)}}}const _ae=class _ae{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};_ae.INVALID=new _ae(-1);let UZ=_ae;class TWe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new KKe(()=>UZ.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let w=0,b=s-1;w0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=t7.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o!s.options.minimap?.sectionHeaderStyle);if(this._samplingState){const s=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),c=this._samplingState.modelLineToMinimapLine(r.endLineNumber);s.push(new cKe(new O(a,r.startColumn,c,r.endColumn),o.options))}return s}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>!!r.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new O(s,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new O(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const s=this._sectionHeaderCache.get(i);if(s)return s;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new O(e,1,e,1),Ns.Center,vt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},vt.Immediate)}}class e2 extends ${constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(fWe),this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ks(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ks(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ks(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ks(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ks(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Xo(this._domNode.domNode,xe.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===Mb.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=ia(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new vz,this._sliderPointerDownListener=Xo(this._slider.domNode,xe.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=dh.addTarget(this._domNode.domNode),this._sliderTouchStartListener=pe(this._domNode.domNode,Eo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=pe(this._domNode.domNode,Eo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Xo(this._domNode.domNode,Eo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=ia(this._domNode.domNode),l=Math.min(Math.abs(a-s),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Is&&l>gbt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new $Me(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(fWe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===Mb.None){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=S$.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(O.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,s,o);const d=new RWe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new RWe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,s),this._renderDecorationsHighlights(l,i,h,e,r,c,a,s),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const c of t){const l=s.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=s.getYForLineNumber(d,o),f=s.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(AC,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(AC,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==xu.Inline)continue;const d=s.intersectWithViewport(c.range);if(!d)continue;const[h,u]=d,f=l.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=r.get(f.toString());p||(p=f.transparent(.5).toString(),r.set(f.toString(),p)),e.fillStyle=p;for(let m=h;m<=u;m++){if(i.has(m))continue;i.set(m,!0);const v=s.getYForLineNumber(h,o);e.fillRect(AC,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=s.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,s,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=s.intersectWithViewport(l.range);if(!h)continue;const[u,f]=h,p=d.getColor(this._theme.value);if(!(!p||p.isTransparent()))for(let m=u;m<=f;m++)switch(d.position){case xu.Inline:this.renderDecorationOnLine(e,i,l.range,p,s,m,o,o,r,a,c);continue;case xu.Gutter:{const v=s.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,fbt,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,c,l,d,h){const u=o.getYForLineNumber(r,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===r?i.startColumn:1,v=p===r?i.endColumn:this._model.getLineMaxColumn(r),w=this.getXOffsetForPosition(t,r,m,l,d,h),b=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,s,w,u,b-w,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return AC;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[AC];let d=AC;for(let h=1;h=r){c[h]=r;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=e2._fitSectionHeader.bind(null,u,r-AC);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,w=v-i,b=w+2,C=this._model.getSectionHeaderText(m,p);e2._renderSectionLabel(u,C,m.options.minimap?.sectionHeaderStyle===V9.Underlined,c,d,r,w,o,v,b)}}static _fitSectionHeader(e,t,i){if(!i)return i;const s="…",o=e.measureText(i).width,r=e.measureText(s).width;if(o<=t||o<=r)return i;const a=i.length,c=o/i.length,l=Math.floor((t-r)/c)-1;let d=Math.ceil(l/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+s+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,s,o,r,a,c,l,d){t&&(e.fillStyle=s,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,AC,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const me=this._lastRenderData._get();return new TWe(e,me.imageData,me.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=e2._renderUntouchedLines(o,e.topPaddingLineCount,t,i,s,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,c),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),v=this._model.options.renderMinimap,w=this._model.options.charRenderer(),b=this._model.options.fontScale,C=this._model.options.minimapCharWidth,S=(v===Mb.Text?Bn.BASE_CHAR_HEIGHT:Bn.BASE_CHAR_HEIGHT+1)*b,M=s>S?Math.floor((s-S)/2):0,k=u.a/255,F=new dx(Math.round((u.r-h.r)*k+h.r),Math.round((u.g-h.g)*k+h.g),Math.round((u.b-h.b)*k+h.b),255);let N=e.topPaddingLineCount*s;const z=[];for(let me=0,De=i-t+1;me=0&&Ub)return;const J=v.charCodeAt(S);if(J===Q.Tab){const j=u-(S+M)%u;M+=j-1,y+=j*r}else if(J===Q.Space)y+=r;else{const j=c1(J)?2:1;for(let re=0;reb)return}}}}}class RWe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var mbt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";Ct(mbt,{});class _bt extends Cp{constructor(e,t){super(e),this._viewDomNode=t;const s=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=s.verticalScrollbarWidth,this._minimapWidth=s.minimap.minimapWidth,this._horizontalScrollbarHeight=s.horizontalScrollbarHeight,this._editorHeight=s.height,this._editorWidth=s.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ks(document.createElement("div")),Xb.write(this.overflowingOverlayWidgetsDomNode,Da.OverflowingOverlayWidgets),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=ks(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],s=t?t.preference:null,o=t?.stackOridinal;return i.preference===s&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=s,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,s=t.length;i0);t.sort((s,o)=>(this._widgets[s].stack||0)-(this._widgets[o].stack||0));for(let s=0,o=t.length;s=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,c=e,l=c+o,d=c+o+a;return[[0,c,l,c,d,c,l,c],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,c=a+o;return[[0,a,a,a,c,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&fe.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}var wwe;(function(n){n[n.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(wwe||(wwe={}));var VZ;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(VZ||(VZ={}));var Zw;(function(n){n[n.NotNeeded=0]="NotNeeded",n[n.Maybe=1]="Maybe",n[n.Needed=2]="Needed"})(Zw||(Zw={}));class wbt extends Cp{constructor(e){super(e),this._actualShouldRender=Zw.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=dc.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new oe(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new vbt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=Zw.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Zw.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(s=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:s})}return this._cursorPositions.sort((t,i)=>oe.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=Zw.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?fe.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(q9.compareByRenderingProps),this._actualShouldRender===Zw.Maybe&&!q9.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe&&!Ls(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=s/a,l=wwe.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):(h.clearRect(0,0,i,s),h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):h.clearRect(0,0,i,s);const u=this._settings.x,f=this._settings.w;for(const p of t){const m=p.color,v=p.data;h.fillStyle=m;let w=0,b=0,C=0;for(let y=0,S=v.length/3;ys&&(J=s-d),N=J-d,z=J+d}N>C+1||M!==w?(y!==0&&h.fillRect(u[w],b,f[w],C-b),w=M,b=N,C=z):z>C&&(C=z)}h.fillRect(u[w],b,f[w],C-b)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[VZ.Full],w=this._settings.w[VZ.Full];let b=-100,C=-100,y=null;for(let S=0,M=this._cursorPositions.length;Ss&&(N=s-m);const z=N-m,U=z+p;z>C+1||k!==y?(S!==0&&y&&h.fillRect(v,b,w,C-b),b=z,C=U):U>C&&(C=U),y=k,h.fillStyle=k}y&&h.fillRect(v,b,w,C-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,s),h.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}var bwe;(function(n){n[n.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(bwe||(bwe={}));class MWe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class nYe{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-v);const w=d.color;let b=this._color2Id[w];b||(b=++this._lastAssignedId,this._color2Id[w]=b,this._id2Color[b]=w);const C=new MWe(m-v,m+v,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(MWe.compare),a}}class Cbt extends dQ{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new bbt(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(x.lineHeight)),this._zoneManager.setPixelRatio(i.get(x.pixelRatio)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(x.lineHeight)&&(this._zoneManager.setLineHeight(t.get(x.lineHeight)),this._render()),e.hasChanged(x.pixelRatio)&&(this._zoneManager.setPixelRatio(t.get(x.pixelRatio)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==o?(e.fillRect(0,r,s,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,s,a-r),r=d,a=h)}e.fillRect(0,r,s,a-r)}}var ybt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";Ct(ybt,{});class Sbt extends Cp{constructor(e){super(e),this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=ks(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(x.layoutInfo);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.scrollbar);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var xbt=".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}";Ct(xbt,{});var Ec;(function(n){n[n.EXTERN=0]="EXTERN",n[n.INTERN=1]="INTERN",n[n.FLAT=2]="FLAT"})(Ec||(Ec={}));class Dbt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class kbt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Ibt(n){return new Dbt(n)}function Lbt(n){return new kbt(n.lineNumber,n.ranges.map(Ibt))}const Pa=class Pa extends fO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!o&&l=0;l--)i[l].lineNumber===c&&(r=i[l].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,c=t.length;a0){const p=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Bj(d-p)p&&(u.top=Ec.INTERN),Bj(h-m)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=s[0].lineNumber,a=s[s.length-1].lineNumber;for(let c=0,l=s.length;c1,l)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};Pa.SELECTION_CLASS_NAME="selected-text",Pa.SELECTION_TOP_LEFT="top-left-radius",Pa.SELECTION_BOTTOM_LEFT="bottom-left-radius",Pa.SELECTION_TOP_RIGHT="top-right-radius",Pa.SELECTION_BOTTOM_RIGHT="bottom-right-radius",Pa.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",Pa.ROUNDED_PIECE_WIDTH=10;let Cwe=Pa;Lm((n,e)=>{const t=n.getColor(Amt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Bj(n){return n<0?-n:n}var Tbt=".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{box-sizing:border-box;overflow:hidden;position:absolute}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:2px}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:1px}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}";Ct(Tbt,{});class NWe{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}var DE;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(DE||(DE={}));class PWe{constructor(e,t){this._context=e;const i=this._context.configuration.options,s=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(`cursor ${lx}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Sd(this._domNode,s),this._domNode.setDisplay("none"),this._position=new oe(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case DE.Single:this._pluralityClass="";break;case DE.MultiPrimary:this._pluralityClass="cursor-primary";break;case DE.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.fontInfo);return this._cursorStyle=t.get(x.cursorStyle),this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),Sd(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=bQe(i,t-1);return[new oe(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fa.Line||this._cursorStyle===fa.LineThin){const u=e.visibleRangeForPosition(s);if(!u||u.outsideRenderedLine)return null;const f=gt(this._domNode.domNode);let p;this._cursorStyle===fa.Line?(p=v2e(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(s))):p=v2e(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const w=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new NWe(w,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new O(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=o===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===fa.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===fa.Underline||this._cursorStyle===fa.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new NWe(d,c.left,0,l,h,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${lx} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}const q8=class q8 extends Cp{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new PWe(this._context,DE.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ks(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new O_,this._cursorFlatBlinkInterval=new sQ,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},q8.BLINK_INTERVAL,gt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},q8.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fa.Line:e+=" cursor-line-style";break;case fa.Block:e+=" cursor-block-style";break;case fa.Underline:e+=" cursor-underline-style";break;case fa.LineThin:e+=" cursor-line-thin-style";break;case fa.BlockOutline:e+=" cursor-block-outline-style";break;case fa.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case xh.Blink:e+=" cursor-blink";break;case xh.Smooth:e+=" cursor-smooth";break;case xh.Phase:e+=" cursor-phase";break;case xh.Expand:e+=" cursor-expand";break;case xh.Solid:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:tS,background:EE},{class:".cursor-primary",foreground:HKe,background:jvt},{class:".cursor-secondary",foreground:UKe,background:Kvt}];for(const i of t){const s=n.getColor(i.foreground);if(s){let o=n.getColor(i.background);o||(o=s.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${s}; border-color: ${s}; color: ${o}; }`),pS(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const rfe=()=>{throw new Error("Invalid change accessor")};class Rbt extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._lineHeight=t.get(x.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ks(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ks(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Mbt(e,s),s.addZone=rfe,s.removeZone=rfe,s.layoutZone=rfe}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ks(t.domNode),marginDomNode:t.marginDomNode?ks(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){bt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){bt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=u.startLineNumber===a?u.startColumn:l.minColumn,p=u.endLineNumber===a?u.endColumn:l.maxColumn;f=z.endOffset&&(N++,z=i&&i[N]),j!==Q.Tab&&j!==Q.Space||u&&!M&&J<=F)continue;if(h&&J>=k&&J<=F&&j===Q.Space){const me=J-1>=0?a.charCodeAt(J-1):Q.Null,De=J+1=0?a.charCodeAt(J-1):Q.Null;if(j===Q.Space&&me!==Q.Space&&me!==Q.Tab)continue}if(i&&(!z||z.startOffset>J||z.endOffset<=J))continue;const re=e.visibleRangeForPosition(new oe(t,J+1));re&&(r?(U=Math.max(U,re.left),j===Q.Tab?S+=this._renderArrow(f,v,re.left):S+=``):j===Q.Tab?S+=`
      ${y?"→":"→"}
      `:S+=`
      ${String.fromCharCode(C)}
      `)}return r?(U=Math.round(U+v),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,c={x:0,y:s/2},l={x:100/125*o,y:c.y},d={x:l.x-.2*l.x,y:l.y+.2*l.x},h={x:d.x+.1*l.x,y:d.y+.1*l.x},u={x:h.x+.35*l.x,y:h.y-.35*l.x},f={x:u.x,y:-u.y},p={x:h.x,y:-h.y},m={x:d.x,y:-d.y},v={x:l.x,y:-l.y},w={x:c.x,y:-c.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class FWe{constructor(e){const t=e.options,i=t.get(x.fontInfo),s=t.get(x.experimentalWhitespaceRendering);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!0):(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(x.lineHeight),this.stopRenderingLineAfter=t.get(x.stopRenderingLineAfter)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class Fbt{constructor(e,t,i,s){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=s,this.visibleRange=new O(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class Obt{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class Bbt{constructor(e,t,i){this.configuration=e,this.theme=new Obt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let Swe=class extends dQ{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new mt(1,1,1,1)],this._renderAnimationFrame=null;const c=new Rwt(t,s,o,e);this._context=new Bbt(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(pwe,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ks(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ks(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ks(document.createElement("div")),Xb.write(this._overflowGuardContainer,Da.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Gwt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new vwe(this._context,this._linesContent),this._viewZones=new Rbt(this._context),this._viewParts.push(this._viewZones);const l=new wbt(this._context);this._viewParts.push(l);const d=new Ebt(this._context);this._viewParts.push(d);const h=new Nwt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Uwt(this._context)),h.addDynamicOverlay(new Cwe(this._context)),h.addDynamicOverlay(new tbt(this._context)),h.addDynamicOverlay(new $wt(this._context)),h.addDynamicOverlay(new Pbt(this._context));const u=new Pwt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Vwt(this._context)),u.addDynamicOverlay(new lbt(this._context)),u.addDynamicOverlay(new abt(this._context)),u.addDynamicOverlay(new BZ(this._context)),this._glyphMarginWidgets=new Kwt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new WZ(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(u.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Bwt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ywe(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _bt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new Sbt(this._context);this._viewParts.push(p);const m=new Owt(this._context);this._viewParts.push(m);const v=new pbt(this._context);if(this._viewParts.push(v),l){const w=this._scrollbar.getOverviewRulerLayoutInfo();w.parent.insertBefore(l.getDomNode(),w.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new $vt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],s=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??FS.Center;return s=Math.max(s,o.range.endLineNumber),{range:o.range,lane:r,persist:o.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return s=Math.max(s,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>O.compareRangesUsingStarts(o.range,r.range)),t.reset(s);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new cvt(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new oe(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(x.layoutInfo);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(x.editorClassName)+" "+fwe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new cn;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Awe.INSTANCE.scheduleCoordinatedRendering({window:gt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new cn;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new cn;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Gk(()=>e.prepareRenderText());const t=Gk(()=>e.renderText());if(t){const[i,s]=t;Gk(()=>e.prepareRender(i,s)),Gk(()=>e.render(i,s))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Hk.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Fbt(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new tvt(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},vt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?lde.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Cbt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}refreshFocusState(){this._textAreaHandler.refreshFocusState()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};Swe=D([_(6,be)],Swe);function Gk(n){try{return n()}catch(e){return bt(e),null}}const vae=class vae{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,s]of this._animationFrameRunners)s.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,wZ(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Gk(()=>i.prepareRenderText());const t=[];for(let i=0,s=e.length;io.renderText())}for(let i=0,s=e.length;io.prepareRender(a,c))}for(let i=0,s=e.length;io.render(a,c))}}};vae.INSTANCE=new vae;let Awe=vae;class A${constructor(e,t,i,s,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=s,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===jo.Left)if(e<=r)s=o-1;else if(e>c)i=o+1;else break;else if(e=c)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Wj(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===jo.Left){if(e>0&&t===this.getMinOutputOffset(e))return new Wj(e-1,this.getMaxOutputOffset(e-1))}else if(i===jo.Right){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===jo.None){if(e===i.offsetInInputWithInjections+i.length&&OWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(BWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(OWe(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,BWe(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===jo.Right||t===jo.RightOfInjectedText){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}oQ()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function OWe(n){return n==null?!0:n===Bv.Right||n===Bv.Both}function BWe(n){return n==null?!0:n===Bv.Left||n===Bv.Both}class Wj{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new oe(e+this.outputLineIndex,this.outputOffset+1)}}var Yp;(function(n){n[n.Flush=1]="Flush",n[n.LineChanged=2]="LineChanged",n[n.LinesDeleted=3]="LinesDeleted",n[n.LinesInserted=4]="LinesInserted",n[n.EOLChanged=5]="EOLChanged"})(Yp||(Yp={}));class Wbt{constructor(){this.changeType=Yp.Flush}}class iw{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new iw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new iw(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}withText(e){return new iw(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class WWe{constructor(e,t,i){this.changeType=Yp.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Hbt{constructor(e,t){this.changeType=Yp.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Ubt{constructor(e,t,i,s){this.changeType=Yp.LinesInserted,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Vbt{constructor(){this.changeType=Yp.EOLChanged}}class MW{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;tn});class GMe{static create(e){return new GMe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>$bt(ws(this.targetWindow.deref()),r,e,t,i,s,o,a)}}}function $bt(n,e,t,i,s,o,r,a){function c(N){const z=a[N];if(z){const U=iw.applyInjectedText(e[N],z),J=z.map(re=>re.options),j=z.map(re=>re.column-1);return new A$(j,J,[U.length],[],0)}else return null}if(s===-1){const N=[];for(let z=0,U=e.length;zl?(U=0,J=0):j=l-De}const re=z.substr(U),me=Gbt(re,J,i,j,p,u);m[N]=U,v[N]=J,w[N]=re,b[N]=me[0],C[N]=me[1]}const y=p.build(),S=zbt?.createHTML(y)??y;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),n.document.body.appendChild(f);const M=document.createRange(),k=Array.prototype.slice.call(f.children,0),F=[];for(let N=0;NOe.options),Qe=Tt.map(Oe=>Oe.column-1)):(De=null,Qe=null),F[N]=new A$(Qe,De,U,me,j)}return n.document.body.removeChild(f),F}var fR;(function(n){n[n.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(fR||(fR={}));function Gbt(n,e,t,i,s,o){if(o!==0){const u=String(o);s.appendString('
      ');const r=n.length;let a=e,c=0;const l=[],d=[];let h=0");for(let u=0;u"),l[u]=c,d[u]=a;const f=h;h=u+1"),l[n.length]=c,d[n.length]=a,s.appendString("
      "),[l,d]}function qbt(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{Ewe(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function Ewe(n,e,t,i,s,o,r,a){if(i===o||(s=s||afe(n,e,t[i],t[i+1]),r=r||afe(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=afe(n,e,t[c],t[c+1]);Ewe(n,e,t,i,s,c,l,a),Ewe(n,e,t,c,l,o,r,a)}function afe(n,e,t,i){return n.setStart(e[t/fR.SPAN_MODULO_LIMIT|0].firstChild,t%fR.SPAN_MODULO_LIMIT),n.setEnd(e[i/fR.SPAN_MODULO_LIMIT|0].firstChild,i%fR.SPAN_MODULO_LIMIT),n.getClientRects()}class Qbt extends ${constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Zo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[mi.Eager]=!1,this._finishedInstantiation[mi.AfterFirstRender]=!1,this._finishedInstantiation[mi.BeforeFirstInteraction]=!1,this._finishedInstantiation[mi.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){bt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(mi.Eager),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.BeforeFirstInteraction)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.Eventually)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}set(e,t){this._instances.set(e,t)}onBeforeInteractionEvent(){this._instantiateSome(mi.BeforeFirstInteraction)}onAfterModelAttached(){return UB(gt(this._editor?.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==mi.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){bt(i)}}}}class oYe{constructor(e,t,i,s,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=s,this._precondition=o,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var qu;(function(n){n.EditorHintDecoration="squiggly-hint",n.EditorInfoDecoration="squiggly-info",n.EditorWarningDecoration="squiggly-warning",n.EditorErrorDecoration="squiggly-error",n.EditorUnnecessaryDecoration="squiggly-unnecessary",n.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",n.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(qu||(qu={}));var ps;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ps||(ps={}));var Do;(function(n){n[n.ColorMask=1]="ColorMask",n[n.ColorMaskInverse=254]="ColorMaskInverse",n[n.ColorOffset=0]="ColorOffset",n[n.IsVisitedMask=2]="IsVisitedMask",n[n.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",n[n.IsVisitedOffset=1]="IsVisitedOffset",n[n.IsForValidationMask=4]="IsForValidationMask",n[n.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",n[n.IsForValidationOffset=2]="IsForValidationOffset",n[n.StickinessMask=24]="StickinessMask",n[n.StickinessMaskInverse=231]="StickinessMaskInverse",n[n.StickinessOffset=3]="StickinessOffset",n[n.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",n[n.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",n[n.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",n[n.IsMarginMask=64]="IsMarginMask",n[n.IsMarginMaskInverse=191]="IsMarginMaskInverse",n[n.IsMarginOffset=6]="IsMarginOffset",n[n.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",n[n.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(Do||(Do={}));function Tg(n){return(n.metadata&Do.ColorMask)>>>Do.ColorOffset}function vr(n,e){n.metadata=n.metadata&Do.ColorMaskInverse|e<>>Do.IsVisitedOffset===1}function dr(n,e){n.metadata=n.metadata&Do.IsVisitedMaskInverse|(e?1:0)<>>Do.IsForValidationOffset===1}function HWe(n,e){n.metadata=n.metadata&Do.IsForValidationMaskInverse|(e?1:0)<>>Do.IsMarginOffset===1}function UWe(n,e){n.metadata=n.metadata&Do.IsMarginMaskInverse|(e?1:0)<>>Do.StickinessOffset}function VWe(n,e){n.metadata=n.metadata&Do.StickinessMaskInverse|e<>>Do.CollapseOnReplaceEditOffset===1}function zWe(n,e){n.metadata=n.metadata&Do.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===fb.ForceMove?!1:i===fb.ForceStay?!0:e}function Jbt(n,e,t,i,s){const o=jbt(n),r=o===gi.AlwaysGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,a=o===gi.NeverGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=n.start;let u=!1;const f=n.end;let p=!1;e<=h&&f<=t&&Kbt(n)&&(n.start=e,u=!0,n.end=e,p=!0);{const v=s?fb.ForceMove:c>0?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e,v)&&(u=!0),!p&&VO(f,a,e,v)&&(p=!0)}if(d>0&&!s){const v=c>l?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e+d,v)&&(u=!0),!p&&VO(f,a,e+d,v)&&(p=!0)}{const v=s?fb.ForceMove:fb.MarkerDefined;!u&&VO(h,r,t,v)&&(n.start=e+l,u=!0),!p&&VO(f,a,t,v)&&(n.end=e+l,p=!0)}const m=l-c;u||(n.start=Math.max(0,h+m)),p||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function Xbt(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==fn;){if(rh(i)){dr(i.left,!1),dr(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!rh(i.left)){if(o=s+i.maxEnd,ot){dr(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),dr(i,!0),i.right!==fn&&!rh(i.right)){s+=i.delta,i=i.right;continue}}return dr(n.root,!1),c}function Zbt(n,e,t,i){let s=n.root,o=0,r=0,a=0;const c=i-(t-e);for(;s!==fn;){if(rh(s)){dr(s.left,!1),dr(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),p1(s),s=s.parent;continue}if(!rh(s.left)){if(r=o+s.maxEnd,rt){s.start+=c,s.end+=c,s.delta+=c,(s.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),dr(s,!0);continue}if(dr(s,!0),s.right!==fn&&!rh(s.right)){o+=s.delta,s=s.right;continue}}dr(n.root,!1)}function eCt(n,e){let t=n.root;const i=[];let s=0;for(;t!==fn;){if(rh(t)){dr(t.left,!1),dr(t.right,!1),t=t.parent;continue}if(t.left!==fn&&!rh(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),dr(t,!0),t.right!==fn&&!rh(t.right)){t=t.right;continue}}return dr(n.root,!1),i}function tCt(n){let e=n.root;const t=[];let i=0;for(;e!==fn;){if(rh(e)){dr(e.left,!1),dr(e.right,!1),e=e.parent;continue}if(e.left!==fn&&!rh(e.left)){e=e.left;continue}if(e.right!==fn&&!rh(e.right)){e=e.right;continue}t[i++]=e,dr(e,!0)}return dr(n.root,!1),t}function $We(n,e,t,i,s){let o=n.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==fn;){if(rh(o)){dr(o.left,!1),dr(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==fn&&!rh(o.left)){o=o.left;continue}a=r+o.start,c=r+o.end,o.setCachedOffsets(a,c,i);let h=!0;if(e&&o.ownerId&&o.ownerId!==e&&(h=!1),t&&rYe(o)&&(h=!1),s&&!aYe(o)&&(h=!1),h&&(l[d++]=o),dr(o,!0),o.right!==fn&&!rh(o.right)){r+=o.delta,o=o.right;continue}}return dr(n.root,!1),l}function iCt(n,e,t,i,s,o,r){let a=n.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==fn;){if(rh(a)){dr(a.left,!1),dr(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!rh(a.left)){if(l=c+a.maxEnd,lt){dr(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,o);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),s&&rYe(a)&&(p=!1),r&&!aYe(a)&&(p=!1),p&&(u[f++]=a)}if(dr(a,!0),a.right!==fn&&!rh(a.right)){c+=a.delta,a=a.right;continue}}return dr(n.root,!1),u}function GWe(n,e){if(n.root===fn)return e.parent=fn,e.left=fn,e.right=fn,vr(e,ps.Black),n.root=e,n.root;nCt(n,e),ID(e.parent);let t=e;for(;t!==n.root&&Tg(t.parent)===ps.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,E$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),x$(n,t.parent.parent))}else{const i=t.parent.parent.left;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,x$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),E$(n,t.parent.parent))}return vr(n.root,ps.Black),e}function nCt(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(oCt(s,o,i.start+t,i.end+t)<0)if(i.left===fn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===fn){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=fn,e.right=fn,vr(e,ps.Red)}function qWe(n,e){let t,i;if(e.left===fn?(t=e.right,i=e,t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===fn?(t=e.left,i=e):(i=sCt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,vr(t,ps.Black),e.detach(),lfe(),p1(t),n.root.parent=fn;return}const s=Tg(i)===ps.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,vr(i,Tg(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==fn&&(i.left.parent=i),i.right!==fn&&(i.right.parent=i)),e.detach(),s){ID(t.parent),i!==e&&(ID(i),ID(i.parent)),lfe();return}ID(t),ID(t.parent),i!==e&&(ID(i),ID(i.parent));let o;for(;t!==n.root&&Tg(t)===ps.Black;)t===t.parent.left?(o=t.parent.right,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),E$(n,t.parent),o=t.parent.right),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.right)===ps.Black&&(vr(o.left,ps.Black),vr(o,ps.Red),x$(n,o),o=t.parent.right),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.right,ps.Black),E$(n,t.parent),t=n.root)):(o=t.parent.left,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),x$(n,t.parent),o=t.parent.left),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.left)===ps.Black&&(vr(o.right,ps.Black),vr(o,ps.Red),E$(n,o),o=t.parent.left),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.left,ps.Black),x$(n,t.parent),t=n.root));vr(t,ps.Black),lfe()}function sCt(n){for(;n.left!==fn;)n=n.left;return n}function lfe(){fn.parent=fn,fn.delta=0,fn.start=0,fn.end=0}function E$(n,e){const t=e.right;t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==fn&&(t.left.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,p1(e),p1(t)}function x$(n,e){const t=e.left;e.delta-=t.delta,(e.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==fn&&(t.right.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,p1(e),p1(t)}function lYe(n){let e=n.end;if(n.left!==fn){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==fn){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function p1(n){n.maxEnd=lYe(n)}function ID(n){for(;n!==fn;){const e=lYe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function oCt(n,e,t,i){return n===t?e-i:n-t}var kE;(function(n){n[n.Unknown=0]="Unknown",n[n.Invalid=3]="Invalid",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(kE||(kE={}));function Gb(n){let e=0,t=0,i=0,s=kE.Unknown;for(let o=0,r=n.length;o=gm&&(t=t-n%gm),t}function dCt(n,e){return n.reduce((t,i)=>ta(t,e(i)),og)}function dYe(n,e){return n===e}function i7(n,e){const t=n,i=e;if(i-t<=0)return og;const o=Math.floor(t/gm),r=Math.floor(i/gm),a=i-r*gm;if(o===r){const c=t-o*gm;return cc(0,a-c)}else return cc(r-o,a)}function NW(n,e){return n=e}function t2(n){return cc(n.lineNumber-1,n.column-1)}function _M(n,e){const t=n,i=Math.floor(t/gm),s=t-i*gm,o=e,r=Math.floor(o/gm),a=o-r*gm;return new O(i+1,s+1,r+1,a+1)}function hCt(n){const e=xw(n);return cc(e.length-1,e[e.length-1].length)}const Hj=[],Gm=class Gm{static create(e,t){if(e<=128&&t.length===0){let i=Gm.cache[e];return i||(i=new Gm(e,t),Gm.cache[e]=i),i}return new Gm(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let s=i>>5;if(s===0){const r=1<>5;return s===0?(this.items&1<i===e)?.[0]}reverseLookupSet(e){const t=[];for(const[i]of this.items)e.has(i,this)&&t.push(i);return t}keys(){return this.items.keys()}}var lr;(function(n){n[n.Text=0]="Text",n[n.Bracket=1]="Bracket",n[n.Pair=2]="Pair",n[n.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",n[n.List=4]="List"})(lr||(lr={}));class qMe{get length(){return this._length}constructor(e){this._length=e}}class FW extends qMe{static create(e,t,i){let s=e.length;return t&&(s=ta(s,t.length)),i&&(s=ta(s,i.length)),new FW(s,e,t,i,t?t.missingOpeningBracketIds:np.getEmpty())}get kind(){return lr.Pair}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,s,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=s,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return FW.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new FW(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(ta(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class mw extends qMe{static create23(e,t,i,s=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=ta(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=ta(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return s?new uCt(o,e.listHeight+1,e,t,i,r):new n7(o,e.listHeight+1,e,t,i,r)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,s=e[0].missingOpeningBracketIds;for(let o=1;o{const s=O.lift(i.range);return new IE(t2(s.getStartPosition()),t2(s.getEndPosition()),hCt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${C_(this.startOffset)}...${C_(this.endOffset)}) -> ${C_(this.newLength)}`}}class pCt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>jMe.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:i7(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?cc(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):cc(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=C_(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?cc(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):cc(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdxthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=cCt(e,t,this.lineIdx,this.lineCharOffset);return new wk(s,Jg.Text,-1,np.getEmpty(),new AT(s))}}class _Ct{constructor(e,t){this.text=e,this._offset=og,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| -`,"gi"):null,o=[];let r,a=0,c=0,l=0,d=0;const h=[];for(let p=0;p<60;p++)h.push(new wk(cc(0,p),Jg.Text,-1,np.getEmpty(),new AT(cc(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new wk(cc(1,p),Jg.Text,-1,np.getEmpty(),new AT(cc(1,p))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const p=r.index,m=r[0];if(m===` -`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const w=p-l;if(wvCt(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===Jg.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function vCt(n){let e=Iu(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class gYe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=KMe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function wCt(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?fYe(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())YWe(i,s)<=YWe(s,r)?(i=dfe(i,s),s=r):s=dfe(s,r);return dfe(i,s)}function fYe(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function YWe(n,e){return Math.abs(n.listHeight-e.listHeight)}function dfe(n,e){return n.listHeight===e.listHeight?mw.create23(n,e,null,!1):n.listHeight>e.listHeight?bCt(n,e):CCt(e,n)}function bCt(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(n,s,null,!1):n}function CCt(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(s,n,null,!1):n}class yCt{constructor(e){this.lastOffset=og,this.nextNodes=[e],this.offsets=[og],this.idxs=[]}readLongestNodeAt(e,t){if(NW(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u5(this.nextNodes);if(!i)return;const s=u5(this.offsets);if(NW(e,s))return;if(NW(s,e))if(ta(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=hfe(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=hfe(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=u5(this.offsets),t=u5(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u5(this.nextNodes),s=hfe(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(ta(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function hfe(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u5(n){return n.length>0?n[n.length-1]:void 0}function xwe(n,e,t,i){return new SCt(n,e,t,i).parseDocument()}let SCt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new yCt(i):void 0,this.positionMapper=new pCt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(np.getEmpty(),0);return e||(e=mw.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Jg.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===lr.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?wCt(i):fYe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!zZ(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!NW(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case Jg.ClosingBracket:return new fCt(i.bracketIds,i.length);case Jg.Text:return i.astNode;case Jg.OpeningBracket:{if(t>300)return new AT(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===Jg.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),FW.create(i.astNode,o,r.astNode)):FW.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var RI;(function(n){n[n.InProgress=1]="InProgress",n[n.Completed=2]="Completed"})(RI||(RI={}));function GZ(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new DS(JWe(n)),i=JWe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return s&&h.unshift(s),h}const d=[];for(;s&&!zZ(l);){const[h,u]=s.splitAt(l);d.push(h),l=i7(h.lengthAfter,l),s=u??t.dequeue()}return zZ(l)||d.push(new qk(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&dYe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new IE(u.startOffset,d,ta(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=og;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=dCt(d,f=>f.lengthBefore),u=ta(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=ta(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class qk{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=i7(e,this.lengthAfter);return dYe(t,og)?[this,void 0]:this.modified?[new qk(this.modified,this.lengthBefore,e),new qk(this.modified,og,t)]:[new qk(this.modified,e,e),new qk(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${C_(this.lengthBefore)} -> ${C_(this.lengthAfter)}`}}function JWe(n){const e=[];let t=og;for(const i of n){const s=i7(t,i.startOffset);zZ(s)||e.push(new qk(!1,s,s));const o=i7(i.startOffset,i.endOffset);e.push(new qk(!0,o,i.newLength)),t=i.endOffset}return e}class ACt extends ${didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new I,this.denseKeyProvider=new hYe,this.brackets=new gYe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===RI.Completed?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new _Ct(this.textModel.getValue(),i);this.initialAstWithoutTokens=xwe(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===RI.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new IE(cc(i.fromLineNumber-1,0),cc(i.toLineNumber,0),cc(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=IE.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=GZ(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=GZ(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new uYe(this.textModel,this.brackets);return xwe(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=cc(e.startLineNumber-1,e.startColumn-1),s=cc(e.endLineNumber-1,e.endColumn-1);return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;Dwe(r,og,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=t2(e.getStartPosition()),s=t2(e.getEndPosition());return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new ECt(o,t,this.textModel);kwe(r,og,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return mYe(t,og,t.length,t2(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pYe(t,og,t.length,t2(e))}}function pYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){const s=[];for(const o of n.children)t=ta(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(NW(r,i)){const c=pYe(n.children[o],r,a,i);if(c)return c}}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function mYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){for(const s of n.children){if(t=ta(e,s.length),NW(i,t)){const o=mYe(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function Dwe(n,e,t,i,s,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case lr.List:{const h=n.childrenLength;for(let u=0;u200)return!0;let c=!0;if(n.kind===lr.Pair){let l=0;if(a){let u=a.get(n.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(n.openingBracket.text,u)}const d=ta(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new aCt(_M(e,t),_M(e,d),n.closingBracket?_M(ta(d,n.child?.length||og),t):void 0,r,l,n,h)),e=d,c&&n.child){const u=n.child;if(t=ta(e,u.length),PW(e,s)&&m3(t,i)&&(c=kwe(u,e,t,i,s,o,r+1,a),!c))return!1}a?.set(n.openingBracket.text,l)}else{let l=e;for(const d of n.children){const h=l;if(l=ta(l,d.length),PW(h,s)&&PW(i,l)&&(c=kwe(d,h,l,i,s,o,r,a),!c))return!1}}return c}class xCt extends ${get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Dn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{(!i.languageId||this.bracketPairsTree.value?.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Z;this.bracketPairsTree.value=DCt(e.add(new ACt(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||oM.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||oM.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||oM.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(O.fromPositions(t,t)).findLast(c=>r.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const c=a.textIsBracket[r];return c?Uj(this._findMatchingBracketUp(c,s,ufe(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(O.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(El(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,O.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=ufe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=s-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=s+1;l=c)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!EC(s.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const h=Y_.findNextBracketInRange(a.forwardRegex,i,o,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof VA)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(c)).brackets;if(l&&!EC(s.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,s,l,c),u=Y_.findPrevBracketInRange(l.reversedRegex,i,o,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof VA?null:p}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof VA?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const f=Y_.findPrevBracketInRange(o,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const d=this.textModel.tokenization.getLineTokens(l),h=d.getCount(),u=this.textModel.getLineContent(l);let f=h-1,p=u.length,m=u.length;l===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const w=d.getLanguageId(f)===s&&!EC(d.getStandardTokenType(f));if(w)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}v=w}if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const p=Y_.findNextBracketInRange(o,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return p;u=p.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let p=0,m=0,v=0;d===t.lineNumber&&(p=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let w=!0;for(;p=1;r--){const a=this.textModel.tokenization.getLineTokens(r),c=a.getCount(),l=this.textModel.getLineContent(r);let d=c-1,h=l.length,u=l.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const p=a.getLanguageId(d);i!==p&&(i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(s&&o&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!s&&!EC(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&s&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&s&&f&&h!==u){const p=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(p)return this._toFoundBracket(o,p)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=t.lineNumber;a<=i;a++){const c=this.textModel.tokenization.getLineTokens(a),l=c.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=c.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const m=c.getLanguageId(h);s!==m&&(s=m,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const s=ufe(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,w=p?p.brackets.length:0;v{for(;;){if(s&&++l%100===0&&!s())return VA.INSTANCE;const b=Y_.findNextBracketInRange(f.forwardRegex,p,m,v,w);if(!b)break;const C=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),y=f.textIsBracket[C];if(y&&(y.isOpen(C)?a[y.index]++:y.isClose(C)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(b,y,!1,s);v=b.endColumn-1}return null};let h=null,u=null;for(let f=i.lineNumber;f<=o;f++){const p=this.textModel.tokenization.getLineTokens(f),m=p.getCount(),v=this.textModel.getLineContent(f);let w=0,b=0,C=0;if(f===i.lineNumber){w=p.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const S=p.getLanguageId(w);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let y=!0;for(;we?.dispose()}}function ufe(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}const wae=class wae{constructor(){this._searchCanceledBrand=void 0}};wae.INSTANCE=new wae;let VA=wae;function Uj(n){return n instanceof VA?null:n}class kCt extends ${constructor(e){super(),this.textModel=e,this.colorProvider=new _Ye,this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new O(1,1,this.textModel.getLineCount(),1),e,t):[]}}class _Ye{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Lm((n,e)=>{const t=[zKe,$Ke,GKe,qKe,QKe,jKe],i=new _Ye;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(fwt)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var wd;(function(n){n[n.Resource=0]="Resource",n[n.Workspace=1]="Workspace"})(wd||(wd={}));class vYe{constructor(e,t){this.resource=e,this.elements=t}}const H2=class H2{constructor(){this.id=H2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};H2._ID=0,H2.None=new H2;let qZ=H2;const U2=class U2{constructor(){this.id=U2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};U2._ID=0,U2.None=new U2;let ET=U2;function Vj(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class $d{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Vj(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Vj(this.oldText)}")`:`(replace@${this.oldPosition} "${Vj(this.oldText)}" with "${Vj(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Wg(e,s,i),i+=4;for(let o=0;o0&&(this.changes=ICt(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Wg(e,t?t.length:0,i),i+=4,t)for(const s of t)Wg(e,s.selectionStartLineNumber,i),i+=4,Wg(e,s.selectionStartColumn,i),i+=4,Wg(e,s.positionLineNumber,i),i+=4,Wg(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Bg(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(P.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Vl}append(e,t,i,s,o){this._data instanceof Vl&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Vl&&(this._data=this._data.serialize())}open(){this._data instanceof Vl||(this._data=Vl.deserialize(this._data))}undo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Vl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class TCt{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=wd.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=zO(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}setDelegate(e){this._delegate=e}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}getMissingModels(){const e=[];for(const t of this._editStackElementsArr)P.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=zO(e);return this._editStackElementsMap.has(t)}setModel(e){const t=zO(P.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=zO(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=zO(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=zO(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ui(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Iwe(n){return n.getEOL()===` -`?bu.LF:bu.CRLF}function zA(n){return n?n instanceof wYe||n instanceof TCt:!1}class YMe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(zA(i)&&i.canAppend(this._model))return i;const s=new wYe(g(LCt,0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],Iwe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=YMe._computeCursorState(i,r),c=r.map((l,d)=>({index:d,textChange:l.textChange}));return c.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,c.map(l=>l.textChange),Iwe(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return bt(i),null}}}class RCt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function MCt(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||c>0&&l>0)return;const d=Math.abs(a-l),h=Math.abs(r-c);if(d===0){s.spacesDiff=h,h>0&&0<=c-1&&c-10?s++:y>1&&o++,MCt(r,a,v,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const M=h.spacesDiff;M<=l&&d[M]++,r=v,a=C}let u=t;s!==o&&(u=s{const v=d[m];v>p&&(p=v,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}class Lwe{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Ii)return JMe(this.right);let e=this;for(;e.parent!==Ii&&e.parent.left!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}prev(){if(this.left!==Ii)return bYe(this.left);let e=this;for(;e.parent!==Ii&&e.parent.right!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var ss;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ss||(ss={}));const Ii=new Lwe(null,ss.Black);Ii.parent=Ii;Ii.left=Ii;Ii.right=Ii;Ii.color=ss.Black;function JMe(n){for(;n.left!==Ii;)n=n.left;return n}function bYe(n){for(;n.right!==Ii;)n=n.right;return n}function XMe(n){return n===Ii?0:n.size_left+n.piece.length+XMe(n.right)}function ZMe(n){return n===Ii?0:n.lf_left+n.piece.lineFeedCnt+ZMe(n.right)}function gfe(){Ii.parent=Ii}function D$(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ii&&(t.left.parent=e),t.parent=e.parent,e.parent===Ii?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function k$(n,e){const t=e.left;e.left=t.right,t.right!==Ii&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ii?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function zj(n,e){let t,i;if(e.left===Ii?(i=e,t=i.right):e.right===Ii?(i=e,t=i.left):(i=JMe(e.right),t=i.right),i===n.root){n.root=t,t.color=ss.Black,e.detach(),gfe(),n.root.parent=Ii;return}const s=i.color===ss.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,_3(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,_3(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ii&&(i.left.parent=i),i.right!==Ii&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,_3(n,i)),e.detach(),t.parent.left===t){const r=XMe(t),a=ZMe(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const c=r-t.parent.size_left,l=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,mA(n,t.parent,c,l)}}if(_3(n,t.parent),s){gfe();return}let o;for(;t!==n.root&&t.color===ss.Black;)t===t.parent.left?(o=t.parent.right,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,D$(n,t.parent),o=t.parent.right),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.right.color===ss.Black&&(o.left.color=ss.Black,o.color=ss.Red,k$(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=ss.Black,o.right.color=ss.Black,D$(n,t.parent),t=n.root)):(o=t.parent.left,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,k$(n,t.parent),o=t.parent.left),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.left.color===ss.Black&&(o.right.color=ss.Black,o.color=ss.Red,D$(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=ss.Black,o.left.color=ss.Black,k$(n,t.parent),t=n.root));t.color=ss.Black,gfe()}function ZWe(n,e){for(_3(n,e);e!==n.root&&e.parent.color===ss.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,D$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,k$(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,k$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,D$(n,e.parent.parent))}n.root.color=ss.Black}function mA(n,e,t,i){for(;e!==n.root&&e!==Ii;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function _3(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=XMe(e.left)-e.size_left,i=ZMe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const cA=65535;function CYe(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class NCt{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function yA(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new NCt(CYe(n),i,s,o,r);return n.length=0,a}class Ef{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class xT{constructor(e,t){this.buffer=e,this.lineStarts=t}}class FCt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ii&&e.iterate(e.root,i=>(i!==Ii&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class OCt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class BCt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new xT("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ii,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=yA(e[o].buffer));const a=new Ef(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new OCt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=cA,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,c=>{const l=this.getNodeContent(c),d=l.length;if(r<=i||r+d0){const c=o.replace(/\r\n|\r|\n/g,e);a.push(new xT(c,yA(c)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new FCt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,s=>{if(s===Ii)return!0;const o=this.getNodeContent(s),r=o.length,a=e.nodeAt(t),c=e.nodeAt(t+r),l=e.getValueInRange2(a,c);return t+=r,o===l})}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Ii;)if(s.left!==Ii&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Ii;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new oe(i+1,a+1)}return new oe(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ii){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new oe(i+1,r+1)}else t=t.right;return new oe(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,c=this._buffers[a.piece.bufferIndex].buffer,l=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return c.substring(l+e.remainder,l+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Ii;){const a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(c,c+t.remainder);break}else r+=a.substr(c,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Ii)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const c=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=l[d]+r.start.column;if(s&&(c.charCodeAt(u)===Q.LineFeed&&(u++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===Q.CarriageReturn?(s=!0,i+=c.substr(u,a-1)):i+=c.substr(u,a),!0;i+=this._EOLNormalized?c.substring(u,Math.max(u,l[d+1]-this._EOLLength)):c.substring(u,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fy+p,t.reset(0)):(b=u.buffer,C=y=>y,t.reset(p));do if(v=t.next(b),v){if(C(v.index)>=m)return d;this.positionInBuffer(e,C(v.index)-f,w);const y=this.getLineFeedCnt(e.piece.bufferIndex,o,w),S=w.line===o.line?w.column-o.column+s:w.column+1,M=S+v[0].length;if(h[d++]=wT(new O(i+y,S,i+y,M),v,c),C(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new $B(t.wordSeparators,t.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(l===null)return[];let d=this.positionInBuffer(c.node,c.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(c.node===l.node)return this.findMatchesInNode(c.node,a,e.startLineNumber,e.startColumn,d,h,t,i,s,r,o),o;let u=e.startLineNumber,f=c.node;for(;f!==l.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){const w=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),C=w[d.line+m],y=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,y,d,this.positionInBuffer(f,C-b),t,i,s,r,o),r>=s)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const w=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,w,e.endLineNumber,v,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,s),r>=s)return o;u++,c=this.nodeAt2(u,1),f=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(u===e.endLineNumber){const m=u===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,m,r,o,i,s),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,c,l){const d=e.wordSeparators;if(!c&&e.simpleSearch){const u=e.simpleSearch,f=u.length,p=i.length;let m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!d||_Me(d,i,p,m,f))&&(a[r++]=new z9(new O(s,m+1+o,s,m+1+f+o),null),r>=l))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=wT(new O(s,h.index+1+o,s,h.index+1+h[0].length+o),h,c),r>=l))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ii){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,c=a.bufferIndex,l=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new Ef(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(c,a.end)-this.offsetInBuffer(c,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const m={line:h.start.line+1,column:0};h=new Ef(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=` -`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const m=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,m),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,l);else this.deleteNodeTail(s,l);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(s,h);let f=s;for(let p=0;p=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=u)l=h+1;else break;return i?(i.line=h,i.column=c-f,null):{line:h,column:c-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tcA){const d=[];for(;e.length>cA;){const u=e.charCodeAt(cA-1);let f;u===Q.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,cA-1),e=e.substring(cA-1)):(f=e.substring(0,cA),e=e.substring(cA));const p=yA(f);d.push(new Ef(this._buffers.length,{line:0,column:0},{line:p.length-1,column:f.length-p[p.length-1]},p.length-1,f.length)),this._buffers.push(new xT(f,p))}const h=yA(e);return d.push(new Ef(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new xT(e,h)),d}let t=this._buffers[0].buffer.length;const i=yA(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+c,h+l-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=l.substring(d+c,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Ii;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(c,c+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Ii;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),c=this.getLineFeedCnt(i.bufferIndex,i.start,r),l=c-s,d=a-o,h=i.length+d;e.piece=new Ef(i.bufferIndex,i.start,r,c,h),mA(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),c=this.offsetInBuffer(i.bufferIndex,r),l=a-s,d=o-c,h=i.length+d;e.piece=new Ef(i.bufferIndex,r,i.end,a,h),mA(this,e,d,l)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,c=s.lineFeedCnt,l=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,l),h=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Ef(s.bufferIndex,s.start,l,d,h),mA(this,e,h-a,d-c);const u=new Ef(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` -`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=yA(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Ii;)if(i.left!==Ii&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Ii;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` -`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Ii||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Ii||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ef(e.piece.bufferIndex,e.piece.start,o,a,r),mA(this,e,-1,-1),e.piece.length===0&&i.push(e);const c={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,c,t.piece.end);t.piece=new Ef(t.piece.bufferIndex,c,t.piece.end,d,l),mA(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r -`);this.rbInsertRight(e,h[0]);for(let u=0;u(t+=this.getNodeContent(i),!0)),t}}class pR extends ${constructor(e,t,i,s,o,r,a){super(),this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._pieceTree=new BCt(e,i,a)}equals(e){return!(e instanceof pR)||this._BOM!==e._BOM||this.getEOL()!==e.getEOL()?!1:this._pieceTree.equal(e._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,s=this.getPositionAt(e),o=this.getPositionAt(i);return new O(s.lineNumber,s.column,o.lineNumber,o.column)}getValueInRange(e,t=xo.TextDefined){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=xo.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),s=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const c=r.length-a.length,l=e.endLineNumber-e.startLineNumber;o=c*l}return s-i+o}getCharacterCountInRange(e,t=xo.TextDefined){if(this._mightContainNonBasicASCII){let i=0;const s=e.startLineNumber,o=e.endLineNumber;for(let r=s;r<=o;r++){const a=this.getLineContent(r),c=r===s?e.startColumn-1:0,l=r===o?e.endColumn-1:a.length;for(let d=c;dv.sortIndex-w.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(c);let p=null;if(t&&h.length>0){h.sort((m,v)=>v.lineNumber-m.lineNumber),p=[];for(let m=0,v=h.length;m0&&h[m-1].lineNumber===w)continue;const b=h[m].oldContent,C=this.getLineContent(w);C.length===0||C===b||Eu(C)!==-1||p.push(w)}}return this._onDidChangeContent.fire(),new Xft(u,f,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new O(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const c=[];for(let f=0,p=e.length;f0&&c.push(m.text),r=v.endLineNumber,a=v.endColumn}const l=c.join(""),[d,h,u]=Gb(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,xo.TextDefined),text:l,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(pR._sortOpsDescending);const t=[];for(let i=0;i0){const l=o+1;l===1?c=new O(i,s,i,s+r):c=new O(i,s,i+l-1,a+1)}else c=new O(i,s,i,s);return c}static _getInverseEditRanges(e){const t=[];let i=0,s=0,o=null;for(let r=0,a=e.length;r0){const u=c.eolCount+1;u===1?h=new O(l,d,l,d+c.firstLineLength):h=new O(l,d,l+u-1,c.lastLineLength+1)}else h=new O(l,d,l,d);i=h.endLineNumber,s=h.endColumn,t.push(h),o=c}return t}static _sortOpsAscending(e,t){const i=O.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=O.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class WCt{constructor(e,t,i,s,o,r,a,c,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=c,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===zb.LF?` + .current-line.current-line-margin.current-line-margin-both{border-right:0}`;ut(j_t,{});class Uqe extends RN{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new dt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),is(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let r=t;r<=i;r++){const a=r-t;n[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new oe(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new oe(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new oe(l,this._context.viewModel.model.getLineMaxColumn(l))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let p=u;p<=f;p++){const m=p-t;n[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=o}this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Y_t extends Uqe{_renderOne(e,t){return`
      `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class J_t extends Uqe{_renderOne(e,t){return`
      `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Cp((s,e)=>{const t=s.getColor(Eqe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||s.defines(aBe)){const i=s.getColor(aBe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Ry(s.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});var X_t=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";ut(X_t,{});class Z_t extends RN{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let c=0,l=t.length;c{if(c.options.zIndexl.options.zIndex)return 1;const d=c.options.className,h=l.options.className;return dh?1:F.compareRangesUsingStarts(c.range,l.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let c=o;c<=r;c++){const l=c-o;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(c.range.startLineNumber,n),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-n;i[f]+=l}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class evt extends pf{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(x.scrollbar),a=o.get(x.mouseWheelScrollSensitivity),c=o.get(x.fastScrollSensitivity),l=o.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+tme(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new l6(t.domNode,d,this._context.viewLayout.getScrollable())),Tb.write(this.scrollbar.getDomNode(),sa.ScrollableElement),this.scrollbarDomNode=ls(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(u,f,p)=>{const m={};{const v=u.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,u.scrollTop=0)}if(p){const v=u.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,u.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,mt.Immediate)};this._register(ue(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(ue(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(ue(n.domNode,"scroll",u=>h(n.domNode,!0,!1))),this._register(ue(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(x.layoutInfo);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(x.minimap).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(x.scrollbar)||e.hasChanged(x.mouseWheelScrollSensitivity)||e.hasChanged(x.fastScrollSensitivity)){const t=this._context.configuration.options,i=t.get(x.scrollbar),n=t.get(x.mouseWheelScrollSensitivity),o=t.get(x.fastScrollSensitivity),r=t.get(x.scrollPredominantAxis),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+tme(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var tvt=".monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{align-items:center;display:flex;justify-content:center;position:absolute}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}";ut(tvt,{});class sme{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class ivt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class nvt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Vqe extends RN{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const c=a-e;n[c]=new nvt}if(i.length===0)return n;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNamen)continue;const l=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(o.preference.lane);t.push(new rvt(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===AT.Decoration&&n.type===AT.Decoration?i.className0;){const n=t.peek();if(!n)break;const o=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===AT.Decoration){const a=[];for(const c of o){if(c.zIndex!==r.zIndex||c.type!==r.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var AT;(function(s){s[s.Decoration=0]="Decoration",s[s.Widget=1]="Widget"})(AT||(AT={}));class ovt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=AT.Decoration}accept(e){return new avt(this.lineNumber,this.laneIndex,e)}}class rvt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=AT.Widget}}class avt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var cvt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";ut(cvt,{});class zqe extends V{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function sae(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Ni("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,c=-1,l=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,c=-1;for(let P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){a=P,c=R;break}}}if(l===-2){l=-1,d=-1;for(let P=k;P=0){l=P,d=R;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){u=P,f=R;break}}}if(p!==-1&&(p===-2||p=0){p=P,m=R;break}}}};let b=0,w=!0,y=0,C=!0,A=0,L=0;for(let k=0;w||C;k++){const P=e-k,R=e+k;k>1&&(P<1||P1&&(R>n||R>i)&&(C=!1),k>5e4&&(w=!1,C=!1);let z=-1;if(w&&P>=1){const Y=this._computeIndentLevel(P-1);Y>=0?(l=P-1,d=Y,z=Math.ceil(Y/this.textModel.getOptions().indentSize)):(h(P),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let G=-1;if(C&&R<=n){const Y=this._computeIndentLevel(R-1);Y>=0?(u=R-1,f=Y,G=Math.ceil(Y/this.textModel.getOptions().indentSize)):(v(R),G=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){L=z;continue}if(k===1){if(R<=n&&G>=0&&L+1===G){w=!1,b=R,y=R,A=G;continue}if(P>=1&&z>=0&&z-1===L){C=!1,b=P,y=P,A=z;continue}if(b=e,y=e,A=L,A===0)return{startLineNumber:b,endLineNumber:y,indent:A}}w&&(z>=A?b=P:w=!1),C&&(G>=A?y=R:C=!1)}return{startLineNumber:b,endLineNumber:y,indent:A}}getLinesBracketGuides(e,t,i,n){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new F(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(F.fromPositions(i)).toArray()).filter(u=>F.strictContainsPosition(u.range,i));c=Ak(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new $qe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!n.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=n.horizontalGuides===ET.Enabled||n.horizontalGuides===ET.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new x1(-1,h.openingBracketRange.getEndPosition().column,f,new l5(!1,m.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(m),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,b,h.minVisibleColumnIndentation+1);let C=!1;kh(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&o[p.lineNumber-e].push(new x1(y,-1,f,new l5(!1,p.column),-1,-1)),m.lineNumber<=t&&b>y&&o[m.lineNumber-e].push(new x1(y,-1,f,new l5(!C,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return qa.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let c=-2,l=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const f=u-e,p=this._computeIndentLevel(u-1);if(p>=0){c=u-1,l=p,a[f]=Math.ceil(p/n.indentSize);continue}if(c===-2){c=-1,l=-1;for(let m=u-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){c=m,l=v;break}}}if(d!==-1&&(d===-2||d=0){d=m,h=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,l,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:tn||this._maxIndentLeft>0&&p>this._maxIndentLeft)break;const m=f.horizontalLine?f.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",v=f.horizontalLine?(e.visibleRangeForPosition(new oe(c,f.horizontalLine.endColumn))?.left??p+this._spaceWidth)-p:this._spaceWidth;h+=`
      `}a[l]=h}this._renderResult=a}getGuidesByLine(e,t,i){const n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?ET.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?ET.EnabledForActive:ET.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,c=h.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const f=n?n[h-e]:[],p=new Uy(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const b=(v-1)*l+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(C=>C.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function aP(s){if(!(s&&s.isTransparent()))return s}Cp((s,e)=>{const t=[{bracketColor:Rqe,guideColor:A_t,guideColorActive:T_t},{bracketColor:Mqe,guideColor:E_t,guideColorActive:L_t},{bracketColor:Nqe,guideColor:x_t,guideColorActive:R_t},{bracketColor:Pqe,guideColor:D_t,guideColorActive:M_t},{bracketColor:Fqe,guideColor:k_t,guideColorActive:N_t},{bracketColor:Oqe,guideColor:I_t,guideColorActive:P_t}],i=new $qe,n=[{indentColor:d6,indentColorActive:h6},{indentColor:r_t,indentColorActive:h_t},{indentColor:a_t,indentColorActive:u_t},{indentColor:c_t,indentColorActive:g_t},{indentColor:l_t,indentColorActive:f_t},{indentColor:d_t,indentColorActive:p_t}],o=t.map(a=>{const c=s.getColor(a.bracketColor),l=s.getColor(a.guideColor),d=s.getColor(a.guideColorActive),h=aP(aP(l)??c?.transparent(.3)),u=aP(aP(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Fc),r=n.map(a=>{const c=s.getColor(a.indentColor),l=s.getColor(a.indentColorActive),d=aP(c),h=aP(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Fc);if(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${c.indentColor}; --indent-color-active: ${c.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});var hvt=".mtkcontrol{background:#960000!important;color:#fff!important}.mtkoverflow{background-color:var(--vscode-button-background,var(--vscode-editor-background));border-color:var(--vscode-contrastBorder);border-radius:2px;border-style:solid;border-width:1px;color:var(--vscode-button-foreground,var(--vscode-editor-foreground));cursor:pointer;padding:4px}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:auto;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{bottom:0;position:absolute;top:0}.monaco-editor .mtkw,.monaco-editor .mtkz{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block}";ut(hvt,{});class Qde{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class uvt{constructor(){this._currentVisibleRange=new F(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class gvt{constructor(e,t,i,n,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class fvt{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new cn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new uvt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(x.stickyScroll).enabled,this._maxNumberStickyLines=n.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new dS(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(x.wrappingInfo)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(x.fontInfo),n=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(x.revealHorizontalRightPadding),this._cursorSurroundingLines=t.get(x.cursorSurroundingLines),this._cursorSurroundingLinesStyle=t.get(x.cursorSurroundingLinesStyle),this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._stickyScrollEnabled=t.get(x.stickyScroll).enabled,this._maxNumberStickyLines=t.get(x.stickyScroll).maxLineCount,Dl(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ZOe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new gvt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new fvt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?mt.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new oe(n,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new Qde(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=F.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let r=0;const a=new Qde(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const u=h===n.startLineNumber?n.startColumn:1,f=h!==n.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):n.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const n=new Qde(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Zpt(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const n=this._computeScrollLeftToReveal(i);n&&(this._isViewportWrapping||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),pr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let b=o[0].startLineNumber,w=o[0].endLineNumber;for(let y=1,C=o.length;yc){if(!d)return-1;v=h}else if(r===_s.NearTop||r===_s.NearTopIfOutsideViewport)if(r===_s.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=Math.max(5*this._lineHeight,c*.2),w=h-b,y=u-c;v=Math.max(y,w)}else if(r===_s.Center||r===_s.CenterIfOutsideViewport)if(r===_s.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=(h+u)/2;v=Math.max(0,b-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===_s.Top,r===_s.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let r=Un.MAX_SAFE_SMALL_INTEGER,a=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const d of l.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const d=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(r=Math.max(0,r-Jne.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}};Jne.HORIZONTAL_EXTRA_PX=30;let ome=Jne;var pvt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";ut(pvt,{});class mvt extends Vqe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(x.layoutInfo);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=n[d].getDecorations();let u="";for(const f of h){let p='
      ';o[a]=l}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var bvt=".monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{left:-6px;position:absolute;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{left:-1px;position:absolute;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}";ut(bvt,{});const zE=class zE{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=zE._clamp(e),this.g=zE._clamp(t),this.b=zE._clamp(i),this.a=zE._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};zE.Empty=new zE(0,0,0,0);let eA=zE;var Dn;(function(s){s[s.START_CH_CODE=32]="START_CH_CODE",s[s.END_CH_CODE=126]="END_CH_CODE",s[s.UNKNOWN_CODE=65533]="UNKNOWN_CODE",s[s.CHAR_COUNT=96]="CHAR_COUNT",s[s.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",s[s.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",s[s.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",s[s.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",s[s.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",s[s.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Dn||(Dn={}));const wvt=(()=>{const s=[];for(let e=Dn.START_CH_CODE;e<=Dn.END_CH_CODE;e++)s.push(e);return s.push(Dn.UNKNOWN_CODE),s})(),yvt=(s,e)=>(s-=Dn.START_CH_CODE,s<0||s>Dn.CHAR_COUNT?e<=2?(s+Dn.CHAR_COUNT)%Dn.CHAR_COUNT:Dn.CHAR_COUNT-1:s),Xne=class Xne extends V{static getInstance(){return this._INSTANCE||(this._INSTANCE=A2(new Xne)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ta.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ta.getColorMap();if(!e){this._colors=[eA.Empty],this._backgroundIsLight=!0;return}this._colors=[eA.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Tl.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};Xne._INSTANCE=null;let gY=Xne;class X8{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=X8.soften(e,12/15),this.charDataLight=X8.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=yvt(n,l),b=e.width*Dn.RGBA_CHANNELS_CNT,w=a.r,y=a.g,C=a.b,A=o.r-w,L=o.g-y,k=o.b-C,P=Math.max(r,c),R=e.data;let z=v*u*f,G=i*b+t*Dn.RGBA_CHANNELS_CNT;for(let Y=0;Ye.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*Dn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,b=n.r-p,w=n.g-m,y=n.b-v,C=p+b*f,A=m+w*f,L=v+y*f,k=Math.max(o,a),P=e.data;let R=i*u+t*Dn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=lBe[s[t]]<<4|lBe[s[t+1]]&15;return e},hBe={1:hm(()=>dBe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:hm(()=>dBe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class d5{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return hBe[e]?i=new X8(hBe[e](),e):i=d5.createFromSampleData(d5.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height=`${Dn.SAMPLED_CHAR_HEIGHT}px`,t.height=Dn.SAMPLED_CHAR_HEIGHT,t.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,t.style.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Dn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(const o of wvt)i.fillText(String.fromCharCode(o),n,Dn.SAMPLED_CHAR_HEIGHT/2),n+=Dn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,Dn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Dn.SAMPLED_CHAR_HEIGHT*Dn.SAMPLED_CHAR_WIDTH*Dn.RGBA_CHANNELS_CNT*Dn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const n=d5._downsample(e,t);return new X8(n,t)}static _downsampleChar(e,t,i,n,o){const r=Dn.BASE_CHAR_WIDTH*o,a=Dn.BASE_CHAR_HEIGHT*o;let c=n,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dd5.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Tl.DefaultBackground),this.backgroundColor=OO._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=OO._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Tft);return i?new eA(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Lft);return t?eA._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Rl);return i?new eA(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class h5{constructor(e,t,i,n,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=c,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,r,a,c,l,d,h){const u=e.pixelRatio,f=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/L)),P=Math.max(0,e.minimapHeight-k),R=P/(d-o),z=l*R,G=P>0,Y=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new h5(l,d,G,R,z,k,j,1,Math.min(a,Y))}let v;if(r&&i!==a){const L=i-t+1;v=Math.floor(L*f/u)}else{const L=o/m;v=Math.floor(L*f/u)}const b=Math.floor(e.paddingTop/m);let w=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const L=o/m;w=Math.max(w,L-1)}let y;if(w>0){const L=o/m;y=(b+a+w-L-1)*f/u}else y=Math.max(0,(b+a)*f/u-v);y=Math.min(e.minimapHeight-v,y);const C=y/(d-o),A=l*C;if(p>=b+a+w){const L=y>0;return new h5(l,d,L,C,A,v,b,1,a)}else{let L;t>1?L=t+b:L=Math.max(1,l/m);let k,P=Math.max(1,Math.floor(L-A*u/f));Pl&&(P=Math.min(P,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?G=(t-P+k+z)*f/u:G=l/e.paddingTop*(k+z)*f/u,new h5(l,d,!0,C,G,v,k,P,R)}}}const Zne=class Zne{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};Zne.INVALID=new Zne(-1);let fY=Zne;class uBe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Bqe(()=>fY.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,o=i.length;n1){for(let b=0,w=n-1;b0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Z8.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,r=t-e+1;o!n.options.minimap?.sectionHeaderStyle);if(this._samplingState){const n=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),c=this._samplingState.modelLineToMinimapLine(r.endLineNumber);n.push(new VKe(new F(a,r.startColumn,c,r.endColumn),o.options))}return n}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>!!r.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new F(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new F(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const n=this._sectionHeaderCache.get(i);if(n)return n;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new F(e,1,e,1),_s.Center,mt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},mt.Immediate)}}class rF extends V{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(QOe),this._domNode=ls(document.createElement("div")),Tb.write(this._domNode,sa.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ls(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ls(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ls(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ls(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ls(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ro(this._domNode.domNode,ke.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===gb.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=Cr(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new SU,this._sliderPointerDownListener=Ro(this._slider.domNode,ke.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=fd.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ue(this._domNode.domNode,uo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ue(this._domNode.domNode,uo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ro(this._domNode.domNode,uo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=Cr(this._domNode.domNode),l=Math.min(Math.abs(a-n),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Qn&&l>Cvt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new ZTe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(QOe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===gb.None){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=h5.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(F.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new gBe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new gBe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,n),this._renderDecorationsHighlights(l,i,h,e,r,c,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const c of t){const l=n.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=n.getYForLineNumber(d,o),f=n.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(Xb,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(Xb,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==Th.Inline)continue;const d=n.intersectWithViewport(c.range);if(!d)continue;const[h,u]=d,f=l.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=r.get(f.toString());p||(p=f.transparent(.5).toString(),r.set(f.toString(),p)),e.fillStyle=p;for(let m=h;m<=u;m++){if(i.has(m))continue;i.set(m,!0);const v=n.getYForLineNumber(h,o);e.fillRect(Xb,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=n.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[u,f]=h,p=d.getColor(this._theme.value);if(!(!p||p.isTransparent()))for(let m=u;m<=f;m++)switch(d.position){case Th.Inline:this.renderDecorationOnLine(e,i,l.range,p,n,m,o,o,r,a,c);continue;case Th.Gutter:{const v=n.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,Svt,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,r,a,c,l,d,h){const u=o.getYForLineNumber(r,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===r?i.startColumn:1,v=p===r?i.endColumn:this._model.getLineMaxColumn(r),b=this.getXOffsetForPosition(t,r,m,l,d,h),w=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,n,b,u,w-b,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return Xb;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[Xb];let d=Xb;for(let h=1;h=r){c[h]=r;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=rF._fitSectionHeader.bind(null,u,r-Xb);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,b=v-i,w=b+2,y=this._model.getSectionHeaderText(m,p);rF._renderSectionLabel(u,y,m.options.minimap?.sectionHeaderStyle===P8.Underlined,c,d,r,b,o,v,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",o=e.measureText(i).width,r=e.measureText(n).width;if(o<=t||o<=r)return i;const a=i.length,c=o/i.length,l=Math.floor((t-r)/c)-1;let d=Math.ceil(l/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+n+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,n,o,r,a,c,l,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,Xb,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const ge=this._lastRenderData._get();return new uBe(e,ge.imageData,ge.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=rF._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,c),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),v=this._model.options.renderMinimap,b=this._model.options.charRenderer(),w=this._model.options.fontScale,y=this._model.options.minimapCharWidth,A=(v===gb.Text?Dn.BASE_CHAR_HEIGHT:Dn.BASE_CHAR_HEIGHT+1)*w,L=n>A?Math.floor((n-A)/2):0,k=u.a/255,P=new eA(Math.round((u.r-h.r)*k+h.r),Math.round((u.g-h.g)*k+h.g),Math.round((u.b-h.b)*k+h.b),255);let R=e.topPaddingLineCount*n;const z=[];for(let ge=0,De=i-t+1;ge=0&&Gw)return;const Y=v.charCodeAt(A);if(Y===B.Tab){const j=u-(A+L)%u;L+=j-1,C+=j*r}else if(Y===B.Space)C+=r;else{const j=Tk(Y)?2:1;for(let ne=0;new)return}}}}}class gBe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var Evt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";ut(Evt,{});class xvt extends pf{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ls(document.createElement("div")),Tb.write(this._domNode,sa.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ls(document.createElement("div")),Tb.write(this.overflowingOverlayWidgetsDomNode,sa.OverflowingOverlayWidgets),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=ls(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,o=t?.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i0);t.sort((n,o)=>(this._widgets[n].stack||0)-(this._widgets[o].stack||0));for(let n=0,o=t.length;n=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-o-r,c=e,l=c+o,d=c+o+a;return[[0,c,l,c,d,c,l,c],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(n/2),r=n-o,a=e,c=a+o;return[[0,a,a,a,c,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=n;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&me.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}var rme;(function(s){s[s.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(rme||(rme={}));var pY;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(pY||(pY={}));var Dv;(function(s){s[s.NotNeeded=0]="NotNeeded",s[s.Maybe=1]="Maybe",s[s.Needed=2]="Needed"})(Dv||(Dv={}));class kvt extends pf{constructor(e){super(e),this._actualShouldRender=Dv.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ls(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Ta.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new oe(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Dvt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=Dv.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Dv.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((t,i)=>oe.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=Dv.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?me.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(W8.compareByRenderingProps),this._actualShouldRender===Dv.Maybe&&!W8.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Dv.Needed),this._actualShouldRender===Dv.Maybe&&!is(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Dv.Needed),this._actualShouldRender===Dv.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=n/a,l=rme.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const u=this._settings.x,f=this._settings.w;for(const p of t){const m=p.color,v=p.data;h.fillStyle=m;let b=0,w=0,y=0;for(let C=0,A=v.length/3;Cn&&(Y=n-d),R=Y-d,z=Y+d}R>y+1||L!==b?(C!==0&&h.fillRect(u[b],w,f[b],y-w),b=L,w=R,y=z):z>y&&(y=z)}h.fillRect(u[b],w,f[b],y-w)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[pY.Full],b=this._settings.w[pY.Full];let w=-100,y=-100,C=null;for(let A=0,L=this._cursorPositions.length;An&&(R=n-m);const z=R-m,G=z+p;z>y+1||k!==C?(A!==0&&C&&h.fillRect(v,w,b,y-w),w=z,y=G):G>y&&(y=G),C=k,h.fillStyle=k}C&&h.fillRect(v,w,b,y-w)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}var ame;(function(s){s[s.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(ame||(ame={}));class fBe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Gqe{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-v);const b=d.color;let w=this._color2Id[b];w||(w=++this._lastAssignedId,this._color2Id[b]=w,this._id2Color[w]=b);const y=new fBe(m-v,m+v,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(fBe.compare),a}}class Tvt extends c6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ls(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Ivt(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(x.lineHeight)),this._zoneManager.setPixelRatio(i.get(x.pixelRatio)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(x.lineHeight)&&(this._zoneManager.setLineHeight(t.get(x.lineHeight)),this._render()),e.hasChanged(x.pixelRatio)&&(this._zoneManager.setPixelRatio(t.get(x.pixelRatio)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,r=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==o?(e.fillRect(0,r,n,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=d,a=h)}e.fillRect(0,r,n,a-r)}}var Lvt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";ut(Lvt,{});class Rvt extends pf{constructor(e){super(e),this.domNode=ls(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=ls(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const n=this._renderedRulers.pop();this.domNode.removeChild(n),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(x.layoutInfo);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.scrollbar);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var Pvt=".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}";ut(Pvt,{});var za;(function(s){s[s.EXTERN=0]="EXTERN",s[s.INTERN=1]="INTERN",s[s.FLAT=2]="FLAT"})(za||(za={}));class Fvt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Ovt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Bvt(s){return new Fvt(s)}function Wvt(s){return new Ovt(s.lineNumber,s.ranges.map(Bvt))}const la=class la extends RN{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!o&&l=0;l--)i[l].lineNumber===c&&(r=i[l].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,c=t.length;a0){const p=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;PG(d-p)p&&(u.top=za.INTERN),PG(h-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let c=0,l=n.length;c1,l)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};la.SELECTION_CLASS_NAME="selected-text",la.SELECTION_TOP_LEFT="top-left-radius",la.SELECTION_BOTTOM_LEFT="bottom-left-radius",la.SELECTION_TOP_RIGHT="top-right-radius",la.SELECTION_BOTTOM_RIGHT="bottom-right-radius",la.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",la.ROUNDED_PIECE_WIDTH=10;let cme=la;Cp((s,e)=>{const t=s.getColor(lft);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function PG(s){return s<0?-s:s}var Hvt=".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{box-sizing:border-box;overflow:hidden;position:absolute}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:2px}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:1px}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}";ut(Hvt,{});class pBe{constructor(e,t,i,n,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=a}}var ES;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(ES||(ES={}));class mBe{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ls(document.createElement("div")),this._domNode.setClassName(`cursor ${ZS}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Dl(this._domNode,n),this._domNode.setDisplay("none"),this._position=new oe(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case ES.Single:this._pluralityClass="";break;case ES.MultiPrimary:this._pluralityClass="cursor-primary";break;case ES.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.fontInfo);return this._cursorStyle=t.get(x.cursorStyle),this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),Dl(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=Q6e(i,t-1);return[new oe(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===qr.Line||this._cursorStyle===qr.LineThin){const u=e.visibleRangeForPosition(n);if(!u||u.outsideRenderedLine)return null;const f=ct(this._domNode.domNode);let p;this._cursorStyle===qr.Line?(p=ZFe(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(n))):p=ZFe(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const b=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new pBe(b,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new F(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=o===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===qr.Block&&(t=o,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===qr.Underline||this._cursorStyle===qr.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new pBe(d,c.left,0,l,h,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${ZS} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}const Fz=class Fz extends pf{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new mBe(this._context,ES.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ls(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Cm,this._cursorFlatBlinkInterval=new X7,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,o=e.ranges.length;n{this._isVisible?this._hide():this._show()},Fz.BLINK_INTERVAL,ct(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Fz.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case qr.Line:e+=" cursor-line-style";break;case qr.Block:e+=" cursor-block-style";break;case qr.Underline:e+=" cursor-underline-style";break;case qr.LineThin:e+=" cursor-line-thin-style";break;case qr.BlockOutline:e+=" cursor-block-outline-style";break;case qr.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case Rd.Blink:e+=" cursor-blink";break;case Rd.Smooth:e+=" cursor-smooth";break;case Rd.Phase:e+=" cursor-phase";break;case Rd.Expand:e+=" cursor-expand";break;case Rd.Solid:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:iae,background:YTe},{class:".cursor-primary",foreground:xqe,background:t_t},{class:".cursor-secondary",foreground:Dqe,background:i_t}];for(const i of t){const n=s.getColor(i.foreground);if(n){let o=s.getColor(i.background);o||(o=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),Ry(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const jde=()=>{throw new Error("Invalid change accessor")};class Uvt extends pf{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._lineHeight=t.get(x.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ls(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ls(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const n={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Vvt(e,n),n.addZone=jde,n.removeZone=jde,n.layoutZone=jde}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ls(t.domNode),marginDomNode:t.marginDomNode?ls(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){vt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){vt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=u.startLineNumber===a?u.startColumn:l.minColumn,p=u.endLineNumber===a?u.endColumn:l.maxColumn;f=z.endOffset&&(R++,z=i&&i[R]),j!==B.Tab&&j!==B.Space||u&&!L&&Y<=P)continue;if(h&&Y>=k&&Y<=P&&j===B.Space){const ge=Y-1>=0?a.charCodeAt(Y-1):B.Null,De=Y+1=0?a.charCodeAt(Y-1):B.Null;if(j===B.Space&&ge!==B.Space&&ge!==B.Tab)continue}if(i&&(!z||z.startOffset>Y||z.endOffset<=Y))continue;const ne=e.visibleRangeForPosition(new oe(t,Y+1));ne&&(r?(G=Math.max(G,ne.left),j===B.Tab?A+=this._renderArrow(f,v,ne.left):A+=``):j===B.Tab?A+=`
      ${C?"→":"→"}
      `:A+=`
      ${String.fromCharCode(y)}
      `)}return r?(G=Math.round(G+v),``+A+""):A}_renderArrow(e,t,i){const n=t/7,o=t,r=e/2,a=i,c={x:0,y:n/2},l={x:100/125*o,y:c.y},d={x:l.x-.2*l.x,y:l.y+.2*l.x},h={x:d.x+.1*l.x,y:d.y+.1*l.x},u={x:h.x+.35*l.x,y:h.y-.35*l.x},f={x:u.x,y:-u.y},p={x:h.x,y:-h.y},m={x:d.x,y:-d.y},v={x:l.x,y:-l.y},b={x:c.x,y:-c.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class _Be{constructor(e){const t=e.options,i=t.get(x.fontInfo),n=t.get(x.experimentalWhitespaceRendering);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="svg"?(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!0):(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(x.lineHeight),this.stopRenderingLineAfter=t.get(x.stopRenderingLineAfter)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class Gvt{constructor(e,t,i,n){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new F(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class Kvt{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class qvt{constructor(e,t,i){this.configuration=e,this.theme=new Kvt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let dme=class extends c6{constructor(e,t,i,n,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new dt(1,1,1,1)],this._renderAnimationFrame=null,this._overflowWidgetsDomNode=r??null;const c=new U_t(t,n,o,e);this._context=new qvt(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(ime,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ls(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ls(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ls(document.createElement("div")),Tb.write(this._overflowGuardContainer,sa.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new evt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ome(this._context,this._linesContent),this._viewZones=new Uvt(this._context),this._viewParts.push(this._viewZones);const l=new kvt(this._context);this._viewParts.push(l);const d=new Nvt(this._context);this._viewParts.push(d);const h=new z_t(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Y_t(this._context)),h.addDynamicOverlay(new cme(this._context)),h.addDynamicOverlay(new dvt(this._context)),h.addDynamicOverlay(new Z_t(this._context)),h.addDynamicOverlay(new $vt(this._context));const u=new $_t(this._context);this._viewParts.push(u),u.addDynamicOverlay(new J_t(this._context)),u.addDynamicOverlay(new vvt(this._context)),u.addDynamicOverlay(new mvt(this._context)),u.addDynamicOverlay(new hY(this._context)),this._glyphMarginWidgets=new svt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new uY(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(u.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new q_t(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new lme(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new xvt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new Rvt(this._context);this._viewParts.push(p);const m=new K_t(this._context);this._viewParts.push(m);const v=new Avt(this._context);if(this._viewParts.push(v),l){const b=this._scrollbar.getOverviewRulerLayoutInfo();b.parent.insertBefore(l.getDomNode(),b.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Jmt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??K_.Center;return n=Math.max(n,o.range.endLineNumber),{range:o.range,lane:r,persist:o.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return n=Math.max(n,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>F.compareRangesUsingStarts(o.range,r.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,overflowWidgetsDomNode:this._overflowWidgetsDomNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new smt(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new oe(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(x.layoutInfo);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(x.editorClassName)+" "+tme(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new Ni;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=hme.INSTANCE.scheduleCoordinatedRendering({window:ct(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ni;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ni;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Sx(()=>e.prepareRenderText());const t=Sx(()=>e.renderText());if(t){const[i,n]=t;Sx(()=>e.prepareRender(i,n)),Sx(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}yx.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Gvt(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new Jpt(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},mt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?nae.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Tvt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}refreshFocusState(){this._textAreaHandler.refreshFocusState()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};dme=D([_(6,we)],dme);function Sx(s){try{return s()}catch(e){return vt(e),null}}const ese=class ese{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Uj(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Sx(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;io.renderText())}for(let i=0,n=e.length;io.prepareRender(a,c))}for(let i=0,n=e.length;io.render(a,c))}}};ese.INSTANCE=new ese;let hme=ese;class u5{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)n0?this.breakOffsets[o-1]:0,t===Io.Left)if(e<=r)n=o-1;else if(e>c)i=o+1;else break;else if(e=c)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new FG(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===Io.Left){if(e>0&&t===this.getMinOutputOffset(e))return new FG(e-1,this.getMaxOutputOffset(e-1))}else if(i===Io.Right){const n=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===Io.None){if(e===i.offsetInInputWithInjections+i.length&&vBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(bBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(vBe(this.injectionOptions[o].cursorStops)||(n-=this.injectionOptions[o].content.length,bBe(this.injectionOptions[o].cursorStops)));)o--;return n}}else if(t===Io.Right||t===Io.RightOfInjectedText){let n=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o--;return n}Z7()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};n+=r}}}}function vBe(s){return s==null?!0:s===w_.Right||s===w_.Both}function bBe(s){return s==null?!0:s===w_.Left||s===w_.Both}class FG{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new oe(e+this.outputLineIndex,this.outputOffset+1)}}var Hg;(function(s){s[s.Flush=1]="Flush",s[s.LineChanged=2]="LineChanged",s[s.LinesDeleted=3]="LinesDeleted",s[s.LinesInserted=4]="LinesInserted",s[s.EOLChanged=5]="EOLChanged"})(Hg||(Hg={}));class Qvt{constructor(){this.changeType=Hg.Flush}}class M_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new M_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new M_(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}withText(e){return new M_(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class wBe{constructor(e,t,i){this.changeType=Hg.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class jvt{constructor(e,t){this.changeType=Hg.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Yvt{constructor(e,t,i,n){this.changeType=Hg.LinesInserted,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Jvt{constructor(){this.changeType=Hg.EOLChanged}}class BO{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;ts});class eLe{static create(e){return new eLe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>Zvt(qn(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function Zvt(s,e,t,i,n,o,r,a){function c(R){const z=a[R];if(z){const G=M_.applyInjectedText(e[R],z),Y=z.map(ne=>ne.options),j=z.map(ne=>ne.column-1);return new u5(j,Y,[G.length],[],0)}else return null}if(n===-1){const R=[];for(let z=0,G=e.length;zl?(G=0,Y=0):j=l-De}const ne=z.substr(G),ge=ebt(ne,Y,i,j,p,u);m[R]=G,v[R]=Y,b[R]=ne,w[R]=ge[0],y[R]=ge[1]}const C=p.build(),A=Xvt?.createHTML(C)??C;f.innerHTML=A,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),s.document.body.appendChild(f);const L=document.createRange(),k=Array.prototype.slice.call(f.children,0),P=[];for(let R=0;RNe.options),Oe=yt.map(Ne=>Ne.column-1)):(De=null,Oe=null),P[R]=new u5(Oe,De,G,ge,j)}return f.remove(),P}var D1;(function(s){s[s.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(D1||(D1={}));function ebt(s,e,t,i,n,o){if(o!==0){const u=String(o);n.appendString('
      ');const r=s.length;let a=e,c=0;const l=[],d=[];let h=0");for(let u=0;u"),l[u]=c,d[u]=a;const f=h;h=u+1"),l[s.length]=c,d[s.length]=a,n.appendString("
      "),[l,d]}function tbt(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{ume(s,n,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function ume(s,e,t,i,n,o,r,a){if(i===o||(n=n||Yde(s,e,t[i],t[i+1]),r=r||Yde(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=Yde(s,e,t[c],t[c+1]);ume(s,e,t,i,n,c,l,a),ume(s,e,t,c,l,o,r,a)}function Yde(s,e,t,i){return s.setStart(e[t/D1.SPAN_MODULO_LIMIT|0].firstChild,t%D1.SPAN_MODULO_LIMIT),s.setEnd(e[i/D1.SPAN_MODULO_LIMIT|0].firstChild,i%D1.SPAN_MODULO_LIMIT),s.getClientRects()}class ibt extends V{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new mo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[ri.Eager]=!1,this._finishedInstantiation[ri.AfterFirstRender]=!1,this._finishedInstantiation[ri.BeforeFirstInteraction]=!1,this._finishedInstantiation[ri.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){vt(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(ri.Eager),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.AfterFirstRender)})),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.BeforeFirstInteraction)})),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.Eventually)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}set(e,t){this._instances.set(e,t)}onBeforeInteractionEvent(){this._instantiateSome(ri.BeforeFirstInteraction)}onAfterModelAttached(){return XP(ct(this._editor?.getDomNode()),()=>{this._instantiateSome(ri.AfterFirstRender)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==ri.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){vt(i)}}}}class qqe{constructor(e,t,i,n,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var Uh;(function(s){s.EditorHintDecoration="squiggly-hint",s.EditorInfoDecoration="squiggly-info",s.EditorWarningDecoration="squiggly-warning",s.EditorErrorDecoration="squiggly-error",s.EditorUnnecessaryDecoration="squiggly-unnecessary",s.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",s.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(Uh||(Uh={}));var rs;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(rs||(rs={}));var fo;(function(s){s[s.ColorMask=1]="ColorMask",s[s.ColorMaskInverse=254]="ColorMaskInverse",s[s.ColorOffset=0]="ColorOffset",s[s.IsVisitedMask=2]="IsVisitedMask",s[s.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",s[s.IsVisitedOffset=1]="IsVisitedOffset",s[s.IsForValidationMask=4]="IsForValidationMask",s[s.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",s[s.IsForValidationOffset=2]="IsForValidationOffset",s[s.StickinessMask=24]="StickinessMask",s[s.StickinessMaskInverse=231]="StickinessMaskInverse",s[s.StickinessOffset=3]="StickinessOffset",s[s.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",s[s.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",s[s.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",s[s.IsMarginMask=64]="IsMarginMask",s[s.IsMarginMaskInverse=191]="IsMarginMaskInverse",s[s.IsMarginOffset=6]="IsMarginOffset",s[s.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",s[s.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(fo||(fo={}));function Cu(s){return(s.metadata&fo.ColorMask)>>>fo.ColorOffset}function er(s,e){s.metadata=s.metadata&fo.ColorMaskInverse|e<>>fo.IsVisitedOffset===1}function qo(s,e){s.metadata=s.metadata&fo.IsVisitedMaskInverse|(e?1:0)<>>fo.IsForValidationOffset===1}function yBe(s,e){s.metadata=s.metadata&fo.IsForValidationMaskInverse|(e?1:0)<>>fo.IsMarginOffset===1}function CBe(s,e){s.metadata=s.metadata&fo.IsMarginMaskInverse|(e?1:0)<>>fo.StickinessOffset}function SBe(s,e){s.metadata=s.metadata&fo.StickinessMaskInverse|e<>>fo.CollapseOnReplaceEditOffset===1}function ABe(s,e){s.metadata=s.metadata&fo.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===Uv.ForceMove?!1:i===Uv.ForceStay?!0:e}function rbt(s,e,t,i,n){const o=nbt(s),r=o===ni.AlwaysGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,a=o===ni.NeverGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=s.start;let u=!1;const f=s.end;let p=!1;e<=h&&f<=t&&sbt(s)&&(s.start=e,u=!0,s.end=e,p=!0);{const v=n?Uv.ForceMove:c>0?Uv.ForceStay:Uv.MarkerDefined;!u&&cP(h,r,e,v)&&(u=!0),!p&&cP(f,a,e,v)&&(p=!0)}if(d>0&&!n){const v=c>l?Uv.ForceStay:Uv.MarkerDefined;!u&&cP(h,r,e+d,v)&&(u=!0),!p&&cP(f,a,e+d,v)&&(p=!0)}{const v=n?Uv.ForceMove:Uv.MarkerDefined;!u&&cP(h,r,t,v)&&(s.start=e+l,u=!0),!p&&cP(f,a,t,v)&&(s.end=e+l,p=!0)}const m=l-c;u||(s.start=Math.max(0,h+m)),p||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function abt(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==hn;){if(ld(i)){qo(i.left,!1),qo(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!ld(i.left)){if(o=n+i.maxEnd,ot){qo(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),qo(i,!0),i.right!==hn&&!ld(i.right)){n+=i.delta,i=i.right;continue}}return qo(s.root,!1),c}function cbt(s,e,t,i){let n=s.root,o=0,r=0,a=0;const c=i-(t-e);for(;n!==hn;){if(ld(n)){qo(n.left,!1),qo(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),Bk(n),n=n.parent;continue}if(!ld(n.left)){if(r=o+n.maxEnd,rt){n.start+=c,n.end+=c,n.delta+=c,(n.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),qo(n,!0);continue}if(qo(n,!0),n.right!==hn&&!ld(n.right)){o+=n.delta,n=n.right;continue}}qo(s.root,!1)}function lbt(s,e){let t=s.root;const i=[];let n=0;for(;t!==hn;){if(ld(t)){qo(t.left,!1),qo(t.right,!1),t=t.parent;continue}if(t.left!==hn&&!ld(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),qo(t,!0),t.right!==hn&&!ld(t.right)){t=t.right;continue}}return qo(s.root,!1),i}function dbt(s){let e=s.root;const t=[];let i=0;for(;e!==hn;){if(ld(e)){qo(e.left,!1),qo(e.right,!1),e=e.parent;continue}if(e.left!==hn&&!ld(e.left)){e=e.left;continue}if(e.right!==hn&&!ld(e.right)){e=e.right;continue}t[i++]=e,qo(e,!0)}return qo(s.root,!1),t}function EBe(s,e,t,i,n){let o=s.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==hn;){if(ld(o)){qo(o.left,!1),qo(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==hn&&!ld(o.left)){o=o.left;continue}a=r+o.start,c=r+o.end,o.setCachedOffsets(a,c,i);let h=!0;if(e&&o.ownerId&&o.ownerId!==e&&(h=!1),t&&Qqe(o)&&(h=!1),n&&!jqe(o)&&(h=!1),h&&(l[d++]=o),qo(o,!0),o.right!==hn&&!ld(o.right)){r+=o.delta,o=o.right;continue}}return qo(s.root,!1),l}function hbt(s,e,t,i,n,o,r){let a=s.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==hn;){if(ld(a)){qo(a.left,!1),qo(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!ld(a.left)){if(l=c+a.maxEnd,lt){qo(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,o);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),n&&Qqe(a)&&(p=!1),r&&!jqe(a)&&(p=!1),p&&(u[f++]=a)}if(qo(a,!0),a.right!==hn&&!ld(a.right)){c+=a.delta,a=a.right;continue}}return qo(s.root,!1),u}function xBe(s,e){if(s.root===hn)return e.parent=hn,e.left=hn,e.right=hn,er(e,rs.Black),s.root=e,s.root;ubt(s,e),CE(e.parent);let t=e;for(;t!==s.root&&Cu(t.parent)===rs.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Cu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,g5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),f5(s,t.parent.parent))}else{const i=t.parent.parent.left;Cu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,f5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),g5(s,t.parent.parent))}return er(s.root,rs.Black),e}function ubt(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(fbt(n,o,i.start+t,i.end+t)<0)if(i.left===hn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===hn){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=hn,e.right=hn,er(e,rs.Red)}function DBe(s,e){let t,i;if(e.left===hn?(t=e.right,i=e,t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===hn?(t=e.left,i=e):(i=gbt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,er(t,rs.Black),e.detach(),Xde(),Bk(t),s.root.parent=hn;return}const n=Cu(i)===rs.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,er(i,Cu(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==hn&&(i.left.parent=i),i.right!==hn&&(i.right.parent=i)),e.detach(),n){CE(t.parent),i!==e&&(CE(i),CE(i.parent)),Xde();return}CE(t),CE(t.parent),i!==e&&(CE(i),CE(i.parent));let o;for(;t!==s.root&&Cu(t)===rs.Black;)t===t.parent.left?(o=t.parent.right,Cu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),g5(s,t.parent),o=t.parent.right),Cu(o.left)===rs.Black&&Cu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(Cu(o.right)===rs.Black&&(er(o.left,rs.Black),er(o,rs.Red),f5(s,o),o=t.parent.right),er(o,Cu(t.parent)),er(t.parent,rs.Black),er(o.right,rs.Black),g5(s,t.parent),t=s.root)):(o=t.parent.left,Cu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),f5(s,t.parent),o=t.parent.left),Cu(o.left)===rs.Black&&Cu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(Cu(o.left)===rs.Black&&(er(o.right,rs.Black),er(o,rs.Red),g5(s,o),o=t.parent.left),er(o,Cu(t.parent)),er(t.parent,rs.Black),er(o.left,rs.Black),f5(s,t.parent),t=s.root));er(t,rs.Black),Xde()}function gbt(s){for(;s.left!==hn;)s=s.left;return s}function Xde(){hn.parent=hn,hn.delta=0,hn.start=0,hn.end=0}function g5(s,e){const t=e.right;t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==hn&&(t.left.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Bk(e),Bk(t)}function f5(s,e){const t=e.left;e.delta-=t.delta,(e.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==hn&&(t.right.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Bk(e),Bk(t)}function Jqe(s){let e=s.end;if(s.left!==hn){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==hn){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function Bk(s){s.maxEnd=Jqe(s)}function CE(s){for(;s!==hn;){const e=Jqe(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function fbt(s,e,t,i){return s===t?e-i:s-t}var xS;(function(s){s[s.Unknown=0]="Unknown",s[s.Invalid=3]="Invalid",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(xS||(xS={}));function Ab(s){let e=0,t=0,i=0,n=xS.Unknown;for(let o=0,r=s.length;o=np&&(t=t-s%np),t}function bbt(s,e){return s.reduce((t,i)=>Tr(t,e(i)),tu)}function Xqe(s,e){return s===e}function e3(s,e){const t=s,i=e;if(i-t<=0)return tu;const o=Math.floor(t/np),r=Math.floor(i/np),a=i-r*np;if(o===r){const c=t-o*np;return ka(0,a-c)}else return ka(r-o,a)}function WO(s,e){return s=e}function aF(s){return ka(s.lineNumber-1,s.column-1)}function DT(s,e){const t=s,i=Math.floor(t/np),n=t-i*np,o=e,r=Math.floor(o/np),a=o-r*np;return new F(i+1,n+1,r+1,a+1)}function wbt(s){const e=ov(s);return ka(e.length-1,e[e.length-1].length)}const OG=[],Ip=class Ip{static create(e,t){if(e<=128&&t.length===0){let i=Ip.cache[e];return i||(i=new Ip(e,t),Ip.cache[e]=i),i}return new Ip(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(n===0){const r=1<>5;return n===0?(this.items&1<i===e)?.[0]}reverseLookupSet(e){const t=[];for(const[i]of this.items)e.has(i,this)&&t.push(i);return t}keys(){return this.items.keys()}}var Go;(function(s){s[s.Text=0]="Text",s[s.Bracket=1]="Bracket",s[s.Pair=2]="Pair",s[s.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",s[s.List=4]="List"})(Go||(Go={}));class tLe{get length(){return this._length}constructor(e){this._length=e}}class UO extends tLe{static create(e,t,i){let n=e.length;return t&&(n=Tr(n,t.length)),i&&(n=Tr(n,i.length)),new UO(n,e,t,i,t?t.missingOpeningBracketIds:Gg.getEmpty())}get kind(){return Go.Pair}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return UO.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new UO(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Tr(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Q_ extends tLe{static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Tr(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Tr(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new ybt(o,e.listHeight+1,e,t,i,r):new t3(o,e.listHeight+1,e,t,i,r)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,n=e[0].missingOpeningBracketIds;for(let o=1;o{const n=F.lift(i.range);return new DS(aF(n.getStartPosition()),aF(n.getEndPosition()),wbt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${nm(this.startOffset)}...${nm(this.endOffset)}) -> ${nm(this.newLength)}`}}class Abt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>nLe.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:e3(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=nm(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ka(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ka(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdxthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=_bt(e,t,this.lineIdx,this.lineCharOffset);return new XE(n,Vu.Text,-1,Gg.getEmpty(),new V0(n))}}class xbt{constructor(e,t){this.text=e,this._offset=tu,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| +`,"gi"):null,o=[];let r,a=0,c=0,l=0,d=0;const h=[];for(let p=0;p<60;p++)h.push(new XE(ka(0,p),Vu.Text,-1,Gg.getEmpty(),new V0(ka(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new XE(ka(1,p),Vu.Text,-1,Gg.getEmpty(),new V0(ka(1,p))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const p=r.index,m=r[0];if(m===` +`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const b=p-l;if(bDbt(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===Vu.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Dbt(s){let e=Rh(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class tQe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=sLe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function kbt(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e=2?iQe(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())LBe(i,n)<=LBe(n,r)?(i=Zde(i,n),n=r):n=Zde(n,r);return Zde(i,n)}function iQe(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?s[2]:null,e)}function LBe(s,e){return Math.abs(s.listHeight-e.listHeight)}function Zde(s,e){return s.listHeight===e.listHeight?Q_.create23(s,e,null,!1):s.listHeight>e.listHeight?Ibt(s,e):Tbt(e,s)}function Ibt(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Q_.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Q_.create23(s,n,null,!1):s}function Tbt(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Q_.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Q_.create23(n,s,null,!1):s}class Lbt{constructor(e){this.lastOffset=tu,this.nextNodes=[e],this.offsets=[tu],this.idxs=[]}readLongestNodeAt(e,t){if(WO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=h4(this.nextNodes);if(!i)return;const n=h4(this.offsets);if(WO(e,n))return;if(WO(n,e))if(Tr(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=ehe(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=ehe(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=h4(this.offsets),t=h4(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=h4(this.nextNodes),n=ehe(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Tr(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function ehe(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function h4(s){return s.length>0?s[s.length-1]:void 0}function gme(s,e,t,i){return new Rbt(s,e,t,i).parseDocument()}let Rbt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Lbt(i):void 0,this.positionMapper=new Abt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Gg.getEmpty(),0);return e||(e=Q_.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Vu.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===Go.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?kbt(i):iQe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!mY(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!WO(n.length,t)?!1:n.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case Vu.ClosingBracket:return new Sbt(i.bracketIds,i.length);case Vu.Text:return i.astNode;case Vu.OpeningBracket:{if(t>300)return new V0(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===Vu.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),UO.create(i.astNode,o,r.astNode)):UO.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var nD;(function(s){s[s.InProgress=1]="InProgress",s[s.Completed=2]="Completed"})(nD||(nD={}));function vY(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Uy(RBe(s)),i=RBe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!mY(l);){const[h,u]=n.splitAt(l);d.push(h),l=e3(h.lengthAfter,l),n=u??t.dequeue()}return mY(l)||d.push(new Ax(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&Xqe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new DS(u.startOffset,d,Tr(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=tu;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=bbt(d,f=>f.lengthBefore),u=Tr(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=Tr(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class Ax{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=e3(e,this.lengthAfter);return Xqe(t,tu)?[this,void 0]:this.modified?[new Ax(this.modified,this.lengthBefore,e),new Ax(this.modified,tu,t)]:[new Ax(this.modified,e,e),new Ax(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${nm(this.lengthBefore)} -> ${nm(this.lengthAfter)}`}}function RBe(s){const e=[];let t=tu;for(const i of s){const n=e3(t,i.startOffset);mY(n)||e.push(new Ax(!1,n,n));const o=e3(i.startOffset,i.endOffset);e.push(new Ax(!0,o,i.newLength)),t=i.endOffset}return e}class Mbt extends V{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new I,this.denseKeyProvider=new Zqe,this.brackets=new tQe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===nD.Completed?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new xbt(this.textModel.getValue(),i);this.initialAstWithoutTokens=gme(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===nD.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new DS(ka(i.fromLineNumber-1,0),ka(i.toLineNumber,0),ka(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=DS.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=vY(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=vY(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t,o=new eQe(this.textModel,this.brackets);return gme(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ka(e.startLineNumber-1,e.startColumn-1),n=ka(e.endLineNumber-1,e.endColumn-1);return new gT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;fme(r,tu,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=aF(e.getStartPosition()),n=aF(e.getEndPosition());return new gT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Nbt(o,t,this.textModel);pme(r,tu,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return sQe(t,tu,t.length,aF(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return nQe(t,tu,t.length,aF(e))}}function nQe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){const n=[];for(const o of s.children)t=Tr(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(WO(r,i)){const c=nQe(s.children[o],r,a,i);if(c)return c}}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=DT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function sQe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){for(const n of s.children){if(t=Tr(e,n.length),WO(i,t)){const o=sQe(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=DT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function fme(s,e,t,i,n,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case Go.List:{const h=s.childrenLength;for(let u=0;u200)return!0;let c=!0;if(s.kind===Go.Pair){let l=0;if(a){let u=a.get(s.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(s.openingBracket.text,u)}const d=Tr(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),c=o.push(new mbt(DT(e,t),DT(e,d),s.closingBracket?DT(Tr(d,s.child?.length||tu),t):void 0,r,l,s,h)),e=d,c&&s.child){const u=s.child;if(t=Tr(e,u.length),HO(e,n)&&eV(t,i)&&(c=pme(u,e,t,i,n,o,r+1,a),!c))return!1}a?.set(s.openingBracket.text,l)}else{let l=e;for(const d of s.children){const h=l;if(l=Tr(l,d.length),HO(h,n)&&HO(i,l)&&(c=pme(d,h,l,i,n,o,r,a),!c))return!1}}return c}class Pbt extends V{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new wn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Z;this.bracketPairsTree.value=Fbt(e.add(new Mbt(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||gT.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||gT.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||gT.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(F.fromPositions(t,t)).findLast(c=>r.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const c=a.textIsBracket[r];return c?BG(this._findMatchingBracketUp(c,n,the(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(F.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Cc(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,F.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=the(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(Zb(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=c)break;if(Zb(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Zb(n.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Om.findNextBracketInRange(a.forwardRegex,i,o,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof KC)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(c)).brackets;if(l&&!Zb(n.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,l,c),u=Om.findPrevBracketInRange(l.reversedRegex,i,o,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof KC?null:p}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof KC?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return KC.INSTANCE;const f=Om.findPrevBracketInRange(o,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const d=this.textModel.tokenization.getLineTokens(l),h=d.getCount(),u=this.textModel.getLineContent(l);let f=h-1,p=u.length,m=u.length;l===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const b=d.getLanguageId(f)===n&&!Zb(d.getStandardTokenType(f));if(b)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}v=b}if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return KC.INSTANCE;const p=Om.findNextBracketInRange(o,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return p;u=p.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let p=0,m=0,v=0;d===t.lineNumber&&(p=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let b=!0;for(;p=1;r--){const a=this.textModel.tokenization.getLineTokens(r),c=a.getCount(),l=this.textModel.getLineContent(r);let d=c-1,h=l.length,u=l.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const p=a.getLanguageId(d);i!==p&&(i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(n&&o&&f&&h!==u){const v=Om.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!n&&!Zb(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&n&&f&&h!==u){const v=Om.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&n&&f&&h!==u){const p=Om.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(p)return this._toFoundBracket(o,p)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let n=null,o=null,r=null;for(let a=t.lineNumber;a<=i;a++){const c=this.textModel.tokenization.getLineTokens(a),l=c.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=c.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const m=c.getLanguageId(h);n!==m&&(n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const n=the(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,b=p?p.brackets.length:0;v{for(;;){if(n&&++l%100===0&&!n())return KC.INSTANCE;const w=Om.findNextBracketInRange(f.forwardRegex,p,m,v,b);if(!w)break;const y=m.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),C=f.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(w,C,!1,n);v=w.endColumn-1}return null};let h=null,u=null;for(let f=i.lineNumber;f<=o;f++){const p=this.textModel.tokenization.getLineTokens(f),m=p.getCount(),v=this.textModel.getLineContent(f);let b=0,w=0,y=0;if(f===i.lineNumber){b=p.findTokenIndexAtOffset(i.column-1),w=i.column-1,y=i.column-1;const A=p.getLanguageId(b);h!==A&&(h=A,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let C=!0;for(;be?.dispose()}}function the(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const tse=class tse{constructor(){this._searchCanceledBrand=void 0}};tse.INSTANCE=new tse;let KC=tse;function BG(s){return s instanceof KC?null:s}class Obt extends V{constructor(e){super(),this.textModel=e,this.colorProvider=new oQe,this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new F(1,1,this.textModel.getLineCount(),1),e,t):[]}}class oQe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Cp((s,e)=>{const t=[Rqe,Mqe,Nqe,Pqe,Fqe,Oqe],i=new oQe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(S_t)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var Al;(function(s){s[s.Resource=0]="Resource",s[s.Workspace=1]="Workspace"})(Al||(Al={}));class rQe{constructor(e,t){this.resource=e,this.elements=t}}const qF=class qF{constructor(){this.id=qF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};qF._ID=0,qF.None=new qF;let bY=qF;const QF=class QF{constructor(){this.id=QF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};QF._ID=0,QF.None=new QF;let z0=QF;function WG(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Kl{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${WG(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${WG(this.oldText)}")`:`(replace@${this.oldPosition} "${WG(this.oldText)}" with "${WG(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Tu(e,n,i),i+=4;for(let o=0;o0&&(this.changes=Bbt(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Tu(e,t?t.length:0,i),i+=4,t)for(const n of t)Tu(e,n.selectionStartLineNumber,i),i+=4,Tu(e,n.selectionStartColumn,i),i+=4,Tu(e,n.positionLineNumber,i),i+=4,Tu(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Iu(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(N.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof el}append(e,t,i,n,o){this._data instanceof el&&this._data.append(e,t,i,n,o)}close(){this._data instanceof el&&(this._data=this._data.serialize())}open(){this._data instanceof el||(this._data=el.deserialize(this._data))}undo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof el&&(this._data=this._data.serialize());const e=el.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof el&&(this._data=this._data.serialize());const e=el.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof el&&(this._data=this._data.serialize()),this._data.byteLength+168}}class mme{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=Al.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const o=lP(n.resource);this._editStackElementsMap.set(o,n)}this._delegate=null}setDelegate(e){this._delegate=e}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}getMissingModels(){const e=[];for(const t of this._editStackElementsArr)N.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=lP(e);return this._editStackElementsMap.has(t)}setModel(e){const t=lP(N.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=lP(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=lP(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=lP(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${_i(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function _me(s){return s.getEOL()===` +`?Sh.LF:Sh.CRLF}function qC(s){return s?s instanceof aQe||s instanceof mme:!1}class oLe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(qC(i)&&i.canAppend(this._model))return i;const n=new aQe(g(4960,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],_me(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=oLe._computeCursorState(i,r),c=r.map((l,d)=>({index:d,textChange:l.textChange}));return c.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,c.map(l=>l.textChange),_me(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return vt(i),null}}}class Wbt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Hbt(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||c>0&&l>0)return;const d=Math.abs(a-l),h=Math.abs(r-c);if(d===0){n.spacesDiff=h,h>0&&0<=c-1&&c-10?n++:C>1&&o++,Hbt(r,a,v,y,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=l&&d[L]++,r=v,a=y}let u=t;n!==o&&(u=n{const v=d[m];v>p&&(p=v,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}class vme{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Si)return rLe(this.right);let e=this;for(;e.parent!==Si&&e.parent.left!==e;)e=e.parent;return e.parent===Si?Si:e.parent}prev(){if(this.left!==Si)return cQe(this.left);let e=this;for(;e.parent!==Si&&e.parent.right!==e;)e=e.parent;return e.parent===Si?Si:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var $n;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})($n||($n={}));const Si=new vme(null,$n.Black);Si.parent=Si;Si.left=Si;Si.right=Si;Si.color=$n.Black;function rLe(s){for(;s.left!==Si;)s=s.left;return s}function cQe(s){for(;s.right!==Si;)s=s.right;return s}function aLe(s){return s===Si?0:s.size_left+s.piece.length+aLe(s.right)}function cLe(s){return s===Si?0:s.lf_left+s.piece.lineFeedCnt+cLe(s.right)}function ihe(){Si.parent=Si}function p5(s,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Si&&(t.left.parent=e),t.parent=e.parent,e.parent===Si?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function m5(s,e){const t=e.left;e.left=t.right,t.right!==Si&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Si?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function HG(s,e){let t,i;if(e.left===Si?(i=e,t=i.right):e.right===Si?(i=e,t=i.left):(i=rLe(e.right),t=i.right),i===s.root){s.root=t,t.color=$n.Black,e.detach(),ihe(),s.root.parent=Si;return}const n=i.color===$n.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,tV(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,tV(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Si&&(i.left.parent=i),i.right!==Si&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,tV(s,i)),e.detach(),t.parent.left===t){const r=aLe(t),a=cLe(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const c=r-t.parent.size_left,l=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,yC(s,t.parent,c,l)}}if(tV(s,t.parent),n){ihe();return}let o;for(;t!==s.root&&t.color===$n.Black;)t===t.parent.left?(o=t.parent.right,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,p5(s,t.parent),o=t.parent.right),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.right.color===$n.Black&&(o.left.color=$n.Black,o.color=$n.Red,m5(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=$n.Black,o.right.color=$n.Black,p5(s,t.parent),t=s.root)):(o=t.parent.left,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,m5(s,t.parent),o=t.parent.left),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.left.color===$n.Black&&(o.right.color=$n.Black,o.color=$n.Red,p5(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=$n.Black,o.left.color=$n.Black,m5(s,t.parent),t=s.root));t.color=$n.Black,ihe()}function NBe(s,e){for(tV(s,e);e!==s.root&&e.parent.color===$n.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,p5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,m5(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,m5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,p5(s,e.parent.parent))}s.root.color=$n.Black}function yC(s,e,t,i){for(;e!==s.root&&e!==Si;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function tV(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=aLe(e.left)-e.size_left,i=cLe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const vC=65535;function lQe(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class Ubt{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function DC(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n126)&&(r=!1)}const a=new Ubt(lQe(s),i,n,o,r);return s.length=0,a}class pg{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class $0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class zbt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Si&&e.iterate(e.root,i=>(i!==Si&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class $bt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class Gbt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new $0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Si,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=DC(e[o].buffer));const a=new pg(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,a)}this._searchCache=new $bt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=vC,i=t-Math.floor(t/3),n=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,c=>{const l=this.getNodeContent(c),d=l.length;if(r<=i||r+d0){const c=o.replace(/\r\n|\r|\n/g,e);a.push(new $0(c,DC(c)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new zbt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,n=>{if(n===Si)return!0;const o=this.getNodeContent(n),r=o.length,a=e.nodeAt(t),c=e.nodeAt(t+r),l=e.getValueInRange2(a,c);return t+=r,o===l})}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Si;)if(n.left!==Si&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Si;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new oe(i+1,a+1)}return new oe(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Si){const o=this.getOffsetAt(i+1,1),r=n-e-o;return new oe(i+1,r+1)}else t=t.right;return new oe(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,c=this._buffers[a.piece.bufferIndex].buffer,l=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return c.substring(l+e.remainder,l+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Si;){const a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(c,c+t.remainder);break}else r+=a.substr(c,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===Si)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const c=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=l[d]+r.start.column;if(n&&(c.charCodeAt(u)===B.LineFeed&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===B.CarriageReturn?(n=!0,i+=c.substr(u,a-1)):i+=c.substr(u,a),!0;i+=this._EOLNormalized?c.substring(u,Math.max(u,l[d+1]-this._EOLLength)):c.substring(u,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fC+p,t.reset(0)):(w=u.buffer,y=C=>C,t.reset(p));do if(v=t.next(w),v){if(y(v.index)>=m)return d;this.positionInBuffer(e,y(v.index)-f,b);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,b),A=b.line===o.line?b.column-o.column+n:b.column+1,L=A+v[0].length;if(h[d++]=O0(new F(i+C,A,i+C,L),v,c),y(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new tF(t.wordSeparators,t.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(l===null)return[];let d=this.positionInBuffer(c.node,c.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(c.node===l.node)return this.findMatchesInNode(c.node,a,e.startLineNumber,e.startColumn,d,h,t,i,n,r,o),o;let u=e.startLineNumber,f=c.node;for(;f!==l.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){const b=this._buffers[f.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=b[d.line+m],C=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,C,d,this.positionInBuffer(f,y-w),t,i,n,r,o),r>=n)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,v,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,n),r>=n)return o;u++,c=this.nodeAt2(u,1),f=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(u===e.endLineNumber){const m=u===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,m,r,o,i,n),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,c,l){const d=e.wordSeparators;if(!c&&e.simpleSearch){const u=e.simpleSearch,f=u.length,p=i.length;let m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!d||vTe(d,i,p,m,f))&&(a[r++]=new F8(new F(n,m+1+o,n,m+1+f+o),null),r>=l))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=O0(new F(n,h.index+1+o,n,h.index+1+h[0].length+o),h,c),r>=l))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Si){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,c=a.bufferIndex,l=this.positionInBuffer(n,o);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new pg(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(c,a.end)-this.offsetInBuffer(c,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,o)===10){const m={line:h.start.line+1,column:0};h=new pg(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,l);else this.deleteNodeTail(n,l);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let f=n;for(let p=0;p=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let r=1;r=u)l=h+1;else break;return i?(i.line=h,i.column=c-f,null):{line:h,column:c-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tvC){const d=[];for(;e.length>vC;){const u=e.charCodeAt(vC-1);let f;u===B.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,vC-1),e=e.substring(vC-1)):(f=e.substring(0,vC),e=e.substring(vC));const p=DC(f);d.push(new pg(this._buffers.length,{line:0,column:0},{line:p.length-1,column:f.length-p[p.length-1]},p.length-1,f.length)),this._buffers.push(new $0(f,p))}const h=DC(e);return d.push(new pg(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new $0(e,h)),d}let t=this._buffers[0].buffer.length;const i=DC(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+c,h+l-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=l.substring(d+c,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Si;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(c,c+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Si;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),c=this.getLineFeedCnt(i.bufferIndex,i.start,r),l=c-n,d=a-o,h=i.length+d;e.piece=new pg(i.bufferIndex,i.start,r,c,h),yC(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),c=this.offsetInBuffer(i.bufferIndex,r),l=a-n,d=o-c,h=i.length+d;e.piece=new pg(i.bufferIndex,r,i.end,a,h),yC(this,e,d,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,c=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new pg(n.bufferIndex,n.start,l,d,h),yC(this,e,h-a,d-c);const u=new pg(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=DC(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Si;)if(i.left!==Si&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Si;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Si||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Si||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new pg(e.piece.bufferIndex,e.piece.start,o,a,r),yC(this,e,-1,-1),e.piece.length===0&&i.push(e);const c={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,c,t.piece.end);t.piece=new pg(t.piece.bufferIndex,c,t.piece.end,d,l),yC(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r +`);this.rbInsertRight(e,h[0]);for(let u=0;u(t+=this.getNodeContent(i),!0)),t}}class k1 extends V{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new Gbt(e,i,a)}equals(e){return!(e instanceof k1)||this._BOM!==e._BOM||this.getEOL()!==e.getEOL()?!1:this._pieceTree.equal(e._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new F(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=go.TextDefined){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=go.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const c=r.length-a.length,l=e.endLineNumber-e.startLineNumber;o=c*l}return n-i+o}getCharacterCountInRange(e,t=go.TextDefined){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),c=r===n?e.startColumn-1:0,l=r===o?e.endColumn-1:a.length;for(let d=c;dv.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(c);let p=null;if(t&&h.length>0){h.sort((m,v)=>v.lineNumber-m.lineNumber),p=[];for(let m=0,v=h.length;m0&&h[m-1].lineNumber===b)continue;const w=h[m].oldContent,y=this.getLineContent(b);y.length===0||y===w||kh(y)!==-1||p.push(b)}}return this._onDidChangeContent.fire(),new Mut(u,f,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new F(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const c=[];for(let f=0,p=e.length;f0&&c.push(m.text),r=v.endLineNumber,a=v.endColumn}const l=c.join(""),[d,h,u]=Ab(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,go.TextDefined),text:l,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(k1._sortOpsDescending);const t=[];for(let i=0;i0){const l=o+1;l===1?c=new F(i,n,i,n+r):c=new F(i,n,i+l-1,a+1)}else c=new F(i,n,i,n);return c}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let r=0,a=e.length;r0){const u=c.eolCount+1;u===1?h=new F(l,d,l,d+c.firstLineLength):h=new F(l,d,l+u-1,c.lastLineLength+1)}else h=new F(l,d,l,d);i=h.endLineNumber,n=h.endColumn,t.push(h),o=c}return t}static _sortOpsAscending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Kbt{constructor(e,t,i,n,o,r,a,c,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=c,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===Sb.LF?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=PCt(this._tmpLineStarts,e);this.chunks.push(new xT(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=DU(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=yQe(e)))}finish(e=!0){return this._finish(),new WCt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=yA(e.buffer);e.lineStarts=t,this._previousChar===Q.CarriageReturn&&this.cr++}}}class HCt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),o=this._store.slice(e+t),r=UCt(i,this._default);this._store=s.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s>>1;if(t===0&&s[s.length-2]===i)return SA;const r=lh.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,c=s[r<<1];if(id&&(s[l++]=p,s[l++]=s[(f<<1)+1],d=p)}if(l===s.length)return e;const u=new Uint32Array(l);return u.set(s.subarray(0,l),0),u.buffer}static append(e,t){if(t===SA)return e;if(e===SA)return t;if(e===null)return e;if(t===null)return null;const i=aE(e),s=aE(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=lh.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Ih.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Ih.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i);return}this._tokens[s]=Ih.deleteEnding(this._tokens[s],e.column-1),this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new QZ(e,[t]))}finalize(){return this._tokens}serialize(){const e=this._serializeSize(),t=new Uint8Array(e);return this._serialize(t),t}_serializeSize(){let e=0;e+=4;for(let t=0;tt)break;const o=this._textModel.getLineContent(s.lineNumber),r=g5(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return Ar.Other;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=g5(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),c=new lh(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return Ar.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(s,0),d=g5(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new lh(d.tokens,c,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const c=this._textModel.getLineFirstNonWhitespaceColumn(a);if(c!==0&&c0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}acceptChanges(e){for(const t of e){const[i]=Gb(t.text);this.acceptChange(new bi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class GCt{constructor(){this._ranges=[]}getRanges(){return this._ranges}get min(){return this._ranges.length===0?null:this._ranges[0].start}removeMin(){if(this._ranges.length===0)return null;const e=this._ranges[0];return e.start+1===e.endExclusive?this._ranges.shift():this._ranges[0]=new hi(e.start+1,e.endExclusive),e.start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new hi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new hi(i.start,e):this._ranges.splice(t,1,new hi(i.start,e),new hi(e+1,i.endExclusive))}}addRange(e){hi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function g5(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){bt(a)}return r||(r=SMe(n.encodeLanguageId(e),o)),lh.convertToEndOffset(r.tokens,i.length),r}class qCt{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,PU(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new bi(e,t))}}class r7{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let s=null;if(t1&&(o=Xf.getLanguageId(s[1])!==e),!o)return SA}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=eHe(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Ih.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Ih.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Ih.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class eNe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){s=s||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=Uq(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=eNe._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let c=0;const l=[];let d=0,h=0;const u=(f,p)=>{f!==h&&(h=f,l[d++]=f,l[d++]=p)};for(let f=0;f>>0,b=~w>>>0;for(;ct)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class jZ extends eYe{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new eNe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new I),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new I),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new I),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QCt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}_hasListeners(){return this._onDidChangeLanguage.hasListeners()||this._onDidChangeLanguageConfiguration.hasListeners()||this._onDidChangeTokens.hasListeners()}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=Gb(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):Q.Null)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new cn("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=jZ._findLanguageBoundaries(s,o),c=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&r===t.column-1){const[l,d]=jZ._findLanguageBoundaries(s,o-1),h=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(l,d),l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new jCt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Mwe(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=dc.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return bt(a),[null,null]}return[o,r]},[i,s]=t();if(i&&s?this._tokenizer=new zCt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===RI.Completed)return;const r=RI.Completed;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&r>=c&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new qCt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new r7(this._languageIdCodec),this._debugBackgroundStates=new Mwe(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,s]=Gb(t.text);this._tokens.acceptEdit(t.range,i,s),this._debugBackgroundTokens?.acceptEdit(t.range,i,s)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=bi.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new Twe,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(s)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new Twe;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(s)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return Ar.Other;const s=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class jCt extends ${get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new yn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ls(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const pO=ae("undoRedoService");var $L;function hde(n){const e=new o7;return e.acceptChunk(n),e.finish()}function tNe(n){return new Promise((e,t)=>{const i=new o7;let s=!1;hO(n,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{s||(s=!0,t(o))},onEnd:()=>{s||(s=!0,e(i.finish()))}})})}function fQ(n){const e=new o7;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function Nwe(n,e){let t;return typeof n=="string"?t=hde(n):Yft(n)?t=fQ(n):t=n,t.create(e)}let $j=0;const KCt=999,YCt=1e4;class JCt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const f5=()=>{throw new Error("Invalid change accessor")};var Vm;(function(n){n[n.Relaxed=0]="Relaxed",n[n.SurrogatePairs=1]="SurrogatePairs"})(Vm||(Vm={}));var yb;let QU=(yb=class extends ${static resolveOptions(e,t){if(t.detectIndentation){const i=XWe(e,t.tabSize,t.insertSpaces);return new YY({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new YY(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return pa(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new nyt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new I),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new I),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new I),this._eventEmitter=this._register(new syt),this._languageSelectionListener=this._register(new Dn),this._deltaDecorationCallCnt=0,this._attachedViews=new oyt,$j++,this.id="$model"+$j,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=P.parse("inmemory://model/"+$j):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Nwe(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=$L.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new xCt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new ebt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new kCt(this)),this._tokenizationTextModelPart=new jZ(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new O(1,1,h,this._buffer.getLineLength(h)+1),xo.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>$L.LARGE_FILE_SIZE_THRESHOLD||h>$L.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>$L.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>$L._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=SQe($j),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new tHe,this._commandManager=new YMe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new pR([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=$.None}_hasListeners(){return this._onWillDispose.hasListeners()||this._onDidChangeDecorations.hasListeners()||this._tokenizationTextModelPart._hasListeners()||this._onDidChangeOptions.hasListeners()||this._onDidChangeAttached.hasListeners()||this._onDidChangeInjectedText.hasListeners()||this._eventEmitter.hasListeners()}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}equalsTextBuffer(e){return this._assertNotDisposed(),this._buffer.equals(e)}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new mM(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Ui();const{textBuffer:t,disposable:i}=Nwe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new tHe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new MW([new Wbt],this._versionId,!1,!1),this._createContentChanged2(new O(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===bu.CRLF?`\r +`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Vbt(this._tmpLineStarts,e);this.chunks.push(new $0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=E2(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Y6e(e)))}finish(e=!0){return this._finish(),new Kbt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=DC(e.buffer);e.lineStarts=t,this._previousChar===B.CarriageReturn&&this.cr++}}}class qbt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),o=this._store.slice(e+t),r=Qbt(i,this._default);this._store=n.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n>>1;if(t===0&&n[n.length-2]===i)return kC;const r=gd.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,c=n[r<<1];if(id&&(n[l++]=p,n[l++]=n[(f<<1)+1],d=p)}if(l===n.length)return e;const u=new Uint32Array(l);return u.set(n.subarray(0,l),0),u.buffer}static append(e,t){if(t===kC)return e;if(e===kC)return t;if(e===null)return e;if(t===null)return null;const i=hS(e),n=hS(t),o=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=gd.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let a=r;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Fd.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Fd.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[n]=Fd.insert(this._tokens[n],e.column-1,i);return}this._tokens[n]=Fd.deleteEnding(this._tokens[n],e.column-1),this._tokens[n]=Fd.insert(this._tokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new wY(e,[t]))}finalize(){return this._tokens}serialize(){const e=this._serializeSize(),t=new Uint8Array(e);return this._serialize(t),t}_serializeSize(){let e=0;e+=4;for(let t=0;tt)break;const o=this._textModel.getLineContent(n.lineNumber),r=u4(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return nr.Other;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=u4(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),c=new gd(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return nr.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,r=this.getStartState(n);if(!r)return null;const a=this._textModel.getLineContent(n),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=u4(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new gd(d.tokens,c,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const c=this._textModel.getLineFirstNonWhitespaceColumn(a);if(c!==0&&c0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}acceptChanges(e){for(const t of e){const[i]=Ab(t.text);this.acceptChange(new pi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class Xbt{constructor(){this._ranges=[]}getRanges(){return this._ranges}get min(){return this._ranges.length===0?null:this._ranges[0].start}removeMin(){if(this._ranges.length===0)return null;const e=this._ranges[0];return e.start+1===e.endExclusive?this._ranges.shift():this._ranges[0]=new mi(e.start+1,e.endExclusive),e.start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new mi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new mi(i.start,e):this._ranges.splice(t,1,new mi(i.start,e),new mi(e+1,i.endExclusive))}}addRange(e){mi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function u4(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,o.clone())}catch(a){vt(a)}return r||(r=ATe(s.encodeLanguageId(e),o)),gd.convertToEndOffset(r.tokens,i.length),r}class Zbt{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,N2(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new pi(e,t))}}class s3{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t1&&(o=Kv.getLanguageId(n[1])!==e),!o)return kC}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=PBe(e),o.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Fd.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Fd.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Fd.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Fd.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Fd.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,o=e.length;n>>0}class lLe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let n=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){n=n||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=N7(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const n=lLe._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let c=0;const l=[];let d=0,h=0;const u=(f,p)=>{f!==h&&(h=f,l[d++]=f,l[d++]=p)};for(let f=0;f>>0,w=~b>>>0;for(;ct)n=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class yY extends zqe{constructor(e,t,i,n,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=r,this._semanticTokens=new lLe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new I),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new I),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new I),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new ewt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}_hasListeners(){return this._onDidChangeLanguage.hasListeners()||this._onDidChangeLanguageConfiguration.hasListeners()||this._onDidChangeTokens.hasListeners()}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,o]=Ab(t.text);this._semanticTokens.acceptEdit(t.range,i,n,o,t.text.length>0?t.text.charCodeAt(0):B.Null)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Ni("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=yY._findLanguageBoundaries(n,o),c=Ik(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&r===t.column-1){const[l,d]=yY._findLanguageBoundaries(n,o-1),h=Ik(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(l,d),l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new twt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new yme(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=Ta.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return vt(a),[null,null]}return[o,r]},[i,n]=t();if(i&&n?this._tokenizer=new Ybt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===nD.Completed)return;const r=nD.Completed;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&r>=c&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Zbt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new s3(this._languageIdCodec),this._debugBackgroundStates=new yme(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,n]=Ab(t.text);this._tokens.acceptEdit(t.range,i,n),this._debugBackgroundTokens?.acceptEdit(t.range,i,n)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=pi.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new bme,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(n)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new bme;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return nr.Other;const n=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class twt extends V{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new cn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){is(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const JA=ae("undoRedoService");var i0;function oae(s){const e=new n3;return e.acceptChunk(s),e.finish()}function dLe(s){return new Promise((e,t)=>{const i=new n3;let n=!1;kN(s,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{n||(n=!0,t(o))},onEnd:()=>{n||(n=!0,e(i.finish()))}})})}function u6(s){const e=new n3;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function Cme(s,e){let t;return typeof s=="string"?t=oae(s):Lut(s)?t=u6(s):t=s,t.create(e)}let UG=0;const iwt=999,nwt=1e4;class swt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const g4=()=>{throw new Error("Invalid change accessor")};var Dp;(function(s){s[s.Relaxed=0]="Relaxed",s[s.SurrogatePairs=1]="SurrogatePairs"})(Dp||(Dp={}));var Jv;let C_=(Jv=class extends V{static resolveOptions(e,t){if(t.detectIndentation){const i=MBe(e,t.tabSize,t.insertSpaces);return new wq({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new wq(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return jr(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new dwt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new I),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new I),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new I),this._eventEmitter=this._register(new hwt),this._languageSelectionListener=this._register(new wn),this._deltaDecorationCallCnt=0,this._attachedViews=new uwt,UG++,this.id="$model"+UG,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=N.parse("inmemory://model/"+UG):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Cme(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=i0.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Pbt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new lvt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Obt(this)),this._tokenizationTextModelPart=new yY(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new F(1,1,h,this._buffer.getLineLength(h)+1),go.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>i0.LARGE_FILE_SIZE_THRESHOLD||h>i0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>i0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>i0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=J6e(UG),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new FBe,this._commandManager=new oLe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d),this._register(this._languageConfigurationService.onDidChange(f=>{this._bracketPairs.handleLanguageConfigurationServiceChange(f),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(f)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new k1([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=V.None}_hasListeners(){return this._onWillDispose.hasListeners()||this._onDidChangeDecorations.hasListeners()||this._tokenizationTextModelPart._hasListeners()||this._onDidChangeOptions.hasListeners()||this._onDidChangeAttached.hasListeners()||this._onDidChangeInjectedText.hasListeners()||this._eventEmitter.hasListeners()}_assertNotDisposed(){if(this._isDisposed)throw new Ni("Model is disposed!")}equalsTextBuffer(e){return this._assertNotDisposed(),this._buffer.equals(e)}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new xT(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Pi();const{textBuffer:t,disposable:i}=Cme(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new FBe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new BO([new Qvt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===Sh.CRLF?`\r `:` -`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new MW([new Vbt],this._versionId,!1,!1),this._createContentChanged2(new O(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=YCt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new YY({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const c=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(c),this._decorationProvider.handleDidChangeOptions(c),this._onDidChangeOptions.fire(c)}detectIndentation(e,t){this._assertNotDisposed();const i=XWe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),FMe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(CQe.source,!1,!0,!1,null,!1,Zn.MAX_SAFE_SMALL_INTEGER);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,Vm.Relaxed);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new cn("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new JCt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new cn("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?bu.LF:bu.CRLF}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(o);r>=h&&(r=h)}const a=e.endLineNumber,c=e.endColumn;let l=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(l);d>=h&&(d=h)}return i===o&&s===r&&a===l&&c===d&&e instanceof O&&!(e instanceof mt)?e:new O(o,r,l,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===Vm.SurrogatePairs){const r=this._buffer.getLineCharCode(e,t-2);if(wl(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new oe(1,1);if(s>r)return new oe(r,this.getLineMaxColumn(r));if(o<=1)return new oe(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new oe(s,a);if(i===Vm.SurrogatePairs){const c=this._buffer.getLineCharCode(s,o-2);if(wl(c))return new oe(s,o-1)}return new oe(s,o)}validatePosition(e){const t=Vm.SurrogatePairs;return this._assertNotDisposed(),e instanceof oe&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,Vm.Relaxed)||!this._isValidPosition(o,r,Vm.Relaxed))return!1;if(t===Vm.SurrogatePairs){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,c=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,l=wl(a),d=wl(c);return!l&&!d}return!0}validateRange(e){const t=Vm.SurrogatePairs;if(this._assertNotDisposed(),e instanceof O&&!(e instanceof mt)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,Vm.Relaxed),s=this._validatePosition(e.endLineNumber,e.endColumn,Vm.Relaxed),o=i.lineNumber,r=i.column,a=s.lineNumber,c=s.column;if(t===Vm.SurrogatePairs){const l=r>1?this._buffer.getLineCharCode(o,r-2):0,d=c>1&&c<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,c-2):0,h=wl(l),u=wl(d);return!h&&!u?new O(o,r,a,c):o===a&&r===c?new O(o,r-1,a,c-1):h&&u?new O(o,r-1,a,c+1):h?new O(o,r-1,a,c):new O(o,r,a,c+1)}return new O(o,r,a,c)}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new O(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=KCt){this._assertNotDisposed();let c=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>O.isIRange(h))&&(c=t.map(h=>this.validateRange(h)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const l=[];l.push(c.reduce((h,u)=>O.areIntersecting(h,u)?h.plusRange(u):(l.push(h),u)));let d;if(!i&&e.indexOf(` -`)<0){const u=new UA(e,i,s,o).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>yj.findMatches(this,new UA(e,i,s,o),h,r,a);return l.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` -`)<0){const l=new UA(e,i,s,o).parseSearchRequest();if(!l)return null;const d=this.getLineCount();let h=new O(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,l,r,1);return yj.findNextMatch(this,new UA(e,i,s,o),a,r),u.length>0||(h=new O(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,r,1),u.length>0)?u[0]:null}return yj.findNextMatch(this,new UA(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return yj.findPreviousMatch(this,new UA(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?bu.LF:bu.CRLF)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Qge?e:new Qge(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,c=e.length;al.endLineNumber,m=l.startLineNumber>f.endLineNumber;if(!p&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,c=this._trimAutoWhitespaceLines.length;ap.endLineNumber)&&!(l===p.startLineNumber&&p.startColumn===d&&p.isEmpty()&&m&&m.length>0&&m.charAt(0)===` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new BO([new Jvt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const o=this._buffer.getLineLength(n);o>=nwt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new wq({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const c=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(c),this._decorationProvider.handleDidChangeOptions(c),this._onDidChangeOptions.fire(c)}detectIndentation(e,t){this._assertNotDisposed();const i=MBe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),HTe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(j6e.source,!1,!0,!1,null,!1,Un.MAX_SAFE_SMALL_INTEGER);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,Dp.Relaxed);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ni("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new swt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ni("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?Sh.LF:Sh.CRLF}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(o);r>=h&&(r=h)}const a=e.endLineNumber,c=e.endColumn;let l=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(l);d>=h&&(d=h)}return i===o&&n===r&&a===l&&c===d&&e instanceof F&&!(e instanceof dt)?e:new F(o,r,l,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===Dp.SurrogatePairs){const r=this._buffer.getLineCharCode(e,t-2);if(Pc(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new oe(1,1);if(n>r)return new oe(r,this.getLineMaxColumn(r));if(o<=1)return new oe(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new oe(n,a);if(i===Dp.SurrogatePairs){const c=this._buffer.getLineCharCode(n,o-2);if(Pc(c))return new oe(n,o-1)}return new oe(n,o)}validatePosition(e){const t=Dp.SurrogatePairs;return this._assertNotDisposed(),e instanceof oe&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,Dp.Relaxed)||!this._isValidPosition(o,r,Dp.Relaxed))return!1;if(t===Dp.SurrogatePairs){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,c=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,l=Pc(a),d=Pc(c);return!l&&!d}return!0}validateRange(e){const t=Dp.SurrogatePairs;if(this._assertNotDisposed(),e instanceof F&&!(e instanceof dt)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,Dp.Relaxed),n=this._validatePosition(e.endLineNumber,e.endColumn,Dp.Relaxed),o=i.lineNumber,r=i.column,a=n.lineNumber,c=n.column;if(t===Dp.SurrogatePairs){const l=r>1?this._buffer.getLineCharCode(o,r-2):0,d=c>1&&c<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,c-2):0,h=Pc(l),u=Pc(d);return!h&&!u?new F(o,r,a,c):o===a&&r===c?new F(o,r-1,a,c-1):h&&u?new F(o,r-1,a,c+1):h?new F(o,r-1,a,c):new F(o,r,a,c+1)}return new F(o,r,a,c)}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new F(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=iwt){this._assertNotDisposed();let c=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>F.isIRange(h))&&(c=t.map(h=>this.validateRange(h)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const l=[];l.push(c.reduce((h,u)=>F.areIntersecting(h,u)?h.plusRange(u):(l.push(h),u)));let d;if(!i&&e.indexOf(` +`)<0){const u=new GC(e,i,n,o).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>IG.findMatches(this,new GC(e,i,n,o),h,r,a);return l.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const l=new GC(e,i,n,o).parseSearchRequest();if(!l)return null;const d=this.getLineCount();let h=new F(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,l,r,1);return IG.findNextMatch(this,new GC(e,i,n,o),a,r),u.length>0||(h=new F(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,r,1),u.length>0)?u[0]:null}return IG.findNextMatch(this,new GC(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return IG.findPreviousMatch(this,new GC(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?Sh.LF:Sh.CRLF)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Bde?e:new Bde(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,c=e.length;al.endLineNumber,m=l.startLineNumber>f.endLineNumber;if(!p&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,c=this._trimAutoWhitespaceLines.length;ap.endLineNumber)&&!(l===p.startLineNumber&&p.startColumn===d&&p.isEmpty()&&m&&m.length>0&&m.charAt(0)===` `)&&!(l===p.startLineNumber&&p.startColumn===1&&p.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` -`)){h=!1;break}}if(h){const u=new O(l,1,l,d);t.push(new Qge(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;N--){const z=f+N,U=C+N;F.takeFromEndWhile(j=>j.lineNumber>U);const J=F.takeFromEndWhile(j=>j.lineNumber===U);a.push(new WWe(z,this.getLineContent(U),J))}if(wQe.lineNumberQe.lineNumber===De)}a.push(new Ubt(z+1,f+v,re,j))}c+=b}this._emitContentChangedEvent(new MW(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new WWe(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new sYe(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,nHe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){bt(o)}return i.addDecoration=f5,i.changeDecoration=f5,i.changeDecorationOptions=f5,i.removeDecoration=f5,i.deltaDecorations=f5,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),bt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:iHe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(iHe[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),c=Math.min(r,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new O(a,1,c,l),h=this._getDecorationsInRange(d,i,s,o);return u_e(h,this._decorationProvider.getDecorationsInRange(d,i,s)),h}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return u_e(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return iw.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(i.options.before||t.before){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}const r=s!==o,a=ZCt(t)!==oJ(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const c=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(c);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return XCt(this.getLineContent(e))+1}},$L=yb,yb._MODEL_SYNC_LIMIT=50*1024*1024,yb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,yb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,yb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,yb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ph.tabSize,indentSize:Ph.indentSize,insertSpaces:Ph.insertSpaces,detectIndentation:!1,defaultEOL:zb.LF,trimAutoWhitespace:Ph.trimAutoWhitespace,largeFileOptimizations:Ph.largeFileOptimizations,bracketPairColorizationOptions:Ph.bracketPairColorizationOptions},yb);QU=$L=D([_(4,pO),_(5,Di),_(6,lo)],QU);function XCt(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function ffe(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function ZCt(n){return!!n.after||!!n.before}function oJ(n){return!!n.options.after||!!n.options.before}class tHe{constructor(){this._decorationsTree0=new cfe,this._decorationsTree1=new cfe,this._injectedTextDecorationsTree=new cfe}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),c=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){oJ(e)?this._injectedTextDecorationsTree.insert(e):ffe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){oJ(e)?this._injectedTextDecorationsTree.delete(e):ffe(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){oJ(e)?this._injectedTextDecorationsTree.resolveNode(e,t):ffe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function _C(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class yYe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class eyt extends yYe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:oh.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class tyt{constructor(e){this.position=e?.position??FS.Center,this.persistLane=e?.persistLane}}class iyt extends yYe{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?fe.fromHex(e):t.getColor(e.id)}}class m1{static from(e){return e instanceof m1?e:new m1(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Kt{static register(e){return new Kt(e)}static createDynamic(e){return new Kt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?_C(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||gi.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?_C(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new eyt(e.overviewRuler):null,this.minimap=e.minimap?new iyt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new tyt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?_C(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?_C(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?_C(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Llt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?_C(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?_C(e.marginClassName):null,this.inlineClassName=e.inlineClassName?_C(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?_C(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?_C(e.afterContentClassName):null,this.after=e.after?m1.from(e.after):null,this.before=e.before?m1.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Kt.EMPTY=Kt.register({description:"empty"});const iHe=[Kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:gi.NeverGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:gi.GrowsOnlyWhenTypingBefore}),Kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:gi.GrowsOnlyWhenTypingAfter})];function nHe(n){return n instanceof Kt?n:Kt.createDynamic(n)}class nyt extends ${constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new I),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}hasListeners(){return this._actual.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class syt extends ${constructor(){super(),this._fastEmitter=this._register(new I),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new I),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}hasListeners(){return this._fastEmitter.hasListeners()||this._slowEmitter.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class oyt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new ryt(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class ryt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new bi(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class iNe{static create(e){return new iNe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new ayt(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],c=[];return{addRequest:(l,d,h)=>{r.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=r.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?fu.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let Pwe=[],Fwe=[];function cyt(n,e,t,i,s,o,r,a){if(s===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=SYe(t,i,s,o,r),f=s-u,p=Pwe,m=Fwe;let v=0,w=0,b=0,C=s;const y=d.length;let S=0;if(S>=0){let M=Math.abs(h[S]-C);for(;S+1=M)break;M=k,S++}}for(;SM&&(M=w,k=b);let F=0,N=0,z=0,U=0;if(k<=C){let j=k,re=M===0?Q.Null:t.charCodeAt(M-1),me=M===0?fu.NONE:n.get(re),De=!0;for(let Qe=M;Qew&&Owe(re,me,Oe,wt,l)&&(F=Tt,N=j),j+=Nt,j>C){Tt>w?(z=Tt,U=j-Nt):(z=Qe+1,U=j),j-N>f&&(F=0),De=!1;break}re=Oe,me=wt}if(De){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(F===0){let j=k,re=t.charCodeAt(M),me=n.get(re),De=!1;for(let Qe=M-1;Qe>=w;Qe--){const Tt=Qe+1,Oe=t.charCodeAt(Qe);if(Oe===Q.Tab){De=!0;break}let wt,Nt;if(sF(Oe)?(Qe--,wt=fu.NONE,Nt=2):(wt=n.get(Oe),Nt=c1(Oe)?o:1),j<=C){if(z===0&&(z=Tt,U=j),j<=C-f)break;if(Owe(Oe,wt,re,me,l)){F=Tt,N=j;break}}j-=Nt,re=Oe,me=wt}if(F!==0){const Qe=f-(U-N);if(Qe<=i){const Tt=t.charCodeAt(z);let Oe;wl(Tt)?Oe=2:Oe=I$(Tt,U,i,o),Qe-Oe<0&&(F=0)}}if(De){S--;continue}}if(F===0&&(F=z,N=U),F<=w){const j=t.charCodeAt(w);wl(j)?(F=w+2,N=b+2):(F=w+1,N=b+I$(j,b,i,o))}for(w=F,p[v]=F,b=N,m[v]=N,v++,C=N+f;S<0||S=J)break;J=j,S++}}return v===0?null:(p.length=v,m.length=v,Pwe=e.breakOffsets,Fwe=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function lyt(n,e,t,i,s,o,r,a){const c=iw.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(N=>N.options),d=t.map(N=>N.column-1)):(l=null,d=null),s===-1)return l?new A$(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new A$(d,l,[c.length],[],0):null;const u=a==="keepAll",f=SYe(c,i,s,o,r),p=s-f,m=[],v=[];let w=0,b=0,C=0,y=s,S=c.charCodeAt(0),M=n.get(S),k=I$(S,0,i,o),F=1;wl(S)&&(k+=1,S=c.charCodeAt(1),M=n.get(S),F++);for(let N=F;Ny&&((b===0||k-C>p)&&(b=z,C=k-j),m[w]=b,v[w]=C,w++,y=C+p,b=0),S=U,M=J}return w===0&&(!t||t.length===0)?null:(m[w]=h,v[w]=k,new A$(d,l,m,v,f))}function I$(n,e,t,i){return n===Q.Tab?t-e%t:c1(n)||n<32?i:1}function sHe(n,e){return e-n%e}function Owe(n,e,t,i,s){return t!==Q.Space&&(e===fu.BREAK_AFTER&&i!==fu.BREAK_AFTER||e!==fu.BREAK_BEFORE&&i===fu.BREAK_BEFORE||!s&&e===fu.BREAK_IDEOGRAPHIC&&i!==fu.BREAK_AFTER||!s&&i===fu.BREAK_IDEOGRAPHIC&&e!==fu.BREAK_BEFORE)}function SYe(n,e,t,i,s){let o=0;if(s!==Vg.None){const r=Eu(n);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class KZ{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0),new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,gi.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,gi.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new zn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?mt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):mt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,jo.None)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,jo.None),a=this._validatePositionWithCache(e,s,i,r),c=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(c)?t:new bd(O.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=KZ._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new bd(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bd(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bd(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new O(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bd(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class oHe{constructor(e){this.context=e,this.cursors=[new KZ(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return kct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return Dct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(zn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,O.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class rHe{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class dyt extends ${constructor(){super(),this._onEvent=this._register(new I),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class hyt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var Ua;(function(n){n[n.ContentSizeChanged=0]="ContentSizeChanged",n[n.FocusChanged=1]="FocusChanged",n[n.ScrollChanged=2]="ScrollChanged",n[n.ViewZonesChanged=3]="ViewZonesChanged",n[n.HiddenAreasChanged=4]="HiddenAreasChanged",n[n.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",n[n.CursorStateChanged=6]="CursorStateChanged",n[n.ModelDecorationsChanged=7]="ModelDecorationsChanged",n[n.ModelLanguageChanged=8]="ModelLanguageChanged",n[n.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",n[n.ModelContentChanged=10]="ModelContentChanged",n[n.ModelOptionsChanged=11]="ModelOptionsChanged",n[n.ModelTokensChanged=12]="ModelTokensChanged"})(Ua||(Ua={}));class nNe{constructor(e,t,i,s){this.kind=Ua.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new nNe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class sNe{constructor(e,t){this.kind=Ua.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new sNe(this.oldHasFocus,e.hasFocus)}}class oNe{constructor(e,t,i,s,o,r,a,c){this.kind=Ua.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new oNe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class uyt{constructor(){this.kind=Ua.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class gyt{constructor(){this.kind=Ua.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class YZ{constructor(e,t,i,s,o,r,a){this.kind=Ua.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=L$.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=O.fromPositions(a[0],a[0]),e.emitViewEvent(new v$(t,i,c,l,s,o,r))}revealPrimary(e,t,i,s,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new v$(t,i,null,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=zn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Hi.Undo:i.isRedoing?Hi.Redo:Hi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,Ns.Simple,!0,vt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Hi.RecoverFromMarkers,zn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}getPosition(){return this._cursors.getPrimaryCursor().modelState.position}setSelections(e,t,i,s){this.setStates(e,t,s,zn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=L$.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new q_t(c,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(s.cursorState[d].modelState))){const l=s?s.cursorState.map(h=>h.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new YZ(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const l=c[0].open,d=o.text.length-r[2].length-1,h=o.text.lastIndexOf(l,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],c=this._model.pushEditOperations(this.getSelections(),i,l=>{if(o)for(let h=0,u=o.length;h0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=Hi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=L$.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){bt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealAll(t,i,!1,Ns.Simple,!0,vt.Smooth)}getAutoClosedCharacters(){return aHe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new T$(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Zr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o{const l=c.getPosition();return new mt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Hi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(Zr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(Zr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,Hi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(lF.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Lg(Cr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Lg(Cr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class L${static from(e,t){return new L$(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class yyt{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,l=>{const d=[];for(let f=0;ff.identifier.minor-p.identifier.minor,u=[];for(let f=0;f0?(d[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:p=>{const m=parseInt(p,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===Cv.LTR?new mt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new mt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);const c=[];for(const l in o)o.hasOwnProperty(l)&&c.push(parseInt(l,10));c.sort((l,d)=>d-l);for(const l of c)a.splice(l,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{O.isEmpty(h)&&u===""||s.push({identifier:{major:t,minor:o++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{const f=mt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter;else{const w=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===w?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter}else p=gi.NeverGrowsWhenTypingAtEdges;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,p);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return bt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-O.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Syt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class T${static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new Syt(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=T$._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=T$._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oG9,tokenizeEncoded:(n,e,t)=>SMe(lM.Null,t)};async function Ayt(n,e,t){if(!t)return lHe(e,n.languageIdCodec,cHe);const i=await dc.getOrCreate(t);return lHe(e,n.languageIdCodec,i||cHe)}function Eyt(n,e,t,i,s,o,r){let a="
      ",c=i,l=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(p+=" ",d=!1):(p+=" ",d=!0),v--;break}case Q.LessThan:p+="<",d=!1;break;case Q.GreaterThan:p+=">",d=!1;break;case Q.Ampersand:p+="&",d=!1;break;case Q.Null:p+="�",d=!1;break;case Q.UTF8_BOM:case Q.LINE_SEPARATOR:case Q.PARAGRAPH_SEPARATOR:case Q.NEXT_LINE:p+="�",d=!1;break;case Q.CarriageReturn:p+="​",d=!1;break;case Q.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>s||c>=s)break}return a+="
      ",a}function lHe(n,e,t){let i='
      ';const s=xw(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
      ");const l=t.tokenizeEncoded(c,!0,o);lh.convertToEndOffset(l.tokens,c.length);const h=new lh(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${rM(c.substring(u,v))}`,u=v}o=l.endState}return i+="
      ",i}class xyt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class Dyt{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}var r0;let kyt=(r0=class{constructor(e,t,i,s){this._instanceId=SQe(++r0.INSTANCE_COUNT),this._pendingChanges=new xyt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Dyt(c,s,o,r,a)),c},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of t)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of i){const l=this._findWhitespaceIndex(c.id);l!==-1&&this._removeWhitespace(l)}return}const s=new Set;for(const c of i)s.add(c.id);const o=new Map;for(const c of t)o.set(c.id,c);const r=c=>{const l=[];for(const d of c)if(!s.has(d.id)){if(o.has(d.id)){const h=o.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}l.push(d)}return l},a=r(this._arr).concat(r(e));a.sort((c,l)=>c.afterLineNumber===l.afterLineNumber?c.ordinal-l.ordinal:c.afterLineNumber-l.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=r0.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}hasWhitespace(){return this._checkPendingChanges(),this.getWhitespacesCount()>0}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const c=this.getWhitespacesCount()|0;let l,d;a===-1?(a=c,d=r+1,l=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);let h=o,u=h;const f=5e5;let p=0;o>=f&&(p=Math.floor(o/f)*f,p=Math.floor(p/i)*i,u-=p);const m=[],v=e+(t-e)/2;let w=-1;for(let S=s;S<=r;S++){if(w===-1){const M=h,k=h+i;(M<=v&&vv)&&(w=S)}for(h+=i,m[S-s]=u,u+=i;d===S;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=S;break}}w===-1&&(w=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=s,y=r;return Ct&&y--,{bigNumbersDelta:p,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:w,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:y,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+c)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}},r0.INSTANCE_COUNT=0,r0);const Iyt=125;class v3{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Lyt extends ${constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new v3(0,0,0,0),this._scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new nNe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class Tyt extends ${constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(x.layoutInfo),r=s.get(x.padding);this._linesLayout=new kyt(t,s.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Lyt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new v3(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(x.smoothScrolling)?Iyt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(x.lineHeight)&&this._linesLayout.setLineHeight(t.get(x.lineHeight)),e.hasChanged(x.padding)){const i=t.get(x.padding);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(x.layoutInfo)){const i=t.get(x.layoutInfo),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new v3(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(x.smoothScrolling)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(x.scrollbar);return s.horizontal===zo.Hidden||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-s.get(x.lineHeight)-s.get(x.padding).bottom):s.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new v3(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),s=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new v3(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===vt.Immediate?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Ryt{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.startLineNumber,1),jo.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),jo.Right);r=new O(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,jo.Right);i=new cKe(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new O(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,aZ(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let c=0;const l=[];for(let d=o;d<=r;d++)l[d-o]=[];for(let d=0,h=s.length;dt===Ar.Comment)}function cNe(n,e){return AYe(n,e.range,t=>t===Ar.String)}function AYe(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function pfe(n,e){return n===null?e?JZ.INSTANCE:XZ.INSTANCE:new Myt(n,e)}class Myt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((l,d)=>new iw(0,0,l+1,this._projectionData.injectionOptions[d],0));r=iw.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=dHe(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const c=this._projectionData,l=c.injectionOffsets,d=c.injectionOptions;let h=null;if(l){h=[];let f=0,p=0;for(let m=0;m0?c.breakOffsets[m-1]:0,b=c.breakOffsets[m];for(;pb)break;if(w0?c.wrappedTextIndentLength:0,F=k+Math.max(y-w,0),N=k+Math.min(S-w,b-w);F!==N&&v.push(new $pt(F,N,M.inlineClassName,M.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=C,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:lh.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=dHe(s.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=mfe.length)for(let e=1;e<=n;e++)mfe[e]=Nyt(e);return mfe[n]}function Nyt(n){return new Array(n+1).join(" ")}class Pyt{constructor(e,t,i,s,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=c,this.wrappingIndent=l,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new Oyt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new DS(iw.fromDecorations(s));for(let m=0;mw.lineNumber===m+1);r.addRequest(i[m],v,t?t[m]:null)}const c=r.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(O.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,b=pfe(c[m],!w);l[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new $ft(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=Fyt(t),s=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(O.compareRangesUsingStarts);if(i.length===s.length){let u=!1;for(let f=0;f({range:u,options:Kt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,c=0,l=-1,d=l+1=a&&f<=c?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),p=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),p=!0)),p){const m=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&c&&l&&d)return!1;const h=r&&a&&!c&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let u=null;if(h){u=[];for(let f=0,p=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const c=[],l=[];for(let d=0,h=s.length;dc?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+c-1,p=h+1,m=p+(o-c)-1,l=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),c=this.convertModelPositionToViewPosition(a.startLineNumber,1),l=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:l.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new hHe(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=s.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===s.modelLineNumber?s.modelLineWrappedLineIdx+1:l.getViewLineCount();for(let u=d;u{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new gR(f.visibleColumn,p,f.className,new C$(f.horizontalLine.top,m.column),-1,-1):v.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=s.lineNumber-1;let d=null;for(let p=c;p<=l;p++){const m=this.modelLineProjections[p];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,p===c?i.column:1),w=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),b=w-v+1;let C=DT.BlockNone;b>1&&m.getViewLineMinColumn(this.model,p+1,w)===1&&(C=v===0?DT.BlockSubsequent:DT.BlockAll),r.push(b),a.push(C),d===null&&(d=new oe(p+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,p)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let f=0;for(let p=0,m=o.length;pt&&(p=!0,f=t-o+1),h.getViewLinesData(this.model,l+1,u,f,o-e,i,c),o+=f,p)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],c=a.getViewLineMinColumn(this.model,o+1,r),l=a.getViewLineMaxColumn(this.model,o+1,r);tl&&(t=l);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new oe(o+1,d)).equals(i)?new oe(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new O(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new O(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=jo.None,s=!1,o=!1){const r=this.model.validatePosition(new oe(e,t)),a=r.lineNumber,c=r.column;let l=a-1,d=!1;if(o)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(l===0&&!this.modelLineProjections[l].isVisible())return new oe(s?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let u;return d?o?u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,c,i),u}convertModelRangeToViewRange(e,t=jo.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return O.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,jo.Right),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,jo.Left);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new O(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let c=[];const l=r.lineNumber-1,d=a.lineNumber-1;let h=null;for(let m=l;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new oe(m+1,m===l?r.column:1));else if(h!==null){const w=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,m,w),t,i,s)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,a.lineNumber,a.column),t,i,s)),h=null),c.sort((m,v)=>{const w=O.compareRangesUsingStarts(m.range,v.range);return w===0?m.idv.id?1:0:w});const u=[];let f=0,p=null;for(const m of c){const v=m.id;p!==v&&(p=v,u[f++]=m)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Fyt(n){if(n.length===0)return[];const e=n.slice();e.sort(O.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new O(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new O(i,1,s,1)),t}class hHe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class uHe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Oyt{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}var DT;(function(n){n[n.BlockNone=0]="BlockNone",n[n.BlockSubsequent=1]="BlockSubsequent",n[n.BlockAll=2]="BlockAll"})(DT||(DT={}));class Byt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Wyt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new rwe(t,i)}onModelLinesInserted(e,t,i,s){return new awe(t,i)}onModelLineChanged(e,t,i){return[!1,new DKe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}modelRangeIsVisible(e){const t=this._lines.model.getLineCount();return!(e.startLineNumber<1||e.startLineNumber>t||e.endLineNumber<1||e.endLineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const bL=FS.Right;class Hyt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*bL/8))}reset(e){const t=Math.ceil((e+1)*bL/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=lNe.create(this.model),this.glyphLanes=new Hyt(0),this.model.isTooLargeForTokenization())this._lines=new Byt(this.model);else{const d=this._configuration.options,h=d.get(x.fontInfo),u=d.get(x.wrappingStrategy),f=d.get(x.wrappingInfo),p=d.get(x.wrappingIndent),m=d.get(x.wordBreak);this._lines=new Pyt(this._editorId,this.model,s,o,h,this.model.getOptions().tabSize,u,f.wrappingColumn,p,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Cyt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Tyt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new K_t(d)),this._eventDispatcher.emitOutgoingEvent(new oNe(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new Ryt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const h=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(h,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(HZ.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new X_t)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Y_t(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new O(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Q_t(e)),this._eventDispatcher.emitOutgoingEvent(new sNe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new z_t)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new $_t)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new oe(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new fHe(t,this._viewportStart.startLineDelta)}return new fHe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(x.fontInfo),r=s.get(x.wrappingStrategy),a=s.get(x.wrappingInfo),c=s.get(x.wrappingIndent),l=s.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new kj),e.emitViewEvent(new Ij),e.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(x.readOnly)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),e.emitViewEvent(new G_t(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),HO.shouldRecreate(t)&&(this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof mM?e.rawContentChangedEvent.changes:e.changes,a=e instanceof mM?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Yp.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Yp.LineChanged:{let u=null;h.injectedText&&(u=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),c.addRequest(h.detail,u,null);break}}const l=c.finalize(),d=new DS(l);for(const h of r)switch(h.changeType){case Yp.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new kj),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case Yp.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),s=!0;break}case Yp.LinesInserted:{const u=d.takeCount(h.detail.length),f=this._lines.onModelLinesInserted(a,h.fromLineNumber,h.toLineNumber,u);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case Yp.LineChanged:{const u=d.dequeue(),[f,p,m,v]=this._lines.onModelLineChanged(a,h.lineNumber,u);o=f,p&&i.emitViewEvent(p),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new Ij),i.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},vt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof mM&&i.emitOutgoingEvent(new vyt(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new j_t),this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new _yt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new myt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new kj),t.emitViewEvent(new Ij),t.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new wyt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vL(e)),this._eventDispatcher.emitOutgoingEvent(new pyt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new kj),r.emitViewEvent(new Ij),r.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=s.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new gyt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(x.layoutInfo),t=this._configuration.options.get(x.lineHeight),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new O(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const c=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;dc||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Eu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zv(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Am(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new zpt(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,aZ(this._configuration.options)),i=new Vyt;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const c=r.getColor(e.value),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(c,o.zIndex,l,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),s=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(s)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(O.compareRangesUsingStarts);let o=!1,r=!1;for(const c of e)c.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const c=e.map(d=>d.startLineNumber);let l="";for(let d=0;d0&&c[d-1]===c[d]||(l+=this.model.getLineContent(c[d])+s);return l}if(o&&t){const c=[];let l=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==l&&c.push(this.model.getLineContent(h)):c.push(this.model.getValueInRange(d,i?xo.CRLF:xo.TextDefined)),l=h}return c.length===1?c[0]:c}const a=[];for(const c of e)c.isEmpty()||a.push(this.model.getValueInRange(c,i?xo.CRLF:xo.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Yc||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new O(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(x.fontInfo),r=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Gh.fontFamily;let l;return c?l=Gh.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${Gh.fontFamily}`),{mode:i,html:`
      `+this._getHTMLToCopy(s,r)+"
      "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=o;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?s-1:0,f=l===o?r-1:h.length;h===""?c+="
      ":c+=Eyt(h,d.inflate(),t,u,f,a,Is)}return c}_getColorMap(){const e=dc.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=Hi.NotSet){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new fyt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealAll(s,e,i,Ns.Simple,t,vt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,Ns.Simple,t,vt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new v$(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Z_t),this._eventDispatcher.emitOutgoingEvent(new uyt))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class lNe{static create(e){const t=e._setTrackedRange(null,new O(1,1,1,1),gi.NeverGrowsWhenTypingAtEdges);return new lNe(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,gi.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new O(i.lineNumber,i.column,i.lineNumber,i.column),gi.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class Vyt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,c=a[a.length-3],l=a[a.length-1];if(c===o&&l+1>=i){s>l&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new q9(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class zyt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&gHe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>$yt(t,i),[]);return gHe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function $yt(n,e){const t=[];let i=0,s=0;for(;i{this._onDidChangeConfiguration.fire(v);const w=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const b=w.get(x.layoutInfo);this._onDidLayoutChange.fire(b)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new Kyt(this,this._contextKeyService)),this._register(new Yyt(this,this._contextKeyService,u)),this._instantiationService=this._register(s.createChild(new Dl([Pe,this._contextKeyService]))),this._modelData=null,this._focusTracker=new Jyt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=b_.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of b_.getEditorActions()){if(this._actions.has(v.id)){bt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const w=new oYe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,b=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,this,b))),this._contextKeyService);this._actions.set(w.id,w)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new yZ(this._domElement,{onDragOver:v=>{if(!m())return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this.showDropIndicatorAt(w.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this._onDropIntoEditor.fire({position:w.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,s,o){return new Zve(e,t,i,s,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return mz.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Es.getWordAtPosition(this._modelData.model,this._configuration.options.get(x.wordSeparators),this._configuration.options.get(x.wordSegmenterLocales),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=xo.TextDefined;return e&&e.lineEnding&&e.lineEnding===` -`?i=xo.LF:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=xo.CRLF),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>O.lift(i)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ic.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getStatusbarColumn(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ic.toStatusbarColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!O.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=vt.Smooth){this._revealLine(e,Ns.Simple,t)}revealLineInCenter(e,t=vt.Smooth){this._revealLine(e,Ns.Center,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealLine(e,Ns.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=vt.Smooth){this._revealLine(e,Ns.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,e,1),t,!1,i)}revealPosition(e,t=vt.Smooth){this._revealPosition(e,Ns.Simple,!0,t)}revealPositionInCenter(e,t=vt.Smooth){this._revealPosition(e,Ns.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealPosition(e,Ns.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=vt.Smooth){this._revealPosition(e,Ns.NearTop,!0,t)}_revealPosition(e,t,i,s){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new O(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=mt.isISelection(e),s=O.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new mt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Simple,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.NearTop,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,t,1),i,!1,s)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._revealRange(e,i?Ns.Center:Ns.Simple,s,t)}revealRangeInCenter(e,t=vt.Smooth){this._revealRange(e,Ns.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=vt.Smooth){this._revealRange(e,Ns.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=vt.Smooth){this._revealRange(e,Ns.Top,!0,t)}_revealRange(e,t,i,s){if(!O.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(O.lift(e),t,i,s)}setSelections(e,t="api",i=Hi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}onVisible(){this._modelData?.view.refreshFocusState()}onHide(){this._modelData?.view.refreshFocusState(),this._focusTracker.refreshState()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case Uc.CompositionStart:this._startComposition();return;case Uc.CompositionEnd:this._endComposition(e);return;case Uc.Type:{const o=i;this._type(e,o.text||"");return}case Uc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case Uc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case Uc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case Uc.Cut:this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,bt);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,s,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new O(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=b_.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,bt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(x.readOnly))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Xyt(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,aZ(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,aZ(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}setDecorationsByType(e,t,i){const s={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=s;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Ed(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!s[h]&&this._registerDecorationType(e,l,c.renderOptions,t),s[h]=!0}const d=this._resolveDecorationOptions(l,!!c.hoverMessage);c.hoverMessage&&(d.hoverMessage=c.hoverMessage),r.push({range:c.range,options:d})}for(const c in o)s[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,r))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const s=Kt.createDynamic(this._resolveDecorationOptions(e,!1)),o=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(r,o))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(x.layoutInfo)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(x.layoutInfo),o=GL._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(x.lineHeight)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Sd(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new Uyt(this._id,this._configuration,e,GMe.create(gt(this._domElement)),iNe.create(this._configuration.options),a=>xd(gt(this._domElement),a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case Ua.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case Ua.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case Ua.ScrollChanged:this._onDidScrollChange.fire(a);break;case Ua.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case Ua.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case Ua.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case Ua.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(pHe,0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(nt.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(pHe,1,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const c=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",o,r,a,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,c)=>{this._compositionType("keyboard",o,r,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,c)=>{const l={text:o,pasteOnNewLine:r,multicursorText:a,mode:c};this._commandService.executeCommand(Uc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(Uc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(Uc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(Uc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(Uc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(Uc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(Uc.Cut,{})}};const i=new lde(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new Swe(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_registerDecorationType(e,t,i,s){this._codeEditorService.registerDecorationType(e,t,i,s,this)}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}_resolveDecorationOptions(e,t){return this._codeEditorService.resolveDecorationOptions(e,t)}getTelemetryData(){return this._telemetryData}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:GL.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,vt.Immediate)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},GL=eN,eN.dropIntoEditorDecorationOptions=Kt.register({description:"workbench-dnd-target",className:"dnd-target"}),eN);_1=GL=D([_(3,be),_(4,jt),_(5,ji),_(6,Pe),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],_1);let Qyt=0,jyt=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){St(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var kT;(function(n){n[n.NotSet=0]="NotSet",n[n.False=1]="False",n[n.True=2]="True"})(kT||(kT={}));class mHe extends ${constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new I(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new I(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=kT.NotSet}setValue(e){const t=e?kT.True:kT.False;this._value!==t&&(this._value=t,this._value===kT.True?this._onDidChangeToTrue.fire():this._value===kT.False&&this._onDidChangeToFalse.fire())}}class eu extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Kyt extends ${constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=X.editorSimpleInput.bindTo(t),this._editorFocus=X.focus.bindTo(t),this._textInputFocus=X.textInputFocus.bindTo(t),this._editorTextFocus=X.editorTextFocus.bindTo(t),this._tabMovesFocus=X.tabMovesFocus.bindTo(t),this._editorReadonly=X.readOnly.bindTo(t),this._inDiffEditor=X.inDiffEditor.bindTo(t),this._editorColumnSelection=X.columnSelection.bindTo(t),this._hasMultipleSelections=X.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=X.hasNonEmptySelection.bindTo(t),this._canUndo=X.canUndo.bindTo(t),this._canRedo=X.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(g1.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(g1.getTabFocusMode()),this._editorReadonly.set(e.get(x.readOnly)),this._inDiffEditor.set(e.get(x.inDiffEditor)),this._editorColumnSelection.set(e.get(x.columnSelection))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Yyt extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=X.languageId.bindTo(t),this._hasCompletionItemProvider=X.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=X.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=X.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=X.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=X.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=X.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=X.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=X.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=X.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=X.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=X.hasReferenceProvider.bindTo(t),this._hasRenameProvider=X.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=X.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=X.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=X.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=X.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=X.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=X.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=X.isInEmbeddedEditor.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===_e.walkThroughSnippet||e.uri.scheme===_e.vscodeChatCodeBlock)})}}class Jyt extends ${constructor(e,t){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Dd(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Dd(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}refreshState(){this._domFocusTracker.refreshState(),this._overflowWidgetsDomNode?.refreshState?.()}}class Xyt{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const Zyt=encodeURIComponent("");function _fe(n){return Zyt+encodeURIComponent(n.toString())+eSt}const tSt=encodeURIComponent('');function nSt(n){return tSt+encodeURIComponent(n.toString())+iSt}Lm((n,e)=>{const t=n.getColor(Vh);t&&e.addRule(`.monaco-editor .${qu.EditorErrorDecoration} { background: url("data:image/svg+xml,${_fe(t)}") repeat-x bottom left; }`);const i=n.getColor(qc);i&&e.addRule(`.monaco-editor .${qu.EditorWarningDecoration} { background: url("data:image/svg+xml,${_fe(i)}") repeat-x bottom left; }`);const s=n.getColor(Qc);s&&e.addRule(`.monaco-editor .${qu.EditorInfoDecoration} { background: url("data:image/svg+xml,${_fe(s)}") repeat-x bottom left; }`);const o=n.getColor(ymt);o&&e.addRule(`.monaco-editor .${qu.EditorHintDecoration} { background: url("data:image/svg+xml,${nSt(o)}") no-repeat bottom left; }`);const r=n.getColor(dwt);r&&e.addRule(`.monaco-editor.showUnused .${qu.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let ZZ=class extends ${constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new I),this.onWillCreateCodeEditor=this._onWillCreateCodeEditor.event,this._onCodeEditorAdd=this._register(new I),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new I),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new I),this.onWillCreateDiffEditor=this._onWillCreateDiffEditor.event,this._onDiffEditorAdd=this._register(new I),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new I),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._onDidChangeTransientModelProperty=this._register(new I),this.onDidChangeTransientModelProperty=this._onDidChangeTransientModelProperty.event,this._onDecorationTypeRegistered=this._register(new I),this.onDecorationTypeRegistered=this._onDecorationTypeRegistered.event,this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._codeEditorOpenHandlers=new td,this._transientWatchers={},this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=this._createGlobalStyleSheet()),this._globalStyleSheet}_createGlobalStyleSheet(){return new rSt(od())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!P9(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const s=new oSt(this,i,od(t));this._editorStyleSheets.set(i,s)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,s,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:s,options:i||Object.create(null)};s?r=new aSt(this._themeService,a,c):r=new cSt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}return r.refCount++,{dispose:()=>{this.removeDecorationType(t)}}}listDecorationTypes(){return Array.from(this._decorationOptionProviders.keys())}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}resolveDecorationCSSRules(e){const t=this._decorationOptionProviders.get(e);return t?t.resolveDecorationCSSRules():null}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}setTransientModelProperty(e,t,i){const s=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(s)?o=this._transientWatchers[s]:(o=new sSt(s,e,this),this._transientWatchers[s]=o),o.get(t)!==i&&(o.set(t,i),this._onDidChangeTransientModelProperty.fire(e))}getTransientModelProperty(e,t){const i=e.uri.toString();if(this._transientWatchers.hasOwnProperty(i))return this._transientWatchers[i].get(t)}getTransientModelProperties(e){const t=e.uri.toString();if(this._transientWatchers.hasOwnProperty(t))return this._transientWatchers[t].keys().map(i=>[i,this._transientWatchers[t].get(i)])}_removeWatcher(e){delete this._transientWatchers[e.uri]}async openCodeEditor(e,t,i){for(const s of this._codeEditorOpenHandlers){const o=await s(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};ZZ=D([_(0,pn)],ZZ);class sSt{constructor(e,t,i){this.uri=e,this._values={},t.onWillDispose(()=>i._removeWatcher(this))}set(e,t){this._values[e]=t}get(e){return this._values[e]}keys(){return Object.keys(this._values)}}class oSt{get sheet(){return this._styleSheet.sheet}constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){this._refCount--,this._refCount===0&&(this._styleSheet.parentNode?.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class rSt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class aSt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new eee(qd.BeforeContentClassName,i,e),this._afterContentRules=new eee(qd.AfterContentClassName,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}resolveDecorationCSSRules(){return this._styleSheet.sheet.cssRules}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class cSt{constructor(e,t,i,s){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new eee(h,s,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new eee(h,s,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(qd.ClassName);const a=r(qd.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(qd.BeforeContentClassName),this.afterContentClassName=o(qd.AfterContentClassName),s.options.beforeInjectedText&&s.options.beforeInjectedText.contentText){const h=r(qd.BeforeInjectedTextClassName);this.beforeInjectedText={content:s.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.beforeInjectedText.affectsLetterSpacing}}if(s.options.afterInjectedText&&s.options.afterInjectedText.contentText){const h=r(qd.AfterInjectedTextClassName);this.afterInjectedText={content:s.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(qd.GlyphMarginClassName);const c=s.options;this.isWholeLine=!!c.isWholeLine,this.stickiness=c.rangeBehavior;const l=c.light&&c.light.overviewRulerColor||c.overviewRulerColor,d=c.dark&&c.dark.overviewRulerColor||c.overviewRulerColor;(typeof l<"u"||typeof d<"u")&&(this.overviewRuler={color:l||d,darkColor:d||l,position:c.overviewRulerLane||oh.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}resolveDecorationCSSRules(){return this._styleSheet.sheet.rules}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const p5={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class eee{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let s=vfe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(s=s+" "+vfe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=s,this._unThemedSelector=vfe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,s;switch(this._ruleType){case qd.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),s=this.getCSSTextForModelDecorationClassName(e.dark);break;case qd.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),s=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case qd.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),s=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case qd.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case qd.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case qd.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case qd.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(this._unThemedSelector,t),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),r=!0),s.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,s),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push(a_(p5.contentIconPath,uf(P.revive(e.contentIconPath)))),typeof e.contentText=="string"){const s=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(a_(p5.contentText,s))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push(a_(p5.gutterIconPath,uf(P.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(a_(p5.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(a_("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const s=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(a_(p5[o],r))}return i.length!==s}resolveValue(e){if(Upt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var qd;(function(n){n[n.ClassName=0]="ClassName",n[n.InlineClassName=1]="InlineClassName",n[n.GlyphMarginClassName=2]="GlyphMarginClassName",n[n.BeforeContentClassName=3]="BeforeContentClassName",n[n.AfterContentClassName=4]="AfterContentClassName",n[n.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",n[n.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(qd||(qd={}));class vfe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let s=".monaco-editor ."+this.getClassName(e,i);return t&&(s=s+"."+this.getClassName(t,i)),i===qd.BeforeContentClassName?s+="::before":i===qd.AfterContentClassName&&(s+="::after"),s}}let tee=class extends ZZ{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,s,o)=>s?this.doOpenEditor(s,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===_e.http||o===_e.https)return vje(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,vt.Immediate);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,vt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};tee=D([_(0,Pe),_(1,pn)],tee);ce(jt,tee,Yt.Eager);const bg=ae("layoutService");let iee=class{get mainContainer(){return k_(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??yi.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return uw(this.mainContainer)}get activeContainerDimension(){return uw(this.activeContainer)}get containers(){return Vi(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=T.None,this.onDidLayoutActiveContainer=T.None,this.onDidLayoutContainer=T.None,this.onDidChangeActiveContainer=T.None,this.onDidAddContainer=T.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};iee=D([_(0,jt)],iee);let Hwe=class extends iee{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Hwe=D([_(1,jt)],Hwe);ce(bg,iee,Yt.Delayed);const To=ae("dialogService"),bf=ae("fileDialogService"),Md="vs/platform/undoRedo/common/undoRedoService";function Gj(n){return n.scheme===_e.file?n.fsPath:n.path}let EYe=0;class qj{constructor(e,t,i,s,o,r,a){this.id=++EYe,this.type=wd.Resource,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}var cE;(function(n){n[n.ExternalRemoval=0]="ExternalRemoval",n[n.NoParallelUniverses=1]="NoParallelUniverses"})(cE||(cE={}));class _He{constructor(e,t){this.resourceLabel=e,this.reason=t}}class vHe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===cE.ExternalRemoval?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(g(Md,0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(Md,1,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` -`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class lSt{constructor(e,t,i,s,o,r,a){this.id=++EYe,this.type=wd.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new vHe),this.removedResources.has(t)||this.removedResources.set(t,new _He(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new vHe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new _He(e,cE.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class xYe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===wd.Workspace&&e.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval);for(const e of this._future)e.type===wd.Workspace&&e.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` -`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}setElementsIsValid(e){for(const t of this._past)t.type===wd.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===wd.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===wd.Workspace?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===wd.Workspace&&t.removeResource(this.resourceLabel,this.strResource,cE.NoParallelUniverses);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new vYe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[s])&&(i=!1,o=0),!i&&l.type===wd.Workspace&&l.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const c=this._future[a];i&&(s>=t||c.id!==e.elements[s])&&(i=!1,r=a),!i&&c.type===wd.Workspace&&c.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class wfe{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t{for(let i=0,s=this._uriComparisonKeyComputers.length;it.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof ET){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){bt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),s.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),s.dispose(),o()),c=>(r(),s.dispose(),this._onError(c,e))):(r(),s.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return $.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?$.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==wd.Workspace||typeof e.actual.prepareUndoRedo>"u")return t($.None);const i=e.actual.prepareUndoRedo();return i?cz(i)?t(i):i.then(s=>t(s)):t($.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||DYe);return new wfe(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new Qj(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new Qj}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,g(Md,3,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,g(Md,4,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,g(Md,5,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,s){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:c}=await this._dialogService.prompt({type:nt.Info,message:g(Md,6,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(Md,7,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(Md,8,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(c===a.Cancel)return;if(c===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const l=this._checkWorkspaceUndo(e,t,i,!1);if(l)return l.returnValue;s=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=g(Md,9,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new wfe([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof ET){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&c)return this._undo(c,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===wd.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(Md,10,"Would you like to undo '{0}'?",i.label),primaryButton:g(Md,11,"&&Yes"),cancelButton:g(Md,12,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(Md,14,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,g(Md,15,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,g(Md,16,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let s;try{s=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(Md,17,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new wfe([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderjle(nee.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?kc(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new hSt(6),this._cache.set(i,s));const o=kc(s.update(t),this._min,this._max);return Rx(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new dNe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return kc(e,this._min,this._max)}}let Vwe=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const s=i?.min??50,o=i?.max??s**2,r=i?.key??void 0,a=`${nee.of(e)},${s}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new uSt(s*1.5)):c=new gSt(this._logService,t,e,this._overallAverage()|0||s*1.5,s,o),this._data.set(a,c)),c}_overallAverage(){const e=new dNe;for(const t of this._data.values())e.update(t.default());return e.value}};Vwe=D([_(0,Ze),_(1,Il)],Vwe);ce(B_,Vwe,Yt.Delayed);const OW="vs/base/common/errorMessage";function bfe(n,e){return e&&(n.stack||n.stacktrace)?g(OW,0,"{0}: {1}",CHe(n),bHe(n.stack)||bHe(n.stacktrace)):CHe(n)}function bHe(n){return Array.isArray(n)?n.join(` -`):n}function CHe(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?g(OW,1,"A system error occurred ({0})",n.message):n.message||g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function Ma(n=null,e=!1){if(!n)return g(OW,2,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=Vi(n),i=Ma(t[0],e);return t.length>1?g(OW,3,"{0} ({1} errors in total)",i,t.length):i}if($t(n))return n;if(n.detail){const t=n.detail;if(t.error)return bfe(t.error,e);if(t.exception)return bfe(t.exception,e)}return n.stack?bfe(n,e):n.message?n.message:g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function fSt(n){const e=n;return e instanceof Error&&Array.isArray(e.actions)}function pSt(n,e){let t;return typeof n=="string"?t=new Error(n):t=n,t.actions=e,t}function kYe(n){return Kc(n)}var Pn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(Pn||(Pn={}));const hNe=Pn.Info;function see(n,e,t){switch(e){case Pn.Trace:n.trace(t);break;case Pn.Debug:n.debug(t);break;case Pn.Info:n.info(t);break;case Pn.Warning:n.warn(t);break;case Pn.Error:n.error(t);break;case Pn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function $O(n,e=!1){let t="";for(let i=0;i0?" ":"")+s}return t}class uNe extends ${constructor(){super(...arguments),this.level=hNe,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Pn.Off&&this.level<=e}}class ude extends uNe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&this.log(Pn.Trace,$O([e,...t],!0))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&this.log(Pn.Debug,$O([e,...t]))}info(e,...t){this.checkLogLevel(Pn.Info)&&this.log(Pn.Info,$O([e,...t]))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&this.log(Pn.Warning,$O([e,...t]))}error(e,...t){if(this.checkLogLevel(Pn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Pn.Error,$O(i))}else this.log(Pn.Error,$O([e,...t]))}flush(){}}let mSt=class extends uNe{constructor(e=hNe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Pn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Pn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class _St extends uNe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}flush(){for(const e of this.loggers)e.flush()}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class IYe extends ${constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new wi,this._onDidChangeLoggers=this._register(new I),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,i)for(const s of i)this._loggers.set(s.resource,{logger:void 0,info:s})}getLoggerEntry(e){return $t(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){const i=this.toResource(e),s=$t(e)?e:t?.id??Ed(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Pn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:s}));const a={logger:o,info:{resource:i,id:s,logLevel:r,name:t?.name,hidden:t?.hidden,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),o}toResource(e){return $t(e)?Qt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(P.isUri(e)){const i=e,s=t,o=this._loggers.get(i);o&&s!==o.info.logLevel&&(o.info.logLevel=s===this.logLevel?void 0:s,o.logger?.setLevel(s),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,s]))}else{this.logLevel=e;for(const[i,s]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&s.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){const t=this._loggers.get(e);t&&(t.logger&&t.logger.dispose(),this._loggers.delete(e),this._onDidChangeLoggers.fire({added:[],removed:[t.info]}))}*getRegisteredLoggers(){for(const e of this._loggers.values())yield e.info}getRegisteredLogger(e){return this._loggers.get(e)?.info}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}}class LYe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Pn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class vSt extends LYe{}function c7(n){switch(n){case Pn.Trace:return"trace";case Pn.Debug:return"debug";case Pn.Info:return"info";case Pn.Warning:return"warn";case Pn.Error:return"error";case Pn.Off:return"off"}}function TYe(n){switch(n){case"trace":return Pn.Trace;case"debug":return Pn.Debug;case"info":return Pn.Info;case"warn":return Pn.Warning;case"error":return Pn.Error;case"critical":return Pn.Error;case"off":return Pn.Off}}const wSt=new Y("logLevel",c7(Pn.Info));class R${static create(e,t){return new R$(e,new oee(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new O(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[s,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new R$(this._startLineNumber,s),new R$(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=Gb(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):Q.Null)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class oee{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;ae||u===e&&p>=t)&&(ue||p===e&&v>=t){if(po?m-=o-i:m=i;else if(f===t&&p===i)if(f===s&&m>o)m-=o-i;else{d=!0;continue}else if(fo)f=t,p=i,m=p+(m-o);else{d=!0;continue}else if(f>s){if(c===0&&!d){l=a;break}f-=c}else if(f===s&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const w=4*l;r[w]=f,r[w+1]=p,r[w+2]=m,r[w+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=Q.Digit0&&r<=Q.Digit9||r>=Q.A&&r<=Q.Z||r>=Q.a&&r<=Q.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;l>0&&this._logService.getLevel()===Pn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),c.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=BW.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?ar.Italic:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_ITALIC}if(typeof d.bold<"u"){const h=(d.bold?ar.Bold:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_BOLD}if(typeof d.underline<"u"){const h=(d.underline?ar.Underline:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_UNDERLINE}if(typeof d.strikethrough<"u"){const h=(d.strikethrough?ar.Strikethrough:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_STRIKETHROUGH}if(d.foreground){const h=d.foreground<<$i.FOREGROUND_OFFSET;r|=h|$i.SEMANTIC_USE_FOREGROUND}r===0&&(r=BW.NO_STYLING)}}else this._logService.getLevel()===Pn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=BW.NO_STYLING,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Pn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${c.join(" ")}): foreground ${Xf.getForeground(r)}, fontStyle ${Xf.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};zwe=D([_(1,pn),_(2,Di),_(3,Ze)],zwe);var ree;(function(n){n[n.DesiredTokensPerArea=400]="DesiredTokensPerArea",n[n.DesiredMaxAreas=1024]="DesiredMaxAreas"})(ree||(ree={}));function RYe(n,e,t){const i=n.data,s=n.data.length/5|0,o=Math.max(Math.ceil(s/ree.DesiredMaxAreas),ree.DesiredTokensPerArea),r=[];let a=0,c=1,l=0;for(;ad&&i[5*b]===0;)b--;if(b-1===d){let C=h;for(;C+1M)e.warnOverlappingSemanticTokens(S,M+1);else{const U=e.getMetadata(N,z,t);U!==BW.NO_STYLING&&(p===0&&(p=S),u[f]=S-p,u[f+1]=M,u[f+2]=F,u[f+3]=U,f+=4,m=S,v=F)}c=S,l=M,a++}f!==u.length&&(u=u.subarray(0,f));const w=R$.create(p,u);r.push(w)}return r}class bSt{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}const OA=class OA{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new zwe(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Gwe=D([_(0,pn),_(1,Ze),_(2,Di)],Gwe);ce(gde,Gwe,Yt.Delayed);const mR="**",qwe="/",rJ="[/\\\\]",aJ="[^/\\\\]",CSt=/\//g;function SHe(n,e){switch(n){case 0:return"";case 1:return`${aJ}*?`;default:return`(?:${rJ}|${aJ}+${rJ}${e?`|${rJ}${aJ}+`:""})*?`}}function Qwe(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function MYe(n){if(!n)return"";let e="";const t=Qwe(n,qwe);if(t.every(i=>i===mR))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===mR){if(i)return;e+=SHe(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===qwe?h="":h=Iu(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${Qwe(a,",").map(f=>MYe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=aJ;continue;case"*":e+=SHe(1);continue;default:e+=Iu(d)}}ogNe(a,e)).filter(a=>a!==_S),n),i=t.length;if(!i)return _S;if(i===1)return t[0];const s=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function DHe(n,e,t){const i=dg===Qi.sep,s=i?n:n.replace(CSt,dg),o=dg+s,r=Qi.sep+n;let a;return t?a=function(c,l){return typeof c=="string"&&(c===s||c.endsWith(o)||!i&&(c===n||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===s||!i&&c===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function TSt(n){try{const e=new RegExp(`^${MYe(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return _S}}function WW(n,e,t){return!n||typeof e!="string"?!1:_w(n)(e,void 0,t)}function _w(n,e={}){if(!n)return EHe;if(typeof n=="string"||NYe(n)){const t=gNe(n,e);if(t===_S)return EHe;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return RSt(n,e)}function NYe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function RSt(n,e){const t=PYe(Object.getOwnPropertyNames(n).map(a=>MSt(a,n[a],e)).filter(a=>a!==_S)),i=t.length;if(!i)return _S;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let f=0,p=t.length;f{for(const f of u){const p=await f;if(typeof p=="string")return p}return null})():null},c=t.find(d=>!!d.allBasenames);c&&(a.allBasenames=c.allBasenames);const l=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return l.length&&(a.allPaths=l),a}const s=function(a,c,l){let d,h;for(let u=0,f=t.length;u{for(const u of h){const f=await u;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function MSt(n,e,t){if(e===!1)return _S;const i=gNe(n,t);if(i===_S)return _S;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=s.replace("$(basename)",()=>c),h=l(d);return NS(h)?h.then(u=>u?n:null):h?n:null};return o.requiresSiblings=!0,o}}return i}function PYe(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let s;if(e){s=[];for(let a=0,c=i.length;a{const l=c.patterns;return l?a.concat(l):a},[]);const o=function(a,c){if(typeof a!="string")return null;if(!c){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===Q.Slash||h===Q.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?s[l]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function fde(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const c=fde(a,e,t,i,s,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=n;if(!i&&!l)return 0;d&&s&&(e=s);let h=0;if(c)if(c===e.scheme)h=10;else if(c==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===o)h=10;else if(d==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:d1(a.base)},u===e.fsPath||WW(u,e.fsPath))h=10;else return 0}return h}else return 0}}function FYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(FYe):!!n.notebookType}function OYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(OYe):!!n.exclusive}class kHe{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()}}class Po{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ee(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){const t=this._notebookInfoResolver?.(e.uri),i=t?new kHe(e.uri,e.getLanguageId(),t.uri,t.type):new kHe(e.uri,e.getLanguageId(),void 0,void 0);if(!this._lastCandidate?.equals(i)){this._lastCandidate=i;for(const s of this._entries)if(s._score=fde(s.selector,i.uri,i.languageId,gS(e),i.notebookUri,i.notebookType),OYe(s.selector)&&s._score>0){for(const o of this._entries)o._score=0;s._score=1e3;break}this._entries.sort(Po._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:w3(e.selector)&&!w3(t.selector)?1:!w3(e.selector)&&w3(t.selector)?-1:e._timet._time?-1:0}}function w3(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(w3):!!n.isBuiltin}class NSt{constructor(){this.referenceProvider=new Po(this._score.bind(this)),this.renameProvider=new Po(this._score.bind(this)),this.newSymbolNamesProvider=new Po(this._score.bind(this)),this.codeActionProvider=new Po(this._score.bind(this)),this.definitionProvider=new Po(this._score.bind(this)),this.typeDefinitionProvider=new Po(this._score.bind(this)),this.declarationProvider=new Po(this._score.bind(this)),this.implementationProvider=new Po(this._score.bind(this)),this.documentSymbolProvider=new Po(this._score.bind(this)),this.inlayHintsProvider=new Po(this._score.bind(this)),this.colorProvider=new Po(this._score.bind(this)),this.codeLensProvider=new Po(this._score.bind(this)),this.documentFormattingEditProvider=new Po(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Po(this._score.bind(this)),this.onTypeFormattingEditProvider=new Po(this._score.bind(this)),this.signatureHelpProvider=new Po(this._score.bind(this)),this.hoverProvider=new Po(this._score.bind(this)),this.documentHighlightProvider=new Po(this._score.bind(this)),this.multiDocumentHighlightProvider=new Po(this._score.bind(this)),this.selectionRangeProvider=new Po(this._score.bind(this)),this.foldingRangeProvider=new Po(this._score.bind(this)),this.linkProvider=new Po(this._score.bind(this)),this.inlineCompletionsProvider=new Po(this._score.bind(this)),this.inlineEditProvider=new Po(this._score.bind(this)),this.completionProvider=new Po(this._score.bind(this)),this.linkedEditingRangeProvider=new Po(this._score.bind(this)),this.inlineValuesProvider=new Po(this._score.bind(this)),this.evaluatableExpressionProvider=new Po(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Po(this._score.bind(this)),this.documentSemanticTokensProvider=new Po(this._score.bind(this)),this.documentDropEditProvider=new Po(this._score.bind(this)),this.documentPasteEditProvider=new Po(this._score.bind(this)),this.mappedEditsProvider=new Po(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(ht,NSt,Yt.Delayed);const el=ae("hoverService"),W_=ae("contextViewService"),Vr=ae("contextMenuService");var PSt='.monaco-workbench .workbench-hover{background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorHoverWidget-foreground);font-size:13px;line-height:19px;max-width:700px;overflow:hidden;position:relative;z-index:40}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{pointer-events:none;position:absolute;z-index:41}.monaco-workbench .workbench-hover-pointer:after{background-color:var(--vscode-editorHoverWidget-background);border-bottom:1px solid var(--vscode-editorHoverWidget-border);border-right:1px solid var(--vscode-editorHoverWidget-border);content:"";height:5px;position:absolute;width:5px}.monaco-workbench .locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;height:4px;width:4px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;text-decoration:underline}.monaco-workbench .workbench-hover a:active,.monaco-workbench .workbench-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}';Ct(PSt,{});var FSt='.monaco-hover{animation:fadein .1s linear;box-sizing:border-box;cursor:default;line-height:1.5em;overflow:hidden;position:absolute;user-select:text;-webkit-user-select:text;white-space:var(--vscode-hover-whiteSpace,normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){word-wrap:break-word;max-width:var(--vscode-hover-maxWidth,500px)}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover .code,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6,.monaco-hover p,.monaco-hover ul{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{border-left:0;border-right:0;box-sizing:border-box;height:1px;margin:4px -8px -4px}.monaco-hover .code:first-child,.monaco-hover p:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover .code:last-child,.monaco-hover p:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ol,.monaco-hover ul{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace,pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{cursor:pointer;margin-right:16px}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link,.monaco-hover .hover-contents a.code-link:hover{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-foreground);text-decoration:underline;text-underline-position:under}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{display:inline-block;margin-bottom:4px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{cursor:default;opacity:.4;pointer-events:none}';Ct(FSt,{});const IHe="vs/base/browser/ui/hover/hoverWidget",jj=we;var Oo;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BELOW=2]="BELOW",n[n.ABOVE=3]="ABOVE"})(Oo||(Oo={}));let fNe=class extends ${constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new bz(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class pNe extends ${static render(e,t,i){return new pNe(e,t,i)}constructor(e,t,i){super(),this.actionContainer=he(e,jj("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=he(this.actionContainer,jj("a.action")),this.action.setAttribute("role","button"),t.iconClass&&he(this.action,jj(`span.icon.${t.iconClass}`));const s=he(this.action,jj("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new WYe(this.actionContainer,t.run)),this._store.add(new HYe(this.actionContainer,t.run,[E.Enter,E.Space])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function BYe(n,e){return n&&e?g(IHe,0,"Inspect this in the accessible view with {0}.",e):n?g(IHe,1,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class WYe extends ${constructor(e,t){super(),this._register(pe(e,xe.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class HYe extends ${constructor(e,t,i){super(),this._register(pe(e,xe.KEY_DOWN,s=>{const o=new os(s);i.some(r=>o.equals(r))&&(s.stopPropagation(),s.preventDefault(),t(e))}))}}var Dh;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),c=Math.min(o.end,r.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],c={start:o.start,end:Math.min(r.start,o.end)},l={start:Math.max(r.end,o.start),end:o.end};return t(c)||a.push(c),t(l)||a.push(l),a}n.relativeComplement=s})(Dh||(Dh={}));var OSt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";Ct(OSt,{});var by;(function(n){n[n.ABSOLUTE=1]="ABSOLUTE",n[n.FIXED=2]="FIXED",n[n.FIXED_SHADOW=3]="FIXED_SHADOW"})(by||(by={}));function BSt(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Ob;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(Ob||(Ob={}));var Jp;(function(n){n[n.BELOW=0]="BELOW",n[n.ABOVE=1]="ABOVE"})(Jp||(Jp={}));var aee;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(aee||(aee={}));var Hp;(function(n){n[n.Before=0]="Before",n[n.After=1]="After"})(Hp||(Hp={}));var Qk;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(Qk||(Qk={}));function i2(n,e,t){const i=t.mode===Qk.ALIGN?t.offset:t.offset+t.size,s=t.mode===Qk.ALIGN?t.offset+t.size:t.offset;return t.position===Hp.Before?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const V2=class V2 extends ${constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=$.None,this.toDisposeOnSetContainer=$.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=we(".context-view"),Jl(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,by.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==by.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===by.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=we(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=WSt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(we("slot"))}else this.container.appendChild(this.view);const s=new Z;V2.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),V2.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){this.isVisible()&&this.hide(),Yo(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Oh(this.view),this.toDisposeOnClean=e.render(this.view)||$.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(I_&&sMe.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Ra(e)){const u=ia(e),f=lje(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else BSt(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=du(this.view),s=Zf(this.view),o=this.delegate.anchorPosition||Jp.BELOW,r=this.delegate.anchorAlignment||Ob.LEFT,a=this.delegate.anchorAxisAlignment||aee.VERTICAL;let c,l;const d=ax();if(a===aee.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After},f={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After,mode:Qk.ALIGN};c=i2(d.innerHeight,s,u)+d.pageYOffset,Dh.intersects({start:c,end:c+s},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),l=i2(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After},f={offset:t.top,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After,mode:Qk.ALIGN};l=i2(d.innerWidth,i,u),Dh.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),c=i2(d.innerHeight,s,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Jp.BELOW?"bottom":"top"),this.view.classList.add(r===Ob.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=ia(this.container);this.view.style.top=`${c-(this.useFixedPosition?ia(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?ia(this.view).left:h.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Jl(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,gt(e).document.activeElement):t&&!al(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};V2.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],V2.BUBBLE_DOWN_EVENTS=["click"];let jwe=V2;const WSt=` +`)){h=!1;break}}if(h){const u=new F(l,1,l,d);t.push(new Bde(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;R--){const z=f+R,G=y+R;P.takeFromEndWhile(j=>j.lineNumber>G);const Y=P.takeFromEndWhile(j=>j.lineNumber===G);a.push(new wBe(z,this.getLineContent(G),Y))}if(bOe.lineNumberOe.lineNumber===De)}a.push(new Yvt(z+1,f+v,ne,j))}c+=w}this._emitContentChangedEvent(new BO(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new wBe(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new Kqe(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,BBe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){vt(o)}return i.addDecoration=g4,i.changeDecoration=g4,i.changeDecorationOptions=g4,i.removeDecoration=g4,i.deltaDecorations=g4,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),vt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:OBe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,o),n.setOptions(OBe[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),c=Math.min(r,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new F(a,1,c,l),h=this._getDecorationsInRange(d,i,n,o);return $ge(h,this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return $ge(a,this._decorationProvider.getDecorationsInRange(r,t,i,n)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return M_.fromDecorations(n).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,n){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,n)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(i.options.before||t.before){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}const r=n!==o,a=rwt(t)!==Iq(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),r=t.length;let a=0;const c=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(c);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return owt(this.getLineContent(e))+1}},i0=Jv,Jv._MODEL_SYNC_LIMIT=50*1024*1024,Jv.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,Jv.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,Jv.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,Jv.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Vd.tabSize,indentSize:Vd.indentSize,insertSpaces:Vd.insertSpaces,detectIndentation:!1,defaultEOL:Sb.LF,trimAutoWhitespace:Vd.trimAutoWhitespace,largeFileOptimizations:Vd.largeFileOptimizations,bracketPairColorizationOptions:Vd.bracketPairColorizationOptions},Jv);C_=i0=D([_(4,JA),_(5,xi),_(6,Vs)],C_);function owt(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function nhe(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function rwt(s){return!!s.after||!!s.before}function Iq(s){return!!s.options.after||!!s.options.before}class FBe{constructor(){this._decorationsTree0=new Jde,this._decorationsTree1=new Jde,this._injectedTextDecorationsTree=new Jde}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,n,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,n,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n,o){const r=e.getVersionId(),a=this._search(t,i,n,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const r=this._decorationsTree0.search(e,t,n,o),a=this._decorationsTree1.search(e,t,n,o),c=this._injectedTextDecorationsTree.search(e,t,n,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Iq(e)?this._injectedTextDecorationsTree.insert(e):nhe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Iq(e)?this._injectedTextDecorationsTree.delete(e):nhe(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){Iq(e)?this._injectedTextDecorationsTree.resolveNode(e,t):nhe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function Kb(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class dQe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class awt extends dQe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:kl.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class cwt{constructor(e){this.position=e?.position??K_.Center,this.persistLane=e?.persistLane}}class lwt extends dQe{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?me.fromHex(e):t.getColor(e.id)}}class Wk{static from(e){return e instanceof Wk?e:new Wk(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Gt{static register(e){return new Gt(e)}static createDynamic(e){return new Gt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?Kb(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||ni.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?Kb(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new awt(e.overviewRuler):null,this.minimap=e.minimap?new lwt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new cwt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Kb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Kb(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Kb(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?aat(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Kb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Kb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Kb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Kb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Kb(e.afterContentClassName):null,this.after=e.after?Wk.from(e.after):null,this.before=e.before?Wk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Gt.EMPTY=Gt.register({description:"empty"});const OBe=[Gt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:ni.NeverGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:ni.GrowsOnlyWhenTypingBefore}),Gt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:ni.GrowsOnlyWhenTypingAfter})];function BBe(s){return s instanceof Gt?s:Gt.createDynamic(s)}class dwt extends V{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new I),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}hasListeners(){return this._actual.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class hwt extends V{constructor(){super(),this._fastEmitter=this._register(new I),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new I),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}hasListeners(){return this._fastEmitter.hasListeners()||this._slowEmitter.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class uwt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new gwt(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class gwt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new pi(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class hLe{static create(e){return new hLe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new fwt(e,t)}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[],c=[];return{addRequest:(l,d,h)=>{r.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=r.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?ph.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let Sme=[],Ame=[];function pwt(s,e,t,i,n,o,r,a){if(n===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=hQe(t,i,n,o,r),f=n-u,p=Sme,m=Ame;let v=0,b=0,w=0,y=n;const C=d.length;let A=0;if(A>=0){let L=Math.abs(h[A]-y);for(;A+1=L)break;L=k,A++}}for(;AL&&(L=b,k=w);let P=0,R=0,z=0,G=0;if(k<=y){let j=k,ne=L===0?B.Null:t.charCodeAt(L-1),ge=L===0?ph.NONE:s.get(ne),De=!0;for(let Oe=L;Oeb&&Eme(ne,ge,Ne,lt,l)&&(P=yt,R=j),j+=xt,j>y){yt>b?(z=yt,G=j-xt):(z=Oe+1,G=j),j-R>f&&(P=0),De=!1;break}ne=Ne,ge=lt}if(De){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(P===0){let j=k,ne=t.charCodeAt(L),ge=s.get(ne),De=!1;for(let Oe=L-1;Oe>=b;Oe--){const yt=Oe+1,Ne=t.charCodeAt(Oe);if(Ne===B.Tab){De=!0;break}let lt,xt;if(fM(Ne)?(Oe--,lt=ph.NONE,xt=2):(lt=s.get(Ne),xt=Tk(Ne)?o:1),j<=y){if(z===0&&(z=yt,G=j),j<=y-f)break;if(Eme(Ne,lt,ne,ge,l)){P=yt,R=j;break}}j-=xt,ne=Ne,ge=lt}if(P!==0){const Oe=f-(G-R);if(Oe<=i){const yt=t.charCodeAt(z);let Ne;Pc(yt)?Ne=2:Ne=_5(yt,G,i,o),Oe-Ne<0&&(P=0)}}if(De){A--;continue}}if(P===0&&(P=z,R=G),P<=b){const j=t.charCodeAt(b);Pc(j)?(P=b+2,R=w+2):(P=b+1,R=w+_5(j,w,i,o))}for(b=P,p[v]=P,w=R,m[v]=R,v++,y=R+f;A<0||A=Y)break;Y=j,A++}}return v===0?null:(p.length=v,m.length=v,Sme=e.breakOffsets,Ame=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function mwt(s,e,t,i,n,o,r,a){const c=M_.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(R=>R.options),d=t.map(R=>R.column-1)):(l=null,d=null),n===-1)return l?new u5(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new u5(d,l,[c.length],[],0):null;const u=a==="keepAll",f=hQe(c,i,n,o,r),p=n-f,m=[],v=[];let b=0,w=0,y=0,C=n,A=c.charCodeAt(0),L=s.get(A),k=_5(A,0,i,o),P=1;Pc(A)&&(k+=1,A=c.charCodeAt(1),L=s.get(A),P++);for(let R=P;RC&&((w===0||k-y>p)&&(w=z,y=k-j),m[b]=w,v[b]=y,b++,C=y+p,w=0),A=G,L=Y}return b===0&&(!t||t.length===0)?null:(m[b]=h,v[b]=k,new u5(d,l,m,v,f))}function _5(s,e,t,i){return s===B.Tab?t-e%t:Tk(s)||s<32?i:1}function WBe(s,e){return e-s%e}function Eme(s,e,t,i,n){return t!==B.Space&&(e===ph.BREAK_AFTER&&i!==ph.BREAK_AFTER||e!==ph.BREAK_BEFORE&&i===ph.BREAK_BEFORE||!n&&e===ph.BREAK_IDEOGRAPHIC&&i!==ph.BREAK_AFTER||!n&&i===ph.BREAK_IDEOGRAPHIC&&e!==ph.BREAK_BEFORE)}function hQe(s,e,t,i,n){let o=0;if(n!==Nu.None){const r=kh(s);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class CY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new El(new F(1,1,1,1),Vh.Simple,0,new oe(1,1),0),new El(new F(1,1,1,1),Vh.Simple,0,new oe(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,ni.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,ni.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new Rn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?dt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):dt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,Io.None)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,Io.None),a=this._validatePositionWithCache(e,n,i,r),c=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(c)?t:new El(F.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=CY._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new El(n,t.selectionStartKind,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new El(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new El(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new F(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new El(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class HBe{constructor(e){this.context=e,this.cursors=[new CY(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return srt(this.cursors,Cc(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return nrt(this.cursors,Cc(e=>e.viewState.position,oe.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(Rn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const n=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ii.selection,F.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class UBe{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class _wt extends V{constructor(){super(),this._onEvent=this._register(new I),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class vwt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var pa;(function(s){s[s.ContentSizeChanged=0]="ContentSizeChanged",s[s.FocusChanged=1]="FocusChanged",s[s.ScrollChanged=2]="ScrollChanged",s[s.ViewZonesChanged=3]="ViewZonesChanged",s[s.HiddenAreasChanged=4]="HiddenAreasChanged",s[s.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",s[s.CursorStateChanged=6]="CursorStateChanged",s[s.ModelDecorationsChanged=7]="ModelDecorationsChanged",s[s.ModelLanguageChanged=8]="ModelLanguageChanged",s[s.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",s[s.ModelContentChanged=10]="ModelContentChanged",s[s.ModelOptionsChanged=11]="ModelOptionsChanged",s[s.ModelTokensChanged=12]="ModelTokensChanged"})(pa||(pa={}));class uLe{constructor(e,t,i,n){this.kind=pa.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new uLe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class gLe{constructor(e,t){this.kind=pa.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new gLe(this.oldHasFocus,e.hasFocus)}}class fLe{constructor(e,t,i,n,o,r,a,c){this.kind=pa.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new fLe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class bwt{constructor(){this.kind=pa.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class wwt{constructor(){this.kind=pa.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class SY{constructor(e,t,i,n,o,r,a){this.kind=pa.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),o=!0);const a=v5.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=F.fromPositions(a[0],a[0]),e.emitViewEvent(new r5(t,i,c,l,n,o,r))}revealPrimary(e,t,i,n,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new r5(t,i,null,c,n,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const o=Rn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Oi.Undo:i.isRedoing?Oi.Redo:Oi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,_s.Simple,!0,mt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Oi.RecoverFromMarkers,Rn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}getPosition(){return this._cursors.getPrimaryCursor().modelState.position}setSelections(e,t,i,n){this.setStates(e,t,n,Rn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const r=v5.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new Vpt(c,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(n.cursorState[d].modelState))){const l=n?n.cursorState.map(h=>h.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new SY(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const l=c[0].open,d=o.text.length-r[2].length-1,h=o.text.lastIndexOf(l,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],c=this._model.pushEditOperations(this.getSelections(),i,l=>{if(o)for(let h=0,u=o.length;h0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=Oi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=v5.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){vt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,_s.Simple,!0,mt.Smooth)}getAutoClosedCharacters(){return VBe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new b5(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(JE.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o{const l=c.getPosition();return new dt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Oi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(JE.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(JE.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,Oi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(yM.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new tg(sr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new tg(sr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class v5{static from(e,t){return new v5(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Iwt{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,l=>{const d=[];for(let f=0;ff.identifier.minor-p.identifier.minor,u=[];for(let f=0;f0?(d[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:p=>{const m=parseInt(p,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===c_.LTR?new dt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new dt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);const c=[];for(const l in o)o.hasOwnProperty(l)&&c.push(parseInt(l,10));c.sort((l,d)=>d-l);for(const l of c)a.splice(l,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{F.isEmpty(h)&&u===""||n.push({identifier:{major:t,minor:o++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{const f=dt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter;else{const b=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===b?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter}else p=ni.NeverGrowsWhenTypingAtEdges;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,p);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return vt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-F.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;io.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Twt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class b5{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new Twt(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=b5._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=b5._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let o=0,r=this._original.length;oB8,tokenizeEncoded:(s,e,t)=>ATe(_T.Null,t)};async function Lwt(s,e,t){if(!t)return $Be(e,s.languageIdCodec,zBe);const i=await Ta.getOrCreate(t);return $Be(e,s.languageIdCodec,i||zBe)}function Rwt(s,e,t,i,n,o,r){let a="
      ",c=i,l=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(p+=" ",d=!1):(p+=" ",d=!0),v--;break}case B.LessThan:p+="<",d=!1;break;case B.GreaterThan:p+=">",d=!1;break;case B.Ampersand:p+="&",d=!1;break;case B.Null:p+="�",d=!1;break;case B.UTF8_BOM:case B.LINE_SEPARATOR:case B.PARAGRAPH_SEPARATOR:case B.NEXT_LINE:p+="�",d=!1;break;case B.CarriageReturn:p+="​",d=!1;break;case B.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>n||c>=n)break}return a+="
      ",a}function $Be(s,e,t){let i='
      ';const n=ov(s);let o=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
      ");const l=t.tokenizeEncoded(c,!0,o);gd.convertToEndOffset(l.tokens,c.length);const h=new gd(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${fT(c.substring(u,v))}`,u=v}o=l.endState}return i+="
      ",i}class Mwt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class Nwt{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}var PD;let Pwt=(PD=class{constructor(e,t,i,n){this._instanceId=J6e(++PD.INSTANCE_COUNT),this._pendingChanges=new Mwt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[r].afterLineNumber?i{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Nwt(c,n,o,r,a)),c},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of t)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of i){const l=this._findWhitespaceIndex(c.id);l!==-1&&this._removeWhitespace(l)}return}const n=new Set;for(const c of i)n.add(c.id);const o=new Map;for(const c of t)o.set(c.id,c);const r=c=>{const l=[];for(const d of c)if(!n.has(d.id)){if(o.has(d.id)){const h=o.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}l.push(d)}return l},a=r(this._arr).concat(r(e));a.sort((c,l)=>c.afterLineNumber===l.afterLineNumber?c.ordinal-l.ordinal:c.afterLineNumber-l.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=PD.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+this._paddingTop}hasWhitespace(){return this._checkPendingChanges(),this.getWhitespacesCount()>0}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let n=1,o=t;for(;n=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|0;const c=this.getWhitespacesCount()|0;let l,d;a===-1?(a=c,d=r+1,l=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);let h=o,u=h;const f=5e5;let p=0;o>=f&&(p=Math.floor(o/f)*f,p=Math.floor(p/i)*i,u-=p);const m=[],v=e+(t-e)/2;let b=-1;for(let A=n;A<=r;A++){if(b===-1){const L=h,k=h+i;(L<=v&&vv)&&(b=A)}for(h+=i,m[A-n]=u,u+=i;d===A;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=A;break}}b===-1&&(b=r);const w=this.getVerticalOffsetForLineNumber(r)|0;let y=n,C=r;return yt&&C--,{bigNumbersDelta:p,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:b,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;for(;t=a+c)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}},PD.INSTANCE_COUNT=0,PD);const Fwt=125;class iV{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Owt extends V{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new iV(0,0,0,0),this._scrollable=this._register(new yN({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new uLe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class Bwt extends V{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(x.layoutInfo),r=n.get(x.padding);this._linesLayout=new Pwt(t,n.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Owt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new iV(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(x.smoothScrolling)?Fwt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(x.lineHeight)&&this._linesLayout.setLineHeight(t.get(x.lineHeight)),e.hasChanged(x.padding)){const i=t.get(x.padding);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(x.layoutInfo)){const i=t.get(x.layoutInfo),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new iV(n,r.contentWidth,o,this._getContentHeight(n,o,a)))}else this._updateHeight();e.hasChanged(x.smoothScrolling)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const n=this._configuration.options.get(x.scrollbar);return n.horizontal===Co.Hidden||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-n.get(x.lineHeight)-n.get(x.padding).bottom):n.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new iV(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new NOe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new NOe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),n=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new iV(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===mt.Immediate?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Wwt{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.startLineNumber,1),Io.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),Io.Right);r=new F(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,Io.Right);i=new VKe(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const n=new F(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Rj(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let c=0;const l=[];for(let d=o;d<=r;d++)l[d-o]=[];for(let d=0,h=n.length;dt===nr.Comment)}function _Le(s,e){return uQe(s,e.range,t=>t===nr.String)}function uQe(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function she(s,e){return s===null?e?AY.INSTANCE:EY.INSTANCE:new Hwt(s,e)}class Hwt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((l,d)=>new M_(0,0,l+1,this._projectionData.injectionOptions[d],0));r=M_.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=GBe(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,r,a){this._assertVisible();const c=this._projectionData,l=c.injectionOffsets,d=c.injectionOptions;let h=null;if(l){h=[];let f=0,p=0;for(let m=0;m0?c.breakOffsets[m-1]:0,w=c.breakOffsets[m];for(;pw)break;if(b0?c.wrappedTextIndentLength:0,P=k+Math.max(C-b,0),R=k+Math.min(A-b,w-b);P!==R&&v.push(new xgt(P,R,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(A<=w)f+=y,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:gd.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=GBe(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=ohe.length)for(let e=1;e<=s;e++)ohe[e]=Uwt(e);return ohe[s]}function Uwt(s){return new Array(s+1).join(" ")}class Vwt{constructor(e,t,i,n,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=c,this.wrappingIndent=l,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new $wt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new Uy(M_.fromDecorations(n));for(let m=0;mb.lineNumber===m+1);r.addRequest(i[m],v,t?t[m]:null)}const c=r.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(F.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,w=she(c[m],!b);l[m]=w.getViewLineCount(),this.modelLineProjections[m]=w}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Eut(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=zwt(t),n=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(F.compareRangesUsingStarts);if(i.length===n.length){let u=!1;for(let f=0;f({range:u,options:Gt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,c=0,l=-1,d=l+1=a&&f<=c?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),p=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),p=!0)),p){const m=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===o;if(r&&a&&c&&l&&d)return!1;const h=r&&a&&!c&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let u=null;if(h){u=[];for(let f=0,p=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const c=[],l=[];for(let d=0,h=n.length;dc?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+c-1,p=h+1,m=p+(o-c)-1,l=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,r.lineNumber),c=this.convertModelPositionToViewPosition(a.startLineNumber,1),l=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:l.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new KBe(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=n.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===n.modelLineNumber?n.modelLineWrappedLineIdx+1:l.getViewLineCount();for(let u=d;u{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new x1(f.visibleColumn,p,f.className,new l5(f.horizontalLine.top,m.column),-1,-1):v.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=n.lineNumber-1;let d=null;for(let p=c;p<=l;p++){const m=this.modelLineProjections[p];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,p===c?i.column:1),b=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),w=b-v+1;let y=G0.BlockNone;w>1&&m.getViewLineMinColumn(this.model,p+1,b)===1&&(y=v===0?G0.BlockSubsequent:G0.BlockAll),r.push(w),a.push(y),d===null&&(d=new oe(p+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,p)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let f=0;for(let p=0,m=o.length;pt&&(p=!0,f=t-o+1),h.getViewLinesData(this.model,l+1,u,f,o-e,i,c),o+=f,p)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.remainder,a=this.modelLineProjections[o],c=a.getViewLineMinColumn(this.model,o+1,r),l=a.getViewLineMaxColumn(this.model,o+1,r);tl&&(t=l);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new oe(o+1,d)).equals(i)?new oe(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new F(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new F(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=Io.None,n=!1,o=!1){const r=this.model.validatePosition(new oe(e,t)),a=r.lineNumber,c=r.column;let l=a-1,d=!1;if(o)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(l===0&&!this.modelLineProjections[l].isVisible())return new oe(n?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let u;return d?o?u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,c,i),u}convertModelRangeToViewRange(e,t=Io.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return F.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,Io.Right),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,Io.Left);return new F(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new F(r.lineNumber,1,a.lineNumber,a.column),t,i,n,o);let c=[];const l=r.lineNumber-1,d=a.lineNumber-1;let h=null;for(let m=l;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new oe(m+1,m===l?r.column:1));else if(h!==null){const b=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,m,b),t,i,n)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,a.lineNumber,a.column),t,i,n)),h=null),c.sort((m,v)=>{const b=F.compareRangesUsingStarts(m.range,v.range);return b===0?m.idv.id?1:0:b});const u=[];let f=0,p=null;for(const m of c){const v=m.id;p!==v&&(p=v,u[f++]=m)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function zwt(s){if(s.length===0)return[];const e=s.slice();e.sort(F.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let o=1,r=e.length;on+1?(t.push(new F(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new F(i,1,n,1)),t}class KBe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class qBe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class $wt{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}var G0;(function(s){s[s.BlockNone=0]="BlockNone",s[s.BlockSubsequent=1]="BlockSubsequent",s[s.BlockAll=2]="BlockAll"})(G0||(G0={}));class Gwt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Kwt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Kpe(t,i)}onModelLinesInserted(e,t,i,n){return new qpe(t,i)}onModelLineChanged(e,t,i){return[!1,new uqe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let o=0;ot)}modelRangeIsVisible(e){const t=this._lines.model.getLineCount();return!(e.startLineNumber<1||e.startLineNumber>t||e.endLineNumber<1||e.endLineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const FI=K_.Right;class qwt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*FI/8))}reset(e){const t=Math.ceil((e+1)*FI/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=vLe.create(this.model),this.glyphLanes=new qwt(0),this.model.isTooLargeForTokenization())this._lines=new Gwt(this.model);else{const h=this._configuration.options,u=h.get(x.fontInfo),f=h.get(x.wrappingStrategy),p=h.get(x.wrappingInfo),m=h.get(x.wrappingIndent),v=h.get(x.wordBreak);this._lines=new Vwt(this._editorId,this.model,n,o,u,this.model.getOptions().tabSize,f,p.wrappingColumn,m,v)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new kwt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Bwt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Gpt(h)),this._eventDispatcher.emitOutgoingEvent(new fLe(h.oldScrollWidth,h.oldScrollLeft,h.oldScrollHeight,h.oldScrollTop,h.scrollWidth,h.scrollLeft,h.scrollHeight,h.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(h=>{this._eventDispatcher.emitOutgoingEvent(h)})),this._decorations=new Wwt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(h=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,h)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(gY.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Qpt)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Kpt(h))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new F(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new zpt(e)),this._eventDispatcher.emitOutgoingEvent(new gLe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Wpt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Hpt)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new oe(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new jBe(t,this._viewportStart.startLineDelta)}return new jBe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(x.fontInfo),r=n.get(x.wrappingStrategy),a=n.get(x.wrappingInfo),c=n.get(x.wrappingIndent),l=n.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new LG),e.emitViewEvent(new RG),e.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(x.readOnly)&&(this._decorations.reset(),e.emitViewEvent(new NI(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new NI(null))),e.emitViewEvent(new Upt(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),rP.shouldRecreate(t)&&(this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let n=!1,o=!1;const r=e instanceof xT?e.rawContentChangedEvent.changes:e.changes,a=e instanceof xT?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Hg.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Hg.LineChanged:{let u=null;h.injectedText&&(u=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),c.addRequest(h.detail,u,null);break}}const l=c.finalize(),d=new Uy(l);for(const h of r)switch(h.changeType){case Hg.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new LG),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case Hg.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),n=!0;break}case Hg.LinesInserted:{const u=d.takeCount(h.detail.length),f=this._lines.onModelLinesInserted(a,h.fromLineNumber,h.toLineNumber,u);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),n=!0;break}case Hg.LineChanged:{const u=d.dequeue(),[f,p,m,v]=this._lines.onModelLineChanged(a,h.lineNumber,u);o=f,p&&i.emitViewEvent(p),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case Hg.EOLChanged:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&o&&(i.emitViewEvent(new RG),i.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const n=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},mt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof xT&&i.emitOutgoingEvent(new Ewt(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new $pt),this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Awt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Swt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new LG),t.emitViewEvent(new RG),t.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new xwt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new NI(e)),this._eventDispatcher.emitOutgoingEvent(new Cwt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const n=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new LG),r.emitViewEvent(new RG),r.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=n.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new wwt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(x.layoutInfo),t=this._configuration.options.get(x.lineHeight),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new F(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const n=[];let o=0,r=t.startLineNumber,a=t.startColumn;const c=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;dc||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=kh(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=T_(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new fp(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Egt(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Rj(this._configuration.options)),i=new jwt;for(const n of t){const o=n.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const c=r.getColor(e.value),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(c,o.zIndex,l,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(F.compareRangesUsingStarts);let o=!1,r=!1;for(const c of e)c.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const c=e.map(d=>d.startLineNumber);let l="";for(let d=0;d0&&c[d-1]===c[d]||(l+=this.model.getLineContent(c[d])+n);return l}if(o&&t){const c=[];let l=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==l&&c.push(this.model.getLineContent(h)):c.push(this.model.getValueInRange(d,i?go.CRLF:go.TextDefined)),l=h}return c.length===1?c[0]:c}const a=[];for(const c of e)c.isEmpty()||a.push(this.model.getValueInRange(c,i?go.CRLF:go.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ca||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new F(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(x.fontInfo),r=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===cd.fontFamily;let l;return c?l=cd.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${cd.fontFamily}`),{mode:i,html:`
      `+this._getHTMLToCopy(n,r)+"
      "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=o;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?n-1:0,f=l===o?r-1:h.length;h===""?c+="
      ":c+=Rwt(h,d.inflate(),t,u,f,a,Qn)}return c}_getColorMap(){const e=Ta.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=Oi.NotSet){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new ywt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,_s.Simple,t,mt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,_s.Simple,t,mt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new r5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new r5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new r5(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new jpt),this._eventDispatcher.emitOutgoingEvent(new bwt))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class vLe{static create(e){const t=e._setTrackedRange(null,new F(1,1,1,1),ni.NeverGrowsWhenTypingAtEdges);return new vLe(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,ni.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new F(i.lineNumber,i.column,i.lineNumber,i.column),ni.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class jwt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const r=this._asMap[e];if(r){const a=r.data,c=a[a.length-3],l=a[a.length-1];if(c===o&&l+1>=i){n>l&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new W8(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class Ywt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&QBe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>Jwt(t,i),[]);return QBe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Jwt(s,e){const t=[];let i=0,n=0;for(;i{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const w=b.get(x.layoutInfo);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new iyt(this,this._contextKeyService)),this._register(new nyt(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new Uc([Le,this._contextKeyService]))),this._modelData=null,this._focusTracker=new syt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=ap.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of ap.getEditorActions()){if(this._actions.has(v.id)){vt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new qqe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,w=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,w))),this._contextKeyService);this._actions.set(b.id,b)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new $j(this._domElement,{onDragOver:v=>{if(!m())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this.showDropIndicatorAt(b.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this._onDropIntoEditor.fire({position:b.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n,o){return new Ppe(e,t,i,n,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return CU.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?hs.getWordAtPosition(this._modelData.model,this._configuration.options.get(x.wordSeparators),this._configuration.options.get(x.wordSegmenterLocales),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=go.TextDefined;return e&&e.lineEnding&&e.lineEnding===` +`?i=go.LF:e&&e.lineEnding&&e.lineEnding===`\r +`&&(i=go.CRLF),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?n0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?n0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?n0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>F.lift(i)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return qa.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getStatusbarColumn(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return qa.toStatusbarColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!F.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=mt.Smooth){this._revealLine(e,_s.Simple,t)}revealLineInCenter(e,t=mt.Smooth){this._revealLine(e,_s.Center,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealLine(e,_s.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=mt.Smooth){this._revealLine(e,_s.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,e,1),t,!1,i)}revealPosition(e,t=mt.Smooth){this._revealPosition(e,_s.Simple,!0,t)}revealPositionInCenter(e,t=mt.Smooth){this._revealPosition(e,_s.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealPosition(e,_s.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=mt.Smooth){this._revealPosition(e,_s.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new F(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=dt.isISelection(e),n=F.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new dt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Simple,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._revealLines(e,t,_s.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._revealLines(e,t,_s.NearTop,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,t,1),i,!1,n)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._revealRange(e,i?_s.Center:_s.Simple,n,t)}revealRangeInCenter(e,t=mt.Smooth){this._revealRange(e,_s.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=mt.Smooth){this._revealRange(e,_s.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=mt.Smooth){this._revealRange(e,_s.Top,!0,t)}_revealRange(e,t,i,n){if(!F.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(F.lift(e),t,i,n)}setSelections(e,t="api",i=Oi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,o=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}onVisible(){this._modelData?.view.refreshFocusState()}onHide(){this._modelData?.view.refreshFocusState(),this._focusTracker.refreshState()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case oc.CompositionStart:this._startComposition();return;case oc.CompositionEnd:this._endComposition(e);return;case oc.Type:{const o=i;this._type(e,o.text||"");return}case oc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case oc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case oc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case oc.Cut:this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,vt);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,n,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new F(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=ap.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,vt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(x.readOnly))return!1;let n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new oyt(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Rj(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Rj(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}setDecorationsByType(e,t,i){const n={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Wc(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!n[h]&&this._registerDecorationType(e,l,c.renderOptions,t),n[h]=!0}const d=this._resolveDecorationOptions(l,!!c.hoverMessage);c.hoverMessage&&(d.hoverMessage=c.hoverMessage),r.push({range:c.range,options:d})}for(const c in o)n[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,r))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const n=Gt.createDynamic(this._resolveDecorationOptions(e,!1)),o=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(r,o))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(x.layoutInfo)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(x.layoutInfo),o=n0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(x.lineHeight)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Dl(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new Qwt(this._id,this._configuration,e,eLe.create(ct(this._domElement)),hLe.create(this._configuration.options),a=>Ll(ct(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case pa.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case pa.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case pa.ScrollChanged:this._onDidScrollChange.fire(a);break;case pa.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case pa.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case pa.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case pa.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(1335,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(Xe.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(1336,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const c=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",o,r,a,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,c)=>{this._compositionType("keyboard",o,r,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,c)=>{const l={text:o,pasteOnNewLine:r,multicursorText:a,mode:c};this._commandService.executeCommand(oc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(oc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(oc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(oc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(oc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(oc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(oc.Cut,{})}};const i=new nae(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new dme(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_registerDecorationType(e,t,i,n){this._codeEditorService.registerDecorationType(e,t,i,n,this)}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}_resolveDecorationOptions(e,t){return this._codeEditorService.resolveDecorationOptions(e,t)}getTelemetryData(){return this._telemetryData}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new F(e.lineNumber,e.column,e.lineNumber,e.column),options:n0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,mt.Immediate)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},n0=cL,cL.dropIntoEditorDecorationOptions=Gt.register({description:"workbench-dnd-target",className:"dnd-target"}),cL);Hk=n0=D([_(3,we),_(4,Kt),_(5,vi),_(6,Le),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],Hk);let eyt=0,tyt=class{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){bt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var K0;(function(s){s[s.NotSet=0]="NotSet",s[s.False=1]="False",s[s.True=2]="True"})(K0||(K0={}));class YBe extends V{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new I(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new I(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=K0.NotSet}setValue(e){const t=e?K0.True:K0.False;this._value!==t&&(this._value=t,this._value===K0.True?this._onDidChangeToTrue.fire():this._value===K0.False&&this._onDidChangeToFalse.fire())}}class rh extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class iyt extends V{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=J.editorSimpleInput.bindTo(t),this._editorFocus=J.focus.bindTo(t),this._textInputFocus=J.textInputFocus.bindTo(t),this._editorTextFocus=J.editorTextFocus.bindTo(t),this._tabMovesFocus=J.tabMovesFocus.bindTo(t),this._editorReadonly=J.readOnly.bindTo(t),this._inDiffEditor=J.inDiffEditor.bindTo(t),this._editorColumnSelection=J.columnSelection.bindTo(t),this._hasMultipleSelections=J.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=J.hasNonEmptySelection.bindTo(t),this._canUndo=J.canUndo.bindTo(t),this._canRedo=J.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Pk.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Pk.getTabFocusMode()),this._editorReadonly.set(e.get(x.readOnly)),this._inDiffEditor.set(e.get(x.inDiffEditor)),this._editorColumnSelection.set(e.get(x.columnSelection))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class nyt extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=J.languageId.bindTo(t),this._hasCompletionItemProvider=J.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=J.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=J.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=J.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=J.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=J.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=J.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=J.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=J.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=J.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=J.hasReferenceProvider.bindTo(t),this._hasRenameProvider=J.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=J.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=J.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=J.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=J.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=J.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=J.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=J.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===pe.walkThroughSnippet||e.uri.scheme===pe.vscodeChatCodeBlock)})}}class syt extends V{constructor(e,t){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Ac(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Ac(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}refreshState(){this._domFocusTracker.refreshState(),this._overflowWidgetsDomNode?.refreshState?.()}}class oyt{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(n=>{this._isChangingDecorations||e.call(t,n)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const ryt=encodeURIComponent("");function rhe(s){return ryt+encodeURIComponent(s.toString())+ayt}const cyt=encodeURIComponent('');function dyt(s){return cyt+encodeURIComponent(s.toString())+lyt}Cp((s,e)=>{const t=s.getColor(TN);t&&e.addRule(`.monaco-editor .${Uh.EditorErrorDecoration} { background: url("data:image/svg+xml,${rhe(t)}") repeat-x bottom left; }`);const i=s.getColor(pm);i&&e.addRule(`.monaco-editor .${Uh.EditorWarningDecoration} { background: url("data:image/svg+xml,${rhe(i)}") repeat-x bottom left; }`);const n=s.getColor(mm);n&&e.addRule(`.monaco-editor .${Uh.EditorInfoDecoration} { background: url("data:image/svg+xml,${rhe(n)}") repeat-x bottom left; }`);const o=s.getColor(aft);o&&e.addRule(`.monaco-editor .${Uh.EditorHintDecoration} { background: url("data:image/svg+xml,${dyt(o)}") no-repeat bottom left; }`);const r=s.getColor(b_t);r&&e.addRule(`.monaco-editor.showUnused .${Uh.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let xY=class extends V{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new I),this.onWillCreateCodeEditor=this._onWillCreateCodeEditor.event,this._onCodeEditorAdd=this._register(new I),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new I),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new I),this.onWillCreateDiffEditor=this._onWillCreateDiffEditor.event,this._onDiffEditorAdd=this._register(new I),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new I),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._onDidChangeTransientModelProperty=this._register(new I),this.onDidChangeTransientModelProperty=this._onDidChangeTransientModelProperty.event,this._onDecorationTypeRegistered=this._register(new I),this.onDecorationTypeRegistered=this._onDecorationTypeRegistered.event,this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._codeEditorOpenHandlers=new hl,this._transientWatchers={},this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=this._createGlobalStyleSheet()),this._globalStyleSheet}_createGlobalStyleSheet(){return new gyt(gl())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!k8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new uyt(this,i,gl(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?r=new fyt(this._themeService,a,c):r=new pyt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}return r.refCount++,{dispose:()=>{this.removeDecorationType(t)}}}listDecorationTypes(){return Array.from(this._decorationOptionProviders.keys())}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}resolveDecorationCSSRules(e){const t=this._decorationOptionProviders.get(e);return t?t.resolveDecorationCSSRules():null}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}setTransientModelProperty(e,t,i){const n=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(n)?o=this._transientWatchers[n]:(o=new hyt(n,e,this),this._transientWatchers[n]=o),o.get(t)!==i&&(o.set(t,i),this._onDidChangeTransientModelProperty.fire(e))}getTransientModelProperty(e,t){const i=e.uri.toString();if(this._transientWatchers.hasOwnProperty(i))return this._transientWatchers[i].get(t)}getTransientModelProperties(e){const t=e.uri.toString();if(this._transientWatchers.hasOwnProperty(t))return this._transientWatchers[t].keys().map(i=>[i,this._transientWatchers[t].get(i)])}_removeWatcher(e){delete this._transientWatchers[e.uri]}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};xY=D([_(0,pn)],xY);class hyt{constructor(e,t,i){this.uri=e,this._values={},t.onWillDispose(()=>i._removeWatcher(this))}set(e,t){this._values[e]=t}get(e){return this._values[e]}keys(){return Object.keys(this._values)}}class uyt{get sheet(){return this._styleSheet.sheet}constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){this._refCount--,this._refCount===0&&(this._styleSheet.remove(),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Uf(e,t,this._styleSheet)}removeRulesContainingSelector(e){CS(e,this._styleSheet)}}class gyt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Uf(e,t,this._styleSheet)}removeRulesContainingSelector(e){CS(e,this._styleSheet)}}class fyt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new DY(Ql.BeforeContentClassName,i,e),this._afterContentRules=new DY(Ql.AfterContentClassName,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}resolveDecorationCSSRules(){return this._styleSheet.sheet.cssRules}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class pyt{constructor(e,t,i,n){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new DY(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new DY(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(Ql.ClassName);const a=r(Ql.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(Ql.BeforeContentClassName),this.afterContentClassName=o(Ql.AfterContentClassName),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const h=r(Ql.BeforeInjectedTextClassName);this.beforeInjectedText={content:n.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.beforeInjectedText.affectsLetterSpacing}}if(n.options.afterInjectedText&&n.options.afterInjectedText.contentText){const h=r(Ql.AfterInjectedTextClassName);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(Ql.GlyphMarginClassName);const c=n.options;this.isWholeLine=!!c.isWholeLine,this.stickiness=c.rangeBehavior;const l=c.light&&c.light.overviewRulerColor||c.overviewRulerColor,d=c.dark&&c.dark.overviewRulerColor||c.overviewRulerColor;(typeof l<"u"||typeof d<"u")&&(this.overviewRuler={color:l||d,darkColor:d||l,position:c.overviewRulerLane||kl.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}resolveDecorationCSSRules(){return this._styleSheet.sheet.rules}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const f4={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class DY{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=ahe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+ahe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=ahe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,n;switch(this._ruleType){case Ql.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case Ql.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case Ql.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case Ql.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case Ql.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case Ql.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case Ql.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(this._unThemedSelector,t),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),r=!0),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,n),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push($p(f4.contentIconPath,Zu(N.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push($p(f4.contentText,n))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push($p(f4.gutterIconPath,Zu(N.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push($p(f4.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push($p("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push($p(f4[o],r))}return i.length!==n}resolveValue(e){if(Sgt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var Ql;(function(s){s[s.ClassName=0]="ClassName",s[s.InlineClassName=1]="InlineClassName",s[s.GlyphMarginClassName=2]="GlyphMarginClassName",s[s.BeforeContentClassName=3]="BeforeContentClassName",s[s.AfterContentClassName=4]="AfterContentClassName",s[s.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",s[s.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(Ql||(Ql={}));class ahe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),i===Ql.BeforeContentClassName?n+="::before":i===Ql.AfterContentClassName&&(n+="::after"),n}}let kY=class extends xY{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,n,o)=>n?this.doOpenEditor(n,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===pe.http||o===pe.https)return YGe(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,mt.Immediate);else{const o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,mt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};kY=D([_(0,Le),_(1,pn)],kY);ce(Kt,kY,qt.Eager);const pu=ae("layoutService");let IY=class{get mainContainer(){return lm(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??si.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return z_(this.mainContainer)}get activeContainerDimension(){return z_(this.activeContainer)}get containers(){return Fi(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=M.None,this.onDidLayoutActiveContainer=M.None,this.onDidLayoutContainer=M.None,this.onDidChangeActiveContainer=M.None,this.onDidAddContainer=M.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};IY=D([_(0,Kt)],IY);let kme=class extends IY{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};kme=D([_(1,Kt)],kme);ce(pu,IY,qt.Delayed);const to=ae("dialogService"),ag=ae("fileDialogService");function VG(s){return s.scheme===pe.file?s.fsPath:s.path}let gQe=0;class zG{constructor(e,t,i,n,o,r,a){this.id=++gQe,this.type=Al.Resource,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}var uS;(function(s){s[s.ExternalRemoval=0]="ExternalRemoval",s[s.NoParallelUniverses=1]="NoParallelUniverses"})(uS||(uS={}));class JBe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class XBe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===uS.ExternalRemoval?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(g(1191,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(1192,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class myt{constructor(e,t,i,n,o,r,a){this.id=++gQe,this.type=Al.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new XBe),this.removedResources.has(t)||this.removedResources.set(t,new JBe(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new XBe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new JBe(e,uS.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class fQe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===Al.Workspace&&e.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval);for(const e of this._future)e.type===Al.Workspace&&e.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}setElementsIsValid(e){for(const t of this._past)t.type===Al.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===Al.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===Al.Workspace?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===Al.Workspace&&t.removeResource(this.resourceLabel,this.strResource,uS.NoParallelUniverses);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new rQe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[n])&&(i=!1,o=0),!i&&l.type===Al.Workspace&&l.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const c=this._future[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,r=a),!i&&c.type===Al.Workspace&&c.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class che{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t{for(let i=0,n=this._uriComparisonKeyComputers.length;it.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof z0){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){vt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),n.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),n.dispose(),o()),c=>(r(),n.dispose(),this._onError(c,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return V.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?V.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==Al.Workspace||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?wN(i)?t(i):i.then(n=>t(n)):t(V.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||pQe);return new che(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new $G(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new $G}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(1193,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(1193,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,g(1194,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,g(1195,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,g(1196,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:c}=await this._dialogService.prompt({type:Xe.Info,message:g(1197,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(1198,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(1199,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(c===a.Cancel)return;if(c===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const l=this._checkWorkspaceUndo(e,t,i,!1);if(l)return l.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=g(1200,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new che([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof z0){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(!o)return;if(o.groupId){const[a,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&c)return this._undo(c,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===Al.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(1201,"Would you like to undo '{0}'?",i.label),primaryButton:g(1202,"&&Yes"),cancelButton:g(1203,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(1205,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,g(1206,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,g(1207,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(1208,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new che([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderPre(TY.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Ka(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new cdt(6),this._cache.set(i,n));const o=Ka(n.update(t),this._min,this._max);return AA(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new aTe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Ka(e,this._min,this._max)}}let Tme=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,o=i?.max??n**2,r=i?.key??void 0,a=`${TY.of(e)},${n}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new _yt(n*1.5)):c=new vyt(this._logService,t,e,this._overallAverage()|0||n*1.5,n,o),this._data.set(a,c)),c}_overallAverage(){const e=new aTe;for(const t of this._data.values())e.update(t.default());return e.value}};Tme=D([_(0,Ge),_(1,Za)],Tme);ce(Sp,Tme,qt.Delayed);function lhe(s,e){return e&&(s.stack||s.stacktrace)?g(568,"{0}: {1}",e2e(s),ZBe(s.stack)||ZBe(s.stacktrace)):e2e(s)}function ZBe(s){return Array.isArray(s)?s.join(` +`):s}function e2e(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?g(569,"A system error occurred ({0})",s.message):s.message||g(570,"An unknown error occurred. Please consult the log for more details.")}function Nr(s=null,e=!1){if(!s)return g(570,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Fi(s),i=Nr(t[0],e);return t.length>1?g(571,"{0} ({1} errors in total)",i,t.length):i}if(Lt(s))return s;if(s.detail){const t=s.detail;if(t.error)return lhe(t.error,e);if(t.exception)return lhe(t.exception,e)}return s.stack?lhe(s,e):s.message?s.message:g(570,"An unknown error occurred. Please consult the log for more details.")}function byt(s){const e=s;return e instanceof Error&&Array.isArray(e.actions)}function wyt(s,e){let t;return typeof s=="string"?t=new Error(s):t=s,t.actions=e,t}function mQe(s){return lc(s)}var Gn;(function(s){s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error"})(Gn||(Gn={}));const bLe=Gn.Info;function LY(s,e,t){switch(e){case Gn.Trace:s.trace(t);break;case Gn.Debug:s.debug(t);break;case Gn.Info:s.info(t);break;case Gn.Warning:s.warn(t);break;case Gn.Error:s.error(t);break;case Gn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function dP(s,e=!1){let t="";for(let i=0;i0?" ":"")+n}return t}class wLe extends V{constructor(){super(...arguments),this.level=bLe,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Gn.Off&&this.level<=e}}class rae extends wLe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&this.log(Gn.Trace,dP([e,...t],!0))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&this.log(Gn.Debug,dP([e,...t]))}info(e,...t){this.checkLogLevel(Gn.Info)&&this.log(Gn.Info,dP([e,...t]))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&this.log(Gn.Warning,dP([e,...t]))}error(e,...t){if(this.checkLogLevel(Gn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Gn.Error,dP(i))}else this.log(Gn.Error,dP([e,...t]))}flush(){}}let yyt=class extends wLe{constructor(e=bLe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Gn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Gn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class Cyt extends wLe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}flush(){for(const e of this.loggers)e.flush()}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class _Qe extends V{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new ui,this._onDidChangeLoggers=this._register(new I),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,i)for(const n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return Lt(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){const i=this.toResource(e),n=Lt(e)?e:t?.id??Wc(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Gn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:o,info:{resource:i,id:n,logLevel:r,name:t?.name,hidden:t?.hidden,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),o}toResource(e){return Lt(e)?Pt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(N.isUri(e)){const i=e,n=t,o=this._loggers.get(i);o&&n!==o.info.logLevel&&(o.info.logLevel=n===this.logLevel?void 0:n,o.logger?.setLevel(n),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,n]))}else{this.logLevel=e;for(const[i,n]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&n.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){const t=this._loggers.get(e);t&&(t.logger&&t.logger.dispose(),this._loggers.delete(e),this._onDidChangeLoggers.fire({added:[],removed:[t.info]}))}*getRegisteredLoggers(){for(const e of this._loggers.values())yield e.info}getRegisteredLogger(e){return this._loggers.get(e)?.info}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}}class vQe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Gn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class Syt extends vQe{}function r3(s){switch(s){case Gn.Trace:return"trace";case Gn.Debug:return"debug";case Gn.Info:return"info";case Gn.Warning:return"warn";case Gn.Error:return"error";case Gn.Off:return"off"}}function bQe(s){switch(s){case"trace":return Gn.Trace;case"debug":return Gn.Debug;case"info":return Gn.Info;case"warn":return Gn.Warning;case"error":return Gn.Error;case"critical":return Gn.Error;case"off":return Gn.Off}}const Ayt=new Q("logLevel",r3(Gn.Info));class w5{static create(e,t){return new w5(e,new RY(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new F(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new w5(this._startLineNumber,n),new w5(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=Ab(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):B.Null)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,n,o)}}class RY{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;for(;ae||u===e&&p>=t)&&(ue||p===e&&v>=t){if(po?m-=o-i:m=i;else if(f===t&&p===i)if(f===n&&m>o)m-=o-i;else{d=!0;continue}else if(fo)f=t,p=i,m=p+(m-o);else{d=!0;continue}else if(f>n){if(c===0&&!d){l=a;break}f-=c}else if(f===n&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const b=4*l;r[b]=f,r[b+1]=p,r[b+2]=m,r[b+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=B.Digit0&&r<=B.Digit9||r>=B.A&&r<=B.Z||r>=B.a&&r<=B.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=VO.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?Vo.Italic:0)<d&&i[5*w]===0;)w--;if(w-1===d){let y=h;for(;y+1L)e.warnOverlappingSemanticTokens(A,L+1);else{const G=e.getMetadata(R,z,t);G!==VO.NO_STYLING&&(p===0&&(p=A),u[f]=A-p,u[f+1]=L,u[f+2]=P,u[f+3]=G,f+=4,m=A,v=P)}c=A,l=L,a++}f!==u.length&&(u=u.subarray(0,f));const b=w5.create(p,u);r.push(b)}return r}class Eyt{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}const VC=class VC{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=VC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=VC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Lme(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Mme=D([_(0,pn),_(1,Ge),_(2,xi)],Mme);ce(aae,Mme,qt.Delayed);const I1="**",Nme="/",Tq="[/\\\\]",Lq="[^/\\\\]",xyt=/\//g;function i2e(s,e){switch(s){case 0:return"";case 1:return`${Lq}*?`;default:return`(?:${Tq}|${Lq}+${Tq}${e?`|${Tq}${Lq}+`:""})*?`}}function Pme(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function yQe(s){if(!s)return"";let e="";const t=Pme(s,Nme);if(t.every(i=>i===I1))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===I1){if(i)return;e+=i2e(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===Nme?h="":h=Rh(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${Pme(a,",").map(f=>yQe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=Lq;continue;case"*":e+=i2e(1);continue;default:e+=Rh(d)}}oyLe(a,e)).filter(a=>a!==Ny),s),i=t.length;if(!i)return Ny;if(i===1)return t[0];const n=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function r2e(s,e,t){const i=ou===Vi.sep,n=i?s:s.replace(xyt,ou),o=ou+n,r=Vi.sep+s;let a;return t?a=function(c,l){return typeof c=="string"&&(c===n||c.endsWith(o)||!i&&(c===s||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===n||!i&&c===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function Fyt(s){try{const e=new RegExp(`^${yQe(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Ny}}function zO(s,e,t){return!s||typeof e!="string"?!1:j_(s)(e,void 0,t)}function j_(s,e={}){if(!s)return s2e;if(typeof s=="string"||CQe(s)){const t=yLe(s,e);if(t===Ny)return s2e;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Oyt(s,e)}function CQe(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Oyt(s,e){const t=SQe(Object.getOwnPropertyNames(s).map(a=>Byt(a,s[a],e)).filter(a=>a!==Ny)),i=t.length;if(!i)return Ny;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let f=0,p=t.length;f{for(const f of u){const p=await f;if(typeof p=="string")return p}return null})():null},c=t.find(d=>!!d.allBasenames);c&&(a.allBasenames=c.allBasenames);const l=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return l.length&&(a.allPaths=l),a}const n=function(a,c,l){let d,h;for(let u=0,f=t.length;u{for(const u of h){const f=await u;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function Byt(s,e,t){if(e===!1)return Ny;const i=yLe(s,t);if(i===Ny)return Ny;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=n.replace("$(basename)",()=>c),h=l(d);return Qy(h)?h.then(u=>u?s:null):h?s:null};return o.requiresSiblings=!0,o}}return i}function SQe(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let n;if(e){n=[];for(let a=0,c=i.length;a{const l=c.patterns;return l?a.concat(l):a},[]);const o=function(a,c){if(typeof a!="string")return null;if(!c){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===B.Slash||h===B.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?n[l]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function cae(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const c=cae(a,e,t,i,n,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=s;if(!i&&!l)return 0;d&&n&&(e=n);let h=0;if(c)if(c===e.scheme)h=10;else if(c==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===o)h=10;else if(d==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:Rk(a.base)},u===e.fsPath||zO(u,e.fsPath))h=10;else return 0}return h}else return 0}}function AQe(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(AQe):!!s.notebookType}function EQe(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(EQe):!!s.exclusive}class a2e{constructor(e,t,i,n,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=o}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class oo{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ee(()=>{if(i){const n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}allNoModel(){return this._entries.map(e=>e.provider)}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new a2e(e.uri,e.getLanguageId(),i.uri,i.type,t):new a2e(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const o of this._entries)if(o._score=cae(o.selector,n.uri,n.languageId,Ly(e),n.notebookUri,n.notebookType),EQe(o.selector)&&o._score>0)if(t)o._score=0;else{for(const r of this._entries)r._score=0;o._score=1e3;break}this._entries.sort(oo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:nV(e.selector)&&!nV(t.selector)?1:!nV(e.selector)&&nV(t.selector)?-1:e._timet._time?-1:0}}function nV(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(nV):!!s.isBuiltin}class Wyt{constructor(){this.referenceProvider=new oo(this._score.bind(this)),this.renameProvider=new oo(this._score.bind(this)),this.newSymbolNamesProvider=new oo(this._score.bind(this)),this.codeActionProvider=new oo(this._score.bind(this)),this.definitionProvider=new oo(this._score.bind(this)),this.typeDefinitionProvider=new oo(this._score.bind(this)),this.declarationProvider=new oo(this._score.bind(this)),this.implementationProvider=new oo(this._score.bind(this)),this.documentSymbolProvider=new oo(this._score.bind(this)),this.inlayHintsProvider=new oo(this._score.bind(this)),this.colorProvider=new oo(this._score.bind(this)),this.codeLensProvider=new oo(this._score.bind(this)),this.documentFormattingEditProvider=new oo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new oo(this._score.bind(this)),this.onTypeFormattingEditProvider=new oo(this._score.bind(this)),this.signatureHelpProvider=new oo(this._score.bind(this)),this.hoverProvider=new oo(this._score.bind(this)),this.documentHighlightProvider=new oo(this._score.bind(this)),this.multiDocumentHighlightProvider=new oo(this._score.bind(this)),this.selectionRangeProvider=new oo(this._score.bind(this)),this.foldingRangeProvider=new oo(this._score.bind(this)),this.linkProvider=new oo(this._score.bind(this)),this.inlineCompletionsProvider=new oo(this._score.bind(this)),this.inlineEditProvider=new oo(this._score.bind(this)),this.completionProvider=new oo(this._score.bind(this)),this.linkedEditingRangeProvider=new oo(this._score.bind(this)),this.inlineValuesProvider=new oo(this._score.bind(this)),this.evaluatableExpressionProvider=new oo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new oo(this._score.bind(this)),this.documentSemanticTokensProvider=new oo(this._score.bind(this)),this.documentDropEditProvider=new oo(this._score.bind(this)),this.documentPasteEditProvider=new oo(this._score.bind(this)),this.mappedEditsProvider=new oo(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(it,Wyt,qt.Delayed);const ec=ae("hoverService"),mf=ae("contextViewService"),lr=ae("contextMenuService");var Hyt='.monaco-workbench .workbench-hover{background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorHoverWidget-foreground);font-size:13px;line-height:19px;max-width:700px;overflow:hidden;position:relative;z-index:40}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{pointer-events:none;position:absolute;z-index:41}.monaco-workbench .workbench-hover-pointer:after{background-color:var(--vscode-editorHoverWidget-background);border-bottom:1px solid var(--vscode-editorHoverWidget-border);border-right:1px solid var(--vscode-editorHoverWidget-border);content:"";height:5px;position:absolute;width:5px}.monaco-workbench .locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;height:4px;width:4px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;text-decoration:underline}.monaco-workbench .workbench-hover a:active,.monaco-workbench .workbench-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}';ut(Hyt,{});var Uyt='.monaco-hover{animation:fadein .1s linear;box-sizing:border-box;cursor:default;line-height:1.5em;overflow:hidden;position:absolute;user-select:text;-webkit-user-select:text;white-space:var(--vscode-hover-whiteSpace,normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){word-wrap:break-word;max-width:var(--vscode-hover-maxWidth,500px)}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover .code,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6,.monaco-hover p,.monaco-hover ul{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{border-left:0;border-right:0;box-sizing:border-box;height:1px;margin:4px -8px -4px}.monaco-hover .code:first-child,.monaco-hover p:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover .code:last-child,.monaco-hover p:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ol,.monaco-hover ul{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace,pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{cursor:pointer;margin-right:16px}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link,.monaco-hover .hover-contents a.code-link:hover{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-foreground);text-decoration:underline;text-underline-position:under}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{display:inline-block;margin-bottom:4px}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{cursor:default;opacity:.4;pointer-events:none}';ut(Uyt,{});const GG=fe;var vo;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BELOW=2]="BELOW",s[s.ABOVE=3]="ABOVE"})(vo||(vo={}));let CLe=class extends V{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new EU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class SLe extends V{static render(e,t,i){return new SLe(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=re(e,GG("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=re(this.actionContainer,GG("a.action")),this.action.setAttribute("role","button"),t.iconClass&&re(this.action,GG(`span.icon.${t.iconClass}`));const n=re(this.action,GG("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new DQe(this.actionContainer,t.run)),this._store.add(new kQe(this.actionContainer,t.run,[S.Enter,S.Space])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function xQe(s,e){return s&&e?g(6985,"Inspect this in the accessible view with {0}.",e):s?g(6986,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class DQe extends V{constructor(e,t){super(),this._register(ue(e,ke.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class kQe extends V{constructor(e,t,i){super(),this._register(ue(e,ke.KEY_DOWN,n=>{const o=new En(n);i.some(r=>o.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var Md;(function(s){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),c=Math.min(o.end,r.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(o,r){const a=[],c={start:o.start,end:Math.min(r.start,o.end)},l={start:Math.max(r.end,o.start),end:o.end};return t(c)||a.push(c),t(l)||a.push(l),a}s.relativeComplement=n})(Md||(Md={}));var Vyt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";ut(Vyt,{});var zw;(function(s){s[s.ABSOLUTE=1]="ABSOLUTE",s[s.FIXED=2]="FIXED",s[s.FIXED_SHADOW=3]="FIXED_SHADOW"})(zw||(zw={}));function zyt(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var vb;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(vb||(vb={}));var Vf;(function(s){s[s.BELOW=0]="BELOW",s[s.ABOVE=1]="ABOVE"})(Vf||(Vf={}));var NY;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(NY||(NY={}));var Mf;(function(s){s[s.Before=0]="Before",s[s.After=1]="After"})(Mf||(Mf={}));var Ex;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Ex||(Ex={}));function cF(s,e,t){const i=t.mode===Ex.ALIGN?t.offset:t.offset+t.size,n=t.mode===Ex.ALIGN?t.offset+t.size:t.offset;return t.position===Mf.Before?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}const jF=class jF extends V{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=V.None,this.toDisposeOnSetContainer=V.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=fe(".context-view"),zd(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,zw.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==zw.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===zw.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=fe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=$yt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fe("slot"))}else this.container.appendChild(this.view);const n=new Z;jF.BUBBLE_UP_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),jF.BUBBLE_DOWN_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Ms(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Yh(this.view),this.toDisposeOnClean=e.render(this.view)||V.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(dm&&kO.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Yr(e)){const u=Cr(e),f=VGe(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else zyt(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=Pd(this.view),n=fb(this.view),o=this.delegate.anchorPosition||Vf.BELOW,r=this.delegate.anchorAlignment||vb.LEFT,a=this.delegate.anchorAxisAlignment||NY.VERTICAL;let c,l;const d=ky();if(a===NY.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Vf.BELOW?Mf.Before:Mf.After},f={offset:t.left,size:t.width,position:r===vb.LEFT?Mf.Before:Mf.After,mode:Ex.ALIGN};c=cF(d.innerHeight,n,u)+d.pageYOffset,Md.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(f.mode=Ex.AVOID),l=cF(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===vb.LEFT?Mf.Before:Mf.After},f={offset:t.top,size:t.height,position:o===Vf.BELOW?Mf.Before:Mf.After,mode:Ex.ALIGN};l=cF(d.innerWidth,i,u),Md.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Ex.AVOID),c=cF(d.innerHeight,n,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Vf.BELOW?"bottom":"top"),this.view.classList.add(r===vb.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=Cr(this.container);this.view.style.top=`${c-(this.useFixedPosition?Cr(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?Cr(this.view).left:h.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),zd(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,ct(e).document.activeElement):t&&!wc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};jF.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],jF.BUBBLE_DOWN_EVENTS=["click"];let Fme=jF;const $yt=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -156,50 +157,50 @@ Received: '{1}'.`,e,e5.getLexeme(t)),o=t.offset,r=e5.getLexeme(t);return this._p :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`,fr=ae("openerService");function HSt(n,e={}){const t=_Ne(e);return t.textContent=n,t}function mNe(n,e={}){const t=_Ne(e);return UYe(t,VSt(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function _Ne(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class USt{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}var za;(function(n){n[n.Invalid=0]="Invalid",n[n.Root=1]="Root",n[n.Text=2]="Text",n[n.Bold=3]="Bold",n[n.Italics=4]="Italics",n[n.Action=5]="Action",n[n.ActionClose=6]="ActionClose",n[n.Code=7]="Code",n[n.NewLine=8]="NewLine"})(za||(za={}));function UYe(n,e,t,i){let s;if(e.type===za.Text)s=document.createTextNode(e.content||"");else if(e.type===za.Bold)s=document.createElement("b");else if(e.type===za.Italics)s=document.createElement("i");else if(e.type===za.Code&&i)s=document.createElement("code");else if(e.type===za.Action&&t){const o=document.createElement("a");t.disposables.add(Xo(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===za.NewLine?s=document.createElement("br"):e.type===za.Root&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{UYe(s,o,t,i)})}function VSt(n,e){const t={type:za.Root,children:[]};let i=0,s=t;const o=[],r=new USt(n);for(;!r.eos();){let a=r.next();const c=a==="\\"&&Kwe(r.peek(),e)!==za.Invalid;if(c&&(a=r.next()),!c&&zSt(a,e)&&a===r.peek()){r.advance(),s.type===za.Text&&(s=o.pop());const l=Kwe(a,e);if(s.type===l||s.type===za.Action&&l===za.ActionClose)s=o.pop();else{const d={type:l,children:[]};l===za.Action&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` -`)s.type===za.Text&&(s=o.pop()),s.children.push({type:za.NewLine});else if(s.type!==za.Text){const l={type:za.Text,content:a};s.children.push(l),o.push(s),s=l}else s.content+=a}return s.type===za.Text&&(s=o.pop()),t}function zSt(n,e){return Kwe(n,e)!==za.Invalid}function Kwe(n,e){switch(n){case"*":return za.Bold;case"_":return za.Italics;case"[":return za.Action;case"]":return za.ActionClose;case"`":return e?za.Code:za.Invalid;default:return za.Invalid}}const $St=new RegExp(`(\\\\)?\\$\\((${$e.iconNameExpression}(?:${$e.iconModifierExpression})?)\\)`,"g");function nw(n){const e=new Array;let t,i=0,s=0;for(;(t=$St.exec(n))!==null;){s=t.index||0,i0)return new Uint32Array(e)}let Mp=0;const bk=new Uint32Array(10);function qSt(n){if(Mp=0,vC(n,yfe,Nd.InitialConsonant),Mp>0||(vC(n,Sfe,Nd.Vowel),Mp>0)||(vC(n,Afe,Nd.FinalConsonant),Mp>0)||(vC(n,CL,Nd.CompatibilityJamo),Mp))return bk.subarray(0,Mp);if(n>=44032&&n<=55203){const e=n-44032,t=e%588,i=Math.floor(e/588),s=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return bk.subarray(0,Mp)}}function vC(n,e,t){n>=t&&n>8&&(bk[Mp++]=n>>8&255),n>>16&&(bk[Mp++]=n>>16&255))}var Nd;(function(n){n[n.InitialConsonant=4352]="InitialConsonant",n[n.Vowel=4449]="Vowel",n[n.FinalConsonant=4520]="FinalConsonant",n[n.CompatibilityJamo=12593]="CompatibilityJamo"})(Nd||(Nd={}));var Gt;(function(n){n[n.NUL=0]="NUL",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z"})(Gt||(Gt={}));var So;(function(n){n[n.fa=24934]="fa",n[n.fg=26470]="fg",n[n.fq=29030]="fq",n[n.fr=29286]="fr",n[n.ft=29798]="ft",n[n.fv=30310]="fv",n[n.fx=30822]="fx",n[n.hk=27496]="hk",n[n.hl=27752]="hl",n[n.ho=28520]="ho",n[n.ml=27757]="ml",n[n.nj=27246]="nj",n[n.nl=27758]="nl",n[n.np=28782]="np",n[n.qt=29809]="qt",n[n.rt=29810]="rt",n[n.sg=26483]="sg",n[n.sw=30579]="sw"})(So||(So={}));const yfe=new Uint8Array([Gt.r,Gt.R,Gt.s,Gt.e,Gt.E,Gt.f,Gt.a,Gt.q,Gt.Q,Gt.t,Gt.T,Gt.d,Gt.w,Gt.W,Gt.c,Gt.z,Gt.x,Gt.v,Gt.g]),Sfe=new Uint16Array([Gt.k,Gt.o,Gt.i,Gt.O,Gt.j,Gt.p,Gt.u,Gt.P,Gt.h,So.hk,So.ho,So.hl,Gt.y,Gt.n,So.nj,So.np,So.nl,Gt.b,Gt.m,So.ml,Gt.l]),Afe=new Uint16Array([Gt.r,Gt.R,So.rt,Gt.s,So.sw,So.sg,Gt.e,Gt.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,Gt.a,Gt.q,So.qt,Gt.t,Gt.T,Gt.d,Gt.w,Gt.c,Gt.z,Gt.x,Gt.v,Gt.g]),CL=new Uint16Array([Gt.r,Gt.R,So.rt,Gt.s,So.sw,So.sg,Gt.e,Gt.E,Gt.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,Gt.a,Gt.q,Gt.Q,So.qt,Gt.t,Gt.T,Gt.d,Gt.w,Gt.W,Gt.c,Gt.z,Gt.x,Gt.v,Gt.g,Gt.k,Gt.o,Gt.i,Gt.O,Gt.j,Gt.p,Gt.u,Gt.P,Gt.h,So.hk,So.ho,So.hl,Gt.y,Gt.n,So.nj,So.np,So.nl,Gt.b,Gt.m,So.ml,Gt.l]);function KU(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function pde(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function zYe(n,e){return Ywe(n.toLowerCase(),e.toLowerCase(),0,0)}function Ywe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=Ywe(n,e,t+1,i+1))?bNe({start:i,end:i+1},s):null}return Ywe(n,e,t,i+1)}function vNe(n){return Q.a<=n&&n<=Q.z}function pQ(n){return Q.A<=n&&n<=Q.Z}function wNe(n){return Q.Digit0<=n&&n<=Q.Digit9}function $Ye(n){return n===Q.Space||n===Q.Tab||n===Q.LineFeed||n===Q.CarriageReturn}const GYe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>GYe.add(n.charCodeAt(0)));function cee(n){return $Ye(n)||GYe.has(n)}function LHe(n,e){return n===e||cee(n)&&cee(e)}const Efe=new Map;function THe(n){if(Efe.has(n))return Efe.get(n);let e;const t=GSt(n);return t&&(e=t),Efe.set(n,e),e}function qYe(n){return vNe(n)||pQ(n)||wNe(n)}function bNe(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function QYe(n,e){for(let t=e;t0&&!qYe(n.charCodeAt(t-1)))return t}return n.length}function Jwe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=Jwe(n,e,t+1,i+1);!s&&(o=QYe(e,o)).6}function YSt(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function JSt(n){let e=0,t=0,i=0,s=0;for(let o=0;o60&&(e=e.substring(0,60));const t=jSt(e);if(!YSt(t)){if(!KSt(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&cee(n.charCodeAt(t-1)))return t;return n.length}const XSt=KU(dF,lee,pde),ZSt=KU(dF,lee,zYe),RHe=new L_(1e4);function dee(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=RHe.get(n);i||(i=new RegExp(Rlt(n),"i"),RHe.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?ZSt(n,e):XSt(n,e)}function KYe(n,e){const t=v1(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?Cz(t):null}function eAt(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const jk=128;function CNe(){const n=[],e=[];for(let t=0;t<=jk;t++)e[t]=0;for(let t=0;t<=jk;t++)n.push(e.slice(0));return n}function YYe(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const JYe=YYe(2*jk),Zwe=YYe(2*jk),lA=CNe(),yL=CNe(),Kj=CNe();function Yj(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case Q.Underline:case Q.Dash:case Q.Period:case Q.Space:case Q.Slash:case Q.Backslash:case Q.SingleQuote:case Q.DoubleQuote:case Q.Colon:case Q.DollarSign:case Q.LessThan:case Q.GreaterThan:case Q.OpenParen:case Q.CloseParen:case Q.OpenSquareBracket:case Q.CloseSquareBracket:case Q.OpenCurlyBrace:case Q.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!XRe(t)}}function MHe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case Q.Space:case Q.Tab:return!0;default:return!1}}function cJ(n,e,t){return e[n]!==t[n]}function XYe(n,e,t,i,s,o,r=!1){for(;ejk?jk:n.length,c=i.length>jk?jk:i.length;if(t>=a||o>=c||a-t>c-o||!XYe(e,t,a,s,o,c,!0))return;tAt(a,c,t,o,e,s);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hb,N=F?yL[l][d-1]+(lA[l][d-1]>0?-5:0):0,z=u>b+1&&lA[l][d-1]>0,U=z?yL[l][d-2]+(lA[l][d-2]>0?-5:0):0;if(z&&(!F||U>=N)&&(!M||U>=k))yL[l][d]=U,Kj[l][d]=IT.LeftLeft,lA[l][d]=0;else if(F&&(!M||N>=k))yL[l][d]=N,Kj[l][d]=IT.Left,lA[l][d]=0;else if(M)yL[l][d]=k,Kj[l][d]=IT.Diag,lA[l][d]=lA[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[yL[l][d],o];let m=0,v=0;for(;l>=1;){let b=d;do{const C=Kj[l][b];if(C===IT.LeftLeft)b=b-2;else if(C===IT.Left)b=b-1;else break}while(b>=1);m>1&&e[t+l-1]===s[o+d-1]&&!cJ(b+o-1,i,s)&&m+1>lA[l][b]&&(b=d),b===d?m++:m=1,v||(v=b),l--,d=b-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const w=v-a;return p[0]-=w,p}function tAt(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(Zwe[r]=a,r--),a--}function iAt(n,e,t,i,s,o,r,a,c,l,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=n[t]===s[r]?7:5:cJ(r,s,o)&&(r===0||!cJ(r-1,s,o))?(h=n[t]===s[r]?7:5,u=!0):Yj(o,r)&&(r===0||!Yj(o,r-1))?h=5:(Yj(o,r-1)||MHe(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=cJ(r,s,o)||Yj(o,r-1)||MHe(o,r-1)),t===i?r>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function nAt(n,e,t,i,s,o,r){return sAt(n,e,t,i,s,o,!0,r)}function sAt(n,e,t,i,s,o,r,a){let c=v1(n,e,t,i,s,o,a);if(c&&!r)return c;if(n.length>=3){const l=Math.min(7,n.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function oAt(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const rAt="$(",yNe=new RegExp(`\\$\\(${$e.iconNameExpression}(?:${$e.iconModifierExpression})?\\)`,"g"),aAt=new RegExp(`(\\\\)?${yNe.source}`,"g");function cAt(n){return n.replace(aAt,(e,t)=>t?e:`\\${e}`)}const lAt=new RegExp(`\\\\${yNe.source}`,"g");function dAt(n){return n.replace(lAt,e=>`\\${e}`)}const hAt=new RegExp(`(\\s)?(\\\\)?${yNe.source}(\\s)?`,"g");function mde(n){return n.indexOf(rAt)===-1?n:n.replace(hAt,(e,t,i,s)=>i?e:t||s||"")}function ZYe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const xfe=new RegExp(`\\$\\(${$e.iconNameCharacter}+\\)`,"g");function n2(n){xfe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=xfe.lastIndex,o=xfe.exec(n),r=n.substring(s,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===hee.Break?`\\ +`,Ao=ae("openerService");function Gyt(s,e={}){const t=ELe(e);return t.textContent=s,t}function ALe(s,e={}){const t=ELe(e);return IQe(t,qyt(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function ELe(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class Kyt{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}var ma;(function(s){s[s.Invalid=0]="Invalid",s[s.Root=1]="Root",s[s.Text=2]="Text",s[s.Bold=3]="Bold",s[s.Italics=4]="Italics",s[s.Action=5]="Action",s[s.ActionClose=6]="ActionClose",s[s.Code=7]="Code",s[s.NewLine=8]="NewLine"})(ma||(ma={}));function IQe(s,e,t,i){let n;if(e.type===ma.Text)n=document.createTextNode(e.content||"");else if(e.type===ma.Bold)n=document.createElement("b");else if(e.type===ma.Italics)n=document.createElement("i");else if(e.type===ma.Code&&i)n=document.createElement("code");else if(e.type===ma.Action&&t){const o=document.createElement("a");t.disposables.add(Ro(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===ma.NewLine?n=document.createElement("br"):e.type===ma.Root&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{IQe(n,o,t,i)})}function qyt(s,e){const t={type:ma.Root,children:[]};let i=0,n=t;const o=[],r=new Kyt(s);for(;!r.eos();){let a=r.next();const c=a==="\\"&&Ome(r.peek(),e)!==ma.Invalid;if(c&&(a=r.next()),!c&&Qyt(a,e)&&a===r.peek()){r.advance(),n.type===ma.Text&&(n=o.pop());const l=Ome(a,e);if(n.type===l||n.type===ma.Action&&l===ma.ActionClose)n=o.pop();else{const d={type:l,children:[]};l===ma.Action&&(d.index=i,i++),n.children.push(d),o.push(n),n=d}}else if(a===` +`)n.type===ma.Text&&(n=o.pop()),n.children.push({type:ma.NewLine});else if(n.type!==ma.Text){const l={type:ma.Text,content:a};n.children.push(l),o.push(n),n=l}else n.content+=a}return n.type===ma.Text&&(n=o.pop()),t}function Qyt(s,e){return Ome(s,e)!==ma.Invalid}function Ome(s,e){switch(s){case"*":return ma.Bold;case"_":return ma.Italics;case"[":return ma.Action;case"]":return ma.ActionClose;case"`":return e?ma.Code:ma.Invalid;default:return ma.Invalid}}const jyt=new RegExp(`(\\\\)?\\$\\((${We.iconNameExpression}(?:${We.iconModifierExpression})?)\\)`,"g");function Eb(s){const e=new Array;let t,i=0,n=0;for(;(t=jyt.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let If=0;const ZE=new Uint32Array(10);function Jyt(s){if(If=0,qb(s,hhe,Bl.InitialConsonant),If>0||(qb(s,uhe,Bl.Vowel),If>0)||(qb(s,ghe,Bl.FinalConsonant),If>0)||(qb(s,OI,Bl.CompatibilityJamo),If))return ZE.subarray(0,If);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return ZE.subarray(0,If)}}function qb(s,e,t){s>=t&&s>8&&(ZE[If++]=s>>8&255),s>>16&&(ZE[If++]=s>>16&255))}var Bl;(function(s){s[s.InitialConsonant=4352]="InitialConsonant",s[s.Vowel=4449]="Vowel",s[s.FinalConsonant=4520]="FinalConsonant",s[s.CompatibilityJamo=12593]="CompatibilityJamo"})(Bl||(Bl={}));var $t;(function(s){s[s.NUL=0]="NUL",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z"})($t||($t={}));var co;(function(s){s[s.fa=24934]="fa",s[s.fg=26470]="fg",s[s.fq=29030]="fq",s[s.fr=29286]="fr",s[s.ft=29798]="ft",s[s.fv=30310]="fv",s[s.fx=30822]="fx",s[s.hk=27496]="hk",s[s.hl=27752]="hl",s[s.ho=28520]="ho",s[s.ml=27757]="ml",s[s.nj=27246]="nj",s[s.nl=27758]="nl",s[s.np=28782]="np",s[s.qt=29809]="qt",s[s.rt=29810]="rt",s[s.sg=26483]="sg",s[s.sw=30579]="sw"})(co||(co={}));const hhe=new Uint8Array([$t.r,$t.R,$t.s,$t.e,$t.E,$t.f,$t.a,$t.q,$t.Q,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g]),uhe=new Uint16Array([$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]),ghe=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,co.qt,$t.t,$t.T,$t.d,$t.w,$t.c,$t.z,$t.x,$t.v,$t.g]),OI=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.E,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,$t.Q,co.qt,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g,$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]);function q2(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function lae(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function LQe(s,e){return Bme(s.toLowerCase(),e.toLowerCase(),0,0)}function Bme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=Bme(s,e,t+1,i+1))?kLe({start:i,end:i+1},n):null}return Bme(s,e,t,i+1)}function xLe(s){return B.a<=s&&s<=B.z}function g6(s){return B.A<=s&&s<=B.Z}function DLe(s){return B.Digit0<=s&&s<=B.Digit9}function RQe(s){return s===B.Space||s===B.Tab||s===B.LineFeed||s===B.CarriageReturn}const MQe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>MQe.add(s.charCodeAt(0)));function PY(s){return RQe(s)||MQe.has(s)}function c2e(s,e){return s===e||PY(s)&&PY(e)}const fhe=new Map;function l2e(s){if(fhe.has(s))return fhe.get(s);let e;const t=Yyt(s);return t&&(e=t),fhe.set(s,e),e}function NQe(s){return xLe(s)||g6(s)||DLe(s)}function kLe(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function PQe(s,e){for(let t=e;t0&&!NQe(s.charCodeAt(t-1)))return t}return s.length}function Wme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=Wme(s,e,t+1,i+1);!n&&(o=PQe(e,o)).6}function tCt(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function iCt(s){let e=0,t=0,i=0,n=0;for(let o=0;o60&&(e=e.substring(0,60));const t=Zyt(e);if(!tCt(t)){if(!eCt(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&PY(s.charCodeAt(t-1)))return t;return s.length}const nCt=q2(CM,FY,lae),sCt=q2(CM,FY,LQe),d2e=new um(1e4);function OY(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=d2e.get(s);i||(i=new RegExp(lat(s),"i"),d2e.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?sCt(s,e):nCt(s,e)}function OQe(s,e){const t=Uk(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?xU(t):null}function oCt(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const xx=128;function ILe(){const s=[],e=[];for(let t=0;t<=xx;t++)e[t]=0;for(let t=0;t<=xx;t++)s.push(e.slice(0));return s}function BQe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const WQe=BQe(2*xx),Ume=BQe(2*xx),bC=ILe(),BI=ILe(),KG=ILe();function qG(s,e){if(e<0||e>=s.length)return!1;const t=s.codePointAt(e);switch(t){case B.Underline:case B.Dash:case B.Period:case B.Space:case B.Slash:case B.Backslash:case B.SingleQuote:case B.DoubleQuote:case B.Colon:case B.DollarSign:case B.LessThan:case B.GreaterThan:case B.OpenParen:case B.CloseParen:case B.OpenSquareBracket:case B.CloseSquareBracket:case B.OpenCurlyBrace:case B.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!Z1e(t)}}function h2e(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case B.Space:case B.Tab:return!0;default:return!1}}function Rq(s,e,t){return e[s]!==t[s]}function HQe(s,e,t,i,n,o,r=!1){for(;exx?xx:s.length,c=i.length>xx?xx:i.length;if(t>=a||o>=c||a-t>c-o||!HQe(e,t,a,n,o,c,!0))return;rCt(a,c,t,o,e,n);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hw,R=P?BI[l][d-1]+(bC[l][d-1]>0?-5:0):0,z=u>w+1&&bC[l][d-1]>0,G=z?BI[l][d-2]+(bC[l][d-2]>0?-5:0):0;if(z&&(!P||G>=R)&&(!L||G>=k))BI[l][d]=G,KG[l][d]=q0.LeftLeft,bC[l][d]=0;else if(P&&(!L||R>=k))BI[l][d]=R,KG[l][d]=q0.Left,bC[l][d]=0;else if(L)BI[l][d]=k,KG[l][d]=q0.Diag,bC[l][d]=bC[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[BI[l][d],o];let m=0,v=0;for(;l>=1;){let w=d;do{const y=KG[l][w];if(y===q0.LeftLeft)w=w-2;else if(y===q0.Left)w=w-1;else break}while(w>=1);m>1&&e[t+l-1]===n[o+d-1]&&!Rq(w+o-1,i,n)&&m+1>bC[l][w]&&(w=d),w===d?m++:m=1,v||(v=w),l--,d=w-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const b=v-a;return p[0]-=b,p}function rCt(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(Ume[r]=a,r--),a--}function aCt(s,e,t,i,n,o,r,a,c,l,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=s[t]===n[r]?7:5:Rq(r,n,o)&&(r===0||!Rq(r-1,n,o))?(h=s[t]===n[r]?7:5,u=!0):qG(o,r)&&(r===0||!qG(o,r-1))?h=5:(qG(o,r-1)||h2e(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=Rq(r,n,o)||qG(o,r-1)||h2e(o,r-1)),t===i?r>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function cCt(s,e,t,i,n,o,r){return lCt(s,e,t,i,n,o,!0,r)}function lCt(s,e,t,i,n,o,r,a){let c=Uk(s,e,t,i,n,o,a);if(c&&!r)return c;if(s.length>=3){const l=Math.min(7,s.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function dCt(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const hCt="$(",TLe=new RegExp(`\\$\\(${We.iconNameExpression}(?:${We.iconModifierExpression})?\\)`,"g"),uCt=new RegExp(`(\\\\)?${TLe.source}`,"g");function gCt(s){return s.replace(uCt,(e,t)=>t?e:`\\${e}`)}const fCt=new RegExp(`\\\\${TLe.source}`,"g");function pCt(s){return s.replace(fCt,e=>`\\${e}`)}const mCt=new RegExp(`(\\s)?(\\\\)?${TLe.source}(\\s)?`,"g");function dae(s){return s.indexOf(hCt)===-1?s:s.replace(mCt,(e,t,i,n)=>i?e:t||n||"")}function UQe(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const phe=new RegExp(`\\$\\(${We.iconNameCharacter}+\\)`,"g");function lF(s){phe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=phe.lastIndex,o=phe.exec(s),r=s.substring(n,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===BY.Break?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` -${gAt(t,e)} -`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Iu(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}};function YU(n){return ah(n)?!n.value:Array.isArray(n)?n.every(YU):!0}function ah(n){return n instanceof Xt?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function uAt(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&_n(P.from(n.baseUri),P.from(e.baseUri)))}function b3(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function gAt(n,e){const t=n.match(/^`+/gm)?.reduce((s,o)=>s.length>o.length?s:o).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,n,`${"`".repeat(i)}`].join(` -`)}function Jj(n){return n.replace(/"/g,""")}function Dfe(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function eJe(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",c=isFinite(parseInt(a)),l=isFinite(parseInt(r));c&&e.push(`width="${a}"`),l&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}class yz{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const ebe=new yz("id#");var mO={exports:{}};function NHe(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function fAt(n){mO.exports.defaults=n}mO.exports={defaults:NHe(),getDefaults:NHe,changeDefaults:fAt};const pAt=/[&<>"']/,mAt=/[&<>"']/g,_At=/[<>"']|&(?!#?\w+;)/,vAt=/[<>"']|&(?!#?\w+;)/g,wAt={"&":"&","<":"<",">":">",'"':""","'":"'"},PHe=n=>wAt[n];function bAt(n,e){if(e){if(pAt.test(n))return n.replace(mAt,PHe)}else if(_At.test(n))return n.replace(vAt,PHe);return n}const CAt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function tJe(n){return n.replace(CAt,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const yAt=/(^|[^\[])\^/g;function SAt(n,e){n=n.source||n,e=e||"";const t={replace:(i,s)=>(s=s.source||s,s=s.replace(yAt,"$1"),n=n.replace(i,s),t),getRegex:()=>new RegExp(n,e)};return t}const AAt=/[^\w:]/g,EAt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function xAt(n,e,t){if(n){let i;try{i=decodeURIComponent(tJe(t)).replace(AAt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!EAt.test(t)&&(t=iJe(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Xj={},DAt=/^[^:]+:\/*[^/]*$/,kAt=/^([^:]+:)[\s\S]*$/,IAt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function iJe(n,e){Xj[" "+n]||(DAt.test(n)?Xj[" "+n]=n+"/":Xj[" "+n]=nJe(n,"/",!0)),n=Xj[" "+n];const t=n.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:n.replace(kAt,"$1")+e:e.charAt(0)==="/"?t?e:n.replace(IAt,"$1")+e:n+e}const LAt={exec:function(){}};function TAt(n){let e=1,t,i;for(;e{let c=!1,l=r;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=t.split(/ \|/);let s=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>e)i.splice(e);else for(;i.length1;)e&1&&(t+=n),e>>=1,n+=n;return t+n}var Sz={escape:bAt,unescape:tJe,edit:SAt,cleanUrl:xAt,resolveUrl:iJe,noopTest:LAt,merge:TAt,splitCells:RAt,rtrim:nJe,findClosingBracket:MAt,checkSanitizeDeprecation:NAt,repeatString:PAt};const{defaults:FAt}=mO.exports,{rtrim:kfe,splitCells:FHe,escape:nv,findClosingBracket:OAt}=Sz;function OHe(n,e,t,i){const s=e.href,o=e.title?nv(e.title):null,r=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){i.state.inLink=!0;const a={type:"link",raw:t,href:s,title:o,text:r,tokens:i.inlineTokens(r,[])};return i.state.inLink=!1,a}else return{type:"image",raw:t,href:s,title:o,text:nv(r)}}function BAt(n,e){const t=n.match(/^(\s+)(?:```)/);if(t===null)return e;const i=t[1];return e.split(` -`).map(s=>{const o=s.match(/^\s+/);if(o===null)return s;const[r]=o;return r.length>=i.length?s.slice(i.length):s}).join(` -`)}var sJe=class{constructor(e){this.options=e||FAt}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:` -`}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:kfe(i,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],s=BAt(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const o=kfe(i,"#");(this.options.pedantic||!o||/ $/.test(o))&&(i=o.trim())}const s={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(s.text,s.tokens),s}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,s,o,r,a,c,l,d,h,u,f=t[1].trim();const p=f.length>1,m={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=p?f:"[*+-]");const v=new RegExp(`^( {0,3}${f})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!(this.rules.block.hr.test(e)||!(t=v.exec(e)));){h=t[2].split(` +${vCt(t,e)} +`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Rh(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}};function Q2(s){return dd(s)?!s.value:Array.isArray(s)?s.every(Q2):!0}function dd(s){return s instanceof Mt?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function _Ct(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&ji(N.from(s.baseUri),N.from(e.baseUri)))}function sV(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function vCt(s,e){const t=s.match(/^`+/gm)?.reduce((n,o)=>n.length>o.length?n:o).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,s,`${"`".repeat(i)}`].join(` +`)}function QG(s){return s.replace(/"/g,""")}function mhe(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function VQe(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",c=isFinite(parseInt(a)),l=isFinite(parseInt(r));c&&e.push(`width="${a}"`),l&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class DU{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const Vme=new DU("id#");var MN={exports:{}};function u2e(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function bCt(s){MN.exports.defaults=s}MN.exports={defaults:u2e(),getDefaults:u2e,changeDefaults:bCt};const wCt=/[&<>"']/,yCt=/[&<>"']/g,CCt=/[<>"']|&(?!#?\w+;)/,SCt=/[<>"']|&(?!#?\w+;)/g,ACt={"&":"&","<":"<",">":">",'"':""","'":"'"},g2e=s=>ACt[s];function ECt(s,e){if(e){if(wCt.test(s))return s.replace(yCt,g2e)}else if(CCt.test(s))return s.replace(SCt,g2e);return s}const xCt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function zQe(s){return s.replace(xCt,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const DCt=/(^|[^\[])\^/g;function kCt(s,e){s=s.source||s,e=e||"";const t={replace:(i,n)=>(n=n.source||n,n=n.replace(DCt,"$1"),s=s.replace(i,n),t),getRegex:()=>new RegExp(s,e)};return t}const ICt=/[^\w:]/g,TCt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function LCt(s,e,t){if(s){let i;try{i=decodeURIComponent(zQe(t)).replace(ICt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!TCt.test(t)&&(t=$Qe(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const jG={},RCt=/^[^:]+:\/*[^/]*$/,MCt=/^([^:]+:)[\s\S]*$/,NCt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $Qe(s,e){jG[" "+s]||(RCt.test(s)?jG[" "+s]=s+"/":jG[" "+s]=GQe(s,"/",!0)),s=jG[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(MCt,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(NCt,"$1")+e:s+e}const PCt={exec:function(){}};function FCt(s){let e=1,t,i;for(;e{let c=!1,l=r;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>e)i.splice(e);else for(;i.length1;)e&1&&(t+=s),e>>=1,s+=s;return t+s}var kU={escape:ECt,unescape:zQe,edit:kCt,cleanUrl:LCt,resolveUrl:$Qe,noopTest:PCt,merge:FCt,splitCells:OCt,rtrim:GQe,findClosingBracket:BCt,checkSanitizeDeprecation:WCt,repeatString:HCt};const{defaults:UCt}=MN.exports,{rtrim:_he,splitCells:f2e,escape:Vm,findClosingBracket:VCt}=kU;function p2e(s,e,t,i){const n=e.href,o=e.title?Vm(e.title):null,r=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){i.state.inLink=!0;const a={type:"link",raw:t,href:n,title:o,text:r,tokens:i.inlineTokens(r,[])};return i.state.inLink=!1,a}else return{type:"image",raw:t,href:n,title:o,text:Vm(r)}}function zCt(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const i=t[1];return e.split(` +`).map(n=>{const o=n.match(/^\s+/);if(o===null)return n;const[r]=o;return r.length>=i.length?n.slice(i.length):n}).join(` +`)}var KQe=class{constructor(e){this.options=e||UCt}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:` +`}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:_he(i,` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=zCt(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const o=_he(i,"#");(this.options.pedantic||!o||/ $/.test(o))&&(i=o.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,o,r,a,c,l,d,h,u,f=t[1].trim();const p=f.length>1,m={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=p?f:"[*+-]");const v=new RegExp(`^( {0,3}${f})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!(this.rules.block.hr.test(e)||!(t=v.exec(e)));){h=t[2].split(` `),this.options.pedantic?(r=2,u=h[0].trimLeft()):(r=t[2].search(/[^ ]/),r=t[1].length+(r>4?1:r),u=h[0].slice(r-t[1].length)),c=!1,i=t[0],!h[0]&&/^ *$/.test(h[1])&&(i=t[1]+h.slice(0,2).join(` `)+` -`,m.loose=!0,h=[]);const b=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(a=1;a=r?u+=` `+d.slice(r):u+=` `+d;continue}if(d.search(/[^ ]/)>=r||!d.trim()){u+=` `+d.slice(r);continue}else{i=t[1]+h.slice(0,a).join(` `)+` -`;break}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(u),s&&(o=s[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!s,checked:o,loose:!1,text:u}),m.raw+=i,e=e.slice(i.length)}m.items[m.items.length-1].raw=i.trimRight(),m.items[m.items.length-1].text=u.trimRight(),m.raw=m.raw.trimRight();const w=m.items.length;for(a=0;ab.type==="space")&&(m.loose=!0,m.items[a].loose=!0);return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const i={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};return this.options.sanitize&&(i.type="paragraph",i.text=this.options.sanitizer?this.options.sanitizer(t[0]):nv(t[0]),i.tokens=[],this.lexer.inline(i.text,i.tokens)),i}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const i={type:"table",header:FHe(t[1]).map(s=>({text:s})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split(` -`):[]};if(i.header.length===i.align.length){i.raw=t[0];let s=i.align.length,o,r,a,c;for(o=0;o({text:l}));for(s=i.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):nv(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=kfe(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=OAt(t[2],"()");if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);r&&(s=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^$/.test(i)?s=s.slice(1):s=s.slice(1,-1)),OHe(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s||!s.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return OHe(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s||s[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=s[1]||s[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=s[0].length-1;let a,c,l=r,d=0;const h=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(s=h.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(c=a.length,s[3]||s[4]){l+=c;continue}else if((s[5]||s[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(l-=c,l>0)continue;if(c=Math.min(c,c+l+d),Math.min(r,c)%2){const f=e.slice(1,r+s.index+c);return{type:"em",raw:e.slice(0,r+s.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+s.index+c-1);return{type:"strong",raw:e.slice(0,r+s.index+c+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const s=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return s&&o&&(i=i.substring(1,i.length-1)),i=nv(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let s,o;return i[2]==="@"?(s=nv(this.options.mangle?t(i[1]):i[1]),o="mailto:"+s):(s=nv(i[1]),o=s),{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let s,o;if(i[2]==="@")s=nv(this.options.mangle?t(i[0]):i[0]),o="mailto:"+s;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);s=nv(i[0]),i[1]==="www."?o="http://"+s:o=s}return{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let s;return this.lexer.state.inRawBlock?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):nv(i[0]):i[0]:s=nv(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:s}}}};const{noopTest:uee,edit:Xc,merge:_O}=Sz,qs={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:uee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};qs._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;qs._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;qs.def=Xc(qs.def).replace("label",qs._label).replace("title",qs._title).getRegex();qs.bullet=/(?:[*+-]|\d{1,9}[.)])/;qs.listItemStart=Xc(/^( *)(bull) */).replace("bull",qs.bullet).getRegex();qs.list=Xc(qs.list).replace(/bull/g,qs.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+qs.def.source+")").getRegex();qs._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";qs._comment=/|$)/;qs.html=Xc(qs.html,"i").replace("comment",qs._comment).replace("tag",qs._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();qs.paragraph=Xc(qs._paragraph).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.blockquote=Xc(qs.blockquote).replace("paragraph",qs.paragraph).getRegex();qs.normal=_O({},qs);qs.gfm=_O({},qs.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});qs.gfm.table=Xc(qs.gfm.table).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.pedantic=_O({},qs.normal,{html:Xc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qs._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uee,paragraph:Xc(qs.normal._paragraph).replace("hr",qs.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",qs.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const sn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:uee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:uee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";sn.punctuation=Xc(sn.punctuation).replace(/punctuation/g,sn._punctuation).getRegex();sn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;sn.escapedEmSt=/\\\*|\\_/g;sn._comment=Xc(qs._comment).replace("(?:-->|$)","-->").getRegex();sn.emStrong.lDelim=Xc(sn.emStrong.lDelim).replace(/punct/g,sn._punctuation).getRegex();sn.emStrong.rDelimAst=Xc(sn.emStrong.rDelimAst,"g").replace(/punct/g,sn._punctuation).getRegex();sn.emStrong.rDelimUnd=Xc(sn.emStrong.rDelimUnd,"g").replace(/punct/g,sn._punctuation).getRegex();sn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;sn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;sn._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;sn.autolink=Xc(sn.autolink).replace("scheme",sn._scheme).replace("email",sn._email).getRegex();sn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;sn.tag=Xc(sn.tag).replace("comment",sn._comment).replace("attribute",sn._attribute).getRegex();sn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;sn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;sn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;sn.link=Xc(sn.link).replace("label",sn._label).replace("href",sn._href).replace("title",sn._title).getRegex();sn.reflink=Xc(sn.reflink).replace("label",sn._label).getRegex();sn.reflinkSearch=Xc(sn.reflinkSearch,"g").replace("reflink",sn.reflink).replace("nolink",sn.nolink).getRegex();sn.normal=_O({},sn);sn.pedantic=_O({},sn.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xc(/^!?\[(label)\]\((.*?)\)/).replace("label",sn._label).getRegex(),reflink:Xc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sn._label).getRegex()});sn.gfm=_O({},sn.normal,{escape:Xc(sn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}var zAt=class tbe{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||UAt,this.options.tokenizer=this.options.tokenizer||new HAt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Zj.normal,inline:m5.normal};this.options.pedantic?(t.block=Zj.pedantic,t.inline=m5.pedantic):this.options.gfm&&(t.block=Zj.gfm,this.options.breaks?t.inline=m5.breaks:t.inline=m5.gfm),this.tokenizer.rules=t}static get rules(){return{block:Zj,inline:m5}}static lex(e,t){return new tbe(t).lex(e)}static lexInline(e,t){return new tbe(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` -`).replace(/\t/g," "),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic&&(e=e.replace(/^ +$/gm,""));let i,s,o,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.type&&t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` -`+i.raw,s.text+=` -`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` -`+i.raw,s.text+=` -`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const c=e.slice(1);let l;this.options.extensions.startBlock.forEach(function(d){l=d.call({lexer:this},c),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){s=t[t.length-1],r&&s.type==="paragraph"?(s.raw+=` -`+i.raw,s.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i),r=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=` -`+i.raw,s.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,s,o,r=e,a,c,l;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+BHe("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+BHe("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&i.type==="text"&&s.type==="text"?(s.raw+=i.raw,s.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),s=t[t.length-1],s&&i.type==="text"&&s.type==="text"?(s.raw+=i.raw,s.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,l)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,WHe)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,WHe))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(function(f){u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(o,VAt)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),c=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=i.raw,s.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}};const{defaults:$At}=mO.exports,{cleanUrl:HHe,escape:eK}=Sz;var oJe=class{constructor(e){this.options=e||$At}code(e,t,i){const s=(t||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(e,s);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+` -`,s?'
      '+(i?e:eK(e,!0))+`
      -`:"
      "+(i?e:eK(e,!0))+`
      +`;break}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(u),n&&(o=n[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!n,checked:o,loose:!1,text:u}),m.raw+=i,e=e.slice(i.length)}m.items[m.items.length-1].raw=i.trimRight(),m.items[m.items.length-1].text=u.trimRight(),m.raw=m.raw.trimRight();const b=m.items.length;for(a=0;aw.type==="space")&&(m.loose=!0,m.items[a].loose=!0);return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const i={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};return this.options.sanitize&&(i.type="paragraph",i.text=this.options.sanitizer?this.options.sanitizer(t[0]):Vm(t[0]),i.tokens=[],this.lexer.inline(i.text,i.tokens)),i}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const i={type:"table",header:f2e(t[1]).map(n=>({text:n})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split(` +`):[]};if(i.header.length===i.align.length){i.raw=t[0];let n=i.align.length,o,r,a,c;for(o=0;o({text:l}));for(n=i.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Vm(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=_he(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=VCt(t[2],"()");if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),p2e(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=(i[2]||i[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n||!n.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return p2e(i,n,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=n[1]||n[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=n[0].length-1;let a,c,l=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(c=a.length,n[3]||n[4]){l+=c;continue}else if((n[5]||n[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(l-=c,l>0)continue;if(c=Math.min(c,c+l+d),Math.min(r,c)%2){const f=e.slice(1,r+n.index+c);return{type:"em",raw:e.slice(0,r+n.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+n.index+c-1);return{type:"strong",raw:e.slice(0,r+n.index+c+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=Vm(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let n,o;return i[2]==="@"?(n=Vm(this.options.mangle?t(i[1]):i[1]),o="mailto:"+n):(n=Vm(i[1]),o=n),{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let n,o;if(i[2]==="@")n=Vm(this.options.mangle?t(i[0]):i[0]),o="mailto:"+n;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);n=Vm(i[0]),i[1]==="www."?o="http://"+n:o=n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Vm(i[0]):i[0]:n=Vm(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:n}}}};const{noopTest:WY,edit:uc,merge:NN}=kU,Ns={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:WY,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ns._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;Ns._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ns.def=uc(Ns.def).replace("label",Ns._label).replace("title",Ns._title).getRegex();Ns.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ns.listItemStart=uc(/^( *)(bull) */).replace("bull",Ns.bullet).getRegex();Ns.list=uc(Ns.list).replace(/bull/g,Ns.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ns.def.source+")").getRegex();Ns._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ns._comment=/|$)/;Ns.html=uc(Ns.html,"i").replace("comment",Ns._comment).replace("tag",Ns._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ns.paragraph=uc(Ns._paragraph).replace("hr",Ns.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ns._tag).getRegex();Ns.blockquote=uc(Ns.blockquote).replace("paragraph",Ns.paragraph).getRegex();Ns.normal=NN({},Ns);Ns.gfm=NN({},Ns.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Ns.gfm.table=uc(Ns.gfm.table).replace("hr",Ns.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ns._tag).getRegex();Ns.pedantic=NN({},Ns.normal,{html:uc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ns._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:WY,paragraph:uc(Ns.normal._paragraph).replace("hr",Ns.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ns.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const tn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:WY,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:WY,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";tn.punctuation=uc(tn.punctuation).replace(/punctuation/g,tn._punctuation).getRegex();tn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;tn.escapedEmSt=/\\\*|\\_/g;tn._comment=uc(Ns._comment).replace("(?:-->|$)","-->").getRegex();tn.emStrong.lDelim=uc(tn.emStrong.lDelim).replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimAst=uc(tn.emStrong.rDelimAst,"g").replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimUnd=uc(tn.emStrong.rDelimUnd,"g").replace(/punct/g,tn._punctuation).getRegex();tn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;tn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;tn._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;tn.autolink=uc(tn.autolink).replace("scheme",tn._scheme).replace("email",tn._email).getRegex();tn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;tn.tag=uc(tn.tag).replace("comment",tn._comment).replace("attribute",tn._attribute).getRegex();tn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;tn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;tn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;tn.link=uc(tn.link).replace("label",tn._label).replace("href",tn._href).replace("title",tn._title).getRegex();tn.reflink=uc(tn.reflink).replace("label",tn._label).getRegex();tn.reflinkSearch=uc(tn.reflinkSearch,"g").replace("reflink",tn.reflink).replace("nolink",tn.nolink).getRegex();tn.normal=NN({},tn);tn.pedantic=NN({},tn.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:uc(/^!?\[(label)\]\((.*?)\)/).replace("label",tn._label).getRegex(),reflink:uc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tn._label).getRegex()});tn.gfm=NN({},tn.normal,{escape:uc(tn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}var QCt=class zme{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||KCt,this.options.tokenizer=this.options.tokenizer||new GCt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:YG.normal,inline:p4.normal};this.options.pedantic?(t.block=YG.pedantic,t.inline=p4.pedantic):this.options.gfm&&(t.block=YG.gfm,this.options.breaks?t.inline=p4.breaks:t.inline=p4.gfm),this.tokenizer.rules=t}static get rules(){return{block:YG,inline:p4}}static lex(e,t){return new zme(t).lex(e)}static lexInline(e,t){return new zme(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`).replace(/\t/g," "),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic&&(e=e.replace(/^ +$/gm,""));let i,n,o,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.type&&t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` +`+i.raw,n.text+=` +`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const c=e.slice(1);let l;this.options.extensions.startBlock.forEach(function(d){l=d.call({lexer:this},c),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){n=t[t.length-1],r&&n.type==="paragraph"?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),r=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&n.type==="text"?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,o,r=e,a,c,l;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+m2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+m2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,l)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,_2e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,_2e))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(function(f){u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(o,qCt)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),c=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}};const{defaults:jCt}=MN.exports,{cleanUrl:v2e,escape:JG}=kU;var qQe=class{constructor(e){this.options=e||jCt}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(e,n);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+` +`,n?'
      '+(i?e:JG(e,!0))+`
      +`:"
      "+(i?e:JG(e,!0))+`
      `}blockquote(e){return`
      `+e+`
      -`}html(e){return e}heading(e,t,i,s){return this.options.headerIds?"'+e+" +`}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"'+e+" `:""+e+" `}hr(){return this.options.xhtml?`
      `:`
      -`}list(e,t,i){const s=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+s+o+`> -`+e+" +`}list(e,t,i){const n=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+n+o+`> +`+e+" `}listitem(e){return"
    1. "+e+`
    2. `}checkbox(e){return" "}paragraph(e){return"

      "+e+`

      `}table(e,t){return t&&(t=""+t+""),` @@ -209,33 +210,33 @@ ${gAt(t,e)} `}tablerow(e){return` `+e+` `}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+" -`}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
      ":"
      "}del(e){return""+e+""}link(e,t,i){if(e=HHe(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let s='",s}image(e,t,i){if(e=HHe(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let s=''+i+'":">",s}text(e){return e}},rJe=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},aJe=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,s=0;if(this.seen.hasOwnProperty(i)){s=this.seen[e];do s++,i=e+"-"+s;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=s,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}};const GAt=oJe,qAt=rJe,QAt=aJe,{defaults:jAt}=mO.exports,{unescape:KAt}=Sz;var YAt=class ibe{constructor(e){this.options=e||jAt,this.options.renderer=this.options.renderer||new GAt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qAt,this.slugger=new QAt}static parse(e,t){return new ibe(t).parse(e)}static parseInline(e,t){return new ibe(t).parseInline(e)}parse(e,t=!0){let i="",s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M;const k=e.length;for(s=0;s0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=S+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=S+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:S}):w+=S),w+=this.parse(b.tokens,v),u+=this.renderer.listitem(w,y,C);i+=this.renderer.list(u,p,m);continue}case"html":{i+=this.renderer.html(f.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(u=f.tokens?this.parseInline(f.tokens):f.text;s+1"u"||n===null)throw new Error("marked(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=_de({},Ks.defaults,e||{}),dJe(e),t){const i=e.highlight;let s;try{s=d7.lex(n,e)}catch(a){return t(a)}const o=function(a){let c;if(!a)try{e.walkTokens&&Ks.walkTokens(s,e.walkTokens),c=h7.parse(s,e)}catch(l){a=l}return e.highlight=i,a?t(a):t(null,c)};if(!i||i.length<3||(delete e.highlight,!s.length))return o();let r=0;Ks.walkTokens(s,function(a){a.type==="code"&&(r++,setTimeout(()=>{i(a.text,a.lang,function(c,l){if(c)return o(c);l!=null&&l!==a.text&&(a.text=l,a.escaped=!0),r--,r===0&&o()})},0))}),r===0&&o();return}try{const i=d7.lex(n,e);return e.walkTokens&&Ks.walkTokens(i,e.walkTokens),h7.parse(i,e)}catch(i){if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

      An error occurred:

      "+hJe(i.message+"",!0)+"
      ";throw i}}Ks.options=Ks.setOptions=function(n){return _de(Ks.defaults,n),eEt(Ks.defaults),Ks};Ks.getDefaults=ZAt;Ks.defaults=tEt;Ks.use=function(...n){const e=_de({},...n),t=Ks.defaults.extensions||{renderers:{},childTokens:{}};let i;n.forEach(s=>{if(s.extensions&&(i=!0,s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const r=t.renderers?t.renderers[o.name]:null;r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)})),s.renderer){const o=Ks.defaults.renderer||new lJe;for(const r in s.renderer){const a=o[r];o[r]=(...c)=>{let l=s.renderer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.renderer=o}if(s.tokenizer){const o=Ks.defaults.tokenizer||new cJe;for(const r in s.tokenizer){const a=o[r];o[r]=(...c)=>{let l=s.tokenizer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.tokenizer=o}if(s.walkTokens){const o=Ks.defaults.walkTokens;e.walkTokens=r=>{s.walkTokens.call(this,r),o&&o(r)}}i&&(e.extensions=t),Ks.setOptions(e)})};Ks.walkTokens=function(n,e){for(const t of n)switch(e(t),t.type){case"table":{for(const i of t.header)Ks.walkTokens(i.tokens,e);for(const i of t.rows)for(const s of i)Ks.walkTokens(s.tokens,e);break}case"list":{Ks.walkTokens(t.items,e);break}default:Ks.defaults.extensions&&Ks.defaults.extensions.childTokens&&Ks.defaults.extensions.childTokens[t.type]?Ks.defaults.extensions.childTokens[t.type].forEach(function(i){Ks.walkTokens(t[i],e)}):t.tokens&&Ks.walkTokens(t.tokens,e)}};Ks.parseInline=function(n,e){if(typeof n>"u"||n===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");e=_de({},Ks.defaults,e||{}),dJe(e);try{const t=d7.lexInline(n,e);return e.walkTokens&&Ks.walkTokens(t,e.walkTokens),h7.parseInline(t,e)}catch(t){if(t.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

      An error occurred:

      "+hJe(t.message+"",!0)+"
      ";throw t}};Ks.Parser=h7;Ks.parser=h7.parse;Ks.Renderer=lJe;Ks.TextRenderer=JAt;Ks.Lexer=d7;Ks.lexer=d7.lex;Ks.Tokenizer=cJe;Ks.Slugger=XAt;Ks.parse=Ks;var Xg=Ks;function uJe(n){return JSON.stringify(n,iEt)}function JU(n){let e=JSON.parse(n);return e=Or(e),e}function iEt(n,e){return e instanceof RegExp?{$mid:Fs.Regexp,source:e.source,flags:e.flags}:e}function Or(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case Fs.Uri:return P.revive(n);case Fs.Regexp:return new RegExp(n.source,n.flags);case Fs.Date:return new Date(n.source)}if(n instanceof ze||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=eJe(n),s.push(`src="${Jj(n)}"`)),t&&s.push(`alt="${Jj(t)}"`),e&&s.push(`title="${Jj(e)}"`),i.length&&(s=s.concat(i)),""},paragraph:n=>`

      ${n}

      `,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=Dfe(t)),e=typeof e=="string"?Jj(Dfe(e)):"",n=Dfe(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
      ${t}`)});function mQ(n,e={},t={}){const i=new Z;let s=!1;const o=_Ne(e),r=function(m){let v;try{v=JU(decodeURIComponent(m))}catch{}return v?(v=AU(v,w=>{if(n.uris&&n.uris[w])return P.revive(n.uris[w])}),encodeURIComponent(JSON.stringify(v))):m},a=function(m,v){const w=n.uris&&n.uris[m];let b=P.revive(w);return v?m.startsWith(_e.data+":")?m:(b||(b=P.parse(m)),lp.uriToBrowserUri(b).toString(!0)):!b||P.parse(m).toString()===b.toString()?m:(b.query&&(b=b.with({query:r(b.query)})),b.toString())},c=new Xg.Renderer;c.image=Ife.image,c.link=Ife.link,c.paragraph=Ife.paragraph;const l=[],d=[];if(e.codeBlockRendererSync?c.code=(m,v)=>{const w=ebe.nextId(),b=e.codeBlockRendererSync(UHe(v),m);return d.push([w,b]),`
      ${rM(m)}
      `}:e.codeBlockRenderer&&(c.code=(m,v)=>{const w=ebe.nextId(),b=e.codeBlockRenderer(UHe(v),m);return l.push(b.then(C=>[w,C])),`
      ${rM(m)}
      `}),e.actionHandler){const m=function(b){let C=b.target;if(!(C.tagName!=="A"&&(C=C.parentElement,!C||C.tagName!=="A")))try{let y=C.dataset.href;y&&(n.baseUri&&(y=Lfe(P.from(n.baseUri),y)),e.actionHandler.callback(y,b))}catch(y){bt(y)}finally{b.preventDefault()}},v=e.actionHandler.disposables.add(new oi(o,"click")),w=e.actionHandler.disposables.add(new oi(o,"auxclick"));e.actionHandler.disposables.add(T.any(v.event,w.event)(b=>{const C=new yu(gt(o),b);!C.leftButton&&!C.middleButton||m(C)})),e.actionHandler.disposables.add(pe(o,"keydown",b=>{const C=new os(b);!C.equals(E.Space)&&!C.equals(E.Enter)||m(C)}))}n.supportHtml||(t.sanitizer=m=>e.sanitizerOptions?.replaceWithPlaintext?rM(m):(n.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let h=n.value??"";h.length>1e5&&(h=`${h.substr(0,1e5)}…`),n.supportThemeIcons&&(h=dAt(h));let u;if(e.fillInIncompleteTokens){const m={...Xg.defaults,...t},v=Xg.lexer(h,m),w=fEt(v);u=Xg.parser(w,m)}else u=Xg.parse(h,t);n.supportThemeIcons&&(u=nw(u).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const p=new DOMParser().parseFromString(nbe({isTrusted:n.isTrusted,...e.sanitizerOptions},u),"text/html");if(p.body.querySelectorAll("img, audio, video, source").forEach(m=>{const v=m.getAttribute("src");if(v){let w=v;try{n.baseUri&&(w=Lfe(P.from(n.baseUri),w))}catch{}if(m.setAttribute("src",a(w,!0)),e.remoteImageIsAllowed){const b=P.parse(w);b.scheme!==_e.file&&b.scheme!==_e.data&&!e.remoteImageIsAllowed(b)&&m.replaceWith(we("",void 0,m.outerHTML))}}}),p.body.querySelectorAll("a").forEach(m=>{const v=m.getAttribute("href");if(m.setAttribute("href",""),!v||/^data:|javascript:/i.test(v)||/^command:/i.test(v)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(v))m.replaceWith(...m.childNodes);else{let w=a(v,!1);n.baseUri&&(w=Lfe(P.from(n.baseUri),v)),m.dataset.href=w}}),o.innerHTML=nbe({isTrusted:n.isTrusted,...e.sanitizerOptions},p.body.innerHTML),l.length>0)Promise.all(l).then(m=>{if(s)return;const v=new Map(m),w=o.querySelectorAll("div[data-code]");for(const b of w){const C=v.get(b.dataset.code??"");C&&_a(b,C)}e.asyncRenderCallback?.()});else if(d.length>0){const m=new Map(d),v=o.querySelectorAll("div[data-code]");for(const w of v){const b=m.get(w.dataset.code??"");b&&_a(w,b)}}if(e.asyncRenderCallback)for(const m of o.getElementsByTagName("img")){const v=i.add(pe(m,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:o,dispose:()=>{s=!0,i.dispose()}}}function UHe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function Lfe(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?r2e(n,e).toString():r2e(ma(n),e).toString()}const nEt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function nbe(n,e){const{config:t,allowedSchemes:i}=oEt(n),s=new Z;s.add(VHe("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&o.attributes.getNamedItem("type")?.value==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}})),s.add(VHe("uponSanitizeElement",(o,r)=>{if(r.tagName==="input"&&(o.attributes.getNamedItem("type")?.value==="checkbox"?o.setAttribute("disabled",""):n.replaceWithPlaintext||o.parentElement?.removeChild(o)),n.replaceWithPlaintext&&!r.allowedTags[r.tagName]&&r.tagName!=="body"&&o.parentElement){let a,c;if(r.tagName==="#comment")a=``;else{const u=nEt.includes(r.tagName),f=o.attributes.length?" "+Array.from(o.attributes).map(p=>`${p.name}="${p.value}"`).join(" "):"";a=`<${r.tagName}${f}>`,u||(c=``)}const l=document.createDocumentFragment(),d=o.parentElement.ownerDocument.createTextNode(a);l.appendChild(d);const h=c?o.parentElement.ownerDocument.createTextNode(c):void 0;for(;o.firstChild;)l.appendChild(o.firstChild);h&&l.appendChild(h),o.parentElement.replaceChild(l,o)}})),s.add(dgt(i));try{return oje(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{s.dispose()}}const sEt=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function oEt(n){const e=[_e.http,_e.https,_e.mailto,_e.data,_e.file,_e.vscodeFileResource,_e.vscodeRemote,_e.vscodeRemoteResource];return n.isTrusted&&e.push(_e.command),{config:{ALLOWED_TAGS:n.allowedTags??[...hgt],ALLOWED_ATTR:sEt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function gJe(n){return typeof n=="string"?n:rEt(n)}function rEt(n,e){let t=n.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Xg.parse(t,{renderer:lEt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>aEt.get(s)??s);return nbe({isTrusted:!1},i).toString()}const aEt=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function cEt(){const n=new Xg.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` -`,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+` -`,n.paragraph=e=>e+` -`,n.table=(e,t)=>e+t+` -`,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>` -`,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n}const lEt=new Ya(n=>cEt());function u7(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function fJe(n){if(n.tokens)for(let e=n.tokens.length-1;e>=0;e--){const t=n.tokens[e];if(t.type==="text"){const i=t.raw.split(` -`),s=i[i.length-1];if(s.includes("`"))return _Et(n);if(s.includes("**"))return SEt(n);if(s.match(/\*\w/))return vEt(n);if(s.match(/(^|\s)__\w/))return AEt(n);if(s.match(/(^|\s)_\w/))return wEt(n);if(dEt(s)||hEt(s)&&n.tokens.slice(0,e).some(o=>o.type==="text"&&o.raw.match(/\[[^\]]*$/))){const o=n.tokens.slice(e+1);return o[0]?.type==="link"&&o[1]?.type==="text"&&o[1].raw.match(/^ *"[^"]*$/)||s.match(/^[^"]* +"[^"]*$/)?CEt(n):bEt(n)}else if(s.match(/(^|\s)\[\w*/))return yEt(n)}}}function dEt(n){return!!n.match(/(^|\s)\[.*\]\(\w*/)}function hEt(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function uEt(n){const e=n.items[n.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if(t?.type==="text"&&!("inRawBlock"in e)&&(i=fJe(t)),!i||i.type!=="paragraph")return;const s=u7(n.items.slice(0,-1)),o=e.raw.match(/^(\s*(-|\d+\.) +)/)?.[0];if(!o)return;const r=o+u7(e.tokens.slice(0,-1))+i.raw,a=Xg.lexer(s+r)[0];if(a.type==="list")return a}const gEt=3;function fEt(n){for(let e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const o=s?t.slice(0,-1).join(` +`}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
      ":"
      "}del(e){return""+e+""}link(e,t,i){if(e=v2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='",n}image(e,t,i){if(e=v2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n=''+i+'":">",n}text(e){return e}},QQe=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},jQe=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}};const YCt=qQe,JCt=QQe,XCt=jQe,{defaults:ZCt}=MN.exports,{unescape:eSt}=kU;var tSt=class $me{constructor(e){this.options=e||ZCt,this.options.renderer=this.options.renderer||new YCt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new JCt,this.slugger=new XCt}static parse(e,t){return new $me(t).parse(e)}static parseInline(e,t){return new $me(t).parseInline(e)}parse(e,t=!0){let i="",n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L;const k=e.length;for(n=0;n0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=A+" "+w.tokens[0].text,w.tokens[0].tokens&&w.tokens[0].tokens.length>0&&w.tokens[0].tokens[0].type==="text"&&(w.tokens[0].tokens[0].text=A+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:A}):b+=A),b+=this.parse(w.tokens,v),u+=this.renderer.listitem(b,C,y);i+=this.renderer.list(u,p,m);continue}case"html":{i+=this.renderer.html(f.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1"u"||s===null)throw new Error("marked(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=hae({},Bs.defaults,e||{}),XQe(e),t){const i=e.highlight;let n;try{n=c3.lex(s,e)}catch(a){return t(a)}const o=function(a){let c;if(!a)try{e.walkTokens&&Bs.walkTokens(n,e.walkTokens),c=l3.parse(n,e)}catch(l){a=l}return e.highlight=i,a?t(a):t(null,c)};if(!i||i.length<3||(delete e.highlight,!n.length))return o();let r=0;Bs.walkTokens(n,function(a){a.type==="code"&&(r++,setTimeout(()=>{i(a.text,a.lang,function(c,l){if(c)return o(c);l!=null&&l!==a.text&&(a.text=l,a.escaped=!0),r--,r===0&&o()})},0))}),r===0&&o();return}try{const i=c3.lex(s,e);return e.walkTokens&&Bs.walkTokens(i,e.walkTokens),l3.parse(i,e)}catch(i){if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

      An error occurred:

      "+ZQe(i.message+"",!0)+"
      ";throw i}}Bs.options=Bs.setOptions=function(s){return hae(Bs.defaults,s),oSt(Bs.defaults),Bs};Bs.getDefaults=sSt;Bs.defaults=rSt;Bs.use=function(...s){const e=hae({},...s),t=Bs.defaults.extensions||{renderers:{},childTokens:{}};let i;s.forEach(n=>{if(n.extensions&&(i=!0,n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const r=t.renderers?t.renderers[o.name]:null;r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)})),n.renderer){const o=Bs.defaults.renderer||new JQe;for(const r in n.renderer){const a=o[r];o[r]=(...c)=>{let l=n.renderer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.renderer=o}if(n.tokenizer){const o=Bs.defaults.tokenizer||new YQe;for(const r in n.tokenizer){const a=o[r];o[r]=(...c)=>{let l=n.tokenizer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.tokenizer=o}if(n.walkTokens){const o=Bs.defaults.walkTokens;e.walkTokens=r=>{n.walkTokens.call(this,r),o&&o(r)}}i&&(e.extensions=t),Bs.setOptions(e)})};Bs.walkTokens=function(s,e){for(const t of s)switch(e(t),t.type){case"table":{for(const i of t.header)Bs.walkTokens(i.tokens,e);for(const i of t.rows)for(const n of i)Bs.walkTokens(n.tokens,e);break}case"list":{Bs.walkTokens(t.items,e);break}default:Bs.defaults.extensions&&Bs.defaults.extensions.childTokens&&Bs.defaults.extensions.childTokens[t.type]?Bs.defaults.extensions.childTokens[t.type].forEach(function(i){Bs.walkTokens(t[i],e)}):t.tokens&&Bs.walkTokens(t.tokens,e)}};Bs.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=hae({},Bs.defaults,e||{}),XQe(e);try{const t=c3.lexInline(s,e);return e.walkTokens&&Bs.walkTokens(t,e.walkTokens),l3.parseInline(t,e)}catch(t){if(t.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

      An error occurred:

      "+ZQe(t.message+"",!0)+"
      ";throw t}};Bs.Parser=l3;Bs.parser=l3.parse;Bs.Renderer=JQe;Bs.TextRenderer=iSt;Bs.Lexer=c3;Bs.lexer=c3.lex;Bs.Tokenizer=YQe;Bs.Slugger=nSt;Bs.parse=Bs;var zu=Bs;function eje(s){return JSON.stringify(s,aSt)}function j2(s){let e=JSON.parse(s);return e=Mo(e),e}function aSt(s,e){return e instanceof RegExp?{$mid:ws.Regexp,source:e.source,flags:e.flags}:e}function Mo(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case ws.Uri:return N.revive(s);case ws.Regexp:return new RegExp(s.source,s.flags);case ws.Date:return new Date(s.source)}if(s instanceof $e||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t{let i=[],n=[];return s&&({href:s,dimensions:i}=VQe(s),n.push(`src="${QG(s)}"`)),t&&n.push(`alt="${QG(t)}"`),e&&n.push(`title="${QG(e)}"`),i.length&&(n=n.concat(i)),""},paragraph:s=>`

      ${s}

      `,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=mhe(t)),e=typeof e=="string"?QG(mhe(e)):"",s=mhe(s),s=s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
      ${t}`)});function f6(s,e={},t={}){const i=new Z;let n=!1;const o=ELe(e),r=function(m){let v;try{v=j2(decodeURIComponent(m))}catch{}return v?(v=S2(v,b=>{if(s.uris&&s.uris[b])return N.revive(s.uris[b])}),encodeURIComponent(JSON.stringify(v))):m},a=function(m,v){const b=s.uris&&s.uris[m];let w=N.revive(b);return v?m.startsWith(pe.data+":")?m:(w||(w=N.parse(m)),ef.uriToBrowserUri(w).toString(!0)):!w||N.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:r(w.query)})),w.toString())},c=new zu.Renderer;c.image=vhe.image,c.link=vhe.link,c.paragraph=vhe.paragraph;const l=[],d=[];if(e.codeBlockRendererSync?c.code=(m,v)=>{const b=Vme.nextId(),w=e.codeBlockRendererSync(b2e(v),m);return d.push([b,w]),`
      ${fT(m)}
      `}:e.codeBlockRenderer&&(c.code=(m,v)=>{const b=Vme.nextId(),w=e.codeBlockRenderer(b2e(v),m);return l.push(w.then(y=>[b,y])),`
      ${fT(m)}
      `}),e.actionHandler){const m=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let C=y.dataset.href;C&&(s.baseUri&&(C=bhe(N.from(s.baseUri),C)),e.actionHandler.callback(C,w))}catch(C){vt(C)}finally{w.preventDefault()}},v=e.actionHandler.disposables.add(new ii(o,"click")),b=e.actionHandler.disposables.add(new ii(o,"auxclick"));e.actionHandler.disposables.add(M.any(v.event,b.event)(w=>{const y=new Eh(ct(o),w);!y.leftButton&&!y.middleButton||m(y)})),e.actionHandler.disposables.add(ue(o,"keydown",w=>{const y=new En(w);!y.equals(S.Space)&&!y.equals(S.Enter)||m(y)}))}s.supportHtml||(t.sanitizer=m=>e.sanitizerOptions?.replaceWithPlaintext?fT(m):(s.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let h=s.value??"";h.length>1e5&&(h=`${h.substr(0,1e5)}…`),s.supportThemeIcons&&(h=pCt(h));let u;if(e.fillInIncompleteTokens){const m={...zu.defaults,...t},v=zu.lexer(h,m),b=bSt(v);u=zu.parser(b,m)}else u=zu.parse(h,t);s.supportThemeIcons&&(u=Eb(u).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const p=new DOMParser().parseFromString(Gme({isTrusted:s.isTrusted,...e.sanitizerOptions},u),"text/html");if(p.body.querySelectorAll("img, audio, video, source").forEach(m=>{const v=m.getAttribute("src");if(v){let b=v;try{s.baseUri&&(b=bhe(N.from(s.baseUri),b))}catch{}if(m.setAttribute("src",a(b,!0)),e.remoteImageIsAllowed){const w=N.parse(b);w.scheme!==pe.file&&w.scheme!==pe.data&&!e.remoteImageIsAllowed(w)&&m.replaceWith(fe("",void 0,m.outerHTML))}}}),p.body.querySelectorAll("a").forEach(m=>{const v=m.getAttribute("href");if(m.setAttribute("href",""),!v||/^data:|javascript:/i.test(v)||/^command:/i.test(v)&&!s.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(v))m.replaceWith(...m.childNodes);else{let b=a(v,!1);s.baseUri&&(b=bhe(N.from(s.baseUri),v)),m.dataset.href=b}}),o.innerHTML=Gme({isTrusted:s.isTrusted,...e.sanitizerOptions},p.body.innerHTML),l.length>0)Promise.all(l).then(m=>{if(n)return;const v=new Map(m),b=o.querySelectorAll("div[data-code]");for(const w of b){const y=v.get(w.dataset.code??"");y&&aa(w,y)}e.asyncRenderCallback?.()});else if(d.length>0){const m=new Map(d),v=o.querySelectorAll("div[data-code]");for(const b of v){const w=m.get(b.dataset.code??"");w&&aa(b,w)}}if(e.asyncRenderCallback)for(const m of o.getElementsByTagName("img")){const v=i.add(ue(m,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:o,dispose:()=>{n=!0,i.dispose()}}}function b2e(s){if(!s)return"";const e=s.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:s}function bhe(s,e){return/^\w[\w\d+.-]*:/.test(e)?e:s.path.endsWith("/")?HFe(s,e).toString():HFe(Lr(s),e).toString()}const cSt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Gme(s,e){const{config:t,allowedSchemes:i}=dSt(s),n=new Z;n.add(w2e("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(border-radius:[0-9]+px;)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&o.attributes.getNamedItem("type")?.value==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}})),n.add(w2e("uponSanitizeElement",(o,r)=>{if(r.tagName==="input"&&(o.attributes.getNamedItem("type")?.value==="checkbox"?o.setAttribute("disabled",""):s.replaceWithPlaintext||o.remove()),s.replaceWithPlaintext&&!r.allowedTags[r.tagName]&&r.tagName!=="body"&&o.parentElement){let a,c;if(r.tagName==="#comment")a=``;else{const u=cSt.includes(r.tagName),f=o.attributes.length?" "+Array.from(o.attributes).map(p=>`${p.name}="${p.value}"`).join(" "):"";a=`<${r.tagName}${f}>`,u||(c=``)}const l=document.createDocumentFragment(),d=o.parentElement.ownerDocument.createTextNode(a);l.appendChild(d);const h=c?o.parentElement.ownerDocument.createTextNode(c):void 0;for(;o.firstChild;)l.appendChild(o.firstChild);h&&l.appendChild(h),o.parentElement.replaceChild(l,o)}})),n.add(Gdt(i));try{return OGe(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{n.dispose()}}const lSt=["align","autoplay","alt","checked","class","colspan","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","style","target","title","type","width","start"];function dSt(s){const e=[pe.http,pe.https,pe.mailto,pe.data,pe.file,pe.vscodeFileResource,pe.vscodeRemote,pe.vscodeRemoteResource];return s.isTrusted&&e.push(pe.command),{config:{ALLOWED_TAGS:s.allowedTags??[...Kdt],ALLOWED_ATTR:lSt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function tje(s){return typeof s=="string"?s:hSt(s)}function hSt(s,e){let t=s.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=zu.parse(t,{renderer:fSt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,n=>uSt.get(n)??n);return Gme({isTrusted:!1},i).toString()}const uSt=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function gSt(){const s=new zu.Renderer;return s.code=e=>e,s.blockquote=e=>e,s.html=e=>"",s.heading=(e,t,i)=>e+` +`,s.hr=()=>"",s.list=(e,t)=>e,s.listitem=e=>e+` +`,s.paragraph=e=>e+` +`,s.table=(e,t)=>e+t+` +`,s.tablerow=e=>e,s.tablecell=(e,t)=>e+" ",s.strong=e=>e,s.em=e=>e,s.codespan=e=>e,s.br=()=>` +`,s.del=e=>e,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s}const fSt=new ya(s=>gSt());function d3(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function ije(s){if(s.tokens)for(let e=s.tokens.length-1;e>=0;e--){const t=s.tokens[e];if(t.type==="text"){const i=t.raw.split(` +`),n=i[i.length-1];if(n.includes("`"))return CSt(s);if(n.includes("**"))return kSt(s);if(n.match(/\*\w/))return SSt(s);if(n.match(/(^|\s)__\w/))return ISt(s);if(n.match(/(^|\s)_\w/))return ASt(s);if(pSt(n)||mSt(n)&&s.tokens.slice(0,e).some(o=>o.type==="text"&&o.raw.match(/\[[^\]]*$/))){const o=s.tokens.slice(e+1);return o[0]?.type==="link"&&o[1]?.type==="text"&&o[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?xSt(s):ESt(s)}else if(n.match(/(^|\s)\[\w*/))return DSt(s)}}}function pSt(s){return!!s.match(/(^|\s)\[.*\]\(\w*/)}function mSt(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function _St(s){const e=s.items[s.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if(t?.type==="text"&&!("inRawBlock"in e)&&(i=ije(t)),!i||i.type!=="paragraph")return;const n=d3(s.items.slice(0,-1)),o=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!o)return;const r=o+d3(e.tokens.slice(0,-1))+i.raw,a=zu.lexer(n+r)[0];if(a.type==="list")return a}const vSt=3;function bSt(s){for(let e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const o=n?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return Xg.lexer(a)}}function VHe(n,e){return rje(n,e),Ee(()=>aje(n))}var xEt=".monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground);padding:1px 3px;vertical-align:middle}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}";Ct(xEt,{});var sbe,tN;let vw=(tN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new I,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new Z,o=s.add(mQ(e,{...this._getRenderOptions(e,s),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,s)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Yc);const r=await Ayt(this._languageService,s,o),a=document.createElement("span");if(a.innerHTML=sbe._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Sd(a,c)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>vde(this._openerService,i,e.isTrusted),disposables:t}}}},sbe=tN,tN._ttpTokenizer=Jx("tokenizeToString",{createHTML(e){return e}}),tN);vw=sbe=D([_(1,Di),_(2,fr)],vw);async function vde(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:DEt(t)})}catch(i){return bt(i),!1}}function DEt(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const kEt="vs/editor/browser/services/hoverService/hoverWidget",wC=we;var aa;(function(n){n[n.PointerSize=3]="PointerSize",n[n.HoverBorderWidth=2]="HoverBorderWidth",n[n.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(aa||(aa={}));let obe=class extends wg{get _targetWindow(){return gt(this._target.targetElements[0])}get _targetDocumentElement(){return gt(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===Oo.BELOW?Jp.BELOW:Jp.ABOVE}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=s,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new Z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new I),this._onRequestLayout=this._register(new I),this._linkHandler=e.linkHandler||(u=>vde(this._openerService,u,ah(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new IEt(e.target),this._hoverPointer=e.appearance?.showPointer?wC("div.workbench-hover-pointer"):void 0,this._hover=this._register(new fNe),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.appearance?.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=e.position?.hoverPosition??Oo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(E.Escape)&&this.dispose()}),this._register(pe(this._targetWindow,"blur",()=>this.dispose()));const a=wC("div.hover-row.markdown-hover"),c=wC("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Ra(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(vw,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Gh.fontFamily}),{element:p}=f.render(u,{actionHandler:{callback:m=>this._linkHandler(m),disposables:this._messageListeners},asyncRenderCallback:()=>{c.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});c.appendChild(p)}if(a.appendChild(c),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=wC("div.hover-row.status-bar"),f=wC("div.actions");e.actions.forEach(p=>{const m=this._keybindingService.lookupKeybinding(p.commandId);m&&m.getLabel()}),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=wC("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let l;if(e.actions&&e.actions.length>0?l=!1:e.persistence?.hideOnHover===void 0?l=typeof e.content=="string"||ah(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=wC("div.hover-row.status-bar"),f=wC("div.info");f.textContent=g(kEt,0,"Hold {0} key to mouse over",ei?"Option":"Alt"),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];l||d.push(this._hoverContainer);const h=this._register(new zHe(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new zHe(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Yle(this._hoverContainer,wC("div")),s=he(this._hoverContainer,wC("div"));i.tabIndex=0,s.tabIndex=0,this._register(pe(s,"focus",o=>{e.focus(),o.preventDefault()})),this._register(pe(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Cu(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=lje(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:o,left:r}=t[0],a=s-r,c=o-i,l={top:i,right:s,bottom:o,left:r,width:a,height:c,center:{x:r+a/2,y:i+c/2}};if(this.adjustHorizontalHoverPosition(l),this.adjustVerticalHoverPosition(l),this.adjustHoverMaxHeight(l),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case Oo.RIGHT:l.left+=aa.PointerSize,l.right+=aa.PointerSize,this._hoverContainer.style.paddingLeft=`${aa.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-aa.PointerSize}px`;break;case Oo.LEFT:l.left-=aa.PointerSize,l.right-=aa.PointerSize,this._hoverContainer.style.paddingRight=`${aa.PointerSize}px`,this._hoverContainer.style.marginRight=`${-aa.PointerSize}px`;break;case Oo.BELOW:l.top+=aa.PointerSize,l.bottom+=aa.PointerSize,this._hoverContainer.style.paddingTop=`${aa.PointerSize}px`,this._hoverContainer.style.marginTop=`${-aa.PointerSize}px`;break;case Oo.ABOVE:l.top-=aa.PointerSize,l.bottom-=aa.PointerSize,this._hoverContainer.style.paddingBottom=`${aa.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-aa.PointerSize}px`;break}l.center.x=l.left+a/2,l.center.y=l.top+c/2}this.computeXCordinate(l),this.computeYCordinate(l),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(l)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+aa.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===Oo.RIGHT?this._x=e.right:this._hoverPosition===Oo.LEFT?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-aa.HoverWindowEdgeMargin,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?aa.PointerSize:0;if(this._forcePosition){const i=t+aa.HoverBorderWidth;this._hoverPosition===Oo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===Oo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===Oo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.LEFT:this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.RIGHT:this._hoverPosition=Oo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=Oo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?aa.PointerSize:0;this._hoverPosition===Oo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=Oo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?aa.PointerSize:0)+aa.HoverBorderWidth;this._hoverPosition===Oo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===Oo.BELOW&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-aa.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-aa.PointerSize}px`;break}case Oo.ABOVE:case Oo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===Oo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-aa.PointerSize;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-aa.PointerSize),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}hide(){this.dispose()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};obe=D([_(1,ti),_(2,Re),_(3,fr),_(4,be),_(5,Ur)],obe);class zHe extends wg{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new I),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=gt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(gt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class IEt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var hp;(function(n){n[n.NoMatchingKb=0]="NoMatchingKb",n[n.MoreChordsNeeded=1]="MoreChordsNeeded",n[n.KbFound=2]="KbFound"})(hp||(hp={}));const gee={kind:hp.NoMatchingKb},LEt={kind:hp.MoreChordsNeeded};function TEt(n,e,t){return{kind:hp.KbFound,commandId:n,commandArgs:e,isBubble:t}}class M${constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const o=s.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=M$.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||t.length===0)return[];const i=[];let s=0;for(let o=t.length-1;o>=0;o--)i[s++]=t[o];return i}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),gee;let r=null;if(s.length<2)r=o;else{r=[];for(let c=0,l=o.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const s=t[i];if(M$._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function $He(n){return n?`${n.serialize()}`:"no when condition"}function GHe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}let fee=class extends ${constructor(e){super(),this.layoutService=e,this.contextView=this._register(new jwe(this.layoutService.mainContainer,by.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(gt(t))?s=by.ABSOLUTE:i?s=by.FIXED_SHADOW:s=by.FIXED:s=by.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};fee=D([_(0,bg)],fee);class REt extends fee{getContextViewElement(){return this.contextView.getViewElement()}}const MEt="vs/editor/browser/services/hoverService/updatableHoverWidget";class NEt{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||$t(e)||Ra(e))s=e;else if(!SU(e.markdown))s=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(MEt,0,"Loading..."),t,i),this._cancellationTokenSource=new ai;const o=this._cancellationTokenSource.token;if(s=await e.markdown(o),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s},position:{hoverPosition:Oo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}s?.dispose()}hasContent(e){return e?ah(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let rbe=class extends ${constructor(e,t,i,s,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=s,this._accessibilityService=o,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new fee(this._layoutService))}showHover(e,t,i){if(qHe(this._currentHoverOptions)===qHe(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const s=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=xl();i||(s&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(obe,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&lMe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Ra(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(gt(c))}if(this._contextViewHandler.showContextView(new PEt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(pe(gt(e.container).document,xe.MOUSE_DOWN,c=>{al(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(pe(l,xe.CLICK,()=>this.hideHover()));else r.add(pe(e.target,xe.CLICK,()=>this.hideHover()));const c=xl();if(c){const l=gt(c).document;r.add(pe(c,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(l,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(c,xe.KEY_UP,d=>this._keyUp(d,a))),r.add(pe(l,xe.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in yi){const c=new IntersectionObserver(d=>this._intersectionChange(d,a),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;c.observe(l),r.add(Ee(()=>c.disconnect()))}return this._currentHover=a,a}hideHover(){this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const s=new os(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(s,s.target).kind!==hp.NoMatchingKb||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupUpdatableHover(e,t,i,s){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(C,y)=>{const S=r!==void 0;C&&(r?.dispose(),r=void 0),y&&(o?.dispose(),o=void 0),S&&(e.onDidHideHover?.(),r=void 0)},c=(C,y,S,M)=>new O_(async()=>{(!r||r.isDisposed)&&(r=new NEt(e,S||t,C>0),await r.update(typeof i=="function"?i():i,y,{...s,trapFocus:M}))},C);let l=!1;const d=pe(t,xe.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=pe(t,xe.MOUSE_UP,()=>{l=!1},!0),u=pe(t,xe.MOUSE_LEAVE,C=>{l=!1,a(!1,C.fromElement===t)},!0),f=C=>{if(o)return;const y=new Z,S={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const M=k=>{S.x=k.x+10,Ra(k.target)&&QHe(k.target,t)!==t&&a(!0,!0)};y.add(pe(t,xe.MOUSE_MOVE,M,!0))}o=y,!(Ra(C.target)&&QHe(C.target,t)!==t)&&y.add(c(e.delay,!1,S))},p=pe(t,xe.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const C={targetElements:[t],dispose:()=>{}},y=new Z,S=()=>a(!0,!0);y.add(pe(t,xe.BLUR,S,!0)),y.add(c(e.delay,!1,C)),o=y};let v;const w=t.tagName.toLowerCase();w!=="input"&&w!=="textarea"&&(v=pe(t,xe.FOCUS,m,!0));const b={show:C=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(C,y)=>{i=C,await r?.update(i,void 0,y)},dispose:()=>{this._existingHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._existingHovers.set(t,b),b}triggerUpdatableHover(e){const t=this._existingHovers.get(e);t&&t.show(!0)}dispose(){this._existingHovers.forEach(e=>e.dispose()),super.dispose()}};rbe=D([_(0,be),_(1,Vr),_(2,ti),_(3,bg),_(4,Ur)],rbe);function qHe(n){if(n!==void 0)return n?.id??n}class PEt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function QHe(n,e){for(e=e??gt(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}ce(el,rbe,Yt.Delayed);Lm((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const vO=ae("IWorkspaceEditService");class _Q{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(vS.is(t))return vS.lift(t);if(up.is(t))return up.lift(t);throw new Error("Unsupported edit")})}}class vS extends _Q{static is(e){return e instanceof vS?!0:fo(e)&&P.isUri(e.resource)&&fo(e.textEdit)}static lift(e){return e instanceof vS?e:new vS(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class up extends _Q{static is(e){return e instanceof up?!0:fo(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof up?e:new up(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const _h={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},ns="vs/editor/common/config/editorConfigurationSchema",sA=Object.freeze({id:"editor",order:5,type:"object",title:g(ns,0,"Editor"),scope:ut.LANGUAGE_OVERRIDABLE}),pee={...sA,properties:{"editor.tabSize":{type:"number",default:Ph.tabSize,minimum:1,markdownDescription:g(ns,1,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:g(ns,2,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ph.insertSpaces,markdownDescription:g(ns,3,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ph.detectIndentation,markdownDescription:g(ns,4,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ph.trimAutoWhitespace,description:g(ns,5,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ph.largeFileOptimizations,description:g(ns,6,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(ns,7,"Turn off Word Based Suggestions."),g(ns,8,"Only suggest words from the active document."),g(ns,9,"Suggest words from all open documents of the same language."),g(ns,10,"Suggest words from all open documents.")],description:g(ns,11,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[g(ns,12,"Semantic highlighting enabled for all color themes."),g(ns,13,"Semantic highlighting disabled for all color themes."),g(ns,14,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(ns,15,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(ns,16,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(ns,17,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(ns,18,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(ns,19,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(ns,20,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:g(ns,21,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(ns,24,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:_h.maxComputationTime,description:g(ns,25,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:_h.maxFileSize,description:g(ns,26,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:_h.renderSideBySide,description:g(ns,27,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:_h.renderSideBySideInlineBreakpoint,description:g(ns,28,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:_h.useInlineViewWhenSpaceIsLimited,description:g(ns,29,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:_h.renderMarginRevertIcon,description:g(ns,30,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:_h.renderGutterMenu,description:g(ns,31,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:_h.ignoreTrimWhitespace,description:g(ns,32,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:_h.renderIndicators,description:g(ns,33,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:_h.diffCodeLens,description:g(ns,34,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:_h.diffWordWrap,markdownEnumDescriptions:[g(ns,35,"Lines will never wrap."),g(ns,36,"Lines will wrap at the viewport width."),g(ns,37,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:_h.diffAlgorithm,markdownEnumDescriptions:[g(ns,38,"Uses the legacy diffing algorithm."),g(ns,39,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:_h.hideUnchangedRegions.enabled,markdownDescription:g(ns,40,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:_h.hideUnchangedRegions.revealLineCount,markdownDescription:g(ns,41,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:_h.hideUnchangedRegions.minimumLineCount,markdownDescription:g(ns,42,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:_h.hideUnchangedRegions.contextLineCount,markdownDescription:g(ns,43,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:_h.experimental.showMoves,markdownDescription:g(ns,44,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:_h.experimental.showEmptyDecorations,description:g(ns,45,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function FEt(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of HB){const e=n.schema;if(typeof e<"u")if(FEt(e))pee.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(pee.properties[t]=e[t])}let tK=null;function pJe(){return tK===null&&(tK=Object.create(null),Object.keys(pee.properties).forEach(n=>{tK[n]=!0})),tK}function OEt(n){return pJe()[`editor.${n}`]||!1}function BEt(n){return pJe()[`diffEditor.${n}`]||!1}const WEt=it.as(Cs.Configuration);WEt.registerConfiguration(pee);var md;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(md||(md={}));var xt;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(xt||(xt={}));var or;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(or||(or={}));var g7;(function(n){n.DEFAULT={allowTrailingComma:!0}})(g7||(g7={}));function mJe(n,e=!1){let t=0;const i=n.length;let s="",o=0,r=xt.Unknown,a=md.None;function c(m){let v=0,w=0;for(;v=si._0&&b<=si._9)w=w*16+b-si._0;else if(b>=si.A&&b<=si.F)w=w*16+b-si.A+10;else if(b>=si.a&&b<=si.f)w=w*16+b-si.a+10;else break;t++,v++}return v=i){m+=n.substring(v,t),a=md.UnexpectedEndOfString;break}const w=n.charCodeAt(t);if(w===si.doubleQuote){m+=n.substring(v,t),t++;break}if(w===si.backslash){if(m+=n.substring(v,t),t++,t>=i){a=md.UnexpectedEndOfString;break}switch(n.charCodeAt(t++)){case si.doubleQuote:m+='"';break;case si.backslash:m+="\\";break;case si.slash:m+="/";break;case si.b:m+="\b";break;case si.f:m+="\f";break;case si.n:m+=` -`;break;case si.r:m+="\r";break;case si.t:m+=" ";break;case si.u:{const C=c(4);C>=0?m+=String.fromCharCode(C):a=md.InvalidUnicode;break}default:a=md.InvalidEscapeCharacter}v=t;continue}if(w>=0&&w<=31)if(iK(w)){m+=n.substring(v,t),a=md.UnexpectedEndOfString;break}else a=md.InvalidCharacter;t++}return m}function u(){if(s="",a=md.None,o=t,t>=i)return o=i,r=xt.EOF;let m=n.charCodeAt(t);if(Tfe(m)){do t++,s+=String.fromCharCode(m),m=n.charCodeAt(t);while(Tfe(m));return r=xt.Trivia}if(iK(m))return t++,s+=String.fromCharCode(m),m===si.carriageReturn&&n.charCodeAt(t)===si.lineFeed&&(t++,s+=` -`),r=xt.LineBreakTrivia;switch(m){case si.openBrace:return t++,r=xt.OpenBraceToken;case si.closeBrace:return t++,r=xt.CloseBraceToken;case si.openBracket:return t++,r=xt.OpenBracketToken;case si.closeBracket:return t++,r=xt.CloseBracketToken;case si.colon:return t++,r=xt.ColonToken;case si.comma:return t++,r=xt.CommaToken;case si.doubleQuote:return t++,s=h(),r=xt.StringLiteral;case si.slash:{const v=t-1;if(n.charCodeAt(t+1)===si.slash){for(t+=2;t=xt.LineCommentTrivia&&m<=xt.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function Tfe(n){return n===si.space||n===si.tab||n===si.verticalTab||n===si.formFeed||n===si.nonBreakingSpace||n===si.ogham||n>=si.enQuad&&n<=si.zeroWidthSpace||n===si.narrowNoBreakSpace||n===si.mathematicalSpace||n===si.ideographicSpace||n===si.byteOrderMark}function iK(n){return n===si.lineFeed||n===si.carriageReturn||n===si.lineSeparator||n===si.paragraphSeparator}function GO(n){return n>=si._0&&n<=si._9}var si;(function(n){n[n.nullCharacter=0]="nullCharacter",n[n.maxAsciiCharacter=127]="maxAsciiCharacter",n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.lineSeparator=8232]="lineSeparator",n[n.paragraphSeparator=8233]="paragraphSeparator",n[n.nextLine=133]="nextLine",n[n.space=32]="space",n[n.nonBreakingSpace=160]="nonBreakingSpace",n[n.enQuad=8192]="enQuad",n[n.emQuad=8193]="emQuad",n[n.enSpace=8194]="enSpace",n[n.emSpace=8195]="emSpace",n[n.threePerEmSpace=8196]="threePerEmSpace",n[n.fourPerEmSpace=8197]="fourPerEmSpace",n[n.sixPerEmSpace=8198]="sixPerEmSpace",n[n.figureSpace=8199]="figureSpace",n[n.punctuationSpace=8200]="punctuationSpace",n[n.thinSpace=8201]="thinSpace",n[n.hairSpace=8202]="hairSpace",n[n.zeroWidthSpace=8203]="zeroWidthSpace",n[n.narrowNoBreakSpace=8239]="narrowNoBreakSpace",n[n.ideographicSpace=12288]="ideographicSpace",n[n.mathematicalSpace=8287]="mathematicalSpace",n[n.ogham=5760]="ogham",n[n._=95]="_",n[n.$=36]="$",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.ampersand=38]="ampersand",n[n.asterisk=42]="asterisk",n[n.at=64]="at",n[n.backslash=92]="backslash",n[n.bar=124]="bar",n[n.caret=94]="caret",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.closeParen=41]="closeParen",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.equals=61]="equals",n[n.exclamation=33]="exclamation",n[n.greaterThan=62]="greaterThan",n[n.lessThan=60]="lessThan",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.openParen=40]="openParen",n[n.percent=37]="percent",n[n.plus=43]="plus",n[n.question=63]="question",n[n.semicolon=59]="semicolon",n[n.singleQuote=39]="singleQuote",n[n.slash=47]="slash",n[n.tilde=126]="tilde",n[n.backspace=8]="backspace",n[n.formFeed=12]="formFeed",n[n.byteOrderMark=65279]="byteOrderMark",n[n.tab=9]="tab",n[n.verticalTab=11]="verticalTab"})(si||(si={}));function ow(n,e=[],t=g7.DEFAULT){let i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}return SNe(n,{onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),s[0]}function _Je(n,e=[],t=g7.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}SNe(n,{onObjectBegin:c=>{i=o({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=o({type:"property",offset:l,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:c,offset:l,length:d,parent:i})},onObjectEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onArrayBegin:(c,l)=>{i=o({type:"array",offset:c,length:-1,parent:i,children:[]})},onArrayEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onLiteralValue:(c,l,d)=>{o({type:HW(c),offset:l,length:d,parent:i,value:c}),s(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&s(l))},onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t);const a=i.children[0];return a&&delete a.parent,a}function abe(n,e){if(!n)return;let t=n;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let s=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],s=!0;break}if(!s)return}else{const s=i;if(t.type!=="array"||s<0||!Array.isArray(t.children)||s>=t.children.length)return;t=t.children[s]}return t}function SNe(n,e,t=g7.DEFAULT){const i=mJe(n,!1);function s(N){return N?()=>N(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(N){return N?z=>N(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=s(e.onObjectBegin),a=o(e.onObjectProperty),c=s(e.onObjectEnd),l=s(e.onArrayBegin),d=s(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=s(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function w(){for(;;){const N=i.scan();switch(i.getTokenError()){case md.InvalidUnicode:b(or.InvalidUnicode);break;case md.InvalidEscapeCharacter:b(or.InvalidEscapeCharacter);break;case md.UnexpectedEndOfNumber:b(or.UnexpectedEndOfNumber);break;case md.UnexpectedEndOfComment:m||b(or.UnexpectedEndOfComment);break;case md.UnexpectedEndOfString:b(or.UnexpectedEndOfString);break;case md.InvalidCharacter:b(or.InvalidCharacter);break}switch(N){case xt.LineCommentTrivia:case xt.BlockCommentTrivia:m?b(or.InvalidCommentToken):f();break;case xt.Unknown:b(or.InvalidSymbol);break;case xt.Trivia:case xt.LineBreakTrivia:break;default:return N}}}function b(N,z=[],U=[]){if(p(N),z.length+U.length>0){let J=i.getToken();for(;J!==xt.EOF;){if(z.indexOf(J)!==-1){w();break}else if(U.indexOf(J)!==-1)break;J=w()}}}function C(N){const z=i.getTokenValue();return N?h(z):a(z),w(),!0}function y(){switch(i.getToken()){case xt.NumericLiteral:{let N=0;try{N=JSON.parse(i.getTokenValue()),typeof N!="number"&&(b(or.InvalidNumberFormat),N=0)}catch{b(or.InvalidNumberFormat)}h(N);break}case xt.NullKeyword:h(null);break;case xt.TrueKeyword:h(!0);break;case xt.FalseKeyword:h(!1);break;default:return!1}return w(),!0}function S(){return i.getToken()!==xt.StringLiteral?(b(or.PropertyNameExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!1):(C(!1),i.getToken()===xt.ColonToken?(u(":"),w(),F()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken])):b(or.ColonExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!0)}function M(){r(),w();let N=!1;for(;i.getToken()!==xt.CloseBraceToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBraceToken&&v)break}else N&&b(or.CommaExpected,[],[]);S()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken]),N=!0}return c(),i.getToken()!==xt.CloseBraceToken?b(or.CloseBraceExpected,[xt.CloseBraceToken],[]):w(),!0}function k(){l(),w();let N=!1;for(;i.getToken()!==xt.CloseBracketToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBracketToken&&v)break}else N&&b(or.CommaExpected,[],[]);F()||b(or.ValueExpected,[],[xt.CloseBracketToken,xt.CommaToken]),N=!0}return d(),i.getToken()!==xt.CloseBracketToken?b(or.CloseBracketExpected,[xt.CloseBracketToken],[]):w(),!0}function F(){switch(i.getToken()){case xt.OpenBracketToken:return k();case xt.OpenBraceToken:return M();case xt.StringLiteral:return C(!0);default:return y()}}return w(),i.getToken()===xt.EOF?t.allowEmptyContent?!0:(b(or.ValueExpected,[],[]),!1):F()?(i.getToken()!==xt.EOF&&b(or.EndOfFileExpected,[],[]),!0):(b(or.ValueExpected,[],[]),!1)}function HW(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(n){if(Array.isArray(n))return"array"}else return"null";return"object"}default:return"null"}}class HEt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===Q.Slash||this._splitOnBackslash&&i===Q.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Su(new VEt(e,t))}static forPaths(e=!1){return new Su(new N$(void 0,!e))}static forStrings(){return new Su(new HEt)}static forConfigKeys(){return new Su(new UEt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);FBe(i);for(const s of i)this.set(s,e)}else{const i=e.slice(0);FBe(i);for(const s of i)this.set(s[0],s[1])}}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new nK,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new nK,s.left.segment=i.value()),o.push([Bc.Left,s]),s=s.left;else if(a<0)s.right||(s.right=new nK,s.right.segment=i.value()),o.push([Bc.Right,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new nK,s.mid.segment=i.value()),o.push([Bc.Mid,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=o[a][0],h=o[a+1][0];if(d===Bc.Right&&h===Bc.Right)o[a][1]=c.rotateLeft();else if(d===Bc.Left&&h===Bc.Left)o[a][1]=c.rotateRight();else if(d===Bc.Right&&h===Bc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===Bc.Left&&h===Bc.Right)c.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case Bc.Left:o[a-1][1].left=o[a][1];break;case Bc.Right:o[a-1][1].right=o[a][1];break;case Bc.Mid:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){return this._getNode(e)?.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)s.push([Bc.Left,o]),o=o.left;else if(r<0)s.push([Bc.Right,o]),o=o.right;else if(i.hasNext())i.next(),s.push([Bc.Mid,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=this._min(o.right);if(r.key){const{key:a,value:c,segment:l}=r;this._delete(r.key,!1),o.key=a,o.value=c,o.segment=l}}else{const r=o.left??o.right;if(s.length>0){const[a,c]=s[s.length-1];switch(a){case Bc.Left:c.left=r;break;case Bc.Mid:c.mid=r;break;case Bc.Right:c.right=r;break}}else this._root=r}for(let r=s.length-1;r>=0;r--){const a=s[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),s[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),s[r][1]=a.rotateRight()),r>0)switch(s[r-1][0]){case Bc.Left:s[r-1][1].left=s[r][1];break;case Bc.Right:s[r-1][1].right=s[r][1];break;case Bc.Mid:s[r-1][1].mid=s[r][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}const mB="vs/platform/files/common/files";var an;(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(an||(an={}));var wm;(function(n){n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked"})(wm||(wm={}));var JD;(function(n){n[n.UPDATED=2]="UPDATED",n[n.ADDED=4]="ADDED",n[n.DELETED=8]="DELETED"})(JD||(JD={}));var es;(function(n){n[n.None=0]="None",n[n.FileReadWrite=2]="FileReadWrite",n[n.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",n[n.FileReadStream=16]="FileReadStream",n[n.FileFolderCopy=8]="FileFolderCopy",n[n.PathCaseSensitive=1024]="PathCaseSensitive",n[n.Readonly=2048]="Readonly",n[n.Trash=4096]="Trash",n[n.FileWriteUnlock=8192]="FileWriteUnlock",n[n.FileAtomicRead=16384]="FileAtomicRead",n[n.FileAtomicWrite=32768]="FileAtomicWrite",n[n.FileAtomicDelete=65536]="FileAtomicDelete",n[n.FileClone=131072]="FileClone"})(es||(es={}));function sv(n){return!!(n.capabilities&es.FileReadWrite)}function jHe(n){return!!(n.capabilities&es.FileFolderCopy)}function zEt(n){return!!(n.capabilities&es.FileClone)}function mD(n){return!!(n.capabilities&es.FileOpenReadWriteClose)}function dJ(n){return!!(n.capabilities&es.FileReadStream)}function Rfe(n){return sv(n)?!!(n.capabilities&es.FileAtomicRead):!1}function KHe(n){return sv(n)?!!(n.capabilities&es.FileAtomicWrite):!1}function $Et(n){return!!(n.capabilities&es.FileAtomicDelete)}function GEt(n){return!!(n.capabilities&es.Readonly)}var rt;(function(n){n.FileExists="EntryExists",n.FileNotFound="EntryNotFound",n.FileNotADirectory="EntryNotADirectory",n.FileIsADirectory="EntryIsADirectory",n.FileExceedsStorageQuota="EntryExceedsStorageQuota",n.FileTooLarge="EntryTooLarge",n.FileWriteLocked="EntryWriteLocked",n.NoPermissions="NoPermissions",n.Unavailable="Unavailable",n.Unknown="Unknown"})(rt||(rt={}));class Nx extends Error{static create(e,t){const i=new Nx(e.toString(),t);return vJe(i,t),i}constructor(e,t){super(e),this.code=t}}function xs(n,e){return Nx.create(n,e)}function qL(n){return n||xs(g(mB,0,"Unknown Error"),rt.Unknown)}function vJe(n,e){return n.name=e?`${e} (FileSystemError)`:"FileSystemError",n}function w1(n){if(!n)return rt.Unknown;if(n instanceof Nx)return n.code;const e=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!e)return rt.Unknown;switch(e[1]){case rt.FileExists:return rt.FileExists;case rt.FileIsADirectory:return rt.FileIsADirectory;case rt.FileNotADirectory:return rt.FileNotADirectory;case rt.FileNotFound:return rt.FileNotFound;case rt.FileTooLarge:return rt.FileTooLarge;case rt.FileWriteLocked:return rt.FileWriteLocked;case rt.NoPermissions:return rt.NoPermissions;case rt.Unavailable:return rt.Unavailable}return rt.Unknown}function Cy(n){if(n instanceof Ah)return n.fileOperationResult;switch(w1(n)){case rt.FileNotFound:return Zi.FILE_NOT_FOUND;case rt.FileIsADirectory:return Zi.FILE_IS_DIRECTORY;case rt.FileNotADirectory:return Zi.FILE_NOT_DIRECTORY;case rt.FileWriteLocked:return Zi.FILE_WRITE_LOCKED;case rt.NoPermissions:return Zi.FILE_PERMISSION_DENIED;case rt.FileExists:return Zi.FILE_MOVE_CONFLICT;case rt.FileTooLarge:return Zi.FILE_TOO_LARGE;default:return Zi.FILE_OTHER_ERROR}}var Li;(function(n){n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.MOVE=2]="MOVE",n[n.COPY=3]="COPY",n[n.WRITE=4]="WRITE"})(Li||(Li={}));class qO{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var Ko;(function(n){n[n.UPDATED=0]="UPDATED",n[n.ADDED=1]="ADDED",n[n.DELETED=2]="DELETED"})(Ko||(Ko={}));const z2=class z2{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new Ya(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(s=>[s,!0])),i}),this.updated=new Ya(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(s=>[s,!0])),i}),this.deleted=new Ya(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(s=>[s,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case Ko.ADDED:this.rawAdded.push(i.resource);break;case Ko.UPDATED:this.rawUpdated.push(i.resource);break;case Ko.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==z2.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=z2.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=z2.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...i){if(!e)return!1;const s=i.length>0;return!!((!s||i.includes(Ko.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!s||i.includes(Ko.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!s||i.includes(Ko.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}};z2.MIXED_CORRELATION=null;let mee=z2;class Ah extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class hJ extends Ah{constructor(e,t,i,s){super(e,t,s),this.fileOperationResult=t,this.size=i}}class P$ extends Ah{constructor(e,t,i){super(e,Zi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Zi;(function(n){n[n.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",n[n.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",n[n.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",n[n.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",n[n.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",n[n.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",n[n.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",n[n.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",n[n.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",n[n.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",n[n.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Zi||(Zi={}));const $l={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Ng={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},ANe="files.associations",qEt="files.exclude",wJe="files.readonlyInclude",bJe="files.readonlyExclude",QEt="files.readonlyFromPermissions";var Lc;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Lc||(Lc={}));const zv="";function _ee(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}async function CJe(n,e){if(!e.hasProvider(P.from({scheme:n.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(s=>{s.scheme===n.scheme&&s.added&&(i.dispose(),t())})})}const Wd=class Wd{static formatSize(e){return Kc(e)||(e=0),e{if(t instanceof _s)return t;const i=new Px("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?AZ(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return C3(i.rawConfiguration.getValue(e))},get override(){return t?C3(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return C3(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new _s(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&s.push({identifiers:r,value:c})}return s.length?C3(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?AZ(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Tc(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Tc(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=Vs(this.contents),i=Vs(this.overrides),s=[...this.keys],o=this.raw?.length?[...this.raw]:[this];for(const r of e)if(o.push(...r.raw?.length?r.raw:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[c]=i.filter(l=>Ls(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=Tc(c.keys)):i.push(Vs(a))}for(const a of r.keys)s.indexOf(a)===-1&&s.push(a)}return new _s(t,s,i,o.every(r=>r instanceof _s)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Tc([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Vs(o),this.mergeContents(o,r)):o=r),i[s]=o}return new _s(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&fo(e[i])&&fo(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Vs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Vs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Eft(this.contents,e),dp.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ls(i.identifiers,H9(e))),1))}updateValue(e,t,i){Bje(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),dp.test(e)&&this.overrides.push({identifiers:H9(e),keys:Object.keys(this.contents[e]),contents:W9(this.contents[e],s=>this.logService.error(s))})}}class Px{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||_s.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!hc(e)){const i=this.doParseContent(e);this.parseRaw(i,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new _s(i,s,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{SNe(e,a),t=s[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=W9(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),r=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){let o=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(dp.test(c)&&i){const l=this.filter(e[c],t,!1,s);r[c]=l.raw,o=o||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:ut.WINDOW:void 0;l?.restricted&&a.push(c),!s.exclude?.includes(c)&&(s.include?.includes(c)||(d===void 0||s.scopes===void 0||s.scopes.includes(d))&&!(s.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(dp.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:H9(s),keys:Object.keys(o),contents:W9(o,t)})}return i}}class yJe extends ${constructor(e,t,i,s,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=s,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new Px(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(T.any(T.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),T.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Li.CREATE)||r.isOperation(Li.COPY)||r.isOperation(Li.DELETE)||r.isOperation(Li.WRITE))&&i.isEqual(r.resource,e)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const e=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(e.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class KEt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return C3(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}}let f7=class SJe{constructor(e,t,i,s,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new wi,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=_s.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const c of s.overrides)for(const l of c.identifiers)s.getOverrideValue(e,l)!==void 0&&a.add(l);return new KEt(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){const i=[];if(!t){const{added:s,updated:o,removed:r}=_D(this._defaultConfiguration,e);t=[...s,...o,...r]}for(const s of t)for(const o of H9(s)){const r=this._defaultConfiguration.getKeysForOverrideIdentifier(o),a=e.getKeysForOverrideIdentifier(o),c=[...a.filter(l=>r.indexOf(l)===-1),...r.filter(l=>a.indexOf(l)===-1),...r.filter(l=>!Io(this._defaultConfiguration.override(o).getValue(l),e.override(o).getValue(l)))];i.push([o,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:s}=_D(this._policyConfiguration,e),o=[...t,...i,...s];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.applicationConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.localUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.remoteUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.workspaceConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:s,updated:o,removed:r,overrides:a}=_D(i,t),c=[...s,...o,...r];return(c.length||!i)&&this.updateFolderConfiguration(e,t),{keys:c,overrides:a}}compareAndDeleteFolderConfiguration(e){const t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:i,updated:s,removed:o,overrides:r}=_D(t,void 0);return{keys:[...i,...s,...o],overrides:r}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(i=>e.add(i))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(i=>e.add(i))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(e).forEach(s=>t.add(s))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((l,d)=>(l.set(P.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new wi);return new SJe(i,s,o,r,_s.createEmptyModel(t),a,c,_s.createEmptyModel(t),new wi,t)}static parseConfigurationModel(e,t){return new _s(e.contents,e.keys,e.overrides,void 0,t)}};function YHe(...n){if(n.length===0)return{keys:[],overrides:[]};if(n.length===1)return n[0];const e=new Set,t=new Map;for(const s of n)s.keys.forEach(o=>e.add(o)),s.overrides.forEach(([o,r])=>{const a=XX(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((s,o)=>i.push([o,[...s.values()]])),{keys:[...e.values()],overrides:i}}class ENe{constructor(e,t,i,s,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=o,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=f7.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const o=s+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Io(a,c)}return!0}}function _D(n,e){const{added:t,removed:i,updated:s}=JHe(e?.rawConfiguration,n?.rawConfiguration),o=[],r=n?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!r.includes(l));for(const l of c)o.push([l,e.getKeysForOverrideIdentifier(l)])}if(n){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,n.getKeysForOverrideIdentifier(l)])}if(e&&n){for(const c of r)if(a.includes(c)){const l=JHe({contents:n.getOverrideValue(void 0,c)||{},keys:n.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});o.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:s,overrides:o}}function JHe(n,e){const t=n?e?n.keys.filter(o=>e.keys.indexOf(o)===-1):[...n.keys]:[],i=e?n?e.keys.filter(o=>n.keys.indexOf(o)===-1):[...e.keys]:[],s=[];if(n&&e){for(const o of e.keys)if(n.keys.indexOf(o)!==-1){const r=AZ(e.contents,o),a=AZ(n.contents,o);Io(r,a)||s.push(o)}}return{added:t,removed:i,updated:s}}const sK="vs/platform/keybinding/common/abstractKeybindingService",YEt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class JEt extends ${get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:T.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new nQ,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new O_,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}getDefaultKeybindingsContent(){return""}toggleLogging(){return this._logging=!this._logging,this._logging}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getDefaultKeybindings(){return this._getResolver().getDefaultKeybindings()}getKeybindings(){return this._getResolver().getKeybindings()}customKeybindingsCount(){return 0}lookupKeybindings(e){return Vi(this._getResolver().lookupKeybindings(e).map(t=>t.resolvedKeybinding))}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),gee;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),gee;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Nle("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(sK,0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(sK,1,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),b$.enabled&&b$.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],b$.enable()}dispatchByUserSettingsLabel(e,t){this._log(`/ Dispatching keybinding triggered via menu entry accelerator - ${e}`);const i=this.resolveUserBinding(e);i.length===0?this._log(`\\ Could not resolve - ${e}`):this._doDispatch(i[0],t,!1)}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new s2(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case hp.NoMatchingKb:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case hp.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case hp.KbFound:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${l.commandId} ]`),l.commandId===null||l.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(s=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{typeof l.commandArgs>"u"?this._commandService.executeCommand(l.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}YEt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=E.KeyA&&e.keyCode<=E.KeyZ||e.keyCode>=E.Digit0&&e.keyCode<=E.Digit9}}const yae=class yae{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};yae.EMPTY=new yae(null);let s2=yae;class vee{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?cbe(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=cbe(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===Q.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function cbe(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return AJe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:XEt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return EJe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}isWYSIWYG(){return this._chords.every(e=>this._isWYSIWYG(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Dht(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class XU extends ext{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Pr.Macintosh)switch(e){case E.LeftArrow:return"←";case E.UpArrow:return"↑";case E.RightArrow:return"→";case E.DownArrow:return"↓"}return iE.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":iE.toString(e.keyCode)}_getElectronAccelerator(e){return iE.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=iE.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return XU.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=iE.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===E.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===E.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===E.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===E.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=tMe[e];if(t!==E.DependsOnKbLayout)return t;switch(e){case ue.KeyA:return E.KeyA;case ue.KeyB:return E.KeyB;case ue.KeyC:return E.KeyC;case ue.KeyD:return E.KeyD;case ue.KeyE:return E.KeyE;case ue.KeyF:return E.KeyF;case ue.KeyG:return E.KeyG;case ue.KeyH:return E.KeyH;case ue.KeyI:return E.KeyI;case ue.KeyJ:return E.KeyJ;case ue.KeyK:return E.KeyK;case ue.KeyL:return E.KeyL;case ue.KeyM:return E.KeyM;case ue.KeyN:return E.KeyN;case ue.KeyO:return E.KeyO;case ue.KeyP:return E.KeyP;case ue.KeyQ:return E.KeyQ;case ue.KeyR:return E.KeyR;case ue.KeyS:return E.KeyS;case ue.KeyT:return E.KeyT;case ue.KeyU:return E.KeyU;case ue.KeyV:return E.KeyV;case ue.KeyW:return E.KeyW;case ue.KeyX:return E.KeyX;case ue.KeyY:return E.KeyY;case ue.KeyZ:return E.KeyZ;case ue.Digit1:return E.Digit1;case ue.Digit2:return E.Digit2;case ue.Digit3:return E.Digit3;case ue.Digit4:return E.Digit4;case ue.Digit5:return E.Digit5;case ue.Digit6:return E.Digit6;case ue.Digit7:return E.Digit7;case ue.Digit8:return E.Digit8;case ue.Digit9:return E.Digit9;case ue.Digit0:return E.Digit0;case ue.Minus:return E.Minus;case ue.Equal:return E.Equal;case ue.BracketLeft:return E.BracketLeft;case ue.BracketRight:return E.BracketRight;case ue.Backslash:return E.Backslash;case ue.IntlHash:return E.Unknown;case ue.Semicolon:return E.Semicolon;case ue.Quote:return E.Quote;case ue.Backquote:return E.Backquote;case ue.Comma:return E.Comma;case ue.Period:return E.Period;case ue.Slash:return E.Slash;case ue.IntlBackslash:return E.IntlBackslash}return E.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof RS)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===E.Unknown?null:new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=cbe(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new XU(i,t)]:[]}}const eo=ae("labelService"),Cf=ae("progressService"),eD=ae("editorProgressService"),xJe="telemetry.telemetryLevel",txt="telemetry.enableCrashReporter",DJe="telemetry.enableTelemetry";var sp;(function(n){n[n.NONE=0]="NONE",n[n.CRASH=1]="CRASH",n[n.ERROR=2]="ERROR",n[n.USAGE=3]="USAGE"})(sp||(sp={}));var LT;(function(n){n.OFF="off",n.CRASH="crash",n.ERROR="error",n.ON="all"})(LT||(LT={}));const ixt="vs/platform/workspace/common/workspace";function BS(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.uri)}function nxt(n){return typeof n?.id=="string"&&!BS(n)&&!hF(n)}const xNe={id:"empty-window"};function UW(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:yr(n)}:xNe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function hF(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.configPath)}var Nn;(function(n){n[n.EMPTY=1]="EMPTY",n[n.FOLDER=2]="FOLDER",n[n.WORKSPACE=3]="WORKSPACE"})(Nn||(Nn={}));function lbe(n){const e=n;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function sxt(n){const e=n;return!!(e&&typeof e=="object"&&P.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let kJe=class{constructor(e,t,i,s,o){this._id=e,this._transient=i,this._configuration=s,this._ignorePathCasing=o,this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._ignorePathCasing=e._ignorePathCasing,this.folders=e.folders}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this._foldersMap.findSubstr(e)||null}updateFoldersMap(){this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0);for(const e of this.folders)this._foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}},Cde=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Qt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function wee(n){return new Cde({uri:n,index:0,name:Mx(n)},{uri:n.toString()})}const qb="code-workspace",IJe=`.${qb}`,oxt=[{name:g(ixt,0,"Code Workspace"),extensions:[qb]}];function p7(n,e){return QQe.isEqualOrParent(n,e.untitledWorkspacesHome)}function hx(n){let e;return P.isUri(n)?e=n:e=n.configuration,e?.scheme===_e.tmp}const LJe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function rxt(n){return n.id===LJe}function dbe(n,e){return!p7(n,e)&&!hx(n)}function yde(n){return(typeof n=="string"?T_(n):uz(n))===IJe}const Ti=ae("contextService"),Hc="vs/editor/common/standaloneStrings";var Xm;(function(n){n.accessibilityHelpTitle=g(Hc,0,"Accessibility Help"),n.openingDocs=g(Hc,1,"Opening the Accessibility documentation page."),n.readonlyDiffEditor=g(Hc,2,"You are in a read-only pane of a diff editor."),n.editableDiffEditor=g(Hc,3,"You are in a pane of a diff editor."),n.readonlyEditor=g(Hc,4,"You are in a read-only code editor."),n.editableEditor=g(Hc,5,"You are in a code editor."),n.changeConfigToOnMac=g(Hc,6,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),n.changeConfigToOnWinLinux=g(Hc,7,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),n.auto_on=g(Hc,8,"The application is configured to be optimized for usage with a Screen Reader."),n.auto_off=g(Hc,9,"The application is configured to never be optimized for usage with a Screen Reader."),n.screenReaderModeEnabled=g(Hc,10,"Screen Reader Optimized Mode enabled."),n.screenReaderModeDisabled=g(Hc,11,"Screen Reader Optimized Mode disabled."),n.tabFocusModeOnMsg=g(Hc,12,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior"),n.tabFocusModeOffMsg=g(Hc,13,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior"),n.stickScroll=g(Hc,14,"Focus Sticky Scroll to focus the currently nested scopes."),n.showAccessibilityHelpAction=g(Hc,15,"Show Accessibility Help"),n.listSignalSounds=g(Hc,16,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),n.listAlerts=g(Hc,17,"Run the command: List Signal Announcements for an overview of announcements and their current status."),n.quickChat=g(Hc,18,"Toggle quick chat to open or close a chat session."),n.startInlineChat=g(Hc,19,"Start inline chat to create an in editor chat session.")})(Xm||(Xm={}));var XHe;(function(n){n.inspectTokensAction=g(Hc,20,"Developer: Inspect Tokens")})(XHe||(XHe={}));var bee;(function(n){n.editorViewAccessibleLabel=g(Hc,27,"Editor content"),n.accessibilityHelpMessage=g(Hc,28,"Press Alt+F1 for Accessibility Options.")})(bee||(bee={}));var ZHe;(function(n){n.toggleHighContrast=g(Hc,29,"Toggle High Contrast Theme")})(ZHe||(ZHe={}));var hbe;(function(n){n.bulkEditServiceSummary=g(Hc,30,"Made {0} edits in {1} files")})(hbe||(hbe={}));const Sde=ae("workspaceTrustEnablementService"),oA=ae("workspaceTrustManagementService"),Ade=ae("workspaceTrustRequestService");let b1=[],DNe=[],kNe=[];function oK(n,e=!1){TJe(n,!1,e)}function axt(n){TJe(n,!0,!1)}function TJe(n,e,t){const i=cxt(n,e);b1.push(i),i.userConfigured?kNe.push(i):DNe.push(i),t&&!i.userConfigured&&b1.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function cxt(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?_w(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Qi.sep)>=0:!1}}function lxt(){b1=b1.filter(n=>n.userConfigured),DNe=[]}function dxt(){b1=b1.filter(n=>!n.userConfigured),kNe=[]}function hxt(n,e){return uxt(n,e).map(t=>t.id)}function uxt(n,e){let t;if(n)switch(n.scheme){case _e.file:t=n.fsPath;break;case _e.data:{t=h1.parseMetaData(n).get(h1.META_DATA_LABEL);break}case _e.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Js.unknown}];t=t.toLowerCase();const i=yr(t),s=eUe(t,i,kNe);if(s)return[s,{id:Yc,mime:Js.text}];const o=eUe(t,i,DNe);if(o)return[o,{id:Yc,mime:Js.text}];if(e){const r=gxt(e);if(r)return[r,{id:Yc,mime:Js.text}]}return[{id:"unknown",mime:Js.unknown}]}function eUe(n,e,t){let i,s,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!s||a.filepattern.length>s.filepattern.length)){const c=a.filepatternOnPath?n:e;a.filepatternLowercase?.(c)&&(s=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(s)return s;if(o)return o}function gxt(n){if(ZRe(n)&&(n=n.substr(1)),n.length>0)for(let e=b1.length-1;e>=0;e--){const t=b1[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Hw=Object.prototype.hasOwnProperty,tUe="vs.editor.nullLanguage";class fxt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(tUe,lM.Null),this._register(Yc,lM.PlainText),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||lM.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||tUe}}const Q8=class Q8 extends ${constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Q8.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new fxt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(hM.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Q8.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},lxt();const e=[].concat(hM.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return hM.registerLanguage(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),it.as(Cs.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Hw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)oK({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)oK({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)oK({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const c=new RegExp(a);YRe(c)||oK({id:i,mime:s,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Hw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)Hw.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>mE(t.languageName,i.languageName)),e}getLanguageName(e){return Hw.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return Hw.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return Hw.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return Hw.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return Hw.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return Hw.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Hw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Hw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:hxt(e,t)}};Q8.instanceCount=0;let ube=Q8;const j8=class j8 extends ${constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new I),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new I),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new I({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,j8.instanceCount++,this._registry=this._register(new ube(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){j8.instanceCount--,super.dispose()}registerLanguage(e){return this._registry.registerLanguage(e)}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getRegisteredLanguageIds(){return this._registry.getRegisteredLanguageIds()}getSortedRegisteredLanguageNames(){return this._registry.getSortedRegisteredLanguageNames()}getLanguageName(e){return this._registry.getLanguageName(e)}getMimeType(e){return this._registry.getMimeType(e)}getIcon(e){return this._registry.getIcon(e)}getExtensions(e){return this._registry.getExtensions(e)}getFilenames(e){return this._registry.getFilenames(e)}getConfigurationFiles(e){return this._registry.getConfigurationFiles(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return k_(i,null)}createById(e){return new Mfe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Mfe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Mfe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Yc),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),dc.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};j8.instanceCount=0;let Cee=j8;class Mfe{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new I({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter?.fire(this.languageId))}}class pxt extends ${constructor(e,t){super(),this._register(pe(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(pe(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const fm={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Js.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},mxt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Ede=mxt;const _xt=new Ya(()=>Ede("mouse",!1)),vxt=new Ya(()=>Ede("element",!1));function RJe(n){Ede=n}function va(n){return n==="element"?vxt.value:_xt.value}function C1(){return Ede("element",!0)}class wxt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}function MJe(n){return(e,t,i)=>{let s=null,o=null;if(typeof i.value=="function"?(s="value",o=i.value):typeof i.get=="function"&&(s="get",o=i.get),!o)throw new Error("not supported");i[s]=n(o,t)}}function ii(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}function INe(n,e,t){return MJe((i,s)=>{const o=`$debounce$${s}`,r=`$debounce$result$${s}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},n)}})}function bxt(n,e,t){return MJe((i,s)=>{const o=`$throttle$timer$${s}`,r=`$throttle$result$${s}`,a=`$throttle$lastRun$${s}`,c=`$throttle$pending$${s}`;return function(...l){if(this[r]||(this[r]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[r]=e(this[r],...l)),this[c])return;const d=this[a]+n;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0):(this[c]=!0,this[o]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0},d-Date.now()))}})}var Cxt=".monaco-list{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{height:100%;position:relative;width:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{min-width:100%;width:auto}.monaco-list-row{box-sizing:border-box;overflow:hidden;position:absolute;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{border-radius:10px;display:inline-block;font-size:12px;padding:1px 7px;position:absolute;z-index:1000}.monaco-list-type-filter-message{box-sizing:border-box;height:100%;left:0;opacity:.7;padding:40px 1em 1em;pointer-events:none;position:absolute;text-align:center;top:0;white-space:normal;width:100%}.monaco-list-type-filter-message:empty{display:none}";Ct(Cxt,{});var _R;(function(n){n[n.Copy=0]="Copy",n[n.Move=1]="Move"})(_R||(_R={}));var iS;(function(n){n.Over="drop-target",n.Before="drop-target-before",n.After="drop-target-after"})(iS||(iS={}));class SL extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function iUe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Axt{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=iUe({start:0,end:e},this.groups),r=iUe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:gbe(c.range,s),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=Sxt(o,a,r),this._size=this._paddingTop+this.groups.reduce((c,l)=>c+l.size*(l.range.end-l.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}const AL={CurrentDragAndDropData:void 0};var AA;(function(n){n[n.TOP=0]="TOP",n[n.CENTER_TOP=1]="CENTER_TOP",n[n.CENTER_BOTTOM=2]="CENTER_BOTTOM",n[n.BOTTOM=3]="BOTTOM"})(AA||(AA={}));const bC={useShadows:!0,verticalScrollMode:zo.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class vQ{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NJe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class fbe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const Sae=class Sae{get contentHeight(){return this.rangeMap.size}get contentWidth(){return this.scrollWidth??0}get onDidScroll(){return this.scrollableElement.onScroll}get onWillScroll(){return this.scrollableElement.onWillScroll}get containerDomNode(){return this.rowsContainer}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:h$(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=bC){if(this.virtualDelegate=t,this.domId=`list_id_${++Sae.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Lu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=$.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=$.None,this.onDragLeaveTimeout=$.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=T.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=T.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new xxt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??bC.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new kxt(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??bC.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(dh.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new nO({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>xd(gt(this.domNode),r)})),this.scrollableElement=this.disposables.add(new hQ(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??bC.alwaysConsumeMouseWheel,horizontal:zo.Auto,vertical:s.verticalScrollMode??bC.verticalScrollMode,useShadows:s.useShadows??bC.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(pe(this.rowsContainer,Eo.Change,r=>this.onTouchChange(r))),this.disposables.add(pe(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(pe(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=s.setRowLineHeight??bC.setRowLineHeight,this.setRowHeight=s.setRowHeight??bC.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??bC.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(bC.dnd),this.layout(s.initialSize?.height,s.initialSize?.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}delegateScrollFromMouseWheelEvent(e){this.scrollableElement.delegateScrollFromMouseWheelEvent(e)}delegateVerticalScrollbarPointerDown(e){this.scrollableElement.delegateVerticalScrollbarPointerDown(e)}updateElementHeight(e,t,i){if(e<0||e>=this.items.length)return;const s=this.items[e].size;if(typeof t>"u"){if(!this.supportDynamicHeights){console.warn("Dynamic heights not supported");return}this.items[e].lastDynamicHeightWidth=void 0,t=s+this.probeDynamicHeight(e)}if(s===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;S--){const M=this.items[S];if(M.dragStartDisposable.dispose(),M.checkedDisposable.dispose(),M.row){let k=a.get(M.templateId);k||(k=[],a.set(M.templateId,k));const F=this.renderers.get(M.templateId);F&&F.disposeElement&&F.disposeElement(M.element,S,M.row.templateData,M.size),k.unshift(M.row)}M.row=null,M.stale=!0}const c={start:e+t,end:this.items.length},l=Dh.intersect(c,s),d=Dh.relativeComplement(c,s),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:$.None,checkedDisposable:$.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));const f=i.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=gbe(l,f),v=Dh.intersect(p,m);for(let S=v.start;Sgbe(S,f)),y=[{start:e,end:e+i.length},...b].map(S=>Dh.intersect(p,S)).reverse();for(const S of y)for(let M=S.end-1;M>=S.start;M--){const k=this.items[M],N=a.get(k.templateId)?.pop();this.insertItemInDOM(M,N)}for(const S of a.values())for(const M of S)this.cache.release(M);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=xd(gt(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}updateWidth(e){if(!this.horizontalScrolling||typeof this.scrollWidth>"u")return;const t=this.items[e];this.measureItemWidth(t),typeof t.width<"u"&&t.width>this.scrollWidth&&(this.scrollWidth=t.width,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth+10}),this._onDidChangeContentWidth.fire(this.scrollWidth))}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}get firstMostlyVisibleIndex(){const e=this.firstVisibleIndex,t=this.rangeMap.positionAt(e),i=this.rangeMap.positionAt(e+1);return i!==-1&&(i-t)/2+tt.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:cMe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:h$(this.domNode)})}render(e,t,i,s,o,r=!1){const a=this.getRenderRange(t,i),c=Dh.relativeComplement(a,e).reverse(),l=Dh.relativeComplement(e,a);if(r){const d=Dh.intersect(e,a);for(let h=d.start;h{for(const d of l)for(let h=d.start;h=d.start;h--)this.insertItemInDOM(h)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const o=this.accessibilityProvider.isChecked(i.element);if(typeof o=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!o));else if(o){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(o.value),i.checkedDisposable=o.onDidChange(()=>c(o.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const r=this.renderers.get(i.templateId);if(!r)throw new Error(`No renderer found for template id ${i.templateId}`);r?.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=pe(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,a,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=h$(e.row.domNode);const t=gt(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}getScrollLeft(){return this.scrollableElement.getScrollPosition().scrollLeft}setScrollLeft(e){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth})),this.scrollableElement.setScrollPosition({scrollLeft:e})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return T.map(this.disposables.add(new oi(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return T.map(this.disposables.add(new oi(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return T.filter(T.map(this.disposables.add(new oi(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return T.map(this.disposables.add(new oi(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return T.map(this.disposables.add(new oi(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return T.map(this.disposables.add(new oi(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return T.map(this.disposables.add(new oi(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return T.map(this.disposables.add(new oi(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return T.any(T.map(this.disposables.add(new oi(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),T.map(this.disposables.add(new oi(this.domNode,Eo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return T.map(this.disposables.add(new oi(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return T.map(this.disposables.add(new oi(this.rowsContainer,Eo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(fm.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length));const r=we(".monaco-drag-image");r.textContent=o;const c=(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode);c.appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>c.removeChild(r),0)}this.domNode.classList.add("dragging"),this.currentDragData=new vQ(s),AL.CurrentDragAndDropData=new NJe(s),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),AL.CurrentDragAndDropData&&AL.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(AL.CurrentDragAndDropData)this.currentDragData=AL.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new fbe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===_R.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Tc(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:iS.Over;if(Dxt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!==iS.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");s===iS.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(s)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=PS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=$.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=bZ(this.domNode).top;this.dragOverAnimationDisposable=rgt(gt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=PS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return kc(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;Ra(i)&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const c=this.getRenderRange(e,t);let l=!1;for(let d=c.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=c.start;un===e;function pbe(n=Zb){return(e,t)=>Ls(e,t,n)}function PJe(){return(n,e)=>n.equals(e)}function Ixt(n,e,t){return!n||!e?n===e:t(n,e)}function Lxt(n){return JSON.stringify(mbe(n))}let Txt=0;const nUe=new WeakMap;function mbe(n){if(Array.isArray(n))return n.map(mbe);if(n&&typeof n=="object")if(Object.getPrototypeOf(n)===Object.prototype){const e=n,t=Object.create(null);for(const i of Object.keys(e).sort())t[i]=mbe(e[i]);return t}else{let e=nUe.get(n);return e===void 0&&(e=Txt++,nUe.set(n,e)),e+"----2b76a038c20c4bcc"}return n}class ff{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return Rxt(e,this)}}const sUe=new Map,_be=new WeakMap;function Rxt(n,e){const t=_be.get(n);if(t)return t;const i=Mxt(n,e);if(i){let s=sUe.get(i)??0;s++,sUe.set(i,s);const o=s===1?i:`${i}#${s}`;return _be.set(n,o),o}}function Mxt(n,e){const t=_be.get(n);if(t)return t;const i=e.owner?Pxt(e.owner)+".":"";let s;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(s=o(),s!==void 0)return i+s}else return i+o;const r=e.referenceFn;if(r!==void 0&&(s=xde(r),s!==void 0))return i+s;if(e.owner!==void 0){const a=Nxt(e.owner,n);if(a!==void 0)return i+a}}function Nxt(n,e){for(const t in n)if(n[t]===e)return t}const oUe=new Map,rUe=new WeakMap;function Pxt(n){const e=rUe.get(n);if(e)return e;const t=Fxt(n);let i=oUe.get(t)??0;i++,oUe.set(t,i);const s=i===1?t:`${t}#${i}`;return rUe.set(n,s),s}function Fxt(n){const e=n.constructor;return e?e.name:"Object"}function xde(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}let FJe;function Oxt(n){FJe=n}let OJe;function Bxt(n){OJe=n}let BJe;function Wxt(n){BJe=n}class WJe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return BJe({owner:i,debugName:()=>{const o=xde(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},o=>s(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(FJe(this,t)),this}keepObserved(e){return e.add(OJe(this)),this}get debugValue(){return this.get()}}class wQ extends WJe{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function En(n,e){const t=new Dde(n,e);try{n(t)}finally{t.finish()}}let rK;function uJ(n){if(rK)n(rK);else{const e=new Dde(n,void 0);rK=e;try{n(e)}finally{e.finish(),rK=void 0}}}async function Hxt(n,e){const t=new Dde(n,e);try{await n(t)}finally{t.finish()}}function m7(n,e,t){n?e(n):En(e,t)}class Dde{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():xde(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t{},()=>`Setting ${this.debugName}`));try{this._setValue(e);for(const o of this.observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function _7(n,e){let t;return typeof n=="string"?t=new ff(void 0,n,void 0):t=new ff(n,void 0,void 0),new Vxt(t,e,Zb)}class Vxt extends LNe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Dt(n,e){return e!==void 0?new uF(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb):new uF(new ff(void 0,void 0,n),n,void 0,void 0,void 0,Zb)}function HJe(n,e,t){return new $xt(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb,t)}function yy(n,e){return new uF(new ff(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,n.equalsFn??Zb)}Wxt(yy);function zxt(n,e){return new uF(new ff(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,n.equalityComparer??Zb)}function wO(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),Zb)}function WC(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>{s.clear();const r=t(o);return r&&s.add(r),r},void 0,void 0,()=>s.dispose(),Zb)}var wh;(function(n){n[n.initial=0]="initial",n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(wh||(wh={}));class uF extends wQ{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=s,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=wh.initial,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=this.createChangeSummary?.()}onLastObserverRemoved(){this.state=wh.initial,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),this._handleLastObserverRemoved?.()}get(){if(this.observers.size===0){const e=this._computeFn(this,this.createChangeSummary?.());return this.onLastObserverRemoved(),e}else{do{if(this.state===wh.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===wh.stale)break}this.state===wh.dependenciesMightHaveChanged&&(this.state=wh.upToDate),this._recomputeIfNeeded()}while(this.state!==wh.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===wh.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==wh.initial,i=this.value;this.state=wh.upToDate;const s=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,s)}finally{for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const r of this.observers)r.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===wh.upToDate&&(this.state=wh.dependenciesMightHaveChanged,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}fw(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===wh.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=wh.dependenciesMightHaveChanged;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===wh.upToDate;if(i&&(this.state===wh.dependenciesMightHaveChanged||s)&&(this.state=wh.stale,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class $xt extends uF{constructor(e,t,i,s,o=void 0,r,a){super(e,t,i,s,o,r),this.set=a}}function Ni(n){return new kde(new ff(void 0,void 0,n),n,void 0,void 0)}function bQ(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,void 0,void 0)}function Az(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,n.createEmptyChangeSummary,n.handleChange)}function xm(n){const e=new Z,t=bQ({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var Lp;(function(n){n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(Lp||(Lp={}));class kde{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=Lp.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),rz(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),az(this)}_runIfNeeded(){if(this.state===Lp.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=Lp.upToDate;const t=this.disposed;try{if(!t){const i=this.changeSummary;this.changeSummary=this.createChangeSummary?.(),this._runFn(this,i)}}finally{for(const i of this.dependenciesToBeRemoved)i.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===Lp.upToDate&&(this.state=Lp.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===Lp.dependenciesMightHaveChanged){this.state=Lp.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===Lp.stale)break}this._runIfNeeded()}while(this.state!==Lp.upToDate);this.updateCount--,fw(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===Lp.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=Lp.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=Lp.stale)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=kde})(Ni||(Ni={}));function Au(n){return new Gxt(n)}class Gxt extends WJe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Wn(n,e){return new vR(n,e)}class vR extends wQ{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{const s=this._getValue(i),o=this.value;(!this.hasValue||o!==s)&&(this.value=s,this.hasValue&&m7(vR.globalTransaction,a=>{for(const c of this.observers)a.updateObserver(c,this),c.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return xde(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=vR;function e(t,i){let s=!1;vR.globalTransaction===void 0&&(vR.globalTransaction=t,s=!0);try{i()}finally{s&&(vR.globalTransaction=void 0)}}n.batchEventsGlobally=e})(Wn||(Wn={}));function Bh(n,e){return new qxt(n,e)}class qxt extends wQ{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{En(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function oL(n){return typeof n=="string"?new aUe(n):new aUe(void 0,n)}class aUe extends wQ{get debugName(){return new ff(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){En(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function gJ(n){const e=new UJe(!1,void 0);return n.addObserver(e),Ee(()=>{n.removeObserver(e)})}Bxt(gJ);function Ez(n,e){const t=new UJe(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),Ee(()=>{n.removeObserver(t)})}Oxt(Ez);class UJe{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function Qxt(n,e){let t;return Dt(n,s=>(t=e(s,t),t))}function jxt(n,e){let t;const i=oL("derivedObservableWithWritableCache"),s=Dt(n,o=>(i.read(o),t=e(o,t),t));return Object.assign(s,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function yee(n,e,t,i){let s=new cUe(t,i);return yy({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{s.dispose(),s=new cUe(t)}},r=>(s.setItems(e.read(r)),s.getItems()))}class cUe{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const s of e){const o=this._keySelector?this._keySelector(s):s;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(s,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const s of i)this._cache.get(s).store.dispose(),this._cache.delete(s);this._items=t}getItems(){return this._items}}class TNe{constructor(e){this.observable=e}get onDidChange(){return T.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function VJe(n,e){return e instanceof TNe?e.observable:Wn(e.onDidChange,()=>e.value)}class Kxt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let v7=class{get name(){return this._trait}get renderer(){return new Kxt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(dUe),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=wbe(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return CU(this.sortedIndexes,e,dUe)>=0}dispose(){St(this._onChange)}};v7.__decorator=D([ii],v7.prototype,"renderer",null);class Yxt extends v7{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class Nfe{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function ux(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function CQ(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:CQ(n.parentElement,e)}function y3(n){return CQ(n,"monaco-editor")}function Jxt(n){return CQ(n,"monaco-custom-toggle")}function Xxt(n){return CQ(n,"action-item")}function F$(n){return CQ(n,"monaco-tree-sticky-row")}function w7(n){return n.classList.contains("monaco-tree-sticky-container")}function zJe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:zJe(n.parentElement)}class vbe{get onKeyDown(){return T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,e=>e.filter(t=>!ux(t.target)).map(t=>new os(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Z,this.multipleSelectionDisposables=new Z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case E.Enter:return this.onEnter(s);case E.UpArrow:return this.onUpArrow(s);case E.DownArrow:return this.onDownArrow(s);case E.PageUp:return this.onPageUpArrow(s);case E.PageDown:return this.onPageDownArrow(s);case E.Escape:return this.onEscape(s);case E.KeyA:this.multipleSelectionSupport&&(ei?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Mg(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}vbe.__decorator=D([ii],vbe.prototype,"onKeyDown",null);var Sy;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Sy||(Sy={}));var o2;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(o2||(o2={}));const Zxt=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=E.KeyA&&n.keyCode<=E.KeyZ||n.keyCode>=E.Digit0&&n.keyCode<=E.Digit9||n.keyCode>=E.Numpad0&&n.keyCode<=E.Numpad9||n.keyCode>=E.Semicolon&&n.keyCode<=E.Quote}};class eDt{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=o2.Idle,this.mode=Sy.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Z,this.disposables=new Z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Sy.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=T.chain(this.enabledDisposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).filter(()=>this.mode===Sy.Automatic||this.triggered).map(r=>new os(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>un.stop(r,!0)).map(r=>r.browserEvent.key)),i=T.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);T.reduce(T.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?sa(t):t&&sa(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=o2.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===o2.Idle?1:0;this.state=o2.Typing;for(let o=0;o1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof c>"u"||dF(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class tDt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=T.chain(this.disposables.add(new oi(t.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).map(r=>new os(r)));T.chain(i,o=>o.filter(r=>r.keyCode===E.Tab&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!Ra(s)||s.tabIndex===-1)return;const o=gt(s).getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function $Je(n){return ei?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function GJe(n){return n.browserEvent.shiftKey}function iDt(n){return hMe(n)&&n.button===2}const lUe={isSelectionSingleChangeEvent:$Je,isSelectionRangeChangeEvent:GJe};class qJe{constructor(e){this.list=e,this.disposables=new Z,this._onPointer=new I,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(dh.addTarget(e.getHTMLElement()))),T.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){y3(e.browserEvent.target)||xl()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),iDt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),o=Math.max(i,t),r=Mg(s,o+1),a=this.list.getSelection(),c=oDt(wbe(a,[i]),i);if(c.length===0)return;const l=wbe(r,rDt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class QJe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` +|${" --- |".repeat(i)}`;return zu.lexer(a)}}function w2e(s,e){return BGe(s,e),Ee(()=>WGe(s))}var LSt=".monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground);padding:1px 3px;vertical-align:middle}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}";ut(LSt,{});var Kme,lL;let Y_=(lL=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new I,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new Z,o=n.add(f6(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Ca);const r=await Lwt(this._languageService,n,o),a=document.createElement("span");if(a.innerHTML=Kme._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Dl(a,c)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>uae(this._openerService,i,e.isTrusted),disposables:t}}}},Kme=lL,lL._ttpTokenizer=QA("tokenizeToString",{createHTML(e){return e}}),lL);Y_=Kme=D([_(1,xi),_(2,Ao)],Y_);async function uae(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:RSt(t)})}catch(i){return vt(i),!1}}function RSt(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}const Qb=fe;var Hr;(function(s){s[s.PointerSize=3]="PointerSize",s[s.HoverBorderWidth=2]="HoverBorderWidth",s[s.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(Hr||(Hr={}));let qme=class extends pd{get _targetWindow(){return ct(this._target.targetElements[0])}get _targetDocumentElement(){return ct(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===vo.BELOW?Vf.BELOW:Vf.ABOVE}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new Z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new I),this._onRequestLayout=this._register(new I),this._linkHandler=e.linkHandler||(u=>uae(this._openerService,u,dd(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new MSt(e.target),this._hoverPointer=e.appearance?.showPointer?Qb("div.workbench-hover-pointer"):void 0,this._hover=this._register(new CLe),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.appearance?.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=e.position?.hoverPosition??vo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(S.Escape)&&this.dispose()}),this._register(ue(this._targetWindow,"blur",()=>this.dispose()));const a=Qb("div.hover-row.markdown-hover"),c=Qb("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Yr(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(Y_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||cd.fontFamily}),{element:p}=f.render(u,{actionHandler:{callback:m=>this._linkHandler(m),disposables:this._messageListeners},asyncRenderCallback:()=>{c.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});c.appendChild(p)}if(a.appendChild(c),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=Qb("div.hover-row.status-bar"),f=Qb("div.actions");e.actions.forEach(p=>{const m=this._keybindingService.lookupKeybinding(p.commandId);m&&m.getLabel()}),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=Qb("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let l;if(e.actions&&e.actions.length>0?l=!1:e.persistence?.hideOnHover===void 0?l=typeof e.content=="string"||dd(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=Qb("div.hover-row.status-bar"),f=Qb("div.info");f.textContent=g(4885,"Hold {0} key to mouse over",Qt?"Option":"Alt"),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];l||d.push(this._hoverContainer);const h=this._register(new y2e(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new y2e(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Ore(this._hoverContainer,Qb("div")),n=re(this._hoverContainer,Qb("div"));i.tabIndex=0,n.tabIndex=0,this._register(ue(n,"focus",o=>{e.focus(),o.preventDefault()})),this._register(ue(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&xQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Ah(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=VGe(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:n,bottom:o,left:r}=t[0],a=n-r,c=o-i,l={top:i,right:n,bottom:o,left:r,width:a,height:c,center:{x:r+a/2,y:i+c/2}};if(this.adjustHorizontalHoverPosition(l),this.adjustVerticalHoverPosition(l),this.adjustHoverMaxHeight(l),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case vo.RIGHT:l.left+=Hr.PointerSize,l.right+=Hr.PointerSize,this._hoverContainer.style.paddingLeft=`${Hr.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-Hr.PointerSize}px`;break;case vo.LEFT:l.left-=Hr.PointerSize,l.right-=Hr.PointerSize,this._hoverContainer.style.paddingRight=`${Hr.PointerSize}px`,this._hoverContainer.style.marginRight=`${-Hr.PointerSize}px`;break;case vo.BELOW:l.top+=Hr.PointerSize,l.bottom+=Hr.PointerSize,this._hoverContainer.style.paddingTop=`${Hr.PointerSize}px`,this._hoverContainer.style.marginTop=`${-Hr.PointerSize}px`;break;case vo.ABOVE:l.top-=Hr.PointerSize,l.bottom-=Hr.PointerSize,this._hoverContainer.style.paddingBottom=`${Hr.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-Hr.PointerSize}px`;break}l.center.x=l.left+a/2,l.center.y=l.top+c/2}this.computeXCordinate(l),this.computeYCordinate(l),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(l)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+Hr.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===vo.RIGHT?this._x=e.right:this._hoverPosition===vo.LEFT?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-Hr.HoverWindowEdgeMargin,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?Hr.PointerSize:0;if(this._forcePosition){const i=t+Hr.HoverBorderWidth;this._hoverPosition===vo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===vo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===vo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.LEFT:this._hoverPosition=vo.BELOW):this._hoverPosition===vo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.RIGHT:this._hoverPosition=vo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=vo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?Hr.PointerSize:0;this._hoverPosition===vo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=vo.BELOW):this._hoverPosition===vo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=vo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?Hr.PointerSize:0)+Hr.HoverBorderWidth;this._hoverPosition===vo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===vo.BELOW&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-Hr.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-Hr.PointerSize}px`;break}case vo.ABOVE:case vo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===vo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-Hr.PointerSize;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-Hr.PointerSize),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}hide(){this.dispose()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};qme=D([_(1,Ut),_(2,Te),_(3,Ao),_(4,we),_(5,mr)],qme);class y2e extends pd{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new I),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=ct(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(ct(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class MSt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var nf;(function(s){s[s.NoMatchingKb=0]="NoMatchingKb",s[s.MoreChordsNeeded=1]="MoreChordsNeeded",s[s.KbFound=2]="KbFound"})(nf||(nf={}));const HY={kind:nf.NoMatchingKb},NSt={kind:nf.MoreChordsNeeded};function PSt(s,e,t){return{kind:nf.KbFound,commandId:s,commandArgs:e,isBubble:t}}class $O{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const o=n.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=$O.handleRemovals([].concat(e).concat(t));for(let n=0,o=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i"u"||t.length===0)return[];const i=[];let n=0;for(let o=t.length-1;o>=0;o--)i[n++]=t[o];return i}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),HY;let r=null;if(n.length<2)r=o;else{r=[];for(let c=0,l=o.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const n=t[i];if($O._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function C2e(s){return s?`${s.serialize()}`:"no when condition"}function S2e(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}let UY=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Fme(this.layoutService.mainContainer,zw.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(ct(t))?n=zw.ABSOLUTE:i?n=zw.FIXED_SHADOW:n=zw.FIXED:n=zw.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};UY=D([_(0,pu)],UY);class FSt extends UY{getContextViewElement(){return this.contextView.getViewElement()}}class OSt{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(e===void 0||Lt(e)||Yr(e))n=e;else if(!C2(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(4884,"Loading..."),t,i),this._cancellationTokenSource=new ci;const o=this._cancellationTokenSource.token;if(n=await e.markdown(o),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:vo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n?.dispose()}hasContent(e){return e?dd(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let Qme=class extends V{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new UY(this._layoutService))}showHover(e,t,i){if(A2e(this._currentHoverOptions)===A2e(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=Bc();i||(n&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(qme,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&lTe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Yr(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ct(c))}if(this._contextViewHandler.showContextView(new BSt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(ue(ct(e.container).document,ke.MOUSE_DOWN,c=>{wc(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(ue(l,ke.CLICK,()=>this.hideHover()));else r.add(ue(e.target,ke.CLICK,()=>this.hideHover()));const c=Bc();if(c){const l=ct(c).document;r.add(ue(c,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(l,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(c,ke.KEY_UP,d=>this._keyUp(d,a))),r.add(ue(l,ke.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in si){const c=new IntersectionObserver(d=>this._intersectionChange(d,a),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;c.observe(l),r.add(Ee(()=>c.disconnect()))}return this._currentHover=a,a}hideHover(){this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const n=new En(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(n,n.target).kind!==nf.NoMatchingKb||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(y,C)=>{const A=r!==void 0;y&&(r?.dispose(),r=void 0),C&&(o?.dispose(),o=void 0),A&&(e.onDidHideHover?.(),r=void 0)},c=(y,C,A,L)=>new Cm(async()=>{(!r||r.isDisposed)&&(r=new OSt(e,A||t,y>0),await r.update(typeof i=="function"?i():i,C,{...n,trapFocus:L}))},y);let l=!1;const d=ue(t,ke.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=ue(t,ke.MOUSE_UP,()=>{l=!1},!0),u=ue(t,ke.MOUSE_LEAVE,y=>{l=!1,a(!1,y.fromElement===t)},!0),f=y=>{if(o)return;const C=new Z,A={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const L=k=>{A.x=k.x+10,Yr(k.target)&&E2e(k.target,t)!==t&&a(!0,!0)};C.add(ue(t,ke.MOUSE_MOVE,L,!0))}o=C,!(Yr(y.target)&&E2e(y.target,t)!==t)&&C.add(c(e.delay,!1,A))},p=ue(t,ke.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const y={targetElements:[t],dispose:()=>{}},C=new Z,A=()=>a(!0,!0);C.add(ue(t,ke.BLUR,A,!0)),C.add(c(e.delay,!1,y)),o=C};let v;const b=t.tagName.toLowerCase();b!=="input"&&b!=="textarea"&&(v=ue(t,ke.FOCUS,m,!0));const w={show:y=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(y,C)=>{i=y,await r?.update(i,void 0,C)},dispose:()=>{this._managedHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._managedHovers.set(t,w),w}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};Qme=D([_(0,we),_(1,lr),_(2,Ut),_(3,pu),_(4,mr)],Qme);function A2e(s){if(s!==void 0)return s?.id??s}class BSt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function E2e(s,e){for(e=e??ct(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}ce(ec,Qme,qt.Delayed);Cp((s,e)=>{const t=s.getColor(ZKe);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const PN=ae("IWorkspaceEditService");class gae{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(tA.is(t))return tA.lift(t);if(cp.is(t))return cp.lift(t);throw new Error("Unsupported edit")})}}class tA extends gae{static is(e){return e instanceof tA?!0:kn(e)&&N.isUri(e.resource)&&kn(e.textEdit)}static lift(e){return e instanceof tA?e:new tA(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class cp extends gae{static is(e){return e instanceof cp?!0:kn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof cp?e:new cp(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Ol={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},Vb=Object.freeze({id:"editor",order:5,type:"object",title:g(1209,"Editor"),scope:at.LANGUAGE_OVERRIDABLE}),VY={...Vb,properties:{"editor.tabSize":{type:"number",default:Vd.tabSize,minimum:1,markdownDescription:g(1210,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:g(1211,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Vd.insertSpaces,markdownDescription:g(1212,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Vd.detectIndentation,markdownDescription:g(1213,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Vd.trimAutoWhitespace,description:g(1214,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Vd.largeFileOptimizations,description:g(1215,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(1216,"Turn off Word Based Suggestions."),g(1217,"Only suggest words from the active document."),g(1218,"Suggest words from all open documents of the same language."),g(1219,"Suggest words from all open documents.")],description:g(1220,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[g(1221,"Semantic highlighting enabled for all color themes."),g(1222,"Semantic highlighting disabled for all color themes."),g(1223,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(1224,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(1225,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(1226,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(1227,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(1228,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(1229,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:g(1230,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(1233,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:g(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Ol.maxComputationTime,description:g(1234,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Ol.maxFileSize,description:g(1235,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Ol.renderSideBySide,description:g(1236,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Ol.renderSideBySideInlineBreakpoint,description:g(1237,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Ol.useInlineViewWhenSpaceIsLimited,description:g(1238,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Ol.renderMarginRevertIcon,description:g(1239,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Ol.renderGutterMenu,description:g(1240,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Ol.ignoreTrimWhitespace,description:g(1241,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Ol.renderIndicators,description:g(1242,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Ol.diffCodeLens,description:g(1243,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Ol.diffWordWrap,markdownEnumDescriptions:[g(1244,"Lines will never wrap."),g(1245,"Lines will wrap at the viewport width."),g(1246,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Ol.diffAlgorithm,markdownEnumDescriptions:[g(1247,"Uses the legacy diffing algorithm."),g(1248,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Ol.hideUnchangedRegions.enabled,markdownDescription:g(1249,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Ol.hideUnchangedRegions.revealLineCount,markdownDescription:g(1250,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Ol.hideUnchangedRegions.minimumLineCount,markdownDescription:g(1251,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Ol.hideUnchangedRegions.contextLineCount,markdownDescription:g(1252,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Ol.experimental.showMoves,markdownDescription:g(1253,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Ol.experimental.showEmptyDecorations,description:g(1254,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Ol.experimental.useTrueInlineView,description:g(1255,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function WSt(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of JP){const e=s.schema;if(typeof e<"u")if(WSt(e))VY.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(VY.properties[t]=e[t])}let XG=null;function nje(){return XG===null&&(XG=Object.create(null),Object.keys(VY.properties).forEach(s=>{XG[s]=!0})),XG}function HSt(s){return nje()[`editor.${s}`]||!1}function USt(s){return nje()[`diffEditor.${s}`]||!1}const VSt=Qe.as(Nn.Configuration);VSt.registerConfiguration(VY);var yl;(function(s){s[s.None=0]="None",s[s.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=2]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",s[s.InvalidUnicode=4]="InvalidUnicode",s[s.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",s[s.InvalidCharacter=6]="InvalidCharacter"})(yl||(yl={}));var ft;(function(s){s[s.OpenBraceToken=1]="OpenBraceToken",s[s.CloseBraceToken=2]="CloseBraceToken",s[s.OpenBracketToken=3]="OpenBracketToken",s[s.CloseBracketToken=4]="CloseBracketToken",s[s.CommaToken=5]="CommaToken",s[s.ColonToken=6]="ColonToken",s[s.NullKeyword=7]="NullKeyword",s[s.TrueKeyword=8]="TrueKeyword",s[s.FalseKeyword=9]="FalseKeyword",s[s.StringLiteral=10]="StringLiteral",s[s.NumericLiteral=11]="NumericLiteral",s[s.LineCommentTrivia=12]="LineCommentTrivia",s[s.BlockCommentTrivia=13]="BlockCommentTrivia",s[s.LineBreakTrivia=14]="LineBreakTrivia",s[s.Trivia=15]="Trivia",s[s.Unknown=16]="Unknown",s[s.EOF=17]="EOF"})(ft||(ft={}));var Ho;(function(s){s[s.InvalidSymbol=1]="InvalidSymbol",s[s.InvalidNumberFormat=2]="InvalidNumberFormat",s[s.PropertyNameExpected=3]="PropertyNameExpected",s[s.ValueExpected=4]="ValueExpected",s[s.ColonExpected=5]="ColonExpected",s[s.CommaExpected=6]="CommaExpected",s[s.CloseBraceExpected=7]="CloseBraceExpected",s[s.CloseBracketExpected=8]="CloseBracketExpected",s[s.EndOfFileExpected=9]="EndOfFileExpected",s[s.InvalidCommentToken=10]="InvalidCommentToken",s[s.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=12]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",s[s.InvalidUnicode=14]="InvalidUnicode",s[s.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",s[s.InvalidCharacter=16]="InvalidCharacter"})(Ho||(Ho={}));var h3;(function(s){s.DEFAULT={allowTrailingComma:!0}})(h3||(h3={}));function LLe(s,e=!1){let t=0;const i=s.length;let n="",o=0,r=ft.Unknown,a=yl.None;function c(m){let v=0,b=0;for(;v=ti._0&&w<=ti._9)b=b*16+w-ti._0;else if(w>=ti.A&&w<=ti.F)b=b*16+w-ti.A+10;else if(w>=ti.a&&w<=ti.f)b=b*16+w-ti.a+10;else break;t++,v++}return v=i){m+=s.substring(v,t),a=yl.UnexpectedEndOfString;break}const b=s.charCodeAt(t);if(b===ti.doubleQuote){m+=s.substring(v,t),t++;break}if(b===ti.backslash){if(m+=s.substring(v,t),t++,t>=i){a=yl.UnexpectedEndOfString;break}switch(s.charCodeAt(t++)){case ti.doubleQuote:m+='"';break;case ti.backslash:m+="\\";break;case ti.slash:m+="/";break;case ti.b:m+="\b";break;case ti.f:m+="\f";break;case ti.n:m+=` +`;break;case ti.r:m+="\r";break;case ti.t:m+=" ";break;case ti.u:{const y=c(4);y>=0?m+=String.fromCharCode(y):a=yl.InvalidUnicode;break}default:a=yl.InvalidEscapeCharacter}v=t;continue}if(b>=0&&b<=31)if(ZG(b)){m+=s.substring(v,t),a=yl.UnexpectedEndOfString;break}else a=yl.InvalidCharacter;t++}return m}function u(){if(n="",a=yl.None,o=t,t>=i)return o=i,r=ft.EOF;let m=s.charCodeAt(t);if(whe(m)){do t++,n+=String.fromCharCode(m),m=s.charCodeAt(t);while(whe(m));return r=ft.Trivia}if(ZG(m))return t++,n+=String.fromCharCode(m),m===ti.carriageReturn&&s.charCodeAt(t)===ti.lineFeed&&(t++,n+=` +`),r=ft.LineBreakTrivia;switch(m){case ti.openBrace:return t++,r=ft.OpenBraceToken;case ti.closeBrace:return t++,r=ft.CloseBraceToken;case ti.openBracket:return t++,r=ft.OpenBracketToken;case ti.closeBracket:return t++,r=ft.CloseBracketToken;case ti.colon:return t++,r=ft.ColonToken;case ti.comma:return t++,r=ft.CommaToken;case ti.doubleQuote:return t++,n=h(),r=ft.StringLiteral;case ti.slash:{const v=t-1;if(s.charCodeAt(t+1)===ti.slash){for(t+=2;t=ft.LineCommentTrivia&&m<=ft.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>n,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function whe(s){return s===ti.space||s===ti.tab||s===ti.verticalTab||s===ti.formFeed||s===ti.nonBreakingSpace||s===ti.ogham||s>=ti.enQuad&&s<=ti.zeroWidthSpace||s===ti.narrowNoBreakSpace||s===ti.mathematicalSpace||s===ti.ideographicSpace||s===ti.byteOrderMark}function ZG(s){return s===ti.lineFeed||s===ti.carriageReturn||s===ti.lineSeparator||s===ti.paragraphSeparator}function hP(s){return s>=ti._0&&s<=ti._9}var ti;(function(s){s[s.nullCharacter=0]="nullCharacter",s[s.maxAsciiCharacter=127]="maxAsciiCharacter",s[s.lineFeed=10]="lineFeed",s[s.carriageReturn=13]="carriageReturn",s[s.lineSeparator=8232]="lineSeparator",s[s.paragraphSeparator=8233]="paragraphSeparator",s[s.nextLine=133]="nextLine",s[s.space=32]="space",s[s.nonBreakingSpace=160]="nonBreakingSpace",s[s.enQuad=8192]="enQuad",s[s.emQuad=8193]="emQuad",s[s.enSpace=8194]="enSpace",s[s.emSpace=8195]="emSpace",s[s.threePerEmSpace=8196]="threePerEmSpace",s[s.fourPerEmSpace=8197]="fourPerEmSpace",s[s.sixPerEmSpace=8198]="sixPerEmSpace",s[s.figureSpace=8199]="figureSpace",s[s.punctuationSpace=8200]="punctuationSpace",s[s.thinSpace=8201]="thinSpace",s[s.hairSpace=8202]="hairSpace",s[s.zeroWidthSpace=8203]="zeroWidthSpace",s[s.narrowNoBreakSpace=8239]="narrowNoBreakSpace",s[s.ideographicSpace=12288]="ideographicSpace",s[s.mathematicalSpace=8287]="mathematicalSpace",s[s.ogham=5760]="ogham",s[s._=95]="_",s[s.$=36]="$",s[s._0=48]="_0",s[s._1=49]="_1",s[s._2=50]="_2",s[s._3=51]="_3",s[s._4=52]="_4",s[s._5=53]="_5",s[s._6=54]="_6",s[s._7=55]="_7",s[s._8=56]="_8",s[s._9=57]="_9",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.ampersand=38]="ampersand",s[s.asterisk=42]="asterisk",s[s.at=64]="at",s[s.backslash=92]="backslash",s[s.bar=124]="bar",s[s.caret=94]="caret",s[s.closeBrace=125]="closeBrace",s[s.closeBracket=93]="closeBracket",s[s.closeParen=41]="closeParen",s[s.colon=58]="colon",s[s.comma=44]="comma",s[s.dot=46]="dot",s[s.doubleQuote=34]="doubleQuote",s[s.equals=61]="equals",s[s.exclamation=33]="exclamation",s[s.greaterThan=62]="greaterThan",s[s.lessThan=60]="lessThan",s[s.minus=45]="minus",s[s.openBrace=123]="openBrace",s[s.openBracket=91]="openBracket",s[s.openParen=40]="openParen",s[s.percent=37]="percent",s[s.plus=43]="plus",s[s.question=63]="question",s[s.semicolon=59]="semicolon",s[s.singleQuote=39]="singleQuote",s[s.slash=47]="slash",s[s.tilde=126]="tilde",s[s.backspace=8]="backspace",s[s.formFeed=12]="formFeed",s[s.byteOrderMark=65279]="byteOrderMark",s[s.tab=9]="tab",s[s.verticalTab=11]="verticalTab"})(ti||(ti={}));function sf(s,e=[],t=h3.DEFAULT){let i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}return MLe(s,{onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),n[0]}function RLe(s,e=[],t=h3.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}MLe(s,{onObjectBegin:c=>{i=o({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=o({type:"property",offset:l,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:c,offset:l,length:d,parent:i})},onObjectEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,n(c+l)},onArrayBegin:(c,l)=>{i=o({type:"array",offset:c,length:-1,parent:i,children:[]})},onArrayEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,n(c+l)},onLiteralValue:(c,l,d)=>{o({type:sD(c),offset:l,length:d,parent:i,value:c}),n(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&n(l))},onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t);const a=i.children[0];return a&&delete a.parent,a}function jme(s,e){if(!s)return;let t=s;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let n=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],n=!0;break}if(!n)return}else{const n=i;if(t.type!=="array"||n<0||!Array.isArray(t.children)||n>=t.children.length)return;t=t.children[n]}return t}function MLe(s,e,t=h3.DEFAULT){const i=LLe(s,!1);function n(R){return R?()=>R(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(R){return R?z=>R(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=n(e.onObjectBegin),a=o(e.onObjectProperty),c=n(e.onObjectEnd),l=n(e.onArrayBegin),d=n(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=n(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function b(){for(;;){const R=i.scan();switch(i.getTokenError()){case yl.InvalidUnicode:w(Ho.InvalidUnicode);break;case yl.InvalidEscapeCharacter:w(Ho.InvalidEscapeCharacter);break;case yl.UnexpectedEndOfNumber:w(Ho.UnexpectedEndOfNumber);break;case yl.UnexpectedEndOfComment:m||w(Ho.UnexpectedEndOfComment);break;case yl.UnexpectedEndOfString:w(Ho.UnexpectedEndOfString);break;case yl.InvalidCharacter:w(Ho.InvalidCharacter);break}switch(R){case ft.LineCommentTrivia:case ft.BlockCommentTrivia:m?w(Ho.InvalidCommentToken):f();break;case ft.Unknown:w(Ho.InvalidSymbol);break;case ft.Trivia:case ft.LineBreakTrivia:break;default:return R}}}function w(R,z=[],G=[]){if(p(R),z.length+G.length>0){let Y=i.getToken();for(;Y!==ft.EOF;){if(z.indexOf(Y)!==-1){b();break}else if(G.indexOf(Y)!==-1)break;Y=b()}}}function y(R){const z=i.getTokenValue();return R?h(z):a(z),b(),!0}function C(){switch(i.getToken()){case ft.NumericLiteral:{let R=0;try{R=JSON.parse(i.getTokenValue()),typeof R!="number"&&(w(Ho.InvalidNumberFormat),R=0)}catch{w(Ho.InvalidNumberFormat)}h(R);break}case ft.NullKeyword:h(null);break;case ft.TrueKeyword:h(!0);break;case ft.FalseKeyword:h(!1);break;default:return!1}return b(),!0}function A(){return i.getToken()!==ft.StringLiteral?(w(Ho.PropertyNameExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!1):(y(!1),i.getToken()===ft.ColonToken?(u(":"),b(),P()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken])):w(Ho.ColonExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!0)}function L(){r(),b();let R=!1;for(;i.getToken()!==ft.CloseBraceToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBraceToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);A()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken]),R=!0}return c(),i.getToken()!==ft.CloseBraceToken?w(Ho.CloseBraceExpected,[ft.CloseBraceToken],[]):b(),!0}function k(){l(),b();let R=!1;for(;i.getToken()!==ft.CloseBracketToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBracketToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);P()||w(Ho.ValueExpected,[],[ft.CloseBracketToken,ft.CommaToken]),R=!0}return d(),i.getToken()!==ft.CloseBracketToken?w(Ho.CloseBracketExpected,[ft.CloseBracketToken],[]):b(),!0}function P(){switch(i.getToken()){case ft.OpenBracketToken:return k();case ft.OpenBraceToken:return L();case ft.StringLiteral:return y(!0);default:return C()}}return b(),i.getToken()===ft.EOF?t.allowEmptyContent?!0:(w(Ho.ValueExpected,[],[]),!1):P()?(i.getToken()!==ft.EOF&&w(Ho.EndOfFileExpected,[],[]),!0):(w(Ho.ValueExpected,[],[]),!1)}function sD(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(s){if(Array.isArray(s))return"array"}else return"null";return"object"}default:return"null"}}class zSt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===B.Slash||this._splitOnBackslash&&i===B.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Dh(new GSt(e,t))}static forPaths(e=!1){return new Dh(new y5(void 0,!e))}static forStrings(){return new Dh(new zSt)}static forConfigKeys(){return new Dh(new $St)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);mFe(i);for(const n of i)this.set(n,e)}else{const i=e.slice(0);mFe(i);for(const n of i)this.set(n[0],n[1])}}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new eK,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new eK,n.left.segment=i.value()),o.push([nc.Left,n]),n=n.left;else if(a<0)n.right||(n.right=new eK,n.right.segment=i.value()),o.push([nc.Right,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new eK,n.mid.segment=i.value()),o.push([nc.Mid,n]),n=n.mid;else break}const r=n.value;n.value=t,n.key=e;for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=o[a][0],h=o[a+1][0];if(d===nc.Right&&h===nc.Right)o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.Left)o[a][1]=c.rotateRight();else if(d===nc.Right&&h===nc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.Right)c.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case nc.Left:o[a-1][1].left=o[a][1];break;case nc.Right:o[a-1][1].right=o[a][1];break;case nc.Mid:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){return this._getNode(e)?.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)n.push([nc.Left,o]),o=o.left;else if(r<0)n.push([nc.Right,o]),o=o.right;else if(i.hasNext())i.next(),n.push([nc.Mid,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=this._min(o.right);if(r.key){const{key:a,value:c,segment:l}=r;this._delete(r.key,!1),o.key=a,o.value=c,o.segment=l}}else{const r=o.left??o.right;if(n.length>0){const[a,c]=n[n.length-1];switch(a){case nc.Left:c.left=r;break;case nc.Mid:c.mid=r;break;case nc.Right:c.right=r;break}}else this._root=r}for(let r=n.length-1;r>=0;r--){const a=n[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),n[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),n[r][1]=a.rotateRight()),r>0)switch(n[r-1][0]){case nc.Left:n[r-1][1].left=n[r][1];break;case nc.Right:n[r-1][1].right=n[r][1];break;case nc.Mid:n[r-1][1].mid=n[r][1];break}else this._root=n[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),n=i.value||n,i=i.mid;else break}return i&&i.value||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const o=i.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?n.value:void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}var sn;(function(s){s[s.Unknown=0]="Unknown",s[s.File=1]="File",s[s.Directory=2]="Directory",s[s.SymbolicLink=64]="SymbolicLink"})(sn||(sn={}));var lp;(function(s){s[s.Readonly=1]="Readonly",s[s.Locked=2]="Locked"})(lp||(lp={}));var LE;(function(s){s[s.UPDATED=2]="UPDATED",s[s.ADDED=4]="ADDED",s[s.DELETED=8]="DELETED"})(LE||(LE={}));var Vn;(function(s){s[s.None=0]="None",s[s.FileReadWrite=2]="FileReadWrite",s[s.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",s[s.FileReadStream=16]="FileReadStream",s[s.FileFolderCopy=8]="FileFolderCopy",s[s.PathCaseSensitive=1024]="PathCaseSensitive",s[s.Readonly=2048]="Readonly",s[s.Trash=4096]="Trash",s[s.FileWriteUnlock=8192]="FileWriteUnlock",s[s.FileAtomicRead=16384]="FileAtomicRead",s[s.FileAtomicWrite=32768]="FileAtomicWrite",s[s.FileAtomicDelete=65536]="FileAtomicDelete",s[s.FileClone=131072]="FileClone"})(Vn||(Vn={}));function zm(s){return!!(s.capabilities&Vn.FileReadWrite)}function x2e(s){return!!(s.capabilities&Vn.FileFolderCopy)}function KSt(s){return!!(s.capabilities&Vn.FileClone)}function hE(s){return!!(s.capabilities&Vn.FileOpenReadWriteClose)}function Nq(s){return!!(s.capabilities&Vn.FileReadStream)}function yhe(s){return zm(s)?!!(s.capabilities&Vn.FileAtomicRead):!1}function D2e(s){return zm(s)?!!(s.capabilities&Vn.FileAtomicWrite):!1}function qSt(s){return!!(s.capabilities&Vn.FileAtomicDelete)}function QSt(s){return!!(s.capabilities&Vn.Readonly)}var ot;(function(s){s.FileExists="EntryExists",s.FileNotFound="EntryNotFound",s.FileNotADirectory="EntryNotADirectory",s.FileIsADirectory="EntryIsADirectory",s.FileExceedsStorageQuota="EntryExceedsStorageQuota",s.FileTooLarge="EntryTooLarge",s.FileWriteLocked="EntryWriteLocked",s.NoPermissions="NoPermissions",s.Unavailable="Unavailable",s.Unknown="Unknown"})(ot||(ot={}));class xA extends Error{static create(e,t){const i=new xA(e.toString(),t);return sje(i,t),i}constructor(e,t){super(e),this.code=t}}function us(s,e){return xA.create(s,e)}function s0(s){return s||us(g(0,"Unknown Error"),ot.Unknown)}function sje(s,e){return s.name=e?`${e} (FileSystemError)`:"FileSystemError",s}function Vk(s){if(!s)return ot.Unknown;if(s instanceof xA)return s.code;const e=/^(.+) \(FileSystemError\)$/.exec(s.name);if(!e)return ot.Unknown;switch(e[1]){case ot.FileExists:return ot.FileExists;case ot.FileIsADirectory:return ot.FileIsADirectory;case ot.FileNotADirectory:return ot.FileNotADirectory;case ot.FileNotFound:return ot.FileNotFound;case ot.FileTooLarge:return ot.FileTooLarge;case ot.FileWriteLocked:return ot.FileWriteLocked;case ot.NoPermissions:return ot.NoPermissions;case ot.Unavailable:return ot.Unavailable}return ot.Unknown}function $w(s){if(s instanceof Td)return s.fileOperationResult;switch(Vk(s)){case ot.FileNotFound:return Qi.FILE_NOT_FOUND;case ot.FileIsADirectory:return Qi.FILE_IS_DIRECTORY;case ot.FileNotADirectory:return Qi.FILE_NOT_DIRECTORY;case ot.FileWriteLocked:return Qi.FILE_WRITE_LOCKED;case ot.NoPermissions:return Qi.FILE_PERMISSION_DENIED;case ot.FileExists:return Qi.FILE_MOVE_CONFLICT;case ot.FileTooLarge:return Qi.FILE_TOO_LARGE;default:return Qi.FILE_OTHER_ERROR}}var Ai;(function(s){s[s.CREATE=0]="CREATE",s[s.DELETE=1]="DELETE",s[s.MOVE=2]="MOVE",s[s.COPY=3]="COPY",s[s.WRITE=4]="WRITE"})(Ai||(Ai={}));class uP{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var To;(function(s){s[s.UPDATED=0]="UPDATED",s[s.ADDED=1]="ADDED",s[s.DELETED=2]="DELETED"})(To||(To={}));const YF=class YF{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(n=>[n,!0])),i}),this.updated=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(n=>[n,!0])),i}),this.deleted=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(n=>[n,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case To.ADDED:this.rawAdded.push(i.resource);break;case To.UPDATED:this.rawUpdated.push(i.resource);break;case To.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==YF.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=YF.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=YF.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...i){if(!e)return!1;const n=i.length>0;return!!((!n||i.includes(To.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!n||i.includes(To.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!n||i.includes(To.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}};YF.MIXED_CORRELATION=null;let zY=YF;class Td extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class Pq extends Td{constructor(e,t,i,n){super(e,t,n),this.fileOperationResult=t,this.size=i}}class C5 extends Td{constructor(e,t,i){super(e,Qi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Qi;(function(s){s[s.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",s[s.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",s[s.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",s[s.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",s[s.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",s[s.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",s[s.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",s[s.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",s[s.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",s[s.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",s[s.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Qi||(Qi={}));const tl={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Eu={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},NLe="files.associations",jSt="files.exclude",oje="files.readonlyInclude",rje="files.readonlyExclude",YSt="files.readonlyFromPermissions";var ba;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(ba||(ba={}));const S_="";function $Y(s){if(!(typeof s.size!="number"||typeof s.mtime!="number"))return s.mtime.toString(29)+s.size.toString(31)}async function aje(s,e){if(!e.hasProvider(N.from({scheme:s.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(n=>{n.scheme===s.scheme&&n.added&&(i.dispose(),t())})})}const $l=class $l{static formatSize(e){return lc(e)||(e=0),e<$l.KB?g(1,"{0}B",e.toFixed(0)):e<$l.MB?g(2,"{0}KB",(e/$l.KB).toFixed(2)):e<$l.GB?g(3,"{0}MB",(e/$l.MB).toFixed(2)):e<$l.TB?g(4,"{0}GB",(e/$l.GB).toFixed(2)):g(5,"{0}TB",(e/$l.TB).toFixed(2))}};$l.KB=1024,$l.MB=$l.KB*$l.KB,$l.GB=$l.MB*$l.KB,$l.TB=$l.GB*$l.KB;let Nc=$l;function JSt(s){const e=typeof s=="string"||s?.scheme===pe.vscodeRemote;return typeof s!="string"&&s?.scheme===pe.file?1024*Nc.MB:e?10*Nc.MB:Wn?50*Nc.MB:1024*Nc.MB}function oV(s){return Object.isFrozen(s)?s:x6e(s)}class as{static createEmptyModel(e){return new as({},[],[],void 0,e)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw?.length){const e=this.raw.map(t=>{if(t instanceof as)return t;const i=new DA("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Qj(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return oV(i.rawConfiguration.getValue(e))},get override(){return t?oV(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return oV(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new as(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&n.push({identifiers:r,value:c})}return n.length?oV(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Qj(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return ja(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return ja(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=xs(this.contents),i=xs(this.overrides),n=[...this.keys],o=this.raw?.length?[...this.raw]:[this];for(const r of e)if(o.push(...r.raw?.length?r.raw:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[c]=i.filter(l=>is(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=ja(c.keys)):i.push(xs(a))}for(const a of r.keys)n.indexOf(a)===-1&&n.push(a)}return new as(t,n,i,o.every(r=>r instanceof as)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const n of ja([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n];const r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=xs(o),this.mergeContents(o,r)):o=r),i[n]=o}return new as(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&kn(e[i])&&kn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=xs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=o=>{o&&(i?this.mergeContents(i,o):i=xs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),sut(this.contents,e),tf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>is(i.identifiers,M8(e))),1))}updateValue(e,t,i){if(_Ke(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),tf.test(e)){const n=M8(e),o={identifiers:n,keys:Object.keys(this.contents[e]),contents:R8(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>is(a.identifiers,n));r!==-1?this.overrides[r]=o:this.overrides.push(o)}}}class DA{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||as.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!ra(e)){const i=this.doParseContent(e);this.parseRaw(i,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new as(i,n,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{MLe(e,a),t=n[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const o=R8(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),r=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:o,keys:r,overrides:a,restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let o=!1;if(!n?.scopes&&!n?.skipRestricted&&!n?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(tf.test(c)&&i){const l=this.filter(e[c],t,!1,n);r[c]=l.raw,o=o||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:at.WINDOW:void 0;l?.restricted&&a.push(c),!n.exclude?.includes(c)&&(n.include?.includes(c)||(d===void 0||n.scopes===void 0||n.scopes.includes(d))&&!(n.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(tf.test(n)){const o={};for(const r in e[n])o[r]=e[n][r];i.push({identifiers:M8(n),keys:Object.keys(o),contents:R8(o,t)})}return i}}class cje extends V{constructor(e,t,i,n,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=n,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new DA(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(M.any(M.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),M.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Ai.CREATE)||r.isOperation(Ai.COPY)||r.isOperation(Ai.DELETE)||r.isOperation(Ai.WRITE))&&i.isEqual(r.resource,e)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const e=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(e.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return as.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class XSt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return oV(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}}let u3=class lje{constructor(e,t,i,n,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ui,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=as.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const c of n.overrides)for(const l of c.identifiers)n.getOverrideValue(e,l)!==void 0&&a.add(l);return new XSt(e,t,n.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){const i=[];if(!t){const{added:n,updated:o,removed:r}=uE(this._defaultConfiguration,e);t=[...n,...o,...r]}for(const n of t)for(const o of M8(n)){const r=this._defaultConfiguration.getKeysForOverrideIdentifier(o),a=e.getKeysForOverrideIdentifier(o),c=[...a.filter(l=>r.indexOf(l)===-1),...r.filter(l=>a.indexOf(l)===-1),...r.filter(l=>!Ys(this._defaultConfiguration.override(o).getValue(l),e.override(o).getValue(l)))];i.push([o,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:n}=uE(this._policyConfiguration,e),o=[...t,...i,...n];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.applicationConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.localUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.remoteUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.workspaceConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:n,updated:o,removed:r,overrides:a}=uE(i,t),c=[...n,...o,...r];return(c.length||!i)&&this.updateFolderConfiguration(e,t),{keys:c,overrides:a}}compareAndDeleteFolderConfiguration(e){const t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:i,updated:n,removed:o,overrides:r}=uE(t,void 0);return{keys:[...i,...n,...o],overrides:r}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(i=>e.add(i))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(i=>e.add(i))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(e).forEach(n=>t.add(n))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((l,d)=>(l.set(N.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new ui);return new lje(i,n,o,r,as.createEmptyModel(t),a,c,as.createEmptyModel(t),new ui,t)}static parseConfigurationModel(e,t){return new as(e.contents,e.keys,e.overrides,void 0,t)}};function k2e(...s){if(s.length===0)return{keys:[],overrides:[]};if(s.length===1)return s[0];const e=new Set,t=new Map;for(const n of s)n.keys.forEach(o=>e.add(o)),n.overrides.forEach(([o,r])=>{const a=Cj(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((n,o)=>i.push([o,[...n.values()]])),{keys:[...e.values()],overrides:i}}class PLe{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=o,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=u3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const o=n+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Ys(a,c)}return!0}}function uE(s,e){const{added:t,removed:i,updated:n}=I2e(e?.rawConfiguration,s?.rawConfiguration),o=[],r=s?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!r.includes(l));for(const l of c)o.push([l,e.getKeysForOverrideIdentifier(l)])}if(s){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,s.getKeysForOverrideIdentifier(l)])}if(e&&s){for(const c of r)if(a.includes(c)){const l=I2e({contents:s.getOverrideValue(void 0,c)||{},keys:s.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});o.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:n,overrides:o}}function I2e(s,e){const t=s?e?s.keys.filter(o=>e.keys.indexOf(o)===-1):[...s.keys]:[],i=e?s?e.keys.filter(o=>s.keys.indexOf(o)===-1):[...e.keys]:[],n=[];if(s&&e){for(const o of e.keys)if(s.keys.indexOf(o)!==-1){const r=Qj(e.contents,o),a=Qj(s.contents,o);Ys(r,a)||n.push(o)}}return{added:t,removed:i,updated:n}}const ZSt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class dje extends V{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:M.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new J7,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Cm,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}getDefaultKeybindingsContent(){return""}toggleLogging(){return this._logging=!this._logging,this._logging}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getDefaultKeybindings(){return this._getResolver().getDefaultKeybindings()}getKeybindings(){return this._getResolver().getKeybindings()}customKeybindingsCount(){return 0}lookupKeybindings(e){return Fi(this._getResolver().lookupKeybindings(e).map(t=>t.resolvedKeybinding))}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),HY;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),HY;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Cre("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(1256,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(1257,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),c5.enabled&&c5.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],c5.enable()}dispatchByUserSettingsLabel(e,t){this._log(`/ Dispatching keybinding triggered via menu entry accelerator - ${e}`);const i=this.resolveUserBinding(e);i.length===0?this._log(`\\ Could not resolve - ${e}`):this._doDispatch(i[0],t,!1)}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new dF(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case nf.NoMatchingKb:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}return n}case nf.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case nf.KbFound:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${l.commandId} ]`),l.commandId===null||l.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{typeof l.commandArgs>"u"?this._commandService.executeCommand(l.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}ZSt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=S.KeyA&&e.keyCode<=S.KeyZ||e.keyCode>=S.Digit0&&e.keyCode<=S.Digit9}}const sse=class sse{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};sse.EMPTY=new sse(null);let dF=sse;class Dx{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?GY(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=GY(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===B.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function GY(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return hje.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:eAt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return FLe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}isWYSIWYG(){return this._chords.every(e=>this._isWYSIWYG(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new slt(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class Y2 extends OLe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Ds.Macintosh)switch(e){case S.LeftArrow:return"←";case S.UpArrow:return"↑";case S.RightArrow:return"→";case S.DownArrow:return"↓"}return Ia.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}_getElectronAccelerator(e){return Ia.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Ia.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return Y2.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Vg[e];if(t!==S.DependsOnKbLayout)return t;switch(e){case X.KeyA:return S.KeyA;case X.KeyB:return S.KeyB;case X.KeyC:return S.KeyC;case X.KeyD:return S.KeyD;case X.KeyE:return S.KeyE;case X.KeyF:return S.KeyF;case X.KeyG:return S.KeyG;case X.KeyH:return S.KeyH;case X.KeyI:return S.KeyI;case X.KeyJ:return S.KeyJ;case X.KeyK:return S.KeyK;case X.KeyL:return S.KeyL;case X.KeyM:return S.KeyM;case X.KeyN:return S.KeyN;case X.KeyO:return S.KeyO;case X.KeyP:return S.KeyP;case X.KeyQ:return S.KeyQ;case X.KeyR:return S.KeyR;case X.KeyS:return S.KeyS;case X.KeyT:return S.KeyT;case X.KeyU:return S.KeyU;case X.KeyV:return S.KeyV;case X.KeyW:return S.KeyW;case X.KeyX:return S.KeyX;case X.KeyY:return S.KeyY;case X.KeyZ:return S.KeyZ;case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0;case X.Minus:return S.Minus;case X.Equal:return S.Equal;case X.BracketLeft:return S.BracketLeft;case X.BracketRight:return S.BracketRight;case X.Backslash:return S.Backslash;case X.IntlHash:return S.Unknown;case X.Semicolon:return S.Semicolon;case X.Quote:return S.Quote;case X.Backquote:return S.Backquote;case X.Comma:return S.Comma;case X.Period:return S.Period;case X.Slash:return S.Slash;case X.IntlBackslash:return S.IntlBackslash}return S.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ih)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===S.Unknown?null:new Ih(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=GY(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new Y2(i,t)]:[]}}const Fs=ae("labelService"),cg=ae("progressService"),XA=ae("editorProgressService"),uje="telemetry.telemetryLevel",iAt="telemetry.enableCrashReporter",gje="telemetry.enableTelemetry";var Kg;(function(s){s[s.NONE=0]="NONE",s[s.CRASH=1]="CRASH",s[s.ERROR=2]="ERROR",s[s.USAGE=3]="USAGE"})(Kg||(Kg={}));var Q0;(function(s){s.OFF="off",s.CRASH="crash",s.ERROR="error",s.ON="all"})(Q0||(Q0={}));function P_(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.uri)}function nAt(s){return typeof s?.id=="string"&&!P_(s)&&!iA(s)}const BLe={id:"empty-window"};function GO(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:Ko(s)}:BLe;const t=s;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function iA(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.configPath)}var qi;(function(s){s[s.EMPTY=1]="EMPTY",s[s.FOLDER=2]="FOLDER",s[s.WORKSPACE=3]="WORKSPACE"})(qi||(qi={}));function Yme(s){const e=s;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function fje(s){const e=s;return!!(e&&typeof e=="object"&&N.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let pje=class{constructor(e,t,i,n,o){this._id=e,this._transient=i,this._configuration=n,this._ignorePathCasing=o,this._foldersMap=Dh.forUris(this._ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._ignorePathCasing=e._ignorePathCasing,this.folders=e.folders}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this._foldersMap.findSubstr(e)||null}updateFoldersMap(){this._foldersMap=Dh.forUris(this._ignorePathCasing,()=>!0);for(const e of this.folders)this._foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}},pae=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Pt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function KY(s){return new pae({uri:s,index:0,name:EA(s)},{uri:s.toString()})}const xb="code-workspace",mje=`.${xb}`,sAt=[{name:g(792,"Code Workspace"),extensions:[xb]}];function g3(s,e){return EGe.isEqualOrParent(s,e.untitledWorkspacesHome)}function Py(s){let e;return N.isUri(s)?e=s:e=s.configuration,e?.scheme===pe.tmp}const _je="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function oAt(s){return s.id===_je}function Jme(s,e){return!g3(s,e)&&!Py(s)}function mae(s){return(typeof s=="string"?Gy(s):vU(s))===mje}const yi=ae("contextService");var kg;(function(s){s.accessibilityHelpTitle=g(1259,"Accessibility Help"),s.openingDocs=g(1260,"Opening the Accessibility documentation page."),s.readonlyDiffEditor=g(1261,"You are in a read-only pane of a diff editor."),s.editableDiffEditor=g(1262,"You are in a pane of a diff editor."),s.readonlyEditor=g(1263,"You are in a read-only code editor."),s.editableEditor=g(1264,"You are in a code editor."),s.changeConfigToOnMac=g(1265,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),s.changeConfigToOnWinLinux=g(1266,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),s.auto_on=g(1267,"The application is configured to be optimized for usage with a Screen Reader."),s.auto_off=g(1268,"The application is configured to never be optimized for usage with a Screen Reader."),s.screenReaderModeEnabled=g(1269,"Screen Reader Optimized Mode enabled."),s.screenReaderModeDisabled=g(1270,"Screen Reader Optimized Mode disabled."),s.tabFocusModeOnMsg=g(1271,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior{0}.",""),s.tabFocusModeOffMsg=g(1272,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior{0}",""),s.stickScroll=g(1273,"Focus Sticky Scroll{0} to focus the currently nested scopes.",""),s.showAccessibilityHelpAction=g(1274,"Show Accessibility Help"),s.listSignalSounds=g(1275,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),s.listAlerts=g(1276,"Run the command: List Signal Announcements for an overview of announcements and their current status."),s.quickChat=g(1277,"Toggle quick chat{0} to open or close a chat session.",""),s.startInlineChat=g(1278,"Start inline chat{0} to create an in editor chat session.",""),s.setBreakpoint=g(1279,"The Debug: Inline Breakpoint command{0} will set or unset a breakpoint at the current cursor position in the active editor.",""),s.debugExecuteSelection=g(1280,"The Debug: Execute Selection command{0} will execute the selected text in the debug console.","")})(kg||(kg={}));var T2e;(function(s){s.inspectTokensAction=g(1281,"Developer: Inspect Tokens")})(T2e||(T2e={}));var qY;(function(s){s.editorViewAccessibleLabel=g(1288,"Editor content"),s.accessibilityHelpMessage=g(1289,"Press Alt+F1 for Accessibility Options.")})(qY||(qY={}));var L2e;(function(s){s.toggleHighContrast=g(1290,"Toggle High Contrast Theme")})(L2e||(L2e={}));var Xme;(function(s){s.bulkEditServiceSummary=g(1291,"Made {0} edits in {1} files")})(Xme||(Xme={}));const _ae=ae("workspaceTrustEnablementService"),uC=ae("workspaceTrustManagementService"),vae=ae("workspaceTrustRequestService");let zk=[],WLe=[],HLe=[];function tK(s,e=!1){vje(s,!1,e)}function rAt(s){vje(s,!0,!1)}function vje(s,e,t){const i=aAt(s,e);zk.push(i),i.userConfigured?HLe.push(i):WLe.push(i),t&&!i.userConfigured&&zk.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function aAt(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?j_(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(Vi.sep)>=0:!1}}function cAt(){zk=zk.filter(s=>s.userConfigured),WLe=[]}function lAt(){zk=zk.filter(s=>!s.userConfigured),HLe=[]}function dAt(s,e){return hAt(s,e).map(t=>t.id)}function hAt(s,e){let t;if(s)switch(s.scheme){case pe.file:t=s.fsPath;break;case pe.data:{t=Mk.parseMetaData(s).get(Mk.META_DATA_LABEL);break}case pe.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Us.unknown}];t=t.toLowerCase();const i=Ko(t),n=R2e(t,i,HLe);if(n)return[n,{id:Ca,mime:Us.text}];const o=R2e(t,i,WLe);if(o)return[o,{id:Ca,mime:Us.text}];if(e){const r=uAt(e);if(r)return[r,{id:Ca,mime:Us.text}]}return[{id:"unknown",mime:Us.unknown}]}function R2e(s,e,t){let i,n,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const c=a.filepatternOnPath?s:e;a.filepatternLowercase?.(c)&&(n=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(n)return n;if(o)return o}function uAt(s){if(eTe(s)&&(s=s.substr(1)),s.length>0)for(let e=zk.length-1;e>=0;e--){const t=zk[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const gv=Object.prototype.hasOwnProperty,M2e="vs.editor.nullLanguage";class gAt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(M2e,_T.Null),this._register(Ca,_T.PlainText),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||_T.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||M2e}}const Oz=class Oz extends V{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Oz.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new gAt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(wT.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Oz.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},cAt();const e=[].concat(wT.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return wT.registerLanguage(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),Qe.as(Nn.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;gv.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)tK({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)tK({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)tK({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const c=new RegExp(a);J1e(c)||tK({id:i,mime:n,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?gv.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)gv.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>wS(t.languageName,i.languageName)),e}getLanguageName(e){return gv.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return gv.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return gv.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return gv.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return gv.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return gv.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return gv.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&gv.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:dAt(e,t)}};Oz.instanceCount=0;let Zme=Oz;const Bz=class Bz extends V{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new I),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new I),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new I({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Bz.instanceCount++,this._registry=this._register(new Zme(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Bz.instanceCount--,super.dispose()}registerLanguage(e){return this._registry.registerLanguage(e)}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getRegisteredLanguageIds(){return this._registry.getRegisteredLanguageIds()}getSortedRegisteredLanguageNames(){return this._registry.getSortedRegisteredLanguageNames()}getLanguageName(e){return this._registry.getLanguageName(e)}getMimeType(e){return this._registry.getMimeType(e)}getIcon(e){return this._registry.getIcon(e)}getExtensions(e){return this._registry.getExtensions(e)}getFilenames(e){return this._registry.getFilenames(e)}getConfigurationFiles(e){return this._registry.getConfigurationFiles(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return lm(i,null)}createById(e){return new Che(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Che(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Che(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Ca),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Ta.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Bz.instanceCount=0;let QY=Bz;class Che{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new I({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter?.fire(this.languageId))}}class fAt extends V{constructor(e,t){super(),this._register(ue(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(ue(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const sp={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Us.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},pAt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let bae=pAt;const mAt=new ya(()=>bae("mouse",!1)),_At=new ya(()=>bae("element",!1));function bje(s){bae=s}function Pr(s){return s==="element"?_At.value:mAt.value}function $k(){return bae("element",!0)}class vAt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function wje(s){return(e,t,i)=>{let n=null,o=null;if(typeof i.value=="function"?(n="value",o=i.value):typeof i.get=="function"&&(n="get",o=i.get),!o)throw new Error("not supported");i[n]=s(o,t)}}function Zt(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,r)}),this[o]}}function ULe(s,e,t){return wje((i,n)=>{const o=`$debounce$${n}`,r=`$debounce$result$${n}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},s)}})}function bAt(s,e,t){return wje((i,n)=>{const o=`$throttle$timer$${n}`,r=`$throttle$result$${n}`,a=`$throttle$lastRun$${n}`,c=`$throttle$pending$${n}`;return function(...l){if(this[r]||(this[r]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[r]=e(this[r],...l)),this[c])return;const d=this[a]+s;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0):(this[c]=!0,this[o]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0},d-Date.now()))}})}var wAt=".monaco-list{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{height:100%;position:relative;width:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{min-width:100%;width:auto}.monaco-list-row{box-sizing:border-box;overflow:hidden;position:absolute;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{border-radius:10px;display:inline-block;font-size:12px;padding:1px 7px;position:absolute;z-index:1000}.monaco-list-type-filter-message{box-sizing:border-box;height:100%;left:0;opacity:.7;padding:40px 1em 1em;pointer-events:none;position:absolute;text-align:center;top:0;white-space:normal;width:100%}.monaco-list-type-filter-message:empty{display:none}";ut(wAt,{});var T1;(function(s){s[s.Copy=0]="Copy",s[s.Move=1]="Move"})(T1||(T1={}));var by;(function(s){s.Over="drop-target",s.Before="drop-target-before",s.After="drop-target-after"})(by||(by={}));class WI extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function N2e(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class SAt{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,o=N2e({start:0,end:e},this.groups),r=N2e({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:e_e(c.range,n),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=CAt(o,a,r),this._size=this._paddingTop+this.groups.reduce((c,l)=>c+l.size*(l.range.end-l.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}const HI={CurrentDragAndDropData:void 0};var IC;(function(s){s[s.TOP=0]="TOP",s[s.CENTER_TOP=1]="CENTER_TOP",s[s.CENTER_BOTTOM=2]="CENTER_BOTTOM",s[s.BOTTOM=3]="BOTTOM"})(IC||(IC={}));const jb={useShadows:!0,verticalScrollMode:Co.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class m6{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class yje{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class t_e{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;tn,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const ose=class ose{get contentHeight(){return this.rangeMap.size}get contentWidth(){return this.scrollWidth??0}get onDidScroll(){return this.scrollableElement.onScroll}get onWillScroll(){return this.scrollableElement.onWillScroll}get containerDomNode(){return this.rowsContainer}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:ZV(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=jb){if(this.virtualDelegate=t,this.domId=`list_id_${++ose.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Mh(50),this.splicing=!1,this.dragOverAnimationStopDisposable=V.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=V.None,this.onDragLeaveTimeout=V.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=M.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=M.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new AAt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=n.horizontalScrolling??jb.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new xAt(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??jb.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(fd.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new yN({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>Ll(ct(this.domNode),r)})),this.scrollableElement=this.disposables.add(new l6(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??jb.alwaysConsumeMouseWheel,horizontal:Co.Auto,vertical:n.verticalScrollMode??jb.verticalScrollMode,useShadows:n.useShadows??jb.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ue(this.rowsContainer,uo.Change,r=>this.onTouchChange(r))),this.disposables.add(ue(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(ue(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=n.setRowLineHeight??jb.setRowLineHeight,this.setRowHeight=n.setRowHeight??jb.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??jb.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(jb.dnd),this.layout(n.initialSize?.height,n.initialSize?.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}delegateScrollFromMouseWheelEvent(e){this.scrollableElement.delegateScrollFromMouseWheelEvent(e)}delegateVerticalScrollbarPointerDown(e){this.scrollableElement.delegateVerticalScrollbarPointerDown(e)}updateElementHeight(e,t,i){if(e<0||e>=this.items.length)return;const n=this.items[e].size;if(typeof t>"u"){if(!this.supportDynamicHeights){console.warn("Dynamic heights not supported");return}this.items[e].lastDynamicHeightWidth=void 0,t=n+this.probeDynamicHeight(e)}if(n===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;A--){const L=this.items[A];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let k=a.get(L.templateId);k||(k=[],a.set(L.templateId,k));const P=this.renderers.get(L.templateId);P&&P.disposeElement&&P.disposeElement(L.element,A,L.row.templateData,L.size),k.unshift(L.row)}L.row=null,L.stale=!0}const c={start:e+t,end:this.items.length},l=Md.intersect(c,n),d=Md.relativeComplement(c,n),h=i.map(A=>({id:String(this.itemId++),element:A,templateId:this.virtualDelegate.getTemplateId(A),size:this.virtualDelegate.getHeight(A),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(A),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:V.None,checkedDisposable:V.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));const f=i.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=e_e(l,f),v=Md.intersect(p,m);for(let A=v.start;Ae_e(A,f)),C=[{start:e,end:e+i.length},...w].map(A=>Md.intersect(p,A)).reverse();for(const A of C)for(let L=A.end-1;L>=A.start;L--){const k=this.items[L],R=a.get(k.templateId)?.pop();this.insertItemInDOM(L,R)}for(const A of a.values())for(const L of A)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(A=>A.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ll(ct(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}updateWidth(e){if(!this.horizontalScrolling||typeof this.scrollWidth>"u")return;const t=this.items[e];this.measureItemWidth(t),typeof t.width<"u"&&t.width>this.scrollWidth&&(this.scrollWidth=t.width,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth+10}),this._onDidChangeContentWidth.fire(this.scrollWidth))}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}get firstMostlyVisibleIndex(){const e=this.firstVisibleIndex,t=this.rangeMap.positionAt(e),i=this.rangeMap.positionAt(e+1);return i!==-1&&(i-t)/2+tt.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:cTe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:ZV(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),c=Md.relativeComplement(a,e).reverse(),l=Md.relativeComplement(e,a);if(r){const d=Md.intersect(e,a);for(let h=d.start;h{for(const d of l)for(let h=d.start;h=d.start;h--)this.insertItemInDOM(h)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);const o=this.accessibilityProvider.isChecked(i.element);if(typeof o=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!o));else if(o){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(o.value),i.checkedDisposable=o.onDidChange(()=>c(o.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const r=this.renderers.get(i.templateId);if(!r)throw new Error(`No renderer found for template id ${i.templateId}`);r?.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=ue(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,a,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=ZV(e.row.domNode);const t=ct(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}getScrollLeft(){return this.scrollableElement.getScrollPosition().scrollLeft}setScrollLeft(e){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth})),this.scrollableElement.setScrollPosition({scrollLeft:e})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return M.map(this.disposables.add(new ii(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new ii(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new ii(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return M.map(this.disposables.add(new ii(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new ii(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new ii(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return M.map(this.disposables.add(new ii(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new ii(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new ii(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new ii(this.domNode,uo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new ii(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new ii(this.rowsContainer,uo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(sp.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),typeof o>"u"&&(o=String(n.length));const r=fe(".monaco-drag-image");r.textContent=o,(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode).appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>r.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new m6(n),HI.CurrentDragAndDropData=new yje(n),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),HI.CurrentDragAndDropData&&HI.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(HI.CurrentDragAndDropData)this.currentDragData=HI.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new t_e}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===T1.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=ja(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:by.Over;if(EAt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===n)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&n!==by.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");n===by.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=jy(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,HI.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,HI.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=V.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Vj(this.domNode).top;this.dragOverAnimationDisposable=Udt(ct(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=jy(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,n=Math.floor(i/.25);return Ka(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Yr(i)||Pdt(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const c=this.getRenderRange(e,t);let l=!1;for(let d=c.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=c.start;us===e;function J2(s=_p){return(e,t)=>is(e,t,s)}function DAt(){return(s,e)=>s.equals(e)}function Fq(s,e,t){if(t!==void 0){const i=s;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=s;return(n,o)=>n==null||o===void 0||o===null?o===n:i(n,o)}}function jY(s,e){if(s===e)return!0;if(Array.isArray(s)&&Array.isArray(e)){if(s.length!==e.length)return!1;for(let t=0;t{const o=VLe(n);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(n.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:n},o=>n(this.read(o),o))}flatten(){return s_e({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(Sje(this,t)),this}keepObserved(e){return e.add(Aje(this)),this}get debugValue(){return this.get()}}class IU extends Eje{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function ts(s,e){const t=new TU(s,e);try{s(t)}finally{t.finish()}}let iK;function rV(s){if(iK)s(iK);else{const e=new TU(s,void 0);iK=e;try{s(e)}finally{e.finish(),iK=void 0}}}async function xje(s,e){const t=new TU(s,e);try{await s(t)}finally{t.finish()}}function SM(s,e,t){s?e(s):ts(e,t)}class TU{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():VLe(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t{},()=>`Setting ${this.debugName}`));try{const o=this._value;this._setValue(e),Cje()?.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this.observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function f3(s,e){let t;return typeof s=="string"?t=new Yd(void 0,s,void 0):t=new Yd(s,void 0,void 0),new WAt(t,e,_p)}class WAt extends zLe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Ze(s,e){return e!==void 0?new AM(new Yd(s,void 0,e),e,void 0,void 0,void 0,_p):new AM(new Yd(void 0,void 0,s),s,void 0,void 0,void 0,_p)}function _6(s,e,t){return new HAt(new Yd(s,void 0,e),e,void 0,void 0,void 0,_p,t)}function Jh(s,e){return new AM(new Yd(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,s.equalsFn??_p)}BAt(Jh);function Dje(s,e){return new AM(new Yd(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,s.equalityComparer??_p)}function AI(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Z;return new AM(new Yd(i,void 0,t),o=>(n.clear(),t(o,n)),void 0,void 0,()=>n.dispose(),_p)}function mh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);let n;return new AM(new Yd(i,void 0,t),o=>{n?n.clear():n=new Z;const r=t(o);return r&&n.add(r),r},void 0,void 0,()=>{n&&(n.dispose(),n=void 0)},_p)}var Sd;(function(s){s[s.initial=0]="initial",s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(Sd||(Sd={}));class AM extends IU{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=Sd.initial,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=this.createChangeSummary?.()}onLastObserverRemoved(){this.state=Sd.initial,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),this._handleLastObserverRemoved?.()}get(){if(this.observers.size===0){const e=this._computeFn(this,this.createChangeSummary?.());return this.onLastObserverRemoved(),e}else{do{if(this.state===Sd.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===Sd.stale)break}this.state===Sd.dependenciesMightHaveChanged&&(this.state=Sd.upToDate),this._recomputeIfNeeded()}while(this.state!==Sd.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===Sd.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==Sd.initial,i=this.value;this.state=Sd.upToDate;const n=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,n)}finally{for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const r of this.observers)r.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===Sd.upToDate&&(this.state=Sd.dependenciesMightHaveChanged,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}G_(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===Sd.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=Sd.dependenciesMightHaveChanged;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,n=this.state===Sd.upToDate;if(i&&(this.state===Sd.dependenciesMightHaveChanged||n)&&(this.state=Sd.stale,n))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class HAt extends AM{constructor(e,t,i,n,o=void 0,r,a){super(e,t,i,n,o,r),this.set=a}}function ai(s){return new wae(new Yd(void 0,void 0,s),s,void 0,void 0)}function v6(s,e){return new wae(new Yd(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,void 0)}function LU(s,e){return new wae(new Yd(s.owner,s.debugName,s.debugReferenceFn??e),e,s.createEmptyChangeSummary,s.handleChange)}function UAt(s,e){const t=new Z,i=LU({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,createEmptyChangeSummary:s.createEmptyChangeSummary,handleChange:s.handleChange},(n,o)=>{t.clear(),e(n,o,t)});return Ee(()=>{i.dispose(),t.dispose()})}function cu(s){const e=new Z,t=v6({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var xf;(function(s){s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(xf||(xf={}));class wae{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=xf.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),gU(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),fU(this)}_runIfNeeded(){if(this.state===xf.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=xf.upToDate;const t=this.disposed;try{if(!t){Cje()?.handleAutorunTriggered(this);const i=this.changeSummary;this.changeSummary=this.createChangeSummary?.(),this._runFn(this,i)}}finally{for(const i of this.dependenciesToBeRemoved)i.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===xf.upToDate&&(this.state=xf.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===xf.dependenciesMightHaveChanged){this.state=xf.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===xf.stale)break}this._runIfNeeded()}while(this.state!==xf.upToDate);this.updateCount--,G_(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===xf.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=xf.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:n=>n===e},this.changeSummary))&&(this.state=xf.stale)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(s){s.Observer=wae})(ai||(ai={}));function nd(s){return new VAt(s)}class VAt extends Eje{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Kn(...s){let e,t,i;return s.length===3?[e,t,i]=s:[t,i]=s,new kx(new Yd(e,void 0,i),t,i,()=>kx.globalTransaction,_p)}function zAt(s,e,t){return new kx(new Yd(s.owner,s.debugName,s.debugReferenceFn??t),e,t,()=>kx.globalTransaction,s.equalsFn??_p)}class kx extends IU{constructor(e,t,i,n,o){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=o,this.hasValue=!1,this.handleEvent=r=>{const a=this._getValue(r),c=this.value;(!this.hasValue||!this._equalityComparator(c,a))&&(this.value=a,this.hasValue&&SM(this._getTransaction(),d=>{for(const h of this.observers)d.updateObserver(h,this),h.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")}),this.hasValue=!0)}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(s){s.Observer=kx;function e(t,i){let n=!1;kx.globalTransaction===void 0&&(kx.globalTransaction=t,n=!0);try{i()}finally{n&&(kx.globalTransaction=void 0)}}s.batchEventsGlobally=e})(Kn||(Kn={}));function id(s,e){return new $At(s,e)}class $At extends IU{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ts(i=>{for(const n of this.observers)i.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function gC(s){return typeof s=="string"?new W2e(s):new W2e(void 0,s)}class W2e extends IU{get debugName(){return new Yd(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){ts(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function Oq(s){const e=new kje(!1,void 0);return s.addObserver(e),Ee(()=>{s.removeObserver(e)})}OAt(Oq);function FN(s,e){const t=new kje(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ee(()=>{s.removeObserver(t)})}FAt(FN);class kje{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function b6(s,e){let t;return Jh({owner:s,debugReferenceFn:e},n=>(t=e(n,t),t))}function GAt(s,e){let t;const i=gC("derivedObservableWithWritableCache"),n=Ze(s,o=>(i.read(o),t=e(o,t),t));return Object.assign(n,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function YY(s,e,t,i){let n=new H2e(t,i);return Jh({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new H2e(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}class H2e{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const o=this._keySelector?this._keySelector(n):n;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(n,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}class $Le{constructor(e){this.observable=e}get onDidChange(){return M.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function Ije(s,e){return e instanceof $Le?e.observable:Kn(s,e.onDidChange,()=>e.value)}function KAt(s,e){return b6(s,(t,i)=>i??e(t))}class qAt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let p3=class{get name(){return this._trait}get renderer(){return new qAt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(V2e),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=r_e(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return y2(this.sortedIndexes,e,V2e)>=0}dispose(){bt(this._onChange)}};p3.__decorator=D([Zt],p3.prototype,"renderer",null);class QAt extends p3{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class She{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function nA(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function w6(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:w6(s.parentElement,e)}function aV(s){return w6(s,"monaco-editor")}function jAt(s){return w6(s,"monaco-custom-toggle")}function YAt(s){return w6(s,"action-item")}function S5(s){return w6(s,"monaco-tree-sticky-row")}function m3(s){return s.classList.contains("monaco-tree-sticky-container")}function Tje(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:Tje(s.parentElement)}class o_e{get onKeyDown(){return M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,e=>e.filter(t=>!nA(t.target)).map(t=>new En(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Z,this.multipleSelectionDisposables=new Z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(n=>{switch(n.keyCode){case S.Enter:return this.onEnter(n);case S.UpArrow:return this.onUpArrow(n);case S.DownArrow:return this.onDownArrow(n);case S.PageUp:return this.onPageUpArrow(n);case S.PageDown:return this.onPageDownArrow(n);case S.Escape:return this.onEscape(n);case S.KeyA:this.multipleSelectionSupport&&(Qt?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Au(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}o_e.__decorator=D([Zt],o_e.prototype,"onKeyDown",null);var Gw;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(Gw||(Gw={}));var hF;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(hF||(hF={}));const JAt=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=S.KeyA&&s.keyCode<=S.KeyZ||s.keyCode>=S.Digit0&&s.keyCode<=S.Digit9||s.keyCode>=S.Numpad0&&s.keyCode<=S.Numpad9||s.keyCode>=S.Semicolon&&s.keyCode<=S.Quote}};class XAt{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=hF.Idle,this.mode=Gw.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Z,this.disposables=new Z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Gw.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=M.chain(this.enabledDisposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.filter(r=>!nA(r.target)).filter(()=>this.mode===Gw.Automatic||this.triggered).map(r=>new En(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>en.stop(r,!0)).map(r=>r.browserEvent.key)),i=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?Mr(t):t&&Mr(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=hF.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===hF.Idle?1:0;this.state=hF.Typing;for(let o=0;o1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof c>"u"||CM(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class ZAt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=M.chain(this.disposables.add(new ii(t.domNode,"keydown")).event,o=>o.filter(r=>!nA(r.target)).map(r=>new En(r)));M.chain(i,o=>o.filter(r=>r.keyCode===S.Tab&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!Yr(n)||n.tabIndex===-1)return;const o=ct(n).getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function Lje(s){return Qt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function Rje(s){return s.browserEvent.shiftKey}function eEt(s){return hTe(s)&&s.button===2}const U2e={isSelectionSingleChangeEvent:Lje,isSelectionRangeChangeEvent:Rje};class Mje{constructor(e){this.list=e,this.disposables=new Z,this._onPointer=new I,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||U2e),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(fd.addTarget(e.getHTMLElement()))),M.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||U2e))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){aV(e.browserEvent.target)||Bc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(nA(e.browserEvent.target)||aV(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||nA(e.browserEvent.target)||aV(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),eEt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(nA(e.browserEvent.target)||aV(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const n=Math.min(i,t),o=Math.max(i,t),r=Au(n,o+1),a=this.list.getSelection(),c=nEt(r_e(a,[i]),i);if(c.length===0)return;const l=r_e(r,sEt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Nje{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=hS(e.listFocusAndSelectionOutline,hS(e.listSelectionOutline,e.listFocusOutline??""));s&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` + `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=Iy(e.listFocusAndSelectionOutline,Iy(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const o=hS(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` + `);const o=Iy(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` .monaco-list${t}.drop-target, .monaco-list${t} .monaco-list-rows.drop-target, .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } @@ -268,17 +269,17 @@ ${e}`)}function _Et(n){return sL(n,"`")}function vEt(n){return sL(n,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const nDt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:fe.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:fe.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:fe.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},sDt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function oDt(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class aDt{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class cDt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),o=s&&typeof s!="string"?s:Au(s);i.disposables.add(Ni(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,s){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lDt{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,s,o){return this.dnd.onDragOver(e,t,i,s,o)}onDragLeave(e,t,i,s){this.dnd.onDragLeave?.(e,t,i,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,s,o){this.dnd.drop(e,t,i,s,o)}dispose(){this.dnd.dispose()}}class Fc{get onDidChangeFocus(){return T.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return T.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseUp(){return this.view.onMouseUp}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseMove(){return this.view.onMouseMove}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.map(r=>new os(r)).filter(r=>e=r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).filter(()=>!1)),i=T.chain(this.disposables.add(new oi(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new os(r)).filter(r=>r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),c=a.length?a[0]:void 0,l=typeof c<"u"?this.view.element(c):void 0,d=typeof c<"u"?this.view.domElement(c):this.view.domNode;return{index:c,element:l,anchor:d,browserEvent:r}})),s=T.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new yu(gt(this.view.domNode),c),browserEvent:c})));return T.any(t,i,s)}get onKeyDown(){return this.disposables.add(new oi(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new oi(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new oi(this.view.domNode,"keypress")).event}get onDidFocus(){return T.signal(this.disposables.add(new oi(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return T.signal(this.disposables.add(new oi(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,o=sDt){this.user=e,this._options=o,this.focus=new v7("focused"),this.anchor=new v7("anchor"),this.eventBufferer=new Ole,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new Yxt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new cDt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(l=>new aDt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new lDt(this,o.dnd)};if(this.view=this.createListView(t,i,s,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=od(this.view.domNode);this.styleController=new QJe(l,this.view.domId)}if(this.spliceable=new wxt([new Nfe(this.focus,this.view,o.identityProvider),new Nfe(this.selection,this.view,o.identityProvider),new Nfe(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new tDt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new vbe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||Zxt;this.typeNavigationController=new eDt(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Zc(e,t,i,s)}createMouseController(e){return new qJe(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new SL(this.user,`Invalid start index: ${e}`);if(t<0)throw new SL(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}updateWidth(e){this.view.updateWidth(e)}updateElementHeight(e,t){this.view.updateElementHeight(e,t,null)}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollLeft(){return this.view.getScrollLeft()}set scrollLeft(e){this.view.setScrollLeft(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get firstMostlyVisibleIndex(){return this.view.firstMostlyVisibleIndex}get lastVisibleIndex(){return this.view.lastVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}triggerTypeNavigation(){this.typeNavigationController?.trigger()}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return k_(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Ta(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const o=i(),r=this.view.getScrollTop()+o;r===0?s=this.view.indexAt(r):s=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const c=this.findNextIndex(s,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([s],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Ta(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(Kc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*kc(t,0,1)+o-i)}else{const a=o+r,c=s+this.view.renderHeight;o=c||(o=c&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-s)/r)}isDOMFocused(){return kw(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Fc.__decorator=D([ii],Fc.prototype,"onDidChangeFocus",null);Fc.__decorator=D([ii],Fc.prototype,"onDidChangeSelection",null);Fc.__decorator=D([ii],Fc.prototype,"onContextMenu",null);Fc.__decorator=D([ii],Fc.prototype,"onKeyDown",null);Fc.__decorator=D([ii],Fc.prototype,"onKeyUp",null);Fc.__decorator=D([ii],Fc.prototype,"onKeyPress",null);Fc.__decorator=D([ii],Fc.prototype,"onDidFocus",null);Fc.__decorator=D([ii],Fc.prototype,"onDidBlur",null);let jJe={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null,triggerUpdatableHover:()=>{}};function KJe(n){jJe=n}function H_(){return jJe}var dDt=".monaco-select-box-dropdown-padding{--dropdown-padding-top:1px;--dropdown-padding-bottom:1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top:3px;--dropdown-padding-bottom:4px}.monaco-select-box-dropdown-container{box-sizing:border-box;display:none}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{font-family:var(--monaco-monospace-font);line-height:15px}.monaco-select-box-dropdown-container.visible{border-bottom-left-radius:3px;border-bottom-right-radius:3px;display:flex;flex-direction:column;overflow:hidden;text-align:left;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{align-self:flex-start;box-sizing:border-box;flex:0 0 auto;overflow:hidden;padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;padding-top:var(--dropdown-padding-top);width:100%}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-bottom:var(--dropdown-padding-bottom);padding-top:var(--dropdown-padding-top)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{float:left;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{float:left;opacity:.7;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{float:right;overflow:hidden;padding-right:10px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{height:1px;left:-10000px;overflow:hidden;position:absolute;top:auto;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{align-self:flex-start;flex:1 1 auto;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{max-height:0;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}";Ct(dDt,{});const hDt="vs/base/browser/ui/selectBox/selectBoxCustom",wR=we,YJe="selectOption.entry.template";class uDt{get templateId(){return YJe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=he(e,wR(".option-text")),t.detail=he(e,wR(".option-detail")),t.decoratorRight=he(e,wR(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",c?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const KC=class KC extends ${constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=KC.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new I,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(H_().setupUpdatableHover(va("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return YJe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=we(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=he(this.selectDropDownContainer,wR(".select-box-details-pane"));const t=he(this.selectDropDownContainer,wR(".select-box-dropdown-container-width-control")),i=he(t,wR(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",he(i,this.widthControlElement),this._dropDownPosition=Jp.BELOW,this.styleElement=od(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(pe(this.selectDropDownContainer,xe.DRAG_START,s=>{un.stop(s,!0)}))}registerListeners(){this._register(Xo(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(pe(this.selectElement,xe.CLICK,t=>{un.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.MOUSE_DOWN,t=>{un.stop(t)}));let e;this._register(pe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(pe(this.selectElement,"touchend",t=>{un.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.KEY_DOWN,t=>{const i=new os(t);let s=!1;ei?(i.keyCode===E.DownArrow||i.keyCode===E.UpArrow||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0):(i.keyCode===E.DownArrow&&i.altKey||i.keyCode===E.UpArrow&&i.altKey||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0),s&&(this.showSelectDropDown(),un.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ls(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setEnabled(e){this.selectElement.disabled=!e}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}setAriaLabel(e){this.selectBoxOptions.ariaLabel=e,this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=hS(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=gt(this.selectElement),i=ia(this.selectElement),s=gt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-KC.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,c=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(c)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,p=Math.floor((r-o-u)/this.getHeight()),m=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Jp.ABOVE,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Jp.BELOW,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=p*this.getHeight())}else f>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,c=o.decoratorRight?o.decoratorRight.length:0,l=o.text.length+a+c;l>s&&(i=r,s=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=du(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=he(e,wR(".select-box-dropdown-list-container")),this.listRenderer=new uDt,this.selectList=new Fc("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:zo.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>g(hDt,0,"Select Box"),getRole:()=>ei?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new oi(this.selectDropDownListContainer,"keydown")),i=T.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new os(o)));this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Enter))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Tab))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Escape))(this.onEscape,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.UpArrow))(this.onUpArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.DownArrow))(this.onDownArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageDown))(this.onPageDown,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageUp))(this.onPageUp,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Home))(this.onHome,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.End))(this.onEnd,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode>=E.Digit0&&o.keyCode<=E.KeyZ||o.keyCode>=E.Semicolon&&o.keyCode<=E.NumpadDivide))(this.onCharacter,this)),this._register(pe(this.selectList.getHTMLElement(),xe.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(pe(this.selectDropDownContainer,xe.FOCUS_OUT,s=>{!this._isVisible||al(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;un.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(un.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){un.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){un.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){un.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=iE.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(pe(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Xo(this.selectElement,"click",e=>{un.stop(e,!0)})),this._register(Xo(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Xo(this.selectElement,"keydown",e=>{let t=!1;ei?(e.keyCode===E.DownArrow||e.keyCode===E.UpArrow||e.keyCode===E.Space)&&(t=!0):(e.keyCode===E.DownArrow&&e.altKey||e.keyCode===E.Space||e.keyCode===E.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ls(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new gw)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(dh.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,pp&&this._register(pe(e,xe.DRAG_START,s=>s.dataTransfer?.setData(fm.TEXT,this._action.label)))),this._register(pe(t,Eo.Tap,s=>this.onClick(s,!0))),this._register(pe(t,xe.MOUSE_DOWN,s=>{i||un.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),ei&&this._register(pe(t,xe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(pe(t,xe.CLICK,s=>{un.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(pe(t,xe.DBLCLICK,s=>{un.stop(s,!0)})),[xe.MOUSE_UP,xe.MOUSE_OUT].forEach(s=>{this._register(pe(t,s,o=>{un.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){un.stop(e,!0);const i=hc(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}isFocused(){return!!this.element?.classList.contains("focused")}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),this.options.hoverDelegate?.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const t=this.options.hoverDelegate??va("element");this.customHover=this._store.add(H_().setupUpdatableHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class WS extends c_{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),Bt(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Kr.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}isFocused(){return!!this.label&&this.label?.tabIndex===0}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=g(_Dt,0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class JJe extends c_{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new pDt(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}setOptions(e,t){this.selectBox.setOptions(e,t)}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}var vDt=".monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(vDt,{});class wDt extends gw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=he(e,we(".monaco-dropdown")),this._label=he(this._element,we(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[xe.CLICK,xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this.element,o,r=>un.stop(r,!0)));for(const o of[xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this._label,o,r=>{hMe(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(pe(this._label,xe.KEY_UP,o=>{const r=new os(o);(r.equals(E.Enter)||r.equals(E.Space))&&(un.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(dh.addTarget(this._label))}get element(){return this._element}get label(){return this._label}set tooltip(e){this._label&&(!this.hover&&e!==""?this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this._label,e)):this.hover&&this.hover.update(e))}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}isVisible(){return!!this.visible}onEvent(e,t){this.hide()}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class bDt extends wDt{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:Ob.LEFT,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class gx extends c_{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=he(o,we("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new bDt(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{this.element?.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}var CDt=".monaco-action-bar .action-item.menu-entry .action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(CDt,{});const _c=ae("menuService");function XJe(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function yDt(n){return n?n.condition!==void 0:!1}const vs=n=>{performance.mark(n)},SDt=()=>{let n=performance.timeOrigin;typeof n!="number"&&(n=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const e=[{name:"code/timeOrigin",startTime:Math.round(n)}];for(const t of performance.getEntriesByType("mark"))e.push({name:t.name,startTime:Math.round(n+t.startTime)});return e};var MI;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(MI||(MI={}));function ADt(n){const e=n;return e?.changed instanceof Map||e?.deleted instanceof Set}var eb;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(eb||(eb={}));const Aae=class Aae extends ${constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new r1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=eb.None,this.cache=new Map,this.flushDelayer=this._register(new iQ(Aae.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===eb.Closed)return;let i=!1;hc(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===eb.None&&(this.state=eb.Initialized,this.options.hint!==MI.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return hc(i)?t:i}getBoolean(e,t){const i=this.get(e);return hc(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return hc(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return hc(i)?t:JU(i)}async set(e,t,i=!1){if(this.state===eb.Closed)return;if(hc(t))return this.delete(e,i);const s=fo(t)||Array.isArray(t)?uJe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===eb.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==eb.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=eb.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===eb.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===MI.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===MI.STORAGE_IN_MEMORY}};Aae.DEFAULT_FLUSH_DELAY=100;let fx=Aae;class fJ{constructor(){this.onDidChangeItemsExternal=T.None,this.items=new Map}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}async optimize(){}async close(){}}const ci=ae("fileService"),_o=ae("IUriIdentityService"),EDt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xDt(n){return EDt.test(n)}const Dr=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;sd.id===a);l&&i.set(c,l)}if(o.emptyWindows)for(const[r,a]of Object.entries(o.emptyWindows)){const c=t.find(l=>l.id===a);c&&s.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:s}}return this._profilesObject}createDefaultProfile(){const e=S3("__default__profile__",g(DDt,0,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Iu(t)}\\s(\\d+)`);let s=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;s=c>s?c:s}const o=`${t} ${s+1}`;return this.createProfile(Ed(Dr()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Ed(Dr()).toString(16),e,t,i)}async createProfile(e,t,i,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return s&&await this.setProfileForWorkspace(s,o),o}async doCreateProfile(e,t,i){if(!$t(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(t);return s||(s=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=S3(e,t,Qt(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(r.location);const a=[];return this._onWillCreateProfile.fire({profile:r,join(c){a.push(c)}}),await ko.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,s)),s}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=S3(i.id,t.name??i.name,i.location,this.profilesCacheHome,{shortName:t.shortName??i.shortName,icon:t.icon===null?void 0:t.icon??i.icon,transient:t.transient??i.isTransient,useDefaultFlags:t.useDefaultFlags??i.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[i]),i}async removeProfile(e){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(s=>s.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(s){i.push(s)}});try{await Promise.allSettled(i)}catch(s){this.logService.error(s)}for(const s of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(s)?.id&&this.profilesObject.emptyWindows.delete(s);for(const s of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(s)?.id&&this.profilesObject.workspaces.delete(s);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(s){Cy(s)!==Zi.FILE_NOT_FOUND&&this.logService.error(s)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(s=>s.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);this.updateWorkspaceAssociation(e,i)}unsetWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(e,void 0,t)}async resetWorkspaces(){this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e);return P.isUri(t)?this.transientProfilesObject.workspaces.get(t)??this.profilesObject.workspaces.get(t):this.transientProfilesObject.emptyWindows.get(t)??this.profilesObject.emptyWindows.get(t)}getWorkspace(e){return BS(e)?e.uri:hF(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const s=[...this.profiles,...e],o=[];this.transientProfilesObject.profiles=[];for(let r of s)r.isDefault||t.some(a=>r.id===a.id)||(r=i.find(a=>r.id===a.id)??r,r.isTransient?this.transientProfilesObject.profiles.push(r):o.push({location:r.location,name:r.name,shortName:r.shortName,icon:r.icon,useDefaultFlags:r.useDefaultFlags}));this.saveStoredProfiles(o),this._profilesObject=void 0,this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateWorkspaceAssociation(e,t,i){i=t?.isTransient?!0:i,i||this.updateWorkspaceAssociation(e,void 0,!0);const s=this.getWorkspace(e),o=i?this.transientProfilesObject:this.profilesObject;P.isUri(s)?(o.workspaces.delete(s),t&&o.workspaces.set(s,t)):(o.emptyWindows.delete(s),t&&o.emptyWindows.set(s,t)),i||this.updateStoredProfileAssociations()}updateStoredProfileAssociations(){const e={};for(const[i,s]of this.profilesObject.workspaces.entries())e[i.toString()]=s.id;const t={};for(const[i,s]of this.profilesObject.emptyWindows.entries())t[i.toString()]=s.id;this.saveStoredProfileAssociations({workspaces:e,emptyWindows:t}),this._profilesObject=void 0}migrateStoredProfileAssociations(e){const t={},i=this.createDefaultProfile();if(e.workspaces)for(const[o,r]of Object.entries(e.workspaces)){const a=P.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const s={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=P.parse(r);s[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:s}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},iN.PROFILES_KEY="userDataProfiles",iN.PROFILE_ASSOCIATIONS_KEY="profileAssociations",iN);uUe=D([_(0,Il),_(1,ci),_(2,_o),_(3,Ze)],uUe);const pJ="__$__isNewStorageMarker",mJ="__$__targetStorageMarker";var nS;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(nS||(nS={}));var ke;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(ke||(ke={}));var ln;(function(n){n[n.USER=0]="USER",n[n.MACHINE=1]="MACHINE"})(ln||(ln={}));function kDt(n){const e=n.get(mJ);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Eae=class Eae extends ${constructor(e={flushInterval:Eae.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new r1),this._onDidChangeTarget=this._register(new r1),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new yn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new Dn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return T.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=PU(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){St([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{vs("code/willInitStorage");try{await this.doInitialize()}finally{vs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===mJ){switch(e){case ke.APPLICATION:this._applicationKeyTargets=void 0;break;case ke.PROFILE:this._profileKeyTargets=void 0;break;case ke.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,s,o=!1){if(hc(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,s),this.getStorage(i)?.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],s=this.getKeyTargets(e);for(const o of Object.keys(s))s[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,s=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(mJ,JSON.stringify(o),s)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(mJ,JSON.stringify(o),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(ke.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(ke.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(ke.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case ke.APPLICATION:return this.applicationKeyTargets;case ke.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?kDt(t):Object.create(null)}isNew(e){return this.getBoolean(pJ,e)===!0}async flush(e=nS.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(ke.APPLICATION),i=this.getStorage(ke.PROFILE),s=this.getStorage(ke.WORKSPACE);switch(e){case nS.NONE:await ko.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case nS.SHUTDOWN:await ko.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(ke.APPLICATION)?.items??new Map,t=this.getStorage(ke.PROFILE)?.items??new Map,i=this.getStorage(ke.WORKSPACE)?.items??new Map;return LDt(e,t,i,this.getLogDetails(ke.APPLICATION)??"",this.getLogDetails(ke.PROFILE)??"",this.getLogDetails(ke.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(nS.NONE),ZJe(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||Cbe(t)&&Cbe(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const s=new Set;for(const[o,r]of e)s.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)s.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};Eae.DEFAULT_FLUSH_INTERVAL=60*1e3;let ZU=Eae;function Cbe(n){return n.isDefault||!!n.useDefaultFlags?.globalState}class IDt extends ZU{constructor(){super(),this.applicationStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.APPLICATION,e)))}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return"inMemory (application)";case ke.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function LDt(n,e,t,i,s,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;n.forEach((m,v)=>{a.set(v,m),c.set(v,r(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,r(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,r(m))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const f=[];if(a.forEach((m,v)=>{f.push({key:v,value:m})}),console.table(f),console.groupEnd(),console.log(c),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const m=[];l.forEach((v,w)=>{m.push({key:w,value:v})}),console.table(m),console.groupEnd(),console.log(d)}console.group(`Storage: Workspace (path: ${o})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const on=ae("storageService");function TDt(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?Ye(s):void 0}return t}const RDt={keybindingLabelBackground:Ye(s_t),keybindingLabelForeground:Ye(o_t),keybindingLabelBorder:Ye(r_t),keybindingLabelBottomBorder:Ye(a_t),keybindingLabelShadow:Ye(__)},yQ={buttonForeground:Ye(Zy),buttonSeparator:Ye(f3),buttonBackground:Ye(eS),buttonHoverBackground:Ye(J9),buttonSecondaryForeground:Ye(Zmt),buttonSecondaryBackground:Ye(nwe),buttonSecondaryHoverBackground:Ye(e_t),buttonBorder:Ye(Xmt)},eXe={progressBarBackground:Ye(bmt)},See={inputActiveOptionBorder:Ye(LMe),inputActiveOptionForeground:Ye(TMe),inputActiveOptionBackground:Ye(hR)};Ye(t_t),Ye(n_t),Ye(i_t);Ye(Zs),Ye(ng),Ye(__),Ye(ft),Ye(Omt),Ye(Bmt),Ye(Wmt),Ye(GB);const eV={inputBackground:Ye(SE),inputForeground:Ye(wKe),inputBorder:Ye(_$),inputValidationInfoBorder:Ye(Qmt),inputValidationInfoBackground:Ye(Gmt),inputValidationInfoForeground:Ye(qmt),inputValidationWarningBorder:Ye(Ymt),inputValidationWarningBackground:Ye(jmt),inputValidationWarningForeground:Ye(Kmt),inputValidationErrorBorder:Ye(yKe),inputValidationErrorBackground:Ye(bKe),inputValidationErrorForeground:Ye(CKe)},MDt={listFilterWidgetBackground:Ye(v_t),listFilterWidgetOutline:Ye(w_t),listFilterWidgetNoMatchesOutline:Ye(b_t),listFilterWidgetShadow:Ye(C_t),inputBoxStyles:eV,toggleStyles:See},tXe={badgeBackground:Ye(kW),badgeForeground:Ye(kMe),badgeBorder:Ye(ft)};Ye(Pmt),Ye(Nmt),Ye(dWe),Ye(dWe),Ye(Fmt);const bO={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Ye(c_t),listFocusForeground:Ye(l_t),listFocusOutline:Ye(swe),listActiveSelectionBackground:Ye(v_),listActiveSelectionForeground:Ye(um),listActiveSelectionIconForeground:Ye(p3),listFocusAndSelectionOutline:Ye(d_t),listFocusAndSelectionBackground:Ye(v_),listFocusAndSelectionForeground:Ye(um),listInactiveSelectionBackground:Ye(owe),listInactiveSelectionIconForeground:Ye(u_t),listInactiveSelectionForeground:Ye(h_t),listInactiveFocusBackground:Ye(g_t),listInactiveFocusOutline:Ye(f_t),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listDropOverBackground:Ye(p_t),listDropBetweenBackground:Ye(m_t),listSelectionOutline:Ye(co),listHoverOutline:Ye(co),treeIndentGuidesStroke:Ye(uR),treeInactiveIndentGuidesStroke:Ye(S_t),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:Ye(A_t),tableOddRowsBackgroundColor:Ye(E_t)};function CO(n){return TDt(n,bO)}const iXe={selectBackground:Ye(Xy),selectListBackground:Ye(Jmt),selectForeground:Ye(AE),decoratorRightForeground:Ye(EKe),selectBorder:Ye(YB),focusBorder:Ye(Zd),listFocusBackground:Ye($k),listInactiveSelectionIconForeground:Ye(JB),listFocusForeground:Ye(zk),listFocusOutline:ewe(co,fe.transparent.toString()),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listHoverOutline:Ye(co),selectListBorder:Ye(sg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},NDt={shadowColor:Ye(__),borderColor:Ye(x_t),foregroundColor:Ye(D_t),backgroundColor:Ye(k_t),selectionForegroundColor:Ye(I_t),selectionBackgroundColor:Ye(L_t),selectionBorderColor:Ye(T_t),separatorColor:Ye(R_t),scrollbarShadow:Ye(p_),scrollbarSliderBackground:Ye(d3),scrollbarSliderHoverBackground:Ye(h3),scrollbarSliderActiveBackground:Ye(u3)},Pfe="vs/platform/actions/browser/menuEntryActionViewItem";function nXe(n,e,t,i){const s=n.getActions(e),o=Nb.getInstance(),r=o.keyStatus.altKey||(Is||jr)&&o.keyStatus.shiftKey;sXe(s,t,r,i?a=>a===i:a=>a==="navigation")}function tD(n,e,t,i,s,o){const r=n.getActions(e);sXe(r,t,!1,typeof i=="string"?c=>c===i:i,s,o)}function sXe(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of n){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Kr)):(h=a,h.length>0&&h.push(new Kr));for(let u of d){t&&(u=u instanceof id&&u.alt?u.alt:u);const f=h.push(u);u instanceof u1&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?r:a,f=d.actions;s(d,l,u.length)&&u.splice(h,1,...f)}}let eC=class extends WS{constructor(e,t,i,s,o,r,a,c){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Dn),this._altKey=Nb.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const s=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(pe(e,"mouseleave",s=>{t=!1,i()})),this._register(pe(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?g(Pfe,0,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),c=a?g(Pfe,0,"{0} ({1})",o,a):o;s=g(Pfe,1,`{0} -[{1}] {2}`,s,bde.modifierLabels[$c].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&yDt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if($e.isThemeIcon(s)){const o=$e.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(s.dark):uf(s.light),i.classList.add("icon"),this._itemClassDispose.value=pa(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};eC=D([_(2,ti),_(3,Pi),_(4,Pe),_(5,pn),_(6,Vr),_(7,Ur)],eC);let b7=class extends gx{constructor(e,t,i,s,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??($e.isThemeIcon(e.item.icon)?$e.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,r),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Bt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!$e.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(i.dark):uf(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};b7=D([_(2,ti),_(3,Vr),_(4,pn)],b7);let ybe=class extends c_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=c,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let l;const d=t?.persistLastActionId?c.get(this._storageKey,ke.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(eC,l,{keybinding:this._getDefaultActionKeybindingLabel(l)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??new gw};this._dropdown=new gx(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof id&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,ke.WORKSPACE,ln.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(eC,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends gw{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Yle(this._container,we(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=we(".action-container");this._defaultAction.render(he(this._container,t)),this._register(pe(t,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=we(".dropdown-action-container");this._dropdown.render(he(this._container,i)),this._register(pe(i,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};ybe=D([_(2,ti),_(3,Pi),_(4,Vr),_(5,_c),_(6,be),_(7,on)],ybe);let Sbe=class extends JJe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Kr.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,iXe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=Ye(YB)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};Sbe=D([_(1,W_)],Sbe);function yO(n,e,t){return e instanceof id?n.createInstance(eC,e,t):e instanceof uS?e.item.isSelection?n.createInstance(Sbe,e):e.item.rememberDefaultAction?n.createInstance(ybe,e,{...t,persistLastActionId:!0}):n.createInstance(b7,e,t):void 0}var Qb;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Qb||(Qb={}));class Qh extends ${constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new Zo),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new I({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??Qb.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[E.Enter,E.Space]},this._hoverDelegate=t.hoverDelegate??this._register(C1()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new gw,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(o=>this._onDidRun.fire(o))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(o=>this._onWillRun.fire(o))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case Qb.HORIZONTAL:i=[E.LeftArrow],s=[E.RightArrow];break;case Qb.VERTICAL:i=[E.UpArrow],s=[E.DownArrow],this.domNode.className+=" vertical";break}this._register(pe(this.domNode,xe.KEY_DOWN,o=>{const r=new os(o);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():s&&(r.equals(s[0])||r.equals(s[1]))?a=this.focusNext():r.equals(E.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(E.Home)?a=this.focusFirst():r.equals(E.End)?a=this.focusLast():r.equals(E.Tab)&&c instanceof c_&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(pe(this.domNode,xe.KEY_UP,o=>{const r=new os(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(E.Tab)||r.equals(V.Shift|E.Tab)||r.equals(E.UpArrow)||r.equals(E.DownArrow)||r.equals(E.LeftArrow)||r.equals(E.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Dd(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(xl()===this.domNode||!al(xl(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setAriaLabel(e){e?this.actionsList.setAttribute("aria-label",e):this.actionsList.removeAttribute("aria-label")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof c_&&i.isEnabled());t instanceof c_&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof c_&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}hasAction(e){return this.viewItems.findIndex(t=>t.action.id===e.id)!==-1}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(Ra(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new WS(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,pe(r,xe.CONTEXT_MENU,l=>{un.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof c_&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let o=!0;SU(s.focus)||(o=!1),this.options.focusOnlyEnabledItems&&SU(s.isEnabled)&&!s.isEnabled()&&(o=!1),s.action.id===Kr.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&s.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof c_){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=St(this.viewItems),this.getContainer().remove(),super.dispose()}}function gUe(n){if(!n.length)return n;let e=-1;for(let i=0;i=0&&n[i].id===Kr.ID;i--)n.splice(i,1);let t=!1;for(let i=n.length-1;i>=0;i--){const s=n[i].id===Kr.ID;s&&!t?n.splice(i,1):s?s&&(t=!1):t=!0}return n}const Abe=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Ffe=/(&)?(&)([^\s&])/g;var Aee;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Aee||(Aee={}));var Ebe;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(Ebe||(Ebe={}));let oXe=class _J extends Qh{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:Qb.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[E.Enter,...ei||jr?[E.Space]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(dh.addTarget(o)),this._register(pe(o,xe.KEY_DOWN,l=>{new os(l).equals(E.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){un.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ofe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(l)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),jr&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=new os(l);d.equals(E.Home)||d.equals(E.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),un.stop(l,!0)):(d.equals(E.End)||d.equals(E.PageDown))&&(this.focusedItem=0,this.focusPrevious(),un.stop(l,!0))})),this._register(pe(this.domNode,xe.MOUSE_OUT,l=>{const d=l.relatedTarget;al(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(pe(this.actionsList,xe.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(dh.addTarget(this.actionsList)),this._register(pe(this.actionsList,Eo.Tap,l=>{let d=l.initialTarget;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new bz(o,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(pe(o,Eo.Change,l=>{un.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(pe(a,xe.MOUSE_UP,l=>{l.preventDefault()}));const c=gt(e);o.style.maxHeight=`${Math.max(10,c.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((l,d)=>i.submenuIds?.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!(l instanceof Kr&&(d===t.length-1||d===0||t[d-1]instanceof Kr))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof fUe)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(P9(e)?this.styleSheet=od(e):(_J.globalStyleSheet||(_J.globalStyleSheet=od()),this.styleSheet=_J.globalStyleSheet)),this.styleSheet.textContent=FDt(t,P9(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}get scrollOffset(){return this.menuElement.scrollTop}trigger(e){if(e<=this.viewItems.length&&e>=0){const t=this.viewItems[e];if(t instanceof Ofe)super.focus(e),t.open(!0);else if(t instanceof xbe)super.run(t._action,t._context);else return}}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(pe(this.element,xe.MOUSE_UP,o=>{if(un.stop(o,!0),pp){if(new yu(gt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(pe(this.element,xe.CONTEXT_MENU,o=>{un.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=he(this.element,we("a.action-menu-item")),this._action.id===Kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=he(this.item,we("span.menu-item-check"+$e.asCSSSelector(Ce.menuSelection))),this.check.setAttribute("role","none"),this.label=he(this.item,we("span.action-label")),this.options.label&&this.options.keybinding&&(he(this.item,we("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Yo(this.label);let e=mde(this.action.label);if(e){const t=PDt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=Abe.exec(e);if(i){e=rM(e),Ffe.lastIndex=0;let s=Ffe.exec(e);for(;s&&s[1];)s=Ffe.exec(e);const o=r=>r.replace(/&&/g,"&");s?this.label.append(lz(o(e.substr(0,s.index))," "),we("u",{"aria-hidden":"true"},s[3]),IS(o(e.substr(s.index+s[0].length))," ")):this.label.innerText=o(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Ofe extends xbe{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:Aee.Right,vertical:Ebe.Below},this.showScheduler=new yn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new yn(()=>{this.element&&!al(xl(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=he(this.item,we("span.submenu-indicator"+$e.asCSSSelector(Ce.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(pe(this.element,xe.KEY_UP,t=>{const i=new os(t);(i.equals(E.RightArrow)||i.equals(E.Enter))&&(un.stop(t,!0),this.createSubmenu(!0))})),this._register(pe(this.element,xe.KEY_DOWN,t=>{const i=new os(t);xl()===this.item&&(i.equals(E.RightArrow)||i.equals(E.Enter))&&un.stop(t,!0)})),this._register(pe(this.element,xe.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(pe(this.element,xe.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(pe(this.element,xe.FOCUS_OUT,t=>{this.element&&!al(xl(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}open(e){this.cleanupExistingSubmenu(!1),this.createSubmenu(e)}onClick(e){un.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=i2(e.width,t.width,{position:s.horizontal===Aee.Right?Hp.Before:Hp.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new os(d).equals(E.LeftArrow)&&(un.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(pe(this.submenuContainer,xe.KEY_DOWN,d=>{new os(d).equals(E.LeftArrow)&&un.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class fUe extends WS{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function PDt(n){const e=Abe,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function pUe(n){const e=FQe()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function FDt(n,e){let t=` +`)}}const tEt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:me.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:me.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:me.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},iEt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function nEt(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]s-e;class oEt{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class rEt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:nd(n);i.disposables.add(ai(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class aEt{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class Xa{get onDidChangeFocus(){return M.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return M.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseUp(){return this.view.onMouseUp}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseMove(){return this.view.onMouseMove}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.map(r=>new En(r)).filter(r=>e=r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.stop(r,!0)).filter(()=>!1)),i=M.chain(this.disposables.add(new ii(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new En(r)).filter(r=>r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),c=a.length?a[0]:void 0,l=typeof c<"u"?this.view.element(c):void 0,d=typeof c<"u"?this.view.domElement(c):this.view.domNode;return{index:c,element:l,anchor:d,browserEvent:r}})),n=M.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new Eh(ct(this.view.domNode),c),browserEvent:c})));return M.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ii(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new ii(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new ii(this.view.domNode,"keypress")).event}get onDidFocus(){return M.signal(this.disposables.add(new ii(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new ii(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=iEt){this.user=e,this._options=o,this.focus=new p3("focused"),this.anchor=new p3("anchor"),this.eventBufferer=new F7,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new QAt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new rEt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(l=>new oEt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new aEt(this,o.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=gl(this.view.domNode);this.styleController=new Nje(l,this.view.domId)}if(this.spliceable=new vAt([new She(this.focus,this.view,o.identityProvider),new She(this.selection,this.view,o.identityProvider),new She(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new ZAt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new o_e(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||JAt;this.typeNavigationController=new XAt(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new gc(e,t,i,n)}createMouseController(e){return new Mje(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new WI(this.user,`Invalid start index: ${e}`);if(t<0)throw new WI(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}updateWidth(e){this.view.updateWidth(e)}updateElementHeight(e,t){this.view.updateElementHeight(e,t,null)}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollLeft(){return this.view.getScrollLeft()}set scrollLeft(e){this.view.setScrollLeft(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get firstMostlyVisibleIndex(){return this.view.firstMostlyVisibleIndex}get lastVisibleIndex(){return this.view.lastVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}triggerTypeNavigation(){this.typeNavigationController?.trigger()}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new WI(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new WI(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return lm(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new WI(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Sr(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),r=this.view.getScrollTop()+o;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const c=this.findNextIndex(n,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([n],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Sr(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new WI(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(lc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Ka(t,0,1)+o-i)}else{const a=o+r,c=n+this.view.renderHeight;o=c||(o=c&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new WI(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}isDOMFocused(){return av(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeSelection",null);Xa.__decorator=D([Zt],Xa.prototype,"onContextMenu",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyDown",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyUp",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyPress",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidBlur",null);let Pje={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function Fje(s){Pje=s}function Sm(){return Pje}var cEt=".monaco-select-box-dropdown-padding{--dropdown-padding-top:1px;--dropdown-padding-bottom:1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top:3px;--dropdown-padding-bottom:4px}.monaco-select-box-dropdown-container{box-sizing:border-box;display:none}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{font-family:var(--monaco-monospace-font);line-height:15px}.monaco-select-box-dropdown-container.visible{border-bottom-left-radius:3px;border-bottom-right-radius:3px;display:flex;flex-direction:column;overflow:hidden;text-align:left;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{align-self:flex-start;box-sizing:border-box;flex:0 0 auto;overflow:hidden;padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;padding-top:var(--dropdown-padding-top);width:100%}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-bottom:var(--dropdown-padding-bottom);padding-top:var(--dropdown-padding-top)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{float:left;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{float:left;opacity:.7;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{float:right;overflow:hidden;padding-right:10px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{height:1px;left:-10000px;overflow:hidden;position:absolute;top:auto;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{align-self:flex-start;flex:1 1 auto;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{max-height:0;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}";ut(cEt,{});const L1=fe,Oje="selectOption.entry.template";class lEt{get templateId(){return Oje}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=re(e,L1(".option-text")),t.detail=re(e,L1(".option-detail")),t.decoratorRight=re(e,L1(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;n.text.textContent=o,n.detail.textContent=r||"",n.decoratorRight.innerText=a||"",c?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}const yw=class yw extends V{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=yw.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new I,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Sm().setupManagedHover(Pr("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Oje}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=re(this.selectDropDownContainer,L1(".select-box-details-pane"));const t=re(this.selectDropDownContainer,L1(".select-box-dropdown-container-width-control")),i=re(t,L1(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",re(i,this.widthControlElement),this._dropDownPosition=Vf.BELOW,this.styleElement=gl(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ue(this.selectDropDownContainer,ke.DRAG_START,n=>{en.stop(n,!0)}))}registerListeners(){this._register(Ro(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(ue(this.selectElement,ke.CLICK,t=>{en.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.MOUSE_DOWN,t=>{en.stop(t)}));let e;this._register(ue(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ue(this.selectElement,"touchend",t=>{en.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.KEY_DOWN,t=>{const i=new En(t);let n=!1;Qt?(i.keyCode===S.DownArrow||i.keyCode===S.UpArrow||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0):(i.keyCode===S.DownArrow&&i.altKey||i.keyCode===S.UpArrow&&i.altKey||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0),n&&(this.showSelectDropDown(),en.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){is(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setEnabled(e){this.selectElement.disabled=!e}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}setAriaLabel(e){this.selectBoxOptions.ariaLabel=e,this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=Iy(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=ct(this.selectElement),i=Cr(this.selectElement),n=ct(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-yw.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,c=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(c)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,p=Math.floor((r-o-u)/this.getHeight()),m=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Vf.ABOVE,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Vf.BELOW,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=p*this.getHeight())}else f>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,c=o.decoratorRight?o.decoratorRight.length:0,l=o.text.length+a+c;l>n&&(i=r,n=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Pd(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=re(e,L1(".select-box-dropdown-list-container")),this.listRenderer=new lEt,this.selectList=this._register(new Xa("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:Co.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let o=n.text;return n.detail&&(o+=`. ${n.detail}`),n.decoratorRight&&(o+=`. ${n.decoratorRight}`),n.description&&(o+=`. ${n.description}`),o},getWidgetAriaLabel:()=>g(10917,"Select Box"),getRole:()=>Qt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ii(this.selectDropDownListContainer,"keydown")),i=M.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(o=>new En(o)));this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Enter))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Tab))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Escape))(this.onEscape,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.UpArrow))(this.onUpArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.DownArrow))(this.onDownArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageDown))(this.onPageDown,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageUp))(this.onPageUp,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Home))(this.onHome,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.End))(this.onEnd,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode>=S.Digit0&&o.keyCode<=S.KeyZ||o.keyCode>=S.Semicolon&&o.keyCode<=S.NumpadDivide))(this.onCharacter,this)),this._register(ue(this.selectList.getHTMLElement(),ke.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(ue(this.selectDropDownContainer,ke.FOCUS_OUT,n=>{!this._isVisible||wc(n.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;en.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(en.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){en.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){en.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){en.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Ia.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(ue(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ro(this.selectElement,"click",e=>{en.stop(e,!0)})),this._register(Ro(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ro(this.selectElement,"keydown",e=>{let t=!1;Qt?(e.keyCode===S.DownArrow||e.keyCode===S.UpArrow||e.keyCode===S.Space)&&(t=!0):(e.keyCode===S.DownArrow&&e.altKey||e.keyCode===S.Space||e.keyCode===S.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!is(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(n)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new $_)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(fd.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,rf&&this._register(ue(e,ke.DRAG_START,n=>n.dataTransfer?.setData(sp.TEXT,this._action.label)))),this._register(ue(t,uo.Tap,n=>this.onClick(n,!0))),this._register(ue(t,ke.MOUSE_DOWN,n=>{i||en.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Qt&&this._register(ue(t,ke.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(ue(t,ke.CLICK,n=>{en.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(ue(t,ke.DBLCLICK,n=>{en.stop(n,!0)})),[ke.MOUSE_UP,ke.MOUSE_OUT].forEach(n=>{this._register(ue(t,n,o=>{en.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){en.stop(e,!0);const i=ra(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}isFocused(){return!!this.element?.classList.contains("focused")}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),this.options.hoverDelegate?.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const t=this.options.hoverDelegate??Pr("element");this.customHover=this._store.add(Sm().setupManagedHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class Jy extends zf{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),Tt(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Ar.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}isFocused(){return!!this.label&&this.label?.tabIndex===0}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=g(5041,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Bje extends zf{constructor(e,t,i,n,o,r,a){super(e,t),this.selectBox=new uEt(i,n,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}setOptions(e,t){this.selectBox.setOptions(e,t)}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}var fEt=".monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";ut(fEt,{});class pEt extends $_{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=re(e,fe(".monaco-dropdown")),this._label=re(this._element,fe(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[ke.CLICK,ke.MOUSE_DOWN,uo.Tap])this._register(ue(this.element,o,r=>en.stop(r,!0)));for(const o of[ke.MOUSE_DOWN,uo.Tap])this._register(ue(this._label,o,r=>{hTe(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(ue(this._label,ke.KEY_UP,o=>{const r=new En(o);(r.equals(S.Enter)||r.equals(S.Space))&&(en.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(fd.addTarget(this._label))}get element(){return this._element}get label(){return this._label}set tooltip(e){this._label&&(!this.hover&&e!==""?this.hover=this._register(Sm().setupManagedHover(Pr("mouse"),this._label,e)):this.hover&&this.hover.update(e))}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}isVisible(){return!!this.visible}onEvent(e,t){this.hide()}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class mEt extends pEt{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:vb.LEFT,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class sA extends zf{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=re(o,fe("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(Sm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new mEt(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{this.element?.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}var _Et='.monaco-action-bar .action-item.menu-entry .action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{border-radius:2px;color:var(--vscode-descriptionForeground);overflow:hidden}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}';ut(_Et,{});const Oa=ae("menuService");function GLe(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function vEt(s){return s?s.condition!==void 0:!1}const A5={exports:{}};(function(){function s(n){const o=[];typeof n=="number"&&o.push("code/timeOrigin",n);function r(c){o.push(c,Date.now())}function a(){const c=[];for(let l=0;lthis.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===kv.Closed)return;let i=!1;ra(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===kv.None&&(this.state=kv.Initialized,this.options.hint!==oD.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return ra(i)?t:i}getBoolean(e,t){const i=this.get(e);return ra(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return ra(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return ra(i)?t:j2(i)}async set(e,t,i=!1){if(this.state===kv.Closed)return;if(ra(t))return this.delete(e,i);const n=kn(t)||Array.isArray(t)?eje(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===kv.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==kv.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=kv.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===kv.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===oD.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===oD.STORAGE_IN_MEMORY}};rse.DEFAULT_FLUSH_DELAY=100;let oA=rse;class Bq{constructor(){this.onDidChangeItemsExternal=M.None,this.items=new Map}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}async optimize(){}async close(){}}const Jt=ae("fileService"),ks=ae("IUriIdentityService"),yEt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function CEt(s){return yEt.test(s)}const ar=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;nd.id===a);l&&i.set(c,l)}if(o.emptyWindows)for(const[r,a]of Object.entries(o.emptyWindows)){const c=t.find(l=>l.id===a);c&&n.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:n}}return this._profilesObject}createDefaultProfile(){const e=cV("__default__profile__",g(567,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Rh(t)}\\s(\\d+)`);let n=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;n=c>n?c:n}const o=`${t} ${n+1}`;return this.createProfile(Wc(ar()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Wc(ar()).toString(16),e,t,i)}async createProfile(e,t,i,n){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return n&&await this.setProfileForWorkspace(n,o),o}async doCreateProfile(e,t,i){if(!Lt(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let n=this.profileCreationPromises.get(t);return n||(n=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=cV(e,t,Pt(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(r.location);const a=[];return this._onWillCreateProfile.fire({profile:r,join(c){a.push(c)}}),await Zs.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,n)),n}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(n=>n.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=cV(i.id,t.name??i.name,i.location,this.profilesCacheHome,{shortName:t.shortName??i.shortName,icon:t.icon===null?void 0:t.icon??i.icon,transient:t.transient??i.isTransient,useDefaultFlags:t.useDefaultFlags??i.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[i]),i}async removeProfile(e){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(n=>n.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(n){i.push(n)}});try{await Promise.allSettled(i)}catch(n){this.logService.error(n)}for(const n of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(n)?.id&&this.profilesObject.emptyWindows.delete(n);for(const n of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(n)?.id&&this.profilesObject.workspaces.delete(n);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(n){$w(n)!==Qi.FILE_NOT_FOUND&&this.logService.error(n)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(n=>n.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);this.updateWorkspaceAssociation(e,i)}unsetWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(e,void 0,t)}async resetWorkspaces(){this.transientProfilesObject.folders.clear(),this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e),i=N.isUri(t)?this.profilesObject.workspaces.get(t):this.profilesObject.emptyWindows.get(t);return i||(P_(e)?this.transientProfilesObject.folders.get(e.uri):iA(e)?this.transientProfilesObject.workspaces.get(e.configPath):this.transientProfilesObject.emptyWindows.get(e.id))}getWorkspace(e){return P_(e)?e.uri:iA(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.folders.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const n=[...this.profiles,...e],o=[],r=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];for(let a of n){if(a.isDefault||t.some(l=>a.id===l.id))continue;a=i.find(l=>a.id===l.id)??a;const c=r.find(l=>a.id===l.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else{if(c){for(const[l,d]of this.transientProfilesObject.emptyWindows.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:l},a);break}for(const[l,d]of this.transientProfilesObject.workspaces.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",configPath:l},a);break}for(const[l,d]of this.transientProfilesObject.folders.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",uri:l},a);break}}o.push({location:a.location,name:a.name,shortName:a.shortName,icon:a.icon,useDefaultFlags:a.useDefaultFlags})}}this.saveStoredProfiles(o),this._profilesObject=void 0,this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateWorkspaceAssociation(e,t,i){if(i=t?.isTransient?!0:i,i)P_(e)?(this.transientProfilesObject.folders.delete(e.uri),t&&this.transientProfilesObject.folders.set(e.uri,t)):iA(e)?(this.transientProfilesObject.workspaces.delete(e.configPath),t&&this.transientProfilesObject.workspaces.set(e.configPath,t)):(this.transientProfilesObject.emptyWindows.delete(e.id),t&&this.transientProfilesObject.emptyWindows.set(e.id,t));else{this.updateWorkspaceAssociation(e,void 0,!0);const n=this.getWorkspace(e);N.isUri(n)?(this.profilesObject.workspaces.delete(n),t&&this.profilesObject.workspaces.set(n,t)):(this.profilesObject.emptyWindows.delete(n),t&&this.profilesObject.emptyWindows.set(n,t)),this.updateStoredProfileAssociations()}}updateStoredProfileAssociations(){const e={};for(const[i,n]of this.profilesObject.workspaces.entries())e[i.toString()]=n.id;const t={};for(const[i,n]of this.profilesObject.emptyWindows.entries())t[i.toString()]=n.id;this.saveStoredProfileAssociations({workspaces:e,emptyWindows:t}),this._profilesObject=void 0}migrateStoredProfileAssociations(e){const t={},i=this.createDefaultProfile();if(e.workspaces)for(const[o,r]of Object.entries(e.workspaces)){const a=N.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const n={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=N.parse(r);n[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:n}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},dL.PROFILES_KEY="userDataProfiles",dL.PROFILE_ASSOCIATIONS_KEY="profileAssociations",dL);$2e=D([_(0,Za),_(1,Jt),_(2,ks),_(3,Ge)],$2e);const Wq="__$__isNewStorageMarker",Hq="__$__targetStorageMarker";var wy;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(wy||(wy={}));var Ie;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Ie||(Ie={}));var an;(function(s){s[s.USER=0]="USER",s[s.MACHINE=1]="MACHINE"})(an||(an={}));function SEt(s){const e=s.get(Hq);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const ase=class ase extends V{constructor(e={flushInterval:ase.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new kk),this._onDidChangeTarget=this._register(new kk),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new cn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new wn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return M.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=N2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){bt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{cs("code/willInitStorage");try{await this.doInitialize()}finally{cs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Hq){switch(e){case Ie.APPLICATION:this._applicationKeyTargets=void 0;break;case Ie.PROFILE:this._profileKeyTargets=void 0;break;case Ie.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,n,o=!1){if(ra(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],n=this.getKeyTargets(e);for(const o of Object.keys(n))n[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,n=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(Hq,JSON.stringify(o),n)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(Hq,JSON.stringify(o),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(Ie.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(Ie.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(Ie.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case Ie.APPLICATION:return this.applicationKeyTargets;case Ie.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?SEt(t):Object.create(null)}isNew(e){return this.getBoolean(Wq,e)===!0}async flush(e=wy.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(Ie.APPLICATION),i=this.getStorage(Ie.PROFILE),n=this.getStorage(Ie.WORKSPACE);switch(e){case wy.NONE:await Zs.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case wy.SHUTDOWN:await Zs.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(Ie.APPLICATION)?.items??new Map,t=this.getStorage(Ie.PROFILE)?.items??new Map,i=this.getStorage(Ie.WORKSPACE)?.items??new Map;return EEt(e,t,i,this.getLogDetails(Ie.APPLICATION)??"",this.getLogDetails(Ie.PROFILE)??"",this.getLogDetails(Ie.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(wy.NONE),Wje(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||c_e(t)&&c_e(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const n=new Set;for(const[o,r]of e)n.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)n.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};ase.DEFAULT_FLUSH_INTERVAL=60*1e3;let X2=ase;function c_e(s){return s.isDefault||!!s.useDefaultFlags?.globalState}class AEt extends X2{constructor(){super(),this.applicationStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.APPLICATION,e)))}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return"inMemory (application)";case Ie.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function EEt(s,e,t,i,n,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;s.forEach((m,v)=>{a.set(v,m),c.set(v,r(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,r(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,r(m))}),console.group(i!==n?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const f=[];if(a.forEach((m,v)=>{f.push({key:v,value:m})}),console.table(f),console.groupEnd(),console.log(c),i!==n){console.group(`Storage: Profile (path: ${n}, profile specific)`);const m=[];l.forEach((v,b)=>{m.push({key:b,value:v})}),console.table(m),console.groupEnd(),console.log(d)}console.group(`Storage: Workspace (path: ${o})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const $i=ae("storageService");function xEt(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?ze(n):void 0}return t}const l_e={keybindingLabelBackground:ze(Zft),keybindingLabelForeground:ze(ept),keybindingLabelBorder:ze(tpt),keybindingLabelBottomBorder:ze(ipt),keybindingLabelShadow:ze(CI)},y6={buttonForeground:ze(bM),buttonSeparator:ze(rqe),buttonBackground:ze(_y),buttonHoverBackground:ze($8),buttonSecondaryForeground:ze(Vft),buttonSecondaryBackground:ze(zpe),buttonSecondaryHoverBackground:ze(zft),buttonBorder:ze(Uft)},Hje={progressBarBackground:ze(sft)},JY={inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre),inputActiveOptionBackground:ze(a6)};ze(Z4),ze($ft),ze(Gft),ze(Kft),ze(qft),ze(Qft),ze(jft);ze(Yft),ze(Xft),ze(Jft);ze(xh),ze(IN),ze(CI),ze(wt),ze(Aft),ze(Eft),ze(xft),ze(ITe);const EM={inputBackground:ze(z2),inputForeground:ze(iqe),inputBorder:ze(o5),inputValidationInfoBorder:ze(Fft),inputValidationInfoBackground:ze(Nft),inputValidationInfoForeground:ze(Pft),inputValidationWarningBorder:ze(Wft),inputValidationWarningBackground:ze(Oft),inputValidationWarningForeground:ze(Bft),inputValidationErrorBorder:ze(oqe),inputValidationErrorBackground:ze(nqe),inputValidationErrorForeground:ze(sqe)},DEt={listFilterWidgetBackground:ze(fpt),listFilterWidgetOutline:ze(ppt),listFilterWidgetNoMatchesOutline:ze(mpt),listFilterWidgetShadow:ze(_pt),inputBoxStyles:EM,toggleStyles:JY},Uje={badgeBackground:ze(yT),badgeForeground:ze($re),badgeBorder:ze(wt)};ze(Cft),ze(yft),ze($Oe),ze($Oe),ze(Sft);const ON={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ze(npt),listFocusForeground:ze(spt),listFocusOutline:ze($pe),listActiveSelectionBackground:ze(vy),listActiveSelectionForeground:ze(G8),listActiveSelectionIconForeground:ze(aqe),listFocusAndSelectionOutline:ze(opt),listFocusAndSelectionBackground:ze(vy),listFocusAndSelectionForeground:ze(G8),listInactiveSelectionBackground:ze(Gpe),listInactiveSelectionIconForeground:ze(apt),listInactiveSelectionForeground:ze(rpt),listInactiveFocusBackground:ze(cpt),listInactiveFocusOutline:ze(lpt),listHoverBackground:ze(cqe),listHoverForeground:ze(lqe),listDropOverBackground:ze(dpt),listDropBetweenBackground:ze(hpt),listSelectionOutline:ze(Js),listHoverOutline:ze(Js),treeIndentGuidesStroke:ze(rY),treeInactiveIndentGuidesStroke:ze(bpt),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:ze(o6),tableColumnsBorder:ze(wpt),tableOddRowsBackgroundColor:ze(ypt)};function BN(s){return xEt(s,ON)}const Vje={selectBackground:ze(Qre),selectListBackground:ze(Hft),selectForeground:ze(NTe),decoratorRightForeground:ze(dqe),selectBorder:ze(PTe),focusBorder:ze(mp),listFocusBackground:ze(q8),listInactiveSelectionIconForeground:ze(FTe),listFocusForeground:ze(K8),listFocusOutline:Fpe(Js,me.transparent.toString()),listHoverBackground:ze(cqe),listHoverForeground:ze(lqe),listHoverOutline:ze(Js),selectListBorder:ze(r6),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},kEt={shadowColor:ze(CI),borderColor:ze(Cpt),foregroundColor:ze(Spt),backgroundColor:ze(Apt),selectionForegroundColor:ze(Ept),selectionBackgroundColor:ze(xpt),selectionBorderColor:ze(Dpt),separatorColor:ze(kpt),scrollbarShadow:ze(o6),scrollbarSliderBackground:ze(jKe),scrollbarSliderHoverBackground:ze(YKe),scrollbarSliderActiveBackground:ze(JKe)};function zje(s,e,t,i){let n,o,r;if(Array.isArray(s))r=s,n=e,o=t;else{const l=e;r=s.getActions(l),n=t,o=i}const a=pb.getInstance(),c=a.keyStatus.altKey||(Qn||pr)&&a.keyStatus.shiftKey;$je(r,n,c,o?l=>l===o:l=>l==="navigation")}function fC(s,e,t,i,n,o){let r,a,c,l,d;if(Array.isArray(s))d=s,r=e,a=t,c=i,l=n;else{const u=e;d=s.getActions(u),r=t,a=i,c=n,l=o}$je(d,r,!1,typeof a=="string"?u=>u===a:a,c,l)}function $je(s,e,t,i=r=>r==="navigation",n=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of s){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Ar)):(h=a,h.length>0&&h.push(new Ar));for(let u of d){t&&(u=u instanceof Sc&&u.alt?u.alt:u);const f=h.push(u);u instanceof Nk&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?r:a,f=d.actions;n(d,l,u.length)&&u.splice(h,1,...f)}}let Lb=class extends Jy{constructor(e,t,i,n,o,r,a,c){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new wn),this._altKey=pb.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const n=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(ue(e,"mouseleave",n=>{t=!1,i()})),this._register(ue(e,"mouseenter",n=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?g(4886,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),c=a?g(4886,"{0} ({1})",o,a):o;n=g(4887,`{0} +[{1}] {2}`,n,p6.modifierLabels[po].altKey,c)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&vEt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(We.isThemeIcon(n)){const o=We.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=Jre(this._themeService.getColorTheme().type)?Zu(n.dark):Zu(n.light),i.classList.add("icon"),this._itemClassDispose.value=jr(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Lb=D([_(2,Ut),_(3,bi),_(4,Le),_(5,pn),_(6,lr),_(7,mr)],Lb);class C6 extends Lb{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=C6._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=g(4888,"{1} to {0}",this._action.label,t):this.label.textContent=g(4889,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let _3=class extends sA{constructor(e,t,i,n,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(We.isThemeIcon(e.item.icon)?We.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),Tt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!We.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Jre(this._themeService.getColorTheme().type)?Zu(i.dark):Zu(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};_3=D([_(2,Ut),_(3,lr),_(4,pn)],_3);let d_e=class extends zf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=c,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let l;const d=t?.persistLastActionId?c.get(this._storageKey,Ie.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(Lb,l,{keybinding:this._getDefaultActionKeybindingLabel(l)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??new $_};this._dropdown=new sA(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Sc&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,Ie.WORKSPACE,an.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Lb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends $_{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Ore(this._container,fe(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=fe(".action-container");this._defaultAction.render(re(this._container,t)),this._register(ue(t,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=fe(".dropdown-action-container");this._dropdown.render(re(this._container,i)),this._register(ue(i,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};d_e=D([_(2,Ut),_(3,bi),_(4,lr),_(5,Oa),_(6,we),_(7,$i)],d_e);let h_e=class extends Bje{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Ar.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Vje,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=ze(PTe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};h_e=D([_(1,mf)],h_e);function WN(s,e,t){return e instanceof Sc?s.createInstance(Lb,e,t):e instanceof Ty?e.item.isSelection?s.createInstance(h_e,e):e.item.rememberDefaultAction?s.createInstance(d_e,e,{...t,persistLastActionId:!0}):s.createInstance(_3,e,t):void 0}var F_;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(F_||(F_={}));class hd extends V{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new mo),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new I({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??F_.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[S.Enter,S.Space]},this._hoverDelegate=t.hoverDelegate??this._register($k()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new $_,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(o=>this._onDidRun.fire(o))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(o=>this._onWillRun.fire(o))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,n;switch(this._orientation){case F_.HORIZONTAL:i=[S.LeftArrow],n=[S.RightArrow];break;case F_.VERTICAL:i=[S.UpArrow],n=[S.DownArrow],this.domNode.className+=" vertical";break}this._register(ue(this.domNode,ke.KEY_DOWN,o=>{const r=new En(o);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():n&&(r.equals(n[0])||r.equals(n[1]))?a=this.focusNext():r.equals(S.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(S.Home)?a=this.focusFirst():r.equals(S.End)?a=this.focusLast():r.equals(S.Tab)&&c instanceof zf&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(ue(this.domNode,ke.KEY_UP,o=>{const r=new En(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(S.Tab)||r.equals(U.Shift|S.Tab)||r.equals(S.UpArrow)||r.equals(S.DownArrow)||r.equals(S.LeftArrow)||r.equals(S.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ac(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Bc()===this.domNode||!wc(Bc(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setAriaLabel(e){e?this.actionsList.setAttribute("aria-label",e):this.actionsList.removeAttribute("aria-label")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof zf&&i.isEnabled());t instanceof zf&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof zf&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}hasAction(e){return this.viewItems.findIndex(t=>t.action.id===e.id)!==-1}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(Yr(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new Jy(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ue(r,ke.CONTEXT_MENU,l=>{en.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof zf&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const n=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=n===-1?void 0:n,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Ar.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Ar.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const n=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(n){let o=!0;C2(n.focus)||(o=!1),this.options.focusOnlyEnabledItems&&C2(n.isEnabled)&&!n.isEnabled()&&(o=!1),n.action.id===Ar.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof zf){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=bt(this.viewItems),this.getContainer().remove(),super.dispose()}}function G2e(s){if(!s.length)return s;let e=-1;for(let i=0;i=0&&s[i].id===Ar.ID;i--)s.splice(i,1);let t=!1;for(let i=s.length-1;i>=0;i--){const n=s[i].id===Ar.ID;n&&!t?s.splice(i,1):n?n&&(t=!1):t=!0}return s}const u_e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Ahe=/(&)?(&)([^\s&])/g;var XY;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(XY||(XY={}));var g_e;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(g_e||(g_e={}));let Gje=class Uq extends hd{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:F_.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[S.Enter,...Qt||pr?[S.Space]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(fd.addTarget(o)),this._register(ue(o,ke.KEY_DOWN,l=>{new En(l).equals(S.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){en.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ehe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(l)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),pr&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=new En(l);d.equals(S.Home)||d.equals(S.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),en.stop(l,!0)):(d.equals(S.End)||d.equals(S.PageDown))&&(this.focusedItem=0,this.focusPrevious(),en.stop(l,!0))})),this._register(ue(this.domNode,ke.MOUSE_OUT,l=>{const d=l.relatedTarget;wc(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ue(this.actionsList,ke.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!wc(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(fd.addTarget(this.actionsList)),this._register(ue(this.actionsList,uo.Tap,l=>{let d=l.initialTarget;if(!(!d||!wc(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new EU(o,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(ue(o,uo.Change,l=>{en.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(ue(a,ke.MOUSE_UP,l=>{l.preventDefault()}));const c=ct(e);o.style.maxHeight=`${Math.max(10,c.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((l,d)=>i.submenuIds?.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!(l instanceof Ar&&(d===t.length-1||d===0||t[d-1]instanceof Ar))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof K2e)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(k8(e)?this.styleSheet=gl(e):(Uq.globalStyleSheet||(Uq.globalStyleSheet=gl()),this.styleSheet=Uq.globalStyleSheet)),this.styleSheet.textContent=TEt(t,k8(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}get scrollOffset(){return this.menuElement.scrollTop}trigger(e){if(e<=this.viewItems.length&&e>=0){const t=this.viewItems[e];if(t instanceof Ehe)super.focus(e),t.open(!0);else if(t instanceof f_e)super.run(t._action,t._context);else return}}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(ue(this.element,ke.MOUSE_UP,o=>{if(en.stop(o,!0),rf){if(new Eh(ct(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ue(this.element,ke.CONTEXT_MENU,o=>{en.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=re(this.element,fe("a.action-menu-item")),this._action.id===Ar.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=re(this.item,fe("span.menu-item-check"+We.asCSSSelector(ve.menuSelection))),this.check.setAttribute("role","none"),this.label=re(this.item,fe("span.action-label")),this.options.label&&this.options.keybinding&&(re(this.item,fe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Ms(this.label);let e=dae(this.action.label);if(e){const t=IEt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=u_e.exec(e);if(i){e=fT(e),Ahe.lastIndex=0;let n=Ahe.exec(e);for(;n&&n[1];)n=Ahe.exec(e);const o=r=>r.replace(/&&/g,"&");n?this.label.append(pU(o(e.substr(0,n.index))," "),fe("u",{"aria-hidden":"true"},n[3]),zy(o(e.substr(n.index+n[0].length))," ")):this.label.innerText=o(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Ehe extends f_e{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:XY.Right,vertical:g_e.Below},this.showScheduler=new cn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new cn(()=>{this.element&&!wc(Bc(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=re(this.item,fe("span.submenu-indicator"+We.asCSSSelector(ve.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ue(this.element,ke.KEY_UP,t=>{const i=new En(t);(i.equals(S.RightArrow)||i.equals(S.Enter))&&(en.stop(t,!0),this.createSubmenu(!0))})),this._register(ue(this.element,ke.KEY_DOWN,t=>{const i=new En(t);Bc()===this.item&&(i.equals(S.RightArrow)||i.equals(S.Enter))&&en.stop(t,!0)})),this._register(ue(this.element,ke.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ue(this.element,ke.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ue(this.element,ke.FOCUS_OUT,t=>{this.element&&!wc(Bc(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}open(e){this.cleanupExistingSubmenu(!1),this.createSubmenu(e)}onClick(e){en.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=cF(e.width,t.width,{position:n.horizontal===XY.Right?Mf.Before:Mf.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new En(d).equals(S.LeftArrow)&&(en.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ue(this.submenuContainer,ke.KEY_DOWN,d=>{new En(d).equals(S.LeftArrow)&&en.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class K2e extends Jy{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function IEt(s){const e=u_e,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function q2e(s){const e=fGe()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function TEt(s,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${pUe(Ce.menuSelection)} -${pUe(Ce.menuSubmenu)} +${q2e(ve.menuSelection)} +${q2e(ve.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -611,7 +612,7 @@ ${pUe(Ce.menuSubmenu)} height: 3px; width: 3px; } - `;const i=n.scrollbarShadow;i&&(t+=` + `;const i=s.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; } @@ -623,99 +624,100 @@ ${pUe(Ce.menuSubmenu)} .monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } - `);const s=n.scrollbarSliderBackground;s&&(t+=` + `);const n=s.scrollbarSliderBackground;n&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { - background: ${s}; + background: ${n}; } - `);const o=n.scrollbarSliderHoverBackground;o&&(t+=` + `);const o=s.scrollbarSliderHoverBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${o}; } - `);const r=n.scrollbarSliderActiveBackground;r&&(t+=` + `);const r=s.scrollbarSliderActiveBackground;r&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class ODt{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=xl();let i;const s=Ra(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(we(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=pe(this.block,xe.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new gw;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new oXe(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},NDt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=gt(o);return a.add(pe(l,xe.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(pe(l,xe.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new yu(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),pa(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide?.(!!o),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(xl()===this.lastContainer||al(xl(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Na(e.error)&&this.notificationService.error(e.error)}}let Dbe=class extends ${get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new ODt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new I),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new I),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=kbe.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Nb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Dbe=D([_(0,rn),_(1,Pi),_(2,W_),_(3,ti),_(4,_c),_(5,Pe)],Dbe);var kbe;(function(n){function e(i){return i&&i.menuId instanceof Te}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=s.createMenu(r,c??o);nXe(d,a,l),d.dispose()}return i.getActions?Kr.join(i.getActions(),l):l}}}n.transform=t})(kbe||(kbe={}));function mUe(n){const e=n;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var y1;(function(n){n[n.ACTIVATE=1]="ACTIVATE",n[n.RESTORE=2]="RESTORE",n[n.PRESERVE=3]="PRESERVE"})(y1||(y1={}));var Ibe;(function(n){n[n.PICK=0]="PICK",n[n.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(Ibe||(Ibe={}));var C7;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(C7||(C7={}));var px;(function(n){n[n.Center=0]="Center",n[n.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",n[n.NearTop=2]="NearTop",n[n.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(px||(px={}));var jb;(function(n){n.PROGRAMMATIC="api",n.NAVIGATION="code.navigation",n.JUMP="code.jump"})(jb||(jb={}));function RNe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}let Lbe=class{constructor(e){this._commandService=e}async open(e,t){if(!Rx(e,_e.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=P.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=JU(decodeURIComponent(e.query))}catch{try{i=JU(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Lbe=D([_(0,ji)],Lbe);let Tbe=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=P.parse(e));const{selection:i,uri:s}=RNe(e);return e=s,e.scheme===_e.file&&(e=jQe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?C7.USER:C7.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};Tbe=D([_(0,jt)],Tbe);let Rbe=class{constructor(e,t){this._openers=new td,this._validators=new td,this._resolvers=new td,this._resolvedUriTargets=new wi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new td,this._defaultExternalOpener={openExternal:async i=>(L9(i,_e.http,_e.https)?vje(i):yi.location.href=i,!0)},this._openers.push({open:async(i,s)=>s?.openExternal||L9(i,_e.mailto,_e.http,_e.https,_e.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new Lbe(t)),this._openers.push(new Tbe(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}async open(e,t){const i=typeof e=="string"?P.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(s,t))return!1;for(const o of this._openers)if(await o.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?P.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},qe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},qe.None)}dispose(){this._validators.clear()}};Rbe=D([_(0,jt),_(1,ji)],Rbe);const kd=ae("editorWorkerService"),Bfe="vs/platform/markers/common/markers";var Ev;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Ev||(Ev={}));var Ys;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Ys||(Ys={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=g(Bfe,0,"Error"),t[n.Warning]=g(Bfe,1,"Warning"),t[n.Info]=g(Bfe,2,"Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case nt.Error:return n.Error;case nt.Warning:return n.Warning;case nt.Info:return n.Info;case nt.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return nt.Error;case n.Warning:return nt.Warning;case n.Info:return nt.Info;case n.Hint:return nt.Ignore}}n.toSeverity=o})(Ys||(Ys={}));var Eee;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Ys.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(Eee||(Eee={}));const U_=ae("markerService");let Mbe=class extends ${constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new wi,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}getLiveMarkers(e){const t=this._markerDecorations.get(e);return t?t.getMarkers():[]}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new BDt(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===_e.inMemory||e.uri.scheme===_e.internal||e.uri.scheme===_e.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Mbe=D([_(0,Ai),_(1,U_)],Mbe);class BDt extends ${constructor(e){super(),this.model=e,this._map=new rlt,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Ple(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a{const s=this.model.getDecorationRange(t);s&&e.push([s,i])}),e}_createDecorationRange(e,t){let i=O.lift(t);if(t.severity===Ys.Hint&&!this._hasMarkerTag(t,Ev.Unnecessary)&&!this._hasMarkerTag(t,Ev.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const s=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(s===1||i.endColumn>=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new O(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var QL;function vD(n){return n.toString()}class WDt{constructor(e,t,i){this.model=e,this._modelEventListeners=new Z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const HDt=jr||ei?zb.LF:zb.CRLF;class UDt{constructor(e,t,i,s,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var nN;let Nbe=(nN=class extends ${constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new I),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new I),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new I),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Ph.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const u=parseInt(e.editor.tabSize,10);isNaN(u)||(i=u),i<1&&(i=1)}let s="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(s=Math.max(u,1))}let o=Ph.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=HDt;const a=e.eol;a===`\r -`?r=zb.CRLF:a===` -`&&(r=zb.LF);let c=Ph.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Ph.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ph.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ph.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:o,detectIndentation:l,defaultEOL:r,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:$c===Pr.Linux||$c===Pr.Macintosh?` + `)}return t}class LEt{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Bc();let i;const n=Yr(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(fe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=ue(this.block,ke.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new $_;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new Gje(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},kEt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=ct(o);return a.add(ue(l,ke.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(ue(l,ke.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Eh(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),jr(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide?.(!!o),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Bc()===this.lastContainer||wc(Bc(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Fr(e.error)&&this.notificationService.error(e.error)}}let p_e=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new LEt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new I),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new I),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=m_e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),pb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};p_e=D([_(0,Yi),_(1,bi),_(2,mf),_(3,Ut),_(4,Oa),_(5,Le)],p_e);var m_e;(function(s){function e(i){return i&&i.menuId instanceof _e}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=n.getMenuActions(r,c??o,a);zje(d,l)}return i.getActions?Ar.join(i.getActions(),l):l}}}s.transform=t})(m_e||(m_e={}));function Q2e(s){const e=s;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Gk;(function(s){s[s.ACTIVATE=1]="ACTIVATE",s[s.RESTORE=2]="RESTORE",s[s.PRESERVE=3]="PRESERVE"})(Gk||(Gk={}));var __e;(function(s){s[s.PICK=0]="PICK",s[s.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(__e||(__e={}));var v3;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(v3||(v3={}));var rA;(function(s){s[s.Center=0]="Center",s[s.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",s[s.NearTop=2]="NearTop",s[s.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(rA||(rA={}));var Db;(function(s){s.PROGRAMMATIC="api",s.NAVIGATION="code.navigation",s.JUMP="code.jump"})(Db||(Db={}));function KLe(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},s=s.with({fragment:""})),{selection:e,uri:s}}let v_e=class{constructor(e){this._commandService=e}async open(e,t){if(!AA(e,pe.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=N.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=j2(decodeURIComponent(e.query))}catch{try{i=j2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};v_e=D([_(0,vi)],v_e);let b_e=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=N.parse(e));const{selection:i,uri:n}=KLe(e);return e=n,e.scheme===pe.file&&(e=xGe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?v3.USER:v3.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};b_e=D([_(0,Kt)],b_e);let w_e=class{constructor(e,t){this._openers=new hl,this._validators=new hl,this._resolvers=new hl,this._resolvedUriTargets=new ui(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new hl,this._defaultExternalOpener={openExternal:async i=>(A8(i,pe.http,pe.https)?YGe(i):si.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||A8(i,pe.mailto,pe.http,pe.https,pe.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new v_e(t)),this._openers.push(new b_e(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}async open(e,t){const i=typeof e=="string"?N.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(n,t))return!1;for(const o of this._openers)if(await o.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?N.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},He.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},He.None)}dispose(){this._validators.clear()}};w_e=D([_(0,Kt),_(1,vi)],w_e);const Ml=ae("editorWorkerService");var u_;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(u_||(u_={}));var Ws;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ws||(Ws={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=g(4412,"Error"),t[s.Warning]=g(4413,"Warning"),t[s.Info]=g(4414,"Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Xe.Error:return s.Error;case Xe.Warning:return s.Warning;case Xe.Info:return s.Info;case Xe.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Xe.Error;case s.Warning:return Xe.Warning;case s.Info:return Xe.Info;case s.Hint:return Xe.Ignore}}s.toSeverity=o})(Ws||(Ws={}));var ZY;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ws.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(ZY||(ZY={}));const Am=ae("markerService");let y_e=class extends V{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new ui,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}getLiveMarkers(e){const t=this._markerDecorations.get(e);return t?t.getMarkers():[]}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new REt(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===pe.inMemory||e.uri.scheme===pe.internal||e.uri.scheme===pe.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};y_e=D([_(0,gi),_(1,Am)],y_e);class REt extends V{constructor(e){super(),this.model=e,this._map=new Prt,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Sre(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,o);for(const a of i)this._map.delete(a);for(let a=0;a{const n=this.model.getDecorationRange(t);n&&e.push([n,i])}),e}_createDecorationRange(e,t){let i=F.lift(t);if(t.severity===Ws.Hint&&!this._hasMarkerTag(t,u_.Unnecessary)&&!this._hasMarkerTag(t,u_.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const n=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(n===1||i.endColumn>=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new F(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var o0;function gE(s){return s.toString()}class MEt{constructor(e,t,i){this.model=e,this._modelEventListeners=new Z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const NEt=pr||Qt?Sb.LF:Sb.CRLF;class PEt{constructor(e,t,i,n,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var hL;let C_e=(hL=class extends V{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=o,this._onModelAdded=this._register(new I),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new I),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new I),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Vd.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const u=parseInt(e.editor.tabSize,10);isNaN(u)||(i=u),i<1&&(i=1)}let n="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(n=Math.max(u,1))}let o=Vd.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=NEt;const a=e.eol;a===`\r +`?r=Sb.CRLF:a===` +`&&(r=Sb.LF);let c=Vd.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Vd.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Vd.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Vd.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:r,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:po===Ds.Linux||po===Ds.Macintosh?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=QL._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=new QU(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(vD(i))){const l=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===l.sha1:!1;if(u||l.sharesUndoRedoStack){for(const f of d.past)zA(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)zA(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>zA(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(l.versionId),r._overwriteAlternativeVersionId(l.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(l.initialUndoRedoSnapshot))}else l.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(l.initialUndoRedoSnapshot)}const a=vD(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new WDt(r,l=>this._onWillDispose(l),(l,d)=>this._onDidChangeLanguage(l,d));return this._models[a]=c,c}updateModel(e,t){const i=this.getCreationOptions(e.getLanguageId(),e.uri,e.isForSimpleWidget),{textBuffer:s,disposable:o}=Nwe(t,i.defaultEOL);if(e.equalsTextBuffer(s)){o.dispose();return}e.pushStackElement(),e.pushEOL(s.getEOL()===`\r -`?bu.CRLF:bu.LF),e.pushEditOperations([],QL._computeEdits(e,s),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,s,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new O(o+1,1,i-r+1,1),c=new O(o+1,1,s-r+1,1)):o>0?(a=new O(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new O(o,1+t.getLineLength(o),s,1+t.getLineLength(s))):(a=new O(1,1,i,e.getLineMaxColumn(i)),c=new O(1,1,s,1+t.getLineLength(s))),[ds.replaceMove(a,t.getValueInRange(c,xo.TextDefined))]}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Yc,i,s),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[vD(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||l.future.length>0){for(const d of l.past)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=QL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!s&&(r>a||!c.canComputeSHA1(e))){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>zA(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new UDt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);QL._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new tV}},QL=nN,nN.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,nN);Nbe=QL=D([_(0,Re),_(1,CMe),_(2,pO),_(3,Di),_(4,lo)],Nbe);const xae=class xae{canComputeSHA1(e){return e.getValueLength()<=xae.MAX_MODEL_SIZE}computeSHA1(e){const t=new Rve,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};xae.MAX_MODEL_SIZE=10*1024*1024;let tV=xae;var VDt=".quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,87%,.4);border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73%,.4);box-shadow:inset 0 -1px 0 hsla(0,0%,73%,.4);color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #6fc3df;box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #0f4a85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50%,.17);border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6);color:#ccc}";Ct(VDt,{});var xee;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(xee||(xee={}));const xz={Quickaccess:"workbench.contributions.quickaccess"};class zDt{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ee(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Vi([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}clear(){const e=[...this.providers],t=this.defaultProvider;return this.providers=[],this.defaultProvider=void 0,()=>{this.providers=e,this.defaultProvider=t}}}it.add(xz.Quickaccess,new zDt);const $Dt={ctrlCmd:!1,alt:!1};var iV;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(iV||(iV={}));var nV;(function(n){n.QuickPick="quickPick",n.InputBox="inputBox",n.QuickWidget="quickWidget"})(nV||(nV={}));var Qp;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Qp||(Qp={}));var Wo;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Wo||(Wo={}));class GDt{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===_e.file?e.resource.fsPath:e.resource?.path}}const _Ue=new GDt,On=ae("quickInputService");let Pbe=class extends ${constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=it.as(xz.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}pick(e="",t){return this.doShowOrPick(e,!0,t)}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[s,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&o&&a===o){e!==o.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!i?.preserveValue){let p;if(r&&a&&a!==o){const m=r.value.substr(a.prefix.length);m&&(p=`${o.prefix}${m}`)}if(!p){const m=s?.defaultFilterValue;m===xee.LAST?p=this.lastAcceptedPickerValues.get(o):typeof m=="string"&&(p=`${o.prefix}${m}`)}typeof p=="string"&&(e=p)}const c=r?.picker?.valueSelection,l=r?.picker?.value,d=new Z,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=i?.placeholder??o?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??Qp.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new sd,d.add(T.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,s,o,e,i));const f=d.add(new ai);if(s&&d.add(s.provide(h,f.token,i?.providerOptions)),T.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),c&&l===e&&(h.valueSelection=c),t)return u?.p}adjustValueSelection(e,t,i){let s;i?.preserveValue?s=[e.value.length,e.value.length]:s=[t?.prefix.length??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ee(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(c=>{const[l]=this.getOrInstantiateProvider(c,o?.enabledProviderPrefixes);l!==t?this.show(c,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):a.value=c})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};Pbe=D([_(0,On),_(1,be)],Pbe);var qDt=".monaco-custom-toggle{border:1px solid transparent;border-radius:3px;box-sizing:border-box;cursor:pointer;float:left;height:20px;margin-left:2px;overflow:hidden;padding:1px;user-select:none;-webkit-user-select:none;width:20px}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{background-size:16px!important;border:1px solid transparent;border-radius:3px;height:18px;margin-left:0;margin-right:9px;opacity:1;padding:0;width:18px}.monaco-action-bar .checkbox-action-item{align-items:center;display:flex}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}";Ct(qDt,{});const rXe={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class iD extends wg{constructor(e){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...$e.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(H_().setupUpdatableHover(e.hoverDelegate??va("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===E.Space||i.keyCode===E.Enter){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...$e.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...$e.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const Dae=class Dae extends wg{constructor(e,t,i){super(),this.title=e,this.isChecked=t,this._onChange=this._register(new I),this.onChange=this._onChange.event,this.checkbox=this._register(new iD({title:this.title,isChecked:this.isChecked,icon:Ce.check,actionClassName:Dae.CLASS_NAME,...rXe})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return kw(this.domNode)}enable(){this.checkbox.enable()}disable(){this.checkbox.disable()}applyStyles(){this.domNode.style.color=this.styles.checkboxForeground||"",this.domNode.style.backgroundColor=this.styles.checkboxBackground||"",this.domNode.style.borderColor=this.styles.checkboxBorder||""}};Dae.CLASS_NAME="monaco-checkbox";let vUe=Dae;var QDt='.quick-input-widget{-webkit-app-region:no-drag;border-radius:6px;left:50%;margin-left:-300px;position:absolute;width:600px;z-index:2550}.quick-input-titlebar{align-items:center;border-radius:inherit;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-title{overflow:hidden;padding:3px 0;text-align:center;text-overflow:ellipsis}.quick-input-right-action-bar{display:flex;flex:1;margin-right:4px}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{flex:1;margin:4px 2px}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{margin-bottom:0;padding:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{display:flex;flex-grow:1;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{left:-10000px;position:absolute}.quick-input-count{align-items:center;align-self:center;display:flex;position:absolute;right:4px}.quick-input-count .monaco-count-badge{border-radius:2px;line-height:normal;min-height:auto;padding:2px 4px;vertical-align:middle}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{align-items:center;display:flex;font-size:11px;height:25px;padding:0 6px}.quick-input-message{margin-top:-1px;overflow-wrap:break-word;padding:5px}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{max-height:440px;overflow:hidden;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;display:flex;height:100%;overflow:hidden;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-style:solid;border-top-width:1px}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{display:flex;flex:1;height:100%;overflow:hidden}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{align-items:center;background-position:0;background-repeat:no-repeat;background-size:16px;display:flex;height:22px;justify-content:center;padding-right:6px;width:16px}.quick-input-list .quick-input-list-rows{display:flex;flex:1;flex-direction:column;height:100%;margin-left:5px;overflow:hidden;text-overflow:ellipsis}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{align-items:center;display:flex}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{line-height:normal;opacity:.7;overflow:hidden;text-overflow:ellipsis}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{background-color:unset;color:var(--vscode-list-highlightForeground)!important;font-weight:700}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px;margin-top:1px}.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-size:12px;padding:4px 6px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}';Ct(QDt,{});class Fbe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Fbe.__decorator=D([ii],Fbe.prototype,"toString",null);const jDt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function aXe(n){const e=[];let t=0,i;for(;i=jDt.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{igt(f)&&un.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new oi(a,xe.CLICK)).event,d=t.disposables.add(new oi(a,xe.KEY_DOWN)).event,h=T.chain(d,f=>f.filter(p=>{const m=new os(p);return m.equals(E.Space)||m.equals(E.Enter)}));t.disposables.add(dh.addTarget(a));const u=t.disposables.add(new oi(a,Eo.Tap)).event;T.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let gF=class extends ${get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},s,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=s,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const s=Ra(e.target)?[e.target]:e.target.targetElements;for(const r of s)this.hoverDisposables.add(Xo(r,"keydown",a=>{a.equals(E.Escape)&&this.hoverService.hideHover()}));const o=Ra(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=iV.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=iV.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?_a(this.ui.widget,this._widget):_a(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new O_,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(r=>r===kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this.buttons.filter(r=>r!==kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.rightActionBar.push(o,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=this.toggles?.filter(o=>o instanceof iD)??[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,_a(this.ui.message),XDt(i,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?g(S1,5,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==nt.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};kae.noPromptMessage=g(S1,4,"Press 'Enter' to confirm your input or 'Escape' to cancel");let sV=kae;const Iae=class Iae extends sV{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new I),this.onWillAcceptEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Qp.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new I),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new I),this.onDidTriggerItemButtonEmitter=this._register(new I),this.onDidTriggerSeparatorButtonEmitter=this._register(new I),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Ole,this.type=nV.QuickPick,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidCustom=this.onDidCustomEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?$Dt:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}inputHasFocus(){return this.visible?this.ui.inputBox.hasFocus():!1}focusOnInput(){this.ui.inputBox.setFocus()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}get hideCountBadge(){return!!this._hideCountBadge}set hideCountBadge(e){this._hideCountBadge=e,this.update()}get hideCheckAll(){return!!this._hideCheckAll}set hideCheckAll(e){this._hideCheckAll=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Wo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ls(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(hMe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return pe(this.ui.container,xe.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new os(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===E.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===E.Alt||a[0].ctrlKey&&i===E.Ctrl||a[0].metaKey&&i===E.Meta)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder||Iae.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Qp.NONE:this._itemActivation=Qp.FIRST;break;case Qp.SECOND:this.ui.list.focus(Wo.Second),this._itemActivation=Qp.FIRST;break;case Qp.LAST:this.ui.list.focus(Wo.Last),this._itemActivation=Qp.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Wo.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};Iae.DEFAULT_ARIA_LABEL=g(S1,6,"Type to narrow down results.");let r2=Iae,skt=class extends sV{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.type=nV.InputBox,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?g(S1,7,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):sV.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}};class okt extends sV{constructor(){super(...arguments),this.type=nV.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let Obe=class extends gF{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Ra(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};Obe=D([_(0,Re),_(1,el)],Obe);var rkt=".monaco-text-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-radius:2px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;line-height:18px;padding:4px;text-align:center;width:100%}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{cursor:default;opacity:.4!important}.monaco-text-button .codicon{color:inherit!important;margin:0 .2em}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;height:28px;overflow:hidden;padding:0 4px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;overflow:hidden;width:0}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{align-items:center;display:flex;font-style:inherit;font-weight:400;justify-content:center;padding:4px 0}.monaco-button-dropdown{cursor:pointer;display:flex}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator,.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{cursor:default;padding:4px 0}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{align-items:center;display:flex;flex-direction:column;margin:4px 5px}.monaco-description-button .monaco-button-description{font-size:11px;font-style:italic;padding:4px 20px}.monaco-description-button .monaco-button-description,.monaco-description-button .monaco-button-label{align-items:center;display:flex;justify-content:center}.monaco-description-button .monaco-button-description>.codicon,.monaco-description-button .monaco-button-label>.codicon{color:inherit!important;margin:0 .2em}.monaco-button-dropdown.default-colors>.monaco-button,.monaco-button.default-colors{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}.monaco-button-dropdown.default-colors>.monaco-button:hover,.monaco-button.default-colors:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary,.monaco-button.default-colors.secondary{background-color:var(--vscode-button-secondaryBackground);color:var(--vscode-button-secondaryForeground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover,.monaco-button.default-colors.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-bottom:1px solid var(--vscode-button-border);border-top:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}";Ct(rkt,{});const akt="vs/base/browser/ui/button/button";fe.white.toString(),fe.white.toString();class Tu extends ${get onDidClick(){return this._onDidClick.event}get onDidEscape(){return this._onDidEscape.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new I),this._onDidEscape=this._register(new I),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(dh.addTarget(this._element)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this._element,o,r=>{if(!this.enabled){un.stop(r);return}this._onDidClick.fire(r)}))}),this._register(pe(this._element,xe.KEY_DOWN,o=>{const r=new os(o);let a=!1;this.enabled&&(r.equals(E.Enter)||r.equals(E.Space))?(this._onDidClick.fire(o),a=!0):r.equals(E.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&un.stop(r,!0)})),this._register(pe(this._element,xe.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(pe(this._element,xe.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Dd(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of nw(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||ah(this._label)&&ah(e)&&uAt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ah(e)){const s=mQ(e,{inline:!0});s.dispose();const o=s.element.querySelector("p")?.innerHTML;if(o){const r=oje(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else _a(t)}else this.options.supportIcons?_a(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=gJe(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set labelShort(e){!this.options.supportShortLabel||!this._labelShortElement||(this.options.supportIcons?_a(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...$e.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return kw(this._element)}}class ckt extends ${constructor(e,t){super(),this._onDidClick=this._register(new I),this.onDidClick=this._onDidClick.event,this.element=document.createElement("div"),this.element.classList.add("monaco-button-dropdown"),e.appendChild(this.element),this.button=this._register(new Tu(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new xn("primaryAction",gJe(this.button.label),void 0,!0,async()=>this._onDidClick.fire(void 0))),this.separatorContainer=document.createElement("div"),this.separatorContainer.classList.add("monaco-button-dropdown-separator"),this.separator=document.createElement("div"),this.separatorContainer.appendChild(this.separator),this.element.appendChild(this.separatorContainer);const i=t.buttonBorder;i&&(this.separatorContainer.style.borderTop="1px solid "+i,this.separatorContainer.style.borderBottom="1px solid "+i);const s=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=s??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new Tu(this.element,{...t,title:!1,supportIcons:!0})),this._register(H_().setupUpdatableHover(va("mouse"),this.dropdownButton.element,g(akt,0,"More Actions..."))),this.dropdownButton.element.setAttribute("aria-haspopup","true"),this.dropdownButton.element.setAttribute("aria-expanded","false"),this.dropdownButton.element.classList.add("monaco-dropdown-button"),this.dropdownButton.icon=Ce.dropDownButton,this._register(this.dropdownButton.onDidClick(o=>{const r=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...r]:[this.action,...r],actionRunner:t.actionRunner,onHide:()=>this.dropdownButton.element.setAttribute("aria-expanded","false")}),this.dropdownButton.element.setAttribute("aria-expanded","true")}))}dispose(){super.dispose(),this.element.remove()}set label(e){this.button.label=e,this.action.label=e}set icon(e){this.button.icon=e}set enabled(e){this.button.enabled=e,this.dropdownButton.enabled=e,this.element.classList.toggle("disabled",!e)}get enabled(){return this.button.enabled}focus(){this.button.focus()}hasFocus(){return this.button.hasFocus()||this.dropdownButton.hasFocus()}}class lkt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Tu(this._element,t),this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("monaco-button-description"),this._element.appendChild(this._descriptionElement),e.appendChild(this._element)}get onDidClick(){return this._button.onDidClick}get element(){return this._element}set label(e){this._button.label=e}set icon(e){this._button.icon=e}get enabled(){return this._button.enabled}set enabled(e){this._button.enabled=e}focus(){this._button.focus()}hasFocus(){return this._button.hasFocus()}dispose(){this._button.dispose()}set description(e){this.options.supportIcons?_a(this._descriptionElement,...nw(e)):this._descriptionElement.textContent=e}}class dkt{constructor(e){this.container=e,this._buttons=[],this._buttonStore=new Z}dispose(){this._buttonStore.dispose()}get buttons(){return this._buttons}clear(){this._buttonStore.clear(),this._buttons.length=0}addButton(e){const t=this._buttonStore.add(new Tu(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new lkt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new ckt(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(pe(e.element,xe.KEY_DOWN,i=>{const s=new os(i);let o=!0,r;s.equals(E.LeftArrow)?r=t>0?t-1:this._buttons.length-1:s.equals(E.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),un.stop(i,!0))}))}}var hkt=".monaco-count-badge{border-radius:11px;box-sizing:border-box;display:inline-block;font-size:11px;font-weight:400;line-height:11px;min-height:18px;min-width:18px;padding:3px 6px;text-align:center}.monaco-count-badge.long{border-radius:2px;line-height:normal;min-height:auto;padding:2px 3px}";Ct(hkt,{});class Bbe{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=he(e,we(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setCountFormat(e){this.countFormat=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=a_(this.countFormat,this.count),this.element.title=a_(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const ukt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let gkt=ukt;function fkt(n,e){return gkt()}var pkt=".monaco-progress-container{height:2px;overflow:hidden;width:100%}.monaco-progress-container .progress-bit{display:none;height:2px;left:0;position:absolute;width:2%}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-duration:4s;animation-iteration-count:infinite;animation-name:progress;animation-timing-function:linear;transform:translateZ(0)}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translateX(0) scaleX(1)}50%{transform:translateX(2500%) scaleX(3)}to{transform:translateX(4900%) scaleX(1)}}";Ct(pkt,{});const Hfe="done",Ufe="active",aK="infinite",cK="infinite-long-running",Vfe="discrete",K8=class K8 extends ${constructor(e,t){super(),this.progressSignal=this._register(new Dn),this.workedVal=0,this.showDelayedScheduler=this._register(new yn(()=>Oh(this.element),0)),this.longRunningScheduler=this._register(new yn(()=>this.infiniteLongRunning(),K8.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Ufe,aK,cK,Vfe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}done(){return this.doDone(!0)}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Hfe),this.element.classList.contains(aK)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Vfe,Hfe,cK),this.element.classList.add(Ufe,aK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(cK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return Kc(this.totalWork)}worked(e){return e=Math.max(1,Number(e)),this.doSetWorked(this.workedVal+e)}setWorked(e){return e=Math.max(1,Number(e)),this.doSetWorked(e)}doSetWorked(e){const t=this.totalWork||100;return this.workedVal=e,this.workedVal=Math.min(t,this.workedVal),this.element.classList.remove(aK,cK,Hfe),this.element.classList.add(Ufe,Vfe),this.element.setAttribute("aria-valuenow",e.toString()),this.bit.style.width=100*(this.workedVal/t)+"%",this}getContainer(){return this.element}show(e){this.showDelayedScheduler.cancel(),this.progressSignal.value=fkt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Oh(this.element)}hide(){Jl(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};K8.LONG_RUNNING_INFINITE_THRESHOLD=1e4,K8.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let y7=K8;const MNe="vs/base/browser/ui/findinput/findInputToggles",mkt=g(MNe,0,"Match Case"),_kt=g(MNe,1,"Match Whole Word"),vkt=g(MNe,2,"Use Regular Expression");class hXe extends iD{constructor(e){super({icon:Ce.caseSensitive,title:mkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class uXe extends iD{constructor(e){super({icon:Ce.wholeWord,title:_kt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class gXe extends iD{constructor(e){super({icon:Ce.regex,title:vkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wkt{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Wbe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isFirst(){return this._currentPosition()===0}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}clear(){this._initialize([]),this._onChange()}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new wkt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}var bkt=".monaco-inputbox{border-radius:2px;box-sizing:border-box;display:block;font-size:inherit;padding:0;position:relative}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{height:100%;position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{border:none;box-sizing:border-box;color:inherit;display:inline-block;font-family:inherit;font-size:inherit;height:100%;line-height:inherit;resize:none;width:100%}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;outline:none;scrollbar-width:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{word-wrap:break-word;box-sizing:border-box;display:inline-block;left:0;position:absolute;top:0;visibility:hidden;white-space:pre-wrap;width:100%}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-top:-1px;overflow:hidden;padding:.4em;text-align:left;width:100%}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;height:16px;width:16px}";Ct(bkt,{});const VW="vs/base/browser/ui/inputbox/inputBox",_5=we;var Yd;(function(n){n[n.INFO=1]="INFO",n[n.WARNING=2]="WARNING",n[n.ERROR=3]="ERROR"})(Yd||(Yd={}));const Ckt={inputBackground:"#3C3C3C",inputForeground:"#CCCCCC",inputValidationInfoBorder:"#55AAFF",inputValidationInfoBackground:"#063B49",inputValidationWarningBorder:"#B89500",inputValidationWarningBackground:"#352A05",inputValidationErrorBorder:"#BE1100",inputValidationErrorBackground:"#5A1D1D",inputBorder:void 0,inputValidationErrorForeground:void 0,inputValidationInfoForeground:void 0,inputValidationWarningForeground:void 0};class fXe extends wg{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new I),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=he(e,_5(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=he(this.element,_5(".ibwrapper"));if(this.input=he(o,_5(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=he(o,_5("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new FKe(this.element,{vertical:zo.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),he(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new oi(e.ownerDocument,"selectionchange")),a=T.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===o);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Qh(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this.input,e))}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get mirrorElement(){return this.mirror}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get step(){return this.input.step}set step(e){this.input.step=e}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Zf(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return kw(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}setEnabled(e){e?this.enable():this.disable()}get width(){return du(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,s=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+s}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Io(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${hS(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}isInputValid(){return!!this.validation&&!this.validation(this.value)}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case Yd.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Yd.WARNING:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case Yd.INFO:return"info";case Yd.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=du(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:Ob.RIGHT,render:s=>{if(!this.message)return null;e=he(s,_5(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?mNe(this.message.content,o):HSt(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background??"",r.style.color=a.foreground??"",r.style.border=a.border?`1px solid ${a.border}`:"",he(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Yd.ERROR?i=g(VW,0,"Error: {0}",this.message.content):this.message.type===Yd.WARNING?i=g(VW,1,"Warning: {0}",this.message.content):i=g(VW,2,"Info: {0}",this.message.content),sa(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${hS(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Zf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class NNe extends fXe{constructor(e,t,i){const s=g(VW,3," or {0} for history","⇅"),o=g(VW,4," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this.history=new Wbe(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!kw(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=c=>{if(this.placeholder.endsWith(c)){const l=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=l:this.setPlaceHolder(l),!0}else return!1};a(o)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}prependHistory(e){const t=this.getHistory();this.clearHistory(),e.forEach(i=>{this.history.add(i)}),t.forEach(i=>{this.history.add(i)})}getHistory(){return this.history.getHistory()}isAtFirstInHistory(){return this.history.isFirst()}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Cu(this.value?this.value:g(VW,5,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Cu(this.value))}clearHistory(){this.history.clear()}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var ykt=".monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.hc-light .monaco-findInput.highlight-0 .controls,.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.hc-light .monaco-findInput.highlight-1 .controls,.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}";Ct(ykt,{});const Skt="vs/base/browser/ui/findinput/findInput",Akt=g(Skt,0,"input"),bBe=class bBe extends wg{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Dn),this.additionalToggles=[],this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCaseSensitiveKeyDown=this._register(new I),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new I),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Akt,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],c=!!i.flexibleHeight,l=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new NNe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:c,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const h=this._register(C1());if(this.showCommonFindToggles){this.regex=this._register(new gXe({appendTitle:r,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new uXe({appendTitle:o,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new hXe({appendTitle:s,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(E.LeftArrow)||f.equals(E.RightArrow)||f.equals(E.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(E.RightArrow)?m=(p+1)%u.length:f.equals(E.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(E.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),un.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(pe(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(pe(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get isImeSessionInProgress(){return this.imeSessionInProgress}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}focusOnRegex(){this.regex?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}clearValidation(){this.inputBox.hideMessage()}};bBe.OPTION_CHANGE="optionChange";let S7=bBe;const Ekt=we;class xkt extends ${constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Xo(this.findInput.inputBox.inputElement,xe.KEY_DOWN,o),this.onMouseDown=o=>Xo(this.findInput.inputBox.inputElement,xe.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=he(this.parent,Ekt(".quick-input-box")),this.findInput=this._register(new S7(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}setPlaceholder(e){this.findInput.inputBox.setPlaceHolder(e)}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===nt.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Dkt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:$.None}}renderElement(e,t,i,s){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new ai,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class kkt{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Ikt(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new kkt(n,e.accessibilityProvider)}}class Lkt{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(c=>new Dkt(c,r));this.list=new Fc(e,t,i,a,Ikt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return kw(this.getHTMLElement())}domFocus(){this.list.domFocus()}get onDidFocus(){return this.list.onDidFocus}get onDidBlur(){return this.list.onDidBlur}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseClick(){return T.map(this.list.onMouseClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onMouseDblClick(){return T.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onTap(){return T.map(this.list.onTap,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return T.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeFocus(){return T.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return T.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onContextMenu(){return T.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:s})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:s}:{element:this._model.get(e),index:t,anchor:i,browserEvent:s})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Mg(e.length))}get length(){return this.list.length}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollLeft(){return this.list.scrollLeft}set scrollLeft(e){this.list.scrollLeft=e}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}setFocus(e){this.list.setFocus(e)}focusNext(e,t){this.list.focusNext(e,t)}focusPrevious(e,t){this.list.focusPrevious(e,t)}focusNextPage(){return this.list.focusNextPage()}focusPreviousPage(){return this.list.focusPreviousPage()}focusLast(){this.list.focusLast()}focusFirst(){this.list.focusFirst()}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}layout(e,t){this.list.layout(e,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}reveal(e,t){this.list.reveal(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Tkt=':root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}.monaco-sash{position:absolute;touch-action:none;z-index:35}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;height:100%;top:0;width:var(--vscode-sash-size)}.monaco-sash.horizontal{cursor:ns-resize;height:var(--vscode-sash-size);left:0;width:100%}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";cursor:all-scroll;display:block;height:calc(var(--vscode-sash-size)*2);position:absolute;width:calc(var(--vscode-sash-size)*2);z-index:100}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-.5);top:calc(var(--vscode-sash-size)*-1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{bottom:calc(var(--vscode-sash-size)*-1);left:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{right:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash:before{background:transparent;content:"";height:100%;pointer-events:none;position:absolute;width:100%}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.active:before,.monaco-sash.hover:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{left:calc(50% - var(--vscode-sash-hover-size)/2);width:var(--vscode-sash-hover-size)}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - var(--vscode-sash-hover-size)/2)}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:cyan}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}';Ct(Tkt,{});const Rkt=!1;var Iee;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(Iee||(Iee={}));var vi;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(vi||(vi={}));var Ia;(function(n){n[n.Disabled=0]="Disabled",n[n.AtMinimum=1]="AtMinimum",n[n.AtMaximum=2]="AtMaximum",n[n.Enabled=3]="Enabled"})(Ia||(Ia={}));let Mkt=4;const Nkt=new I;let Pkt=300;const Fkt=new I;class A7{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new oi(gt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new oi(gt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}A7.__decorator=D([ii],A7.prototype,"onPointerMove",null);A7.__decorator=D([ii],A7.prototype,"onPointerUp",null);class E7{get onPointerMove(){return this.disposables.add(new oi(this.el,Eo.Change)).event}get onPointerUp(){return this.disposables.add(new oi(this.el,Eo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}E7.__decorator=D([ii],E7.prototype,"onPointerMove",null);E7.__decorator=D([ii],E7.prototype,"onPointerUp",null);class oV{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}oV.__decorator=D([ii],oV.prototype,"onPointerMove",null);oV.__decorator=D([ii],oV.prototype,"onPointerUp",null);const wUe="pointer-events-disabled";class Lh extends ${get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===Ia.Disabled),this.el.classList.toggle("minimum",e===Ia.AtMinimum),this.el.classList.toggle("maximum",e===Ia.AtMaximum),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalStartDragHandle=he(this.el,we(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalEndDragHandle=he(this.el,we(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=Pkt,this.hoverDelayer=this._register(new Lu(this.hoverDelay)),this._state=Ia.Enabled,this.onDidEnablementChange=this._register(new I),this._onDidStart=this._register(new I),this._onDidChange=this._register(new I),this._onDidReset=this._register(new I),this._onDidEnd=this._register(new I),this.orthogonalStartSashDisposables=this._register(new Z),this.orthogonalStartDragHandleDisposables=this._register(new Z),this.orthogonalEndSashDisposables=this._register(new Z),this.orthogonalEndDragHandleDisposables=this._register(new Z),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=he(e,we(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),ei&&this.el.classList.add("mac");const s=this._register(new oi(this.el,"mousedown")).event;this._register(s(h=>this.onPointerStart(h,new A7(e)),this));const o=this._register(new oi(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new oi(this.el,"mouseenter")).event;this._register(r(()=>Lh.onMouseEnter(this)));const a=this._register(new oi(this.el,"mouseleave")).event;this._register(a(()=>Lh.onMouseLeave(this))),this._register(dh.addTarget(this.el));const c=this._register(new oi(this.el,Eo.Start)).event;this._register(c(h=>this.onPointerStart(h,new E7(this.el)),this));const l=this._register(new oi(this.el,Eo.Tap)).event;let d;this._register(l(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===vi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Mkt,this._register(Nkt.event(h=>{this.size=h,this.layout()}))),this._register(Fkt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||vi.VERTICAL,this.orientation===vi.HORIZONTAL?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",Rkt),this.layout()}onPointerStart(e,t){un.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new oV(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new oV(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of s)p.classList.add(wUe);const o=e.pageX,r=e.pageY,a=e.altKey,c={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=od(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===vi.HORIZONTAL?this.state===Ia.AtMinimum?p="s-resize":this.state===Ia.AtMaximum?p="n-resize":p=ei?"row-resize":"ns-resize":this.state===Ia.AtMinimum?p="e-resize":this.state===Ia.AtMaximum?p="w-resize":p=ei?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{un.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{un.stop(p,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of s)m.classList.remove(wUe)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Lh.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Lh.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Lh.onMouseLeave(this)}layout(){if(this.orientation===vi.VERTICAL){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!Ra(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var Okt='.monaco-split-view2{height:100%;position:relative;width:100%}.monaco-split-view2>.sash-container{height:100%;pointer-events:none;position:absolute;width:100%}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{height:100%;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{position:absolute;white-space:normal}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{background-color:var(--separator-border);content:" ";left:0;pointer-events:none;position:absolute;top:0;z-index:5}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}';Ct(Okt,{});const Bkt={separatorBorder:fe.transparent};var HC;(function(n){n[n.Normal=0]="Normal",n[n.Low=1]="Low",n[n.High=2]="High"})(HC||(HC={}));class pXe{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=kc(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class Wkt extends pXe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Hkt extends pXe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Hu;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Hu||(Hu={}));var A1;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(A1||(A1={}));class x7 extends ${get contentSize(){return this._contentSize}get length(){return this.viewItems.length}get minimumSize(){return this.viewItems.reduce((e,t)=>e+t.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,t)=>e+t.maximumSize,0)}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get sashes(){return this.sashItems.map(e=>e.sash)}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Hu.Idle,this._onDidSashChange=this._register(new I),this._onDidSashReset=this._register(new I),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??vi.VERTICAL,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===vi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=he(this.el,we(".sash-container")),this.viewContainer=we(".split-view-container"),this.scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(this.el),s)})),this.scrollableElement=this._register(new hQ(this.viewContainer,{vertical:this.orientation===vi.VERTICAL?t.scrollbarVisibility??zo.Auto:zo.Hidden,horizontal:this.orientation===vi.HORIZONTAL?t.scrollbarVisibility??zo.Auto:zo.Hidden},this.scrollable));const i=this._register(new oi(this.viewContainer,"scroll")).event;this._register(i(s=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),he(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Bkt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,o)=>{const r=ll(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((s,o)=>s+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{t?.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index});const i=t?.type==="split"?this.viewItems[t.index]:void 0,s=this.viewItems.splice(e,1)[0];if(i&&(i.size+=s.size),this.viewItems.length>=1){const r=Math.max(e-1,0);this.sashItems.splice(r,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const o=s.view;return s.dispose(),o}finally{this.state=Hu.Idle}}removeAllViews(){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const e=this.viewItems.splice(0,this.viewItems.length);for(const i of e)i.dispose();const t=this.sashItems.splice(0,this.sashItems.length);for(const i of t)i.disposable.dispose();return this.relayout(),e.map(i=>i.view)}finally{this.state=Hu.Idle}}moveView(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),s=typeof i>"u"?this.getViewSize(e):A1.Invisible(i),o=this.removeView(e);this.addView(o,s,t)}swapViews(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),s=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,s,t)}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[e].setVisible(t),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;o0&&(r.size=kc(Math.round(a*e/s),r.minimumSize,r.maximumSize))}}else{const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=pa(pe(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),pe(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,c)=>{const l=this.viewItems.map(p=>p.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(s===this.sashItems.length-1){const m=this.viewItems[s];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[s+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Mg(s,-1),m=Mg(s+1,this.viewItems.length),v=p.reduce((F,N)=>F+(this.viewItems[N].minimumSize-l[N]),0),w=p.reduce((F,N)=>F+(this.viewItems[N].viewMaximumSize-l[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].minimumSize),0),C=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].viewMaximumSize),0),y=Math.max(v,C),S=Math.min(b,w),M=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof M=="number"){const F=this.viewItems[M],N=Math.floor(F.viewMinimumSize/2);u={index:M,limitDelta:F.visible?y-N:y+N,size:F.size}}if(typeof k=="number"){const F=this.viewItems[k],N=Math.floor(F.viewMinimumSize/2);f={index:k,limitDelta:F.visible?S+N:S-N,size:F.size}}}this.sashDragState={start:a,current:a,index:s,sizes:l,minDelta:d,maxDelta:h,alt:c,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:c,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,s,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(C=>C.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,w=m.size-m.minimumSize,b=u?t-1:t+1;this.resize(b,-h,f,void 0,void 0,v,w)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=kc(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const i=Mg(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===HC.Low),e],o=i.filter(a=>this.viewItems[a].priority===HC.High),r=this.viewItems[e];t=Math.round(t),t=kc(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o)}finally{this.state=Hu.Idle}}}isViewExpanded(e){if(e<0||e>=this.viewItems.length)return!1;for(const t of this.viewItems)if(t!==this.viewItems[e]&&t.size>t.minimumSize)return!1;return!0}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=kc(i,a.minimumSize,a.maximumSize);const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const o=we(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>this.viewContainer.removeChild(o)),c=pa(r,a);let l;typeof t=="number"?l=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?l=this.getViewSize(t.index)/2:t.type==="invisible"?l={cachedVisibleSize:t.cachedVisibleSize}:l=e.minimumSize);const d=this.orientation===vi.VERTICAL?new Wkt(o,e,l,c):new Hkt(o,e,l,c);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===vi.VERTICAL?new Lh(this.sashContainer,{getHorizontalSashTop:F=>this.getSashPosition(F),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:vi.HORIZONTAL}):new Lh(this.sashContainer,{getVerticalSashLeft:F=>this.getSashPosition(F),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:vi.VERTICAL}),p=this.orientation===vi.VERTICAL?F=>({sash:f,start:F.startY,current:F.currentY,alt:F.altKey}):F=>({sash:f,start:F.startX,current:F.currentX,alt:F.altKey}),v=T.map(f.onDidStart,p)(this.onSashStart,this),b=T.map(f.onDidChange,p)(this.onSashChange,this),y=T.map(f.onDidEnd,()=>this.sashItems.findIndex(F=>F.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const F=this.sashItems.findIndex(j=>j.sash===f),N=Mg(F,-1),z=Mg(F+1,this.viewItems.length),U=this.findFirstSnapIndex(N),J=this.findFirstSnapIndex(z);typeof U=="number"&&!this.viewItems[U].visible||typeof J=="number"&&!this.viewItems[J].visible||this._onDidSashReset.fire(F)}),M=pa(v,b,y,S,f),k={sash:f,disposable:M};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),s||this.relayout([i],h),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Hu.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Mg(e,-1),h=Mg(e+1,this.viewItems.length);if(o)for(const k of o)Sge(d,k),Sge(h,k);if(s)for(const k of s)hj(d,k),hj(h,k);const u=d.map(k=>this.viewItems[k]),f=d.map(k=>i[k]),p=h.map(k=>this.viewItems[k]),m=h.map(k=>i[k]),v=d.reduce((k,F)=>k+(this.viewItems[F].minimumSize-i[F]),0),w=d.reduce((k,F)=>k+(this.viewItems[F].maximumSize-i[F]),0),b=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].minimumSize),0),C=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].maximumSize),0),y=Math.max(v,C,r),S=Math.min(b,w,a);let M=!1;if(c){const k=this.viewItems[c.index],F=t>=c.limitDelta;M=F!==k.visible,k.setVisible(F,c.size)}if(!M&&l){const k=this.viewItems[l.index],F=ta+c.size,0);let i=this.size-t;const s=Mg(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);for(const a of r)Sge(s,a);for(const a of o)hj(s,a);typeof e=="number"&&hj(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===vi.VERTICAL?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const i=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=s.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=Ia.AtMinimum:b&&t[c]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),St(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Ukt='.monaco-table{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;white-space:nowrap;width:100%}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{font-weight:700;height:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.monaco-table-td,.monaco-table-th{box-sizing:border-box;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{border-left:1px solid transparent;content:"";left:calc(var(--vscode-sash-size)/2);position:absolute;width:0}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}';Ct(Ukt,{});const Lae=class Lae{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Lae.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=he(e,we(".monaco-table-tr")),i=[],s=[];for(let r=0;rthis.disposables.add(new zkt(d,h))),c={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new x7(this.domNode,{orientation:vi.HORIZONTAL,scrollbarVisibility:zo.Hidden,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new Lee(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Fc(e,this.domNode,Vkt(i),[l],r)),T.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((f,p)=>f+p.weight,0),u=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=od(this.domNode),this.style(nDt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}rerender(){this.list.rerender()}row(e){return this.list.element(e)}indexOf(e){return this.list.indexOf(e)}get length(){return this.list.length}getHTMLElement(){return this.domNode}layout(e,t){e=e??cMe(this.domNode),t=t??h$(this.domNode),this.cachedWidth=t,this.cachedHeight=e,this.splitview.layout(t);const i=e-this.virtualDelegate.headerRowHeight;this.list.getHTMLElement().style.height=`${i}px`,this.list.layout(i,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=o0._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),r=new C_(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(gE(i))){const l=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===l.sha1:!1;if(u||l.sharesUndoRedoStack){for(const f of d.past)qC(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)qC(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>qC(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(l.versionId),r._overwriteAlternativeVersionId(l.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(l.initialUndoRedoSnapshot))}else l.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(l.initialUndoRedoSnapshot)}const a=gE(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new MEt(r,l=>this._onWillDispose(l),(l,d)=>this._onDidChangeLanguage(l,d));return this._models[a]=c,c}updateModel(e,t){const i=this.getCreationOptions(e.getLanguageId(),e.uri,e.isForSimpleWidget),{textBuffer:n,disposable:o}=Cme(t,i.defaultEOL);if(e.equalsTextBuffer(n)){o.dispose();return}e.pushStackElement(),e.pushEOL(n.getEOL()===`\r +`?Sh.CRLF:Sh.LF),e.pushEditOperations([],o0._computeEdits(e,n),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,n,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new F(o+1,1,i-r+1,1),c=new F(o+1,1,n-r+1,1)):o>0?(a=new F(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new F(o,1+t.getLineLength(o),n,1+t.getLineLength(n))):(a=new F(1,1,i,e.getLineMaxColumn(i)),c=new F(1,1,n,1+t.getLineLength(n))),[Zn.replaceMove(a,t.getValueInRange(c,go.TextDefined))]}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,Ca,i,n),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[gE(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||l.future.length>0){for(const d of l.past)qC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)qC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=o0.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!n&&(r>a||!c.canComputeSHA1(e))){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>qC(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new PEt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);o0._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Z2}},o0=hL,hL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,hL);C_e=o0=D([_(0,Te),_(1,CTe),_(2,JA),_(3,xi),_(4,Vs)],C_e);const cse=class cse{canComputeSHA1(e){return e.getValueLength()<=cse.MAX_MODEL_SIZE}computeSHA1(e){const t=new fpe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}};cse.MAX_MODEL_SIZE=10*1024*1024;let Z2=cse;var FEt=".quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,87%,.4);border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73%,.4);box-shadow:inset 0 -1px 0 hsla(0,0%,73%,.4);color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #6fc3df;box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #0f4a85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50%,.17);border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6);color:#ccc}";ut(FEt,{});var eJ;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(eJ||(eJ={}));const RU={Quickaccess:"workbench.contributions.quickaccess"};class OEt{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ee(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Fi([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}clear(){const e=[...this.providers],t=this.defaultProvider;return this.providers=[],this.defaultProvider=void 0,()=>{this.providers=e,this.defaultProvider=t}}}Qe.add(RU.Quickaccess,new OEt);const BEt={ctrlCmd:!1,alt:!1};var eW;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(eW||(eW={}));var tW;(function(s){s.QuickPick="quickPick",s.InputBox="inputBox",s.QuickWidget="quickWidget"})(tW||(tW={}));var Hf;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(Hf||(Hf={}));var wo;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(wo||(wo={}));var tJ;(function(s){s[s.Title=1]="Title",s[s.Inline=2]="Inline"})(tJ||(tJ={}));class WEt{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===pe.file?e.resource.fsPath:e.resource?.path}}const j2e=new WEt,In=ae("quickInputService");let S_e=class extends V{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Qe.as(RU.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}pick(e="",t){return this.doShowOrPick(e,!0,t)}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[n,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&o&&a===o){e!==o.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!i?.preserveValue){let p;if(r&&a&&a!==o){const m=r.value.substr(a.prefix.length);m&&(p=`${o.prefix}${m}`)}if(!p){const m=n?.defaultFilterValue;m===eJ.LAST?p=this.lastAcceptedPickerValues.get(o):typeof m=="string"&&(p=`${o.prefix}${m}`)}typeof p=="string"&&(e=p)}const c=r?.picker?.valueSelection,l=r?.picker?.value,d=new Z,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=i?.placeholder??o?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??Hf.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new dc,d.add(M.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,o,e,i));const f=d.add(new ci);if(n&&d.add(n.provide(h,f.token,i?.providerOptions)),M.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),c&&l===e&&(h.valueSelection=c),t)return u?.p}adjustValueSelection(e,t,i){let n;i?.preserveValue?n=[e.value.length,e.value.length]:n=[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add(Ee(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(c=>{const[l]=this.getOrInstantiateProvider(c,o?.enabledProviderPrefixes);l!==t?this.show(c,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):a.value=c})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};S_e=D([_(0,In),_(1,we)],S_e);var HEt=".monaco-custom-toggle{border:1px solid transparent;border-radius:3px;box-sizing:border-box;cursor:pointer;float:left;height:20px;margin-left:2px;overflow:hidden;padding:1px;user-select:none;-webkit-user-select:none;width:20px}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{background-size:16px!important;border:1px solid transparent;border-radius:3px;height:18px;margin-left:0;margin-right:9px;opacity:1;padding:0;width:18px}.monaco-action-bar .checkbox-action-item{align-items:center;border-radius:2px;display:flex;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}";ut(HEt,{});const Kje={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class ZA extends pd{constructor(e){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...We.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(Sm().setupManagedHover(e.hoverDelegate??Pr("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===S.Space||i.keyCode===S.Enter){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...We.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...We.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const lse=class lse extends pd{constructor(e,t,i){super(),this.title=e,this.isChecked=t,this._onChange=this._register(new I),this.onChange=this._onChange.event,this.checkbox=this._register(new ZA({title:this.title,isChecked:this.isChecked,icon:ve.check,actionClassName:lse.CLASS_NAME,...Kje})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(n=>{this.applyStyles(),this._onChange.fire(n)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return av(this.domNode)}enable(){this.checkbox.enable()}disable(){this.checkbox.disable()}applyStyles(){this.domNode.style.color=this.styles.checkboxForeground||"",this.domNode.style.backgroundColor=this.styles.checkboxBackground||"",this.domNode.style.borderColor=this.styles.checkboxBorder||""}};lse.CLASS_NAME="monaco-checkbox";let Y2e=lse;var UEt='.quick-input-widget{-webkit-app-region:no-drag;border-radius:6px;left:50%;margin-left:-300px;position:absolute;width:600px;z-index:2550}.quick-input-titlebar{align-items:center;border-top-left-radius:5px;border-top-right-radius:5px;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-inline-action-bar{margin:2px 0 0 5px}.quick-input-title{overflow:hidden;padding:3px 0;text-align:center;text-overflow:ellipsis}.quick-input-right-action-bar{display:flex;flex:1;margin-right:4px}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{flex:1;margin:4px 2px}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{margin-bottom:0;padding:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{display:flex;flex-grow:1;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{left:-10000px;position:absolute}.quick-input-count{align-items:center;align-self:center;display:flex;position:absolute;right:4px}.quick-input-count .monaco-count-badge{border-radius:2px;line-height:normal;min-height:auto;padding:2px 4px;vertical-align:middle}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{align-items:center;display:flex;font-size:11px;height:25px;padding:0 6px}.quick-input-message{margin-top:-1px;overflow-wrap:break-word;padding:5px}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{max-height:440px;overflow:hidden;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;display:flex;overflow:hidden;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-style:solid;border-top-width:1px}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{display:flex;flex:1;height:100%;overflow:hidden}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{align-items:center;background-position:0;background-repeat:no-repeat;background-size:16px;display:flex;height:22px;justify-content:center;padding-right:6px;width:16px}.quick-input-list .quick-input-list-rows{display:flex;flex:1;flex-direction:column;height:100%;margin-left:5px;overflow:hidden;text-overflow:ellipsis}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{align-items:center;display:flex}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{line-height:normal;opacity:.7;overflow:hidden;text-overflow:ellipsis}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{background-color:unset;color:var(--vscode-list-highlightForeground)!important;font-weight:700}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px;margin-top:1px}.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-size:12px;padding:4px 6px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}';ut(UEt,{});class A_e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}A_e.__decorator=D([Zt],A_e.prototype,"toString",null);const VEt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function qje(s){const e=[];let t=0,i;for(;i=VEt.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,o,,r]=i;r?e.push({label:n,href:o,title:r}):e.push({label:n,href:o}),t=i.index+i[0].length}return t{Odt(f)&&en.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new ii(a,ke.CLICK)).event,d=t.disposables.add(new ii(a,ke.KEY_DOWN)).event,h=M.chain(d,f=>f.filter(p=>{const m=new En(p);return m.equals(S.Space)||m.equals(S.Enter)}));t.disposables.add(fd.addTarget(a));const u=t.disposables.add(new ii(a,uo.Tap)).event;M.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let xM=class extends V{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=Yr(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ro(r,"keydown",a=>{a.equals(S.Escape)&&this.hoverService.hideHover()}));const o=Yr(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTimet===iJ),this._rightButtons=e.filter(t=>t!==iJ&&t.location!==tJ.Inline),this._inlineButtons=e.filter(t=>t.location===tJ.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=eW.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=eW.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?aa(this.ui.widget,this._widget):aa(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Cm,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const n=this._leftButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this._rightButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(o,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const r=this._inlineButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(r,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(o=>o instanceof ZA)??[];this.ui.inputBox.toggles=n}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,aa(this.ui.message),GEt(i,this.ui.message,{callback:n=>{this.ui.linkOpenerDelegate(n)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?g(5276,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Xe.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};dse.noPromptMessage=g(5275,"Press 'Enter' to confirm your input or 'Escape' to cancel");let iW=dse;const hse=class hse extends iW{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new I),this.onWillAcceptEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Hf.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new I),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new I),this.onDidTriggerItemButtonEmitter=this._register(new I),this.onDidTriggerSeparatorButtonEmitter=this._register(new I),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new F7,this.type=tW.QuickPick,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidCustom=this.onDidCustomEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?BEt:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}inputHasFocus(){return this.visible?this.ui.inputBox.hasFocus():!1}focusOnInput(){this.ui.inputBox.setFocus()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}get hideCountBadge(){return!!this._hideCountBadge}set hideCountBadge(e){this._hideCountBadge=e,this.update()}get hideCheckAll(){return!!this._hideCheckAll}set hideCheckAll(e){this._hideCheckAll=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(wo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&is(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&is(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(hTe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&is(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return ue(this.ui.container,ke.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new En(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===S.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===S.Alt||a[0].ctrlKey&&i===S.Ctrl||a[0].metaKey&&i===S.Meta)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder||hse.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case Hf.NONE:this._itemActivation=Hf.FIRST;break;case Hf.SECOND:this.ui.list.focus(wo.Second),this._itemActivation=Hf.FIRST;break;case Hf.LAST:this.ui.list.focus(wo.Last),this._itemActivation=Hf.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(wo.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};hse.DEFAULT_ARIA_LABEL=g(5277,"Type to narrow down results.");let uF=hse,JEt=class extends iW{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.type=tW.InputBox,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?g(5278,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):iW.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}};class XEt extends iW{constructor(){super(...arguments),this.type=tW.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let E_e=class extends xM{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Yr(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};E_e=D([_(0,Te),_(1,ec)],E_e);var ZEt=".monaco-text-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-radius:2px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;line-height:18px;padding:4px;text-align:center;width:100%}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{cursor:default;opacity:.4!important}.monaco-text-button .codicon{color:inherit!important;margin:0 .2em}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;height:28px;overflow:hidden;padding:0 4px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;overflow:hidden;width:0}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{align-items:center;display:flex;font-style:inherit;font-weight:400;justify-content:center;padding:4px 0}.monaco-button-dropdown{cursor:pointer;display:flex}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator,.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{cursor:default;padding:4px 0}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{align-items:center;display:flex;flex-direction:column;margin:4px 5px}.monaco-description-button .monaco-button-description{font-size:11px;font-style:italic;padding:4px 20px}.monaco-description-button .monaco-button-description,.monaco-description-button .monaco-button-label{align-items:center;display:flex;justify-content:center}.monaco-description-button .monaco-button-description>.codicon,.monaco-description-button .monaco-button-label>.codicon{color:inherit!important;margin:0 .2em}.monaco-button-dropdown.default-colors>.monaco-button,.monaco-button.default-colors{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}.monaco-button-dropdown.default-colors>.monaco-button:hover,.monaco-button.default-colors:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary,.monaco-button.default-colors.secondary{background-color:var(--vscode-button-secondaryBackground);color:var(--vscode-button-secondaryForeground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover,.monaco-button.default-colors.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-bottom:1px solid var(--vscode-button-border);border-top:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}";ut(ZEt,{});me.white.toString(),me.white.toString();class Jd extends V{get onDidClick(){return this._onDidClick.event}get onDidEscape(){return this._onDidEscape.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new I),this._onDidEscape=this._register(new I),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(fd.addTarget(this._element)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this._element,o,r=>{if(!this.enabled){en.stop(r);return}this._onDidClick.fire(r)}))}),this._register(ue(this._element,ke.KEY_DOWN,o=>{const r=new En(o);let a=!1;this.enabled&&(r.equals(S.Enter)||r.equals(S.Space))?(this._onDidClick.fire(o),a=!0):r.equals(S.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&en.stop(r,!0)})),this._register(ue(this._element,ke.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ue(this._element,ke.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ac(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Eb(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||dd(this._label)&&dd(e)&&_Ct(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(dd(e)){const n=f6(e,{inline:!0});n.dispose();const o=n.element.querySelector("p")?.innerHTML;if(o){const r=OGe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else aa(t)}else this.options.supportIcons?aa(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=tje(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set labelShort(e){!this.options.supportShortLabel||!this._labelShortElement||(this.options.supportIcons?aa(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...We.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(Sm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return av(this._element)}}class ext extends V{constructor(e,t){super(),this._onDidClick=this._register(new I),this.onDidClick=this._onDidClick.event,this.element=document.createElement("div"),this.element.classList.add("monaco-button-dropdown"),e.appendChild(this.element),this.button=this._register(new Jd(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new rn("primaryAction",tje(this.button.label),void 0,!0,async()=>this._onDidClick.fire(void 0))),this.separatorContainer=document.createElement("div"),this.separatorContainer.classList.add("monaco-button-dropdown-separator"),this.separator=document.createElement("div"),this.separatorContainer.appendChild(this.separator),this.element.appendChild(this.separatorContainer);const i=t.buttonBorder;i&&(this.separatorContainer.style.borderTop="1px solid "+i,this.separatorContainer.style.borderBottom="1px solid "+i);const n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=n??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new Jd(this.element,{...t,title:!1,supportIcons:!0})),this._register(Sm().setupManagedHover(Pr("mouse"),this.dropdownButton.element,g(8811,"More Actions..."))),this.dropdownButton.element.setAttribute("aria-haspopup","true"),this.dropdownButton.element.setAttribute("aria-expanded","false"),this.dropdownButton.element.classList.add("monaco-dropdown-button"),this.dropdownButton.icon=ve.dropDownButton,this._register(this.dropdownButton.onDidClick(o=>{const r=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...r]:[this.action,...r],actionRunner:t.actionRunner,onHide:()=>this.dropdownButton.element.setAttribute("aria-expanded","false")}),this.dropdownButton.element.setAttribute("aria-expanded","true")}))}dispose(){super.dispose(),this.element.remove()}set label(e){this.button.label=e,this.action.label=e}set icon(e){this.button.icon=e}set enabled(e){this.button.enabled=e,this.dropdownButton.enabled=e,this.element.classList.toggle("disabled",!e)}get enabled(){return this.button.enabled}focus(){this.button.focus()}hasFocus(){return this.button.hasFocus()||this.dropdownButton.hasFocus()}}class txt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Jd(this._element,t),this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("monaco-button-description"),this._element.appendChild(this._descriptionElement),e.appendChild(this._element)}get onDidClick(){return this._button.onDidClick}get element(){return this._element}set label(e){this._button.label=e}set icon(e){this._button.icon=e}get enabled(){return this._button.enabled}set enabled(e){this._button.enabled=e}focus(){this._button.focus()}hasFocus(){return this._button.hasFocus()}dispose(){this._button.dispose()}set description(e){this.options.supportIcons?aa(this._descriptionElement,...Eb(e)):this._descriptionElement.textContent=e}}class ixt{constructor(e){this.container=e,this._buttons=[],this._buttonStore=new Z}dispose(){this._buttonStore.dispose()}get buttons(){return this._buttons}clear(){this._buttonStore.clear(),this._buttons.length=0}addButton(e){const t=this._buttonStore.add(new Jd(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new txt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new ext(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(ue(e.element,ke.KEY_DOWN,i=>{const n=new En(i);let o=!0,r;n.equals(S.LeftArrow)?r=t>0?t-1:this._buttons.length-1:n.equals(S.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),en.stop(i,!0))}))}}var nxt=".monaco-count-badge{border-radius:11px;box-sizing:border-box;display:inline-block;font-size:11px;font-weight:400;line-height:11px;min-height:18px;min-width:18px;padding:3px 6px;text-align:center}.monaco-count-badge.long{border-radius:2px;line-height:normal;min-height:auto;padding:2px 3px}";ut(nxt,{});class x_e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=re(e,fe(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setCountFormat(e){this.countFormat=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=$p(this.countFormat,this.count),this.element.title=$p(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const sxt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let oxt=sxt;function rxt(s,e){return oxt()}var axt=".monaco-progress-container{height:2px;overflow:hidden;width:100%}.monaco-progress-container .progress-bit{display:none;height:2px;left:0;position:absolute;width:2%}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-duration:4s;animation-iteration-count:infinite;animation-name:progress;animation-timing-function:linear;transform:translateZ(0)}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translateX(0) scaleX(1)}50%{transform:translateX(2500%) scaleX(3)}to{transform:translateX(4900%) scaleX(1)}}";ut(axt,{});const Dhe="done",khe="active",nK="infinite",sK="infinite-long-running",Ihe="discrete",Wz=class Wz extends V{constructor(e,t){super(),this.progressSignal=this._register(new wn),this.workedVal=0,this.showDelayedScheduler=this._register(new cn(()=>Yh(this.element),0)),this.longRunningScheduler=this._register(new cn(()=>this.infiniteLongRunning(),Wz.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(khe,nK,sK,Ihe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}done(){return this.doDone(!0)}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Dhe),this.element.classList.contains(nK)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Ihe,Dhe,sK),this.element.classList.add(khe,nK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(sK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return lc(this.totalWork)}worked(e){return e=Math.max(1,Number(e)),this.doSetWorked(this.workedVal+e)}setWorked(e){return e=Math.max(1,Number(e)),this.doSetWorked(e)}doSetWorked(e){const t=this.totalWork||100;return this.workedVal=e,this.workedVal=Math.min(t,this.workedVal),this.element.classList.remove(nK,sK,Dhe),this.element.classList.add(khe,Ihe),this.element.setAttribute("aria-valuenow",e.toString()),this.bit.style.width=100*(this.workedVal/t)+"%",this}getContainer(){return this.element}show(e){this.showDelayedScheduler.cancel(),this.progressSignal.value=rxt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Yh(this.element)}hide(){zd(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};Wz.LONG_RUNNING_INFINITE_THRESHOLD=1e4,Wz.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let nJ=Wz;const cxt=g(9871,"Match Case"),lxt=g(9872,"Match Whole Word"),dxt=g(9873,"Use Regular Expression");class Jje extends ZA{constructor(e){super({icon:ve.caseSensitive,title:cxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Xje extends ZA{constructor(e){super({icon:ve.wholeWord,title:lxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Zje extends ZA{constructor(e){super({icon:ve.regex,title:dxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class hxt{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class uxt{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isFirst(){return this._currentPosition()===0}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}clear(){this._initialize([]),this._onChange()}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new hxt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}class J2e{get size(){return this._size}constructor(e,t=10,i=n=>n){if(this.capacity=t,this.identityFn=i,e.length<1)throw new Error("not supported");this._size=1,this.head=this.tail=this.cursor={value:e[0],previous:void 0,next:void 0},this.valueSet=new Lrt([e[0]],i);for(let n=1;nthis.capacity;)this.valueSet.delete(this.head.value),this.head=this.head.next,this.head.previous=void 0,this._size--}replaceLast(e){if(this.identityFn(this.tail.value)===this.identityFn(e))return e;const t=this.tail.value;return this.valueSet.delete(t),this.tail.value=e,this.valueSet.has(e)?this._deleteFromList(e):this.valueSet.add(e),t}prepend(e){if(this._size===this.capacity||this.valueSet.has(e))return;const t={value:e,previous:void 0,next:this.head};this.head.previous=t,this.head=t,this._size++,this.valueSet.add(e)}isAtEnd(){return this.cursor===this.tail}current(){return this.cursor.value}previous(){return this.cursor.previous&&(this.cursor=this.cursor.previous),this.cursor.value}next(){return this.cursor.next&&(this.cursor=this.cursor.next),this.cursor.value}has(e){return this.valueSet.has(e)}resetCursor(){return this.cursor=this.tail,this.cursor.value}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}_deleteFromList(e){let t=this.head;const i=this.identityFn(e);for(;t!==this.tail;)this.identityFn(t.value)===i&&(t===this.head?(this.head=this.head.next,this.head.previous=void 0):(t.previous.next=t.next,t.next.previous=t.previous),this._size--),t=t.next}}var gxt=".monaco-inputbox{border-radius:2px;box-sizing:border-box;display:block;font-size:inherit;padding:0;position:relative}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{height:100%;position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{border:none;box-sizing:border-box;color:inherit;display:inline-block;font-family:inherit;font-size:inherit;height:100%;line-height:inherit;resize:none;width:100%}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;outline:none;scrollbar-width:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{word-wrap:break-word;box-sizing:border-box;display:inline-block;left:0;position:absolute;top:0;visibility:hidden;white-space:pre-wrap;width:100%}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-top:-1px;overflow:hidden;padding:.4em;text-align:left;width:100%}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;height:16px;width:16px}";ut(gxt,{});const m4=fe;var Xl;(function(s){s[s.INFO=1]="INFO",s[s.WARNING=2]="WARNING",s[s.ERROR=3]="ERROR"})(Xl||(Xl={}));const fxt={inputBackground:"#3C3C3C",inputForeground:"#CCCCCC",inputValidationInfoBorder:"#55AAFF",inputValidationInfoBackground:"#063B49",inputValidationWarningBorder:"#B89500",inputValidationWarningBackground:"#352A05",inputValidationErrorBorder:"#BE1100",inputValidationErrorBackground:"#5A1D1D",inputBorder:void 0,inputValidationErrorForeground:void 0,inputValidationInfoForeground:void 0,inputValidationWarningForeground:void 0};class eYe extends pd{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new I),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=re(e,m4(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",o=re(this.element,m4(".ibwrapper"));if(this.input=re(o,m4(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=re(o,m4("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Cqe(this.element,{vertical:Co.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),re(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new ii(e.ownerDocument,"selectionchange")),a=M.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===o);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new hd(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(Sm().setupManagedHover(Pr("mouse"),this.input,e))}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get mirrorElement(){return this.mirror}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get step(){return this.input.step}set step(e){this.input.step=e}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:fb(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return av(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}setEnabled(e){e?this.enable():this.disable()}get width(){return Pd(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,n=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+n}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Ys(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Iy(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}isInputValid(){return!!this.validation&&!this.validation(this.value)}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case Xl.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Xl.WARNING:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case Xl.INFO:return"info";case Xl.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Pd(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:vb.RIGHT,render:n=>{if(!this.message)return null;e=re(n,m4(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?ALe(this.message.content,o):Gyt(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background??"",r.style.color=a.foreground??"",r.style.border=a.border?`1px solid ${a.border}`:"",re(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Xl.ERROR?i=g(9834,"Error: {0}",this.message.content):this.message.type===Xl.WARNING?i=g(9835,"Warning: {0}",this.message.content):i=g(9836,"Info: {0}",this.message.content),Mr(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${Iy(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=fb(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class qLe extends eYe{constructor(e,t,i){const n=g(9837," or {0} for history","⇅"),o=g(9838," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this.history=new uxt(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!av(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=c=>{if(this.placeholder.endsWith(c)){const l=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=l:this.setPlaceHolder(l),!0}else return!1};a(o)||a(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}prependHistory(e){const t=this.getHistory();this.clearHistory(),e.forEach(i=>{this.history.add(i)}),t.forEach(i=>{this.history.add(i)})}getHistory(){return this.history.getHistory()}isAtFirstInHistory(){return this.history.isFirst()}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Ah(this.value?this.value:g(9839,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Ah(this.value))}clearHistory(){this.history.clear()}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var pxt=".monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.hc-light .monaco-findInput.highlight-0 .controls,.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.hc-light .monaco-findInput.highlight-1 .controls,.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}";ut(pxt,{});const mxt=g(9833,"input"),iFe=class iFe extends pd{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new wn),this.additionalToggles=[],this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCaseSensitiveKeyDown=this._register(new I),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new I),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||mxt,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],c=!!i.flexibleHeight,l=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qLe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:c,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const h=this._register($k());if(this.showCommonFindToggles){this.regex=this._register(new Zje({appendTitle:r,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new Xje({appendTitle:o,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new Jje({appendTitle:n,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(S.LeftArrow)||f.equals(S.RightArrow)||f.equals(S.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(S.RightArrow)?m=(p+1)%u.length:f.equals(S.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(S.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),en.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(ue(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ue(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get isImeSessionInProgress(){return this.imeSessionInProgress}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}focusOnRegex(){this.regex?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}clearValidation(){this.inputBox.hideMessage()}};iFe.OPTION_CHANGE="optionChange";let b3=iFe;const _xt=fe;class vxt extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Ro(this.findInput.inputBox.inputElement,ke.KEY_DOWN,o),this.onMouseDown=o=>Ro(this.findInput.inputBox.inputElement,ke.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=re(this.parent,_xt(".quick-input-box")),this.findInput=this._register(new b3(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}setPlaceholder(e){this.findInput.inputBox.setPlaceHolder(e)}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Xe.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Xe.Info?Xl.INFO:e===Xe.Warning?Xl.WARNING:Xl.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Xe.Info?Xl.INFO:e===Xe.Warning?Xl.WARNING:Xl.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class bxt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:V.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const r=new ci,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class wxt{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function yxt(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new wxt(s,e.accessibilityProvider)}}class Cxt{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(c=>new bxt(c,r));this.list=new Xa(e,t,i,a,yxt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return av(this.getHTMLElement())}domFocus(){this.list.domFocus()}get onDidFocus(){return this.list.onDidFocus}get onDidBlur(){return this.list.onDidBlur}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseClick(){return M.map(this.list.onMouseClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onMouseDblClick(){return M.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onTap(){return M.map(this.list.onTap,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return M.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeFocus(){return M.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return M.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onContextMenu(){return M.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:n})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:n}:{element:this._model.get(e),index:t,anchor:i,browserEvent:n})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Au(e.length))}get length(){return this.list.length}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollLeft(){return this.list.scrollLeft}set scrollLeft(e){this.list.scrollLeft=e}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}setFocus(e){this.list.setFocus(e)}focusNext(e,t){this.list.focusNext(e,t)}focusPrevious(e,t){this.list.focusPrevious(e,t)}focusNextPage(){return this.list.focusNextPage()}focusPreviousPage(){return this.list.focusPreviousPage()}focusLast(){this.list.focusLast()}focusFirst(){this.list.focusFirst()}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}layout(e,t){this.list.layout(e,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}reveal(e,t){this.list.reveal(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Sxt=':root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}.monaco-sash{position:absolute;touch-action:none;z-index:35}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;height:100%;top:0;width:var(--vscode-sash-size)}.monaco-sash.horizontal{cursor:ns-resize;height:var(--vscode-sash-size);left:0;width:100%}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";cursor:all-scroll;display:block;height:calc(var(--vscode-sash-size)*2);position:absolute;width:calc(var(--vscode-sash-size)*2);z-index:100}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-.5);top:calc(var(--vscode-sash-size)*-1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{bottom:calc(var(--vscode-sash-size)*-1);left:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{right:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash:before{background:transparent;content:"";height:100%;pointer-events:none;position:absolute;width:100%}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.active:before,.monaco-sash.hover:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{left:calc(50% - var(--vscode-sash-hover-size)/2);width:var(--vscode-sash-hover-size)}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - var(--vscode-sash-hover-size)/2)}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:cyan}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}';ut(Sxt,{});const Axt=!1;var sJ;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(sJ||(sJ={}));var fi;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(fi||(fi={}));var oa;(function(s){s[s.Disabled=0]="Disabled",s[s.AtMinimum=1]="AtMinimum",s[s.AtMaximum=2]="AtMaximum",s[s.Enabled=3]="Enabled"})(oa||(oa={}));let Ext=4;const xxt=new I;let Dxt=300;const kxt=new I;class w3{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new ii(ct(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ii(ct(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}w3.__decorator=D([Zt],w3.prototype,"onPointerMove",null);w3.__decorator=D([Zt],w3.prototype,"onPointerUp",null);class y3{get onPointerMove(){return this.disposables.add(new ii(this.el,uo.Change)).event}get onPointerUp(){return this.disposables.add(new ii(this.el,uo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}y3.__decorator=D([Zt],y3.prototype,"onPointerMove",null);y3.__decorator=D([Zt],y3.prototype,"onPointerUp",null);class nW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}nW.__decorator=D([Zt],nW.prototype,"onPointerMove",null);nW.__decorator=D([Zt],nW.prototype,"onPointerUp",null);const X2e="pointer-events-disabled";class Od extends V{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===oa.Disabled),this.el.classList.toggle("minimum",e===oa.AtMinimum),this.el.classList.toggle("maximum",e===oa.AtMaximum),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==oa.Disabled&&(this._orthogonalStartDragHandle=re(this.el,fe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Od.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Od.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==oa.Disabled&&(this._orthogonalEndDragHandle=re(this.el,fe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Od.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Od.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=Dxt,this.hoverDelayer=this._register(new Mh(this.hoverDelay)),this._state=oa.Enabled,this.onDidEnablementChange=this._register(new I),this._onDidStart=this._register(new I),this._onDidChange=this._register(new I),this._onDidReset=this._register(new I),this._onDidEnd=this._register(new I),this.orthogonalStartSashDisposables=this._register(new Z),this.orthogonalStartDragHandleDisposables=this._register(new Z),this.orthogonalEndSashDisposables=this._register(new Z),this.orthogonalEndDragHandleDisposables=this._register(new Z),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=re(e,fe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Qt&&this.el.classList.add("mac");const n=this._register(new ii(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new w3(e)),this));const o=this._register(new ii(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ii(this.el,"mouseenter")).event;this._register(r(()=>Od.onMouseEnter(this)));const a=this._register(new ii(this.el,"mouseleave")).event;this._register(a(()=>Od.onMouseLeave(this))),this._register(fd.addTarget(this.el));const c=this._register(new ii(this.el,uo.Start)).event;this._register(c(h=>this.onPointerStart(h,new y3(this.el)),this));const l=this._register(new ii(this.el,uo.Tap)).event;let d;this._register(l(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===fi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Ext,this._register(xxt.event(h=>{this.size=h,this.layout()}))),this._register(kxt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||fi.VERTICAL,this.orientation===fi.HORIZONTAL?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",Axt),this.layout()}onPointerStart(e,t){en.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new nW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new nW(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of n)p.classList.add(X2e);const o=e.pageX,r=e.pageY,a=e.altKey,c={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=gl(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===fi.HORIZONTAL?this.state===oa.AtMinimum?p="s-resize":this.state===oa.AtMaximum?p="n-resize":p=Qt?"row-resize":"ns-resize":this.state===oa.AtMinimum?p="e-resize":this.state===oa.AtMaximum?p="w-resize":p=Qt?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{en.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{en.stop(p,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.classList.remove(X2e)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Od.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Od.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Od.onMouseLeave(this)}layout(){if(this.orientation===fi.VERTICAL){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!Yr(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var Ixt='.monaco-split-view2{height:100%;position:relative;width:100%}.monaco-split-view2>.sash-container{height:100%;pointer-events:none;position:absolute;width:100%}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{height:100%;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{position:absolute;white-space:normal}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{background-color:var(--separator-border);content:" ";left:0;pointer-events:none;position:absolute;top:0;z-index:5}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}';ut(Ixt,{});const Txt={separatorBorder:me.transparent};var hw;(function(s){s[s.Normal=0]="Normal",s[s.Low=1]="Low",s[s.High=2]="High"})(hw||(hw={}));class tYe{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=Ka(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class Lxt extends tYe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Rxt extends tYe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Oh;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Oh||(Oh={}));var Kk;(function(s){s.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}s.Split=e;function t(n){return{type:"auto",index:n}}s.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}s.Invisible=i})(Kk||(Kk={}));class C3 extends V{get contentSize(){return this._contentSize}get length(){return this.viewItems.length}get minimumSize(){return this.viewItems.reduce((e,t)=>e+t.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,t)=>e+t.maximumSize,0)}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get sashes(){return this.sashItems.map(e=>e.sash)}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Oh.Idle,this._onDidSashChange=this._register(new I),this._onDidSashReset=this._register(new I),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??fi.VERTICAL,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===fi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=re(this.el,fe(".sash-container")),this.viewContainer=fe(".split-view-container"),this.scrollable=this._register(new yN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ll(ct(this.el),n)})),this.scrollableElement=this._register(new l6(this.viewContainer,{vertical:this.orientation===fi.VERTICAL?t.scrollbarVisibility??Co.Auto:Co.Hidden,horizontal:this.orientation===fi.HORIZONTAL?t.scrollbarVisibility??Co.Auto:Co.Hidden},this.scrollable));const i=this._register(new ii(this.viewContainer,"scroll")).event;this._register(i(n=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(n=>{n.scrollTopChanged&&(this.viewContainer.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this.viewContainer.scrollLeft=n.scrollLeft)})),re(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Txt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,o)=>{const r=Ya(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((n,o)=>n+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{t?.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index});const i=t?.type==="split"?this.viewItems[t.index]:void 0,n=this.viewItems.splice(e,1)[0];if(i&&(i.size+=n.size),this.viewItems.length>=1){const r=Math.max(e-1,0);this.sashItems.splice(r,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const o=n.view;return n.dispose(),o}finally{this.state=Oh.Idle}}removeAllViews(){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{const e=this.viewItems.splice(0,this.viewItems.length);for(const i of e)i.dispose();const t=this.sashItems.splice(0,this.sashItems.length);for(const i of t)i.disposable.dispose();return this.relayout(),e.map(i=>i.view)}finally{this.state=Oh.Idle}}moveView(e,t){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),n=typeof i>"u"?this.getViewSize(e):Kk.Invisible(i),o=this.removeView(e);this.addView(o,n,t)}swapViews(e,t){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),n=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,n,t)}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[e].setVisible(t),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let n=0;for(let o=0;o0&&(r.size=Ka(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=Au(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.High);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const n=this.sashItems.findIndex(a=>a.sash===e),o=jr(ue(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),ue(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,c)=>{const l=this.viewItems.map(p=>p.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(n===this.sashItems.length-1){const m=this.viewItems[n];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Au(n,-1),m=Au(n+1,this.viewItems.length),v=p.reduce((P,R)=>P+(this.viewItems[R].minimumSize-l[R]),0),b=p.reduce((P,R)=>P+(this.viewItems[R].viewMaximumSize-l[R]),0),w=m.length===0?Number.POSITIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].viewMaximumSize),0),C=Math.max(v,y),A=Math.min(w,b),L=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof L=="number"){const P=this.viewItems[L],R=Math.floor(P.viewMinimumSize/2);u={index:L,limitDelta:P.visible?C-R:C+R,size:P.size}}if(typeof k=="number"){const P=this.viewItems[k],R=Math.floor(P.viewMinimumSize/2);f={index:k,limitDelta:P.visible?A+R:A-R,size:P.size}}}this.sashDragState={start:a,current:a,index:n,sizes:l,minDelta:d,maxDelta:h,alt:c,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:r,maxDelta:a,snapBefore:c,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,b=m.size-m.minimumSize,w=u?t-1:t+1;this.resize(w,-h,f,void 0,void 0,v,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Ka(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{const i=Au(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===hw.Low),e],o=i.filter(a=>this.viewItems[a].priority===hw.High),r=this.viewItems[e];t=Math.round(t),t=Ka(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o)}finally{this.state=Oh.Idle}}}isViewExpanded(e){if(e<0||e>=this.viewItems.length)return!1;for(const t of this.viewItems)if(t!==this.viewItems[e]&&t.size>t.minimumSize)return!1;return!0}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Ka(i,a.minimumSize,a.maximumSize);const n=Au(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.High);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{const o=fe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>o.remove()),c=jr(r,a);let l;typeof t=="number"?l=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?l=this.getViewSize(t.index)/2:t.type==="invisible"?l={cachedVisibleSize:t.cachedVisibleSize}:l=e.minimumSize);const d=this.orientation===fi.VERTICAL?new Lxt(o,e,l,c):new Rxt(o,e,l,c);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===fi.VERTICAL?new Od(this.sashContainer,{getHorizontalSashTop:P=>this.getSashPosition(P),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:fi.HORIZONTAL}):new Od(this.sashContainer,{getVerticalSashLeft:P=>this.getSashPosition(P),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:fi.VERTICAL}),p=this.orientation===fi.VERTICAL?P=>({sash:f,start:P.startY,current:P.currentY,alt:P.altKey}):P=>({sash:f,start:P.startX,current:P.currentX,alt:P.altKey}),v=M.map(f.onDidStart,p)(this.onSashStart,this),w=M.map(f.onDidChange,p)(this.onSashChange,this),C=M.map(f.onDidEnd,()=>this.sashItems.findIndex(P=>P.sash===f))(this.onSashEnd,this),A=f.onDidReset(()=>{const P=this.sashItems.findIndex(j=>j.sash===f),R=Au(P,-1),z=Au(P+1,this.viewItems.length),G=this.findFirstSnapIndex(R),Y=this.findFirstSnapIndex(z);typeof G=="number"&&!this.viewItems[G].visible||typeof Y=="number"&&!this.viewItems[Y].visible||this._onDidSashReset.fire(P)}),L=jr(v,w,C,A,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Oh.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Au(e,-1),h=Au(e+1,this.viewItems.length);if(o)for(const k of o)fde(d,k),fde(h,k);if(n)for(const k of n)vG(d,k),vG(h,k);const u=d.map(k=>this.viewItems[k]),f=d.map(k=>i[k]),p=h.map(k=>this.viewItems[k]),m=h.map(k=>i[k]),v=d.reduce((k,P)=>k+(this.viewItems[P].minimumSize-i[P]),0),b=d.reduce((k,P)=>k+(this.viewItems[P].maximumSize-i[P]),0),w=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].minimumSize),0),y=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].maximumSize),0),C=Math.max(v,y,r),A=Math.min(w,b,a);let L=!1;if(c){const k=this.viewItems[c.index],P=t>=c.limitDelta;L=P!==k.visible,k.setVisible(P,c.size)}if(!L&&l){const k=this.viewItems[l.index],P=ta+c.size,0);let i=this.size-t;const n=Au(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.High);for(const a of r)fde(n,a);for(const a of o)vG(n,a);typeof e=="number"&&vG(n,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===fi.VERTICAL?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const i=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),n=[...this.viewItems].reverse();e=!1;const o=n.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=n.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=oa.AtMinimum:w&&t[c]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),bt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Mxt='.monaco-table{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;white-space:nowrap;width:100%}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{font-weight:700;height:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.monaco-table-td,.monaco-table-th{box-sizing:border-box;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{border-left:1px solid transparent;content:"";left:calc(var(--vscode-sash-size)/2);position:absolute;width:0}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}';ut(Mxt,{});const use=class use{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=use.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=re(e,fe(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new Pxt(d,h))),c={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new C3(this.domNode,{orientation:fi.HORIZONTAL,scrollbarVisibility:Co.Hidden,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new oJ(n,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Xa(e,this.domNode,Nxt(i),[l],r)),M.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=n.reduce((f,p)=>f+p.weight,0),u=n[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=gl(this.domNode),this.style(tEt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}rerender(){this.list.rerender()}row(e){return this.list.element(e)}indexOf(e){return this.list.indexOf(e)}get length(){return this.list.length}getHTMLElement(){return this.domNode}layout(e,t){e=e??cTe(this.domNode),t=t??ZV(this.domNode),this.cachedWidth=t,this.cachedHeight=e,this.splitview.layout(t);const i=e-this.virtualDelegate.headerRowHeight;this.list.getHTMLElement().style.height=`${i}px`,this.list.layout(i,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}domFocus(){this.list.domFocus()}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}getSelectedElements(){return this.list.getSelectedElements()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}setFocus(e,t){this.list.setFocus(e,t)}focusNext(e=1,t=!1,i){this.list.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.list.focusPrevious(e,t,i)}focusNextPage(e){return this.list.focusNextPage(e)}focusPreviousPage(e){return this.list.focusPreviousPage(e)}focusFirst(e){this.list.focusFirst(e)}focusLast(e){this.list.focusLast(e)}getFocus(){return this.list.getFocus()}getFocusedElements(){return this.list.getFocusedElements()}getRelativeTop(e){return this.list.getRelativeTop(e)}reveal(e,t){this.list.reveal(e,t)}dispose(){this.disposables.dispose()}};Tae.InstanceCount=0;let Hbe=Tae;var so;(function(n){n[n.Hidden=0]="Hidden",n[n.Visible=1]="Visible",n[n.Recurse=2]="Recurse"})(so||(so={}));var Up;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Up||(Up={}));var bR;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(bR||(bR={}));var CR;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(CR||(CR={}));class Jd extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class PNe{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function FNe(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function D7(n){switch(n){case!0:return so.Visible;case!1:return so.Hidden;default:return n}}function zfe(n){return typeof n.collapsible=="boolean"}class $kt{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ole,this._onDidChangeCollapseState=new I,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new I,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new I,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Lu(YQe),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.allowNonCollapsibleParents=s.allowNonCollapsibleParents??!1,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:so.Visible,visible:!0,filterData:void 0}}splice(e,t,i=fi.empty(),s={}){if(e.length===0)throw new Jd(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=fi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],l=t[t.length-1],d=new wy({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,l),...c,...a.children.slice(l+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),u=(m,v,w)=>{if(r>0)for(let b=0;bw.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,fi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=fi.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=fi.map(i,S=>this.createTreeNode(S,a,a.visible?so.Visible:so.Hidden,l,h,s)),f=e[e.length-1];let p=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let C=0;for(const S of b)S.visible&&C++;if(C!==0)for(let S=f+m.length;SM+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,w-S),this.list.splice(c,S,h)}if(b.length>0&&o){const S=M=>{o(M),M.children.forEach(S)};b.forEach(S)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let y=a;for(;y;){if(y.visibility===so.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}y=y.parent}}rerender(e){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{listIndex:i}=this.getTreeNodeWithListIndex(e);this.list.updateElementHeight(i,t)}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!zfe(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let c=0;c-1){a=-1;break}else a=c;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=r-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(zfe(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!zfe(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:so.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,s&&o.push(a);const l=e.children||fi.empty(),d=s&&c!==so.Hidden&&!a.collapsed;let h=0,u=1;for(const f of l){const p=this.createTreeNode(f,a,c,d,o,r);a.children.push(p),u+=p.renderNodeCount,p.visible&&(p.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=c===so.Recurse?h>0:c===so.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,s&&o.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?so.Visible:so.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===so.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==so.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,s&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===so.Recurse?a:o===so.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):so.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?so.Visible:so.Hidden):FNe(i)?(e.filterData=i.data,D7(i.visibility)):(e.filterData=void 0,D7(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Jd(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function $fe(n){return n instanceof vQ?new qkt(n):n}class Qkt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=$.None,this.disposables=new Z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.($fe(e),t)}onDragOver(e,t,i,s,o,r=!0){const a=this.dnd.onDragOver($fe(e),t&&t.element,i,s,o),c=this.autoExpandNode!==t;if(c&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(c&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=PS(()=>{const f=this.modelProvider(),p=f.getNodeLocation(t);f.isCollapsed(p)&&f.setCollapsed(p,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,p=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:p,feedback:[i]}}return a}if(a.bubble===CR.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),w=m&&f.getListIndex(m);return this.onDragOver(e,v,w,s,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Mg(h,h+u)}}drop(e,t,i,s,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop($fe(e),t&&t.element,i,s,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function jkt(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Qkt(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class ONe{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}class O${static lift(e){return e instanceof O$?e:new O$(e)}static empty(e=0){return new O$({focus:[],selection:[],expanded:Object.create(null),scrollTop:e})}constructor(e){if(this.focus=new Set(e.focus),this.selection=new Set(e.selection),e.expanded instanceof Array){this.expanded=Object.create(null);for(const t of e.expanded)this.expanded[t]=1}else this.expanded=e.expanded;this.expanded=e.expanded,this.scrollTop=e.scrollTop}toJSON(){return{focus:Array.from(this.focus),selection:Array.from(this.selection),expanded:this.expanded,scrollTop:this.scrollTop}}}var rV;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(rV||(rV={}));class Kkt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=T.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Y8=class Y8{constructor(e,t,i,s,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Y8.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=$.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),T.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=kc(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==rV.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new Z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=he(e,we(".monaco-tl-row")),i=he(t,we(".monaco-tl-indent")),s=he(t,we(".monaco-tl-twistie")),o=he(t,we(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:$.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Y8.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...$e.asClassNameArray(Ce.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...$e.asClassNameArray(Ce.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Yo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),c=we(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&c.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(c):t.indent.insertBefore(c,t.indent.firstElementChild),this.renderedIndentGuides.add(a,c),i.add(Ee(()=>this.renderedIndentGuides.delete(a,c))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),St(this.disposables)}};Y8.DefaultIndent=8;let Ube=Y8;class Ykt{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Z,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=so.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?so.Visible:so.Hidden:FNe(r)?i=D7(r.visibility):i=r,i===so.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:sw.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:sw.Default,visibility:i};let c;if(this.tree.findMatchType===Bb.Contiguous){const l=a.toLowerCase().indexOf(this._lowercasePattern);if(l>-1){c=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)c.push(l+d-1)}}else c=v1(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,o.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===am.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):so.Recurse:{data:sw.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){St(this.disposables)}}class Jkt extends iD{constructor(e){super({icon:Ce.listFilter,title:g(yR,0,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Xkt extends iD{constructor(e){super({icon:Ce.searchFuzzy,title:g(yR,1,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Zkt={inputBoxStyles:Ckt,toggleStyles:rXe,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var am;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(am||(am={}));var Bb;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Bb||(Bb={}));let eIt=class extends ${set mode(e){this.modeToggle.checked=e===am.Filter,this.findInput.inputBox.setPlaceHolder(e===am.Filter?g(yR,2,"Type to filter"):g(yR,3,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===Bb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,s,o,r){super(),this.tree=t,this.elements=di(".monaco-tree-type-filter",[di(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),di(".monaco-tree-type-filter-input@findInput"),di(".monaco-tree-type-filter-actionbar@actionbar")]),this.width=0,this.right=0,this.top=0,this._onDidDisable=new I,this.onDidDisable=this._onDidDisable.event,e.appendChild(this.elements.root),this._register(Ee(()=>e.removeChild(this.elements.root)));const a=r?.styles??Zkt;a.listFilterWidgetBackground&&(this.elements.root.style.backgroundColor=a.listFilterWidgetBackground),a.listFilterWidgetShadow&&(this.elements.root.style.boxShadow=`0 0 8px 2px ${a.listFilterWidgetShadow}`);const c=this._register(C1());this.modeToggle=this._register(new Jkt({...a.toggleStyles,isChecked:s===am.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new Xkt({...a.toggleStyles,isChecked:o===Bb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=T.map(this.modeToggle.onChange,()=>this.modeToggle.checked?am.Filter:am.Highlight,this._store),this.onDidChangeMatchType=T.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?Bb.Fuzzy:Bb.Contiguous,this._store),this.findInput=this._register(new S7(this.elements.findInput,i,{label:g(yR,3,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new Qh(this.elements.actionbar)),this.mode=s;const l=this._register(new oi(this.findInput.inputBox.inputElement,"keydown")),d=T.chain(l.event,p=>p.map(m=>new os(m)));this._register(d(p=>{if(p.equals(E.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(E.DownArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.isAtLastInHistory()||this.findInput.inputBox.isNowhereInHistory()?(this.findInput.inputBox.addToHistory(),this.tree.domFocus()):this.findInput.inputBox.showNextValue();return}if(p.equals(E.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new xn("close",g(yR,4,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new oi(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new oi(gt(p),"mousemove")),w=m.add(new oi(gt(p),"mouseup")),b=this.right,C=p.pageX,y=this.top,S=p.pageY;this.elements.grab.classList.add("grabbing");const M=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=F=>{const N=F.pageX-C;this.right=b-N;const z=F.pageY-S;this.top=y+z,this.layout()};m.add(v.event(k)),m.add(w.event(F=>{k(F),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=M,m.dispose()}))}));const f=T.chain(this._register(new oi(this.elements.grab,"keydown")).event,p=>p.map(m=>new os(m)));this._register(f(p=>{let m,v;if(p.keyCode===E.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===E.RightArrow?m=0:p.keyCode===E.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===E.UpArrow?v=0:p.keyCode===E.DownArrow&&(v=Number.POSITIVE_INFINITY),m!==void 0&&(p.preventDefault(),p.stopPropagation(),this.right=m,this.layout()),v!==void 0){p.preventDefault(),p.stopPropagation(),this.top=v;const w=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=w},0)}})),this.onDidChangeValue=this.findInput.onDidChange}getHistory(){return this.findInput.inputBox.getHistory()}focus(){this.findInput.focus()}select(){this.findInput.select(),this.findInput.inputBox.addToHistory(!0)}layout(e=this.width){this.width=e,this.right=kc(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=kc(this.top,0,24),this.elements.root.style.top=`${this.top}px`}showMessage(e){this.findInput.showMessage(e)}clearMessage(){this.findInput.clearMessage()}async dispose(){this._onDidDisable.fire(),this.elements.root.classList.add("disabled"),await Ta(300),super.dispose()}},tIt=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.previousPattern="",this.width=0,this._onDidChangeMode=new I,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new I,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new I,this.onDidChangePattern=this._onDidChangePattern.event,this._onDidChangeOpenState=new I,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Z,this.disposables=new Z,this._mode=e.options.defaultFindMode??am.Highlight,this._matchType=e.options.defaultFindMatchType??Bb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}open(){if(this.widget){this.widget.focus(),this.widget.select();return}this.widget=new eIt(this.view.getHTMLElement(),this.tree,this.contextViewProvider,this.mode,this.matchType,{...this.options,history:this._history}),this.enabledDisposables.add(this.widget),this.widget.onDidChangeValue(this.onDidChangeValue,this,this.enabledDisposables),this.widget.onDidChangeMode(e=>this.mode=e,void 0,this.enabledDisposables),this.widget.onDidChangeMatchType(e=>this.matchType=e,void 0,this.enabledDisposables),this.widget.onDidDisable(this.close,this,this.enabledDisposables),this.widget.layout(this.width),this.widget.focus(),this.widget.value=this.previousPattern,this.widget.select(),this._onDidChangeOpenState.fire(!0)}close(){this.widget&&(this._history=this.widget.getHistory(),this.widget=void 0,this.enabledDisposables.clear(),this.previousPattern=this.pattern,this.onDidChangeValue(""),this.tree.domFocus(),this._onDidChangeOpenState.fire(!1))}onDidChangeValue(e){this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,i=>!sw.isDefault(i.filterData));const t=this.tree.getFocus();if(t.length>0){const i=t[0];this.tree.getRelativeTop(i)===null&&this.tree.reveal(i,.5)}this.render()}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:Yd.WARNING,content:g(yR,5,"No elements found.")}):this.widget?.showMessage({type:Yd.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!sw.isDefault(e.filterData)}layout(e){this.width=e,this.widget?.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function iIt(n,e){return n.position===e.position&&mXe(n,e)}function mXe(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class nIt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ls(this.stickyNodes,e.stickyNodes,iIt)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Ls(this.stickyNodes,e.stickyNodes,mXe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class sIt{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let bUe=class extends ${constructor(e,t,i,s,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new sIt,this._widget=this._register(new oIt(i.getScrollableElement(),i,e,s,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}get count(){return this._widget.count}getNode(e){return this._widget.getNode(e)}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,o=this.getNextStickyNode(i,void 0,s);for(;o&&(t.push(o),s+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,s);const r=this.constrainStickyNodes(t);return r.length?new nIt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),o=t;return this.view.scrollTop===s-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:s,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1c&&t<=c?c-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const o=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),o=i+s-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let o=0;ot.node===e)}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${s.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:c,disposable:l}=this.createElement(a,r,e.count);o[r]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}createElement(e,t,i){const s=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${s}`),o.setAttribute("data-parity",s%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(s));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),c=this.treeRenderers.find(u=>u.templateId===a);if(!c)throw new Error(`No renderer found for template id ${a}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=c.renderTemplate(o);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{r.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return $.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:Au(o),a=Ni(l=>{const d=l.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}getFocus(){return this.stickyScrollFocus.getFocus()}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class rIt extends ${get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new I,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new I,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){this.focusedLast()&&this.view.domFocus();return}if(!Sv(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!w7(t)&&!F$(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=kc(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=s?s.position+s.height+i.height:i.height;this.view.scrollTop=o-r}getFocus(){if(!(!this.state||this.focusedIndex===-1))return this.state.stickyNodes[this.focusedIndex].node.element}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function QO(n){let e=bR.Unknown;return GY(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=bR.Twistie:GY(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=bR.Element:GY(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=bR.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function aIt(n){const e=w7(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function vJ(n,e){e(n),n.children.forEach(t=>vJ(t,e))}class Gfe{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Ls(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const c=this.createNodeSet(),l=d=>c.delete(d);t.forEach(d=>vJ(d,l)),this.set([...c.values()]);return}const i=new Set,s=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>vJ(c,s));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>vJ(c,r));const a=[];for(const c of this.nodes){const l=this.identityProvider.getId(c.element).toString();if(!i.has(l))a.push(c);else{const h=o.get(l);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const c=this.getFirstViewElementWithTrait();c&&a.push(c)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class cIt extends qJe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(zJe(e.browserEvent.target)||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=F$(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||s)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),s){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Jxt(e.browserEvent.target)||Xxt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),o=this.list.getElementTop(s),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onContextMenu(e);return}}}class lIt extends Fc{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new cIt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&s.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),s.length>0&&super.setFocus(Tc([...super.getFocus(),...s])),o.length>0&&super.setSelection(Tc([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var aV;(function(n){n[n.Tree=0]="Tree",n[n.StickyScroll=1]="StickyScroll"})(aV||(aV={}));class _Xe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseClick(){return T.map(this.view.onMouseClick,QO)}get onMouseDblClick(){return T.filter(T.map(this.view.onMouseDblClick,QO),e=>e.target!==bR.Filter)}get onMouseOver(){return T.map(this.view.onMouseOver,QO)}get onMouseOut(){return T.map(this.view.onMouseOut,QO)}get onContextMenu(){return T.any(T.filter(T.map(this.view.onContextMenu,aIt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??T.None)}get onTap(){return T.map(this.view.onTap,QO)}get onPointer(){return T.map(this.view.onPointer,QO)}get onKeyDown(){return this.view.onKeyDown}get onKeyUp(){return this.view.onKeyUp}get onKeyPress(){return this.view.onKeyPress}get onDidFocus(){return this.view.onDidFocus}get onDidBlur(){return this.view.onDidBlur}get onDidChangeModel(){return T.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??am.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Bb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get onDidChangeFindPattern(){return this.findController?this.findController.onDidChangePattern:T.None}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){this._user=e,this._options=o,this.eventBufferer=new Ole,this.onDidChangeFindOpenState=T.None,this.onDidChangeStickyScrollFocused=T.None,this.disposables=new Z,this._onWillRefilter=new I,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new I,this.onDidUpdateOptions=this._onDidUpdateOptions.event,this.treeDelegate=new ONe(i);const r=new w_e,a=new w_e,c=this.disposables.add(new Kkt(a.event)),l=new Vq;this.renderers=s.map(p=>new Ube(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Ykt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new Gfe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Gfe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Gfe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new lIt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...jkt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=T.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const u=this.disposables.add(new I),f=this.disposables.add(new Lu(0));if(this.disposables.add(T.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);u.fire([...p.values()])})})),a.input=u.event,o.keyboardSupport!==!1){const p=T.chain(this.view.onKeyDown,m=>m.filter(v=>!ux(v.target)).map(v=>new os(v)));T.chain(p,m=>m.filter(v=>v.keyCode===E.LeftArrow))(this.onLeftArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.RightArrow))(this.onRightArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.Space))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new tIt(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=T.None,this.onDidChangeFindMatchType=T.None;o.enableStickyScroll&&(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=od(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=T.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}updateWidth(e){const t=this.model.getListIndex(e);t!==-1&&this.view.updateWidth(t)}getHTMLElement(){return this.view.getHTMLElement()}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollLeft(){return this.view.scrollLeft}set scrollLeft(e){this.view.scrollLeft=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleElement(){let e=this.view.firstVisibleIndex;return this.stickyScrollController&&(e+=this.stickyScrollController.count),e<0||e>=this.view.length?void 0:this.view.element(e).element}get lastVisibleElement(){const e=this.view.lastVisibleIndex;return this.view.element(e).element}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}get selectionSize(){return this.selection.getNodes().length}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}isDOMFocused(){return kw(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),Kc(t)&&this.findController?.layout(t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=hS(e.listFocusAndSelectionOutline,hS(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}expandAll(){this.model.setCollapsed(this.model.rootRef,!1,!0)}collapseAll(){this.model.setCollapsed(this.model.rootRef,!0,!0)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}expandTo(e){this.model.expandTo(e)}triggerTypeNavigation(){this.view.triggerTypeNavigation()}openFind(){this.findController?.open()}closeFind(){this.findController?.close()}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setAnchor(e){if(typeof e>"u")return this.view.setAnchor(void 0);this.eventBufferer.bufferEvents(()=>{const t=this.model.getNode(e);this.anchor.set([t]);const i=this.model.getListIndex(e);i>-1&&this.view.setAnchor(i,!0)})}getAnchor(){return k_(this.anchor.get(),void 0)}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)})}focusNext(e=1,t=!1,i,s=Sv(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}focusPrevious(e=1,t=!1,i,s=Sv(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,s)}focusNextPage(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}getStickyScrollFocus(){const e=this.stickyScrollController?.getFocus();return e!==void 0?[e]:[]}getFocusedPart(){return this.stickyScrollController?.focusedLast()?aV.StickyScroll:aV.Tree}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const s=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,s)}}getRelativeTop(e){const t=this.model.getListIndex(e);if(t===-1)return null;const i=this.stickyScrollController?.getNode(this.getNode(e));return this.view.getRelativeTop(t,i?.position??this.stickyScrollController?.height)}getViewState(e=this.options.identityProvider){if(!e)throw new Jd(this._user,"Can't get tree view state without an identity provider");const t=r=>e.getId(r).toString(),i=O$.empty(this.scrollTop);for(const r of this.getFocus())i.focus.add(t(r));for(const r of this.getSelection())i.selection.add(t(r));const s=this.model.getNode(),o=[s];for(;o.length>0;){const r=o.shift();r!==s&&r.collapsible&&(i.expanded[t(r.element)]=r.collapsed?0:1),o.push(...r.children)}return i}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(c=>c.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}navigate(e){return new dIt(this.view,this.model,e)}dispose(){St(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class dIt{constructor(e,t,i){this.view=e,this.model=t,i?this.index=this.model.getListIndex(i):this.index=-1}current(){return this.index<0||this.index>=this.view.length?null:this.view.element(this.index).element}previous(){return this.index--,this.current()}next(){return this.index++,this.current()}first(){return this.index=0,this.current()}last(){return this.index=this.view.length-1,this.current()}}class BNe{get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new $kt(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=fi.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=fi.empty(),i){const s=new Set,o=new Set,r=c=>{if(c.element===null)return;const l=c;if(s.add(l.element),this.nodes.set(l.element,l),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.add(d),this.nodesByIdentity.set(d,l)}i.onDidCreateNode?.(l)},a=c=>{if(c.element===null)return;const l=c;if(s.has(l.element)||this.nodes.delete(l.element),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(l)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=fi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),fi.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Up.Collapsed||t.collapsed===Up.PreserveOrCollapsed?r=!0:t.collapsed===Up.Expanded||t.collapsed===Up.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Up.PreserveOrCollapsed||t.collapsed===Up.PreserveOrExpanded?o=i.collapsed:t.collapsed===Up.Collapsed?o=!0:t.collapsed===Up.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getElementLocation(e);this.model.updateElementHeight(i,t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),s=this.model.getNode(i);this._setChildren(i,this.resortChildren(s,t),{})}resortChildren(e,t,i=!0){let s=[...e.children];return(t||i)&&(s=s.sort(this.sorter.compare.bind(this.sorter))),fi.map(s,o=>({element:o.element,collapsible:o.collapsible,collapsed:o.collapsed,children:this.resortChildren(o,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e=null){const t=this.getElementLocation(e);return this.model.getLastElementAncestor(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Jd(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function wJ(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:fi.map(fi.from(n.children),wJ),collapsible:n.collapsible,collapsed:n.collapsed}}function bJ(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=fi.consume(fi.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:fi.map(fi.concat(s,i),bJ),collapsible:n.collapsible,collapsed:n.collapsed}}function Vbe(n,e=0){let t;return eVbe(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function CUe(n){return Vbe(n,0)}function vXe(n,e,t){return n.element===e?{...n,children:t}:{...n,children:fi.map(fi.from(n.children),i=>vXe(i,e,t))}}const hIt=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class uIt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new BNe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=fi.empty(),i){const s=i.diffIdentityProvider&&hIt(i.diffIdentityProvider);if(e===null){const p=fi.map(t,this.enabled?bJ:wJ);this._setChildren(null,p,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Jd(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),l=CUe(r),d=vXe(l,e,t),h=(this.enabled?bJ:wJ)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(Ls(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||fi.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=c.children.map(p=>p===r?h:p);this._setChildren(c.element,f,{diffIdentityProvider:s,diffDepth:r.depth-c.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=fi.map(i,CUe),o=fi.map(s,e?bJ:wJ);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const c of a.element.elements)s.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)s.has(c)||this.nodes.delete(c)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e){const t=typeof e>"u"?void 0:this.getCompressedNode(e);return this.model.getLastElementAncestor(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getCompressedNode(e);i&&this.model.updateElementHeight(i,t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return t}}const gIt=n=>n[n.length-1];class WNe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new WNe(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function fIt(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function pIt(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}}}class mIt{get onDidSplice(){return T.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return T.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return T.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||gIt;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new PNe(o=>new WNe(s,o)),this.model=new uIt(e,fIt(this.nodeMapper,t),pIt(s,i))}setChildren(e,t=fi.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}getLastElementAncestor(e){const t=this.model.getLastElementAncestor(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class HNe extends _Xe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=fi.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new BNe(e,t,i)}}class zbe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,s):this.renderer.disposeElement?.(e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}zbe.__decorator=D([ii],zbe.prototype,"compressedTreeNodeProvider",null);class _It{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let s=0;si||s>=t-1&&tthis,a=new _It(()=>this.model),c=s.map(l=>new zbe(r,a,l));super(e,t,i,c,{...vIt(r,o),stickyScrollDelegate:a})}setChildren(e,t=fi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new mIt(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function qfe(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function $be(n,e){return e.parent?e.parent===n?!0:$be(n,e.parent):!1}function wIt(n,e){return n===e||$be(n,e)||$be(e,n)}class UNe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new UNe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class bIt{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(Ce.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(Ce.treeItemLoading)),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function yUe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function lK(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}function CIt(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,anchor:n.anchor,isStickyScroll:n.isStickyScroll}}class yIt extends vQ{set context(e){this.data.context=e}get context(){return this.data.context}constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function Qfe(n){return n instanceof vQ?new yIt(n):n}class SIt{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(Qfe(e),t)}onDragOver(e,t,i,s,o,r=!0){return this.dnd.onDragOver(Qfe(e),t&&t.element,i,s,o)}drop(e,t,i,s,o){this.dnd.drop(Qfe(e),t&&t.element,i,s,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function bXe(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new SIt(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>!!n.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?so.Visible:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?so.Recurse:n.defaultFindVisibility(e.element)}}function Gbe(n,e){e(n),n.children.forEach(t=>Gbe(t,e))}class CXe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return T.map(this.tree.onDidChangeFocus,yUe)}get onDidChangeSelection(){return T.map(this.tree.onDidChangeSelection,yUe)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return T.map(this.tree.onMouseClick,lK)}get onMouseDblClick(){return T.map(this.tree.onMouseDblClick,lK)}get onContextMenu(){return T.map(this.tree.onContextMenu,CIt)}get onTap(){return T.map(this.tree.onTap,lK)}get onPointer(){return T.map(this.tree.onPointer,lK)}get onDidFocus(){return this.tree.onDidFocus}get onDidBlur(){return this.tree.onDidBlur}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidUpdateOptions(){return this.tree.onDidUpdateOptions}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get findMode(){return this.tree.findMode}set findMode(e){this.tree.findMode=e}get findMatchType(){return this.tree.findMatchType}set findMatchType(e){this.tree.findMatchType=e}get expandOnlyOnTwistieClick(){if(typeof this.tree.expandOnlyOnTwistieClick=="boolean")return this.tree.expandOnlyOnTwistieClick;const e=this.tree.expandOnlyOnTwistieClick;return t=>e(this.nodes.get(t===this.root.element?null:t)||null)}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new I,this._onDidChangeNodeSlowState=new I,this.nodeMapper=new PNe(a=>new UNe(a)),this.disposables=new Z,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?Up.PreserveOrCollapsed:Up.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=qfe({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new ONe(i),a=s.map(l=>new bIt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=bXe(o)||{};return new HNe(e,t,r,a,c)}updateOptions(e={}){this.tree.updateOptions(e)}get options(){return this.tree.options}getHTMLElement(){return this.tree.getHTMLElement()}get contentHeight(){return this.tree.contentHeight}get contentWidth(){return this.tree.contentWidth}get onDidChangeContentHeight(){return this.tree.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.tree.onDidChangeContentWidth}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollLeft(){return this.tree.scrollLeft}set scrollLeft(e){this.tree.scrollLeft=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}get lastVisibleElement(){return this.tree.lastVisibleElement.element}get ariaLabel(){return this.tree.ariaLabel}set ariaLabel(e){this.tree.ariaLabel=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async updateChildren(e=this.root.element,t=!0,i=!1,s){await this._updateChildren(e,t,i,void 0,s)}async _updateChildren(e=this.root.element,t=!0,i=!1,s,o){if(typeof this.root.element>"u")throw new Jd(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}}resort(e=this.root.element,t=!0){this.tree.resort(this.getDataNode(e),t)}hasElement(e){return this.tree.hasElement(this.getDataNode(e))}hasNode(e){return e===this.root.element||this.nodes.has(e)}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}updateElementHeight(e,t){const i=this.getDataNode(e);this.tree.updateElementHeight(i,t)}updateWidth(e){const t=this.getDataNode(e);this.tree.updateWidth(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Jd(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event)),s}toggleCollapsed(e,t=!1){return this.tree.toggleCollapsed(this.getDataNode(e),t)}expandAll(){this.tree.expandAll()}async expandTo(e){if(!this.dataSource.getParent)throw new Error("Can't expand to element without getParent method");const t=[];for(;!this.hasNode(e);)e=this.dataSource.getParent(e),e!==this.root.element&&t.push(e);for(const i of fi.reverse(t))await this.expand(i);this.tree.expandTo(this.getDataNode(e))}collapseAll(){this.tree.collapseAll()}isCollapsible(e){return this.tree.isCollapsible(this.getDataNode(e))}isCollapsed(e){return this.tree.isCollapsed(this.getDataNode(e))}triggerTypeNavigation(){this.tree.triggerTypeNavigation()}openFind(){this.tree.openFind()}closeFind(){this.tree.closeFind()}refilter(){this.tree.refilter()}setAnchor(e){this.tree.setAnchor(typeof e>"u"?void 0:this.getDataNode(e))}getAnchor(){return this.tree.getAnchor()?.element}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}focusNext(e=1,t=!1,i){this.tree.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.tree.focusPrevious(e,t,i)}focusNextPage(e){return this.tree.focusNextPage(e)}focusPreviousPage(e){return this.tree.focusPreviousPage(e)}focusLast(e){this.tree.focusLast(e)}focusFirst(e){this.tree.focusFirst(e)}getFocus(){return this.tree.getFocus().map(t=>t.element)}getStickyScrollFocus(){return this.tree.getStickyScrollFocus().map(t=>t.element)}getFocusedPart(){return this.tree.getFocusedPart()}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getRelativeTop(e){return this.tree.getRelativeTop(this.getDataNode(e))}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Jd(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,s){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,s)}async refreshNode(e,t,i){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&wIt(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await ko.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(fi.empty());else{const o=this.doGetChildren(e);if(BBe(o))s=Promise.resolve(o);else{const r=Ta(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=await s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Na(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return BBe(i)?this.processChildren(i):(t=na(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(bt))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const c=[],l=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=qfe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Up.PreserveOrExpanded&&c.push(m),m}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=h,i?f.collapsed?(m.children.forEach(v=>Gbe(v,w=>this.nodes.delete(w.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&!f.collapsed&&c.push(m),m}const p=qfe({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return s&&s.viewState.focus&&s.viewState.focus.indexOf(u)>-1&&s.focus.push(p),s&&s.viewState.selection&&s.viewState.selection.indexOf(u)>-1&&s.selection.push(p),(s&&s.viewState.expanded&&s.viewState.expanded.indexOf(u)>-1||h&&p.defaultCollapseState===Up.PreserveOrExpanded)&&c.push(p),p});for(const d of r.values())Gbe(d,h=>this.nodes.delete(h.element));for(const d of l)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&l.length===1&&c.length===0&&(l[0].forceExpanded=!0,c.push(l[0])),c}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?fi.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}getViewState(){if(!this.identityProvider)throw new Jd(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),s=[],o=this.tree.getNode(),r=[o];for(;r.length>0;){const a=r.pop();a!==o&&a.collapsible&&!a.collapsed&&s.push(e(a.element.element)),r.push(...a.children)}return{focus:t,selection:i,expanded:s,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class VNe{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new VNe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class AIt{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(Ce.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(Ce.treeItemLoading)),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=St(this.disposables)}}function EIt(n){const e=n&&bXe(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class xIt extends CXe{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new PNe(c=>new VNe(c)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new ONe(i),a=s.map(l=>new AIt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=EIt(o)||{};return new wXe(e,t,r,a,c)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}getViewState(){if(!this.identityProvider)throw new Jd(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),s=[],o=this.tree.getCompressedTreeNode(),r=[o];for(;r.length>0;){const a=r.pop();if(a!==o&&a.collapsible&&!a.collapsed)for(const c of a.element.elements)s.push(e(c.element));r.push(...a.children)}return{focus:t,selection:i,expanded:s,scrollTop:this.scrollTop}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const s=f=>this.identityProvider.getId(f).toString(),o=f=>{const p=new Set;for(const m of f){const v=this.tree.getCompressedTreeNode(m===this.root?null:m);if(v.element)for(const w of v.element.elements)p.add(s(w.element))}return p},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const c=this.getSelection();let l=!1;const d=this.getFocus();let h=!1;const u=f=>{const p=f.element;if(p)for(let m=0;m{const i=this.filter.filter(t,so.Visible),s=DIt(i);if(s===so.Recurse)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===so.Visible})),super.processChildren(e)}}function DIt(n){return typeof n=="boolean"?n?so.Visible:so.Hidden:FNe(n)?D7(n.visibility):D7(n)}class kIt extends _Xe{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.nodesByIdentity=new Map,this.identityProvider=r.identityProvider}getInput(){return this.input}setInput(e,t){if(t&&!this.identityProvider)throw new Jd(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,fi.empty());return}if(!t){this._refresh(e);return}const i=[],s=[],o=a=>{const c=this.identityProvider.getId(a).toString();return!t.expanded[c]},r=a=>{const c=this.identityProvider.getId(a.element).toString();t.focus.has(c)&&i.push(a.element),t.selection.has(c)&&s.push(a.element)};this._refresh(e,o,r),this.setFocus(i),this.setSelection(s),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}updateChildren(e=this.input){if(typeof this.input>"u")throw new Jd(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const s=this.identityProvider.getId(i).toString(),o=this.nodesByIdentity.get(s);if(o)return o.collapsed}),this._refresh(e,t)}resort(e=this.input,t=!0){this.model.resort(e===this.input?null:e,t)}refresh(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}_refresh(e,t,i){let s;if(this.identityProvider){const o=new Set,r=i;i=a=>{const c=this.identityProvider.getId(a.element).toString();o.add(c),this.nodesByIdentity.set(c,a),r?.(a)},s=a=>{const c=this.identityProvider.getId(a.element).toString();o.has(c)||this.nodesByIdentity.delete(c)}}this.model.setChildren(e===this.input?null:e,this.iterate(e,t).elements,{onDidCreateNode:i,onDidDeleteNode:s})}iterate(e,t){const i=[...this.dataSource.getChildren(e)];return{elements:fi.map(i,o=>{const{elements:r,size:a}=this.iterate(o,t),c=this.dataSource.hasChildren?this.dataSource.hasChildren(o):void 0,l=a===0?void 0:t&&t(o);return{element:o,children:r,collapsible:c,collapsed:l}}),size:i.length}}createModel(e,t,i){return new BNe(e,t,i)}}const nD="vs/platform/contextkey/common/contextkeys";new Y("isMac",ei,g(nD,0,"Whether the operating system is macOS"));new Y("isLinux",jr,g(nD,1,"Whether the operating system is Linux"));const Ide=new Y("isWindows",Is,g(nD,2,"Whether the operating system is Windows")),yXe=new Y("isWeb",Jn,g(nD,3,"Whether the platform is a web browser"));new Y("isMacNative",ei&&!Jn,g(nD,4,"Whether the operating system is macOS on a non-browser platform"));new Y("isIOS",I_,g(nD,5,"Whether the operating system is iOS"));new Y("isMobile",sQe,g(nD,6,"Whether the platform is a mobile web browser"));new Y("isDevelopment",!1,!0);new Y("productQualityType","",g(nD,7,"Quality type of VS Code"));const Lde="inputFocus",SXe=new Y(Lde,!1,g(nD,8,"Whether keyboard focus is inside an input box")),yf=ae("listService"),nc="vs/platform/list/browser/listService";class IIt{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Z,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new QJe(od(),"").style(bO)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),kw(e.getHTMLElement())&&this.setLastFocusedList(e),pa(e.onDidFocus(()=>this.setLastFocusedList(e)),Ee(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const k7=new Y("listScrollAtBoundary","none"),LIt=ge.or(k7.isEqualTo("top"),k7.isEqualTo("both")),TIt=ge.or(k7.isEqualTo("bottom"),k7.isEqualTo("both")),AXe=new Y("listFocus",!0),EXe=new Y("treestickyScrollFocused",!1),Tde=new Y("listSupportsMultiselect",!0),Rde=ge.and(AXe,ge.not(Lde),EXe.negate()),zNe=new Y("listHasSelectionOrFocus",!1),$Ne=new Y("listDoubleSelection",!1),GNe=new Y("listMultiSelection",!1),Mde=new Y("listSelectionNavigation",!1),RIt=new Y("listSupportsFind",!0),qNe=new Y("treeElementCanCollapse",!1),MIt=new Y("treeElementHasParent",!1),QNe=new Y("treeElementCanExpand",!1),NIt=new Y("treeElementHasChild",!1),PIt=new Y("treeFindOpen",!1),xXe="listTypeNavigationMode",DXe="listAutomaticKeyboardNavigation";function Nde(n,e){const t=n.createScoped(e.getHTMLElement());return AXe.bindTo(t),t}function Pde(n,e){const t=k7.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const SO="workbench.list.multiSelectModifier",CJ="workbench.list.openMode",y_="workbench.list.horizontalScrolling",jNe="workbench.list.defaultFindMode",KNe="workbench.list.typeNavigationMode",Tee="workbench.list.keyboardNavigation",tC="workbench.list.scrollByPage",YNe="workbench.list.defaultFindMatchType",I7="workbench.tree.indent",Ree="workbench.tree.renderIndentGuides",iC="workbench.list.smoothScrolling",HS="workbench.list.mouseWheelScrollSensitivity",US="workbench.list.fastScrollSensitivity",Mee="workbench.tree.expandMode",Nee="workbench.tree.enableStickyScroll",Pee="workbench.tree.stickyScrollMaxItemCount";function VS(n){return n.getValue(SO)==="alt"}class FIt extends ${constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=VS(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(SO)&&(this.useAltAsMultipleSelectionModifier=VS(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:$Je(e)}isSelectionRangeChangeEvent(e){return GJe(e)}}function Fde(n,e){const t=n.get(Re),i=n.get(ti),s=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(iC),mouseWheelScrollSensitivity:t.getValue(HS),fastScrollSensitivity:t.getValue(US),multipleSelectionController:e.multipleSelectionController??s.add(new FIt(t)),keyboardNavigationEventFilter:WIt(i),scrollByPage:!!t.getValue(tC)},s]}let qbe=class extends Fc{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(y_),[h,u]=l.invokeFunction(Fde,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Nde(r,this),this.disposables.add(Pde(this.contextKeyService,this)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=zNe.bindTo(this.contextKeyService),this.listDoubleSelection=$Ne.bindTo(this.contextKeyService),this.listMultiSelection=GNe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=VS(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(c));let m={};if(p.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const v=!!c.getValue(y_);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(tC)){const v=!!c.getValue(tC);m={...m,scrollByPage:v}}if(p.affectsConfiguration(iC)){const v=!!c.getValue(iC);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(HS)){const v=c.getValue(HS);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(US)){const v=c.getValue(US);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new kXe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};qbe=D([_(5,Pe),_(6,yf),_(7,Re),_(8,be)],qbe);let SUe=class extends Lkt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(y_),[h,u]=l.invokeFunction(Fde,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=Nde(r,this),this.disposables.add(Pde(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=VS(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(c));let m={};if(p.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const v=!!c.getValue(y_);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(tC)){const v=!!c.getValue(tC);m={...m,scrollByPage:v}}if(p.affectsConfiguration(iC)){const v=!!c.getValue(iC);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(HS)){const v=c.getValue(HS);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(US)){const v=c.getValue(US);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new kXe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};SUe=D([_(5,Pe),_(6,yf),_(7,Re),_(8,be)],SUe);let AUe=class extends Hbe{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(y_),[u,f]=d.invokeFunction(Fde,r);super(e,t,i,s,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=Nde(a,this),this.disposables.add(Pde(this.contextKeyService,this)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=zNe.bindTo(this.contextKeyService),this.listDoubleSelection=$Ne.bindTo(this.contextKeyService),this.listMultiSelection=GNe.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=VS(l),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(l.onDidChangeConfiguration(m=>{m.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(l));let v={};if(m.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const w=!!l.getValue(y_);v={...v,horizontalScrolling:w}}if(m.affectsConfiguration(tC)){const w=!!l.getValue(tC);v={...v,scrollByPage:w}}if(m.affectsConfiguration(iC)){const w=!!l.getValue(iC);v={...v,smoothScrolling:w}}if(m.affectsConfiguration(HS)){const w=l.getValue(HS);v={...v,mouseWheelScrollSensitivity:w}}if(m.affectsConfiguration(US)){const w=l.getValue(US);v={...v,fastScrollSensitivity:w}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new OIt(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};AUe=D([_(6,Pe),_(7,yf),_(8,Re),_(9,be)],AUe);class JNe extends ${constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new I),this.onDidOpen=this._onDidOpen.event,this._register(T.filter(this.widget.onDidChangeSelection,i=>Sv(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(CJ)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(CJ)&&(this.openOnSingleClick=t?.configurationService.getValue(CJ)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class kXe extends JNe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class OIt extends JNe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class BIt extends JNe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function WIt(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===hp.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===hp.NoMatchingKb)}}let L7=class extends HNe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(SQ,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new fF(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};L7=D([_(5,be),_(6,Pe),_(7,yf),_(8,Re)],L7);let EUe=class extends wXe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(SQ,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new fF(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};EUe=D([_(5,be),_(6,Pe),_(7,yf),_(8,Re)],EUe);let xUe=class extends kIt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(SQ,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new fF(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};xUe=D([_(6,be),_(7,Pe),_(8,yf),_(9,Re)],xUe);let Qbe=class extends CXe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(SQ,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new fF(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Qbe=D([_(6,be),_(7,Pe),_(8,yf),_(9,Re)],Qbe);let Fee=class extends xIt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(SQ,a);super(e,t,i,s,o,r,u),this.disposables.add(p),this.internals=new fF(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Fee=D([_(7,be),_(8,Pe),_(9,yf),_(10,Re)],Fee);function IXe(n){const e=n.getValue(jNe);if(e==="highlight")return am.Highlight;if(e==="filter")return am.Filter;const t=n.getValue(Tee);if(t==="simple"||t==="highlight")return am.Highlight;if(t==="filter")return am.Filter}function LXe(n){const e=n.getValue(YNe);if(e==="fuzzy")return Bb.Fuzzy;if(e==="contiguous")return Bb.Contiguous}function SQ(n,e){const t=n.get(Re),i=n.get(W_),s=n.get(Pe),o=n.get(be),r=()=>{const u=s.getContextKeyValue(xXe);if(u==="automatic")return Sy.Automatic;if(u==="trigger"||s.getContextKeyValue(DXe)===!1)return Sy.Trigger;const p=t.getValue(KNe);if(p==="automatic")return Sy.Automatic;if(p==="trigger")return Sy.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(y_),[c,l]=o.invokeFunction(Fde,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(Ree);return{getTypeNavigationMode:r,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(I7)=="number"?t.getValue(I7):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(iC),defaultFindMode:IXe(t),defaultFindMatchType:LXe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(tC),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(Mee)==="doubleClick",contextViewProvider:i,findWidgetStyles:MDt,enableStickyScroll:!!t.getValue(Nee),stickyScrollMaxItemCount:Number(t.getValue(Pee))}}}let fF=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Nde(o,e),this.disposables.push(Pde(this.contextKeyService,e)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=RIt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=zNe.bindTo(this.contextKeyService),this.hasDoubleSelection=$Ne.bindTo(this.contextKeyService),this.hasMultiSelection=GNe.bindTo(this.contextKeyService),this.treeElementCanCollapse=qNe.bindTo(this.contextKeyService),this.treeElementHasParent=MIt.bindTo(this.contextKeyService),this.treeElementCanExpand=QNe.bindTo(this.contextKeyService),this.treeElementHasChild=NIt.bindTo(this.contextKeyService),this.treeFindOpen=PIt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=EXe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=VS(a),this.updateStyleOverrides(s);const l=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(xXe),d.add(DXe),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),l()}),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(a)),h.affectsConfiguration(I7)){const f=a.getValue(I7);u={...u,indent:f}}if(h.affectsConfiguration(Ree)&&t.renderIndentGuides===void 0){const f=a.getValue(Ree);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(iC)){const f=!!a.getValue(iC);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(jNe)||h.affectsConfiguration(Tee)){const f=IXe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(KNe)||h.affectsConfiguration(Tee)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(YNe)){const f=LXe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(y_)&&t.horizontalScrolling===void 0){const f=!!a.getValue(y_);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(tC)){const f=!!a.getValue(tC);u={...u,scrollByPage:f}}if(h.affectsConfiguration(Mee)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(Mee)==="doubleClick"}),h.affectsConfiguration(Nee)){const f=a.getValue(Nee);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(Pee)){const f=Math.max(1,a.getValue(Pee));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(HS)){const f=a.getValue(HS);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(US)){const f=a.getValue(US);u={...u,fastScrollSensitivity:f}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new BIt(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?CO(e):bO)}dispose(){this.disposables=St(this.disposables)}};fF=D([_(4,Pe),_(5,yf),_(6,Re)],fF);const HIt=it.as(Cs.Configuration);HIt.registerConfiguration({id:"workbench",order:7,title:g(nc,0,"Workbench"),type:"object",properties:{[SO]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[g(nc,1,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(nc,2,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:g(nc,3,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[CJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(nc,4,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[y_]:{type:"boolean",default:!1,description:g(nc,5,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[tC]:{type:"boolean",default:!1,description:g(nc,6,"Controls whether clicks in the scrollbar scroll page by page.")},[I7]:{type:"number",default:8,minimum:4,maximum:40,description:g(nc,7,"Controls tree indentation in pixels.")},[Ree]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(nc,8,"Controls whether the tree should render indent guides.")},[iC]:{type:"boolean",default:!1,description:g(nc,9,"Controls whether lists and trees have smooth scrolling.")},[HS]:{type:"number",default:1,markdownDescription:g(nc,10,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[US]:{type:"number",default:5,markdownDescription:g(nc,11,"Scrolling speed multiplier when pressing `Alt`.")},[jNe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[g(nc,12,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),g(nc,13,"Filter elements when searching.")],default:"highlight",description:g(nc,14,"Controls the default find mode for lists and trees in the workbench.")},[Tee]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[g(nc,15,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),g(nc,16,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),g(nc,17,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:g(nc,18,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:g(nc,19,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[YNe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[g(nc,20,"Use fuzzy matching when searching."),g(nc,21,"Use contiguous matching when searching.")],default:"fuzzy",description:g(nc,22,"Controls the type of matching used when searching lists and trees in the workbench.")},[Mee]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(nc,23,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Nee]:{type:"boolean",default:!0,description:g(nc,24,"Controls whether sticky scrolling is enabled in trees.")},[Pee]:{type:"number",minimum:1,default:7,markdownDescription:g(nc,25,"Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[KNe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:g(nc,26,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var UIt=".monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:16px;display:inline-block;flex-shrink:0;height:22px;line-height:inherit!important;padding-right:6px;vertical-align:top;width:16px}.monaco-icon-label-iconpath{display:flex;height:16px;margin-top:2px;padding-left:2px;width:16px}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-size:.9em;margin-left:.5em;opacity:.7;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{opacity:.66;text-decoration:line-through}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{font-size:90%;font-weight:600;margin:auto 16px 0 5px;opacity:.75;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}";Ct(UIt,{});class NI extends ${constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=he(e,we("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=NI.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Io(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class v5{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class T7 extends ${constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new v5(he(e,we(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,we(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,we("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new $It(this.nameContainer,!!t.supportIcons)):this.nameNode=new VIt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??va("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let c;!a||!Ra(a)?(c=we(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=uf(i?.iconPath)}else a&&a.remove();if(this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof NI?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?NI.escapeNewLines(t,[]):t||"",this.setupHover(c.element,i?.descriptionTitle||""),c.empty=!t)}if(i?.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){$t(r)?o.title=mde(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const s=H_().setupUpdatableHover(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new v5(pje(this.nameContainer,we("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new v5(he(e.element,we("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new v5(he(this.labelContainer,we("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new NI(he(e.element,we("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new v5(he(e.element,we("span.label-description"))))}return this.descriptionNode}}class VIt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=he(this.container,we("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>Dh.intersect(o,a)).filter(a=>!Dh.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class $It extends ${constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new NI(he(this.container,we("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",s=zIt(e,i,t?.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}}),kz=new Ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),XNe=new Ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function RXe(n,e,t=!1){const i=n||"",s=e||"",o=DUe.value.collator.compare(i,s);return DUe.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var jbe;const s0t="vs/platform/quickinput/browser/quickInputTree",$w=we;class PXe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Ya(()=>{const s=i.label??"",o=n2(s).text.trim(),r=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>ZYe(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class iu extends PXe{constructor(e,t,i,s,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=s,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?T.map(T.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):T.None,this._saneDetail=o.detail,this._labelHighlights=o.highlights?.label,this._descriptionHighlights=o.highlights?.description,this._detailHighlights=o.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var iy;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(iy||(iy={}));class LD extends PXe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=iy.NONE}}class o0t{getHeight(e){return e instanceof LD?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof iu?Wee.ID:Hee.ID}}class r0t{getWidgetAriaLabel(){return g(s0t,0,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof iu)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class FXe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=he(e,$w(".quick-input-list-entry"));const i=he(t.entry,$w("label.quick-input-list-label"));t.toDisposeTemplate.add(Xo(i,xe.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=he(i,$w("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const s=he(i,$w(".quick-input-list-rows")),o=he(s,$w(".quick-input-list-row")),r=he(s,$w(".quick-input-list-row"));t.label=new T7(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Yle(t.label.element,$w(".quick-input-list-icon"));const a=he(o,$w(".quick-input-list-entry-keybinding"));t.keybinding=new Dz(a,$c),t.toDisposeTemplate.add(t.keybinding);const c=he(r,$w(".quick-input-list-label-meta"));return t.detail=new T7(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=he(t.entry,$w(".quick-input-list-separator")),t.actionBar=new Qh(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var sN;let Wee=(sN=class extends FXe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return jbe.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Xo(t.checkbox,xe.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0;const o=s.item;i.checkbox.checked=s.checked,i.toDisposeElement.add(s.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=s.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;if(o.iconPath){const u=rde(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=P.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=uf(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(o.keybinding),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";s.separator?.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireButtonTriggered({button:u,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},jbe=sN,sN.ID="quickpickitem",sN);Wee=jbe=D([_(1,pn)],Wee);const Rae=class Rae extends FXe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return Rae.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const o=s.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;i.icon.style.backgroundImage="",i.icon.className="";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireSeparatorButtonTriggered({button:u,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};Rae.ID="quickpickseparator";let Hee=Rae,pF=class extends ${constructor(e,t,i,s,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new I,this.onKeyDown=this._onKeyDown.event,this._onLeave=new I,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new I,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new I,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new I,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new I,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=he(this.parent,$w(".quick-input-list")),this._separatorRenderer=new Hee(t),this._itemRenderer=o.createInstance(Wee,t),this._tree=this._register(o.createInstance(L7,"QuickInput",this._container,new o0t,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new r0t,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:rV.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return T.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof iu).map(t=>t.item))}get onDidChangeSelection(){return T.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof iu).map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get matchOnMeta(){return this._matchOnMeta}set matchOnMeta(e){this._matchOnMeta=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new os(e);switch(t.keyCode){case E.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(pe(this._container,xe.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(pe(this._container,xe.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new iQ(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(_2e(t.browserEvent.target)){e.cancel();return}if(!(!_2e(t.browserEvent.relatedTarget)&&al(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof iu&&this.showHover(t.element)})}catch(i){if(!Na(i))throw i}})),this._register(this._tree.onMouseOut(t=>{al(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&iy.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=iy.ACTIVE_ITEM:i.focusInsideSeparator&=~iy.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)||(i.focusInsideSeparator|=iy.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)&&(i.focusInsideSeparator&=~iy.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof iu);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof LD&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;const t=this.parent.classList.contains("show-checkboxes");let i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,c)=>{let l;if(a.type==="separator"){if(!a.buttons)return r;i=new LD(c,d=>this.fireSeparatorButtonTriggered(d),a),l=i}else{const d=c>0?e[c-1]:void 0;let h;d&&d.type==="separator"&&!d.buttons&&(i=void 0,h=d);const u=new iu(c,t,f=>this.fireButtonTriggered(f),this._elementChecked,a,h);if(this._itemElements.push(u),i)return i.children.push(u),r;l=u}return r.push(l),r},new Array);const s=new Array;let o=0;for(const r of this._elementTree)r instanceof LD?(s.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),o+=r.children.length+1):(s.push({element:r,collapsible:!1,collapsed:!1}),o++);this._tree.setChildren(null,s),this._onChangedVisibleCount.fire(o),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const r=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),a=r?.parentNode;if(r&&a){const c=r.nextSibling;a.removeChild(r),a.insertBefore(r,c)}},0)}getElementsCount(){return this._inputElements.length}getFocusedElements(){return this._tree.getFocus().filter(e=>!!e).map(e=>e.item).filter(e=>!!e)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}getSelectedElements(){return this._tree.getSelection().filter(e=>!!e&&!!e.item).map(e=>e.item)}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._shouldFireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){if(this._itemElements.length)switch(e===Wo.Second&&this._itemElements.length<2&&(e=Wo.First),e){case Wo.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof iu);break;case Wo.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case Wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case Wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,s=>s.element instanceof iu?(this._tree.reveal(s.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case Wo.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,s=>{if(!(s.element instanceof iu))return!1;const o=this._tree.getParentElement(s.element);return o===null||o.children[0]!==s.element?this._tree.reveal(s.element):this._tree.reveal(o),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[0]&&this._onLeave.fire();break}case Wo.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof iu?(this._tree.reveal(t.element),!0):!1);break;case Wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof iu))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case Wo.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(t)return!0;if(o.element instanceof LD)t=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof iu){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const s=this._tree.getFocus()[0];i===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case Wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof LD)i?t||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element.children[0]):i=!0;else if(s.element instanceof iu&&!t){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(a=>{a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=!1;const c=a.index&&this._inputElements[a.index-1];a.item&&(a.separator=c&&c.type==="separator"&&!c.buttons?c:void 0)});else{let a;this._elementTree.forEach(c=>{let l;this.matchOnLabelMode==="fuzzy"?l=this.matchOnLabel?lJ(e,n2(c.saneLabel))??void 0:void 0:l=this.matchOnLabel?a0t(t,n2(c.saneLabel))??void 0:void 0;const d=this.matchOnDescription?lJ(e,n2(c.saneDescription||""))??void 0:void 0,h=this.matchOnDetail?lJ(e,n2(c.saneDetail||""))??void 0:void 0;if(l||d||h?(c.labelHighlights=l,c.descriptionHighlights=d,c.detailHighlights=h,c.hidden=!1):(c.labelHighlights=void 0,c.descriptionHighlights=void 0,c.detailHighlights=void 0,c.hidden=c.item?!c.item.alwaysShow:!0),c.item?c.separator=void 0:c.separator&&(c.hidden=!0),!this.sortByLabel){const u=c.index&&this._inputElements[c.index-1];a=u&&u.type==="separator"?u:a,a&&!c.hidden&&(c.separator=a,a=void 0)}})}const i=this._elementTree.filter(a=>!a.hidden);if(this.sortByLabel&&e){const a=e.toLowerCase();i.sort((c,l)=>c0t(c,l,a))}let s;const o=i.reduce((a,c,l)=>(c instanceof iu?s?s.children.push(c):a.push(c):c instanceof LD&&(c.children=[],s=c,a.push(c)),a),new Array),r=new Array;for(const a of o)a instanceof LD?r.push({element:a,collapsible:!1,collapsed:!1,children:a.children.map(c=>({element:c,collapsible:!1,collapsed:!1}))}):r.push({element:a,collapsible:!1,collapsed:!1});return this._tree.setChildren(null,r),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;const e=this._tree.getFocus().filter(i=>i instanceof iu),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof iu))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof iu&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:Oo.RIGHT}},!1))}};pF.__decorator=D([ii],pF.prototype,"onDidChangeFocus",null);pF.__decorator=D([ii],pF.prototype,"onDidChangeSelection",null);pF=D([_(4,be),_(5,Ur)],pF);function a0t(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return kUe(n,t);const s=lz(t," "),o=t.length-s.length,r=kUe(n,s);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function kUe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function c0t(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:SJ(n.saneSortLabel,e.saneSortLabel,t)}const ZNe="vs/platform/quickinput/browser/quickInputActions",OXe={weight:ye.WorkbenchContrib,when:ge.and(ge.equals(lXe,nV.QuickPick),ekt),metadata:{description:g(ZNe,0,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Qf(n,e={}){xr.registerCommandAndKeybindingRule({...OXe,...n,secondary:l0t(n.primary,n.secondary??[],e)})}const Uee=ei?V.WinCtrl:V.CtrlCmd;function l0t(n,e,t={}){return t.withAltMod&&e.push(V.Alt+n),t.withCtrlMod&&(e.push(Uee+n),t.withAltMod&&e.push(V.Alt+Uee+n)),t.withCmdMod&&ei&&(e.push(V.CtrlCmd+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.WinCtrl+n),t.withAltMod&&(e.push(V.CtrlCmd+V.Alt+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.Alt+V.WinCtrl+n))),e}function Vp(n,e){return t=>{const i=t.get(On).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Qf({id:"quickInput.pageNext",primary:E.PageDown,handler:Vp(Wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.pagePrevious",primary:E.PageUp,handler:Vp(Wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.first",primary:Uee+E.Home,handler:Vp(Wo.First)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.last",primary:Uee+E.End,handler:Vp(Wo.Last)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.next",primary:E.DownArrow,handler:Vp(Wo.Next)},{withCtrlMod:!0});Qf({id:"quickInput.previous",primary:E.UpArrow,handler:Vp(Wo.Previous)},{withCtrlMod:!0});const IUe=g(ZNe,1,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),LUe=g(ZNe,2,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");ei?(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.DownArrow],handler:Vp(Wo.NextSeparator)},{withCtrlMod:!0}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.UpArrow],handler:Vp(Wo.PreviousSeparator)},{withCtrlMod:!0})):(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator)}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator)}));Qf({id:"quickInput.acceptInBackground",when:ge.and(OXe.when,ge.or(SXe.negate(),nkt)),primary:E.RightArrow,weight:ye.WorkbenchContrib+50,handler:n=>{n.get(On).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var Kbe;const EL="vs/platform/quickinput/browser/quickInputController",xf=we;var oN;let Ybe=(oN=class extends ${get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this.onDidTriggerButtonEmitter=this._register(new I),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new I),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new I),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=ZDt.bindTo(this.contextKeyService),this.quickInputTypeContext=tkt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=ikt.bindTo(this.contextKeyService),this.backButton=kee,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(T.runAndSubscribe(Vb,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:yi,disposables:this._store})),this._register(Iut(o=>{this.ui&>(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[xe.KEY_DOWN,xe.KEY_UP,xe.MOUSE_DOWN])t.add(pe(e,s,i,!0))}getUI(e){if(this.ui)return e&>(this._container)!==gt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=he(this._container,xf(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=od(t),s=he(t,xf(".quick-input-titlebar")),o=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=he(s,xf(".quick-input-title")),a=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=he(t,xf(".quick-input-header")),l=he(c,xf("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(EL,0,"Toggle all checkboxes")),this._register(Xo(l,xe.CHANGE,j=>{const re=l.checked;U.setAllVisibleChecked(re)})),this._register(pe(l,xe.CLICK,j=>{(j.x||j.y)&&f.setFocus()}));const d=he(c,xf(".quick-input-description")),h=he(c,xf(".quick-input-and-message")),u=he(h,xf(".quick-input-filter")),f=this._register(new xkt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=he(u,xf(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new Bbe(p,{countFormat:g(EL,1,"{0} Results")},this.styles.countBadge),v=he(u,xf(".quick-input-count"));v.setAttribute("aria-live","polite");const w=new Bbe(v,{countFormat:g(EL,2,"{0} Selected")},this.styles.countBadge),b=he(c,xf(".quick-input-action")),C=this._register(new Tu(b,this.styles.button));C.label=g(EL,3,"OK"),this._register(C.onDidClick(j=>{this.onDidAcceptEmitter.fire()}));const y=he(c,xf(".quick-input-action")),S=this._register(new Tu(y,{...this.styles.button,supportIcons:!0}));S.label=g(EL,4,"Custom"),this._register(S.onDidClick(j=>{this.onDidCustomEmitter.fire()}));const M=he(h,xf(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new y7(t,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const F=he(t,xf(".quick-input-html-widget"));F.tabIndex=-1;const N=he(t,xf(".quick-input-description")),z=this.idPrefix+"list",U=this._register(this.instantiationService.createInstance(pF,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,z));f.setAttribute("aria-controls",z),this._register(U.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",U.getActiveDescendant()??"")})),this._register(U.onChangedAllVisibleChecked(j=>{l.checked=j})),this._register(U.onChangedVisibleCount(j=>{m.setCount(j)})),this._register(U.onChangedCheckedCount(j=>{w.setCount(j)})),this._register(U.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof r2&&this.controller.canSelectMany&&U.clearFocus())},0)}));const J=Dd(t);return this._register(J),this._register(pe(t,xe.FOCUS,j=>{const re=this.getUI();if(al(j.relatedTarget,re.inputContainer)){const me=re.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==me&&this.endOfQuickInputBoxContext.set(me)}al(j.relatedTarget,re.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Ra(j.relatedTarget)?j.relatedTarget:void 0)},!0)),this._register(J.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(iV.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(j=>{const re=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==re&&this.endOfQuickInputBoxContext.set(re)})),this._register(pe(t,xe.FOCUS,j=>{f.setFocus()})),this._register(Xo(t,xe.KEY_DOWN,j=>{if(!al(j.target,F))switch(j.keyCode){case E.Enter:un.stop(j,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case E.Escape:un.stop(j,!0),this.hide(iV.Gesture);break;case E.Tab:if(!j.altKey&&!j.ctrlKey&&!j.metaKey){const re=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?re.push("input"):re.push("input[type=text]"),this.getUI().list.isDisplayed()&&re.push(".monaco-list"),this.getUI().message&&re.push(".quick-input-message a"),this.getUI().widget){if(al(j.target,this.getUI().widget))break;re.push(".quick-input-html-widget")}const me=t.querySelectorAll(re.join(", "));j.shiftKey&&j.target===me[0]?(un.stop(j,!0),U.clearFocus()):!j.shiftKey&&al(j.target,me[me.length-1])&&(un.stop(j,!0),me[0].focus())}break;case E.Space:j.ctrlKey&&(un.stop(j,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:s,title:r,description1:N,description2:d,widget:F,rightActionBar:a,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:w,okContainer:b,ok:C,message:M,customButtonContainer:y,customButton:S,list:U,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:j=>this.show(j),hide:()=>this.hide(),setVisibilities:j=>this.setVisibilities(j),setEnabled:j=>this.setEnabled(j),setContextKey:j=>this.options.setContextKey(j),linkOpenerDelegate:j=>this.options.linkOpenerDelegate(j)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,he(this._container,this.ui.container))}pick(e,t={},i=qe.None){return new Promise((s,o)=>{let r=d=>{r=s,t.onKeyMods?.(a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let c;const l=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),p=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,p&&(a.activeItems=p),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{c&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==c)&&(a.activeItems=[c])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{St(l),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{c=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),c&&(a.activeItems=[c])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&$t(t)?(e.severity=nt.Error,e.validationMessage=t):t&&!$t(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=nt.Ignore,e.validationMessage=void 0)}input(e={},t=qe.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const s=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=T.debounce(s.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[s,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(s,h)})}),s.onDidAccept(()=>{const d=s.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!$t(h)&&h.severity!==nt.Error?(i(d),s.hide()):d===a&&this.setValidationOnInput(s,h)})}),t.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{St(l),i(void 0)})];s.title=e.title,s.value=e.value||"",s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.placeholder=e.placeHolder,s.password=!!e.password,s.ignoreFocusOut=!!e.ignoreFocusLost,s.show()})}createQuickPick(){const e=this.getUI(!0);return new r2(e)}createInputBox(){const e=this.getUI(!0);return new skt(e)}createQuickWidget(){const e=this.getUI(!0);return new okt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",_a(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(nt.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),_a(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();kee.tooltip=s?g(EL,5,"Back ({0})",s):g(EL,6,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,s=i&&!lMe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o?.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}focus(){if(this.isVisible()){const e=this.getUI();e.inputBox.enabled?e.inputBox.setFocus():e.list.domFocus()}}toggle(){this.isVisible()&&this.controller instanceof r2&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.isDisplayed()&&(this.getUI().list.focus(e?Wo.Next:Wo.Previous),t&&this.controller instanceof r2&&(this.controller.quickNavigate=t))}async accept(e={alt:!1,ctrlCmd:!1}){this.keyMods.alt=e.alt,this.keyMods.ctrlCmd=e.ctrlCmd,this.onDidAcceptEmitter.fire()}async back(){this.onDidTriggerButtonEmitter.fire(this.backButton)}async cancel(){this.hide()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Kbe.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},Kbe=oN,oN.MAX_WIDTH=600,oN);Ybe=Kbe=D([_(1,bg),_(2,be),_(3,Pe)],Ybe);let Vee=class extends zMe{get backButton(){return this.controller.backButton}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Pbe))),this._quickAccess}constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=o,this._onShow=this._register(new I),this.onShow=this._onShow.event,this._onHide=this._register(new I),this.onHide=this._onHide.event,this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(fr).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Obe))},s=this._register(this.instantiationService.createInstance(Ybe,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{gt(e.activeContainer)===gt(s.container)&&s.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Y(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=qe.None){return this.controller.pick(e,t,i)}input(e={},t=qe.None){return this.controller.input(e,t)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}createQuickWidget(){return this.controller.createQuickWidget()}focus(){this.controller.focus()}toggle(){this.controller.toggle()}navigate(e,t){this.controller.navigate(e,t)}accept(e){return this.controller.accept(e)}back(){return this.controller.back()}cancel(){return this.controller.cancel()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Ye(mWe),quickInputForeground:Ye(M_t),quickInputTitleBackground:Ye(N_t),widgetBorder:Ye(UU),widgetShadow:Ye(__)},inputBox:eV,toggle:See,countBadge:tXe,button:yQ,progressBar:eXe,keybindingLabel:RDt,list:CO({listBackground:mWe,listFocusBackground:$k,listFocusForeground:zk,listInactiveFocusForeground:zk,listInactiveSelectionIconForeground:JB,listInactiveFocusBackground:$k,listFocusOutline:co,listInactiveFocusOutline:co}),pickerGroup:{pickerGroupBorder:Ye(P_t),pickerGroupForeground:Ye(EKe)}}}};Vee=D([_(0,be),_(1,Pe),_(2,pn),_(3,bg),_(4,Re)],Vee);let Jbe=class extends Vee{constructor(e,t,i,s,o,r){super(t,i,s,new Hwe(e.getContainerDomNode(),o),r),this.host=void 0;const a=M7.get(e);if(a){const c=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return c.getDomNode()},getContainer(){return c.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[c.getDomNode()]},get activeContainer(){return c.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return T.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return T.None},get onDidAddContainer(){return T.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Jbe=D([_(1,be),_(2,Pe),_(3,pn),_(4,jt),_(5,Re)],Jbe);let R7=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Jbe,e);this.mapEditorToService.set(e,t),cw(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}createQuickWidget(){return this.activeService.createQuickWidget()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};R7=D([_(0,be),_(1,jt)],R7);const Mae=class Mae{static get(e){return e.getContribution(Mae.ID)}constructor(e){this.editor=e,this.widget=new Xbe(this.editor)}dispose(){this.widget.dispose()}};Mae.ID="editor.controller.quickInput";let M7=Mae;const Nae=class Nae{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Nae.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Yf.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Nae.ID="editor.contrib.quickInputWidget";let Xbe=Nae;vn(M7.ID,M7,mi.Lazy);class d0t{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function h0t(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const u=_0t(d.token,h.token);return u!==0?u:d.index-h.index});let t=ar.None,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==ar.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new f0t;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),c=new ePe(t,r,a),l=new tPe(c);for(let d=0,h=n.length;d"u"){const s=this._match(t),o=m0t(t);i=(s.metadata|o<<$i.TOKEN_TYPE_OFFSET)>>>0,this._cache.set(t,i)}return(i|e<<$i.LANGUAGEID_OFFSET)>>>0}}const p0t=/\b(comment|string|regex|regexp)\b/;function m0t(n){const e=n.match(p0t);if(!e)return Ar.Other;switch(e[1]){case"comment":return Ar.Comment;case"string":return Ar.String;case"regex":return Ar.RegEx;case"regexp":return Ar.RegEx}throw new Error("Unexpected match for standard token type!")}function _0t(n,e){return ne?1:0}class ePe{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<$i.FONT_STYLE_OFFSET|this._foreground<<$i.FOREGROUND_OFFSET|this._background<<$i.BACKGROUND_OFFSET)>>>0}clone(){return new ePe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==ar.NotSet&&(this._fontStyle=e),t!==Ad.None&&(this._foreground=t),i!==Ad.None&&(this._background=i),this.metadata=(this._fontStyle<<$i.FONT_STYLE_OFFSET|this._foreground<<$i.FOREGROUND_OFFSET|this._background<<$i.BACKGROUND_OFFSET)>>>0}}class v0t{constructor(e,t=new Map){if(this.mainRule=e,t instanceof Map)this.children=t;else{this.children=new Map;for(const i in t)this.children.set(i,t[i])}}}class tPe{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}toExternalThemeTrieElement(){const e=new Map;return this._children.forEach((t,i)=>{e.set(i,t.toExternalThemeTrieElement())}),new v0t(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let c=this._children.get(r);typeof c>"u"&&(c=new tPe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,s)}}function w0t(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>$t(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>$t(o.format)&&$t(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:P.parse(o.location)}))}}n.fromJSONObject=t})(TUe||(TUe={}));class A0t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:g(N7,0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:g(N7,1,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${$e.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];const t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enum.splice(t,1),this.iconReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,t){const i=this.iconFontsById[e];return i||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;$e.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${$e.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!$e.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const Iz=new A0t;it.add(WXe.IconContribution,Iz);function Ki(n,e,t,i){return Iz.registerIcon(n,e,t,i)}function iPe(){return Iz}function E0t(){const n=FQe();for(const e in n){const t="\\"+n[e].toString(16);Iz.registerIcon(e,{fontCharacter:t})}}E0t();const HXe="vscode://schemas/icons",UXe=it.as(eL.JSONContribution);UXe.registerSchema(HXe,Iz.getIconSchema());const RUe=new yn(()=>UXe.notifySchemaChanged(HXe),200);Iz.onDidChange(()=>{RUe.isScheduled()||RUe.schedule()});const VXe=Ki("widget-close",Ce.close,g(N7,2,"Icon for the close action in widgets.")),x0t=Ki("goto-previous-location",Ce.arrowUp,g(N7,3,"Icon for goto previous editor location.")),D0t=Ki("goto-next-location",Ce.arrowDown,g(N7,4,"Icon for goto next editor location."));$e.modify(Ce.sync,"spin");$e.modify(Ce.loading,"spin");function k0t(n){const e=new Z,t=e.add(new I),i=iPe();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new zXe,o={},r=[],a=[];for(const c of i.getIcons()){const l=s.getIcon(c);if(!l)continue;const d=l.font,h=`--vscode-icon-${c.id}-font-family`,u=`--vscode-icon-${c.id}-content`;d?(o[d.id]=d.definition,a.push(`${h}: ${qY(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${qY(d.id)}; }`)):(a.push(`${u}: '${l.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; }`))}for(const c in o){const l=o[c],d=l.weight?`font-weight: ${l.weight};`:"",h=l.style?`font-style: ${l.style};`:"",u=l.src.map(f=>`${uf(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${qY(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` -`)}}}class zXe{getIcon(e){const t=iPe();let i=e.defaults;for(;$e.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Ck="vs",B$="vs-dark",zW="hc-black",$W="hc-light",$Xe=it.as(DMe.ColorContribution),I0t=it.as(OKe.ThemingContribution);class GXe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(AJ(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get label(){return this.themeName}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,fe.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Zbe(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,fe.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=$Xe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ck:return sf.LIGHT;case zW:return sf.HIGH_CONTRAST_DARK;case $W:return sf.HIGH_CONTRAST_LIGHT;default:return sf.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Zbe(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=BXe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Xf.getForeground(o),a=Xf.getFontStyle(o);return{foreground:r,italic:!!(a&ar.Italic),bold:!!(a&ar.Bold),underline:!!(a&ar.Underline),strikethrough:!!(a&ar.Strikethrough)}}get tokenColorMap(){return[]}}function AJ(n){return n===Ck||n===B$||n===zW||n===$W}function Zbe(n){switch(n){case Ck:return b0t;case B$:return C0t;case zW:return y0t;case $W:return S0t}}function hK(n){const e=Zbe(n);return new GXe(n,e)}class L0t extends ${constructor(){super(),this._onColorThemeChange=this._register(new I),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onFileIconThemeChange=this._register(new I),this.onDidFileIconThemeChange=this._onFileIconThemeChange.event,this._onProductIconThemeChange=this._register(new I),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new zXe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ck,hK(Ck)),this._knownThemes.set(B$,hK(B$)),this._knownThemes.set(zW,hK(zW)),this._knownThemes.set($W,hK($W));const e=this._register(k0t(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ck),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),pZ(yi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return P9(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=od(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),$.None}_registerShadowDomContainer(e){const t=od(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Ck),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=yi.matchMedia("(forced-colors: active)").matches;if(e!==pS(this._theme.type)){let t;rde(this._theme.type)?t=e?zW:B$:t=e?$W:Ck,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};I0t.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of $Xe.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${tde(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${s.join(` -`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(w0t(o)),this._themeCSS=e.join(` -`),this._updateCSS(),dc.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Iw=ae("themeService");let eCe=class extends ${constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=Kd.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._accessibilityModeEnabledContext=Xq.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=yi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(pe(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===Kd.Enabled}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}alwaysUnderlineAccessKeys(){return Promise.resolve(!1)}getAccessibilitySupport(){return this._accessibilitySupport}setAccessibilitySupport(e){this._accessibilitySupport!==e&&(this._accessibilitySupport=e,this._onDidChangeScreenReaderOptimized.fire())}alert(e){sa(e)}status(e){Cu(e)}};eCe=D([_(0,Pe),_(1,bg),_(2,Re)],eCe);var _B,TD;const qXe="vs/platform/actions/common/menuService";let tCe=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new iCe(i)}createMenu(e,t,i){return new sCe(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};tCe=D([_(0,ji),_(1,ti),_(2,on)],tCe);var rN;let iCe=(rN=class{constructor(e){this._storageService=e,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(ke.PROFILE,_B._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),s=this._data[e.id]?.includes(t)??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Rct(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(_B._key,e,ke.PROFILE,ln.USER)}finally{this._ignoreChangeEvent=!1}}},_B=rN,rN._key="menu.hiddenCommands",rN);iCe=_B=D([_(0,on)],iCe);let nCe=TD=class{constructor(e,t,i,s,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._keybindingService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Xs.getMenuItems(this._id);let t;e.sort(TD._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(TD._fillInKbExprKeys(e.when,this._structureContextKeys),lR(e)){if(e.command.precondition&&TD._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;TD._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Xs.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=lR(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=T0t(this._id,c?a.command:a,this._hiddenStates);if(c){const d=QXe(a.command.id,a.when,this._commandService,this._keybindingService);(r??=[]).push(new id(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new TD(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Kr.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new uS(a,l,h))}}r&&r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:TD._compareTitles(lR(e)?e.command.title:e.title,lR(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};nCe=TD=D([_(3,ji),_(4,ti),_(5,Pe)],nCe);let sCe=class{constructor(e,t,i,s,o,r){this._disposables=new Z,this._menuInfo=new nCe(e,t,i.emitEventsForSubmenuChanges,s,o,r);const a=new yn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Xs.onDidChangeMenu(h=>{h.has(e)&&a.schedule()}));const c=this._disposables.add(new Z),l=h=>{let u=!1,f=!1,p=!1;for(const m of h)if(u=u||m.isStructuralChange,f=f||m.isEnablementChange,p=p||m.isToggleChange,u&&f&&p)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p}},d=()=>{c.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),p=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||p)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p})})),c.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new Fle({onWillAddFirstListener:d,onDidRemoveLastListener:c.clear.bind(c),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};sCe=D([_(3,ji),_(4,ti),_(5,Pe)],sCe);function T0t(n,e,t){const i=kgt(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=_l({id:`hide/${n.id}/${i}`,label:g(qXe,0,"Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=_l({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function QXe(n,e=void 0,t,i){return _l({id:`configureKeybinding/${n}`,label:g(qXe,1,"Configure Keybinding"),run(){const o=!!!i.lookupKeybinding(n)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${n}`+(o?` +when:${o}`:""))}})}var oCe,aN;let rCe=(aN=class extends ${constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(TS||HQe)&&this.installWebKitWriteTextWorkaround(),this._register(T.runAndSubscribe(Vb,({window:i,disposables:s})=>{s.add(pe(i.document,"copy",()=>this.clearResources()))},{window:yi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new sd;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ax().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(pe(t,"click",e)),i.add(pe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await ax().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Kg(),i=t.activeElement,s=t.body.appendChild(we("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),Ra(i)&&i.focus(),t.body.removeChild(s)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await ax().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Ed(e.substring(0,oCe.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},oCe=aN,aN.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,aN);rCe=oCe=D([_(0,bg),_(1,Ze)],rCe);const Mu=ae("clipboardService"),R0t="vs/platform/contextkey/browser/contextKeyService",W$="data-keybinding-context";let nPe=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}updateParent(e){this._parent=e}collectAllValues(){let e=this._parent?this._parent.collectAllValues():Object.create(null);return e={...e,...this._value},delete e._contextId,e}};const Pae=class Pae extends nPe{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};Pae.INSTANCE=new Pae;let cV=Pae;const J8=class J8 extends nPe{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Su.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===Ot.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new cCe(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...fi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new cCe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(J8._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(J8._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}collectAllValues(){const e=Object.create(null);return this._values.forEach((t,i)=>e[i]=t),{...e,...super.collectAllValues()}}};J8._keyPrefix="config.";let aCe=J8;class M0t{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class MUe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class cCe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class N0t{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function P0t(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class jXe extends ${constructor(e){super(),this._onDidChangeContext=this._register(new r1({merge:t=>new N0t(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}get contextId(){return this._myContextId}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new M0t(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new F0t(this,e)}createOverlay(e=fi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new sPe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new MUe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new MUe(e))}getContext(e){return this._isDisposed?cV.INSTANCE:this.getContextValuesContainer(O0t(e))}dispose(){super.dispose(),this._isDisposed=!0}}let lCe=class extends jXe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new aCe(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._contexts.get(e)||cV.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new nPe(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};lCe=D([_(0,Re)],lCe);class F0t extends jXe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Dn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(W$)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(W$,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;P0t(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(W$),super.dispose())}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}updateParent(e){if(this._parent===e)return;const t=this._parent.getContextValuesContainer(this._myContextId),i=t.collectAllValues();this._parent=e,this._updateParentChangeListener();const s=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(s);const o=t.collectAllValues(),r={...f9(i,o),...f9(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new cCe(a))}}class NUe{constructor(e,t){this.parent=e,this.overlay=t}getValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getValue(e)}}class sPe{get contextId(){return this.parent.contextId}get onDidChangeContext(){return this.parent.onDidChangeContext}constructor(e,t){this.parent=e,this.overlay=new Map(t)}bufferChangeEvents(e){this.parent.bufferChangeEvents(e)}createKey(){throw new Error("Not supported.")}getContext(e){return new NUe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new NUe(t,this.overlay)}contextMatchesRules(e){const t=this.getContextValuesContainer(this.contextId);return e?e.evaluate(t):!0}getContextKeyValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getContextKeyValue(e)}createScoped(){throw new Error("Not supported.")}createOverlay(e=fi.empty()){return new sPe(this,e)}updateParent(){throw new Error("Not supported.")}}function O0t(n){for(;n;){if(n.hasAttribute(W$)){const e=n.getAttribute(W$);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function B0t(n,e,t){n.get(Pe).createKey(String(e),W0t(t))}function W0t(n){return AU(n,e=>{if(typeof e=="object"&&e.$mid===Fs.Uri)return P.revive(e).toString();if(e instanceof P)return e.toString()})}yt.registerCommand("_setContext",B0t);yt.registerCommand({id:"getContextKeyInfo",handler(){return[...Y.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:g(R0t,0,"A command that returns information about context keys"),args:[]}});yt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Y.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let H0t=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class PUe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new H0t(t,e),this._nodes.set(t,i)),i}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +`),this.list.style(e)}domFocus(){this.list.domFocus()}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}getSelectedElements(){return this.list.getSelectedElements()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}setFocus(e,t){this.list.setFocus(e,t)}focusNext(e=1,t=!1,i){this.list.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.list.focusPrevious(e,t,i)}focusNextPage(e){return this.list.focusNextPage(e)}focusPreviousPage(e){return this.list.focusPreviousPage(e)}focusFirst(e){this.list.focusFirst(e)}focusLast(e){this.list.focusLast(e)}getFocus(){return this.list.getFocus()}getFocusedElements(){return this.list.getFocusedElements()}getRelativeTop(e){return this.list.getRelativeTop(e)}reveal(e,t){this.list.reveal(e,t)}dispose(){this.disposables.dispose()}};gse.InstanceCount=0;let D_e=gse;var qs;(function(s){s[s.Hidden=0]="Hidden",s[s.Visible=1]="Visible",s[s.Recurse=2]="Recurse"})(qs||(qs={}));var Nf;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Nf||(Nf={}));var R1;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(R1||(R1={}));var M1;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(M1||(M1={}));class Zl extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class QLe{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function jLe(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function S3(s){switch(s){case!0:return qs.Visible;case!1:return qs.Hidden;default:return s}}function The(s){return typeof s.collapsible=="boolean"}class Fxt{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new F7,this._onDidChangeCollapseState=new I,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new I,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new I,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Mh(kGe),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=n.allowNonCollapsibleParents??!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:qs.Visible,visible:!0,filterData:void 0}}splice(e,t,i=hi.empty(),n={}){if(e.length===0)throw new Zl(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=hi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],l=t[t.length-1],d=new Vw({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,l),...c,...a.children.slice(l+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),u=(m,v,b)=>{if(r>0)for(let w=0;wb.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,hi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=hi.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=hi.map(i,A=>this.createTreeNode(A,a,a.visible?qs.Visible:qs.Hidden,l,h,n)),f=e[e.length-1];let p=0;for(let A=f;A>=0&&Ar.getId(A.element).toString())):a.lastDiffIds=a.children.map(A=>r.getId(A.element).toString()):a.lastDiffIds=void 0;let y=0;for(const A of w)A.visible&&y++;if(y!==0)for(let A=f+m.length;AL+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-A),this.list.splice(c,A,h)}if(w.length>0&&o){const A=L=>{o(L),L.children.forEach(A)};w.forEach(A)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:w});let C=a;for(;C;){if(C.visibility===qs.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Zl(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Zl(this.user,"Invalid tree location");const{listIndex:i}=this.getTreeNodeWithListIndex(e);this.list.updateElementHeight(i,t)}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!The(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let c=0;c-1){a=-1;break}else a=c;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=r-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(The(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!The(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:qs.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,n&&o.push(a);const l=e.children||hi.empty(),d=n&&c!==qs.Hidden&&!a.collapsed;let h=0,u=1;for(const f of l){const p=this.createTreeNode(f,a,c,d,o,r);a.children.push(p),u+=p.renderNodeCount,p.visible&&(p.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=c===qs.Recurse?h>0:c===qs.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,n&&o.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?qs.Visible:qs.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===qs.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==qs.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,n&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===qs.Recurse?a:o===qs.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):qs.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?qs.Visible:qs.Hidden):jLe(i)?(e.filterData=i.data,S3(i.visibility)):(e.filterData=void 0,S3(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Zl(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Zl(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Zl(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function Lhe(s){return s instanceof m6?new Bxt(s):s}class Wxt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=V.None,this.disposables=new Z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(Lhe(e),t)}onDragOver(e,t,i,n,o,r=!0){const a=this.dnd.onDragOver(Lhe(e),t&&t.element,i,n,o),c=this.autoExpandNode!==t;if(c&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(c&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=jy(()=>{const f=this.modelProvider(),p=f.getNodeLocation(t);f.isCollapsed(p)&&f.setCollapsed(p,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,p=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:p,feedback:[i]}}return a}if(a.bubble===M1.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),b=m&&f.getListIndex(m);return this.onDragOver(e,v,b,n,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Au(h,h+u)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Lhe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Hxt(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Wxt(s,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class YLe{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}class x5{static lift(e){return e instanceof x5?e:new x5(e)}static empty(e=0){return new x5({focus:[],selection:[],expanded:Object.create(null),scrollTop:e})}constructor(e){if(this.focus=new Set(e.focus),this.selection=new Set(e.selection),e.expanded instanceof Array){this.expanded=Object.create(null);for(const t of e.expanded)this.expanded[t]=1}else this.expanded=e.expanded;this.expanded=e.expanded,this.scrollTop=e.scrollTop}toJSON(){return{focus:Array.from(this.focus),selection:Array.from(this.selection),expanded:this.expanded,scrollTop:this.scrollTop}}}var sW;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(sW||(sW={}));class Uxt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=M.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Hz=class Hz{constructor(e,t,i,n,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Hz.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=V.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),M.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Ka(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==sW.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);if(this.indentGuidesDisposable.dispose(),t){const i=new Z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=re(e,fe(".monaco-tl-row")),i=re(t,fe(".monaco-tl-indent")),n=re(t,fe(".monaco-tl-twistie")),o=re(t,fe(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:V.None,templateData:r}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,n),typeof n=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Hz.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...We.asClassNameArray(ve.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...We.asClassNameArray(ve.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Ms(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),r=n.getParentNodeLocation(o);if(!r)break;const a=n.getNode(r),c=fe(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&c.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(c):t.indent.insertBefore(c,t.indent.firstElementChild),this.renderedIndentGuides.add(a,c),i.add(Ee(()=>this.renderedIndentGuides.delete(a,c))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),bt(this.disposables)}};Hz.DefaultIndent=8;let k_e=Hz;class Vxt{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Z,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=qs.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?qs.Visible:qs.Hidden:jLe(r)?i=S3(r.visibility):i=r,i===qs.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:N_.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:N_.Default,visibility:i};let c;if(this.tree.findMatchType===bb.Contiguous){const l=a.toLowerCase().indexOf(this._lowercasePattern);if(l>-1){c=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)c.push(l+d-1)}}else c=Uk(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,o.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===Zf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):qs.Recurse:{data:N_.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){bt(this.disposables)}}class zxt extends ZA{constructor(e){super({icon:ve.listFilter,title:g(4961,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $xt extends ZA{constructor(e){super({icon:ve.searchFuzzy,title:g(4962,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Gxt={inputBoxStyles:fxt,toggleStyles:Kje,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var Zf;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(Zf||(Zf={}));var bb;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(bb||(bb={}));let Kxt=class extends V{set mode(e){this.modeToggle.checked=e===Zf.Filter,this.findInput.inputBox.setPlaceHolder(e===Zf.Filter?g(4963,"Type to filter"):g(4964,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===bb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,n,o,r){super(),this.tree=t,this.elements=Bt(".monaco-tree-type-filter",[Bt(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),Bt(".monaco-tree-type-filter-input@findInput"),Bt(".monaco-tree-type-filter-actionbar@actionbar")]),this.width=0,this.right=0,this.top=0,this._onDidDisable=new I,this.onDidDisable=this._onDidDisable.event,e.appendChild(this.elements.root),this._register(Ee(()=>this.elements.root.remove()));const a=r?.styles??Gxt;a.listFilterWidgetBackground&&(this.elements.root.style.backgroundColor=a.listFilterWidgetBackground),a.listFilterWidgetShadow&&(this.elements.root.style.boxShadow=`0 0 8px 2px ${a.listFilterWidgetShadow}`);const c=this._register($k());this.modeToggle=this._register(new zxt({...a.toggleStyles,isChecked:n===Zf.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new $xt({...a.toggleStyles,isChecked:o===bb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=M.map(this.modeToggle.onChange,()=>this.modeToggle.checked?Zf.Filter:Zf.Highlight,this._store),this.onDidChangeMatchType=M.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?bb.Fuzzy:bb.Contiguous,this._store),this.findInput=this._register(new b3(this.elements.findInput,i,{label:g(4964,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new hd(this.elements.actionbar)),this.mode=n;const l=this._register(new ii(this.findInput.inputBox.inputElement,"keydown")),d=M.chain(l.event,p=>p.map(m=>new En(m)));this._register(d(p=>{if(p.equals(S.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(S.DownArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.isAtLastInHistory()||this.findInput.inputBox.isNowhereInHistory()?(this.findInput.inputBox.addToHistory(),this.tree.domFocus()):this.findInput.inputBox.showNextValue();return}if(p.equals(S.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new rn("close",g(4965,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new ii(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new ii(ct(p),"mousemove")),b=m.add(new ii(ct(p),"mouseup")),w=this.right,y=p.pageX,C=this.top,A=p.pageY;this.elements.grab.classList.add("grabbing");const L=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=P=>{const R=P.pageX-y;this.right=w-R;const z=P.pageY-A;this.top=C+z,this.layout()};m.add(v.event(k)),m.add(b.event(P=>{k(P),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=L,m.dispose()}))}));const f=M.chain(this._register(new ii(this.elements.grab,"keydown")).event,p=>p.map(m=>new En(m)));this._register(f(p=>{let m,v;if(p.keyCode===S.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===S.RightArrow?m=0:p.keyCode===S.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===S.UpArrow?v=0:p.keyCode===S.DownArrow&&(v=Number.POSITIVE_INFINITY),m!==void 0&&(p.preventDefault(),p.stopPropagation(),this.right=m,this.layout()),v!==void 0){p.preventDefault(),p.stopPropagation(),this.top=v;const b=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=b},0)}})),this.onDidChangeValue=this.findInput.onDidChange}getHistory(){return this.findInput.inputBox.getHistory()}focus(){this.findInput.focus()}select(){this.findInput.select(),this.findInput.inputBox.addToHistory(!0)}layout(e=this.width){this.width=e,this.right=Ka(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Ka(this.top,0,24),this.elements.root.style.top=`${this.top}px`}showMessage(e){this.findInput.showMessage(e)}clearMessage(){this.findInput.clearMessage()}async dispose(){this._onDidDisable.fire(),this.elements.root.classList.add("disabled"),await Sr(300),super.dispose()}},qxt=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,r={}){this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=r,this._pattern="",this.previousPattern="",this.width=0,this._onDidChangeMode=new I,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new I,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new I,this.onDidChangePattern=this._onDidChangePattern.event,this._onDidChangeOpenState=new I,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Z,this.disposables=new Z,this._mode=e.options.defaultFindMode??Zf.Highlight,this._matchType=e.options.defaultFindMatchType??bb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}open(){if(this.widget){this.widget.focus(),this.widget.select();return}this.widget=new Kxt(this.view.getHTMLElement(),this.tree,this.contextViewProvider,this.mode,this.matchType,{...this.options,history:this._history}),this.enabledDisposables.add(this.widget),this.widget.onDidChangeValue(this.onDidChangeValue,this,this.enabledDisposables),this.widget.onDidChangeMode(e=>this.mode=e,void 0,this.enabledDisposables),this.widget.onDidChangeMatchType(e=>this.matchType=e,void 0,this.enabledDisposables),this.widget.onDidDisable(this.close,this,this.enabledDisposables),this.widget.layout(this.width),this.widget.focus(),this.widget.value=this.previousPattern,this.widget.select(),this._onDidChangeOpenState.fire(!0)}close(){this.widget&&(this._history=this.widget.getHistory(),this.widget=void 0,this.enabledDisposables.clear(),this.previousPattern=this.pattern,this.onDidChangeValue(""),this.tree.domFocus(),this._onDidChangeOpenState.fire(!1))}onDidChangeValue(e){this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,i=>!N_.isDefault(i.filterData));const t=this.tree.getFocus();if(t.length>0){const i=t[0];this.tree.getRelativeTop(i)===null&&this.tree.reveal(i,.5)}this.render()}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:Xl.WARNING,content:g(4966,"No elements found.")}):this.widget?.showMessage({type:Xl.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!N_.isDefault(e.filterData)}layout(e){this.width=e,this.widget?.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Qxt(s,e){return s.position===e.position&&iYe(s,e)}function iYe(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class jxt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return is(this.stickyNodes,e.stickyNodes,Qxt)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!is(this.stickyNodes,e.stickyNodes,iYe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class Yxt{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let Z2e=class extends V{constructor(e,t,i,n,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new Yxt,this._widget=this._register(new Jxt(i.getScrollableElement(),i,e,n,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}get count(){return this._widget.count}getNode(e){return this._widget.getNode(e)}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,n);const r=this.constrainStickyNodes(t);return r.length?new jxt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===null&&this.view.firstVisibleIndex===e&&e+1c&&t<=c?c-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const n=this.model.getListRenderCount(t),o=i+n-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let o=0;ot.node===e)}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const n=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${n.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:c,disposable:l}=this.createElement(a,r,e.count);o[r]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}createElement(e,t,i){const n=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),c=this.treeRenderers.find(u=>u.templateId===a);if(!c)throw new Error(`No renderer found for template id ${a}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=c.renderTemplate(o);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{r.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return V.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:nd(o),a=ai(l=>{const d=l.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}getFocus(){return this.stickyScrollFocus.getFocus()}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class Xxt extends V{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new I,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new I,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(ue(this.container,"focus",()=>this.onFocus())),this._register(ue(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!m3(t)&&!S5(t)){this.focusedLast()&&this.view.domFocus();return}if(!d_(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const n=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!m3(t)&&!S5(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const n=Ka(i,0,t.count-1);this.setFocus(n)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=o-r}getFocus(){if(!(!this.state||this.focusedIndex===-1))return this.state.stickyNodes[this.focusedIndex].node.element}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function gP(s){let e=R1.Unknown;return pq(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=R1.Twistie:pq(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=R1.Element:pq(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=R1.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function Zxt(s){const e=m3(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function Vq(s,e){e(s),s.children.forEach(t=>Vq(t,e))}class Rhe{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&is(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const n=this;this._onDidChange.fire({get elements(){return n.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const c=this.createNodeSet(),l=d=>c.delete(d);t.forEach(d=>Vq(d,l)),this.set([...c.values()]);return}const i=new Set,n=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>Vq(c,n));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>Vq(c,r));const a=[];for(const c of this.nodes){const l=this.identityProvider.getId(c.element).toString();if(!i.has(l))a.push(c);else{const h=o.get(l);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const c=this.getFirstViewElementWithTrait();c&&a.push(c)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class eDt extends Mje{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Tje(e.browserEvent.target)||nA(e.browserEvent.target)||aV(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=S5(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),n){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(jAt(e.browserEvent.target)||YAt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!m3(t)&&!S5(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!m3(t)&&!S5(t)){super.onContextMenu(e);return}}}class tDt extends Xa{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new eDt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&n.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),n.length>0&&super.setFocus(ja([...super.getFocus(),...n])),o.length>0&&super.setSelection(ja([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var oW;(function(s){s[s.Tree=0]="Tree",s[s.StickyScroll=1]="StickyScroll"})(oW||(oW={}));class nYe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseClick(){return M.map(this.view.onMouseClick,gP)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,gP),e=>e.target!==R1.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,gP)}get onMouseOut(){return M.map(this.view.onMouseOut,gP)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,Zxt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onTap(){return M.map(this.view.onTap,gP)}get onPointer(){return M.map(this.view.onPointer,gP)}get onKeyDown(){return this.view.onKeyDown}get onKeyUp(){return this.view.onKeyUp}get onKeyPress(){return this.view.onKeyPress}get onDidFocus(){return this.view.onDidFocus}get onDidBlur(){return this.view.onDidBlur}get onDidChangeModel(){return M.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??Zf.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??bb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get onDidChangeFindPattern(){return this.findController?this.findController.onDidChangePattern:M.None}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){this._user=e,this._options=o,this.eventBufferer=new F7,this.onDidChangeFindOpenState=M.None,this.onDidChangeStickyScrollFocused=M.None,this.disposables=new Z,this._onWillRefilter=new I,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new I,this.onDidUpdateOptions=this._onDidUpdateOptions.event,this.treeDelegate=new YLe(i);const r=new Xge,a=new Xge,c=this.disposables.add(new Uxt(a.event)),l=new P7;this.renderers=n.map(p=>new k_e(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Vxt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new Rhe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Rhe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Rhe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new tDt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...Hxt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=M.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const u=this.disposables.add(new I),f=this.disposables.add(new Mh(0));if(this.disposables.add(M.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);u.fire([...p.values()])})})),a.input=u.event,o.keyboardSupport!==!1){const p=M.chain(this.view.onKeyDown,m=>m.filter(v=>!nA(v.target)).map(v=>new En(v)));M.chain(p,m=>m.filter(v=>v.keyCode===S.LeftArrow))(this.onLeftArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.RightArrow))(this.onRightArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.Space))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new qxt(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=M.None,this.onDidChangeFindMatchType=M.None;o.enableStickyScroll&&(this.stickyScrollController=new Z2e(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=gl(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===sW.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===sW.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new Z2e(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=M.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}updateWidth(e){const t=this.model.getListIndex(e);t!==-1&&this.view.updateWidth(t)}getHTMLElement(){return this.view.getHTMLElement()}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollLeft(){return this.view.scrollLeft}set scrollLeft(e){this.view.scrollLeft=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleElement(){let e=this.view.firstVisibleIndex;return this.stickyScrollController&&(e+=this.stickyScrollController.count),e<0||e>=this.view.length?void 0:this.view.element(e).element}get lastVisibleElement(){const e=this.view.lastVisibleIndex;return this.view.element(e).element}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}get selectionSize(){return this.selection.getNodes().length}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}isDOMFocused(){return av(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),lc(t)&&this.findController?.layout(t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=Iy(e.listFocusAndSelectionOutline,Iy(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}expandAll(){this.model.setCollapsed(this.model.rootRef,!1,!0)}collapseAll(){this.model.setCollapsed(this.model.rootRef,!0,!0)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}expandTo(e){this.model.expandTo(e)}triggerTypeNavigation(){this.view.triggerTypeNavigation()}openFind(){this.findController?.open()}closeFind(){this.findController?.close()}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setAnchor(e){if(typeof e>"u")return this.view.setAnchor(void 0);this.eventBufferer.bufferEvents(()=>{const t=this.model.getNode(e);this.anchor.set([t]);const i=this.model.getListIndex(e);i>-1&&this.view.setAnchor(i,!0)})}getAnchor(){return lm(this.anchor.get(),void 0)}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=d_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=d_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}getStickyScrollFocus(){const e=this.stickyScrollController?.getFocus();return e!==void 0?[e]:[]}getFocusedPart(){return this.stickyScrollController?.focusedLast()?oW.StickyScroll:oW.Tree}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}getRelativeTop(e){const t=this.model.getListIndex(e);if(t===-1)return null;const i=this.stickyScrollController?.getNode(this.getNode(e));return this.view.getRelativeTop(t,i?.position??this.stickyScrollController?.height)}getViewState(e=this.options.identityProvider){if(!e)throw new Zl(this._user,"Can't get tree view state without an identity provider");const t=r=>e.getId(r).toString(),i=x5.empty(this.scrollTop);for(const r of this.getFocus())i.focus.add(t(r));for(const r of this.getSelection())i.selection.add(t(r));const n=this.model.getNode(),o=[n];for(;o.length>0;){const r=o.shift();r!==n&&r.collapsible&&(i.expanded[t(r.element)]=r.collapsed?0:1),o.push(...r.children)}return i}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(c=>c.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}navigate(e){return new iDt(this.view,this.model,e)}dispose(){bt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class iDt{constructor(e,t,i){this.view=e,this.model=t,i?this.index=this.model.getListIndex(i):this.index=-1}current(){return this.index<0||this.index>=this.view.length?null:this.view.element(this.index).element}previous(){return this.index--,this.current()}next(){return this.index++,this.current()}first(){return this.index=0,this.current()}last(){return this.index=this.view.length-1,this.current()}}class JLe{get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Fxt(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=hi.empty(),i){const n=new Set,o=new Set,r=c=>{if(c.element===null)return;const l=c;if(n.add(l.element),this.nodes.set(l.element,l),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.add(d),this.nodesByIdentity.set(d,l)}i.onDidCreateNode?.(l)},a=c=>{if(c.element===null)return;const l=c;if(n.has(l.element)||this.nodes.delete(l.element),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(l)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=hi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),hi.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Nf.Collapsed||t.collapsed===Nf.PreserveOrCollapsed?r=!0:t.collapsed===Nf.Expanded||t.collapsed===Nf.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Nf.PreserveOrCollapsed||t.collapsed===Nf.PreserveOrExpanded?o=i.collapsed:t.collapsed===Nf.Collapsed?o=!0:t.collapsed===Nf.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:n,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getElementLocation(e);this.model.updateElementHeight(i,t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),hi.map(n,o=>({element:o.element,collapsible:o.collapsible,collapsed:o.collapsed,children:this.resortChildren(o,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e=null){const t=this.getElementLocation(e);return this.model.getLastElementAncestor(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Zl(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function zq(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:hi.map(hi.from(s.children),zq),collapsible:s.collapsible,collapsed:s.collapsed}}function $q(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=hi.consume(hi.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:hi.map(hi.concat(n,i),$q),collapsible:s.collapsible,collapsed:s.collapsed}}function I_e(s,e=0){let t;return eI_e(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function eWe(s){return I_e(s,0)}function sYe(s,e,t){return s.element===e?{...s,children:t}:{...s,children:hi.map(hi.from(s.children),i=>sYe(i,e,t))}}const nDt=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class sDt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new JLe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i){const n=i.diffIdentityProvider&&nDt(i.diffIdentityProvider);if(e===null){const p=hi.map(t,this.enabled?$q:zq);this._setChildren(null,p,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Zl(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),l=eWe(r),d=sYe(l,e,t),h=(this.enabled?$q:zq)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(is(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||hi.empty(),{diffIdentityProvider:n,diffDepth:1});return}const f=c.children.map(p=>p===r?h:p);this._setChildren(c.element,f,{diffIdentityProvider:n,diffDepth:r.depth-c.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=hi.map(i,eWe),o=hi.map(n,e?$q:zq);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=a=>{for(const c of a.element.elements)n.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)n.has(c)||this.nodes.delete(c)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e){const t=typeof e>"u"?void 0:this.getCompressedNode(e);return this.model.getLastElementAncestor(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getCompressedNode(e);i&&this.model.updateElementHeight(i,t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);return t}}const oDt=s=>s[s.length-1];class XLe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new XLe(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function rDt(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function aDt(s,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(s(t),i)}}}}class cDt{get onDidSplice(){return M.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return M.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return M.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||oDt;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new QLe(o=>new XLe(n,o)),this.model=new sDt(e,rDt(this.nodeMapper,t),aDt(n,i))}setChildren(e,t=hi.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}getLastElementAncestor(e){const t=this.model.getLastElementAncestor(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class ZLe extends nYe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=hi.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new JLe(e,t,i)}}class T_e{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}T_e.__decorator=D([Zt],T_e.prototype,"compressedTreeNodeProvider",null);class lDt{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let n=0;ni||n>=t-1&&tthis,a=new lDt(()=>this.model),c=n.map(l=>new T_e(r,a,l));super(e,t,i,c,{...dDt(r,o),stickyScrollDelegate:a})}setChildren(e,t=hi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new cDt(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function Mhe(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function L_e(s,e){return e.parent?e.parent===s?!0:L_e(s,e.parent):!1}function hDt(s,e){return s===e||L_e(s,e)||L_e(e,s)}class eRe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new eRe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class uDt{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function tWe(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function oK(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}function gDt(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,anchor:s.anchor,isStickyScroll:s.isStickyScroll}}class fDt extends m6{set context(e){this.data.context=e}get context(){return this.data.context}constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function Nhe(s){return s instanceof m6?new fDt(s):s}class pDt{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(Nhe(e),t)}onDragOver(e,t,i,n,o,r=!0){return this.dnd.onDragOver(Nhe(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(Nhe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function rYe(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new pDt(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:s.accessibilityProvider&&{...s.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>!!s.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))},filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{...s.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?qs.Visible:typeof s.defaultFindVisibility=="number"?s.defaultFindVisibility:typeof s.defaultFindVisibility>"u"?qs.Recurse:s.defaultFindVisibility(e.element)}}function R_e(s,e){e(s),s.children.forEach(t=>R_e(t,e))}class aYe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return M.map(this.tree.onDidChangeFocus,tWe)}get onDidChangeSelection(){return M.map(this.tree.onDidChangeSelection,tWe)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return M.map(this.tree.onMouseClick,oK)}get onMouseDblClick(){return M.map(this.tree.onMouseDblClick,oK)}get onContextMenu(){return M.map(this.tree.onContextMenu,gDt)}get onTap(){return M.map(this.tree.onTap,oK)}get onPointer(){return M.map(this.tree.onPointer,oK)}get onDidFocus(){return this.tree.onDidFocus}get onDidBlur(){return this.tree.onDidBlur}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidUpdateOptions(){return this.tree.onDidUpdateOptions}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get findMode(){return this.tree.findMode}set findMode(e){this.tree.findMode=e}get findMatchType(){return this.tree.findMatchType}set findMatchType(e){this.tree.findMatchType=e}get expandOnlyOnTwistieClick(){if(typeof this.tree.expandOnlyOnTwistieClick=="boolean")return this.tree.expandOnlyOnTwistieClick;const e=this.tree.expandOnlyOnTwistieClick;return t=>e(this.nodes.get(t===this.root.element?null:t)||null)}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new I,this._onDidChangeNodeSlowState=new I,this.nodeMapper=new QLe(a=>new eRe(a)),this.disposables=new Z,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?Nf.PreserveOrCollapsed:Nf.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=Mhe({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,o){const r=new YLe(i),a=n.map(l=>new uDt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=rYe(o)||{};return new ZLe(e,t,r,a,c)}updateOptions(e={}){this.tree.updateOptions(e)}get options(){return this.tree.options}getHTMLElement(){return this.tree.getHTMLElement()}get contentHeight(){return this.tree.contentHeight}get contentWidth(){return this.tree.contentWidth}get onDidChangeContentHeight(){return this.tree.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.tree.onDidChangeContentWidth}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollLeft(){return this.tree.scrollLeft}set scrollLeft(e){this.tree.scrollLeft=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}get lastVisibleElement(){return this.tree.lastVisibleElement.element}get ariaLabel(){return this.tree.ariaLabel}set ariaLabel(e){this.tree.ariaLabel=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(n=>n.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async updateChildren(e=this.root.element,t=!0,i=!1,n){await this._updateChildren(e,t,i,void 0,n)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(typeof this.root.element>"u")throw new Zl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,o),i)try{this.tree.rerender(r)}catch{}}resort(e=this.root.element,t=!0){this.tree.resort(this.getDataNode(e),t)}hasNode(e){return e===this.root.element||this.nodes.has(e)}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}updateElementHeight(e,t){const i=this.getDataNode(e);this.tree.updateElementHeight(i,t)}updateWidth(e){const t=this.getDataNode(e);this.tree.updateWidth(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Zl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),n}toggleCollapsed(e,t=!1){return this.tree.toggleCollapsed(this.getDataNode(e),t)}expandAll(){this.tree.expandAll()}async expandTo(e){if(!this.dataSource.getParent)throw new Error("Can't expand to element without getParent method");const t=[];for(;!this.hasNode(e);)e=this.dataSource.getParent(e),e!==this.root.element&&t.push(e);for(const i of hi.reverse(t))await this.expand(i);this.tree.expandTo(this.getDataNode(e))}collapseAll(){this.tree.collapseAll()}isCollapsible(e){return this.tree.isCollapsible(this.getDataNode(e))}isCollapsed(e){return this.tree.isCollapsed(this.getDataNode(e))}triggerTypeNavigation(){this.tree.triggerTypeNavigation()}openFind(){this.tree.openFind()}closeFind(){this.tree.closeFind()}refilter(){this.tree.refilter()}setAnchor(e){this.tree.setAnchor(typeof e>"u"?void 0:this.getDataNode(e))}getAnchor(){return this.tree.getAnchor()?.element}setSelection(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setFocus(i,t)}focusNext(e=1,t=!1,i){this.tree.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.tree.focusPrevious(e,t,i)}focusNextPage(e){return this.tree.focusNextPage(e)}focusPreviousPage(e){return this.tree.focusPreviousPage(e)}focusLast(e){this.tree.focusLast(e)}focusFirst(e){this.tree.focusFirst(e)}getFocus(){return this.tree.getFocus().map(t=>t.element)}getStickyScrollFocus(){return this.tree.getStickyScrollFocus().map(t=>t.element)}getFocusedPart(){return this.tree.getFocusedPart()}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getRelativeTop(e){return this.tree.getRelativeTop(this.getDataNode(e))}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Zl(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n)}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((o,r)=>{!n&&hDt(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let n;e.refreshPromise=new Promise(o=>n=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await Zs.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(hi.empty());else{const o=this.doGetChildren(e);if(vFe(o))n=Promise.resolve(o);else{const r=Sr(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=o.finally(()=>r.cancel())}}try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Fr(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return vFe(i)?this.processChildren(i):(t=Rr(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(vt))}setChildren(e,t,i,n){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const c=[],l=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=Mhe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Nf.PreserveOrExpanded&&c.push(m),m}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=h,i?f.collapsed?(m.children.forEach(v=>R_e(v,b=>this.nodes.delete(b.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&!f.collapsed&&c.push(m),m}const p=Mhe({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(p),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(p),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1||h&&p.defaultCollapseState===Nf.PreserveOrExpanded)&&c.push(p),p});for(const d of r.values())R_e(d,h=>this.nodes.delete(h.element));for(const d of l)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&l.length===1&&c.length===0&&(l[0].forceExpanded=!0,c.push(l[0])),c}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?hi.map(e.children,n=>this.asTreeElement(n,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}getViewState(){if(!this.identityProvider)throw new Zl(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),n=[],o=this.tree.getNode(),r=[o];for(;r.length>0;){const a=r.pop();a!==o&&a.collapsible&&!a.collapsed&&n.push(e(a.element.element)),r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class tRe{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new tRe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class mDt{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=bt(this.disposables)}}function _Dt(s){const e=s&&rYe(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class vDt extends aYe{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new QLe(c=>new tRe(c)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new YLe(i),a=n.map(l=>new mDt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=_Dt(o)||{};return new oYe(e,t,r,a,c)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}getViewState(){if(!this.identityProvider)throw new Zl(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),n=[],o=this.tree.getCompressedTreeNode(),r=[o];for(;r.length>0;){const a=r.pop();if(a!==o&&a.collapsible&&!a.collapsed)for(const c of a.element.elements)n.push(e(c.element));r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=f=>this.identityProvider.getId(f).toString(),o=f=>{const p=new Set;for(const m of f){const v=this.tree.getCompressedTreeNode(m===this.root?null:m);if(v.element)for(const b of v.element.elements)p.add(n(b.element))}return p},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const c=this.getSelection();let l=!1;const d=this.getFocus();let h=!1;const u=f=>{const p=f.element;if(p)for(let m=0;m{const i=this.filter.filter(t,qs.Visible),n=bDt(i);if(n===qs.Recurse)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===qs.Visible})),super.processChildren(e)}}function bDt(s){return typeof s=="boolean"?s?qs.Visible:qs.Hidden:jLe(s)?S3(s.visibility):S3(s)}class wDt extends nYe{constructor(e,t,i,n,o,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=o,this.nodesByIdentity=new Map,this.identityProvider=r.identityProvider}getInput(){return this.input}setInput(e,t){if(t&&!this.identityProvider)throw new Zl(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,hi.empty());return}if(!t){this._refresh(e);return}const i=[],n=[],o=a=>{const c=this.identityProvider.getId(a).toString();return!t.expanded[c]},r=a=>{const c=this.identityProvider.getId(a.element).toString();t.focus.has(c)&&i.push(a.element),t.selection.has(c)&&n.push(a.element)};this._refresh(e,o,r),this.setFocus(i),this.setSelection(n),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}updateChildren(e=this.input){if(typeof this.input>"u")throw new Zl(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const n=this.identityProvider.getId(i).toString(),o=this.nodesByIdentity.get(n);if(o)return o.collapsed}),this._refresh(e,t)}resort(e=this.input,t=!0){this.model.resort(e===this.input?null:e,t)}refresh(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}_refresh(e,t,i){let n;if(this.identityProvider){const o=new Set,r=i;i=a=>{const c=this.identityProvider.getId(a.element).toString();o.add(c),this.nodesByIdentity.set(c,a),r?.(a)},n=a=>{const c=this.identityProvider.getId(a.element).toString();o.has(c)||this.nodesByIdentity.delete(c)}}this.model.setChildren(e===this.input?null:e,this.iterate(e,t).elements,{onDidCreateNode:i,onDidDeleteNode:n})}iterate(e,t){const i=[...this.dataSource.getChildren(e)];return{elements:hi.map(i,o=>{const{elements:r,size:a}=this.iterate(o,t),c=this.dataSource.hasChildren?this.dataSource.hasChildren(o):void 0,l=a===0?void 0:t&&t(o);return{element:o,children:r,collapsible:c,collapsed:l}}),size:i.length}}createModel(e,t,i){return new JLe(e,t,i)}}const yDt=new Q("isMac",Qt,g(4967,"Whether the operating system is macOS")),CDt=new Q("isLinux",pr,g(4968,"Whether the operating system is Linux")),S6=new Q("isWindows",Qn,g(4969,"Whether the operating system is Windows")),iRe=new Q("isWeb",Wn,g(4970,"Whether the platform is a web browser")),SDt=new Q("isMacNative",Qt&&!Wn,g(4971,"Whether the operating system is macOS on a non-browser platform")),ADt=new Q("isIOS",dm,g(4972,"Whether the operating system is iOS")),EDt=new Q("isMobile",L6e,g(4973,"Whether the platform is a mobile web browser")),iWe=new Q("isDevelopment",!1,!0),xDt=new Q("productQualityType","",g(4974,"Quality type of VS Code")),yae="inputFocus",nRe=new Q(yae,!1,g(4975,"Whether keyboard focus is inside an input box")),lg=ae("listService");class DDt{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Z,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Nje(gl(),"").style(ON)),this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),av(e.getHTMLElement())&&this.setLastFocusedList(e),jr(e.onDidFocus(()=>this.setLastFocusedList(e)),Ee(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const A3=new Q("listScrollAtBoundary","none"),kDt=he.or(A3.isEqualTo("top"),A3.isEqualTo("both")),IDt=he.or(A3.isEqualTo("bottom"),A3.isEqualTo("both")),cYe=new Q("listFocus",!0),lYe=new Q("treestickyScrollFocused",!1),Cae=new Q("listSupportsMultiselect",!0),Sae=he.and(cYe,he.not(yae),lYe.negate()),sRe=new Q("listHasSelectionOrFocus",!1),oRe=new Q("listDoubleSelection",!1),rRe=new Q("listMultiSelection",!1),Aae=new Q("listSelectionNavigation",!1),TDt=new Q("listSupportsFind",!0),aRe=new Q("treeElementCanCollapse",!1),LDt=new Q("treeElementHasParent",!1),cRe=new Q("treeElementCanExpand",!1),RDt=new Q("treeElementHasChild",!1),MDt=new Q("treeFindOpen",!1),dYe="listTypeNavigationMode",hYe="listAutomaticKeyboardNavigation";function Eae(s,e){const t=s.createScoped(e.getHTMLElement());return cYe.bindTo(t),t}function xae(s,e){const t=A3.bindTo(s),i=()=>{const n=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&o?t.set("both"):n?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const HN="workbench.list.multiSelectModifier",Gq="workbench.list.openMode",sm="workbench.list.horizontalScrolling",lRe="workbench.list.defaultFindMode",dRe="workbench.list.typeNavigationMode",rJ="workbench.list.keyboardNavigation",Rb="workbench.list.scrollByPage",hRe="workbench.list.defaultFindMatchType",E3="workbench.tree.indent",aJ="workbench.tree.renderIndentGuides",Mb="workbench.list.smoothScrolling",Xy="workbench.list.mouseWheelScrollSensitivity",Zy="workbench.list.fastScrollSensitivity",cJ="workbench.tree.expandMode",lJ="workbench.tree.enableStickyScroll",dJ="workbench.tree.stickyScrollMaxItemCount";function eC(s){return s.getValue(HN)==="alt"}class NDt extends V{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=eC(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(HN)&&(this.useAltAsMultipleSelectionModifier=eC(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Lje(e)}isSelectionRangeChangeEvent(e){return Rje(e)}}function Dae(s,e){const t=s.get(Te),i=s.get(Ut),n=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(Mb),mouseWheelScrollSensitivity:t.getValue(Xy),fastScrollSensitivity:t.getValue(Zy),multipleSelectionController:e.multipleSelectionController??n.add(new NDt(t)),keyboardNavigationEventFilter:ODt(i),scrollByPage:!!t.getValue(Rb)},n]}let M_e=class extends Xa{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(sm),[h,u]=l.invokeFunction(Dae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Eae(r,this),this.disposables.add(xae(this.contextKeyService,this)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.listDoubleSelection=oRe.bindTo(this.contextKeyService),this.listMultiSelection=rRe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=eC(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(HN)&&(this._useAltAsMultipleSelectionModifier=eC(c));let m={};if(p.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(sm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Rb)){const v=!!c.getValue(Rb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Mb)){const v=!!c.getValue(Mb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xy)){const v=c.getValue(Xy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Zy)){const v=c.getValue(Zy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new uYe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};M_e=D([_(5,Le),_(6,lg),_(7,Te),_(8,we)],M_e);let nWe=class extends Cxt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(sm),[h,u]=l.invokeFunction(Dae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=Eae(r,this),this.disposables.add(xae(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=eC(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(HN)&&(this._useAltAsMultipleSelectionModifier=eC(c));let m={};if(p.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(sm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Rb)){const v=!!c.getValue(Rb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Mb)){const v=!!c.getValue(Mb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xy)){const v=c.getValue(Xy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Zy)){const v=c.getValue(Zy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new uYe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};nWe=D([_(5,Le),_(6,lg),_(7,Te),_(8,we)],nWe);let sWe=class extends D_e{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(sm),[u,f]=d.invokeFunction(Dae,r);super(e,t,i,n,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=Eae(a,this),this.disposables.add(xae(this.contextKeyService,this)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.listDoubleSelection=oRe.bindTo(this.contextKeyService),this.listMultiSelection=rRe.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=eC(l),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(l.onDidChangeConfiguration(m=>{m.affectsConfiguration(HN)&&(this._useAltAsMultipleSelectionModifier=eC(l));let v={};if(m.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const b=!!l.getValue(sm);v={...v,horizontalScrolling:b}}if(m.affectsConfiguration(Rb)){const b=!!l.getValue(Rb);v={...v,scrollByPage:b}}if(m.affectsConfiguration(Mb)){const b=!!l.getValue(Mb);v={...v,smoothScrolling:b}}if(m.affectsConfiguration(Xy)){const b=l.getValue(Xy);v={...v,mouseWheelScrollSensitivity:b}}if(m.affectsConfiguration(Zy)){const b=l.getValue(Zy);v={...v,fastScrollSensitivity:b}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new PDt(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};sWe=D([_(6,Le),_(7,lg),_(8,Te),_(9,we)],sWe);class uRe extends V{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new I),this.onDidOpen=this._onDidOpen.event,this._register(M.filter(this.widget.onDidChangeSelection,i=>d_(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(Gq)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(Gq)&&(this.openOnSingleClick=t?.configurationService.getValue(Gq)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,o=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class uYe extends uRe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class PDt extends uRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class FDt extends uRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function ODt(s){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=s.softDispatch(t,t.target);return i.kind===nf.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===nf.NoMatchingKb)}}let x3=class extends ZLe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(A6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new DM(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};x3=D([_(5,we),_(6,Le),_(7,lg),_(8,Te)],x3);let oWe=class extends oYe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(A6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new DM(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};oWe=D([_(5,we),_(6,Le),_(7,lg),_(8,Te)],oWe);let rWe=class extends wDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(A6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new DM(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};rWe=D([_(6,we),_(7,Le),_(8,lg),_(9,Te)],rWe);let N_e=class extends aYe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(A6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new DM(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};N_e=D([_(6,we),_(7,Le),_(8,lg),_(9,Te)],N_e);let hJ=class extends vDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(A6,a);super(e,t,i,n,o,r,u),this.disposables.add(p),this.internals=new DM(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};hJ=D([_(7,we),_(8,Le),_(9,lg),_(10,Te)],hJ);function gYe(s){const e=s.getValue(lRe);if(e==="highlight")return Zf.Highlight;if(e==="filter")return Zf.Filter;const t=s.getValue(rJ);if(t==="simple"||t==="highlight")return Zf.Highlight;if(t==="filter")return Zf.Filter}function fYe(s){const e=s.getValue(hRe);if(e==="fuzzy")return bb.Fuzzy;if(e==="contiguous")return bb.Contiguous}function A6(s,e){const t=s.get(Te),i=s.get(mf),n=s.get(Le),o=s.get(we),r=()=>{const u=n.getContextKeyValue(dYe);if(u==="automatic")return Gw.Automatic;if(u==="trigger"||n.getContextKeyValue(hYe)===!1)return Gw.Trigger;const p=t.getValue(dRe);if(p==="automatic")return Gw.Automatic;if(p==="trigger")return Gw.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(sm),[c,l]=o.invokeFunction(Dae,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(aJ);return{getTypeNavigationMode:r,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(E3)=="number"?t.getValue(E3):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(Mb),defaultFindMode:gYe(t),defaultFindMatchType:fYe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Rb),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(cJ)==="doubleClick",contextViewProvider:i,findWidgetStyles:DEt,enableStickyScroll:!!t.getValue(lJ),stickyScrollMaxItemCount:Number(t.getValue(dJ))}}}let DM=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Eae(o,e),this.disposables.push(xae(this.contextKeyService,e)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=TDt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.hasDoubleSelection=oRe.bindTo(this.contextKeyService),this.hasMultiSelection=rRe.bindTo(this.contextKeyService),this.treeElementCanCollapse=aRe.bindTo(this.contextKeyService),this.treeElementHasParent=LDt.bindTo(this.contextKeyService),this.treeElementCanExpand=cRe.bindTo(this.contextKeyService),this.treeElementHasChild=RDt.bindTo(this.contextKeyService),this.treeFindOpen=MDt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=lYe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=eC(a),this.updateStyleOverrides(n);const l=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(dYe),d.add(hYe),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),l()}),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(HN)&&(this._useAltAsMultipleSelectionModifier=eC(a)),h.affectsConfiguration(E3)){const f=a.getValue(E3);u={...u,indent:f}}if(h.affectsConfiguration(aJ)&&t.renderIndentGuides===void 0){const f=a.getValue(aJ);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(Mb)){const f=!!a.getValue(Mb);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(lRe)||h.affectsConfiguration(rJ)){const f=gYe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(dRe)||h.affectsConfiguration(rJ)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(hRe)){const f=fYe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(sm)&&t.horizontalScrolling===void 0){const f=!!a.getValue(sm);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(Rb)){const f=!!a.getValue(Rb);u={...u,scrollByPage:f}}if(h.affectsConfiguration(cJ)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(cJ)==="doubleClick"}),h.affectsConfiguration(lJ)){const f=a.getValue(lJ);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(dJ)){const f=Math.max(1,a.getValue(dJ));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(Xy)){const f=a.getValue(Xy);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(Zy)){const f=a.getValue(Zy);u={...u,fastScrollSensitivity:f}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new FDt(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?BN(e):ON)}dispose(){this.disposables=bt(this.disposables)}};DM=D([_(4,Le),_(5,lg),_(6,Te)],DM);const BDt=Qe.as(Nn.Configuration);BDt.registerConfiguration({id:"workbench",order:7,title:g(1295,"Workbench"),type:"object",properties:{[HN]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[g(1296,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(1297,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:g(1298,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[Gq]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1299,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[sm]:{type:"boolean",default:!1,description:g(1300,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Rb]:{type:"boolean",default:!1,description:g(1301,"Controls whether clicks in the scrollbar scroll page by page.")},[E3]:{type:"number",default:8,minimum:4,maximum:40,description:g(1302,"Controls tree indentation in pixels.")},[aJ]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(1303,"Controls whether the tree should render indent guides.")},[Mb]:{type:"boolean",default:!1,description:g(1304,"Controls whether lists and trees have smooth scrolling.")},[Xy]:{type:"number",default:1,markdownDescription:g(1305,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Zy]:{type:"number",default:5,markdownDescription:g(1306,"Scrolling speed multiplier when pressing `Alt`.")},[lRe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[g(1307,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),g(1308,"Filter elements when searching.")],default:"highlight",description:g(1309,"Controls the default find mode for lists and trees in the workbench.")},[rJ]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[g(1310,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),g(1311,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),g(1312,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:g(1313,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:g(1314,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[hRe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[g(1315,"Use fuzzy matching when searching."),g(1316,"Use contiguous matching when searching.")],default:"fuzzy",description:g(1317,"Controls the type of matching used when searching lists and trees in the workbench.")},[cJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1318,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[lJ]:{type:"boolean",default:!0,description:g(1319,"Controls whether sticky scrolling is enabled in trees.")},[dJ]:{type:"number",minimum:1,default:7,markdownDescription:g(1320,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[dRe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:g(1321,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var WDt=".monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:16px;display:inline-block;flex-shrink:0;height:22px;line-height:inherit!important;padding-right:6px;vertical-align:top;width:16px}.monaco-icon-label-iconpath{display:flex;height:16px;margin-top:2px;padding-left:2px;width:16px}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-size:.9em;margin-left:.5em;opacity:.7;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{opacity:.66;text-decoration:line-through}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{font-size:90%;font-weight:600;margin:auto 16px 0 5px;opacity:.75;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}";ut(WDt,{});class rD extends V{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=re(e,fe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=rD.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Ys(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{n=o===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class _4{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class D3 extends V{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new _4(re(e,fe(".monaco-icon-label")))),this.labelContainer=re(this.domNode.element,fe(".monaco-icon-label-container")),this.nameContainer=re(this.labelContainer,fe("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new VDt(this.nameContainer,!!t.supportIcons)):this.nameNode=new HDt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Pr("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let c;!a||!Yr(a)?(c=fe(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=Zu(i?.iconPath)}else a&&a.remove();if(this.domNode.className=n.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof rD?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?rD.escapeNewLines(t,[]):t||"",this.setupHover(c.element,i?.descriptionTitle||""),c.empty=!t)}if(i?.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){Lt(r)?o.title=dae(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=Sm().setupManagedHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new _4(QGe(this.nameContainer,fe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new _4(re(e.element,fe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new _4(re(this.labelContainer,fe("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new rD(re(e.element,fe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new _4(re(e.element,fe("span.label-description"))))}return this.descriptionNode}}class HDt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Ys(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=re(this.container,fe("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+n.length},r=t.map(a=>Md.intersect(o,a)).filter(a=>!Md.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class VDt extends V{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Ys(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new rD(re(this.container,fe("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",n=UDt(e,i,t?.matches);for(let o=0;o{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}}),MU=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),gRe=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function mYe(s,e,t=!1){const i=s||"",n=e||"",o=aWe.value.collator.compare(i,n);return aWe.value.collatorIsNumeric&&o===0&&i!==n?in.length)return 1}return 0}class tkt extends IU{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this.observers)for(const t of this._deltas)e.handleChange(this,t);this._deltas.length=0}else for(const e of this.observers)e.handleChange(this,void 0)}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this.observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this.observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this.observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new TU(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(o,r)=>{},handlePossibleChange:o=>{}},this),this._updateCounter>1)for(const o of this.observers)o.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function fJ(s,e){return s.lazy?new tkt(new Yd(s.owner,s.debugName,void 0),e,s.equalsFn??_p):new zLe(new Yd(s.owner,s.debugName,void 0),e,s.equalsFn??_p)}var P_e;const vv=fe;class bYe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new ya(()=>{const n=i.label??"",o=lF(n).text.trim(),r=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>UQe(a)).filter(a=>!!a).join(", ");return{saneLabel:n,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class vl extends bYe{constructor(e,t,i,n,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=n,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?M.map(M.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):M.None,this._saneDetail=o.detail,this._labelHighlights=o.highlights?.label,this._descriptionHighlights=o.highlights?.description,this._detailHighlights=o.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var kw;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(kw||(kw={}));class r0 extends bYe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=kw.NONE}}class ikt{getHeight(e){return e instanceof r0?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof vl?pJ.ID:mJ.ID}}class nkt{getWidgetAriaLabel(){return g(9964,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof vl)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class wYe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=re(e,vv(".quick-input-list-entry"));const i=re(t.entry,vv("label.quick-input-list-label"));t.toDisposeTemplate.add(Ro(i,ke.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=re(i,vv("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=re(i,vv(".quick-input-list-rows")),o=re(n,vv(".quick-input-list-row")),r=re(n,vv(".quick-input-list-row"));t.label=new D3(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Ore(t.label.element,vv(".quick-input-list-icon"));const a=re(o,vv(".quick-input-list-entry-keybinding"));t.keybinding=new qk(a,po),t.toDisposeTemplate.add(t.keybinding);const c=re(r,vv(".quick-input-list-label-meta"));return t.detail=new D3(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=re(t.entry,vv(".quick-input-list-separator")),t.actionBar=new hd(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var uL;let pJ=(uL=class extends wYe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return P_e.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ro(t.checkbox,ke.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const o=n.item;i.checkbox.checked=n.checked,i.toDisposeElement.add(n.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=n.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;if(o.iconPath){const u=Jre(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=N.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Zu(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(o.keybinding),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>E5(u,`id-${f}`,()=>n.fireButtonTriggered({button:u,item:n.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},P_e=uL,uL.ID="quickpickitem",uL);pJ=P_e=D([_(1,pn)],pJ);const fse=class fse extends wYe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return fse.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const o=n.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;i.icon.style.backgroundImage="",i.icon.className="";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>E5(u,`id-${f}`,()=>n.fireSeparatorButtonTriggered({button:u,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};fse.ID="quickpickseparator";let mJ=fse,kM=class extends V{constructor(e,t,i,n,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new I,this.onKeyDown=this._onKeyDown.event,this._onLeave=new I,this.onLeave=this._onLeave.event,this._visibleCountObservable=jt("VisibleCount",0),this.onChangedVisibleCount=M.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=jt("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=M.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=jt("CheckedCount",0),this.onChangedCheckedCount=M.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=fJ({equalsFn:is},new Array),this.onChangedCheckedElements=M.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._elementCheckedEventBufferer=new F7,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=re(this.parent,vv(".quick-input-list")),this._separatorRenderer=new mJ(t),this._itemRenderer=o.createInstance(pJ,t),this._tree=this._register(o.createInstance(x3,"QuickInput",this._container,new ikt,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new nkt,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:sW.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return M.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof vl).map(t=>t.item),this._store)}get onDidChangeSelection(){return M.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof vl).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get matchOnMeta(){return this._matchOnMeta}set matchOnMeta(e){this._matchOnMeta=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new En(e);switch(t.keyCode){case S.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(ue(this._container,ke.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(ue(this._container,ke.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new Y7(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(XFe(t.browserEvent.target)){e.cancel();return}if(!(!XFe(t.browserEvent.relatedTarget)&&wc(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof vl&&this.showHover(t.element)})}catch(i){if(!Fr(i))throw i}})),this._register(this._tree.onMouseOut(t=>{wc(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const n=i===t;!!(i.focusInsideSeparator&kw.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=kw.ACTIVE_ITEM:i.focusInsideSeparator&=~kw.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&kw.MOUSE_HOVER)||(i.focusInsideSeparator|=kw.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&kw.MOUSE_HOVER)&&(i.focusInsideSeparator&=~kw.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof vl);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof r0&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,n,o)=>{let r;if(n.type==="separator"){if(!n.buttons)return i;t=new r0(o,a=>this._onSeparatorButtonTriggered.fire(a),n),r=t}else{const a=o>0?e[o-1]:void 0;let c;a&&a.type==="separator"&&!a.buttons&&(t=void 0,c=a);const l=new vl(o,this._hasCheckboxes,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,c);if(this._itemElements.push(l),t)return t.children.push(l),i;r=l}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),n=i?.parentNode;if(i&&n){const o=i.nextSibling;i.remove(),n.insertBefore(i,o)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){if(this._itemElements.length)switch(e===wo.Second&&this._itemElements.length<2&&(e=wo.First),e){case wo.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof vl);break;case wo.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof vl?t?!0:(t=!t,!1):!1);break}case wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof vl);break;case wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof vl?(this._tree.reveal(n.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case wo.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,n=>{if(!(n.element instanceof vl))return!1;const o=this._tree.getParentElement(n.element);return o===null||o.children[0]!==n.element?this._tree.reveal(n.element):this._tree.reveal(o),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[0]&&this._onLeave.fire();break}case wo.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof vl?(this._tree.reveal(t.element),!0):!1);break;case wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof vl))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case wo.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(t)return!0;if(o.element instanceof r0)t=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof vl){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,o=>o.element instanceof vl));break}case wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof r0)i?t||(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element.children[0]):i=!0;else if(n.element instanceof vl&&!t){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const a=r.index&&this._inputElements[r.index-1];r.item&&(r.separator=a&&a.type==="separator"&&!a.buttons?a:void 0)});else{let r;this._elementTree.forEach(a=>{let c;this.matchOnLabelMode==="fuzzy"?c=this.matchOnLabel?Mq(e,lF(a.saneLabel))??void 0:void 0:c=this.matchOnLabel?skt(t,lF(a.saneLabel))??void 0:void 0;const l=this.matchOnDescription?Mq(e,lF(a.saneDescription||""))??void 0:void 0,d=this.matchOnDetail?Mq(e,lF(a.saneDetail||""))??void 0:void 0;if(c||l||d?(a.labelHighlights=c,a.descriptionHighlights=l,a.detailHighlights=d,a.hidden=!1):(a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=a.item?!a.item.alwaysShow:!0),a.item?a.separator=void 0:a.separator&&(a.hidden=!0),!this.sortByLabel){const h=a.index&&this._inputElements[a.index-1];r=h&&h.type==="separator"?h:r,r&&!a.hidden&&(a.separator=r,r=void 0)}})}const i=this._elementTree.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();i.sort((a,c)=>okt(a,c,r))}let n;const o=i.reduce((r,a,c)=>(a instanceof vl?n?n.children.push(a):r.push(a):a instanceof r0&&(a.children=[],n=a,r.push(a)),r),new Array);return this._setElementsToTree(o),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof vl),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof vl))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof vl&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof r0?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(n=>({element:n,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;it.checked).length;this._checkedCountObservable.set(e,void 0),this._checkedElementsObservable.set(this.getCheckedElements(),void 0)}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:t=>{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:vo.RIGHT}},!1))}};kM.__decorator=D([Zt],kM.prototype,"onDidChangeFocus",null);kM.__decorator=D([Zt],kM.prototype,"onDidChangeSelection",null);kM=D([_(4,we),_(5,mr)],kM);function skt(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return cWe(s,t);const n=pU(t," "),o=t.length-n.length,r=cWe(s,n);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function cWe(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function okt(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:qq(s.saneSortLabel,e.saneSortLabel,t)}const yYe={weight:Ae.WorkbenchContrib,when:he.and(he.equals(jje,tW.QuickPick),qEt),metadata:{description:g(9965,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Pg(s,e={}){So.registerCommandAndKeybindingRule({...yYe,...s,secondary:rkt(s.primary,s.secondary??[],e)})}const _J=Qt?U.WinCtrl:U.CtrlCmd;function rkt(s,e,t={}){return t.withAltMod&&e.push(U.Alt+s),t.withCtrlMod&&(e.push(_J+s),t.withAltMod&&e.push(U.Alt+_J+s)),t.withCmdMod&&Qt&&(e.push(U.CtrlCmd+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.WinCtrl+s),t.withAltMod&&(e.push(U.CtrlCmd+U.Alt+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.Alt+U.WinCtrl+s))),e}function Pf(s,e){return t=>{const i=t.get(In).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(s)}}Pg({id:"quickInput.pageNext",primary:S.PageDown,handler:Pf(wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Pg({id:"quickInput.pagePrevious",primary:S.PageUp,handler:Pf(wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Pg({id:"quickInput.first",primary:_J+S.Home,handler:Pf(wo.First)},{withAltMod:!0,withCmdMod:!0});Pg({id:"quickInput.last",primary:_J+S.End,handler:Pf(wo.Last)},{withAltMod:!0,withCmdMod:!0});Pg({id:"quickInput.next",primary:S.DownArrow,handler:Pf(wo.Next)},{withCtrlMod:!0});Pg({id:"quickInput.previous",primary:S.UpArrow,handler:Pf(wo.Previous)},{withCtrlMod:!0});const lWe=g(9966,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),dWe=g(9967,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");Qt?(Pg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.DownArrow,handler:Pf(wo.NextSeparator,wo.Next),metadata:{description:lWe}}),Pg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.DownArrow],handler:Pf(wo.NextSeparator)},{withCtrlMod:!0}),Pg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.UpArrow,handler:Pf(wo.PreviousSeparator,wo.Previous),metadata:{description:dWe}}),Pg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.UpArrow],handler:Pf(wo.PreviousSeparator)},{withCtrlMod:!0})):(Pg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.Alt+S.DownArrow,handler:Pf(wo.NextSeparator,wo.Next),metadata:{description:lWe}}),Pg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,handler:Pf(wo.NextSeparator)}),Pg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.Alt+S.UpArrow,handler:Pf(wo.PreviousSeparator,wo.Previous),metadata:{description:dWe}}),Pg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,handler:Pf(wo.PreviousSeparator)}));Pg({id:"quickInput.acceptInBackground",when:he.and(yYe.when,he.or(nRe.negate(),YEt)),primary:S.RightArrow,weight:Ae.WorkbenchContrib+50,handler:s=>{s.get(In).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var F_e;const mg=fe;var gL;let O_e=(gL=class extends V{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this.onDidTriggerButtonEmitter=this._register(new I),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new I),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new I),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=KEt.bindTo(this.contextKeyService),this.quickInputTypeContext=QEt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=jEt.bindTo(this.contextKeyService),this.backButton=iJ,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(M.runAndSubscribe(tm,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:si,disposables:this._store})),this._register(ddt(o=>{this.ui&&ct(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[ke.KEY_DOWN,ke.KEY_UP,ke.MOUSE_DOWN])t.add(ue(e,n,i,!0))}getUI(e){if(this.ui)return e&&ct(this._container)!==ct(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=re(this._container,mg(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=gl(t),n=re(t,mg(".quick-input-titlebar")),o=this._register(new hd(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=re(n,mg(".quick-input-title")),a=this._register(new hd(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=re(t,mg(".quick-input-header")),l=re(c,mg("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(5279,"Toggle all checkboxes")),this._register(Ro(l,ke.CHANGE,ne=>{const ge=l.checked;Y.setAllVisibleChecked(ge)})),this._register(ue(l,ke.CLICK,ne=>{(ne.x||ne.y)&&f.setFocus()}));const d=re(c,mg(".quick-input-description")),h=re(c,mg(".quick-input-and-message")),u=re(h,mg(".quick-input-filter")),f=this._register(new vxt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=re(u,mg(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new x_e(p,{countFormat:g(5280,"{0} Results")},this.styles.countBadge),v=re(u,mg(".quick-input-count"));v.setAttribute("aria-live","polite");const b=new x_e(v,{countFormat:g(5281,"{0} Selected")},this.styles.countBadge),w=this._register(new hd(c,{hoverDelegate:this.options.hoverDelegate}));w.domNode.classList.add("quick-input-inline-action-bar");const y=re(c,mg(".quick-input-action")),C=this._register(new Jd(y,this.styles.button));C.label=g(5282,"OK"),this._register(C.onDidClick(ne=>{this.onDidAcceptEmitter.fire()}));const A=re(c,mg(".quick-input-action")),L=this._register(new Jd(A,{...this.styles.button,supportIcons:!0}));L.label=g(5283,"Custom"),this._register(L.onDidClick(ne=>{this.onDidCustomEmitter.fire()}));const k=re(h,mg(`#${this.idPrefix}message.quick-input-message`)),P=this._register(new nJ(t,this.styles.progressBar));P.getContainer().classList.add("quick-input-progress");const R=re(t,mg(".quick-input-html-widget"));R.tabIndex=-1;const z=re(t,mg(".quick-input-description")),G=this.idPrefix+"list",Y=this._register(this.instantiationService.createInstance(kM,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,G));f.setAttribute("aria-controls",G),this._register(Y.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",Y.getActiveDescendant()??"")})),this._register(Y.onChangedAllVisibleChecked(ne=>{l.checked=ne})),this._register(Y.onChangedVisibleCount(ne=>{m.setCount(ne)})),this._register(Y.onChangedCheckedCount(ne=>{b.setCount(ne)})),this._register(Y.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof uF&&this.controller.canSelectMany&&Y.clearFocus())},0)}));const j=Ac(t);return this._register(j),this._register(ue(t,ke.FOCUS,ne=>{const ge=this.getUI();if(wc(ne.relatedTarget,ge.inputContainer)){const De=ge.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==De&&this.endOfQuickInputBoxContext.set(De)}wc(ne.relatedTarget,ge.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Yr(ne.relatedTarget)?ne.relatedTarget:void 0)},!0)),this._register(j.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(eW.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(ne=>{const ge=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ge&&this.endOfQuickInputBoxContext.set(ge)})),this._register(ue(t,ke.FOCUS,ne=>{f.setFocus()})),this._register(Ro(t,ke.KEY_DOWN,ne=>{if(!wc(ne.target,R))switch(ne.keyCode){case S.Enter:en.stop(ne,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case S.Escape:en.stop(ne,!0),this.hide(eW.Gesture);break;case S.Tab:if(!ne.altKey&&!ne.ctrlKey&&!ne.metaKey){const ge=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?ge.push("input"):ge.push("input[type=text]"),this.getUI().list.displayed&&ge.push(".monaco-list"),this.getUI().message&&ge.push(".quick-input-message a"),this.getUI().widget){if(wc(ne.target,this.getUI().widget))break;ge.push(".quick-input-html-widget")}const De=t.querySelectorAll(ge.join(", "));ne.shiftKey&&ne.target===De[0]?(en.stop(ne,!0),Y.clearFocus()):!ne.shiftKey&&wc(ne.target,De[De.length-1])&&(en.stop(ne,!0),De[0].focus())}break;case S.Space:ne.ctrlKey&&(en.stop(ne,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:r,description1:z,description2:d,widget:R,rightActionBar:a,inlineActionBar:w,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:b,okContainer:y,ok:C,message:k,customButtonContainer:A,customButton:L,list:Y,progressBar:P,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:ne=>this.show(ne),hide:()=>this.hide(),setVisibilities:ne=>this.setVisibilities(ne),setEnabled:ne=>this.setEnabled(ne),setContextKey:ne=>this.options.setContextKey(ne),linkOpenerDelegate:ne=>this.options.linkOpenerDelegate(ne)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,re(this._container,this.ui.container))}pick(e,t={},i=He.None){return new Promise((n,o)=>{let r=d=>{r=n,t.onKeyMods?.(a.keyMods),n(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let c;const l=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),p=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,p&&(a.activeItems=p),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{c&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==c)&&(a.activeItems=[c])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{bt(l),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{c=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),c&&(a.activeItems=[c])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&Lt(t)?(e.severity=Xe.Error,e.validationMessage=t):t&&!Lt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Xe.Ignore,e.validationMessage=void 0)}input(e={},t=He.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=M.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[n,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!Lt(h)&&h.severity!==Xe.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{bt(l),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(){const e=this.getUI(!0);return new uF(e)}createInputBox(){const e=this.getUI(!0);return new JEt(e)}createQuickWidget(){const e=this.getUI(!0);return new XEt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",aa(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Xe.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),aa(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();iJ.tooltip=n?g(5284,"Back ({0})",n):g(5285,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,n=i&&!lTe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o?.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}focus(){if(this.isVisible()){const e=this.getUI();e.inputBox.enabled?e.inputBox.setFocus():e.list.domFocus()}}toggle(){this.isVisible()&&this.controller instanceof uF&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.displayed&&(this.getUI().list.focus(e?wo.Next:wo.Previous),t&&this.controller instanceof uF&&(this.controller.quickNavigate=t))}async accept(e={alt:!1,ctrlCmd:!1}){this.keyMods.alt=e.alt,this.keyMods.ctrlCmd=e.ctrlCmd,this.onDidAcceptEmitter.fire()}async back(){this.onDidTriggerButtonEmitter.fire(this.backButton)}async cancel(){this.hide()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,F_e.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},F_e=gL,gL.MAX_WIDTH=600,gL);O_e=F_e=D([_(1,pu),_(2,we),_(3,Le)],O_e);let vJ=class extends jTe{get backButton(){return this.controller.backButton}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(S_e))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new I),this.onShow=this._onShow.event,this._onHide=this._register(new I),this.onHide=this._onHide.event,this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(Ao).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(E_e))},n=this._register(this.instantiationService.createInstance(O_e,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{ct(e.activeContainer)===ct(n.container)&&n.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Q(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=He.None){return this.controller.pick(e,t,i)}input(e={},t=He.None){return this.controller.input(e,t)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}createQuickWidget(){return this.controller.createQuickWidget()}focus(){this.controller.focus()}toggle(){this.controller.toggle()}navigate(e,t){this.controller.navigate(e,t)}accept(e){return this.controller.accept(e)}back(){return this.controller.back()}cancel(){return this.controller.cancel()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ze(YOe),quickInputForeground:ze(Ipt),quickInputTitleBackground:ze(Tpt),widgetBorder:ze(H2),widgetShadow:ze(CI)},inputBox:EM,toggle:JY,countBadge:Uje,button:y6,progressBar:Hje,keybindingLabel:l_e,list:BN({listBackground:YOe,listFocusBackground:q8,listFocusForeground:K8,listInactiveFocusForeground:K8,listInactiveSelectionIconForeground:FTe,listInactiveFocusBackground:q8,listFocusOutline:Js,listInactiveFocusOutline:Js}),pickerGroup:{pickerGroupBorder:ze(Lpt),pickerGroupForeground:ze(dqe)}}}};vJ=D([_(0,we),_(1,Le),_(2,pn),_(3,pu),_(4,Te)],vJ);let B_e=class extends vJ{constructor(e,t,i,n,o,r){super(t,i,n,new kme(e.getContainerDomNode(),o),r),this.host=void 0;const a=I3.get(e);if(a){const c=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return c.getDomNode()},getContainer(){return c.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[c.getDomNode()]},get activeContainer(){return c.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return M.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return M.None},get onDidAddContainer(){return M.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};B_e=D([_(1,we),_(2,Le),_(3,pn),_(4,Kt),_(5,Te)],B_e);let k3=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(B_e,e);this.mapEditorToService.set(e,t),hm(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=He.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}createQuickWidget(){return this.activeService.createQuickWidget()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};k3=D([_(0,we),_(1,Kt)],k3);const pse=class pse{static get(e){return e.getContribution(pse.ID)}constructor(e){this.editor=e,this.widget=new W_e(this.editor)}dispose(){this.widget.dispose()}};pse.ID="editor.controller.quickInput";let I3=pse;const mse=class mse{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return mse.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Wg.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};mse.ID="editor.contrib.quickInputWidget";let W_e=mse;on(I3.ID,I3,ri.Lazy);class akt{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function ckt(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const u=fkt(d.token,h.token);return u!==0?u:d.index-h.index});let t=Vo.None,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==Vo.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const o=new hkt;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(n),c=new fRe(t,r,a),l=new pRe(c);for(let d=0,h=s.length;d"u"){const n=this._match(t),o=gkt(t);i=(n.metadata|o<>>0,this._cache.set(t,i)}return(i|e<>>0}}const ukt=/\b(comment|string|regex|regexp)\b/;function gkt(s){const e=s.match(ukt);if(!e)return nr.Other;switch(e[1]){case"comment":return nr.Comment;case"string":return nr.String;case"regex":return nr.RegEx;case"regexp":return nr.RegEx}throw new Error("Unexpected match for standard token type!")}function fkt(s,e){return se?1:0}class fRe{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<>>0}clone(){return new fRe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==Vo.NotSet&&(this._fontStyle=e),t!==Tl.None&&(this._foreground=t),i!==Tl.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class pkt{constructor(e,t=new Map){if(this.mainRule=e,t instanceof Map)this.children=t;else{this.children=new Map;for(const i in t)this.children.set(i,t[i])}}}class pRe{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}toExternalThemeTrieElement(){const e=new Map;return this._children.forEach((t,i)=>{e.set(i,t.toExternalThemeTrieElement())}),new pkt(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let c=this._children.get(r);typeof c>"u"&&(c=new pRe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,n)}}function mkt(s){const e=[];for(let t=1,i=s.length;t({format:n.format,location:n.location.toString()}))}}s.toJSONObject=e;function t(i){const n=o=>Lt(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Lt(o.format)&&Lt(o.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(o=>({format:o.format,location:N.parse(o.location)}))}}s.fromJSONObject=t})(hWe||(hWe={}));class ykt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:g(4497,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:g(4498,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${We.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];const t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enum.splice(t,1),this.iconReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,t){const i=this.iconFontsById[e];return i||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;We.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${We.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!We.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` +`)}}const NU=new ykt;Qe.add(SYe.IconContribution,NU);function oi(s,e,t,i){return NU.registerIcon(s,e,t,i)}function mRe(){return NU}function Ckt(){const s=fGe();for(const e in s){const t="\\"+s[e].toString(16);NU.registerIcon(e,{fontCharacter:t})}}Ckt();const AYe="vscode://schemas/icons",EYe=Qe.as(YA.JSONContribution);EYe.registerSchema(AYe,NU.getIconSchema());const uWe=new cn(()=>EYe.notifySchemaChanged(AYe),200);NU.onDidChange(()=>{uWe.isScheduled()||uWe.schedule()});const xYe=oi("widget-close",ve.close,g(4499,"Icon for the close action in widgets.")),Skt=oi("goto-previous-location",ve.arrowUp,g(4500,"Icon for goto previous editor location.")),Akt=oi("goto-next-location",ve.arrowDown,g(4501,"Icon for goto next editor location."));We.modify(ve.sync,"spin");We.modify(ve.loading,"spin");function Ekt(s){const e=new Z,t=e.add(new I),i=mRe();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new DYe,o={},r=[],a=[];for(const c of i.getIcons()){const l=n.getIcon(c);if(!l)continue;const d=l.font,h=`--vscode-icon-${c.id}-font-family`,u=`--vscode-icon-${c.id}-content`;d?(o[d.id]=d.definition,a.push(`${h}: ${mq(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${mq(d.id)}; }`)):(a.push(`${u}: '${l.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; }`))}for(const c in o){const l=o[c],d=l.weight?`font-weight: ${l.weight};`:"",h=l.style?`font-style: ${l.style};`:"",u=l.src.map(f=>`${Zu(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${mq(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` +`)}}}class DYe{getIcon(e){const t=mRe();let i=e.defaults;for(;We.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const ex="vs",D5="vs-dark",KO="hc-black",qO="hc-light",kYe=Qe.as(kTe.ColorContribution),xkt=Qe.as(Sqe.ThemingContribution);class IYe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Qq(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get label(){return this.themeName}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,me.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=H_e(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,me.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=kYe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case ex:return Jg.LIGHT;case KO:return Jg.HIGH_CONTRAST_DARK;case qO:return Jg.HIGH_CONTRAST_LIGHT;default:return Jg.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=H_e(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=CYe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Kv.getForeground(o),a=Kv.getFontStyle(o);return{foreground:r,italic:!!(a&Vo.Italic),bold:!!(a&Vo.Bold),underline:!!(a&Vo.Underline),strikethrough:!!(a&Vo.Strikethrough)}}get tokenColorMap(){return[]}}function Qq(s){return s===ex||s===D5||s===KO||s===qO}function H_e(s){switch(s){case ex:return _kt;case D5:return vkt;case KO:return bkt;case qO:return wkt}}function aK(s){const e=H_e(s);return new IYe(s,e)}class Dkt extends V{constructor(){super(),this._onColorThemeChange=this._register(new I),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onFileIconThemeChange=this._register(new I),this.onDidFileIconThemeChange=this._onFileIconThemeChange.event,this._onProductIconThemeChange=this._register(new I),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new DYe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ex,aK(ex)),this._knownThemes.set(D5,aK(D5)),this._knownThemes.set(KO,aK(KO)),this._knownThemes.set(qO,aK(qO));const e=this._register(Ekt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ex),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Bj(si,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return k8(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=gl(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=gl(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(ex),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=si.matchMedia("(forced-colors: active)").matches;if(e!==Ry(this._theme.type)){let t;Jre(this._theme.type)?t=e?KO:D5:t=e?qO:ex,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};xkt.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of kYe.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${Vre(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` +`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(mkt(o)),this._themeCSS=e.join(` +`),this._updateCSS(),Ta.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const cv=ae("themeService");let U_e=class extends V{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=Jl.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._onDidChangeLinkUnderline=new I,this._accessibilityModeEnabledContext=K7.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=si.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(ue(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===Jl.Enabled}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}alwaysUnderlineAccessKeys(){return Promise.resolve(!1)}getAccessibilitySupport(){return this._accessibilitySupport}setAccessibilitySupport(e){this._accessibilitySupport!==e&&(this._accessibilitySupport=e,this._onDidChangeScreenReaderOptimized.fire())}alert(e){Mr(e)}status(e){Ah(e)}};U_e=D([_(0,Le),_(1,pu),_(2,Te)],U_e);var LP,lV;let V_e=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new z_e(i)}createMenu(e,t,i){return new bJ(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new bJ(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=n.getActions(i);return n.dispose(),o}getMenuContexts(e){const t=new QO(e,!1);return new Set([...t.structureContextKeys,...t.preconditionContextKeys,...t.toggledContextKeys])}resetHiddenStates(e){this._hiddenStates.reset(e)}};V_e=D([_(0,vi),_(1,Ut),_(2,$i)],V_e);var fL;let z_e=(fL=class{constructor(e){this._storageService=e,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(LP._key,Ie.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(Ie.PROFILE,LP._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(LP._key,Ie.PROFILE,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&crt(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(LP._key,e,Ie.PROFILE,an.USER)}finally{this._ignoreChangeEvent=!1}}},LP=fL,fL._key="menu.hiddenCommands",fL);z_e=LP=D([_(0,$i)],z_e);class QO{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(jn.getMenuItems(this._id));let t;for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_sort(e){return e}_collectContextKeys(e){if(QO._fillInKbExprKeys(e.when,this._structureContextKeys),bT(e)){if(e.command.precondition&&QO._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;QO._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&jn.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let $_e=lV=class extends QO{constructor(e,t,i,n,o,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=o,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=bT(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=kkt(this._id,c?a.command:a,this._hiddenStates);if(c){const d=TYe(this._commandService,this._keybindingService,a.command.id,a.when);(r??=[]).push(new Sc(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new lV(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Ar.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new Ty(a,l,h))}}r&&r.length>0&&t.push([n,r])}return t}_sort(e){return e.sort(lV._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:lV._compareTitles(bT(e)?e.command.title:e.title,bT(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};$_e=lV=D([_(3,vi),_(4,Ut),_(5,Le)],$_e);let bJ=class{constructor(e,t,i,n,o,r){this._disposables=new Z,this._menuInfo=new $_e(e,t,i.emitEventsForSubmenuChanges,n,o,r);const a=new cn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(jn.onDidChangeMenu(h=>{h.has(e)&&a.schedule()}));const c=this._disposables.add(new Z),l=h=>{let u=!1,f=!1,p=!1;for(const m of h)if(u=u||m.isStructuralChange,f=f||m.isEnablementChange,p=p||m.isToggleChange,u&&f&&p)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p}},d=()=>{c.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),p=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||p)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p})})),c.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new Are({onWillAddFirstListener:d,onDidRemoveLastListener:c.clear.bind(c),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};bJ=D([_(3,vi),_(4,Ut),_(5,Le)],bJ);function kkt(s,e,t){const i=aht(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,o=rl({id:`hide/${s.id}/${i}`,label:g(1292,"Hide '{0}'",n),run(){t.updateHidden(s,i,!0)}}),r=rl({id:`toggle/${s.id}/${i}`,label:n,get checked(){return!t.isHidden(s,i)},run(){t.updateHidden(s,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function TYe(s,e,t,i=void 0,n=!0){return rl({id:`configureKeybinding/${t}`,label:g(1293,"Configure Keybinding"),enabled:n,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;s.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}var G_e,pL;let K_e=(pL=class extends V{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Ky||bGe)&&this.installWebKitWriteTextWorkaround(),this._register(M.runAndSubscribe(tm,({window:i,disposables:n})=>{n.add(ue(i.document,"copy",()=>this.clearResources()))},{window:si,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new dc;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ky().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(ue(t,"click",e)),i.add(ue(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await ky().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Hu(),i=t.activeElement,n=t.body.appendChild(fe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),Yr(i)&&i.focus(),n.remove()}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await ky().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Wc(e.substring(0,G_e.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},G_e=pL,pL.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,pL);K_e=G_e=D([_(0,pu),_(1,Ge)],K_e);const dg=ae("clipboardService"),k5="data-keybinding-context";let _Re=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}updateParent(e){this._parent=e}collectAllValues(){let e=this._parent?this._parent.collectAllValues():Object.create(null);return e={...e,...this._value},delete e._contextId,e}};const _se=class _se extends _Re{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};_se.INSTANCE=new _se;let rW=_se;const Uz=class Uz extends _Re{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Dh.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===St.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new Q_e(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...hi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new Q_e(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Uz._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Uz._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}collectAllValues(){const e=Object.create(null);return this._values.forEach((t,i)=>e[i]=t),{...e,...super.collectAllValues()}}};Uz._keyPrefix="config.";let q_e=Uz;class Ikt{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class gWe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Q_e{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class Tkt{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function Lkt(s,e){return s.allKeysContainedIn(new Set(Object.keys(e)))}class LYe extends V{constructor(e){super(),this._onDidChangeContext=this._register(new kk({merge:t=>new Tkt(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}get contextId(){return this._myContextId}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Ikt(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Rkt(this,e)}createOverlay(e=hi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new vRe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new gWe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new gWe(e))}getContext(e){return this._isDisposed?rW.INSTANCE:this.getContextValuesContainer(Mkt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let j_e=class extends LYe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new q_e(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?rW.INSTANCE:this._contexts.get(e)||rW.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new _Re(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};j_e=D([_(0,Te)],j_e);class Rkt extends LYe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new wn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(k5)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(k5,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;Lkt(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(k5),super.dispose())}getContextValuesContainer(e){return this._isDisposed?rW.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}updateParent(e){if(this._parent===e)return;const t=this._parent.getContextValuesContainer(this._myContextId),i=t.collectAllValues();this._parent=e,this._updateParentChangeListener();const n=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(n);const o=t.collectAllValues(),r={...o8(i,o),...o8(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new Q_e(a))}}class fWe{constructor(e,t){this.parent=e,this.overlay=t}getValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getValue(e)}}class vRe{get contextId(){return this.parent.contextId}get onDidChangeContext(){return this.parent.onDidChangeContext}constructor(e,t){this.parent=e,this.overlay=new Map(t)}bufferChangeEvents(e){this.parent.bufferChangeEvents(e)}createKey(){throw new Error("Not supported.")}getContext(e){return new fWe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new fWe(t,this.overlay)}contextMatchesRules(e){const t=this.getContextValuesContainer(this.contextId);return e?e.evaluate(t):!0}getContextKeyValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getContextKeyValue(e)}createScoped(){throw new Error("Not supported.")}createOverlay(e=hi.empty()){return new vRe(this,e)}updateParent(){throw new Error("Not supported.")}}function Mkt(s){for(;s;){if(s.hasAttribute(k5)){const e=s.getAttribute(k5);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}function Nkt(s,e,t){s.get(Le).createKey(String(e),Pkt(t))}function Pkt(s){return S2(s,e=>{if(typeof e=="object"&&e.$mid===ws.Uri)return N.revive(e).toString();if(e instanceof N)return e.toString()})}_t.registerCommand("_setContext",Nkt);_t.registerCommand({id:"getContextKeyInfo",handler(){return[...Q.all()].sort((s,e)=>s.key.localeCompare(e.key))},metadata:{description:g(1294,"A command that returns information about context keys"),args:[]}});_t.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(const t of Q.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});let Fkt=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class pWe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new Fkt(t,e),this._nodes.set(t,i)),i}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const U0t=!1;class FUe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class P7{constructor(e=new Dl,t=!1,i,s=U0t){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(be,this),this._globalGraph=s?i?._globalGraph??new PUe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,St(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)cz(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends P7{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t?.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=H$.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw Nle("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof Gi?(i=H$.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=H$.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Ov.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of s){const c=this._getOrCreateServiceInstance(a.id,i);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(c)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Gi)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Gi?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const s=new PUe(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(s.lookupOrInsertNode(a),o++>1e3)throw new FUe(s);for(const c of Ov.getServiceDependencies(a.desc.ctor)){const l=this._getServiceInstanceOrDescriptor(c.id);if(l||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(a.id),String(c.id)),l instanceof Gi){const d={id:c.id,desc:l,_trace:a._trace.branch(c.id,!0)};s.lookup(d)||r.push(d),s.insertEdge(a,d)}}}for(;;){const a=s.roots();if(a.length===0){if(!s.isEmpty())throw new FUe(s);break}for(const{data:c}of a){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Gi){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,d)}s.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof Gi)return this._createServiceInstance(e,t,i,s,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o,r){if(s){const a=new P7(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new Ive(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of c){const f=d[h];if(typeof f=="function")for(const p of u)p.disposable=f.apply(d,p.listener)}return c.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!l.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let p=c.get(h);return p||(p=new td,c.set(h,p)),(v,w,b)=>{if(l.isInitialized)return l.value[h](v,w,b);{const C={listener:[v,w,b],disposable:void 0},y=p.push(C);return Ee(()=>{y(),C.disposable?.dispose()})}}}if(h in d)return d[h];const u=l.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return l.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}var TT;(function(n){n[n.None=0]="None",n[n.Creation=1]="Creation",n[n.Invocation=2]="Invocation",n[n.Branch=3]="Branch"})(TT||(TT={}));const Tp=class Tp{static traceInvocation(e,t){return e?new Tp(TT.Invocation,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const Okt=!1;class mWe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class T3{constructor(e=new Uc,t=!1,i,n=Okt){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(we,this),this._globalGraph=n?i?._globalGraph??new pWe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,bt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)wN(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends T3{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=I5.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw Cre("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof wi?(i=I5.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=I5.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=b_.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of n){const c=this._getOrCreateServiceInstance(a.id,i);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(c)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof wi)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof wi?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new pWe(c=>c.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),n.lookupOrInsertNode(c),o++>1e3)throw new mWe(n);for(const l of b_.getServiceDependencies(c.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(l.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(c.id),String(l.id)),d instanceof wi){const h={id:l.id,desc:d,_trace:c._trace.branch(l.id,!0)};n.lookup(h)||r.push(h),n.insertEdge(c,h)}}}}for(;;){const c=n.roots();if(c.length===0){if(!n.isEmpty())throw new mWe(n);break}for(const{data:l}of c){if(this._getServiceInstanceOrDescriptor(l.id)instanceof wi){const h=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setCreatedServiceInstance(l.id,h)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof wi)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,r){if(n){const a=new T3(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new hpe(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of c){const f=d[h];if(typeof f=="function")for(const p of u)p.disposable=f.apply(d,p.listener)}return c.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!l.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let p=c.get(h);return p||(p=new hl,c.set(h,p)),(v,b,w)=>{if(l.isInitialized)return l.value[h](v,b,w);{const y={listener:[v,b,w],disposable:void 0},C=p.push(y);return Ee(()=>{C(),y.disposable?.dispose()})}}}if(h in d)return d[h];const u=l.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return l.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}var j0;(function(s){s[s.None=0]="None",s[s.Creation=1]="Creation",s[s.Invocation=2]="Invocation",s[s.Branch=3]="Branch"})(j0||(j0={}));const Df=class Df{static traceInvocation(e,t){return e?new Df(j0.Invocation,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):Tp._None}static traceCreation(e,t){return e?new Tp(TT.Creation,t.name):Tp._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Tp(TT.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Tp._totals+=e;let t=!1;function i(o,r){const a=[],c=new Array(o+1).join(" ");for(const[l,d,h]of r._dep)if(d&&h){t=!0,a.push(`${c}CREATES -> ${l}`);const u=i(o+1,h);u&&a.push(u)}else a.push(`${c}uses -> ${l}`);return a.join(` -`)}const s=[`${this.type===TT.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Tp._totals.toFixed(2)}ms)`];(e>2||t)&&Tp.all.add(s.join(` -`))}};Tp.all=new Set,Tp._None=new class extends Tp{constructor(){super(TT.None,null)}stop(){}branch(){return this}},Tp._totals=0;let H$=Tp;const V0t=new Set([_e.inMemory,_e.vscodeSourceControl,_e.walkThrough,_e.walkThroughSnippet,_e.vscodeChatCodeBlock,_e.vscodeCopilotBackingChatCodeBlock]);class z0t{constructor(){this._byResource=new wi,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new wi,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??fi.empty():P.isUri(e)?this._byResource.get(e)?.values()??fi.empty():fi.map(fi.concat(...this._byOwner.values()),t=>t[1])}}class $0t{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new wi,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(V0t.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ys.Error?t.errors+=1:i===Ys.Warning?t.warnings+=1:i===Ys.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class XD{constructor(){this._onMarkerChanged=new Fle({delay:0,merge:XD._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new z0t,this._stats=new $0t(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}getStatistics(){return this._stats}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(iO(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=XD._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}=i;if(r)return c=c>0?c:1,l=l>0?l:1,d=d>=c?d:c,h=h>0?h:l,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=fi.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(mo(t)){const o=new wi;for(const{resource:r,marker:a}of t){const c=XD._toMarker(e,r,a);if(!c)continue;const l=o.get(r);l?l.push(c):(o.set(r,[c]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const c of r)if(XD._accept(c,s)){const l=a.push(c);if(o>0&&l===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const c of a)if(XD._accept(c,s)){const l=r.push(c);if(o>0&&l===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const c of r)for(const l of c)if(XD._accept(l,s)){const d=a.push(l);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new wi;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}const oPe=ae("policy");let KXe=class extends ${get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=_s.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(it.as(Cs.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:t})=>this.onDidUpdateConfiguration(Array.from(e),t))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,t){this.updateConfigurationModel(e,it.as(Cs.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=_s.createEmptyModel(this.logService);const e=it.as(Cs.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}};class G0t{constructor(){this.onDidChangeConfiguration=T.None,this.configurationModel=_s.createEmptyModel(new vSt)}async initialize(){return this.configurationModel}}let dCe=class extends ${get configurationModel(){return this._configurationModel}constructor(e,t,i){super(),this.defaultConfiguration=e,this.policyService=t,this.logService=i,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=_s.createEmptyModel(this.logService)}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this._register(this.policyService.onDidChange(e=>this.onDidChangePolicies(e))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:e})=>this.update(await this.updatePolicyDefinitions(e),!0))),this._configurationModel}async updatePolicyDefinitions(e){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",e);const t={},i=[],s=it.as(Cs.Configuration).getConfigurationProperties();for(const o of e){const r=s[o];if(!r){i.push(o);continue}if(r.policy){if(r.type!=="string"&&r.type!=="number"){this.logService.warn(`Policy ${r.policy.name} has unsupported type ${r.type}`);continue}i.push(o),t[r.policy.name]={type:r.type}}}return n1(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const t=it.as(Cs.Configuration).getPolicyConfigurations(),i=Vi(e.map(s=>t.get(s)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);const i=it.as(Cs.Configuration).getConfigurationProperties(),s=[],o=this._configurationModel.isEmpty();for(const r of e){const a=i[r]?.policy?.name;if(a){const c=this.policyService.getPolicyValue(a);(o?c!==void 0:!Io(this._configurationModel.getValue(r),c))&&s.push([r,c])}else this._configurationModel.getValue(r)!==void 0&&s.push([r,void 0])}if(s.length){this.logService.trace("PolicyConfiguration#changed",s);const r=this._configurationModel;this._configurationModel=_s.createEmptyModel(this.logService);for(const a of r.keys)this._configurationModel.setValue(a,r.getValue(a));for(const[a,c]of s)c===void 0?this._configurationModel.removeValue(a):this._configurationModel.setValue(a,c);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};dCe=D([_(1,oPe),_(2,Ze)],dCe);const Lw=ae("accessibilitySignalService");class YXe extends ${constructor(e,t=[]){super(),this.logger=new _St([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}}class q0t{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new I}get onWillDispose(){return this._onWillDispose.event}resolve(){return Promise.resolve()}get textEditorModel(){return this.model}createSnapshot(){return this.model.createSnapshot()}isReadonly(){return!1}dispose(){this.disposed=!0,this._onWillDispose.fire()}isDisposed(){return this.disposed}isResolved(){return!0}getLanguageId(){return this.model.getLanguageId()}}let hCe=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new llt(new q0t(t))):Promise.reject(new Error("Model not found"))}registerTextModelContentProvider(e,t){return{dispose:function(){}}}canHandleResource(e){return!1}};hCe=D([_(0,Ai)],hCe);const Fae=class Fae{show(){return Fae.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};Fae.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let uCe=Fae;class Q0t{withProgress(e,t,i){return t({report:()=>{}})}}class j0t{constructor(){this.stateResource=P.from({scheme:"monaco",authority:"stateResource"}),this.userRoamingDataHome=P.from({scheme:"monaco",authority:"userRoamingDataHome"}),this.keyboardLayoutResource=P.from({scheme:"monaco",authority:"keyboardLayoutResource"}),this.argvResource=P.from({scheme:"monaco",authority:"argvResource"}),this.untitledWorkspacesHome=P.from({scheme:"monaco",authority:"untitledWorkspacesHome"}),this.workspaceStorageHome=P.from({scheme:"monaco",authority:"workspaceStorageHome"}),this.localHistoryHome=P.from({scheme:"monaco",authority:"localHistoryHome"}),this.cacheHome=P.from({scheme:"monaco",authority:"cacheHome"}),this.userDataSyncHome=P.from({scheme:"monaco",authority:"userDataSyncHome"}),this.sync=void 0,this.continueOn=void 0,this.editSessionId=void 0,this.debugExtensionHost={port:null,break:!1},this.isExtensionDevelopment=!1,this.disableExtensions=!1,this.enableExtensions=void 0,this.extensionDevelopmentLocationURI=void 0,this.extensionDevelopmentKind=void 0,this.extensionTestsLocationURI=void 0,this.logsHome=P.from({scheme:"monaco",authority:"logsHome"}),this.logLevel=void 0,this.extensionLogLevel=void 0,this.verbose=!1,this.isBuilt=!1,this.disableTelemetry=!1,this.serviceMachineIdResource=P.from({scheme:"monaco",authority:"serviceMachineIdResource"}),this.policyFile=void 0}}class K0t{constructor(){this.onWillShowDialog=T.None,this.onDidShowDialog=T.None}async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` +`)):Df._None}static traceCreation(e,t){return e?new Df(j0.Creation,t.name):Df._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Df(j0.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Df._totals+=e;let t=!1;function i(o,r){const a=[],c=new Array(o+1).join(" ");for(const[l,d,h]of r._dep)if(d&&h){t=!0,a.push(`${c}CREATES -> ${l}`);const u=i(o+1,h);u&&a.push(u)}else a.push(`${c}uses -> ${l}`);return a.join(` +`)}const n=[`${this.type===j0.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Df._totals.toFixed(2)}ms)`];(e>2||t)&&Df.all.add(n.join(` +`))}};Df.all=new Set,Df._None=new class extends Df{constructor(){super(j0.None,null)}stop(){}branch(){return this}},Df._totals=0;let I5=Df;const Bkt=new Set([pe.inMemory,pe.vscodeSourceControl,pe.walkThrough,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeCopilotBackingChatCodeBlock]);class Wkt{constructor(){this._byResource=new ui,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new ui,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??hi.empty():N.isUri(e)?this._byResource.get(e)?.values()??hi.empty():hi.map(hi.concat(...this._byOwner.values()),t=>t[1])}}class Hkt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ui,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Bkt.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ws.Error?t.errors+=1:i===Ws.Warning?t.warnings+=1:i===Ws.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class RE{constructor(){this._onMarkerChanged=new Are({delay:0,merge:RE._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Wkt,this._stats=new Hkt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}getStatistics(){return this._stats}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(uU(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=RE._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}=i;if(r)return c=c>0?c:1,l=l>0?l:1,d=d>=c?d:c,h=h>0?h:l,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=hi.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(eo(t)){const o=new ui;for(const{resource:r,marker:a}of t){const c=RE._toMarker(e,r,a);if(!c)continue;const l=o.get(r);l?l.push(c):(o.set(r,[c]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const c of r)if(RE._accept(c,n)){const l=a.push(c);if(o>0&&l===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const c of a)if(RE._accept(c,n)){const l=r.push(c);if(o>0&&l===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const c of r)for(const l of c)if(RE._accept(l,n)){const d=a.push(l);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new ui;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}const bRe=ae("policy");let RYe=class extends V{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=as.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(Qe.as(Nn.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:t})=>this.onDidUpdateConfiguration(Array.from(e),t))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,t){this.updateConfigurationModel(e,Qe.as(Nn.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=as.createEmptyModel(this.logService);const e=Qe.as(Nn.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const o=i[n],r=t[n];o!==void 0?this._configurationModel.setValue(n,o):r?this._configurationModel.setValue(n,r.default):this._configurationModel.removeValue(n)}}};class Ukt{constructor(){this.onDidChangeConfiguration=M.None,this.configurationModel=as.createEmptyModel(new Syt)}async initialize(){return this.configurationModel}}let Y_e=class extends V{get configurationModel(){return this._configurationModel}constructor(e,t,i){super(),this.defaultConfiguration=e,this.policyService=t,this.logService=i,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=as.createEmptyModel(this.logService)}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this._register(this.policyService.onDidChange(e=>this.onDidChangePolicies(e))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:e})=>this.update(await this.updatePolicyDefinitions(e),!0))),this._configurationModel}async updatePolicyDefinitions(e){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",e);const t={},i=[],n=Qe.as(Nn.Configuration).getConfigurationProperties();for(const o of e){const r=n[o];if(!r){i.push(o);continue}if(r.policy){if(r.type!=="string"&&r.type!=="number"){this.logService.warn(`Policy ${r.policy.name} has unsupported type ${r.type}`);continue}i.push(o),t[r.policy.name]={type:r.type}}}return CA(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const t=Qe.as(Nn.Configuration).getPolicyConfigurations(),i=Fi(e.map(n=>t.get(n)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=[],o=this._configurationModel.isEmpty();for(const r of e){const a=i[r]?.policy?.name;if(a){const c=this.policyService.getPolicyValue(a);(o?c!==void 0:!Ys(this._configurationModel.getValue(r),c))&&n.push([r,c])}else this._configurationModel.getValue(r)!==void 0&&n.push([r,void 0])}if(n.length){this.logService.trace("PolicyConfiguration#changed",n);const r=this._configurationModel;this._configurationModel=as.createEmptyModel(this.logService);for(const a of r.keys)this._configurationModel.setValue(a,r.getValue(a));for(const[a,c]of n)c===void 0?this._configurationModel.removeValue(a):this._configurationModel.setValue(a,c);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};Y_e=D([_(1,bRe),_(2,Ge)],Y_e);const lv=ae("accessibilitySignalService");class MYe extends V{constructor(e,t=[]){super(),this.logger=new Cyt([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}}class Vkt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new I}get onWillDispose(){return this._onWillDispose.event}resolve(){return Promise.resolve()}get textEditorModel(){return this.model}createSnapshot(){return this.model.createSnapshot()}isReadonly(){return!1}dispose(){this.disposed=!0,this._onWillDispose.fire()}isDisposed(){return this.disposed}isResolved(){return!0}getLanguageId(){return this.model.getLanguageId()}}let J_e=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Hrt(new Vkt(t))):Promise.reject(new Error("Model not found"))}registerTextModelContentProvider(e,t){return{dispose:function(){}}}canHandleResource(e){return!1}};J_e=D([_(0,gi)],J_e);const vse=class vse{show(){return vse.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};vse.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let X_e=vse;class zkt{withProgress(e,t,i){return t({report:()=>{}})}}class $kt{constructor(){this.stateResource=N.from({scheme:"monaco",authority:"stateResource"}),this.userRoamingDataHome=N.from({scheme:"monaco",authority:"userRoamingDataHome"}),this.keyboardLayoutResource=N.from({scheme:"monaco",authority:"keyboardLayoutResource"}),this.argvResource=N.from({scheme:"monaco",authority:"argvResource"}),this.untitledWorkspacesHome=N.from({scheme:"monaco",authority:"untitledWorkspacesHome"}),this.workspaceStorageHome=N.from({scheme:"monaco",authority:"workspaceStorageHome"}),this.localHistoryHome=N.from({scheme:"monaco",authority:"localHistoryHome"}),this.cacheHome=N.from({scheme:"monaco",authority:"cacheHome"}),this.userDataSyncHome=N.from({scheme:"monaco",authority:"userDataSyncHome"}),this.sync=void 0,this.continueOn=void 0,this.editSessionId=void 0,this.debugExtensionHost={port:null,break:!1},this.isExtensionDevelopment=!1,this.disableExtensions=!1,this.enableExtensions=void 0,this.extensionDevelopmentLocationURI=void 0,this.extensionDevelopmentKind=void 0,this.extensionTestsLocationURI=void 0,this.logsHome=N.from({scheme:"monaco",authority:"logsHome"}),this.logLevel=void 0,this.extensionLogLevel=void 0,this.verbose=!1,this.isBuilt=!1,this.disableTelemetry=!1,this.serviceMachineIdResource=N.from({scheme:"monaco",authority:"serviceMachineIdResource"}),this.policyFile=void 0}}class Gkt{constructor(){this.onWillShowDialog=M.None,this.onDidShowDialog=M.None}async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),yi.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const s=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),t=await s[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:nt.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:nt.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:nt.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const X8=class X8{constructor(){this.onDidAddNotification=T.None,this.onDidRemoveNotification=T.None,this.onDidChangeFilter=T.None}info(e){return this.notify({severity:nt.Info,message:e})}warn(e){return this.notify({severity:nt.Warning,message:e})}error(e){return this.notify({severity:nt.Error,message:e})}notify(e){switch(e.severity){case nt.Error:console.error(e.message);break;case nt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return X8.NO_OP}prompt(e,t,i,s){return X8.NO_OP}status(e,t){return $.None}setFilter(e){}getFilter(e){return Wwe.OFF}getFilters(){return[]}removeFilter(e){}};X8.NO_OP=new Gyt;let gCe=X8,fCe=class{constructor(e){this._onWillExecuteCommand=new I,this._onDidExecuteCommand=new I,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=yt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};fCe=D([_(0,be)],fCe);let x1=class extends JEt{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(pe(f,xe.KEY_DOWN,m=>{const v=new os(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(pe(f,xe.KEY_UP,m=>{const v=new os(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Y0t(f,p))},c=f=>{for(let p=0;p{f.getOption(x.inDiffEditor)||a(f.getContainerDomNode())},d=f=>{f.getOption(x.inDiffEditor)||c(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(l);const h=f=>{a(f.getContainerDomNode())},u=f=>{c(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,s){return pa(yt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:Eve(i.keybinding,$c),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ee(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return yi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new vee(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[s++]=new vee(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return XU.resolveKeybinding(e,$c)}resolveKeyboardEvent(e){const t=new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new XU([t],$c)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};x1=D([_(0,Pe),_(1,ji),_(2,rn),_(3,Pi),_(4,Ze),_(5,jt)],x1);class Y0t extends ${constructor(e,t){super(),this.domNode=e,this._register(t)}}function OUe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof P)}let zee=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new KXe(e);this._configuration=new f7(t.reload(),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),new wi,_s.createEmptyModel(e),new wi,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=OUe(e)?e:OUe(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new ENe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=Ot.MEMORY,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}keys(){return this._configuration.keys(void 0)}reloadConfiguration(){return Promise.resolve(void 0)}getConfigurationData(){const e={contents:{},keys:[],overrides:[]};return{defaults:e,policy:e,application:e,user:e,workspace:e,folders:[]}}};zee=D([_(0,Ze)],zee);let pCe=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=oe.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}updateValue(e,t,i,s){return this.configurationService.updateValue(t,i,{resource:e},s)}};pCe=D([_(0,Re),_(1,Ai),_(2,Di)],pCe);let mCe=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:jr||ei?` +`+t),si.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:Xe.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:Xe.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:Xe.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const Vz=class Vz{constructor(){this.onDidAddNotification=M.None,this.onDidRemoveNotification=M.None,this.onDidChangeFilter=M.None}info(e){return this.notify({severity:Xe.Info,message:e})}warn(e){return this.notify({severity:Xe.Warning,message:e})}error(e){return this.notify({severity:Xe.Error,message:e})}notify(e){switch(e.severity){case Xe.Error:console.error(e.message);break;case Xe.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Vz.NO_OP}prompt(e,t,i,n){return Vz.NO_OP}status(e,t){return V.None}setFilter(e){}getFilter(e){return Dme.OFF}getFilters(){return[]}removeFilter(e){}};Vz.NO_OP=new Xwt;let Z_e=Vz,eve=class{constructor(e){this._onWillExecuteCommand=new I,this._onDidExecuteCommand=new I,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};eve=D([_(0,we)],eve);let jk=class extends dje{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(ue(f,ke.KEY_DOWN,m=>{const v=new En(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(ue(f,ke.KEY_UP,m=>{const v=new En(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Kkt(f,p))},c=f=>{for(let p=0;p{f.getOption(x.inDiffEditor)||a(f.getContainerDomNode())},d=f=>{f.getOption(x.inDiffEditor)||c(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(l);const h=f=>{a(f.getContainerDomNode())},u=f=>{c(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return jr(_t.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:ape(i.keybinding,po),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ee(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return si.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[n++]=new Dx(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return Y2.resolveKeybinding(e,po)}resolveKeyboardEvent(e){const t=new Ih(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Y2([t],po)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};jk=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,Ge),_(5,Kt)],jk);class Kkt extends V{constructor(e,t){super(),this.domNode=e,this._register(t)}}function _We(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof N)}let wJ=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new RYe(e);this._configuration=new u3(t.reload(),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),new ui,as.createEmptyModel(e),new ui,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=_We(e)?e:_We(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new PLe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=St.MEMORY,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}keys(){return this._configuration.keys(void 0)}reloadConfiguration(){return Promise.resolve(void 0)}getConfigurationData(){const e={contents:{},keys:[],overrides:[]};return{defaults:e,policy:e,application:e,user:e,workspace:e,folders:[]}}};wJ=D([_(0,Ge)],wJ);let tve=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.configurationService.onDidChangeConfiguration(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(o,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=oe.isIPosition(t)?t:null,o=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}inspect(e,t,i){const n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}updateValue(e,t,i,n){return this.configurationService.updateValue(t,i,{resource:e},n)}};tve=D([_(0,Te),_(1,gi),_(2,xi)],tve);let ive=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:pr||Qt?` `:`\r -`}};mCe=D([_(0,Re)],mCe);class J0t{constructor(){this.telemetryLevel=sp.NONE,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}setEnabled(){}setExperimentProperty(){}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}}const $2=class $2{constructor(){this._onDidChangeWorkspaceName=new I,this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onWillChangeWorkspaceFolders=new I,this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=new I,this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkbenchState=new I,this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event;const e=P.from({scheme:$2.SCHEME,authority:"model",path:"/"});this.workspace={id:LJe,folders:[new Cde({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?Nn.WORKSPACE:Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===$2.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===$2.SCHEME}isCurrentWorkspace(e){return!0}};$2.SCHEME="inmemory";let _Ce=$2;function $ee(n,e,t){if(!e||!(n instanceof zee))return;const i=[];Object.keys(e).forEach(s=>{OEt(s)&&i.push([`editor.${s}`,e[s]]),t&&BEt(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let vCe=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return $.None}async apply(e,t){const i=Array.isArray(e)?e:_Q.convert(e),s=new Map;for(const a of i){if(!(a instanceof vS))throw new Error("bad edit - only text edits are supported");const c=this._modelService.getModel(a.resource);if(!c)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&c.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let l=s.get(c);l||(l=[],s.set(c,l)),l.push(ds.replaceMove(O.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of s)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:a_(hbe.bulkEditServiceSummary,o,r),isApplied:o>0}}};vCe=D([_(0,Ai)],vCe);class X0t{constructor(){this.onDidChangeFormatters=T.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ui(e)}getWorkspaceLabel(e,t){return""}getSeparator(e,t){return"/"}registerFormatter(e){throw new Error("Not implemented")}registerCachedFormatter(e){return this.registerFormatter(e)}getHostLabel(){return""}getHostTooltip(){}}let wCe=class extends REt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};wCe=D([_(0,bg),_(1,jt)],wCe);class Z0t{constructor(){this._neverEmitter=new I,this.onDidChangeTrust=this._neverEmitter.event,this.onDidChangeTrustedFolders=this._neverEmitter.event,this.workspaceResolved=Promise.resolve(),this.workspaceTrustInitialized=Promise.resolve(),this.acceptsOutOfWorkspaceFiles=!0}isWorkspaceTrusted(){return!0}isWorkspaceTrustForced(){return!1}canSetParentFolderTrust(){return!1}async setParentFolderTrust(e){}canSetWorkspaceTrust(){return!1}async setWorkspaceTrust(e){}getUriTrustInfo(e){throw new Error("Method not supported.")}async setUrisTrust(e,t){}getTrustedUris(){return[]}async setTrustedUris(e){}addWorkspaceTrustTransitionParticipant(e){throw new Error("Method not supported.")}}class e1t extends Cee{constructor(){super()}}class t1t extends YXe{constructor(){super(new mSt)}}let bCe=class extends Dbe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};bCe=D([_(0,rn),_(1,Pi),_(2,W_),_(3,ti),_(4,_c),_(5,Pe)],bCe);class i1t{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return gQe.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return T.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ze,t1t,Yt.Eager);ce(Re,zee,Yt.Eager);ce(dl,pCe,Yt.Eager);ce(CMe,mCe,Yt.Eager);ce(Ti,_Ce,Yt.Eager);ce(eo,X0t,Yt.Eager);ce(rn,J0t,Yt.Eager);ce(To,K0t,Yt.Eager);ce(Il,j0t,Yt.Eager);ce(Pi,gCe,Yt.Eager);ce(U_,XD,Yt.Eager);ce(Di,e1t,Yt.Eager);ce(Iw,L0t,Yt.Eager);ce(Ai,Nbe,Yt.Eager);ce(xMe,Mbe,Yt.Eager);ce(Pe,lCe,Yt.Eager);ce(Cf,Q0t,Yt.Eager);ce(eD,uCe,Yt.Eager);ce(on,IDt,Yt.Eager);ce(kd,Kve,Yt.Eager);ce(vO,vCe,Yt.Eager);ce(oA,Z0t,Yt.Eager);ce(Rn,hCe,Yt.Eager);ce(Ur,eCe,Yt.Eager);ce(yf,IIt,Yt.Eager);ce(ji,fCe,Yt.Eager);ce(ti,x1,Yt.Eager);ce(On,R7,Yt.Eager);ce(W_,wCe,Yt.Eager);ce(fr,Rbe,Yt.Eager);ce(Mu,rCe,Yt.Eager);ce(Vr,bCe,Yt.Eager);ce(_c,tCe,Yt.Eager);ce(Lw,i1t,Yt.Eager);var Lt;(function(n){const e=new Dl;for(const[c,l]of Uve())e.set(c,l);const t=new P7(e,!0);e.set(be,t);function i(c){s||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof Gi?t.invokeFunction(d=>d.get(c)):l}n.get=i;let s=!1;const o=new I;function r(c){if(s)return t;s=!0;for(const[l,d]of Uve())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof Gi&&e.set(d,c[l])}return o.fire(),t}n.initialize=r;function a(c){if(s)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}n.withServices=a})(Lt||(Lt={}));var n1t=".monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{font-size:13px;height:0;line-height:14px;transform:translateY(-10px)}.monaco-editor .diff-hidden-lines .bottom.dragging,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .bottom,.monaco-editor .diff-hidden-lines .top{background-clip:padding-box;background-color:transparent;border-bottom:2px solid transparent;border-top:4px solid transparent;height:4px;transition:background-color .1s ease-out}.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *{cursor:n-resize!important}.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *{cursor:s-resize!important}.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{align-items:center;background:var(--vscode-editor-background);display:flex;justify-content:center;z-index:1}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);color:var(--vscode-diffEditor-unchangedRegionForeground);display:block;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedModified,.monaco-editor .movedOriginal{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedModified.currentMove,.monaco-editor .movedOriginal.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{pointer-events:none;position:absolute}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-removedTextBackground);margin-left:-1px}.monaco-editor .char-insert.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{font-size:12px;height:12px;width:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{align-items:center;display:flex!important;font-size:11px!important;opacity:.7!important}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-editor.hc-light .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{position:absolute;z-index:10}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .char-insert,.monaco-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-diff-editor .line-insert,.monaco-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-insert,.monaco-editor .line-insert{border:1px solid var(--vscode-diffEditor-insertedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-insert,.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .char-insert,.monaco-editor.hc-light .line-insert{border-style:dashed}.monaco-editor .char-delete,.monaco-editor .line-delete{border:1px solid var(--vscode-diffEditor-removedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-delete,.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .char-delete,.monaco-editor.hc-light .line-delete{border-style:dashed}.monaco-diff-editor .gutter-insert,.monaco-editor .gutter-insert,.monaco-editor .inline-added-margin-view-zone{background-color:var(--vscode-diffEditorGutter-insertedLineBackground,var(--vscode-diffEditor-insertedLineBackground),var(--vscode-diffEditor-insertedTextBackground))}.monaco-diff-editor .char-delete,.monaco-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-diff-editor .line-delete,.monaco-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor .gutter-delete,.monaco-editor .gutter-delete,.monaco-editor .inline-deleted-margin-view-zone{background-color:var(--vscode-diffEditorGutter-removedLineBackground,var(--vscode-diffEditor-removedLineBackground),var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--vscode-diffEditor-border);box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor.side-by-side .editor.original{border-right:1px solid var(--vscode-diffEditor-border);box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;&>div{position:absolute}.gutterItem{opacity:0;transition:opacity .7s;&.showAlways{opacity:1}&.noTransition,&.showAlways{transition:none}}&:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.gutterItem{.background{border-left:2px solid var(--vscode-menu-border);height:100%;left:50%;position:absolute;width:1px}.buttons{align-items:center;display:flex;justify-content:center;position:absolute;width:100%;.monaco-toolbar{height:fit-content;.monaco-action-bar{line-height:1;.actions-container{background:var(--vscode-editorGutter-commentRangeForeground);border-radius:4px;width:fit-content;.action-item{&:hover{background:var(--vscode-toolbar-hoverBackground)}.action-label{padding:1px 2px}}}}}}}}";Ct(n1t,{});class M_{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new M_(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new M_(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,vt.Immediate)}}class Gee{static capture(e){if(e.hasPendingScrollAnimation())return new Gee(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const s=e.getVisibleRanges();return s.length>0&&(t=s.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new Gee(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getBottomForLineNumber(this._visiblePosition.lineNumber);e.setScrollTop(t-this._visiblePositionScrollDelta,vt.Immediate)}}}function rPe(){return IU&&!!IU.VSCODE_DEV}function JXe(n){if(rPe()){const e=s1t();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function s1t(){uK||(uK=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const i of uK){const s=i(t);if(s)return s}}),uK}let uK;rPe()&&JXe(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const s in i){const o=i[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=n[s];if(r){for(const a of Object.getOwnPropertyNames(o.prototype)){const c=Object.getOwnPropertyDescriptor(o.prototype,a),l=Object.getOwnPropertyDescriptor(r.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${s}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[s]=r}}}return!0}});function o1t(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(c),r++):(s.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function A3(n,e){return n.appendChild(e),Ee(()=>{n.removeChild(e)})}function r1t(n,e){return n.prepend(e),Ee(()=>{n.removeChild(e)})}class XXe extends ${get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new gKe(e,t)),this._width=xi(this,this.elementSizeObserver.getWidth()),this._height=xi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>En(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function BUe(n,e,t){let i=e.get(),s=i,o=i;const r=xi("animatedValue",i);let a=-1;const c=300;let l;t.add(Az({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(n.cancelAnimationFrame(l),l=void 0),s=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(a1t(h,s,i-s,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const Oae=class Oae{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Oae._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Oae._counter=0;let CCe=Oae;function D1(n,e){return Ni(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function _v(n,e){return c1t([n],e),n}function c1t(n,e){rPe()&&Bh("reload",i=>JXe(({oldExports:s})=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function jee(n,e,t,i){const s=new Z,o=[];return s.add(xm((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(const u of o)h.removeZone(u),i?.delete(u);o.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(Az({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}},(h,u)=>{for(const f of c)f.onChange&&(d.set(f.onChange,l.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),s}class l1t extends ai{dispose(){super.dispose(!0)}}function WUe(n,e){const t=t1(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return O.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return O.fromPositions(new oe(s,n.column))}if(!t.innerChanges)return O.fromPositions(new oe(t.modified.startLineNumber,1));const i=t1(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return O.fromPositions(new oe(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=d1t(i.originalRange.getEndPosition(),n);return O.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function d1t(n,e){return n.lineNumber===e.lineNumber?new gf(0,e.column-n.column):new gf(e.lineNumber-n.lineNumber,e.column-1)}function h1t(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}function eZe(n,e,t){return Wn(i=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(n)&&i(s)}),()=>t.getValue(n)??e)}function dA(n,e,t){const i=n.bindTo(e);return bQ({debugName:()=>`Set Context Key "${n.key}"`},s=>{i.set(t(s))})}const jn="vs/platform/accessibilitySignal/browser/accessibilitySignalService";let HUe=class extends ${constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Wn(this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new tZ(s=>eZe(s.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new tZ({getCacheKey:Lxt},s=>Dt(o=>{const r=this._signalConfigValue.get(s.signal).read(o);return!!((s.modality==="sound"||s.modality===void 0)&&UUe(r.sound,()=>this.screenReaderAttached.read(o),s.userGesture)||(s.modality==="announcement"||s.modality===void 0)&&UUe(r.announcement,()=>this.screenReaderAttached.read(o),s.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new TNe(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,s=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&s&&this.accessibilityService.status(s),(t.modality==="sound"||t.modality===void 0)&&this.isSoundEnabled(e,t.userGesture)&&(this.sendSignalTelemetry(e,t.source),await this.playSound(e.sound.getSound(),t.allowManyInParallel))}async playSignals(e){for(const o of e)this.sendSignalTelemetry("signal"in o?o.signal:o,"source"in o?o.source:void 0);const t=e.map(o=>"signal"in o?o.signal:o),i=t.filter(o=>this.isAnnouncementEnabled(o)).map(o=>o.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const s=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(s).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),s=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(s)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(s),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibilitySignals.volume");return typeof e!="number"?50:Math.max(Math.min(e,100),0)}async playSound(e,t=!1){if(!t&&this.playingSounds.has(e))return;this.playingSounds.add(e);const i=lp.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const s=this.sounds.get(i);if(s)s.volume=this.getVolumeInPercent()/100,s.currentTime=0,await s.play();else{const o=await u1t(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(s){s.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",s)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const s=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&s()},t)})};return s(),Ee(()=>i=!1)}isAnnouncementEnabled(e,t){return e.announcementMessage?this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"announcement"}).get():!1}isSoundEnabled(e,t){return this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"sound"}).get()}onSoundEnabledChanged(e){return this.getEnabledState(e,!1).onDidChange}getDelayMs(e,t,i){const s=this.configurationService.getValue("accessibility.signalOptions");if(!s||!s.debouncePositionChanges)return 0;let o;return e.name===Zl.errorAtPosition.name&&i==="positional"?o=s["experimental.delays"].errorAtPosition:e.name===Zl.warningAtPosition.name&&i==="positional"?o=s["experimental.delays"].warningAtPosition:o=s["experimental.delays"].general,t==="sound"?o.sound:o.announcement}};HUe=D([_(0,Re),_(1,Ur),_(2,rn)],HUe);function UUe(n,e,t){return n==="on"||n==="always"||n==="auto"&&e()||n==="userGesture"&&t}function u1t(n,e){return new Promise((t,i)=>{const s=new Audio(n);s.volume=e,s.addEventListener("ended",()=>{t(s)}),s.addEventListener("error",o=>{i(o.error)}),s.play().catch(o=>{i(o)})})}const Yn=class Yn{static register(e){return new Yn(e.fileName)}constructor(e){this.fileName=e}};Yn.error=Yn.register({fileName:"error.mp3"}),Yn.warning=Yn.register({fileName:"warning.mp3"}),Yn.success=Yn.register({fileName:"success.mp3"}),Yn.foldedArea=Yn.register({fileName:"foldedAreas.mp3"}),Yn.break=Yn.register({fileName:"break.mp3"}),Yn.quickFixes=Yn.register({fileName:"quickFixes.mp3"}),Yn.taskCompleted=Yn.register({fileName:"taskCompleted.mp3"}),Yn.taskFailed=Yn.register({fileName:"taskFailed.mp3"}),Yn.terminalBell=Yn.register({fileName:"terminalBell.mp3"}),Yn.diffLineInserted=Yn.register({fileName:"diffLineInserted.mp3"}),Yn.diffLineDeleted=Yn.register({fileName:"diffLineDeleted.mp3"}),Yn.diffLineModified=Yn.register({fileName:"diffLineModified.mp3"}),Yn.chatRequestSent=Yn.register({fileName:"chatRequestSent.mp3"}),Yn.chatResponseReceived1=Yn.register({fileName:"chatResponseReceived1.mp3"}),Yn.chatResponseReceived2=Yn.register({fileName:"chatResponseReceived2.mp3"}),Yn.chatResponseReceived3=Yn.register({fileName:"chatResponseReceived3.mp3"}),Yn.chatResponseReceived4=Yn.register({fileName:"chatResponseReceived4.mp3"}),Yn.clear=Yn.register({fileName:"clear.mp3"}),Yn.save=Yn.register({fileName:"save.mp3"}),Yn.format=Yn.register({fileName:"format.mp3"}),Yn.voiceRecordingStarted=Yn.register({fileName:"voiceRecordingStarted.mp3"}),Yn.voiceRecordingStopped=Yn.register({fileName:"voiceRecordingStopped.mp3"}),Yn.progress=Yn.register({fileName:"progress.mp3"});let Ir=Yn;class g1t{constructor(e){this.randomOneOf=e}getSound(e=!1){if(e||this.randomOneOf.length===1)return this.randomOneOf[0];{const t=Math.floor(Math.random()*this.randomOneOf.length);return this.randomOneOf[t]}}}const Xi=class Xi{constructor(e,t,i,s,o,r,a){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.delaySettingsKey=a}static register(e){const t=new g1t("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Xi(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.delaySettingsKey);return Xi._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Xi._signals=new Set,Xi.errorAtPosition=Xi.register({name:g(jn,0,"Error at Position"),sound:Ir.error,announcementMessage:g(jn,1,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Xi.warningAtPosition=Xi.register({name:g(jn,2,"Warning at Position"),sound:Ir.warning,announcementMessage:g(jn,3,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Xi.errorOnLine=Xi.register({name:g(jn,4,"Error on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(jn,5,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Xi.warningOnLine=Xi.register({name:g(jn,6,"Warning on Line"),sound:Ir.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(jn,7,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Xi.foldedArea=Xi.register({name:g(jn,8,"Folded Area on Line"),sound:Ir.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(jn,9,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Xi.break=Xi.register({name:g(jn,10,"Breakpoint on Line"),sound:Ir.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(jn,11,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Xi.inlineSuggestion=Xi.register({name:g(jn,12,"Inline Suggestion on Line"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Xi.terminalQuickFix=Xi.register({name:g(jn,13,"Terminal Quick Fix"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(jn,14,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Xi.onDebugBreak=Xi.register({name:g(jn,15,"Debugger Stopped on Breakpoint"),sound:Ir.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(jn,16,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Xi.noInlayHints=Xi.register({name:g(jn,17,"No Inlay Hints on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(jn,18,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Xi.taskCompleted=Xi.register({name:g(jn,19,"Task Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(jn,20,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Xi.taskFailed=Xi.register({name:g(jn,21,"Task Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(jn,22,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Xi.terminalCommandFailed=Xi.register({name:g(jn,23,"Terminal Command Failed"),sound:Ir.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(jn,24,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Xi.terminalCommandSucceeded=Xi.register({name:g(jn,25,"Terminal Command Succeeded"),sound:Ir.success,announcementMessage:g(jn,26,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Xi.terminalBell=Xi.register({name:g(jn,27,"Terminal Bell"),sound:Ir.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(jn,28,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Xi.notebookCellCompleted=Xi.register({name:g(jn,29,"Notebook Cell Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(jn,30,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Xi.notebookCellFailed=Xi.register({name:g(jn,31,"Notebook Cell Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(jn,32,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Xi.diffLineInserted=Xi.register({name:g(jn,33,"Diff Line Inserted"),sound:Ir.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Xi.diffLineDeleted=Xi.register({name:g(jn,34,"Diff Line Deleted"),sound:Ir.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Xi.diffLineModified=Xi.register({name:g(jn,35,"Diff Line Modified"),sound:Ir.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Xi.chatRequestSent=Xi.register({name:g(jn,36,"Chat Request Sent"),sound:Ir.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(jn,37,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Xi.chatResponseReceived=Xi.register({name:g(jn,38,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Ir.chatResponseReceived1,Ir.chatResponseReceived2,Ir.chatResponseReceived3,Ir.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Xi.progress=Xi.register({name:g(jn,39,"Progress"),sound:Ir.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(jn,40,"Progress"),settingsKey:"accessibility.signals.progress"}),Xi.clear=Xi.register({name:g(jn,41,"Clear"),sound:Ir.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(jn,42,"Clear"),settingsKey:"accessibility.signals.clear"}),Xi.save=Xi.register({name:g(jn,43,"Save"),sound:Ir.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(jn,44,"Save"),settingsKey:"accessibility.signals.save"}),Xi.format=Xi.register({name:g(jn,45,"Format"),sound:Ir.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(jn,46,"Format"),settingsKey:"accessibility.signals.format"}),Xi.voiceRecordingStarted=Xi.register({name:g(jn,47,"Voice Recording Started"),sound:Ir.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Xi.voiceRecordingStopped=Xi.register({name:g(jn,48,"Voice Recording Stopped"),sound:Ir.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let Zl=Xi;var f1t=".monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{color:var(--vscode-editorLineNumber-foreground);display:inline-block;text-align:right}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;position:absolute}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;vertical-align:middle;width:10px}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{height:16px;margin:2px 0;width:16px}.monaco-component.diff-review .revertButton{cursor:pointer}";Ct(f1t,{});const Np="vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer",p1t=Ki("diff-review-insert",Ce.add,g(Np,0,"Icon for 'Insert' in accessible diff viewer.")),m1t=Ki("diff-review-remove",Ce.remove,g(Np,1,"Icon for 'Remove' in accessible diff viewer.")),_1t=Ki("diff-review-close",Ce.close,g(Np,2,"Icon for 'Close' in accessible diff viewer."));var gH;let Kk=(gH=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=wO(this,(d,h)=>{const u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;const f=h.add(this._instantiationService.createInstance(yCe,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(SCe,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){En(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){En(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){En(e=>{this._setVisible(!1,e)})}},gH._ttPolicy=Jx("diffReview",{createHTML:e=>e}),gH);Kk=D([_(8,be)],Kk);let yCe=class extends ${constructor(e,t,i,s,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=o,this._groups=xi(this,[]),this._currentGroupIdx=xi(this,0),this._currentElementIdx=xi(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(Ni(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=v1t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());En(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===ju.Deleted?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===ju.Added&&this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ni(r=>{const a=this.currentElement.read(r);if(a&&a.type!==ju.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(O.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||m7(t,s=>{this._currentGroupIdx.set(hi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||En(i=>{this._currentElementIdx.set(hi.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&En(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ju.Deleted?this._models.originalReveal(O.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ju.Header?O.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};yCe=D([_(4,Lw)],yCe);const w5=3;function v1t(n,e,t){const i=[];for(const s of PRe(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*w5)){const o=[];o.push(new b1t);const r=new bi(Math.max(1,s[0].original.startLineNumber-w5),Math.min(s[s.length-1].original.endLineNumberExclusive+w5,e+1)),a=new bi(Math.max(1,s[0].modified.startLineNumber-w5),Math.min(s[s.length-1].modified.endLineNumberExclusive+w5,t+1));$qe(s,(d,h)=>{const u=new bi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new bi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new S1t(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new C1t(h,p))}),h.modified.forEach(p=>{o.push(new y1t(h,p))}))});const c=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);i.push(new w1t(new $b(c,l),o))}return i}var ju;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ju||(ju={}));class w1t{constructor(e,t){this.range=e,this.lines=t}}class b1t{constructor(){this.type=ju.Header}}class C1t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ju.Deleted,this.modifiedLineNumber=void 0}}class y1t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ju.Added,this.originalLineNumber=void 0}}class S1t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ju.Unchanged}}let SCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Qh(a)),this._register(Ni(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new xn("diffreview.close",g(Np,3,"Close"),"close-diff-review "+$e.asClassName(_1t),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new bz(this._content,{})),_a(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ni(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{_a(this.domNode)})),this._register(D1(this.domNode,{width:this._width,height:this._height})),this._register(D1(this._content,{width:this._width,height:this._height})),this._register(xm((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Xo(this.domNode,"keydown",c=>{(c.equals(E.DownArrow)||c.equals(V.CtrlCmd|E.DownArrow)||c.equals(V.Alt|E.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(E.UpArrow)||c.equals(V.CtrlCmd|E.UpArrow)||c.equals(V.Alt|E.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(E.Escape)||c.equals(V.CtrlCmd|E.Escape)||c.equals(V.Alt|E.Escape)||c.equals(V.Shift|E.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(E.Space)||c.equals(E.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",g(Np,4,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Sd(s,i.get(x.fontInfo)),_a(this._content,s);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),c=r.getOptions(),l=i.get(x.lineHeight),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===ju.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),w=this._model.groups.get().length,b=M=>M===0?g(Np,5,"no lines changed"):M===1?g(Np,6,"1 line changed"):g(Np,7,"{0} lines changed",M),C=b(m.original.length),y=b(m.modified.length);p.setAttribute("aria-label",g(Np,8,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,w,m.original.startLineNumber,C,m.modified.startLineNumber,y));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${v+1}/${w}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(S),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);s.appendChild(u);const f=Dt(p=>this._model.currentElement.read(p)===h);e.add(Ni(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(pe(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,c,l){const d=s.get(x.layoutInfo),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(x.layoutInfo),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let p="diff-review-row",m="";const v="diff-review-spacer";let w=null;switch(e.type){case ju.Added:p="diff-review-row line-insert",m=" char-insert",w=p1t;break;case ju.Deleted:p="diff-review-row line-delete",m=" char-delete",w=m1t;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=p,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,b.appendChild(C);const y=document.createElement("span");y.style.width=h+"px",y.style.minWidth=h+"px",y.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText=" ",C.appendChild(y);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",C.appendChild(S);const M=document.createElement("span");if(M.className=v,w){const N=document.createElement("span");N.className=$e.asClassName(w),N.innerText="  ",M.appendChild(N)}else M.innerText="  ";C.appendChild(M);let k;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=c.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(Np,9,"blank"));let F="";switch(e.type){case ju.Unchanged:e.originalLineNumber===e.modifiedLineNumber?F=g(Np,10,"{0} unchanged line {1}",k,e.originalLineNumber):F=g(Np,11,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case ju.Added:F=g(Np,12,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case ju.Deleted:F=g(Np,13,"- {0} original line {1}",k,e.originalLineNumber);break}return b.setAttribute("aria-label",F),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(x.fontInfo),c=lh.createEmpty(r,o),l=Am.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Am.containsRTL(r,l,e.mightContainRTL());return ede(new tL(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,r,!1,l,d,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(x.stopRenderingLineAfter),t.get(x.renderWhitespace),t.get(x.renderControlCharacters),t.get(x.fontLigatures)!==l1.OFF,null)).html}};SCe=D([_(5,Di)],SCe);class A1t{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}const gK="vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature",Z8=class Z8 extends ${constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Bh("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=xi(this,0),this._modifiedViewZonesChangedSignal=Bh("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Bh("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=wO(this,(d,h)=>{this._element.replaceChildren();const u=this._diffModel.read(d),f=u?.diff.read(d)?.movedTexts;if(!f||f.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const p=this._originalEditorLayoutInfo.read(d),m=this._modifiedEditorLayoutInfo.read(d);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=f.map(k=>{function F(Qe,Tt){const Oe=Tt.getTopForLineNumber(Qe.startLineNumber,!0),wt=Tt.getTopForLineNumber(Qe.endLineNumberExclusive,!0);return(Oe+wt)/2}const N=F(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),U=F(k.lineRangeMapping.modified,this._editors.modified),J=this._modifiedScrollTop.read(d),j=N-z,re=U-J,me=Math.min(N,U),De=Math.max(N,U);return{range:new hi(me,De),from:j,to:re,fromWithoutScroll:N,toWithoutScroll:U,move:k}});v.sort(jqe(El(k=>k.fromWithoutScroll>k.toWithoutScroll,Oct),El(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,cg)));const w=aPe.compute(v.map(k=>k.range)),b=10,C=p.verticalScrollbarWidth,y=(w.getTrackCount()-1)*10+b*2,S=C+y+(m.contentLeft-Z8.movedCodeBlockPadding);let M=0;for(const k of v){const F=w.getTrack(M),N=C+b+F*10,z=15,U=15,J=S,j=m.glyphMarginWidth+m.lineNumbersWidth,re=18,me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("arrow-rectangle"),me.setAttribute("x",`${J-j}`),me.setAttribute("y",`${k.to-re/2}`),me.setAttribute("width",`${j}`),me.setAttribute("height",`${re}`),this._element.appendChild(me);const De=document.createElementNS("http://www.w3.org/2000/svg","g"),Qe=document.createElementNS("http://www.w3.org/2000/svg","path");Qe.setAttribute("d",`M 0 ${k.from} L ${N} ${k.from} L ${N} ${k.to} L ${J-U} ${k.to}`),Qe.setAttribute("fill","none"),De.appendChild(Qe);const Tt=document.createElementNS("http://www.w3.org/2000/svg","polygon");Tt.classList.add("arrow"),h.add(Ni(Oe=>{Qe.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe)),Tt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe))})),Tt.setAttribute("points",`${J-U},${k.to-z/2} ${J},${k.to} ${J-U},${k.to+z/2}`),De.appendChild(Tt),this._element.appendChild(De),M++}this.width.set(y,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ee(()=>this._element.remove())),this._register(Ni(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Z8.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(Ez(this._state));const r=Dt(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new Qee(Au(f.lineRangeMapping.original.startLineNumber-1),18),modified:new Qee(Au(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(jee(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(jee(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(xm((d,h)=>{const u=r.read(d);for(const f of u)h.add(new VUe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new VUe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=Bh("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=Bh("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(Az({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(l="original"),d.didChange(c)&&(l="modified"),!0)},d=>{a.read(d),c.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&l==="original"){const p=this._editors.originalCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.original.contains(p.lineNumber)))}if(u&&l==="modified"){const p=this._editors.modifiedCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber)))}f!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};Z8.movedCodeBlockPadding=4;let GW=Z8;class aPe{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=Ict(t,El(a=>a.intersectWithRangeLength(s),cg)):(o=t.length,t.push(new wMe))),t[o].addRange(s),i.push(o)}return new aPe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class VUe extends ZXe{constructor(e,t,i,s,o){const r=di("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=di("div.diff-moved-code-block",{style:{marginRight:"4px"}},[di("div.text-content@textContent"),di("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(D1(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(gK,0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,1,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(gK,2,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,3,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new Qh(this._nodes.actionBar,{highlightToggledItems:!0})),d=new xn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new xn("","Compare",$e.asClassName(Ce.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Ni(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}const AQ="vs/editor/browser/widget/diffEditor/registrations.contribution";B("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},g(AQ,0,"The border color for text that got moved in the diff editor."));B("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},g(AQ,1,"The active border color for text that got moved in the diff editor."));B("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(AQ,2,"The color of the shadow around unchanged region widgets."));const E1t=Ki("diff-insert",Ce.add,g(AQ,3,"Line decoration for inserts in the diff editor.")),tZe=Ki("diff-remove",Ce.remove,g(AQ,4,"Line decoration for removals in the diff editor.")),zUe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+$e.asClassName(E1t),marginClassName:"gutter-insert"}),$Ue=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+$e.asClassName(tZe),marginClassName:"gutter-delete"}),GUe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),qUe=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),QUe=Kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),x1t=Kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),D1t=Kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),ACe=Kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),k1t=Kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),I1t=Kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class L1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Dt(this,o=>{const r=this._diffModel.read(o)?.diff.read(o);if(!r)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),l=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!a)for(const f of r.mappings)if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?$Ue:qUe}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?zUe:GUe}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:k1t}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:x1t});else for(const p of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&l?I1t:ACe}),f.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&l?D1t:QUe});if(a)for(const f of a.changes){const p=f.original.toInclusiveRange();p&&d.push({range:p,options:c?$Ue:qUe});const m=f.modified.toInclusiveRange();m&&h.push({range:m,options:c?zUe:GUe});for(const v of f.innerChanges||[])d.push({range:v.originalRange,options:ACe}),h.push({range:v.modifiedRange,options:QUe})}const u=this._diffModel.read(o).activeMovedText.read(o);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===u?" currentMove":""),blockPadding:[GW.movedCodeBlockPadding,0,GW.movedCodeBlockPadding,GW.movedCodeBlockPadding]}}),h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===u?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(qee(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(qee(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class T1t{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=HJe(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,s)}),this._sashRatio=xi(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class iZe extends ${constructor(e,t,i,s,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Lh(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:vi.VERTICAL})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Ni(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(Ni(a=>{const c=this._enabled.read(a);this._sash.state=c?Ia.Enabled:Ia.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class R1t{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=xi(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class M1t{constructor(e){this._value=xi(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(En(i=>{this._value.set(new jUe(t,void 0),i)}),t),t=>{throw En(i=>{this._value.set(new jUe(void 0,t),i)}),t})}}class jUe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class N1t{constructor(e){this._computePromise=e,this._lazyValue=new R1t(()=>new M1t(this._computePromise())),this.cachedPromiseResult=Dt(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function U$(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,o)=>{let r=!0,a=!1;const c=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=Ni(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):s(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Rc)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Rc);return}}r=!1,a&&l.dispose()})}var jL;const nZe=ae("diffProviderFactoryService");let ECe=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(xCe,e)}};ECe=D([_(0,be)],ECe);ce(nZe,ECe,Yt.Delayed);var cN;let xCe=(cN=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new I,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new pw(new bi(1,2),new bi(1,t.getLineCount()+1),[new fS(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=jL.diffCache.get(o);if(a&&a.context===r)return a.result;const c=ao.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=c.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return jL.diffCache.size>10&&jL.diffCache.delete(jL.diffCache.keys().next().value),jL.diffCache.set(o,{result:l,context:r}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},jL=cN,cN.diffCache=new Map,cN);xCe=jL=D([_(1,kd),_(2,rn)],xCe);let Kee=class extends ${setActiveMovedText(e){this._activeMovedText.set(e,void 0)}setHoveredMovedText(e){this._hoveredMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=xi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=xi(this,void 0),this.diff=this._diff,this._unchangedRegions=xi(this,void 0),this.unchangedRegions=Dt(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(En(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=xi(this,void 0),this._activeMovedText=xi(this,void 0),this._hoveredMovedText=xi(this,void 0),this.activeMovedText=Dt(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ai,this._diffProvider=Dt(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=Bh("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const s=oL("contentChangedSignal"),o=this._register(new yn(()=>s.trigger(void 0),200));this._register(Ni(a=>{const c=this._unchangedRegions.read(a);if(!c||c.regions.some(p=>p.isDragged.read(a)))return;const l=c.originalDecorationIds.map(p=>e.original.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Yk(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(yl),u=[];let f=!1;for(const p of PRe(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((w,b)=>w+b.lineCount,0),v=new Yk(p[0].originalLineNumber,p[0].modifiedLineNumber,m,p[0].visibleLineCountTop.get(),p[p.length-1].visibleLineCountBottom.get());u.push(v)}else u.push(p[0]);if(f){const p=e.original.deltaDecorations(c.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(c.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));En(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Yk.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l));let h;const u=this._unchangedRegions.get();if(u){const v=u.originalDecorationIds.map(y=>e.original.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0),w=u.modifiedDecorationIds.map(y=>e.modified.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0);let C=h1t(u.regions.map((y,S)=>{if(!v[S]||!w[S])return;const M=v[S].length;return new Yk(v[S].startLineNumber,w[S].startLineNumber,M,Math.min(y.visibleLineCountTop.get(),M),Math.min(y.visibleLineCountBottom.get(),M-y.visibleLineCountTop.get()))}).filter(yl),(y,S)=>!S||y.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&y.originalLineNumber>=S.originalLineNumber+S.lineCount).map(y=>new $b(y.getHiddenOriginalRange(l),y.getHiddenModifiedRange(l)));C=$b.clip(C,bi.ofLength(1,e.original.getLineCount()),bi.ofLength(1,e.modified.getLineCount())),h=$b.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const w=h.filter(b=>b.original.intersectsStrict(v.originalUnchangedRange)&&b.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(w,c))}else f.push(...d);const p=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:p,modifiedDecorationIds:m},c)};this._register(e.modified.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(xm(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),s.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),_v(sKe,a),_v(jve,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);d=GZ(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);h=GZ(h,p)}));let u=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=P1t(u,e.original,e.modified),u=u,u=u,En(f=>{r(u,f),this._lastDiff=u;const p=cPe.fromDiffResult(u);this._diff.set(p,f),this._isDiffUpToDate.set(!0,f);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await U$(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(s=>bi.deserialize(s.range)),i=this._unchangedRegions.get();!i||!t||En(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};Kee=D([_(2,nZe)],Kee);function P1t(n,e,t){return{changes:n.changes.map(i=>new pw(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>F1t(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function F1t(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew sZe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class sZe{constructor(e){this.lineRangeMapping=e}}class Yk{static fromDiffs(e,t,i,s,o){const r=pw.inverse(e,t,i),a=[];for(const c of r){let l=c.original.startLineNumber,d=c.modified.startLineNumber,h=c.original.length;const u=l===1&&d===1,f=l+h===t+1&&d+h===i+1;(u||f)&&h>=o+s?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Yk(l,d,h,0,0))):h>=o*2+s&&(l+=o,d+=o,h-=o*2,a.push(new Yk(l,d,h,0,0)))}return a}get originalUnchangedRange(){return bi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return bi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=xi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=xi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Dt(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=xi(this,void 0);const r=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-s),0);C2e(s===r),C2e(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new h_(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of s.ranges){const d=c===s.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Yk(o,r,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return bi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return bi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===xv.FromCloserSide&&s{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],w=s.modified.isEmpty;return v.push(new xn("diff.clipboard.copyDeletedContent",w?s.original.length>1?g(xL,0,"Copy deleted lines"):g(xL,1,"Copy deleted line"):s.original.length>1?g(xL,2,"Copy changed lines"):g(xL,3,"Copy changed line"),void 0,!0,async()=>{const C=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(C)})),s.original.length>1&&v.push(new xn("diff.clipboard.copyDeletedLineContent",w?g(xL,4,"Copy deleted line ({0})",s.original.startLineNumber+h):g(xL,5,"Copy changed line ({0})",s.original.startLineNumber+h),void 0,!0,async()=>{let C=this._originalTextModel.getLineContent(s.original.startLineNumber+h);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===bu.LF?` +`}};ive=D([_(0,Te)],ive);class qkt{constructor(){this.telemetryLevel=Kg.NONE,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}setEnabled(){}setExperimentProperty(){}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}}const JF=class JF{constructor(){this._onDidChangeWorkspaceName=new I,this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onWillChangeWorkspaceFolders=new I,this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=new I,this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkbenchState=new I,this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event;const e=N.from({scheme:JF.SCHEME,authority:"model",path:"/"});this.workspace={id:_je,folders:[new pae({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?qi.WORKSPACE:qi.FOLDER:qi.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===JF.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===JF.SCHEME}isCurrentWorkspace(e){return!0}};JF.SCHEME="inmemory";let nve=JF;function yJ(s,e,t){if(!e||!(s instanceof wJ))return;const i=[];Object.keys(e).forEach(n=>{HSt(n)&&i.push([`editor.${n}`,e[n]]),t&&USt(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let sve=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return V.None}async apply(e,t){const i=Array.isArray(e)?e:gae.convert(e),n=new Map;for(const a of i){if(!(a instanceof tA))throw new Error("bad edit - only text edits are supported");const c=this._modelService.getModel(a.resource);if(!c)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&c.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let l=n.get(c);l||(l=[],n.set(c,l)),l.push(Zn.replaceMove(F.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of n)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:$p(Xme.bulkEditServiceSummary,o,r),isApplied:o>0}}};sve=D([_(0,gi)],sve);class Qkt{constructor(){this.onDidChangeFormatters=M.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return _i(e)}getWorkspaceLabel(e,t){return""}getSeparator(e,t){return"/"}registerFormatter(e){throw new Error("Not implemented")}registerCachedFormatter(e){return this.registerFormatter(e)}getHostLabel(){return""}getHostTooltip(){}}let ove=class extends FSt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};ove=D([_(0,pu),_(1,Kt)],ove);class jkt{constructor(){this._neverEmitter=new I,this.onDidChangeTrust=this._neverEmitter.event,this.onDidChangeTrustedFolders=this._neverEmitter.event,this.workspaceResolved=Promise.resolve(),this.workspaceTrustInitialized=Promise.resolve(),this.acceptsOutOfWorkspaceFiles=!0}isWorkspaceTrusted(){return!0}isWorkspaceTrustForced(){return!1}canSetParentFolderTrust(){return!1}async setParentFolderTrust(e){}canSetWorkspaceTrust(){return!1}async setWorkspaceTrust(e){}getUriTrustInfo(e){throw new Error("Method not supported.")}async setUrisTrust(e,t){}getTrustedUris(){return[]}async setTrustedUris(e){}addWorkspaceTrustTransitionParticipant(e){throw new Error("Method not supported.")}}class Ykt extends QY{constructor(){super()}}class Jkt extends MYe{constructor(){super(new yyt)}}let rve=class extends p_e{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};rve=D([_(0,Yi),_(1,bi),_(2,mf),_(3,Ut),_(4,Oa),_(5,Le)],rve);class Xkt{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return H6e.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return M.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ge,Jkt,qt.Eager);ce(Te,wJ,qt.Eager);ce(Ec,tve,qt.Eager);ce(CTe,ive,qt.Eager);ce(yi,nve,qt.Eager);ce(Fs,Qkt,qt.Eager);ce(Yi,qkt,qt.Eager);ce(to,Gkt,qt.Eager);ce(Za,$kt,qt.Eager);ce(bi,Z_e,qt.Eager);ce(Am,RE,qt.Eager);ce(xi,Ykt,qt.Eager);ce(cv,Dkt,qt.Eager);ce(gi,C_e,qt.Eager);ce(DTe,y_e,qt.Eager);ce(Le,j_e,qt.Eager);ce(cg,zkt,qt.Eager);ce(XA,X_e,qt.Eager);ce($i,AEt,qt.Eager);ce(Ml,Lpe,qt.Eager);ce(PN,sve,qt.Eager);ce(uC,jkt,qt.Eager);ce(fn,J_e,qt.Eager);ce(mr,U_e,qt.Eager);ce(lg,DDt,qt.Eager);ce(vi,eve,qt.Eager);ce(Ut,jk,qt.Eager);ce(In,k3,qt.Eager);ce(mf,ove,qt.Eager);ce(Ao,w_e,qt.Eager);ce(dg,K_e,qt.Eager);ce(lr,rve,qt.Eager);ce(Oa,V_e,qt.Eager);ce(lv,Xkt,qt.Eager);var Dt;(function(s){const e=new Uc;for(const[c,l]of Spe())e.set(c,l);const t=new T3(e,!0);e.set(we,t);function i(c){n||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof wi?t.invokeFunction(d=>d.get(c)):l}s.get=i;let n=!1;const o=new I;function r(c){if(n)return t;n=!0;for(const[l,d]of Spe())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof wi&&e.set(d,c[l])}return o.fire(),t}s.initialize=r;function a(c){if(n)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}s.withServices=a})(Dt||(Dt={}));var Zkt=".monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{font-size:13px;height:0;line-height:14px;transform:translateY(-10px)}.monaco-editor .diff-hidden-lines .bottom.dragging,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .bottom,.monaco-editor .diff-hidden-lines .top{background-clip:padding-box;background-color:transparent;border-bottom:2px solid transparent;border-top:4px solid transparent;height:4px;transition:background-color .1s ease-out}.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *{cursor:n-resize!important}.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *{cursor:s-resize!important}.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{align-items:center;background:var(--vscode-editor-background);display:flex;justify-content:center;z-index:1}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);color:var(--vscode-diffEditor-unchangedRegionForeground);display:block;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedModified,.monaco-editor .movedOriginal{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedModified.currentMove,.monaco-editor .movedOriginal.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{pointer-events:none;position:absolute}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-removedTextBackground);margin-left:-1px}.monaco-editor .char-insert.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{font-size:12px;height:12px;width:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{align-items:center;display:flex!important;font-size:11px!important;opacity:.7!important}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-editor.hc-light .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{position:absolute;z-index:10}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .char-insert,.monaco-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-diff-editor .line-insert,.monaco-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-insert,.monaco-editor .line-insert{border:1px solid var(--vscode-diffEditor-insertedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-insert,.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .char-insert,.monaco-editor.hc-light .line-insert{border-style:dashed}.monaco-editor .char-delete,.monaco-editor .line-delete{border:1px solid var(--vscode-diffEditor-removedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-delete,.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .char-delete,.monaco-editor.hc-light .line-delete{border-style:dashed}.monaco-diff-editor .gutter-insert,.monaco-editor .gutter-insert,.monaco-editor .inline-added-margin-view-zone{background-color:var(--vscode-diffEditorGutter-insertedLineBackground,var(--vscode-diffEditor-insertedLineBackground),var(--vscode-diffEditor-insertedTextBackground))}.monaco-diff-editor .char-delete,.monaco-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-diff-editor .line-delete,.monaco-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor .gutter-delete,.monaco-editor .gutter-delete,.monaco-editor .inline-deleted-margin-view-zone{background-color:var(--vscode-diffEditorGutter-removedLineBackground,var(--vscode-diffEditor-removedLineBackground),var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--vscode-diffEditor-border);box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor.side-by-side .editor.original{border-right:1px solid var(--vscode-diffEditor-border);box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;&>div{position:absolute}.gutterItem{opacity:0;transition:opacity .7s;&.showAlways{opacity:1}&.noTransition,&.showAlways{transition:none}}&:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.gutterItem{.background{border-left:2px solid var(--vscode-menu-border);height:100%;left:50%;position:absolute;width:1px}.buttons{align-items:center;display:flex;justify-content:center;position:absolute;width:100%;.monaco-toolbar{height:fit-content;.monaco-action-bar{line-height:1;.actions-container{background:var(--vscode-editorGutter-commentRangeForeground);border-radius:4px;width:fit-content;.action-item{&:hover{background:var(--vscode-toolbar-hoverBackground)}.action-label{padding:1px 2px}}}}}}}}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px;.line-left,.line-right{border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);height:1px;margin:auto;opacity:.5;width:100%}.line-left{width:20px}.text{text-wrap:nowrap;color:var(--vscode-editorCodeLens-foreground);font-size:11px;line-height:11px;margin:0 4px}}";ut(Zkt,{});class vm{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new vm(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new vm(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,mt.Immediate)}}class tx{static capture(e){if(e.hasPendingScrollAnimation())return new tx(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const n=e.getVisibleRanges();return n.length>0&&(t=n.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new tx(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,n){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getBottomForLineNumber(this._visiblePosition.lineNumber);e.setScrollTop(t-this._visiblePositionScrollDelta,mt.Immediate)}}}function eIt(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let o=0,r=0;for(;od?(n.push(c),r++):(n.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function gF(s,e){return s.appendChild(e),Ee(()=>{e.remove()})}function tIt(s,e){return s.prepend(e),Ee(()=>{e.remove()})}class NYe extends V{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new KKe(e,t)),this._width=jt(this,this.elementSizeObserver.getWidth()),this._height=jt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ts(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function vWe(s,e,t){let i=e.get(),n=i,o=i;const r=jt("animatedValue",i);let a=-1;const c=300;let l;t.add(LU({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(s.cancelAnimationFrame(l),l=void 0),n=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(iIt(h,n,i-n,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const bse=class bse{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${bse._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};bse._counter=0;let ave=bse;function IA(s,e){return ai(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s.style[i]=n})}function SJ(s,e,t,i){const n=new Z,o=[];return n.add(cu((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),s.changeViewZones(h=>{for(const u of o)h.removeZone(u),i?.delete(u);o.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(LU({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}},(h,u)=>{for(const f of c)f.onChange&&(d.set(f.onChange,l.get(f)),f.onChange.read(h));t&&t(!0),s.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),s.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class nIt extends ci{dispose(){super.dispose(!0)}}function bWe(s,e){const t=Ak(e,n=>n.original.startLineNumber<=s.lineNumber);if(!t)return F.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const n=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return F.fromPositions(new oe(n,s.column))}if(!t.innerChanges)return F.fromPositions(new oe(t.modified.startLineNumber,1));const i=Ak(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return F.fromPositions(new oe(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=sIt(i.originalRange.getEndPosition(),s);return F.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function sIt(s,e){return s.lineNumber===e.lineNumber?new eg(0,e.column-s.column):new eg(e.lineNumber-s.lineNumber,e.column-1)}function oIt(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}class aW{static create(e,t=void 0){return new Phe(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Z;return n.add(t),n.add(e),new Phe(e,n,i)}static createOfNonDisposable(e,t,i=void 0){return new Phe(e,t,i)}}class Phe extends aW{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new rIt(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class rIt extends aW{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}function yRe(s,e,t){return zAt({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function Iv(s,e,t){const i=s.bindTo(e);return v6({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}let wWe=class extends V{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Kn(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new xj(n=>yRe(n.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new xj({getCacheKey:kAt},n=>Ze(o=>{const r=this._signalConfigValue.get(n.signal).read(o);return!!((n.modality==="sound"||n.modality===void 0)&&yWe(r.sound,()=>this.screenReaderAttached.read(o),n.userGesture)||(n.modality==="announcement"||n.modality===void 0)&&yWe(r.announcement,()=>this.screenReaderAttached.read(o),n.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new $Le(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,n=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&n&&this.accessibilityService.status(n),(t.modality==="sound"||t.modality===void 0)&&this.isSoundEnabled(e,t.userGesture)&&(this.sendSignalTelemetry(e,t.source),await this.playSound(e.sound.getSound(),t.allowManyInParallel))}async playSignals(e){for(const o of e)this.sendSignalTelemetry("signal"in o?o.signal:o,"source"in o?o.source:void 0);const t=e.map(o=>"signal"in o?o.signal:o),i=t.filter(o=>this.isAnnouncementEnabled(o)).map(o=>o.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const n=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(n).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),n=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(n)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(n),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibility.signalOptions.volume");return typeof e!="number"?50:Math.max(Math.min(e,100),0)}async playSound(e,t=!1){if(!t&&this.playingSounds.has(e))return;this.playingSounds.add(e);const i=ef.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const n=this.sounds.get(i);if(n)n.volume=this.getVolumeInPercent()/100,n.currentTime=0,await n.play();else{const o=await aIt(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(n){n.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",n)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const n=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&n()},t)})};return n(),Ee(()=>i=!1)}isAnnouncementEnabled(e,t){return e.announcementMessage?this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"announcement"}).get():!1}isSoundEnabled(e,t){return this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"sound"}).get()}onSoundEnabledChanged(e){return this.getEnabledState(e,!1).onDidChange}getDelayMs(e,t,i){if(!this.configurationService.getValue("accessibility.signalOptions.debouncePositionChanges"))return 0;let n;return e.name===cl.errorAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===cl.warningAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.warningAtPosition"):n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.general"),t==="sound"?n.sound:n.announcement}};wWe=D([_(0,Te),_(1,mr),_(2,Yi)],wWe);function yWe(s,e,t){return s==="on"||s==="always"||s==="auto"&&e()||s==="userGesture"&&t}function aIt(s,e){return new Promise((t,i)=>{const n=new Audio(s);n.volume=e,n.addEventListener("ended",()=>{t(n)}),n.addEventListener("error",o=>{i(o.error)}),n.play().catch(o=>{i(o)})})}const Bn=class Bn{static register(e){return new Bn(e.fileName)}constructor(e){this.fileName=e}};Bn.error=Bn.register({fileName:"error.mp3"}),Bn.warning=Bn.register({fileName:"warning.mp3"}),Bn.success=Bn.register({fileName:"success.mp3"}),Bn.foldedArea=Bn.register({fileName:"foldedAreas.mp3"}),Bn.break=Bn.register({fileName:"break.mp3"}),Bn.quickFixes=Bn.register({fileName:"quickFixes.mp3"}),Bn.taskCompleted=Bn.register({fileName:"taskCompleted.mp3"}),Bn.taskFailed=Bn.register({fileName:"taskFailed.mp3"}),Bn.terminalBell=Bn.register({fileName:"terminalBell.mp3"}),Bn.diffLineInserted=Bn.register({fileName:"diffLineInserted.mp3"}),Bn.diffLineDeleted=Bn.register({fileName:"diffLineDeleted.mp3"}),Bn.diffLineModified=Bn.register({fileName:"diffLineModified.mp3"}),Bn.chatRequestSent=Bn.register({fileName:"chatRequestSent.mp3"}),Bn.chatResponseReceived1=Bn.register({fileName:"chatResponseReceived1.mp3"}),Bn.chatResponseReceived2=Bn.register({fileName:"chatResponseReceived2.mp3"}),Bn.chatResponseReceived3=Bn.register({fileName:"chatResponseReceived3.mp3"}),Bn.chatResponseReceived4=Bn.register({fileName:"chatResponseReceived4.mp3"}),Bn.clear=Bn.register({fileName:"clear.mp3"}),Bn.save=Bn.register({fileName:"save.mp3"}),Bn.format=Bn.register({fileName:"format.mp3"}),Bn.voiceRecordingStarted=Bn.register({fileName:"voiceRecordingStarted.mp3"}),Bn.voiceRecordingStopped=Bn.register({fileName:"voiceRecordingStopped.mp3"}),Bn.progress=Bn.register({fileName:"progress.mp3"});let ur=Bn;class cIt{constructor(e){this.randomOneOf=e}getSound(e=!1){if(e||this.randomOneOf.length===1)return this.randomOneOf[0];{const t=Math.floor(Math.random()*this.randomOneOf.length);return this.randomOneOf[t]}}}const Ki=class Ki{constructor(e,t,i,n,o,r){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r}static register(e){const t=new cIt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ki(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return Ki._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Ki._signals=new Set,Ki.errorAtPosition=Ki.register({name:g(2242,"Error at Position"),sound:ur.error,announcementMessage:g(2243,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Ki.warningAtPosition=Ki.register({name:g(2244,"Warning at Position"),sound:ur.warning,announcementMessage:g(2245,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Ki.errorOnLine=Ki.register({name:g(2246,"Error on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(2247,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Ki.warningOnLine=Ki.register({name:g(2248,"Warning on Line"),sound:ur.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(2249,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Ki.foldedArea=Ki.register({name:g(2250,"Folded Area on Line"),sound:ur.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(2251,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Ki.break=Ki.register({name:g(2252,"Breakpoint on Line"),sound:ur.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(2253,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Ki.inlineSuggestion=Ki.register({name:g(2254,"Inline Suggestion on Line"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Ki.terminalQuickFix=Ki.register({name:g(2255,"Terminal Quick Fix"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(2256,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Ki.onDebugBreak=Ki.register({name:g(2257,"Debugger Stopped on Breakpoint"),sound:ur.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(2258,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Ki.noInlayHints=Ki.register({name:g(2259,"No Inlay Hints on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(2260,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Ki.taskCompleted=Ki.register({name:g(2261,"Task Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(2262,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Ki.taskFailed=Ki.register({name:g(2263,"Task Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(2264,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Ki.terminalCommandFailed=Ki.register({name:g(2265,"Terminal Command Failed"),sound:ur.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(2266,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Ki.terminalCommandSucceeded=Ki.register({name:g(2267,"Terminal Command Succeeded"),sound:ur.success,announcementMessage:g(2268,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Ki.terminalBell=Ki.register({name:g(2269,"Terminal Bell"),sound:ur.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(2270,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Ki.notebookCellCompleted=Ki.register({name:g(2271,"Notebook Cell Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(2272,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Ki.notebookCellFailed=Ki.register({name:g(2273,"Notebook Cell Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(2274,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Ki.diffLineInserted=Ki.register({name:g(2275,"Diff Line Inserted"),sound:ur.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Ki.diffLineDeleted=Ki.register({name:g(2276,"Diff Line Deleted"),sound:ur.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Ki.diffLineModified=Ki.register({name:g(2277,"Diff Line Modified"),sound:ur.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Ki.chatRequestSent=Ki.register({name:g(2278,"Chat Request Sent"),sound:ur.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(2279,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Ki.chatResponseReceived=Ki.register({name:g(2280,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[ur.chatResponseReceived1,ur.chatResponseReceived2,ur.chatResponseReceived3,ur.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Ki.progress=Ki.register({name:g(2281,"Progress"),sound:ur.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(2282,"Progress"),settingsKey:"accessibility.signals.progress"}),Ki.clear=Ki.register({name:g(2283,"Clear"),sound:ur.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(2284,"Clear"),settingsKey:"accessibility.signals.clear"}),Ki.save=Ki.register({name:g(2285,"Save"),sound:ur.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(2286,"Save"),settingsKey:"accessibility.signals.save"}),Ki.format=Ki.register({name:g(2287,"Format"),sound:ur.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(2288,"Format"),settingsKey:"accessibility.signals.format"}),Ki.voiceRecordingStarted=Ki.register({name:g(2289,"Voice Recording Started"),sound:ur.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Ki.voiceRecordingStopped=Ki.register({name:g(2290,"Voice Recording Stopped"),sound:ur.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let cl=Ki;var lIt=".monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{color:var(--vscode-editorLineNumber-foreground);display:inline-block;text-align:right}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;position:absolute}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;vertical-align:middle;width:10px}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{height:16px;margin:2px 0;width:16px}.monaco-component.diff-review .revertButton{cursor:pointer}";ut(lIt,{});const dIt=oi("diff-review-insert",ve.add,g(5250,"Icon for 'Insert' in accessible diff viewer.")),hIt=oi("diff-review-remove",ve.remove,g(5251,"Icon for 'Remove' in accessible diff viewer.")),uIt=oi("diff-review-close",ve.close,g(5252,"Icon for 'Close' in accessible diff viewer."));var pB;let Ix=(pB=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=AI(this,(d,h)=>{const u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;const f=h.add(this._instantiationService.createInstance(cve,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(lve,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){ts(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){ts(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){ts(e=>{this._setVisible(!1,e)})}},pB._ttPolicy=QA("diffReview",{createHTML:e=>e}),pB);Ix=D([_(8,we)],Ix);let cve=class extends V{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=jt(this,[]),this._currentGroupIdx=jt(this,0),this._currentElementIdx=jt(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(ai(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=gIt(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());ts(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===zh.Deleted?this._accessibilitySignalService.playSignal(cl.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===zh.Added&&this._accessibilitySignalService.playSignal(cl.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ai(r=>{const a=this.currentElement.read(r);if(a&&a.type!==zh.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(F.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||SM(t,n=>{this._currentGroupIdx.set(mi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||ts(i=>{this._currentElementIdx.set(mi.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&ts(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===zh.Deleted?this._models.originalReveal(F.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==zh.Header?F.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};cve=D([_(4,lv)],cve);const v4=3;function gIt(s,e,t){const i=[];for(const n of P1e(s,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*v4)){const o=[];o.push(new pIt);const r=new pi(Math.max(1,n[0].original.startLineNumber-v4),Math.min(n[n.length-1].original.endLineNumberExclusive+v4,e+1)),a=new pi(Math.max(1,n[0].modified.startLineNumber-v4),Math.min(n[n.length-1].modified.endLineNumberExclusive+v4,t+1));v6e(n,(d,h)=>{const u=new pi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new pi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new vIt(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new mIt(h,p))}),h.modified.forEach(p=>{o.push(new _It(h,p))}))});const c=n[0].modified.join(n[n.length-1].modified),l=n[0].original.join(n[n.length-1].original);i.push(new fIt(new L_(c,l),o))}return i}var zh;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(zh||(zh={}));class fIt{constructor(e,t){this.range=e,this.lines=t}}class pIt{constructor(){this.type=zh.Header}}class mIt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=zh.Deleted,this.modifiedLineNumber=void 0}}class _It{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=zh.Added,this.originalLineNumber=void 0}}class vIt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=zh.Unchanged}}let lve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new hd(a)),this._register(ai(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new rn("diffreview.close",g(5253,"Close"),"close-diff-review "+We.asClassName(uIt),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new EU(this._content,{})),aa(this.domNode,this._scrollbar.getDomNode(),a),this._register(ai(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{aa(this.domNode)})),this._register(IA(this.domNode,{width:this._width,height:this._height})),this._register(IA(this._content,{width:this._width,height:this._height})),this._register(cu((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Ro(this.domNode,"keydown",c=>{(c.equals(S.DownArrow)||c.equals(U.CtrlCmd|S.DownArrow)||c.equals(U.Alt|S.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(S.UpArrow)||c.equals(U.CtrlCmd|S.UpArrow)||c.equals(U.Alt|S.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(S.Escape)||c.equals(U.CtrlCmd|S.Escape)||c.equals(U.Alt|S.Escape)||c.equals(U.Shift|S.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(S.Space)||c.equals(S.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",g(5254,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Dl(n,i.get(x.fontInfo)),aa(this._content,n);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),c=r.getOptions(),l=i.get(x.lineHeight),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===zh.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,w=L=>L===0?g(5255,"no lines changed"):L===1?g(5256,"1 line changed"):g(5257,"{0} lines changed",L),y=w(m.original.length),C=w(m.modified.length);p.setAttribute("aria-label",g(5258,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,b,m.original.startLineNumber,y,m.modified.startLineNumber,C));const A=document.createElement("div");A.className="diff-review-cell diff-review-summary",A.appendChild(document.createTextNode(`${v+1}/${b}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(A),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);n.appendChild(u);const f=Ze(p=>this._model.currentElement.read(p)===h);e.add(ai(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(ue(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,r,a,c,l){const d=n.get(x.layoutInfo),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(x.layoutInfo),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let p="diff-review-row",m="";const v="diff-review-spacer";let b=null;switch(e.type){case zh.Added:p="diff-review-row line-insert",m=" char-insert",b=dIt;break;case zh.Deleted:p="diff-review-row line-delete",m=" char-delete",b=hIt;break}const w=document.createElement("div");w.style.minWidth=i+"px",w.className=p,w.setAttribute("role","listitem"),w.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,w.appendChild(y);const C=document.createElement("span");C.style.width=h+"px",C.style.minWidth=h+"px",C.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",y.appendChild(C);const A=document.createElement("span");A.style.width=f+"px",A.style.minWidth=f+"px",A.style.paddingRight="10px",A.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?A.appendChild(document.createTextNode(String(e.modifiedLineNumber))):A.innerText=" ",y.appendChild(A);const L=document.createElement("span");if(L.className=v,b){const R=document.createElement("span");R.className=We.asClassName(b),R.innerText="  ",L.appendChild(R)}else L.innerText="  ";y.appendChild(L);let k;if(e.modifiedLineNumber!==void 0){let R=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Ix._ttPolicy&&(R=Ix._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=c.getLineContent(e.modifiedLineNumber)}else{let R=this._getLineHtml(o,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Ix._ttPolicy&&(R=Ix._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(5259,"blank"));let P="";switch(e.type){case zh.Unchanged:e.originalLineNumber===e.modifiedLineNumber?P=g(5260,"{0} unchanged line {1}",k,e.originalLineNumber):P=g(5261,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case zh.Added:P=g(5262,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case zh.Deleted:P=g(5263,"- {0} original line {1}",k,e.originalLineNumber);break}return w.setAttribute("aria-label",P),w}_getLineHtml(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(x.fontInfo),c=gd.createEmpty(r,o),l=fp.isBasicASCII(r,e.mightContainNonBasicASCII()),d=fp.containsRTL(r,l,e.mightContainRTL());return Ure(new yI(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,r,!1,l,d,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(x.stopRenderingLineAfter),t.get(x.renderWhitespace),t.get(x.renderControlCharacters),t.get(x.fontLigatures)!==Lk.OFF,null)).html}};lve=D([_(5,xi)],lve);class bIt{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}W("diffEditor.move.border","#8b8b8b9c",g(4988,"The border color for text that got moved in the diff editor."));W("diffEditor.moveActive.border","#FFA500",g(4989,"The active border color for text that got moved in the diff editor."));W("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(4990,"The color of the shadow around unchanged region widgets."));const wIt=oi("diff-insert",ve.add,g(4991,"Line decoration for inserts in the diff editor.")),PYe=oi("diff-remove",ve.remove,g(4992,"Line decoration for removals in the diff editor.")),AJ=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+We.asClassName(wIt),marginClassName:"gutter-insert"}),L3=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+We.asClassName(PYe),marginClassName:"gutter-delete"}),CWe=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),SWe=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),EJ=Gt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),CRe=Gt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),SRe=Gt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),cW=Gt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),ARe=Gt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),ERe=Gt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class yIt{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=jt(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class E6{static fromFn(e){return new E6(e())}constructor(e){this._value=jt(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(ts(i=>{this._value.set(new AWe(t,void 0),i)}),t),t=>{throw ts(i=>{this._value.set(new AWe(void 0,t),i)}),t})}}class AWe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class CIt{constructor(e){this._computePromise=e,this._lazyValue=new yIt(()=>new E6(this._computePromise())),this.cachedPromiseResult=Ze(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function T5(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,o)=>{let r=!0,a=!1;const c=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=ai(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):n(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Ma)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Ma);return}}r=!1,a&&l.dispose()})}var a0;const x6=ae("diffProviderFactoryService");let dve=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(hve,e)}};dve=D([_(0,we)],dve);ce(x6,dve,qt.Delayed);var mL;let hve=(mL=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new I,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new q_(new pi(1,2),new pi(1,t.getLineCount()+1),[new Gp(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=a0.diffCache.get(o);if(a&&a.context===r)return a.result;const c=js.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=c.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return a0.diffCache.size>10&&a0.diffCache.delete(a0.diffCache.keys().next().value),a0.diffCache.set(o,{result:l,context:r}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},a0=mL,mL.diffCache=new Map,mL);hve=a0=D([_(1,Ml),_(2,Yi)],hve);function kae(){return D2&&!!D2.VSCODE_DEV}function FYe(s){if(kae()){const e=SIt();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function SIt(){cK||(cK=new Set);const s=globalThis;return s.$hotReload_applyNewExports||(s.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e},i=[];for(const n of cK){const o=n(t);o&&i.push(o)}if(i.length>0)return n=>{let o=!1;for(const r of i)r(n)&&(o=!0);return o}}),cK}let cK;kae()&&FYe(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const n in i){const o=i[n];if(console.log(`[hot-reload] Patching prototype methods of '${n}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=s[n];if(r){for(const a of Object.getOwnPropertyNames(o.prototype)){const c=Object.getOwnPropertyDescriptor(o.prototype,a),l=Object.getOwnPropertyDescriptor(r.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${n}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[n]=r}}}return!0}});function Fg(s,e){return AIt([s],e),s}function AIt(s,e){kae()&&id("reload",i=>FYe(({oldExports:n})=>{if([...Object.values(n)].some(o=>s.includes(o)))return o=>(i(void 0),!0)})).read(e)}let xJ=class extends V{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}setHoveredMovedText(e){this._hoveredMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=jt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=jt(this,void 0),this.diff=this._diff,this._unchangedRegions=jt(this,void 0),this.unchangedRegions=Ze(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(ts(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=jt(this,void 0),this._activeMovedText=jt(this,void 0),this._hoveredMovedText=jt(this,void 0),this.activeMovedText=Ze(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ci,this._diffProvider=Ze(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=id("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const n=gC("contentChangedSignal"),o=this._register(new cn(()=>n.trigger(void 0),200));this._register(ai(a=>{const c=this._unchangedRegions.read(a);if(!c||c.regions.some(p=>p.isDragged.read(a)))return;const l=c.originalDecorationIds.map(p=>e.original.getDecorationRange(p)).map(p=>p?pi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?pi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Tx(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(Fc),u=[];let f=!1;for(const p of P1e(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((b,w)=>b+w.lineCount,0),v=new Tx(p[0].originalLineNumber,p[0].modifiedLineNumber,m,p[0].visibleLineCountTop.get(),p[p.length-1].visibleLineCountBottom.get());u.push(v)}else u.push(p[0]);if(f){const p=e.original.deltaDecorations(c.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(c.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));ts(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Tx.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l));let h;const u=this._unchangedRegions.get();if(u){const v=u.originalDecorationIds.map(C=>e.original.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0);let y=oIt(u.regions.map((C,A)=>{if(!v[A]||!b[A])return;const L=v[A].length;return new Tx(v[A].startLineNumber,b[A].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Fc),(C,A)=>!A||C.modifiedLineNumber>=A.modifiedLineNumber+A.lineCount&&C.originalLineNumber>=A.originalLineNumber+A.lineCount).map(C=>new L_(C.getHiddenOriginalRange(l),C.getHiddenModifiedRange(l)));y=L_.clip(y,pi.ofLength(1,e.original.getLineCount()),pi.ofLength(1,e.modified.getLineCount())),h=L_.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const b=h.filter(w=>w.original.intersectsStrict(v.originalUnchangedRange)&&w.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(b,c))}else f.push(...d);const p=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:p,modifiedDecorationIds:m},c)};this._register(e.modified.onDidChangeContent(a=>{this._diff.get()&&DS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&DS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(cu(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),n.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),Fg(BKe,a),Fg(Tpe,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=DS.fromModelContentChanges(f.changes);d=vY(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=DS.fromModelContentChanges(f.changes);h=vY(h,p)}));let u=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=EIt(u,e.original,e.modified),u=u,u=u,ts(f=>{r(u,f),this._lastDiff=u;const p=xRe.fromDiffResult(u);this._diff.set(p,f),this._isDiffUpToDate.set(!0,f);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await T5(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(n=>pi.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||ts(n=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,n);break}})}};xJ=D([_(2,x6)],xJ);function EIt(s,e,t){return{changes:s.changes.map(i=>new q_(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>xIt(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function xIt(s,e,t){let i=s.originalRange,n=s.modifiedRange;return i.startColumn===1&&n.startColumn===1&&(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew OYe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class OYe{constructor(e){this.lineRangeMapping=e}}class Tx{static fromDiffs(e,t,i,n,o){const r=q_.inverse(e,t,i),a=[];for(const c of r){let l=c.original.startLineNumber,d=c.modified.startLineNumber,h=c.original.length;const u=l===1&&d===1,f=l+h===t+1&&d+h===i+1;(u||f)&&h>=o+n?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Tx(l,d,h,0,0))):h>=o*2+n&&(l+=o,d+=o,h-=o*2,a.push(new Tx(l,d,h,0,0)))}return a}get originalUnchangedRange(){return pi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return pi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=jt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=jt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ze(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=jt(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-n),0);tOe(n===r),tOe(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new jp(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of n.ranges){const d=c===n.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Tx(o,r,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return pi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return pi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===g_.FromCloserSide&&n{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],b=n.modified.isEmpty;return v.push(new rn("diff.clipboard.copyDeletedContent",b?n.original.length>1?g(9956,"Copy deleted lines"):g(9957,"Copy deleted line"):n.original.length>1?g(9958,"Copy changed lines"):g(9959,"Copy changed line"),void 0,!0,async()=>{const y=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(y)})),n.original.length>1&&v.push(new rn("diff.clipboard.copyDeletedLineContent",b?g(9960,"Copy deleted line ({0})",n.original.startLineNumber+h):g(9961,"Copy changed line ({0})",n.original.startLineNumber+h),void 0,!0,async()=>{let y=this._originalTextModel.getLineContent(n.original.startLineNumber+h);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===Sh.LF?` `:`\r -`),await this._clipboardService.writeText(C)})),i.getOption(x.readOnly)||v.push(new xn("diff.inline.revertChange",g(xL,6,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Xo(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=ia(this._diffActions),w=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+w)})),this._register(i.onMouseMove(p=>{(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(p=>{p.event.leftButton&&(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()&&(p.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),f(p.event.posx,p.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=ia(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ln});function oZe(n,e,t,i){Sd(i,e.fontInfo);const s=t.length>0,o=new fz(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=Am.isBasicASCII(c,s),d=Am.containsRTL(c,l,o),h=lQ(new tL(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==l1.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let DCe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=xi(this,0),this._originalScrollOffset=xi(this,0),this._originalScrollOffsetAnimated=BUe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=xi(this,0),this._modifiedScrollOffset=xi(this,0),this._modifiedScrollOffsetAnimated=BUe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=xi("invalidateAlignmentsState",0),u=this._register(new yn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(C=>C?Wn(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===RI.Completed):void 0).map((C,y)=>C?.read(y)),p=Dt(C=>{const y=this._diffModel.read(C),S=y?.diff.read(C);if(!y||!S)return null;h.read(C);const k=this._options.renderSideBySide.read(C);return JUe(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Dt(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);if(!y)return null;h.read(C);const S=y.changes.map(M=>new sZe(M));return JUe(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const C=document.createElement("div");return C.className="diagonal-fill",C}const w=this._register(new Z);this.viewZones=wO(this,(C,y)=>{w.clear();const S=p.read(C)||[],M=[],k=[],F=this._modifiedTopPadding.read(C);F>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._originalTopPadding.read(C);N>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:N,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(C),U=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(U){const Oe=this._editors.original.getModel();for(const wt of S)if(wt.diff)for(let Nt=wt.originalRange.startLineNumber;NtOe.getLineCount())return{orig:M,mod:k};U?.addRequest(Oe.getLineContent(Nt),null,null)}}const J=U?.finalize()??[];let j=0;const re=this._editors.modified.getOption(x.lineHeight),me=this._diffModel.read(C)?.movedTextToCompare.read(C),De=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Qe=this._editors.original.getModel()?.mightContainRTL()??!1,Tt=Ode.fromEditor(this._editors.modified);for(const Oe of S)if(Oe.diff&&!z){if(!Oe.originalRange.isEmpty){f.read(C);const Nt=document.createElement("div");Nt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ji=this._editors.original.getModel();if(Oe.originalRange.endLineNumberExclusive-1>Ji.getLineCount())return{orig:M,mod:k};const zi=new rZe(Oe.originalRange.mapToLineArray(ys=>Ji.tokenization.getLineTokens(ys)),Oe.originalRange.mapToLineArray(ys=>J[j++]),De,Qe),Gn=[];for(const ys of Oe.diff.innerChanges||[])Gn.push(new DW(ys.originalRange.delta(-(Oe.diff.original.startLineNumber-1)),ACe.className,Mc.Regular));const Ro=oZe(zi,Tt,Gn,Nt),qn=document.createElement("div");if(qn.className="inline-deleted-margin-view-zone",Sd(qn,Tt.fontInfo),this._options.renderIndicators.read(C))for(let ys=0;ysws(tc),qn,this._editors.modified,Oe.diff,this._diffEditorWidget,Ro.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ys=0;ys1&&M.push({afterLineNumber:Oe.originalRange.startLineNumber+ys,domNode:v(),heightInPx:(mr-1)*re,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Oe.modifiedRange.startLineNumber-1,domNode:Nt,heightInPx:Ro.heightInLines*re,minWidthInPx:Ro.minWidthInPx,marginDomNode:qn,setZoneId(ys){tc=ys},showInHiddenAreas:!0,suppressMouseDown:!0})}const wt=document.createElement("div");wt.className="gutter-delete",M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Oe.modifiedHeightInPx,marginDomNode:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;if(wt>0){if(me?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Oe.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Nt=function(){const zi=document.createElement("div");return zi.className="arrow-revert-change "+$e.asClassName(Ce.arrowRight),y.add(pe(zi,"mousedown",Gn=>Gn.stopPropagation())),y.add(pe(zi,"click",Gn=>{Gn.stopPropagation(),o.revert(Oe.diff)})),we("div",{},zi)};if(me?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Oe.modifiedRange.endLineNumberExclusive-1))continue;let Ji;Oe.diff&&Oe.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(Ji=Nt()),k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,marginDomNode:Ji,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Oe of m.read(C)??[]){if(!me?.lineRangeMapping.original.intersect(Oe.originalRange)||!me?.lineRangeMapping.modified.intersect(Oe.modifiedRange))continue;const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;wt>0?M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:k}});let b=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(C.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(C.scrollLeft),b=!1)})),this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ni(C=>{const y=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));y!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));y!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);let S=0;if(y){const M=this._editors.original.getTopForLineNumber(y.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(y.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-M}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};DCe=D([_(8,Mu),_(9,Vr)],DCe);function JUe(n,e,t,i,s,o){const r=new DS(XUe(n,i)),a=new DS(XUe(e,s)),c=n.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),w=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),w&&w.lineNumber>=m&&(w=void 0),!v&&!w)break;const b=v?v.lineNumber-h:Number.MAX_VALUE,C=w?w.lineNumber-u:Number.MAX_VALUE;bC?(a.dequeue(),v={lineNumber:w.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:bi.ofLength(v.lineNumber,1),modifiedRange:bi.ofLength(w.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+w.heightInPx,diff:void 0})}}for(const p of t){let C=function(y,S){if(yz.lineNumberz+U.heightInPx,0)??0,N=a.takeWhile(z=>z.lineNumberz+U.heightInPx,0)??0;d.push({originalRange:M,modifiedRange:k,originalHeightInPx:M.length*c+F,modifiedHeightInPx:k.length*l+N,diff:p.lineRangeMapping}),b=y,w=S};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,w=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const y of m.innerChanges||[]){y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&C(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber);const S=n.getModel(),M=y.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(y.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;y.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of n.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new oe(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return o1t(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}class B1t extends ${constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Wn(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Wn(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Bh("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Bh("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=oL("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(di("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{En(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(Ni(r=>{s.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(Ni(r=>this.render(r)))}dispose(){super.dispose(),_a(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),o=hi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new bi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);En(l=>{for(const d of c){if(!d.range.intersect(a))continue;s.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,l);else{const m=document.createElement("div");this._domNode.appendChild(m);const v=xi("item",d),w=this.itemProvider.createView(v,m);h=new W1t(v,w,m),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,p=(d.range.isEmpty?u:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${p}px`,h.gutterItemView.layout(hi.ofStartAndLength(u,p),o)}})}for(const r of s){const a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}}class W1t{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class aZe extends gw{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class kCe extends Zje{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new gf(e-1,t)}}var H1t=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";Ct(H1t,{});const U1t="vs/base/browser/ui/toolbar/toolbar";class cZe extends ${constructor(e,t,i={orientation:Qb.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new QRe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(C1()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new F7(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Qh(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,o)=>{if(s.id===F7.ID)return this.toggleMenuActionViewItem=new gx(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:$e.asClassNameArray(i.moreIcon??Ce.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(s,o);if(r)return r}if(s instanceof u1){const r=new gx(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}focus(){this.actionBar.focus()}getItemsWidth(){let e=0;for(let t=0;t0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return(this.lookupKeybindings?this.options.getKeyBinding?.(e):void 0)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const Bae=class Bae extends xn{constructor(e,t){t=t||g(U1t,0,"More Actions..."),super(Bae.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};Bae.ID="toolbar.toggle.more";let F7=Bae;const ZUe="vs/platform/actions/browser/toolbar";var wS;(function(n){n[n.NoHide=-1]="NoHide",n[n.Ignore=0]="Ignore",n[n.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(wS||(wS={}));let lV=class extends cZe{constructor(e,t,i,s,o,r,a,c){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new Z);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>c.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();const s=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==wS.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(s[f]=void 0,c[f]=p))}}iF(s),iF(c),super.setActions(s,Kr.join(c,o)),(r.length>0||s.length>0)&&this._sessionDisposables.add(pe(this.getElement(),"contextmenu",d=>{const h=new yu(gt(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof id&&u.menuKeybinding?f.push(u.menuKeybinding):u instanceof uS||u instanceof F7||f.push(QXe(u.id,void 0,this._commandService,this._keybindingService)),r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===wS.Ignore){m=!0;for(let v=0;vthis._menuService.resetHiddenStates(i)}))),p.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>p,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};lV=D([_(2,_c),_(3,Pe),_(4,Vr),_(5,ti),_(6,ji),_(7,rn)],lV);let nC=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(s.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];tD(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",u.length===0&&f.length===0),super.setActions(u,f)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new cn("This toolbar is populated from a menu.")}};nC=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,ji),_(8,rn)],nC);const jfe=[],fK=35;let ICe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(Te.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Wn(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Dt(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Dt(this,d=>this._hasActions.read(d)?fK:0),this.elements=di("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:fK+"px"}},[]),this._currentDiff=Dt(this,d=>{const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d)?.mappings,f=this._editors.modifiedCursor.read(d);if(f)return u?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=Dt(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return jfe;const f=this._editors.modifiedSelections.read(d);if(f.every(w=>w.isEmpty()))return jfe;const p=new h_(f.map(w=>bi.fromRangeInclusive(w))),v=u.mappings.filter(w=>w.lineRangeMapping.innerChanges&&p.intersects(w.lineRangeMapping.modified)).map(w=>({mapping:w,rangeMappings:w.lineRangeMapping.innerChanges.filter(b=>f.some(C=>O.areIntersecting(b.modifiedRange,C)))}));return v.length===0||v.every(w=>w.rangeMappings.length===0)?jfe:v}),this._register(r1t(e,this.elements.root)),this._register(pe(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(D1(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),WC(this,d=>this._showSash.read(d)?new iZe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,HJe(this,u=>this._sashLayout.sashLeft.read(u)-fK,(u,f)=>this._sashLayout.sashLeft.set(u+fK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new B1t(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,h)=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const p=this._selectedDiffs.read(h);if(p.length>0){const v=pw.fromRangeMappings(p.flatMap(w=>w.rangeMappings));return[new eVe(v,!0,Te.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new eVe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,Te.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(LCe,d,h,this)})),this._register(pe(this.elements.gutter,xe.MOUSE_WHEEL,d=>{this._editors.modified.getOption(x.scrollbar).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new kCe(this._editors.modifiedModel.get()),s=new kCe(this._editors.original.getModel());return new WU(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};ICe=D([_(6,be),_(7,Pe),_(8,_c)],ICe);class eVe{constructor(e,t,i,s,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let LCe=class extends ${constructor(e,t,i,s){super(),this._item=e,this._elements=di("div.gutterItem",{style:{height:"20px",width:"34px"}},[di("div.background@background",{},[]),di("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=xi(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(s.createInstance(gF,"element",!0,{position:{hoverPosition:Oo.RIGHT}}));this._register(A3(t,this._elements.root)),this._register(Ni(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(xm((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(s.createInstance(nC,this._elements.buttons,this._menuId.read(r),{orientation:Qb.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:wS.Ignore,actionRunner:new aZe(()=>{const l=this._item.get(),d=l.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:l.originalUri,modifiedUri:l.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(c.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,o=i;let r=e.start+s;const a=hi.tryCreate(o,t.endExclusive-o-i),c=hi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const l=this._editors.modifiedModel.read(c),d=TCe._breadcrumbsSourceFactory.read(c);return!l||!d?void 0:d(l,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===Hi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Hi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})}));const o=this._diffModel.map((c,l)=>{const d=c?.unchangedRegions.read(l)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(l)?.getLineCount()?[]:d});this.viewZones=wO(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=o.read(c);for(const m of p)if(!m.shouldHideControls(c)){{const v=Dt(this,b=>m.getHiddenOriginalRange(b).startLineNumber-1),w=new Qee(v,24);h.push(w),l.add(new tVe(this._editors.original,w,m,m.originalUnchangedRange,!f,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}{const v=Dt(this,b=>m.getHiddenModifiedRange(b).startLineNumber-1),w=new Qee(v,24);u.push(w),l.add(new tVe(this._editors.modified,w,m,m.modifiedUnchangedRange,!1,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}}return{origViewZones:h,modViewZones:u}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Xt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(vB,0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+$e.asClassName(Ce.fold),zIndex:10001};this._register(qee(this._editors.original,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:O.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(qee(this._editors.modified,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:bi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Ni(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(yl)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(yl))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}},TCe=lN,lN._breadcrumbsSourceFactory=xi("breadcrumbsSourceFactory",void 0),lN);Yee=TCe=D([_(3,be)],Yee);class tVe extends ZXe{constructor(e,t,i,s,o,r,a,c){const l=di("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=di("div.diff-hidden-lines",[di("div.top@top",{title:g(vB,1,"Click or drag to show more above")}),di("div.center@content",{style:{display:"flex"}},[di("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[we("a",{title:g(vB,2,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...nw("$(unfold)"))]),di("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),di("div.bottom@bottom",{title:g(vB,3,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const d=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?_a(this._nodes.first):this._register(D1(this._nodes.first,{width:d.map(u=>u.contentLeft)})),this._register(Ni(u=>{const f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const p=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!p),p==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):p==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const h=this._editor;this._register(pe(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const v=gt(this._nodes.top),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m+M,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),b=pe(v,"mouseup",C=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),w.dispose(),b.dispose()})})),this._register(pe(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const v=gt(this._nodes.bottom),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m-M,this._unchangedRegion.getMaxVisibleLineCountBottom())),F=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const N=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(N-F))}),b=pe(v,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const y=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const S=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(S-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),w.dispose(),b.dispose()})})),this._register(Ni(u=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(u).length,m=g(vB,4,"{0} hidden lines",p),v=we("span",{title:g(vB,5,"Double click to unfold")},m);v.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const w=this._unchangedRegion.getHiddenModifiedRange(u),b=this._modifiedOutlineSource.getBreadcrumbItems(w,u);if(b.length>0){f.push(we("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(y.startLineNumber)}}}}_a(this._nodes.others,...f)}))}}var J_,a0;let dV=(a0=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=J_.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Wn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Dt(u=>{const f=c.read(u),p=f.getColor(Rmt)||(f.getColor(m_)||twe).transparent(2),m=f.getColor(Mmt)||(f.getColor(yE)||iwe).transparent(2);return{insertColor:p,removeColor:m}}),d=ks(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=di("div.diffOverview",{style:{position:"absolute",top:"0px",width:J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(A3(h,d.domNode)),this._register(Xo(h,xe.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(pe(h,xe.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(A3(this._rootElement,h)),this._register(xm((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(A3(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(A3(h,v.getDomNode()))),!m||!v)return;const w=Bh("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=Bh("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=Bh("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),y=Bh("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(Ni(S=>{w.read(S),b.read(S),C.read(S),y.read(S);const M=l.read(S),k=p?.diff.read(S)?.mappings;function F(U,J,j){const re=j._getViewModel();return re?U.filter(me=>me.length>0).map(me=>{const De=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.startLineNumber,1)),Qe=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.endLineNumberExclusive,1)),Tt=Qe.lineNumber-De.lineNumber;return new nYe(De.lineNumber,Qe.lineNumber,Tt,J.toString())}):[]}const N=F((k||[]).map(U=>U.lineRangeMapping.original),M.removeColor,this._editors.original),z=F((k||[]).map(U=>U.lineRangeMapping.modified),M.insertColor,this._editors.modified);m?.setZones(N),v?.setZones(z)})),f.add(Ni(S=>{const M=this._rootHeight.read(S),k=this._rootWidth.read(S),F=this._modifiedEditorLayoutInfo.read(S);if(F){const N=J_.ENTIRE_DIFF_OVERVIEW_WIDTH-2*J_.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:M,right:N+J_.ONE_OVERVIEW_WIDTH,width:J_.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:M,right:0,width:J_.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(S),U=this._editors.modifiedScrollHeight.read(S),J=this._editors.modified.getOption(x.scrollbar),j=new qU(J.verticalHasArrows?J.arrowSize:0,J.verticalScrollbarSize,0,F.height,U,z);d.setTop(j.getSliderPosition()),d.setHeight(j.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=M+"px",h.style.left=k-J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(J_.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},J_=a0,a0.ONE_OVERVIEW_WIDTH=15,a0.ENTIRE_DIFF_OVERVIEW_WIDTH=J_.ONE_OVERVIEW_WIDTH*2,a0);dV=J_=D([_(6,pn)],dV);const iVe="vs/editor/browser/widget/diffEditor/features/revertButtonsFeature",Kfe=[];class V1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=Dt(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return Kfe;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return Kfe;const l=new h_(c.map(u=>bi.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&l.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>c.some(p=>O.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?Kfe:h}),this._register(xm((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),c=a?.diff.read(o);if(!a||!c||a.movedTextToCompare.read(o))return;const l=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new Jee(u[u.length-1].positionLineNumber,this._widget,d.flatMap(p=>p.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}for(const u of c.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new Jee(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}r.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Wae=class Wae extends ${getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${Wae.counter++}`,this._domNode=di("div.revertButton",{title:this._revertSelection?g(iVe,0,"Revert Selected Changes"):g(iVe,1,"Revert Change")},[OS(Ce.arrowRight)]).root,this._register(pe(this._domNode,xe.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(pe(this._domNode,xe.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(pe(this._domNode,xe.CLICK,o=>{this._diffs instanceof $b?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:FS.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Wae.counter=0;let Jee=Wae;function Yfe(n){return RCe.get(n)}const ZT=class ZT{static get(e){let t=ZT._map.get(e);if(!t){t=new ZT(e),ZT._map.set(e,t);const i=e.onDidDispose(()=>{ZT._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.value=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getValue()),this.valueIsEmpty=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getModel()?.getValueLength()===0),this.selections=Wn(this.editor.onDidChangeCursorSelection,()=>this.editor.getSelections()),this.cursorPosition=yy({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.isFocused=Wn(t=>{const i=this.editor.onDidFocusEditorWidget(t),s=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),s.dispose()}}},()=>this.editor.hasWidgetFocus())}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(bQ({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}};ZT._map=new Map;let RCe=ZT;const z1t="vs/editor/browser/widget/diffEditor/components/diffEditorEditors";let MCe=class extends ${get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new I),this.modifiedScrollTop=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=Yfe(this.modified).model,this.modifiedSelections=Wn(this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=yy({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Wn(this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Yfe(this.original).isFocused,this.isModifiedFocused=Yfe(this.modified).isFocused,this.isFocused=Dt(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(Az({createEmptyChangeSummary:()=>({}),handleChange:(c,l)=>(c.didChange(i.editorOptions)&&Object.assign(l,c.change.changedOptions),!0)},(c,l)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,l)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,l))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=_u.revealHorizontalRightPadding.defaultValue+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=g(z1t,0," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};MCe=D([_(5,be),_(6,ti)],MCe);const Hae=class Hae extends ${constructor(){super(...arguments),this._id=++Hae.idCounter,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getStatusbarColumn(e){return this._targetEditor.getStatusbarColumn(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=vt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=vt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=vt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=vt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=vt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=vt.Smooth){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=vt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=vt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=vt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=vt.Smooth){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};Hae.idCounter=0;let NCe=Hae,Xee=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=xi(this,0),this._screenReaderMode=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Dt(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Dt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=Dt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=Dt(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=Dt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=Dt(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=Dt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=Dt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=Dt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=Dt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=Dt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=Dt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=Dt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=Dt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=Dt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=Dt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=Dt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=Dt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=Dt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Dt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Dt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i={...e,...nVe(e,_h)};this._options=xi(this,i)}updateOptions(e){const t=nVe(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}};Xee=D([_(1,Ur)],Xee);function nVe(n,e){return{enableSplitViewResizing:It(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:odt(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:It(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:It(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:VL(n.maxComputationTime,e.maxComputationTime,0,Zn.MAX_SAFE_SMALL_INTEGER),maxFileSize:VL(n.maxFileSize,e.maxFileSize,0,Zn.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:It(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:It(n.renderIndicators,e.renderIndicators),originalEditable:It(n.originalEditable,e.originalEditable),diffCodeLens:It(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:It(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:La(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:La(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:It(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:It(n.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:It(n.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:It(n.hideUnchangedRegions?.enabled??n.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:VL(n.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),minimumLineCount:VL(n.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),revealLineCount:VL(n.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:It(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:It(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:VL(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Zn.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:It(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:It(n.renderGutterMenu,e.renderGutterMenu)}}var fH;let Dm=(fH=class extends NCe{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,s,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=di("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[di("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),di("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),di("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=xi(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=T.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._boundarySashes=xi(this,void 0),this._accessibleDiffViewerShouldBeVisible=xi(this,!1),this._accessibleDiffViewerVisible=Dt(this,y=>this._options.onlyShowAccessibleDiffViewer.read(y)?!0:this._accessibleDiffViewerShouldBeVisible.read(y)),this._movedBlocksLinesPart=xi(this,void 0),this._layoutInfo=Dt(this,y=>{const S=this._rootSizeObserver.width.read(y),M=this._rootSizeObserver.height.read(y);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=M+"px";const k=this._sash.read(y),F=this._gutter.read(y),N=F?.width.read(y)??0,z=this._overviewRulerPart.read(y)?.width??0;let U,J,j,re,me;if(!!k){const Qe=k.sashLeft.read(y),Tt=this._movedBlocksLinesPart.read(y)?.width.read(y)??0;U=0,J=Qe-N-Tt,me=Qe-N,j=Qe,re=S-j-z}else me=0,U=N,J=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),j=N+J,re=S-j-z;return this.elements.original.style.left=U+"px",this.elements.original.style.width=J+"px",this._editors.original.layout({width:J,height:M},!0),F?.layout(me),this.elements.modified.style.left=j+"px",this.elements.modified.style.width=re+"px",this._editors.modified.layout({width:re,height:M},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((y,S)=>y?.diff.read(S)),this.onDidUpdateDiff=T.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this.elements.root.classList.toggle("standalone",i.isStandaloneEditor||!1),this._domElement.appendChild(this.elements.root),this._register(Ee(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new XXe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(Xee,t),this._register(Ni(y=>{this._options.setWidth(this._rootSizeObserver.width.read(y))})),this._contextKeyService.createKey(X.isEmbeddedDiffEditor.key,!1),this._register(dA(X.isEmbeddedDiffEditor,this._contextKeyService,y=>this._options.isInEmbeddedEditor.read(y))),this._register(dA(X.comparingMovedCode,this._contextKeyService,y=>!!this._diffModel.read(y)?.movedTextToCompare.read(y))),this._register(dA(X.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,y=>this._options.couldShowInlineViewBecauseOfSize.read(y))),this._register(dA(X.diffEditorInlineMode,this._contextKeyService,y=>!this._options.renderSideBySide.read(y))),this._register(dA(X.hasChanges,this._contextKeyService,y=>(this._diffModel.read(y)?.diff.read(y)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(MCe,this.elements.original,this.elements.modified,this._options,i,(y,S,M,k)=>this._createInnerEditor(y,S,M,k))),this._register(dA(X.diffEditorOriginalWritable,this._contextKeyService,y=>this._options.originalEditable.read(y))),this._register(dA(X.diffEditorModifiedWritable,this._contextKeyService,y=>!this._options.readOnly.read(y))),this._register(dA(X.diffEditorOriginalUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.original.uri.toString()??"")),this._register(dA(X.diffEditorModifiedUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.modified.uri.toString()??"")),this._overviewRulerPart=WC(this,y=>this._options.renderOverviewRuler.read(y)?this._instantiationService.createInstance(_v(dV,y),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,S)=>y-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new T1t(this._options,l),this._sash=WC(this,y=>{const S=this._options.renderSideBySide.read(y);return this.elements.root.classList.toggle("side-by-side",S),S?new iZe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=WC(this,y=>this._instantiationService.createInstance(_v(Yee,y),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);WC(this,y=>this._instantiationService.createInstance(_v(L1t,y),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=WC(this,y=>this._instantiationService.createInstance(_v(DCe,y),gt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Dt(this,y=>{const S=p.read(y).viewZones.read(y).orig,M=d.read(y).viewZones.read(y).origViewZones;return S.concat(M)}),v=Dt(this,y=>{const S=p.read(y).viewZones.read(y).mod,M=d.read(y).viewZones.read(y).modViewZones;return S.concat(M)});this._register(jee(this._editors.original,m,y=>{f=y},h));let w;this._register(jee(this._editors.modified,v,y=>{f=y,f?w=M_.capture(this._editors.modified):(w?.restore(this._editors.modified),w=void 0)},u)),this._accessibleDiffViewer=WC(this,y=>this._instantiationService.createInstance(_v(Kk,y),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,M)=>this._accessibleDiffViewerShouldBeVisible.set(S,M),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,M)=>S?.diff.read(M)?.mappings.map(k=>k.lineRangeMapping)),new A1t(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(y=>y?"hidden":"visible");this._register(D1(this.elements.modified,{visibility:b})),this._register(D1(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=WC(this,y=>this._options.shouldRenderGutterMenu.read(y)?this._instantiationService.createInstance(_v(ICe,y),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Ez(this._layoutInfo)),WC(this,y=>new(_v(GW,y))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,y=>{this._movedBlocksLinesPart.set(y,void 0)}),this._register(T.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!0))),this._register(T.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!1)));const C=this._diffModel.map(this,(y,S)=>{if(y)return y.diff.read(S)===void 0&&!y.isDiffUpToDate.read(S)});this._register(xm((y,S)=>{if(C.read(y)===!0){const M=this._editorProgressService.show(!0,1e3);S.add(Ee(()=>M.done()))}})),this._register(Ee(()=>{this._shouldDisposeDiffModel&&this._diffModel.get()?.dispose()})),this._register(xm((y,S)=>{S.add(new(_v(V1t,y))(this._editors,this._diffModel,this._options,this))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,s){return e.createInstance(_1,t,i,s)}_createDiffEditorContributions(){const e=b_.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){bt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return mz.IDiffEditor}onVisible(){this._editors.original.onVisible(),this._editors.modified.onVisible()}onHide(){this._editors.original.onHide(),this._editors.modified.onHide()}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(Kee,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==i?.model&&m7(t,s=>{Wn.batchEventsGlobally(s,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const o=this._diffModel.get(),r=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=i?.shouldDispose??!1,this._diffModel.set(i?.model,s),r&&o?.dispose()})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}setBoundarySashes(e){this._boundarySashes.set(e,void 0)}get ignoreTrimWhitespace(){return this._options.ignoreTrimWhitespace.get()}get maxComputationTime(){return this._options.maxComputationTimeMs.get()}get renderSideBySide(){return this._options.renderSideBySide.get()}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?$1t(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new oe(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?s=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=t1(t,o=>o.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const o=t.getSelection();if(o){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=WUe(o.getStartPosition(),r),c=WUe(o.getEndPosition(),r);s=O.plusRange(a,c)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Hi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(s=>t?s.lineRangeMapping.modified.contains(e.position.lineNumber):s.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Zl.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},fH.ENTIRE_DIFF_OVERVIEW_WIDTH=dV.ENTIRE_DIFF_OVERVIEW_WIDTH,fH);Dm=D([_(3,Pe),_(4,be),_(5,jt),_(6,Lw),_(7,eD)],Dm);function $1t(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a?.map(c=>({originalStartLineNumber:c.originalRange.startLineNumber,originalStartColumn:c.originalRange.startColumn,originalEndLineNumber:c.originalRange.endLineNumber,originalEndColumn:c.originalRange.endColumn,modifiedStartLineNumber:c.modifiedRange.startLineNumber,modifiedStartColumn:c.modifiedRange.startColumn,modifiedEndLineNumber:c.modifiedRange.endLineNumber,modifiedEndColumn:c.modifiedRange.endColumn}))}})}let G1t=0,sVe=!1;function q1t(n){if(!n){if(sVe)return;sVe=!0}smt(n||yi.document.body)}let k1=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||bee.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+bee.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,s,o,r,l,d,h,u,f),c instanceof x1?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,q1t(p.ariaContainerElement),RJe((m,v)=>i.createInstance(gF,m,v,{})),KJe(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++G1t,o=ge.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None;const t=e.id,i=e.label,s=ge.and(ge.equals("editorId",this.getId()),ge.deserialize(e.precondition)),o=e.keybindings,r=ge.and(s,ge.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,l=(f,...p)=>Promise.resolve(e.run(this,...p)),d=new Z,h=this.getId()+":"+t;if(d.add(yt.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:s,group:a,order:c};d.add(Xs.appendMenuItem(Te.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new oYe(h,i,i,void 0,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Ee(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof tee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};k1=D([_(2,be),_(3,jt),_(4,ji),_(5,Pe),_(6,el),_(7,ti),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],k1);let mF=class extends k1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){const w={...t};$ee(h,w,!1);const b=l.registerEditorContainer(e);typeof w.theme=="string"&&l.setTheme(w.theme),typeof w.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!w.autoDetectHighContrast);const C=w.model;delete w.model,super(e,w,i,s,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(b);let y;if(typeof C>"u"){const S=p.getLanguageIdByMimeType(w.language)||w.language||Yc;y=lZe(f,p,w.value||"",S,void 0),this._ownsModel=!0}else y=C,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};mF=D([_(2,be),_(3,jt),_(4,ji),_(5,Pe),_(6,el),_(7,ti),_(8,Iw),_(9,Pi),_(10,Re),_(11,Ur),_(12,Ai),_(13,Di),_(14,lo),_(15,ht)],mF);let Zee=class extends Dm{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={...t};$ee(c,f,!0);const p=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},s,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(k1,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};Zee=D([_(2,be),_(3,Pe),_(4,jt),_(5,Iw),_(6,Pi),_(7,Re),_(8,Vr),_(9,eD),_(10,Mu),_(11,Lw)],Zee);function lZe(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),oVe(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return oVe(n,t,e.createById(i),s)}function oVe(n,e,t,i){return n.createModel(e,t,i)}var Q1t=".monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);height:100%;overflow-y:hidden;position:relative;width:100%;>div{height:100%;left:0;position:absolute;top:0;width:100%;&.placeholder{display:grid;place-content:center;place-items:center;visibility:hidden;&.visible{visibility:visible}}}.active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.multiDiffEntry{display:flex;flex:1;flex-direction:column;overflow:hidden;.collapse-button{cursor:pointer;margin:0 5px;a{display:block}}.header{background:var(--vscode-editor-background);z-index:1000;&:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.header-content{align-items:center;background:var(--vscode-multiDiffEditor-headerBackground);border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);display:flex;margin:8px 0 0;padding:4px 5px;&.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.file-path{display:flex;flex:1;min-width:0;.title{font-size:14px;line-height:22px;&.original{flex:1;min-width:0;text-overflow:ellipsis}}.status{font-weight:600;line-height:22px;margin:0 10px;opacity:.75}}.actions{padding:0 8px}}}.editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);display:flex;flex:1;flex-direction:column;overflow:hidden}.editorContainer{flex:1}}}";Ct(Q1t,{});class j1t{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let ete=class extends ${constructor(e,t,i,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=xi(this,void 0),this._collapsed=Dt(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=xi(this,500),this.contentHeight=Dt(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=xi(this,0),this._modifiedWidth=xi(this,0),this._originalContentWidth=xi(this,0),this._originalWidth=xi(this,0),this.maxScroll=Dt(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),c=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>c?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:c,width:this._originalWidth.read(r)}}),this._elements=di("div.multiDiffEntry",[di("div.header@header",[di("div.header-content",[di("div.collapse-button@collapseButton"),di("div.file-path",[di("div.title.modified.show-file-icons@primaryPath",[]),di("div.status.deleted@status",["R"]),di("div.title.original.show-file-icons@secondaryPath",[])]),di("div.actions@actions")])]),di("div.editorParent",[di("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Dm,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=rVe(this.editor.getModifiedEditor()),this.isOriginalFocused=rVe(this.editor.getOriginalEditor()),this.isFocused=Dt(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Z,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new Tu(this._elements.collapseButton,{});this._register(Ni(r=>{o.element.className="",o.icon=this._collapsed.read(r)?Ce.chevronRight:Ce.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ni(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{uJ(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(Ni(r=>{const a=this._viewModel.read(r)?.isActive.read(r);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(nC,this._elements.actions,Te.MultiDiffEditorFileToolbar,{actionRunner:this._register(new aZe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>yO(s,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),uJ(s=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setModel(e.viewModel.diffEditorViewModel,s),this.editor.updateOptions(t(i.options??{}))})}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(s.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,uJ(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};ete=D([_(3,be)],ete);function rVe(n){return Wn(e=>{const t=new Z;return t.add(n.onDidFocusEditorWidget(()=>e(!0))),t.add(n.onDidBlurEditorWidget(()=>e(!1))),t},()=>n.hasTextFocus())}class K1t{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}const Y1t="vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl";let PCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=di("div.scrollContent",[di("div@content",{style:{overflow:"hidden"}}),di("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new nO({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>xd(gt(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new hQ(this._scrollableElements.root,{vertical:zo.Auto,horizontal:zo.Auto,useShadows:!1},this._scrollable)),this._elements=di("div.monaco-component.multiDiffEditor",{},[di("div",{},[this._scrollableElement.getDomNode()]),di("div.placeholder@placeholder",{},[di("div",[g(Y1t,0,"No Changed Files")])])]),this._sizeObserver=this._register(new XXe(this._element,void 0)),this._objectPool=this._register(new K1t(c=>{const l=this._instantiationService.createInstance(ete,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=wO(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new cn}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new X1t(p,this._objectPool,this.scrollLeft,w=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+w})})),v=this._lastDocStates?.[m.getKey()];return v&&En(w=>{m.setViewState(v,w)}),u.set(p,m),m}),getItem:p=>u.get(p)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,l)=>c.reduce((d,h)=>d+h.contentHeight.read(l)+this._spaceBetweenPx,0)),this.activeControl=Dt(this,c=>{const l=this._viewModel.read(c)?.activeDiffItem.read(c);return l?this._viewItemsInfo.read(c).getItem(l).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(X.inMultiDiffEditor.key,!0),this._register(xm((c,l)=>{const d=this._viewModel.read(c);if(d&&d.contextKeys)for(const[h,u]of Object.entries(d.contextKeys)){const f=this._contextKeyService.createKey(h,void 0);f.set(u),l.add(Ee(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(X.multiDiffEditorAllCollapsed.key,!1);this._register(Ni(c=>{const l=this._viewModel.read(c);if(l){const d=l.items.read(c).every(h=>h.collapsed.read(c));a.set(d)}})),this._register(Ni(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(Ni(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Ni(c=>{const l=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${l}px`;const d=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${d}px`;const h=this._sizeObserver.width.read(c);let u=h;const f=this._viewItems.read(c),p=NRe(f,El(m=>m.maxScroll.read(c).maxScroll,cg));if(p){const m=p.maxScroll.read(c);u=h+m.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:l,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._elements.root),this._register(Ee(()=>{e.replaceChildren()})),this._register(this._register(Ni(c=>{uJ(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),s=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(s===-1)throw new cn("Resource not found in diff editor");const o=i[s];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,En(t=>{if(e.docStates)for(const i of this._viewItems.get()){const s=e.docStates[i.getKey()];s&&i.setViewState(s,t)}})}tryGetCodeEditor(e){const t=this._viewItems.get().find(s=>s.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||s.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString()),i=t?.template.get()?.editor;if(i)return t.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()?{diffEditor:i,editor:i.getModifiedEditor()}:{diffEditor:i,editor:i.getOriginalEditor()}}render(e){const t=this.scrollTop.read(e);let i=0,s=0,o=0;const r=this._sizeObserver.height.read(e),a=hi.ofStartAndLength(t,r),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,r),u=hi.ofStartAndLength(s,h),f=hi.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,l.hide();else if(f.isAfter(a))l.hide();else{const p=Math.max(0,Math.min(a.start-f.start,d-h));i-=p;const m=hi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}s+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};PCe=D([_(4,Pe),_(5,be)],PCe);function J1t(n,e){const t=n.getModel(),i=n.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{n.getModel()===t&&i.clear()},350)}class X1t extends ${constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(_7(this,void 0)),this.contentHeight=Dt(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Dt(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Dt(this,o=>this._templateRef.read(o)?.object),this._isHidden=xi(this,!1),this._isFocused=Dt(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Ni(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(Ni(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.entry.value.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return En(e=>{this._updateTemplateData(e)}),{collapsed:this.viewModel.collapsed.get(),selections:this.viewModel.lastTemplateData.get().selections}}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=e.selections?.map(mt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&En(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new j1t(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,s)}}class dZe extends ${async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!1,e)})}get contextKeys(){return this.model.contextKeys}constructor(e,t){super(),this.model=e,this._instantiationService=t,this._documents=VJe(this.model,this.model.documents),this.items=yee(this,this._documents,(i,s)=>s.add(this._instantiationService.createInstance(FCe,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Dt(this,i=>this.items.read(i).find(s=>s.isFocused.read(i))),this.activeDiffItem=jxt(this,(i,s)=>this.focusedDiffItem.read(i)??s)}}let FCe=class extends ${get originalUri(){return this.entry.value.original?.uri}get modifiedUri(){return this.entry.value.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}constructor(e,t,i,s){super(),this.entry=e,this._editorViewModel=t,this._instantiationService=i,this._modelService=s,this.collapsed=xi(this,!1),this.lastTemplateData=xi(this,{contentHeight:500,selections:void 0}),this.isActive=Dt(this,l=>this._editorViewModel.activeDiffItem.read(l)===this),this._isFocusedSource=xi(this,Au(!1)),this.isFocused=Dt(this,l=>this._isFocusedSource.read(l).read(l));function o(l){return{...l,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(Xee,o(this.entry.value.options||{}));this.entry.value.onOptionsDidChange&&this._register(this.entry.value.onOptionsDidChange(()=>{r.updateOptions(o(this.entry.value.options||{}))}));const a=this.entry.value.original??this._register(this._modelService.createModel("",null)),c=this.entry.value.modified??this._register(this._modelService.createModel("",null));this.diffEditorViewModel=this._register(this._instantiationService.createInstance(Kee,{original:a,modified:c},r))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};FCe=D([_(2,be),_(3,Ai)],FCe);const lPe="vs/editor/browser/widget/multiDiffEditor/colors";B("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(lPe,0,"The background color of the diff editor's header"));B("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},g(lPe,1,"The background color of the multi file diff editor"));B("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(lPe,2,"The border color of the multi file diff editor"));let OCe=class extends ${constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=xi(this,void 0),this._viewModel=xi(this,void 0),this._widgetImpl=wO(this,(s,o)=>(_v(ete,s),o.add(this._instantiationService.createInstance(_v(PCe,s),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Dt(this,s=>this._widgetImpl.read(s).activeControl.read(s)),this.onDidChangeActiveControl=T.fromObservableLight(this._activeControl),this._register(Ez(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new dZe(e,this._instantiationService)}setViewModel(e){this._viewModel.set(e,void 0)}layout(e){this._dimension.set(e,void 0)}getActiveControl(){return this._activeControl.get()}getViewState(){return this._widgetImpl.get().getViewState()}setViewState(e){this._widgetImpl.get().setViewState(e)}tryGetCodeEditor(e){return this._widgetImpl.get().tryGetCodeEditor(e)}};OCe=D([_(2,be)],OCe);const Z1t="vs/editor/contrib/editorState/browser/keybindingCancellation",dPe=ae("IEditorCancelService"),hZe=new Y("cancellableOperation",!1,g(Z1t,0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(dPe,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=hZe.bindTo(s.get(Pe)),r=new td;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},Yt.Delayed);class eLt extends ai{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(dPe).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ke(new class extends Jc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:ye.EditorContrib,primary:E.Escape},precondition:hZe})}runEditorCommand(n,e){n.get(dPe).cancel(e)}});var hr;(function(n){n[n.Value=1]="Value",n[n.Selection=2]="Selection",n[n.Position=4]="Position",n[n.Scroll=8]="Scroll"})(hr||(hr={}));let Bde=class BCe{constructor(e,t){if(this.flags=t,this.flags&hr.Value){const i=e.getModel();this.modelVersionId=i?a_("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&hr.Position?this.position=e.getPosition():this.position=null,this.flags&hr.Selection?this.selection=e.getSelection():this.selection=null,this.flags&hr.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof BCe))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new BCe(e,this.flags))}};class I1 extends eLt{constructor(e,t,i,s){super(e,s),this._listener=new Z,t&hr.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!O.containsPosition(i,o.position))&&this.cancel()})),t&hr.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!O.containsRange(i,o.selection))&&this.cancel()})),t&hr.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&hr.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class hPe extends ai{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hV{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=M_.capture(e),o=hV._handleEolEdits(e,t);o.length===1&&hV._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>ds.replace(O.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>ds.replaceMove(O.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}function uZe(n){return n.scheme===_e.vscodeRemote?n.authority:void 0}function Wde(n){if(!n)return;const e=n.indexOf("+");return e<0?n:n.substr(0,e)}const tLt="extensions.user.cache",iLt="extensions.builtin.cache",gZe="undefined_publisher",nLt=["ui","workspace","web"];function pK(n){if(typeof n=="object"&&n!==null&&n.supported!==!0)return n.description}const fZe=["Azure","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","AI","Chat","Other"];var qr;(function(n){n[n.System=0]="System",n[n.User=1]="User"})(qr||(qr={}));var Hs;(function(n){n.WIN32_X64="win32-x64",n.WIN32_ARM64="win32-arm64",n.LINUX_X64="linux-x64",n.LINUX_ARM64="linux-arm64",n.LINUX_ARMHF="linux-armhf",n.ALPINE_X64="alpine-x64",n.ALPINE_ARM64="alpine-arm64",n.DARWIN_X64="darwin-x64",n.DARWIN_ARM64="darwin-arm64",n.WEB="web",n.UNIVERSAL="universal",n.UNKNOWN="unknown",n.UNDEFINED="undefined"})(Hs||(Hs={}));class Cn{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(typeof e>"u"||e===null)return typeof t>"u"||t===null;if(typeof t>"u"||t===null)return!1;if(typeof e=="string"||typeof t=="string"){const i=typeof e=="string"?e:e.value,s=typeof t=="string"?t:t.value;return Ba(i,s)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class $v{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Cn.toKey(e))}delete(e){return this._set.delete(Cn.toKey(e))}has(e){return this._set.has(Cn.toKey(e))}}class Ga{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Cn.toKey(e))}get(e){return this._map.get(Cn.toKey(e))}has(e){return this._map.has(Cn.toKey(e))}set(e,t){this._map.set(Cn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function sLt(n){return uPe(n)}function uPe(n){return n.contributes&&n.contributes.localizations?n.contributes.localizations.length>0:!1}function oLt(n,e){if(e){const t=`onResolveRemoteAuthority:${Wde(e)}`;return!!n.activationEvents?.includes(t)}return!1}function Hde(n,e,t){const i=[],s=new $v,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(c,l,d){return a.provideDocumentRangeFormattingEdits(c,c.getFullModelRange(),l,d)}})}return i}var uV;(function(n){n[n.File=1]="File",n[n.Selection=2]="Selection"})(uV||(uV={}));var S_;(function(n){n[n.Explicit=1]="Explicit",n[n.Silent=2]="Silent"})(S_||(S_={}));const e9=class e9{static setFormatterSelector(e){return{dispose:e9._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const o=fi.first(e9._selectors);if(o)return await o(e,t,i,s)}};e9._selectors=new td;let gV=e9;async function Ude(n,e,t,i,s,o,r){const a=n.get(be),{documentRangeFormattingEditProvider:c}=n.get(ht),l=Ka(e)?e.getModel():e,d=c.ordered(l),h=await gV.select(d,l,i,uV.Selection);h&&(s.report(h),await a.invokeFunction(pZe,h,e,t,o,r))}async function pZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Ze),c=n.get(Lw);let l,d;Ka(t)?(l=t.getModel(),d=new I1(t,hr.Value|hr.Position,void 0,s)):(l=t,d=new hPe(t,s));const h=[];let u=0;for(const w of Kb(i).sort(O.compareRangesUsingStarts))u>0&&O.areIntersectingOrTouching(h[u-1],w)?h[u-1]=O.fromPositions(h[u-1].getStartPosition(),w.getEndPosition()):u=h.push(w);const f=async w=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,w);const b=await e.provideDocumentRangeFormattingEdits(l,w,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),b},p=(w,b)=>{if(!w.length||!b.length)return!1;const C=w.reduce((y,S)=>O.plusRange(y,S.range),w[0].range);if(!b.some(y=>O.intersectRanges(C,y.range)))return!1;for(const y of w)for(const S of b)if(O.intersectRanges(y.range,S.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const w=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),v.push(w)}else{for(const w of h){if(d.token.isCancellationRequested)return!0;v.push(await f(w))}for(let w=0;w({text:C.text,range:O.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:y}of C)if(O.areIntersectingOrTouching(y,b))return[new mt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return c.playSignal(Zl.format,{userGesture:o}),!0}async function WCe(n,e,t,i,s,o){const r=n.get(be),a=n.get(ht),c=Ka(e)?e.getModel():e,l=Hde(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await gV.select(l,c,t,uV.File);d&&(i.report(d),await r.invokeFunction(mZe,d,e,t,s,o))}async function mZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Lw);let c,l;Ka(t)?(c=t.getModel(),l=new I1(t,hr.Value|hr.Position,void 0,s)):(c=t,l=new hPe(t,s));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await r.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(Ka(t))hV.execute(t,d,i!==S_.Silent),i!==S_.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),vt.Immediate);else{const[{range:h}]=d,u=new mt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:O.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(O.areIntersectingOrTouching(p,u))return[new mt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(Zl.format,{userGesture:o}),!0}async function rLt(n,e,t,i,s,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(er);if(mo(c))return await n.computeMoreMinimalEdits(t.uri,c)}}async function aLt(n,e,t,i,s){const o=Hde(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(er);if(mo(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function _Ze(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(er).then(c=>n.computeMoreMinimalEdits(t.uri,c))}yt.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const o=n.get(Rn),r=n.get(kd),a=n.get(ht),c=await o.createModelReference(t);try{return rLt(r,a,c.object.textEditorModel,O.lift(i),s,qe.None)}finally{c.dispose()}});yt.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;Bt(P.isUri(t));const s=n.get(Rn),o=n.get(kd),r=n.get(ht),a=await s.createModelReference(t);try{return aLt(o,r,a.object.textEditorModel,i,qe.None)}finally{a.dispose()}});yt.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string");const r=n.get(Rn),a=n.get(kd),c=n.get(ht),l=await r.createModelReference(t);try{return _Ze(a,c,l.object.textEditorModel,oe.lift(i),s,o,qe.None)}finally{l.dispose()}});var _d;(function(n){n[n.provider=0]="provider",n[n.userDefined=1]="userDefined",n[n.recovered=2]="recovered"})(_d||(_d={}));const cLt={[_d.provider]:" ",[_d.userDefined]:"u",[_d.recovered]:"r"},aVe=65535,pb=16777215,cVe=4278190080;class Jfe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<aVe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Jfe(e.length),this._userDefinedStates=new Jfe(e.length),this._recoveredStates=new Jfe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;ipb||r>pb)throw new Error("startLineNumber or endLineNumber must not exceed "+pb);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&pb}getEndLineNumber(e){return this._endIndexes[e]&pb}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?_d.userDefined:this.isRecovered(e)?_d.recovered:_d.provider}setSource(e,t){t===_d.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===_d.recovered?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&cVe)>>>16);return t===aVe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?w=>ww=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===_d.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=_d.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===_d.provider&&(m.source=_d.recovered)),d=r(++c);else{let v=c,w=d;for(;;){if(!w||w.startLineNumber>l.endLineNumber){m=l;break}if(w.source===_d.userDefined&&w.endLineNumber>l.endLineNumber)break;w=r(++v)}l=o(++a)}if(m){for(;u&&u.endLineNumberm.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!u||u.endLineNumber>=m.endLineNumber)&&(p.push(m),f=m.startLineNumber,u&&h.push(u),u=m)}}return p}}class lLt{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}hidesLine(e){return this.startLineNumberi.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=c=>{for(;sr&&(r=l),s++}};for(const c of e){const l=c.regionIndex,d=this._editorDecorationIds[l];if(d&&!t[d]){t[d]=!0,a(l);const h=!this._regions.isCollapsed(l);this._regions.setCollapsed(l,h),o=Math.max(o,this._regions.getEndLineNumber(l))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??_d.provider})}const s=Xp.sanitizeAndMerge(this._regions,t,i);this.updatePost(Xp.fromFoldRanges(s))}_getLinesChecksum(e,t){return Ed(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,c=this._regions.length;a0&&!l.containedBy(r[r.length-1]);)r.pop();r.push(l),t(l,r.length)&&i.push(l)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);s.push(...r)}n.toggleCollapseState(s)}function hLt(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function uLt(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function bZe(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function gPe(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function fPe(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function gLt(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function fLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function pLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Gb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return lVe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!vLt(r,s))&&(s=lVe(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function vLt(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function lVe(n,e){const t=bU(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const wLt=5e3,bLt="indent";class pPe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=bLt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(SLt(this.editorModel,i,s,this.foldingRangesLimit))}}let CLt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>pb||t>pb)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new Xp(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let c=0;ct){s=c;break}i+=l}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let c=this._length-1,l=0;c>=0;c--){const d=this._startIndexes[c],h=e.getLineContent(d),u=dde(h,o);(u{}};function SLt(n,e,t,i=yLt){const s=n.getOptions().tabSize,o=new CLt(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=n.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=n.getLineCount();l>0;l--){const d=n.getLineContent(l),h=dde(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,u=a[p],o.insertFirst(l,u.line,h),u.line=l,u.indent=h,u.endAbove=l;continue}}else{a.push({indent:-2,endAbove:l,line:l});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const p=u.endAbove-1;p-l>=1&&o.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return o.toIndentRanges(n)}const rL="vs/editor/contrib/folding/browser/foldingDecorations",ALt=B("editor.foldBackground",{light:Ie(Hv,.3),dark:Ie(Hv,.3),hcDark:null,hcLight:null},g(rL,0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);B("editorGutter.foldingControlForeground",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(rL,1,"Color of the folding control in the editor gutter."));const tte=Ki("folding-expanded",Ce.chevronDown,g(rL,2,"Icon for expanded ranges in the editor glyph margin.")),ite=Ki("folding-collapsed",Ce.chevronRight,g(rL,3,"Icon for collapsed ranges in the editor glyph margin.")),dVe=Ki("folding-manual-collapsed",ite,g(rL,4,"Icon for manually collapsed ranges in the editor glyph margin.")),hVe=Ki("folding-manual-expanded",tte,g(rL,5,"Icon for manually expanded ranges in the editor glyph margin.")),Xfe={color:Nr(ALt),position:xu.Inline},jO=g(rL,6,"Click to expand the range."),mK=g(rL,7,"Click to collapse the range."),xc=class xc{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?xc.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?xc.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:xc.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:xc.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?xc.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:xc.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?xc.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:xc.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?xc.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:xc.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?xc.MANUALLY_EXPANDED_VISUAL_DECORATION:xc.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};xc.COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),xc.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Xfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),xc.MANUALLY_COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),xc.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Xfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),xc.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO}),xc.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Xfe,isWholeLine:!0,linesDecorationsTooltip:jO}),xc.EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-expanded-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(tte),linesDecorationsTooltip:mK}),xc.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(tte),linesDecorationsTooltip:mK}),xc.MANUALLY_EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(hVe),linesDecorationsTooltip:mK}),xc.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(hVe),linesDecorationsTooltip:mK}),xc.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),xc.HIDDEN_RANGE_DECORATION=Kt.register({description:"folding-hidden-range-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges});let HCe=xc;const ELt={},xLt="syntax";class mPe{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=xLt,this.disposables=new Z,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return DLt(this.providers,this.editorModel,e).then(t=>t?ILt(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function DLt(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,ELt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const c=e.getLineCount();for(const l of a)l.start>0&&l.end>l.start&&l.end<=c&&i.push({start:l.start,end:l.end,rank:r,kind:l.kind})}},er));return Promise.all(s).then(o=>i)}class kLt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>pb||t>pb)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=c}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,c=0;a{let c=r.start-a.start;return c===0&&(c=r.rank-a.rank),c}),i=new kLt(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var KL;const Nu="vs/editor/contrib/folding/browser/folding",jh=new Y("foldingEnabled",!1);var dN;let Ox=(dN=class extends ${static get(e){return e.getContribution(KL.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return KL._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return KL._foldingRangeSelector=e,{dispose:()=>{KL._foldingRangeSelector=void 0}}}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new CZe(e);const a=this.editor.getOptions();this._isEnabled=a.get(x.folding),this._useFoldingProviders=a.get(x.foldingStrategy)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(x.unfoldOnClickAfterEndOfLine),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(x.foldingImportsByDefault),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new HCe(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=jh.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(c=>{if(c.hasChanged(x.folding)&&(this._isEnabled=this.editor.getOptions().get(x.folding),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),c.hasChanged(x.foldingMaximumRegions)&&this.onModelChanged(),c.hasChanged(x.showFoldingControls)||c.hasChanged(x.foldingHighlight)){const l=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=l.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=l.get(x.foldingHighlight),this.triggerFoldingModelChanged()}c.hasChanged(x.foldingStrategy)&&(this._useFoldingProviders=this.editor.getOptions().get(x.foldingStrategy)!=="indentation",this.onFoldingStrategyChanged()),c.hasChanged(x.unfoldOnClickAfterEndOfLine)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(x.unfoldOnClickAfterEndOfLine)),c.hasChanged(x.foldingImportsByDefault)&&(this._foldingImportsByDefault=this.editor.getOptions().get(x.foldingImportsByDefault))})),this.onModelChanged()}get limitReporter(){return this._foldingLimitReporter}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new dLt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new _Lt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Lu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new yn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new pPe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=KL.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new mPe(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new ao,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=na(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(yv.Imports.value,!0);d&&(r=M_.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(o,c),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(bt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,bt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case Mt.GUTTER_LINE_DECORATIONS:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case Mt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Mt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==Mt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&l.push(u);l.length===0&&(l=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(r)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,vt.Smooth)}},KL=dN,dN.ID="editor.contrib.folding",dN);Ox=KL=D([_(1,Pe),_(2,lo),_(3,Pi),_(4,B_),_(5,ht)],Ox);class CZe{constructor(e){this.editor=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(x.foldingMaximumRegions)}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Pu extends lt{runEditorCommand(e,t,i){const s=e.get(lo),o=Ox.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const c=t.getSelection();c&&o.reveal(c.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function yZe(n){if(!ll(n)){if(!fo(n))return!1;const e=n;if(!ll(e.levels)&&!Kc(e.levels)||!ll(e.direction)&&!$t(e.direction)||!ll(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Kc)))return!1}return!0}class LLt extends Pu{constructor(){super({id:"editor.unfold",label:g(Nu,0,"Unfold"),alias:"Unfold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.BracketRight,mac:{primary:V.CtrlCmd|V.Alt|E.BracketRight},weight:ye.EditorContrib},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +`),await this._clipboardService.writeText(y)})),i.getOption(x.readOnly)||v.push(new rn("diff.inline.revertChange",g(9962,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ro(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=Cr(this._diffActions),b=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+b)})),this._register(i.onMouseMove(p=>{(p.target.type===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(p=>{p.event.leftButton&&(p.target.type===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()&&(p.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),f(p.event.posx,p.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Cr(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ls});function BYe(s,e,t,i){Dl(i,e.fontInfo);const n=t.length>0,o=new wU(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=fp.isBasicASCII(c,n),d=fp.containsRTL(c,l,o),h=n6(new yI(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Lk.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let uve=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=jt(this,0),this._originalScrollOffset=jt(this,0),this._originalScrollOffsetAnimated=vWe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=jt(this,0),this._modifiedScrollOffset=jt(this,0),this._modifiedScrollOffsetAnimated=vWe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=jt("invalidateAlignmentsState",0),u=this._register(new cn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(y=>y?Kn(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===nD.Completed):void 0).map((y,C)=>y?.read(C)),p=Ze(y=>{const C=this._diffModel.read(y),A=C?.diff.read(y);if(!C||!A)return null;h.read(y);const k=this._options.renderSideBySide.read(y);return DWe(this._editors.original,this._editors.modified,A.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Ze(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);if(!C)return null;h.read(y);const A=C.changes.map(L=>new OYe(L));return DWe(this._editors.original,this._editors.modified,A,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const b=this._register(new Z);this.viewZones=AI(this,(y,C)=>{b.clear();const A=p.read(y)||[],L=[],k=[],P=this._modifiedTopPadding.read(y);P>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:P,showInHiddenAreas:!0,suppressMouseDown:!0});const R=this._originalTopPadding.read(y);R>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:R,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(y),G=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(G){const Ne=this._editors.original.getModel();for(const lt of A)if(lt.diff)for(let xt=lt.originalRange.startLineNumber;xtNe.getLineCount())return{orig:L,mod:k};G?.addRequest(Ne.getLineContent(xt),null,null)}}const Y=G?.finalize()??[];let j=0;const ne=this._editors.modified.getOption(x.lineHeight),ge=this._diffModel.read(y)?.movedTextToCompare.read(y),De=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Oe=this._editors.original.getModel()?.mightContainRTL()??!1,yt=Iae.fromEditor(this._editors.modified);for(const Ne of A)if(Ne.diff&&!z&&(!this._options.useTrueInlineDiffRendering.read(y)||!DRe(Ne.diff))){if(!Ne.originalRange.isEmpty){f.read(y);const xt=document.createElement("div");xt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ji=this._editors.original.getModel();if(Ne.originalRange.endLineNumberExclusive-1>Ji.getLineCount())return{orig:L,mod:k};const Ii=new WYe(Ne.originalRange.mapToLineArray(ds=>Ji.tokenization.getLineTokens(ds)),Ne.originalRange.mapToLineArray(ds=>Y[j++]),De,Oe),ns=[];for(const ds of Ne.diff.innerChanges||[])ns.push(new MO(ds.originalRange.delta(-(Ne.diff.original.startLineNumber-1)),cW.className,Ja.Regular));const zs=BYe(Ii,yt,ns,xt),Pn=document.createElement("div");if(Pn.className="inline-deleted-margin-view-zone",Dl(Pn,yt.fontInfo),this._options.renderIndicators.read(y))for(let ds=0;dsqn(Xr),Pn,this._editors.modified,Ne.diff,this._diffEditorWidget,zs.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ds=0;ds1&&L.push({afterLineNumber:Ne.originalRange.startLineNumber+ds,domNode:v(),heightInPx:(Zo-1)*ne,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Ne.modifiedRange.startLineNumber-1,domNode:xt,heightInPx:zs.heightInLines*ne,minWidthInPx:zs.minWidthInPx,marginDomNode:Pn,setZoneId(ds){Xr=ds},showInHiddenAreas:!0,suppressMouseDown:!0})}const lt=document.createElement("div");lt.className="gutter-delete",L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ne.modifiedHeightInPx,marginDomNode:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const lt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;if(lt>0){if(ge?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ne.originalRange.endLineNumberExclusive-1))continue;L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xt=function(){const Ii=document.createElement("div");return Ii.className="arrow-revert-change "+We.asClassName(ve.arrowRight),C.add(ue(Ii,"mousedown",ns=>ns.stopPropagation())),C.add(ue(Ii,"click",ns=>{ns.stopPropagation(),o.revert(Ne.diff)})),fe("div",{},Ii)};if(ge?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ne.modifiedRange.endLineNumberExclusive-1))continue;let Ji;Ne.diff&&Ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Ji=xt()),k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,marginDomNode:Ji,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ne of m.read(y)??[]){if(!ge?.lineRangeMapping.original.intersect(Ne.originalRange)||!ge?.lineRangeMapping.modified.intersect(Ne.modifiedRange))continue;const lt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;lt>0?L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:L,mod:k}});let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=Kn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ai(y=>{const C=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);let A=0;if(C){const L=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();A=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}A>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(A,void 0)):A<0?(this._modifiedTopPadding.set(-A,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-A,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+A,void 0,!0)}))}};uve=D([_(8,dg),_(9,lr)],uve);function DWe(s,e,t,i,n,o){const r=new Uy(kWe(s,i)),a=new Uy(kWe(e,n)),c=s.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),b=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),b&&b.lineNumber>=m&&(b=void 0),!v&&!b)break;const w=v?v.lineNumber-h:Number.MAX_VALUE,y=b?b.lineNumber-u:Number.MAX_VALUE;wy?(a.dequeue(),v={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:pi.ofLength(v.lineNumber,1),modifiedRange:pi.ofLength(b.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+b.heightInPx,diff:void 0})}}for(const p of t){let y=function(C,A,L=!1){if(CG.lineNumberG+Y.heightInPx,0)??0,z=a.takeWhile(G=>G.lineNumberG+Y.heightInPx,0)??0;d.push({originalRange:k,modifiedRange:P,originalHeightInPx:k.length*c+R,modifiedHeightInPx:P.length*l+z,diff:p.lineRangeMapping}),w=C,b=A};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,b=m.modified.startLineNumber,w=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[]){C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber);const A=s.getModel(),L=C.originalRange.endLineNumber<=A.getLineCount()?A.getLineMaxColumn(C.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;C.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of s.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new oe(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return eIt(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}function DRe(s){return s.innerChanges?s.innerChanges.every(e=>IWe(e.modifiedRange)&&IWe(e.originalRange)):!1}function IWe(s){return s.startLineNumber===s.endLineNumber}const zz=class zz extends V{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Kn(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=id("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=jt(this,0),this._modifiedViewZonesChangedSignal=id("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=id("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=AI(this,(d,h)=>{this._element.replaceChildren();const u=this._diffModel.read(d),f=u?.diff.read(d)?.movedTexts;if(!f||f.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const p=this._originalEditorLayoutInfo.read(d),m=this._modifiedEditorLayoutInfo.read(d);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=f.map(k=>{function P(Oe,yt){const Ne=yt.getTopForLineNumber(Oe.startLineNumber,!0),lt=yt.getTopForLineNumber(Oe.endLineNumberExclusive,!0);return(Ne+lt)/2}const R=P(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),G=P(k.lineRangeMapping.modified,this._editors.modified),Y=this._modifiedScrollTop.read(d),j=R-z,ne=G-Y,ge=Math.min(R,G),De=Math.max(R,G);return{range:new mi(ge,De),from:j,to:ne,fromWithoutScroll:R,toWithoutScroll:G,move:k}});v.sort(C6e(Cc(k=>k.fromWithoutScroll>k.toWithoutScroll,urt),Cc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,nu)));const b=kRe.compute(v.map(k=>k.range)),w=10,y=p.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+w*2,A=y+C+(m.contentLeft-zz.movedCodeBlockPadding);let L=0;for(const k of v){const P=b.getTrack(L),R=y+w+P*10,z=15,G=15,Y=A,j=m.glyphMarginWidth+m.lineNumbersWidth,ne=18,ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("arrow-rectangle"),ge.setAttribute("x",`${Y-j}`),ge.setAttribute("y",`${k.to-ne/2}`),ge.setAttribute("width",`${j}`),ge.setAttribute("height",`${ne}`),this._element.appendChild(ge);const De=document.createElementNS("http://www.w3.org/2000/svg","g"),Oe=document.createElementNS("http://www.w3.org/2000/svg","path");Oe.setAttribute("d",`M 0 ${k.from} L ${R} ${k.from} L ${R} ${k.to} L ${Y-G} ${k.to}`),Oe.setAttribute("fill","none"),De.appendChild(Oe);const yt=document.createElementNS("http://www.w3.org/2000/svg","polygon");yt.classList.add("arrow"),h.add(ai(Ne=>{Oe.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne)),yt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne))})),yt.setAttribute("points",`${Y-G},${k.to-z/2} ${Y},${k.to} ${Y-G},${k.to+z/2}`),De.appendChild(yt),this._element.appendChild(De),L++}this.width.set(C,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ee(()=>this._element.remove())),this._register(ai(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-zz.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(FN(this._state));const r=Ze(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new fF(nd(f.lineRangeMapping.original.startLineNumber-1),18),modified:new fF(nd(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(SJ(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(SJ(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(cu((d,h)=>{const u=r.read(d);for(const f of u)h.add(new TWe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new TWe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=id("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=id("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(LU({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(l="original"),d.didChange(c)&&(l="modified"),!0)},d=>{a.read(d),c.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&l==="original"){const p=this._editors.originalCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.original.contains(p.lineNumber)))}if(u&&l==="modified"){const p=this._editors.modifiedCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber)))}f!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};zz.movedCodeBlockPadding=4;let jO=zz;class kRe{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=ort(t,Cc(a=>a.intersectWithRangeLength(n),nu)):(o=t.length,t.push(new wTe))),t[o].addRange(n),i.push(o)}return new kRe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class TWe extends wRe{constructor(e,t,i,n,o){const r=Bt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Bt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Bt("div.text-content@textContent"),Bt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Kn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(IA(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(5264,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5265,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(5266,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5267,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new hd(this._nodes.actionBar,{highlightToggledItems:!0})),d=new rn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new rn("","Compare",We.asClassName(ve.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ai(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}class kIt extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ze(this,o=>{const r=this._diffModel.read(o),a=r?.diff.read(o);if(!a)return null;const c=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),h=[],u=[];if(!c)for(const p of a.mappings)if(p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:l?L3:SWe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:l?AJ:CWe}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:ARe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:CRe});else{const m=this._options.useTrueInlineDiffRendering.read(o)&&DRe(p.lineRangeMapping);for(const v of p.lineRangeMapping.innerChanges||[])if(p.lineRangeMapping.original.contains(v.originalRange.startLineNumber)&&h.push({range:v.originalRange,options:v.originalRange.isEmpty()&&d?ERe:cW}),p.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&u.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!m?SRe:EJ}),m){const b=r.model.original.getValueInRange(v.originalRange);u.push({range:v.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(c)for(const p of c.changes){const m=p.original.toInclusiveRange();m&&h.push({range:m,options:l?L3:SWe});const v=p.modified.toInclusiveRange();v&&u.push({range:v,options:l?AJ:CWe});for(const b of p.innerChanges||[])h.push({range:b.originalRange,options:cW}),u.push({range:b.modifiedRange,options:EJ})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const p of a.movedTexts)h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[jO.movedCodeBlockPadding,0,jO.movedCodeBlockPadding,jO.movedCodeBlockPadding]}}),u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(p===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(CJ(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(CJ(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class IIt{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=_6(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=jt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:oi-r?i-r:o}}class HYe extends V{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Od(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:fi.VERTICAL})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(ai(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(ai(a=>{const c=this._enabled.read(a);this._sash.state=c?oa.Enabled:oa.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class TIt extends V{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Kn(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Kn(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=id("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=id("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=gC("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Bt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{ts(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(ai(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(ai(r=>this.render(r)))}dispose(){super.dispose(),aa(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=mi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new pi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);ts(l=>{for(const d of c){if(!d.range.intersect(a))continue;n.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,l);else{const m=document.createElement("div");this._domNode.appendChild(m);const v=jt("item",d),b=this.itemProvider.createView(v,m);h=new LIt(v,b,m),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,p=(d.range.isEmpty?u:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${p}px`,h.gutterItemView.layout(mi.ofStartAndLength(u,p),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class LIt{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class UYe extends $_{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class gve extends MKe{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new eg(e-1,t)}}var RIt=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";ut(RIt,{});class VYe extends V{constructor(e,t,i={orientation:F_.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Q1e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register($k()),this.options=i,this.toggleMenuAction=this._register(new R3(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new hd(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,o)=>{if(n.id===R3.ID)return this.toggleMenuActionViewItem=new sA(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:We.asClassNameArray(i.moreIcon??ve.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(n,o);if(r)return r}if(n instanceof Nk){const r=new sA(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}focus(){this.actionBar.focus()}getItemsWidth(){let e=0;for(let t=0;t0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const wse=class wse extends rn{constructor(e,t){t=t||g(10094,"More Actions..."),super(wse.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};wse.ID="toolbar.toggle.more";let R3=wse;var aA;(function(s){s[s.NoHide=-1]="NoHide",s[s.Ignore=0]="Ignore",s[s.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(aA||(aA={}));let lW=class extends VYe{constructor(e,t,i,n,o,r,a,c){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new Z);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>c.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==aA.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(n[f]=void 0,c[f]=p))}}uM(n),uM(c),super.setActions(n,Ar.join(c,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const h=new Eh(ct(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof Sc&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Ty||u instanceof R3)){const m=!!this._keybindingService.lookupKeybinding(u.id);f.push(TYe(this._commandService,this._keybindingService,u.id,void 0,m))}if(r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===aA.Ignore){m=!0;for(let v=0;vthis._menuService.resetHiddenStates(i)}))),p.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>p,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};lW=D([_(2,Oa),_(3,Le),_(4,lr),_(5,Ut),_(6,vi),_(7,Yi)],lW);let bm=class extends lW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];fC(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",u.length===0&&f.length===0),super.setActions(u,f)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new Ni("This toolbar is populated from a menu.")}};bm=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],bm);const Fhe=[],lK=35;let fve=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(_e.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Kn(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Ze(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Ze(this,d=>this._hasActions.read(d)?lK:0),this.elements=Bt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:lK+"px"}},[]),this._currentDiff=Ze(this,d=>{const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d)?.mappings,f=this._editors.modifiedCursor.read(d);if(f)return u?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=Ze(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return Fhe;const f=this._editors.modifiedSelections.read(d);if(f.every(b=>b.isEmpty()))return Fhe;const p=new jp(f.map(b=>pi.fromRangeInclusive(b))),v=u.mappings.filter(b=>b.lineRangeMapping.innerChanges&&p.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(w=>f.some(y=>F.areIntersecting(w.modifiedRange,y)))}));return v.length===0||v.every(b=>b.rangeMappings.length===0)?Fhe:v}),this._register(tIt(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(IA(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),mh(this,d=>this._showSash.read(d)?new HYe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,_6(this,u=>this._sashLayout.sashLeft.read(u)-lK,(u,f)=>this._sashLayout.sashLeft.set(u+lK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new TIt(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,h)=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const p=this._selectedDiffs.read(h);if(p.length>0){const v=q_.fromRangeMappings(p.flatMap(b=>b.rangeMappings));return[new LWe(v,!0,_e.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new LWe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,_e.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(pve,d,h,this)})),this._register(ue(this.elements.gutter,ke.MOUSE_WHEEL,d=>{this._editors.modified.getOption(x.scrollbar).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new gve(this._editors.modifiedModel.get()),n=new gve(this._editors.original.getModel());return new B2(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};fve=D([_(6,we),_(7,Le),_(8,Oa)],fve);class LWe{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let pve=class extends V{constructor(e,t,i,n){super(),this._item=e,this._elements=Bt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Bt("div.background@background",{},[]),Bt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=jt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(xM,"element",!0,{position:{hoverPosition:vo.RIGHT}}));this._register(gF(t,this._elements.root)),this._register(ai(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(cu((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(n.createInstance(bm,this._elements.buttons,this._menuId.read(r),{orientation:F_.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:aA.Ignore,actionRunner:new UYe(()=>{const l=this._item.get(),d=l.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:l.originalUri,modifiedUri:l.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(c.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let r=e.start+n;const a=mi.tryCreate(o,t.endExclusive-o-i),c=mi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const n=$E._map.get(e);n&&($E._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new TU(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=jt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._versionId=fJ({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=fJ({owner:this,equalsFn:Fq(J2(dt.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Jh({owner:this,equalsFn:Fq(J2(oe.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=Kn(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=_6(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=Ze(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Jh({owner:this,equalsFn:Fq(dt.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Jh({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.onDidType=gC(this),this.scrollTop=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Kn(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=Kn(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Kn(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(v6({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=ai(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return Ee(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};$E._map=new Map;let mve=$E;function _ve(s,e){return UAt({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(s)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=s.read(t);i.didChange&&e(n,i.deltas)})}function MIt(s,e){const t=new Z,i=_ve(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var jq,_L;let DJ=(_L=class extends V{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=mh(this,c=>{const l=this._editors.modifiedModel.read(c),d=jq._breadcrumbsSourceFactory.read(c);return!l||!d?void 0:d(l,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,g_.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,g_.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,g_.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,g_.FromCloserSide,d)})}));const o=this._diffModel.map((c,l)=>{const d=c?.unchangedRegions.read(l)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(l)?.getLineCount()?[]:d});this.viewZones=AI(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=this._options.compactMode.read(c),m=o.read(c);for(let v=0;vb.getHiddenOriginalRange(C).startLineNumber-1),y=new fF(w,12);h.push(y),l.add(new RWe(this._editors.original,y,b,!f))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new fF(w,12);u.push(y),l.add(new RWe(this._editors.modified,y,b))}}else{{const w=Ze(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),y=new fF(w,24);h.push(y),l.add(new MWe(this._editors.original,y,b,b.originalUnchangedRange,!f,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,g_.FromBottom,void 0),this._options))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new fF(w,24);u.push(y),l.add(new MWe(this._editors.modified,y,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,g_.FromBottom,void 0),this._options))}}}return{origViewZones:h,modViewZones:u}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Mt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(5244,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+We.asClassName(ve.fold),zIndex:10001};this._register(CJ(this._editors.original,Ze(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:F.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(CJ(this._editors.modified,Ze(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:pi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ai(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(Fc)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(Fc))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}},jq=_L,_L._breadcrumbsSourceFactory=jt(jq,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),_L);DJ=jq=D([_(3,we)],DJ);class RWe extends wRe{constructor(e,t,i,n=!1){const o=Bt("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Bt("div.diff-hidden-lines-compact",[Bt("div.line-left",[]),Bt("div.text@text",[]),Bt("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ai(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,c=g(5245,"{0} hidden lines",a);this._nodes.text.innerText=c}}))}}class MWe extends wRe{constructor(e,t,i,n,o,r,a,c){const l=Bt("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=Bt("div.diff-hidden-lines",[Bt("div.top@top",{title:g(5246,"Click or drag to show more above")}),Bt("div.center@content",{style:{display:"flex"}},[Bt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[fe("a",{title:g(5247,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Eb("$(unfold)"))]),Bt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Bt("div.bottom@bottom",{title:g(5248,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?aa(this._nodes.first):this._register(IA(this._nodes.first,{width:Xh(this._editor).layoutInfoContentLeft})),this._register(ai(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!u)):f==="bottom"?(p.classList.toggle("canMoveTop",!u),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ue(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=ct(this._nodes.top),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p+A,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=ue(m,"mouseup",w=>{f||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),b.dispose()})})),this._register(ue(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=ct(this._nodes.bottom),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p-A,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const P=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(P-k))}),b=ue(m,"mouseup",w=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),b.dispose()})})),this._register(ai(h=>{const u=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,p=g(5245,"{0} hidden lines",f),m=fe("span",{title:g(5249,"Double click to unfold")},p);m.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){u.push(fe("span",void 0,"  |  "));for(let w=0;w{this._revealModifiedHiddenLine(y.startLineNumber)}}}}aa(this._nodes.others,...u)}))}}var bv,BS;let dW=(BS=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=bv.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Kn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Ze(u=>{const f=c.read(u),p=f.getColor(bft)||(f.getColor(my)||Ope).transparent(2),m=f.getColor(wft)||(f.getColor(iF)||Bpe).transparent(2);return{insertColor:p,removeColor:m}}),d=ls(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Bt("div.diffOverview",{style:{position:"absolute",top:"0px",width:bv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(gF(h,d.domNode)),this._register(Ro(h,ke.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(ue(h,ke.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(gF(this._rootElement,h)),this._register(cu((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(gF(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(gF(h,v.getDomNode()))),!m||!v)return;const b=id("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=id("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=id("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=id("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(ai(A=>{b.read(A),w.read(A),y.read(A),C.read(A);const L=l.read(A),k=p?.diff.read(A)?.mappings;function P(G,Y,j){const ne=j._getViewModel();return ne?G.filter(ge=>ge.length>0).map(ge=>{const De=ne.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.startLineNumber,1)),Oe=ne.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.endLineNumberExclusive,1)),yt=Oe.lineNumber-De.lineNumber;return new Gqe(De.lineNumber,Oe.lineNumber,yt,Y.toString())}):[]}const R=P((k||[]).map(G=>G.lineRangeMapping.original),L.removeColor,this._editors.original),z=P((k||[]).map(G=>G.lineRangeMapping.modified),L.insertColor,this._editors.modified);m?.setZones(R),v?.setZones(z)})),f.add(ai(A=>{const L=this._rootHeight.read(A),k=this._rootWidth.read(A),P=this._modifiedEditorLayoutInfo.read(A);if(P){const R=bv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*bv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:R+bv.ONE_OVERVIEW_WIDTH,width:bv.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:L,right:0,width:bv.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(A),G=this._editors.modifiedScrollHeight.read(A),Y=this._editors.modified.getOption(x.scrollbar),j=new G2(Y.verticalHasArrows?Y.arrowSize:0,Y.verticalScrollbarSize,0,P.height,G,z);d.setTop(j.getSliderPosition()),d.setHeight(j.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=k-bv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(bv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},bv=BS,BS.ONE_OVERVIEW_WIDTH=15,BS.ENTIRE_DIFF_OVERVIEW_WIDTH=BS.ONE_OVERVIEW_WIDTH*2,BS);dW=bv=D([_(6,pn)],dW);const Ohe=[];class NIt extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=Ze(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return Ohe;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return Ohe;const l=new jp(c.map(u=>pi.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&l.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>c.some(p=>F.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?Ohe:h}),this._register(cu((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),c=a?.diff.read(o);if(!a||!c||a.movedTextToCompare.read(o))return;const l=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new kJ(u[u.length-1].positionLineNumber,this._widget,d.flatMap(p=>p.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}for(const u of c.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new kJ(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}r.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const yse=class yse extends V{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${yse.counter++}`,this._domNode=Bt("div.revertButton",{title:this._revertSelection?g(5268,"Revert Selected Changes"):g(5269,"Revert Change")},[Yy(ve.arrowRight)]).root,this._register(ue(this._domNode,ke.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ue(this._domNode,ke.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ue(this._domNode,ke.CLICK,o=>{this._diffs instanceof L_?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:K_.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};yse.counter=0;let kJ=yse,vve=class extends V{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new I),this.modifiedScrollTop=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Xh(this.modified),this.originalObs=Xh(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Kn(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Jh({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Kn(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Xh(this.original).isFocused,this.isModifiedFocused=Xh(this.modified).isFocused,this.isFocused=Ze(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(LU({createEmptyChangeSummary:()=>({}),handleChange:(c,l)=>(c.didChange(i.editorOptions)&&Object.assign(l,c.change.changedOptions),!0)},(c,l)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,l)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,l))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dW.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=wh.revealHorizontalRightPadding.defaultValue+dW.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=g(5270," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};vve=D([_(5,we),_(6,Ut)],vve);const Cse=class Cse extends V{constructor(){super(...arguments),this._id=++Cse.idCounter,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getStatusbarColumn(e){return this._targetEditor.getStatusbarColumn(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=mt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=mt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=mt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=mt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=mt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=mt.Smooth){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=mt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=mt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=mt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=mt.Smooth){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};Cse.idCounter=0;let bve=Cse,IJ=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=jt(this,0),this._screenReaderMode=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Ze(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ze(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Ze(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=Ze(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=Ze(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=Ze(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=Ze(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Ze(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Ze(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ze(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Ze(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Ze(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Ze(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Ze(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Ze(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Ze(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Ze(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Ze(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Ze(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ze(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=Ze(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=Ze(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Ze(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=Ze(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=jt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>KAt(this,o=>{const r=n?.diff.read(o);return r?PIt(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...NWe(e,Ol)};this._options=jt(this,i)}updateOptions(e){const t=NWe(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};IJ=D([_(1,mr)],IJ);function PIt(s,e){return s.mappings.every(t=>FIt(t.lineRangeMapping)||OIt(t.lineRangeMapping)||e&&DRe(t.lineRangeMapping))}function FIt(s){return s.original.length===0}function OIt(s){return s.modified.length===0}function NWe(s,e){return{enableSplitViewResizing:Et(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Oat(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Et(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Et(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ZI(s.maxComputationTime,e.maxComputationTime,0,Un.MAX_SAFE_SMALL_INTEGER),maxFileSize:ZI(s.maxFileSize,e.maxFileSize,0,Un.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:Et(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Et(s.renderIndicators,e.renderIndicators),originalEditable:Et(s.originalEditable,e.originalEditable),diffCodeLens:Et(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Et(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Kr(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Kr(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Et(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Et(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:Et(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Et(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Et(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:ZI(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),minimumLineCount:ZI(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),revealLineCount:ZI(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Un.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:Et(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Et(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ZI(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Un.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:Et(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Et(s.renderGutterMenu,e.renderGutterMenu),compactMode:Et(s.compactMode,e.compactMode)}}var mB;let vp=(mB=class extends bve{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,n,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=Bt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Bt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Bt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Bt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(f3(this,void 0)),this._diffModel=Ze(this,C=>this._diffModelSrc.read(C)?.object),this.onDidChangeModel=M.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Uc([Le,this._contextKeyService]))),this._boundarySashes=jt(this,void 0),this._accessibleDiffViewerShouldBeVisible=jt(this,!1),this._accessibleDiffViewerVisible=Ze(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=jt(this,void 0),this._layoutInfo=Ze(this,C=>{const A=this._rootSizeObserver.width.read(C),L=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const k=this._sash.read(C),P=this._gutter.read(C),R=P?.width.read(C)??0,z=this._overviewRulerPart.read(C)?.width??0;let G,Y,j,ne,ge;if(!!k){const Oe=k.sashLeft.read(C),yt=this._movedBlocksLinesPart.read(C)?.width.read(C)??0;G=0,Y=Oe-R-yt,ge=Oe-R,j=Oe,ne=A-j-z}else{ge=0;const Oe=this._options.inlineViewHideOriginalLineNumbers.read(C);G=R,Oe?Y=0:Y=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),j=R+Y,ne=A-j-z}return this.elements.original.style.left=G+"px",this.elements.original.style.width=Y+"px",this._editors.original.layout({width:Y,height:L},!0),P?.layout(ge),this.elements.modified.style.left=j+"px",this.elements.modified.style.width=ne+"px",this._editors.modified.layout({width:ne,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,A)=>C?.diff.read(A)),this.onDidUpdateDiff=M.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this.elements.root.classList.toggle("standalone",i.isStandaloneEditor||!1),this._domElement.appendChild(this.elements.root),this._register(Ee(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new NYe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(IJ,t),this._register(ai(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(J.isEmbeddedDiffEditor.key,!1),this._register(Iv(J.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Iv(J.comparingMovedCode,this._contextKeyService,C=>!!this._diffModel.read(C)?.movedTextToCompare.read(C))),this._register(Iv(J.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Iv(J.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Iv(J.hasChanges,this._contextKeyService,C=>(this._diffModel.read(C)?.diff.read(C)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(vve,this.elements.original,this.elements.modified,this._options,i,(C,A,L,k)=>this._createInnerEditor(C,A,L,k))),this._register(Iv(J.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Iv(J.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Iv(J.diffEditorOriginalUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.original.uri.toString()??"")),this._register(Iv(J.diffEditorModifiedUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.modified.uri.toString()??"")),this._overviewRulerPart=mh(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(Fg(dW,C),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(A=>A.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,A)=>C-(this._overviewRulerPart.read(A)?.width??0))};this._sashLayout=new IIt(this._options,l),this._sash=mh(this,C=>{const A=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",A),A?new HYe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=mh(this,C=>this._instantiationService.createInstance(Fg(DJ,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);mh(this,C=>this._instantiationService.createInstance(Fg(kIt,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=mh(this,C=>this._instantiationService.createInstance(Fg(uve,C),ct(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Ze(this,C=>{const A=p.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return A.concat(L)}),v=Ze(this,C=>{const A=p.read(C).viewZones.read(C).mod,L=d.read(C).viewZones.read(C).modViewZones;return A.concat(L)});this._register(SJ(this._editors.original,m,C=>{f=C},h));let b;this._register(SJ(this._editors.modified,v,C=>{f=C,f?b=vm.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=mh(this,C=>this._instantiationService.createInstance(Fg(Ix,C),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(A,L)=>this._accessibleDiffViewerShouldBeVisible.set(A,L),this._options.onlyShowAccessibleDiffViewer.map(A=>!A),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((A,L)=>A?.diff.read(L)?.mappings.map(k=>k.lineRangeMapping)),new bIt(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(IA(this.elements.modified,{visibility:w})),this._register(IA(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=mh(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(Fg(fve,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(FN(this._layoutInfo)),mh(this,C=>new(Fg(jO,C))(this.elements.root,this._diffModel,this._layoutInfo.map(A=>A.originalEditor),this._layoutInfo.map(A=>A.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(M.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(M.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const y=this._diffModel.map(this,(C,A)=>{if(C)return C.diff.read(A)===void 0&&!C.isDiffUpToDate.read(A)});this._register(cu((C,A)=>{if(y.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);A.add(Ee(()=>L.done()))}})),this._register(cu((C,A)=>{A.add(new(Fg(NIt,C))(this._editors,this._diffModel,this._options,this))})),this._register(cu((C,A)=>{const L=this._diffModel.read(C);if(L)for(const k of[L.model.original,L.model.modified])A.add(k.onWillDispose(P=>{vt(new Ni("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ai(C=>{this._options.setModel(this._diffModel.read(C))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,n){return e.createInstance(Hk,t,i,n)}_createDiffEditorContributions(){const e=ap.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){vt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return CU.IDiffEditor}onVisible(){this._editors.original.onVisible(),this._editors.modified.onVisible()}onHide(){this._editors.original.onHide(),this._editors.modified.onHide()}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(xJ,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?aW.create(e).createNewRef(this):aW.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&SM(t,n=>{const o=e?.object;Kn.batchEventsGlobally(n,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}setBoundarySashes(e){this._boundarySashes.set(e,void 0)}get ignoreTrimWhitespace(){return this._options.ignoreTrimWhitespace.get()}get maxComputationTime(){return this._options.maxComputationTimeMs.get()}get renderSideBySide(){return this._options.renderSideBySide.get()}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?BIt(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new oe(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let n;e==="next"?n=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Ak(t,o=>o.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const o=t.getSelection();if(o){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=bWe(o.getStartPosition(),r),c=bWe(o.getEndPosition(),r);n=F.plusRange(a,c)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&ts(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&ts(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Oi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(cl.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(cl.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(cl.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},mB.ENTIRE_DIFF_OVERVIEW_WIDTH=dW.ENTIRE_DIFF_OVERVIEW_WIDTH,mB);vp=D([_(3,Le),_(4,we),_(5,Kt),_(6,lv),_(7,XA)],vp);function BIt(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a?.map(c=>({originalStartLineNumber:c.originalRange.startLineNumber,originalStartColumn:c.originalRange.startColumn,originalEndLineNumber:c.originalRange.endLineNumber,originalEndColumn:c.originalRange.endColumn,modifiedStartLineNumber:c.modifiedRange.startLineNumber,modifiedStartColumn:c.modifiedRange.startColumn,modifiedEndLineNumber:c.modifiedRange.endLineNumber,modifiedEndColumn:c.modifiedRange.endColumn}))}})}let WIt=0,PWe=!1;function HIt(s){if(!s){if(PWe)return;PWe=!0}Hgt(s||si.document.body)}let Yk=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||qY.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+qY.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,n,o,r,l,d,h,u,f),c instanceof jk?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,HIt(p.ariaContainerElement),bje((m,v)=>i.createInstance(xM,m,v,{})),Fje(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++WIt,o=he.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),V.None;const t=e.id,i=e.label,n=he.and(he.equals("editorId",this.getId()),he.deserialize(e.precondition)),o=e.keybindings,r=he.and(n,he.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,l=(f,...p)=>Promise.resolve(e.run(this,...p)),d=new Z,h=this.getId()+":"+t;if(d.add(_t.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:n,group:a,order:c};d.add(jn.appendMenuItem(_e.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new qqe(h,i,i,void 0,n,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Ee(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof kY)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Yk=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],Yk);let IM=class extends Yk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){const b={...t};yJ(h,b,!1);const w=l.registerEditorContainer(e);typeof b.theme=="string"&&l.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const y=b.model;delete b.model,super(e,b,i,n,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(w);let C;if(typeof y>"u"){const A=p.getLanguageIdByMimeType(b.language)||b.language||Ca;C=zYe(f,p,b.value||"",A,void 0),this._ownsModel=!0}else C=y,this._ownsModel=!1;if(this._attachModel(C),C){const A={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(A)}}dispose(){super.dispose()}updateOptions(e){yJ(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};IM=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,cv),_(9,bi),_(10,Te),_(11,mr),_(12,gi),_(13,xi),_(14,Vs),_(15,it)],IM);let TJ=class extends vp{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={...t};yJ(c,f,!0);const p=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},n,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){yJ(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Yk,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};TJ=D([_(2,we),_(3,Le),_(4,Kt),_(5,cv),_(6,bi),_(7,Te),_(8,lr),_(9,XA),_(10,dg),_(11,lv)],TJ);function zYe(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),FWe(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return FWe(s,t,e.createById(i),n)}function FWe(s,e,t,i){return s.createModel(e,t,i)}var UIt=".monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);height:100%;overflow-y:hidden;position:relative;width:100%;>div{height:100%;left:0;position:absolute;top:0;width:100%;&.placeholder{display:grid;place-content:center;place-items:center;visibility:hidden;&.visible{visibility:visible}}}.active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.multiDiffEntry{display:flex;flex:1;flex-direction:column;overflow:hidden;.collapse-button{cursor:pointer;margin:0 5px;a{display:block}}.header{background:var(--vscode-editor-background);z-index:1000;&:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.header-content{align-items:center;background:var(--vscode-multiDiffEditor-headerBackground);border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);display:flex;margin:8px 0 0;padding:4px 5px;&.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.file-path{display:flex;flex:1;min-width:0;.title{font-size:14px;line-height:22px;&.original{flex:1;min-width:0;text-overflow:ellipsis}}.status{font-weight:600;line-height:22px;margin:0 10px;opacity:.75}}.actions{padding:0 8px}}}.editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);display:flex;flex:1;flex-direction:column;overflow:hidden}.editorContainer{flex:1}}}";ut(UIt,{});class VIt{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let LJ=class extends V{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=jt(this,void 0),this._collapsed=Ze(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=jt(this,500),this.contentHeight=Ze(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=jt(this,0),this._modifiedWidth=jt(this,0),this._originalContentWidth=jt(this,0),this._originalWidth=jt(this,0),this.maxScroll=Ze(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),c=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>c?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:c,width:this._originalWidth.read(r)}}),this._elements=Bt("div.multiDiffEntry",[Bt("div.header@header",[Bt("div.header-content",[Bt("div.collapse-button@collapseButton"),Bt("div.file-path",[Bt("div.title.modified.show-file-icons@primaryPath",[]),Bt("div.status.deleted@status",["R"]),Bt("div.title.original.show-file-icons@secondaryPath",[])]),Bt("div.actions@actions")])]),Bt("div.editorParent",[Bt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(vp,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Xh(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Xh(this.editor.getOriginalEditor()).isFocused,this.isFocused=Ze(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Z,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new Jd(this._elements.collapseButton,{});this._register(ai(r=>{o.element.className="",o.icon=this._collapsed.read(r)?ve.chevronRight:ve.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ai(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{rV(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(ai(r=>{const a=this._viewModel.read(r)?.isActive.read(r);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(bm,this._elements.actions,_e.MultiDiffEditorFileToolbar,{actionRunner:this._register(new UYe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>WN(n,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){rV(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;rV(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)})}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,rV(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};LJ=D([_(3,we)],LJ);class zIt{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(n=>this._itemData.get(n).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}let wve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Bt("div.scrollContent",[Bt("div@content",{style:{overflow:"hidden"}}),Bt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new yN({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Ll(ct(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new l6(this._scrollableElements.root,{vertical:Co.Auto,horizontal:Co.Auto,useShadows:!1},this._scrollable)),this._elements=Bt("div.monaco-component.multiDiffEditor",{},[Bt("div",{},[this._scrollableElement.getDomNode()]),Bt("div.placeholder@placeholder",{},[Bt("div",[g(9360,"No Changed Files")])])]),this._sizeObserver=this._register(new NYe(this._element,void 0)),this._objectPool=this._register(new zIt(c=>{const l=this._instantiationService.createInstance(LJ,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=AI(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new Ni}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new GIt(p,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=this._lastDocStates?.[m.getKey()];return v&&ts(b=>{m.setViewState(v,b)}),u.set(p,m),m}),getItem:p=>u.get(p)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,l)=>c.reduce((d,h)=>d+h.contentHeight.read(l)+this._spaceBetweenPx,0)),this.activeControl=Ze(this,c=>{const l=this._viewModel.read(c)?.activeDiffItem.read(c);return l?this._viewItemsInfo.read(c).getItem(l).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Uc([Le,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(J.inMultiDiffEditor.key,!0),this._register(cu((c,l)=>{const d=this._viewModel.read(c);if(d&&d.contextKeys)for(const[h,u]of Object.entries(d.contextKeys)){const f=this._contextKeyService.createKey(h,void 0);f.set(u),l.add(Ee(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(J.multiDiffEditorAllCollapsed.key,!1);this._register(ai(c=>{const l=this._viewModel.read(c);if(l){const d=l.items.read(c).every(h=>h.collapsed.read(c));a.set(d)}})),this._register(ai(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(ai(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(ai(c=>{const l=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${l}px`;const d=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${d}px`;const h=this._sizeObserver.width.read(c);let u=h;const f=this._viewItems.read(c),p=N1e(f,Cc(m=>m.maxScroll.read(c).maxScroll,nu));if(p){const m=p.maxScroll.read(c);u=h+m.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:l,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._elements.root),this._register(Ee(()=>{e.replaceChildren()})),this._register(this._register(ai(c=>{rV(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new Ni("Resource not found in diff editor");const o=i[n];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,ts(t=>{if(e.docStates)for(const i of this._viewItems.get()){const n=e.docStates[i.getKey()];n&&i.setViewState(n,t)}})}findDocumentDiffItem(e){return this._viewItems.get().find(i=>i.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||i.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString())?.viewModel.documentDiffItem}tryGetCodeEditor(e){const t=this._viewItems.get().find(n=>n.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||n.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString()),i=t?.template.get()?.editor;if(i)return t.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()?{diffEditor:i,editor:i.getModifiedEditor()}:{diffEditor:i,editor:i.getOriginalEditor()}}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const r=this._sizeObserver.height.read(e),a=mi.ofStartAndLength(t,r),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,r),u=mi.ofStartAndLength(n,h),f=mi.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,l.hide();else if(f.isAfter(a))l.hide();else{const p=Math.max(0,Math.min(a.start-f.start,d-h));i-=p;const m=mi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}n+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};wve=D([_(4,Le),_(5,we)],wve);function $It(s,e){const t=s.getModel(),i=s.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{s.getModel()===t&&i.clear()},350)}class GIt extends V{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(f3(this,void 0)),this.contentHeight=Ze(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Ze(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Ze(this,o=>this._templateRef.read(o)?.object),this._isHidden=jt(this,!1),this._isFocused=Ze(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ai(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(ai(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return ts(e=>{this._updateTemplateData(e)}),{collapsed:this.viewModel.collapsed.get(),selections:this.viewModel.lastTemplateData.get().selections}}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(dt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&ts(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new VIt(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,n)}}class $Ye extends V{async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){ts(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){ts(e=>{for(const t of this.items.get())t.collapsed.set(!1,e)})}get contextKeys(){return this.model.contextKeys}constructor(e,t){super(),this.model=e,this._instantiationService=t,this._documents=Ije(this.model,this.model.documents),this.items=YY(this,this._documents,(i,n)=>n.add(this._instantiationService.createInstance(yve,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Ze(this,i=>this.items.read(i).find(n=>n.isFocused.read(i))),this.activeDiffItem=GAt(this,(i,n)=>this.focusedDiffItem.read(i)??n)}}let yve=class extends V{get diffEditorViewModel(){return this.diffEditorViewModelRef.object}get originalUri(){return this.documentDiffItem.original?.uri}get modifiedUri(){return this.documentDiffItem.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}get documentDiffItem(){return this.documentDiffItemRef.object}constructor(e,t,i,n){super(),this._editorViewModel=t,this._instantiationService=i,this._modelService=n,this.collapsed=jt(this,!1),this.lastTemplateData=jt(this,{contentHeight:500,selections:void 0}),this.isActive=Ze(this,d=>this._editorViewModel.activeDiffItem.read(d)===this),this._isFocusedSource=jt(this,nd(!1)),this.isFocused=Ze(this,d=>this._isFocusedSource.read(d).read(d)),this.isAlive=jt(this,!0),this._register(Ee(()=>{this.isAlive.set(!1,void 0)})),this.documentDiffItemRef=this._register(e.createNewRef(this));function o(d){return{...d,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(IJ,o(this.documentDiffItem.options||{}));this.documentDiffItem.onOptionsDidChange&&this._register(this.documentDiffItem.onOptionsDidChange(()=>{r.updateOptions(o(this.documentDiffItem.options||{}))}));const a=new Z,c=this.documentDiffItem.original??a.add(this._modelService.createModel("",null)),l=this.documentDiffItem.modified??a.add(this._modelService.createModel("",null));a.add(this.documentDiffItemRef.createNewRef(this)),this.diffEditorViewModelRef=this._register(aW.createWithDisposable(this._instantiationService.createInstance(xJ,{original:c,modified:l},r),a,this))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};yve=D([_(2,we),_(3,gi)],yve);W("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(9361,"The background color of the diff editor's header"));W("multiDiffEditor.background","editorBackground",g(9362,"The background color of the multi file diff editor"));W("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(9363,"The border color of the multi file diff editor"));let Cve=class extends V{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=jt(this,void 0),this._viewModel=jt(this,void 0),this._widgetImpl=AI(this,(n,o)=>(Fg(LJ,n),o.add(this._instantiationService.createInstance(Fg(wve,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Ze(this,n=>this._widgetImpl.read(n).activeControl.read(n)),this.onDidChangeActiveControl=M.fromObservableLight(this._activeControl),this._register(FN(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new $Ye(e,this._instantiationService)}setViewModel(e){this._viewModel.set(e,void 0)}layout(e){this._dimension.set(e,void 0)}getActiveControl(){return this._activeControl.get()}getViewState(){return this._widgetImpl.get().getViewState()}setViewState(e){this._widgetImpl.get().setViewState(e)}tryGetCodeEditor(e){return this._widgetImpl.get().tryGetCodeEditor(e)}findDocumentDiffItem(e){return this._widgetImpl.get().findDocumentDiffItem(e)}};Cve=D([_(2,we)],Cve);const IRe=ae("IEditorCancelService"),GYe=new Q("cancellableOperation",!1,g(9366,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(IRe,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=GYe.bindTo(n.get(Le)),r=new hl;return{key:o,tokens:r}}),this._tokens.set(s,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},qt.Delayed);class KIt extends ci{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(IRe).add(e,this))}dispose(){this._unregister(),super.dispose()}}qe(new class extends hc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:Ae.EditorContrib,primary:S.Escape},precondition:GYe})}runEditorCommand(s,e){s.get(IRe).cancel(e)}});var jo;(function(s){s[s.Value=1]="Value",s[s.Selection=2]="Selection",s[s.Position=4]="Position",s[s.Scroll=8]="Scroll"})(jo||(jo={}));let Tae=class Sve{constructor(e,t){if(this.flags=t,this.flags&jo.Value){const i=e.getModel();this.modelVersionId=i?$p("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&jo.Position?this.position=e.getPosition():this.position=null,this.flags&jo.Selection?this.selection=e.getSelection():this.selection=null,this.flags&jo.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Sve))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new Sve(e,this.flags))}};class Jk extends KIt{constructor(e,t,i,n){super(e,n),this._listener=new Z,t&jo.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!F.containsPosition(i,o.position))&&this.cancel()})),t&jo.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!F.containsRange(i,o.selection))&&this.cancel()})),t&jo.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&jo.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class TRe extends ci{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hW{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=vm.capture(e),o=hW._handleEolEdits(e,t);o.length===1&&hW._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Zn.replace(F.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Zn.replaceMove(F.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}function KYe(s){return s.scheme===pe.vscodeRemote?s.authority:void 0}function D6(s){if(!s)return;const e=s.indexOf("+");return e<0?s:s.substr(0,e)}const qIt="extensions.user.cache",QIt="extensions.builtin.cache",qYe="undefined_publisher",jIt=["ui","workspace","web"];function dK(s){if(typeof s=="object"&&s!==null&&s.supported!==!0)return s.description}const QYe=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"];var br;(function(s){s[s.System=0]="System",s[s.User=1]="User"})(br||(br={}));var Es;(function(s){s.WIN32_X64="win32-x64",s.WIN32_ARM64="win32-arm64",s.LINUX_X64="linux-x64",s.LINUX_ARM64="linux-arm64",s.LINUX_ARMHF="linux-armhf",s.ALPINE_X64="alpine-x64",s.ALPINE_ARM64="alpine-arm64",s.DARWIN_X64="darwin-x64",s.DARWIN_ARM64="darwin-arm64",s.WEB="web",s.UNIVERSAL="universal",s.UNKNOWN="unknown",s.UNDEFINED="undefined"})(Es||(Es={}));class Sn{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(typeof e>"u"||e===null)return typeof t>"u"||t===null;if(typeof t>"u"||t===null)return!1;if(typeof e=="string"||typeof t=="string"){const i=typeof e=="string"?e:e.value,n=typeof t=="string"?t:t.value;return ua(i,n)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class A_{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Sn.toKey(e))}delete(e){return this._set.delete(Sn.toKey(e))}has(e){return this._set.has(Sn.toKey(e))}}class va{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Sn.toKey(e))}get(e){return this._map.get(Sn.toKey(e))}has(e){return this._map.has(Sn.toKey(e))}set(e,t){this._map.set(Sn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function YIt(s){return LRe(s)}function LRe(s){return s.contributes&&s.contributes.localizations?s.contributes.localizations.length>0:!1}function JIt(s,e){if(e){const t=`onResolveRemoteAuthority:${D6(e)}`;return!!s.activationEvents?.includes(t)}return!1}function XIt(s){return s.map(e=>{const[t,i]=e.split("@");return{proposalName:t,version:i?parseInt(i):void 0}})}function ZIt(s){return s.map(e=>e.split("@")[0])}function Lae(s,e,t){const i=[],n=new A_,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(c,l,d){return a.provideDocumentRangeFormattingEdits(c,c.getFullModelRange(),l,d)}})}return i}var uW;(function(s){s[s.File=1]="File",s[s.Selection=2]="Selection"})(uW||(uW={}));var om;(function(s){s[s.Explicit=1]="Explicit",s[s.Silent=2]="Silent"})(om||(om={}));const $z=class $z{static setFormatterSelector(e){return{dispose:$z._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=hi.first($z._selectors);if(o)return await o(e,t,i,n)}};$z._selectors=new hl;let gW=$z;async function Rae(s,e,t,i,n,o,r){const a=s.get(we),{documentRangeFormattingEditProvider:c}=s.get(it),l=Qr(e)?e.getModel():e,d=c.ordered(l),h=await gW.select(d,l,i,uW.Selection);h&&(n.report(h),await a.invokeFunction(jYe,h,e,t,o,r))}async function jYe(s,e,t,i,n,o){const r=s.get(Ml),a=s.get(Ge),c=s.get(lv);let l,d;Qr(t)?(l=t.getModel(),d=new Jk(t,jo.Value|jo.Position,void 0,n)):(l=t,d=new TRe(t,n));const h=[];let u=0;for(const b of H_(i).sort(F.compareRangesUsingStarts))u>0&&F.areIntersectingOrTouching(h[u-1],b)?h[u-1]=F.fromPositions(h[u-1].getStartPosition(),b.getEndPosition()):u=h.push(b);const f=async b=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,b);const w=await e.provideDocumentRangeFormattingEdits(l,b,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),w},p=(b,w)=>{if(!b.length||!w.length)return!1;const y=b.reduce((C,A)=>F.plusRange(C,A.range),b[0].range);if(!w.some(C=>F.intersectRanges(y,C.range)))return!1;for(const C of b)for(const A of w)if(F.intersectRanges(C.range,A.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const b=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),v.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;v.push(await f(b))}for(let b=0;b({text:y.text,range:F.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(F.areIntersectingOrTouching(C,w))return[new dt(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return c.playSignal(cl.format,{userGesture:o}),!0}async function Ave(s,e,t,i,n,o){const r=s.get(we),a=s.get(it),c=Qr(e)?e.getModel():e,l=Lae(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await gW.select(l,c,t,uW.File);d&&(i.report(d),await r.invokeFunction(YYe,d,e,t,n,o))}async function YYe(s,e,t,i,n,o){const r=s.get(Ml),a=s.get(lv);let c,l;Qr(t)?(c=t.getModel(),l=new Jk(t,jo.Value|jo.Position,void 0,n)):(c=t,l=new TRe(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await r.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(Qr(t))hW.execute(t,d,i!==om.Silent),i!==om.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),mt.Immediate);else{const[{range:h}]=d,u=new dt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:F.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(F.areIntersectingOrTouching(p,u))return[new dt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(cl.format,{userGesture:o}),!0}async function e0t(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(No);if(eo(c))return await s.computeMoreMinimalEdits(t.uri,c)}}async function t0t(s,e,t,i,n){const o=Lae(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(No);if(eo(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function JYe(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(No).then(c=>s.computeMoreMinimalEdits(t.uri,c))}_t.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const o=s.get(fn),r=s.get(Ml),a=s.get(it),c=await o.createModelReference(t);try{return e0t(r,a,c.object.textEditorModel,F.lift(i),n,He.None)}finally{c.dispose()}});_t.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;Tt(N.isUri(t));const n=s.get(fn),o=s.get(Ml),r=s.get(it),a=await n.createModelReference(t);try{return t0t(o,r,a.object.textEditorModel,i,He.None)}finally{a.dispose()}});_t.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string");const r=s.get(fn),a=s.get(Ml),c=s.get(it),l=await r.createModelReference(t);try{return JYe(a,c,l.object.textEditorModel,oe.lift(i),n,o,He.None)}finally{l.dispose()}});var Cl;(function(s){s[s.provider=0]="provider",s[s.userDefined=1]="userDefined",s[s.recovered=2]="recovered"})(Cl||(Cl={}));const i0t={[Cl.provider]:" ",[Cl.userDefined]:"u",[Cl.recovered]:"r"},OWe=65535,Vv=16777215,BWe=4278190080;class Bhe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<OWe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Bhe(e.length),this._userDefinedStates=new Bhe(e.length),this._recoveredStates=new Bhe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;iVv||r>Vv)throw new Error("startLineNumber or endLineNumber must not exceed "+Vv);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Vv}getEndLineNumber(e){return this._endIndexes[e]&Vv}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?Cl.userDefined:this.isRecovered(e)?Cl.recovered:Cl.provider}setSource(e,t){t===Cl.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===Cl.recovered?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n>>24)+((this._endIndexes[e]&BWe)>>>16);return t===OWe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?b=>bb=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===Cl.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=Cl.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===Cl.provider&&(m.source=Cl.recovered)),d=r(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>l.endLineNumber){m=l;break}if(b.source===Cl.userDefined&&b.endLineNumber>l.endLineNumber)break;b=r(++v)}l=o(++a)}if(m){for(;u&&u.endLineNumberm.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!u||u.endLineNumber>=m.endLineNumber)&&(p.push(m),f=m.startLineNumber,u&&h.push(u),u=m)}}return p}}class n0t{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}hidesLine(e){return this.startLineNumberi.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,r=-1;const a=c=>{for(;nr&&(r=l),n++}};for(const c of e){const l=c.regionIndex,d=this._editorDecorationIds[l];if(d&&!t[d]){t[d]=!0,a(l);const h=!this._regions.isCollapsed(l);this._regions.setCollapsed(l,h),o=Math.max(o,this._regions.getEndLineNumber(l))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const o of e)if(!(o.startLineNumber>n.endLineNumber||n.startLineNumber>o.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(n,o)=>{for(const r of e)if(n=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??Cl.provider})}const n=$f.sanitizeAndMerge(this._regions,t,i);this.updatePost($f.fromFoldRanges(n))}_getLinesChecksum(e,t){return Wc(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,o))&&i.push(r),o++,n=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,c=this._regions.length;a0&&!l.containedBy(r[r.length-1]);)r.pop();r.push(l),t(l,r.length)&&i.push(l)}else break}}else for(let r=n,a=this._regions.length;r1){const a=s.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=s.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=s.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);n.push(...r)}s.toggleCollapseState(n)}function o0t(s,e,t){const i=[];for(const n of t){const o=s.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}s.toggleCollapseState(i)}function r0t(s,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function ZYe(s,e,t){const i=[];for(const r of t){const a=s.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function MRe(s,e,t){const i=s.textModel,n=s.regions,o=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(n.toRegion(r))}s.toggleCollapseState(o)}function NRe(s,e,t){const i=s.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));s.toggleCollapseState(n)}function a0t(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function c0t(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function l0t(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>s)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Ab(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return WWe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=r=>((!n||!u0t(r,n))&&(n=WWe(this._hiddenRanges,r)),n?n.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function u0t(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function WWe(s,e){const t=w2(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const g0t=5e3,f0t="indent";class PRe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=f0t}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(_0t(this.editorModel,i,n,this.foldingRangesLimit))}}let p0t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Vv||t>Vv)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],n[r]=this._endIndexes[o];return new $f(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let c=0;ct){n=c;break}i+=l}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let c=this._length-1,l=0;c>=0;c--){const d=this._startIndexes[c],h=e.getLineContent(d),u=sae(h,o);(u{}};function _0t(s,e,t,i=m0t){const n=s.getOptions().tabSize,o=new p0t(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=s.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=s.getLineCount();l>0;l--){const d=s.getLineContent(l),h=sae(d,n);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,u=a[p],o.insertFirst(l,u.line,h),u.line=l,u.indent=h,u.endAbove=l;continue}}else{a.push({indent:-2,endAbove:l,line:l});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const p=u.endAbove-1;p-l>=1&&o.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return o.toIndentRanges(s)}const v0t=W("editor.foldBackground",{light:st(AS,.3),dark:st(AS,.3),hcDark:null,hcLight:null},g(1685,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},g(1686,"Color of the collapsed text after the first line of a folded range."));W("editorGutter.foldingControlForeground",nY,g(1687,"Color of the folding control in the editor gutter."));const RJ=oi("folding-expanded",ve.chevronDown,g(1688,"Icon for expanded ranges in the editor glyph margin.")),MJ=oi("folding-collapsed",ve.chevronRight,g(1689,"Icon for collapsed ranges in the editor glyph margin.")),HWe=oi("folding-manual-collapsed",MJ,g(1690,"Icon for manually collapsed ranges in the editor glyph margin.")),UWe=oi("folding-manual-expanded",RJ,g(1691,"Icon for manually expanded ranges in the editor glyph margin.")),Whe={color:$o(v0t),position:Th.Inline},fP=g(1692,"Click to expand the range."),hK=g(1693,"Click to collapse the range."),$a=class $a{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?$a.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?$a.MANUALLY_EXPANDED_VISUAL_DECORATION:$a.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};$a.COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(MJ)}),$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(MJ)}),$a.MANUALLY_COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(HWe)}),$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(HWe)}),$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP}),$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP}),$a.EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-expanded-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(RJ),linesDecorationsTooltip:hK}),$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(RJ),linesDecorationsTooltip:hK}),$a.MANUALLY_EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(UWe),linesDecorationsTooltip:hK}),$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(UWe),linesDecorationsTooltip:hK}),$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),$a.HIDDEN_RANGE_DECORATION=Gt.register({description:"folding-hidden-range-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges});let Eve=$a;const b0t={},w0t="syntax";class FRe{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id=w0t,this.disposables=new Z,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return y0t(this.providers,this.editorModel,e).then(t=>t?S0t(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function y0t(s,e,t){let i=null;const n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,b0t,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const c=e.getLineCount();for(const l of a)l.start>0&&l.end>l.start&&l.end<=c&&i.push({start:l.start,end:l.end,rank:r,kind:l.kind})}},No));return Promise.all(n).then(o=>i)}class C0t{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Vv||t>Vv)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;ne){i=a;break}t+=c}}const n=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,c=0;a{let c=r.start-a.start;return c===0&&(c=r.rank-a.rank),c}),i=new C0t(e);let n;const o=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>n.start)if(r.end<=n.end)o.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>n.end){do n=o.pop();while(n&&r.start>n.end);n&&o.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var c0;const md=new Q("foldingEnabled",!1);var vL;let TA=(vL=class extends V{static get(e){return e.getContribution(c0.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return c0._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return c0._foldingRangeSelector=e,{dispose:()=>{c0._foldingRangeSelector=void 0}}}constructor(e,t,i,n,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new eJe(e);const a=this.editor.getOptions();this._isEnabled=a.get(x.folding),this._useFoldingProviders=a.get(x.foldingStrategy)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(x.unfoldOnClickAfterEndOfLine),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(x.foldingImportsByDefault),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Eve(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=md.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(c=>{if(c.hasChanged(x.folding)&&(this._isEnabled=this.editor.getOptions().get(x.folding),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),c.hasChanged(x.foldingMaximumRegions)&&this.onModelChanged(),c.hasChanged(x.showFoldingControls)||c.hasChanged(x.foldingHighlight)){const l=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=l.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=l.get(x.foldingHighlight),this.triggerFoldingModelChanged()}c.hasChanged(x.foldingStrategy)&&(this._useFoldingProviders=this.editor.getOptions().get(x.foldingStrategy)!=="indentation",this.onFoldingStrategyChanged()),c.hasChanged(x.unfoldOnClickAfterEndOfLine)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(x.unfoldOnClickAfterEndOfLine)),c.hasChanged(x.foldingImportsByDefault)&&(this._foldingImportsByDefault=this.editor.getOptions().get(x.foldingImportsByDefault))})),this.onModelChanged()}get limitReporter(){return this._foldingLimitReporter}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new s0t(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new h0t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Mh(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new cn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new PRe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=c0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new FRe(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new js,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Rr(o=>i.compute(o));return n.then(o=>{if(o&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(l_.Imports.value,!0);d&&(r=vm.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(o,c),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(vt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,vt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case Rt.GUTTER_LINE_DECORATIONS:{const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<4)return;i=!0;break}case Rt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Rt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(e.target.type!==Rt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(n||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&l.push(u);l.length===0&&(l=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(r)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,mt.Smooth)}},c0=vL,vL.ID="editor.contrib.folding",vL);TA=c0=D([_(1,Le),_(2,Vs),_(3,bi),_(4,Sp),_(5,it)],TA);class eJe{constructor(e){this.editor=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(x.foldingMaximumRegions)}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Zd extends tt{runEditorCommand(e,t,i){const n=e.get(Vs),o=TA.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,n);const c=t.getSelection();c&&o.reveal(c.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function tJe(s){if(!Ya(s)){if(!kn(s))return!1;const e=s;if(!Ya(e.levels)&&!lc(e.levels)||!Ya(e.direction)&&!Lt(e.direction)||!Ya(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(lc)))return!1}return!0}class A0t extends Zd{constructor(){super({id:"editor.unfold",label:g(453,"Unfold"),alias:"Unfold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketRight,mac:{primary:U.CtrlCmd|U.Alt|S.BracketRight},weight:Ae.EditorContrib},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:yZe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?wZe(t,!1,o,r):Lz(t,!1,o,r)}}class TLt extends Pu{constructor(){super({id:"editor.unfoldRecursively",label:g(Nu,1,"Unfold Recursively"),alias:"Unfold Recursively",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.BracketRight),weight:ye.EditorContrib}})}invoke(e,t,i,s){Lz(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class RLt extends Pu{constructor(){super({id:"editor.fold",label:g(Nu,2,"Fold"),alias:"Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.BracketLeft,mac:{primary:V.CtrlCmd|V.Alt|E.BracketLeft},weight:ye.EditorContrib},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:tJe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?XYe(t,!1,o,r):PU(t,!1,o,r)}}class E0t extends Zd{constructor(){super({id:"editor.unfoldRecursively",label:g(454,"Unfold Recursively"),alias:"Unfold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketRight),weight:Ae.EditorContrib}})}invoke(e,t,i,n){PU(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class x0t extends Zd{constructor(){super({id:"editor.fold",label:g(455,"Fold"),alias:"Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketLeft,mac:{primary:U.CtrlCmd|U.Alt|S.BracketLeft},weight:Ae.EditorContrib},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:yZe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?hLt(t,!0,o):a==="up"?wZe(t,!0,r||1,o):Lz(t,!0,r||1,o)}}class MLt extends Pu{constructor(){super({id:"editor.toggleFold",label:g(Nu,3,"Toggle Fold"),alias:"Toggle Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyL),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);vZe(t,1,s)}}class NLt extends Pu{constructor(){super({id:"editor.foldRecursively",label:g(Nu,4,"Fold Recursively"),alias:"Fold Recursively",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.BracketLeft),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);Lz(t,!0,Number.MAX_VALUE,s)}}class PLt extends Pu{constructor(){super({id:"editor.foldAllBlockComments",label:g(Nu,5,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Slash),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())fPe(t,yv.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const c=new RegExp("^\\s*"+Iu(a.blockCommentStartToken));gPe(t,c,!0)}}}}class FLt extends Pu{constructor(){super({id:"editor.foldAllMarkerRegions",label:g(Nu,6,"Fold All Regions"),alias:"Fold All Regions",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit8),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())fPe(t,yv.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);gPe(t,c,!0)}}}}class OLt extends Pu{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g(Nu,7,"Unfold All Regions"),alias:"Unfold All Regions",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit9),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())fPe(t,yv.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);gPe(t,c,!1)}}}}class BLt extends Pu{constructor(){super({id:"editor.foldAllExcept",label:g(Nu,8,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Minus),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);bZe(t,!0,s)}}class WLt extends Pu{constructor(){super({id:"editor.unfoldAllExcept",label:g(Nu,9,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Equal),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);bZe(t,!1,s)}}class HLt extends Pu{constructor(){super({id:"editor.foldAll",label:g(Nu,10,"Fold All"),alias:"Fold All",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit0),weight:ye.EditorContrib}})}invoke(e,t,i){Lz(t,!0)}}class ULt extends Pu{constructor(){super({id:"editor.unfoldAll",label:g(Nu,11,"Unfold All"),alias:"Unfold All",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyJ),weight:ye.EditorContrib}})}invoke(e,t,i){Lz(t,!1)}}const G2=class G2 extends Pu{getFoldingLevel(){return parseInt(this.id.substr(G2.ID_PREFIX.length))}invoke(e,t,i){uLt(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};G2.ID_PREFIX="editor.foldLevel",G2.ID=e=>G2.ID_PREFIX+e;let nte=G2;class VLt extends Pu{constructor(){super({id:"editor.gotoParentFold",label:g(Nu,12,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=gLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class zLt extends Pu{constructor(){super({id:"editor.gotoPreviousFold",label:g(Nu,13,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=fLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class $Lt extends Pu{constructor(){super({id:"editor.gotoNextFold",label:g(Nu,14,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=pLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class GLt extends Pu{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(Nu,15,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Comma),weight:ye.EditorContrib}})}invoke(e,t,i){const s=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(s.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:_d.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=Xp.sanitizeAndMerge(t.regions,s,i.getModel()?.getLineCount());t.updatePost(Xp.fromFoldRanges(r))}}}}class qLt extends Pu{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(Nu,16,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Period),weight:ye.EditorContrib}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}vn(Ox.ID,Ox,mi.Eager);Fe(LLt);Fe(TLt);Fe(RLt);Fe(NLt);Fe(HLt);Fe(ULt);Fe(PLt);Fe(FLt);Fe(OLt);Fe(BLt);Fe(WLt);Fe(MLt);Fe(VLt);Fe(zLt);Fe($Lt);Fe(GLt);Fe(qLt);for(let n=1;n<=7;n++)Lgt(new nte({id:nte.ID(n),label:g(Nu,17,"Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit0+n),weight:ye.EditorContrib}}));yt.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof P))throw Ui();const i=n.get(ht),s=n.get(Ai).getModel(t);if(!s)throw Ui();const o=n.get(Re);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(lo),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new pPe(s,r,c);let d=l;if(a!=="indentation"){const f=Ox.getFoldingRangeProviders(i,s);f.length&&(d=new mPe(s,f,()=>{},c,l))}const h=await d.compute(qe.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};n.openEditor(e,o)}}),_l({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(ste,3,"Configure Limit"),run:()=>s.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:nt.Warning})}function z$(n){return ja(n?.editor)}function Zfe(n){const e=n;return z$(n)&&e?.group!==void 0}function UCe(n){const e=n;return typeof e?.groupId=="number"&&ja(e.editor)}var mx;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.REPLACE=1]="REPLACE",n[n.MOVE=2]="MOVE",n[n.UNPIN=3]="UNPIN"})(mx||(mx={}));var qo;(function(n){n[n.GROUP_ACTIVE=0]="GROUP_ACTIVE",n[n.GROUP_INDEX=1]="GROUP_INDEX",n[n.GROUP_LABEL=2]="GROUP_LABEL",n[n.GROUP_LOCKED=3]="GROUP_LOCKED",n[n.EDITORS_SELECTION=4]="EDITORS_SELECTION",n[n.EDITOR_OPEN=5]="EDITOR_OPEN",n[n.EDITOR_CLOSE=6]="EDITOR_CLOSE",n[n.EDITOR_MOVE=7]="EDITOR_MOVE",n[n.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",n[n.EDITOR_LABEL=9]="EDITOR_LABEL",n[n.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",n[n.EDITOR_PIN=11]="EDITOR_PIN",n[n.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",n[n.EDITOR_STICKY=13]="EDITOR_STICKY",n[n.EDITOR_DIRTY=14]="EDITOR_DIRTY",n[n.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(qo||(qo={}));var go;(function(n){n[n.PRIMARY=1]="PRIMARY",n[n.SECONDARY=2]="SECONDARY",n[n.BOTH=3]="BOTH",n[n.ANY=4]="ANY"})(go||(go={}));class eTt{getOriginalUri(e,t){if(!e)return;if(Wb(e))return jc.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getOriginalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getOriginalUri(s,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=JLt(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return XLt(e)||LE(e)?{primary:e.primary,secondary:e.secondary}:EZe(e)||Gv(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Wb(e))return jc.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getCanonicalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getCanonicalUri(s,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(i=>e.scheme===i))return e}else if(t===e.scheme)return e}}var gVe;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.KEYBOARD=1]="KEYBOARD",n[n.MOUSE=2]="MOUSE"})(gVe||(gVe={}));const jc=new eTt;var fVe;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(fVe||(fVe={}));class tTt{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(be);for(const[i,s]of this.editorSerializerConstructors)this.createEditorSerializer(i,s,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const s=i.createInstance(t);this.editorSerializerInstances.set(e,s)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return ws(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),Ee(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}it.add(zS.EditorFactory,new tTt);async function epe(n,e,t){return!n||!n.length?[]:await Promise.all(n.map(async i=>{const s=P.revive(i.fileUri);if(!s){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(s)){t.info("Cannot resolve the path because it cannot be handled",i);return}let r=i.exists,a=i.type;if(typeof r!="boolean"||typeof a!="number")try{a=(await e.stat(s)).isDirectory?an.Directory:an.Unknown,r=!0}catch(l){t.error(l),r=!1}if(!r&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===an.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:s,options:c}:{resource:s,options:c,forceUntitled:!0}}))}var eg;(function(n){n[n.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",n[n.SEQUENTIAL=1]="SEQUENTIAL"})(eg||(eg={}));function _Pe(n){const e=n;if(!e)return!1;const t=e;if(t.modified)return _Pe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function xZe(n,e,t){const i=pSt(n,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var Gw;const Si="vs/workbench/common/contextkeys";new Y("workbenchState",void 0,{type:"string",description:g(Si,0,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")});new Y("workspaceFolderCount",0,g(Si,1,"The number of root folders in the workspace"));new Y("openFolderWorkspaceSupport",!0,!0);new Y("enterMultiRootWorkspaceSupport",!0,!0);const iTt=new Y("emptyWorkspaceSupport",!0,!0);new Y("dirtyWorkingCopies",!1,g(Si,2,"Whether there are any working copies with unsaved changes"));new Y("remoteName","",g(Si,3,"The name of the remote the window is connected to or an empty string if not connected to any remote"));new Y("virtualWorkspace","",g(Si,4,"The scheme of the current workspace is from a virtual file system or an empty string."));const nTt=new Y("temporaryWorkspace",!1,g(Si,5,"The scheme of the current workspace is from a temporary file system."));new Y("isFullscreen",!1,g(Si,6,"Whether the main window is in fullscreen mode"));new Y("isAuxiliaryWindowFocusedContext",!1,g(Si,7,"Whether an auxiliary window is focused"));new Y("hasWebFileSystemAccess",!1,!0);new Y("embedderIdentifier",void 0,g(Si,8,"The identifier of the embedder according to the product service, if one is defined"));new Y("activeEditorIsDirty",!1,g(Si,9,"Whether the active editor has unsaved changes"));new Y("activeEditorIsNotPreview",!1,g(Si,10,"Whether the active editor is not in preview mode"));new Y("activeEditorIsFirstInGroup",!1,g(Si,11,"Whether the active editor is the first one in its group"));new Y("activeEditorIsLastInGroup",!1,g(Si,12,"Whether the active editor is the last one in its group"));new Y("activeEditorIsPinned",!1,g(Si,13,"Whether the active editor is pinned"));new Y("activeEditorIsReadonly",!1,g(Si,14,"Whether the active editor is read-only"));new Y("activeCompareEditorCanSwap",!1,g(Si,15,"Whether the active compare editor can swap sides"));const sTt=new Y("activeEditorCanToggleReadonly",!0,g(Si,16,"Whether the active editor can toggle between being read-only or writeable"));new Y("activeEditorCanRevert",!1,g(Si,17,"Whether the active editor can revert"));new Y("activeEditorCanSplitInGroup",!0);const DZe=new Y("activeEditor",null,{type:"string",description:g(Si,18,"The identifier of the active editor")});new Y("activeEditorAvailableEditorIds","",g(Si,19,"The available editor identifiers that are usable for the active editor"));new Y("textCompareEditorVisible",!1,g(Si,20,"Whether a text compare editor is visible"));const Vde=new Y("textCompareEditorActive",!1,g(Si,21,"Whether a text compare editor is active"));new Y("sideBySideEditorActive",!1,g(Si,22,"Whether a side by side editor is active"));new Y("groupEditorsCount",0,g(Si,23,"The number of opened editor groups"));new Y("activeEditorGroupEmpty",!1,g(Si,24,"Whether the active editor group is empty"));new Y("activeEditorGroupIndex",0,g(Si,25,"The index of the active editor group"));new Y("activeEditorGroupLast",!1,g(Si,26,"Whether the active editor group is the last group"));new Y("activeEditorGroupLocked",!1,g(Si,27,"Whether the active editor group is locked"));new Y("multipleEditorGroups",!1,g(Si,28,"Whether there are multiple editor groups opened"));new Y("multipleEditorsSelectedInGroup",!1,g(Si,29,"Whether multiple editors have been selected in an editor group"));new Y("twoEditorsSelectedInGroup",!1,g(Si,30,"Whether exactly two editors have been selected in an editor group"));new Y("editorPartMultipleEditorGroups",!1,g(Si,31,"Whether there are multiple editor groups opened in an editor part"));new Y("editorPartMaximizedEditorGroup",!1,g(Si,32,"Editor Part has a maximized group"));new Y("isAuxiliaryEditorPart",!1,g(Si,33,"Editor Part is in an auxiliary window"));new Y("editorIsOpen",!1,g(Si,34,"Whether an editor is open"));new Y("inZenMode",!1,g(Si,35,"Whether Zen mode is enabled"));new Y("isCenteredLayout",!1,g(Si,36,"Whether centered layout is enabled for the main editor"));new Y("splitEditorsVertically",!1,g(Si,37,"Whether editors split vertically"));new Y("mainEditorAreaVisible",!0,g(Si,38,"Whether the editor area in the main window is visible"));new Y("editorTabsVisible",!0,g(Si,39,"Whether editor tabs are visible"));new Y("sideBarVisible",!1,g(Si,40,"Whether the sidebar is visible"));new Y("sideBarFocus",!1,g(Si,41,"Whether the sidebar has keyboard focus"));new Y("activeViewlet","",g(Si,42,"The identifier of the active viewlet"));new Y("statusBarFocused",!1,g(Si,43,"Whether the status bar has keyboard focus"));new Y("titleBarStyle",jr?"native":"custom",g(Si,44,"Style of the window title bar"));new Y("titleBarVisible",!1,g(Si,45,"Whether the title bar is visible"));new Y("bannerFocused",!1,g(Si,46,"Whether the banner has keyboard focus"));new Y("notificationFocus",!0,g(Si,47,"Whether a notification has keyboard focus"));new Y("notificationCenterVisible",!1,g(Si,48,"Whether the notifications center is visible"));new Y("notificationToastsVisible",!1,g(Si,49,"Whether a notification toast is visible"));new Y("activeAuxiliary","",g(Si,50,"The identifier of the active auxiliary panel"));new Y("auxiliaryBarFocus",!1,g(Si,51,"Whether the auxiliary bar has keyboard focus"));new Y("auxiliaryBarVisible",!1,g(Si,52,"Whether the auxiliary bar is visible"));new Y("activePanel","",g(Si,53,"The identifier of the active panel"));new Y("panelFocus",!1,g(Si,54,"Whether the panel has keyboard focus"));new Y("panelPosition","bottom",g(Si,55,"The position of the panel, always 'bottom'"));new Y("panelAlignment","center",g(Si,56,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'"));new Y("panelVisible",!1,g(Si,57,"Whether the panel is visible"));new Y("panelMaximized",!1,g(Si,58,"Whether the panel is maximized"));const Tz=new Y("focusedView","",g(Si,59,"The identifier of the view that has keyboard focus"));var Gf;let O7=(Gf=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new Z,this._schemeKey=Gw.Scheme.bindTo(this._contextKeyService),this._filenameKey=Gw.Filename.bindTo(this._contextKeyService),this._dirnameKey=Gw.Dirname.bindTo(this._contextKeyService),this._pathKey=Gw.Path.bindTo(this._contextKeyService),this._langIdKey=Gw.LangId.bindTo(this._contextKeyService),this._resourceKey=Gw.Resource.bindTo(this._contextKeyService),this._extensionKey=Gw.Extension.bindTo(this._contextKeyService),this._hasResource=Gw.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Gw.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(s.onModelAdded(o=>{_n(o.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(o=>{_n(o.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}_setLangId(){const e=this.get();if(!e){this._langIdKey.set(null);return}const t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!_n(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?ui(e):null),this._dirnameKey.set(e?this.uriToPath(ma(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?uz(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}},Gw=Gf,Gf.Scheme=new Y("resourceScheme",void 0,{type:"string",description:g(Si,60,"The scheme of the resource")}),Gf.Filename=new Y("resourceFilename",void 0,{type:"string",description:g(Si,61,"The file name of the resource")}),Gf.Dirname=new Y("resourceDirname",void 0,{type:"string",description:g(Si,62,"The folder name the resource is contained in")}),Gf.Path=new Y("resourcePath",void 0,{type:"string",description:g(Si,63,"The full path of the resource")}),Gf.LangId=new Y("resourceLangId",void 0,{type:"string",description:g(Si,64,"The language identifier of the resource")}),Gf.Resource=new Y("resource",void 0,{type:"URI",description:g(Si,65,"The full value of the resource including scheme and path")}),Gf.Extension=new Y("resourceExtname",void 0,{type:"string",description:g(Si,66,"The extension name of the resource")}),Gf.HasResource=new Y("resourceSet",void 0,{type:"boolean",description:g(Si,67,"Whether a resource is present or not")}),Gf.IsFileSystemResource=new Y("isFileSystemResource",void 0,{type:"boolean",description:g(Si,68,"Whether the resource is backed by a file system provider")}),Gf);O7=Gw=D([_(0,Pe),_(1,ci),_(2,Di),_(3,Ai)],O7);function oTt(n,e){return n.invokeFunction(t=>Ov.getServiceDependencies(e).sort((i,s)=>i.index-s.index).map(i=>t.get(i.id)))}function vPe(n){const e=n;return class extends e{constructor(...t){super(...t.slice(1),...oTt(t[0],n))}}}class wPe{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}class pVe{constructor(e){this.identifier=e}}const zde=ae("treeViewsDndService");ce(zde,wPe,Yt.Delayed);const kZe=ae("extensionHostDebugService"),rTt="diagnosticsService";class aTt{async getPerformanceInfo(e,t){return{}}async getSystemInfo(e,t){return{processArgs:"nullProcessArgs",gpuStatus:"nullGpuStatus",screenReader:"nullScreenReader",remoteData:[],os:"nullOs",memory:"nullMemory",vmHint:"nullVmHint"}}async getDiagnostics(e,t){return""}async getWorkspaceFileExtensions(e){return{extensions:[]}}async reportWorkspaceStats(e){}}const cTt=ae(rTt),bPe=ae("downloadService"),lTt=ae("encryptionService"),aL=ae("extensionGalleryService"),Rz=ae("extensionManagementService"),IZe=ae("IGlobalExtensionEnablementService"),dTt=ae("IExtensionTipsService"),B7=ae("IExtensionStorageService"),$de=ae("IExtensionsProfileScannerService"),hTt=ae("IExtensionsScannerService"),uTt=ae("IExtensionRecommendationNotificationService"),CPe=ae("extensionResourceLoaderService"),gTt=ae("IBuiltinExtensionsScannerService"),fTt=ae("keyboardLayoutService"),LZe=ae("languagePackService");class TZe{constructor(){this.onDidChange=T.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Xa=ae("productService"),rA=ae("remoteAuthorityResolverService"),Gde=ae("IRemoteExtensionsScannerService"),yPe=ae("remoteSocketFactoryService"),EQ=ae("requestService"),RZe=ae("secretStorageService"),pTt="signService",MZe=ae(pTt);let qde=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class mTt{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const _Tt="extensionTelemetryLog";function EJ(n,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!n.enableTelemetry)}function SPe(n,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||n.enableTelemetry&&n.aiConfig?.ariaKey)}function vTt(n){const e=n.getValue(xJe),t=n.getValue(txt);if(n.getValue(DJe)===!1||t===!1)return sp.NONE;switch(e??LT.ON){case LT.ON:return sp.USAGE;case LT.ERROR:return sp.ERROR;case LT.CRASH:return sp.CRASH;case LT.OFF:return sp.NONE}}const wTt=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function bTt(n){if(!n)return"none";const e=Wde(n);return wTt.has(e)?e:"other"}function CTt(n,e){if(!n||!n.includes("/")&&!n.includes("\\"))return n;let t=n;const i=[];for(const a of e)for(;;){const c=a.exec(n);if(!c)break;i.push([c.index,a.lastIndex])}const s=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(n);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return n}function mVe(n,e){return AU(n,t=>{if(t instanceof qde||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=CTt(i,e);for(const s of e)i=i.replace(s,"");return i=yTt(i),i}})}var _Ve;(function(n){n.AutomationProfile="terminal.integrated.automationProfile.",n.DefaultProfile="terminal.integrated.defaultProfile.",n.Profiles="terminal.integrated.profiles."})(_Ve||(_Ve={}));var _y;(function(n){n.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",n.AutomationProfileLinux="terminal.integrated.automationProfile.linux",n.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",n.AutomationProfileWindows="terminal.integrated.automationProfile.windows",n.ProfilesWindows="terminal.integrated.profiles.windows",n.ProfilesMacOs="terminal.integrated.profiles.osx",n.ProfilesLinux="terminal.integrated.profiles.linux",n.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",n.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",n.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",n.UseWslProfiles="terminal.integrated.useWslProfiles",n.TabsDefaultColor="terminal.integrated.tabs.defaultColor",n.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",n.TabsEnabled="terminal.integrated.tabs.enabled",n.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",n.TabsHideCondition="terminal.integrated.tabs.hideCondition",n.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",n.TabsShowActions="terminal.integrated.tabs.showActions",n.TabsLocation="terminal.integrated.tabs.location",n.TabsFocusMode="terminal.integrated.tabs.focusMode",n.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",n.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",n.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",n.CopyOnSelection="terminal.integrated.copyOnSelection",n.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",n.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",n.FontFamily="terminal.integrated.fontFamily",n.FontSize="terminal.integrated.fontSize",n.LetterSpacing="terminal.integrated.letterSpacing",n.LineHeight="terminal.integrated.lineHeight",n.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",n.TabStopWidth="terminal.integrated.tabStopWidth",n.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",n.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",n.BellDuration="terminal.integrated.bellDuration",n.FontWeight="terminal.integrated.fontWeight",n.FontWeightBold="terminal.integrated.fontWeightBold",n.CursorBlinking="terminal.integrated.cursorBlinking",n.CursorStyle="terminal.integrated.cursorStyle",n.CursorStyleInactive="terminal.integrated.cursorStyleInactive",n.CursorWidth="terminal.integrated.cursorWidth",n.Scrollback="terminal.integrated.scrollback",n.DetectLocale="terminal.integrated.detectLocale",n.DefaultLocation="terminal.integrated.defaultLocation",n.GpuAcceleration="terminal.integrated.gpuAcceleration",n.TerminalTitleSeparator="terminal.integrated.tabs.separator",n.TerminalTitle="terminal.integrated.tabs.title",n.TerminalDescription="terminal.integrated.tabs.description",n.RightClickBehavior="terminal.integrated.rightClickBehavior",n.MiddleClickBehavior="terminal.integrated.middleClickBehavior",n.Cwd="terminal.integrated.cwd",n.ConfirmOnExit="terminal.integrated.confirmOnExit",n.ConfirmOnKill="terminal.integrated.confirmOnKill",n.EnableBell="terminal.integrated.enableBell",n.EnableVisualBell="terminal.integrated.enableVisualBell",n.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",n.AllowChords="terminal.integrated.allowChords",n.AllowMnemonics="terminal.integrated.allowMnemonics",n.TabFocusMode="terminal.integrated.tabFocusMode",n.EnvMacOs="terminal.integrated.env.osx",n.EnvLinux="terminal.integrated.env.linux",n.EnvWindows="terminal.integrated.env.windows",n.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",n.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",n.ShowExitAlert="terminal.integrated.showExitAlert",n.SplitCwd="terminal.integrated.splitCwd",n.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",n.WordSeparators="terminal.integrated.wordSeparators",n.EnableFileLinks="terminal.integrated.enableFileLinks",n.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",n.UnicodeVersion="terminal.integrated.unicodeVersion",n.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",n.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",n.HideOnStartup="terminal.integrated.hideOnStartup",n.CustomGlyphs="terminal.integrated.customGlyphs",n.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",n.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",n.InheritEnv="terminal.integrated.inheritEnv",n.ShowLinkHover="terminal.integrated.showLinkHover",n.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",n.AutoReplies="terminal.integrated.autoReplies",n.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",n.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",n.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",n.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",n.EnableImages="terminal.integrated.enableImages",n.SmoothScrolling="terminal.integrated.smoothScrolling",n.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",n.FocusAfterRun="terminal.integrated.focusAfterRun",n.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",n.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",n.DevMode="terminal.integrated.developer.devMode"})(_y||(_y={}));var vVe;(function(n){n.PowerShell="pwsh",n.Bash="bash",n.Fish="fish",n.Sh="sh",n.Csh="csh",n.Ksh="ksh",n.Zsh="zsh",n.Python="python"})(vVe||(vVe={}));var wVe;(function(n){n.CommandPrompt="cmd",n.PowerShell="pwsh",n.Wsl="wsl",n.GitBash="gitbash",n.Python="python"})(wVe||(wVe={}));var bVe;(function(n){n[n.Api=0]="Api",n[n.Process=1]="Process",n[n.Sequence=2]="Sequence",n[n.Config=3]="Config"})(bVe||(bVe={}));var jf;(function(n){n.Cwd="cwd",n.InitialCwd="initialCwd",n.FixedDimensions="fixedDimensions",n.Title="title",n.ShellType="shellType",n.HasChildProcesses="hasChildProcesses",n.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",n.OverrideDimensions="overrideDimensions",n.FailedShellIntegrationActivation="failedShellIntegrationActivation",n.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(jf||(jf={}));var fV;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(fV||(fV={}));var CVe;(function(n){n.TerminalView="view",n.Editor="editor"})(CVe||(CVe={}));var yVe;(function(n){n[n.HighWatermarkChars=1e5]="HighWatermarkChars",n[n.LowWatermarkChars=5e3]="LowWatermarkChars",n[n.CharCountAckSize=5e3]="CharCountAckSize"})(yVe||(yVe={}));var SVe;(function(n){n[n.Off=0]="Off",n[n.FinalTerm=1]="FinalTerm",n[n.VSCode=2]="VSCode"})(SVe||(SVe={}));var vM;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(vM||(vM={}));const STt={Backend:"workbench.contributions.terminal.processBackend"};function VCe(n){return n?.toLowerCase()??""}class ATt{constructor(e){this.remoteAuthority=e}affects(e){return VCe(e)===this.remoteAuthority}}class ETt{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=VCe(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new ATt(t))}getTerminalBackend(e){return this._backends.get(VCe(e))}}it.add(STt.Backend,new ETt);const xTt=ae("terminalLogService"),Qde=ae("tunnelService");var tb;(function(n){n.Uninitialized="uninitialized",n.Idle="idle",n.Disabled="disabled",n.CheckingForUpdates="checking for updates",n.AvailableForDownload="available for download",n.Downloading="downloading",n.Downloaded="downloaded",n.Updating="updating",n.Ready="ready"})(tb||(tb={}));var AVe;(function(n){n[n.Setup=0]="Setup",n[n.Archive=1]="Archive",n[n.Snap=2]="Snap"})(AVe||(AVe={}));var EVe;(function(n){n[n.NotBuilt=0]="NotBuilt",n[n.DisabledByEnvironment=1]="DisabledByEnvironment",n[n.ManuallyDisabled=2]="ManuallyDisabled",n[n.MissingConfiguration=3]="MissingConfiguration",n[n.InvalidConfiguration=4]="InvalidConfiguration",n[n.RunningAsAdmin=5]="RunningAsAdmin"})(EVe||(EVe={}));const DTt={Uninitialized:{type:tb.Uninitialized},Disabled:n=>({type:tb.Disabled,reason:n}),Idle:(n,e)=>({type:tb.Idle,updateType:n,error:e}),CheckingForUpdates:n=>({type:tb.CheckingForUpdates,explicit:n}),AvailableForDownload:n=>({type:tb.AvailableForDownload,update:n}),Downloading:{type:tb.Downloading},Downloaded:n=>({type:tb.Downloaded,update:n}),Updating:n=>({type:tb.Updating,update:n}),Ready:n=>({type:tb.Ready,update:n})},NZe=ae("updateService");var xVe;let tpe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const b5=void 0;class MT{constructor(e,t=2**16){this.comparator=e,this[xVe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new tpe(this._maxLevel,b5,b5)}get size(){return this._size}clear(){this._header=new tpe(this._maxLevel,b5,b5),this._size=0}has(e){return!!MT._search(this,e,this.comparator)}get(e){return MT._search(this,e,this.comparator)?.value}set(e,t){return MT._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=MT._delete(this,e,this.comparator);return t&&(this._size-=1),t}forEach(e,t){let i=this._header.forward[0];for(;i;)e.call(t,i.value,i.key,this),i=i.forward[0]}[(xVe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this._header.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this._header.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this._header.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",t=this._header.forward[0];for(;t;)e+=`node(${t.key}, ${t.value}, lvl:${t.level})`,t=t.forward[0];return e}static _search(e,t,i){let s=e._header;for(let o=e._level-1;o>=0;o--)for(;s.forward[o]&&i(s.forward[o].key,t)<0;)s=s.forward[o];if(s=s.forward[0],s&&i(s.key,t)===0)return s}static _insert(e,t,i,s){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&s(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&s(r.key,t)===0)return r.value=i,!1;{const a=MT._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;r--){for(;o.forward[r]&&i(o.forward[r].key,t)<0;)o=o.forward[r];s[r]=o}if(o=o.forward[0],!o||i(o.key,t)!==0)return!1;for(let r=0;r0&&e._header.forward[e._level-1]===b5;)e._level-=1;return!0}}const t9=class t9{constructor(e){this.uri=e,this.time=t9._clock++}touch(){return this.time=t9._clock++,this}};t9._clock=0;let rte=t9,zCe=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=s=>{let o=t.get(s.scheme);return o===void 0&&(o=e.hasProvider(s)&&!this._fileService.hasCapability(s,es.PathCaseSensitive),t.set(s.scheme,o)),o};this._dispooables.add(T.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(s=>{t.delete(s.scheme)})),this.extUri=new cO(i),this._canonicalUris=new MT((s,o)=>this.extUri.compare(s,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=jQe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new rte(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].times[1].time?-1:0);rte._clock=0,this._canonicalUris.clear();const t=this._limit*.5;for(let i=0;ie.accessor.dispose()),this._entries.clear(),this._onDidChange.dispose()}setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=ZYe(o),r){const C=typeof r=="string"?r:r.value;f+=`, ${C}`}let m;switch(l?.id){case RVe:case jTt:m=l.id===RVe?"error":"warning",c=void 0,l=void 0}const v={name:s,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let w=d?W7.LEFT:W7.RIGHT;const b=this._entries.get(e);if(b&&(w=b.alignment,h=b.priority),b)return b.accessor.update(v),b.entry=v,H7.DidUpdate;{let C;typeof i=="string"?C={primary:h,secondary:Ed(i)}:C=h;const y=this._statusbarService.addEntry(v,t,w,C);return this._entries.set(e,{accessor:y,entry:v,alignment:w,priority:h,disposable:Ee(()=>{y.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:w,priority:h}]}),H7.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};$Ce=D([_(0,xPe)],$Ce);ce(DPe,$Ce,Yt.Delayed);const eRt=ae("IEditorBreadcrumbsService"),rI=new Tn(220,70),cte=new Tn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Kde={showTabs:"multiple",highlightModifiedTabs:!1,tabActionLocation:"right",tabActionCloseVisibility:!0,tabActionUnpinVisibility:!0,alwaysShowEditorActions:!1,tabSizing:"fit",tabSizingFixedMinWidth:50,tabSizingFixedMaxWidth:160,pinnedTabSizing:"normal",pinnedTabsOnSeparateRow:!1,tabHeight:"default",preventPinnedEditorClose:"keyboardAndMouse",titleScrollbarSizing:"default",focusRecentEditorAfterClose:!0,showIcons:!0,hasIcons:!0,enablePreview:!0,openPositioning:"right",openSideBySideDirection:"right",closeEmptyGroups:!0,labelFormat:"default",splitSizing:"auto",splitOnDragAndDrop:!0,dragToOpenWindow:!0,centeredLayoutFixedWidth:!1,doubleClickTabToToggleEditorGroupSizes:"expand",editorActionsLocation:"default",wrapTabs:!1,enablePreviewFromQuickOpen:!1,scrollToSwitchTabs:!1,enablePreviewFromCodeNavigation:!1,closeOnFileDelete:!1,mouseBackForwardToNavigate:!0,restoreViewState:!0,splitInGroupLayout:"horizontal",revealIfOpen:!1,get limit(){return{enabled:!1,value:10,perEditorGroup:!1,excludeDirty:!1}},get decorations(){return{badges:!0,colors:!0}},get autoLockGroups(){return new Set}},z_=ae("viewDescriptorService"),Tw=ae("accessibleViewService"),lL=ae("chatWidgetService"),tRt=ae("quickChatService"),BZe=ae("chatAccessibilityService"),iRt=ae("chatCodeBlockContextProviderService"),yp=ae("chatAgentService"),Yde=ae("chatAgentNameService"),Rw=ae("IChatService"),kPe=ae("chatSlashCommandService"),Mz=ae("IChatVariablesService"),WZe=ae("IChatWidgetHistoryService"),HZe=ae("ILanguageModelsService"),sD=ae("commentService"),IPe=ae("customEditorService"),LPe=ae("debugService"),UZe=ae("debugVisualizerService"),nRt=ae("IEditSessionsStorageService"),sRt=ae("IEditSessionsLogService"),pr=ae("extensionsWorkbenchService"),VZe=ae("externalUriOpenerService"),Sp=ae("explorerService"),zZe=ae("IInlineChatSavingService "),TPe=ae("IInlineChatSessionService"),RPe=ae("IInteractiveDocumentService"),$Ze=ae("IInteractiveHistoryService"),oRt=ae("IDefaultLogLevelsService"),GZe=ae("multiDiffSourceResolverService"),xQ=ae("INotebookEditorWidgetService"),qZe=ae("notebookCellStatusBarService"),Jde=ae("INotebookModelResolverService"),rRt=ae("INotebookExecutionService"),QZe=ae("INotebookExecutionStateService"),jZe=ae("INotebookKernelService"),aRt=ae("INotebookKernelHistoryService"),cRt=ae("notebookKeymapService"),lRt=ae("INotebookLoggingService"),KZe=ae("INotebookRendererMessagingService"),oD=ae("notebookService"),dRt="notebookEditorWorkerService",hRt=ae(dRt),uRt=ae("outputChannelModelService"),gRt=ae("preferencesSearchService"),DQ=ae("quickDiff"),MPe=ae("scm"),YZe=ae("scmView"),fRt=ae("replaceService"),pRt=ae("searchViewModelWorkbenchService"),mRt=ae("notebookSearchService"),_Rt=ae("searchHistoryService"),JZe=ae("shareService"),$_=ae("snippetService"),Xde=ae("speechService");class vRt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const wRt=ae("workspaceTagsService"),XZe=ae("taskService"),Nz=ae("terminalService"),bRt=ae("terminalConfigurationService"),ZZe=ae("terminalEditorService"),NPe=ae("terminalGroupService"),eet=ae("terminalInstanceService"),tet=ae("environmentVariableService"),iet=ae("terminalProfileResolverService"),net=ae("terminalProfileService"),CRt=ae("terminalContributionsService"),set=ae("terminalLinkProviderService"),oet=ae("terminalQuickFixService"),yRt=ae("testCoverageService"),SRt=ae("testingFilterState"),ret=ae("testProfileService"),aet=ae("testResultService"),ARt=ae("ITestResultStorage"),cet=ae("testService"),ERt=ae("testingContinuousRunService"),xRt=ae("testingDecorationService"),DRt=ae("testingPeekOpener"),kRt="timeline",det=ae(kRt),Zde=ae("webviewService"),kQ=ae("webviewEditorService"),het=ae("webviewViewService"),IRt=ae("walkthroughsService"),LRt=ae("activityService"),uet=ae("IAiEmbeddingVectorService"),PPe=ae("IAiRelatedInformationService"),get=ae("WorkbenchAssignmentService"),ehe=ae("IAuthenticationAccessService"),fet=ae("IAuthenticationUsageService"),FPe=ae("IAuthenticationService"),pet=ae("IAuthenticationExtensionsService"),met=ae("auxiliaryWindowService"),TRt=ae("bannerService"),dL=ae("jsonEditingService"),_et=ae("configurationResolverService"),rD=ae("IFileDecorationsService"),aD=ae("ICustomEditorLabelService"),ur=ae("editorGroupsService"),vet=ae("editorPaneService"),Pz=ae("editorResolverService"),_i=ae("editorService"),Fz=ae("IExtensionBisectService"),wet=ae("IExtensionFeaturesManagementService"),RRt=Rz,Mw=ae("extensionManagementServerService"),the=RRt,Kh=ae("extensionEnablementService"),OPe=ae("IWebExtensionsScannerService"),bet=ae("extensionRecommendationsService"),ihe=ae("IExtensionIgnoredRecommendationsService"),MRt=ae("IWorkspaceExtensionsConfigService"),Cet=ae("extensionUrlHandler"),G_=ae("extensionManifestPropertiesService"),ho=ae("extensionService"),IQ=ae("elevatedFileService"),hh=ae("filesConfigurationService"),NRt=ae("historyService"),Id=ae("hostService"),PRt=ae("ITroubleshootIssueService"),FRt=ae("workbenchIssueService");class ORt{constructor(e,t){this._mapAltGrToCtrlAlt=e,this._OS=t}dumpDebugInfo(){return"FallbackKeyboardMapper dispatching on keyCode"}resolveKeyboardEvent(e){const t=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,i=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,s=new RS(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new l$([s]))[0]}resolveKeybinding(e){return XU.resolveKeybinding(e,this._OS)}}const BRt=ae("keybindingEditingService"),LQ=ae("ILanguageDetectionService"),BPe=ae("ILanguageStatusService"),mg=ae("lifecycleService");var PI;(function(n){n[n.CLOSE=1]="CLOSE",n[n.QUIT=2]="QUIT",n[n.RELOAD=3]="RELOAD",n[n.LOAD=4]="LOAD"})(PI||(PI={}));var $$;(function(n){n[n.NewWindow=1]="NewWindow",n[n.ReloadedWindow=3]="ReloadedWindow",n[n.ReopenedWindow=4]="ReopenedWindow"})($$||($$={}));var Us;(function(n){n[n.Starting=1]="Starting",n[n.Ready=2]="Ready",n[n.Restored=3]="Restored",n[n.Eventually=4]="Eventually"})(Us||(Us={}));function WRt(n){switch(n){case Us.Starting:return"Starting";case Us.Ready:return"Ready";case Us.Restored:return"Restored";case Us.Eventually:return"Eventually"}}var D3,hN;let GCe=(hN=class extends ${get startupKind(){return this._startupKind}get phase(){return this._phase}constructor(e,t){super(),this.logService=e,this.storageService=t,this._onBeforeShutdown=this._register(new I),this.onBeforeShutdown=this._onBeforeShutdown.event,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this._onBeforeShutdownError=this._register(new I),this.onBeforeShutdownError=this._onBeforeShutdownError.event,this._onShutdownVeto=this._register(new I),this.onShutdownVeto=this._onShutdownVeto.event,this._phase=Us.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this.storageService.store(D3.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,ke.WORKSPACE,ln.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??$$.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);this.storageService.remove(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);let t;switch(e){case PI.RELOAD:t=$$.ReloadedWindow;break;case PI.LOAD:t=$$.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Cn.toKey(i.identifier)]=s)}return t}_readActivationEvents(e){if(typeof e.main>"u"&&typeof e.browser>"u")return[];const t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let i=0;ie)throw new Error(`ExtensionHostExtensions: invalid versionId ${e} (current: ${this._versionId})`);const s=[],o=[],r=[],a=[],c=VVe(this._allExtensions),l=VVe(t),d=(m,v)=>m.extensionLocation.toString()===v.extensionLocation.toString()||m.isBuiltin===v.isBuiltin||m.isUserBuiltin===v.isUserBuiltin||m.isUnderDevelopment===v.isUnderDevelopment;for(const m of this._allExtensions){const v=l.get(m.identifier);if(!v){s.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){s.push(m.identifier),c.delete(m.identifier);continue}}for(const m of t){const v=c.get(m.identifier);if(!v){o.push(m);continue}if(!d(v,m)){s.push(v.identifier),c.delete(v.identifier);continue}}const h=new $v(this._myExtensions),u=new $v(i);for(const m of this._myExtensions)u.has(m)||r.push(m);for(const m of i)h.has(m)||a.push(m);const f=QW.createActivationEventsMap(o),p={versionId:e,toRemove:s,toAdd:o,addActivationEvents:f,myToRemove:r,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:s,myToAdd:o}=e,r=new $v(t),a=new $v(s);for(let c=0;csetTimeout(e,n))}function bMt(n,e,t){let i=Promise.resolve(),s=null;return async o=>{s==null?(s=o,i=i.then(async()=>wMt(t)).then(async()=>{const r=s;s=null,await n(r)})):s=e(s,o),await i}}var AK;ce(wp,class extends IYe{constructor(){super(Pn.Info,P.file("logs.log"))}doCreateLogger(){return new LYe}},0);ce(_i,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=T.None,this.onDidActiveEditorChange=T.None,this.onDidVisibleEditorsChange=T.None,this.onDidEditorsChange=T.None,this.onDidCloseEditor=T.None,this.activeEditorPane=void 0,this.activeEditor=void 0,this.activeTextEditorLanguageId=void 0,this.visibleEditorPanes=[],this.visibleEditors=[],this.visibleTextEditorControls=[],this.editors=[],this.count=0,this.getEditors=()=>[],this.openEditor=A,this.openEditors=A,this.replaceEditors=async()=>{},this.isOpened=()=>!1,this.isVisible=()=>!1,this.closeEditor=async()=>{},this.closeEditors=async()=>{},this.findEditors=()=>[],this.save=async()=>({success:!1,editors:[]}),this.saveAll=async()=>({success:!1,editors:[]}),this.revert=async()=>!1,this.revertAll=async()=>!1}get activeTextEditorControl(){return Lt.get(jt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Nw,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=T.None,this.onDidPaneCompositeClose=T.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=A,this.showActivity=()=>$.None}},0);ce(_o,zCe,1);ce(tr,class{constructor(){this.isDirty=A,this.save=A,this.saveAs=A,this.revert=A,this.read=A,this.readStream=A,this.write=A,this.create=A,this.getEncodedReadable=A,this.getDecodedStream=A,this.dispose=A}get files(){return A()}get untitled(){return A()}get encoding(){return A()}},0);ce(ci,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=T.None,this.onDidChangeFileSystemProviderCapabilities=T.None,this.onWillActivateFileSystemProvider=T.None,this.registerProvider=A,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=T.None,this.onDidRunOperation=T.None,this.resolve=A,this.resolveAll=A,this.stat=A,this.exists=async()=>!1,this.readFile=A,this.readFileStream=A,this.writeFile=A,this.move=A,this.canMove=A,this.copy=A,this.canCopy=A,this.cloneFile=A,this.createFile=A,this.canCreateFile=A,this.createFolder=A,this.del=A,this.canDelete=A,this.onDidWatchError=T.None,this.watch=A,this.createWatcher=A}dispose(){}},0);let CMt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=A,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=A,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=A,this.notifyIndexChanged=A,this.relayout=A,this.dispose=A,this.toJSON=A,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=A,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=A,this.openEditor=A,this.openEditors=A,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=A,this.moveEditors=A,this.copyEditor=A,this.copyEditors=A,this.closeEditor=A,this.closeEditors=A,this.closeAllEditors=A,this.replaceEditors=A,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=A,this.isLast=A}get groupsView(){return A()}notifyLabelChanged(){}get titleHeight(){return A()}get element(){return A()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}};const dte=new CMt;let yMt=class{constructor(){this.windowId=yi.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=A,this.isLayoutCentered=A,this.enforcePartOptions=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.applyLayout=A,this.getLayout=A,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=A}get contentDimension(){return A()}get sideGroup(){return A()}},SMt=class{constructor(){this.registerContextKeyProvider=A,this.saveWorkingSet=A,this.getWorkingSets=A,this.applyWorkingSet=A,this.deleteWorkingSet=A,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new yMt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=A,this.createAuxiliaryEditorPart=A,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.partOptions=Kde,this.createEditorDropTarget=A,this._serviceBrand=void 0,this.getLayout=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.applyLayout=A,this.centerLayout=A,this.isLayoutCentered=()=>!1,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=A}get contentDimension(){return A()}get sideGroup(){return A()}};ce(ur,SMt,0);ce(TRt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(zRt,class{constructor(){this.getPart=A,this.createAuxiliaryTitlebarPart=A,this.dispose=A,this.onMenubarVisibilityChange=T.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=T.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(fC,class{constructor(){this.onWillRunWorkingCopyFileOperation=T.None,this.onDidFailWorkingCopyFileOperation=T.None,this.onDidRunWorkingCopyFileOperation=T.None,this.addFileOperationParticipant=A,this.hasSaveParticipants=!1,this.addSaveParticipant=A,this.runSaveParticipants=A,this.create=A,this.createFolder=A,this.move=A,this.copy=A,this.delete=A,this.registerWorkingCopyProvider=A,this.getDirty=()=>[]}},0);ce(Tm,class{constructor(){this.defaultUriScheme="file",this.fileURI=A,this.userHome=A,this.hasValidBasename=A,this.resolvedUserHome=void 0}get path(){return A()}},1);ce(Xa,class{constructor(){this._serviceBrand=void 0,this.version="1.90.2",this.commit="5437499feb04f7a586f677b155b039bc2b3669eb",this.quality="oss",this.nameShort="Code - OSS Dev",this.nameLong="Code - OSS Dev",this.applicationName="code-oss",this.dataFolderName=".vscode-oss",this.urlProtocol="code-oss",this.reportIssueUrl="https://github.com/microsoft/vscode/issues/new",this.licenseName="MIT",this.licenseUrl="https://github.com/microsoft/vscode/blob/main/LICENSE.txt",this.serverApplicationName="code-server-oss"}},0);ce(dTt,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(BPe,class{constructor(){this.onDidChange=T.None,this.addStatus=A,this.getLanguageStatus=A}},1);ce(Id,class{constructor(){this.onDidChangeFullScreen=T.None,this.onDidChangeFocus=T.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=A,this.onDidChangeActiveWindow=T.None,this.openWindow=A,this.toggleFullScreen=A,this.moveTop=A,this.getCursorScreenPoint=A,this.restart=A,this.reload=A,this.close=A,this.withExpectedShutdown=A}},0);ce(mg,class extends GCe{constructor(){super(...arguments),this.shutdown=A}},0);ce(LQ,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(ho,dMt,0);ce(fTt,class{constructor(){this.onDidChangeKeyboardLayout=T.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new ORt(!1,$c),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(ahe,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(xet,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=T.None}},0);let qCe=class{constructor(e){this.profileService=e,this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=A,this.createPreferencesEditorModel=A,this.resolveModel=A,this.createSettings2EditorModel=A,this.openRawDefaultSettings=A,this.openSettings=A,this.openUserSettings=A,this.openRemoteSettings=A,this.openWorkspaceSettings=A,this.openFolderSettings=A,this.openGlobalKeybindingSettings=A,this.openDefaultKeybindingsFile=A,this.getEditableSettingsURI=A,this.createSplitJsonEditorInput=A,this.openApplicationSettings=A,this.openLanguageSpecificSettings=A}};qCe=D([_(0,Rm)],qCe);ce(TQ,qCe,0);ce(VRt,class{constructor(){this.onDidEncounterLanguage=T.None,this.createGrammar=A,this.startDebugMode=A,this.createTokenizer=A}},0);let QCe=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=T.None,this.isEnabled=()=>!1,this.createNamedProfile=A,this.createTransientProfile=A,this.resetWorkspaces=A,this.cleanUp=A,this.cleanUpTransientProfiles=A,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=T.None,this.profiles=[this.profileService.currentProfile],this.createProfile=A,this.updateProfile=A,this.setProfileForWorkspace=A,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=A}get profilesHome(){return A()}};QCe=D([_(0,Rm)],QCe);ce(V_,QCe,0);ce(uMt,class{constructor(){this.onDidChange=T.None,this.readStorageData=A,this.updateStorageData=A,this.withProfileScopedStorageService=A}},0);let jCe=class extends KRt{constructor(e){super({...S3("__default__profile__","Default",e.userRoamingDataHome,Qt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};jCe=D([_(0,Il)],jCe);ce(Rm,jCe,0);ce(oPe,TZe,0);ce($_,class{constructor(){this.getSnippetFiles=A,this.isEnabled=A,this.updateEnablement=A,this.updateUsageTimestamp=A,this.getSnippets=async()=>[],this.getSnippetsSync=A}},0);const AMt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:T.None,onDidChangeCallStack:T.None,onDidChangeWatchExpressions:T.None,fetchCallstack:A,getId:A,registerBreakpointModes:A,getBreakpointModes:()=>[]};class EMt{constructor(){this.setVisualizedExpression=A,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=T.None,this.getId=A,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=A,this.setSelectedExpression=A,this.updateViews=A,this.isMultiSessionView=A,this.onDidFocusSession=T.None,this.onDidFocusStackFrame=T.None,this.onDidSelectExpression=T.None,this.onDidEvaluateLazyExpression=T.None,this.onWillUpdateViews=T.None,this.onDidFocusThread=T.None,this.evaluateLazyExpression=A}}class xMt{constructor(){this.onDidRegisterDebugger=T.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=A,this.getDebuggerLabel=A,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=A,this.registerDebugAdapterFactory=()=>$.None,this.createDebugAdapter=A,this.registerDebugAdapterDescriptorFactory=A,this.unregisterDebugAdapterDescriptorFactory=A,this.substituteVariables=A,this.runInTerminal=A,this.getEnabledDebugger=A,this.guessDebugger=A,this.onDidDebuggersExtPointRead=T.None}}ce(LPe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=A,this.updateDataBreakpoint=A,this.onDidChangeState=T.None,this.onDidNewSession=T.None,this.onWillNewSession=T.None,this.onDidEndSession=T.None,this.getConfigurationManager=A,this.getAdapterManager=()=>new xMt,this.focusStackFrame=A,this.canSetBreakpointsIn=A,this.addBreakpoints=A,this.updateBreakpoints=A,this.enableOrDisableBreakpoints=A,this.setBreakpointsActivated=A,this.removeBreakpoints=A,this.addFunctionBreakpoint=A,this.updateFunctionBreakpoint=A,this.removeFunctionBreakpoints=A,this.addDataBreakpoint=A,this.removeDataBreakpoints=A,this.addInstructionBreakpoint=A,this.removeInstructionBreakpoints=A,this.setExceptionBreakpointCondition=A,this.setExceptionBreakpointsForSession=A,this.sendAllBreakpoints=A,this.addWatchExpression=A,this.renameWatchExpression=A,this.moveWatchExpression=A,this.removeWatchExpressions=A,this.startDebugging=A,this.restartSession=A,this.stopSession=A,this.sourceIsNotAvailable=A,this.getModel=()=>AMt,this.getViewModel=()=>new EMt,this.runTo=A}get state(){return A()}},0);ce(EQ,class{constructor(){this.request=A,this.resolveProxy=A,this.loadCertificates=A}},0);ce(Ade,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=T.None,this.completeOpenFilesTrustRequest=A,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=A,this.completeWorkspaceTrustRequest=A,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(LRt,class{constructor(){this.onDidChangeActivity=T.None,this.getViewContainerActivities=A,this.getActivity=A,this.showViewContainerActivity=()=>$.None,this.showViewActivity=()=>$.None,this.showAccountsActivity=()=>$.None,this.showGlobalActivity=()=>$.None}},0);ce(kZe,class{constructor(){this.reload=A,this.onReload=T.None,this.close=A,this.onClose=T.None,this.attachSession=A,this.onAttachSession=T.None,this.terminateSession=A,this.onTerminateSession=T.None,this.openExtensionDevelopmentHostWindow=A}},0);ce(q_,class{constructor(){this.getFocusedViewName=A,this.onDidChangeFocusedView=T.None,this.onDidChangeViewContainerVisibility=T.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=A,this.closeViewContainer=A,this.getVisibleViewContainer=A,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=T.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=A,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(z_,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=T.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=A,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=A,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:T.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=T.None,this.moveViewContainerToLocation=A,this.getViewContainerBadgeEnablementState=A,this.setViewContainerBadgeEnablementState=A,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=T.None,this.moveViewsToContainer=A,this.onDidChangeLocation=T.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(NRt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=A,this.goBack=A,this.goPrevious=A,this.goLast=A,this.reopenLastClosedEditor=A,this.getHistory=()=>[],this.removeFromHistory=A,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=A,this.openPreviouslyUsedEditor=A,this.clear=A,this.clearRecentlyOpened=A}},0);ce(XZe,class{constructor(){this.onDidChangeTaskConfig=T.None,this.onDidStateChange=T.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=A,this.run=A,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=A,this.terminate=A,this.tasks=A,this.taskTypes=A,this.getWorkspaceTasks=A,this.getSavedTasks=A,this.removeRecentlyUsedTask=A,this.getTask=A,this.tryResolveTask=A,this.createSorter=A,this.getTaskDescription=A,this.customize=A,this.openConfig=A,this.registerTaskProvider=A,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=T.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=A,this.isReconnected=!1,this.onDidReconnectToTasks=T.None}},0);ce(_et,class{constructor(){this.resolveWithEnvironment=A,this.resolveAsync=A,this.resolveAnyAsync=A,this.resolveAnyMap=A,this.resolveWithInteractionReplace=A,this.resolveWithInteraction=A,this.contributeVariable=A}},0);ce(Sf,class{constructor(){this.getConnection=()=>null,this.getEnvironment=async()=>null,this.getRawEnvironment=async()=>null,this.getExtensionHostExitInfo=async()=>null,this.getRoundTripTime=async()=>{},this.whenExtensionsReady=async()=>{},this.scanExtensions=async()=>[],this.scanSingleExtension=async()=>null,this.getDiagnosticInfo=async()=>{},this.updateTelemetryLevel=async()=>{},this.logTelemetry=async()=>{},this.flushTelemetry=async()=>{}}},0);ce(Igt,mTt,0);let KCe=class{constructor(e){this.modelService=e,this.aiTextSearch=A,this.textSearchSplitSyncAsync=A,this.registerSearchResultProvider=A}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};KCe=D([_(0,Ai)],KCe);ce(ohe,KCe,0);ce(EPe,class{constructor(){this.registerEditSessionIdentityProvider=()=>$.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>$.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce($S,class{constructor(){this.addFolders=A,this.removeFolders=A,this.updateFolders=A,this.enterWorkspace=A,this.createAndEnterWorkspace=A,this.saveAndEnterWorkspace=A,this.copyWorkspaceSettings=A,this.pickNewWorkspacePath=A}},0);ce(Det,class{constructor(){this.getStartTime=A,this.whenReady=A,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=A,this.getDuration=A}get perfBaseline(){return A()}get startupMetrics(){return A()}},0);ce(pr,class{constructor(){this.getResourceExtensions=A,this.updateRunningExtensions=A,this.togglePreRelease=A,this.isAutoUpdateEnabledFor=A,this.updateAutoUpdateEnablementFor=A,this.isAutoUpdateEnabled=A,this.getAutoUpdateValue=A,this.updateAll=A,this.toggleApplyExtensionToAllProfiles=A,this.whenInitialized=Promise.resolve(),this.onChange=T.None,this.onReset=T.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=A,this.queryGallery=A,this.getExtensions=A,this.canInstall=A,this.install=A,this.installInServer=A,this.uninstall=A,this.installVersion=A,this.reinstall=A,this.canSetLanguage=A,this.setLanguage=A,this.setEnablement=A,this.pinExtension=A,this.open=A,this.checkForUpdates=A,this.getExtensionStatus=A,this.isExtensionIgnoredToSync=A,this.toggleExtensionIgnoredToSync=A}},0);ce(Mw,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=A,this.getExtensionInstallLocation=A}},0);ce(bet,class{constructor(){this.onDidChangeRecommendations=T.None,this.getAllRecommendationsWithReason=()=>({}),this.getImportantRecommendations=async()=>[],this.getOtherRecommendations=async()=>[],this.getFileBasedRecommendations=()=>[],this.getExeBasedRecommendations=async()=>({important:[],others:[]}),this.getConfigBasedRecommendations=async()=>({important:[],others:[]}),this.getWorkspaceRecommendations=async()=>[],this.getKeymapRecommendations=()=>[],this.getLanguageRecommendations=()=>[],this.getRemoteRecommendations=()=>[]}},0);ce(NTt,class{constructor(){this.onError=T.None,this.turnOn=A,this.turnOff=A,this.triggerSync=A}},0);ce(kTt,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=A,this.updateSynchronizedExtensions=A}},0);ce(uTt,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=A,this.promptWorkspaceRecommendations=A}},0);ce(OPe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=A,this.addExtensionFromGallery=A,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=A,this.scanExtensionManifest=async()=>null}},0);ce(hTt,class{constructor(){this.onDidChangeCache=T.None,this.getTargetPlatform=A,this.scanAllExtensions=A,this.scanSystemExtensions=A,this.scanUserExtensions=A,this.scanExtensionsUnderDevelopment=A,this.scanExistingExtension=A,this.scanOneOrMultipleExtensions=A,this.scanMultipleExtensions=A,this.scanMetadata=A,this.updateMetadata=A,this.initializeDefaultProfileExtensions=A}get systemExtensionsLocation(){return A()}get userExtensionsLocation(){return A()}},0);ce($de,class{constructor(){this.onAddExtensions=T.None,this.onDidAddExtensions=T.None,this.onRemoveExtensions=T.None,this.onDidRemoveExtensions=T.None,this.scanProfileExtensions=A,this.addExtensionsToProfile=A,this.updateMetadata=A,this.removeExtensionFromProfile=A}},0);ce(ihe,class{constructor(){this.onDidChangeIgnoredRecommendations=T.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=T.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=A}},0);ce(MRt,class{constructor(){this.onDidChangeExtensionsConfigs=T.None,this.getExtensionsConfigs=A,this.getRecommendations=A,this.getUnwantedRecommendations=A,this.toggleRecommendation=A,this.toggleUnwantedRecommendation=A}},0);ce(Kh,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=T.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=A,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=A}},0);ce(Qde,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=T.None,this.onTunnelClosed=T.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=T.None,this.canTunnel=()=>!1,this.openTunnel=A,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=A,this.closeTunnel=A,this.setTunnelProvider=A,this.setTunnelFeatures=A,this.isPortPrivileged=()=>!1}},0);ce(hh,class{constructor(){this.onDidChangeAutoSaveConfiguration=T.None,this.onDidChangeAutoSaveDisabled=T.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=A,this.onDidChangeReadonly=T.None,this.onDidChangeFilesAssociation=T.None,this.onAutoSaveConfigurationChange=T.None,this.getAutoSaveConfiguration=A,this.getAutoSaveMode=A,this.toggleAutoSave=A,this.onReadonlyChange=T.None,this.isReadonly=A,this.updateReadonly=A,this.onFilesAssociationChange=T.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=A}},0);ce(RQ,class{constructor(){this.onDidCreate=T.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=T.None,this.onDidChangeEncoding=T.None,this.onDidChangeLabel=T.None,this.onWillDispose=T.None,this.create=A,this.get=()=>{},this.getValue=()=>{},this.resolve=A}},0);ce(MQ,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Pw,class{constructor(){this.onDidRegister=T.None,this.onDidUnregister=T.None,this.onDidChangeDirty=T.None,this.onDidChangeContent=T.None,this.onDidSave=T.None,this.dirtyCount=0,this.dirtyWorkingCopies=[],this.modifiedCount=0,this.modifiedWorkingCopies=[],this.hasDirty=!1,this.isDirty=()=>!1,this.workingCopies=[],this.has=()=>!1,this.get=()=>{},this.getAll=()=>{}}registerWorkingCopy(){return $.None}},0);ce(rD,class{constructor(){this.onDidChangeDecorations=T.None,this.registerDecorationsProvider=A,this.getDecoration=()=>{}}},0);ce(IQ,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=A}},0);ce(bf,class{constructor(){this.preferredHome=A,this.defaultFilePath=A,this.defaultFolderPath=A,this.defaultWorkspacePath=A,this.pickFileFolderAndOpen=A,this.pickFileAndOpen=A,this.pickFolderAndOpen=A,this.pickWorkspaceAndOpen=A,this.pickFileToSave=A,this.showSaveDialog=A,this.showSaveConfirm=A,this.showOpenDialog=A}},0);ce(dL,class{constructor(){this.write=A}},1);ce(cL,class{constructor(){this.enterWorkspace=A,this.createUntitledWorkspace=A,this.deleteUntitledWorkspace=A,this.getWorkspaceIdentifier=A,this.onDidChangeRecentlyOpened=T.None,this.addRecentlyOpened=A,this.removeRecentlyOpened=A,this.clearRecentlyOpened=A,this.getRecentlyOpened=A,this.getDirtyWorkspaces=A}},1);ce(rhe,class{constructor(){this.createTextEditor=A,this.resolveTextEditor=A}},0);ce(Pz,class{constructor(){this.getAllUserAssociations=A,this.getAssociationsForResource=A,this.updateUserAssociations=A,this.onDidChangeEditorRegistrations=T.None,this.bufferChangeEvents=A,this.resolveEditor=A,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(nhe,class{constructor(){this.onActiveOutputChannel=T.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(uRt,class{constructor(){this.createOutputChannelModel=A}},1);ce(CPe,class{constructor(){this.readExtensionResource=A,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=A}},0);ce(gTt,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(Sp,class{constructor(){this.roots=[],this.getContext=A,this.hasViewFocus=A,this.setEditable=A,this.getEditable=A,this.getEditableData=A,this.isEditable=A,this.findClosest=A,this.findClosestRoot=A,this.refresh=A,this.setToCopy=A,this.isCut=A,this.applyBulkEdit=A,this.select=A,this.registerView=A}get sortOrderConfiguration(){return A()}},1);ce(B7,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=A,this.onDidChangeExtensionStorageToSync=T.None,this.setKeysForSync=A,this.getKeysForSync=()=>{},this.addToMigrationList=A,this.getSourceExtensionToMigrate=()=>{}}},1);ce(IZe,class{constructor(){this.onDidChangeEnablement=T.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(LZe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=_Mt(t)?.[e];return i!=null?P.parse(i):void 0}},1);ce(zde,class{constructor(){this.removeDragOperationTransfer=A,this.addDragOperationTransfer=A}},1);ce(eRt,class{constructor(){this.register=A,this.getWidget=()=>{}}},0);ce(Eet,class{constructor(){this.onDidChange=T.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=A}},0);ce(NZe,class{constructor(){this.onStateChange=T.None,this.state=DTt.Uninitialized,this.checkForUpdates=A,this.downloadUpdate=A,this.applyUpdate=A,this.quitAndInstall=A,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=A}},0);ce(xPe,class{constructor(){this.getPart=A,this.createAuxiliaryStatusbarPart=A,this.createScoped=A,this.dispose=A,this.onDidChangeEntryVisibility=T.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>$.None}},0);ce(aL,class{constructor(){this.isEnabled=()=>!1,this.query=A,this.getExtensions=A,this.isExtensionCompatible=A,this.getCompatibleExtension=A,this.getAllCompatibleVersions=A,this.download=A,this.downloadSignatureArchive=A,this.reportStatistic=A,this.getReadme=A,this.getManifest=A,this.getChangelog=A,this.getCoreTranslation=A,this.getExtensionsControlManifest=A}},0);ce(Nz,class{constructor(){this.onAnyInstanceData=T.None,this.moveIntoNewEditor=A,this.detachedInstances=[],this.onAnyInstanceDataInput=T.None,this.onAnyInstanceIconChange=T.None,this.onAnyInstanceMaximumDimensionsChange=T.None,this.onAnyInstancePrimaryStatusChange=T.None,this.onAnyInstanceProcessIdReady=T.None,this.onAnyInstanceSelectionChange=T.None,this.onAnyInstanceTitleChange=T.None,this.createDetachedTerminal=A,this.onDidChangeSelection=T.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=A,this.instances=[],this.revealActiveTerminal=A,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=fV.Panel,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidCreateInstance=T.None,this.onDidReceiveProcessId=T.None,this.onDidChangeInstanceDimensions=T.None,this.onDidMaximumDimensionsChange=T.None,this.onDidRequestStartExtensionTerminal=T.None,this.onDidChangeInstanceTitle=T.None,this.onDidChangeInstanceIcon=T.None,this.onDidChangeInstanceColor=T.None,this.onDidChangeInstancePrimaryStatus=T.None,this.onDidInputInstanceData=T.None,this.onDidRegisterProcessSupport=T.None,this.onDidChangeConnectionState=T.None,this.createTerminal=A,this.getInstanceFromId=A,this.getInstanceFromIndex=A,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=A,this.moveToEditor=A,this.moveToTerminalView=A,this.getPrimaryBackend=A,this.refreshActiveGroup=A,this.registerProcessSupport=()=>{},this.showProfileQuickPick=A,this.setContainers=A,this.requestStartExtensionTerminal=A,this.isAttachedToTerminal=A,this.getEditableData=A,this.setEditable=A,this.isEditable=A,this.safeDisposeTerminal=A,this.getDefaultInstanceHost=A,this.getInstanceHost=A,this.resolveLocation=A,this.setNativeDelegate=A,this.toggleEscapeSequenceLogging=A,this.getEditingTerminal=A,this.setEditingTerminal=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}createOnInstanceCapabilityEvent(){return{event:T.None,dispose(){}}}createOnInstanceEvent(e){return new blt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return A()}},1);ce(bRt,class{constructor(){this.onConfigChanged=T.None,this.setPanelContainer=A,this.configFontIsMonospace=A,this.getFont=A}get config(){return A()}},1);ce(ZZe,class{constructor(){this.instances=[],this.openEditor=A,this.detachActiveEditorInstance=A,this.detachInstance=A,this.splitInstance=A,this.revealActiveEditor=A,this.resolveResource=A,this.reviveInput=A,this.getInputFromResource=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(NPe,class{constructor(){this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidChangeGroups=T.None,this.onDidShow=T.None,this.onDidChangePanelOrientation=T.None,this.createGroup=A,this.getGroupForInstance=A,this.moveGroup=A,this.moveGroupToEnd=A,this.moveInstance=A,this.unsplitInstance=A,this.joinInstances=A,this.instanceIsSplit=A,this.getGroupLabels=A,this.setActiveGroupByIndex=A,this.setActiveGroupToNext=A,this.setActiveGroupToPrevious=A,this.setActiveInstanceByIndex=A,this.setContainer=A,this.showPanel=A,this.hidePanel=A,this.focusTabs=A,this.focusHover=A,this.showTabs=A,this.updateVisibility=A,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(eet,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=T.None,this.convertProfileToShellLaunchConfig=A,this.createInstance=A,this.getBackend=A,this.didRegisterBackend=A}},1);ce(net,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=A,this.refreshAvailableProfiles=A,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=T.None,this.getContributedDefaultProfile=A,this.registerContributedProfile=A,this.getContributedProfileProvider=A,this.registerTerminalProfileProvider=A}},1);ce(xTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(set,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=T.None,this.onDidRemoveLinkProvider=T.None,this.registerLinkProvider=A}},1);ce(CRt,class{constructor(){this.terminalProfiles=[]}},1);ce(iet,class{constructor(){this.resolveIcon=A,this.resolveShellLaunchConfig=A,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=A,this.getDefaultShellArgs=A,this.getDefaultIcon=A,this.getEnvironment=A,this.createProfileFromShellAndShellArgs=A}},1);ce(tet,class{constructor(){this.collections=new Map,this.onDidChangeCollections=T.None,this.set=A,this.delete=A}get mergedCollection(){return A()}},1);ce(oet,class{constructor(){this.onDidRegisterProvider=T.None,this.onDidRegisterCommandSelector=T.None,this.onDidUnregisterProvider=T.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=A,this.registerCommandSelector=A}},1);ce(Rz,class{constructor(){this.toggleAppliationScope=async e=>e,this.installGalleryExtensions=A,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installFromLocation=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=async()=>[],this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(YRt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=T.None,this.turnOn=A,this.turnoff=A,this.signIn=A,this.resetSyncedData=A,this.showSyncActivity=A,this.syncNow=A,this.synchroniseUserDataSyncStoreType=A,this.showConflicts=A,this.accept=A,this.getAllLogResources=A,this.downloadSyncActivity=A}},1);ce(PZe,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=A,this.onDidChangeResourceEnablement=T.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=A,this.getResourceSyncStateVersion=()=>{}}},1);ce(BRt,class{constructor(){this.addKeybinding=A,this.editKeybinding=A,this.removeKeybinding=A,this.resetKeybinding=A}},1);ce(gRt,class{constructor(){this.getLocalSearchProvider=A,this.getRemoteSearchProvider=A}},1);ce(oD,class{constructor(){this.canResolve=async()=>!1,this.onAddViewType=T.None,this.onWillRemoveViewType=T.None,this.onDidChangeOutputRenderers=T.None,this.onWillAddNotebookDocument=T.None,this.onDidAddNotebookDocument=T.None,this.onWillRemoveNotebookDocument=T.None,this.onDidRemoveNotebookDocument=T.None,this.registerNotebookSerializer=A,this.withNotebookDataProvider=A,this.getOutputMimeTypeInfo=A,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=A,this.updateMimePreferredRenderer=A,this.saveMimeDisplayOrder=A,this.createNotebookTextModel=A,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=A,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=A,this.getContributedNotebookType=A,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=A,this.getToCopy=A,this.clearEditorCache=A}},1);ce(fRt,class{constructor(){this.replace=A,this.openReplacePreview=A,this.updateReplacePreview=A}},1);ce(_Rt,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.load=A,this.save=A}},1);ce(xQ,class{constructor(){this.retrieveWidget=A,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=T.None,this.onDidRemoveNotebookEditor=T.None,this.addNotebookEditor=A,this.removeNotebookEditor=A,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(pRt,class{get searchModel(){return A()}},1);ce(Jde,class{constructor(){this.onDidSaveNotebook=T.None,this.onDidChangeDirty=T.None,this.onWillFailWithConflict=T.None,this.isDirty=A,this.resolve=A}},1);ce(Iet,class{constructor(){this.onDidRegisterHandler=T.None,this.registerHandler=()=>$.None,this.findEditor=()=>{}}},1);ce(WPe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=T.None,this.markActive=A}},1);ce(APe,class{constructor(){this.registerCanonicalUriProvider=A}},1);ce(DPe,class{constructor(){this.onDidChange=T.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(get,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Rw,class{constructor(){this.adoptRequest=A,this.isEnabled=()=>!1,this.resendRequest=A,this.onDidUnregisterProvider=T.None,this.clearAllHistoryEntries=A,this.onDidSubmitAgent=T.None,this.onDidRegisterProvider=T.None,this.hasSessions=()=>!1,this.onDidDisposeSession=T.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=T.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=A,this.registerProvider=A,this.registerSlashCommandProvider=A,this.getProviderInfos=()=>[],this.startSession=A,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=A,this.removeRequest=A,this.cancelCurrentRequestForSession=A,this.getSlashCommands=A,this.clearSession=A,this.addRequest=A,this.addCompleteRequest=A,this.sendRequestToProvider=A,this.getHistory=()=>[],this.removeHistoryEntry=A,this.onDidPerformUserAction=T.None,this.notifyUserAction=A}},1);ce(Ret,class{constructor(){this.update=A}},1);ce(tRt,class{constructor(){this.focused=!1,this.onDidClose=T.None,this.enabled=!1,this.toggle=A,this.focus=A,this.open=A,this.close=A,this.openInChatView=A}},1);ce(yp,class{constructor(){this._serviceBrand=void 0,this.registerAgentCompletionProvider=A,this.getAgentCompletionItems=A,this.getAgentByFullyQualifiedId=A,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=A,this.registerDynamicAgent=A,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=A,this.getDefaultAgent=A,this.getSecondaryAgent=A,this.updateAgent=A,this.onDidChangeAgents=T.None,this.registerAgentData=A,this.registerAgentCallback=A,this.registerAgent=A,this.invokeAgent=A,this.getAgents=A,this.getAgent=A,this.hasAgent=A}},1);ce(Yde,class{getAgentNameRestriction(){return!0}},1);ce(URt,class{constructor(){this.onDidCreateTerminal=T.None,this.createTerminal=A}},1);ce(IPe,class{constructor(){this.getCustomEditor=A,this.getAllCustomEditors=A,this.getContributedCustomEditors=A,this.getUserConfiguredCustomEditors=A,this.registerCustomEditorCapabilities=()=>$.None,this.getCustomEditorCapabilities=()=>{}}get models(){return A()}},1);ce(Zde,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=T.None,this.createWebviewElement=A,this.createWebviewOverlay=A}},1);ce(het,class{constructor(){this.onNewResolverRegistered=T.None,this.register=A,this.resolve=A}},1);ce(yet,class{constructor(){this.setLocale=A}clearLocalePreference(){return Promise.resolve()}},1);ce(kQ,class{constructor(){this.onDidChangeActiveWebviewEditor=T.None,this.openWebview=A,this.openRevivedWebview=A,this.revealWebview=A,this.registerResolver=()=>$.None,this.shouldPersist=A,this.resolveWebview=A}get iconManager(){return A()}},1);ce(rA,class{constructor(){this.onDidChangeConnectionData=T.None,this.resolveAuthority=A,this.getConnectionData=A,this.getCanonicalURI=A,this._clearResolvedAuthority=A,this._setResolvedAuthority=A,this._setResolvedAuthorityError=A,this._setAuthorityConnectionToken=A,this._setCanonicalURIProvider=A}},1);ce(VZe,class{constructor(){this.registerExternalOpenerProvider=()=>$.None,this.getOpener=async()=>{}}},1);ce(Tw,class{constructor(){this.configureKeybindings=A,this.openHelpLink=A,this.navigateToCodeBlock=A,this.getCodeBlockContext=()=>{},this.showLastProvider=A,this.showAccessibleViewHelp=A,this.goToSymbol=A,this.disableHint=A,this.next=A,this.previous=A,this.getOpenAriaHint=A,this.show=A,this.registerProvider=A,this.getPosition=A,this.setPosition=A,this.getLastPosition=A}},1);ce(hMt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(the,class{constructor(){this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=T.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=A,this.toggleAppliationScope=async e=>e,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidChangeProfile=T.None,this.installVSIX=A,this.installFromLocation=A,this.updateFromGallery=A,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installGalleryExtensions=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=A,this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(G_,class{constructor(){this.prefersExecuteOnUI=A,this.prefersExecuteOnWorkspace=A,this.prefersExecuteOnWeb=A,this.canExecuteOnUI=A,this.canExecuteOnWorkspace=A,this.canExecuteOnWeb=A,this.getExtensionKind=A,this.getUserConfiguredExtensionKind=A,this.getExtensionUntrustedWorkspaceSupportType=A,this.getExtensionVirtualWorkspaceSupportType=A}},1);ce(Sde,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Gde,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(jde,class{constructor(){this.create=A,this.open=async()=>!1,this.registerHandler=A}},1);ce(yPe,class{constructor(){this.register=A,this.connect=A}},1);ce(DQ,class{constructor(){this.onDidChangeQuickDiffProviders=T.None,this.addQuickDiffProvider=A,this.getQuickDiffs=A}},1);ce(MPe,class{constructor(){this.onDidChangeInputValueProviders=T.None,this.getDefaultInputValueProvider=A,this.registerSCMInputValueProvider=A,this.onDidAddRepository=T.None,this.onDidRemoveRepository=T.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=A,this.getRepository=A}},1);ce(bPe,class{constructor(){this.download=A}},1);ce(Cet,class{constructor(){this.registerExtensionHandler=A,this.unregisterExtensionHandler=A}},1);ce(sD,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=T.None,this.setActiveEditingCommentThread=A,this.setActiveCommentAndThread=A,this.onDidSetResourceCommentInfos=T.None,this.onDidSetAllCommentThreads=T.None,this.onDidUpdateCommentThreads=T.None,this.onDidUpdateNotebookCommentThreads=T.None,this.onDidChangeActiveCommentThread=T.None,this.onDidChangeCurrentCommentThread=T.None,this.onDidUpdateCommentingRanges=T.None,this.onDidChangeActiveCommentingRange=T.None,this.onDidSetDataProvider=T.None,this.onDidDeleteDataProvider=T.None,this.onDidChangeCommentingEnabled=T.None,this.isCommentingEnabled=!1,this.setDocumentComments=A,this.setWorkspaceComments=A,this.removeWorkspaceComments=A,this.registerCommentController=A,this.unregisterCommentController=()=>{},this.getCommentController=A,this.createCommentThreadTemplate=A,this.updateCommentThreadTemplate=A,this.getCommentMenus=A,this.updateComments=A,this.updateNotebookComments=A,this.disposeCommentThread=A,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=A,this.hasReactionHandler=A,this.toggleReaction=A,this.setActiveCommentThread=A,this.setCurrentCommentThread=A,this.enableCommenting=A,this.registerContinueOnCommentProvider=A,this.removeContinueOnComment=A}get commentsModel(){return A()}},1);ce(qZe,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeItems=T.None,this.registerCellStatusBarItemProvider=A,this.getStatusBarItemsForCell=A}},1);ce(jZe,class{constructor(){this.onDidNotebookVariablesUpdate=T.None,this.notifyVariablesChange=A,this.onDidAddKernel=T.None,this.onDidRemoveKernel=T.None,this.onDidChangeSelectedNotebooks=T.None,this.onDidChangeNotebookAffinity=T.None,this.registerKernel=A,this.getMatchingKernel=A,this.getSelectedOrSuggestedKernel=A,this.selectKernelForNotebook=A,this.preselectKernelForNotebook=A,this.updateKernelNotebookAffinity=A,this.onDidChangeKernelDetectionTasks=T.None,this.registerNotebookKernelDetectionTask=A,this.getKernelDetectionTasks=A,this.onDidChangeSourceActions=T.None,this.getSourceActions=A,this.getRunningSourceActions=A,this.registerKernelSourceActionProvider=A,this.getKernelSourceActions2=A}},1);ce(KZe,class{constructor(){this.onShouldPostMessage=T.None,this.prepare=A,this.getScoped=A,this.receiveMessage=A}},1);ce($Ze,class{constructor(){this.addToHistory=A,this.getPreviousValue=A,this.getNextValue=A,this.replaceLast=A,this.clearHistory=A,this.has=A}},1);ce(RPe,class{constructor(){this.onWillAddInteractiveDocument=T.None,this.onWillRemoveInteractiveDocument=T.None,this.willCreateInteractiveDocument=A,this.willRemoveInteractiveDocument=A}},1);ce(HRt,class{async getExtensionIdProvidingCurrentLocale(){return vMt()}},0);ce($Rt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=A}},0);ce(Fz,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=A,this.next=A,this.reset=A}},0);ce(OTt,class{constructor(){this.onTokenFailed=T.None,this.account=void 0,this.onDidChangeAccount=T.None}updateAccount(){return Promise.resolve()}},0);ce(lL,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=A,this.getWidgetByInputUri=A}},1);ce(she,class{constructor(){this.onDidChangeHelpInformation=T.None,this.onDidChangeTargetType=T.None,this.targetType=[],this.onDidChangeEditable=T.None,this.setEditable=A,this.getEditableData=A,this.forward=A,this.close=A,this.setTunnelInformation=A,this.setCandidateFilter=A,this.onFoundNewCandidates=A,this.restore=A,this.enablePortsFeatures=A,this.onEnabledPortsFeatures=T.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return A()}get tunnelModel(){return A()}},1);ce(FPe,class{constructor(){this.onDidRegisterAuthenticationProvider=T.None,this.onDidUnregisterAuthenticationProvider=T.None,this.onDidChangeSessions=T.None,this.onDidChangeDeclaredProviders=T.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=A,this.unregisterDeclaredAuthenticationProvider=A,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=A,this.unregisterAuthenticationProvider=A,this.getProviderIds=()=>[],this.getProvider=A,this.getSessions=A,this.createSession=A,this.removeSession=A}},1);ce(ehe,class{constructor(){this.onDidChangeExtensionSessionAccess=T.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=A,this.removeAllowedExtensions=A}},1);ce(pet,class{constructor(){this.updateSessionPreference=A,this.getSessionPreference=()=>{},this.removeSessionPreference=A,this.selectSession=A,this.requestSessionAccess=A,this.requestNewSession=A}},1);ce(fet,class{constructor(){this.readAccountUsages=A,this.removeAccountUsage=A,this.addAccountUsage=A}},1);ce(det,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeTimeline=T.None,this.onDidChangeUri=T.None,this.registerTimelineProvider=A,this.unregisterTimelineProvider=A,this.getSources=()=>[],this.getTimeline=A,this.setUri=A}},1);ce(cet,class{constructor(){this.registerExtHost=()=>$.None,this.provideTestFollowups=A,this.onDidCancelTestRun=T.None,this.onWillProcessDiff=T.None,this.onDidProcessDiff=T.None,this.registerTestController=A,this.getTestController=()=>{},this.refreshTests=A,this.cancelRefreshTests=A,this.startContinuousRun=A,this.runTests=A,this.runResolvedTests=A,this.syncTests=A,this.cancelTestRun=A,this.publishDiff=A}get excluded(){return A()}get collection(){return A()}get showInlineOutput(){return A()}},1);ce(RZe,class{constructor(){this.onDidChangeSecret=T.None,this.type="in-memory",this.get=async()=>{},this.set=A,this.delete=A}},1);ce(JZe,class{constructor(){this.registerShareProvider=A,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(ket,class{constructor(){this.resolveProfileTemplate=A,this.exportProfile2=A,this.createFromProfile=A,this.createProfile=A,this.editProfile=A,this.registerProfileContentHandler=A,this.unregisterProfileContentHandler=A,this.exportProfile=A,this.importProfile=A,this.showProfileContents=A,this.createFromCurrentProfile=A,this.createTroubleshootProfile=A,this.setProfile=A}},1);ce(FRt,class{constructor(){this.registerIssueDataProvider=A,this.openReporter=A,this.openProcessExplorer=A,this.registerIssueUriRequestHandler=A}},1);ce(gMt,class{constructor(){this.stopTracing=A,this.openReporter=A,this.openProcessExplorer=A,this.getSystemStatus=A,this.$getSystemInfo=A,this.$getPerformanceInfo=A,this.$reloadWithExtensionsDisabled=A,this.$showConfirmCloseDialog=A,this.$showClipboardDialog=A,this.$sendReporterMenu=A,this.$closeReporter=A}},1);ce(YZe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=T.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=T.None,this.isVisible=()=>!1,this.toggleVisibility=A,this.toggleSortKey=A,this.focusedRepository=void 0,this.onDidFocusRepository=T.None,this.focus=A}get menus(){return A()}},1);ce(QZe,class{constructor(){this.onDidChangeExecution=T.None,this.onDidChangeLastRunFailState=T.None,this.forceCancelNotebookExecutions=A,this.getCellExecutionsForNotebook=A,this.getCellExecutionsByHandleForNotebook=A,this.getCellExecution=A,this.createCellExecution=A,this.getExecution=A,this.createExecution=A,this.getLastFailedCellForNotebook=A}},1);ce(ret,class{constructor(){this.onDidChange=T.None,this.addProfile=A,this.updateProfile=A,this.removeProfile=A,this.capabilitiesForTest=A,this.configure=A,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=A,this.getControllerProfiles=()=>[]}},1);ce(lTt,class{constructor(){this.setUsePlainTextEncryption=A,this.getKeyStorageProvider=A,this.encrypt=A,this.decrypt=A,this.isEncryptionAvailable=A}},1);ce(aet,class{constructor(){this.onResultsChanged=T.None,this.onTestChanged=T.None,this.results=[],this.clear=A,this.createLiveResult=A,this.push=A,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(ARt,class{constructor(){this.read=A,this.persist=A}},1);ce(xRt,class{constructor(){this.onDidChange=T.None,this.invalidateResultMessage=A,this.syncDecorations=A,this.getDecoratedTestPosition=A}},1);ce(ahe,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(cTt,aTt,1);ce(mRt,class{notebookSearch(){return{openFilesToScan:new o1,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new o1)}}},1);ce(HZe,class{constructor(){this.selectLanguageModels=A,this.computeTokenLength=A,this.onDidChangeLanguageModels=T.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=A,this.makeLanguageModelChatRequest=A}},1);ce(kPe,class{constructor(){this.onDidChangeCommands=A,this.registerSlashData=A,this.registerSlashCallback=A,this.registerSlashCommand=A,this.executeCommand=A,this.getCommands=A,this.hasCommand=A}},1);ce(Mz,class{constructor(){this.attachContext=A,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=A,this.getDynamicReferences=A,this.registerVariable=A,this.getVariables=A,this.resolveVariables=A,this.hasVariable=A}},1);ce(PPe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=A,this.registerAiRelatedInformationProvider=A}},1);ce(uet,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=A,this.registerAiEmbeddingVectorProvider=A}},1);ce(MZe,(AK=class{async createNewMessage(e){return{id:String(AK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},AK._nextId=1,AK),1);ce(ERt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=T.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=A,this.stop=A}},1);ce(SRt,class{constructor(){this.onDidRequestInputFocus=T.None,this.focusInput=A,this.setText=A,this.isFilteringFor=()=>!1,this.toggleFilteringFor=A}get text(){return A()}get reveal(){return A()}get globList(){return A()}get includeTags(){return A()}get excludeTags(){return A()}get fuzzy(){return A()}},1);ce(DRt,class{constructor(){this.tryPeekFirstError=A,this.peekUri=A,this.openCurrentInEditor=A,this.open=A,this.closeAllPeeks=A}get historyVisible(){return A()}},1);ce(met,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=T.None,this.hasWindow=()=>!1,this.open=A}},1);ce(Xde,class{constructor(){this.onDidStartTextToSpeechSession=T.None,this.onDidEndTextToSpeechSession=T.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=A,this.onDidChangeHasSpeechProvider=T.None,this.onDidStartSpeechToTextSession=T.None,this.onDidEndSpeechToTextSession=T.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=T.None,this.onDidEndKeywordRecognition=T.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=A,this.onDidRegisterSpeechProvider=T.None,this.onDidUnregisterSpeechProvider=T.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=A,this.createSpeechToTextSession=A}},1);ce(yRt,class{constructor(){this.openCoverage=A,this.closeCoverage=A}get filterToTest(){return A()}get selected(){return A()}},1);ce(BZe,class{constructor(){this.acceptRequest=A,this.acceptResponse=A}},1);ce(WZe,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.getHistory=()=>[],this.saveHistory=A}},1);ce(iRt,class{constructor(){this.providers=[],this.registerProvider=A}},1);ce(TPe,class{constructor(){this.onDidMoveSession=T.None,this.onDidMoveSessio=T.None,this.onDidStashSession=T.None,this.moveSession=A,this.getCodeEditor=A,this.stashSession=A,this.onWillStartSession=T.None,this.onDidEndSession=T.None,this.createSession=A,this.getSession=()=>{},this.releaseSession=A,this.registerSessionKeyComputer=A,this.recordings=A,this.dispose=A}},1);ce(hRt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=A,this.canPromptRecommendation=async()=>!1}},1);ce(aRt,class{constructor(){this.getKernels=A,this.addMostRecentKernel=A}},1);ce(rRt,class{constructor(){this.executeNotebookCells=A,this.cancelNotebookCells=A,this.cancelNotebookCellHandles=A,this.registerExecutionParticipant=A}},1);ce(cRt,class{},1);ce(lRt,class{constructor(){this.info=A,this.debug=A}},1);ce(IRt,class{constructor(){this.onDidAddWalkthrough=T.None,this.onDidRemoveWalkthrough=T.None,this.onDidChangeWalkthrough=T.None,this.onDidProgressStep=T.None,this.getWalkthroughs=A,this.getWalkthrough=A,this.registerWalkthrough=A,this.progressByEvent=A,this.progressStep=A,this.deprogressStep=A,this.markWalkthroughOpened=A}},1);ce(ITt,class{constructor(){this.onDidChangeUserDataSyncStore=T.None,this.userDataSyncStore=void 0,this.switch=A,this.getPreviousUserDataSyncStore=A}},1);ce(LTt,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=T.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=T.None,this.onTokenSucceed=T.None,this.setAuthToken=A,this.manifest=A,this.readResource=A,this.writeResource=A,this.deleteResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A,this.getAllCollections=A,this.createCollection=A,this.deleteCollection=A,this.getActivityData=A,this.clear=A}},1);ce(FTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(RTt,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=T.None,this.conflicts=[],this.onDidChangeConflicts=T.None,this.onDidChangeLocal=T.None,this.onSyncErrors=T.None,this.onDidChangeLastSyncTime=T.None,this.onDidResetRemote=T.None,this.onDidResetLocal=T.None,this.createSyncTask=A,this.createManualSyncTask=A,this.resolveContent=A,this.accept=A,this.reset=A,this.resetRemote=A,this.cleanUpRemoteData=A,this.resetLocal=A,this.hasLocalData=A,this.hasPreviouslySynced=A,this.replace=A,this.saveRemoteActivityData=A,this.extractActivityData=A}},1);ce(BTt,class{constructor(){this.onDidChange=T.None,this.getMachines=A,this.addCurrentMachine=A,this.removeCurrentMachine=A,this.renameMachine=A,this.setEnablements=A}},1);ce(MTt,class{constructor(){this.getRemoteSyncedProfiles=A,this.getLocalSyncedProfiles=A,this.getRemoteSyncResourceHandles=A,this.getLocalSyncResourceHandles=A,this.getAssociatedResources=A,this.getMachineId=A,this.getLocalSyncedMachines=A,this.resolveContent=A,this.resolveUserDataSyncResource=A}},1);ce(TTt,class{constructor(){this.writeResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A}},1);ce(PTt,class{constructor(){this.resolveUserBindings=A,this.resolveFormattingOptions=A,this.resolveDefaultIgnoredSettings=A}},1);ce(GRt,class{constructor(){this.createAndEnterProfile=A,this.createAndEnterTransientProfile=A,this.removeProfile=A,this.updateProfile=A,this.switchProfile=A,this.getBuiltinProfileTemplates=A}},1);ce(JRt,class{constructor(){this.onDidAddEntry=T.None,this.onDidChangeEntry=T.None,this.onDidReplaceEntry=T.None,this.onDidRemoveEntry=T.None,this.onDidMoveEntries=T.None,this.onDidRemoveEntries=T.None,this.addEntry=A,this.updateEntry=A,this.removeEntry=A,this.moveEntries=A,this.getEntries=A,this.getAll=A,this.removeAll=A}},1);ce(zZe,class{constructor(){this.markChanged=A}},1);ce(Aet,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=A,this.removeNotebookDocument=A}},1);ce(UZe,class{constructor(){this.registerTree=A,this.getVisualizedNodeFor=A,this.getVisualizedChildren=A,this.editTreeItem=A,this.getApplicableFor=A,this.register=A}},1);ce(sRt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(nRt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=T.None,this.onDidSignOut=T.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=A,this.read=A,this.write=A,this.delete=A,this.list=A,this.getMachineById=A}},1);ce(GZe,class{constructor(){this.registerResolver=()=>$.None,this.resolve=async()=>{}}},1);ce(wRt,vRt,1);ce(wet,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!0,this.setEnablement=A,this.getEnablementData=A,this.getAccess=A,this.onDidChangeAccessData=T.None,this.getAccessData=()=>{},this.setStatus=A}},1);ce(vet,class{constructor(){this.onWillInstantiateEditorPane=T.None,this.didInstantiateEditorPane=()=>!1}},1);ce(XRt,class{constructor(){this.matches=A,this.getWorkspaceStateFolders=A}},1);ce(oRt,class{constructor(){this.onDidChangeDefaultLogLevels=T.None,this.getDefaultLogLevel=async()=>Pn.Off,this.getDefaultLogLevels=A,this.setDefaultLogLevel=A,this.migrateLogLevels=A}},1);ce(aD,class{constructor(){this.onDidChange=T.None,this.getName=()=>{}}},1);ce(PRt,class{constructor(){this.isActive=()=>!1,this.start=A,this.resume=A,this.stop=A}},1);ce(fMt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(lhe,class{isValid(){return!1}},1);const mV=Object.freeze({activeComment:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts",aiRelatedInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts",aiTextSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",attributableCoverage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts",authGetSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts",authLearnMore:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts",authSession:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts",canonicalUriProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts",chatParticipantAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts",chatParticipantPrivate:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",chatProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",chatTab:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts",chatVariableResolver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts",codeActionAI:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts",codeActionRanges:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",codiconDecoration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts",commentReactor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts",commentThreadApplicability:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts",commentingRangeHint:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts",commentsDraftState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts",contribAccessibilityHelpContent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts",contribCommentEditorActionsMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts",contribCommentPeekContext:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts",contribCommentThreadAdditionalMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts",contribCommentsViewThreadMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts",contribDiffEditorGutterToolBarMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts",contribEditSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts",contribEditorContentMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts",contribIssueReporter:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts",contribLabelFormatterWorkspaceTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts",contribMenuBarHome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts",contribMergeEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts",contribMultiDiffEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts",contribNotebookStaticPreloads:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts",contribRemoteHelp:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts",contribShareMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts",contribSourceControlHistoryItemGroupMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts",contribSourceControlHistoryItemMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts",contribSourceControlInputBoxMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts",contribSourceControlTitleMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts",contribStatusBarItems:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts",contribViewsRemote:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts",contribViewsWelcome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts",createFileSystemWatcher:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts",customEditorMove:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts",debugVisualization:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts",defaultChatParticipant:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",diffCommand:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts",diffContentOptions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts",documentFiltersExclusive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts",documentPaste:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts",editSessionIdentityProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts",editorHoverVerbosityLevel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts",editorInsets:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts",embeddings:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts",extensionRuntime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts",extensionsAny:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts",externalUriOpener:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts",fileComments:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts",fileSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts",findFiles2:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",findTextInFiles:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts",fsChunks:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts",idToken:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts",inlineCompletionsAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts",inlineEdit:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts",interactive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts",interactiveWindow:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts",ipc:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts",languageModelSystem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts",languageStatusText:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts",mappedEditsProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",multiDocumentHighlightProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts",newSymbolNamesProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts",notebookCellExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts",notebookCellExecutionState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts",notebookControllerAffinityHidden:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts",notebookDeprecated:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts",notebookExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts",notebookKernelSource:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts",notebookLiveShare:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts",notebookMessaging:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts",notebookMime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts",notebookVariableProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts",portsAttributes:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts",profileContentHandlers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts",quickDiffProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts",quickPickItemTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts",quickPickSortByLabel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts",resolvers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts",scmActionButton:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts",scmHistoryProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts",scmMultiDiffEditor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts",scmSelectedProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts",scmTextDocument:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts",scmValidation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts",shareProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts",showLocal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts",speech:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts",tabInputMultiDiff:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts",tabInputTextMerge:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts",taskPresentationGroup:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts",telemetry:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts",terminalDataWriteEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts",terminalDimensions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts",terminalExecuteCommandEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts",terminalQuickFixProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts",terminalSelection:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts",terminalShellIntegration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts",testObserver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts",textSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts",timeline:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts",tokenInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts",treeViewActiveItem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts",treeViewMarkdownMessage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts",treeViewReveal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts",tunnelFactory:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts",tunnels:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts",workspaceTrust:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}),DMt="vscode://schemas/vscode-product",ni="vs/workbench/services/extensions/common/extensionsRegistry",UPe=it.as(eL.JSONContribution);class kMt{constructor(e,t,i){this._messageHandler=e,this._extension=t,this._extensionPointId=i}_msg(e,t){this._messageHandler({type:e,message:t,extensionId:this._extension.identifier,extensionPointId:this._extensionPointId})}error(e){this._msg(nt.Error,e)}warn(e){this._msg(nt.Warning,e)}info(e){this._msg(nt.Info,e)}}class q${static _toSet(e){const t=new $v;for(let i=0,s=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!s.has(a.description.identifier));return new q$(o,r)}constructor(e,t){this.added=e,this.removed=t}}class IMt{constructor(e,t){this.name=e,this.defaultExtensionKind=t,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=q$.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){bt(e)}}}const LMt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(ni,0,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(ni,1,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},Met="vscode://schemas/vscode-extensions",YCe={properties:{engines:{type:"object",description:g(ni,2,"Engine compatibility."),properties:{vscode:{type:"string",description:g(ni,3,"For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5."),default:"^1.22.0"}}},publisher:{description:g(ni,4,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(ni,5,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(ni,6,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:fZe},{type:"string",const:"Languages",deprecationMessage:g(ni,7,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(ni,8,"Banner used in the VS Code marketplace."),properties:{color:{description:g(ni,9,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(ni,10,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(ni,11,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(ni,12,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(ni,13,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(ni,14,"Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api"),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}},api:{markdownDescription:g(ni,15,"Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions"),type:"string",enum:["none"],enumDescriptions:[g(ni,16,"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.")]},activationEvents:{description:g(ni,17,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(ni,18,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(ni,19,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(ni,20,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(ni,21,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(ni,22,'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:g(ni,23,'An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).'),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:g(ni,24,"An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called)."),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:g(ni,25,"An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed."),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:g(ni,26,"An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern."),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:g(ni,27,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(ni,28,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(ni,29,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(ni,30,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(ni,31,"An activation event emitted whenever a search is started in the folder with the given scheme."),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:g(ni,32,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(ni,33,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(ni,34,"An activation event emitted whenever a external uri (such as an http or https link) is being opened.")},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:g(ni,35,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(ni,36,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(ni,37,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(ni,38,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(ni,39,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(ni,40,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(ni,41,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(ni,42,"An activation event emitted when the issue reporter is opened.")},{label:"*",description:g(ni,43,"An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case."),body:"*"}]}},badges:{type:"array",description:g(ni,44,"Array of badges to display in the sidebar of the Marketplace's extension page."),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:g(ni,45,"Badge image URL.")},href:{type:"string",description:g(ni,46,"Badge link.")},description:{type:"string",description:g(ni,47,"Badge description.")}}}},markdown:{type:"string",description:g(ni,48,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(ni,49,"Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:g(ni,50,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionPack:{description:g(ni,51,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionKind:{description:g(ni,52,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:"array",items:LMt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(ni,53,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(ni,54,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(ni,55,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(ni,56,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(ni,57,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(ni,58,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(ni,59,"Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true."),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:g(ni,60,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,61,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(ni,62,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(ni,63,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(ni,64,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:g(ni,65,"Declares how the extension should be handled in untrusted workspaces."),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:g(ni,66,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,67,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(ni,68,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(ni,69,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(ni,70,"A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:g(ni,71,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:g(ni,72,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(ni,73,"URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess"),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:g(ni,74,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(ni,75,"Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported."),type:"string"}}},icon:{type:"string",description:g(ni,76,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(ni,77,"The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.")},pricing:{type:"string",markdownDescription:g(ni,78,"The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label"),enum:["Free","Trial"],default:"Free"}}};class TMt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new IMt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&QW.register(e.extensionPoint,e.activationEventsGenerator),YCe.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,UPe.registerSchema(Met,YCe),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const Net={ExtensionsRegistry:"ExtensionsRegistry"};it.add(Net.ExtensionsRegistry,new TMt);const Ap=it.as(Net.ExtensionsRegistry);UPe.registerSchema(Met,YCe);UPe.registerSchema(DMt,{properties:{extensionEnabledApiProposals:{description:g(ni,79,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}}]}}}});var GS;(function(n){n.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(GS||(GS={}));class RMt{constructor(){this.extensionFeatures=new Map}registerExtensionFeature(e){if(this.extensionFeatures.has(e.id))throw new Error(`Extension feature with id '${e.id}' already exists`);return this.extensionFeatures.set(e.id,e),{dispose:()=>this.extensionFeatures.delete(e.id)}}getExtensionFeature(e){return this.extensionFeatures.get(e)}getExtensionFeatures(){return Array.from(this.extensionFeatures.values())}}it.add(GS.ExtensionFeaturesRegistry,new RMt);var pf;(function(n){n.Workbench="workbench.contributions.kind"})(pf||(pf={}));var Sl;(function(n){n[n.BlockStartup=1]="BlockStartup",n[n.BlockRestore=2]="BlockRestore",n[n.AfterRestored=3]="AfterRestored",n[n.Eventually=4]="Eventually"})(Sl||(Sl={}));function zVe(n){const e=n;return!!e&&typeof e.editorTypeId=="string"}function MMt(n){switch(n){case Us.Restored:return Sl.AfterRestored;case Us.Eventually:return Sl.Eventually}}function $Ve(n){switch(n){case Sl.BlockStartup:return Us.Starting;case Sl.BlockRestore:return Us.Ready;case Sl.AfterRestored:return Us.Restored;case Sl.Eventually:return Us.Eventually}}const uk=class uk extends ${constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.timingsByPhase=new Map,this.pendingRestoredContributions=new sd,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const s={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&zVe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,s,typeof i=="number"?$Ve(i):this.lifecycleService.phase):(typeof i=="number"&&XX(this.contributionsByPhase,$Ve(i),[]).push(s),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,s),zVe(i)&&XX(this.contributionsByEditor,i.editorTypeId,[]).push(s)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,MMt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,s=this.logService,o=this.environmentService;if(!t||!i||!s||!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const r=this.contributionsById.get(e);if(!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phasethis.onEditor(a.typeId,t,i,s,o)))}onEditor(e,t,i,s,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,s,o,a,i.phase)}}instantiateByPhase(e,t,i,s,o){t.phase>=o?this.doInstantiateByPhase(e,i,s,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,s,o))}async doInstantiateByPhase(e,t,i,s){const o=this.contributionsByPhase.get(s);if(o)switch(this.contributionsByPhase.delete(s),s){case Us.Starting:case Us.Ready:{vs(`code/willCreateWorkbenchContributions/${s}`);for(const r of o)this.safeCreateContribution(e,t,i,r,s);vs(`code/didCreateWorkbenchContributions/${s}`);break}case Us.Restored:case Us.Eventually:{s===Us.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,s);break}}}doInstantiateWhenIdle(e,t,i,s,o){vs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Us.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,s=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){s.error(g(Dv,3,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!$t(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every($t))){s.error(g(Dv,4,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!$t(a)){s.error(g(Dv,5,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Qt(o,a);MS(c,o)||s.warn(g(Dv,6,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",GVe.name,c.toString(),o.path))}catch(c){s.error(g(Dv,7,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){s.error(g(Dv,8,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class PMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.jsonValidation}render(e){const t=e.contributes?.jsonValidation||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Dv,9,"File Match"),g(Dv,10,"Schema")],s=t.map(o=>[new Xt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:s},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(Dv,11,"JSON Validation"),access:{canToggle:!1},renderer:new Gi(PMt)});var pH;let hte=(pH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(NMt)}},pH.ID="workbench.contrib.jsonValidationExtensionPoint",pH);hte=D([_(0,be)],hte);gp(hte.ID,hte,Sl.BlockStartup);const Kl="vs/workbench/services/themes/common/colorExtensionPoint",JCe=it.as(DMe.ColorContribution),EK=JCe.getColorReferenceSchema(),Pet="^\\w+[.\\w+]*$",FMt=Ap.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(Kl,0,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(Kl,1,"The identifier of the themable color"),pattern:Pet,patternErrorMessage:g(Kl,2,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(Kl,3,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(Kl,4,"The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},dark:{description:g(Kl,5,"The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrast:{description:g(Kl,6,"The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(Kl,7,"The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class OMt{constructor(){FMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||!Array.isArray(s)){o.error(g(Kl,8,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?fe.Format.CSS.parseHex(a):a:(o.error(g(Kl,9,"{0} must be either a color value in hex (#RRGGBB[AA] or #RGB[A]) or the identifier of a themable color which provides the default.",c)),fe.red);for(const a of s){if(typeof a.id!="string"||a.id.length===0){o.error(g(Kl,10,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(Pet)){o.error(g(Kl,11,"'configuration.colors.id' must only contain letters, digits and dots and can not start with a dot"));return}if(typeof a.description!="string"||a.id.length===0){o.error(g(Kl,12,"'configuration.colors.description' must be defined and can not be empty"));return}const c=a.defaults;if(!c||typeof c!="object"||typeof c.light!="string"||typeof c.dark!="string"){o.error(g(Kl,13,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(Kl,14,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(Kl,15,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}JCe.registerColor(a.id,{light:r(c.light,"configuration.colors.defaults.light"),dark:r(c.dark,"configuration.colors.defaults.dark"),hcDark:r(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:r(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const s=i.value;for(const o of s)JCe.deregisterColor(o.id)}})}}class BMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.colors}render(e){const t=e.contributes?.colors||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Kl,16,"ID"),g(Kl,17,"Description"),g(Kl,18,"Dark Default"),g(Kl,19,"Light Default"),g(Kl,20,"High Contrast Default")],s=r=>r[0]==="#"?fe.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Xt().appendMarkdown(`\`${r.id}\``),r.description,s(r.defaults.dark)??new Xt().appendMarkdown(`\`${r.defaults.dark}\``),s(r.defaults.light)??new Xt().appendMarkdown(`\`${r.defaults.light}\``),s(r.defaults.highContrast)??new Xt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(Kl,21,"Colors"),access:{canToggle:!1},renderer:new Gi(BMt)});var mH;let ute=(mH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(OMt)}},mH.ID="workbench.contrib.colorExtensionPoint",mH);ute=D([_(0,be)],ute);gp(ute.ID,ute,Sl.BlockStartup);const o_="vs/workbench/services/themes/common/iconExtensionPoint",k3=it.as(WXe.IconContribution),WMt=k3.getIconReferenceSchema(),Fet=`^${$e.iconNameSegment}(-${$e.iconNameSegment})+$`,HMt=Ap.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(o_,0,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:Fet,description:g(o_,1,"The identifier of the themable icon"),patternErrorMessage:g(o_,2,"Identifiers can only contain letters, digits and minuses and need to consist of at least two segments in the form `component-iconname`.")},additionalProperties:{type:"object",properties:{description:{type:"string",description:g(o_,3,"The description of the themable icon")},default:{anyOf:[WMt,{type:"object",properties:{fontPath:{description:g(o_,4,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(o_,5,"The character for the icon in the icon font."),type:"string"}},required:["fontPath","fontCharacter"],defaultSnippets:[{body:{fontPath:"${1:myiconfont.woff}",fontCharacter:"${2:\\\\E001}"}}]}],description:g(o_,6,"The default of the icon. Either a reference to an extisting ThemeIcon or an icon in an icon font.")}},required:["description","default"],defaultSnippets:[{body:{description:"${1:my icon}",default:{fontPath:"${2:myiconfont.woff}",fontCharacter:"${3:\\\\E001}"}}}]},defaultSnippets:[{body:{"${1:my-icon-id}":{description:"${2:my icon}",default:{fontPath:"${3:myiconfont.woff}",fontCharacter:"${4:\\\\E001}"}}}}]}});class UMt{constructor(){HMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||typeof s!="object"){o.error(g(o_,7,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in s){if(!r.match(Fet)){o.error(g(o_,8,"'configuration.icons' keys represent the icon id and can only contain letter, digits and minuses. They need to consist of at least two segments in the form `component-iconname`."));return}const a=s[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(o_,9,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")k3.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=T_(c.fontPath).substring(1),d=VMt[l];if(!d){o.warn(g(o_,10,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=Qt(h,c.fontPath);if(!MS(u,h)){o.warn(g(o_,11,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=zMt(i.description,c.fontPath),p=k3.registerIconFont(f,{src:[{location:u,format:d}]});k3.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(o_,12,"'configuration.icons.default' must be either a reference to the id of an other theme icon (string) or a icon definition (object) with properties `fontPath` and `fontCharacter`."))}}for(const i of t.removed){const s=i.value;for(const o in s)k3.deregisterIcon(o)}})}}const VMt={ttf:"truetype",woff:"woff",woff2:"woff2"};function zMt(n,e){return Qi.join(n.identifier.value,e)}var _H;let gte=(_H=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(UMt)}},_H.ID="workbench.contrib.iconExtensionPoint",_H);gte=D([_(0,be)],gte);gp(gte.ID,gte,Sl.BlockStartup);const KO="vs/platform/action/common/actionCommonCategories",Za=Object.freeze({View:Be(KO,0,"View"),Help:Be(KO,1,"Help"),Test:Be(KO,2,"Test"),File:Be(KO,3,"File"),Preferences:Be(KO,4,"Preferences"),Developer:Be(KO,5,"Developer")}),$Mt="vs/platform/actions/common/menuResetAction";class GMt extends pi{constructor(){super({id:"menu.resetHiddenStates",title:Be($Mt,0,"Reset All Menus"),category:Za.View,f1:!0})}run(e){e.get(_c).resetHiddenStates(),e.get(Ze).info("did RESET all menu hidden states")}}At(GMt);var qMt='.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:space-between}.monaco-editor .peekview-widget .head .peekview-title{align-items:baseline;display:flex;font-size:13px;margin-left:20px;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename,.monaco-editor .peekview-widget .head .peekview-title .meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;padding-right:2px;text-align:right}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{align-self:center;margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}';Ct(qMt,{});let oC=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){Sm(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};oC=D([_(4,be),_(5,jt),_(6,ji),_(7,Pe),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],oC);var QMt=".monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-bottom-style:solid;border-bottom-width:0;border-top-style:solid;border-top-width:0;position:relative}";Ct(QMt,{});const qVe=new fe(new gn(0,122,204)),jMt={showArrow:!0,showFrame:!0,className:"",frameColor:qVe,arrowColor:qVe,keepEditorSelection:!1},KMt="vs.editor.contrib.zoneWidget";class YMt{constructor(e,t,i,s,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class JMt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const Uae=class Uae{constructor(e){this._editor=e,this._ruleName=Uae._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),vE(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){vE(this._ruleName),Kp(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:O.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:gi.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};Uae._IdGenerator=new yz(".arrow-decoration-");let XCe=Uae;class VPe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Vs(t),Sm(this.options,jMt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new XCe(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}hasFocus(){return this.domNode.contains(xl())}show(e,t){const i=O.isIRange(e)?O.lift(e):O.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Kt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=O.isIRange(e)?O.getStartPosition(e):e,this._viewZone.afterLineNumber=e.lineNumber,this._viewZone.afterColumn=e.column,this._viewZone.heightInLines=t??this._viewZone.heightInLines,this.editor.changeViewZones(i=>{i.layoutZone(this._viewZone.id)}),this._positionMarkerId.set([{range:O.isIRange(e)?e:O.fromPositions(e),options:Kt.EMPTY}]))}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(x.lineHeight);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(x.lineHeight);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let c=0,l=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new YMt(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new JMt(KMt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new O(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,vt.Smooth):this.editor.revealRange(e,vt.Smooth)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Lh(this.domNode,this,{orientation:vi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=Ia.Disabled);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(x.lineHeight),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}const Cg="vs/editor/contrib/peekView/browser/peekView",Oet=ae("IPeekViewService");ce(Oet,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},Yt.Delayed);var mf;(function(n){n.inPeekEditor=new Y("inReferenceSearchEditor",!0,g(Cg,0,"Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(mf||(mf={}));var vH;let fte=(vH=class{constructor(e,t){e instanceof oC&&mf.inPeekEditor.bindTo(t)}dispose(){}},vH.ID="editor.contrib.referenceController",vH);fte=D([_(1,Pe)],fte);vn(fte.ID,fte,mi.Eager);function Bet(n){const e=n.get(jt).getFocusedCodeEditor();return e instanceof oC?e.getParentEditor():e}const XMt={headerBackgroundColor:fe.white,primaryHeadingColor:fe.fromHex("#333333"),secondaryHeadingColor:fe.fromHex("#6c6c6cb3")};let V7=class extends VPe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,Sm(this.options,XMt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=we(".head"),this._bodyElement=we(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=we(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Xo(this._titleElement,"click",o=>this._onTitleClick(o))),he(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=we("span.filename"),this._secondaryHeading=we("span.dirname"),this._metaHeading=we("span.meta"),he(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=we(".peekview-actions");he(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Qh(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xn("peekview.close",g(Cg,1,"Close"),$e.asClassName(Ce.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:yO.bind(void 0,this.instantiationService),orientation:Qb.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Yo(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Oh(this._metaHeading)):Jl(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};V7=D([_(2,be)],V7);const SR=B("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,2,"Background color of the peek view title area.")),zPe=B("peekViewTitleLabel.foreground",{dark:fe.white,light:fe.black,hcDark:fe.white,hcLight:Nc},g(Cg,3,"Color of the peek view title.")),$Pe=B("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(Cg,4,"Color of the peek view title info.")),GPe=B("peekView.border",{dark:Qc,light:Qc,hcDark:ft,hcLight:ft},g(Cg,5,"Color of the peek view borders and arrow.")),ZMt=B("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,6,"Background color of the peek view result list."));B("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:fe.white,hcLight:Nc},g(Cg,7,"Foreground color for line nodes in the peek view result list."));B("peekViewResult.fileForeground",{dark:fe.white,light:"#1E1E1E",hcDark:fe.white,hcLight:Nc},g(Cg,8,"Foreground color for file nodes in the peek view result list."));B("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(Cg,9,"Background color of the selected entry in the peek view result list."));B("peekViewResult.selectionForeground",{dark:fe.white,light:"#6C6C6C",hcDark:fe.white,hcLight:Nc},g(Cg,10,"Foreground color of the selected entry in the peek view result list."));const aI=B("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:fe.black,hcLight:fe.white},g(Cg,11,"Background color of the peek view editor."));B("peekViewEditorGutter.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,12,"Background color of the gutter in the peek view editor."));B("peekViewEditorStickyScroll.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,13,"Background color of sticky scroll in the peek view editor."));B("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(Cg,14,"Match highlight color in the peek view result list."));B("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(Cg,15,"Match highlight color in the peek view editor."));B("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Cg,16,"Match highlight border in the peek view editor."));const cI="vs/editor/contrib/gotoSymbol/browser/referencesModel";class L1{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=ebe.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?g(cI,1,"{0} in {1} on line {2} at column {3}",e.value,ui(this.uri),this.range.startLineNumber,this.range.startColumn):g(cI,0,"in {0} on line {1} at column {2}",ui(this.uri),this.range.startLineNumber,this.range.startColumn)}}class eNt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:s,column:o-t}),l=new O(s,c.startColumn,s,o),d=new O(r,a,r,Zn.MAX_SAFE_SMALL_INTEGER),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class z7{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new wi}dispose(){St(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g(cI,2,"1 symbol in {0}, full path {1}",ui(this.uri),this.uri.fsPath):g(cI,3,"{0} symbols in {1}, full path {2}",e,ui(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new eNt(i))}catch(i){bt(i)}return this}}class fp{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new I,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(fp._compareReferences);let s;for(const o of e)if((!s||!Fn.isEqual(s.uri,o.uri,!0))&&(s=new z7(this,o.uri),this.groups.push(s)),s.children.length===0||fp._compareReferences(o,s.children[s.children.length-1])!==0){const r=new L1(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){St(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new fp(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(cI,4,"No results found"):this.references.length===1?g(cI,5,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(cI,6,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(cI,7,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:LS(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&O.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Fn.compare(e.uri,t.uri)||O.compareRangesUsingStarts(e.range,t.range)}}var tNt=".monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-bottom-width:1px;border-top-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;padding:3em 0;text-align:center;width:100%}.monaco-editor .reference-zone-widget .ref-tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground);line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{overflow:hidden;text-overflow:ellipsis}.monaco-editor .reference-zone-widget .ref-tree .reference-file{color:var(--vscode-peekViewResult-fileForeground);display:inline-flex;height:100%;width:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-left:auto;margin-right:12px}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input,.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder,transparent);box-sizing:border-box}";Ct(tNt,{});var ZCe;const eye="vs/editor/contrib/gotoSymbol/browser/peek/referencesTree";let tye=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof fp||e instanceof z7}getChildren(e){if(e instanceof fp)return e.groups;if(e instanceof z7)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};tye=D([_(0,Rn)],tye);class iNt{getHeight(){return 23}getTemplateId(e){return e instanceof z7?pte.id:mte.id}}let iye=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof L1){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return ui(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};iye=D([_(0,ti)],iye);class nNt{getId(e){return e instanceof L1?e.id:e.uri}}let nye=class extends ${constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new T7(i,{supportHighlights:!0})),this.badge=new Bbe(he(i,we(".count")),{},tXe),e.appendChild(i)}set(e,t){const i=ma(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(g(eye,0,"{0} references",s)):this.badge.setTitleFormat(g(eye,1,"{0} reference",s))}};nye=D([_(1,eo)],nye);var uN;let pte=(uN=class{constructor(e){this._instantiationService=e,this.templateId=ZCe.id}renderTemplate(e){return this._instantiationService.createInstance(nye,e)}renderElement(e,t,i){i.set(e.element,Cz(e.filterData))}disposeTemplate(e){e.dispose()}},ZCe=uN,uN.id="FileReferencesRenderer",uN);pte=ZCe=D([_(0,be)],pte);class sNt extends ${constructor(e){super(),this.label=this._register(new NI(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${ui(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:o}=i;t&&!sw.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,Cz(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[o]))}}}const Vae=class Vae{constructor(){this.templateId=Vae.id}renderTemplate(e){return new sNt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};Vae.id="OneReferenceRenderer";let mte=Vae;class oNt{getWidgetAriaLabel(){return g(eye,2,"References")}getAriaLabel(e){return e.ariaMessage}}const ipe="vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget",zae=class zae{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Z,this._callOnModelChange=new Z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(E.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(aNt,"ReferencesWidget",this._treeContainer,new iNt,[this._instantiationService.createInstance(pte),this._instantiationService.createInstance(mte)],this._instantiationService.createInstance(tye),i),this._splitView.addView({onDidChange:T.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},A1.Distribute),this._splitView.addView({onDidChange:T.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},A1.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof L1&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Jl(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g(ipe,1,"No results"),Oh(this._messageContainer),Promise.resolve(void 0)):(Jl(this._messageContainer),this._decorationsManager=new sye(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Oh(this._treeContainer),Oh(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof L1)return e;if(e instanceof z7&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==_e.inMemory?this.setTitle(Mx(e.uri),this._uriLabel.getUriLabel(ma(e.uri))):this.setTitle(g(ipe,2,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}St(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?vt.Smooth:vt.Immediate,a=O.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};oye=D([_(3,pn),_(4,Rn),_(5,be),_(6,Oet),_(7,eo),_(8,pO),_(9,ti),_(10,Di),_(11,lo)],oye);var DJ;const rye="vs/editor/contrib/gotoSymbol/browser/peek/referencesController",AO=new Y("referenceSearchVisible",!1,g(rye,0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var gN;let wF=(gN=class{static get(e){return e.getContribution(DJ.ID)}constructor(e,t,i,s,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=AO.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=rNt.fromJSON(this._storageService.get(o,ke.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(oye,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(rye,1,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),ke.PROFILE,ln.MACHINE),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{const{element:l,kind:d}=c;if(l)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":i?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const a=++this._requestIdPool;t.then(c=>{if(a!==this._requestIdPool||!this._widget){c.dispose();return}return this._model?.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(g(rye,2,"{0} ({1})",this._model.title,this._model.references.length));const l=this._editor.getModel().uri,d=new oe(e.startLineNumber,e.startColumn),h=this._model.nearestReference(l,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(x.peekWidgetDefaultFocus)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=O.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:jb.JUMP,pinned:t}},this._editor).then(s=>{if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=DJ.get(s),r=this._model.clone();this.closeWidget(),s.focus(),o?.toggleWidget(i,na(a=>Promise.resolve(r)),this._peekMode??!1)}},s=>{this._ignoreModelChangeEvent=!1,bt(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:jb.JUMP,pinned:i}},this._editor,t)}},DJ=gN,gN.ID="editor.contrib.referencesController",gN);wF=DJ=D([_(2,Pe),_(3,jt),_(4,Pi),_(5,be),_(6,on),_(7,Re)],wF);function EO(n,e){const t=Bet(n);if(!t)return;const i=wF.get(t);i&&e(i)}xr.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:ye.EditorContrib,primary:Br(V.CtrlCmd|E.KeyK,E.F2),when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});xr.registerCommandAndKeybindingRule({id:"goToNextReference",weight:ye.EditorContrib-10,primary:E.F4,secondary:[E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!0)})}});xr.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:ye.EditorContrib-10,primary:V.Shift|E.F4,secondary:[V.Shift|E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!1)})}});yt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");yt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");yt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");yt.registerCommand("closeReferenceSearch",n=>EO(n,e=>e.closeWidget()));xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.EditorContrib-101,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(mf.inPeekEditor,ge.not("config.editor.stablePeek"))});xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.WorkbenchContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(AO,ge.not("config.editor.stablePeek"),ge.or(X.editorTextFocus,SXe.negate()))});xr.registerCommandAndKeybindingRule({id:"revealReference",weight:ye.WorkbenchContrib,primary:E.Enter,mac:{primary:E.Enter,secondary:[V.CtrlCmd|E.DownArrow]},when:ge.and(AO,Rde,qNe.negate(),QNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.revealReference(t[0]))}});xr.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:ye.EditorContrib,primary:V.CtrlCmd|E.Enter,mac:{primary:V.WinCtrl|E.Enter},when:ge.and(AO,Rde,qNe.negate(),QNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!0,!0))}});yt.registerCommand("openReference",n=>{const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!1,!0))});let aye=class extends wF{constructor(e,t,i,s,o,r,a){super(!1,e,t,i,s,o,r,a)}};aye=D([_(1,Pe),_(2,jt),_(3,Pi),_(4,be),_(5,on),_(6,Re)],aye);vn(wF.ID,aye,mi.Lazy);const CBe=class CBe extends ${constructor(e){super(),this._editor=e,this._altListeningMouse=!1,this._altMouseTriggered=!1,this._register(this._editor.onMouseDown(t=>{this._altListeningMouse&&(this._altMouseTriggered=!0)})),this._register(this._editor.onKeyDown(t=>{t.equals(V.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(V.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};CBe.ID="editor.contrib.menuPreventer";let Hx=CBe;vn(Hx.ID,Hx,mi.BeforeFirstInteraction);let $7=class extends Dm{constructor(e,t,i,s,o,r,a,c,l){super(e,s.getRawOptions(),i,o,r,a,c,l),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){Sm(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};$7=D([_(4,Pe),_(5,be),_(6,jt),_(7,Lw),_(8,eD)],$7);const NQ=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1),e.dispose()}}}getImplementations(){return this._implementations}};class Wet extends wg{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=we(".floating-click-widget"),this._domNode.style.padding="6px 11px",this._domNode.style.borderRadius="2px",this._domNode.style.cursor="pointer",this._domNode.style.zIndex="1"}getDomNode(){return this._domNode}render(){Yo(this._domNode),this._domNode.style.backgroundColor=ewe(eS,Ye(us)),this._domNode.style.color=ewe(Zy,Ye(Nc)),this._domNode.style.border=`1px solid ${Ye(ft)}`,he(this._domNode,we("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let _te=class extends ${constructor(e,t,i){super(),this.renderEmitter=new I,this.onDidRender=this.renderEmitter.event,this.menu=this._register(t.createMenu(e,i))}render(){const e=this._register(new Z),t=()=>{if(e.clear(),!this.isVisible())return;const i=[];if(tD(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[s]=i,o=this.createWidget(s,e);e.add(o),e.add(o.onClick(()=>s.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};_te=D([_(1,_c),_(2,Pe)],_te);let QVe=class extends _te{constructor(e,t,i,s){super(e.menuId,i,s),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(Wet,e.label),s=i.getDomNode();return this.options.container.appendChild(s),t.add(Ee(()=>this.options.container.removeChild(s))),i}getActionArg(){return this.options.getActionArg()}};QVe=D([_(1,be),_(2,_c),_(3,Pe)],QVe);var kJ,c0;let jVe=(c0=class extends ${constructor(e){super(),this.editorService=e,this._onHighlightRemoved=this._register(new I),this.onHighlightRemoved=this._onHighlightRemoved.event,this.rangeHighlightDecorationId=null,this.editor=null,this.editorDisposables=this._register(new Z)}removeHighlightRange(){if(this.editor&&this.rangeHighlightDecorationId){const e=this.rangeHighlightDecorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e)}),this._onHighlightRemoved.fire()}this.rangeHighlightDecorationId=null}highlightRange(e,t){t=t??this.getEditor(e),Ka(t)?this.doHighlightRange(t,e):HU(t)&&Ka(t.activeCodeEditor)&&this.doHighlightRange(t.activeCodeEditor,e)}doHighlightRange(e,t){this.removeHighlightRange(),e.changeDecorations(i=>{this.rangeHighlightDecorationId=i.addDecoration(t.range,this.createRangeHighlightDecoration(t.isWholeLine))}),this.setEditor(e)}getEditor(e){const t=this.editorService.activeEditor?.resource;if(t&&_n(t,e.resource)&&Ka(this.editorService.activeTextEditorControl))return this.editorService.activeTextEditorControl}setEditor(e){this.editor!==e&&(this.editorDisposables.clear(),this.editor=e,this.editorDisposables.add(this.editor.onDidChangeCursorPosition(t=>{(t.reason===Hi.NotSet||t.reason===Hi.Explicit||t.reason===Hi.Undo||t.reason===Hi.Redo)&&this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidChangeModel(()=>{this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidDispose(()=>{this.removeHighlightRange(),this.editor=null})))}createRangeHighlightDecoration(e=!0){return e?kJ._WHOLE_LINE_RANGE_HIGHLIGHT:kJ._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},kJ=c0,c0._WHOLE_LINE_RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight-whole",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),c0._RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),c0);jVe=kJ=D([_(0,_i)],jVe);let vte=class extends Wet{constructor(e,t,i,s){super(i&&s.lookupKeybinding(i)?`${t} (${s.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};vte=D([_(3,ti)],vte);var wH;let KVe=(wH=class extends _te{constructor(e,t,i,s){super(Te.EditorContent,i,s),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(vte,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof oC)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},wH.ID="editor.contrib.floatingClickMenu",wH);KVe=D([_(1,be),_(2,_c),_(3,Pe)],KVe);const bS="vs/workbench/common/configuration";Object.freeze({id:"application",order:100,title:g(bS,0,"Application"),type:"object"});const PQ=Object.freeze({id:"workbench",order:7,title:g(bS,1,"Workbench"),type:"object"}),cNt=Object.freeze({id:"security",scope:ut.APPLICATION,title:g(bS,2,"Security"),type:"object",order:7}),lNt=Object.freeze({id:"problems",title:g(bS,3,"Problems"),type:"object",order:101}),Het=Object.freeze({id:"window",order:8,title:g(bS,4,"Window"),type:"object"}),Mm={ConfigurationMigration:"base.contributions.configuration.migration"};class dNt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const IJ=new dNt;it.add(Mm.ConfigurationMigration,IJ);var bH;let wte=(bH=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const s of i.added)await this.migrateConfigurationsForFolder(s,IJ.migrations)})),this.migrateConfigurations(IJ.migrations),this._register(IJ.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),s=this.workspaceService.getWorkbenchState()===Nn.WORKSPACE?[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE],["workspaceFolder",Ot.WORKSPACE_FOLDER]]:[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE]];for(const[o,r]of s){const a=i[o];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,o,a.value,t,void 0);for(const d of l??[])c.push([d,[]])}for(const{identifiers:l,value:d}of a.overrides??[])if(d!==void 0){const h=await this.runMigration(e,o,d,t,l);for(const u of h??[])c.push([u,l])}c.length&&await Promise.allSettled(c.map(async([[l,d],h])=>this.configurationService.updateValue(l,d.value,{resource:t,overrideIdentifiers:h},r)))}}async runMigration(e,t,i,s,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:s})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Io(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},bH.ID="workbench.contrib.configurationMigration",bH);wte=D([_(0,Re),_(1,Ti)],wte);var CH;let bte=(CH=class extends ${constructor(e){super(),this.remoteAgentService=e,this._ready=new sd,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Is&&(await this.remoteAgentService.getEnvironment())?.os!==Pr.Windows)return;it.as(Cs.Configuration).registerConfiguration({...cNt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(bS,5,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(bS,6,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(bS,7,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE}}})}},CH.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",CH);bte=D([_(0,Sf)],bte);const C5="window.newWindowProfile";var yH;let Cte=(yH=class extends ${constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==Ot.DEFAULT&&i.affectsConfiguration(C5)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=it.as(Cs.Configuration),t={...Het,properties:{[C5]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(bS,8,"Active Window")],description:g(bS,9,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the default profile if no active window exists."),scope:ut.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(C5);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(C5);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(C5,t?.name)}},yH.ID="workbench.contrib.dynamicWindowConfiguration",yH);Cte=D([_(0,V_),_(1,Re)],Cte);const Fw="vs/editor/browser/widget/diffEditor/commands";class hNt extends pi{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Be(Fw,0,"Toggle Collapse Unchanged Regions"),icon:Ce.map,toggled:ge.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ge.has("isInDiffEditor"),menu:{when:ge.has("isInDiffEditor"),id:Te.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class Uet extends pi{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Be(Fw,1,"Toggle Show Moved Code Blocks"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class Vet extends pi{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Be(Fw,2,"Toggle Use Inline View When Space Is Limited"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const FQ=Be(Fw,3,"Diff Editor");class uNt extends wf{constructor(){super({id:"diffEditor.switchSide",title:Be(Fw,4,"Switch Side"),icon:Ce.arrowSwap,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,i){const s=Oz(e);if(s instanceof Dm){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class gNt extends wf{constructor(){super({id:"diffEditor.exitCompareMove",title:Be(Fw,5,"Exit Compare Move"),icon:Ce.close,precondition:X.comparingMovedCode,f1:!1,category:FQ,keybinding:{weight:1e4,primary:E.Escape}})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof Dm&&s.exitCompareMove()}}class fNt extends wf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Be(Fw,6,"Collapse All Unchanged Regions"),icon:Ce.fold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof Dm&&s.collapseAllUnchangedRegions()}}class pNt extends wf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Be(Fw,7,"Show All Unchanged Regions"),icon:Ce.unfold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof Dm&&s.showAllUnchangedRegions()}}class cye extends pi{constructor(){super({id:"diffEditor.revert",title:Be(Fw,8,"Revert"),f1:!1,category:FQ})}run(e,t){const i=mNt(e,t.originalUri,t.modifiedUri);i instanceof Dm&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const zet=Be(Fw,9,"Accessible Diff Viewer"),$ae=class $ae extends pi{constructor(){super({id:$ae.id,title:Be(Fw,10,"Go to Next Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerNext()}};$ae.id="editor.action.accessibleDiffViewer.next";let _V=$ae;const Gae=class Gae extends pi{constructor(){super({id:Gae.id,title:Be(Fw,11,"Go to Previous Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:V.Shift|E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerPrev()}};Gae.id="editor.action.accessibleDiffViewer.prev";let G7=Gae;function mNt(n,e,t){return n.get(jt).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Oz(n){const t=n.get(jt).listDiffEditors(),i=xl();if(i)for(const s of t){const o=s.getContainerDomNode();if(_Nt(o,i))return s}return null}function _Nt(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}var rC;(function(n){n.Terminal="terminal",n.TerminalChat="terminal-chat",n.TerminalHelp="terminal-help",n.DiffEditor="diffEditor",n.Chat="panelChat",n.InlineChat="inlineChat",n.InlineCompletions="inlineCompletions",n.KeybindingsEditor="keybindingsEditor",n.Notebook="notebook",n.Editor="editor",n.Hover="hover",n.Notification="notification",n.EmptyEditorHint="emptyEditorHint",n.Comments="comments"})(rC||(rC={}));var N_;(function(n){n.Help="help",n.View="view"})(N_||(N_={}));var YVe;(function(n){n.Previous="previous",n.Next="next"})(YVe||(YVe={}));const Ea="vs/workbench/contrib/speech/common/speechService",vNt=new Y("hasSpeechProvider",!1,{type:"boolean",description:g(Ea,0,"A speech provider is registered to the speech service.")}),wNt=new Y("speechToTextInProgress",!1,{type:"boolean",description:g(Ea,1,"A speech-to-text session is in progress.")});new Y("textToSpeechInProgress",!1,{type:"boolean",description:g(Ea,2,"A text-to-speech session is in progress.")});var l2;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(l2||(l2={}));var lye;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(lye||(lye={}));var JVe;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped",n[n.Canceled=3]="Canceled"})(JVe||(JVe={}));var jW;(function(n){n.SpeechTimeout="accessibility.voice.speechTimeout",n.AutoSynthesize="accessibility.voice.autoSynthesize",n.SpeechLanguage="accessibility.voice.speechLanguage"})(jW||(jW={}));jW.SpeechLanguage;const bNt={"da-DK":{name:g(Ea,3,"Danish (Denmark)")},"de-DE":{name:g(Ea,4,"German (Germany)")},"en-AU":{name:g(Ea,5,"English (Australia)")},"en-CA":{name:g(Ea,6,"English (Canada)")},"en-GB":{name:g(Ea,7,"English (United Kingdom)")},"en-IE":{name:g(Ea,8,"English (Ireland)")},"en-IN":{name:g(Ea,9,"English (India)")},"en-NZ":{name:g(Ea,10,"English (New Zealand)")},"en-US":{name:g(Ea,11,"English (United States)")},"es-ES":{name:g(Ea,12,"Spanish (Spain)")},"es-MX":{name:g(Ea,13,"Spanish (Mexico)")},"fr-CA":{name:g(Ea,14,"French (Canada)")},"fr-FR":{name:g(Ea,15,"French (France)")},"hi-IN":{name:g(Ea,16,"Hindi (India)")},"it-IT":{name:g(Ea,17,"Italian (Italy)")},"ja-JP":{name:g(Ea,18,"Japanese (Japan)")},"ko-KR":{name:g(Ea,19,"Korean (South Korea)")},"nl-NL":{name:g(Ea,20,"Dutch (Netherlands)")},"pt-PT":{name:g(Ea,21,"Portuguese (Portugal)")},"pt-BR":{name:g(Ea,22,"Portuguese (Brazil)")},"ru-RU":{name:g(Ea,23,"Russian (Russia)")},"sv-SE":{name:g(Ea,24,"Swedish (Sweden)")},"tr-TR":{name:g(Ea,25,"Turkish (Türkiye)")},"zh-CN":{name:g(Ea,26,"Chinese (Simplified, China)")},"zh-HK":{name:g(Ea,27,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(Ea,28,"Chinese (Traditional, Taiwan)")}},dt="vs/workbench/contrib/accessibility/browser/accessibilityConfiguration",T1=new Y("accessibilityHelpIsShown",!1,!0),km=new Y("accessibleViewIsShown",!1,!0),yte=new Y("accessibleViewSupportsNavigation",!1,!0),XVe=new Y("accessibleViewVerbosityEnabled",!1,!0),ZVe=new Y("accessibleViewGoToSymbolSupported",!1,!0);new Y("accessibleViewOnLastLine",!1,!0);const Ste=new Y("accessibleViewCurrentProviderId",void 0,void 0);new Y("accessibleViewInCodeBlock",void 0,void 0);const Ate=new Y("accessibleViewContainsCodeBlocks",void 0,void 0);var dye;(function(n){n.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",n.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",n.HideAccessibleView="accessibility.hideAccessibleView",n.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(dye||(dye={}));var e4e;(function(n){n[n.Default=.75]="Default",n[n.Minimum=.2]="Minimum",n[n.Maximum=1]="Maximum"})(e4e||(e4e={}));var ua;(function(n){n.Terminal="accessibility.verbosity.terminal",n.DiffEditor="accessibility.verbosity.diffEditor",n.Chat="accessibility.verbosity.panelChat",n.InlineChat="accessibility.verbosity.inlineChat",n.TerminalChat="accessibility.verbosity.terminalChat",n.InlineCompletions="accessibility.verbosity.inlineCompletions",n.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",n.Notebook="accessibility.verbosity.notebook",n.Editor="accessibility.verbosity.editor",n.Hover="accessibility.verbosity.hover",n.Notification="accessibility.verbosity.notification",n.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",n.Comments="accessibility.verbosity.comments",n.DiffEditorActive="accessibility.verbosity.diffEditorActive"})(ua||(ua={}));const Q_={type:"boolean",default:!0,tags:["accessibility"]},$et=Object.freeze({id:"accessibility",title:g(dt,0,"Accessibility"),type:"object"}),Sc={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(dt,1,"Enable sound when a screen reader is attached."),g(dt,2,"Enable sound."),g(dt,3,"Disable sound.")],tags:["accessibility"]},ph={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},mh={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(dt,4,"Enable announcement, will only play when in screen reader optimized mode."),g(dt,5,"Disable announcement.")],tags:["accessibility"]},DL={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...$et,scope:ut.RESOURCE,properties:(ua.Terminal+"",{description:g(dt,6,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...Q_},ua.DiffEditor+"",{description:g(dt,7,"Provide information about how to navigate changes in the diff editor when it is focused."),...Q_},ua.Chat+"",{description:g(dt,8,"Provide information about how to access the chat help menu when the chat input is focused."),...Q_},ua.InlineChat+"",{description:g(dt,9,"Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused."),...Q_},ua.InlineCompletions+"",{description:g(dt,10,"Provide information about how to access the inline completions hover and Accessible View."),...Q_},ua.KeybindingsEditor+"",{description:g(dt,11,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...Q_},ua.Notebook+"",{description:g(dt,12,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...Q_},ua.Hover+"",{description:g(dt,13,"Provide information about how to open the hover in an Accessible View."),...Q_},ua.Notification+"",{description:g(dt,14,"Provide information about how to open the notification in an Accessible View."),...Q_},ua.EmptyEditorHint+"",{description:g(dt,15,"Provide information about relevant actions in an empty text editor."),...Q_},ua.Comments+"",{description:g(dt,16,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...Q_},ua.DiffEditorActive+"",{description:g(dt,17,"Indicate when a diff editor becomes the active editor."),...Q_},dye.AccessibleViewCloseOnKeyPress+"",g(dt,18,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(dt,19,"The volume of the sounds in percent (0-100)."),g(dt,20,"Whether or not position changes should be debounced"),g(dt,21,"The delay in milliseconds before an announcement is made."),g(dt,22,"The delay in milliseconds before a sound is played."),g(dt,23,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(dt,24,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(dt,25,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(dt,26,"The delay in milliseconds before a sound is played when there's an error at the position."),{...ph,description:g(dt,27,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(dt,28,"Plays a sound when the active line has a breakpoint."),...Sc},{description:g(dt,29,"Announces when the active line has a breakpoint."),...mh})},{...DL,description:g(dt,30,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(dt,31,"Plays a sound when the active line has an inline suggestion."),...Sc}},{...ph,description:g(dt,32,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(dt,33,"Plays a sound when the active line has an error."),...Sc},{description:g(dt,34,"Announces when the active line has an error."),...mh})},{...ph,description:g(dt,35,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(dt,36,"Plays a sound when the active line has a folded area that can be unfolded."),...Sc},{description:g(dt,37,"Announces when the active line has a folded area that can be unfolded."),...mh})},{...ph,description:g(dt,38,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,39,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,40,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,41,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,42,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,43,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,44,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,45,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,46,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,47,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(dt,48,"Plays a sound when the debugger stopped on a breakpoint."),...Sc},{description:g(dt,49,"Announces when the debugger stopped on a breakpoint."),...mh})},{...ph,description:g(dt,50,"Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."),properties:({description:g(dt,51,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...Sc},{description:g(dt,52,"Announces when trying to read a line with inlay hints that has no inlay hints."),...mh})},{...ph,description:g(dt,53,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(dt,54,"Plays a sound when a task is completed."),...Sc},{description:g(dt,55,"Announces when a task is completed."),...mh})},{...ph,description:g(dt,56,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(dt,57,"Plays a sound when a task fails (non-zero exit code)."),...Sc},{description:g(dt,58,"Announces when a task fails (non-zero exit code)."),...mh})},{...ph,description:g(dt,59,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,60,"Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Sc},{description:g(dt,61,"Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,62,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,63,"Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Sc},{description:g(dt,64,"Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,65,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(dt,66,"Plays a sound when terminal Quick Fixes are available."),...Sc},{description:g(dt,67,"Announces when terminal Quick Fixes are available."),...mh})},{...ph,description:g(dt,68,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(dt,69,"Plays a sound when the terminal bell is ringing."),...Sc},{description:g(dt,70,"Announces when the terminal bell is ringing."),...mh})},{...DL,description:g(dt,71,"Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,72,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...DL,description:g(dt,73,"Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,74,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...DL,description:g(dt,75,"Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,76,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...ph,description:g(dt,77,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(dt,78,"Plays a sound when a notebook cell execution is successfully completed."),...Sc},{description:g(dt,79,"Announces when a notebook cell execution is successfully completed."),...mh})},{...ph,description:g(dt,80,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(dt,81,"Plays a sound when a notebook cell execution fails."),...Sc},{description:g(dt,82,"Announces when a notebook cell execution fails."),...mh})},{...ph,description:g(dt,83,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(dt,84,"Plays a sound when a chat request is made."),...Sc},{description:g(dt,85,"Announces when a chat request is made."),...mh})},{...ph,description:g(dt,86,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(dt,87,"Plays a sound on loop while progress is occurring."),...Sc},{description:g(dt,88,"Alerts on loop while progress is occurring."),...mh})},{...DL,description:g(dt,89,"Plays a sound / audio cue when the response has been received."),properties:{description:g(dt,90,"Plays a sound on loop while the response has been received."),...Sc}},{...DL,description:g(dt,91,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(dt,92,"Plays a sound when the voice recording has started."),...Sc}},{...DL,description:g(dt,93,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(dt,94,"Plays a sound when the voice recording has stopped."),...Sc}},{...ph,description:g(dt,95,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."),properties:({description:g(dt,96,"Plays a sound when a feature is cleared."),...Sc},{description:g(dt,97,"Announces when a feature is cleared."),...mh})},g(dt,98,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(dt,99,"Plays a sound when a file is saved."),g(dt,100,"Plays the sound when a user explicitly saves a file."),g(dt,101,"Plays the sound whenever a file is saved, including auto save."),g(dt,102,"Never plays the sound."),g(dt,103,"Announces when a file is saved."),g(dt,104,"Announces when a user explicitly saves a file."),g(dt,105,"Announces whenever a file is saved, including auto save."),g(dt,106,"Never plays the announcement."),g(dt,107,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(dt,108,"Plays a sound when a file or notebook is formatted."),g(dt,109,"Plays the sound when a user explicitly formats a file."),g(dt,110,"Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,111,"Never plays the sound."),g(dt,112,"Announces when a file or notebook is formatted."),g(dt,113,"Announces when a user explicitly formats a file."),g(dt,114,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,115,"Never announces."))});const CNt=1200;var SH;let t4e=(SH=class extends ${constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(T.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((s,o)=>e[s].name.localeCompare(e[o].name));it.as(Cs.Configuration).registerConfiguration({...$et,properties:{[jW.SpeechTimeout]:{markdownDescription:g(dt,119,"The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."),type:"number",default:CNt,minimum:0,tags:["accessibility"]},[jW.SpeechLanguage]:{markdownDescription:g(dt,120,"The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."),type:"string",enum:t,default:"auto",tags:["accessibility"],enumDescriptions:t.map(s=>e[s].name),enumItemLabels:t.map(s=>e[s].name)},[jW.AutoSynthesize]:{type:"boolean",markdownDescription:g(dt,121,"Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."),default:this.productService.quality!=="stable",tags:["accessibility"]}}})}getLanguages(){return{auto:{name:g(dt,122,"Auto (Use Display Language)")},...bNt}}},SH.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",SH);t4e=D([_(0,Xde),_(1,Xa)],t4e);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["audioCues.volume",{value:void 0}]]}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["audioCues.debouncePositionChanges",{value:void 0}]]}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(n,e)=>{const t=n.delays;return t?[["accessibility.signalOptions",{value:{...n,"experimental.delays":t,delays:void 0}}]]:[]}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["accessibility.signals.sounds.volume",{value:void 0}]]}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}}]);function Get(n){return n("accessibility.signalOptions")?.volume||n("accessibility.signals.sounds.volume")||n("audioCues.volume")}function qet(n){return n("accessibility.signalOptions")?.debouncePositionChanges||n("accessibility.signals.debouncePositionChanges")||n("audioCues.debouncePositionChanges")}it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(n,e)=>[["accessibility.signals.progress",{value:n}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.map(n=>n.legacySoundSettingsKey?{key:n.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],s=n.legacyAnnouncementSettingsKey;let o;return s&&(o=t(s)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${n.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(yl));it.as(Mm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.filter(n=>!!n.legacyAnnouncementSettingsKey&&!!n.legacySoundSettingsKey).map(n=>({key:n.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],s=t(n.settingsKey)?.sound||t(n.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${n.settingsKey}`,{value:e!==void 0?{announcement:e,sound:s}:{sound:s}}]),i.push([`${n.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Ru;(function(n){n.OpenAccessibleView="editor.action.accessibleView",n.OpenAccessibilityHelp="editor.action.accessibilityHelp",n.DisableVerbosityHint="editor.action.accessibleViewDisableHint",n.GoToSymbol="editor.action.accessibleViewGoToSymbol",n.ShowNext="editor.action.accessibleViewNext",n.ShowPrevious="editor.action.accessibleViewPrevious",n.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",n.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",n.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",n.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",n.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Ru||(Ru={}));const Qet="editor.action.inlineSuggest.commit",jet="editor.action.inlineSuggest.showPrevious",Ket="editor.action.inlineSuggest.showNext";var yNt=".monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{cursor:pointer;display:inline-block;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{font-size:0;opacity:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border);color:var(--vscode-editorGhostText-foreground)!important}";Ct(yNt,{});class q7{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}render(e,t=!1){return new WU([...this.parts.map(i=>new ug(O.fromPositions(new oe(this.lineNumber,i.column)),t?`[${i.lines.join(` + `,constraint:tJe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?o0t(t,!0,o):a==="up"?XYe(t,!0,r||1,o):PU(t,!0,r||1,o)}}class D0t extends Zd{constructor(){super({id:"editor.toggleFold",label:g(456,"Toggle Fold"),alias:"Toggle Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);RRe(t,1,n)}}class k0t extends Zd{constructor(){super({id:"editor.foldRecursively",label:g(457,"Fold Recursively"),alias:"Fold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketLeft),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);PU(t,!0,Number.MAX_VALUE,n)}}class I0t extends Zd{constructor(){super({id:"editor.toggleFoldRecursively",label:g(458,"Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);RRe(t,Number.MAX_VALUE,n)}}class T0t extends Zd{constructor(){super({id:"editor.foldAllBlockComments",label:g(459,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Slash),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const c=new RegExp("^\\s*"+Rh(a.blockCommentStartToken));MRe(t,c,!0)}}}}class L0t extends Zd{constructor(){super({id:"editor.foldAllMarkerRegions",label:g(460,"Fold All Regions"),alias:"Fold All Regions",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit8),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);MRe(t,c,!0)}}}}class R0t extends Zd{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g(461,"Unfold All Regions"),alias:"Unfold All Regions",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit9),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);MRe(t,c,!1)}}}}class M0t extends Zd{constructor(){super({id:"editor.foldAllExcept",label:g(462,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Minus),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);ZYe(t,!0,n)}}class N0t extends Zd{constructor(){super({id:"editor.unfoldAllExcept",label:g(463,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Equal),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);ZYe(t,!1,n)}}class P0t extends Zd{constructor(){super({id:"editor.foldAll",label:g(464,"Fold All"),alias:"Fold All",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0),weight:Ae.EditorContrib}})}invoke(e,t,i){PU(t,!0)}}class F0t extends Zd{constructor(){super({id:"editor.unfoldAll",label:g(465,"Unfold All"),alias:"Unfold All",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyJ),weight:Ae.EditorContrib}})}invoke(e,t,i){PU(t,!1)}}const XF=class XF extends Zd{getFoldingLevel(){return parseInt(this.id.substr(XF.ID_PREFIX.length))}invoke(e,t,i){r0t(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};XF.ID_PREFIX="editor.foldLevel",XF.ID=e=>XF.ID_PREFIX+e;let NJ=XF;class O0t extends Zd{constructor(){super({id:"editor.gotoParentFold",label:g(466,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=a0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class B0t extends Zd{constructor(){super({id:"editor.gotoPreviousFold",label:g(467,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=c0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class W0t extends Zd{constructor(){super({id:"editor.gotoNextFold",label:g(468,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=l0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class H0t extends Zd{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(469,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Comma),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(n.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:Cl.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=$f.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost($f.fromFoldRanges(r))}}}}class U0t extends Zd{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(470,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Period),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=i.getSelections();if(n){const o=[];for(const r of n){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}on(TA.ID,TA,ri.Eager);Re(A0t);Re(E0t);Re(x0t);Re(k0t);Re(I0t);Re(P0t);Re(F0t);Re(T0t);Re(L0t);Re(R0t);Re(M0t);Re(N0t);Re(D0t);Re(O0t);Re(B0t);Re(W0t);Re(H0t);Re(U0t);for(let s=1;s<=7;s++)lht(new NJ({id:NJ.ID(s),label:g(471,"Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0+s),weight:Ae.EditorContrib}}));_t.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const i=s.get(it),n=s.get(gi).getModel(t);if(!n)throw Pi();const o=s.get(Te);if(!o.getValue("editor.folding",{resource:t}))return[];const r=s.get(Vs),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new PRe(n,r,c);let d=l;if(a!=="indentation"){const f=TA.getFoldingRangeProviders(i,n);f.length&&(d=new FRe(n,f,()=>{},c,l))}const h=await d.compute(He.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};s.openEditor(e,o)}}),rl({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(452,"Configure Limit"),run:()=>n.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:Xe.Warning})}function R5(s){return wa(s?.editor)}function Hhe(s){const e=s;return R5(s)&&e?.group!==void 0}function xve(s){const e=s;return typeof e?.groupId=="number"&&wa(e.editor)}function zWe(s){return typeof s?.groupId=="number"}var cA;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.REPLACE=1]="REPLACE",s[s.MOVE=2]="MOVE",s[s.UNPIN=3]="UNPIN"})(cA||(cA={}));var Do;(function(s){s[s.GROUP_ACTIVE=0]="GROUP_ACTIVE",s[s.GROUP_INDEX=1]="GROUP_INDEX",s[s.GROUP_LABEL=2]="GROUP_LABEL",s[s.GROUP_LOCKED=3]="GROUP_LOCKED",s[s.EDITORS_SELECTION=4]="EDITORS_SELECTION",s[s.EDITOR_OPEN=5]="EDITOR_OPEN",s[s.EDITOR_CLOSE=6]="EDITOR_CLOSE",s[s.EDITOR_MOVE=7]="EDITOR_MOVE",s[s.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",s[s.EDITOR_LABEL=9]="EDITOR_LABEL",s[s.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",s[s.EDITOR_PIN=11]="EDITOR_PIN",s[s.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",s[s.EDITOR_STICKY=13]="EDITOR_STICKY",s[s.EDITOR_DIRTY=14]="EDITOR_DIRTY",s[s.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(Do||(Do={}));var Hs;(function(s){s[s.PRIMARY=1]="PRIMARY",s[s.SECONDARY=2]="SECONDARY",s[s.BOTH=3]="BOTH",s[s.ANY=4]="ANY"})(Hs||(Hs={}));class j0t{getOriginalUri(e,t){if(!e)return;if(wb(e))return Na.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(E_(e)||L5(e)||kS(e)||wb(e))return;const i=K0t(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return q0t(e)||kS(e)?{primary:e.primary,secondary:e.secondary}:sJe(e)||E_(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(wb(e))return Na.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(E_(e)||L5(e)||kS(e)||wb(e))return;const i=e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(i=>e.scheme===i))return e}else if(t===e.scheme)return e}}var $We;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.KEYBOARD=1]="KEYBOARD",s[s.MOUSE=2]="MOUSE"})($We||($We={}));const Na=new j0t;var GWe;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(GWe||(GWe={}));class Y0t{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(we);for(const[i,n]of this.editorSerializerConstructors)this.createEditorSerializer(i,n,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const n=i.createInstance(t);this.editorSerializerInstances.set(e,n)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return qn(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),Ee(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}Qe.add(tC.EditorFactory,new Y0t);async function Uhe(s,e,t){return!s||!s.length?[]:await Promise.all(s.map(async i=>{const n=N.revive(i.fileUri);if(!n){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(n)){t.info("Cannot resolve the path because it cannot be handled",i);return}let r=i.exists,a=i.type;if(typeof r!="boolean"||typeof a!="number")try{a=(await e.stat(n)).isDirectory?sn.Directory:sn.Unknown,r=!0}catch(l){t.error(l),r=!1}if(!r&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===sn.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:n,options:c}:{resource:n,options:c,forceUntitled:!0}}))}var Zh;(function(s){s[s.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",s[s.SEQUENTIAL=1]="SEQUENTIAL"})(Zh||(Zh={}));function ORe(s){const e=s;if(!e)return!1;const t=e;if(t.modified)return ORe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function oJe(s,e,t){const i=wyt(s,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var wv;const J0t=new Q("workbenchState",void 0,{type:"string",description:g(480,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")}),X0t=new Q("workspaceFolderCount",0,g(481,"The number of root folders in the workspace")),Z0t=new Q("openFolderWorkspaceSupport",!0,!0),e1t=new Q("enterMultiRootWorkspaceSupport",!0,!0),rJe=new Q("emptyWorkspaceSupport",!0,!0),t1t=new Q("dirtyWorkingCopies",!1,g(482,"Whether there are any working copies with unsaved changes")),i1t=new Q("remoteName","",g(483,"The name of the remote the window is connected to or an empty string if not connected to any remote")),n1t=new Q("virtualWorkspace","",g(484,"The scheme of the current workspace is from a virtual file system or an empty string.")),aJe=new Q("temporaryWorkspace",!1,g(485,"The scheme of the current workspace is from a temporary file system.")),s1t=new Q("isFullscreen",!1,g(486,"Whether the main window is in fullscreen mode")),o1t=new Q("isAuxiliaryWindowFocusedContext",!1,g(487,"Whether an auxiliary window is focused")),r1t=new Q("hasWebFileSystemAccess",!1,!0),a1t=new Q("embedderIdentifier",void 0,g(488,"The identifier of the embedder according to the product service, if one is defined"));new Q("activeEditorIsDirty",!1,g(489,"Whether the active editor has unsaved changes"));new Q("activeEditorIsNotPreview",!1,g(490,"Whether the active editor is not in preview mode"));new Q("activeEditorIsFirstInGroup",!1,g(491,"Whether the active editor is the first one in its group"));new Q("activeEditorIsLastInGroup",!1,g(492,"Whether the active editor is the last one in its group"));new Q("activeEditorIsPinned",!1,g(493,"Whether the active editor is pinned"));new Q("activeEditorIsReadonly",!1,g(494,"Whether the active editor is read-only"));new Q("activeCompareEditorCanSwap",!1,g(495,"Whether the active compare editor can swap sides"));const c1t=new Q("activeEditorCanToggleReadonly",!0,g(496,"Whether the active editor can toggle between being read-only or writeable"));new Q("activeEditorCanRevert",!1,g(497,"Whether the active editor can revert"));new Q("activeEditorCanSplitInGroup",!0);const cJe=new Q("activeEditor",null,{type:"string",description:g(498,"The identifier of the active editor")});new Q("activeEditorAvailableEditorIds","",g(499,"The available editor identifiers that are usable for the active editor"));new Q("textCompareEditorVisible",!1,g(500,"Whether a text compare editor is visible"));const Mae=new Q("textCompareEditorActive",!1,g(501,"Whether a text compare editor is active"));new Q("sideBySideEditorActive",!1,g(502,"Whether a side by side editor is active"));new Q("groupEditorsCount",0,g(503,"The number of opened editor groups"));const l1t=new Q("activeEditorGroupEmpty",!1,g(504,"Whether the active editor group is empty")),d1t=new Q("activeEditorGroupIndex",0,g(505,"The index of the active editor group")),h1t=new Q("activeEditorGroupLast",!1,g(506,"Whether the active editor group is the last group")),u1t=new Q("activeEditorGroupLocked",!1,g(507,"Whether the active editor group is locked")),g1t=new Q("multipleEditorGroups",!1,g(508,"Whether there are multiple editor groups opened"));new Q("multipleEditorsSelectedInGroup",!1,g(509,"Whether multiple editors have been selected in an editor group"));new Q("twoEditorsSelectedInGroup",!1,g(510,"Whether exactly two editors have been selected in an editor group"));new Q("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,g(511,"Whether all selected editors in a group have a file or untitled resource associated"));new Q("editorPartMultipleEditorGroups",!1,g(512,"Whether there are multiple editor groups opened in an editor part"));new Q("editorPartMaximizedEditorGroup",!1,g(513,"Editor Part has a maximized group"));new Q("isAuxiliaryEditorPart",!1,g(514,"Editor Part is in an auxiliary window"));const f1t=new Q("editorIsOpen",!1,g(515,"Whether an editor is open")),p1t=new Q("inZenMode",!1,g(516,"Whether Zen mode is enabled")),m1t=new Q("isCenteredLayout",!1,g(517,"Whether centered layout is enabled for the main editor")),_1t=new Q("splitEditorsVertically",!1,g(518,"Whether editors split vertically")),v1t=new Q("mainEditorAreaVisible",!0,g(519,"Whether the editor area in the main window is visible")),b1t=new Q("editorTabsVisible",!0,g(520,"Whether editor tabs are visible")),w1t=new Q("sideBarVisible",!1,g(521,"Whether the sidebar is visible"));new Q("sideBarFocus",!1,g(522,"Whether the sidebar has keyboard focus"));new Q("activeViewlet","",g(523,"The identifier of the active viewlet"));new Q("statusBarFocused",!1,g(524,"Whether the status bar has keyboard focus"));const y1t=new Q("titleBarStyle",pr?"native":"custom",g(525,"Style of the window title bar")),C1t=new Q("titleBarVisible",!1,g(526,"Whether the title bar is visible"));new Q("bannerFocused",!1,g(527,"Whether the banner has keyboard focus"));new Q("notificationFocus",!0,g(528,"Whether a notification has keyboard focus"));new Q("notificationCenterVisible",!1,g(529,"Whether the notifications center is visible"));new Q("notificationToastsVisible",!1,g(530,"Whether a notification toast is visible"));new Q("activeAuxiliary","",g(531,"The identifier of the active auxiliary panel"));new Q("auxiliaryBarFocus",!1,g(532,"Whether the auxiliary bar has keyboard focus"));const S1t=new Q("auxiliaryBarVisible",!1,g(533,"Whether the auxiliary bar is visible"));new Q("activePanel","",g(534,"The identifier of the active panel"));new Q("panelFocus",!1,g(535,"Whether the panel has keyboard focus"));const A1t=new Q("panelPosition","bottom",g(536,"The position of the panel, always 'bottom'")),E1t=new Q("panelAlignment","center",g(537,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),x1t=new Q("panelVisible",!1,g(538,"Whether the panel is visible")),D1t=new Q("panelMaximized",!1,g(539,"Whether the panel is maximized")),FU=new Q("focusedView","",g(540,"The identifier of the view that has keyboard focus"));var Ng;let M3=(Ng=class{constructor(e,t,i,n){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=n,this._disposables=new Z,this._schemeKey=wv.Scheme.bindTo(this._contextKeyService),this._filenameKey=wv.Filename.bindTo(this._contextKeyService),this._dirnameKey=wv.Dirname.bindTo(this._contextKeyService),this._pathKey=wv.Path.bindTo(this._contextKeyService),this._langIdKey=wv.LangId.bindTo(this._contextKeyService),this._resourceKey=wv.Resource.bindTo(this._contextKeyService),this._extensionKey=wv.Extension.bindTo(this._contextKeyService),this._hasResource=wv.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=wv.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(n.onModelAdded(o=>{ji(o.uri,this.get())&&this._setLangId()})),this._disposables.add(n.onModelLanguageChanged(o=>{ji(o.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}_setLangId(){const e=this.get();if(!e){this._langIdKey.set(null);return}const t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!ji(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?_i(e):null),this._dirnameKey.set(e?this.uriToPath(Lr(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?vU(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}},wv=Ng,Ng.Scheme=new Q("resourceScheme",void 0,{type:"string",description:g(541,"The scheme of the resource")}),Ng.Filename=new Q("resourceFilename",void 0,{type:"string",description:g(542,"The file name of the resource")}),Ng.Dirname=new Q("resourceDirname",void 0,{type:"string",description:g(543,"The folder name the resource is contained in")}),Ng.Path=new Q("resourcePath",void 0,{type:"string",description:g(544,"The full path of the resource")}),Ng.LangId=new Q("resourceLangId",void 0,{type:"string",description:g(545,"The language identifier of the resource")}),Ng.Resource=new Q("resource",void 0,{type:"URI",description:g(546,"The full value of the resource including scheme and path")}),Ng.Extension=new Q("resourceExtname",void 0,{type:"string",description:g(547,"The extension name of the resource")}),Ng.HasResource=new Q("resourceSet",void 0,{type:"boolean",description:g(548,"Whether a resource is present or not")}),Ng.IsFileSystemResource=new Q("isFileSystemResource",void 0,{type:"boolean",description:g(549,"Whether the resource is backed by a file system provider")}),Ng);M3=wv=D([_(0,Le),_(1,Jt),_(2,xi),_(3,gi)],M3);function k1t(s,e){return s.invokeFunction(t=>b_.getServiceDependencies(e).sort((i,n)=>i.index-n.index).map(i=>t.get(i.id)))}function BRe(s){const e=s;return class extends e{constructor(...t){super(...t.slice(1),...k1t(t[0],s))}}}class WRe{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}class KWe{constructor(e){this.identifier=e}}const Nae=ae("treeViewsDndService");ce(Nae,WRe,qt.Delayed);const lJe=ae("extensionHostDebugService"),I1t="diagnosticsService";class T1t{async getPerformanceInfo(e,t){return{}}async getSystemInfo(e,t){return{processArgs:"nullProcessArgs",gpuStatus:"nullGpuStatus",screenReader:"nullScreenReader",remoteData:[],os:"nullOs",memory:"nullMemory",vmHint:"nullVmHint"}}async getDiagnostics(e,t){return""}async getWorkspaceFileExtensions(e){return{extensions:[]}}async reportWorkspaceStats(e){}}const L1t=ae(I1t),HRe=ae("downloadService"),R1t=ae("encryptionService"),EI=ae("extensionGalleryService"),k6=ae("extensionManagementService"),dJe=ae("IGlobalExtensionEnablementService"),M1t=ae("IExtensionTipsService"),N3=ae("IExtensionStorageService"),Pae=ae("IExtensionsProfileScannerService"),N1t=ae("IExtensionsScannerService"),P1t=ae("IExtensionRecommendationNotificationService"),Fae=ae("extensionResourceLoaderService"),F1t=ae("IBuiltinExtensionsScannerService"),Oae=ae("keyboardLayoutService"),hJe=ae("languagePackService");class uJe{constructor(){this.onDidChange=M.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Er=ae("productService"),pC=ae("remoteAuthorityResolverService"),Bae=ae("IRemoteExtensionsScannerService"),URe=ae("remoteSocketFactoryService"),I6=ae("requestService"),gJe=ae("secretStorageService"),O1t="signService",fJe=ae(O1t);let Wae=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class B1t{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const W1t="extensionTelemetryLog";function Yq(s,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!s.enableTelemetry)}function VRe(s,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}function H1t(s){const e=s.getValue(uje),t=s.getValue(iAt);if(s.getValue(gje)===!1||t===!1)return Kg.NONE;switch(e??Q0.ON){case Q0.ON:return Kg.USAGE;case Q0.ERROR:return Kg.ERROR;case Q0.CRASH:return Kg.CRASH;case Q0.OFF:return Kg.NONE}}const U1t=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function V1t(s){if(!s)return"none";const e=D6(s);return U1t.has(e)?e:"other"}function z1t(s,e){if(!s||!s.includes("/")&&!s.includes("\\"))return s;let t=s;const i=[];for(const a of e)for(;;){const c=a.exec(s);if(!c)break;i.push([c.index,a.lastIndex])}const n=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(s);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return s}function qWe(s,e){return S2(s,t=>{if(t instanceof Wae||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=z1t(i,e);for(const n of e)i=i.replace(n,"");return i=$1t(i),i}})}var QWe;(function(s){s.AutomationProfile="terminal.integrated.automationProfile.",s.DefaultProfile="terminal.integrated.defaultProfile.",s.Profiles="terminal.integrated.profiles."})(QWe||(QWe={}));var Ww;(function(s){s.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",s.AutomationProfileLinux="terminal.integrated.automationProfile.linux",s.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",s.AutomationProfileWindows="terminal.integrated.automationProfile.windows",s.ProfilesWindows="terminal.integrated.profiles.windows",s.ProfilesMacOs="terminal.integrated.profiles.osx",s.ProfilesLinux="terminal.integrated.profiles.linux",s.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",s.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",s.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",s.UseWslProfiles="terminal.integrated.useWslProfiles",s.TabsDefaultColor="terminal.integrated.tabs.defaultColor",s.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",s.TabsEnabled="terminal.integrated.tabs.enabled",s.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",s.TabsHideCondition="terminal.integrated.tabs.hideCondition",s.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",s.TabsShowActions="terminal.integrated.tabs.showActions",s.TabsLocation="terminal.integrated.tabs.location",s.TabsFocusMode="terminal.integrated.tabs.focusMode",s.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",s.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",s.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",s.CopyOnSelection="terminal.integrated.copyOnSelection",s.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",s.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",s.FontFamily="terminal.integrated.fontFamily",s.FontSize="terminal.integrated.fontSize",s.LetterSpacing="terminal.integrated.letterSpacing",s.LineHeight="terminal.integrated.lineHeight",s.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",s.TabStopWidth="terminal.integrated.tabStopWidth",s.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",s.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",s.BellDuration="terminal.integrated.bellDuration",s.FontWeight="terminal.integrated.fontWeight",s.FontWeightBold="terminal.integrated.fontWeightBold",s.CursorBlinking="terminal.integrated.cursorBlinking",s.CursorStyle="terminal.integrated.cursorStyle",s.CursorStyleInactive="terminal.integrated.cursorStyleInactive",s.CursorWidth="terminal.integrated.cursorWidth",s.Scrollback="terminal.integrated.scrollback",s.DetectLocale="terminal.integrated.detectLocale",s.DefaultLocation="terminal.integrated.defaultLocation",s.GpuAcceleration="terminal.integrated.gpuAcceleration",s.TerminalTitleSeparator="terminal.integrated.tabs.separator",s.TerminalTitle="terminal.integrated.tabs.title",s.TerminalDescription="terminal.integrated.tabs.description",s.RightClickBehavior="terminal.integrated.rightClickBehavior",s.MiddleClickBehavior="terminal.integrated.middleClickBehavior",s.Cwd="terminal.integrated.cwd",s.ConfirmOnExit="terminal.integrated.confirmOnExit",s.ConfirmOnKill="terminal.integrated.confirmOnKill",s.EnableBell="terminal.integrated.enableBell",s.EnableVisualBell="terminal.integrated.enableVisualBell",s.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",s.AllowChords="terminal.integrated.allowChords",s.AllowMnemonics="terminal.integrated.allowMnemonics",s.TabFocusMode="terminal.integrated.tabFocusMode",s.EnvMacOs="terminal.integrated.env.osx",s.EnvLinux="terminal.integrated.env.linux",s.EnvWindows="terminal.integrated.env.windows",s.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",s.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",s.ShowExitAlert="terminal.integrated.showExitAlert",s.SplitCwd="terminal.integrated.splitCwd",s.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",s.WordSeparators="terminal.integrated.wordSeparators",s.EnableFileLinks="terminal.integrated.enableFileLinks",s.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",s.UnicodeVersion="terminal.integrated.unicodeVersion",s.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",s.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",s.HideOnStartup="terminal.integrated.hideOnStartup",s.CustomGlyphs="terminal.integrated.customGlyphs",s.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",s.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",s.InheritEnv="terminal.integrated.inheritEnv",s.ShowLinkHover="terminal.integrated.showLinkHover",s.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",s.AutoReplies="terminal.integrated.autoReplies",s.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",s.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",s.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",s.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",s.EnableImages="terminal.integrated.enableImages",s.SmoothScrolling="terminal.integrated.smoothScrolling",s.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",s.FocusAfterRun="terminal.integrated.focusAfterRun",s.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",s.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",s.DevMode="terminal.integrated.developer.devMode"})(Ww||(Ww={}));var jWe;(function(s){s.PowerShell="pwsh",s.Bash="bash",s.Fish="fish",s.Sh="sh",s.Csh="csh",s.Ksh="ksh",s.Zsh="zsh",s.Python="python"})(jWe||(jWe={}));var YWe;(function(s){s.CommandPrompt="cmd",s.PowerShell="pwsh",s.Wsl="wsl",s.GitBash="gitbash",s.Python="python"})(YWe||(YWe={}));var JWe;(function(s){s[s.Api=0]="Api",s[s.Process=1]="Process",s[s.Sequence=2]="Sequence",s[s.Config=3]="Config"})(JWe||(JWe={}));var Og;(function(s){s.Cwd="cwd",s.InitialCwd="initialCwd",s.FixedDimensions="fixedDimensions",s.Title="title",s.ShellType="shellType",s.HasChildProcesses="hasChildProcesses",s.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",s.OverrideDimensions="overrideDimensions",s.FailedShellIntegrationActivation="failedShellIntegrationActivation",s.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(Og||(Og={}));var fW;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(fW||(fW={}));var XWe;(function(s){s.TerminalView="view",s.Editor="editor"})(XWe||(XWe={}));var ZWe;(function(s){s[s.HighWatermarkChars=1e5]="HighWatermarkChars",s[s.LowWatermarkChars=5e3]="LowWatermarkChars",s[s.CharCountAckSize=5e3]="CharCountAckSize"})(ZWe||(ZWe={}));var eHe;(function(s){s[s.Off=0]="Off",s[s.FinalTerm=1]="FinalTerm",s[s.VSCode=2]="VSCode"})(eHe||(eHe={}));var kT;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})(kT||(kT={}));const G1t={Backend:"workbench.contributions.terminal.processBackend"};function Dve(s){return s?.toLowerCase()??""}class K1t{constructor(e){this.remoteAuthority=e}affects(e){return Dve(e)===this.remoteAuthority}}class q1t{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=Dve(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new K1t(t))}getTerminalBackend(e){return this._backends.get(Dve(e))}}Qe.add(G1t.Backend,new q1t);const Q1t=ae("terminalLogService"),Hae=ae("tunnelService");var Tv;(function(s){s.Uninitialized="uninitialized",s.Idle="idle",s.Disabled="disabled",s.CheckingForUpdates="checking for updates",s.AvailableForDownload="available for download",s.Downloading="downloading",s.Downloaded="downloaded",s.Updating="updating",s.Ready="ready"})(Tv||(Tv={}));var tHe;(function(s){s[s.Setup=0]="Setup",s[s.Archive=1]="Archive",s[s.Snap=2]="Snap"})(tHe||(tHe={}));var iHe;(function(s){s[s.NotBuilt=0]="NotBuilt",s[s.DisabledByEnvironment=1]="DisabledByEnvironment",s[s.ManuallyDisabled=2]="ManuallyDisabled",s[s.MissingConfiguration=3]="MissingConfiguration",s[s.InvalidConfiguration=4]="InvalidConfiguration",s[s.RunningAsAdmin=5]="RunningAsAdmin"})(iHe||(iHe={}));const j1t={Uninitialized:{type:Tv.Uninitialized},Disabled:s=>({type:Tv.Disabled,reason:s}),Idle:(s,e)=>({type:Tv.Idle,updateType:s,error:e}),CheckingForUpdates:s=>({type:Tv.CheckingForUpdates,explicit:s}),AvailableForDownload:s=>({type:Tv.AvailableForDownload,update:s}),Downloading:{type:Tv.Downloading},Downloaded:s=>({type:Tv.Downloaded,update:s}),Updating:s=>({type:Tv.Updating,update:s}),Ready:s=>({type:Tv.Ready,update:s})},pJe=ae("updateService");var nHe;let Vhe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const b4=void 0;class J0{constructor(e,t=2**16){this.comparator=e,this[nHe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new Vhe(this._maxLevel,b4,b4)}get size(){return this._size}clear(){this._header=new Vhe(this._maxLevel,b4,b4),this._size=0}has(e){return!!J0._search(this,e,this.comparator)}get(e){return J0._search(this,e,this.comparator)?.value}set(e,t){return J0._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=J0._delete(this,e,this.comparator);return t&&(this._size-=1),t}forEach(e,t){let i=this._header.forward[0];for(;i;)e.call(t,i.value,i.key,this),i=i.forward[0]}[(nHe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this._header.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this._header.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this._header.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",t=this._header.forward[0];for(;t;)e+=`node(${t.key}, ${t.value}, lvl:${t.level})`,t=t.forward[0];return e}static _search(e,t,i){let n=e._header;for(let o=e._level-1;o>=0;o--)for(;n.forward[o]&&i(n.forward[o].key,t)<0;)n=n.forward[o];if(n=n.forward[0],n&&i(n.key,t)===0)return n}static _insert(e,t,i,n){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&n(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&n(r.key,t)===0)return r.value=i,!1;{const a=J0._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;r--){for(;o.forward[r]&&i(o.forward[r].key,t)<0;)o=o.forward[r];n[r]=o}if(o=o.forward[0],!o||i(o.key,t)!==0)return!1;for(let r=0;r0&&e._header.forward[e._level-1]===b4;)e._level-=1;return!0}}const Gz=class Gz{constructor(e){this.uri=e,this.time=Gz._clock++}touch(){return this.time=Gz._clock++,this}};Gz._clock=0;let FJ=Gz,kve=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=n=>{let o=t.get(n.scheme);return o===void 0&&(o=e.hasProvider(n)&&!this._fileService.hasCapability(n,Vn.PathCaseSensitive),t.set(n.scheme,o)),o};this._dispooables.add(M.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(n=>{t.delete(n.scheme)})),this.extUri=new xN(i),this._canonicalUris=new J0((n,o)=>this.extUri.compare(n,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=xGe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new FJ(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].timen[1].time?-1:0);FJ._clock=0,this._canonicalUris.clear();const t=this._limit*.5;for(let i=0;ie.accessor.dispose()),this._entries.clear(),this._onDidChange.dispose()}setOrUpdateEntry(e,t,i,n,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=UQe(o),r){const y=typeof r=="string"?r:r.value;f+=`, ${y}`}let m;switch(l?.id){case lHe:case bTt:m=l.id===lHe?"error":"warning",c=void 0,l=void 0}const v={name:n,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let b=d?O3.LEFT:O3.RIGHT;const w=this._entries.get(e);if(w&&(b=w.alignment,h=w.priority),w)return w.accessor.update(v),w.entry=v,B3.DidUpdate;{let y;typeof i=="string"?y={primary:h,secondary:Wc(i)}:y=h;const C=this._statusbarService.addEntry(v,t,b,y);return this._entries.set(e,{accessor:C,entry:v,alignment:b,priority:h,disposable:Ee(()=>{C.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:b,priority:h}]}),B3.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};Lve=D([_(0,QRe)],Lve);ce(jRe,Lve,qt.Delayed);const kTt=ae("IEditorBreadcrumbsService"),Rx=new bn(220,70),BJ=new bn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Vae={showTabs:"multiple",highlightModifiedTabs:!1,tabActionLocation:"right",tabActionCloseVisibility:!0,tabActionUnpinVisibility:!0,alwaysShowEditorActions:!1,tabSizing:"fit",tabSizingFixedMinWidth:50,tabSizingFixedMaxWidth:160,pinnedTabSizing:"normal",pinnedTabsOnSeparateRow:!1,tabHeight:"default",preventPinnedEditorClose:"keyboardAndMouse",titleScrollbarSizing:"default",focusRecentEditorAfterClose:!0,showIcons:!0,hasIcons:!0,enablePreview:!0,openPositioning:"right",openSideBySideDirection:"right",closeEmptyGroups:!0,labelFormat:"default",splitSizing:"auto",splitOnDragAndDrop:!0,dragToOpenWindow:!0,centeredLayoutFixedWidth:!1,doubleClickTabToToggleEditorGroupSizes:"expand",editorActionsLocation:"default",wrapTabs:!1,enablePreviewFromQuickOpen:!1,scrollToSwitchTabs:!1,enablePreviewFromCodeNavigation:!1,closeOnFileDelete:!1,mouseBackForwardToNavigate:!0,restoreViewState:!0,splitInGroupLayout:"horizontal",revealIfOpen:!1,get limit(){return{enabled:!1,value:10,perEditorGroup:!1,excludeDirty:!1}},get decorations(){return{badges:!0,colors:!0}},get autoLockGroups(){return new Set}},xm=ae("viewDescriptorService"),Dm=ae("accessibleViewService"),UN=ae("chatWidgetService"),ITt=ae("quickChatService"),DJe=ae("chatAccessibilityService"),TTt=ae("chatCodeBlockContextProviderService"),_f=ae("chatAgentService"),zae=ae("chatAgentNameService"),km=ae("IChatService"),YRe=ae("chatSlashCommandService"),L6=ae("IChatVariablesService"),kJe=ae("IChatWidgetHistoryService"),IJe=ae("ILanguageModelsService"),eE=ae("commentService"),JRe=ae("customEditorService"),XRe=ae("debugService"),TJe=ae("debugVisualizerService"),LTt=ae("IEditSessionsStorageService"),RTt=ae("IEditSessionsLogService"),Xo=ae("extensionsWorkbenchService"),LJe=ae("externalUriOpenerService"),vf=ae("explorerService"),RJe=ae("IInlineChatSavingService "),ZRe=ae("IInlineChatSessionService"),eMe=ae("IInteractiveDocumentService"),MJe=ae("IInteractiveHistoryService"),MTt=ae("IDefaultLogLevelsService"),NJe=ae("multiDiffSourceResolverService"),R6=ae("INotebookEditorWidgetService"),PJe=ae("notebookCellStatusBarService"),$ae=ae("INotebookModelResolverService"),NTt=ae("INotebookExecutionService"),FJe=ae("INotebookExecutionStateService"),OJe=ae("INotebookKernelService"),PTt=ae("INotebookKernelHistoryService"),FTt=ae("notebookKeymapService"),OTt=ae("INotebookLoggingService"),BJe=ae("INotebookRendererMessagingService"),tE=ae("notebookService"),BTt="notebookEditorWorkerService",WTt=ae(BTt),HTt=ae("outputChannelModelService"),UTt=ae("preferencesSearchService"),M6=ae("quickDiff"),tMe=ae("scm"),WJe=ae("scmView"),VTt=ae("replaceService"),zTt=ae("searchViewModelWorkbenchService"),$Tt=ae("notebookSearchService"),GTt=ae("searchHistoryService"),HJe=ae("shareService"),Gae=ae("snippetService"),Kae=ae("speechService");class KTt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const qTt=ae("workspaceTagsService"),UJe=ae("taskService"),OU=ae("terminalService"),QTt=ae("terminalConfigurationService"),VJe=ae("terminalEditorService"),iMe=ae("terminalGroupService"),zJe=ae("terminalInstanceService"),$Je=ae("environmentVariableService"),GJe=ae("terminalProfileResolverService"),KJe=ae("terminalProfileService"),jTt=ae("terminalContributionsService"),qJe=ae("terminalLinkProviderService"),QJe=ae("terminalQuickFixService"),YTt=ae("testCoverageService"),JTt=ae("testingFilterState"),jJe=ae("testProfileService"),YJe=ae("testResultService"),XTt=ae("ITestResultStorage"),JJe=ae("testService"),ZTt=ae("testingContinuousRunService"),eLt=ae("testingDecorationService"),tLt=ae("testingPeekOpener"),iLt="timeline",XJe=ae(iLt),qae=ae("webviewService"),N6=ae("webviewEditorService"),ZJe=ae("webviewViewService"),nLt=ae("walkthroughsService"),sLt=ae("activityService"),eXe=ae("IAiEmbeddingVectorService"),nMe=ae("IAiRelatedInformationService"),tXe=ae("WorkbenchAssignmentService"),Qae=ae("IAuthenticationAccessService"),iXe=ae("IAuthenticationUsageService"),sMe=ae("IAuthenticationService"),nXe=ae("IAuthenticationExtensionsService"),sXe=ae("auxiliaryWindowService"),oLt=ae("bannerService"),DI=ae("jsonEditingService"),oMe=ae("configurationResolverService"),iE=ae("IFileDecorationsService"),nE=ae("ICustomEditorLabelService"),Po=ae("editorGroupsService"),oXe=ae("editorPaneService"),BU=ae("editorResolverService"),ei=ae("editorService"),WU=ae("IExtensionBisectService"),rXe=ae("IExtensionFeaturesManagementService"),rLt=k6,dv=ae("extensionManagementServerService"),P6=rLt,Nl=ae("extensionEnablementService"),rMe=ae("IWebExtensionsScannerService"),aXe=ae("extensionRecommendationsService"),jae=ae("IExtensionIgnoredRecommendationsService"),aLt=ae("IWorkspaceExtensionsConfigService"),cXe=ae("extensionUrlHandler"),Im=ae("extensionManifestPropertiesService"),fs=ae("extensionService"),F6=ae("elevatedFileService"),_d=ae("filesConfigurationService"),cLt=ae("historyService"),xc=ae("hostService"),lLt=ae("ITroubleshootIssueService"),dLt=ae("issueFormService"),hLt=ae("workbenchIssueService");class Rve{constructor(e,t){this._mapAltGrToCtrlAlt=e,this._OS=t}dumpDebugInfo(){return"FallbackKeyboardMapper dispatching on keyCode"}resolveKeyboardEvent(e){const t=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,i=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,n=new Ih(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new IO([n]))[0]}resolveKeybinding(e){return Y2.resolveKeybinding(e,this._OS)}}const uLt=ae("keybindingEditingService"),O6=ae("ILanguageDetectionService"),Yae=ae("ILanguageStatusService"),ig=ae("lifecycleService");var Mve;(function(s){s[s.Default=1]="Default",s[s.Last=2]="Last"})(Mve||(Mve={}));var lD;(function(s){s[s.CLOSE=1]="CLOSE",s[s.QUIT=2]="QUIT",s[s.RELOAD=3]="RELOAD",s[s.LOAD=4]="LOAD"})(lD||(lD={}));var M5;(function(s){s[s.NewWindow=1]="NewWindow",s[s.ReloadedWindow=3]="ReloadedWindow",s[s.ReopenedWindow=4]="ReopenedWindow"})(M5||(M5={}));var Rs;(function(s){s[s.Starting=1]="Starting",s[s.Ready=2]="Ready",s[s.Restored=3]="Restored",s[s.Eventually=4]="Eventually"})(Rs||(Rs={}));function gLt(s){switch(s){case Rs.Starting:return"Starting";case Rs.Ready:return"Ready";case Rs.Restored:return"Restored";case Rs.Eventually:return"Eventually"}}var dV,bL;let Nve=(bL=class extends V{get startupKind(){return this._startupKind}get phase(){return this._phase}constructor(e,t){super(),this.logService=e,this.storageService=t,this._onBeforeShutdown=this._register(new I),this.onBeforeShutdown=this._onBeforeShutdown.event,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this._onBeforeShutdownError=this._register(new I),this.onBeforeShutdownError=this._onBeforeShutdownError.event,this._onShutdownVeto=this._register(new I),this.onShutdownVeto=this._onShutdownVeto.event,this._phase=Rs.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===wy.SHUTDOWN&&this.storageService.store(dV.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,Ie.WORKSPACE,an.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??M5.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(dV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);this.storageService.remove(dV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);let t;switch(e){case lD.RELOAD:t=M5.ReloadedWindow;break;case lD.LOAD:t=M5.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Sn.toKey(i.identifier)]=n)}return t}_readActivationEvents(e){if(typeof e.main>"u"&&typeof e.browser>"u")return[];const t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let i=0;ie)throw new Error(`ExtensionHostExtensions: invalid versionId ${e} (current: ${this._versionId})`);const n=[],o=[],r=[],a=[],c=bHe(this._allExtensions),l=bHe(t),d=(m,v)=>m.extensionLocation.toString()===v.extensionLocation.toString()||m.isBuiltin===v.isBuiltin||m.isUserBuiltin===v.isUserBuiltin||m.isUnderDevelopment===v.isUnderDevelopment;for(const m of this._allExtensions){const v=l.get(m.identifier);if(!v){n.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){n.push(m.identifier),c.delete(m.identifier);continue}}for(const m of t){const v=c.get(m.identifier);if(!v){o.push(m);continue}if(!d(v,m)){n.push(v.identifier),c.delete(v.identifier);continue}}const h=new A_(this._myExtensions),u=new A_(i);for(const m of this._myExtensions)u.has(m)||r.push(m);for(const m of i)h.has(m)||a.push(m);const f=JO.createActivationEventsMap(o),p={versionId:e,toRemove:n,toAdd:o,addActivationEvents:f,myToRemove:r,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:n,myToAdd:o}=e,r=new A_(t),a=new A_(n);for(let c=0;csetTimeout(e,s))}function zLt(s,e,t){let i=Promise.resolve(),n=null;return async o=>{n==null?(n=o,i=i.then(async()=>VLt(t)).then(async()=>{const r=n;n=null,await s(r)})):n=e(n,o),await i}}const $Lt={};let GLt;function KLt(s){return $Lt[s]}function qLt(){return GLt}var gK;ce(uf,class extends _Qe{constructor(){super(Gn.Info,N.file("logs.log"))}doCreateLogger(){return new vQe}},0);ce(ei,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=M.None,this.onDidActiveEditorChange=M.None,this.onDidVisibleEditorsChange=M.None,this.onDidEditorsChange=M.None,this.onDidCloseEditor=M.None,this.activeEditorPane=void 0,this.activeEditor=void 0,this.activeTextEditorLanguageId=void 0,this.visibleEditorPanes=[],this.visibleEditors=[],this.visibleTextEditorControls=[],this.editors=[],this.count=0,this.getEditors=()=>[],this.openEditor=E,this.openEditors=E,this.replaceEditors=async()=>{},this.isOpened=()=>!1,this.isVisible=()=>!1,this.closeEditor=async()=>{},this.closeEditors=async()=>{},this.findEditors=()=>[],this.save=async()=>({success:!1,editors:[]}),this.saveAll=async()=>({success:!1,editors:[]}),this.revert=async()=>!1,this.revertAll=async()=>!1}get activeTextEditorControl(){return Dt.get(Kt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Tm,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=M.None,this.onDidPaneCompositeClose=M.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=E,this.showActivity=()=>V.None}},0);ce(ks,kve,1);ce(Fo,class{constructor(){this.isDirty=E,this.save=E,this.saveAs=E,this.revert=E,this.read=E,this.readStream=E,this.write=E,this.create=E,this.getEncodedReadable=E,this.getDecodedStream=E,this.dispose=E}get files(){return E()}get untitled(){return E()}get encoding(){return E()}},0);ce(Jt,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=M.None,this.onDidChangeFileSystemProviderCapabilities=M.None,this.onWillActivateFileSystemProvider=M.None,this.registerProvider=E,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=M.None,this.onDidRunOperation=M.None,this.resolve=E,this.resolveAll=E,this.stat=E,this.exists=async()=>!1,this.readFile=E,this.readFileStream=E,this.writeFile=E,this.move=E,this.canMove=E,this.copy=E,this.canCopy=E,this.cloneFile=E,this.createFile=E,this.canCreateFile=E,this.createFolder=E,this.del=E,this.canDelete=E,this.onDidWatchError=M.None,this.watch=E,this.createWatcher=E}dispose(){}},0);let QLt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=E,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=E,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=E,this.notifyIndexChanged=E,this.relayout=E,this.dispose=E,this.toJSON=E,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=E,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=E,this.openEditor=E,this.openEditors=E,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=E,this.moveEditors=E,this.copyEditor=E,this.copyEditors=E,this.closeEditor=E,this.closeEditors=E,this.closeAllEditors=E,this.replaceEditors=E,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=E,this.isLast=E}get groupsView(){return E()}notifyLabelChanged(){}get titleHeight(){return E()}get element(){return E()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}};const HJ=new QLt;let jLt=class{constructor(){this.windowId=si.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=E,this.isLayoutCentered=E,this.enforcePartOptions=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=HJ,this.groups=[HJ],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.applyLayout=E,this.getLayout=E,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.partOptions=Vae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=E}get contentDimension(){return E()}get sideGroup(){return E()}},YLt=class{constructor(){this.registerContextKeyProvider=E,this.saveWorkingSet=E,this.getWorkingSets=E,this.applyWorkingSet=E,this.deleteWorkingSet=E,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new jLt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=E,this.createAuxiliaryEditorPart=E,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.partOptions=Vae,this.createEditorDropTarget=E,this._serviceBrand=void 0,this.getLayout=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=HJ,this.groups=[HJ],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.applyLayout=E,this.centerLayout=E,this.isLayoutCentered=()=>!1,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=E}get contentDimension(){return E()}get sideGroup(){return E()}};ce(Po,YLt,0);ce(oLt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(_Lt,class{constructor(){this.getPart=E,this.createAuxiliaryTitlebarPart=E,this.dispose=E,this.onMenubarVisibilityChange=M.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=M.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(zb,class{constructor(){this.onWillRunWorkingCopyFileOperation=M.None,this.onDidFailWorkingCopyFileOperation=M.None,this.onDidRunWorkingCopyFileOperation=M.None,this.addFileOperationParticipant=E,this.hasSaveParticipants=!1,this.addSaveParticipant=E,this.runSaveParticipants=E,this.create=E,this.createFolder=E,this.move=E,this.copy=E,this.delete=E,this.registerWorkingCopyProvider=E,this.getDirty=()=>[]}},0);ce(bf,class{constructor(){this.defaultUriScheme="file",this.fileURI=E,this.userHome=E,this.hasValidBasename=E,this.resolvedUserHome=void 0}get path(){return E()}},1);ce(Er,class{constructor(){this._serviceBrand=void 0,this.version="1.92.2",this.commit="fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",this.quality="oss",this.nameShort="Code - OSS Dev",this.nameLong="Code - OSS Dev",this.applicationName="code-oss",this.dataFolderName=".vscode-oss",this.urlProtocol="code-oss",this.reportIssueUrl="https://github.com/microsoft/vscode/issues/new",this.licenseName="MIT",this.licenseUrl="https://github.com/microsoft/vscode/blob/main/LICENSE.txt",this.serverApplicationName="code-server-oss"}},0);ce(M1t,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(Yae,class{constructor(){this.onDidChange=M.None,this.addStatus=E,this.getLanguageStatus=E}},1);ce(xc,class{constructor(){this.getPathForFile=()=>{},this.onDidChangeFullScreen=M.None,this.onDidChangeFocus=M.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=E,this.onDidChangeActiveWindow=M.None,this.openWindow=E,this.toggleFullScreen=E,this.moveTop=E,this.getCursorScreenPoint=E,this.restart=E,this.reload=E,this.close=E,this.withExpectedShutdown=E}},0);ce(ig,class extends Nve{constructor(){super(...arguments),this.shutdown=E}},0);ce(O6,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(fs,BLt,0);ce(Oae,class{constructor(){this.onDidChangeKeyboardLayout=M.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new Rve(!1,po),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(tce,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(uXe,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=M.None}},0);let Pve=class{constructor(e){this.profileService=e,this.onDidDefaultSettingsContentChanged=M.None,this.getDefaultSettingsContent=()=>{},this.hasDefaultSettingsContent=()=>!1,this.getSetting=()=>{},this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=E,this.createPreferencesEditorModel=E,this.resolveModel=E,this.createSettings2EditorModel=E,this.openRawDefaultSettings=E,this.openSettings=E,this.openUserSettings=E,this.openRemoteSettings=E,this.openWorkspaceSettings=E,this.openFolderSettings=E,this.openGlobalKeybindingSettings=E,this.openDefaultKeybindingsFile=E,this.getEditableSettingsURI=E,this.createSplitJsonEditorInput=E,this.openApplicationSettings=E,this.openLanguageSpecificSettings=E}};Pve=D([_(0,ug)],Pve);ce(B6,Pve,0);ce(mLt,class{constructor(){this.onDidEncounterLanguage=M.None,this.createGrammar=E,this.startDebugMode=E,this.createTokenizer=E}},0);let Fve=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=M.None,this.isEnabled=()=>!1,this.createNamedProfile=E,this.createTransientProfile=E,this.resetWorkspaces=E,this.cleanUp=E,this.cleanUpTransientProfiles=E,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=M.None,this.profiles=[this.profileService.currentProfile],this.createProfile=E,this.updateProfile=E,this.setProfileForWorkspace=E,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=E}get profilesHome(){return E()}};Fve=D([_(0,ug)],Fve);ce(Em,Fve,0);ce(HLt,class{constructor(){this.onDidChange=M.None,this.readStorageData=E,this.updateStorageData=E,this.withProfileScopedStorageService=E}},0);let Ove=class extends SLt{constructor(e){super({...cV("__default__profile__","Default",e.userRoamingDataHome,Pt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};Ove=D([_(0,Za)],Ove);ce(ug,Ove,0);ce(bRe,uJe,0);ce(Gae,class{constructor(){this.getSnippetFiles=E,this.isEnabled=E,this.updateEnablement=E,this.updateUsageTimestamp=E,this.getSnippets=async()=>[],this.getSnippetsSync=E}},0);const JLt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:M.None,onDidChangeCallStack:M.None,onDidChangeWatchExpressions:M.None,fetchCallstack:E,getId:E,registerBreakpointModes:E,getBreakpointModes:()=>[],onDidChangeWatchExpressionValue:M.None};class XLt{constructor(){this.setVisualizedExpression=E,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=M.None,this.getId=E,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=E,this.setSelectedExpression=E,this.updateViews=E,this.isMultiSessionView=E,this.onDidFocusSession=M.None,this.onDidFocusStackFrame=M.None,this.onDidSelectExpression=M.None,this.onDidEvaluateLazyExpression=M.None,this.onWillUpdateViews=M.None,this.onDidFocusThread=M.None,this.evaluateLazyExpression=E}}class ZLt{constructor(){this.onDidRegisterDebugger=M.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=E,this.getDebuggerLabel=E,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=E,this.registerDebugAdapterFactory=()=>V.None,this.createDebugAdapter=E,this.registerDebugAdapterDescriptorFactory=E,this.unregisterDebugAdapterDescriptorFactory=E,this.substituteVariables=E,this.runInTerminal=E,this.getEnabledDebugger=E,this.guessDebugger=E,this.onDidDebuggersExtPointRead=M.None}}ce(XRe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=E,this.updateDataBreakpoint=E,this.onDidChangeState=M.None,this.onDidNewSession=M.None,this.onWillNewSession=M.None,this.onDidEndSession=M.None,this.getConfigurationManager=E,this.getAdapterManager=()=>new ZLt,this.focusStackFrame=E,this.canSetBreakpointsIn=E,this.addBreakpoints=E,this.updateBreakpoints=E,this.enableOrDisableBreakpoints=E,this.setBreakpointsActivated=E,this.removeBreakpoints=E,this.addFunctionBreakpoint=E,this.updateFunctionBreakpoint=E,this.removeFunctionBreakpoints=E,this.addDataBreakpoint=E,this.removeDataBreakpoints=E,this.addInstructionBreakpoint=E,this.removeInstructionBreakpoints=E,this.setExceptionBreakpointCondition=E,this.setExceptionBreakpointsForSession=E,this.sendAllBreakpoints=E,this.addWatchExpression=E,this.renameWatchExpression=E,this.moveWatchExpression=E,this.removeWatchExpressions=E,this.startDebugging=E,this.restartSession=E,this.stopSession=E,this.sourceIsNotAvailable=E,this.getModel=()=>JLt,this.getViewModel=()=>new XLt,this.runTo=E}get state(){return E()}},0);ce(I6,class{constructor(){this.lookupAuthorization=E,this.lookupKerberosAuthorization=E,this.request=E,this.resolveProxy=E,this.loadCertificates=E}},0);ce(vae,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=M.None,this.completeOpenFilesTrustRequest=E,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=E,this.completeWorkspaceTrustRequest=E,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(sLt,class{constructor(){this.onDidChangeActivity=M.None,this.getViewContainerActivities=E,this.getActivity=E,this.showViewContainerActivity=()=>V.None,this.showViewActivity=()=>V.None,this.showAccountsActivity=()=>V.None,this.showGlobalActivity=()=>V.None}},0);ce(lJe,class{constructor(){this.reload=E,this.onReload=M.None,this.close=E,this.onClose=M.None,this.attachSession=E,this.onAttachSession=M.None,this.terminateSession=E,this.onTerminateSession=M.None,this.openExtensionDevelopmentHostWindow=E}},0);ce(Lm,class{constructor(){this.getFocusedViewName=E,this.onDidChangeFocusedView=M.None,this.onDidChangeViewContainerVisibility=M.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=E,this.closeViewContainer=E,this.getVisibleViewContainer=E,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=M.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=E,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(xm,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=M.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=E,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=E,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:M.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=M.None,this.moveViewContainerToLocation=E,this.getViewContainerBadgeEnablementState=E,this.setViewContainerBadgeEnablementState=E,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=M.None,this.moveViewsToContainer=E,this.onDidChangeLocation=M.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(cLt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=E,this.goBack=E,this.goPrevious=E,this.goLast=E,this.reopenLastClosedEditor=E,this.getHistory=()=>[],this.removeFromHistory=E,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=E,this.openPreviouslyUsedEditor=E,this.clear=E,this.clearRecentlyOpened=E}},0);ce(UJe,class{constructor(){this.onDidChangeTaskConfig=M.None,this.onDidStateChange=M.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=E,this.run=E,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=E,this.terminate=E,this.tasks=E,this.taskTypes=E,this.getWorkspaceTasks=E,this.getSavedTasks=E,this.removeRecentlyUsedTask=E,this.getTask=E,this.tryResolveTask=E,this.createSorter=E,this.getTaskDescription=E,this.customize=E,this.openConfig=E,this.registerTaskProvider=E,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=M.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=E,this.isReconnected=!1,this.onDidReconnectToTasks=M.None}},0);ce(oMe,class{constructor(){this.resolveWithEnvironment=E,this.resolveAsync=E,this.resolveAnyAsync=E,this.resolveAnyMap=E,this.resolveWithInteractionReplace=E,this.resolveWithInteraction=E,this.contributeVariable=E}},0);ce(hg,class{constructor(){this.endConnection=E,this.getConnection=()=>null,this.getEnvironment=async()=>null,this.getRawEnvironment=async()=>null,this.getExtensionHostExitInfo=async()=>null,this.getRoundTripTime=async()=>{},this.whenExtensionsReady=async()=>{},this.scanExtensions=async()=>[],this.scanSingleExtension=async()=>null,this.getDiagnosticInfo=async()=>{},this.updateTelemetryLevel=async()=>{},this.logTelemetry=async()=>{},this.flushTelemetry=async()=>{}}},0);ce(cht,B1t,0);let Bve=class{constructor(e){this.modelService=e,this.aiTextSearch=E,this.textSearchSplitSyncAsync=E,this.registerSearchResultProvider=E}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};Bve=D([_(0,gi)],Bve);ce(Zae,Bve,0);ce($Re,class{constructor(){this.registerEditSessionIdentityProvider=()=>V.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>V.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce(iC,class{constructor(){this.addFolders=E,this.removeFolders=E,this.updateFolders=E,this.enterWorkspace=E,this.createAndEnterWorkspace=E,this.saveAndEnterWorkspace=E,this.copyWorkspaceSettings=E,this.pickNewWorkspacePath=E}},0);ce(gXe,class{constructor(){this.getStartTime=E,this.whenReady=E,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=E,this.getDuration=E}get perfBaseline(){return E()}get startupMetrics(){return E()}},0);ce(Xo,class{constructor(){this.shouldRequireConsentToUpdate=async()=>{},this.updateAutoUpdateValue=E,this.getResourceExtensions=E,this.updateRunningExtensions=E,this.togglePreRelease=E,this.isAutoUpdateEnabledFor=E,this.updateAutoUpdateEnablementFor=E,this.isAutoUpdateEnabled=E,this.getAutoUpdateValue=E,this.updateAll=E,this.toggleApplyExtensionToAllProfiles=E,this.whenInitialized=Promise.resolve(),this.onChange=M.None,this.onReset=M.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=E,this.queryGallery=E,this.getExtensions=E,this.canInstall=E,this.install=E,this.installInServer=E,this.uninstall=E,this.installVersion=E,this.reinstall=E,this.canSetLanguage=E,this.setLanguage=E,this.setEnablement=E,this.pinExtension=E,this.open=E,this.checkForUpdates=E,this.getExtensionStatus=E,this.isExtensionIgnoredToSync=E,this.toggleExtensionIgnoredToSync=E}},0);ce(dv,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=E,this.getExtensionInstallLocation=E}},0);ce(aXe,class{constructor(){this.onDidChangeRecommendations=M.None,this.getAllRecommendationsWithReason=()=>({}),this.getImportantRecommendations=async()=>[],this.getOtherRecommendations=async()=>[],this.getFileBasedRecommendations=()=>[],this.getExeBasedRecommendations=async()=>({important:[],others:[]}),this.getConfigBasedRecommendations=async()=>({important:[],others:[]}),this.getWorkspaceRecommendations=async()=>[],this.getKeymapRecommendations=()=>[],this.getLanguageRecommendations=()=>[],this.getRemoteRecommendations=()=>[]}},0);ce(iTt,class{constructor(){this.onError=M.None,this.turnOn=E,this.turnOff=E,this.triggerSync=E}},0);ce(Y1t,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=E,this.updateSynchronizedExtensions=E}},0);ce(P1t,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=E,this.promptWorkspaceRecommendations=E}},0);ce(rMe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=E,this.addExtensionFromGallery=E,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=E,this.scanExtensionManifest=async()=>null}},0);ce(N1t,class{constructor(){this.onDidChangeCache=M.None,this.getTargetPlatform=E,this.scanAllExtensions=E,this.scanSystemExtensions=E,this.scanUserExtensions=E,this.scanExtensionsUnderDevelopment=E,this.scanExistingExtension=E,this.scanOneOrMultipleExtensions=E,this.scanMultipleExtensions=E,this.scanMetadata=E,this.updateMetadata=E,this.initializeDefaultProfileExtensions=E}get systemExtensionsLocation(){return E()}get userExtensionsLocation(){return E()}},0);ce(Pae,class{constructor(){this.onAddExtensions=M.None,this.onDidAddExtensions=M.None,this.onRemoveExtensions=M.None,this.onDidRemoveExtensions=M.None,this.scanProfileExtensions=E,this.addExtensionsToProfile=E,this.updateMetadata=E,this.removeExtensionFromProfile=E}},0);ce(jae,class{constructor(){this.onDidChangeIgnoredRecommendations=M.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=M.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=E}},0);ce(aLt,class{constructor(){this.onDidChangeExtensionsConfigs=M.None,this.getExtensionsConfigs=E,this.getRecommendations=E,this.getUnwantedRecommendations=E,this.toggleRecommendation=E,this.toggleUnwantedRecommendation=E}},0);ce(Nl,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=M.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=E,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=E}},0);ce(Hae,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=M.None,this.onTunnelClosed=M.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=M.None,this.canTunnel=()=>!1,this.openTunnel=E,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=E,this.closeTunnel=E,this.setTunnelProvider=E,this.setTunnelFeatures=E,this.isPortPrivileged=()=>!1}},0);ce(_d,class{constructor(){this.onDidChangeAutoSaveConfiguration=M.None,this.onDidChangeAutoSaveDisabled=M.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=E,this.onDidChangeReadonly=M.None,this.onDidChangeFilesAssociation=M.None,this.onAutoSaveConfigurationChange=M.None,this.getAutoSaveConfiguration=E,this.getAutoSaveMode=E,this.toggleAutoSave=E,this.onReadonlyChange=M.None,this.isReadonly=E,this.updateReadonly=E,this.onFilesAssociationChange=M.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=E}},0);ce(W6,class{constructor(){this.onDidCreate=M.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=M.None,this.onDidChangeEncoding=M.None,this.onDidChangeLabel=M.None,this.onWillDispose=M.None,this.create=E,this.get=()=>{},this.getValue=()=>{},this.resolve=E}},0);ce(H6,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Rm,class{constructor(){this.onDidRegister=M.None,this.onDidUnregister=M.None,this.onDidChangeDirty=M.None,this.onDidChangeContent=M.None,this.onDidSave=M.None,this.dirtyCount=0,this.dirtyWorkingCopies=[],this.modifiedCount=0,this.modifiedWorkingCopies=[],this.hasDirty=!1,this.isDirty=()=>!1,this.workingCopies=[],this.has=()=>!1,this.get=()=>{},this.getAll=()=>{}}registerWorkingCopy(){return V.None}},0);ce(iE,class{constructor(){this.onDidChangeDecorations=M.None,this.registerDecorationsProvider=E,this.getDecoration=()=>{}}},0);ce(F6,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=E}},0);ce(ag,class{constructor(){this.preferredHome=E,this.defaultFilePath=E,this.defaultFolderPath=E,this.defaultWorkspacePath=E,this.pickFileFolderAndOpen=E,this.pickFileAndOpen=E,this.pickFolderAndOpen=E,this.pickWorkspaceAndOpen=E,this.pickFileToSave=E,this.showSaveDialog=E,this.showSaveConfirm=E,this.showOpenDialog=E}},0);ce(DI,class{constructor(){this.write=E}},1);ce(xI,class{constructor(){this.enterWorkspace=E,this.createUntitledWorkspace=E,this.deleteUntitledWorkspace=E,this.getWorkspaceIdentifier=E,this.onDidChangeRecentlyOpened=M.None,this.addRecentlyOpened=E,this.removeRecentlyOpened=E,this.clearRecentlyOpened=E,this.getRecentlyOpened=E,this.getDirtyWorkspaces=E}},1);ce(ece,class{constructor(){this.createTextEditor=E,this.resolveTextEditor=E}},0);ce(BU,class{constructor(){this.getAllUserAssociations=E,this.getAssociationsForResource=E,this.updateUserAssociations=E,this.onDidChangeEditorRegistrations=M.None,this.bufferChangeEvents=E,this.resolveEditor=E,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(Jae,class{constructor(){this.onActiveOutputChannel=M.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(HTt,class{constructor(){this.createOutputChannelModel=E}},1);ce(Fae,class{constructor(){this.readExtensionResource=E,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=E}},0);ce(F1t,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(vf,class{constructor(){this.roots=[],this.getContext=E,this.hasViewFocus=E,this.setEditable=E,this.getEditable=E,this.getEditableData=E,this.isEditable=E,this.findClosest=E,this.findClosestRoot=E,this.refresh=E,this.setToCopy=E,this.isCut=E,this.applyBulkEdit=E,this.select=E,this.registerView=E}get sortOrderConfiguration(){return E()}},1);ce(N3,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=E,this.onDidChangeExtensionStorageToSync=M.None,this.setKeysForSync=E,this.getKeysForSync=()=>{},this.addToMigrationList=E,this.getSourceExtensionToMigrate=()=>{}}},1);ce(dJe,class{constructor(){this.onDidChangeEnablement=M.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(hJe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=KLt(t)?.[e];return i!=null?N.parse(i):void 0}},1);ce(Nae,class{constructor(){this.removeDragOperationTransfer=E,this.addDragOperationTransfer=E}},1);ce(kTt,class{constructor(){this.register=E,this.getWidget=()=>{}}},0);ce(hXe,class{constructor(){this.onDidChange=M.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=E}},0);ce(pJe,class{constructor(){this.onStateChange=M.None,this.state=j1t.Uninitialized,this.checkForUpdates=E,this.downloadUpdate=E,this.applyUpdate=E,this.quitAndInstall=E,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=E}},0);ce(QRe,class{constructor(){this.getPart=E,this.createAuxiliaryStatusbarPart=E,this.createScoped=E,this.dispose=E,this.onDidChangeEntryVisibility=M.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>V.None}},0);ce(EI,class{constructor(){this.isEnabled=()=>!1,this.query=E,this.getExtensions=E,this.isExtensionCompatible=E,this.getCompatibleExtension=E,this.getAllCompatibleVersions=E,this.download=E,this.downloadSignatureArchive=E,this.reportStatistic=E,this.getReadme=E,this.getManifest=E,this.getChangelog=E,this.getCoreTranslation=E,this.getExtensionsControlManifest=E}},0);ce(OU,class{constructor(){this.revealTerminal=E,this.focusInstance=E,this.onAnyInstanceData=M.None,this.moveIntoNewEditor=E,this.detachedInstances=[],this.onAnyInstanceDataInput=M.None,this.onAnyInstanceIconChange=M.None,this.onAnyInstanceMaximumDimensionsChange=M.None,this.onAnyInstancePrimaryStatusChange=M.None,this.onAnyInstanceProcessIdReady=M.None,this.onAnyInstanceSelectionChange=M.None,this.onAnyInstanceTitleChange=M.None,this.createDetachedTerminal=E,this.onDidChangeSelection=M.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=E,this.instances=[],this.revealActiveTerminal=E,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=fW.Panel,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidCreateInstance=M.None,this.onDidReceiveProcessId=M.None,this.onDidChangeInstanceDimensions=M.None,this.onDidMaximumDimensionsChange=M.None,this.onDidRequestStartExtensionTerminal=M.None,this.onDidChangeInstanceTitle=M.None,this.onDidChangeInstanceIcon=M.None,this.onDidChangeInstanceColor=M.None,this.onDidChangeInstancePrimaryStatus=M.None,this.onDidInputInstanceData=M.None,this.onDidRegisterProcessSupport=M.None,this.onDidChangeConnectionState=M.None,this.createTerminal=E,this.getInstanceFromId=E,this.getInstanceFromIndex=E,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=E,this.moveToEditor=E,this.moveToTerminalView=E,this.getPrimaryBackend=E,this.refreshActiveGroup=E,this.registerProcessSupport=()=>{},this.showProfileQuickPick=E,this.setContainers=E,this.requestStartExtensionTerminal=E,this.isAttachedToTerminal=E,this.getEditableData=E,this.setEditable=E,this.isEditable=E,this.safeDisposeTerminal=E,this.getDefaultInstanceHost=E,this.getInstanceHost=E,this.resolveLocation=E,this.setNativeDelegate=E,this.toggleEscapeSequenceLogging=E,this.getEditingTerminal=E,this.setEditingTerminal=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}createOnInstanceCapabilityEvent(){return{event:M.None,dispose(){}}}createOnInstanceEvent(e){return new Yrt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return E()}},1);ce(QTt,class{constructor(){this.onConfigChanged=M.None,this.setPanelContainer=E,this.configFontIsMonospace=E,this.getFont=E}get config(){return E()}},1);ce(VJe,class{constructor(){this.focusInstance=E,this.instances=[],this.openEditor=E,this.detachActiveEditorInstance=E,this.detachInstance=E,this.splitInstance=E,this.revealActiveEditor=E,this.resolveResource=E,this.reviveInput=E,this.getInputFromResource=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce(iMe,class{constructor(){this.focusInstance=E,this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidChangeGroups=M.None,this.onDidShow=M.None,this.onDidChangePanelOrientation=M.None,this.createGroup=E,this.getGroupForInstance=E,this.moveGroup=E,this.moveGroupToEnd=E,this.moveInstance=E,this.unsplitInstance=E,this.joinInstances=E,this.instanceIsSplit=E,this.getGroupLabels=E,this.setActiveGroupByIndex=E,this.setActiveGroupToNext=E,this.setActiveGroupToPrevious=E,this.setActiveInstanceByIndex=E,this.setContainer=E,this.showPanel=E,this.hidePanel=E,this.focusTabs=E,this.focusHover=E,this.showTabs=E,this.updateVisibility=E,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce(zJe,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=M.None,this.convertProfileToShellLaunchConfig=E,this.createInstance=E,this.getBackend=E,this.didRegisterBackend=E}},1);ce(KJe,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=E,this.refreshAvailableProfiles=E,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=M.None,this.getContributedDefaultProfile=E,this.registerContributedProfile=E,this.getContributedProfileProvider=E,this.registerTerminalProfileProvider=E}},1);ce(Q1t,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(qJe,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=M.None,this.onDidRemoveLinkProvider=M.None,this.registerLinkProvider=E}},1);ce(jTt,class{constructor(){this.terminalProfiles=[]}},1);ce(GJe,class{constructor(){this.resolveIcon=E,this.resolveShellLaunchConfig=E,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=E,this.getDefaultShellArgs=E,this.getDefaultIcon=E,this.getEnvironment=E,this.createProfileFromShellAndShellArgs=E}},1);ce($Je,class{constructor(){this.collections=new Map,this.onDidChangeCollections=M.None,this.set=E,this.delete=E}get mergedCollection(){return E()}},1);ce(QJe,class{constructor(){this.onDidRegisterProvider=M.None,this.onDidRegisterCommandSelector=M.None,this.onDidUnregisterProvider=M.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=E,this.registerCommandSelector=E}},1);ce(ALt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=M.None,this.turnOn=E,this.turnoff=E,this.signIn=E,this.resetSyncedData=E,this.showSyncActivity=E,this.syncNow=E,this.synchroniseUserDataSyncStoreType=E,this.showConflicts=E,this.accept=E,this.getAllLogResources=E,this.downloadSyncActivity=E}},1);ce(mJe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=E,this.onDidChangeResourceEnablement=M.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=E,this.getResourceSyncStateVersion=()=>{}}},1);ce(uLt,class{constructor(){this.addKeybinding=E,this.editKeybinding=E,this.removeKeybinding=E,this.resetKeybinding=E}},1);ce(UTt,class{constructor(){this.getLocalSearchProvider=E,this.getRemoteSearchProvider=E}},1);ce(tE,class{constructor(){this.tryGetDataProviderSync=()=>{},this.canResolve=async()=>!1,this.onAddViewType=M.None,this.onWillRemoveViewType=M.None,this.onDidChangeOutputRenderers=M.None,this.onWillAddNotebookDocument=M.None,this.onDidAddNotebookDocument=M.None,this.onWillRemoveNotebookDocument=M.None,this.onDidRemoveNotebookDocument=M.None,this.registerNotebookSerializer=E,this.withNotebookDataProvider=E,this.getOutputMimeTypeInfo=E,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=E,this.updateMimePreferredRenderer=E,this.saveMimeDisplayOrder=E,this.createNotebookTextModel=E,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=E,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=E,this.getContributedNotebookType=E,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=E,this.getToCopy=E,this.clearEditorCache=E}},1);ce(VTt,class{constructor(){this.replace=E,this.openReplacePreview=E,this.updateReplacePreview=E}},1);ce(GTt,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.load=E,this.save=E}},1);ce(R6,class{constructor(){this.retrieveWidget=E,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=M.None,this.onDidRemoveNotebookEditor=M.None,this.addNotebookEditor=E,this.removeNotebookEditor=E,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(zTt,class{get searchModel(){return E()}},1);ce($ae,class{constructor(){this.onDidSaveNotebook=M.None,this.onDidChangeDirty=M.None,this.onWillFailWithConflict=M.None,this.isDirty=E,this.resolve=E}},1);ce(pXe,class{constructor(){this.onDidRegisterHandler=M.None,this.registerHandler=()=>V.None,this.findEditor=()=>{}}},1);ce(aMe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=M.None,this.markActive=E}},1);ce(zRe,class{constructor(){this.registerCanonicalUriProvider=E}},1);ce(jRe,class{constructor(){this.onDidChange=M.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(tXe,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(km,class{constructor(){this.adoptRequest=E,this.isEnabled=()=>!1,this.resendRequest=E,this.clearAllHistoryEntries=E,this.onDidSubmitAgent=M.None,this.hasSessions=()=>!1,this.onDidDisposeSession=M.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=M.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=E,this.registerSlashCommandProvider=E,this.getProviderInfos=()=>[],this.startSession=E,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=E,this.removeRequest=E,this.cancelCurrentRequestForSession=E,this.getSlashCommands=E,this.clearSession=E,this.addRequest=E,this.addCompleteRequest=E,this.sendRequestToProvider=E,this.getHistory=()=>[],this.removeHistoryEntry=E,this.onDidPerformUserAction=M.None,this.notifyUserAction=E}},1);ce(_Xe,class{constructor(){this.update=E}},1);ce(ITt,class{constructor(){this.focused=!1,this.onDidClose=M.None,this.enabled=!1,this.toggle=E,this.focus=E,this.open=E,this.close=E,this.openInChatView=E}},1);ce(_f,class{constructor(){this._serviceBrand=void 0,this.agentHasDupeName=()=>!1,this.registerAgentCompletionProvider=E,this.getAgentCompletionItems=E,this.getAgentByFullyQualifiedId=E,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=E,this.registerDynamicAgent=E,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=E,this.getDefaultAgent=E,this.getSecondaryAgent=E,this.updateAgent=E,this.onDidChangeAgents=M.None,this.registerAgentData=E,this.registerAgentCallback=E,this.registerAgent=E,this.invokeAgent=E,this.getAgents=E,this.getAgent=E,this.hasAgent=E}},1);ce(zae,class{getAgentNameRestriction(){return!0}},1);ce(pLt,class{constructor(){this.onDidCreateTerminal=M.None,this.createTerminal=E}},1);ce(JRe,class{constructor(){this.getCustomEditor=E,this.getAllCustomEditors=E,this.getContributedCustomEditors=E,this.getUserConfiguredCustomEditors=E,this.registerCustomEditorCapabilities=()=>V.None,this.getCustomEditorCapabilities=()=>{}}get models(){return E()}},1);ce(qae,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=M.None,this.createWebviewElement=E,this.createWebviewOverlay=E}},1);ce(ZJe,class{constructor(){this.onNewResolverRegistered=M.None,this.register=E,this.resolve=E}},1);ce(lXe,class{constructor(){this.setLocale=E}clearLocalePreference(){return Promise.resolve()}},1);ce(N6,class{constructor(){this.onDidChangeActiveWebviewEditor=M.None,this.openWebview=E,this.openRevivedWebview=E,this.revealWebview=E,this.registerResolver=()=>V.None,this.shouldPersist=E,this.resolveWebview=E}get iconManager(){return E()}},1);ce(pC,class{constructor(){this.onDidChangeConnectionData=M.None,this.resolveAuthority=E,this.getConnectionData=E,this.getCanonicalURI=E,this._clearResolvedAuthority=E,this._setResolvedAuthority=E,this._setResolvedAuthorityError=E,this._setAuthorityConnectionToken=E,this._setCanonicalURIProvider=E}},1);ce(LJe,class{constructor(){this.registerExternalOpenerProvider=()=>V.None,this.getOpener=async()=>{}}},1);ce(Dm,class{constructor(){this.configureKeybindings=E,this.openHelpLink=E,this.navigateToCodeBlock=E,this.getCodeBlockContext=()=>{},this.showLastProvider=E,this.showAccessibleViewHelp=E,this.goToSymbol=E,this.disableHint=E,this.next=E,this.previous=E,this.getOpenAriaHint=E,this.show=E,this.registerProvider=E,this.getPosition=E,this.setPosition=E,this.getLastPosition=E}},1);ce(WLt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(P6,class{constructor(){this.uninstallExtensions=E,this.resetPinnedStateForAllUserExtensions=E,this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=M.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=E,this.toggleAppliationScope=async e=>e,this.onInstallExtension=M.None,this.onDidInstallExtensions=M.None,this.onUninstallExtension=M.None,this.onDidUninstallExtension=M.None,this.onDidChangeProfile=M.None,this.installVSIX=E,this.installFromLocation=E,this.updateFromGallery=E,this.onDidUpdateExtensionMetadata=M.None,this.zip=E,this.unzip=E,this.getManifest=E,this.install=E,this.canInstall=E,this.installFromGallery=E,this.installGalleryExtensions=E,this.installExtensionsFromProfile=E,this.uninstall=E,this.reinstallFromGallery=E,this.getInstalled=async()=>[],this.getExtensionsControlManifest=E,this.copyExtensions=E,this.updateMetadata=E,this.download=E,this.registerParticipant=E,this.getTargetPlatform=E,this.cleanUp=E}},1);ce(Im,class{constructor(){this.prefersExecuteOnUI=E,this.prefersExecuteOnWorkspace=E,this.prefersExecuteOnWeb=E,this.canExecuteOnUI=E,this.canExecuteOnWorkspace=E,this.canExecuteOnWeb=E,this.getExtensionKind=E,this.getUserConfiguredExtensionKind=E,this.getExtensionUntrustedWorkspaceSupportType=E,this.getExtensionVirtualWorkspaceSupportType=E}},1);ce(_ae,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Bae,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(Uae,class{constructor(){this.create=E,this.open=async()=>!1,this.registerHandler=E}},1);ce(URe,class{constructor(){this.register=E,this.connect=E}},1);ce(M6,class{constructor(){this.onDidChangeQuickDiffProviders=M.None,this.addQuickDiffProvider=E,this.getQuickDiffs=E}},1);ce(tMe,class{constructor(){this.onDidChangeInputValueProviders=M.None,this.getDefaultInputValueProvider=E,this.registerSCMInputValueProvider=E,this.onDidAddRepository=M.None,this.onDidRemoveRepository=M.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=E,this.getRepository=E}},1);ce(HRe,class{constructor(){this.download=E}},1);ce(cXe,class{constructor(){this.registerExtensionHandler=E,this.unregisterExtensionHandler=E}},1);ce(eE,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=M.None,this.setActiveEditingCommentThread=E,this.setActiveCommentAndThread=E,this.onDidSetResourceCommentInfos=M.None,this.onDidSetAllCommentThreads=M.None,this.onDidUpdateCommentThreads=M.None,this.onDidUpdateNotebookCommentThreads=M.None,this.onDidChangeActiveCommentThread=M.None,this.onDidChangeCurrentCommentThread=M.None,this.onDidUpdateCommentingRanges=M.None,this.onDidChangeActiveCommentingRange=M.None,this.onDidSetDataProvider=M.None,this.onDidDeleteDataProvider=M.None,this.onDidChangeCommentingEnabled=M.None,this.isCommentingEnabled=!1,this.setDocumentComments=E,this.setWorkspaceComments=E,this.removeWorkspaceComments=E,this.registerCommentController=E,this.unregisterCommentController=()=>{},this.getCommentController=E,this.createCommentThreadTemplate=E,this.updateCommentThreadTemplate=E,this.getCommentMenus=E,this.updateComments=E,this.updateNotebookComments=E,this.disposeCommentThread=E,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=E,this.hasReactionHandler=E,this.toggleReaction=E,this.setActiveCommentThread=E,this.setCurrentCommentThread=E,this.enableCommenting=E,this.registerContinueOnCommentProvider=E,this.removeContinueOnComment=E}get commentsModel(){return E()}},1);ce(PJe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeItems=M.None,this.registerCellStatusBarItemProvider=E,this.getStatusBarItemsForCell=E}},1);ce(OJe,class{constructor(){this.onDidNotebookVariablesUpdate=M.None,this.notifyVariablesChange=E,this.onDidAddKernel=M.None,this.onDidRemoveKernel=M.None,this.onDidChangeSelectedNotebooks=M.None,this.onDidChangeNotebookAffinity=M.None,this.registerKernel=E,this.getMatchingKernel=E,this.getSelectedOrSuggestedKernel=E,this.selectKernelForNotebook=E,this.preselectKernelForNotebook=E,this.updateKernelNotebookAffinity=E,this.onDidChangeKernelDetectionTasks=M.None,this.registerNotebookKernelDetectionTask=E,this.getKernelDetectionTasks=E,this.onDidChangeSourceActions=M.None,this.getSourceActions=E,this.getRunningSourceActions=E,this.registerKernelSourceActionProvider=E,this.getKernelSourceActions2=E}},1);ce(BJe,class{constructor(){this.onShouldPostMessage=M.None,this.prepare=E,this.getScoped=E,this.receiveMessage=E}},1);ce(MJe,class{constructor(){this.addToHistory=E,this.getPreviousValue=E,this.getNextValue=E,this.replaceLast=E,this.clearHistory=E,this.has=E}},1);ce(eMe,class{constructor(){this.onWillAddInteractiveDocument=M.None,this.onWillRemoveInteractiveDocument=M.None,this.willCreateInteractiveDocument=E,this.willRemoveInteractiveDocument=E}},1);ce(fLt,class{async getExtensionIdProvidingCurrentLocale(){return qLt()}},0);ce(vLt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=E}},0);ce(WU,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=E,this.next=E,this.reset=E}},0);ce(oTt,class{constructor(){this.onTokenFailed=M.None,this.account=void 0,this.onDidChangeAccount=M.None}updateAccount(){return Promise.resolve()}},0);ce(UN,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=E,this.getWidgetByInputUri=E}},1);ce(Xae,class{constructor(){this.onDidChangeHelpInformation=M.None,this.onDidChangeTargetType=M.None,this.targetType=[],this.onDidChangeEditable=M.None,this.setEditable=E,this.getEditableData=E,this.forward=E,this.close=E,this.setTunnelInformation=E,this.setCandidateFilter=E,this.onFoundNewCandidates=E,this.restore=E,this.enablePortsFeatures=E,this.onEnabledPortsFeatures=M.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return E()}get tunnelModel(){return E()}},1);ce(sMe,class{constructor(){this.getAccounts=async()=>[],this.onDidRegisterAuthenticationProvider=M.None,this.onDidUnregisterAuthenticationProvider=M.None,this.onDidChangeSessions=M.None,this.onDidChangeDeclaredProviders=M.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=E,this.unregisterDeclaredAuthenticationProvider=E,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=E,this.unregisterAuthenticationProvider=E,this.getProviderIds=()=>[],this.getProvider=E,this.getSessions=E,this.createSession=E,this.removeSession=E}},1);ce(Qae,class{constructor(){this.onDidChangeExtensionSessionAccess=M.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=E,this.removeAllowedExtensions=E}},1);ce(nXe,class{constructor(){this.updateSessionPreference=E,this.getSessionPreference=()=>{},this.removeSessionPreference=E,this.selectSession=E,this.requestSessionAccess=E,this.requestNewSession=E}},1);ce(iXe,class{constructor(){this.readAccountUsages=E,this.removeAccountUsage=E,this.addAccountUsage=E}},1);ce(XJe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeTimeline=M.None,this.onDidChangeUri=M.None,this.registerTimelineProvider=E,this.unregisterTimelineProvider=E,this.getSources=()=>[],this.getTimeline=E,this.setUri=E}},1);ce(JJe,class{constructor(){this.getTestsRelatedToCode=async()=>[],this.getCodeRelatedToTest=async()=>[],this.registerExtHost=()=>V.None,this.provideTestFollowups=E,this.onDidCancelTestRun=M.None,this.onWillProcessDiff=M.None,this.onDidProcessDiff=M.None,this.registerTestController=E,this.getTestController=()=>{},this.refreshTests=E,this.cancelRefreshTests=E,this.startContinuousRun=E,this.runTests=E,this.runResolvedTests=E,this.syncTests=E,this.cancelTestRun=E,this.publishDiff=E}get excluded(){return E()}get collection(){return E()}get showInlineOutput(){return E()}},1);ce(gJe,class{constructor(){this.onDidChangeSecret=M.None,this.type="in-memory",this.get=async()=>{},this.set=E,this.delete=E}},1);ce(HJe,class{constructor(){this.registerShareProvider=E,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(fXe,class{constructor(){this.createProfileFromTemplate=async()=>{},this.resolveProfileTemplate=async()=>null,this.exportProfile2=E,this.createFromProfile=E,this.createProfile=E,this.editProfile=E,this.registerProfileContentHandler=()=>V.None,this.unregisterProfileContentHandler=()=>{},this.exportProfile=E,this.importProfile=E,this.showProfileContents=E,this.createFromCurrentProfile=E,this.createTroubleshootProfile=E,this.setProfile=E}},1);ce(hLt,class{constructor(){this.registerIssueDataProvider=E,this.openReporter=E,this.openProcessExplorer=E,this.registerIssueUriRequestHandler=E}},1);ce(WJe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=M.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=M.None,this.isVisible=()=>!1,this.toggleVisibility=E,this.toggleSortKey=E,this.focusedRepository=void 0,this.onDidFocusRepository=M.None,this.focus=E}get menus(){return E()}},1);ce(FJe,class{constructor(){this.onDidChangeExecution=M.None,this.onDidChangeLastRunFailState=M.None,this.forceCancelNotebookExecutions=E,this.getCellExecutionsForNotebook=E,this.getCellExecutionsByHandleForNotebook=E,this.getCellExecution=E,this.createCellExecution=E,this.getExecution=E,this.createExecution=E,this.getLastFailedCellForNotebook=E}},1);ce(jJe,class{constructor(){this.onDidChange=M.None,this.addProfile=E,this.updateProfile=E,this.removeProfile=E,this.capabilitiesForTest=E,this.configure=E,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=E,this.getControllerProfiles=()=>[]}},1);ce(R1t,class{constructor(){this.setUsePlainTextEncryption=E,this.getKeyStorageProvider=E,this.encrypt=E,this.decrypt=E,this.isEncryptionAvailable=E}},1);ce(YJe,class{constructor(){this.onResultsChanged=M.None,this.onTestChanged=M.None,this.results=[],this.clear=E,this.createLiveResult=E,this.push=E,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(XTt,class{constructor(){this.read=E,this.persist=E}},1);ce(eLt,class{constructor(){this.onDidChange=M.None,this.invalidateResultMessage=E,this.syncDecorations=E,this.getDecoratedTestPosition=E}},1);ce(tce,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(L1t,T1t,1);ce($Tt,class{notebookSearch(){return{openFilesToScan:new Dk,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new Dk)}}},1);ce(IJe,class{constructor(){this.sendChatRequest=E,this.selectLanguageModels=E,this.computeTokenLength=E,this.onDidChangeLanguageModels=M.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=E,this.makeLanguageModelChatRequest=E}},1);ce(YRe,class{constructor(){this.onDidChangeCommands=E,this.registerSlashData=E,this.registerSlashCallback=E,this.registerSlashCommand=E,this.executeCommand=E,this.getCommands=E,this.hasCommand=E}},1);ce(L6,class{constructor(){this.attachContext=E,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=E,this.getDynamicReferences=E,this.registerVariable=E,this.getVariables=E,this.resolveVariables=E,this.hasVariable=E}},1);ce(nMe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=E,this.registerAiRelatedInformationProvider=E}},1);ce(eXe,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=E,this.registerAiEmbeddingVectorProvider=E}},1);ce(fJe,(gK=class{async createNewMessage(e){return{id:String(gK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},gK._nextId=1,gK),1);ce(ZTt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=M.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=E,this.stop=E}},1);ce(JTt,class{constructor(){this.onDidRequestInputFocus=M.None,this.focusInput=E,this.setText=E,this.isFilteringFor=()=>!1,this.toggleFilteringFor=E}get text(){return E()}get reveal(){return E()}get globList(){return E()}get includeTags(){return E()}get excludeTags(){return E()}get fuzzy(){return E()}},1);ce(tLt,class{constructor(){this.tryPeekFirstError=E,this.peekUri=E,this.openCurrentInEditor=E,this.open=E,this.closeAllPeeks=E}get historyVisible(){return E()}},1);ce(sXe,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=M.None,this.hasWindow=()=>!1,this.open=E}},1);ce(Kae,class{constructor(){this.onDidStartTextToSpeechSession=M.None,this.onDidEndTextToSpeechSession=M.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=E,this.onDidChangeHasSpeechProvider=M.None,this.onDidStartSpeechToTextSession=M.None,this.onDidEndSpeechToTextSession=M.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=M.None,this.onDidEndKeywordRecognition=M.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=E,this.onDidRegisterSpeechProvider=M.None,this.onDidUnregisterSpeechProvider=M.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=E,this.createSpeechToTextSession=E}},1);ce(YTt,class{constructor(){this.openCoverage=E,this.closeCoverage=E}get showInline(){return E()}get filterToTest(){return E()}get selected(){return E()}},1);ce(DJe,class{constructor(){this.acceptRequest=E,this.acceptResponse=E}},1);ce(kJe,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.getHistory=()=>[],this.saveHistory=E}},1);ce(TTt,class{constructor(){this.providers=[],this.registerProvider=()=>V.None}},1);ce(ZRe,class{constructor(){this.onDidMoveSession=M.None,this.onDidMoveSessio=M.None,this.onDidStashSession=M.None,this.moveSession=E,this.getCodeEditor=E,this.stashSession=E,this.onWillStartSession=M.None,this.onDidEndSession=M.None,this.createSession=E,this.getSession=()=>{},this.releaseSession=E,this.registerSessionKeyComputer=E,this.recordings=E,this.dispose=E}},1);ce(WTt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=E,this.canPromptRecommendation=async()=>!1}},1);ce(PTt,class{constructor(){this.getKernels=E,this.addMostRecentKernel=E}},1);ce(NTt,class{constructor(){this.executeNotebookCells=E,this.cancelNotebookCells=E,this.cancelNotebookCellHandles=E,this.registerExecutionParticipant=E}},1);ce(FTt,class{},1);ce(OTt,class{constructor(){this.info=E,this.debug=E}},1);ce(nLt,class{constructor(){this.onDidAddWalkthrough=M.None,this.onDidRemoveWalkthrough=M.None,this.onDidChangeWalkthrough=M.None,this.onDidProgressStep=M.None,this.getWalkthroughs=E,this.getWalkthrough=E,this.registerWalkthrough=E,this.progressByEvent=E,this.progressStep=E,this.deprogressStep=E,this.markWalkthroughOpened=E}},1);ce(J1t,class{constructor(){this.onDidChangeUserDataSyncStore=M.None,this.userDataSyncStore=void 0,this.switch=E,this.getPreviousUserDataSyncStore=E}},1);ce(X1t,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=M.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=M.None,this.onTokenSucceed=M.None,this.setAuthToken=E,this.manifest=E,this.readResource=E,this.writeResource=E,this.deleteResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E,this.getAllCollections=E,this.createCollection=E,this.deleteCollection=E,this.getActivityData=E,this.clear=E}},1);ce(sTt,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(eTt,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=M.None,this.conflicts=[],this.onDidChangeConflicts=M.None,this.onDidChangeLocal=M.None,this.onSyncErrors=M.None,this.onDidChangeLastSyncTime=M.None,this.onDidResetRemote=M.None,this.onDidResetLocal=M.None,this.createSyncTask=E,this.createManualSyncTask=E,this.resolveContent=E,this.accept=E,this.reset=E,this.resetRemote=E,this.cleanUpRemoteData=E,this.resetLocal=E,this.hasLocalData=E,this.hasPreviouslySynced=E,this.replace=E,this.saveRemoteActivityData=E,this.extractActivityData=E}},1);ce(rTt,class{constructor(){this.onDidChange=M.None,this.getMachines=E,this.addCurrentMachine=E,this.removeCurrentMachine=E,this.renameMachine=E,this.setEnablements=E}},1);ce(tTt,class{constructor(){this.getRemoteSyncedProfiles=E,this.getLocalSyncedProfiles=E,this.getRemoteSyncResourceHandles=E,this.getLocalSyncResourceHandles=E,this.getAssociatedResources=E,this.getMachineId=E,this.getLocalSyncedMachines=E,this.resolveContent=E,this.resolveUserDataSyncResource=E}},1);ce(Z1t,class{constructor(){this.writeResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E}},1);ce(nTt,class{constructor(){this.resolveDefaultCoreIgnoredSettings=async()=>[],this.resolveUserBindings=E,this.resolveFormattingOptions=E,this.resolveDefaultIgnoredSettings=E}},1);ce(bLt,class{constructor(){this.createProfile=E,this.createAndEnterProfile=E,this.createAndEnterTransientProfile=E,this.removeProfile=E,this.updateProfile=E,this.switchProfile=E,this.getBuiltinProfileTemplates=E}},1);ce(ELt,class{constructor(){this.onDidAddEntry=M.None,this.onDidChangeEntry=M.None,this.onDidReplaceEntry=M.None,this.onDidRemoveEntry=M.None,this.onDidMoveEntries=M.None,this.onDidRemoveEntries=M.None,this.addEntry=E,this.updateEntry=E,this.removeEntry=E,this.moveEntries=E,this.getEntries=async()=>[],this.getAll=async()=>[],this.removeAll=E}},1);ce(RJe,class{constructor(){this.markChanged=E}},1);ce(dXe,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=E,this.removeNotebookDocument=E}},1);ce(TJe,class{constructor(){this.registerTree=E,this.getVisualizedNodeFor=E,this.getVisualizedChildren=E,this.editTreeItem=E,this.getApplicableFor=E,this.register=E}},1);ce(RTt,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(LTt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=M.None,this.onDidSignOut=M.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=E,this.read=E,this.write=E,this.delete=E,this.list=E,this.getMachineById=E}},1);ce(NJe,class{constructor(){this.registerResolver=()=>V.None,this.resolve=async()=>{}}},1);ce(qTt,KTt,1);ce(rXe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!0,this.setEnablement=E,this.getEnablementData=E,this.getAccess=E,this.onDidChangeAccessData=M.None,this.getAccessData=()=>{},this.setStatus=E}},1);ce(oXe,class{constructor(){this.onWillInstantiateEditorPane=M.None,this.didInstantiateEditorPane=()=>!1}},1);ce(xLt,class{constructor(){this.matches=E,this.getWorkspaceStateFolders=E}},1);ce(MTt,class{constructor(){this.onDidChangeDefaultLogLevels=M.None,this.getDefaultLogLevel=async()=>Gn.Off,this.getDefaultLogLevels=E,this.setDefaultLogLevel=E,this.migrateLogLevels=E}},1);ce(nE,class{constructor(){this.onDidChange=M.None,this.getName=()=>{}}},1);ce(lLt,class{constructor(){this.isActive=()=>!1,this.start=E,this.resume=E,this.stop=E}},1);ce(ULt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(nce,class{isValid(){return!1}},1);ce(vXe,class{constructor(){this.onDidChangeTools=M.None,this.registerToolData=E,this.registerToolImplementation=E,this.getTools=()=>[],this.invokeTool=E}},1);ce(dLt,class{constructor(){this.openReporter=E,this.reloadWithExtensionsDisabled=E,this.showConfirmCloseDialog=E,this.showClipboardDialog=E,this.sendReporterMenu=E,this.closeReporter=E}},1);const eRt="vscode://schemas/vscode-product",tRt={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts"},aiTextSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts"},attributableCoverage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts"},authGetSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:2},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},chatVariableResolver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribIssueReporter:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemChangesMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemChangesMenu.d.ts"},contribSourceControlHistoryItemGroupMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},createFileSystemWatcher:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts"},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},documentPaste:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileComments:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts"},findFiles2New:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2New.d.ts"},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFilesNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFilesNew.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},lmTools:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.lmTools.d.ts",version:2},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookCellExecutionState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},showLocal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellIntegration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts"},testMessageStackTrace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textSearchCompleteNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},RM=Object.freeze(tRt),cMe=Qe.as(YA.JSONContribution);class iRt{constructor(e,t,i){this._messageHandler=e,this._extension=t,this._extensionPointId=i}_msg(e,t){this._messageHandler({type:e,message:t,extensionId:this._extension.identifier,extensionPointId:this._extensionPointId})}error(e){this._msg(Xe.Error,e)}warn(e){this._msg(Xe.Warning,e)}info(e){this._msg(Xe.Info,e)}}class P5{static _toSet(e){const t=new A_;for(let i=0,n=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!n.has(a.description.identifier));return new P5(o,r)}constructor(e,t){this.added=e,this.removed=t}}class nRt{constructor(e,t){this.name=e,this.defaultExtensionKind=t,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=P5.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){vt(e)}}}const sRt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(4415,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(4416,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},bXe="vscode://schemas/vscode-extensions",Wve={properties:{engines:{type:"object",description:g(4417,"Engine compatibility."),properties:{vscode:{type:"string",description:g(4418,"For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5."),default:"^1.22.0"}}},publisher:{description:g(4419,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(4420,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(4421,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:QYe},{type:"string",const:"Languages",deprecationMessage:g(4422,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(4423,"Banner used in the VS Code marketplace."),properties:{color:{description:g(4424,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(4425,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(4426,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(4427,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(4428,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(4429,"Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api"),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(RM).map(s=>s),markdownEnumDescriptions:Object.values(RM).map(s=>s.proposal)}},api:{markdownDescription:g(4430,"Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions"),type:"string",enum:["none"],enumDescriptions:[g(4431,"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.")]},activationEvents:{description:g(4432,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(4433,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(4434,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(4435,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(4436,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(4437,'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:g(4438,'An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).'),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:g(4439,"An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called)."),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:g(4440,"An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed."),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:g(4441,"An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern."),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:g(4442,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(4443,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(4444,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(4445,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(4446,"An activation event emitted whenever a search is started in the folder with the given scheme."),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:g(4447,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(4448,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(4449,"An activation event emitted whenever a external uri (such as an http or https link) is being opened.")},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:g(4450,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(4451,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(4452,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(4453,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(4454,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(4455,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(4456,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(4457,"An activation event emitted when the issue reporter is opened.")},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:g(4458,"An activation event emitted when the specified chat participant is invoked.")},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolName}",description:g(4459,"An activation event emitted when the specified language model tool is invoked.")},{label:"*",description:g(4460,"An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case."),body:"*"}]}},badges:{type:"array",description:g(4461,"Array of badges to display in the sidebar of the Marketplace's extension page."),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:g(4462,"Badge image URL.")},href:{type:"string",description:g(4463,"Badge link.")},description:{type:"string",description:g(4464,"Badge description.")}}}},markdown:{type:"string",description:g(4465,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(4466,"Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:g(4467,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:W3}},extensionPack:{description:g(4468,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:W3}},extensionKind:{description:g(4469,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:"array",items:sRt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(4470,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(4471,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(4472,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(4473,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(4474,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(4475,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(4476,"Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true."),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:g(4477,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4478,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(4479,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(4480,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(4481,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:g(4482,"Declares how the extension should be handled in untrusted workspaces."),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:g(4483,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4484,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(4485,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(4486,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(4487,"A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:g(4488,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:g(4489,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(4490,"URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess"),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:g(4491,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(4492,"Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported."),type:"string"}}},icon:{type:"string",description:g(4493,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(4494,"The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.")},pricing:{type:"string",markdownDescription:g(4495,"The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label"),enum:["Free","Trial"],default:"Free"}}};class oRt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new nRt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&JO.register(e.extensionPoint,e.activationEventsGenerator),Wve.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,cMe.registerSchema(bXe,Wve),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const wXe={ExtensionsRegistry:"ExtensionsRegistry"};Qe.add(wXe.ExtensionsRegistry,new oRt);const eh=Qe.as(wXe.ExtensionsRegistry);cMe.registerSchema(bXe,Wve);cMe.registerSchema(eRt,{properties:{extensionEnabledApiProposals:{description:g(4496,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(RM),markdownEnumDescriptions:Object.values(RM).map(s=>s.proposal)}}]}}}});var J_;(function(s){s.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(J_||(J_={}));class rRt{constructor(){this.extensionFeatures=new Map}registerExtensionFeature(e){if(this.extensionFeatures.has(e.id))throw new Error(`Extension feature with id '${e.id}' already exists`);return this.extensionFeatures.set(e.id,e),{dispose:()=>this.extensionFeatures.delete(e.id)}}getExtensionFeature(e){return this.extensionFeatures.get(e)}getExtensionFeatures(){return Array.from(this.extensionFeatures.values())}}Qe.add(J_.ExtensionFeaturesRegistry,new rRt);var cf;(function(s){s.Workbench="workbench.contributions.kind"})(cf||(cf={}));var yc;(function(s){s[s.BlockStartup=1]="BlockStartup",s[s.BlockRestore=2]="BlockRestore",s[s.AfterRestored=3]="AfterRestored",s[s.Eventually=4]="Eventually"})(yc||(yc={}));function wHe(s){const e=s;return!!e&&typeof e.editorTypeId=="string"}function aRt(s){switch(s){case Rs.Restored:return yc.AfterRestored;case Rs.Eventually:return yc.Eventually}}function yHe(s){switch(s){case yc.BlockStartup:return Rs.Starting;case yc.BlockRestore:return Rs.Ready;case yc.AfterRestored:return Rs.Restored;case yc.Eventually:return Rs.Eventually}}const GE=class GE extends V{constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.instanceDisposables=this._register(new Z),this.timingsByPhase=new Map,this.pendingRestoredContributions=new dc,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const n={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&wHe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,n,typeof i=="number"?yHe(i):this.lifecycleService.phase):(typeof i=="number"&&Cj(this.contributionsByPhase,yHe(i),[]).push(n),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,n),wHe(i)&&Cj(this.contributionsByEditor,i.editorTypeId,[]).push(n)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,aRt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,n=this.logService,o=this.environmentService;if(!t||!i||!n||!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const r=this.contributionsById.get(e);if(!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phase{this.instanceDisposables.clear()}));for(const a of[Rs.Starting,Rs.Ready,Rs.Restored,Rs.Eventually])this.instantiateByPhase(t,i,n,o,a);for(const a of this.contributionsByEditor.keys())r.didInstantiateEditorPane(a)&&this.onEditor(a,t,i,n,o);this._register(r.onWillInstantiateEditorPane(a=>this.onEditor(a.typeId,t,i,n,o)))}onEditor(e,t,i,n,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,n,o,a,i.phase)}}instantiateByPhase(e,t,i,n,o){t.phase>=o?this.doInstantiateByPhase(e,i,n,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,n,o))}async doInstantiateByPhase(e,t,i,n){const o=this.contributionsByPhase.get(n);if(o)switch(this.contributionsByPhase.delete(n),n){case Rs.Starting:case Rs.Ready:{cs(`code/willCreateWorkbenchContributions/${n}`);for(const r of o)this.safeCreateContribution(e,t,i,r,n);cs(`code/didCreateWorkbenchContributions/${n}`);break}case Rs.Restored:case Rs.Eventually:{n===Rs.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,n);break}}}doInstantiateWhenIdle(e,t,i,n,o){cs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Rs.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,n=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){n.error(g(674,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!Lt(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every(Lt))){n.error(g(675,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!Lt(a)){n.error(g(676,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Pt(o,a);qy(c,o)||n.warn(g(677,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",CHe.name,c.toString(),o.path))}catch(c){n.error(g(678,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){n.error(g(679,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class lRt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.jsonValidation}render(e){const t=e.contributes?.jsonValidation||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(680,"File Match"),g(681,"Schema")],n=t.map(o=>[new Mt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:n},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(682,"JSON Validation"),access:{canToggle:!1},renderer:new wi(lRt)});var _B;let UJ=(_B=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(cRt)}},_B.ID="workbench.contrib.jsonValidationExtensionPoint",_B);UJ=D([_(0,we)],UJ);Qu(UJ.ID,UJ,yc.BlockStartup);const Hve=Qe.as(kTe.ColorContribution),fK=Hve.getColorReferenceSchema(),yXe="^\\w+[.\\w+]*$",dRt=eh.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(683,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(684,"The identifier of the themable color"),pattern:yXe,patternErrorMessage:g(685,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(686,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(687,"The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[fK,{type:"string",format:"color-hex"}]},dark:{description:g(688,"The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[fK,{type:"string",format:"color-hex"}]},highContrast:{description:g(689,"The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes."),type:"string",anyOf:[fK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(690,"The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes."),type:"string",anyOf:[fK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class hRt{constructor(){dRt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||!Array.isArray(n)){o.error(g(691,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?me.Format.CSS.parseHex(a):a:(o.error(g(692,"{0} must be either a color value in hex (#RRGGBB[AA] or #RGB[A]) or the identifier of a themable color which provides the default.",c)),me.red);for(const a of n){if(typeof a.id!="string"||a.id.length===0){o.error(g(693,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(yXe)){o.error(g(694,"'configuration.colors.id' must only contain letters, digits and dots and can not start with a dot"));return}if(typeof a.description!="string"||a.id.length===0){o.error(g(695,"'configuration.colors.description' must be defined and can not be empty"));return}const c=a.defaults;if(!c||typeof c!="object"||typeof c.light!="string"||typeof c.dark!="string"){o.error(g(696,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(697,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(698,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}Hve.registerColor(a.id,{light:r(c.light,"configuration.colors.defaults.light"),dark:r(c.dark,"configuration.colors.defaults.dark"),hcDark:r(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:r(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const n=i.value;for(const o of n)Hve.deregisterColor(o.id)}})}}class uRt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.colors}render(e){const t=e.contributes?.colors||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(699,"ID"),g(700,"Description"),g(701,"Dark Default"),g(702,"Light Default"),g(703,"High Contrast Default")],n=r=>r[0]==="#"?me.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Mt().appendMarkdown(`\`${r.id}\``),r.description,n(r.defaults.dark)??new Mt().appendMarkdown(`\`${r.defaults.dark}\``),n(r.defaults.light)??new Mt().appendMarkdown(`\`${r.defaults.light}\``),n(r.defaults.highContrast)??new Mt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(704,"Colors"),access:{canToggle:!1},renderer:new wi(uRt)});var vB;let VJ=(vB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(hRt)}},vB.ID="workbench.contrib.colorExtensionPoint",vB);VJ=D([_(0,we)],VJ);Qu(VJ.ID,VJ,yc.BlockStartup);const hV=Qe.as(SYe.IconContribution),gRt=hV.getIconReferenceSchema(),CXe=`^${We.iconNameSegment}(-${We.iconNameSegment})+$`,fRt=eh.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(705,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:CXe,description:g(706,"The identifier of the themable icon"),patternErrorMessage:g(707,"Identifiers can only contain letters, digits and minuses and need to consist of at least two segments in the form `component-iconname`.")},additionalProperties:{type:"object",properties:{description:{type:"string",description:g(708,"The description of the themable icon")},default:{anyOf:[gRt,{type:"object",properties:{fontPath:{description:g(709,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(710,"The character for the icon in the icon font."),type:"string"}},required:["fontPath","fontCharacter"],defaultSnippets:[{body:{fontPath:"${1:myiconfont.woff}",fontCharacter:"${2:\\\\E001}"}}]}],description:g(711,"The default of the icon. Either a reference to an extisting ThemeIcon or an icon in an icon font.")}},required:["description","default"],defaultSnippets:[{body:{description:"${1:my icon}",default:{fontPath:"${2:myiconfont.woff}",fontCharacter:"${3:\\\\E001}"}}}]},defaultSnippets:[{body:{"${1:my-icon-id}":{description:"${2:my icon}",default:{fontPath:"${3:myiconfont.woff}",fontCharacter:"${4:\\\\E001}"}}}}]}});class pRt{constructor(){fRt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||typeof n!="object"){o.error(g(712,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in n){if(!r.match(CXe)){o.error(g(713,"'configuration.icons' keys represent the icon id and can only contain letter, digits and minuses. They need to consist of at least two segments in the form `component-iconname`."));return}const a=n[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(714,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")hV.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=Gy(c.fontPath).substring(1),d=mRt[l];if(!d){o.warn(g(715,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=Pt(h,c.fontPath);if(!qy(u,h)){o.warn(g(716,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=_Rt(i.description,c.fontPath),p=hV.registerIconFont(f,{src:[{location:u,format:d}]});hV.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(717,"'configuration.icons.default' must be either a reference to the id of an other theme icon (string) or a icon definition (object) with properties `fontPath` and `fontCharacter`."))}}for(const i of t.removed){const n=i.value;for(const o in n)hV.deregisterIcon(o)}})}}const mRt={ttf:"truetype",woff:"woff",woff2:"woff2"};function _Rt(s,e){return Vi.join(s.identifier.value,e)}var bB;let zJ=(bB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(pRt)}},bB.ID="workbench.contrib.iconExtensionPoint",bB);zJ=D([_(0,we)],zJ);Qu(zJ.ID,zJ,yc.BlockStartup);const ca=Object.freeze({View:Pe(4523,"View"),Help:Pe(4524,"Help"),Test:Pe(4525,"Test"),File:Pe(4526,"File"),Preferences:Pe(4527,"Preferences"),Developer:Pe(4528,"Developer")});class vRt extends li{constructor(){super({id:"menu.resetHiddenStates",title:Pe(4502,"Reset All Menus"),category:ca.View,f1:!0})}run(e){e.get(Oa).resetHiddenStates(),e.get(Ge).info("did RESET all menu hidden states")}}At(vRt);var bRt='.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:space-between}.monaco-editor .peekview-widget .head .peekview-title{align-items:baseline;display:flex;font-size:13px;margin-left:20px;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename,.monaco-editor .peekview-widget .head .peekview-title .meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;padding-right:2px;text-align:right}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{align-self:center;margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}';ut(bRt,{});let lf=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){gp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};lf=D([_(4,we),_(5,Kt),_(6,vi),_(7,Le),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],lf);var wRt=".monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-bottom-style:solid;border-bottom-width:0;border-top-style:solid;border-top-width:0;position:relative}";ut(wRt,{});const SHe=new me(new dn(0,122,204)),yRt={showArrow:!0,showFrame:!0,className:"",frameColor:SHe,arrowColor:SHe,keepEditorSelection:!1},CRt="vs.editor.contrib.zoneWidget";class SRt{constructor(e,t,i,n,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class ARt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const Sse=class Sse{constructor(e){this._editor=e,this._ruleName=Sse._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),CS(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){CS(this._ruleName),Uf(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:F.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:ni.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};Sse._IdGenerator=new DU(".arrow-decoration-");let Uve=Sse;class lMe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=xs(t),gp(this.options,yRt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Uve(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}hasFocus(){return this.domNode.contains(Bc())}show(e,t){const i=F.isIRange(e)?F.lift(e):F.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Gt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=F.isIRange(e)?F.getStartPosition(e):e,this._viewZone.afterLineNumber=e.lineNumber,this._viewZone.afterColumn=e.column,this._viewZone.heightInLines=t??this._viewZone.heightInLines,this.editor.changeViewZones(i=>{i.layoutZone(this._viewZone.id)}),this._positionMarkerId.set([{range:F.isIRange(e)?e:F.fromPositions(e),options:Gt.EMPTY}]))}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(x.lineHeight);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(x.lineHeight);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let c=0,l=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new SRt(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new ARt(CRt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new F(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,mt.Smooth):this.editor.revealRange(e,mt.Smooth)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Od(this.domNode,this,{orientation:fi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=oa.Disabled);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(x.lineHeight),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}const SXe=ae("IPeekViewService");ce(SXe,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){const t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(s);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},qt.Delayed);var ng;(function(s){s.inPeekEditor=new Q("inReferenceSearchEditor",!0,g(5106,"Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(ng||(ng={}));var wB;let $J=(wB=class{constructor(e,t){e instanceof lf&&ng.inPeekEditor.bindTo(t)}dispose(){}},wB.ID="editor.contrib.referenceController",wB);$J=D([_(1,Le)],$J);on($J.ID,$J,ri.Eager);function AXe(s){const e=s.get(Kt).getFocusedCodeEditor();return e instanceof lf?e.getParentEditor():e}const ERt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let H3=class extends lMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,gp(this.options,ERt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=fe(".head"),this._bodyElement=fe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=fe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ro(this._titleElement,"click",o=>this._onTitleClick(o))),re(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fe("span.filename"),this._secondaryHeading=fe("span.dirname"),this._metaHeading=fe("span.meta"),re(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fe(".peekview-actions");re(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new hd(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new rn("peekview.close",g(5107,"Close"),We.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:WN.bind(void 0,this.instantiationService),orientation:F_.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ms(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Yh(this._metaHeading)):zd(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};H3=D([_(2,we)],H3);const sce=W("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5108,"Background color of the peek view title area.")),dMe=W("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Rl},g(5109,"Color of the peek view title.")),hMe=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(5110,"Color of the peek view title info.")),uMe=W("peekView.border",{dark:mm,light:mm,hcDark:wt,hcLight:wt},g(5111,"Color of the peek view borders and arrow.")),xRt=W("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5112,"Background color of the peek view result list."));W("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Rl},g(5113,"Foreground color for line nodes in the peek view result list."));W("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Rl},g(5114,"Foreground color for file nodes in the peek view result list."));W("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(5115,"Background color of the selected entry in the peek view result list."));W("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Rl},g(5116,"Foreground color of the selected entry in the peek view result list."));const EXe=W("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},g(5117,"Background color of the peek view editor."));W("peekViewEditorGutter.background",EXe,g(5118,"Background color of the gutter in the peek view editor."));W("peekViewEditorStickyScroll.background",EXe,g(5119,"Background color of sticky scroll in the peek view editor."));W("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(5120,"Match highlight color in the peek view result list."));W("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(5121,"Match highlight color in the peek view editor."));W("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(5122,"Match highlight border in the peek view editor."));class Xk{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=Vme.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?g(5095,"{0} in {1} on line {2} at column {3}",e.value,_i(this.uri),this.range.startLineNumber,this.range.startColumn):g(5094,"in {0} on line {1} at column {2}",_i(this.uri),this.range.startLineNumber,this.range.startColumn)}}class DRt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new F(n,c.startColumn,n,o),d=new F(r,a,r,Un.MAX_SAFE_SMALL_INTEGER),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class U3{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ui}dispose(){bt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g(5096,"1 symbol in {0}, full path {1}",_i(this.uri),this.uri.fsPath):g(5097,"{0} symbols in {1}, full path {2}",e,_i(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new DRt(i))}catch(i){vt(i)}return this}}class of{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new I,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(of._compareReferences);let n;for(const o of e)if((!n||!xn.isEqual(n.uri,o.uri,!0))&&(n=new U3(this,o.uri),this.groups.push(n)),n.children.length===0||of._compareReferences(o,n.children[n.children.length-1])!==0){const r=new Xk(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){bt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new of(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(5098,"No results found"):this.references.length===1?g(5099,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(5100,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(5101,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%o:n=(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,o)=>({idx:o,prefixLen:$y(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&F.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return xn.compare(e.uri,t.uri)||F.compareRangesUsingStarts(e.range,t.range)}}var kRt=".monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-bottom-width:1px;border-top-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;padding:3em 0;text-align:center;width:100%}.monaco-editor .reference-zone-widget .ref-tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground);line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{overflow:hidden;text-overflow:ellipsis}.monaco-editor .reference-zone-widget .ref-tree .reference-file{color:var(--vscode-peekViewResult-fileForeground);display:inline-flex;height:100%;width:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-left:auto;margin-right:12px}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input,.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder,transparent);box-sizing:border-box}";ut(kRt,{});var Vve;let zve=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof of||e instanceof U3}getChildren(e){if(e instanceof of)return e.groups;if(e instanceof U3)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};zve=D([_(0,fn)],zve);class IRt{getHeight(){return 23}getTemplateId(e){return e instanceof U3?GJ.id:KJ.id}}let $ve=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof Xk){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return _i(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};$ve=D([_(0,Ut)],$ve);class TRt{getId(e){return e instanceof Xk?e.id:e.uri}}let Gve=class extends V{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new D3(i,{supportHighlights:!0})),this.badge=new x_e(re(i,fe(".count")),{},Uje),e.appendChild(i)}set(e,t){const i=Lr(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(g(11226,"{0} references",n)):this.badge.setTitleFormat(g(11227,"{0} reference",n))}};Gve=D([_(1,Fs)],Gve);var wL;let GJ=(wL=class{constructor(e){this._instantiationService=e,this.templateId=Vve.id}renderTemplate(e){return this._instantiationService.createInstance(Gve,e)}renderElement(e,t,i){i.set(e.element,xU(e.filterData))}disposeTemplate(e){e.dispose()}},Vve=wL,wL.id="FileReferencesRenderer",wL);GJ=Vve=D([_(0,we)],GJ);class LRt extends V{constructor(e){super(),this.label=this._register(new rD(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${_i(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:o}=i;t&&!N_.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,xU(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[o]))}}}const Ase=class Ase{constructor(){this.templateId=Ase.id}renderTemplate(e){return new LRt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};Ase.id="OneReferenceRenderer";let KJ=Ase;class RRt{getWidgetAriaLabel(){return g(11228,"References")}getAriaLabel(e){return e.ariaMessage}}const Ese=class Ese{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Z,this._callOnModelChange=new Z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,o=e.children.length;n{const o=n.deltaDecorations([],t);for(let r=0;r{o.equals(S.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(NRt,"ReferencesWidget",this._treeContainer,new IRt,[this._instantiationService.createInstance(GJ),this._instantiationService.createInstance(KJ)],this._instantiationService.createInstance(zve),i),this._splitView.addView({onDidChange:M.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},Kk.Distribute),this._splitView.addView({onDidChange:M.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},Kk.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,r)=>{o instanceof Xk&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")})),zd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new bn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g(9797,"No results"),Yh(this._messageContainer),Promise.resolve(void 0)):(zd(this._messageContainer),this._decorationsManager=new Kve(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Yh(this._treeContainer),Yh(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Xk)return e;if(e instanceof U3&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==pe.inMemory?this.setTitle(EA(e.uri),this._uriLabel.getUriLabel(Lr(e.uri))):this.setTitle(g(9798,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}bt(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?mt.Smooth:mt.Immediate,a=F.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};qve=D([_(3,pn),_(4,fn),_(5,we),_(6,SXe),_(7,Fs),_(8,JA),_(9,Ut),_(10,xi),_(11,Vs)],qve);var Xq;const VN=new Q("referenceSearchVisible",!1,g(4503,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var yL;let NM=(yL=class{static get(e){return e.getContribution(Xq.ID)}constructor(e,t,i,n,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=VN.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=MRt.fromJSON(this._storageService.get(o,Ie.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(qve,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(4504,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),Ie.PROFILE,an.MACHINE),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{const{element:l,kind:d}=c;if(l)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":i?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const a=++this._requestIdPool;t.then(c=>{if(a!==this._requestIdPool||!this._widget){c.dispose();return}return this._model?.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(g(4505,"{0} ({1})",this._model.title,this._model.references.length));const l=this._editor.getModel().uri,d=new oe(e.startLineNumber,e.startColumn),h=this._model.nearestReference(l,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(x.peekWidgetDefaultFocus)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=F.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:Db.JUMP,pinned:t}},this._editor).then(n=>{if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=Xq.get(n),r=this._model.clone();this.closeWidget(),n.focus(),o?.toggleWidget(i,Rr(a=>Promise.resolve(r)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,vt(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:Db.JUMP,pinned:i}},this._editor,t)}},Xq=yL,yL.ID="editor.contrib.referencesController",yL);NM=Xq=D([_(2,Le),_(3,Kt),_(4,bi),_(5,we),_(6,$i),_(7,Te)],NM);function zN(s,e){const t=AXe(s);if(!t)return;const i=NM.get(t);i&&e(i)}So.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:Ae.EditorContrib,primary:rr(U.CtrlCmd|S.KeyK,S.F2),when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});So.registerCommandAndKeybindingRule({id:"goToNextReference",weight:Ae.EditorContrib-10,primary:S.F4,secondary:[S.F12],when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.goToNextOrPreviousReference(!0)})}});So.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:Ae.EditorContrib-10,primary:U.Shift|S.F4,secondary:[U.Shift|S.F12],when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.goToNextOrPreviousReference(!1)})}});_t.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");_t.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");_t.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");_t.registerCommand("closeReferenceSearch",s=>zN(s,e=>e.closeWidget()));So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.EditorContrib-101,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(ng.inPeekEditor,he.not("config.editor.stablePeek"))});So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.WorkbenchContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(VN,he.not("config.editor.stablePeek"),he.or(J.editorTextFocus,nRe.negate()))});So.registerCommandAndKeybindingRule({id:"revealReference",weight:Ae.WorkbenchContrib,primary:S.Enter,mac:{primary:S.Enter,secondary:[U.CtrlCmd|S.DownArrow]},when:he.and(VN,Sae,aRe.negate(),cRe.negate()),handler(s){const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.revealReference(t[0]))}});So.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Enter,mac:{primary:U.WinCtrl|S.Enter},when:he.and(VN,Sae,aRe.negate(),cRe.negate()),handler(s){const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.openReference(t[0],!0,!0))}});_t.registerCommand("openReference",s=>{const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.openReference(t[0],!1,!0))});let Qve=class extends NM{constructor(e,t,i,n,o,r,a){super(!1,e,t,i,n,o,r,a)}};Qve=D([_(1,Le),_(2,Kt),_(3,bi),_(4,we),_(5,$i),_(6,Te)],Qve);on(NM.ID,Qve,ri.Lazy);const nFe=class nFe extends V{constructor(e){super(),this._editor=e,this._altListeningMouse=!1,this._altMouseTriggered=!1,this._register(this._editor.onMouseDown(t=>{this._altListeningMouse&&(this._altMouseTriggered=!0)})),this._register(this._editor.onKeyDown(t=>{t.equals(U.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(U.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};nFe.ID="editor.contrib.menuPreventer";let MA=nFe;on(MA.ID,MA,ri.BeforeFirstInteraction);let V3=class extends vp{constructor(e,t,i,n,o,r,a,c,l){super(e,n.getRawOptions(),i,o,r,a,c,l),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){gp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};V3=D([_(4,Le),_(5,we),_(6,Kt),_(7,lv),_(8,XA)],V3);const U6=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};class xXe extends pd{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=fe(".floating-click-widget"),this._domNode.style.padding="6px 11px",this._domNode.style.borderRadius="2px",this._domNode.style.cursor="pointer",this._domNode.style.zIndex="1"}getDomNode(){return this._domNode}render(){Ms(this._domNode),this._domNode.style.backgroundColor=Fpe(_y,ze(Hc)),this._domNode.style.color=Fpe(bM,ze(Rl)),this._domNode.style.border=`1px solid ${ze(wt)}`,re(this._domNode,fe("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let qJ=class extends V{constructor(e,t,i){super(),this.renderEmitter=new I,this.onDidRender=this.renderEmitter.event,this.menu=this._register(t.createMenu(e,i))}render(){const e=this._register(new Z),t=()=>{if(e.clear(),!this.isVisible())return;const i=[];if(fC(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[n]=i,o=this.createWidget(n,e);e.add(o),e.add(o.onClick(()=>n.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};qJ=D([_(1,Oa),_(2,Le)],qJ);let AHe=class extends qJ{constructor(e,t,i,n){super(e.menuId,i,n),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(xXe,e.label),n=i.getDomNode();return this.options.container.appendChild(n),t.add(Ee(()=>n.remove())),i}getActionArg(){return this.options.getActionArg()}};AHe=D([_(1,we),_(2,Oa),_(3,Le)],AHe);var Zq,FD;let EHe=(FD=class extends V{constructor(e){super(),this.editorService=e,this._onHighlightRemoved=this._register(new I),this.onHighlightRemoved=this._onHighlightRemoved.event,this.rangeHighlightDecorationId=null,this.editor=null,this.editorDisposables=this._register(new Z)}removeHighlightRange(){if(this.editor&&this.rangeHighlightDecorationId){const e=this.rangeHighlightDecorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e)}),this._onHighlightRemoved.fire()}this.rangeHighlightDecorationId=null}highlightRange(e,t){t=t??this.getEditor(e),Qr(t)?this.doHighlightRange(t,e):W2(t)&&Qr(t.activeCodeEditor)&&this.doHighlightRange(t.activeCodeEditor,e)}doHighlightRange(e,t){this.removeHighlightRange(),e.changeDecorations(i=>{this.rangeHighlightDecorationId=i.addDecoration(t.range,this.createRangeHighlightDecoration(t.isWholeLine))}),this.setEditor(e)}getEditor(e){const t=this.editorService.activeEditor?.resource;if(t&&ji(t,e.resource)&&Qr(this.editorService.activeTextEditorControl))return this.editorService.activeTextEditorControl}setEditor(e){this.editor!==e&&(this.editorDisposables.clear(),this.editor=e,this.editorDisposables.add(this.editor.onDidChangeCursorPosition(t=>{(t.reason===Oi.NotSet||t.reason===Oi.Explicit||t.reason===Oi.Undo||t.reason===Oi.Redo)&&this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidChangeModel(()=>{this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidDispose(()=>{this.removeHighlightRange(),this.editor=null})))}createRangeHighlightDecoration(e=!0){return e?Zq._WHOLE_LINE_RANGE_HIGHLIGHT:Zq._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},Zq=FD,FD._WHOLE_LINE_RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight-whole",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),FD._RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),FD);EHe=Zq=D([_(0,ei)],EHe);let QJ=class extends xXe{constructor(e,t,i,n){super(i&&n.lookupKeybinding(i)?`${t} (${n.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Wg.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};QJ=D([_(3,Ut)],QJ);var yB;let xHe=(yB=class extends qJ{constructor(e,t,i,n){super(_e.EditorContent,i,n),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(QJ,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof lf)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},yB.ID="editor.contrib.floatingClickMenu",yB);xHe=D([_(1,we),_(2,Oa),_(3,Le)],xHe);Object.freeze({id:"application",order:100,title:g(4506,"Application"),type:"object"});const V6=Object.freeze({id:"workbench",order:7,title:g(4507,"Workbench"),type:"object"}),PRt=Object.freeze({id:"security",scope:at.APPLICATION,title:g(4508,"Security"),type:"object",order:7}),FRt=Object.freeze({id:"problems",title:g(4509,"Problems"),type:"object",order:101}),DXe=Object.freeze({id:"window",order:8,title:g(4510,"Window"),type:"object"}),Mm={ConfigurationMigration:"base.contributions.configuration.migration"};class ORt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const eQ=new ORt;Qe.add(Mm.ConfigurationMigration,eQ);var CB;let jJ=(CB=class extends V{constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const n of i.added)await this.migrateConfigurationsForFolder(n,eQ.migrations)})),this.migrateConfigurations(eQ.migrations),this._register(eQ.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),n=this.workspaceService.getWorkbenchState()===qi.WORKSPACE?[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE],["workspaceFolder",St.WORKSPACE_FOLDER]]:[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE]];for(const[o,r]of n){const a=i[o];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,o,a.value,t,void 0);for(const d of l??[])c.push([d,[]])}for(const{identifiers:l,value:d}of a.overrides??[])if(d!==void 0){const h=await this.runMigration(e,o,d,t,l);for(const u of h??[])c.push([u,l])}c.length&&await Promise.allSettled(c.map(async([[l,d],h])=>this.configurationService.updateValue(l,d.value,{resource:t,overrideIdentifiers:h},r)))}}async runMigration(e,t,i,n,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:n})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Ys(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},CB.ID="workbench.contrib.configurationMigration",CB);jJ=D([_(0,Te),_(1,yi)],jJ);var SB;let YJ=(SB=class extends V{constructor(e){super(),this.remoteAgentService=e,this._ready=new dc,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Qn&&(await this.remoteAgentService.getEnvironment())?.os!==Ds.Windows)return;Qe.as(Nn.Configuration).registerConfiguration({...PRt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(4511,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(4512,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:at.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(4513,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:at.MACHINE}}})}},SB.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",SB);YJ=D([_(0,hg)],YJ);const w4="window.newWindowProfile";var AB;let JJ=(AB=class extends V{constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==St.DEFAULT&&i.affectsConfiguration(w4)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=Qe.as(Nn.Configuration),t={...DXe,properties:{[w4]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(4514,"Active Window")],description:g(4515,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the Default profile if no active window exists."),scope:at.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(w4);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(w4);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(w4,t?.name)}},AB.ID="workbench.contrib.dynamicWindowConfiguration",AB);JJ=D([_(0,Em),_(1,Te)],JJ);class BRt extends li{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Pe(4976,"Toggle Collapse Unchanged Regions"),icon:ve.map,toggled:he.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:he.has("isInDiffEditor"),menu:{when:he.has("isInDiffEditor"),id:_e.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class kXe extends li{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Pe(4977,"Toggle Show Moved Code Blocks"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class IXe extends li{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Pe(4978,"Toggle Use Inline View When Space Is Limited"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const z6=Pe(4979,"Diff Editor");class WRt extends gf{constructor(){super({id:"diffEditor.switchSide",title:Pe(4980,"Switch Side"),icon:ve.arrowSwap,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,i){const n=HU(e);if(n instanceof vp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class HRt extends gf{constructor(){super({id:"diffEditor.exitCompareMove",title:Pe(4981,"Exit Compare Move"),icon:ve.close,precondition:J.comparingMovedCode,f1:!1,category:z6,keybinding:{weight:1e4,primary:S.Escape}})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.exitCompareMove()}}class URt extends gf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Pe(4982,"Collapse All Unchanged Regions"),icon:ve.fold,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.collapseAllUnchangedRegions()}}class VRt extends gf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Pe(4983,"Show All Unchanged Regions"),icon:ve.unfold,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.showAllUnchangedRegions()}}class jve extends li{constructor(){super({id:"diffEditor.revert",title:Pe(4984,"Revert"),f1:!1,category:z6})}run(e,t){const i=zRt(e,t.originalUri,t.modifiedUri);i instanceof vp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const TXe=Pe(4985,"Accessible Diff Viewer"),xse=class xse extends li{constructor(){super({id:xse.id,title:Pe(4986,"Go to Next Difference"),category:TXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){HU(e)?.accessibleDiffViewerNext()}};xse.id="editor.action.accessibleDiffViewer.next";let mW=xse;const Dse=class Dse extends li{constructor(){super({id:Dse.id,title:Pe(4987,"Go to Previous Difference"),category:TXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:U.Shift|S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){HU(e)?.accessibleDiffViewerPrev()}};Dse.id="editor.action.accessibleDiffViewer.prev";let z3=Dse;function zRt(s,e,t){return s.get(Kt).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function HU(s){const t=s.get(Kt).listDiffEditors(),i=Bc();if(i)for(const n of t){const o=n.getContainerDomNode();if($Rt(o,i))return n}return null}function $Rt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}var Pb;(function(s){s.Terminal="terminal",s.TerminalChat="terminal-chat",s.TerminalHelp="terminal-help",s.DiffEditor="diffEditor",s.Chat="panelChat",s.InlineChat="inlineChat",s.InlineCompletions="inlineCompletions",s.KeybindingsEditor="keybindingsEditor",s.Notebook="notebook",s.Editor="editor",s.Hover="hover",s.Notification="notification",s.EmptyEditorHint="emptyEditorHint",s.Comments="comments",s.Repl="repl",s.ReplHelp="replHelp",s.RunAndDebug="runAndDebug"})(Pb||(Pb={}));var wm;(function(s){s.Help="help",s.View="view"})(wm||(wm={}));var DHe;(function(s){s.Previous="previous",s.Next="next"})(DHe||(DHe={}));class LXe extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.id=e,this.options=t,this.provideContent=i,this.onClose=n,this.verbositySettingKey=o,this.onOpen=r,this.actions=a,this.provideNextContent=c,this.providePreviousContent=l,this.onDidChangeContent=d,this.onKeyDown=h,this.getSymbols=u,this.onDidRequestClearLastProvider=f}}const GRt=new Q("hasSpeechProvider",!1,{type:"boolean",description:g(6234,"A speech provider is registered to the speech service.")}),KRt=new Q("speechToTextInProgress",!1,{type:"boolean",description:g(6235,"A speech-to-text session is in progress.")});new Q("textToSpeechInProgress",!1,{type:"boolean",description:g(6236,"A text-to-speech session is in progress.")});var pF;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(pF||(pF={}));var Yve;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(Yve||(Yve={}));var kHe;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped",s[s.Canceled=3]="Canceled"})(kHe||(kHe={}));var XO;(function(s){s.SpeechTimeout="accessibility.voice.speechTimeout",s.AutoSynthesize="accessibility.voice.autoSynthesize",s.SpeechLanguage="accessibility.voice.speechLanguage"})(XO||(XO={}));XO.SpeechLanguage;const qRt={"da-DK":{name:g(6237,"Danish (Denmark)")},"de-DE":{name:g(6238,"German (Germany)")},"en-AU":{name:g(6239,"English (Australia)")},"en-CA":{name:g(6240,"English (Canada)")},"en-GB":{name:g(6241,"English (United Kingdom)")},"en-IE":{name:g(6242,"English (Ireland)")},"en-IN":{name:g(6243,"English (India)")},"en-NZ":{name:g(6244,"English (New Zealand)")},"en-US":{name:g(6245,"English (United States)")},"es-ES":{name:g(6246,"Spanish (Spain)")},"es-MX":{name:g(6247,"Spanish (Mexico)")},"fr-CA":{name:g(6248,"French (Canada)")},"fr-FR":{name:g(6249,"French (France)")},"hi-IN":{name:g(6250,"Hindi (India)")},"it-IT":{name:g(6251,"Italian (Italy)")},"ja-JP":{name:g(6252,"Japanese (Japan)")},"ko-KR":{name:g(6253,"Korean (South Korea)")},"nl-NL":{name:g(6254,"Dutch (Netherlands)")},"pt-PT":{name:g(6255,"Portuguese (Portugal)")},"pt-BR":{name:g(6256,"Portuguese (Brazil)")},"ru-RU":{name:g(6257,"Russian (Russia)")},"sv-SE":{name:g(6258,"Swedish (Sweden)")},"tr-TR":{name:g(6259,"Turkish (Türkiye)")},"zh-CN":{name:g(6260,"Chinese (Simplified, China)")},"zh-HK":{name:g(6261,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(6262,"Chinese (Traditional, Taiwan)")}},NA=new Q("accessibilityHelpIsShown",!1,!0),bp=new Q("accessibleViewIsShown",!1,!0),XJ=new Q("accessibleViewSupportsNavigation",!1,!0),IHe=new Q("accessibleViewVerbosityEnabled",!1,!0),THe=new Q("accessibleViewGoToSymbolSupported",!1,!0);new Q("accessibleViewOnLastLine",!1,!0);const ZJ=new Q("accessibleViewCurrentProviderId",void 0,void 0);new Q("accessibleViewInCodeBlock",void 0,void 0);const eX=new Q("accessibleViewContainsCodeBlocks",void 0,void 0),LHe=new Q("accessibleViewHasUnassignedKeybindings",void 0,void 0),RHe=new Q("accessibleViewHasAssignedKeybindings",void 0,void 0);var Jve;(function(s){s.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",s.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",s.HideAccessibleView="accessibility.hideAccessibleView",s.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(Jve||(Jve={}));var MHe;(function(s){s[s.Default=.75]="Default",s[s.Minimum=.2]="Minimum",s[s.Maximum=1]="Maximum"})(MHe||(MHe={}));var vr;(function(s){s.Terminal="accessibility.verbosity.terminal",s.DiffEditor="accessibility.verbosity.diffEditor",s.Chat="accessibility.verbosity.panelChat",s.InlineChat="accessibility.verbosity.inlineChat",s.TerminalChat="accessibility.verbosity.terminalChat",s.InlineCompletions="accessibility.verbosity.inlineCompletions",s.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",s.Notebook="accessibility.verbosity.notebook",s.Editor="accessibility.verbosity.editor",s.Hover="accessibility.verbosity.hover",s.Notification="accessibility.verbosity.notification",s.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",s.ReplInputHint="accessibility.verbosity.replInputHint",s.Comments="accessibility.verbosity.comments",s.DiffEditorActive="accessibility.verbosity.diffEditorActive",s.Debug="accessibility.verbosity.debug"})(vr||(vr={}));const yf={type:"boolean",default:!0,tags:["accessibility"]},RXe=Object.freeze({id:"accessibility",title:g(4679,"Accessibility"),type:"object"}),Ua={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(4680,"Enable sound when a screen reader is attached."),g(4681,"Enable sound."),g(4682,"Disable sound.")],tags:["accessibility"]},bd={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},wd={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(4683,"Enable announcement, will only play when in screen reader optimized mode."),g(4684,"Disable announcement.")],tags:["accessibility"]},UI={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...RXe,scope:at.RESOURCE,properties:(vr.Terminal+"",{description:g(4685,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...yf},vr.DiffEditor+"",{description:g(4686,"Provide information about how to navigate changes in the diff editor when it is focused."),...yf},vr.Chat+"",{description:g(4687,"Provide information about how to access the chat help menu when the chat input is focused."),...yf},vr.InlineChat+"",{description:g(4688,"Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused."),...yf},vr.InlineCompletions+"",{description:g(4689,"Provide information about how to access the inline completions hover and Accessible View."),...yf},vr.KeybindingsEditor+"",{description:g(4690,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...yf},vr.Notebook+"",{description:g(4691,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...yf},vr.Hover+"",{description:g(4692,"Provide information about how to open the hover in an Accessible View."),...yf},vr.Notification+"",{description:g(4693,"Provide information about how to open the notification in an Accessible View."),...yf},vr.EmptyEditorHint+"",{description:g(4694,"Provide information about relevant actions in an empty text editor."),...yf},vr.ReplInputHint+"",{description:g(4695,"Provide information about relevant actions For the Repl input."),...yf},vr.Comments+"",{description:g(4696,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...yf},vr.DiffEditorActive+"",{description:g(4697,"Indicate when a diff editor becomes the active editor."),...yf},vr.Debug+"",{description:g(4698,"Provide information about how to access the debug console accessibility help dialog when the debug console or run and debug viewlet is focused. Note that a reload of the window is required for this to take effect."),...yf},Jve.AccessibleViewCloseOnKeyPress+"",g(4699,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(4700,"The volume of the sounds in percent (0-100)."),g(4701,"Whether or not position changes should be debounced"),g(4702,"The delay in milliseconds before an announcement is made."),g(4703,"The delay in milliseconds before a sound is played."),g(4704,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(4705,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(4706,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(4707,"The delay in milliseconds before a sound is played when there's an error at the position."),{...bd,description:g(4708,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(4709,"Plays a sound when the active line has a breakpoint."),...Ua},{description:g(4710,"Announces when the active line has a breakpoint."),...wd})},{...UI,description:g(4711,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(4712,"Plays a sound when the active line has an inline suggestion."),...Ua}},{...bd,description:g(4713,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(4714,"Plays a sound when the active line has an error."),...Ua},{description:g(4715,"Announces when the active line has an error."),...wd})},{...bd,description:g(4716,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(4717,"Plays a sound when the active line has a folded area that can be unfolded."),...Ua},{description:g(4718,"Announces when the active line has a folded area that can be unfolded."),...wd})},{...bd,description:g(4719,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4720,"Plays a sound when the active line has a warning."),...Ua},{description:g(4721,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4722,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4723,"Plays a sound when the active line has a warning."),...Ua},{description:g(4724,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4725,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4726,"Plays a sound when the active line has a warning."),...Ua},{description:g(4727,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4728,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(4729,"Plays a sound when the debugger stopped on a breakpoint."),...Ua},{description:g(4730,"Announces when the debugger stopped on a breakpoint."),...wd})},{...bd,description:g(4731,"Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."),properties:({description:g(4732,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...Ua},{description:g(4733,"Announces when trying to read a line with inlay hints that has no inlay hints."),...wd})},{...bd,description:g(4734,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(4735,"Plays a sound when a task is completed."),...Ua},{description:g(4736,"Announces when a task is completed."),...wd})},{...bd,description:g(4737,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(4738,"Plays a sound when a task fails (non-zero exit code)."),...Ua},{description:g(4739,"Announces when a task fails (non-zero exit code)."),...wd})},{...bd,description:g(4740,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(4741,"Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Ua},{description:g(4742,"Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...wd})},{...bd,description:g(4743,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(4744,"Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Ua},{description:g(4745,"Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...wd})},{...bd,description:g(4746,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(4747,"Plays a sound when terminal Quick Fixes are available."),...Ua},{description:g(4748,"Announces when terminal Quick Fixes are available."),...wd})},{...bd,description:g(4749,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(4750,"Plays a sound when the terminal bell is ringing."),...Ua},{description:g(4751,"Announces when the terminal bell is ringing."),...wd})},{...UI,description:g(4752,"Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(4753,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...UI,description:g(4754,"Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(4755,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...UI,description:g(4756,"Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(4757,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...bd,description:g(4758,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(4759,"Plays a sound when a notebook cell execution is successfully completed."),...Ua},{description:g(4760,"Announces when a notebook cell execution is successfully completed."),...wd})},{...bd,description:g(4761,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(4762,"Plays a sound when a notebook cell execution fails."),...Ua},{description:g(4763,"Announces when a notebook cell execution fails."),...wd})},{...bd,description:g(4764,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(4765,"Plays a sound when a chat request is made."),...Ua},{description:g(4766,"Announces when a chat request is made."),...wd})},{...bd,description:g(4767,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(4768,"Plays a sound on loop while progress is occurring."),...Ua},{description:g(4769,"Alerts on loop while progress is occurring."),...wd})},{...UI,description:g(4770,"Plays a sound / audio cue when the response has been received."),properties:{description:g(4771,"Plays a sound on loop while the response has been received."),...Ua}},{...UI,description:g(4772,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(4773,"Plays a sound when the voice recording has started."),...Ua}},{...UI,description:g(4774,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(4775,"Plays a sound when the voice recording has stopped."),...Ua}},{...bd,description:g(4776,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."),properties:({description:g(4777,"Plays a sound when a feature is cleared."),...Ua},{description:g(4778,"Announces when a feature is cleared."),...wd})},g(4779,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(4780,"Plays a sound when a file is saved."),g(4781,"Plays the sound when a user explicitly saves a file."),g(4782,"Plays the sound whenever a file is saved, including auto save."),g(4783,"Never plays the sound."),g(4784,"Announces when a file is saved."),g(4785,"Announces when a user explicitly saves a file."),g(4786,"Announces whenever a file is saved, including auto save."),g(4787,"Never plays the announcement."),g(4788,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(4789,"Plays a sound when a file or notebook is formatted."),g(4790,"Plays the sound when a user explicitly formats a file."),g(4791,"Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(4792,"Never plays the sound."),g(4793,"Announces when a file or notebook is formatted."),g(4794,"Announces when a user explicitly formats a file."),g(4795,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(4796,"Never announces."),g(4797,"Controls whether links should be underlined in the workbench."),g(4798,"Controls whether variable changes should be announced in the debug watch view."))});const QRt=1200;var EB;let NHe=(EB=class extends V{constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(M.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((n,o)=>e[n].name.localeCompare(e[o].name));Qe.as(Nn.Configuration).registerConfiguration({...RXe,properties:{[XO.SpeechTimeout]:{markdownDescription:g(4802,"The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."),type:"number",default:QRt,minimum:0,tags:["accessibility"]},[XO.SpeechLanguage]:{markdownDescription:g(4803,"The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."),type:"string",enum:t,default:"auto",tags:["accessibility"],enumDescriptions:t.map(n=>e[n].name),enumItemLabels:t.map(n=>e[n].name)},[XO.AutoSynthesize]:{type:"boolean",markdownDescription:g(4804,"Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."),default:this.productService.quality!=="stable",tags:["accessibility"]}}})}getLanguages(){return{auto:{name:g(4805,"Auto (Use Display Language)")},...qRt}}},EB.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",EB);NHe=D([_(0,Kae),_(1,Er)],NHe);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(s,e)=>[["accessibility.signalOptions.volume",{value:s}],["audioCues.volume",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["audioCues.debouncePositionChanges",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(s,e)=>{const t=zhe(e,"general"),i=zhe(e,"errorAtPosition"),n=zhe(e,"warningAtPosition"),o=jRt(e),r=YRt(e);return[["accessibility.signalOptions.volume",{value:o}],["accessibility.signalOptions.debouncePositionChanges",{value:r}],["accessibility.signalOptions.experimental.delays.general",{value:t}],["accessibility.signalOptions.experimental.delays.errorAtPosition",{value:i}],["accessibility.signalOptions.experimental.delays.warningAtPosition",{value:n}],["accessibility.signalOptions",{value:void 0}]]}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:s=>[["accessibility.signalOptions.volume",{value:s}],["accessibility.signals.sounds.volume",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}]);function zhe(s,e){return s(`accessibility.signalOptions.experimental.delays.${e}`)||s("accessibility.signalOptions")?.["experimental.delays"]?.[`${e}`]||s("accessibility.signalOptions")?.delays?.[`${e}`]}function jRt(s){return s("accessibility.signalOptions.volume")||s("accessibility.signalOptions")?.volume||s("accessibility.signals.sounds.volume")||s("audioCues.volume")}function YRt(s){return s("accessibility.signalOptions.debouncePositionChanges")||s("accessibility.signalOptions")?.debouncePositionChanges||s("accessibility.signals.debouncePositionChanges")||s("audioCues.debouncePositionChanges")}Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(s,e)=>[["accessibility.signals.progress",{value:s}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations(cl.allAccessibilitySignals.map(s=>s.legacySoundSettingsKey?{key:s.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],n=s.legacyAnnouncementSettingsKey;let o;return n&&(o=t(n)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${s.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(Fc));Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations(cl.allAccessibilitySignals.filter(s=>!!s.legacyAnnouncementSettingsKey&&!!s.legacySoundSettingsKey).map(s=>({key:s.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],n=t(s.settingsKey)?.sound||t(s.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${s.settingsKey}`,{value:e!==void 0?{announcement:e,sound:n}:{sound:n}}]),i.push([`${s.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Xd;(function(s){s.OpenAccessibleView="editor.action.accessibleView",s.OpenAccessibilityHelp="editor.action.accessibilityHelp",s.DisableVerbosityHint="editor.action.accessibleViewDisableHint",s.GoToSymbol="editor.action.accessibleViewGoToSymbol",s.ShowNext="editor.action.accessibleViewNext",s.ShowPrevious="editor.action.accessibleViewPrevious",s.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",s.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",s.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",s.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",s.AccessibilityHelpConfigureAssignedKeybindings="editor.action.accessibilityHelpConfigureAssignedKeybindings",s.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Xd||(Xd={}));function JRt(s){const e=new Z,t=e.add(GGe());return e.add(ai(i=>{t.setStyle(s.read(i))})),e}const MXe="editor.action.inlineSuggest.commit",NXe="editor.action.inlineSuggest.showPrevious",PXe="editor.action.inlineSuggest.showNext";var XRt=".monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{cursor:pointer;display:inline-block;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{font-size:0;opacity:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border);color:var(--vscode-editorGhostText-foreground)!important}";ut(XRt,{});class $3{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}render(e,t=!1){return new B2([...this.parts.map(i=>new au(F.fromPositions(new oe(this.lineNumber,i.column)),t?`[${i.lines.join(` `)}]`:i.lines.join(` -`)))]).applyToString(e)}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new WU([...this.parts.map(o=>new ug(O.fromPositions(new oe(1,o.column)),o.lines.join(` -`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class Ete{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=xw(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class hye{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=s,this.parts=[new Ete(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=xw(this.text)}renderForScreenReader(e){return this.newLines.join(` -`)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new WU([new ug(O.fromPositions(i.getStartPosition()),"("),new ug(O.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` -`)}]`)]).applyToString(e):new WU([new ug(i,this.newLines.join(` -`))]).applyToString(e)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function i4e(n,e){return Ls(n,e,Yet)}function Yet(n,e){return n===e?!0:!n||!e?!1:n instanceof q7&&e instanceof q7||n instanceof hye&&e instanceof hye?n.equals(e):!1}const SNt=[];function ANt(){return SNt}class Jet{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new cn(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new O(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Xet(n,e){const t=new Z,i=n.createDecorationsCollection();return t.add(bQ({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function ENt(n,e){return new oe(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function n4e(n,e){return new oe(n.lineNumber-e.lineNumber+1,n.lineNumber-e.lineNumber===0?n.column-e.column+1:n.column)}const s4e="ghost-text";let uye=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=xi(this,!1),this.currentTextModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;const a=r instanceof hye?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const w=l[l.length-1];v&&w.decorations.push(new ig(w.content.length+1,w.content.length+1+m[0].length,v,Mc.Regular)),w.content+=m[0],m=m.slice(1)}for(const w of m)l.push({content:w,decorations:v?[new ig(1,w.length+1,v,Mc.Regular)]:[]})}const h=o.getLineContent(r.lineNumber);let u,f=0;for(const m of r.parts){let v=m.lines;u===void 0?(c.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):d([h.substring(f,m.column-1)],void 0),v.length>0&&(d(v,s4e),u===void 0&&m.column<=h.length&&(u=m.column)),f=m.column-1}u!==void 0&&d([h.substring(f)],void 0);const p=u!==void 0?new Jet(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:O.fromPositions(new oe(o.lineNumber,a.column)),options:{description:s4e,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Bv.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new Zet(this.editor,this.languageService.languageIdCodec,Dt(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};uye=D([_(2,Di)],uye);class Zet extends ${get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Bh("editorOptionChanged",T.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(x.disableMonospaceOptimizations)||s.hasChanged(x.stopRenderingLineAfter)||s.hasChanged(x.renderWhitespace)||s.hasChanged(x.renderControlCharacters)||s.hasChanged(x.fontLigatures)||s.hasChanged(x.fontInfo)||s.hasChanged(x.lineHeight))),this._register(Ni(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");xNt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:jo.Right})}})}}function xNt(n,e,t,i,s){const o=i.get(x.disableMonospaceOptimizations),r=i.get(x.stopRenderingLineAfter),a="none",c=i.get(x.renderControlCharacters),l=i.get(x.fontLigatures),d=i.get(x.fontInfo),h=i.get(x.lineHeight),u=new fz(1e4);u.appendString('
      ');for(let m=0,v=t.length;m');const C=qq(b),y=DU(b),S=lh.createEmpty(b,s);lQ(new tL(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,b,!1,C,y,0,S,w.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==l1.OFF,null),u),u.appendString("
      ")}u.appendString(""),Sd(n,d);const f=u.build(),p=o4e?o4e.createHTML(f):f;n.innerHTML=p}const o4e=Jx("editorGhostText",{createHTML:n=>n}),xK="vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys",YC=class YC extends ${constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=YC.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=YC.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=YC.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=YC.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ni(i=>{const o=this.model.read(i)?.state.read(i),r=!!o?.inlineCompletion&&o?.primaryGhostText!==void 0&&!o?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(r),o?.primaryGhostText&&o?.inlineCompletion&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ni(i=>{const s=this.model.read(i);let o=!1,r=!0;const a=s?.primaryGhostText.read(i);if(s?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=s.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=Eu(d);f===-1&&(f=d.length-1),o=f>0;const p=s.textModel.getOptions().tabSize;r=Ic.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(xm((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=wO((l,d)=>{const h=d.add(this.instantiationService.createInstance(vV,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(Ni(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==Ub.Explicit&&r.triggerExplicitly()})),h}),c=Qxt(this,(l,d)=>!!this.position.read(l)||!!d);o.add(Ni(l=>{c.read(l)&&a.read(l)}))}))}};gye=D([_(2,be)],gye);const kNt=Ki("inline-suggestion-hints-next",Ce.chevronRight,g(Q$,0,"Icon for show next parameter hint.")),INt=Ki("inline-suggestion-hints-previous",Ce.chevronLeft,g(Q$,1,"Icon for show previous parameter hint."));var l0;let vV=(l0=class extends ${static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new xn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(Q$,2,"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${LJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.previousAction=this.createCommandAction(jet,g(Q$,3,"Previous"),$e.asClassName(INt)),this.availableSuggestionCountAction=new xn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Ket,g(Q$,4,"Next"),$e.asClassName(kNt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new yn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new yn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(fye,this.nodes.toolBar,Te.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof id)return c.createInstance(TNt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new LNt(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{LJ._dropDownVisible=u})),this._register(Ni(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(Ni(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Ni(u=>{const p=this._extraCommands.read(u).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const w of v)w instanceof id&&p.push(w);p.length>0&&p.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},LJ=l0,l0._dropDownVisible=!1,l0.id=0,l0);vV=LJ=D([_(6,ji),_(7,be),_(8,ti),_(9,Pe),_(10,_c)],vV);class LNt extends WS{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let TNt=class extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,$c,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},fye=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};fye=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,ji),_(8,rn)],fye);function RNt(n,e){const t=new hYe,i=new gYe(t,l=>e.getLanguageConfiguration(l)),s=new uYe(new MNt([n]),i),o=xwe(s,[],void 0,!0);let r="";const a=n.getLineContent();function c(l,d){if(l.kind===lr.Pair)if(c(l.openingBracket,d),d=ta(d,l.openingBracket.length),l.child&&(c(l.child,d),d=ta(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=ta(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==lr.UnexpectedClosingBracket){if(l.kind===lr.Text||l.kind===lr.Bracket)r+=a.substring(d,ta(d,l.length));else if(l.kind===lr.List)for(const h of l.children)c(h,d),d=ta(d,h.length)}}return c(o,og),r}class MNt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getValue(){return this.lines.map(e=>e.getLineContent()).join(` -`)}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var Zt;(function(n){n[n.Dollar=0]="Dollar",n[n.Colon=1]="Colon",n[n.Comma=2]="Comma",n[n.CurlyOpen=3]="CurlyOpen",n[n.CurlyClose=4]="CurlyClose",n[n.Backslash=5]="Backslash",n[n.Forwardslash=6]="Forwardslash",n[n.Pipe=7]="Pipe",n[n.Int=8]="Int",n[n.VariableName=9]="VariableName",n[n.Format=10]="Format",n[n.Plus=11]="Plus",n[n.Dash=12]="Dash",n[n.QuestionMark=13]="QuestionMark",n[n.EOF=14]="EOF"})(Zt||(Zt={}));const hv=class hv{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=Q.Digit0&&e<=Q.Digit9}static isVariableCharacter(e){return e===Q.Underline||e>=Q.a&&e<=Q.z||e>=Q.A&&e<=Q.Z}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:Zt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=hv._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(hv.isDigitCharacter(i)){s=Zt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(hv.isVariableCharacter(i)){s=Zt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(hv.isVariableCharacter(i)||hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=Zt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hv._table[i]>"u"&&!hv.isDigitCharacter(i)&&!hv.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};hv._table={[Q.DollarSign]:Zt.Dollar,[Q.Colon]:Zt.Colon,[Q.Comma]:Zt.Comma,[Q.OpenCurlyBrace]:Zt.CurlyOpen,[Q.CloseCurlyBrace]:Zt.CurlyClose,[Q.Backslash]:Zt.Backslash,[Q.Slash]:Zt.Forwardslash,[Q.Pipe]:Zt.Pipe,[Q.Plus]:Zt.Plus,[Q.Dash]:Zt.Dash,[Q.QuestionMark]:Zt.QuestionMark};let pye=hv;class Bz{constructor(){this._children=[]}appendChild(e){return e instanceof Fh&&this._children[this._children.length-1]instanceof Fh?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof OQ)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Fh extends Bz{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return Fh.escape(this.value)}len(){return this.value.length}clone(){return new Fh(this.value)}}class ett extends Bz{}class ep extends ett{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Wz?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new ep(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Wz extends Bz{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Fh&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,|\\/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){const e=new Wz;return this.options.forEach(e.appendChild,e),e}}class qPe extends Bz{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof mb&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof mb){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){const e=new qPe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class mb extends Bz{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new mb(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class wV extends ett{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Fh(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new wV(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function r4e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class OQ extends Bz{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ep&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return r4e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ep&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof wV&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){const e=new OQ;return this._children=this.children.map(t=>t.clone()),e}walk(e){r4e(this.children,e)}}class ww{constructor(){this._scanner=new pye,this._token={type:Zt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new ww().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new OQ;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(c=>(c instanceof ep&&(c.isFinalTabstop?s.set(0,void 0):!s.has(c.index)&&c.children.length>0?s.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=s.get(c.index);if(!d)return;const h=new ep(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof ep&&s.has(f.index)&&!l.has(f.index)&&(l.add(f.index),r(f,l),l.delete(f.index))}t.replace(c,[h])},a=new Set;for(const c of o)r(c,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new ep(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===Zt.EOF)return!1;if(this._token.type===Zt.Backslash){const s=this._scanner.next();if(s.type!==Zt.Dollar&&s.type!==Zt.CurlyClose&&s.type!==Zt.Backslash)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(Zt.Backslash,!0))?(t=this._accept(Zt.Dollar,!0)||this._accept(Zt.CurlyClose,!0)||this._accept(Zt.Backslash,!0)||t,e.appendChild(new Fh(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Zt.Dollar)&&(t=this._accept(Zt.VariableName,!0)||this._accept(Zt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new ep(Number(t)):new wV(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.Int,!0))))return this._backTo(i);const o=new ep(Number(t));if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Zt.Pipe)){const r=new Wz;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Zt.Comma))continue;if(this._accept(Zt.Pipe)&&(o.appendChild(r),this._accept(Zt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Zt.Comma||this._token.type===Zt.Pipe);){let s;if((s=this._accept(Zt.Backslash,!0))?s=this._accept(Zt.Comma,!0)||this._accept(Zt.Pipe,!0)||this._accept(Zt.Backslash,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Fh(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.VariableName,!0))))return this._backTo(i);const o=new wV(t);if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new qPe;let i="",s="";for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Zt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Backslash,!0)||this._accept(Zt.Forwardslash,!0)||o,t.appendChild(new Fh(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Zt.CurlyClose);){if(this._token.type!==Zt.EOF){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Zt.Dollar))return!1;let i=!1;this._accept(Zt.CurlyOpen)&&(i=!0);const s=this._accept(Zt.Int,!0);if(s)if(i){if(this._accept(Zt.CurlyClose))return e.appendChild(new mb(Number(s))),!0;if(!this._accept(Zt.Colon))return this._backTo(t),!1}else return e.appendChild(new mb(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(Zt.Forwardslash)){const o=this._accept(Zt.VariableName,!0);return!o||!this._accept(Zt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new mb(Number(s),o)),!0)}else if(this._accept(Zt.Plus)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,o,void 0)),!0}else if(this._accept(Zt.Dash)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}else if(this._accept(Zt.QuestionMark)){const o=this._until(Zt.Colon);if(o){const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new mb(Number(s),void 0,o,r)),!0}}else{const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Zt.EOF?(e.appendChild(new Fh(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function NNt(n,e,t,i,s=qe.None,o){const r=BNt(e,t),a=n.all(t),c=new Vq;for(const w of a)w.groupId&&c.add(w.groupId,w);function l(w){if(!w.yieldsToGroupIds)return[];const b=[];for(const C of w.yieldsToGroupIds||[]){const y=c.get(C);for(const S of y)b.push(S)}return b}const d=new Map,h=new Set;function u(w,b){if(b=[...b,w],h.has(w))return b;h.add(w);try{const C=l(w);for(const y of C){const S=u(y,b);if(S)return S}}finally{h.delete(w)}}function f(w){const b=d.get(w);if(b)return b;const C=u(w,[]);C&&er(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${C.map(S=>S.toString?S.toString():""+S).join(" -> ")}`));const y=new sd;return d.set(w,y.p),(async()=>{if(!C){const S=l(w);for(const M of S){const k=await f(M);if(k&&k.items.length>0)return}}try{return await w.provideInlineCompletions(t,e,i,s)}catch(S){er(S);return}})().then(S=>y.complete(S),S=>y.error(S)),y.p}const p=await Promise.all(a.map(async w=>({provider:w,completions:await f(w)}))),m=new Map,v=[];for(const w of p){const b=w.completions;if(!b)continue;const C=new FNt(b,w.provider);v.push(C);for(const y of b.items){const S=ONt.from(y,C,r,t,o);m.set(S.hash(),S)}}return new PNt(Array.from(m.values()),new Set(m.keys()),v)}class PNt{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}let FNt=class{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}},ONt=class mye{static from(e,t,i,s,o){let r,a,c=e.range?O.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=a4e(r,c.getStartPosition(),s,o);const l=r.length-e.insertText.length;l!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+l))}a=void 0}else if("snippet"in e.insertText){const l=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=a4e(e.insertText.snippet,c.getStartPosition(),s,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new ww().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Fh?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else oQ();return new mye(r,e.command,c,r,a,e.additionalTextEdits||ANt(),e,t)}constructor(e,t,i,s,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` -`),s=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new mye(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new ug(this.range,this.insertText)}};function BNt(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new O(n.lineNumber,t.startColumn,n.lineNumber,i):O.fromPositions(n,n.with(void 0,i))}function a4e(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n)?.sliceAndInflate(e.column-1,o.length,0);return a?RNt(a,i):n}function wM(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=e.getValueInRange(i,xo.LF),o=LS(s,n.text),r=gf.ofText(s.substring(0,o)).addToPosition(n.range.getStartPosition()),a=n.text.substring(o),c=O.fromPositions(r,n.range.getEndPosition());return new ug(c,a)}function ttt(n,e){return n.text.startsWith(e.text)&&WNt(n.range,e.range)}function c4e(n,e,t,i,s=0){let o=wM(n,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=Uo(r).length;if(o.range.startColumn-1<=a){const p=Uo(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,w]=[o.range.getStartPosition(),o.range.getEndPosition()],b=v.column+m.length<=w.column?v.delta(0,m.length):w,C=O.fromPositions(b,w),y=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new ug(C,y)}const l=e.getValueInRange(o.range),d=HNt(l,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const p=d.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==l.length)return}const f=o.text.length-s;for(const p of d){const m=o.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,w=Math.max(p.modifiedStart,Math.min(v,f)),b=o.text.substring(p.modifiedStart,w),C=o.text.substring(w,Math.max(p.modifiedStart,v));b.length>0&&u.push(new Ete(m,b,!1)),C.length>0&&u.push(new Ete(m,C,!0))}return new q7(h,u)}function WNt(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let DK;function HNt(n,e){if(DK?.originalValue===n&&DK?.newValue===e)return DK?.changes;{let t=d4e(n,e,!0);if(t){const i=l4e(t);if(i>0){const s=d4e(n,e,!1);s&&l4e(s)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(l){if(l<0)throw new Error("unexpected");return s+l+1}function r(l){let d=0,h=0;const u=new Int32Array(l.length);for(let f=0,p=l.length;fa},{getElements:()=>c}).ComputeDiff(!1).changes}let _ye=class extends ${constructor(e,t,i,s,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new Dn),this.inlineCompletions=_7("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=_7("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const s=new VNt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(s))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(s))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ai,c=(async()=>{if((r||t.triggerKind===Ub.Automatic)&&await UNt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const h=new Date,u=await NNt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new $Nt(u,s,this.textModel,this.versionId);if(i){const m=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!u.has(m)&&p.prepend(i.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),En(m=>{o.set(p,m)}),!0})(),l=new zNt(s,a,c);return this._updateOperation.value=l,c}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};_ye=D([_(3,ht),_(4,lo)],_ye);function UNt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class VNt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Ixt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,PJe())&&(e.context.triggerKind===Ub.Automatic||this.context.triggerKind===Ub.Explicit)&&this.versionId===e.versionId}}class zNt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class $Nt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[];const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new h4e(r,o[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new h4e(e,s,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class h4e{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=s,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=yy({owner:this,equalsFn:O.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??npe)}toSingleTextEdit(e){return new ug(this._updatedRange.read(e)??npe,this.inlineCompletion.insertText)}isVisible(e,t,i){const s=wM(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const r=e.getValueInRange(s.range,xo.LF),a=s.text,c=Math.max(0,t.column-s.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=r.substring(0,c),u=r.substring(c);const f=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!zYe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&gf.ofRange(i).isGreaterThanOrEqualTo(gf.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new ug(this._updatedRange.read(e)??npe,this.inlineCompletion.filterText)}}const npe=new O(1,1,1,1),itt="vs/base/browser/ui/findinput/replaceInput",GNt=g(itt,0,"input"),qNt=g(itt,1,"Preserve Case");class QNt extends iD{constructor(e){super({icon:Ce.preserveCase,title:qNt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const yBe=class yBe extends wg{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onPreserveCaseKeyDown=this._register(new I),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||GNt;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,c=!!s.flexibleWidth,l=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new NNe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new QNt({appendTitle:o,isChecked:!1,...s.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(E.LeftArrow)||u.equals(E.RightArrow)||u.equals(E.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(E.RightArrow)?p=(f+1)%d.length:u.equals(E.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(E.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),un.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}applyStyles(){}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox?.validate()}showMessage(e){this.inputBox?.showMessage(e)}clearMessage(){this.inputBox?.hideMessage()}clearValidation(){this.inputBox?.hideMessage()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}};yBe.OPTION_CHANGE="optionChange";let vye=yBe;const jNt="vs/platform/history/browser/contextScopedHistoryWidget",QPe=new Y("suggestWidgetVisible",!1,g(jNt,0,"Whether suggestion are visible")),jPe="historyNavigationWidgetFocus",ntt="historyNavigationForwardsEnabled",stt="historyNavigationBackwardsEnabled";let j$;const kK=[];function dhe(n,e){if(kK.includes(e))throw new Error("Cannot register the same widget multiple times");kK.push(e);const t=new Z,i=new Y(jPe,!1).bindTo(n),s=new Y(ntt,!0).bindTo(n),o=new Y(stt,!0).bindTo(n),r=()=>{i.set(!0),j$=e},a=()=>{i.set(!1),j$===e&&(j$=void 0)};return kw(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{kK.splice(kK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let wye=class extends NNe{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.element));this._register(dhe(o,this))}};wye=D([_(3,Pe)],wye);let bye=class extends S7{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(dhe(o,this.inputBox))}};bye=D([_(3,Pe)],bye);let Cye=class extends vye{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(dhe(r,this.inputBox))}};Cye=D([_(3,Pe)],Cye);xr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:ye.WorkbenchContrib,when:ge.and(ge.has(jPe),ge.equals(stt,!0),ge.not("isComposing"),QPe.isEqualTo(!1)),primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],handler:n=>{j$?.showPreviousValue()}});xr.registerCommandAndKeybindingRule({id:"history.showNext",weight:ye.WorkbenchContrib,when:ge.and(ge.has(jPe),ge.equals(ntt,!0),ge.not("isComposing"),QPe.isEqualTo(!1)),primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],handler:n=>{j$?.showNextValue()}});const wD="vs/editor/contrib/suggest/browser/suggest",qi={Visible:QPe,HasFocusedSuggestion:new Y("suggestWidgetHasFocusedSuggestion",!1,g(wD,0,"Whether any suggestion is focused")),DetailsVisible:new Y("suggestWidgetDetailsVisible",!1,g(wD,1,"Whether suggestion details are visible")),MultipleSuggestions:new Y("suggestWidgetMultipleSuggestions",!1,g(wD,2,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Y("suggestionMakesTextEdit",!0,g(wD,3,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Y("acceptSuggestionOnEnter",!0,g(wD,4,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Y("suggestionHasInsertAndReplaceRange",!1,g(wD,5,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Y("suggestionInsertMode",void 0,{type:"string",description:g(wD,6,"Whether the default behaviour is to insert or replace")}),CanResolve:new Y("suggestionCanResolve",!1,g(wD,7,"Whether the current suggestion supports to resolve further details"))},FI=new Te("suggestWidgetStatusBar");let KNt=class{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=sw.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,O.isIRange(t.range)?(this.editStart=new oe(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new oe(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new oe(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new oe(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range.insert)||O.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new ao(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{Na(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var _x;(function(n){n[n.Top=0]="Top",n[n.Inline=1]="Inline",n[n.Bottom=2]="Bottom"})(_x||(_x={}));const qae=class qae{constructor(e=_x.Bottom,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}};qae.default=new qae;let Q7=qae,yk;function YNt(){return yk}function JNt(n){const e=yk;return yk=n,e}class XNt{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function KPe(n,e,t,i=Q7.default,s={triggerKind:tf.Invoke},o=qe.None){const r=new ao;t=t.clone();const a=e.getWordAtPosition(t),c=a?new O(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):O.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,w,b)=>{let C=!1;if(!w)return C;for(const y of w.suggestions)if(!i.kindFilter.has(y.kind)){if(!i.showDeprecated&&y?.tags?.includes(TU.Deprecated))continue;y.range||(y.range=l),y.sortText||(y.sortText=typeof y.label=="string"?y.label:y.label.label),!f&&y.insertTextRules&&y.insertTextRules&cp.InsertAsSnippet&&(f=ww.guessNeedsClipboard(y.insertText)),d.push(new KNt(t,y,w,v)),C=!0}return cz(w)&&h.add(w),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:w.duration??-1,elapsedOverall:b.elapsed()}),C},m=(async()=>{if(!yk||i.kindFilter.has(Ne.Snippet))return;const v=i.providerItemsToReuse.get(yk);if(v){v.forEach(C=>d.push(C));return}if(i.providerFilter.size>0&&!i.providerFilter.has(yk))return;const w=new ao,b=await yk.provideCompletionItems(e,t,s,o);p(yk,b,w)})();for(const v of n.orderedGroups(e)){let w=!1;if(await Promise.all(v.map(async b=>{if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(y=>d.push(y)),w=w||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new ao,y=await b.provideCompletionItems(e,t,s,o);w=p(b,y,C)||w}catch(C){er(C)}})),w||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Rc)):new XNt(d.sort(tPt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function YPe(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function ZNt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return-1;if(e.completion.kind===Ne.Snippet)return 1}return YPe(n,e)}function ePt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return 1;if(e.completion.kind===Ne.Snippet)return-1}return YPe(n,e)}const hhe=new Map;hhe.set(_x.Top,ZNt);hhe.set(_x.Bottom,ePt);hhe.set(_x.Inline,YPe);function tPt(n){return hhe.get(n)}yt.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s),Bt(typeof o=="number"||!o);const{completionProvider:r}=n.get(ht),a=await n.get(Rn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await KPe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?tf.TriggerCharacter:tf.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(qe.None)),c.incomplete=c.incomplete||u.container.incomplete,c.suggestions.push(u.completion);try{return await Promise.all(l),c}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function ott(n,e){n.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class d2{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case Ar.Comment:return e.comments;case Ar.String:return e.strings;default:return e.other}}}var iPt=".monaco-editor .snippet-placeholder{background-color:var(--vscode-editor-snippetTabstopHighlightBackground,transparent);min-width:2px;outline-color:var(--vscode-editor-snippetTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}.monaco-editor .finish-snippet-placeholder{background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground,transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}";Ct(iPt,{});function nPt(n,e){const{os:t,tildify:i,relative:s}=e;if(s){const a=sPt(n,s,t);if(typeof a=="string")return a}let o=n.fsPath;if(t===Pr.Windows&&!Is?o=o.replace(/\//g,"\\"):t!==Pr.Windows&&Is&&(o=o.replace(/\\/g,"/")),t!==Pr.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;n.scheme!==i.userHome.scheme&&n.path[0]===Qi.sep&&n.path[1]!==Qi.sep?c=i.userHome.with({path:n.path}).fsPath:c=o,o=rtt(c,a,t)}return(t===Pr.Windows?Gc:Qi).normalize(Ay(o,t===Pr.Windows))}function sPt(n,e,t){const i=t===Pr.Windows?Gc:Qi,s=t===Pr.Linux?Fn:Gle,o=e.getWorkspace(),r=k_(o.folders);if(!r)return;n.scheme!==r.uri.scheme&&n.path[0]===Qi.sep&&n.path[1]!==Qi.sep&&(n=r.uri.with({path:n.path}));const a=e.getWorkspaceFolder(n);if(!a)return;let c;if(s.isEqual(a.uri,n)?c="":c=s.relativePath(a.uri,n)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:s.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Ay(n,e=Is){return $Qe(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}let spe=Object.create(null);function rtt(n,e,t=$c){if(t===Pr.Windows||!n||!e)return n;let i=spe.original===e?spe.normalized:void 0;i||(i=e,Is&&(i=I9(i)),i=`${IS(i,Qi.sep)}${Qi.sep}`,spe={original:e,normalized:i});let s=n;return Is&&(s=I9(s)),(t===Pr.Linux?s.startsWith(i):Gq(s,i))?`~/${s.substr(i.length)}`:n}function oPt(n,e){return n.replace(/^~($|\/|\\)/,`${e}$1`)}const u4e="…",y5="\\\\",S5="~";function rPt(n,e=dg){const t=new Array(n.length);let i=!1;for(let s=0;s=0;d--){i=!1;let h=c.slice(d,d+l).join(e);for(let u=0;!i&&u-1){const f=d+l===c.length,p=d>0&&n[u].indexOf(e)>-1?e+h:h,m=n[u].endsWith(p);i=!f||m}if(!i){let u="";(c[0].endsWith(":")||r!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=r+u),d>0&&(u=u+u4e+e),u=u+h,d+l{if(o.type===UC.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===UC.VARIABLE||l.type===UC.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function JPe(n,e){return ei||e?n.replace(/\(&&\w\)|&&/g,""):Is?n.replace(/&&|&/g,t=>t==="&"?"&&":"&"):n.replace(/&&/g,"_")}const vo="vs/editor/contrib/snippet/browser/snippetVariables",cPt=Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class g4e{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class f4e{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=Uo(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof Fh&&(a=Uo(xw(l.value).pop())),!0));const c=LS(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(l,d,h)=>`${d}${a.substr(c)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class p4e{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return yr(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=yr(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return lS(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(ma(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class m4e{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!Xv(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let xte=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};xte=D([_(2,lo)],xte);const JC=class JC{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return JC.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return JC.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return JC.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return JC.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,c=a<10?"0"+a:a;return s+r+":"+c}}};JC.dayNames=[g(vo,0,"Sunday"),g(vo,1,"Monday"),g(vo,2,"Tuesday"),g(vo,3,"Wednesday"),g(vo,4,"Thursday"),g(vo,5,"Friday"),g(vo,6,"Saturday")],JC.dayNamesShort=[g(vo,7,"Sun"),g(vo,8,"Mon"),g(vo,9,"Tue"),g(vo,10,"Wed"),g(vo,11,"Thu"),g(vo,12,"Fri"),g(vo,13,"Sat")],JC.monthNames=[g(vo,14,"January"),g(vo,15,"February"),g(vo,16,"March"),g(vo,17,"April"),g(vo,18,"May"),g(vo,19,"June"),g(vo,20,"July"),g(vo,21,"August"),g(vo,22,"September"),g(vo,23,"October"),g(vo,24,"November"),g(vo,25,"December")],JC.monthNamesShort=[g(vo,26,"Jan"),g(vo,27,"Feb"),g(vo,28,"Mar"),g(vo,29,"Apr"),g(vo,30,"May"),g(vo,31,"Jun"),g(vo,32,"Jul"),g(vo,33,"Aug"),g(vo,34,"Sep"),g(vo,35,"Oct"),g(vo,36,"Nov"),g(vo,37,"Dec")];let Dte=JC;class _4e{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=UW(this._workspaceService.getWorkspace());if(!nxt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(BS(e))return yr(e.uri.path);let t=yr(e.configPath.path);return t.endsWith(qb)&&(t=t.substr(0,t.length-qb.length-1)),t}_resoveWorkspacePath(e){if(BS(e))return Ay(e.uri.fsPath);const t=yr(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Ay(i):"/"}}class v4e{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Dr()}}var qw;const uv=class uv{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=yU(t.placeholders,ep.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=O.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive,c=t.addDecoration(r,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),c=this._editor.getModel().getValueInRange(a),l=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);r.push(new mt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof ep){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Wz,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=s.index+(r+1)/this._nestingLevel:c.index=s.index+c.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=O.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,uv._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=yU(this._snippet.placeholders,ep.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const s=t.getDecorationRange(i)??void 0;e?e=e.plusRange(s):e=s}return e}};uv._decor={active:Kt.register({description:"snippet-placeholder-1",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Kt.register({description:"snippet-placeholder-2",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Kt.register({description:"snippet-placeholder-3",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Kt.register({description:"snippet-placeholder-4",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let kte=uv;const w4e={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Ite=qw=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=Uo(r,0,t.column-1);let c;return s.walk(l=>{if(!(l instanceof Fh)||l.parent instanceof Wz||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=s.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??s.toString();const f=c.charCodeAt(u-1);(f===Q.LineFeed||f===Q.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fy.get(Ti)),p=e.invokeWithinContext(y=>new p4e(y.get(eo),u)),m=()=>a,v=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),i,0)),w=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),0,s)),b=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((y,S)=>({selection:y,idx:S})).sort((y,S)=>O.compareRangesUsingStarts(y.selection,S.selection));for(const{selection:y,idx:S}of C){let M=qw.adjustSelection(u,y,i,0),k=qw.adjustSelection(u,y,0,s);v!==u.getValueInRange(M)&&(M=y),w!==u.getValueInRange(k)&&(k=y);const F=y.setStartPosition(M.startLineNumber,M.startColumn).setEndPosition(k.endLineNumber,k.endColumn),N=new ww().parse(t,!0,o),z=F.getStartPosition(),U=qw.adjustWhitespace(u,z,r||S>0&&b!==u.getLineFirstNonWhitespaceColumn(y.positionLineNumber),N);N.resolveVariables(new g4e([p,new m4e(m,S,C.length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(u,y,S,c),new xte(u,y,l),new Dte,new _4e(f),new v4e])),d[S]=ds.replace(F,N.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new kte(e,N,U)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new ww,h=new OQ,u=new g4e([e.invokeWithinContext(p=>new p4e(p.get(eo),l)),new m4e(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(l,e.getSelection(),0,r),new xte(l,e.getSelection(),a),new Dte,new _4e(e.invokeWithinContext(p=>p.get(Ti))),new v4e]);t=t.sort((p,m)=>O.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const S=t[p-1].range,M=O.fromPositions(S.getEndPosition(),m.getStartPosition()),k=new Fh(l.getValueInRange(M));h.appendChild(k),f+=k.value.length}const w=d.parseFragment(v,h);qw.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(w)),h.resolveVariables(u);const b=h.toString(),C=b.slice(f);f=b.length;const y=ds.replace(m,C);y.identifier={major:p,minor:0},y._isTracked=!0,c.push(y)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new kte(e,h,"")]}}constructor(e,t,i=w4e,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){St(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?qw.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):qw.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(o=>!!o.identifier);for(let o=0;omt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=w4e){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=qw.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(c=>!!c.identifier);for(let c=0;cmt.fromPositions(c.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(O.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(O.compareRangesUsingStarts);for(let o=0;o0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};Ite=qw=D([_(3,lo)],Ite);var wB;const IK="vs/editor/contrib/snippet/browser/snippetController2",LK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Ny;let mc=(Ny=class{static get(e){return e.getContribution(wB.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=wB.InSnippetMode.bindTo(s),this._hasNextTabstop=wB.HasNextTabstop.bindTo(s),this._hasPrevTabstop=wB.HasPrevTabstop.bindTo(s)}dispose(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}apply(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_edits=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}insert(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Bt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new Ite(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(l,d)=>{if(!this._session||l!==this._editor.getModel()||!oe.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=l.getValueInRange(h.range),f=!!h.choice.options.find(m=>m.value===u),p=[];for(let m=0;m{o?.dispose(),r=!1},c=()=>{r||(o=this._languageFeaturesService.completionProvider.register({language:s.getLanguageId(),pattern:s.uri.fsPath,scheme:s.uri.scheme,exclusive:!0},i),this._snippetListener.add(o),r=!0)};this._choiceCompletions={provider:i,enable:c,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{ott(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}getSessionEnclosingRange(){if(this._session)return this._session.getEnclosingRange()}},wB=Ny,Ny.ID="snippetController2",Ny.InSnippetMode=new Y("inSnippetMode",!1,g(IK,0,"Whether the editor in current in snippet mode")),Ny.HasNextTabstop=new Y("hasNextTabstop",!1,g(IK,1,"Whether there is a next tab stop when in snippet mode")),Ny.HasPrevTabstop=new Y("hasPrevTabstop",!1,g(IK,2,"Whether there is a previous tab stop when in snippet mode")),Ny);mc=wB=D([_(1,Ze),_(2,ht),_(3,Pe),_(4,lo)],mc);vn(mc.ID,mc,mi.Lazy);const uhe=Jc.bindToContribution(mc.get);Ke(new uhe({id:"jumpToNextSnippetPlaceholder",precondition:ge.and(mc.InSnippetMode,mc.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new uhe({id:"jumpToPrevSnippetPlaceholder",precondition:ge.and(mc.InSnippetMode,mc.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Ke(new uhe({id:"leaveSnippet",precondition:mc.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new uhe({id:"acceptSnippet",precondition:mc.InSnippetMode,handler:n=>n.finish()}));var Bp;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Bp||(Bp={}));let yye=class extends ${get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=i,this._positions=s,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=c,this._enabled=l,this._instantiationService=d,this._commandService=h,this._languageConfigurationService=u,this._source=this._register(this._instantiationService.createInstance(_ye,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=xi(this,!1),this._forceUpdateExplicitlySignal=oL(this),this._selectedInlineCompletionId=xi(this,void 0),this._primaryPosition=Dt(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Bp.Redo,Bp.Undo,Bp.AcceptWord]),this._fetchInlineCompletionsPromise=zxt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ub.Automatic}),handleChange:(p,m)=>(p.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(p.change)?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=Ub.Explicit),!0)},(p,m)=>{if(this._forceUpdateExplicitlySignal.read(p),!(this._enabled.read(p)&&this.selectedSuggestItem.read(p)||this._isActive.read(p))){this._source.cancelUpdate();return}this.textModelVersionId.read(p);const w=this._source.suggestWidgetInlineCompletions.get(),b=this.selectedSuggestItem.read(p);if(w&&!b){const k=this._source.inlineCompletions.get();En(F=>{(!k||w.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(w.clone(),F),this._source.clearSuggestWidgetInlineCompletions(F)})}const C=this._primaryPosition.read(p),y={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:b?.toSelectedSuggestionInfo()},S=this.selectedInlineCompletion.get(),M=m.preserveCurrentCompletion||S?.forwardStable?S:void 0;return this._source.fetch(C,y,M)}),this._filteredInlineCompletionItems=yy({owner:this,equalsFn:pbe()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Dt(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),w=this._selectedInlineCompletionId===void 0?-1:v.findIndex(b=>b.semanticId===m);return w===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):w}),this.selectedInlineCompletion=Dt(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=yy({owner:this,equalsFn:pbe()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Dt(this,p=>{if(this.lastTriggerKind.read(p)===Ub.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=yy({owner:this,equalsFn:(p,m)=>!p||!m?p===m:i4e(p.ghostTexts,m.ghostTexts)&&p.inlineCompletion===m.inlineCompletion&&p.suggestItem===m.suggestItem},p=>{const m=this.textModel,v=this.selectedSuggestItem.read(p);if(v){const w=wM(v.toSingleTextEdit(),m),b=this._computeAugmentation(w,p);if(!this._suggestPreviewEnabled.read(p)&&!b)return;const y=b?.edit??w,S=b?b.edit.text.length-w.text.length:0,M=this._suggestPreviewMode.read(p),k=this._positions.read(p),F=[y,...ope(this.textModel,k,y)],N=F.map((U,J)=>c4e(U,m,M,k[J],S)).filter(yl),z=N[0]??new q7(y.range.endLineNumber,[]);return{edits:F,primaryGhostText:z,ghostTexts:N,inlineCompletion:b?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const w=this.selectedInlineCompletion.read(p);if(!w)return;const b=w.toSingleTextEdit(p),C=this._inlineSuggestMode.read(p),y=this._positions.read(p),S=[b,...ope(this.textModel,y,b)],M=S.map((k,F)=>c4e(k,m,C,y[F],0)).filter(yl);return M[0]?{edits:S,primaryGhostText:M[0],ghostTexts:M,inlineCompletion:w,suggestItem:void 0}:void 0}}),this.ghostTexts=yy({owner:this,equalsFn:i4e},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=yy({owner:this,equalsFn:Yet},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(Ez(this._fetchInlineCompletionsPromise));let f;this._register(Ni(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const w=v.inlineCompletion,b=w.source;b.provider.handleItemDidShow?.(b.inlineCompletions,w.sourceInlineCompletion,w.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){m7(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){m7(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(yl);return Lct(o,a=>{let c=a.toSingleTextEdit(t);return c=wM(c,i,O.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),ttt(c,e)?{completion:a,edit:c}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new cn;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[ds.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),mc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const s=t.edits,o=b4e(s).map(r=>mt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...s.map(r=>ds.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}i.command&&i.source.addRef(),En(s=>{this._source.clear(s),this._isActive.set(!1,s)}),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,er),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(s),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let c=0;a&&a.index!==void 0?a.index===0?c=a[0].length:c=a.index:c=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length},DI.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new cn;const s=this.state.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const o=s.primaryGhostText,r=s.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){await this.accept(e);return}const a=o.parts[0],c=new oe(o.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&o.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];r.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=O.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new ug(p,m),w=[v,...ope(this.textModel,u,v)],b=b4e(w).map(C=>mt.fromPositions(C));e.executeEdits("inlineSuggestion.accept",w.map(C=>ds.replace(C.range,C.text))),e.setSelections(b,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),vt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=O.fromPositions(r.range.getStartPosition(),gf.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,xo.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=wM(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=i.completion.inlineCompletion;s.source.provider.handlePartialAccept?.(s.source.inlineCompletions,s.sourceInlineCompletion,t.text.length,{kind:DI.Suggest})}};yye=D([_(9,be),_(10,ji),_(11,lo)],yye);function ope(n,e,t){if(e.length===1)return[];const i=e[0],s=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=n.getValueInRange(O.fromPositions(i,r)),c=n4e(i,o);if(c.lineNumber<1)return bt(new cn(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=lPt(t.text,c);return s.map(d=>{const h=ENt(n4e(d,o),r),u=n.getValueInRange(O.fromPositions(d,h)),f=LS(a,u),p=O.fromPositions(d,d.delta(0,f));return new ug(p,l)})}function lPt(n,e){let t="";const i=Nlt(n);for(let s=e.lineNumber-1;sO.compareRangesUsingStarts(o.range,r.range)),i=new WU(e.apply(n)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var I3;class XPe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;oc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&r===-1)return r=l}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:E9.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class hPt extends XPe{constructor(){super("recentlyUsedByPrefix"),this._trie=Su.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o=`${e.getLanguageId()}/${s}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:E9.fromString(i.type),this._trie.set(t,i)}}}var d0;let Sye=(d0=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new yn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const s=I3._strategyCtors.get(i)||C4e;this._strategy=new s;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,a=this._storageService.get(`${I3._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${I3._storagePrefix}/${this._strategy.name}`,i,t,ln.MACHINE)}}},I3=d0,d0._strategyCtors=new Map([["recentlyUsedByPrefix",hPt],["recentlyUsed",dPt],["first",C4e]]),d0._storagePrefix="suggest/memories",d0);Sye=I3=D([_(0,on),_(1,Re)],Sye);const ghe=ae("ISuggestMemories");ce(ghe,Sye,Yt.Delayed);var Aye,fN;let Lte=(fN=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Aye.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(x.tabCompletion)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(x.tabCompletion)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},Aye=fN,fN.AtEnd=new Y("atEndOfWord",!1),fN);Lte=Aye=D([_(1,Pe)],Lte);var L3,pN;let bV=(pN=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=L3.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(L3._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=L3._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},L3=pN,pN.OtherSuggestions=new Y("hasOtherSuggestions",!1),pN);bV=L3=D([_(1,Pe)],bV);const qm=class qm{async provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>qm._bracketsRightYield(a,0,e,s,r)),await new Promise(a=>qm._bracketsLeftYield(a,0,e,s,r,o))}return i}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=qm._maxRounds){e();break}if(!s){e();break}const c=i.bracketPairs.findNextBracket(s);if(!c){e();break}if(Date.now()-a>qm._maxDuration){setTimeout(()=>qm._bracketsRightYield(e,t+1,i,s,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new td,o.set(d,u)),u.push(c.range)}}s=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,c=Date.now();for(;;){if(t>=qm._maxRounds&&o.size===0){e();break}if(!s){e();break}const l=i.bracketPairs.findPrevBracket(s);if(!l){e();break}if(Date.now()-c>qm._maxDuration){setTimeout(()=>qm._bracketsLeftYield(e,t+1,i,s,o,r));break}if(l.bracketInfo.isOpeningBracket){const h=l.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const p=f.shift();f.size===0&&o.delete(h);const m=O.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=O.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),qm._addBracketLeading(i,v,r)}}}else{const h=l.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}s=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:O.fromPositions(new oe(s,o),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:O.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(r,1),t.getEndPosition())}))}}};qm._maxDuration=30,qm._maxRounds=2;let Tte=qm;const XC=class XC{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return XC.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return XC.None;const[o]=await new Tte().provideSelectionRanges(i,[s]);if(o.length===0)return XC.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return XC.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends XC{distance(c,l){if(!s.equals(t.getPosition()))return 0;if(l.kind===Ne.Keyword)return 2<<20;const d=typeof l.label=="string"?l.label:l.label.label,h=r[d];if(iO(h))return 2<<20;const u=CU(h,O.fromPositions(c),O.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!O.containsRange(m.range,f))break;p-=1}return p}}}};XC.None=new class extends XC{distance(){return 0}};let Rte=XC,y4e=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var ZD;(function(n){n[n.Nothing=0]="Nothing",n[n.All=1]="All",n[n.Incr=2]="Incr"})(ZD||(ZD={}));class Sk{constructor(e,t,i,s,o,r,a=l7.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=Sk._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=ZD.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Sk._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Sk._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==ZD.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===ZD.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?v1:nAt;for(let l=0;l=f)d.score=sw.Default;else if(typeof d.completion.filterText=="string"){const m=c(s,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;mE(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=eAt(s,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(s,o,p,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=ZD.Nothing,this._stats={pLabelLen:e.length?h_e(e.length-.85,e,(l,d)=>l-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return 1;if(t.completion.kind===Ne.Snippet)return-1}return Sk._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return-1;if(t.completion.kind===Ne.Snippet)return 1}return Sk._compareCompletionItems(e,t)}}var Eye;class kL{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}var OI;(function(n){n[n.Idle=0]="Idle",n[n.Manual=1]="Manual",n[n.Auto=2]="Auto"})(OI||(OI={}));function uPt(n,e,t){if(!e.getContextKeyValue(af.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}function gPt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}let Mte=Eye=class{constructor(e,t,i,s,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new O_,this._triggerState=void 0,this._completionDisposables=new Z,this._onDidCancel=new I,this._onDidTrigger=new I,this._onDidSuggest=new I,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new mt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){St(this._triggerCharacterListener),St([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(x.readOnly)||!this._editor.hasModel()||!this._editor.getOption(x.suggestOnTriggerCharacters))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(YNt()),e.set(s,o)),o.add(i)}const t=i=>{if(!gPt(this._editor,this._contextKeyService)||kL.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let s="";sF(i.charCodeAt(i.length-1))?wl(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const r=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())o.has(a)||r.set(a,c);this.trigger({auto:!0,triggerKind:tf.TriggerCharacter,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?OI.Auto:OI.Manual:OI.Idle}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==Hi.NotSet&&e.reason!==Hi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Hi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Hi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){d2.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&mc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!kL.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(x.quickSuggestions);if(!d2.isAllOff(i)){if(!d2.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const s=e.tokenization.getLineTokens(t.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(i,o)!=="on")return}uPt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Bt(this._editor.hasModel()),Bt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new kL(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new kL(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??tf.Invoke};e.triggerCharacter&&(s={triggerKind:tf.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ai;const o=this._editor.getOption(x.snippetSuggestions);let r=_x.Inline;switch(o){case"top":r=_x.Top;break;case"bottom":r=_x.Bottom;break}const{itemKind:a,showDeprecated:c}=Eye.createSuggestFilter(this._editor),l=new Q7(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=Rte.create(this._editorWorkerService,this._editor),h=KPe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,s,this._requestToken.token);Promise.all([h,d]).then(async([u,f])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return;let p=e?.clipboardText;if(!p&&u.needsClipboard&&(p=await this._clipboardService.readText()),this._triggerState===void 0)return;const m=this._editor.getModel(),v=new kL(m,this._editor.getPosition(),e),w={...l7.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new Sk(u.items,this._context.column,{leadingLineContent:v.leadingLineContent,characterCountDelta:v.column-this._context.column},f,this._editor.getOption(x.suggest),this._editor.getOption(x.snippetSuggestions),w,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const b of u.items)b.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${b.provider._debugDisplayName}`,b.completion)}).catch(bt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(x.snippetSuggestions)==="none"&&t.add(Ne.Snippet);const s=e.getOption(x.suggest);return s.showMethods||t.add(Ne.Method),s.showFunctions||t.add(Ne.Function),s.showConstructors||t.add(Ne.Constructor),s.showFields||t.add(Ne.Field),s.showVariables||t.add(Ne.Variable),s.showClasses||t.add(Ne.Class),s.showStructs||t.add(Ne.Struct),s.showInterfaces||t.add(Ne.Interface),s.showModules||t.add(Ne.Module),s.showProperties||t.add(Ne.Property),s.showEvents||t.add(Ne.Event),s.showOperators||t.add(Ne.Operator),s.showUnits||t.add(Ne.Unit),s.showValues||t.add(Ne.Value),s.showConstants||t.add(Ne.Constant),s.showEnums||t.add(Ne.Enum),s.showEnumMembers||t.add(Ne.EnumMember),s.showKeywords||t.add(Ne.Keyword),s.showWords||t.add(Ne.Text),s.showColors||t.add(Ne.Color),s.showFiles||t.add(Ne.File),s.showReferences||t.add(Ne.Reference),s.showColors||t.add(Ne.Customcolor),s.showFolders||t.add(Ne.Folder),s.showTypeParameters||t.add(Ne.TypeParameter),s.showSnippets||t.add(Ne.Snippet),s.showUsers||t.add(Ne.User),s.showIssues||t.add(Ne.Issue),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Uo(e.leadingLineContent)!==Uo(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(kL.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:tf.TriggerForIncompleteCompletions,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=kL.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};Mte=Eye=D([_(1,kd),_(2,Mu),_(3,rn),_(4,Ze),_(5,Pe),_(6,Re),_(7,ht),_(8,Il)],Mte);class fPt{constructor(e,t,i,s){this._disposables=new Z,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==OI.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&s(this._active.item)}}))}_onItem(e){if(!e||!mo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new EZ;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Qae=class Qae{constructor(e,t){this._disposables=new Z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;aQae._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&ea instanceof id?i.createInstance(wPt,a,void 0):void 0;this._leftActions=new Qh(this.element,{actionViewItemProvider:r}),this._rightActions=new Qh(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};Dye=D([_(2,be),_(3,_c),_(4,Pe)],Dye);var bPt=".monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-enum,.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-value{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}";Ct(bPt,{});const zr="vs/editor/contrib/symbolIcons/browser/symbolIcons";B("symbolIcon.arrayForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.booleanForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,1,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,2,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.colorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,3,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constantForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,4,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,5,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,6,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,7,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,8,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,9,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fileForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,10,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.folderForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,11,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,12,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,13,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,14,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keywordForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,15,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,16,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.moduleForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,17,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.namespaceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,18,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.nullForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,19,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.numberForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,20,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.objectForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,21,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.operatorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,22,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.packageForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,23,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.propertyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,24,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.referenceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,25,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.snippetForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,26,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.stringForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,27,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.structForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,28,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.textForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,29,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.typeParameterForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,30,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.unitForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,31,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,32,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class ZPe{constructor(){this._onDidWillResize=new I,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._sashListener=new Z,this._size=new Tn(0,0),this._minSize=new Tn(0,0),this._maxSize=new Tn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Lh(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:vi.VERTICAL}),this._westSash=new Lh(this.domNode,{getVerticalSashLeft:()=>0},{orientation:vi.VERTICAL}),this._northSash=new Lh(this.domNode,{getHorizontalSashTop:()=>0},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.North}),this._southSash=new Lh(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(T.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(T.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(T.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(T.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?Ia.Enabled:Ia.Disabled,this._eastSash.state=t?Ia.Enabled:Ia.Disabled,this._southSash.state=i?Ia.Enabled:Ia.Disabled,this._westSash.state=s?Ia.Enabled:Ia.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Tn(t,e);Tn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const S4e="vs/editor/contrib/suggest/browser/suggestWidgetDetails";function eFe(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let kye=class{constructor(e,t){this._editor=e,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new I,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Z,this._renderDisposeable=new Z,this._borderWidth=1,this._size=new Tn(330,0),this.domNode=we(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(vw,{editor:e}),this._body=we(".body"),this._scrollbar=new bz(this._body,{alwaysConsumeMouseWheel:!0}),he(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=he(this._body,we(".header")),this._close=he(this._header,we("span"+$e.asCSSSelector(Ce.close))),this._close.title=g(S4e,0,"Close"),this._type=he(this._header,we("p.type")),this._docs=he(this._body,we("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.fontInfo)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(x.fontInfo),i=t.getMassagedFontFamily(),s=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${s}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(x.suggestLineHeight)||this._editor.getOption(x.fontInfo).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=g(S4e,1,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} +`)))]).applyToString(e)}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new B2([...this.parts.map(o=>new au(F.fromPositions(new oe(1,o.column)),o.lines.join(` +`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class tX{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=ov(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class Xve{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new tX(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=ov(this.text)}renderForScreenReader(e){return this.newLines.join(` +`)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new B2([new au(F.fromPositions(i.getStartPosition()),"("),new au(F.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` +`)}]`)]).applyToString(e):new B2([new au(i,this.newLines.join(` +`))]).applyToString(e)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function PHe(s,e){return is(s,e,FXe)}function FXe(s,e){return s===e?!0:!s||!e?!1:s instanceof $3&&e instanceof $3||s instanceof Xve&&e instanceof Xve?s.equals(e):!1}const ZRt=[];function eMt(){return ZRt}class OXe{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ni(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new F(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function BXe(s,e){const t=new Z,i=s.createDecorationsCollection();return t.add(v6({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function tMt(s,e){return new oe(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function FHe(s,e){return new oe(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}const OHe="ghost-text";let Zve=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=jt(this,!1),this.currentTextModel=Kn(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof Xve?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const b=l[l.length-1];v&&b.decorations.push(new eu(b.content.length+1,b.content.length+1+m[0].length,v,Ja.Regular)),b.content+=m[0],m=m.slice(1)}for(const b of m)l.push({content:b,decorations:v?[new eu(1,b.length+1,v,Ja.Regular)]:[]})}const h=o.getLineContent(r.lineNumber);let u,f=0;for(const m of r.parts){let v=m.lines;u===void 0?(c.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):d([h.substring(f,m.column-1)],void 0),v.length>0&&(d(v,OHe),u===void 0&&m.column<=h.length&&(u=m.column)),f=m.column-1}u!==void 0&&d([h.substring(f)],void 0);const p=u!==void 0?new OXe(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:F.fromPositions(new oe(o.lineNumber,a.column)),options:{description:OHe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:w_.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new WXe(this.editor,this.languageService.languageIdCodec,Ze(n=>{const o=this.uiState.read(n);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(BXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Zve=D([_(2,xi)],Zve);class WXe extends V{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=id("editorOptionChanged",M.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(x.disableMonospaceOptimizations)||n.hasChanged(x.stopRenderingLineAfter)||n.hasChanged(x.renderWhitespace)||n.hasChanged(x.renderControlCharacters)||n.hasChanged(x.fontLigatures)||n.hasChanged(x.fontInfo)||n.hasChanged(x.lineHeight))),this._register(ai(n=>{const o=this.lines.read(n);this.editorOptionsChanged.read(n),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");iMt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:Io.Right})}})}}function iMt(s,e,t,i,n){const o=i.get(x.disableMonospaceOptimizations),r=i.get(x.stopRenderingLineAfter),a="none",c=i.get(x.renderControlCharacters),l=i.get(x.fontLigatures),d=i.get(x.fontInfo),h=i.get(x.lineHeight),u=new wU(1e4);u.appendString('
      ');for(let m=0,v=t.length;m');const y=H7(w),C=E2(w),A=gd.createEmpty(w,n);n6(new yI(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,A,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==Lk.OFF,null),u),u.appendString("
      ")}u.appendString(""),Dl(s,d);const f=u.build(),p=BHe?BHe.createHTML(f):f;s.innerHTML=p}const BHe=QA("editorGhostText",{createHTML:s=>s}),Cw=class Cw extends V{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Cw.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Cw.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Cw.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Cw.suppressSuggestions.bindTo(this.contextKeyService),this._register(ai(i=>{const o=this.model.read(i)?.state.read(i),r=!!o?.inlineCompletion&&o?.primaryGhostText!==void 0&&!o?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(r),o?.primaryGhostText&&o?.inlineCompletion&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(ai(i=>{const n=this.model.read(i);let o=!1,r=!0;const a=n?.primaryGhostText.read(i);if(n?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=n.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=kh(d);f===-1&&(f=d.length-1),o=f>0;const p=n.textModel.getOptions().tabSize;r=qa.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(cu((n,o)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=AI((l,d)=>{const h=d.add(this.instantiationService.createInstance(_W,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(ai(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==em.Explicit&&r.triggerExplicitly()})),h}),c=b6(this,(l,d)=>!!this.position.read(l)||!!d);o.add(ai(l=>{c.read(l)&&a.read(l)}))}))}};ebe=D([_(2,we)],ebe);const sMt=oi("inline-suggestion-hints-next",ve.chevronRight,g(9866,"Icon for show next parameter hint.")),oMt=oi("inline-suggestion-hints-previous",ve.chevronLeft,g(9867,"Icon for show previous parameter hint."));var OD;let _W=(OD=class extends V{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new rn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(9868,"{0} ({1})",t,o.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${tQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.previousAction=this.createCommandAction(NXe,g(9869,"Previous"),We.asClassName(oMt)),this.availableSuggestionCountAction=new rn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(PXe,g(9870,"Next"),We.asClassName(sMt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new cn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new cn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(tbe,this.nodes.toolBar,_e.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof Sc)return c.createInstance(aMt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new rMt(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{tQ._dropDownVisible=u})),this._register(ai(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(ai(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ai(u=>{const p=this._extraCommands.read(u).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const b of v)b instanceof Sc&&p.push(b);p.length>0&&p.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},tQ=OD,OD._dropDownVisible=!1,OD.id=0,OD);_W=tQ=D([_(6,vi),_(7,we),_(8,Ut),_(9,Le),_(10,Oa)],_W);class rMt extends Jy{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let aMt=class extends Lb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new qk(t,po,{disableTitle:!0,...pYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},tbe=class extends lW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];fC(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};tbe=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],tbe);function cMt(s,e){const t=new Zqe,i=new tQe(t,l=>e.getLanguageConfiguration(l)),n=new eQe(new lMt([s]),i),o=gme(n,[],void 0,!0);let r="";const a=s.getLineContent();function c(l,d){if(l.kind===Go.Pair)if(c(l.openingBracket,d),d=Tr(d,l.openingBracket.length),l.child&&(c(l.child,d),d=Tr(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=Tr(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==Go.UnexpectedClosingBracket){if(l.kind===Go.Text||l.kind===Go.Bracket)r+=a.substring(d,Tr(d,l.length));else if(l.kind===Go.List)for(const h of l.children)c(h,d),d=Tr(d,h.length)}}return c(o,tu),r}class lMt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getValue(){return this.lines.map(e=>e.getLineContent()).join(` +`)}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var Xt;(function(s){s[s.Dollar=0]="Dollar",s[s.Colon=1]="Colon",s[s.Comma=2]="Comma",s[s.CurlyOpen=3]="CurlyOpen",s[s.CurlyClose=4]="CurlyClose",s[s.Backslash=5]="Backslash",s[s.Forwardslash=6]="Forwardslash",s[s.Pipe=7]="Pipe",s[s.Int=8]="Int",s[s.VariableName=9]="VariableName",s[s.Format=10]="Format",s[s.Plus=11]="Plus",s[s.Dash=12]="Dash",s[s.QuestionMark=13]="QuestionMark",s[s.EOF=14]="EOF"})(Xt||(Xt={}));const Ym=class Ym{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=B.Digit0&&e<=B.Digit9}static isVariableCharacter(e){return e===B.Underline||e>=B.a&&e<=B.z||e>=B.A&&e<=B.Z}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:Xt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Ym._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Ym.isDigitCharacter(i)){n=Xt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(Ym.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Ym.isVariableCharacter(i)){n=Xt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(Ym.isVariableCharacter(i)||Ym.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=Xt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ym._table[i]>"u"&&!Ym.isDigitCharacter(i)&&!Ym.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Ym._table={[B.DollarSign]:Xt.Dollar,[B.Colon]:Xt.Colon,[B.Comma]:Xt.Comma,[B.OpenCurlyBrace]:Xt.CurlyOpen,[B.CloseCurlyBrace]:Xt.CurlyClose,[B.Backslash]:Xt.Backslash,[B.Slash]:Xt.Forwardslash,[B.Pipe]:Xt.Pipe,[B.Plus]:Xt.Plus,[B.Dash]:Xt.Dash,[B.QuestionMark]:Xt.QuestionMark};let ibe=Ym;class UU{constructor(){this._children=[]}appendChild(e){return e instanceof $d&&this._children[this._children.length-1]instanceof $d?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof $6)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class $d extends UU{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return $d.escape(this.value)}len(){return this.value.length}clone(){return new $d(this.value)}}class HXe extends UU{}class zg extends HXe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof VU?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new zg(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class VU extends UU{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof $d&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,|\\/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){const e=new VU;return this.options.forEach(e.appendChild,e),e}}class gMe extends UU{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof zv&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof zv){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){const e=new gMe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class zv extends UU{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new zv(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class vW extends HXe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new $d(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new vW(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function WHe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class $6 extends UU{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof zg&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return WHe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof zg&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof vW&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){const e=new $6;return this._children=this.children.map(t=>t.clone()),e}walk(e){WHe(this.children,e)}}class X_{constructor(){this._scanner=new ibe,this._token={type:Xt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new X_().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new $6;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(c=>(c instanceof zg&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=n.get(c.index);if(!d)return;const h=new zg(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof zg&&n.has(f.index)&&!l.has(f.index)&&(l.add(f.index),r(f,l),l.delete(f.index))}t.replace(c,[h])},a=new Set;for(const c of o)r(c,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new zg(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===Xt.EOF)return!1;if(this._token.type===Xt.Backslash){const n=this._scanner.next();if(n.type!==Xt.Dollar&&n.type!==Xt.CurlyClose&&n.type!==Xt.Backslash)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(Xt.Backslash,!0))?(t=this._accept(Xt.Dollar,!0)||this._accept(Xt.CurlyClose,!0)||this._accept(Xt.Backslash,!0)||t,e.appendChild(new $d(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Xt.Dollar)&&(t=this._accept(Xt.VariableName,!0)||this._accept(Xt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new zg(Number(t)):new vW(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.Int,!0))))return this._backTo(i);const o=new zg(Number(t));if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $d("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Xt.Pipe)){const r=new VU;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Xt.Comma))continue;if(this._accept(Xt.Pipe)&&(o.appendChild(r),this._accept(Xt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Xt.Comma||this._token.type===Xt.Pipe);){let n;if((n=this._accept(Xt.Backslash,!0))?n=this._accept(Xt.Comma,!0)||this._accept(Xt.Pipe,!0)||this._accept(Xt.Backslash,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new $d(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.VariableName,!0))))return this._backTo(i);const o=new vW(t);if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $d("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new gMe;let i="",n="";for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Xt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Backslash,!0)||this._accept(Xt.Forwardslash,!0)||o,t.appendChild(new $d(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Xt.CurlyClose);){if(this._token.type!==Xt.EOF){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Xt.Dollar))return!1;let i=!1;this._accept(Xt.CurlyOpen)&&(i=!0);const n=this._accept(Xt.Int,!0);if(n)if(i){if(this._accept(Xt.CurlyClose))return e.appendChild(new zv(Number(n))),!0;if(!this._accept(Xt.Colon))return this._backTo(t),!1}else return e.appendChild(new zv(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(Xt.Forwardslash)){const o=this._accept(Xt.VariableName,!0);return!o||!this._accept(Xt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new zv(Number(n),o)),!0)}else if(this._accept(Xt.Plus)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,o,void 0)),!0}else if(this._accept(Xt.Dash)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,void 0,o)),!0}else if(this._accept(Xt.QuestionMark)){const o=this._until(Xt.Colon);if(o){const r=this._until(Xt.CurlyClose);if(r)return e.appendChild(new zv(Number(n),void 0,o,r)),!0}}else{const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Xt.EOF?(e.appendChild(new $d(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function UXe(s,e,t,i,n=He.None,o){const r=e instanceof oe?gMt(e,t):e,a=s.all(t),c=new P7;for(const b of a)b.groupId&&c.add(b.groupId,b);function l(b){if(!b.yieldsToGroupIds)return[];const w=[];for(const y of b.yieldsToGroupIds||[]){const C=c.get(y);for(const A of C)w.push(A)}return w}const d=new Map,h=new Set;function u(b,w){if(w=[...w,b],h.has(b))return w;h.add(b);try{const y=l(b);for(const C of y){const A=u(C,w);if(A)return A}}finally{h.delete(b)}}function f(b){const w=d.get(b);if(w)return w;const y=u(b,[]);y&&No(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(A=>A.toString?A.toString():""+A).join(" -> ")}`));const C=new dc;return d.set(b,C.p),(async()=>{if(!y){const A=l(b);for(const L of A){const k=await f(L);if(k&&k.items.length>0)return}}try{return e instanceof oe?await b.provideInlineCompletions(t,e,i,n):await b.provideInlineEdits?.(t,e,i,n)}catch(A){No(A);return}})().then(A=>C.complete(A),A=>C.error(A)),C.p}const p=await Promise.all(a.map(async b=>({provider:b,completions:await f(b)}))),m=new Map,v=[];for(const b of p){const w=b.completions;if(!w)continue;const y=new hMt(w,b.provider);v.push(y);for(const C of w.items){const A=uMt.from(C,y,r,t,o);m.set(A.hash(),A)}}return new dMt(Array.from(m.values()),new Set(m.keys()),v)}class dMt{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}let hMt=class{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}},uMt=class nbe{static from(e,t,i,n,o){let r,a,c=e.range?F.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=HHe(r,c.getStartPosition(),n,o);const l=r.length-e.insertText.length;l!==0&&(c=new F(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+l))}a=void 0}else if("snippet"in e.insertText){const l=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=HHe(e.insertText.snippet,c.getStartPosition(),n,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new F(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new X_().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof $d?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else Z7();return new nbe(r,e.command,c,r,a,e.additionalTextEdits||eMt(),e,t)}constructor(e,t,i,n,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` +`),n=e.replace(/\r\n|\r/g,` +`)}withRange(e){return new nbe(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new au(this.range,this.insertText)}};function gMt(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new F(s.lineNumber,t.startColumn,s.lineNumber,i):F.fromPositions(s,s.with(void 0,i))}function HHe(s,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),s)?.sliceAndInflate(e.column-1,o.length,0);return a?cMt(a,i):s}function IT(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,go.LF),o=$y(n,s.text),r=eg.ofText(n.substring(0,o)).addToPosition(s.range.getStartPosition()),a=s.text.substring(o),c=F.fromPositions(r,s.range.getEndPosition());return new au(c,a)}function VXe(s,e){return s.text.startsWith(e.text)&&fMt(s.range,e.range)}function UHe(s,e,t,i,n=0){let o=IT(s,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=ho(r).length;if(o.range.startColumn-1<=a){const p=ho(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,b]=[o.range.getStartPosition(),o.range.getEndPosition()],w=v.column+m.length<=b.column?v.delta(0,m.length):b,y=F.fromPositions(w,b),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new au(y,C)}const l=e.getValueInRange(o.range),d=pMt(l,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const p=d.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==l.length)return}const f=o.text.length-n;for(const p of d){const m=o.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,b=Math.max(p.modifiedStart,Math.min(v,f)),w=o.text.substring(p.modifiedStart,b),y=o.text.substring(b,Math.max(p.modifiedStart,v));w.length>0&&u.push(new tX(m,w,!1)),y.length>0&&u.push(new tX(m,y,!0))}return new $3(h,u)}function fMt(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let pK;function pMt(s,e){if(pK?.originalValue===s&&pK?.newValue===e)return pK?.changes;{let t=zHe(s,e,!0);if(t){const i=VHe(t);if(i>0){const n=zHe(s,e,!1);n&&VHe(n)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const n=Math.max(i(s),i(e));function o(l){if(l<0)throw new Error("unexpected");return n+l+1}function r(l){let d=0,h=0;const u=new Int32Array(l.length);for(let f=0,p=l.length;fa},{getElements:()=>c}).ComputeDiff(!1).changes}let sbe=class extends V{constructor(e,t,i,n,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=o,this._updateOperation=this._register(new wn),this.inlineCompletions=f3("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=f3("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const n=new _Mt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(n))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(n))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ci,c=(async()=>{if((r||t.triggerKind===em.Automatic)&&await mMt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const h=new Date,u=await UXe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new bMt(u,n,this.textModel,this.versionId);if(i){const m=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!u.has(m)&&p.prepend(i.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),ts(m=>{o.set(p,m)}),!0})(),l=new vMt(n,a,c);return this._updateOperation.value=l,c}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};sbe=D([_(3,it),_(4,Vs)],sbe);function mMt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class _Mt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Fq(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,DAt())&&(e.context.triggerKind===em.Automatic||this.context.triggerKind===em.Explicit)&&this.versionId===e.versionId}}class vMt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class bMt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,this._refCount=1,this._prependedInlineCompletionItems=[];const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new $He(r,o[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new $He(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class $He{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Jh({owner:this,equalsFn:F.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??$he)}toSingleTextEdit(e){return new au(this._updatedRange.read(e)??$he,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=IT(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const r=e.getValueInRange(n.range,go.LF),a=n.text,c=Math.max(0,t.column-n.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=r.substring(0,c),u=r.substring(c);const f=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!LQe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&eg.ofRange(i).isGreaterThanOrEqualTo(eg.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new au(this._updatedRange.read(e)??$he,this.inlineCompletion.filterText)}}const $he=new F(1,1,1,1),wMt=g(11236,"input"),yMt=g(11237,"Preserve Case");class CMt extends ZA{constructor(e){super({icon:ve.preserveCase,title:yMt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const sFe=class sFe extends pd{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onPreserveCaseKeyDown=this._register(new I),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||wMt;const o=n.appendPreserveCaseLabel||"",r=n.history||[],a=!!n.flexibleHeight,c=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qLe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new CMt({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(S.LeftArrow)||u.equals(S.RightArrow)||u.equals(S.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(S.RightArrow)?p=(f+1)%d.length:u.equals(S.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(S.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),en.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}applyStyles(){}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox?.validate()}showMessage(e){this.inputBox?.showMessage(e)}clearMessage(){this.inputBox?.hideMessage()}clearValidation(){this.inputBox?.hideMessage()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}};sFe.OPTION_CHANGE="optionChange";let obe=sFe;const fMe=new Q("suggestWidgetVisible",!1,g(9874,"Whether suggestion are visible")),pMe="historyNavigationWidgetFocus",zXe="historyNavigationForwardsEnabled",$Xe="historyNavigationBackwardsEnabled";let F5;const mK=[];function oce(s,e){if(mK.includes(e))throw new Error("Cannot register the same widget multiple times");mK.push(e);const t=new Z,i=new Q(pMe,!1).bindTo(s),n=new Q(zXe,!0).bindTo(s),o=new Q($Xe,!0).bindTo(s),r=()=>{i.set(!0),F5=e},a=()=>{i.set(!1),F5===e&&(F5=void 0)};return av(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{mK.splice(mK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let iX=class extends qLe{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.element));this._register(oce(o,this))}};iX=D([_(3,Le)],iX);let rbe=class extends b3{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(oce(o,this.inputBox))}};rbe=D([_(3,Le)],rbe);let abe=class extends obe{constructor(e,t,i,n,o=!1){super(e,t,o,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(oce(r,this.inputBox))}};abe=D([_(3,Le)],abe);So.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:Ae.WorkbenchContrib,when:he.and(he.has(pMe),he.equals($Xe,!0),he.not("isComposing"),fMe.isEqualTo(!1)),primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],handler:s=>{F5?.showPreviousValue()}});So.registerCommandAndKeybindingRule({id:"history.showNext",weight:Ae.WorkbenchContrib,when:he.and(he.has(pMe),he.equals(zXe,!0),he.not("isComposing"),fMe.isEqualTo(!1)),primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],handler:s=>{F5?.showNextValue()}});const Ui={Visible:fMe,HasFocusedSuggestion:new Q("suggestWidgetHasFocusedSuggestion",!1,g(5209,"Whether any suggestion is focused")),DetailsVisible:new Q("suggestWidgetDetailsVisible",!1,g(5210,"Whether suggestion details are visible")),MultipleSuggestions:new Q("suggestWidgetMultipleSuggestions",!1,g(5211,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Q("suggestionMakesTextEdit",!0,g(5212,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Q("acceptSuggestionOnEnter",!0,g(5213,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Q("suggestionHasInsertAndReplaceRange",!1,g(5214,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Q("suggestionInsertMode",void 0,{type:"string",description:g(5215,"Whether the default behaviour is to insert or replace")}),CanResolve:new Q("suggestionCanResolve",!1,g(5216,"Whether the current suggestion supports to resolve further details"))},hD=new _e("suggestWidgetStatusBar");let SMt=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=N_.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,F.isIRange(t.range)?(this.editStart=new oe(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||F.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new oe(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new oe(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new oe(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||F.spansMultipleLines(t.range.insert)||F.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof n.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new js(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Fr(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var lA;(function(s){s[s.Top=0]="Top",s[s.Inline=1]="Inline",s[s.Bottom=2]="Bottom"})(lA||(lA={}));const kse=class kse{constructor(e=lA.Bottom,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}};kse.default=new kse;let G3=kse,ix;function AMt(){return ix}function EMt(s){const e=ix;return ix=s,e}class xMt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function mMe(s,e,t,i=G3.default,n={triggerKind:Ku.Invoke},o=He.None){const r=new js;t=t.clone();const a=e.getWordAtPosition(t),c=a?new F(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):F.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,b,w)=>{let y=!1;if(!b)return y;for(const C of b.suggestions)if(!i.kindFilter.has(C.kind)){if(!i.showDeprecated&&C?.tags?.includes(I2.Deprecated))continue;C.range||(C.range=l),C.sortText||(C.sortText=typeof C.label=="string"?C.label:C.label.label),!f&&C.insertTextRules&&C.insertTextRules&Yg.InsertAsSnippet&&(f=X_.guessNeedsClipboard(C.insertText)),d.push(new SMt(t,C,b,v)),y=!0}return wN(b)&&h.add(b),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:w.elapsed()}),y},m=(async()=>{if(!ix||i.kindFilter.has(Me.Snippet))return;const v=i.providerItemsToReuse.get(ix);if(v){v.forEach(y=>d.push(y));return}if(i.providerFilter.size>0&&!i.providerFilter.has(ix))return;const b=new js,w=await ix.provideCompletionItems(e,t,n,o);p(ix,w,b)})();for(const v of s.orderedGroups(e)){let b=!1;if(await Promise.all(v.map(async w=>{if(i.providerItemsToReuse.has(w)){const y=i.providerItemsToReuse.get(w);y.forEach(C=>d.push(C)),b=b||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(w)))try{const y=new js,C=await w.provideCompletionItems(e,t,n,o);b=p(w,C,y)||b}catch(y){No(y)}})),b||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Ma)):new xMt(d.sort(IMt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function _Me(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLowe.sortTextLow)return 1}return s.textLabele.textLabel?1:s.completion.kind-e.completion.kind}function DMt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Me.Snippet)return-1;if(e.completion.kind===Me.Snippet)return 1}return _Me(s,e)}function kMt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Me.Snippet)return 1;if(e.completion.kind===Me.Snippet)return-1}return _Me(s,e)}const rce=new Map;rce.set(lA.Top,DMt);rce.set(lA.Bottom,kMt);rce.set(lA.Inline,_Me);function IMt(s){return rce.get(s)}_t.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n),Tt(typeof o=="number"||!o);const{completionProvider:r}=s.get(it),a=await s.get(fn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await mMe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?Ku.TriggerCharacter:Ku.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(He.None)),c.incomplete=c.incomplete||u.container.incomplete,c.suggestions.push(u.completion);try{return await Promise.all(l),c}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function GXe(s,e){s.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class mF{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case nr.Comment:return e.comments;case nr.String:return e.strings;default:return e.other}}}var TMt=".monaco-editor .snippet-placeholder{background-color:var(--vscode-editor-snippetTabstopHighlightBackground,transparent);min-width:2px;outline-color:var(--vscode-editor-snippetTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}.monaco-editor .finish-snippet-placeholder{background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground,transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}";ut(TMt,{});function LMt(s,e){const{os:t,tildify:i,relative:n}=e;if(n){const a=RMt(s,n,t);if(typeof a=="string")return a}let o=s.fsPath;if(t===Ds.Windows&&!Qn?o=o.replace(/\//g,"\\"):t!==Ds.Windows&&Qn&&(o=o.replace(/\\/g,"/")),t!==Ds.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;s.scheme!==i.userHome.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep?c=i.userHome.with({path:s.path}).fsPath:c=o,o=KXe(c,a,t)}return(t===Ds.Windows?cc:Vi).normalize(Kw(o,t===Ds.Windows))}function RMt(s,e,t){const i=t===Ds.Windows?cc:Vi,n=t===Ds.Linux?xn:Rre,o=e.getWorkspace(),r=lm(o.folders);if(!r)return;s.scheme!==r.uri.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep&&(s=r.uri.with({path:s.path}));const a=e.getWorkspaceFolder(s);if(!a)return;let c;if(n.isEqual(a.uri,s)?c="":c=n.relativePath(a.uri,s)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:n.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Kw(s,e=Qn){return CGe(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}let Ghe=Object.create(null);function KXe(s,e,t=po){if(t===Ds.Windows||!s||!e)return s;let i=Ghe.original===e?Ghe.normalized:void 0;i||(i=e,Qn&&(i=S8(i)),i=`${zy(i,Vi.sep)}${Vi.sep}`,Ghe={original:e,normalized:i});let n=s;return Qn&&(n=S8(n)),(t===Ds.Linux?n.startsWith(i):W7(n,i))?`~/${n.substr(i.length)}`:s}function MMt(s,e){return s.replace(/^~($|\/|\\)/,`${e}$1`)}const GHe="…",y4="\\\\",C4="~";function NMt(s,e=ou){const t=new Array(s.length);let i=!1;for(let n=0;n=0;d--){i=!1;let h=c.slice(d,d+l).join(e);for(let u=0;!i&&u-1){const f=d+l===c.length,p=d>0&&s[u].indexOf(e)>-1?e+h:h,m=s[u].endsWith(p);i=!f||m}if(!i){let u="";(c[0].endsWith(":")||r!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=r+u),d>0&&(u=u+GHe+e),u=u+h,d+l{if(o.type===gw.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===gw.VARIABLE||l.type===gw.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function vMe(s,e){return Qt||e?s.replace(/\(&&\w\)|&&/g,""):Qn?s.replace(/&&|&/g,t=>t==="&"?"&&":"&"):s.replace(/&&/g,"_")}const FMt=Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class KHe{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class qHe{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ho(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof $d&&(a=ho(ov(l.value).pop())),!0));const c=$y(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(l,d,h)=>`${d}${a.substr(c)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class QHe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Ko(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Ko(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return Cb(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Lr(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class jHe{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!Gu(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let nX=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};nX=D([_(2,Vs)],nX);const Sw=class Sw{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Sw.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Sw.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Sw.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Sw.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),n=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,c=a<10?"0"+a:a;return n+r+":"+c}}};Sw.dayNames=[g(9881,"Sunday"),g(9882,"Monday"),g(9883,"Tuesday"),g(9884,"Wednesday"),g(9885,"Thursday"),g(9886,"Friday"),g(9887,"Saturday")],Sw.dayNamesShort=[g(9888,"Sun"),g(9889,"Mon"),g(9890,"Tue"),g(9891,"Wed"),g(9892,"Thu"),g(9893,"Fri"),g(9894,"Sat")],Sw.monthNames=[g(9895,"January"),g(9896,"February"),g(9897,"March"),g(9898,"April"),g(9899,"May"),g(9900,"June"),g(9901,"July"),g(9902,"August"),g(9903,"September"),g(9904,"October"),g(9905,"November"),g(9906,"December")],Sw.monthNamesShort=[g(9907,"Jan"),g(9908,"Feb"),g(9909,"Mar"),g(9910,"Apr"),g(9911,"May"),g(9912,"Jun"),g(9913,"Jul"),g(9914,"Aug"),g(9915,"Sep"),g(9916,"Oct"),g(9917,"Nov"),g(9918,"Dec")];let sX=Sw;class YHe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=GO(this._workspaceService.getWorkspace());if(!nAt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(P_(e))return Ko(e.uri.path);let t=Ko(e.configPath.path);return t.endsWith(xb)&&(t=t.substr(0,t.length-xb.length-1)),t}_resoveWorkspacePath(e){if(P_(e))return Kw(e.uri.fsPath);const t=Ko(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Kw(i):"/"}}class JHe{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return ar()}}var yv;const Jm=class Jm{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=i8(t.placeholders,zg.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),r=F.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?Jm._decor.inactiveFinal:Jm._decor.inactive,c=t.addDecoration(r,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),c=this._editor.getModel().getValueInRange(a),l=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);r.push(new dt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(c,a.isFinalTabstop?Jm._decor.activeFinal:Jm._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?Jm._decor.activeFinal:Jm._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(c,a.isFinalTabstop?Jm._decor.inactiveFinal:Jm._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof zg){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const o=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(n.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof VU,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=n.index+(r+1)/this._nestingLevel:c.index=n.index+c.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=F.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,Jm._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=i8(this._snippet.placeholders,zg.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const n=t.getDecorationRange(i)??void 0;e?e=e.plusRange(n):e=n}return e}};Jm._decor={active:Gt.register({description:"snippet-placeholder-1",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Gt.register({description:"snippet-placeholder-2",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Gt.register({description:"snippet-placeholder-3",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Gt.register({description:"snippet-placeholder-4",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let oX=Jm;const XHe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let rX=yv=class{static adjustWhitespace(e,t,i,n,o){const r=e.getLineContent(t.lineNumber),a=ho(r,0,t.column-1);let c;return n.walk(l=>{if(!(l instanceof $d)||l.parent instanceof VU||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=n.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??n.toString();const f=c.charCodeAt(u-1);(f===B.LineFeed||f===B.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fC.get(yi)),p=e.invokeWithinContext(C=>new QHe(C.get(Fs),u)),m=()=>a,v=u.getValueInRange(yv.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(yv.adjustSelection(u,e.getSelection(),0,n)),w=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,A)=>({selection:C,idx:A})).sort((C,A)=>F.compareRangesUsingStarts(C.selection,A.selection));for(const{selection:C,idx:A}of y){let L=yv.adjustSelection(u,C,i,0),k=yv.adjustSelection(u,C,0,n);v!==u.getValueInRange(L)&&(L=C),b!==u.getValueInRange(k)&&(k=C);const P=C.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(k.endLineNumber,k.endColumn),R=new X_().parse(t,!0,o),z=P.getStartPosition(),G=yv.adjustWhitespace(u,z,r||A>0&&w!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),R);R.resolveVariables(new KHe([p,new jHe(m,A,y.length,e.getOption(x.multiCursorPaste)==="spread"),new qHe(u,C,A,c),new nX(u,C,l),new sX,new YHe(f),new JHe])),d[A]=Zn.replace(P,R.toString()),d[A].identifier={major:A,minor:0},d[A]._isTracked=!0,h[A]=new oX(e,R,G)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new X_,h=new $6,u=new KHe([e.invokeWithinContext(p=>new QHe(p.get(Fs),l)),new jHe(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new qHe(l,e.getSelection(),0,r),new nX(l,e.getSelection(),a),new sX,new YHe(e.invokeWithinContext(p=>p.get(yi))),new JHe]);t=t.sort((p,m)=>F.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const A=t[p-1].range,L=F.fromPositions(A.getEndPosition(),m.getStartPosition()),k=new $d(l.getValueInRange(L));h.appendChild(k),f+=k.value.length}const b=d.parseFragment(v,h);yv.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(b)),h.resolveVariables(u);const w=h.toString(),y=w.slice(f);f=w.length;const C=Zn.replace(m,y);C.identifier={major:p,minor:0},C._isTracked=!0,c.push(C)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new oX(e,h,"")]}}constructor(e,t,i=XHe,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){bt(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?yv.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):yv.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const n=i.filter(o=>!!o.identifier);for(let o=0;odt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=XHe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=yv.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(c=>!!c.identifier);for(let c=0;cdt.fromPositions(c.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...n.get(r))})}e.sort(F.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(F.compareRangesUsingStarts);for(let o=0;o0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};rX=yv=D([_(3,Vs)],rX);var RP;const _K={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var ey;let fc=(ey=class{static get(e){return e.getContribution(RP.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=RP.InSnippetMode.bindTo(n),this._hasNextTabstop=RP.HasNextTabstop.bindTo(n),this._hasPrevTabstop=RP.HasPrevTabstop.bindTo(n)}dispose(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}apply(e,t){try{this._doInsert(e,typeof t>"u"?_K:{..._K,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_edits=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}insert(e,t){try{this._doInsert(e,typeof t>"u"?_K:{..._K,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Tt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new rX(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(l,d)=>{if(!this._session||l!==this._editor.getModel()||!oe.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=l.getValueInRange(h.range),f=!!h.choice.options.find(m=>m.value===u),p=[];for(let m=0;m{o?.dispose(),r=!1},c=()=>{r||(o=this._languageFeaturesService.completionProvider.register({language:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.uri.scheme,exclusive:!0},i),this._snippetListener.add(o),r=!0)};this._choiceCompletions={provider:i,enable:c,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{GXe(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}getSessionEnclosingRange(){if(this._session)return this._session.getEnclosingRange()}},RP=ey,ey.ID="snippetController2",ey.InSnippetMode=new Q("inSnippetMode",!1,g(1558,"Whether the editor in current in snippet mode")),ey.HasNextTabstop=new Q("hasNextTabstop",!1,g(1559,"Whether there is a next tab stop when in snippet mode")),ey.HasPrevTabstop=new Q("hasPrevTabstop",!1,g(1560,"Whether there is a previous tab stop when in snippet mode")),ey);fc=RP=D([_(1,Ge),_(2,it),_(3,Le),_(4,Vs)],fc);on(fc.ID,fc,ri.Lazy);const ace=hc.bindToContribution(fc.get);qe(new ace({id:"jumpToNextSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new ace({id:"jumpToPrevSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));qe(new ace({id:"leaveSnippet",precondition:fc.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new ace({id:"acceptSnippet",precondition:fc.InSnippetMode,handler:s=>s.finish()}));let cbe=class extends V{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=c,this._enabled=l,this._instantiationService=d,this._commandService=h,this._languageConfigurationService=u,this._source=this._register(this._instantiationService.createInstance(sbe,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=jt(this,!1),this._forceUpdateExplicitlySignal=gC(this),this._selectedInlineCompletionId=jt(this,void 0),this._primaryPosition=Ze(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([TC.Redo,TC.Undo,TC.AcceptWord]),this._fetchInlineCompletionsPromise=Dje({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:em.Automatic}),handleChange:(p,m)=>(p.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(p.change))?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=em.Explicit),!0)},(p,m)=>{if(this._forceUpdateExplicitlySignal.read(p),!(this._enabled.read(p)&&this.selectedSuggestItem.read(p)||this._isActive.read(p))){this._source.cancelUpdate();return}this._textModelVersionId.read(p);const b=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(p);if(b&&!w){const k=this._source.inlineCompletions.get();ts(P=>{(!k||b.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(b.clone(),P),this._source.clearSuggestWidgetInlineCompletions(P)})}const y=this._primaryPosition.read(p),C={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:w?.toSelectedSuggestionInfo()},A=this.selectedInlineCompletion.get(),L=m.preserveCurrentCompletion||A?.forwardStable?A:void 0;return this._source.fetch(y,C,L)}),this._filteredInlineCompletionItems=Jh({owner:this,equalsFn:J2()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(w=>w.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Ze(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),b=this._selectedInlineCompletionId===void 0?-1:v.findIndex(w=>w.semanticId===m);return b===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):b}),this.selectedInlineCompletion=Ze(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=Jh({owner:this,equalsFn:J2()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Ze(this,p=>{if(this.lastTriggerKind.read(p)===em.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=Jh({owner:this,equalsFn:(p,m)=>!p||!m?p===m:PHe(p.ghostTexts,m.ghostTexts)&&p.inlineCompletion===m.inlineCompletion&&p.suggestItem===m.suggestItem},p=>{const m=this.textModel,v=this.selectedSuggestItem.read(p);if(v){const b=IT(v.toSingleTextEdit(),m),w=this._computeAugmentation(b,p);if(!this._suggestPreviewEnabled.read(p)&&!w)return;const C=w?.edit??b,A=w?w.edit.text.length-b.text.length:0,L=this._suggestPreviewMode.read(p),k=this._positions.read(p),P=[C,...Khe(this.textModel,k,C)],R=P.map((G,Y)=>UHe(G,m,L,k[Y],A)).filter(Fc),z=R[0]??new $3(C.range.endLineNumber,[]);return{edits:P,primaryGhostText:z,ghostTexts:R,inlineCompletion:w?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const b=this.selectedInlineCompletion.read(p);if(!b)return;const w=b.toSingleTextEdit(p),y=this._inlineSuggestMode.read(p),C=this._positions.read(p),A=[w,...Khe(this.textModel,C,w)],L=A.map((k,P)=>UHe(k,m,y,C[P],0)).filter(Fc);return L[0]?{edits:A,primaryGhostText:L[0],ghostTexts:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostTexts=Jh({owner:this,equalsFn:PHe},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=Jh({owner:this,equalsFn:FXe},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(FN(this._fetchInlineCompletionsPromise));let f;this._register(ai(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const b=v.inlineCompletion,w=b.source;w.provider.handleItemDidShow?.(w.inlineCompletions,b.sourceInlineCompletion,b.insertText)}}))}_getReason(e){return e?.isUndoing?TC.Undo:e?.isRedoing?TC.Redo:this.isAcceptingPartially?TC.AcceptWord:TC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){SM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){SM(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),o=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Fc);return rrt(o,a=>{let c=a.toSingleTextEdit(t);return c=IT(c,i,F.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),VXe(c,e)?{completion:a,edit:c}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new Ni;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Zn.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),fc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const n=t.edits,o=ZHe(n).map(r=>dt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...n.map(r=>Zn.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,No),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(n),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let c=0;a&&a.index!==void 0?a.index===0?c=a[0].length:c=a.index:c=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},Jx.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Ni;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const o=n.primaryGhostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){await this.accept(e);return}const a=o.parts[0],c=new oe(o.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&o.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];r.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=F.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new au(p,m),b=[v,...Khe(this.textModel,u,v)],w=ZHe(b).map(y=>dt.fromPositions(y));e.executeEdits("inlineSuggestion.accept",b.map(y=>Zn.replace(y.range,y.text))),e.setSelections(w,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),mt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=F.fromPositions(r.range.getStartPosition(),eg.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,go.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=IT(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=i.completion.inlineCompletion;n.source.provider.handlePartialAccept?.(n.source.inlineCompletions,n.sourceInlineCompletion,t.text.length,{kind:Jx.Suggest})}};cbe=D([_(9,we),_(10,vi),_(11,Vs)],cbe);var TC;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})(TC||(TC={}));function Khe(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=s.getValueInRange(F.fromPositions(i,r)),c=FHe(i,o);if(c.lineNumber<1)return vt(new Ni(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=OMt(t.text,c);return n.map(d=>{const h=tMt(FHe(d,o),r),u=s.getValueInRange(F.fromPositions(d,h)),f=$y(a,u),p=F.fromPositions(d,d.delta(0,f));return new au(p,l)})}function OMt(s,e){let t="";const i=hat(s);for(let n=e.lineNumber-1;no.range,F.compareRangesUsingStarts)),i=new B2(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var uV;class bMe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let o=0;oc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&r===-1)return r=l}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:v8.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class WMt extends bMe{constructor(){super("recentlyUsedByPrefix"),this._trie=Dh.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:v8.fromString(i.type),this._trie.set(t,i)}}}var BD;let lbe=(BD=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new cn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===wy.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const n=uV._strategyCtors.get(i)||eUe;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,a=this._storageService.get(`${uV._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${uV._storagePrefix}/${this._strategy.name}`,i,t,an.MACHINE)}}},uV=BD,BD._strategyCtors=new Map([["recentlyUsedByPrefix",WMt],["recentlyUsed",BMt],["first",eUe]]),BD._storagePrefix="suggest/memories",BD);lbe=uV=D([_(0,$i),_(1,Te)],lbe);const cce=ae("ISuggestMemories");ce(cce,lbe,qt.Delayed);var dbe,CL;let aX=(CL=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=dbe.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(x.tabCompletion)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(x.tabCompletion)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},dbe=CL,CL.AtEnd=new Q("atEndOfWord",!1),CL);aX=dbe=D([_(1,Le)],aX);var gV,SL;let bW=(SL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=gV.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(gV._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=gV._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},gV=SL,SL.OtherSuggestions=new Q("hasOtherSuggestions",!1),SL);bW=gV=D([_(1,Le)],bW);const Tp=class Tp{async provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Tp._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>Tp._bracketsLeftYield(a,0,e,n,r,o))}return i}static _bracketsRightYield(e,t,i,n,o){const r=new Map,a=Date.now();for(;;){if(t>=Tp._maxRounds){e();break}if(!n){e();break}const c=i.bracketPairs.findNextBracket(n);if(!c){e();break}if(Date.now()-a>Tp._maxDuration){setTimeout(()=>Tp._bracketsRightYield(e,t+1,i,n,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new hl,o.set(d,u)),u.push(c.range)}}n=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,r){const a=new Map,c=Date.now();for(;;){if(t>=Tp._maxRounds&&o.size===0){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-c>Tp._maxDuration){setTimeout(()=>Tp._bracketsLeftYield(e,t+1,i,n,o,r));break}if(l.bracketInfo.isOpeningBracket){const h=l.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const p=f.shift();f.size===0&&o.delete(h);const m=F.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=F.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),Tp._addBracketLeading(i,v,r)}}}else{const h=l.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:F.fromPositions(new oe(n,o),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:F.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(r,1),t.getEndPosition())}))}}};Tp._maxDuration=30,Tp._maxRounds=2;let cX=Tp;const Aw=class Aw{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return Aw.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Aw.None;const[o]=await new cX().provideSelectionRanges(i,[n]);if(o.length===0)return Aw.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return Aw.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends Aw{distance(c,l){if(!n.equals(t.getPosition()))return 0;if(l.kind===Me.Keyword)return 2<<20;const d=typeof l.label=="string"?l.label:l.label.label,h=r[d];if(uU(h))return 2<<20;const u=y2(h,F.fromPositions(c),F.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!F.containsRange(m.range,f))break;p-=1}return p}}}};Aw.None=new class extends Aw{distance(){return 0}};let lX=Aw,tUe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var ME;(function(s){s[s.Nothing=0]="Nothing",s[s.All=1]="All",s[s.Incr=2]="Incr"})(ME||(ME={}));class nx{constructor(e,t,i,n,o,r,a=a3.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=nx._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=ME.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=nx._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=nx._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==ME.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const r=this._refilterKind===ME.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?Uk:cCt;for(let l=0;l=f)d.score=N_.Default;else if(typeof d.completion.filterText=="string"){const m=c(n,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;wS(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=oCt(n,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(n,o,p,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=ME.Nothing,this._stats={pLabelLen:e.length?zge(e.length-.85,e,(l,d)=>l-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Me.Snippet)return 1;if(t.completion.kind===Me.Snippet)return-1}return nx._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Me.Snippet)return-1;if(t.completion.kind===Me.Snippet)return 1}return nx._compareCompletionItems(e,t)}}var hbe;class VI{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}var uD;(function(s){s[s.Idle=0]="Idle",s[s.Manual=1]="Manual",s[s.Auto=2]="Auto"})(uD||(uD={}));function HMt(s,e,t){if(!e.getContextKeyValue(ju.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(ju.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}function UMt(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(ju.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}let dX=hbe=class{constructor(e,t,i,n,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new Cm,this._triggerState=void 0,this._completionDisposables=new Z,this._onDidCancel=new I,this._onDidTrigger=new I,this._onDidSuggest=new I,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new dt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){bt(this._triggerCharacterListener),bt([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(x.readOnly)||!this._editor.hasModel()||!this._editor.getOption(x.suggestOnTriggerCharacters))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(AMt()),e.set(n,o)),o.add(i)}const t=i=>{if(!UMt(this._editor,this._contextKeyService)||VI.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";fM(i.charCodeAt(i.length-1))?Pc(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const o=e.get(n);if(o){const r=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())o.has(a)||r.set(a,c);this.trigger({auto:!0,triggerKind:Ku.TriggerCharacter,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?uD.Auto:uD.Manual:uD.Idle}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==Oi.NotSet&&e.reason!==Oi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Oi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Oi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){mF.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&fc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!VI.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(x.quickSuggestions);if(!mF.isAllOff(i)){if(!mF.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(mF.valueFor(i,o)!=="on")return}HMt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Tt(this._editor.hasModel()),Tt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new VI(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new VI(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??Ku.Invoke};e.triggerCharacter&&(n={triggerKind:Ku.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ci;const o=this._editor.getOption(x.snippetSuggestions);let r=lA.Inline;switch(o){case"top":r=lA.Top;break;case"bottom":r=lA.Bottom;break}const{itemKind:a,showDeprecated:c}=hbe.createSuggestFilter(this._editor),l=new G3(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=lX.create(this._editorWorkerService,this._editor),h=mMe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,n,this._requestToken.token);Promise.all([h,d]).then(async([u,f])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return;let p=e?.clipboardText;if(!p&&u.needsClipboard&&(p=await this._clipboardService.readText()),this._triggerState===void 0)return;const m=this._editor.getModel(),v=new VI(m,this._editor.getPosition(),e),b={...a3.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new nx(u.items,this._context.column,{leadingLineContent:v.leadingLineContent,characterCountDelta:v.column-this._context.column},f,this._editor.getOption(x.suggest),this._editor.getOption(x.snippetSuggestions),b,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const w of u.items)w.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${w.provider._debugDisplayName}`,w.completion)}).catch(vt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(x.snippetSuggestions)==="none"&&t.add(Me.Snippet);const n=e.getOption(x.suggest);return n.showMethods||t.add(Me.Method),n.showFunctions||t.add(Me.Function),n.showConstructors||t.add(Me.Constructor),n.showFields||t.add(Me.Field),n.showVariables||t.add(Me.Variable),n.showClasses||t.add(Me.Class),n.showStructs||t.add(Me.Struct),n.showInterfaces||t.add(Me.Interface),n.showModules||t.add(Me.Module),n.showProperties||t.add(Me.Property),n.showEvents||t.add(Me.Event),n.showOperators||t.add(Me.Operator),n.showUnits||t.add(Me.Unit),n.showValues||t.add(Me.Value),n.showConstants||t.add(Me.Constant),n.showEnums||t.add(Me.Enum),n.showEnumMembers||t.add(Me.EnumMember),n.showKeywords||t.add(Me.Keyword),n.showWords||t.add(Me.Text),n.showColors||t.add(Me.Color),n.showFiles||t.add(Me.File),n.showReferences||t.add(Me.Reference),n.showColors||t.add(Me.Customcolor),n.showFolders||t.add(Me.Folder),n.showTypeParameters||t.add(Me.TypeParameter),n.showSnippets||t.add(Me.Snippet),n.showUsers||t.add(Me.User),n.showIssues||t.add(Me.Issue),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ho(e.leadingLineContent)!==ho(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(VI.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[n,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(n):t.set(n,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:Ku.TriggerForIncompleteCompletions,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const n=VI.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};dX=hbe=D([_(1,Ml),_(2,dg),_(3,Yi),_(4,Ge),_(5,Le),_(6,Te),_(7,it),_(8,Za)],dX);class VMt{constructor(e,t,i,n){this._disposables=new Z,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==uD.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&n(this._active.item)}}))}_onItem(e){if(!e||!eo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new jj;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Ise=class Ise{constructor(e,t){this._disposables=new Z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),n=i.length;let o=!1;for(let a=0;aIse._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&ea instanceof Sc?i.createInstance(C6,a,{useComma:!0}):void 0;this._leftActions=new hd(this.element,{actionViewItemProvider:r}),this._rightActions=new hd(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],n=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};gbe=D([_(2,we),_(3,Oa),_(4,Le)],gbe);var KMt=".monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-enum,.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-value{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}";ut(KMt,{});W("symbolIcon.arrayForeground",zi,g(9919,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.booleanForeground",zi,g(9920,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9921,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.colorForeground",zi,g(9922,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constantForeground",zi,g(9923,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9924,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9925,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9926,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9927,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9928,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fileForeground",zi,g(9929,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.folderForeground",zi,g(9930,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9931,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9932,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keyForeground",zi,g(9933,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keywordForeground",zi,g(9934,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9935,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.moduleForeground",zi,g(9936,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.namespaceForeground",zi,g(9937,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.nullForeground",zi,g(9938,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.numberForeground",zi,g(9939,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.objectForeground",zi,g(9940,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.operatorForeground",zi,g(9941,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.packageForeground",zi,g(9942,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.propertyForeground",zi,g(9943,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.referenceForeground",zi,g(9944,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.snippetForeground",zi,g(9945,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.stringForeground",zi,g(9946,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.structForeground",zi,g(9947,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.textForeground",zi,g(9948,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.typeParameterForeground",zi,g(9949,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.unitForeground",zi,g(9950,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9951,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class wMe{constructor(){this._onDidWillResize=new I,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._sashListener=new Z,this._size=new bn(0,0),this._minSize=new bn(0,0),this._maxSize=new bn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Od(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:fi.VERTICAL}),this._westSash=new Od(this.domNode,{getVerticalSashLeft:()=>0},{orientation:fi.VERTICAL}),this._northSash=new Od(this.domNode,{getHorizontalSashTop:()=>0},{orientation:fi.HORIZONTAL,orthogonalEdge:sJ.North}),this._southSash=new Od(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:fi.HORIZONTAL,orthogonalEdge:sJ.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(M.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(M.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(M.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(M.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?oa.Enabled:oa.Disabled,this._eastSash.state=t?oa.Enabled:oa.Disabled,this._southSash.state=i?oa.Enabled:oa.Disabled,this._westSash.state=n?oa.Enabled:oa.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(r,t));const a=new bn(t,e);bn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}function yMe(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let fbe=class{constructor(e,t){this._editor=e,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new I,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Z,this._renderDisposeable=new Z,this._borderWidth=1,this._size=new bn(330,0),this.domNode=fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Y_,{editor:e}),this._body=fe(".body"),this._scrollbar=new EU(this._body,{alwaysConsumeMouseWheel:!0}),re(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=re(this._body,fe(".header")),this._close=re(this._header,fe("span"+We.asCSSSelector(ve.close))),this._close.title=g(9952,"Close"),this._type=re(this._header,fe("p.type")),this._docs=re(this._body,fe("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.fontInfo)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(x.fontInfo),i=t.getMassagedFontFamily(),n=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${n}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/n}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(x.suggestLineHeight)||this._editor.getOption(x.fontInfo).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=g(9953,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} `,o+=`prefix: ${e.word??"(no prefix)"} `,o+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,o+=`distance: ${e.distance} (localityBonus-setting) `,o+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,o+=`commit_chars: ${e.completion.commitCharacters?.join("")} -`,s=new Xt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!eFe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Oh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Yo(this._type),this._type.title="",Jl(this._type),this.domNode.classList.add("no-type");if(Yo(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Yo(this._docs);const o=this._markdownRenderer.render(s);this._docs.appendChild(o.element),this._renderDisposeable.add(o),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Tn(e,t);Tn.equals(i,this._size)||(this._size=i,Hut(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};kye=D([_(1,be)],kye);class CPt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new ZPe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=s.width-a.dimension.width,c=!0),a.north&&(o=s.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=uw(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Tn(220,2*o.lineHeight),a=e.top,c=function(){const S=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),M=-o.borderWidth+e.left+e.width,k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),l=function(){const S=e.left-o.borderWidth-o.horizontalPadding,M=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),d=function(){const S=e.left,M=-o.borderWidth+e.top+e.height,k=new Tn(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:M,left:S,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(S=>S.fit>=0)??h.sort((S,M)=>M.fit-S.fit)[0],f=e.top+e.height-o.borderHeight;let p,m=t.height;const v=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);m>v&&(m=v);let w;i?m<=u.maxSizeTop.height?(p=!0,w=u.maxSizeTop):(p=!1,w=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,w=u.maxSizeBottom):(p=!0,w=u.maxSizeTop);let{top:b,left:C}=u;!p&&m>e.height&&(b=f-m);const y=this._editor.getDomNode();if(y){const S=y.getBoundingClientRect();b-=S.top,C-=S.left}this._applyTopLeft({left:C,top:b}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=w,this._resizable.layout(m,Math.min(w.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const yPt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function lI(n,e,t,i,s){if($e.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(P.isUri(s))return[];const o=i===Lc.ROOT_FOLDER?["rootfolder-icon"]:i===Lc.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===_e.data)r=h1.parseMetaData(t).get(h1.META_DATA_LABEL);else{const a=t.path.match(yPt);a?(r=TK(a[2].toLowerCase()),a[1]&&o.push(`${TK(a[1].toLowerCase())}-name-dir-icon`)):r=TK(t.authority.toLowerCase())}if(i===Lc.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===Lc.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const c=r.split(".");for(let l=1;l{const w=this._editor.getOptions(),b=w.get(x.fontInfo),C=b.getMassagedFontFamily(),y=b.fontFeatureSettings,S=w.get(x.suggestFontSize)||b.fontSize,M=w.get(x.suggestLineHeight)||b.lineHeight,k=b.fontWeight,F=b.letterSpacing,N=`${S}px`,z=`${M}px`,U=`${F}px`;i.style.fontSize=N,i.style.fontWeight=k,i.style.letterSpacing=U,a.style.fontFamily=C,a.style.fontFeatureSettings=y,a.style.lineHeight=z,s.style.height=z,s.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.root.id=ltt(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Cz(e.score)},r=[];if(s.kind===Ne.Color&&EPt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===Ne.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Lc.FILE),c=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Lc.FILE);o.extraClasses=a.length>c.length?a:c}else s.kind===Ne.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Lc.FOLDER),lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Lc.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...$e.asClassNameArray(E9.toIcon(s.kind))));s.tags&&s.tags.indexOf(TU.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=rpe(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=rpe(s.label.detail||""),i.detailsLabel.textContent=rpe(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Oh(i.detailsLabel):Jl(i.detailsLabel),eFe(e)?(i.right.classList.add("can-expand-details"),Oh(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Jl(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Iye=D([_(1,Ai),_(2,Di),_(3,pn)],Iye);function rpe(n){return n.replace(/\r\n|\r|\n/g,"")}var bB;const $g="vs/editor/contrib/suggest/browser/suggestWidget";B("editorSuggestWidget.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g($g,0,"Background color of the suggest widget."));B("editorSuggestWidget.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g($g,1,"Border color of the suggest widget."));const RK=B("editorSuggestWidget.foreground",{dark:Nc,light:Nc,hcDark:Nc,hcLight:Nc},g($g,2,"Foreground color of the suggest widget."));B("editorSuggestWidget.selectedForeground",{dark:zk,light:zk,hcDark:zk,hcLight:zk},g($g,3,"Foreground color of the selected entry in the suggest widget."));B("editorSuggestWidget.selectedIconForeground",{dark:JB,light:JB,hcDark:JB,hcLight:JB},g($g,4,"Icon foreground color of the selected entry in the suggest widget."));const xPt=B("editorSuggestWidget.selectedBackground",{dark:$k,light:$k,hcDark:$k,hcLight:$k},g($g,5,"Background color of the selected entry in the suggest widget."));B("editorSuggestWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g($g,6,"Color of the match highlights in the suggest widget."));B("editorSuggestWidget.focusHighlightForeground",{dark:Dj,light:Dj,hcDark:Dj,hcLight:Dj},g($g,7,"Color of the match highlights in the suggest widget when an item is focused."));B("editorSuggestWidgetStatus.foreground",{dark:Ie(RK,.5),light:Ie(RK,.5),hcDark:Ie(RK,.5),hcLight:Ie(RK,.5)},g($g,8,"Foreground color of the suggest widget status."));var An;(function(n){n[n.Hidden=0]="Hidden",n[n.Loading=1]="Loading",n[n.Empty=2]="Empty",n[n.Open=3]="Open",n[n.Frozen=4]="Frozen",n[n.Details=5]="Details"})(An||(An={}));class DPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof oC}`}restore(){const e=this._service.get(this._key,ke.PROFILE)??"";try{const t=JSON.parse(e);if(Tn.is(t))return Tn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),ke.PROFILE,ln.MACHINE)}reset(){this._service.remove(this._key,ke.PROFILE)}}var h0;let Lye=(h0=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=An.Hidden,this._isAuto=!1,this._pendingLayout=new Dn,this._pendingShowDetails=new Dn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new O_,this._disposables=new Z,this._onDidSelect=new r1,this._onDidFocus=new r1,this._onDidHide=new I,this._onDidShow=new I,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new I,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new ZPe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new kPt(this,e),this._persistedSize=new DPt(t,e);class r{constructor(f,p,m=!1,v=!1){this.persistedSize=f,this.currentSize=p,this.persistHeight=m,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:f,defaultSize:p}=this.getLayoutInfo(),m=Math.round(f/2);let{width:v,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=m)&&(w=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new Tn(v,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=he(this.element.domNode,we(".message")),this._listElement=he(this.element.domNode,we(".tree"));const c=this._disposables.add(o.createInstance(kye,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new CPt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(Iye,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Fc("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>g($g,11,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:w,description:b}=u.completion.label;w&&b?f=g($g,12,"{0} {1}, {2}",f,w,b):w?f=g($g,13,"{0} {1}",f,w):b&&(f=g($g,14,"{0}, {1}",f,b))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=a_("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g($g,15,"{0}, docs: {1}",f,v)}}}),this._list.style(CO({listInactiveFocusBackground:xPt,listInactiveFocusOutline:co})),this._status=o.createInstance(Dye,this.element.domNode,FI);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(s.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.suggest)&&(h(),l()),this._completionModel&&(u.hasChanged(x.fontInfo)||u.hasChanged(x.suggestFontSize)||u.hasChanged(x.suggestLineHeight))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=qi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=qi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=qi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=qi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Xo(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==An.Hidden&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=pS(e.type)?2:1}_onListFocus(e){if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=na(async s=>{const o=PS(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=s.onCancellationRequested(()=>o.dispose());try{return await t.resolve(s)}finally{o.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:ltt(i)}))}).catch(bt)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===An.Frozen),this.element.domNode.classList.remove("message"),e){case An.Hidden:Jl(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case An.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.LOADING_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.LOADING_MESSAGE);break;case An.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.NO_SUGGESTIONS_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.NO_SUGGESTIONS_MESSAGE);break;case An.Open:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Frozen:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Details:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===An.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=PS(()=>this._setState(An.Loading),t)))}showSuggestions(e,t,i,s,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==An.Empty&&this._state!==An.Hidden){this._setState(An.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(s?An.Hidden:An.Empty),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?An.Frozen:An.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=wZ(gt(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageDown(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollBottom(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageUp(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollTop(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==An.Hidden&&this._state!==An.Empty&&this._state!==An.Loading&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===An.Details?(this._setState(An.Open),this._details.widget.domNode.classList.remove("focused")):this._state===An.Open&&this._isDetailsVisible()&&(this._setState(An.Details),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(eFe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===An.Open||this._state===An.Details||this._state===An.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=wZ(gt(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(An.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(o=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=ia(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,f=Math.min(t.height-u-i.verticalPadding,c),p=d.top+h.top-i.verticalPadding,m=Math.min(p,c);let v=Math.min(Math.max(m,f)+i.borderHeight,c);s===this._cappedHeight?.capped&&(s=this._cappedHeight.wanted),sv&&(s=v),s>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(hs.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(hs.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new Tn(a,i.defaultSize.height),this.element.maxSize=new Tn(r,v),this.element.minSize=new Tn(220,l),this._cappedHeight=s===c?{wanted:this._cappedHeight?.wanted??e.height,capped:s}:void 0}this._resize(o,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===hs.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=kc(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===An.Empty||this._state===An.Loading?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Tn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",ke.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,ke.PROFILE,ln.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},bB=h0,h0.LOADING_MESSAGE=g($g,9,"Loading..."),h0.NO_SUGGESTIONS_MESSAGE=g($g,10,"No suggestions."),h0);Lye=bB=D([_(1,on),_(2,Pe),_(3,pn),_(4,be)],Lye);class kPt{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Tn(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var Tye;const CS="vs/editor/contrib/suggest/browser/suggestController";class IPt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Kt.register({description:"suggest-line-suffix",stickiness:gi.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(O.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var Pd;(function(n){n[n.None=0]="None",n[n.NoBeforeUndoStop=1]="NoBeforeUndoStop",n[n.NoAfterUndoStop=2]="NoAfterUndoStop",n[n.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",n[n.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Pd||(Pd={}));var mN;let mm=(mN=class{static get(e){return e.getContribution(Tye.ID)}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Dn,this._toDispose=new Z,this._selectors=new LPt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(Mte,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=qi.InsertMode.bindTo(s);c.set(e.getOption(x.suggest).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>c.set(e.getOption(x.suggest).insertMode))),this.widget=this._toDispose.add(new d$(gt(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(Lye,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Pd.None),this));const u=new fPt(this.editor,h,this.model,v=>this._insertSuggestion(v,Pd.NoAfterUndoStop));this._toDispose.add(u);const f=qi.MakesTextEdit.bindTo(this._contextKeyService),p=qi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=qi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const w=this.editor.getPosition(),b=v.editStart.column,C=w.column;let y=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===OI.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&cp.InsertAsSnippet)&&C-b===v.completion.insertText.length&&(y=this.editor.getModel().getValueInRange({startLineNumber:w.lineNumber,startColumn:b,endLineNumber:w.lineNumber,endColumn:C})!==v.completion.insertText),f.set(y),p.set(!oe.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new RS(!0,!1,!1,!1,E.KeyC))||ei&&v.toKeyCodeChord().equals(new RS(!1,!1,!1,!0,E.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new xye(this.editor,this.model)))),this._alternatives=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new bV(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Lte,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new IPt(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const p of this._selectors.itemsOrderedByPriorityDesc)if(u=p.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===OI.Idle)return;let f=!1;if(h.triggerOptions.auto){const p=this.editor.getOption(x.suggest);p.selectionMode==="never"||p.selectionMode==="always"?f=p.selectionMode==="never":p.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==tf.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===tf.TriggerCharacter&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const l=qi.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(x.acceptSuggestionOnEnter);l.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=mc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],c=new ai;t&Pd.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Pd.AlternativeOverwriteConfig));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=M_.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=O.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const w=this.editor.getPosition().column-r.position.column,b=w,C=O.spansMultipleLines(v)?0:w;v=new O(v.startLineNumber,v.startColumn+b,v.endLineNumber,v.endColumn+C)}return ds.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new ao;let m;const v=s.onDidChangeContent(y=>{if(y.isFlush){c.cancel(),v.dispose();return}for(const S of y.changes){const M=O.getEndPosition(S.range);(!m||oe.isBefore(M,m))&&(m=M)}}),w=t;t|=Pd.NoAfterUndoStop;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,w&Pd.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(r.resolve(c.token).then(()=>{if(!r.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(S=>oe.isBefore(m,O.getStartPosition(S.range))))return!1;b&&this.editor.pushUndoStop();const y=M_.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(S=>ds.replaceMove(O.lift(S.range),S.text))),y.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(w&Pd.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(y=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),y),u=y===!0?1:y===!1?0:-2}).finally(()=>{v.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&cp.InsertAsSnippet||(f=ww.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&cp.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Pd.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===Nte.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new ao;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?er(m):bt(m)}).finally(()=>{h=p.elapsed()}))}t&Pd.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(p,Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop|(t&Pd.AlternativeOverwriteConfig?Pd.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o){Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Ed(ui(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:uz(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,t){Bt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(mo(e.completion.additionalTextEdits)){const t=g(CS,0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);sa(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),vt.Smooth),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&cp.InsertAsSnippet||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,c=r.column;return c-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:c})!==o.completion.insertText};T.once(this.model.onDidTrigger)(o=>{const r=[];T.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{St(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(St(r),a.items.length===0){i();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),l=a.items[c];if(!s(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Pd.KeepAlternativeSuggestions|Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,vt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=Pd.KeepAlternativeSuggestions),t&&(s|=Pd.AlternativeOverwriteConfig),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}},Tye=mN,mN.ID="editor.contrib.suggestController",mN);mm=Tye=D([_(1,ghe),_(2,ji),_(3,Pe),_(4,be),_(5,Ze),_(6,rn)],mm);class LPt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const jae=class jae extends lt{constructor(){super({id:jae.id,label:g(CS,1,"Trigger Suggest"),alias:"Trigger Suggest",precondition:ge.and(X.writable,X.hasCompletionItemProvider,qi.Visible.toNegated()),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.Alt|E.Escape,V.CtrlCmd|E.KeyI]},weight:ye.EditorContrib}})}run(e,t,i){const s=mm.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}};jae.id="editor.action.triggerSuggest";let Nte=jae;vn(mm.ID,mm,mi.BeforeFirstInteraction);Fe(Nte);const Im=ye.EditorContrib+90,yg=Jc.bindToContribution(mm.get);Ke(new yg({id:"acceptSelectedSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:E.Tab,kbExpr:ge.and(qi.Visible,X.textInputFocus),weight:Im},{primary:E.Enter,kbExpr:ge.and(qi.Visible,X.textInputFocus,qi.AcceptSuggestionsOnEnter,qi.MakesTextEdit),weight:Im}],menuOpts:[{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:qi.HasInsertAndReplaceRange.toNegated()},{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("insert"))},{menuId:FI,title:g(CS,3,"Replace"),group:"left",order:1,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("replace"))}]}));Ke(new yg({id:"acceptAlternativeSelectedSuggestion",precondition:ge.and(qi.Visible,X.textInputFocus,qi.HasFocusedSuggestion),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:V.Shift|E.Enter,secondary:[V.Shift|E.Tab]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:FI,group:"left",order:2,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("insert")),title:g(CS,3,"Replace")},{menuId:FI,group:"left",order:2,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("replace")),title:g(CS,2,"Insert")}]}));yt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ke(new yg({id:"hideSuggestWidget",precondition:qi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new yg({id:"selectNextSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}}));Ke(new yg({id:"selectNextPageSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.PageDown,secondary:[V.CtrlCmd|E.PageDown]}}));Ke(new yg({id:"selectLastSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Ke(new yg({id:"selectPrevSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new yg({id:"selectPrevPageSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.PageUp,secondary:[V.CtrlCmd|E.PageUp]}}));Ke(new yg({id:"selectFirstSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Ke(new yg({id:"focusSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}}}));Ke(new yg({id:"focusAndAcceptSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Ke(new yg({id:"toggleSuggestionDetails",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}},menuOpts:[{menuId:FI,group:"right",order:1,when:ge.and(qi.DetailsVisible,qi.CanResolve),title:g(CS,4,"show less")},{menuId:FI,group:"right",order:1,when:ge.and(qi.DetailsVisible.toNegated(),qi.CanResolve),title:g(CS,5,"show more")}]}));Ke(new yg({id:"toggleExplainMode",precondition:qi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Slash}}));Ke(new yg({id:"toggleSuggestionFocus",precondition:qi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Alt|E.Space,mac:{primary:V.WinCtrl|V.Alt|E.Space}}}));Ke(new yg({id:"insertBestCompletion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),Lte.AtEnd,qi.Visible.toNegated(),bV.OtherSuggestions.toNegated(),mc.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(fo(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:Im,primary:E.Tab}}));Ke(new yg({id:"insertNextSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,qi.Visible.toNegated(),mc.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new yg({id:"insertPrevSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,qi.Visible.toNegated(),mc.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:Im,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Fe(class extends lt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(CS,6,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){mm.get(e)?.resetWidgetSize()}});class TPt extends ${get selectedItem(){return this._selectedItem}constructor(e,t,i,s){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=xi(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=mm.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(c,l,d)=>{En(w=>this.checkModelVersion(w));const h=this.editor.getModel();if(!h)return-1;const u=this.suggestControllerPreselector(),f=u?wM(u,h):void 0;if(!f)return-1;const p=oe.lift(l),m=d.map((w,b)=>{const C=K$.fromSuggestion(o,h,p,w,this.isShiftKeyPressed),y=wM(C.toSingleTextEdit(),h),S=ttt(f,y);return{index:b,valid:S,prefixLength:y.text.length,suggestItem:w}}).filter(w=>w&&w.valid&&w.prefixLength>0),v=NRe(m,El(w=>w.prefixLength,cg));return v?v.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(T.once(o.model.onDidTrigger)(c=>{a()})),this._register(o.onWillInsertSuggestItem(c=>{const l=this.editor.getPosition(),d=this.editor.getModel();if(!l||!d)return;const h=K$.fromSuggestion(o,d,l,c.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!RPt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,En(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=mm.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return K$.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){mm.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){mm.get(this.editor)?.forceRenderingAbove()}}class K${static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&cp.InsertAsSnippet){const l=new ww().parse(r);l.children.length<100&&Ite.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(s,o);return new K$(O.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new OQe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new ug(this.range,this.insertText)}}function RPt(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var Rye;const MPt="vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController";var _N;let _g=(_N=class extends ${static get(e){return e.getContribution(Rye.ID)}constructor(e,t,i,s,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this.model=this._register(_7("inlineCompletionModel",void 0)),this._textModelVersionId=xi(this,-1),this._positions=Uxt({owner:this,equalsFn:pbe(PJe())},[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new TPt(this.editor,()=>this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0),m=>this.updateObservables(m,Bp.Other),m=>{En(v=>{this.updateObservables(v,Bp.Other),this.model.get()?.handleSuggestAccepted(m)})})),this._enabledInConfig=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Wn(this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Dt(this,m=>this._enabledInConfig.read(m)&&(!this._isScreenReaderEnabled.read(m)||!this._editorDictationInProgress.read(m))),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._ghostTexts=Dt(this,m=>this.model.read(m)?.ghostTexts.read(m)??[]),this._stablizedGhostTexts=NPt(this._ghostTexts,this._store),this._ghostTextWidgets=yee(this,this._stablizedGhostTexts,(m,v)=>v.add(this._instantiationService.createInstance(uye,this.editor,{ghostText:m,minReservedLineCount:Au(0),targetTextModel:this.model.map(w=>w?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=oL(this),this._isReadonly=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._textModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=Dt(m=>this._isReadonly.read(m)?void 0:this._textModel.read(m)),this._register(new af(this._contextKeyService,this.model)),this._register(Ni(m=>{const v=this._textModelIfWritable.read(m);En(w=>{if(this.model.set(void 0,w),this.updateObservables(w,Bp.Other),v){const b=t.createInstance(yye,v,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).preview),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).previewMode),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.inlineSuggest).mode),this._enabled);this.model.set(b,w)}})}));const h=this._register(uje());this._register(Ni(m=>{const v=this._fontFamily.read(m);h.setStyle(v===""||v==="default"?"":` +`,n=new Mt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!yMe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Yh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Ms(this._type),this._type.title="",zd(this._type),this.domNode.classList.add("no-type");if(Ms(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Ms(this._docs);const o=this._markdownRenderer.render(n);this._docs.appendChild(o.element),this._renderDisposeable.add(o),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new bn(e,t);bn.equals(i,this._size)||(this._size=i,UGe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};fbe=D([_(1,we)],fbe);class qMt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new wMe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=n.width-a.dimension.width,c=!0),a.north&&(o=n.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,n=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=z_(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new bn(220,2*o.lineHeight),a=e.top,c=function(){const A=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),L=-o.borderWidth+e.left+e.width,k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),l=function(){const A=e.left-o.borderWidth-o.horizontalPadding,L=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),d=function(){const A=e.left,L=-o.borderWidth+e.top+e.height,k=new bn(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:L,left:A,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(A=>A.fit>=0)??h.sort((A,L)=>L.fit-A.fit)[0],f=e.top+e.height-o.borderHeight;let p,m=t.height;const v=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);m>v&&(m=v);let b;i?m<=u.maxSizeTop.height?(p=!0,b=u.maxSizeTop):(p=!1,b=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,b=u.maxSizeBottom):(p=!0,b=u.maxSizeTop);let{top:w,left:y}=u;!p&&m>e.height&&(w=f-m);const C=this._editor.getDomNode();if(C){const A=C.getBoundingClientRect();w-=A.top,y-=A.left}this._applyTopLeft({left:y,top:w}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(m,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const QMt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Mx(s,e,t,i,n){if(We.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(N.isUri(n))return[];const o=i===ba.ROOT_FOLDER?["rootfolder-icon"]:i===ba.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===pe.data)r=Mk.parseMetaData(t).get(Mk.META_DATA_LABEL);else{const a=t.path.match(QMt);a?(r=vK(a[2].toLowerCase()),a[1]&&o.push(`${vK(a[1].toLowerCase())}-name-dir-icon`)):r=vK(t.authority.toLowerCase())}if(i===ba.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===ba.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const c=r.split(".");for(let l=1;l{const b=this._editor.getOptions(),w=b.get(x.fontInfo),y=w.getMassagedFontFamily(),C=w.fontFeatureSettings,A=b.get(x.suggestFontSize)||w.fontSize,L=b.get(x.suggestLineHeight)||w.lineHeight,k=w.fontWeight,P=w.letterSpacing,R=`${A}px`,z=`${L}px`,G=`${P}px`;i.style.fontSize=R,i.style.fontWeight=k,i.style.letterSpacing=G,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=z,n.style.height=z,n.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=qXe(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:xU(e.score)},r=[];if(n.kind===Me.Color&&JMt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===Me.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FILE),c=Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FILE);o.extraClasses=a.length>c.length?a:c}else n.kind===Me.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FOLDER),Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...We.asClassNameArray(v8.toIcon(n.kind))));n.tags&&n.tags.indexOf(I2.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=qhe(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=qhe(n.label.detail||""),i.detailsLabel.textContent=qhe(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Yh(i.detailsLabel):zd(i.detailsLabel),yMe(e)?(i.right.classList.add("can-expand-details"),Yh(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),zd(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};pbe=D([_(1,gi),_(2,xi),_(3,pn)],pbe);function qhe(s){return s.replace(/\r\n|\r|\n/g,"")}var MP;W("editorSuggestWidget.background",xh,g(5228,"Background color of the suggest widget."));W("editorSuggestWidget.border",r6,g(5229,"Border color of the suggest widget."));const XMt=W("editorSuggestWidget.foreground",Rl,g(5230,"Foreground color of the suggest widget."));W("editorSuggestWidget.selectedForeground",K8,g(5231,"Foreground color of the selected entry in the suggest widget."));W("editorSuggestWidget.selectedIconForeground",FTe,g(5232,"Icon foreground color of the selected entry in the suggest widget."));const ZMt=W("editorSuggestWidget.selectedBackground",q8,g(5233,"Background color of the selected entry in the suggest widget."));W("editorSuggestWidget.highlightForeground",nF,g(5234,"Color of the match highlights in the suggest widget."));W("editorSuggestWidget.focusHighlightForeground",upt,g(5235,"Color of the match highlights in the suggest widget when an item is focused."));W("editorSuggestWidgetStatus.foreground",st(XMt,.5),g(5236,"Foreground color of the suggest widget status."));var _n;(function(s){s[s.Hidden=0]="Hidden",s[s.Loading=1]="Loading",s[s.Empty=2]="Empty",s[s.Open=3]="Open",s[s.Frozen=4]="Frozen",s[s.Details=5]="Details",s[s.onDetailsKeyDown=6]="onDetailsKeyDown"})(_n||(_n={}));class eNt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof lf}`}restore(){const e=this._service.get(this._key,Ie.PROFILE)??"";try{const t=JSON.parse(e);if(bn.is(t))return bn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),Ie.PROFILE,an.MACHINE)}reset(){this._service.remove(this._key,Ie.PROFILE)}}var WD;let mbe=(WD=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=_n.Hidden,this._isAuto=!1,this._pendingLayout=new wn,this._pendingShowDetails=new wn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Cm,this._disposables=new Z,this._onDidSelect=new kk,this._onDidFocus=new kk,this._onDidHide=new I,this._onDidShow=new I,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new I,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new wMe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new tNt(this,e),this._persistedSize=new eNt(t,e);class r{constructor(f,p,m=!1,v=!1){this.persistedSize=f,this.currentSize=p,this.persistHeight=m,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:f,defaultSize:p}=this.getLayoutInfo(),m=Math.round(f/2);let{width:v,height:b}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-b)<=m)&&(b=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new bn(v,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=re(this.element.domNode,fe(".message")),this._listElement=re(this.element.domNode,fe(".tree"));const c=this._disposables.add(o.createInstance(fbe,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new qMt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(pbe,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Xa("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>g(5239,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:b,description:w}=u.completion.label;b&&w?f=g(5240,"{0} {1}, {2}",f,b,w):b?f=g(5241,"{0} {1}",f,b):w&&(f=g(5242,"{0}, {1}",f,w))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=$p("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g(5243,"{0}, docs: {1}",f,v)}}}),this._list.style(BN({listInactiveFocusBackground:ZMt,listInactiveFocusOutline:Js})),this._status=o.createInstance(gbe,this.element.domNode,hD);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(n.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.suggest)&&(h(),l()),this._completionModel&&(u.hasChanged(x.fontInfo)||u.hasChanged(x.suggestFontSize)||u.hasChanged(x.suggestLineHeight))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Ui.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Ui.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Ui.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Ui.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ro(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==_n.Hidden&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Ry(e.type)?2:1}_onListFocus(e){if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Rr(async n=>{const o=jy(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=n.onCancellationRequested(()=>o.dispose());try{return await t.resolve(n)}finally{o.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:qXe(i)}))}).catch(vt)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===_n.Frozen),this.element.domNode.classList.remove("message"),e){case _n.Hidden:zd(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case _n.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=MP.LOADING_MESSAGE,zd(this._listElement,this._status.element),Yh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ah(MP.LOADING_MESSAGE);break;case _n.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=MP.NO_SUGGESTIONS_MESSAGE,zd(this._listElement,this._status.element),Yh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ah(MP.NO_SUGGESTIONS_MESSAGE);break;case _n.Open:zd(this._messageElement),Yh(this._listElement,this._status.element),this._show();break;case _n.Frozen:zd(this._messageElement),Yh(this._listElement,this._status.element),this._show();break;case _n.Details:zd(this._messageElement),Yh(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===_n.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=jy(()=>this._setState(_n.Loading),t)))}showSuggestions(e,t,i,n,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==_n.Empty&&this._state!==_n.Hidden){this._setState(_n.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(n?_n.Hidden:_n.Empty),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?_n.Frozen:_n.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Uj(ct(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.pageDown(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollBottom(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.pageUp(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollTop(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==_n.Hidden&&this._state!==_n.Empty&&this._state!==_n.Loading&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===_n.Details?(this._setState(_n.Open),this._details.widget.domNode.classList.remove("focused")):this._state===_n.Open&&this._isDetailsVisible()&&(this._setState(_n.Details),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(yMe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===_n.Open||this._state===_n.Details||this._state===_n.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=Uj(ct(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(_n.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(o=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=Cr(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,f=Math.min(t.height-u-i.verticalPadding,c),p=d.top+h.top-i.verticalPadding,m=Math.min(p,c);let v=Math.min(Math.max(m,f)+i.borderHeight,c);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),nv&&(n=v),n>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(es.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(es.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new bn(a,i.defaultSize.height),this.element.maxSize=new bn(r,v),this.element.minSize=new bn(220,l),this._cappedHeight=n===c?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(o,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===es.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Ka(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===_n.Empty||this._state===_n.Loading?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new bn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",Ie.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,Ie.PROFILE,an.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},MP=WD,WD.LOADING_MESSAGE=g(5237,"Loading..."),WD.NO_SUGGESTIONS_MESSAGE=g(5238,"No suggestions."),WD);mbe=MP=D([_(1,$i),_(2,Le),_(3,pn),_(4,we)],mbe);class tNt{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new bn(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var _be;class iNt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Gt.register({description:"suggest-line-suffix",stickiness:ni.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(F.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var Wl;(function(s){s[s.None=0]="None",s[s.NoBeforeUndoStop=1]="NoBeforeUndoStop",s[s.NoAfterUndoStop=2]="NoAfterUndoStop",s[s.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",s[s.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Wl||(Wl={}));var AL;let Xg=(AL=class{static get(e){return e.getContribution(_be.ID)}constructor(e,t,i,n,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new wn,this._toDispose=new Z,this._selectors=new nNt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(dX,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Ui.InsertMode.bindTo(n);c.set(e.getOption(x.suggest).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>c.set(e.getOption(x.suggest).insertMode))),this.widget=this._toDispose.add(new XV(ct(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(mbe,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Wl.None),this));const u=new VMt(this.editor,h,this.model,v=>this._insertSuggestion(v,Wl.NoAfterUndoStop));this._toDispose.add(u);const f=Ui.MakesTextEdit.bindTo(this._contextKeyService),p=Ui.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Ui.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const b=this.editor.getPosition(),w=v.editStart.column,y=b.column;let C=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===uD.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&Yg.InsertAsSnippet)&&y-w===v.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:w,endLineNumber:b.lineNumber,endColumn:y})!==v.completion.insertText),f.set(C),p.set(!oe.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new Ih(!0,!1,!1,!1,S.KeyC))||Qt&&v.toKeyCodeChord().equals(new Ih(!1,!1,!1,!0,S.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new XV(ct(e.getDomNode()),()=>this._toDispose.add(new ube(this.editor,this.model)))),this._alternatives=this._toDispose.add(new XV(ct(e.getDomNode()),()=>this._toDispose.add(new bW(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(aX,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new iNt(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const p of this._selectors.itemsOrderedByPriorityDesc)if(u=p.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===uD.Idle)return;let f=!1;if(h.triggerOptions.auto){const p=this.editor.getOption(x.suggest);p.selectionMode==="never"||p.selectionMode==="always"?f=p.selectionMode==="never":p.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==Ku.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===Ku.TriggerCharacter&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const l=Ui.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const h=this.editor.getOption(x.acceptSuggestionOnEnter);l.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=fc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:r}=e,a=[],c=new ci;t&Wl.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Wl.AlternativeOverwriteConfig));this._memoryService.memorize(n,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=vm.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=F.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const b=this.editor.getPosition().column-r.position.column,w=b,y=F.spansMultipleLines(v)?0:b;v=new F(v.startLineNumber,v.startColumn+w,v.endLineNumber,v.endColumn+y)}return Zn.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new js;let m;const v=n.onDidChangeContent(C=>{if(C.isFlush){c.cancel(),v.dispose();return}for(const A of C.changes){const L=F.getEndPosition(A.range);(!m||oe.isBefore(L,m))&&(m=L)}}),b=t;t|=Wl.NoAfterUndoStop;let w=!1;const y=this.editor.onWillType(()=>{y.dispose(),w=!0,b&Wl.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(r.resolve(c.token).then(()=>{if(!r.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(A=>oe.isBefore(m,F.getStartPosition(A.range))))return!1;w&&this.editor.pushUndoStop();const C=vm.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(A=>Zn.replaceMove(F.lift(A.range),A.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(b&Wl.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),C),u=C===!0?1:C===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&Yg.InsertAsSnippet||(f=X_.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&Yg.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Wl.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===hX.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new js;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?No(m):vt(m)}).finally(()=>{h=p.elapsed()}))}t&Wl.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(p,Wl.NoBeforeUndoStop|Wl.NoAfterUndoStop|(t&Wl.AlternativeOverwriteConfig?Wl.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,o){Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Wc(_i(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:vU(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o})}getOverwriteInfo(e,t){Tt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(eo(e.completion.additionalTextEdits)){const t=g(1562,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Mr(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),mt.Smooth),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=o=>{if(o.completion.insertTextRules&Yg.InsertAsSnippet||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,c=r.column;return c-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:c})!==o.completion.insertText};M.once(this.model.onDidTrigger)(o=>{const r=[];M.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{bt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(bt(r),a.items.length===0){i();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),l=a.items[c];if(!n(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Wl.KeepAlternativeSuggestions|Wl.NoBeforeUndoStop|Wl.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,mt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=Wl.KeepAlternativeSuggestions),t&&(n|=Wl.AlternativeOverwriteConfig),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}},_be=AL,AL.ID="editor.contrib.suggestController",AL);Xg=_be=D([_(1,cce),_(2,vi),_(3,Le),_(4,we),_(5,Ge),_(6,Yi)],Xg);class nNt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const Tse=class Tse extends tt{constructor(){super({id:Tse.id,label:g(1563,"Trigger Suggest"),alias:"Trigger Suggest",precondition:he.and(J.writable,J.hasCompletionItemProvider,Ui.Visible.toNegated()),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.Alt|S.Escape,U.CtrlCmd|S.KeyI]},weight:Ae.EditorContrib}})}run(e,t,i){const n=Xg.get(t);if(!n)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),n.triggerSuggest(void 0,o,void 0)}};Tse.id="editor.action.triggerSuggest";let hX=Tse;on(Xg.ID,Xg,ri.BeforeFirstInteraction);Re(hX);const wp=Ae.EditorContrib+90,mu=hc.bindToContribution(Xg.get);qe(new mu({id:"acceptSelectedSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:S.Tab,kbExpr:he.and(Ui.Visible,J.textInputFocus),weight:wp},{primary:S.Enter,kbExpr:he.and(Ui.Visible,J.textInputFocus,Ui.AcceptSuggestionsOnEnter,Ui.MakesTextEdit),weight:wp}],menuOpts:[{menuId:hD,title:g(1564,"Insert"),group:"left",order:1,when:Ui.HasInsertAndReplaceRange.toNegated()},{menuId:hD,title:g(1564,"Insert"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert"))},{menuId:hD,title:g(1565,"Replace"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace"))}]}));qe(new mu({id:"acceptAlternativeSelectedSuggestion",precondition:he.and(Ui.Visible,J.textInputFocus,Ui.HasFocusedSuggestion),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.Shift|S.Enter,secondary:[U.Shift|S.Tab]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:hD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert")),title:g(1565,"Replace")},{menuId:hD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace")),title:g(1564,"Insert")}]}));_t.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");qe(new mu({id:"hideSuggestWidget",precondition:Ui.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new mu({id:"selectNextSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}}));qe(new mu({id:"selectNextPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.PageDown,secondary:[U.CtrlCmd|S.PageDown]}}));qe(new mu({id:"selectLastSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));qe(new mu({id:"selectPrevSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new mu({id:"selectPrevPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.PageUp,secondary:[U.CtrlCmd|S.PageUp]}}));qe(new mu({id:"selectFirstSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));qe(new mu({id:"focusSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}}}));qe(new mu({id:"focusAndAcceptSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));qe(new mu({id:"toggleSuggestionDetails",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}},menuOpts:[{menuId:hD,group:"right",order:1,when:he.and(Ui.DetailsVisible,Ui.CanResolve),title:g(1566,"show less")},{menuId:hD,group:"right",order:1,when:he.and(Ui.DetailsVisible.toNegated(),Ui.CanResolve),title:g(1567,"show more")}]}));qe(new mu({id:"toggleExplainMode",precondition:Ui.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Slash}}));qe(new mu({id:"toggleSuggestionFocus",precondition:Ui.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Alt|S.Space,mac:{primary:U.WinCtrl|U.Alt|S.Space}}}));qe(new mu({id:"insertBestCompletion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),aX.AtEnd,Ui.Visible.toNegated(),bW.OtherSuggestions.toNegated(),fc.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(kn(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:wp,primary:S.Tab}}));qe(new mu({id:"insertNextSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),bW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new mu({id:"insertPrevSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),bW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Re(class extends tt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(1568,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){Xg.get(e)?.resetWidgetSize()}});class sNt extends V{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new I),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(o=>{o.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(o=>{o.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=Xg.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,c,l)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?IT(h,d):void 0;if(!u)return-1;const f=oe.lift(c),p=l.map((v,b)=>{const w=O5.fromSuggestion(n,d,f,v,this.isShiftKeyPressed),y=IT(w.toSingleTextEdit(),d),C=VXe(u,y);return{index:b,valid:C,prefixLength:y.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=N1e(p,Cc(v=>v.prefixLength,nu));return m?m.index:-1}}));let o=!1;const r=()=>{o||(o=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(M.once(n.model.onDidTrigger)(a=>{r()})),this._register(n.onWillInsertSuggestItem(a=>{const c=this.editor.getPosition(),l=this.editor.getModel();if(!c||!l)return;const d=O5.fromSuggestion(n,l,c,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!oNt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=Xg.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return O5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){Xg.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){Xg.get(this.editor)?.forceRenderingAbove()}}class O5{static fromSuggestion(e,t,i,n,o){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&Yg.InsertAsSnippet){const l=new X_().parse(r);l.children.length<100&&rX.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(n,o);return new O5(F.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new pGe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new au(this.range,this.insertText)}}function oNt(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var vbe,EL;let fu=(EL=class extends V{static get(e){return e.getContribution(vbe.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this._editorObs=Xh(this.editor),this._positions=Ze(this,u=>this._editorObs.selections.read(u)?.map(f=>f.getEndPosition())??[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new sNt(this.editor,()=>(this._editorObs.forceUpdate(),this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0)),u=>this._editorObs.forceUpdate(f=>{this.model.get()?.handleSuggestAccepted(u)}))),this._suggestWidgetSelectedItem=Kn(this,u=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(f=>u(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Kn(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Ze(this,u=>this._enabledInConfig.read(u)&&(!this._isScreenReaderEnabled.read(u)||!this._editorDictationInProgress.read(u))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=mh(this,u=>{if(this._editorObs.isReadonly.read(u))return;const f=this._editorObs.model.read(u);return f?this._instantiationService.createInstance(cbe,f,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).preview),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).previewMode),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=Ze(this,u=>this.model.read(u)?.ghostTexts.read(u)??[]),this._stablizedGhostTexts=rNt(this._ghostTexts,this._store),this._ghostTextWidgets=YY(this,this._stablizedGhostTexts,(u,f)=>f.add(this._instantiationService.createInstance(Zve,this.editor,{ghostText:u,minReservedLineCount:nd(0),targetTextModel:this.model.map(p=>p?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=gC(this),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._register(new ju(this._contextKeyService,this.model)),this._register(_ve(this._editorObs.onDidType,(u,f)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(u=>{new Set([FO.Tab.id,FO.DeleteLeft.id,FO.DeleteRight.id,MXe,"acceptSelectedSuggestion"]).has(u.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(p=>{this.model.get()?.trigger(p)})})),this._register(_ve(this._editorObs.selections,(u,f)=>{f.some(p=>p.reason===Oi.Explicit||p.source==="api")&&this.model.get()?.stop()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||_W.dropDownVisible||ts(u=>{this.model.get()?.stop(u)})})),this._register(ai(u=>{const f=this.model.read(u)?.state.read(u);f?.suggestItem?f.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const h=b6(this,(u,f)=>{const m=this.model.read(u)?.state.read(u);return this._suggestWidgetSelectedItem.get()?f:m?.inlineCompletion?.semanticId});this._register(MIt(Ze(u=>(this._playAccessibilitySignal.read(u),h.read(u),{})),async(u,f,p)=>{const m=this.model.get(),v=m?.state.get();if(!v||!m)return;const b=m.textModel.getLineContent(v.primaryGhostText.lineNumber);await Sr(50,Zge(p)),await T5(this._suggestWidgetSelectedItem,Ya,()=>!1,Zge(p)),await this._accessibilitySignalService.playSignal(cl.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(b))})),this._register(new ebe(this.editor,this.model,this._instantiationService)),this._register(JRt(Ze(u=>{const f=this._fontFamily.read(u);return f===""||f==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { - font-family: ${v}; -}`)}));const u=m=>m.isUndoing?Bp.Undo:m.isRedoing?Bp.Redo:this.model.get()?.isAcceptingPartially?Bp.AcceptWord:Bp.Other;this._register(e.onDidChangeModelContent(m=>En(v=>this.updateObservables(v,u(m))))),this._register(e.onDidChangeCursorPosition(m=>En(v=>{this.updateObservables(v,Bp.Other),(m.reason===Hi.Explicit||m.source==="api")&&this.model.get()?.stop(v)}))),this._register(e.onDidType(()=>En(m=>{this.updateObservables(m,Bp.Other),this._enabled.get()&&this.model.get()?.trigger(m)}))),this._register(this._commandService.onDidExecuteCommand(m=>{new Set([TW.Tab.id,TW.DeleteLeft.id,TW.DeleteRight.id,Qet,"acceptSelectedSuggestion"]).has(m.commandId)&&e.hasTextFocus()&&this._enabled.get()&&En(w=>{this.model.get()?.trigger(w)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||vV.dropDownVisible||En(m=>{this.model.get()?.stop(m)})})),this._register(Ni(m=>{const v=this.model.read(m)?.state.read(m);v?.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const f=this._register(new Z);let p;this._register(Az({handleChange:(m,v)=>(m.didChange(this._playAccessibilitySignal)&&(p=void 0),!0)},async(m,v)=>{this._playAccessibilitySignal.read(m);const w=this.model.read(m),b=w?.state.read(m);if(!w||!b||!b.inlineCompletion){p=void 0;return}if(b.inlineCompletion.semanticId!==p){f.clear(),p=b.inlineCompletion.semanticId;const C=w.textModel.getLineContent(b.primaryGhostText.lineNumber);await Ta(50,qBe(f)),await U$(this._suggestWidgetAdaptor.selectedItem,ll,()=>!1,qBe(f)),await this._accessibilitySignalService.playSignal(Zl.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.provideScreenReaderUpdate(b.primaryGhostText.renderForScreenReader(C))}})),this._register(new gye(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(s=g(MPt,0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),sa(s?e+", "+s:e)}updateObservables(e,t){const i=this.editor.getModel();this._textModelVersionId.set(i?.getVersionId()??-1,e,t),this._positions.set(this.editor.getSelections()?.map(s=>s.getPosition())??[new oe(1,1)],e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new oe(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){En(e=>{this.model.get()?.stop(e)})}},Rye=_N,_N.ID="editor.contrib.inlineCompletionsController",_N);_g=Rye=D([_(1,be),_(2,Pe),_(3,Re),_(4,ji),_(5,B_),_(6,ht),_(7,Lw),_(8,ti),_(9,Ur)],_g);function NPt(n,e){const t=xi("result",[]),i=[];return e.add(Ni(s=>{const o=n.read(s);En(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const pC="vs/workbench/contrib/accessibility/browser/accessibleViewActions",BQ={id:Te.AccessibleView,group:"navigation",when:km},WQ={id:Te.CommandPalette,group:"",order:1};class PPt extends pi{constructor(){super({id:Ru.ShowNext,precondition:ge.and(km,yte),keybinding:{primary:V.Alt|E.BracketRight,weight:ye.WorkbenchContrib},menu:[WQ,{...BQ,when:ge.and(km,yte)}],icon:Ce.arrowDown,title:g(pC,0,"Show Next in Accessible View")})}run(e){e.get(Tw).next()}}At(PPt);class FPt extends pi{constructor(){super({id:Ru.NextCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageDown,mac:{primary:V.CtrlCmd|V.Alt|E.PageDown},weight:ye.WorkbenchContrib},icon:Ce.arrowRight,menu:{...BQ,when:ge.and(km,Ate)},title:g(pC,1,"Accessible View: Next Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("next")}}At(FPt);class OPt extends pi{constructor(){super({id:Ru.PreviousCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageUp,mac:{primary:V.CtrlCmd|V.Alt|E.PageUp},weight:ye.WorkbenchContrib},icon:Ce.arrowLeft,menu:{...BQ,when:ge.and(km,Ate)},title:g(pC,2,"Accessible View: Previous Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("previous")}}At(OPt);class BPt extends pi{constructor(){super({id:Ru.ShowPrevious,precondition:ge.and(km,yte),keybinding:{primary:V.Alt|E.BracketLeft,weight:ye.WorkbenchContrib},icon:Ce.arrowUp,menu:[WQ,{...BQ,when:ge.and(km,yte)}],title:g(pC,3,"Show Previous in Accessible View")})}run(e){e.get(Tw).previous()}}At(BPt);class WPt extends pi{constructor(){super({id:Ru.GoToSymbol,precondition:ge.and(ge.or(km,T1),ZVe),keybinding:{primary:V.CtrlCmd|V.Shift|E.KeyO,secondary:[V.CtrlCmd|V.Shift|E.Period],weight:ye.WorkbenchContrib+10},icon:Ce.symbolField,menu:[WQ,{...BQ,when:ge.and(ge.or(km,T1),ZVe)}],title:g(pC,4,"Go To Symbol in Accessible View")})}run(e){e.get(Tw).goToSymbol()}}At(WPt);function dtt(n){return n.register(),n}dtt(new Z1({id:Ru.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:V.Alt|E.F1,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F1,secondary:[V.Alt|E.F1]},kbExpr:T1.toNegated()},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,5,"Open Accessibility Help"),order:1}]}));const HPt=dtt(new Z1({id:Ru.OpenAccessibleView,precondition:void 0,kbOpts:{primary:V.Alt|E.F2,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F2,secondary:[V.Alt|E.F2]}},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,6,"Open Accessible View"),order:1}]}));class UPt extends pi{constructor(){super({id:Ru.DisableVerbosityHint,precondition:ge.and(ge.or(km,T1),XVe),keybinding:{primary:V.Alt|E.F6,weight:ye.WorkbenchContrib},icon:Ce.bellSlash,menu:[WQ,{id:Te.AccessibleView,group:"navigation",when:ge.and(ge.or(km,T1),XVe)}],title:g(pC,7,"Disable Accessible View Hint")})}run(e){e.get(Tw).disableHint()}}At(UPt);class VPt extends pi{constructor(){super({id:Ru.AccessibilityHelpConfigureKeybindings,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyK,weight:ye.WorkbenchContrib},title:g(pC,8,"Accessibility Help Configure Keybindings")})}async run(e){await e.get(Tw).configureKeybindings()}}At(VPt);class zPt extends pi{constructor(){super({id:Ru.AccessibilityHelpOpenHelpLink,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyH,weight:ye.WorkbenchContrib},title:g(pC,9,"Accessibility Help Open Help Link")})}run(e){e.get(Tw).openHelpLink()}}At(zPt);class $Pt extends pi{constructor(){super({id:Ru.AccessibleViewAcceptInlineCompletion,precondition:ge.and(km,ge.equals(Ste.key,rC.InlineCompletions)),keybinding:{primary:V.CtrlCmd|E.Slash,mac:{primary:V.WinCtrl|E.Slash},weight:ye.WorkbenchContrib},icon:Ce.check,menu:[WQ,{id:Te.AccessibleView,group:"navigation",order:0,when:ge.and(km,ge.equals(Ste.key,rC.InlineCompletions))}],title:g(pC,10,"Accept Inline Completion")})}async run(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const s=_g.get(i)?.model.get(),o=s?.state.get();!s||!o||(await s.accept(i),s.stop(),i.focus())}}At($Pt);const Nm="vs/workbench/contrib/chat/common/chatContextKeys",A4e=new Y("chatSessionResponseVote","",{type:"string",description:g(Nm,0,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),GPt=new Y("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(Nm,1,"When the agent or command was automatically detected")}),qPt=new Y("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(Nm,2,"True when the current chat response supports issue reporting.")}),htt=new Y("chatSessionResponseFiltered",!1,{type:"boolean",description:g(Nm,3,"True when the chat response was filtered out by the server.")}),j7=new Y("chatSessionRequestInProgress",!1,{type:"boolean",description:g(Nm,4,"True when the current request is still in progress.")}),QPt=new Y("chatResponse",!1,{type:"boolean",description:g(Nm,5,"The chat item is a response.")}),jPt=new Y("chatRequest",!1,{type:"boolean",description:g(Nm,6,"The chat item is a request")}),KPt=new Y("chatEditApplied",!1,{type:"boolean",description:g(Nm,7,"True when the chat text edits have been applied.")}),tFe=new Y("chatInputHasText",!1,{type:"boolean",description:g(Nm,8,"True when the chat input has text.")}),YPt=new Y("chatInputHasFocus",!1,{type:"boolean",description:g(Nm,9,"True when the chat input has focus.")}),iFe=new Y("inChatInput",!1,{type:"boolean",description:g(Nm,10,"True when focus is in the chat input, false otherwise.")}),JPt=new Y("inChat",!1,{type:"boolean",description:g(Nm,11,"True when focus is in the chat widget, false otherwise.")}),utt=new Y("chatIsEnabled",!1,{type:"boolean",description:g(Nm,12,"True when chat is enabled because a default chat participant is registered.")}),XPt=new Y("chatCursorAtTop",!1),gtt=new Y("chatInputHasAgent",!1),ZPt=new Y("chatLocation",void 0),eFt=new Y("quickChatHasFocus",!1,{type:"boolean",description:g(Nm,13,"True when the quick chat UI has focus, false otherwise.")});var tFt=".monaco-editor .editor-dictation-widget{align-items:center;background-color:var(--vscode-editor-background);border-radius:8px;box-shadow:0 4px 8px var(--vscode-widget-shadow);display:flex;line-height:var(--vscode-editor-dictation-widget-height);max-width:var(--vscode-editor-dictation-widget-width);min-height:var(--vscode-editor-dictation-widget-height);padding:2px;z-index:1000}.monaco-editor .editor-dictation-widget.recording .codicon.codicon-mic-filled{animation:editor-dictation-animation 1s infinite;color:var(--vscode-activityBarBadge-background)}@keyframes editor-dictation-animation{0%{color:var(--vscode-editorCursor-background)}50%{color:var(--vscode-activityBarBadge-background)}to{color:var(--vscode-editorCursor-background)}}";Ct(tFt,{});var TJ;const K7="vs/workbench/contrib/codeEditor/browser/dictation/editorDictation",ftt=new Y("editorDictation.inProgress",!1),ptt=Be(K7,0,"Voice");class iFt extends wf{constructor(){super({id:"workbench.action.editorDictation.start",title:Be(K7,1,"Start Dictation in Editor"),category:ptt,precondition:ge.and(vNt,wNt.toNegated(),X.readOnly.toNegated()),f1:!0,keybinding:{primary:V.CtrlCmd|V.Alt|E.KeyV,weight:ye.WorkbenchContrib,secondary:Is?[V.Alt|E.Backquote]:void 0}})}runEditorCommand(e,t){const s=e.get(ti).enableKeybindingHoldMode(this.desc.id);if(s){let o=!1;const r=setTimeout(()=>{o=!0},500);s.finally(()=>{clearTimeout(r),o&&qS.get(t)?.stop()})}qS.get(t)?.start()}}const Kae=class Kae extends wf{constructor(){super({id:Kae.ID,title:Be(K7,2,"Stop Dictation in Editor"),category:ptt,precondition:ftt,f1:!0,keybinding:{primary:E.Escape,weight:ye.WorkbenchContrib+100}})}runEditorCommand(e,t){qS.get(t)?.stop()}};Kae.ID="workbench.action.editorDictation.stop";let Y7=Kae;class nFt extends ${constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new Qh(this.domNode)),s=t.lookupKeybinding(Y7.ID)?.getLabel();i.push(_l({id:Y7.ID,label:s?g(K7,3,"Stop Dictation ({0})",s):g(K7,4,"Stop Dictation"),class:$e.asClassName(Ce.micFilled),run:()=>qS.get(e)?.stop()}),{icon:!0,label:!1,keybinding:s}),this.domNode.classList.add("editor-dictation-widget"),this.domNode.appendChild(i.domNode)}getId(){return"editorDictation"}getDomNode(){return this.domNode}getPosition(){if(!this.editor.hasModel())return null;const e=this.editor.getSelection();return{position:e.getPosition(),preference:[e.getPosition().equals(e.getStartPosition())?hs.ABOVE:hs.BELOW,hs.EXACT]}}beforeRender(){const e=this.editor.getOption(x.lineHeight),t=this.editor.getLayoutInfo().contentWidth*.7;return this.domNode.style.setProperty("--vscode-editor-dictation-widget-height",`${e}px`),this.domNode.style.setProperty("--vscode-editor-dictation-widget-width",`${t}px`),null}show(){this.editor.addContentWidget(this)}layout(){this.editor.layoutContentWidget(this)}active(){this.domNode.classList.add("recording")}hide(){this.domNode.classList.remove("recording"),this.editor.removeContentWidget(this)}}var vN;let qS=(vN=class extends ${static get(e){return e.getContribution(TJ.ID)}constructor(e,t,i,s){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=s,this.widget=this._register(new nFt(this.editor,this.keybindingService)),this.editorDictationInProgress=ftt.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new Dn)}async start(){const e=new Z;this.sessionDisposables.value=e,this.widget.show(),e.add(Ee(()=>this.widget.hide())),this.editorDictationInProgress.set(!0),e.add(Ee(()=>this.editorDictationInProgress.reset()));const t=this.editor.createDecorationsCollection();e.add(Ee(()=>t.clear())),e.add(this.editor.onDidChangeCursorPosition(()=>this.widget.layout()));let i,s=0;const o=(c,l)=>{i||(i=ws(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(TJ.ID,[ds.replace(O.fromPositions(i,i.with(void 0,i.column+s)),c)],[mt.fromPositions(d)]),l?t.set([{range:O.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),s=c.length,l||(i=void 0,s=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ai;e.add(Ee(()=>r.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(r.token,"editor");e.add(a.onDidChange(c=>{if(!r.token.isCancellationRequested)switch(c.status){case l2.Started:this.widget.active();break;case l2.Stopped:e.dispose();break;case l2.Recognizing:{if(!c.text)return;o(c.text,!0);break}case l2.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},TJ=vN,vN.ID="editorDictation",vN);qS=TJ=D([_(1,Xde),_(2,Pe),_(3,ti)],qS);vn(qS.ID,qS,mi.Lazy);At(iFt);At(Y7);var Mye;const xC="vs/editor/contrib/contextmenu/browser/contextmenu";var wN;let QS=(wN=class{static get(e){return e.getContribution(Mye.ID)}constructor(e,t,i,s,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=c,this._toDispose=new Z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=l.srcElement;h.shadowRoot&&cF(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===E.ContextMenu&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(x.contextmenu)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===Mt.OVERLAY_WIDGET||e.target.type===Mt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Mt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Mt.CONTENT_TEXT&&e.target.type!==Mt.CONTENT_EMPTY&&e.target.type!==Mt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Mt.TEXTAREA&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(x.contextmenu)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const r of o){const[,a]=r;let c=0;for(const l of a)if(l instanceof uS){const d=this._getMenuActions(e,l.item.submenu);d.length>0&&(i.push(new u1(l.id,l.label,d)),c++)}else i.push(l),c++;c&&i.push(new Kr)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(x.hover);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),vt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ia(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;s={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new WS(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new WS(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||rxt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const s=l=>({id:`menu-action-${++i}`,label:l.label,tooltip:"",class:void 0,enabled:typeof l.enabled>"u"?!0:l.enabled,checked:l.checked,run:l.run}),o=(l,d)=>new u1(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return s({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(s({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(s({label:g(xC,0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Kr),a.push(s({label:g(xC,1,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(xC,2,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(xC,3,"Proportional"),value:"proportional"},{label:g(xC,4,"Fill"),value:"fill"},{label:g(xC,5,"Fit"),value:"fit"}])),a.push(r(g(xC,6,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(xC,7,"Mouse Over"),value:"mouseover"},{label:g(xC,8,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:c?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:l=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},Mye=wN,wN.ID="editor.contrib.contextmenu",wN);QS=Mye=D([_(1,Vr),_(2,W_),_(3,Pe),_(4,ti),_(5,_c),_(6,Re),_(7,Ti)],QS);class sFt extends lt{constructor(){super({id:"editor.action.showContextMenu",label:g(xC,9,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|E.F10,weight:ye.EditorContrib}})}run(e,t){QS.get(t)?.showContextMenu()}}vn(QS.ID,QS,mi.BeforeFirstInteraction);Fe(sFt);const ape="vs/workbench/contrib/snippets/browser/snippetsFile";class oFt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new ww().parse(e,!1),i=new Map;let s=0;for(const r of t.placeholders)s=Math.max(s,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(s===0){const r=Mf(t.children);this.isTrivial=r instanceof ep&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof wV){if(r.children.length===0&&!cPt[r.name]){const a=i.has(r.name)?i.get(r.name):++s;i.set(r.name,a);const c=new ep(a).appendChild(new Fh(r.name));t.replace(r,[c]),this.isBogous=!0}switch(r.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else o.push(...r.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class nFe{constructor(e,t,i,s,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=s,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=s.toLowerCase(),this._bodyInsights=new d$(ax(),()=>new oFt(this.body))}get codeSnippet(){return this._bodyInsights.value.codeSnippet}get isBogous(){return this._bodyInsights.value.isBogous}get isTrivial(){return this._bodyInsights.value.isTrivial}get needsClipboard(){return this._bodyInsights.value.usesClipboardVariable}get usesSelection(){return this._bodyInsights.value.usesSelectionVariable}}function rFt(n){return fo(n)&&!!n.body}var Yg;(function(n){n[n.User=1]="User",n[n.Workspace=2]="Workspace",n[n.Extension=3]="Extension"})(Yg||(Yg={}));class cpe{constructor(e,t,i,s,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=s,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=T_(t.path)===".code-snippets",this.isUserSnippets=!this._extension}select(e,t){this.isGlobalSnippets||!this.isUserSnippets?this._scopeSelect(e,t):this._filepathSelect(e,t)}_filepathSelect(e,t){e+".json"===yr(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const s of this.data){const o=s.scopes.length;if(o===0)t.push(s);else for(let r=0;r=0&&this._scopeSelect(e.substring(0,i),t)}async _load(){return this._extension?this._extensionResourceLoaderService.readExtensionResource(this.location):(await this._fileService.readFile(this.location)).value.toString()}load(){return this._loadPromise||(this._loadPromise=Promise.resolve(this._load()).then(e=>{const t=ow(e);if(HW(t)==="object")for(const[i,s]of Object.entries(t))if(rFt(s))this._parseSnippet(i,s,this.data);else for(const[o,r]of Object.entries(s))this._parseSnippet(o,r,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:s,prefix:o,body:r,description:a}=t;if(o||(o=""),Array.isArray(r)&&(r=r.join(` + font-family: ${f}; +}`}))),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(n=g(5093,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Mr(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new oe(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){ts(e=>{this.model.get()?.stop(e)})}},vbe=EL,EL.ID="editor.contrib.inlineCompletionsController",EL);fu=vbe=D([_(1,we),_(2,Le),_(3,Te),_(4,vi),_(5,Sp),_(6,it),_(7,lv),_(8,Ut),_(9,mr)],fu);function rNt(s,e){const t=jt("result",[]),i=[];return e.add(ai(n=>{const o=s.read(n);ts(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const G6={id:_e.AccessibleView,group:"navigation",when:bp},K6={id:_e.CommandPalette,group:"",order:1};class aNt extends li{constructor(){super({id:Xd.ShowNext,precondition:he.and(bp,XJ),keybinding:{primary:U.Alt|S.BracketRight,weight:Ae.WorkbenchContrib},menu:[K6,{...G6,when:he.and(bp,XJ)}],icon:ve.arrowDown,title:g(10002,"Show Next in Accessible View")})}run(e){e.get(Dm).next()}}At(aNt);class cNt extends li{constructor(){super({id:Xd.NextCodeBlock,precondition:he.and(eX,he.equals(ZJ.key,Pb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageDown,mac:{primary:U.CtrlCmd|U.Alt|S.PageDown},weight:Ae.WorkbenchContrib},icon:ve.arrowRight,menu:{...G6,when:he.and(bp,eX)},title:g(10003,"Accessible View: Next Code Block")})}run(e){e.get(Dm).navigateToCodeBlock("next")}}At(cNt);class lNt extends li{constructor(){super({id:Xd.PreviousCodeBlock,precondition:he.and(eX,he.equals(ZJ.key,Pb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageUp,mac:{primary:U.CtrlCmd|U.Alt|S.PageUp},weight:Ae.WorkbenchContrib},icon:ve.arrowLeft,menu:{...G6,when:he.and(bp,eX)},title:g(10004,"Accessible View: Previous Code Block")})}run(e){e.get(Dm).navigateToCodeBlock("previous")}}At(lNt);class dNt extends li{constructor(){super({id:Xd.ShowPrevious,precondition:he.and(bp,XJ),keybinding:{primary:U.Alt|S.BracketLeft,weight:Ae.WorkbenchContrib},icon:ve.arrowUp,menu:[K6,{...G6,when:he.and(bp,XJ)}],title:g(10005,"Show Previous in Accessible View")})}run(e){e.get(Dm).previous()}}At(dNt);class hNt extends li{constructor(){super({id:Xd.GoToSymbol,precondition:he.and(he.or(bp,NA),THe),keybinding:{primary:U.CtrlCmd|U.Shift|S.KeyO,secondary:[U.CtrlCmd|U.Shift|S.Period],weight:Ae.WorkbenchContrib+10},icon:ve.symbolField,menu:[K6,{...G6,when:he.and(he.or(bp,NA),THe)}],title:g(10006,"Go To Symbol in Accessible View")})}run(e){e.get(Dm).goToSymbol()}}At(hNt);function QXe(s){return s.register(),s}QXe(new wI({id:Xd.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:U.Alt|S.F1,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F1,secondary:[U.Alt|S.F1]},kbExpr:NA.toNegated()},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10007,"Open Accessibility Help"),order:1}]}));const uNt=QXe(new wI({id:Xd.OpenAccessibleView,precondition:void 0,kbOpts:{primary:U.Alt|S.F2,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F2,secondary:[U.Alt|S.F2]}},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10008,"Open Accessible View"),order:1}]}));class gNt extends li{constructor(){super({id:Xd.DisableVerbosityHint,precondition:he.and(he.or(bp,NA),IHe),keybinding:{primary:U.Alt|S.F6,weight:Ae.WorkbenchContrib},icon:ve.bellSlash,menu:[K6,{id:_e.AccessibleView,group:"navigation",when:he.and(he.or(bp,NA),IHe)}],title:g(10009,"Disable Accessible View Hint")})}run(e){e.get(Dm).disableHint()}}At(gNt);class fNt extends li{constructor(){super({id:Xd.AccessibilityHelpConfigureKeybindings,precondition:he.and(NA,LHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyK,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:3,when:LHe}],title:g(10010,"Accessibility Help Configure Unassigned Keybindings")})}async run(e){await e.get(Dm).configureKeybindings(!0)}}At(fNt);class pNt extends li{constructor(){super({id:Xd.AccessibilityHelpConfigureAssignedKeybindings,precondition:he.and(NA,RHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyA,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:4,when:RHe}],title:g(10011,"Accessibility Help Configure Assigned Keybindings")})}async run(e){await e.get(Dm).configureKeybindings(!1)}}At(pNt);class mNt extends li{constructor(){super({id:Xd.AccessibilityHelpOpenHelpLink,precondition:he.and(NA),keybinding:{primary:U.Alt|S.KeyH,weight:Ae.WorkbenchContrib},title:g(10012,"Accessibility Help Open Help Link")})}run(e){e.get(Dm).openHelpLink()}}At(mNt);class _Nt extends li{constructor(){super({id:Xd.AccessibleViewAcceptInlineCompletion,precondition:he.and(bp,he.equals(ZJ.key,Pb.InlineCompletions)),keybinding:{primary:U.CtrlCmd|S.Slash,mac:{primary:U.WinCtrl|S.Slash},weight:Ae.WorkbenchContrib},icon:ve.check,menu:[K6,{id:_e.AccessibleView,group:"navigation",order:0,when:he.and(bp,he.equals(ZJ.key,Pb.InlineCompletions))}],title:g(10013,"Accept Inline Completion")})}async run(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=fu.get(i)?.model.get(),o=n?.state.get();!n||!o||(await n.accept(i),n.stop(),i.focus())}}At(_Nt);const iUe=new Q("chatSessionResponseVote","",{type:"string",description:g(7024,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),vNt=new Q("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(7025,"When the agent or command was automatically detected")}),bNt=new Q("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(7026,"True when the current chat response supports issue reporting.")}),jXe=new Q("chatSessionResponseFiltered",!1,{type:"boolean",description:g(7027,"True when the chat response was filtered out by the server.")}),K3=new Q("chatSessionRequestInProgress",!1,{type:"boolean",description:g(7028,"True when the current request is still in progress.")}),wNt=new Q("chatResponse",!1,{type:"boolean",description:g(7029,"The chat item is a response.")}),yNt=new Q("chatRequest",!1,{type:"boolean",description:g(7030,"The chat item is a request")}),CNt=new Q("chatEditApplied",!1,{type:"boolean",description:g(7031,"True when the chat text edits have been applied.")}),CMe=new Q("chatInputHasText",!1,{type:"boolean",description:g(7032,"True when the chat input has text.")}),SNt=new Q("chatInputHasFocus",!1,{type:"boolean",description:g(7033,"True when the chat input has focus.")}),SMe=new Q("inChatInput",!1,{type:"boolean",description:g(7034,"True when focus is in the chat input, false otherwise.")}),ANt=new Q("inChat",!1,{type:"boolean",description:g(7035,"True when focus is in the chat widget, false otherwise.")}),YXe=new Q("chatIsEnabled",!1,{type:"boolean",description:g(7036,"True when chat is enabled because a default chat participant is registered.")}),ENt=new Q("chatCursorAtTop",!1),JXe=new Q("chatInputHasAgent",!1),xNt=new Q("chatLocation",void 0),DNt=new Q("quickChatHasFocus",!1,{type:"boolean",description:g(7037,"True when the quick chat UI has focus, false otherwise.")});var kNt=".monaco-editor .editor-dictation-widget{align-items:center;background-color:var(--vscode-editor-background);border-radius:8px;box-shadow:0 4px 8px var(--vscode-widget-shadow);display:flex;line-height:var(--vscode-editor-dictation-widget-height);max-width:var(--vscode-editor-dictation-widget-width);min-height:var(--vscode-editor-dictation-widget-height);padding:2px;z-index:1000}.monaco-editor .editor-dictation-widget.recording .codicon.codicon-mic-filled{animation:editor-dictation-animation 1s infinite;color:var(--vscode-activityBarBadge-background)}@keyframes editor-dictation-animation{0%{color:var(--vscode-editorCursor-background)}50%{color:var(--vscode-activityBarBadge-background)}to{color:var(--vscode-editorCursor-background)}}";ut(kNt,{});var iQ;const XXe=new Q("editorDictation.inProgress",!1),ZXe=Pe(10420,"Voice");class INt extends gf{constructor(){super({id:"workbench.action.editorDictation.start",title:Pe(10421,"Start Dictation in Editor"),category:ZXe,precondition:he.and(GRt,KRt.toNegated(),J.readOnly.toNegated()),f1:!0,keybinding:{primary:U.CtrlCmd|U.Alt|S.KeyV,weight:Ae.WorkbenchContrib,secondary:Qn?[U.Alt|S.Backquote]:void 0}})}runEditorCommand(e,t){const n=e.get(Ut).enableKeybindingHoldMode(this.desc.id);if(n){let o=!1;const r=setTimeout(()=>{o=!0},500);n.finally(()=>{clearTimeout(r),o&&nC.get(t)?.stop()})}nC.get(t)?.start()}}const Lse=class Lse extends gf{constructor(){super({id:Lse.ID,title:Pe(10422,"Stop Dictation in Editor"),category:ZXe,precondition:XXe,f1:!0,keybinding:{primary:S.Escape,weight:Ae.WorkbenchContrib+100}})}runEditorCommand(e,t){nC.get(t)?.stop()}};Lse.ID="workbench.action.editorDictation.stop";let q3=Lse;class TNt extends V{constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new hd(this.domNode)),n=t.lookupKeybinding(q3.ID)?.getLabel();i.push(rl({id:q3.ID,label:n?g(10423,"Stop Dictation ({0})",n):g(10424,"Stop Dictation"),class:We.asClassName(ve.micFilled),run:()=>nC.get(e)?.stop()}),{icon:!0,label:!1,keybinding:n}),this.domNode.classList.add("editor-dictation-widget"),this.domNode.appendChild(i.domNode)}getId(){return"editorDictation"}getDomNode(){return this.domNode}getPosition(){if(!this.editor.hasModel())return null;const e=this.editor.getSelection();return{position:e.getPosition(),preference:[e.getPosition().equals(e.getStartPosition())?es.ABOVE:es.BELOW,es.EXACT]}}beforeRender(){const e=this.editor.getOption(x.lineHeight),t=this.editor.getLayoutInfo().contentWidth*.7;return this.domNode.style.setProperty("--vscode-editor-dictation-widget-height",`${e}px`),this.domNode.style.setProperty("--vscode-editor-dictation-widget-width",`${t}px`),null}show(){this.editor.addContentWidget(this)}layout(){this.editor.layoutContentWidget(this)}active(){this.domNode.classList.add("recording")}hide(){this.domNode.classList.remove("recording"),this.editor.removeContentWidget(this)}}var xL;let nC=(xL=class extends V{static get(e){return e.getContribution(iQ.ID)}constructor(e,t,i,n){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=n,this.widget=this._register(new TNt(this.editor,this.keybindingService)),this.editorDictationInProgress=XXe.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new wn)}async start(){const e=new Z;this.sessionDisposables.value=e,this.widget.show(),e.add(Ee(()=>this.widget.hide())),this.editorDictationInProgress.set(!0),e.add(Ee(()=>this.editorDictationInProgress.reset()));const t=this.editor.createDecorationsCollection();e.add(Ee(()=>t.clear())),e.add(this.editor.onDidChangeCursorPosition(()=>this.widget.layout()));let i,n=0;const o=(c,l)=>{i||(i=qn(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(iQ.ID,[Zn.replace(F.fromPositions(i,i.with(void 0,i.column+n)),c)],[dt.fromPositions(d)]),l?t.set([{range:F.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),n=c.length,l||(i=void 0,n=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ci;e.add(Ee(()=>r.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(r.token,"editor");e.add(a.onDidChange(c=>{if(!r.token.isCancellationRequested)switch(c.status){case pF.Started:this.widget.active();break;case pF.Stopped:e.dispose();break;case pF.Recognizing:{if(!c.text)return;o(c.text,!0);break}case pF.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},iQ=xL,xL.ID="editorDictation",xL);nC=iQ=D([_(1,Kae),_(2,Le),_(3,Ut)],nC);on(nC.ID,nC,ri.Lazy);At(INt);At(q3);var bbe,DL;let Fb=(DL=class{static get(e){return e.getContribution(bbe.ID)}constructor(e,t,i,n,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=c,this._toDispose=new Z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=l.srcElement;h.shadowRoot&&vM(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===S.ContextMenu&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(x.contextmenu)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===Rt.OVERLAY_WIDGET||e.target.type===Rt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Rt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Rt.CONTENT_TEXT&&e.target.type!==Rt.CONTENT_EMPTY&&e.target.type!==Rt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Rt.TEXTAREA&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(x.contextmenu)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of n){const[,r]=o;let a=0;for(const c of r)if(c instanceof Ty){const l=this._getMenuActions(e,c.item.submenu);l.length>0&&(i.push(new Nk(c.id,c.label,l)),a++)}else i.push(c),a++;a&&i.push(new Ar)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(x.hover);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),mt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Cr(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;n={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!dm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new Jy(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new Jy(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||oAt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const n=l=>({id:`menu-action-${++i}`,label:l.label,tooltip:"",class:void 0,enabled:typeof l.enabled>"u"?!0:l.enabled,checked:l.checked,run:l.run}),o=(l,d)=>new Nk(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return n({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(n({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(n({label:g(1373,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Ar),a.push(n({label:g(1374,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(1375,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(1376,"Proportional"),value:"proportional"},{label:g(1377,"Fill"),value:"fill"},{label:g(1378,"Fit"),value:"fit"}])),a.push(r(g(1379,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(1380,"Mouse Over"),value:"mouseover"},{label:g(1381,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!dm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:c?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:l=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},bbe=DL,DL.ID="editor.contrib.contextmenu",DL);Fb=bbe=D([_(1,lr),_(2,mf),_(3,Le),_(4,Ut),_(5,Oa),_(6,Te),_(7,yi)],Fb);class LNt extends tt{constructor(){super({id:"editor.action.showContextMenu",label:g(1382,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|S.F10,weight:Ae.EditorContrib}})}run(e,t){Fb.get(t)?.showContextMenu()}}on(Fb.ID,Fb,ri.BeforeFirstInteraction);Re(LNt);class RNt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new X_().parse(e,!1),i=new Map;let n=0;for(const r of t.placeholders)n=Math.max(n,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(n===0){const r=Cg(t.children);this.isTrivial=r instanceof zg&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof vW){if(r.children.length===0&&!FMt[r.name]){const a=i.has(r.name)?i.get(r.name):++n;i.set(r.name,a);const c=new zg(a).appendChild(new $d(r.name));t.replace(r,[c]),this.isBogous=!0}switch(r.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else o.push(...r.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class eZe{constructor(e,t,i,n,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=n,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=n.toLowerCase(),this._bodyInsights=new XV(ky(),()=>new RNt(this.body))}get codeSnippet(){return this._bodyInsights.value.codeSnippet}get isBogous(){return this._bodyInsights.value.isBogous}get isTrivial(){return this._bodyInsights.value.isTrivial}get needsClipboard(){return this._bodyInsights.value.usesClipboardVariable}get usesSelection(){return this._bodyInsights.value.usesSelectionVariable}}function MNt(s){return kn(s)&&!!s.body}var Hw;(function(s){s[s.User=1]="User",s[s.Workspace=2]="Workspace",s[s.Extension=3]="Extension"})(Hw||(Hw={}));class Qhe{constructor(e,t,i,n,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=n,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=Gy(t.path)===".code-snippets",this.isUserSnippets=!this._extension}select(e,t){this.isGlobalSnippets||!this.isUserSnippets?this._scopeSelect(e,t):this._filepathSelect(e,t)}_filepathSelect(e,t){e+".json"===Ko(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const n of this.data){const o=n.scopes.length;if(o===0)t.push(n);else for(let r=0;r=0&&this._scopeSelect(e.substring(0,i),t)}async _load(){return this._extension?this._extensionResourceLoaderService.readExtensionResource(this.location):(await this._fileService.readFile(this.location)).value.toString()}load(){return this._loadPromise||(this._loadPromise=Promise.resolve(this._load()).then(e=>{const t=sf(e);if(sD(t)==="object")for(const[i,n]of Object.entries(t))if(MNt(n))this._parseSnippet(i,n,this.data);else for(const[o,r]of Object.entries(n))this._parseSnippet(o,r,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:n,prefix:o,body:r,description:a}=t;if(o||(o=""),Array.isArray(r)&&(r=r.join(` `)),typeof r!="string")return;Array.isArray(a)&&(a=a.join(` -`));let c;this.defaultScopes?c=this.defaultScopes:typeof t.scope=="string"?c=t.scope.split(",").map(d=>d.trim()).filter(Boolean):c=[];let l;this._extension?l=this._extension.displayName||this._extension.name:this.source===Yg.Workspace?l=g(ape,0,"Workspace Snippet"):this.isGlobalSnippets?l=g(ape,1,"Global User Snippet"):l=g(ape,2,"User Snippet");for(const d of fi.wrap(o))i.push(new nFe(!!s,c,e,d,a,r,l,this.source,this._extension?`${lO(this._extension.extensionLocation,this.location)}/${e}`:`${yr(this.location.path)}/${e}`,this._extension?.identifier))}}const Va="vs/workbench/services/language/common/languageService",CV=Ap.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(Va,0,"Contributes language declarations."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:languageId}",aliases:["${2:label}"],extensions:["${3:extension}"],configuration:"./language-configuration.json"}}],properties:{id:{description:g(Va,1,"ID of the language."),type:"string"},aliases:{description:g(Va,2,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(Va,3,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(Va,4,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(Va,5,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(Va,6,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(Va,7,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(Va,8,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(Va,9,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(Va,10,"Icon path when a light theme is used"),type:"string"},dark:{description:g(Va,11,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(n,e)=>{for(const t of n)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class aFt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],s=[];for(const d of i)mtt(d)&&s.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=Pct(s,d=>d.id);if((t?.grammars||[]).forEach(d=>{let h=o[d.language];h?h.hasGrammar=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!0,hasSnippets:!1},o[h.id]=h,s.push(h))}),(t?.snippets||[]).forEach(d=>{let h=o[d.language];h?h.hasSnippets=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!1,hasSnippets:!0},o[h.id]=h,s.push(h))}),!s.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(Va,12,"ID"),g(Va,13,"Name"),g(Va,14,"File Extensions"),g(Va,15,"Grammar"),g(Va,16,"Snippets")],l=s.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Xt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(Va,17,"Programming Languages"),access:{canToggle:!1},renderer:new Gi(aFt)});let E4e=class extends Cee{constructor(e,t,i,s){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=s,this._configurationService=t,this._extensionService=e,CV.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(ANe)&&this.updateMime()})),this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this.updateMime()}),this._register(this.onDidRequestRichLanguageFeatures(o=>{this._extensionService.activateByEvent(`onLanguage:${o}`),this._extensionService.activateByEvent("onLanguage")}))}updateMime(){const e=this._configurationService.getValue();dxt(),e.files?.associations&&Object.keys(e.files.associations).forEach(t=>{const i=e.files.associations[t];if(typeof i!="string"){this.logService.warn(`Ignoring configured 'files.associations' for '${t}' because its type is not a string but '${typeof i}'`);return}const s=this.getMimeType(i)||`text/x-${i}`;axt({id:i,mime:s,filepattern:t})}),this._onDidChange.fire()}};E4e=D([_(0,ho),_(1,Re),_(2,Il),_(3,Ze)],E4e);function MK(n){return typeof n>"u"?!0:Array.isArray(n)?n.every(e=>typeof e=="string"):!1}function mtt(n,e){return n?typeof n.id!="string"?(e?.error(g(Va,20,"property `{0}` is mandatory and must be of type `string`","id")),!1):MK(n.extensions)?MK(n.filenames)?typeof n.firstLine<"u"&&typeof n.firstLine!="string"?(e?.error(g(Va,23,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof n.configuration<"u"&&typeof n.configuration!="string"?(e?.error(g(Va,24,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):MK(n.aliases)?MK(n.mimetypes)?typeof n.icon<"u"&&(typeof n.icon!="object"||typeof n.icon.light!="string"||typeof n.icon.dark!="string")?(e?.error(g(Va,27,"property `{0}` can be omitted and must be of type `object` with properties `{1}` and `{2}` of type `string`","icon","light","dark")),!1):!0:(e?.error(g(Va,26,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(Va,25,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(Va,22,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(Va,21,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(Va,19,"Empty value for `contributes.{0}`",CV.name)),!1)}const Nye="vs/workbench/contrib/snippets/browser/snippetCompletionProvider",_tt="_snippet.markAsUsed";yt.registerCommand(_tt,(n,...e)=>{const t=n.get($_),[i]=e;i instanceof nFe&&t.updateUsageTimestamp(i)});class T3{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(Nye,0,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Yg.Extension?"z":"a"}-${e.prefix}`,this.kind=Ne.Snippet,this.insertTextRules=cp.InsertAsSnippet,this.command={id:_tt,title:"",arguments:[e]}}resolve(){return this.documentation=new Xt().appendCodeblock("",ww.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return lw(e.label.label,t.label.label)}}let Pye=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const s=new ao,o=t.lineNumber,r=e.getWordAtPosition(t)??{startColumn:t.column,endColumn:t.column,word:""},a=e.getLineContent(t.lineNumber).toLowerCase(),c=a.substring(0,r.startColumn+r.word.length-1),l=this._computeSnippetPositions(e,o,r,c),d=t.column-1,h=i.triggerCharacter?.toLowerCase()??"",u=this._getLanguageIdAtPosition(e,t),f=this._languageConfigurationService.getLanguageConfiguration(u),p=new Set(await this._snippets.getSnippets(u)),m=[];for(const v of p){if(i.triggerKind===tf.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let w;for(const N of l)if(!(N.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&XYe(N.prefixLow,0,N.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){w=N;break}if(!w)continue;const b=w.startColumn-1,C=v.prefixLow.length-(d-b),y=Ble(a,v.prefixLow,d,d+C,d-b),S=t.with(void 0,b+1);let M=y===0?t.column+C:t.column;dU.open===a[S.column-1]&&v.prefix.startsWith(U.open)&&v.prefix[v.prefix.length-1]===U.close)&&M++;const k=O.fromPositions({lineNumber:o,column:w.startColumn},{lineNumber:o,column:M}),F=k.setEndPosition(o,t.column);m.push(new T3(v,{replace:k,insert:F})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const w=O.fromPositions(t),b=a.indexOf(v.prefixLow,d)===d?w.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):w;m.push(new T3(v,{replace:b,insert:w}))}return this._disambiguateSnippets(m),{suggestions:m,duration:s.elapsed()}}_disambiguateSnippets(e){e.sort(T3.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(Nye,1,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=s)}}resolveCompletionItem(e){return e instanceof T3?e.resolve():e}_computeSnippetPositions(e,t,i,s){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:s.substring(i.startColumn-1),isWord:!0}),o}_getLanguageIdAtPosition(e,t){e.tokenization.tokenizeIfCheap(t.lineNumber);let i=e.getLanguageIdAtPosition(t.lineNumber,t.column);return this._languageService.getLanguageName(i)||(i=e.getLanguageId()),i}};Pye=D([_(0,Di),_(1,$_),_(2,lo)],Pye);var RJ,MJ;const xA="vs/workbench/contrib/snippets/browser/snippetsService";var Pte;(function(n){function e(t,i,s){if(Xv(i.path))return t.collector.error(g(xA,0,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(Xv(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(xA,1,"When omitting the language, the value of `contributes.{0}.path` must be a `.code-snippets`-file. Provided value: {1}",t.description.name,String(i.path))),null;if(!Xv(i.language)&&!s.isRegisteredLanguageId(i.language))return t.collector.error(g(xA,2,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=Qt(o,i.path);return MS(r,o)?{language:i.language,location:r}:(t.collector.error(g(xA,3,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",t.description.name,r.path,o.path)),null)}n.toValidSnippet=e,n.snippetsContribution={description:g(xA,4,"Contributes snippets."),type:"array",defaultSnippets:[{body:[{language:"",path:""}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",path:"./snippets/${2:id}.json."}}],properties:{language:{description:g(xA,5,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(xA,6,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},n.point=Ap.registerExtensionPoint({extensionPoint:"snippets",deps:[CV],jsonSchema:n.snippetsContribution})})(Pte||(Pte={}));function cFt(n,e,t){return pa(n.watch(e),n.onDidFilesChange(i=>{i.affects(e)&&t()}))}var bN;let Fye=(bN=class{constructor(e){this._storageService=e;const t=e.get(RJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=Yqe(i)?new Set(i):new Set}isIgnored(e){return this._ignored.has(e)}updateIgnored(e,t){let i=!1;this._ignored.has(e)&&!t?(this._ignored.delete(e),i=!0):!this._ignored.has(e)&&t&&(this._ignored.add(e),i=!0),i&&this._storageService.store(RJ._key,JSON.stringify(Array.from(this._ignored)),ke.PROFILE,ln.USER)}},RJ=bN,bN._key="snippets.ignoredSnippets",bN);Fye=RJ=D([_(0,on)],Fye);var CN;let Oye=(CN=class{constructor(e){this._storageService=e;const t=e.get(MJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{i=[]}this._usages=Array.isArray(i)?new Map(i):new Map}getUsageTimestamp(e){return this._usages.get(e)}updateUsageTimestamp(e){this._usages.delete(e),this._usages.set(e,Date.now());const t=[...this._usages].slice(-100);this._storageService.store(MJ._key,JSON.stringify(t),ke.PROFILE,ln.USER)}},MJ=CN,CN._key="snippets.usageTimestamps",CN);Oye=MJ=D([_(0,on)],Oye);let Bye=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=s,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new wi,this._pendingWork.push(Promise.resolve(l.when(Us.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),JNt(new Pye(this._languageService,this,h)),this._enablement=d.createInstance(Fye),this._usageTimestamps=d.createInstance(Oye)}dispose(){this._disposables.dispose()}isEnabled(e){return!this._enablement.isIgnored(e.snippetIdentifier)}updateEnablement(e,t){this._enablement.updateIgnored(e.snippetIdentifier,!t)}updateUsageTimestamp(e){this._usageTimestamps.updateUsageTimestamp(e.snippetIdentifier)}_joinSnippets(){const e=this._pendingWork.slice(0);return this._pendingWork.length=0,Promise.all(e)}async getSnippetFiles(){return await this._joinSnippets(),this._files.values()}async getSnippets(e,t){await this._joinSnippets();const i=[],s=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())s.push(o.load().then(r=>r.select(e,i)).catch(r=>this._logService.error(r,o.location.toString())))}else for(const o of this._files.values())s.push(o.load().then(r=>qqe(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(s),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const s of this._files.values())s.load().catch(o=>{}),s.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const s of e)!s.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(s)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==s.isFileTemplate||i.push(s);return i.sort((s,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(s.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(s,o)),r})}_compareSnippet(e,t){return e.snippetSourcet.snippetSource?1:e.sourcet.source||e.name>t.name?1:e.name{for(const[t,i]of this._files)i.source===Yg.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const s=Pte.toValidSnippet(t,i,this._languageService);if(!s)continue;const o=this._files.get(s.location);if(o)o.defaultScopes?o.defaultScopes.push(s.language):o.defaultScopes=[];else{const r=new cpe(Yg.Extension,s.location,s.language?[s.language]:void 0,t.description,this._fileService,this._extensionResourceLoaderService);this._files.set(r.location,r),this._environmentService.isExtensionDevelopment&&r.load().then(a=>{a.data.some(c=>c.isBogous)&&t.collector.warn(g(xA,7,"One or more snippets from the extension '{0}' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)",t.description.name))},a=>{t.collector.warn(g(xA,8,'The snippet file "{0}" could not be read.',r.location.toString()))})}}})}_initWorkspaceSnippets(){const e=new Z,t=()=>{e.clear(),this._pendingWork.push(this._initWorkspaceFolderSnippets(this._contextService.getWorkspace(),e))};this._disposables.add(e),this._disposables.add(this._contextService.onDidChangeWorkspaceFolders(t)),this._disposables.add(this._contextService.onDidChangeWorkbenchState(t)),t()}async _initWorkspaceFolderSnippets(e,t){const i=e.folders.map(async s=>{const o=s.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Yg.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,Ko.ADDED)&&this._initFolderSnippets(Yg.Workspace,o,t)}))});await Promise.all(i)}async _initUserSnippets(){const e=new Z,t=async()=>{e.clear();const i=this._userDataProfileService.currentProfile.snippetsHome;await this._fileService.createFolder(i),await this._initFolderSnippets(Yg.User,i,e)};this._disposables.add(e),this._disposables.add(this._userDataProfileService.onDidChangeCurrentProfile(i=>i.join((async()=>{this._pendingWork.push(t())})()))),await t()}_initFolderSnippets(e,t,i){const s=new Z,o=async()=>{if(s.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])s.add(this._addSnippetFile(a.resource,e))}catch(r){this._logService.error(`Failed snippets from folder '${t.toString()}'`,r)}};return i.add(this._textfileService.files.onDidSave(r=>{MS(r.model.resource,t)&&o()})),i.add(cFt(this._fileService,t,o)),i.add(s),o()}_addSnippetFile(e,t){const i=uz(e);if(t===Yg.User&&i===".json"){const s=ui(e).replace(/\.json/,"");this._files.set(e,new cpe(t,e,[s],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new cpe(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};Bye=D([_(0,Il),_(1,Rm),_(2,Ti),_(3,Di),_(4,Ze),_(5,ci),_(6,tr),_(7,CPe),_(8,mg),_(9,be),_(10,lo)],Bye);function lFt(n,e){const i=n.getLineContent(e.lineNumber).substr(0,e.column-1),s=Math.max(0,i.length-100);for(let o=i.length-1;o>=s;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return s===0?i:""}var NJ,u0;let Ux=(u0=class{static get(e){return e.getContribution(NJ.ID)}constructor(e,t,i,s,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=s,this._activeSnippets=[],this._hasSnippets=NJ.ContextKey.bindTo(o),this._configListener=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(x.tabCompletion)&&this._update()}),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose()}_update(){const e=this._editor.getOption(x.tabCompletion)==="onlySnippets";this._enabled!==e&&(this._enabled=e,this._enabled?(this._selectionListener=this._editor.onDidChangeCursorSelection(t=>this._updateSnippets()),this._editor.getModel()&&this._updateSnippets()):this._selectionListener?.dispose())}_updateSnippets(){if(this._activeSnippets=[],this._completionProvider?.dispose(),!this._editor.hasModel())return;const e=this._editor.getSelection(),t=this._editor.getModel();t.tokenization.tokenizeIfCheap(e.positionLineNumber);const i=t.getLanguageIdAtPosition(e.positionLineNumber,e.positionColumn),s=this._snippetService.getSnippetsSync(i);if(!s){this._hasSnippets.set(!1);return}if(O.isEmpty(e)){const r=lFt(t,e.getPosition());if(r)for(const a of s)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!O.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of s)r===a.prefix&&this._activeSnippets.push(a)}const o=this._activeSnippets.length;if(o===0)this._hasSnippets.set(!1);else if(o===1)this._hasSnippets.set(!0);else{this._hasSnippets.set(!0),this._completionProvider={_debugDisplayName:"tabCompletion",dispose:()=>{r.dispose()},provideCompletionItems:(a,c)=>a!==t||!e.containsPosition(c)?void 0:{suggestions:this._activeSnippets.map(d=>{const h=O.fromPositions(c.delta(0,-d.prefix.length),c);return new T3(d,h)})}};const r=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme},this._completionProvider)}}async performSnippetCompletions(){if(this._editor.hasModel())if(this._activeSnippets.length===1){const[e]=this._activeSnippets;let t;if(e.needsClipboard){const i=new Bde(this._editor,hr.Value|hr.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}mc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&ott(this._editor,this._completionProvider)}},NJ=u0,u0.ID="editor.tabCompletionController",u0.ContextKey=new Y("hasSnippetCompletions",void 0),u0);Ux=NJ=D([_(1,$_),_(2,Mu),_(3,ht),_(4,Pe)],Ux);vn(Ux.ID,Ux,mi.Eager);const dFt=Jc.bindToContribution(Ux.get);Ke(new dFt({id:"insertSnippet",precondition:Ux.ContextKey,handler:n=>n.performSnippetCompletions(),kbOpts:{weight:ye.EditorContrib,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus,mc.InSnippetMode.toNegated()),primary:E.Tab}}));const hA="vs/workbench/contrib/comments/common/commentContextKeys";var Qv;(function(n){n.activeCursorHasCommentingRange=new Y("activeCursorHasCommentingRange",!1,{description:g(hA,0,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),n.activeEditorHasCommentingRange=new Y("activeEditorHasCommentingRange",!1,{description:g(hA,1,"Whether the active editor has a commenting range"),type:"boolean"}),n.WorkspaceHasCommenting=new Y("workspaceHasCommenting",!1,{description:g(hA,2,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),n.commentThreadIsEmpty=new Y("commentThreadIsEmpty",!1,{type:"boolean",description:g(hA,3,"Set when the comment thread has no comments")}),n.commentIsEmpty=new Y("commentIsEmpty",!1,{type:"boolean",description:g(hA,4,"Set when the comment has no input")}),n.commentContext=new Y("comment",void 0,{type:"string",description:g(hA,5,"The context value of the comment")}),n.commentThreadContext=new Y("commentThread",void 0,{type:"string",description:g(hA,6,"The context value of the comment thread")}),n.commentControllerContext=new Y("commentController",void 0,{type:"string",description:g(hA,7,"The comment controller id associated with a comment thread")}),n.commentFocused=new Y("commentFocused",!1,{type:"boolean",description:g(hA,8,"Set when the comment is focused")})})(Qv||(Qv={}));function HQ(n){return{asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function hFt(n,e,t){const i={id:Dr(),name:n,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class fhe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return fi.some(this,([i,s])=>s.asFile())&&t.push("files"),wtt(Fte(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Fte(e)}}function Fte(n){return n.toLowerCase()}function vtt(n,e){return wtt(Fte(n),e.map(Fte))}function wtt(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const R1=Object.freeze({create:n=>Tc(n.map(e=>e.toString())).join(`\r -`),split:n=>n.split(`\r -`),parse:n=>R1.split(n).filter(e=>!e.startsWith("#"))}),ZC=class ZC{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ZC.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ZC((this.value?[this.value,...e]:e).join(ZC.sep))}};ZC.sep=".",ZC.None=new ZC("@@none@@"),ZC.Empty=new ZC("");let bs=ZC;var Tv;(function(n){function e(o){return typeof o?.showDirectoryPicker=="function"}n.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}n.isFileSystemHandle=t;function i(o){return o.kind==="file"}n.isFileSystemFileHandle=i;function s(o){return o.kind==="directory"}n.isFileSystemDirectoryHandle=s})(Tv||(Tv={}));const x4e="vs/platform/files/browser/htmlFileSystemProvider";class uFt{get capabilities(){return this._capabilities||(this._capabilities=es.FileReadWrite|es.FileReadStream,jr&&(this._capabilities|=es.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.extUri=jr?Fn:Gle,this._files=new Map,this._directories=new Map}async stat(e){try{const t=await this.getHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, stat",rt.FileNotFound);if(Tv.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:an.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:an.Directory,mtime:0,ctime:0,size:0}}catch(t){throw this.toFileSystemProviderError(t)}}async readdir(e){try{const t=await this.getDirectoryHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readdir",rt.FileNotFound);const i=[];for await(const[s,o]of t)i.push([s,Tv.isFileSystemFileHandle(o)?an.File:an.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer,{highWaterMark:10});return(async()=>{try{const o=await this.getFileHandle(e);if(!o)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const r=await o.getFile();if(typeof t.length=="number"||typeof t.position=="number"){let a=new Uint8Array(await r.arrayBuffer());typeof t?.position=="number"&&(a=a.slice(t.position)),typeof t?.length=="number"&&(a=a.slice(0,t.length)),s.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await s.write(c.value),i.isCancellationRequested));)c=await a.read();s.end(void 0)}}catch(o){s.error(this.toFileSystemProviderError(o)),s.end()}})(),s}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const i=await t.getFile();return new Uint8Array(await i.arrayBuffer())}catch(t){throw this.toFileSystemProviderError(t)}}async writeFile(e,t,i){try{let s=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(s){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",rt.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",rt.FileNotFound)}if(!s){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",rt.FileNotFound);if(s=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!s)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",rt.Unknown)}const o=await s.createWritable();await o.write(t),await o.close()}catch(s){throw this.toFileSystemProviderError(s)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",rt.FileNotFound);await t.getDirectoryHandle(this.extUri.basename(e),{create:!0})}catch(t){throw this.toFileSystemProviderError(t)}}async delete(e,t){try{const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(!i)throw this.createFileSystemProviderError(e,"No such parent directory, delete",rt.FileNotFound);return i.removeEntry(this.extUri.basename(e),{recursive:t.recursive})}catch(i){throw this.toFileSystemProviderError(i)}}async rename(e,t,i){try{if(this.extUri.isEqual(e,t))return;const s=await this.getFileHandle(e);if(s){const o=await s.getFile(),r=new Uint8Array(await o.arrayBuffer());await this.writeFile(t,r,{create:!0,overwrite:i.overwrite,unlock:!1,atomic:!1}),await this.delete(e,{recursive:!1,useTrash:!1,atomic:!1})}else throw this.createFileSystemProviderError(e,g(x4e,0,"Rename is only supported for files."),rt.Unavailable)}catch(s){throw this.toFileSystemProviderError(s)}}watch(e,t){return $.None}registerFileHandle(e){return this.registerHandle(e,this._files)}registerDirectoryHandle(e){return this.registerHandle(e,this._directories)}get directories(){return this._directories.values()}async registerHandle(e,t){let i=`/${e.name}`;if(t.has(i)&&!await t.get(i)?.isSameEntry(e)){const s=T_(e.name),o=yr(e.name,s);let r=1;do i=`/${o}-${r++}${s}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",s=>s.put(e,i))}catch(s){this.logService.error(s)}return P.from({scheme:_e.file,path:i})}async getHandle(e){let t=await this.doGetHandle(e);if(!t){const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(i){const s=Fn.basename(e);try{t=await i.getFileHandle(s)}catch{try{t=await i.getDirectoryHandle(s)}catch{}}}}return t}async getFileHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemFileHandle)return t;const i=await this.getDirectoryHandle(this.extUri.dirname(e));try{return await i?.getFileHandle(Fn.basename(e))}catch{return}}async getDirectoryHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemDirectoryHandle)return t;const i=this.extUri.dirname(e);if(this.extUri.isEqual(i,e))return;const s=await this.getDirectoryHandle(i);try{return await s?.getDirectoryHandle(Fn.basename(e))}catch{return}}async doGetHandle(e){if(this.extUri.dirname(e).path!=="/")return;const t=e.path.replace(/\/$/,""),i=this._files.get(t)??this._directories.get(t);if(i)return i;const s=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(Tv.isFileSystemHandle(s)){let o=await s.queryPermission()==="granted";try{o||(o=await s.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return Tv.isFileSystemFileHandle(s)?this._files.set(t,s):Tv.isFileSystemDirectoryHandle(s)&&this._directories.set(t,s),s}throw this.createFileSystemProviderError(e,"No file system handle registered",rt.Unavailable)}toFileSystemProviderError(e){if(e instanceof Nx)return e;let t=rt.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(x4e,1,"Insufficient permissions. Please retry and allow the operation.")),t=rt.Unavailable),xs(e,t)}createFileSystemProviderError(e,t,i){return xs(new Error(`${t} (${d1(e.path)})`),i)}}const gFt="vs/platform/dnd/browser/dnd",bF={EDITORS:"CodeEditors",FILES:"CodeFiles"};function fFt(n){const e=[];if(n.dataTransfer&&n.dataTransfer.types.length>0){const s=n.dataTransfer.getData(bF.EDITORS);if(s)try{e.push(...JU(s))}catch{}else try{const a=n.dataTransfer.getData(fm.RESOURCES);e.push(...pFt(a))}catch{}if(n.dataTransfer?.files)for(let a=0;amFt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function pFt(n){const e=[];if(n){const t=JSON.parse(n);for(const i of t)if(i.indexOf(":")>0){const{selection:s,uri:o}=RNe(P.parse(i));e.push({resource:o,options:{selection:s}})}}return e}async function mFt(n,e){if(Tv.supported(yi)){const i=e.dataTransfer?.items;if(i)return _Ft(n,i)}const t=e.dataTransfer?.files;return t?vFt(n,t):[]}async function _Ft(n,e){const t=n.get(ci).getProvider(_e.file);if(!(t instanceof uFt))return[];const i=[];for(let s=0;s{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}Tv.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Tv.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Vi(await Promise.all(i.map(s=>s.p)))}async function vFt(n,e){const t=n.get(To),i=[];for(let s=0;s100*vl.MB){t.warn(g(gFt,0,"File is too large to open as untitled editor. Please upload it first into the file explorer and then try again."));continue}const r=new sd;i.push(r);const a=new FileReader;a.onerror=()=>r.complete(void 0),a.onabort=()=>r.complete(void 0),a.onload=async c=>{const l=o.name,d=c.target?.result??void 0;if(typeof l!="string"||typeof d>"u"){r.complete(void 0);return}r.complete({resource:P.from({scheme:_e.untitled,path:l}),contents:typeof d=="string"?ze.fromString(d):ze.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Vi(await Promise.all(i.map(s=>s.p)))}function Ctt(n,...e){if(!n.dataTransfer)return!1;const t=n.dataTransfer.types,i=[];for(let s=0;s=0)return!0;return!1}class wFt{constructor(){this._contributions=new Map}register(e){if(this._contributions.has(e.dataFormatKey))throw new Error(`A drag and drop contributiont with key '${e.dataFormatKey}' was already registered.`);this._contributions.set(e.dataFormatKey,e)}getAll(){return this._contributions.values()}}const sFe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};it.add(sFe.DragAndDropContribution,new wFt);const i9=class i9{constructor(){}static getInstance(){return i9.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}};i9.INSTANCE=new i9;let Ote=i9;function ytt(n){const e=new fhe;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,HQ(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,bFt(s))}}return e}function bFt(n){const e=n.path?P.parse(n.path):void 0;return hFt(n.name,e,async()=>new Uint8Array(await n.arrayBuffer()))}const CFt=Object.freeze([bF.EDITORS,bF.FILES,fm.RESOURCES,fm.INTERNAL_URI_LIST]);function Stt(n,e=!1){const t=ytt(n),i=t.get(fm.INTERNAL_URI_LIST);if(i)t.replace(Js.uriList,i);else if(e||!t.has(Js.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=r.path;try{a?s.push(P.file(a).toString()):s.push(P.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(Js.uriList,HQ(R1.create(s)))}for(const s of CFt)t.delete(s);return t}const dI="vs/editor/contrib/dropOrPasteInto/browser/defaultProviders";class oFe{async provideDocumentPasteEdits(e,t,i,s,o){const r=await this.getEdit(i,o);if(r)return{dispose(){},edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}]}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);return o?[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}]:void 0}}const q2=class q2 extends oFe{constructor(){super(...arguments),this.id=q2.id,this.kind=q2.kind,this.dropMimeTypes=[Js.text],this.pasteMimeTypes=[Js.text]}async getEdit(e,t){const i=e.get(Js.text);if(!i||e.has(Js.uriList))return;const s=await i.asString();return{handledMimeType:Js.text,title:g(dI,0,"Insert Plain Text"),insertText:s,kind:this.kind}}};q2.id="text",q2.kind=new bs("text.plain");let CF=q2;class Att extends oFe{constructor(){super(...arguments),this.kind=new bs("uri.absolute"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===_e.file?a.fsPath:(s++,c)).join(" ");let r;return s>0?r=i.length>1?g(dI,1,"Insert Uris"):g(dI,2,"Insert Uri"):r=i.length>1?g(dI,3,"Insert Paths"):g(dI,4,"Insert Path"),{handledMimeType:Js.uriList,insertText:o,title:r,kind:this.kind}}}let Bte=class extends oFe{constructor(e){super(),this._workspaceContextService=e,this.kind=new bs("uri.relative"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;const s=Vi(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?lO(r.uri,o):void 0}));if(s.length)return{handledMimeType:Js.uriList,insertText:s.join(" "),title:i.length>1?g(dI,5,"Insert Relative Paths"):g(dI,6,"Insert Relative Path"),kind:this.kind}}};Bte=D([_(0,Ti)],Bte);class yFt{constructor(){this.kind=new bs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Js.text}]}async provideDocumentPasteEdits(e,t,i,s,o){if(s.triggerKind!==x9.PasteAs&&!s.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:g(dI,7,"Insert HTML"),kind:this.kind}]}}}async function Ett(n){const e=n.get(Js.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of R1.parse(t))try{i.push({uri:P.parse(s),originalText:s})}catch{}return i}let Wye=class extends ${constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new CF)),this._register(e.documentDropEditProvider.register("*",new Att)),this._register(e.documentDropEditProvider.register("*",new Bte(t)))}};Wye=D([_(0,ht),_(1,Ti)],Wye);let Hye=class extends ${constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new CF)),this._register(e.documentPasteEditProvider.register("*",new Att)),this._register(e.documentPasteEditProvider.register("*",new Bte(t))),this._register(e.documentPasteEditProvider.register("*",new yFt))}};Hye=D([_(0,ht),_(1,Ti)],Hye);function xtt(n,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new vS(n,{range:i,text:typeof t.insertText=="string"?ww.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Dtt(n){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of n)for(const a of r.yieldTo??[])for(const c of n)if(c!==r&&e(a,c)){let l=t.get(r);l||(l=[],t.set(r,l)),l.push(c)}if(!t.size)return Array.from(n);const i=new Set,s=[];function o(r){if(!r.length)return[];const a=r[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let c=[];const l=t.get(a);return l&&(s.push(a),c=o(l),s.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(n))}var SFt=".inline-editor-progress-decoration{display:inline-block;height:1em;width:1em}.inline-progress-widget{align-items:center;display:flex!important;justify-content:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{animation:none;font-size:90%!important}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(SFt,{});const AFt=Kt.register({description:"inline-progress-widget",stickiness:gi.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:AQe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Yae=class Yae extends ${constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=we(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=we("span.icon");this.domNode.append(t),t.classList.add(...$e.asClassNameArray(Ce.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(x.fontSize)||s.hasChanged(x.lineHeight))&&i()})),this._register(pe(this.domNode,xe.CLICK,s=>{this.delegate.cancel()}))}getId(){return Yae.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[hs.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Yae.baseId="editor.widget.inlineProgressWidget";let Uye=Yae,Wte=class extends ${constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Dn),this._currentWidget=new Dn,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=PS(()=>{const o=O.fromPositions(e);this._currentDecorations.set([{range:o,options:AFt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Uye,this.id,this._editor,o,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Wte=D([_(2,be)],Wte);var EFt=".monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);padding:2px 4px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{border:8px solid transparent;height:0!important;left:2px;position:absolute;width:0!important;z-index:1000}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage.below .anchor.below,.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}";Ct(EFt,{});var PJ;const xFt="vs/editor/contrib/message/browser/messageController";var g0;let Du=(g0=class{static get(e){return e.getContribution(PJ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Dn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=PJ.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}isVisible(){return this._visible.get()}showMessage(e,t){sa(ah(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=ah(e)?mQ(e,{actionHandler:{callback:s=>{this.closeMessage(),vde(this._openerService,s,ah(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new D4e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(T.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&al(xl(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new O(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(D4e.fadeOut(this._messageWidget.value))}},PJ=g0,g0.ID="editor.contrib.messageController",g0.MESSAGE_VISIBLE=new Y("messageVisible",!1,g(xFt,0,"Whether the editor is currently showing an inline message")),g0);Du=PJ=D([_(1,Pe),_(2,fr)],Du);const DFt=Jc.bindToContribution(Du.get);Ke(new DFt({id:"leaveEditorMessage",precondition:Du.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:ye.EditorContrib+30,primary:E.Escape}}));let D4e=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,vt.Smooth),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.Right}}afterRender(e){this._domNode.classList.toggle("below",e===hs.BELOW)}};vn(Du.ID,Du,mi.Lazy);var ch;(function(n){n[n.Explorer=1]="Explorer",n[n.Scm=3]="Scm",n[n.Extensions=5]="Extensions",n[n.Window=10]="Window",n[n.Notification=15]="Notification",n[n.Dialog=20]="Dialog"})(ch||(ch={}));const SBe=class SBe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};SBe.None=Object.freeze({report(){}});let cf=SBe,k4e=class extends ${constructor(e,t){super(),this.deferred=new sd,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(Ee(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};k4e=D([_(1,Cf)],k4e);var kFt=".post-edit-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-widget-border,transparent);border-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);overflow:hidden}.post-edit-widget .monaco-button{border:none;border-radius:0;padding:2px}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}";Ct(kFt,{});var Vye;const I4e="vs/editor/contrib/dropOrPasteInto/browser/postEditWidget";var yN;let zye=(yN=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Ee(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ee(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(T.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=we(".post-edit-widget"),this.button=this._register(new Tu(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(pe(this.domNode,xe.CLICK,()=>this.showSelector()))}getId(){return Vye.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[hs.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=ia(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>_l({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Vye=yN,yN.baseId="editor.widget.postEditWidget",yN);zye=Vye=D([_(7,Vr),_(8,Pe),_(9,ti)],zye);let Hte=class extends ${constructor(e,t,i,s,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Dn),this._register(T.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const c=async v=>{const w=this._editor.getModel();w&&(await w.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,s,o))},l=(v,w)=>{Na(v)||(this._notificationService.error(w),i&&this.show(e[0],t,c))};let d;try{d=await s(a,o)}catch(v){return l(v,g(I4e,0,`Error resolving edit '{0}': -{1}`,a.title,Ma(v)))}if(o.isCancellationRequested)return;const h=xtt(r.uri,e,d),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(h,{editor:this._editor,token:o}),m=r.getDecorationRange(f[0])}catch(v){return l(v,g(I4e,1,`Error applying edit '{0}': -{1}`,a.title,Ma(v)))}finally{r.deltaDecorations(f,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,c)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(zye,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Hte=D([_(4,be),_(5,vO),_(6,Pi)],Hte);var YL;const CB="vs/editor/contrib/dropOrPasteInto/browser/copyPasteController",ktt="editor.changePasteType",rFe=new Y("pasteWidgetVisible",!1,g(CB,0,"Whether the paste widget is showing")),lpe="application/vnd.code.copyMetadata";var SN;let jS=(SN=class extends ${static get(e){return e.getContribution(YL.ID)}constructor(e,t,i,s,o,r,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(pe(c,"copy",l=>this.handleCopy(l))),this._register(pe(c,"cut",l=>this.handleCopy(l))),this._register(pe(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new Wte("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Hte,"pasteIntoEditor",e,rFe,{id:ktt,label:g(CB,1,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Kg().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(x.pasteAs).enabled&&!this._editor.getOption(x.readOnly)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(!this._editor.hasTextFocus()||(Jn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const s=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!s)return;o=[new O(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,s,Is),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=ytt(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=Dr();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=na(async m=>{const v=Vi(await Promise.all(d.map(async w=>{try{return await w.prepareDocumentPaste(t,o,h,m)}catch(b){console.error(b);return}})));v.reverse();for(const w of v)for(const[b,C]of w)h.replace(b,C);return h});YL._currentCopyOperation?.dataTransferPromise.cancel(),YL._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Du.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e),o=Stt(e.clipboardData);o.delete(lpe);const r=[...e.clipboardData.types,...s?.providerCopyMimeTypes??[],Js.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const l=this._pasteAsActionContext?.preferred;return l&&c.providedPasteEditKinds&&!this.providerMatchesPreference(c,l)?!1:c.pasteMimeTypes?.some(d=>vtt(d,r))});if(!a.length){this._pasteAsActionContext?.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,s):this.doPasteInline(a,i,o,s,e)}showPasteAsNoEditMessage(e,t){Du.get(this._editor)?.showMessage(g(CB,2,"No paste edits for '{0}' found",t instanceof bs?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(i,s,d.token),d.token.isCancellationRequested)return;const h=e.filter(p=>this.isSupportedPasteProvider(p,i));if(!h.length||h.length===1&&h[0]instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);const u={triggerKind:x9.Automatic},f=await this.getPasteEdits(h,i,l,t,u,d.token);if(d.token.isCancellationRequested)return;if(f.length===1&&f[0].provider instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);if(f.length){const p=c.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:f},p,async(m,v)=>{const w=await m.provider.resolveDocumentPasteEdit?.(m,v);return w&&(m.additionalEdit=w.additionalEdit),m},d.token)}await this.applyDefaultPasteHandler(i,s,d.token,o)}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(CB,3,"Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>this.isSupportedPasteProvider(v,s,e));e&&(h=h.filter(v=>this.providerMatchesPreference(v,e)));const u={triggerKind:x9.PasteAs,only:e&&e instanceof bs?e:void 0};let f=await this.getPasteEdits(h,s,l,i,u,d.token);if(d.token.isCancellationRequested)return;if(e&&(f=f.filter(v=>e instanceof bs?e.contains(v.kind):e.providerId===v.provider.id)),!f.length){u.only&&this.showPasteAsNoEditMessage(i,u.only);return}let p;if(e?p=f.at(0):p=(await this._quickInputService.pick(f.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(CB,4,"Select Paste Action")}))?.edit,!p)return;const m=xtt(l.uri,i,p);await this._bulkEditService.apply(m,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:ch.Window,title:g(CB,5,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(lpe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(lpe);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=gwe.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&YL._currentCopyOperation?.handle===t.id){const s=await YL._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of s)e.replace(o,r)}if(!e.has(Js.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(Js.uriList,HQ(R1.create(s)))}}async getPasteEdits(e,t,i,s,o,r){const a=await dw(Promise.all(e.map(async l=>{try{return(await l.provideDocumentPasteEdits?.(i,s,t,o,r))?.edits?.map(h=>({...h,provider:l}))}catch(d){console.error(d)}})),r),c=Vi(a??[]).flat().filter(l=>!o.only||o.only.contains(l.kind));return Dtt(c)}async applyDefaultPasteHandler(e,t,i,s){const r=await(e.get(Js.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",Uc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(s=>t.matches(s))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof bs?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},YL=SN,SN.ID="editor.contrib.copyPasteActionController",SN);jS=YL=D([_(1,be),_(2,vO),_(3,Mu),_(4,ht),_(5,On),_(6,Cf)],jS);const ls=new class{constructor(){this.QuickFix=new bs("quickfix"),this.Refactor=new bs("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new bs("notebook"),this.Source=new bs("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var th;(function(n){n.IfSingle="ifSingle",n.First="first",n.Never="never"})(th||(th={}));var _f;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(_f||(_f={}));function IFt(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>Itt(e,t,n.include))||!n.includeSourceActions&&ls.Source.contains(e))}function LFt(n,e){const t=e.kind?new bs(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>Itt(t,i,n.include))||!n.includeSourceActions&&t&&ls.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function Itt(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Ey{static fromUser(e,t){return!e||typeof e!="object"?new Ey(t.kind,t.apply,!1):new Ey(Ey.getKindFromUser(e,t.kind),Ey.getApplyFromUser(e,t.apply),Ey.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return th.First;case"never":return th.Never;case"ifsingle":return th.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new bs(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class TFt{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){er(i)}t&&(this.action.edit=t.edit)}return this}}const RFt="vs/editor/contrib/codeAction/browser/codeAction",aFe="editor.action.codeAction",cFe="editor.action.quickFix",Ltt="editor.action.autoFix",lFe="editor.action.refactor",dFe="editor.action.sourceAction",$ye="editor.action.organizeImports",Gye="editor.action.fixAll";class Y$ extends ${static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:mo(e.diagnostics)?mo(t.diagnostics)?Y$.codeActionsPreferredComparator(e,t):-1:mo(t.diagnostics)?1:Y$.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Y$.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ls.QuickFix.contains(new bs(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const L4e={actions:[],documentation:void 0};async function KW(n,e,t,i,s,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ls.Notebook]},c={only:r.include?.value,trigger:i.type},l=new hPe(e,o),d=i.type===wu.Auto,h=MFt(n,e,d?a:r),u=new Z,f=h.map(async m=>{try{s.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return L4e;const w=(v?.actions||[]).filter(C=>C&&LFt(r,C)),b=PFt(m,w,r.include);return{actions:w.map(C=>new TFt(C,m)),documentation:b}}catch(v){if(Na(v))throw v;return er(v),L4e}}),p=n.onDidChange(()=>{const m=n.all(e);Ls(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(b=>b.actions).flat(),w=[...Vi(m.map(b=>b.documentation)),...NFt(n,e,i,v)];return new Y$(v,w,u)}finally{p.dispose(),l.dispose()}}function MFt(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>IFt(t,new bs(s))):!0)}function*NFt(n,e,t,i){if(e&&i.length)for(const s of n.all(e))s._getAdditionalMenuItems&&(yield*s._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function PFt(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new bs(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s?.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new bs(s.kind)))return o.command}}var hI;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb"})(hI||(hI={}));async function Ttt(n,e,t,i,s=qe.None){const o=n.get(vO),r=n.get(ji),a=n.get(rn),c=n.get(Pi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(s),!s.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await o.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==hI.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=FFt(l);c.error(typeof d=="string"?d:g(RFt,0,"An unknown error occurred while applying the code action"))}}function FFt(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}yt.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof P))throw Ui();const{codeActionProvider:o}=n.get(ht),r=n.get(Ai).getModel(e);if(!r)throw Ui();const a=mt.isISelection(t)?mt.liftSelection(t):O.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Ui();const c=typeof i=="string"?new bs(i):void 0,l=await KW(o,r,a,{type:wu.Invoke,triggerAction:_f.Default,filter:{includeSourceActions:!0,include:c}},cf.None,qe.None),d=[],h=Math.min(l.validActions.length,typeof s=="number"?s:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var qye,AN;let Qye=(AN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ya(()=>this.keybindingService.getKeybindings().filter(t=>qye.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===$ye?i={kind:ls.SourceOrganizeImports.value}:t.command===Gye&&(i={kind:ls.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Ey.fromUser(i,{kind:bs.None,apply:th.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new bs(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}},qye=AN,AN.codeActionCommands=[lFe,aFe,dFe,$ye,Gye],AN);Qye=qye=D([_(0,ti)],Qye);var OFt='.action-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-editorWidget-border)!important;border-radius:0;border-radius:2px;color:var(--vscode-editorWidget-foreground);display:block;font-size:13px;max-width:80vw;min-width:160px;width:100%;z-index:40}.context-view-block{z-index:-1}.context-view-block,.context-view-pointerBlock{cursor:auto;height:100%;left:0;position:fixed;top:0;width:100%}.context-view-pointerBlock{z-index:2}.action-widget .monaco-list{border:0!important;user-select:none;-webkit-user-select:none}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{cursor:pointer;padding:0 10px;touch-action:none;white-space:nowrap;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before,.action-widget .monaco-list .option-disabled:before{-webkit-touch-callout:none;background-color:transparent!important;cursor:default!important;outline:0 solid!important;-webkit-user-select:none;user-select:none}.action-widget .monaco-list-row.action{align-items:center;display:flex;gap:6px}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{content:"";display:block;width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}';Ct(OFt,{});const Ute="vs/platform/actionWidget/browser/actionList",Rtt="acceptSelectedCodeAction",Mtt="previewSelectedCodeAction";var Rv;(function(n){n.Action="action",n.Header="header"})(Rv||(Rv={}));class BFt{get templateId(){return Rv.Header}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??""}disposeTemplate(e){}}let jye=class{get templateId(){return Rv.Action}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new Dz(e,$c);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=$e.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ye(e.group.icon.color.id))):(i.icon.className=$e.asClassName(Ce.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Ntt(e.label),i.keybinding.set(e.keybinding),_je(!!e.keybinding,i.keybinding.element);const s=this._keybindingService.lookupKeybinding(Rtt)?.getLabel(),o=this._keybindingService.lookupKeybinding(Mtt)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:s&&o?this._supportsPreview&&e.canPreview?i.container.title=g(Ute,0,"{0} to Apply, {1} to Preview",s,o):i.container.title=g(Ute,1,"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};jye=D([_(1,ti)],jye);class WFt extends UIEvent{constructor(){super("acceptSelectedAction")}}class T4e extends UIEvent{constructor(){super("previewSelectedAction")}}function HFt(n){if(n.kind==="action")return n.label}let Kye=class extends ${constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ai),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===Rv.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Fc(e,this.domNode,a,[new jye(t,this._keybindingService),new BFt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:HFt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===Rv.Action){let l=c.label?Ntt(c?.label):"";return c.disabled&&(l=g(Ute,2,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(Ute,3,"Action Widget"),getRole:c=>c.kind===Rv.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(bO),this._register(this._list.onMouseClick(c=>this.onListClick(c))),this._register(this._list.onMouseOver(c=>this.onListHover(c))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(c=>this.onListSelection(c))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind===Rv.Action}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);let o=e;if(this._allMenuItems.length>=50)o=380;else{const c=this._allMenuItems.map((l,d)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(d));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});o=Math.max(...c,e)}const a=Math.min(s,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new T4e:new WFt;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof T4e):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind===Rv.Action){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Kye=D([_(4,W_),_(5,ti)],Kye);function Ntt(n){return n.replace(/\r\n|\r|\n/g," ")}const RD="vs/editor/contrib/codeAction/browser/codeActionMenu",Ptt=Object.freeze({kind:bs.Empty,title:g(RD,0,"More Actions...")}),UFt=Object.freeze([{kind:ls.QuickFix,title:g(RD,1,"Quick Fix")},{kind:ls.RefactorExtract,title:g(RD,2,"Extract"),icon:Ce.wrench},{kind:ls.RefactorInline,title:g(RD,3,"Inline"),icon:Ce.wrench},{kind:ls.RefactorRewrite,title:g(RD,4,"Rewrite"),icon:Ce.wrench},{kind:ls.RefactorMove,title:g(RD,5,"Move"),icon:Ce.wrench},{kind:ls.SurroundWith,title:g(RD,6,"Surround With"),icon:Ce.surroundWith},{kind:ls.Source,title:g(RD,7,"Source Action"),icon:Ce.symbolFile},Ptt]);function VFt(n,e,t){if(!e)return n.map(o=>({kind:Rv.Action,item:o,group:Ptt,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=UFt.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new bs(o.action.kind):bs.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:Rv.Header,group:o.group});for(const r of o.actions){const a=o.group;s.push({kind:Rv.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:Ce.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return s}var zFt='.monaco-editor .lightBulbWidget{align-items:center;display:flex;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{background-color:var(--vscode-editor-background);content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}';Ct(zFt,{});var Yye;const NK="vs/editor/contrib/codeAction/browser/lightBulbWidget";var ib;(function(n){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=n.Type||(n.Type={})),n.Hidden={type:e.Hidden};class t{constructor(s,o,r,a){this.actions=s,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}n.Showing=t})(ib||(ib={}));var f0;let J7=(f0=class extends ${constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=ib.Hidden,this._iconClasses=[],this._domNode=we("div.lightBulbWidget"),this._domNode.role="listbox",this._register(dh.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(s=>{const o=this._editor.getModel();(this.state.type!==ib.Type.Showing||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(Mut(this._domNode,s=>{if(this.state.type!==ib.Type.Showing)return;this._editor.focus(),s.preventDefault();const{top:o,height:r}=ia(this._domNode),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(s.buttons&1)===1&&this.hide()})),this._register(T.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(Ltt)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(cFe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===ib.Type.Showing?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(x.lightbulb).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),c=o.getOptions().tabSize,l=this._editor.getOptions().get(x.fontInfo),d=o.getLineContent(r),h=dde(d,c),u=l.spaceWidth*h>22,f=b=>b>2&&this._editor.getTopForLineNumber(b)===this._editor.getTopForLineNumber(b-1);let p=r,m=1;if(!u){if(r>1&&!f(r-1))p-=1;else if(ro,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}clear(){this._list.clear()}_renderWidget(e,t,i){const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new Z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(pe(a,xe.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(pe(l,xe.POINTER_MOVE,()=>l.remove())),o.add(pe(l,xe.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);s.style.width=`${h}px`;const u=o.add(Dd(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=we(e),s=new Qh(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){this._list.value?.hide(e)}};SF=D([_(0,W_),_(1,Pe),_(2,be)],SF);ce(DO,SF,Yt.Delayed);const UQ=ye.EditorContrib+1e3;At(class extends pi{constructor(){super({id:"hideCodeActionWidget",title:Be(xO,2,"Hide action widget"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Escape,secondary:[V.Shift|E.Escape]}})}run(n){n.get(DO).hide(!0)}});At(class extends pi{constructor(){super({id:"selectPrevCodeAction",title:Be(xO,3,"Select previous action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusPrevious()}});At(class extends pi{constructor(){super({id:"selectNextCodeAction",title:Be(xO,4,"Select next action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusNext()}});At(class extends pi{constructor(){super({id:Rtt,title:Be(xO,5,"Accept selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Enter,secondary:[V.CtrlCmd|E.Period]}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected()}});At(class extends pi{constructor(){super({id:Mtt,title:Be(xO,6,"Preview selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:V.CtrlCmd|E.Enter}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected(!0)}});const Ftt=new Y("supportedCodeAction",""),R4e="_typescript.applyFixAllCodeAction";class $Ft extends ${constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new O_),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>_n(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:wu.Auto,triggerAction:_f.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===wu.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==bv.Off){{if(i===bv.On)return t;if(i===bv.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),c=o.getLineContent(r);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var ab;(function(n){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=n.Type||(n.Type={})),n.Empty={type:e.Empty};class t{constructor(s,o,r){this.trigger=s,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Na(a))return Ott;throw a})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=t})(ab||(ab={}));const Ott=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class GFt extends ${constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Dn),this._state=ab.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Ftt.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.lightbulb)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(ab.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(ab.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(x.readOnly)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new $Ft(this._editor,this._markerService,i=>{if(!i){this.setState(ab.Empty);return}const s=i.selection.getStartPosition(),o=na(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===wu.Invoke&&(i.trigger.triggerAction===_f.QuickFix||i.trigger.filter?.include?.contains(ls.QuickFix))){const l=await KW(this._registry,e,i.selection,i.trigger,cf.None,c),d=[...l.allActions];if(c.isCancellationRequested)return Ott;const h=l.validActions?.some(f=>f.action.kind?ls.QuickFix.contains(new bs(f.action.kind)):!1),u=this._markerService.read({resource:e.uri});if(h){for(const f of l.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(R4e))&&(f.action.diagnostics=[...u.filter(p=>p.relatedInformation)]);return{validActions:l.validActions,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}else if(!h&&u.length>0){const f=i.selection.getPosition();let p=f,m=Number.MAX_VALUE;const v=[...l.validActions];for(const b of u){const C=b.endColumn,y=b.endLineNumber,S=b.startLineNumber;if(y===f.lineNumber||S===f.lineNumber){p=new oe(y,C);const M={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ls.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new mt(p.lineNumber,p.column,p.lineNumber,p.column),F=await KW(this._registry,e,k,M,cf.None,c);if(F.validActions.length!==0){for(const N of F.validActions)N.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(R4e))&&(N.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...F.allActions),Math.abs(f.column-C)y.findIndex(S=>S.action.title===b.action.title)===C);return w.sort((b,C)=>b.action.isPreferred&&!C.action.isPreferred?-1:!b.action.isPreferred&&C.action.isPreferred||b.action.isAI&&!C.action.isAI?1:!b.action.isAI&&C.action.isAI?-1:0),{validActions:w,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return KW(this._registry,e,i.selection,i.trigger,cf.None,c)});i.trigger.type===wu.Invoke&&this._progressService?.showWhile(o,250);const r=new ab.Triggered(i.trigger,s,o);let a=!1;this._state.type===ab.Type.Triggered&&(a=this._state.trigger.type===wu.Invoke&&r.type===ab.Type.Triggered&&r.trigger.type===wu.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:wu.Auto,triggerAction:_f.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===ab.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var yB;const dpe="vs/editor/contrib/codeAction/browser/codeActionController",qFt="quickfix-edit-highlight";var p0;let AF=(p0=class extends ${static get(e){return e.getContribution(yB.ID)}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._telemetryService=h,this._activeCodeActions=this._register(new Dn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new GFt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ya(()=>{const u=this._editor.getContribution(J7.ID);return u&&this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u}),this._resolver=s.createInstance(Qye),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(this._telemetryService.publicLog2("codeAction.showCodeActionsFromLightbulb",{codeActionListLength:e.validActions.length,codeActions:e.validActions.map(i=>i.action.title),codeActionProviders:e.validActions.map(i=>i.provider?.displayName??"")}),e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,hI.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}hideCodeActions(){this._actionWidgetService.hide()}manualTriggerAtCurrentPosition(e,t,i,s){if(!this._editor.hasModel())return;Du.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:wu.Invoke,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,s){try{await this._instantiationService.invokeFunction(Ttt,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:wu.Auto,triggerAction:_f.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide()}async update(e){if(e.type!==ab.Type.Triggered){this._lightBulbWidget.rawValue?.hide();return}let t;try{t=await e.actions}catch(i){bt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===wu.Invoke){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this._lightBulbWidget.value?.hide(),await this._applyCodeAction(s,!1,!1,hI.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Du.get(this._editor)?.showMessage(o.action.disabled,e.trigger.context.position),t.dispose();return}}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length)){Du.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===th.First&&t.validActions.length===0||e.autoApply===th.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===th.First&&t.validActions.length>0||e.autoApply===th.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=oe.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?hI.FromAILightbulb:hI.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:l=>{this._editor?.focus(),s.clear(),i.fromLightbulb&&l!==void 0&&this._telemetryService.publicLog2("codeAction.showCodeActionList.onHide",{codeActionListLength:e.validActions.length,didCancel:l,codeActions:e.validActions.map(d=>d.action.title)})},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new bs(u);h=[ls.RefactorExtract,ls.RefactorInline,ls.RefactorRewrite,ls.RefactorMove,ls.Source].some(m=>m.contains(f))}return{canPreview:h||!!l.action.edit?.edits.length}},onFocus:l=>{if(l&&l.action){const d=l.action.ranges,h=l.action.diagnostics;if(s.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:yB.DECORATION})):d.map(f=>({range:f,options:yB.DECORATION}));s.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:yB.DECORATION}));s.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Cu(g(dpe,0,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,VFt(r,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,vt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=ia(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:g(dpe,1,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(dpe,2,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},yB=p0,p0.ID="editor.contrib.codeActionController",p0.DECORATION=Kt.register({description:"quickfix-highlight",className:qFt}),p0);AF=yB=D([_(1,U_),_(2,Pe),_(3,be),_(4,ht),_(5,eD),_(6,ji),_(7,Re),_(8,DO),_(9,be),_(10,rn)],AF);Lm((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Fb));const i=n.getColor(Uk);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${pS(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Jye;const Xye="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController",Btt="editor.experimental.dropIntoEditor.defaultProvider",Wtt="editor.changeDropType",hFe=new Y("dropWidgetVisible",!1,g(Xye,0,"Whether the drop widget is showing"));var EN;let EF=(EN=class extends ${static get(e){return e.getContribution(Jye.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=Ote.getInstance(),this._dropProgressManager=this._register(t.createInstance(Wte,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(Hte,"dropIntoEditor",e,hFe,{id:Wtt,label:g(Xye,1,"Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;this._currentOperation?.cancel(),e.focus(),e.setPosition(t);const s=na(async o=>{const r=new I1(e,hr.Value,void 0,o);try{const a=await this.extractDataTransferData(i);if(a.size===0||r.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const l=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(u=>a.matches(u)):!0),d=await this.getDropEdits(l,c,t,a,r);if(r.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),u=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([O.fromPositions(t)],{activeEditIndex:h,allEdits:d},u,async f=>f,o)}}finally{r.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(Xye,2,"Running drop handlers. Click to cancel"),s),this._currentOperation=s}async getDropEdits(e,t,i,s,o){const r=await dw(Promise.all(e.map(async c=>{try{return(await c.provideDocumentDropEdits(t,i,s,o.token))?.map(d=>({...d,providerId:c.id}))}catch(l){console.error(l)}})),o.token),a=Vi(r??[]).flat();return Dtt(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Btt,{resource:e.uri});for(const[s,o]of Object.entries(i)){const r=new bs(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&vtt(s,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new fhe;const t=Stt(e.dataTransfer);if(this.treeItemsTransfer.hasData(pVe.prototype)){const i=this.treeItemsTransfer.getData(pVe.prototype);if(Array.isArray(i))for(const s of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Jye=EN,EN.ID="editor.contrib.dropIntoEditorController",EN);EF=Jye=D([_(1,be),_(2,Re),_(3,ht),_(4,zde)],EF);var QFt=".monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}";Ct(QFt,{});function Zye(n,e){return!!n[e]}class hpe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Zye(e.event,t.triggerModifier),this.hasSideBySideModifier=Zye(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class M4e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Zye(e,t.triggerModifier)}}class PK{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function N4e(n){return n==="altKey"?ei?new PK(E.Meta,"metaKey",E.Alt,"altKey"):new PK(E.Ctrl,"ctrlKey",E.Alt,"altKey"):ei?new PK(E.Alt,"altKey",E.Meta,"metaKey"):new PK(E.Alt,"altKey",E.Ctrl,"ctrlKey")}class phe extends ${constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new I),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new I),this.onExecute=this._onExecute.event,this._onCancel=this._register(new I),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=N4e(this._editor.getOption(x.multiCursorModifier)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(x.multiCursorModifier)){const s=N4e(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new hpe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new hpe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new hpe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new M4e(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new M4e(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}let jFt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class Vte{constructor(e){this._disposables=new Z;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new jFt(r,s));t=Vte._union(t,o),cz(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;sPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},er));return Promise.all(s).then(()=>{const o=new Vte(Vi(i));return t.isCancellationRequested?(o.dispose(),new Vte([])):o})}yt.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;Bt(t instanceof P),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)return[];const r=await Htt(s,o,qe.None);if(!r)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new phe(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(x.links)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(x.links))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=na(t=>Htt(this.providers,e,t));try{const t=new ao(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){bt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(YW.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(x.multiCursorModifier)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(qe.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===_e.file&&o.startsWith(`${_e.file}:`)){const a=P.parse(o);if(a.scheme===_e.file){const c=fv(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=Qt(r,l))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(g(sy,0,"Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(g(sy,1,"Failed to open this link because its target is missing.")):bt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===Mt.CONTENT_TEXT&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},eSe=xN,xN.ID="editor.linkDetector",xN);yV=eSe=D([_(1,fr),_(2,Pi),_(3,ht),_(4,B_)],yV);const P4e={general:Kt.register({description:"detected-link",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Kt.register({description:"detected-link-active",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class YW{static decoration(e,t){return{range:e.range,options:YW._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?P4e.active:P4e.general};return s.hoverMessage=KFt(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!1))}}function KFt(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?g(sy,2,"Execute command"):g(sy,3,"Follow link"),s=e?ei?g(sy,4,"cmd + click"):g(sy,5,"ctrl + click"):ei?g(sy,6,"option + click"):g(sy,7,"alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(sy,8,"Execute command {0}",c)}}return new Xt("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${s})`)}else return new Xt().appendText(`${i} (${s})`)}class YFt extends lt{constructor(){super({id:"editor.action.openLink",label:g(sy,9,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yV.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}vn(yV.ID,yV,mi.AfterFirstRender);Fe(YFt);const mhe="editor.contrib.selectionClipboard",Utt="vs/editor/contrib/hover/browser/hoverActionIds",Vtt="editor.action.showHover",JFt="editor.action.showDefinitionPreviewHover",XFt="editor.action.scrollUpHover",ZFt="editor.action.scrollDownHover",eOt="editor.action.scrollLeftHover",tOt="editor.action.scrollRightHover",iOt="editor.action.pageUpHover",nOt="editor.action.pageDownHover",sOt="editor.action.goToTopHover",oOt="editor.action.goToBottomHover",VQ="editor.action.increaseHoverVerbosityLevel",rOt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",aOt=g(Utt,0,"Increase Hover Verbosity Level"),zQ="editor.action.decreaseHoverVerbosityLevel",cOt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",lOt=g(Utt,1,"Decrease Hover Verbosity Level");var Fd;(function(n){n[n.Idle=0]="Idle",n[n.FirstWait=1]="FirstWait",n[n.SecondWait=2]="SecondWait",n[n.WaitingForAsync=3]="WaitingForAsync",n[n.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Fd||(Fd={}));var KS;(function(n){n[n.Delayed=0]="Delayed",n[n.Immediate=1]="Immediate"})(KS||(KS={}));var Vx;(function(n){n[n.Mouse=0]="Mouse",n[n.Keyboard=1]="Keyboard"})(Vx||(Vx={}));let dOt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class ztt extends ${constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new yn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new yn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new yn(()=>this._triggerLoadingMessage(),0)),this._state=Fd.Idle,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(x.hover).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(Fd.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=nut(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===Fd.WaitingForAsync||this._state===Fd.WaitingForAsyncShowingLoading)&&this._setState(Fd.Idle)}catch(e){bt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Fd.Idle:Fd.WaitingForAsync)}_triggerLoadingMessage(){this._state===Fd.WaitingForAsync&&this._setState(Fd.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Fd.FirstWait||this._state===Fd.SecondWait)return;const e=this._state===Fd.Idle,t=this._state===Fd.WaitingForAsyncShowingLoading;this._onResult.fire(new dOt(this._result.slice(0),e,t))}start(e){if(e===KS.Delayed)this._state===Fd.Idle&&(this._setState(Fd.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Fd.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Fd.SecondWait:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(Fd.Idle,!1)}}const hOt=30,uOt=24;class gOt extends ${constructor(e,t=new Tn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new ZPe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Tn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Tn(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?oe.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:ia(t).top+i.top-hOt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=ia(t),o=uw(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-uOt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(s,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=s?hs.ABOVE:hs.BELOW:a=r<=i?hs.BELOW:hs.ABOVE,a===hs.ABOVE?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var DC;const F4e=30,fOt=6;var m0;let zte=(m0=class extends gOt{get isColorPickerVisible(){return!!this._visibleData?.colorPicker}get isVisibleFromKeyboard(){return this._visibleData?.source===Vx.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new Tn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new fNe),this._minimumSize=c,this._hoverVisibleKey=X.hoverVisible.bindTo(t),this._hoverFocusedKey=X.hoverFocused.bindTo(t),he(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(x.fontInfo)&&this._updateFont()}));const l=this._register(Dd(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._visibleData?.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return DC.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return DC._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return DC._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){DC._applyMaxDimensions(this._hover.contentsDomNode,e,t),DC._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Tn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){DC._lastDimensions=new Tn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._visibleData?.colorPicker?.layout()}_findAvailableSpaceVertically(){const e=this._visibleData?.showAtPosition;if(e)return this._positionPreference===hs.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=fOt;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=ia(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=O4e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=O4e(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){this._visibleData?.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(x.fontInfo),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,DC._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,DC._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?jo.LeftOfInjectedText:void 0,preference:[this._positionPreference??hs.ABOVE]}:null}showAt(e,t){if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const i=Zf(this._hover.containerDomNode),s=t.showAtPosition;this._positionPreference=this._findPositionPreference(i,s)??hs.ABOVE,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker?.layout();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+r)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Tn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}setMinimumDimensions(e){this._minimumSize=new Tn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Tn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=Zf(e),i=du(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Zf(e),i=du(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._visibleData?.showAtPosition){const s=Zf(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-F4e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+F4e})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},DC=m0,m0.ID="editor.contrib.resizableContentHoverWidget",m0._lastDimensions=new Tn(0,0),m0);zte=DC=D([_(1,Pe),_(2,Re),_(3,Ur),_(4,ti)],zte);function O4e(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,c=Math.max(Math.abs(n-r)-s/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var ku;(function(n){n[n.Range=1]="Range",n[n.ForeignElement=2]="ForeignElement"})(ku||(ku={}));class upe{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=ku.Range}equals(e){return e.type===ku.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===ku.Range&&t.lineNumber===this.range.startLineNumber}}class bM{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=ku.ForeignElement}equals(e){return e.type===ku.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===ku.ForeignElement&&this.owner===e.owner}}const hL=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pOt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function mOt(n,e,t,i,s){const o=await Promise.resolve(n.provideHover(t,i,s)).catch(er);if(!(!o||!vOt(o)))return new pOt(n,o,e)}function uFe(n,e,t,i){const o=n.ordered(e).map((r,a)=>mOt(r,a,e,t,i));return tg.fromPromises(o).coalesce()}function _Ot(n,e,t,i){return uFe(n,e,t,i).map(s=>s.hover).toPromise()}nA("_executeHoverProvider",(n,e,t)=>{const i=n.get(ht);return _Ot(i.hoverProvider,e,t,qe.None)});function vOt(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}const NE="vs/editor/contrib/hover/browser/markdownHoverParticipant",h2=we,wOt=Ki("hover-increase-verbosity",Ce.add,g(NE,0,"Icon for increaseing hover verbosity.")),bOt=Ki("hover-decrease-verbosity",Ce.remove,g(NE,1,"Icon for decreasing hover verbosity."));class xb{constructor(e,t,i,s,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class $tt{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Yl.Increase:return this.hover.canIncreaseVerbosity??!1;case Yl.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let X7=class{constructor(e,t,i,s,o,r,a){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new xb(this,e.range,[new Xt().appendText(g(NE,2,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const c=i.getLineLength(s),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(x.stopRenderingLineAfter),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let u=!1;d>=0&&c>d&&e.range.startColumn>=d&&(u=!0,r.push(new xb(this,e.range,[{value:g(NE,3,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&c>=h&&r.push(new xb(this,e.range,[{value:g(NE,4,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const p of t){const m=p.range.startLineNumber===s?p.range.startColumn:1,v=p.range.endLineNumber===s?p.range.endColumn:o,w=p.options.hoverMessage;if(!w||YU(w))continue;p.options.beforeContentClassName&&(f=!0);const b=new O(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new xb(this,b,Kb(w),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==ku.Range)return tg.EMPTY;const s=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(s)?this._getMarkdownHovers(o,s,e,i):tg.EMPTY}_getMarkdownHovers(e,t,i,s){const o=i.range.getStartPosition();return uFe(e,t,o,s).filter(c=>!YU(c.hover.contents)).map(c=>{const l=c.hover.range?O.lift(c.hover.range):i.range,d=new $tt(c.hover,c.provider,o);return new xb(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new COt(t,e.fragment,this._editor,this._languageService,this._openerService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}markdownHoverContentAtIndex(e){return this._renderedHoverParts?.markdownHoverContentAtIndex(e)??""}focusedMarkdownHoverIndex(){return this._renderedHoverParts?.focusedMarkdownHoverIndex()??1}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i)}};X7=D([_(1,Di),_(2,fr),_(3,Re),_(4,ht),_(5,ti),_(6,el)],X7);class COt extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._editor=i,this._languageService=s,this._openerService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=c,this._onFinishedRendering=l,this._focusedHoverPartIndex=-1,this._ongoingHoverOperations=new Map,this._renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._register(Ee(()=>{this._renderedHoverParts.forEach(d=>{d.disposables.dispose()})})),this._register(Ee(()=>{this._ongoingHoverOperations.forEach(d=>{d.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(El(s=>s.ordinal,cg)),e.map((s,o)=>{const r=this._renderHoverPart(o,s.contents,s.source,i);return t.appendChild(r.renderedMarkdown),r})}_renderHoverPart(e,t,i,s){const{renderedMarkdown:o,disposables:r}=this._renderMarkdownContent(t,s);if(!i)return{renderedMarkdown:o,disposables:r};const a=i.supportsVerbosityAction(Yl.Increase),c=i.supportsVerbosityAction(Yl.Decrease);if(!a&&!c)return{renderedMarkdown:o,disposables:r,hoverSource:i};const l=h2("div.verbosity-actions");return o.prepend(l),r.add(this._renderHoverExpansionAction(l,Yl.Increase,a)),r.add(this._renderHoverExpansionAction(l,Yl.Decrease,c)),this._register(pe(o,xe.FOCUS_IN,d=>{d.stopPropagation(),this._focusedHoverPartIndex=e})),this._register(pe(o,xe.FOCUS_OUT,d=>{d.stopPropagation(),this._focusedHoverPartIndex=-1})),{renderedMarkdown:o,disposables:r,hoverSource:i}}_renderMarkdownContent(e,t){const i=h2("div.hover-row");i.tabIndex=0;const s=h2("div.hover-row-contents");i.appendChild(s);const o=new Z;return o.add(Gtt(this._editor,s,e,this._languageService,this._openerService,t)),{renderedMarkdown:i,disposables:o}}_renderHoverExpansionAction(e,t,i){const s=new Z,o=t===Yl.Increase,r=he(e,h2($e.asCSSSelector(o?wOt:bOt)));r.tabIndex=0;const a=new gF("mouse",!1,{target:e,position:{hoverPosition:Oo.LEFT}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupUpdatableHover(a,r,qtt(this._keybindingService,t))),!i)return r.classList.add("disabled"),s;r.classList.add("enabled");const c=()=>this.updateMarkdownHoverPartVerbosityLevel(t);return s.add(new WYe(r,c)),s.add(new HYe(r,c,[E.Enter,E.Space])),s}async updateMarkdownHoverPartVerbosityLevel(e,t=-1,i=!0){const s=this._editor.getModel();if(!s)return;const o=t!==-1?t:this._focusedHoverPartIndex,r=this._getRenderedHoverPartAtIndex(o);if(!r||!r.hoverSource?.supportsVerbosityAction(e))return;const a=r.hoverSource,c=await this._fetchHover(a,s,e);if(!c)return;const l=new $tt(c,a.hoverProvider,a.hoverPosition),d=this._renderHoverPart(o,c.contents,l,this._onFinishedRendering);this._replaceRenderedHoverPartAtIndex(o,d),i&&this._focusOnHoverPartWithIndex(o),this._onFinishedRendering()}markdownHoverContentAtIndex(e){return this._getRenderedHoverPartAtIndex(e)?.renderedMarkdown.innerText??""}focusedMarkdownHoverIndex(){return this._focusedHoverPartIndex}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e);return!(!i||!i.hoverSource?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let s=i===Yl.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),s+=r.verbosityDelta);const a=new ai;this._ongoingHoverOperations.set(o,{verbosityDelta:s,tokenSource:a});const c={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){er(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t){if(e>=this._renderHoverParts.length||e<0)return;const i=this._renderedHoverParts[e];i.renderedMarkdown.replaceWith(t.renderedMarkdown),i.disposables.dispose(),this._renderedHoverParts[e]=t}_focusOnHoverPartWithIndex(e){this._renderedHoverParts[e].renderedMarkdown.focus()}_getRenderedHoverPartAtIndex(e){return this._renderedHoverParts[e]}}function yOt(n,e,t,i,s){e.sort(El(r=>r.ordinal,cg));const o=new Z;for(const r of e)o.add(Gtt(t,n.fragment,r.contents,i,s,n.onContentsChanged));return o}function Gtt(n,e,t,i,s,o){const r=new Z;for(const a of t){if(YU(a))continue;const c=h2("div.markdown-hover"),l=he(c,h2("div.hover-contents")),d=r.add(new vw({editor:n},i,s));r.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",o()}));const h=r.add(d.render(a));l.appendChild(h.element),e.appendChild(c)}return r}function qtt(n,e){switch(e){case Yl.Increase:{const t=n.lookupKeybinding(VQ);return t?g(NE,5,"Increase Hover Verbosity ({0})",t.getLabel()):g(NE,6,"Increase Hover Verbosity")}case Yl.Decrease:{const t=n.lookupKeybinding(zQ);return t?g(NE,7,"Decrease Hover Verbosity ({0})",t.getLabel()):g(NE,8,"Decrease Hover Verbosity")}}}class Qtt{constructor(e,t){this.range=e,this.direction=t}}class gFe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new gFe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){er(t),this._isResolved=!1}}}const Q2=class Q2{static async create(e,t,i,s){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,s);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??Q2._emptyInlayHintList,a])}catch(l){er(l)}}));if(await Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Rc;return new Q2(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const c=i.validatePosition(a.position);let l="before";const d=Q2._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=O.fromPositions(d.getStartPosition(),c),l="after"):(h=O.fromPositions(c,d.getEndPosition()),l="before"),s.push(new gFe(a,new Qtt(h,l),r))}}this.items=s.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new O(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let c=o.getStartOffset(a),l=o.getEndOffset(a);return l-c===1&&(c===r&&a>1?(c=o.getStartOffset(a-1),l=o.getEndOffset(a-1)):l===r&&a{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),c=r.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(_n(h.uri,a.uri))l=!0,d=d||O.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=pa(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:O.collapseToStart(t.range),selectionRevealType:px.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(tSe,1,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(tSe,2,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};iSe=D([_(0,Pe),_(1,jt),_(2,Pi),_(3,ti)],iSe);ce(_he,iSe,Yt.Delayed);Ke(new class extends Jc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:fFe,kbOpts:{weight:ye.EditorContrib,primary:E.F12}})}runEditorCommand(n,e){return n.get(_he).revealNext(e)}});xr.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:ye.EditorContrib,when:fFe,primary:E.Escape,handler(n){n.get(_he).reset()}});let nSe=class{constructor(e){this._listener=new Map,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),St(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,pa(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};nSe=D([_(0,jt)],nSe);function sSe(n,e){return e.uri.scheme===n.uri.scheme?!0:!L9(e.uri,_e.walkThroughSnippet,_e.vscodeChatCodeBlock,_e.vscodeChatCodeCompareBlock,_e.vscodeCopilotBackingChatCodeBlock)}async function $Q(n,e,t,i){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,c=>{er(c)})),r=await Promise.all(o);return Vi(r.flat()).filter(a=>sSe(n,a))}function vhe(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function Ktt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function Ytt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function Jtt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function whe(n,e,t,i,s){return $Q(e,t,n,async(o,r,a)=>{const c=(await o.provideReferences(r,a,{includeDeclaration:!0},s))?.filter(d=>sSe(r,d));if(!i||!c||c.length!==2)return c;const l=(await o.provideReferences(r,a,{includeDeclaration:!1},s))?.filter(d=>sSe(r,d));return l&&l.length===1?l:c})}async function GQ(n){const e=await n(),t=new fp(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}nA("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=vhe(i.definitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=Jtt(i.typeDefinitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(ht),s=Ktt(i.declarationProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeReferenceProvider",(n,e,t)=>{const i=n.get(ht),s=whe(i.referenceProvider,e,t,!1,qe.None);return GQ(()=>s)});nA("_executeImplementationProvider",(n,e,t)=>{const i=n.get(ht),s=Ytt(i.implementationProvider,e,t,qe.None);return GQ(()=>s)});const po="vs/editor/contrib/gotoSymbol/browser/goToCommands";Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextPeek,title:g(po,0,"Peek"),group:"navigation",order:100});class SV{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof SV||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const gv=class gv extends wf{static all(){return gv._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of fi.wrap(t.menu))(i.id===Te.EditorContext||i.id===Te.EditorContextPeek)&&(i.when=ge.and(e.precondition,i.when));return t}constructor(e,t){super(gv._patchConfig(t)),this.configuration=e,gv._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Pi),r=e.get(jt),a=e.get(eD),c=e.get(_he),l=e.get(ht),d=e.get(be),h=t.getModel(),u=t.getPosition(),f=SV.is(i)?i:new SV(h,u),p=new I1(t,hr.Value|hr.Position),m=dw(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;sa(v.ariaMessage);let w;if(v.referenceAt(h.uri,u)){const C=this._getAlternativeCommand(t);!gv._activeAlternativeCommands.has(C)&&gv._allSymbolNavigationCommands.has(C)&&(w=gv._allSymbolNavigationCommands.get(C))}const b=v.references.length;if(b===0){if(!this.configuration.muteMessage){const C=h.getWordAtPosition(u);Du.get(t)?.showMessage(this._getNoResultFoundMessage(C),u)}}else if(b===1&&w)gv._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(C=>w.runEditorCommand(C,t,i,s).finally(()=>{gv._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,s)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,s,o){const r=this._getGoToPreference(i);if(!(i instanceof oC)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),c=s.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,s,o):s.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,s,o){let r;if(BQe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:O.collapseToStart(r),selectionRevealType:px.NearTopIfOutsideViewport,selectionSource:jb.JUMP}},e,s);if(a){if(o){const c=a.getModel(),l=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const s=wF.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),na(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};gv._allSymbolNavigationCommands=new Map,gv._activeAlternativeCommands=new Set;let zx=gv;class qQ extends zx{async _getLocationModel(e,t,i,s){return new fp(await vhe(e.definitionProvider,t,i,s),g(po,1,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,2,"No definition found for '{0}'",e.word):g(po,3,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var _0;At((_0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:_0.id,title:{...Be(po,4,"Go to Definition"),mnemonicTitle:g(po,5,"Go to &&Definition")},precondition:X.hasDefinitionProvider,keybinding:[{when:X.editorTextFocus,primary:E.F12,weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib}],menu:[{id:Te.EditorContext,group:"navigation",order:1.1},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),yt.registerCommandAlias("editor.action.goToDeclaration",_0.id)}},_0.id="editor.action.revealDefinition",_0));var v0;At((v0=class extends qQ{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:v0.id,title:Be(po,6,"Open Definition to the Side"),precondition:ge.and(X.hasDefinitionProvider,X.isInEmbeddedEditor.toNegated()),keybinding:[{when:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,E.F12),weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.F12),weight:ye.EditorContrib}]}),yt.registerCommandAlias("editor.action.openDeclarationToTheSide",v0.id)}},v0.id="editor.action.revealDefinitionAside",v0));var w0;At((w0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:w0.id,title:Be(po,7,"Peek Definition"),precondition:ge.and(X.hasDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Alt|E.F12,linux:{primary:V.CtrlCmd|V.Shift|E.F10},weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:2}}),yt.registerCommandAlias("editor.action.previewDeclaration",w0.id)}},w0.id="editor.action.peekDefinition",w0));class Xtt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ktt(e.declarationProvider,t,i,s),g(po,8,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var DN;At((DN=class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:DN.id,title:{...Be(po,11,"Go to Declaration"),mnemonicTitle:g(po,12,"Go to &&Declaration")},precondition:ge.and(X.hasDeclarationProvider,X.isInEmbeddedEditor.toNegated()),menu:[{id:Te.EditorContext,group:"navigation",order:1.3},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}},DN.id="editor.action.revealDeclaration",DN));At(class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Be(po,13,"Peek Declaration"),precondition:ge.and(X.hasDeclarationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:3}})}});class Ztt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Jtt(e.typeDefinitionProvider,t,i,s),g(po,14,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,15,"No type definition found for '{0}'",e.word):g(po,16,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var kN;At((kN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kN.ID,title:{...Be(po,17,"Go to Type Definition"),mnemonicTitle:g(po,18,"Go to &&Type Definition")},precondition:X.hasTypeDefinitionProvider,keybinding:{when:X.editorTextFocus,primary:0,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.4},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},kN.ID="editor.action.goToTypeDefinition",kN));var IN;At((IN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:IN.ID,title:Be(po,19,"Peek Type Definition"),precondition:ge.and(X.hasTypeDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:4}})}},IN.ID="editor.action.peekTypeDefinition",IN));class eit extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ytt(e.implementationProvider,t,i,s),g(po,20,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,21,"No implementation found for '{0}'",e.word):g(po,22,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var LN;At((LN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:LN.ID,title:{...Be(po,23,"Go to Implementations"),mnemonicTitle:g(po,24,"Go to &&Implementations")},precondition:X.hasImplementationProvider,keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},LN.ID="editor.action.goToImplementation",LN));var TN;At((TN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TN.ID,title:Be(po,25,"Peek Implementations"),precondition:ge.and(X.hasImplementationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F12,weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:5}})}},TN.ID="editor.action.peekImplementation",TN));class tit extends zx{_getNoResultFoundMessage(e){return e?g(po,26,"No references found for '{0}'",e.word):g(po,27,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Be(po,28,"Go to References"),mnemonicTitle:g(po,29,"Go to &&References")},precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Shift|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!0,s),g(po,30,"References"))}});At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Be(po,31,"Peek References"),precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!1,s),g(po,30,"References"))}});class SOt extends zx{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Be(po,32,"Go to Any Symbol"),precondition:ge.and(mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new fp(this._references,g(po,33,"Locations"))}_getNoResultFoundMessage(e){return e&&g(po,34,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}yt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(n,e,t,i,s,o,r)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t)),Bt(Array.isArray(i)),Bt(typeof s>"u"||typeof s=="string"),Bt(typeof r>"u"||typeof r=="boolean");const a=n.get(jt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Ka(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,vt.Smooth),c.invokeWithinContext(l=>{const d=new class extends SOt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);l.get(be).invokeFunction(d.run.bind(d),c)})}});yt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(n,e,t,i,s)=>{n.get(ji).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});yt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t));const i=n.get(ht),s=n.get(jt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!Ka(o)||!o.hasModel())return;const r=wF.get(o);if(!r)return;const a=na(l=>whe(i.referenceProvider,o.getModel(),oe.lift(t),!1,l).then(d=>new fp(d,g(po,30,"References")))),c=new O(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});yt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function AOt(n,e,t,i){const s=n.get(Rn),o=n.get(Vr),r=n.get(ji),a=n.get(be),c=n.get(Pi);if(await i.item.resolve(qe.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(Xs.getMenuItems(Te.EditorContext).map(f=>lR(f)?f.command.id:Dr()));for(const f of zx.all())h.has(f.desc.id)&&d.push(new xn(f.desc.id,id.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await s.createModelReference(l.uri);try{const m=new SV(p.object.textEditorModel,O.getStartPosition(l.range)),v=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,m,v)}finally{p.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Kr),d.push(new xn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:nt.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=ia(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function iit(n,e,t,i){const o=await n.get(Rn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Pe),l=mf.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new qQ({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new SV(o.object.textEditorModel,O.getStartPosition(i.range)),O.lift(i.range))}),o.dispose()}var SB;class Gte{constructor(){this._entries=new L_(50)}get(e){const t=Gte._key(e);return this._entries.get(t)}set(e,t){const i=Gte._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const nit=ae("IInlayHintsCache");ce(nit,Gte,Yt.Delayed);class oSe{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class EOt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var DA;(function(n){n[n.Normal=0]="Normal",n[n.Invisible=1]="Invisible"})(DA||(DA={}));var KE;let AV=(KE=class{static get(e){return e.getContribution(SB.ID)??void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new PZ(this._editor),this._activeRenderMode=DA.Normal,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(c=>{c.hasChanged(x.inlayHints)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(x.inlayHints);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=DA.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=DA.Normal,c=DA.Invisible):(a=DA.Invisible,c=DA.Normal),this._activeRenderMode=a,this._sessionDisposables.add(Nb.getInstance().event(l=>{if(!this._editor.hasModel())return;const d=l.altKey&&l.ctrlKey&&!(l.shiftKey||l.metaKey)?c:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const h=this._editor.getModel(),u=this._copyInlayHintsWithCurrentAnchor(h);this._updateHintsDecorators([h.getFullModelRange()],u),r.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Ee(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set,r=new yn(async()=>{const a=Date.now();s?.dispose(!0),s=new ai;const c=t.onWillDispose(()=>s?.cancel());try{const l=s.token,d=await $te.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(r.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!o.has(h)&&(o.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){bt(l)}finally{s.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>s?.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{s?.cancel();const c=Math.max(r.delay,1250);r.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new phe(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ai;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new EOt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new O(l,1,l,a.getLineMaxColumn(l)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Ee(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(iit,s,this._editor,r.location):uZ.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(qe.None),mo(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>ds.replace(O.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Ra(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(AOt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Mt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof m1&&t?.attachedData instanceof oSe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:nt.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new Qtt(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(O.compareRangesUsingStarts)){const r=t.validateRange(new O(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!O.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=O.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){const i=[],s=(p,m,v,w,b)=>{const C={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:w,attachedData:b};i.push({item:p,classNameRef:m,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:gi.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===DA.Normal?C:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});s(p,v," ",m?Bv.Right:Bv.None)},{fontSize:r,fontFamily:a,padding:c,isUniform:l}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,a);let h={line:0,totalLen:0};for(const p of t){if(h.line!==p.anchor.range.startLineNumber&&(h={line:p.anchor.range.startLineNumber,totalLen:0}),h.totalLen>SB._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&o(p,!1);const m=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v0&&(S=S.slice(0,-k)+"…",M=!0),s(p,this._ruleFactory.createClassNameRef(y),xOt(S),C&&!p.hint.paddingRight?Bv.Right:Bv.None,new oSe(p,v)),M)break}if(p.hint.paddingRight&&o(p,!0),i.length>SB._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(w=>w.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=M_.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}getInlayHintsForLine(e){if(!this._editor.hasModel())return[];const t=new Set,i=[];for(const s of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(s.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},SB=KE,KE.ID="editor.contrib.InlayHints",KE._MAX_DECORATORS=1500,KE._MAX_LABEL_LEN=43,KE);AV=SB=D([_(1,ht),_(2,B_),_(3,nit),_(4,ji),_(5,Pi),_(6,be)],AV);function xOt(n){return n.replace(/[ \t]/g," ")}yt.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const{inlayHintsProvider:s}=n.get(ht),o=await n.get(Rn).createModelReference(t);try{const r=await $te.create(s,o.object.textEditorModel,[O.lift(i)],qe.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});const bD="vs/editor/contrib/inlayHints/browser/inlayHintsHover";class B4e extends bM{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let qte=class extends X7{constructor(e,t,i,s,o,r,a,c){super(e,t,i,r,c,s,o),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!AV.get(this._editor)||e.target.type!==Mt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof m1&&i.attachedData instanceof oSe?new B4e(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof B4e?new tg(async s=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Xt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&s.emitOne(new xb(this,e.range,[r],!1,0)),mo(o.item.hint.textEdits)&&s.emitOne(new xb(this,e.range,[new Xt().appendText(g(bD,0,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Xt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&s.emitOne(new xb(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?ei?g(bD,1,"cmd + click"):g(bD,2,"ctrl + click"):ei?g(bD,3,"option + click"):g(bD,4,"alt + click");o.part.location&&o.part.command?l=new Xt().appendText(g(bD,5,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Xt().appendText(g(bD,6,"Go to Definition ({0})",h)):o.part.command&&(l=new Xt(`[${g(bD,7,"Execute Command")}](${jtt(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&s.emitOne(new xb(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)s.emitOne(l)}):tg.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return tg.EMPTY;const{uri:i,range:s}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?uFe(this._languageFeaturesService.hoverProvider,r,new oe(s.startLineNumber,s.startColumn),t).filter(a=>!YU(a.hover.contents)).map(a=>new xb(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):tg.EMPTY}finally{o.dispose()}}};qte=D([_(1,Di),_(2,fr),_(3,ti),_(4,el),_(5,Re),_(6,Rn),_(7,ht)],qte);class Qte{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=Vx.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==ku.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,c=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>c)return!1}else if(a>t.range.startColumn||t.range.endColumn>c)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return tg.EMPTY;const i=Qte._getLineDecorations(this._editor,t);return tg.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):tg.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Qte._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Vi(t)}}class sit{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new DOt(this,this.anchor,t,this.isComplete)}}class DOt extends sit{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class kOt{constructor(e,t,i,s,o,r,a,c,l,d){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=i,this.showAtPosition=s,this.showAtSecondaryPosition=o,this.preferAbove=r,this.stoleFocus=a,this.source=c,this.isBeforeContent=l,this.disposables=d,this.closestMouseDistance=void 0}}const W4e=we;let jte=class extends ${get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=W4e("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=he(this.hoverElement,W4e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(pNe.render(this.actionsElement,e,i))}append(e){const t=he(this.actionsElement,e);return this._hasContent=!0,t}};jte=D([_(0,ti)],jte);var FJ,RN;let rSe=(RN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new I),this.onContentsChanged=this._onContentsChanged.event,this._widget=this._register(this._instantiationService.createInstance(zte,this._editor)),this._participants=[];for(const s of hL.getAll()){const o=this._instantiationService.createInstance(s,this._editor);o instanceof X7&&!(o instanceof qte)&&(this._markdownHoverParticipant=o),this._participants.push(o)}this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new Qte(this._editor,this._participants),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new sit(this._computer.anchor,o,s.isComplete))})),this._register(Xo(this._widget.getDomNode(),"keydown",s=>{s.equals(E.Escape)&&this.hide()})),this._register(dc.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(x.hover).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=FJ.computeHoverRanges(this._editor,e.range,t),r=new Z,a=r.add(new jte(this._keybindingService)),c=document.createDocumentFragment();let l=null;const d={fragment:c,statusBar:a,setColorPicker:u=>l=u,onContentsChanged:()=>this._doOnContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const f=t.filter(p=>p.owner===u);f.length>0&&r.add(u.renderHoverParts(d,f))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&c.appendChild(a.hoverElement),c.hasChildNodes()){if(o){const u=this._editor.createDecorationsCollection();u.set([{range:o,options:FJ._DECORATION_OPTIONS}]),r.add(Ee(()=>{u.clear()}))}this._widget.showAt(c,new kOt(e.initialMousePosX,e.initialMousePosY,l,i,s,this._editor.getOption(x.hover).above,this._computer.shouldFocus,this._computer.source,h,r))}else r.dispose()}_doOnContentsChanged(){this._onContentsChanged.fire(),this._widget.onContentsChanged()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const h=e._getViewModel(),u=h.coordinatesConverter,f=u.convertModelRangeToViewRange(t),p=new oe(f.startLineNumber,h.getLineMinColumn(f.startLineNumber));s=u.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,c=null;for(const h of i)a=O.plusRange(a,h.range),h.range.startLineNumber===o&&h.range.endLineNumber===o&&(r=Math.max(Math.min(r,h.range.startColumn),s)),h.forceShowAtRange&&(c=h.range);const l=c?c.getStartPosition():new oe(o,t.startColumn),d=c?c.getStartPosition():new oe(o,r);return{showAtPosition:l,showAtSecondaryPosition:d,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===Mt.CONTENT_TEXT&&t.push(new upe(0,i.range,e.event.posx,e.event.posy)),i.type===Mt.CONTENT_EMPTY){const s=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],KS.Delayed,Vx.Mouse,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new upe(0,e,void 0,void 0),t,i,s,null)}async updateMarkdownHoverVerbosityLevel(e,t,i){this._markdownHoverParticipant?.updateMarkdownHoverVerbosityLevel(e,t,i)}focusedMarkdownHoverIndex(){return this._markdownHoverParticipant?.focusedMarkdownHoverIndex()??-1}markdownHoverContentAtIndex(e){return this._markdownHoverParticipant?.markdownHoverContentAtIndex(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._markdownHoverParticipant?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}getWidgetContent(){const e=this._widget.getDomNode();if(e.textContent)return e.textContent}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}},FJ=RN,RN._DECORATION_OPTIONS=Kt.register({description:"content-hover-highlight",className:"hoverHighlight"}),RN);rSe=FJ=D([_(1,be),_(2,ti)],rSe);var IOt=".monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover-content{box-sizing:border-box;padding-bottom:2px;padding-right:2px}.monaco-editor .monaco-hover{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{display:flex;flex-direction:column;min-width:0}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);display:flex;flex-direction:column;justify-content:end;padding-left:5px;padding-right:5px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}";Ct(IOt,{});class LOt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=FS.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],s=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??FS.Center;if(!s&&r!==this._laneOrLine)continue;const a=s?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||YU(a)||i.push(...Kb(a).map(e))}return i}}const H4e=we,Jae=class Jae extends ${constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new fNe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new vw({editor:this._editor},t,i)),this._computer=new LOt(this._editor),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Jae.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(KS.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Mt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Mt.GUTTER_LINE_NUMBERS?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(KS.Delayed))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=H4e("div.hover-row.markdown-hover"),r=he(o,H4e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2,c=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};Jae.ID="editor.contrib.modesGlyphHoverWidget";let Kte=Jae;var aSe;const TOt=!1;var u2;(function(n){n[n.Content=0]="Content",n[n.Glyph=1]="Glyph"})(u2||(u2={}));var MN;let Pc=(MN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new I),this.onHoverContentsChanged=this._onHoverContentsChanged.event,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Z,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new yn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(aSe.ID)}_hookListeners(){const e=this._editor.getOption(x.hover);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return!!(this._isMouseOnContentHoverWidget(e)||this._isMouseOnMarginHoverWidget(e)||this._isContentWidgetResizing())}_isMouseOnMarginHoverWidget(e){const t=e.target;return t?t.type===Mt.OVERLAY_WIDGET&&t.detail===Kte.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Mt.CONTENT_WIDGET&&t.detail===zte.ID:!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(a,c)=>{const l=this._isMouseOnMarginHoverWidget(a);return c&&l},s=(a,c)=>{const l=this._isMouseOnContentHoverWidget(a);return c&&l},o=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},r=(a,c)=>c&&this._contentWidget?.containsNode(a.event.browserEvent.view?.document.activeElement)&&!a.event.browserEvent.view?.getSelection()?.isCollapsed;return!!(i(e,t)||s(e,t)||o(e)||r(e,t))}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._contentWidget?.isFocused||this._contentWidget?.isResizing))return;const t=this._hoverSettings.sticky;if(t&&this._contentWidget?.isVisibleFromKeyboard)return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const s=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&s>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(s);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),s=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(s==="click"&&!r||s==="hover"&&!o&&!TOt||s==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,u2.Content)||this._tryShowHoverWidget(e,u2.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),s=this._getOrCreateGlyphWidget();let o,r;switch(t){case u2.Content:o=i,r=s;break;case u2.Glyph:o=s,r=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=o.showsOrWillShow(e);return a&&r.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===hp.MoreChordsNeeded||t.kind===hp.KbFound&&(t.commandId===Vtt||t.commandId===VQ||t.commandId===zQ)&&this._contentWidget?.isVisible;e.keyCode===E.Ctrl||e.keyCode===E.Alt||e.keyCode===E.Meta||e.keyCode===E.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||vV.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(rSe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(Kte,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,s,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedMarkdownHoverIndex(){return this._getOrCreateContentWidget().focusedMarkdownHoverIndex()}markdownHoverContentAtIndex(e){return this._getOrCreateContentWidget().markdownHoverContentAtIndex(e)}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)}updateMarkdownHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateMarkdownHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}getWidgetContent(){return this._contentWidget?.getWidgetContent()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose(),this._contentWidget?.dispose()}},aSe=MN,MN.ID="editor.contrib.hover",MN);Pc=aSe=D([_(1,be),_(2,ti)],Pc);const ROt=new Y("commentEditorFocused",!1),J$=5*18,MOt=25*18;let EV=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={contributions:[{id:Hx.ID,ctor:Hx,instantiation:mi.BeforeFirstInteraction},{id:QS.ID,ctor:QS,instantiation:mi.BeforeFirstInteraction},{id:mm.ID,ctor:mm,instantiation:mi.Eager},{id:mc.ID,ctor:mc,instantiation:mi.Lazy},{id:Ux.ID,ctor:Ux,instantiation:mi.Eager},{id:qS.ID,ctor:qS,instantiation:mi.Lazy},...b_.getSomeEditorContributions([jS.ID,EF.ID,yV.ID,Du.ID,Pc.ID,mhe,_g.ID,AF.ID])],contextMenuId:Te.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=ROt.bindTo(i),this._commentEditorEmpty=Qv.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=s,this._register(this.onDidFocusEditorWidget(p=>this._commentEditorFocused.set(!0))),this._register(this.onDidChangeModelContent(p=>this._commentEditorEmpty.set(!this.getModel()?.getValueLength()))),this._register(this.onDidBlurEditorWidget(p=>this._commentEditorFocused.reset()))}getParentThread(){return this._parentThread}_getActions(){return b_.getEditorActions()}static getEditorOptions(e){return{wordWrap:"on",glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,scrollbar:{vertical:"visible",verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,lineDecorationsWidth:0,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},dropIntoEditor:{enabled:!0},autoClosingBrackets:e.getValue("editor.autoClosingBrackets"),quickSuggestions:!1,accessibilitySupport:e.getValue("editor.accessibilitySupport")}}};EV=D([_(4,be),_(5,jt),_(6,ji),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],EV);function oit(n,e,t){const i=e.getLayoutInfo(),s=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*s;if(o>i.height||oJ$){const r=Math.ceil((o-i.height)/s),a=i.height+s*r;return kc(a,J$,kc(n.getLayoutInfo().height-90,J$,MOt))}return t}var $A;(function(n){n.Add="workbench.action.addComment",n.NextThread="editor.action.nextCommentThreadAction",n.PreviousThread="editor.action.previousCommentThreadAction",n.NextRange="editor.action.nextCommentingRange",n.PreviousRange="editor.action.previousCommentingRange",n.ToggleCommenting="workbench.action.toggleCommenting",n.Submit="editor.action.submitComment",n.Hide="workbench.action.hideComment",n.CollapseAll="workbench.action.collapseAllComments",n.ExpandAll="workbench.action.expandAllComments",n.ExpandUnresolved="workbench.action.expandUnresolvedComments"})($A||($A={}));const FK="vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode",Xae=class Xae extends pi{constructor(){super({id:Xae.ID,title:Be(FK,0,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:V.CtrlCmd|E.KeyM,mac:{primary:V.WinCtrl|V.Shift|E.KeyM},weight:ye.EditorContrib},metadata:{description:Be(FK,1,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!g1.getTabFocusMode();g1.setTabFocusMode(t),sa(t?g(FK,2,"Pressing Tab will now move focus to the next focusable element"):g(FK,3,"Pressing Tab will now insert the tab character"))}};Xae.ID="editor.action.toggleTabFocusMode";let Yte=Xae;At(Yte);const CC="vs/workbench/contrib/comments/browser/commentsAccessibility";var ek;(function(n){n.intro=g(CC,0,"The editor contains commentable range(s). Some useful commands include:"),n.tabFocus=g(CC,1,"This widget contains a text area, for composition of new comments, and actions, that can be tabbed to once tab moves focus mode has been enabled with the command Toggle Tab Key Moves Focus{0}",``),n.commentCommands=g(CC,2,"Some useful comment commands include:"),n.escape=g(CC,3,"- Dismiss Comment (Escape)"),n.nextRange=g(CC,4,"- Go to Next Commenting Range{0}",``),n.previousRange=g(CC,5,"- Go to Previous Commenting Range{0}",``),n.nextCommentThread=g(CC,6,"- Go to Next Comment Thread{0}",``),n.previousCommentThread=g(CC,7,"- Go to Previous Comment Thread{0}",``),n.addComment=g(CC,8,"- Add Comment on Current Selection{0}",``),n.submitComment=g(CC,9,"- Submit Comment{0}",``)})(ek||(ek={}));const Hz="vs/workbench/contrib/files/browser/fileConstants",NOt="revealInExplorer",POt="workbench.action.files.saveAs";Be(Hz,0,"Save As...");const FOt="workbench.action.files.save";Be(Hz,1,"Save");const OOt="workbench.action.files.saveWithoutFormatting";Be(Hz,2,"Save without Formatting");const BOt="saveAll";Be(Hz,3,"Save All");const rit="workbench.files.action.saveAllInGroup",WOt="workbench.action.files.saveFiles";new Y("groupFocusedInOpenEditors",!1);new Y("dirtyEditorFocusedInOpenEditors",!1);new Y("readonlyEditorFocusedInOpenEditors",!1);new Y("resourceSelectedForCompare",!1);g(Hz,4,"Remove Folder from Workspace");const HOt="workbench.action.files.newUntitledFile";Be(Hz,5,"New Untitled Text File");let U4e=class{onClose(){this._editor.focus()}constructor(e,t,i){this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=rC.Editor,this.options={type:N_.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=ua.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Xm.readonlyDiffEditor):t.push(Xm.editableDiffEditor):e.get(x.readOnly)?t.push(Xm.readonlyEditor):t.push(Xm.editableEditor),t.push(Xm.listSignalSounds),t.push(Xm.listAlerts);const i=UOt(this._keybindingService,this._contextKeyService);i&&t.push(i);const s=ait(this._keybindingService,this._contextKeyService,this._editor);return s&&t.push(s),e.get(x.stickyScroll).enabled&&t.push(Xm.stickScroll),e.get(x.tabFocusMode)?t.push(Xm.tabFocusModeOnMsg):t.push(Xm.tabFocusModeOffMsg),t.join(` - -`)}};U4e=D([_(1,ti),_(2,Pe)],U4e);function ait(n,e,t){if(e.getContext(t.getDomNode()).getValue(Qv.activeEditorHasCommentingRange.key))return[ek.intro,ek.addComment,ek.nextCommentThread,ek.previousCommentThread,ek.nextRange,ek.previousRange].join(` -`)}function UOt(n,e){if(utt.getValue(e))return[Xm.quickChat,Xm.startInlineChat].join(` -`)}const A5="vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp";class VOt{constructor(){this.priority=105,this.name="diff-editor",this.when=oO.create("isInDiffEditor",!0),this.type=N_.Help}getProvider(e){const t=e.get(_i),i=e.get(jt),s=e.get(ti),o=e.get(Pe);if(!(t.activeTextEditorControl instanceof Dm))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(A5,0,"Run the command Diff Editor: Switch Side to toggle between the original and modified editors."),c=g(A5,1,"The setting, accessibility.verbosity.diffEditorActive, controls if a diff editor announcement is made when it becomes the active editor."),l=["accessibility.signals.diffLineDeleted","accessibility.signals.diffLineInserted","accessibility.signals.diffLineModified"],d=[g(A5,2,"You are in a diff editor."),g(A5,3,"View the next or previous diff in diff review mode, which is optimized for screen readers.",_V.id,G7.id),a,c,g(A5,4,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=ait(s,o,r);return h&&d.push(h),{id:rC.DiffEditor,verbositySettingKey:ua.DiffEditor,provideContent:()=>d.join(` - -`),onClose:()=>{r.focus()},options:{type:N_.Help}}}dispose(){}}const gpe="vs/workbench/contrib/codeEditor/browser/diffEditorHelper";var AH;let Jte=(AH=class extends ${constructor(e,t,i,s){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=s,!(this._diffEditor instanceof $7)){const a=Wn(c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(xm((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(vte,this._diffEditor.getModifiedEditor(),g(gpe,0,"Show Whitespace Differences"),null));l.add(d.onClick(()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.ignoreTrimWhitespace",!1)})),d.render()}})),this._register(this._diffEditor.onDidUpdateDiff(()=>{const c=this._diffEditor.getDiffComputationResult();c&&c.quitEarly&&this._notificationService.prompt(nt.Warning,g(gpe,1,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(gpe,2,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},AH.ID="editor.contrib.diffEditorHelper",AH);Jte=D([_(1,be),_(2,dl),_(3,Pi)],Jte);Aje(Jte.ID,Jte);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(n,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:n}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);NQ.register(new VOt);const fpe="vs/workbench/contrib/codeEditor/browser/largeFileOptimizations";var EH;let Xte=(EH=class extends ${constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(s=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(fpe,0,"{0}: tokenization, wrapping, folding, codelens, word highlighting and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",yr(e.uri.path));this._notificationService.prompt(nt.Info,t,[{label:g(fpe,1,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(fpe,2,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},EH.ID="editor.contrib.largeFileOptimizationsWarner",EH);Xte=D([_(1,Pi),_(2,Re)],Xte);vn(Xte.ID,Xte,mi.AfterFirstRender);class zOt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=cit(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,o=i.length;sa.lineNumber===c.lineNumber?a.column-c.column:a.lineNumber-c.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,o=0;const r=e.length;for(let a=1,c=n.getLineCount();a<=c;a++){const l=n.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof n=="string"?ze.fromString(n):{read:()=>{const e=n.read();return typeof e=="string"?ze.fromString(e):null}}}const lit="vs/workbench/contrib/scm/browser/dirtyDiffSwitcher";let cSe=class extends JJe{constructor(e,t,i,s,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...iXe},l=o.getColorTheme(),d=l.getColor(us),u=l.getColor(SR)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,s,c,{ariaLabel:g(lit,0,"Switch quick diff base")}),this.optionsItems=r}setSelection(e){const t=this.optionsItems.findIndex(i=>i.provider===e);this.select(t)}getActionContext(e,t){return this.optionsItems[t]}render(e){super.render(e),this.setFocusable(!0)}};cSe=D([_(3,W_),_(4,pn)],cSe);const j2=class j2 extends xn{constructor(e){super(j2.ID,j2.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};j2.ID="quickDiff.base.switch",j2.LABEL=g(lit,1,"Switch Quick Diff Base");let lSe=j2;var dSe,JL;const bl="vs/workbench/contrib/scm/browser/dirtydiffDecorator";class KOt extends gw{runAction(e,t){return e instanceof id?e.run(...t):super.runAction(e,t)}}const dit=new Y("dirtyDiffVisible",!1);function YOt(n){const e=n.modifiedEndLineNumber-n.modifiedStartLineNumber+1,t=n.originalEndLineNumber-n.originalStartLineNumber+1;return n.originalEndLineNumber===0?e:n.modifiedEndLineNumber===0?t:e+t}function hSe(n){return n.modifiedEndLineNumber===0?n.modifiedStartLineNumber===0?1:n.modifiedStartLineNumber:n.modifiedEndLineNumber}function JOt(n,e){return n===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:n>=e.modifiedStartLineNumber&&n<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let X$=class extends xn{constructor(e,t,i,s,o){const r=s.lookupKeybinding(t.id),a=t.label+(r?` (${r.getLabel()})`:"");super(t.id,a,i),this.instantiationService=o,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};X$=D([_(3,ti),_(4,be)],X$);var bm;(function(n){n[n.Modify=0]="Modify",n[n.Add=1]="Add",n[n.Delete=2]="Delete"})(bm||(bm={}));function pFe(n){return n.originalEndLineNumber===0?bm.Add:n.modifiedEndLineNumber===0?bm.Delete:bm.Modify}function XOt(n,e){switch(e){case bm.Modify:return n.getColor(PE);case bm.Add:return n.getColor(FE);case bm.Delete:return n.getColor(OE)}}function QQ(n){const e=n.get(jt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof $7)return t.getParentEditor();return Bet(n)}let uSe=class extends V7{constructor(e,t,i,s,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},s),this.model=t,this.themeService=i,this.menuService=o,this.contextKeyService=r,this._index=0,this._provider="",this.height=void 0,this._disposables.add(i.onDidColorThemeChange(this._applyTheme,this)),this._applyTheme(i.getColorTheme()),this.model.original.length>0&&(r=r.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=ui(e.getModel().uri):this.title="",this.setTitle(this.title)}get provider(){return this._provider}get index(){return this._index}get visibleRange(){const e=this.diffEditor.getModifiedEditor().getVisibleRanges();return e.length>=0?e[0]:void 0}showChange(e,t=!0){const i=this.model.changes[e],s=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=s,!this.model.original)return;T.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(s),0));const a=this.model.getDiffEditorModel(i.uri.toString());if(!a)return;this.diffEditor.setModel(a),this.dropdown?.setSelection(i.label);const c=new oe(hSe(s),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(YOt(s)+8,Math.floor(h/3));this.renderTitle(i.label);const f=pFe(s),p=XOt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const w of this.model.changes)w.label===this.model.changes[this._index].label&&(m.push(w.change),i===w&&(v=m.length-1));this._actionbarWidget.context=[a.modified.uri,m,v],t&&(this.show(c,u),this.editor.setPosition(c),this.editor.focus())}renderTitle(e){const t=this.model.mapChanges.get(e),i=t.indexOf(this._index);let s;this.shouldUseDropdown()?(s=this.model.changes.length>1?g(bl,2,"{0} of {1} changes",i+1,t.length):g(bl,3,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(s=this.model.changes.length>1?g(bl,0,"{0} - {1} of {2} changes",e,i+1,t.length):g(bl,1,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,s)}switchQuickDiff(e){const t=e?.provider;if(t===this.model.changes[this._index].label)return;let i=this._index0?this._index-1:this.model.changes.length-1;for(let r=s;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){s=r;break}const o=Math.abs(this.model.changes[i].change.modifiedEndLineNumber-this.model.changes[this._index].change.modifiedEndLineNumber)1){const t=Array.from(this.model.mapChanges.keys());for(let i=0;i0&&e++}return e>=2}updateActions(){if(!this._actionbarWidget)return;const e=this.instantiationService.createInstance(X$,this.editor,new hit(this.editor),$e.asClassName(x0t)),t=this.instantiationService.createInstance(X$,this.editor,new uit(this.editor),$e.asClassName(D0t));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(Te.SCMChangeContext,this.contextKeyService),tD(this.menu,{shouldForwardArgs:!0},i),this._actionbarWidget.clear(),this._actionbarWidget.push(i.reverse(),{label:!1,icon:!0}),this._actionbarWidget.push([t,e],{label:!1,icon:!0}),this._actionbarWidget.push(new xn("peekview.close",g(bl,4,"Close"),$e.asClassName(Ce.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Yle(this._titleElement,we(".dropdown")),this.dropdown=this.instantiationService.createInstance(cSe,new lSe(t=>this.switchQuickDiff(t)),this.model.quickDiffs.map(t=>t.label),this.model.changes[this._index].label),this.dropdown.render(this.dropdownContainer),this.updateActions()}_getActionBarOptions(){const e=new KOt;return e.onDidRun(t=>{!(t.action instanceof X$)&&!t.error&&this.dispose()}),{...super._getActionBarOptions(),actionRunner:e}}_fillBody(e){const t={scrollBeyondLastLine:!0,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1},renderSideBySide:!1,readOnly:!1,renderIndicators:!1,diffAlgorithm:"advanced",ignoreTrimWhitespace:!1,stickyScroll:{enabled:!1}};this.diffEditor=this.instantiationService.createInstance($7,e,t,{},this.editor),this._disposables.add(this.diffEditor)}_onWidth(e){typeof this.height>"u"||this.diffEditor.layout({height:this.height,width:e})}_doLayoutBody(e,t){super._doLayoutBody(e,t),this.diffEditor.layout({height:e,width:t}),typeof this.height>"u"&&this.change&&this.revealChange(this.change),this.height=e}revealChange(e){let t,i;e.modifiedEndLineNumber===0?(t=e.modifiedStartLineNumber,i=e.modifiedStartLineNumber+1):e.originalEndLineNumber>0?(t=e.modifiedStartLineNumber-1,i=e.modifiedEndLineNumber+1):(t=e.modifiedStartLineNumber,i=e.modifiedEndLineNumber),this.diffEditor.revealLinesInCenter(t,i,vt.Immediate)}_applyTheme(e){const t=e.getColor(GPe)||fe.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(SR)||fe.transparent,primaryHeadingColor:e.getColor(zPe),secondaryHeadingColor:e.getColor($Pe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,vt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};uSe=D([_(2,pn),_(3,be),_(4,_c),_(5,Pe)],uSe);class hit extends lt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(bl,5,"Show Previous Change"),alias:"Show Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.previous()}}Fe(hit);class uit extends lt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(bl,6,"Show Next Change"),alias:"Show Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.next()}}Fe(uit);Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(bl,7,"Next &&Change")},order:1});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(bl,8,"Previous &&Change")},order:2});class ZOt extends lt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(bl,9,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=QQ(e),i=e.get(Lw),s=e.get(Ur),o=e.get(jt);if(!t||!t.hasModel())return;const r=YS.get(t);if(!r||!r.modelRegistry)return;const a=t.getPosition().lineNumber,c=r.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await fit(d.change,i),git(d.change,t,s,o)}}Fe(ZOt);class eBt extends lt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(bl,10,"Go to Next Change"),alias:"Go to Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=e.get(Lw),i=QQ(e),s=e.get(Ur),o=e.get(jt);if(!i||!i.hasModel())return;const r=YS.get(i);if(!r||!r.modelRegistry)return;const a=i.getPosition().lineNumber,c=r.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await fit(d,t),git(d,i,s,o)}}function git(n,e,t,i){const s=new oe(n.modifiedStartLineNumber,1);e.setPosition(s),e.revealPositionInCenter(s),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:n.modifiedStartLineNumber,startColumn:0,endLineNumber:n.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function fit(n,e){switch(pFe(n)){case bm.Add:e.playSignal(Zl.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case bm.Delete:e.playSignal(Zl.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case bm.Modify:e.playSignal(Zl.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Fe(eBt);xr.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:ye.EditorContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(dit),handler:n=>{const e=QQ(n);if(!e)return;const t=YS.get(e);t&&t.close()}});var NN;let YS=(NN=class extends ${static get(e){return e.getContribution(dSe.ID)}constructor(e,t,i,s){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=s,this.modelRegistry=null,this.model=null,this.widget=null,this.session=$.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=od(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=dit.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=T.filter(i.onDidChangeConfiguration,r=>r.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(o(this.onDidChangeGutterAction,this)),this.onDidChangeGutterAction()}}onDidChangeGutterAction(){const e=this.configurationService.getValue("scm.diffDecorationsGutterAction");this.gutterActionDisposables.clear(),e==="diff"?(this.gutterActionDisposables.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.gutterActionDisposables.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.stylesheet.textContent=` +`));let c;this.defaultScopes?c=this.defaultScopes:typeof t.scope=="string"?c=t.scope.split(",").map(d=>d.trim()).filter(Boolean):c=[];let l;this._extension?l=this._extension.displayName||this._extension.name:this.source===Hw.Workspace?l=g(6745,"Workspace Snippet"):this.isGlobalSnippets?l=g(6746,"Global User Snippet"):l=g(6747,"User Snippet");for(const d of hi.wrap(o))i.push(new eZe(!!n,c,e,d,a,r,l,this.source,this._extension?`${DN(this._extension.extensionLocation,this.location)}/${e}`:`${Ko(this.location.path)}/${e}`,this._extension?.identifier))}}const wW=eh.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(2464,"Contributes language declarations."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:languageId}",aliases:["${2:label}"],extensions:["${3:extension}"],configuration:"./language-configuration.json"}}],properties:{id:{description:g(2465,"ID of the language."),type:"string"},aliases:{description:g(2466,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(2467,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(2468,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(2469,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(2470,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(2471,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(2472,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(2473,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(2474,"Icon path when a light theme is used"),type:"string"},dark:{description:g(2475,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(s,e)=>{for(const t of s)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class NNt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],n=[];for(const d of i)tZe(d)&&n.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=O1e(n,d=>d.id);if((t?.grammars||[]).forEach(d=>{if(!Lt(d.language))return;let h=o[d.language];h?h.hasGrammar=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!0,hasSnippets:!1},o[h.id]=h,n.push(h))}),(t?.snippets||[]).forEach(d=>{if(!Lt(d.language))return;let h=o[d.language];h?h.hasSnippets=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!1,hasSnippets:!0},o[h.id]=h,n.push(h))}),!n.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(2476,"ID"),g(2477,"Name"),g(2478,"File Extensions"),g(2479,"Grammar"),g(2480,"Snippets")],l=n.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Mt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(2481,"Programming Languages"),access:{canToggle:!1},renderer:new wi(NNt)});let wbe=class extends QY{constructor(e,t,i,n){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=n,this._configurationService=t,this._extensionService=e,wW.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(NLe)&&this.updateMime()})),this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this.updateMime()}),this._register(this.onDidRequestRichLanguageFeatures(o=>{this._extensionService.activateByEvent(`onLanguage:${o}`),this._extensionService.activateByEvent("onLanguage")}))}updateMime(){const e=this._configurationService.getValue();lAt(),e.files?.associations&&Object.keys(e.files.associations).forEach(t=>{const i=e.files.associations[t];if(typeof i!="string"){this.logService.warn(`Ignoring configured 'files.associations' for '${t}' because its type is not a string but '${typeof i}'`);return}const n=this.getMimeType(i)||`text/x-${i}`;rAt({id:i,mime:n,filepattern:t})}),this._onDidChange.fire()}};wbe=D([_(0,fs),_(1,Te),_(2,Za),_(3,Ge)],wbe);function bK(s){return typeof s>"u"?!0:Array.isArray(s)?s.every(e=>typeof e=="string"):!1}function tZe(s,e){return s?typeof s.id!="string"?(e?.error(g(2484,"property `{0}` is mandatory and must be of type `string`","id")),!1):bK(s.extensions)?bK(s.filenames)?typeof s.firstLine<"u"&&typeof s.firstLine!="string"?(e?.error(g(2487,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof s.configuration<"u"&&typeof s.configuration!="string"?(e?.error(g(2488,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):bK(s.aliases)?bK(s.mimetypes)?typeof s.icon<"u"&&(typeof s.icon!="object"||typeof s.icon.light!="string"||typeof s.icon.dark!="string")?(e?.error(g(2491,"property `{0}` can be omitted and must be of type `object` with properties `{1}` and `{2}` of type `string`","icon","light","dark")),!1):!0:(e?.error(g(2490,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(2489,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(2486,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(2485,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(2483,"Empty value for `contributes.{0}`",wW.name)),!1)}const iZe="_snippet.markAsUsed";_t.registerCommand(iZe,(s,...e)=>{const t=s.get(Gae),[i]=e;i instanceof eZe&&t.updateUsageTimestamp(i)});class fV{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(6748,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Hw.Extension?"z":"a"}-${e.prefix}`,this.kind=Me.Snippet,this.insertTextRules=Yg.InsertAsSnippet,this.command={id:iZe,title:"",arguments:[e]}}resolve(){return this.documentation=new Mt().appendCodeblock("",X_.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return gm(e.label.label,t.label.label)}}let ybe=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const n=new js,o=t.lineNumber,r=e.getWordAtPosition(t)??{startColumn:t.column,endColumn:t.column,word:""},a=e.getLineContent(t.lineNumber).toLowerCase(),c=a.substring(0,r.startColumn+r.word.length-1),l=this._computeSnippetPositions(e,o,r,c),d=t.column-1,h=i.triggerCharacter?.toLowerCase()??"",u=this._getLanguageIdAtPosition(e,t),f=this._languageConfigurationService.getLanguageConfiguration(u),p=new Set(await this._snippets.getSnippets(u)),m=[];for(const v of p){if(i.triggerKind===Ku.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let b;for(const R of l)if(!(R.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&HQe(R.prefixLow,0,R.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){b=R;break}if(!b)continue;const w=b.startColumn-1,y=v.prefixLow.length-(d-w),C=Ere(a,v.prefixLow,d,d+y,d-w),A=t.with(void 0,w+1);let L=C===0?t.column+y:t.column;dG.open===a[A.column-1]&&v.prefix.startsWith(G.open)&&v.prefix[v.prefix.length-1]===G.close)&&L++;const k=F.fromPositions({lineNumber:o,column:b.startColumn},{lineNumber:o,column:L}),P=k.setEndPosition(o,t.column);m.push(new fV(v,{replace:k,insert:P})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const b=F.fromPositions(t),w=a.indexOf(v.prefixLow,d)===d?b.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):b;m.push(new fV(v,{replace:w,insert:b}))}return this._disambiguateSnippets(m),{suggestions:m,duration:n.elapsed()}}_disambiguateSnippets(e){e.sort(fV.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(6749,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=n)}}resolveCompletionItem(e){return e instanceof fV?e.resolve():e}_computeSnippetPositions(e,t,i,n){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:n.substring(i.startColumn-1),isWord:!0}),o}_getLanguageIdAtPosition(e,t){e.tokenization.tokenizeIfCheap(t.lineNumber);let i=e.getLanguageIdAtPosition(t.lineNumber,t.column);return this._languageService.getLanguageName(i)||(i=e.getLanguageId()),i}};ybe=D([_(0,xi),_(1,Gae),_(2,Vs)],ybe);var nQ,sQ,uX;(function(s){function e(t,i,n){if(Gu(i.path))return t.collector.error(g(2991,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(Gu(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(2992,"When omitting the language, the value of `contributes.{0}.path` must be a `.code-snippets`-file. Provided value: {1}",t.description.name,String(i.path))),null;if(!Gu(i.language)&&!n.isRegisteredLanguageId(i.language))return t.collector.error(g(2993,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=Pt(o,i.path);return qy(r,o)?{language:i.language,location:r}:(t.collector.error(g(2994,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",t.description.name,r.path,o.path)),null)}s.toValidSnippet=e,s.snippetsContribution={description:g(2995,"Contributes snippets."),type:"array",defaultSnippets:[{body:[{language:"",path:""}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",path:"./snippets/${2:id}.json."}}],properties:{language:{description:g(2996,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(2997,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},s.point=eh.registerExtensionPoint({extensionPoint:"snippets",deps:[wW],jsonSchema:s.snippetsContribution})})(uX||(uX={}));function PNt(s,e,t){return jr(s.watch(e),s.onDidFilesChange(i=>{i.affects(e)&&t()}))}var kL;let Cbe=(kL=class{constructor(e){this._storageService=e;const t=e.get(nQ._key,Ie.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=A6e(i)?new Set(i):new Set}isIgnored(e){return this._ignored.has(e)}updateIgnored(e,t){let i=!1;this._ignored.has(e)&&!t?(this._ignored.delete(e),i=!0):!this._ignored.has(e)&&t&&(this._ignored.add(e),i=!0),i&&this._storageService.store(nQ._key,JSON.stringify(Array.from(this._ignored)),Ie.PROFILE,an.USER)}},nQ=kL,kL._key="snippets.ignoredSnippets",kL);Cbe=nQ=D([_(0,$i)],Cbe);var IL;let Sbe=(IL=class{constructor(e){this._storageService=e;const t=e.get(sQ._key,Ie.PROFILE,"");let i;try{i=JSON.parse(t)}catch{i=[]}this._usages=Array.isArray(i)?new Map(i):new Map}getUsageTimestamp(e){return this._usages.get(e)}updateUsageTimestamp(e){this._usages.delete(e),this._usages.set(e,Date.now());const t=[...this._usages].slice(-100);this._storageService.store(sQ._key,JSON.stringify(t),Ie.PROFILE,an.USER)}},sQ=IL,IL._key="snippets.usageTimestamps",IL);Sbe=sQ=D([_(0,$i)],Sbe);let nUe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=n,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new ui,this._pendingWork.push(Promise.resolve(l.when(Rs.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),EMt(new ybe(this._languageService,this,h)),this._enablement=d.createInstance(Cbe),this._usageTimestamps=d.createInstance(Sbe)}dispose(){this._disposables.dispose()}isEnabled(e){return!this._enablement.isIgnored(e.snippetIdentifier)}updateEnablement(e,t){this._enablement.updateIgnored(e.snippetIdentifier,!t)}updateUsageTimestamp(e){this._usageTimestamps.updateUsageTimestamp(e.snippetIdentifier)}_joinSnippets(){const e=this._pendingWork.slice(0);return this._pendingWork.length=0,Promise.all(e)}async getSnippetFiles(){return await this._joinSnippets(),this._files.values()}async getSnippets(e,t){await this._joinSnippets();const i=[],n=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())n.push(o.load().then(r=>r.select(e,i)).catch(r=>this._logService.error(r,o.location.toString())))}else for(const o of this._files.values())n.push(o.load().then(r=>w6e(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(n),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const n of this._files.values())n.load().catch(o=>{}),n.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const n of e)!n.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(n)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==n.isFileTemplate||i.push(n);return i.sort((n,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(n.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(n,o)),r})}_compareSnippet(e,t){return e.snippetSourcet.snippetSource?1:e.sourcet.source||e.name>t.name?1:e.name{for(const[t,i]of this._files)i.source===Hw.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const n=uX.toValidSnippet(t,i,this._languageService);if(!n)continue;const o=this._files.get(n.location);if(o)o.defaultScopes?o.defaultScopes.push(n.language):o.defaultScopes=[];else{const r=new Qhe(Hw.Extension,n.location,n.language?[n.language]:void 0,t.description,this._fileService,this._extensionResourceLoaderService);this._files.set(r.location,r),this._environmentService.isExtensionDevelopment&&r.load().then(a=>{a.data.some(c=>c.isBogous)&&t.collector.warn(g(2998,"One or more snippets from the extension '{0}' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)",t.description.name))},a=>{t.collector.warn(g(2999,'The snippet file "{0}" could not be read.',r.location.toString()))})}}})}_initWorkspaceSnippets(){const e=new Z,t=()=>{e.clear(),this._pendingWork.push(this._initWorkspaceFolderSnippets(this._contextService.getWorkspace(),e))};this._disposables.add(e),this._disposables.add(this._contextService.onDidChangeWorkspaceFolders(t)),this._disposables.add(this._contextService.onDidChangeWorkbenchState(t)),t()}async _initWorkspaceFolderSnippets(e,t){const i=e.folders.map(async n=>{const o=n.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Hw.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,To.ADDED)&&this._initFolderSnippets(Hw.Workspace,o,t)}))});await Promise.all(i)}async _initUserSnippets(){const e=new Z,t=async()=>{e.clear();const i=this._userDataProfileService.currentProfile.snippetsHome;await this._fileService.createFolder(i),await this._initFolderSnippets(Hw.User,i,e)};this._disposables.add(e),this._disposables.add(this._userDataProfileService.onDidChangeCurrentProfile(i=>i.join((async()=>{this._pendingWork.push(t())})()))),await t()}_initFolderSnippets(e,t,i){const n=new Z,o=async()=>{if(n.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])n.add(this._addSnippetFile(a.resource,e))}catch(r){this._logService.error(`Failed snippets from folder '${t.toString()}'`,r)}};return i.add(this._textfileService.files.onDidSave(r=>{qy(r.model.resource,t)&&o()})),i.add(PNt(this._fileService,t,o)),i.add(n),o()}_addSnippetFile(e,t){const i=vU(e);if(t===Hw.User&&i===".json"){const n=_i(e).replace(/\.json/,"");this._files.set(e,new Qhe(t,e,[n],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new Qhe(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};nUe=D([_(0,Za),_(1,ug),_(2,yi),_(3,xi),_(4,Ge),_(5,Jt),_(6,Fo),_(7,Fae),_(8,ig),_(9,we),_(10,Vs)],nUe);function FNt(s,e){const i=s.getLineContent(e.lineNumber).substr(0,e.column-1),n=Math.max(0,i.length-100);for(let o=i.length-1;o>=n;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return n===0?i:""}var oQ,HD;let PA=(HD=class{static get(e){return e.getContribution(oQ.ID)}constructor(e,t,i,n,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=n,this._activeSnippets=[],this._hasSnippets=oQ.ContextKey.bindTo(o),this._configListener=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(x.tabCompletion)&&this._update()}),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose()}_update(){const e=this._editor.getOption(x.tabCompletion)==="onlySnippets";this._enabled!==e&&(this._enabled=e,this._enabled?(this._selectionListener=this._editor.onDidChangeCursorSelection(t=>this._updateSnippets()),this._editor.getModel()&&this._updateSnippets()):this._selectionListener?.dispose())}_updateSnippets(){if(this._activeSnippets=[],this._completionProvider?.dispose(),!this._editor.hasModel())return;const e=this._editor.getSelection(),t=this._editor.getModel();t.tokenization.tokenizeIfCheap(e.positionLineNumber);const i=t.getLanguageIdAtPosition(e.positionLineNumber,e.positionColumn),n=this._snippetService.getSnippetsSync(i);if(!n){this._hasSnippets.set(!1);return}if(F.isEmpty(e)){const r=FNt(t,e.getPosition());if(r)for(const a of n)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!F.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of n)r===a.prefix&&this._activeSnippets.push(a)}const o=this._activeSnippets.length;if(o===0)this._hasSnippets.set(!1);else if(o===1)this._hasSnippets.set(!0);else{this._hasSnippets.set(!0),this._completionProvider={_debugDisplayName:"tabCompletion",dispose:()=>{r.dispose()},provideCompletionItems:(a,c)=>a!==t||!e.containsPosition(c)?void 0:{suggestions:this._activeSnippets.map(d=>{const h=F.fromPositions(c.delta(0,-d.prefix.length),c);return new fV(d,h)})}};const r=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme},this._completionProvider)}}async performSnippetCompletions(){if(this._editor.hasModel())if(this._activeSnippets.length===1){const[e]=this._activeSnippets;let t;if(e.needsClipboard){const i=new Tae(this._editor,jo.Value|jo.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}fc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&GXe(this._editor,this._completionProvider)}},oQ=HD,HD.ID="editor.tabCompletionController",HD.ContextKey=new Q("hasSnippetCompletions",void 0),HD);PA=oQ=D([_(1,Gae),_(2,dg),_(3,it),_(4,Le)],PA);on(PA.ID,PA,ri.Eager);const ONt=hc.bindToContribution(PA.get);qe(new ONt({id:"insertSnippet",precondition:PA.ContextKey,handler:s=>s.performSnippetCompletions(),kbOpts:{weight:Ae.EditorContrib,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus,fc.InSnippetMode.toNegated()),primary:S.Tab}}));var x_;(function(s){s.activeCursorHasCommentingRange=new Q("activeCursorHasCommentingRange",!1,{description:g(5301,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),s.activeEditorHasCommentingRange=new Q("activeEditorHasCommentingRange",!1,{description:g(5302,"Whether the active editor has a commenting range"),type:"boolean"}),s.WorkspaceHasCommenting=new Q("workspaceHasCommenting",!1,{description:g(5303,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),s.commentThreadIsEmpty=new Q("commentThreadIsEmpty",!1,{type:"boolean",description:g(5304,"Set when the comment thread has no comments")}),s.commentIsEmpty=new Q("commentIsEmpty",!1,{type:"boolean",description:g(5305,"Set when the comment has no input")}),s.commentContext=new Q("comment",void 0,{type:"string",description:g(5306,"The context value of the comment")}),s.commentThreadContext=new Q("commentThread",void 0,{type:"string",description:g(5307,"The context value of the comment thread")}),s.commentControllerContext=new Q("commentController",void 0,{type:"string",description:g(5308,"The comment controller id associated with a comment thread")}),s.commentFocused=new Q("commentFocused",!1,{type:"boolean",description:g(5309,"Set when the comment is focused")})})(x_||(x_={}));function q6(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function BNt(s,e,t){const i={id:ar(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class lce{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return hi.some(this,([i,n])=>n.asFile())&&t.push("files"),sZe(gX(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return gX(e)}}function gX(s){return s.toLowerCase()}function nZe(s,e){return sZe(gX(s),e.map(gX))}function sZe(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Zk=Object.freeze({create:s=>ja(s.map(e=>e.toString())).join(`\r +`),split:s=>s.split(`\r +`),parse:s=>Zk.split(s).filter(e=>!e.startsWith("#"))}),Ew=class Ew{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Ew.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Ew((this.value?[this.value,...e]:e).join(Ew.sep))}};Ew.sep=".",Ew.None=new Ew("@@none@@"),Ew.Empty=new Ew("");let Yn=Ew;var Yp;(function(s){function e(o){return typeof o?.showDirectoryPicker=="function"}s.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}s.isFileSystemHandle=t;function i(o){return o.kind==="file"}s.isFileSystemFileHandle=i;function n(o){return o.kind==="directory"}s.isFileSystemDirectoryHandle=n})(Yp||(Yp={}));class WNt{get capabilities(){return this._capabilities||(this._capabilities=Vn.FileReadWrite|Vn.FileReadStream,pr&&(this._capabilities|=Vn.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.extUri=pr?xn:Rre,this._files=new Map,this._directories=new Map}async stat(e){try{const t=await this.getHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, stat",ot.FileNotFound);if(Yp.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:sn.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:sn.Directory,mtime:0,ctime:0,size:0}}catch(t){throw this.toFileSystemProviderError(t)}}async readdir(e){try{const t=await this.getDirectoryHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readdir",ot.FileNotFound);const i=[];for await(const[n,o]of t)i.push([n,Yp.isFileSystemFileHandle(o)?sn.File:sn.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const n=jA(o=>$e.concat(o.map(r=>$e.wrap(r))).buffer,{highWaterMark:10});return(async()=>{try{const o=await this.getFileHandle(e);if(!o)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",ot.FileNotFound);const r=await o.getFile();if(typeof t.length=="number"||typeof t.position=="number"){let a=new Uint8Array(await r.arrayBuffer());typeof t?.position=="number"&&(a=a.slice(t.position)),typeof t?.length=="number"&&(a=a.slice(0,t.length)),n.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await n.write(c.value),i.isCancellationRequested));)c=await a.read();n.end(void 0)}}catch(o){n.error(this.toFileSystemProviderError(o)),n.end()}})(),n}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",ot.FileNotFound);const i=await t.getFile();return new Uint8Array(await i.arrayBuffer())}catch(t){throw this.toFileSystemProviderError(t)}}async writeFile(e,t,i){try{let n=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(n){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",ot.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",ot.FileNotFound)}if(!n){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",ot.FileNotFound);if(n=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!n)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",ot.Unknown)}const o=await n.createWritable();await o.write(t),await o.close()}catch(n){throw this.toFileSystemProviderError(n)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",ot.FileNotFound);await t.getDirectoryHandle(this.extUri.basename(e),{create:!0})}catch(t){throw this.toFileSystemProviderError(t)}}async delete(e,t){try{const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(!i)throw this.createFileSystemProviderError(e,"No such parent directory, delete",ot.FileNotFound);return i.removeEntry(this.extUri.basename(e),{recursive:t.recursive})}catch(i){throw this.toFileSystemProviderError(i)}}async rename(e,t,i){try{if(this.extUri.isEqual(e,t))return;const n=await this.getFileHandle(e);if(n){const o=await n.getFile(),r=new Uint8Array(await o.arrayBuffer());await this.writeFile(t,r,{create:!0,overwrite:i.overwrite,unlock:!1,atomic:!1}),await this.delete(e,{recursive:!1,useTrash:!1,atomic:!1})}else throw this.createFileSystemProviderError(e,g(607,"Rename is only supported for files."),ot.Unavailable)}catch(n){throw this.toFileSystemProviderError(n)}}watch(e,t){return V.None}registerFileHandle(e){return this.registerHandle(e,this._files)}registerDirectoryHandle(e){return this.registerHandle(e,this._directories)}get directories(){return this._directories.values()}async registerHandle(e,t){let i=`/${e.name}`;if(t.has(i)&&!await t.get(i)?.isSameEntry(e)){const n=Gy(e.name),o=Ko(e.name,n);let r=1;do i=`/${o}-${r++}${n}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",n=>n.put(e,i))}catch(n){this.logService.error(n)}return N.from({scheme:pe.file,path:i})}async getHandle(e){let t=await this.doGetHandle(e);if(!t){const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(i){const n=xn.basename(e);try{t=await i.getFileHandle(n)}catch{try{t=await i.getDirectoryHandle(n)}catch{}}}}return t}async getFileHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemFileHandle)return t;const i=await this.getDirectoryHandle(this.extUri.dirname(e));try{return await i?.getFileHandle(xn.basename(e))}catch{return}}async getDirectoryHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemDirectoryHandle)return t;const i=this.extUri.dirname(e);if(this.extUri.isEqual(i,e))return;const n=await this.getDirectoryHandle(i);try{return await n?.getDirectoryHandle(xn.basename(e))}catch{return}}async doGetHandle(e){if(this.extUri.dirname(e).path!=="/")return;const t=e.path.replace(/\/$/,""),i=this._files.get(t)??this._directories.get(t);if(i)return i;const n=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(Yp.isFileSystemHandle(n)){let o=await n.queryPermission()==="granted";try{o||(o=await n.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return Yp.isFileSystemFileHandle(n)?this._files.set(t,n):Yp.isFileSystemDirectoryHandle(n)&&this._directories.set(t,n),n}throw this.createFileSystemProviderError(e,"No file system handle registered",ot.Unavailable)}toFileSystemProviderError(e){if(e instanceof xA)return e;let t=ot.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(608,"Insufficient permissions. Please retry and allow the operation.")),t=ot.Unavailable),us(e,t)}createFileSystemProviderError(e,t,i){return us(new Error(`${t} (${Rk(e.path)})`),i)}}const PM={EDITORS:"CodeEditors",FILES:"CodeFiles"};function HNt(s){const e=[];if(s.dataTransfer&&s.dataTransfer.types.length>0){const n=s.dataTransfer.getData(PM.EDITORS);if(n)try{e.push(...j2(n))}catch{}else try{const a=s.dataTransfer.getData(sp.RESOURCES);e.push(...UNt(a))}catch{}if(s.dataTransfer?.files)for(let a=0;aVNt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function UNt(s){const e=[];if(s){const t=JSON.parse(s);for(const i of t)if(i.indexOf(":")>0){const{selection:n,uri:o}=KLe(N.parse(i));e.push({resource:o,options:{selection:n}})}}return e}async function VNt(s,e){if(Yp.supported(si)){const i=e.dataTransfer?.items;if(i)return zNt(s,i)}const t=e.dataTransfer?.files;return t?$Nt(s,t):[]}async function zNt(s,e){const t=s.get(Jt).getProvider(pe.file);if(!(t instanceof WNt))return[];const i=[];for(let n=0;n{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}Yp.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Yp.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Fi(await Promise.all(i.map(n=>n.p)))}async function $Nt(s,e){const t=s.get(to),i=[];for(let n=0;n100*Nc.MB){t.warn(g(5675,"File is too large to open as untitled editor. Please upload it first into the file explorer and then try again."));continue}const r=new dc;i.push(r);const a=new FileReader;a.onerror=()=>r.complete(void 0),a.onabort=()=>r.complete(void 0),a.onload=async c=>{const l=o.name,d=c.target?.result??void 0;if(typeof l!="string"||typeof d>"u"){r.complete(void 0);return}r.complete({resource:N.from({scheme:pe.untitled,path:l}),contents:typeof d=="string"?$e.fromString(d):$e.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Fi(await Promise.all(i.map(n=>n.p)))}function rZe(s,...e){if(!s.dataTransfer)return!1;const t=s.dataTransfer.types,i=[];for(let n=0;n=0)return!0;return!1}class GNt{constructor(){this._contributions=new Map}register(e){if(this._contributions.has(e.dataFormatKey))throw new Error(`A drag and drop contributiont with key '${e.dataFormatKey}' was already registered.`);this._contributions.set(e.dataFormatKey,e)}getAll(){return this._contributions.values()}}const AMe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Qe.add(AMe.DragAndDropContribution,new GNt);const Kz=class Kz{constructor(){}static getInstance(){return Kz.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}};Kz.INSTANCE=new Kz;let fX=Kz;function aZe(s){const e=new lce;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,q6(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,KNt(n))}}return e}function KNt(s){const e=s.path?N.parse(s.path):void 0;return BNt(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const qNt=Object.freeze([PM.EDITORS,PM.FILES,sp.RESOURCES,sp.INTERNAL_URI_LIST]);function cZe(s,e=!1){const t=aZe(s),i=t.get(sp.INTERNAL_URI_LIST);if(i)t.replace(Us.uriList,i);else if(e||!t.has(Us.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(N.file(a).toString()):n.push(N.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Us.uriList,q6(Zk.create(n)))}for(const n of qNt)t.delete(n);return t}class EMe{async provideDocumentPasteEdits(e,t,i,n,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const ZF=class ZF extends EMe{constructor(){super(...arguments),this.id=ZF.id,this.kind=ZF.kind,this.dropMimeTypes=[Us.text],this.pasteMimeTypes=[Us.text]}async getEdit(e,t){const i=e.get(Us.text);if(!i||e.has(Us.uriList))return;const n=await i.asString();return{handledMimeType:Us.text,title:g(5042,"Insert Plain Text"),insertText:n,kind:this.kind}}};ZF.id="text",ZF.kind=new Yn("text.plain");let FM=ZF;class lZe extends EMe{constructor(){super(...arguments),this.kind=new Yn("uri.absolute"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await dZe(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===pe.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?g(5043,"Insert Uris"):g(5044,"Insert Uri"):r=i.length>1?g(5045,"Insert Paths"):g(5046,"Insert Path"),{handledMimeType:Us.uriList,insertText:o,title:r,kind:this.kind}}}let pX=class extends EMe{constructor(e){super(),this._workspaceContextService=e,this.kind=new Yn("uri.relative"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await dZe(e);if(!i.length||t.isCancellationRequested)return;const n=Fi(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?DN(r.uri,o):void 0}));if(n.length)return{handledMimeType:Us.uriList,insertText:n.join(" "),title:i.length>1?g(5047,"Insert Relative Paths"):g(5048,"Insert Relative Path"),kind:this.kind}}};pX=D([_(0,yi)],pX);class QNt{constructor(){this.kind=new Yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Us.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==b8.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:g(5049,"Insert HTML"),kind:this.kind}]}}}async function dZe(s){const e=s.get(Us.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of Zk.parse(t))try{i.push({uri:N.parse(n),originalText:n})}catch{}return i}let Abe=class extends V{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new FM)),this._register(e.documentDropEditProvider.register("*",new lZe)),this._register(e.documentDropEditProvider.register("*",new pX(t)))}};Abe=D([_(0,it),_(1,yi)],Abe);let Ebe=class extends V{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new FM)),this._register(e.documentPasteEditProvider.register("*",new lZe)),this._register(e.documentPasteEditProvider.register("*",new pX(t))),this._register(e.documentPasteEditProvider.register("*",new QNt))}};Ebe=D([_(0,it),_(1,yi)],Ebe);function hZe(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new tA(s,{range:i,text:typeof t.insertText=="string"?X_.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function uZe(s){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of s)for(const a of r.yieldTo??[])for(const c of s)if(c!==r&&e(a,c)){let l=t.get(r);l||(l=[],t.set(r,l)),l.push(c)}if(!t.size)return Array.from(s);const i=new Set,n=[];function o(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let c=[];const l=t.get(a);return l&&(n.push(a),c=o(l),n.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(s))}var jNt=".inline-editor-progress-decoration{display:inline-block;height:1em;width:1em}.inline-progress-widget{align-items:center;display:flex!important;justify-content:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{animation:none;font-size:90%!important}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";ut(jNt,{});const YNt=Gt.register({description:"inline-progress-widget",stickiness:ni.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:X6e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Rse=class Rse extends V{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fe("span.icon");this.domNode.append(t),t.classList.add(...We.asClassNameArray(ve.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(x.fontSize)||n.hasChanged(x.lineHeight))&&i()})),this._register(ue(this.domNode,ke.CLICK,n=>{this.delegate.cancel()}))}getId(){return Rse.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[es.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Rse.baseId="editor.widget.inlineProgressWidget";let xbe=Rse,mX=class extends V{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new wn),this._currentWidget=this._register(new wn),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=jy(()=>{const a=F.fromPositions(e);this._currentDecorations.set([{range:a,options:YNt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(xbe,this.id,this._editor,a,t,n))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};mX=D([_(2,we)],mX);var JNt=".monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);padding:2px 4px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{border:8px solid transparent;height:0!important;left:2px;position:absolute;width:0!important;z-index:1000}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage.below .anchor.below,.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}";ut(JNt,{});var rQ,UD;let Lh=(UD=class{static get(e){return e.getContribution(rQ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new wn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=rQ.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}isVisible(){return this._visible.get()}showMessage(e,t){Mr(dd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=dd(e)?f6(e,{actionHandler:{callback:n=>{this.closeMessage(),uae(this._openerService,n,dd(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new sUe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(M.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&wc(Bc(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new F(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sUe.fadeOut(this._messageWidget.value))}},rQ=UD,UD.ID="editor.contrib.messageController",UD.MESSAGE_VISIBLE=new Q("messageVisible",!1,g(5105,"Whether the editor is currently showing an inline message")),UD);Lh=rQ=D([_(1,Le),_(2,Ao)],Lh);const XNt=hc.bindToContribution(Lh.get);qe(new XNt({id:"leaveEditorMessage",precondition:Lh.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:Ae.EditorContrib+30,primary:S.Escape}}));let sUe=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,mt.Smooth),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[es.ABOVE,es.BELOW],positionAffinity:Io.Right}}afterRender(e){this._domNode.classList.toggle("below",e===es.BELOW)}};on(Lh.ID,Lh,ri.Lazy);var ud;(function(s){s[s.Explorer=1]="Explorer",s[s.Scm=3]="Scm",s[s.Extensions=5]="Extensions",s[s.Window=10]="Window",s[s.Notification=15]="Notification",s[s.Dialog=20]="Dialog"})(ud||(ud={}));const oFe=class oFe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};oFe.None=Object.freeze({report(){}});let lu=oFe,oUe=class extends V{constructor(e,t){super(),this.deferred=new dc,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(Ee(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};oUe=D([_(1,cg)],oUe);var ZNt=".post-edit-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-widget-border,transparent);border-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);overflow:hidden}.post-edit-widget .monaco-button{border:none;border-radius:0;padding:2px}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}";ut(ZNt,{});var Dbe,TL;let kbe=(TL=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Ee(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ee(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(M.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=fe(".post-edit-widget"),this.button=this._register(new Jd(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,ke.CLICK,()=>this.showSelector()))}getId(){return Dbe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[es.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Cr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>rl({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Dbe=TL,TL.baseId="editor.widget.postEditWidget",TL);kbe=Dbe=D([_(7,lr),_(8,Le),_(9,Ut)],kbe);let _X=class extends V{constructor(e,t,i,n,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new wn),this._register(M.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const c=async v=>{const b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n,o))},l=(v,b)=>{Fr(v)||(this._notificationService.error(b),i&&this.show(e[0],t,c))};let d;try{d=await n(a,o)}catch(v){return l(v,g(9845,`Error resolving edit '{0}': +{1}`,a.title,Nr(v)))}if(o.isCancellationRequested)return;const h=hZe(r.uri,e,d),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(h,{editor:this._editor,token:o}),m=r.getDecorationRange(f[0])}catch(v){return l(v,g(9846,`Error applying edit '{0}': +{1}`,a.title,Nr(v)))}finally{r.deltaDecorations(f,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,c)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(kbe,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};_X=D([_(4,we),_(5,PN),_(6,bi)],_X);var l0;const gZe="editor.changePasteType",xMe=new Q("pasteWidgetVisible",!1,g(4993,"Whether the paste widget is showing")),jhe="application/vnd.code.copyMetadata";var LL;let sC=(LL=class extends V{static get(e){return e.getContribution(l0.ID)}constructor(e,t,i,n,o,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(ue(c,"copy",l=>this.handleCopy(l))),this._register(ue(c,"cut",l=>this.handleCopy(l))),this._register(ue(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new mX("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(_X,"pasteIntoEditor",e,xMe,{id:gZe,label:g(4994,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Hu().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(x.pasteAs).enabled&&!this._editor.getOption(x.readOnly)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(!this._editor.hasTextFocus()||(Wn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const n=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!n)return;o=[new F(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,Qn),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=aZe(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=ar();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=Rr(async m=>{const v=Fi(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,o,h,m)}catch(w){console.error(w);return}})));v.reverse();for(const b of v)for(const[w,y]of b)h.replace(w,y);return h});l0._currentCopyOperation?.dataTransferPromise.cancel(),l0._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Lh.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e),o=cZe(e.clipboardData);o.delete(jhe);const r=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],Us.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const l=this._pasteAsActionContext?.preferred;return l&&c.providedPasteEditKinds&&!this.providerMatchesPreference(c,l)?!1:c.pasteMimeTypes?.some(d=>nZe(d,r))});if(!a.length){this._pasteAsActionContext?.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,n):this.doPasteInline(a,i,o,n,e)}showPasteAsNoEditMessage(e,t){Lh.get(this._editor)?.showMessage(g(4995,"No paste edits for '{0}' found",t instanceof Yn?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){const r=this._editor;if(!r.hasModel())return;const a=new Jk(r,jo.Value|jo.Selection,void 0),c=Rr(async l=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new Z,f=u.add(new ci(l));u.add(a.token.onCancellationRequested(()=>f.cancel()));const p=f.token;try{if(await this.mergeInDataFromCopy(i,n,p),p.isCancellationRequested)return;const m=e.filter(w=>this.isSupportedPasteProvider(w,i));if(!m.length||m.length===1&&m[0]instanceof FM)return this.applyDefaultPasteHandler(i,n,p,o);const v={triggerKind:b8.Automatic},b=await this.getPasteEdits(m,i,h,t,v,p);if(u.add(b),p.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof FM)return this.applyDefaultPasteHandler(i,n,p,o);if(b.edits.length){const w=d.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:b.edits},w,(y,C)=>new Promise((A,L)=>{(async()=>{try{const k=y.provider.resolveDocumentPasteEdit?.(y,C),P=new dc,R=k&&await this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4996,"Resolving paste edit. Click to cancel"),Promise.race([P.p,k]),{cancel:()=>(P.cancel(),L(new Ma))},0);return R&&(y.additionalEdit=R.additionalEdit),A(y)}catch(k){return L(k)}})()}),p)}await this.applyDefaultPasteHandler(i,n,p,o)}finally{u.dispose(),this._currentPasteOperation===c&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4997,"Running paste handlers. Click to cancel and do basic paste"),c,{cancel:async()=>{try{if(c.cancel(),a.token.isCancellationRequested)return;await this.applyDefaultPasteHandler(i,n,a.token,o)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=c}showPasteAsPick(e,t,i,n,o){const r=Rr(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new Z,h=d.add(new Jk(c,jo.Value|jo.Selection,void 0,a));try{if(await this.mergeInDataFromCopy(n,o,h.token),h.token.isCancellationRequested)return;let u=t.filter(b=>this.isSupportedPasteProvider(b,n,e));e&&(u=u.filter(b=>this.providerMatchesPreference(b,e)));const f={triggerKind:b8.PasteAs,only:e&&e instanceof Yn?e:void 0};let p=d.add(await this.getPasteEdits(u,n,l,i,f,h.token));if(h.token.isCancellationRequested)return;if(e&&(p={edits:p.edits.filter(b=>e instanceof Yn?e.contains(b.kind):e.providerId===b.provider.id),dispose:p.dispose}),!p.edits.length){f.only&&this.showPasteAsNoEditMessage(i,f.only);return}let m;if(e?m=p.edits.at(0):m=(await this._quickInputService.pick(p.edits.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(4998,"Select Paste Action")}))?.edit,!m)return;const v=hZe(l.uri,i,m);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:ud.Window,title:g(4999,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(jhe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(jhe);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=eme.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&l0._currentCopyOperation?.handle===t.id){const n=await l0._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of n)e.replace(o,r)}if(!e.has(Us.uriList)){const n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(Us.uriList,q6(Zk.create(n)))}}async getPasteEdits(e,t,i,n,o,r){const a=new Z,c=await U_(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,o,r);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Fr(h)||console.error(h);return}})),r),l=Fi(c??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return{edits:uZe(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(Us.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",oc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof Yn?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},l0=LL,LL.ID="editor.contrib.copyPasteActionController",LL);sC=l0=D([_(1,we),_(2,PN),_(3,dg),_(4,it),_(5,In),_(6,cg)],sC);const ys=new class{constructor(){this.QuickFix=new Yn("quickfix"),this.Refactor=new Yn("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Yn("notebook"),this.Source=new Yn("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var sd;(function(s){s.IfSingle="ifSingle",s.First="first",s.Never="never"})(sd||(sd={}));var sg;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(sg||(sg={}));function ePt(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>fZe(e,t,s.include))||!s.includeSourceActions&&ys.Source.contains(e))}function tPt(s,e){const t=e.kind?new Yn(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>fZe(t,i,s.include))||!s.includeSourceActions&&t&&ys.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function fZe(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class qw{static fromUser(e,t){return!e||typeof e!="object"?new qw(t.kind,t.apply,!1):new qw(qw.getKindFromUser(e,t.kind),qw.getApplyFromUser(e,t.apply),qw.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return sd.First;case"never":return sd.Never;case"ifsingle":return sd.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Yn(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class iPt{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){No(i)}t&&(this.action.edit=t.edit)}return this}}const DMe="editor.action.codeAction",kMe="editor.action.quickFix",pZe="editor.action.autoFix",IMe="editor.action.refactor",TMe="editor.action.sourceAction",Ibe="editor.action.organizeImports",Tbe="editor.action.fixAll";class B5 extends V{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:eo(e.diagnostics)?eo(t.diagnostics)?B5.codeActionsPreferredComparator(e,t):-1:eo(t.diagnostics)?1:B5.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(B5.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ys.QuickFix.contains(new Yn(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const rUe={actions:[],documentation:void 0};async function ZO(s,e,t,i,n,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ys.Notebook]},c={only:r.include?.value,trigger:i.type},l=new TRe(e,o),d=i.type===Ch.Auto,h=nPt(s,e,d?a:r),u=new Z,f=h.map(async m=>{try{n.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return rUe;const b=(v?.actions||[]).filter(y=>y&&tPt(r,y)),w=oPt(m,b,r.include);return{actions:b.map(y=>new iPt(y,m)),documentation:w}}catch(v){if(Fr(v))throw v;return No(v),rUe}}),p=s.onDidChange(()=>{const m=s.all(e);is(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(w=>w.actions).flat(),b=[...Fi(m.map(w=>w.documentation)),...sPt(s,e,i,v)];return new B5(v,b,u)}finally{p.dispose(),l.dispose()}}function nPt(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>ePt(t,new Yn(n))):!0)}function*sPt(s,e,t,i){if(e&&i.length)for(const n of s.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function oPt(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Yn(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n?.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new Yn(n.kind)))return o.command}}var Nx;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(Nx||(Nx={}));async function mZe(s,e,t,i,n=He.None){const o=s.get(PN),r=s.get(vi),a=s.get(Yi),c=s.get(bi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await o.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Nx.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=rPt(l);c.error(typeof d=="string"?d:g(4521,"An unknown error occurred while applying the code action"))}}function rPt(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}_t.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof N))throw Pi();const{codeActionProvider:o}=s.get(it),r=s.get(gi).getModel(e);if(!r)throw Pi();const a=dt.isISelection(t)?dt.liftSelection(t):F.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Pi();const c=typeof i=="string"?new Yn(i):void 0,l=await ZO(o,r,a,{type:Ch.Invoke,triggerAction:sg.Default,filter:{includeSourceActions:!0,include:c}},lu.None,He.None),d=[],h=Math.min(l.validActions.length,typeof n=="number"?n:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var Lbe,RL;let Rbe=(RL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ya(()=>this.keybindingService.getKeybindings().filter(t=>Lbe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Ibe?i={kind:ys.SourceOrganizeImports.value}:t.command===Tbe&&(i={kind:ys.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...qw.fromUser(i,{kind:Yn.None,apply:sd.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Yn(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}},Lbe=RL,RL.codeActionCommands=[IMe,DMe,TMe,Ibe,Tbe],RL);Rbe=Lbe=D([_(0,Ut)],Rbe);var aPt='.action-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-editorWidget-border)!important;border-radius:0;border-radius:2px;color:var(--vscode-editorWidget-foreground);display:block;font-size:13px;max-width:80vw;min-width:160px;width:100%;z-index:40}.context-view-block{z-index:-1}.context-view-block,.context-view-pointerBlock{cursor:auto;height:100%;left:0;position:fixed;top:0;width:100%}.context-view-pointerBlock{z-index:2}.action-widget .monaco-list{border:0!important;user-select:none;-webkit-user-select:none}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{cursor:pointer;padding:0 10px;touch-action:none;white-space:nowrap;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before,.action-widget .monaco-list .option-disabled:before{-webkit-touch-callout:none;background-color:transparent!important;cursor:default!important;outline:0 solid!important;-webkit-user-select:none;user-select:none}.action-widget .monaco-list-row.action{align-items:center;display:flex;gap:6px}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{content:"";display:block;width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}';ut(aPt,{});const _Ze="acceptSelectedCodeAction",vZe="previewSelectedCodeAction";var p_;(function(s){s.Action="action",s.Header="header"})(p_||(p_={}));class cPt{get templateId(){return p_.Header}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??""}disposeTemplate(e){}}let Mbe=class{get templateId(){return p_.Action}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=new qk(e,po);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=We.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=ze(e.group.icon.color.id))):(i.icon.className=We.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=bZe(e.label),i.keybinding.set(e.keybinding),uTe(!!e.keybinding,i.keybinding.element);const n=this._keybindingService.lookupKeybinding(_Ze)?.getLabel(),o=this._keybindingService.lookupKeybinding(vZe)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:n&&o?this._supportsPreview&&e.canPreview?i.container.title=g(11229,"{0} to Apply, {1} to Preview",n,o):i.container.title=g(11230,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Mbe=D([_(1,Ut)],Mbe);class lPt extends UIEvent{constructor(){super("acceptSelectedAction")}}class aUe extends UIEvent{constructor(){super("previewSelectedAction")}}function dPt(s){if(s.kind==="action")return s.label}let Nbe=class extends V{constructor(e,t,i,n,o,r){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ci),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===p_.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Xa(e,this.domNode,a,[new Mbe(t,this._keybindingService),new cPt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:dPt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===p_.Action){let l=c.label?bZe(c?.label):"";return c.disabled&&(l=g(11231,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(11232,"Action Widget"),getRole:c=>c.kind===p_.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(ON),this._register(this._list.onMouseClick(c=>this.onListClick(c))),this._register(this._list.onMouseOver(c=>this.onListHover(c))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(c=>this.onListSelection(c))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind===p_.Action}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let o=e;if(this._allMenuItems.length>=50)o=380;else{const c=this._allMenuItems.map((l,d)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(d));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});o=Math.max(...c,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new aUe:new lPt;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof aUe):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind===p_.Action){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Nbe=D([_(4,mf),_(5,Ut)],Nbe);function bZe(s){return s.replace(/\r\n|\r|\n/g," ")}const wZe=Object.freeze({kind:Yn.Empty,title:g(9847,"More Actions...")}),hPt=Object.freeze([{kind:ys.QuickFix,title:g(9848,"Quick Fix")},{kind:ys.RefactorExtract,title:g(9849,"Extract"),icon:ve.wrench},{kind:ys.RefactorInline,title:g(9850,"Inline"),icon:ve.wrench},{kind:ys.RefactorRewrite,title:g(9851,"Rewrite"),icon:ve.wrench},{kind:ys.RefactorMove,title:g(9852,"Move"),icon:ve.wrench},{kind:ys.SurroundWith,title:g(9853,"Surround With"),icon:ve.surroundWith},{kind:ys.Source,title:g(9854,"Source Action"),icon:ve.symbolFile},wZe]);function uPt(s,e,t){if(!e)return s.map(o=>({kind:p_.Action,item:o,group:wZe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=hPt.map(o=>({group:o,actions:[]}));for(const o of s){const r=o.action.kind?new Yn(o.action.kind):Yn.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const n=[];for(const o of i)if(o.actions.length){n.push({kind:p_.Header,group:o.group});for(const r of o.actions){const a=o.group;n.push({kind:p_.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gPt='.monaco-editor .lightBulbWidget{align-items:center;display:flex;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{cursor:pointer;display:block}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}';ut(gPt,{});var NP;const cUe=oi("gutter-lightbulb",ve.lightBulb,g(5031,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),lUe=oi("gutter-lightbulb-auto-fix",ve.lightbulbAutofix,g(5032,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),dUe=oi("gutter-lightbulb-sparkle",ve.lightbulbSparkle,g(5033,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),hUe=oi("gutter-lightbulb-aifix-auto-fix",ve.lightbulbSparkleAutofix,g(5034,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),uUe=oi("gutter-lightbulb-sparkle-filled",ve.sparkleFilled,g(5035,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var Ad;(function(s){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=s.Type||(s.Type={})),s.Hidden={type:e.Hidden};class t{constructor(n,o,r,a){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}s.Showing=t})(Ad||(Ad={}));var WS;let Q3=(WS=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=Ad.Hidden,this._gutterState=Ad.Hidden,this._iconClasses=[],this.gutterDecoration=NP.GUTTER_DECORATION,this._domNode=fe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(fd.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==Ad.Type.Showing||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==Ad.Type.Showing||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(fdt(this._domNode,i=>{if(this.state.type!==Ad.Type.Showing)return;this._editor.focus(),i.preventDefault();const{top:n,height:o}=Cr(this._domNode),r=this._editor.getOption(x.lineHeight);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(M.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(pZe)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(kMe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{const n=["codicon-"+cUe.id,"codicon-"+hUe.id,"codicon-"+lUe.id,"codicon-"+dUe.id,"codicon-"+uUe.id];if(!i.target.element||!n.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==Ad.Type.Showing)return;this._editor.focus();const{top:o,height:r}=Cr(i.target.element),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,f=w=>w>2&&this._editor.getTopForLineNumber(w)===this._editor.getTopForLineNumber(w-1);let p=r,m=1;if(!u){const w=y=>{const C=o.getLineContent(y);return/^\s*$|^\s+/.test(C)||C.length<=m};if(r>1&&!f(r-1)){const y=o.getLineCount(),C=r===y,A=r>1&&w(r-1),L=!C&&w(r+1),k=w(r),P=!L&&!A;let R=!1;const z=this._editor.getLineDecorations(r);if(z)for(const G of z)G.options.glyphMarginClassName?.includes(ve.debugBreakpoint.id)&&(R=!0);if(!L&&!A&&!R)return this.gutterState=new Ad.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:NP._posPref}),this.renderGutterLightbub(),this.hide();A||C||P&&!k?p-=1:(L||P&&k)&&(p+=1)}else{if(r===1&&(r===o.getLineCount()||!w(r+1)&&!w(r)))return this.gutterState=new Ad.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:NP._posPref}),this.renderGutterLightbub(),this.hide();if(r{this._gutterDecorationID=t.addDecoration(new F(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new F(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===Ad.Type.Showing&&(t?this.title=g(5036,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=g(5037,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=g(5038,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=g(5039,"Show Code Actions")))}set title(e){this._domNode.title=e}},NP=WS,WS.GUTTER_DECORATION=Gt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:We.asClassName(ve.lightBulb),glyphMargin:{position:K_.Left},stickiness:ni.NeverGrowsWhenTypingAtEdges}),WS.ID="editor.contrib.lightbulbWidget",WS._posPref=[es.EXACT],WS);Q3=NP=D([_(1,Ut)],Q3);W("actionBar.toggledBackground",a6,g(9855,"Background color for toggled action items in action bar."));const OM={Visible:new Q("codeActionMenuVisible",!1,g(9856,"Whether the action widget list is visible"))},$N=ae("actionWidgetService");let BM=class extends V{get isVisible(){return OM.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new wn)}show(e,t,i,n,o,r,a){const c=OM.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(Nbe,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}clear(){this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new Z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(ue(a,ke.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(ue(l,ke.POINTER_MOVE,()=>l.remove())),o.add(ue(l,ke.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(n.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=o.add(Ac(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=fe(e),n=new hd(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};BM=D([_(0,mf),_(1,Le),_(2,we)],BM);ce($N,BM,qt.Delayed);const Q6=Ae.EditorContrib+1e3;At(class extends li{constructor(){super({id:"hideCodeActionWidget",title:Pe(9857,"Hide action widget"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.Escape,secondary:[U.Shift|S.Escape]}})}run(s){s.get($N).hide(!0)}});At(class extends li{constructor(){super({id:"selectPrevCodeAction",title:Pe(9858,"Select previous action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}})}run(s){const e=s.get($N);e instanceof BM&&e.focusPrevious()}});At(class extends li{constructor(){super({id:"selectNextCodeAction",title:Pe(9859,"Select next action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}})}run(s){const e=s.get($N);e instanceof BM&&e.focusNext()}});At(class extends li{constructor(){super({id:_Ze,title:Pe(9860,"Accept selected action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.Enter,secondary:[U.CtrlCmd|S.Period]}})}run(s){const e=s.get($N);e instanceof BM&&e.acceptSelected()}});At(class extends li{constructor(){super({id:vZe,title:Pe(9861,"Preview selected action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:U.CtrlCmd|S.Enter}})}run(s){const e=s.get($N);e instanceof BM&&e.acceptSelected(!0)}});const yZe=new Q("supportedCodeAction",""),gUe="_typescript.applyFixAllCodeAction";class fPt extends V{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Cm),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>ji(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:Ch.Auto,triggerAction:sg.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===Ch.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==a_.Off){{if(i===a_.On)return t;if(i===a_.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),c=o.getLineContent(r);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var Fv;(function(s){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=s.Type||(s.Type={})),s.Empty={type:e.Empty};class t{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Fr(a))return CZe;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=t})(Fv||(Fv={}));const CZe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class pPt extends V{constructor(e,t,i,n,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new wn),this._state=Fv.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=yZe.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.lightbulb)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Fv.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Fv.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(x.readOnly)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new fPt(this._editor,this._markerService,i=>{if(!i){this.setState(Fv.Empty);return}const n=i.selection.getStartPosition(),o=Rr(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===Ch.Invoke&&(i.trigger.triggerAction===sg.QuickFix||i.trigger.filter?.include?.contains(ys.QuickFix))){const l=await ZO(this._registry,e,i.selection,i.trigger,lu.None,c),d=[...l.allActions];if(c.isCancellationRequested)return CZe;const h=l.validActions?.some(f=>f.action.kind?ys.QuickFix.contains(new Yn(f.action.kind)):!1),u=this._markerService.read({resource:e.uri});if(h){for(const f of l.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(gUe))&&(f.action.diagnostics=[...u.filter(p=>p.relatedInformation)]);return{validActions:l.validActions,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}else if(!h&&u.length>0){const f=i.selection.getPosition();let p=f,m=Number.MAX_VALUE;const v=[...l.validActions];for(const w of u){const y=w.endColumn,C=w.endLineNumber,A=w.startLineNumber;if(C===f.lineNumber||A===f.lineNumber){p=new oe(C,y);const L={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ys.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new dt(p.lineNumber,p.column,p.lineNumber,p.column),P=await ZO(this._registry,e,k,L,lu.None,c);if(P.validActions.length!==0){for(const R of P.validActions)R.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(gUe))&&(R.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...P.allActions),Math.abs(f.column-y)C.findIndex(A=>A.action.title===w.action.title)===y);return b.sort((w,y)=>w.action.isPreferred&&!y.action.isPreferred?-1:!w.action.isPreferred&&y.action.isPreferred||w.action.isAI&&!y.action.isAI?1:!w.action.isAI&&y.action.isAI?-1:0),{validActions:b,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return ZO(this._registry,e,i.selection,i.trigger,lu.None,c)});i.trigger.type===Ch.Invoke&&this._progressService?.showWhile(o,250);const r=new Fv.Triggered(i.trigger,n,o);let a=!1;this._state.type===Fv.Type.Triggered&&(a=this._state.trigger.type===Ch.Invoke&&r.type===Fv.Type.Triggered&&r.trigger.type===Ch.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:Ch.Auto,triggerAction:sg.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===Fv.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var PP;const mPt="quickfix-edit-highlight";var VD;let WM=(VD=class extends V{static get(e){return e.getContribution(PP.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new wn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new pPt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new ya(()=>{const h=this._editor.getContribution(Q3.ID);return h&&this._register(h.onClick(u=>this.showCodeActionsFromLightbulb(u.actions,u))),h}),this._resolver=n.createInstance(Rbe),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,Nx.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}hideCodeActions(){this._actionWidgetService.hide()}manualTriggerAtCurrentPosition(e,t,i,n){if(!this._editor.hasModel())return;Lh.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:Ch.Invoke,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(mZe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:Ch.Auto,triggerAction:sg.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==Fv.Type.Triggered){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(i){vt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===Ch.Invoke){if(e.trigger.filter?.include){const n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this._applyCodeAction(n,!1,!1,Nx.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Lh.get(this._editor)?.showMessage(o.action.disabled,e.trigger.context.position),t.dispose();return}}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length)){Lh.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===sd.First&&t.validActions.length===0||e.autoApply===sd.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===sd.First&&t.validActions.length>0||e.autoApply===sd.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=oe.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?Nx.FromAILightbulb:Nx.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:l=>{this._editor?.focus(),n.clear()},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new Yn(u);h=[ys.RefactorExtract,ys.RefactorInline,ys.RefactorRewrite,ys.RefactorMove,ys.Source].some(m=>m.contains(f))}return{canPreview:h||!!l.action.edit?.edits.length}},onFocus:l=>{if(l&&l.action){const d=l.action.ranges,h=l.action.diagnostics;if(n.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:PP.DECORATION})):d.map(f=>({range:f,options:PP.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:PP.DECORATION}));n.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Ah(g(5028,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,uPt(r,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,mt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Cr(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,y:o}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:g(5029,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(5030,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}},PP=VD,VD.ID="editor.contrib.codeActionController",VD.DECORATION=Gt.register({description:"quickfix-highlight",className:mPt}),VD);WM=PP=D([_(1,Am),_(2,Le),_(3,we),_(4,it),_(5,XA),_(6,vi),_(7,Te),_(8,$N),_(9,we)],WM);Cp((s,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",s.getColor(_b));const i=s.getColor(Cx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Ry(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Pbe;const SZe="editor.experimental.dropIntoEditor.defaultProvider",AZe="editor.changeDropType",LMe=new Q("dropWidgetVisible",!1,g(5050,"Whether the drop widget is showing"));var ML;let HM=(ML=class extends V{static get(e){return e.getContribution(Pbe.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=fX.getInstance(),this._dropProgressManager=this._register(t.createInstance(mX,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(_X,"dropIntoEditor",e,LMe,{id:AZe,label:g(5051,"Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;this._currentOperation?.cancel(),e.focus(),e.setPosition(t);const n=Rr(async o=>{const r=new Z,a=r.add(new Jk(e,jo.Value,void 0,o));try{const c=await this.extractDataTransferData(i);if(c.size===0||a.token.isCancellationRequested)return;const l=e.getModel();if(!l)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(l).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(f=>c.matches(f)):!0),h=r.add(await this.getDropEdits(d,l,t,c,a));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(l,h.edits),f=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([F.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},f,async p=>p,o)}}finally{r.dispose(),this._currentOperation===n&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(5052,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),this._currentOperation=n}async getDropEdits(e,t,i,n,o){const r=new Z,a=await U_(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,o.token);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:l.id}))}catch(d){console.error(d)}})),o.token),c=Fi(a??[]).flat();return{edits:uZe(c),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(SZe,{resource:e.uri});for(const[n,o]of Object.entries(i)){const r=new Yn(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&nZe(n,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new lce;const t=cZe(e.dataTransfer);if(this.treeItemsTransfer.hasData(KWe.prototype)){const i=this.treeItemsTransfer.getData(KWe.prototype);if(Array.isArray(i))for(const n of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Pbe=ML,ML.ID="editor.contrib.dropIntoEditorController",ML);HM=Pbe=D([_(1,we),_(2,Te),_(3,it),_(4,Nae)],HM);var _Pt=".monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}";ut(_Pt,{});function Fbe(s,e){return!!s[e]}class Yhe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Fbe(e.event,t.triggerModifier),this.hasSideBySideModifier=Fbe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class fUe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Fbe(e,t.triggerModifier)}}class wK{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function pUe(s){return s==="altKey"?Qt?new wK(S.Meta,"metaKey",S.Alt,"altKey"):new wK(S.Ctrl,"ctrlKey",S.Alt,"altKey"):Qt?new wK(S.Alt,"altKey",S.Meta,"metaKey"):new wK(S.Alt,"altKey",S.Ctrl,"ctrlKey")}class dce extends V{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new I),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new I),this.onExecute=this._onExecute.event,this._onCancel=this._register(new I),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=pUe(this._editor.getOption(x.multiCursorModifier)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(x.multiCursorModifier)){const n=pUe(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new Yhe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new Yhe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new Yhe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new fUe(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new fUe(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}let vPt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class vX{constructor(e){this._disposables=new Z;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new vPt(r,n));t=vX._union(t,o),wN(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,r,a;for(n=0,r=0,o=e.length,a=t.length;nPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},No));return Promise.all(n).then(()=>{const o=new vX(Fi(i));return t.isCancellationRequested?(o.dispose(),new vX([])):o})}_t.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;Tt(t instanceof N),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)return[];const r=await EZe(n,o,He.None);if(!r)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new dce(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(x.links)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(x.links))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Rr(t=>EZe(this.providers,e,t));try{const t=new js(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){vt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(eB.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{n.activate(o,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(x.multiCursorModifier)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(He.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===pe.file&&o.startsWith(`${pe.file}:`)){const a=N.parse(o);if(a.scheme===pe.file){const c=Zm(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=Pt(r,l))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(g(1508,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(g(1509,"Failed to open this link because its target is missing.")):vt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===Rt.CONTENT_TEXT&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Obe=NL,NL.ID="editor.linkDetector",NL);yW=Obe=D([_(1,Ao),_(2,bi),_(3,it),_(4,Sp)],yW);const mUe={general:Gt.register({description:"detected-link",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Gt.register({description:"detected-link-active",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class eB{static decoration(e,t){return{range:e.range,options:eB._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?mUe.active:mUe.general};return n.hoverMessage=bPt(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,eB._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,eB._getOptions(this.link,t,!1))}}function bPt(s,e){const t=s.url&&/^command:/i.test(s.url.toString()),i=s.tooltip?s.tooltip:t?g(1510,"Execute command"):g(1511,"Follow link"),n=e?Qt?g(1512,"cmd + click"):g(1513,"ctrl + click"):Qt?g(1514,"option + click"):g(1515,"alt + click");if(s.url){let o="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(1516,"Execute command {0}",c)}}return new Mt("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${n})`)}else return new Mt().appendText(`${i} (${n})`)}class wPt extends tt{constructor(){super({id:"editor.action.openLink",label:g(1517,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yW.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const o of n){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}on(yW.ID,yW,ri.AfterFirstRender);Re(wPt);const hce="editor.contrib.selectionClipboard",xZe="editor.action.showHover",yPt="editor.action.showDefinitionPreviewHover",CPt="editor.action.scrollUpHover",SPt="editor.action.scrollDownHover",APt="editor.action.scrollLeftHover",EPt="editor.action.scrollRightHover",xPt="editor.action.pageUpHover",DPt="editor.action.pageDownHover",kPt="editor.action.goToTopHover",IPt="editor.action.goToBottomHover",zU="editor.action.increaseHoverVerbosityLevel",TPt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",LPt=g(9864,"Increase Hover Verbosity Level"),$U="editor.action.decreaseHoverVerbosityLevel",RPt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",MPt=g(9865,"Decrease Hover Verbosity Level");var Hl;(function(s){s[s.Idle=0]="Idle",s[s.FirstWait=1]="FirstWait",s[s.SecondWait=2]="SecondWait",s[s.WaitingForAsync=3]="WaitingForAsync",s[s.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Hl||(Hl={}));var oC;(function(s){s[s.Delayed=0]="Delayed",s[s.Immediate=1]="Immediate"})(oC||(oC={}));var FA;(function(s){s[s.Mouse=0]="Mouse",s[s.Keyboard=1]="Keyboard"})(FA||(FA={}));let NPt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class DZe extends V{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new cn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new cn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new cn(()=>this._triggerLoadingMessage(),0)),this._state=Hl.Idle,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(x.hover).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(Hl.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Flt(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===Hl.WaitingForAsync||this._state===Hl.WaitingForAsyncShowingLoading)&&this._setState(Hl.Idle)}catch(e){vt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Hl.Idle:Hl.WaitingForAsync)}_triggerLoadingMessage(){this._state===Hl.WaitingForAsync&&this._setState(Hl.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Hl.FirstWait||this._state===Hl.SecondWait)return;const e=this._state===Hl.Idle,t=this._state===Hl.WaitingForAsyncShowingLoading;this._onResult.fire(new NPt(this._result.slice(0),e,t))}start(e){if(e===oC.Delayed)this._state===Hl.Idle&&(this._setState(Hl.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Hl.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Hl.SecondWait:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(Hl.Idle,!1)}}const PPt=30,FPt=24;class OPt extends V{constructor(e,t=new bn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new wMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new bn(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?oe.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Cr(t).top+i.top-PPt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Cr(t),o=z_(t.ownerDocument.body),r=n.top+i.top+i.height;return o.height-r-FPt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(n,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=n?es.ABOVE:es.BELOW:a=r<=i?es.BELOW:es.ABOVE,a===es.ABOVE?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var ew;const _Ue=30,BPt=6;var zD;let bX=(zD=class extends OPt{get isVisibleFromKeyboard(){return this._renderedHover?.source===FA.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new bn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new CLe),this._onDidResize=this._register(new I),this.onDidResize=this._onDidResize.event,this._minimumSize=c,this._hoverVisibleKey=J.hoverVisible.bindTo(t),this._hoverFocusedKey=J.hoverFocused.bindTo(t),re(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(x.fontInfo)&&this._updateFont()}));const l=this._register(Ac(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return ew.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return ew._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return ew._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){ew._applyMaxDimensions(this._hover.contentsDomNode,e,t),ew._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new bn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){ew._lastDimensions=new bn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===es.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=BPt;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(x.fontInfo),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,ew._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,ew._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?Io.LeftOfInjectedText:void 0,preference:[this._positionPreference??es.ABOVE]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=fb(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??es.ABOVE,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const o=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&xQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");o&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+o)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new bn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}setMinimumDimensions(e){this._minimumSize=new bn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new bn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=fb(e),i=Pd(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=fb(e),i=Pd(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=fb(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-_Ue})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+_Ue})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},ew=zD,zD.ID="editor.contrib.resizableContentHoverWidget",zD._lastDimensions=new bn(0,0),zD);bX=ew=D([_(1,Le),_(2,Te),_(3,mr),_(4,Ut)],bX);function vUe(s,e,t,i,n,o){const r=t+n/2,a=i+o/2,c=Math.max(Math.abs(s-r)-n/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var du;(function(s){s[s.Range=1]="Range",s[s.ForeignElement=2]="ForeignElement"})(du||(du={}));class Jhe{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=du.Range}equals(e){return e.type===du.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===du.Range&&t.lineNumber===this.range.startLineNumber}}class aQ{constructor(e,t,i,n,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=du.ForeignElement}equals(e){return e.type===du.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===du.ForeignElement&&this.owner===e.owner}}class UM{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const GN=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class wX{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=FA.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==du.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,c=r.range.endLineNumber===n?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>c)return!1}else if(a>t.range.startColumn||t.range.endColumn>c)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Qd.EMPTY;const i=wX._getLineDecorations(this._editor,t);return Qd.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Qd.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=wX._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Fi(t)}}class kZe{constructor(e,t,i){this.anchor=e,this.hoverParts=t,this.isComplete=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new WPt(this,this.anchor,t,this.isComplete)}}class WPt extends kZe{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}const bUe=fe;let yX=class extends V{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=bUe("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=re(this.hoverElement,bUe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(SLe.render(this.actionsElement,e,i));return this.actions.push(n),n}append(e){const t=re(this.actionsElement,e);return this._hasContent=!0,t}};yX=D([_(0,Ut)],yX);class HPt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function UPt(s,e,t,i,n){const o=await Promise.resolve(s.provideHover(t,i,n)).catch(No);if(!(!o||!VPt(o)))return new HPt(s,o,e)}function RMe(s,e,t,i,n=!1){const r=s.ordered(e,n).map((a,c)=>UPt(a,c,e,t,i));return Qd.fromPromises(r).coalesce()}function IZe(s,e,t,i,n=!1){return RMe(s,e,t,i,n).map(o=>o.hover).toPromise()}rg("_executeHoverProvider",(s,e,t)=>{const i=s.get(it);return IZe(i.hoverProvider,e,t,He.None)});rg("_executeHoverProvider_recursive",(s,e,t)=>{const i=s.get(it);return IZe(i.hoverProvider,e,t,He.None,!0)});function VPt(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}const _F=fe,zPt=oi("hover-increase-verbosity",ve.add,g(5160,"Icon for increaseing hover verbosity.")),$Pt=oi("hover-decrease-verbosity",ve.remove,g(5161,"Icon for decreasing hover verbosity."));class m_{constructor(e,t,i,n,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class TZe{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Mc.Increase:return this.hover.canIncreaseVerbosity??!1;case Mc.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let j3=class{constructor(e,t,i,n,o,r,a,c){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this._commandService=c,this.hoverOrdinal=3}createLoadingMessage(e){return new m_(this,e.range,[new Mt().appendText(g(5162,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==du.Range)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];let a=1e3;const c=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(x.stopRenderingLineAfter),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let u=!1;d>=0&&c>d&&e.range.startColumn>=d&&(u=!0,r.push(new m_(this,e.range,[{value:g(5163,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&c>=h&&r.push(new m_(this,e.range,[{value:g(5164,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const p of t){const m=p.range.startLineNumber===n?p.range.startColumn:1,v=p.range.endLineNumber===n?p.range.endColumn:o,b=p.options.hoverMessage;if(!b||Q2(b))continue;p.options.beforeContentClassName&&(f=!0);const w=new F(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new m_(this,w,H_(b),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==du.Range)return Qd.EMPTY;const n=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(n)?this._getMarkdownHovers(o,n,e,i):Qd.EMPTY}_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition();return RMe(e,t,o,n).filter(c=>!Q2(c.hover.contents)).map(c=>{const l=c.hover.range?F.lift(c.hover.range):i.range,d=new TZe(c.hover,c.provider,o);return new m_(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new GPt(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i))}};j3=D([_(1,xi),_(2,Ao),_(3,Te),_(4,it),_(5,Ut),_(6,ec),_(7,vi)],j3);class yK{constructor(e,t,i){this.hoverPart=e,this.hoverElement=t,this.disposables=i}get hoverAccessibleContent(){return this.hoverElement.innerText.trim()}dispose(){this.disposables.dispose()}}class GPt{constructor(e,t,i,n,o,r,a,c,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=o,this._openerService=r,this._commandService=a,this._keybindingService=c,this._hoverService=l,this._configurationService=d,this._onFinishedRendering=h,this._ongoingHoverOperations=new Map,this._disposables=new Z,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Ee(()=>{this.renderedHoverParts.forEach(u=>{u.dispose()}),this._ongoingHoverOperations.forEach(u=>{u.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(Cc(n=>n.ordinal,nu)),e.map(n=>{const o=this._renderHoverPart(n,i);return t.appendChild(o.hoverElement),o})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,o=e.source,r=new Z;if(r.add(i),!o)return new yK(e,n,r);const a=o.supportsVerbosityAction(Mc.Increase),c=o.supportsVerbosityAction(Mc.Decrease);if(!a&&!c)return new yK(e,n,r);const l=_F("div.verbosity-actions");return n.prepend(l),r.add(this._renderHoverExpansionAction(l,Mc.Increase,a)),r.add(this._renderHoverExpansionAction(l,Mc.Decrease,c)),new yK(e,n,r)}_renderMarkdownHover(e,t){return LZe(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Z,o=t===Mc.Increase,r=re(e,_F(We.asCSSSelector(o?zPt:$Pt)));r.tabIndex=0;const a=new xM("mouse",!1,{target:e,position:{hoverPosition:vo.LEFT}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,r,RZe(this._keybindingService,t))),!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const c=()=>this._commandService.executeCommand(t===Mc.Increase?zU:$U);return n.add(new DQe(r,c)),n.add(new kQe(r,c,[S.Enter,S.Space])),n}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const n=this._editor.getModel();if(!n)return;const o=this._getRenderedHoverPartAtIndex(t),r=o?.hoverPart.source;if(!o||!r?.supportsVerbosityAction(e))return;const a=await this._fetchHover(r,n,e);if(!a)return;const c=new TZe(a,r.hoverProvider,r.hoverPosition),l=o.hoverPart,d=new m_(this._hoverParticipant,l.range,a.contents,l.isBeforeContent,l.ordinal,c),h=this._renderHoverPart(d,this._onFinishedRendering);return this._replaceRenderedHoverPartAtIndex(t,h,d),i&&this._focusOnHoverPartWithIndex(t),{hoverPart:d,hoverElement:h.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e),n=i?.hoverPart.source;return!(!i||!n?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let n=i===Mc.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),n+=r.verbosityDelta);const a=new ci;this._ongoingHoverOperations.set(o,{verbosityDelta:n,tokenSource:a});const c={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){No(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const n=this.renderedHoverParts[e],o=n.hoverElement,r=t.hoverElement,a=Array.from(r.children);o.replaceChildren(...a);const c=new yK(i,o,t.disposables);o.focus(),n.dispose(),this.renderedHoverParts[e]=c}_focusOnHoverPartWithIndex(e){this.renderedHoverParts[e].hoverElement.focus()}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function KPt(s,e,t,i,n){e.sort(Cc(r=>r.ordinal,nu));const o=[];for(const r of e)o.push(LZe(t,r,i,n,s.onContentsChanged));return new UM(o)}function LZe(s,e,t,i,n){const o=new Z,r=_F("div.hover-row"),a=_F("div.hover-row-contents");r.appendChild(a);const c=e.contents;for(const d of c){if(Q2(d))continue;const h=_F("div.markdown-hover"),u=re(h,_F("div.hover-contents")),f=o.add(new Y_({editor:s},t,i));o.add(f.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n()}));const p=o.add(f.render(d));u.appendChild(p.element),a.appendChild(h)}return{hoverPart:e,hoverElement:r,dispose(){o.dispose()}}}function RZe(s,e){switch(e){case Mc.Increase:{const t=s.lookupKeybinding(zU);return t?g(5165,"Increase Hover Verbosity ({0})",t.getLabel()):g(5166,"Increase Hover Verbosity")}case Mc.Decrease:{const t=s.lookupKeybinding($U);return t?g(5167,"Decrease Hover Verbosity ({0})",t.getLabel()):g(5168,"Decrease Hover Verbosity")}}}const MZe=[];function j6(s){MZe.push(s)}function qPt(){return MZe.slice(0)}class MMe{constructor(e,t){this._editorWorkerClient=new STe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,r=o.alpha,a=new me(new dn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),l=r?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),d=r?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:n,text:c}}),h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h}}let Bbe=class extends V{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new MMe(e,t)))}};Bbe=D([_(0,gi),_(1,Vs),_(2,it)],Bbe);j6(Bbe);async function NZe(s,e,t,i=!0){return NMe(new QPt,s,e,t,i)}function PZe(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class QPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({colorInfo:r,provider:e});return Array.isArray(o)}}class jPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class YPt{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,He.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function NMe(s,e,t,i,n){let o=!1,r;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof MMe)r=d;else try{await s.compute(d,t,i,a)&&(o=!0)}catch(h){No(h)}}return o?a:r&&n?(await s.compute(r,t,i,a),a):[]}function FZe(s,e){const{colorProvider:t}=s.get(it),i=s.get(gi).getModel(e);if(!i)throw Pi();const n=s.get(Te).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}_t.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:o}=FZe(s,t);return NMe(new jPt,n,i,He.None,o)});_t.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof N)||!Array.isArray(t)||t.length!==4||!F.isIRange(o))throw Pi();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=FZe(s,n),[l,d,h,u]=t;return NMe(new YPt({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,He.None,c)});var Wbe;const OZe=Object.create({});var $D;let VM=($D=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Z),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new aY(this._editor),this._decoratorLimitReporter=new JPt,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:Wbe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(x.colorDecoratorsLimit),c=o.hasChanged(x.defaultColorDecorators);(a||c)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(x.colorDecorators)}get limitReporter(){return this._decoratorLimitReporter}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Cm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Rr(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new js(!1),n=await NZe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){vt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Gt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},Wbe=$D,$D.ID="editor.contrib.colorDetector",$D.RECOMPUTE_TIME=1e3,$D);VM=Wbe=D([_(1,Te),_(2,it),_(3,Sp)],VM);class JPt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}on(VM.ID,VM,ri.AfterFirstRender);class XPt{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new I,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new I,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n{this.backgroundColor=r.getColor(sY)||me.white})),this._register(ue(this._pickedColorNode,ke.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ue(this._originalColorNode,ke.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new tFt(this._domNode)))}get domNode(){return this._domNode}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class tFt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),re(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),re(this._button,t),re(t,ep(".button"+We.asCSSSelector(oi("color-picker-close",ve.close,g(9863,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}}class iFt extends V{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=ep(".colorpicker-body"),re(e,this._domNode),this._saturationBox=new nFt(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new sFt(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new oFt(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new rFt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new me(new fy(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new fy(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new me(new fy(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get opacityStrip(){return this._opacityStrip}get hueStrip(){return this._hueStrip}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class nFt extends V{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._domNode=ep(".saturation-wrap"),re(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",re(this._domNode,this._canvas),this.selection=ep(".saturation-selection"),re(this._domNode,this.selection),this.layout(),this._register(ue(this._domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}get canvas(){return this._canvas}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new SU);const t=Cr(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=ue(e.target.ownerDocument,ke.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new me(new fy(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=me.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class BZe extends V{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=re(e,ep(".standalone-strip")),this.overlay=re(this.domNode,ep(".standalone-overlay"))):(this.domNode=re(e,ep(".strip")),this.overlay=re(this.domNode,ep(".overlay"))),this.slider=re(this.domNode,ep(".slider")),this.slider.style.top="0px",this._register(ue(this.domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new SU),i=Cr(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const n=ue(e.target.ownerDocument,ke.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class sFt extends BZe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,o=new me(new dn(t,i,n,1)),r=new me(new dn(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class oFt extends BZe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class rFt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=re(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const Mse=class Mse extends pd{constructor(e,t,i,n,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(L8.getInstance(ct(e)).onDidChange(()=>this.layout())),this._domNode=ep(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new eFt(this._domNode,this.model,n,o)),this.body=this._register(new iFt(this._domNode,this.model,this.pixelRatio,o))}getId(){return Mse.ID}layout(){this.body.layout()}get domNode(){return this._domNode}};Mse.ID="editor.contrib.colorPickerWidget";let Hbe=Mse;class aFt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Y3=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Qd.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=VM.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const r=n.getColorData(o.range.getStartPosition());if(r)return[await WZe(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){const i=HZe(this,this._editor,this._themeService,t,e);if(!i)return new UM([]);this._colorPicker=i.colorPicker;const n={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new UM([n])}getAccessibleContent(e){return g(5040,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}isColorPickerVisible(){return!!this._colorPicker}};Y3=D([_(1,pn)],Y3);class cFt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let J3=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!VM.get(this._editor))return null;const o=await NZe(i,this._editor.getModel(),He.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;F.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await WZe(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new F(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await cQ(this._editor.getModel(),t,this._color,i,e),i=UZe(this._editor,i,t))}renderHoverParts(e,t){return HZe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};J3=D([_(1,pn)],J3);async function WZe(s,e,t,i){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new dn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new me(l),h=await PZe(e,t,i,He.None),u=new XPt(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,n),s instanceof Y3?new aFt(s,F.lift(t.range),u,i):new cFt(s,F.lift(t.range),u,i)}function HZe(s,e,t,i,n){if(i.length===0||!e.hasModel())return;if(n.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;n.setMinimumDimensions(new bn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new Hbe(n.fragment,c,e.getOption(x.pixelRatio),t,s instanceof J3));let d=!1,h=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof J3){const u=r.model.color;s.color=u,cQ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{s.color=f}))}else o.add(c.onColorFlushed(async u=>{await cQ(a,c,u,h,r),d=!0,h=UZe(e,h,c)}));return o.add(c.onDidChangeColor(u=>{cQ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(n.hide(),e.focus())})),{hoverPart:r,colorPicker:l,disposables:o}}function UZe(s,e,t){const i=[],n=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(n),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=F.lift(n.range),r=s.getModel()._setTrackedRange(null,o,ni.GrowsOnlyWhenTypingAfter);return s.executeEdits("colorpicker",i),s.pushUndoStop(),s.getModel()._getTrackedRange(r)??o}async function cQ(s,e,t,i,n){const o=await PZe(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,He.None);e.colorPresentations=o||[]}class VZe{constructor(e,t){this.range=e,this.direction=t}}class PMe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new PMe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){No(t),this._isResolved=!1}}}const eO=class eO{static async create(e,t,i,n){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,n);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??eO._emptyInlayHintList,a])}catch(l){No(l)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new Ma;return new eO(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const n=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const c=i.validatePosition(a.position);let l="before";const d=eO._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=F.fromPositions(d.getStartPosition(),c),l="after"):(h=F.fromPositions(c,d.getEndPosition()),l="before"),n.push(new PMe(a,new VZe(h,l),r))}}this.items=n.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new F(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let c=o.getStartOffset(a),l=o.getEndOffset(a);return l-c===1&&(c===r&&a>1?(c=o.getStartOffset(a-1),l=o.getEndOffset(a-1)):l===r&&a{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),c=r.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(ji(h.uri,a.uri))l=!0,d=d||F.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=jr(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:F.collapseToStart(t.range),selectionRevealType:rA.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(5103,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(5104,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};Ube=D([_(0,Le),_(1,Kt),_(2,bi),_(3,Ut)],Ube);ce(uce,Ube,qt.Delayed);qe(new class extends hc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:FMe,kbOpts:{weight:Ae.EditorContrib,primary:S.F12}})}runEditorCommand(s,e){return s.get(uce).revealNext(e)}});So.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:Ae.EditorContrib,when:FMe,primary:S.Escape,handler(s){s.get(uce).reset()}});let Vbe=class{constructor(e){this._listener=new Map,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),bt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,jr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};Vbe=D([_(0,Kt)],Vbe);function zbe(s,e){return e.uri.scheme===s.uri.scheme?!0:!A8(e.uri,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeChatCodeCompareBlock,pe.vscodeCopilotBackingChatCodeBlock)}async function Y6(s,e,t,i,n){const r=t.ordered(s,i).map(c=>Promise.resolve(n(c,s,e)).then(void 0,l=>{No(l)})),a=await Promise.all(r);return Fi(a.flat()).filter(c=>zbe(s,c))}function J6(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideDefinition(r,a,n))}function OMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideDeclaration(r,a,n))}function BMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideImplementation(r,a,n))}function WMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideTypeDefinition(r,a,n))}function X6(s,e,t,i,n,o){return Y6(e,t,s,n,async(r,a,c)=>{const l=(await r.provideReferences(a,c,{includeDeclaration:!0},o))?.filter(h=>zbe(a,h));if(!i||!l||l.length!==2)return l;const d=(await r.provideReferences(a,c,{includeDeclaration:!1},o))?.filter(h=>zbe(a,h));return d&&d.length===1?d:l})}async function mC(s){const e=await s(),t=new of(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}rg("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=J6(i.definitionProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=J6(i.definitionProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=WMe(i.typeDefinitionProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeTypeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=WMe(i.typeDefinitionProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(it),n=OMe(i.declarationProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeDeclarationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=OMe(i.declarationProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeReferenceProvider",(s,e,t)=>{const i=s.get(it),n=X6(i.referenceProvider,e,t,!1,!1,He.None);return mC(()=>n)});rg("_executeReferenceProvider_recursive",(s,e,t)=>{const i=s.get(it),n=X6(i.referenceProvider,e,t,!1,!0,He.None);return mC(()=>n)});rg("_executeImplementationProvider",(s,e,t)=>{const i=s.get(it),n=BMe(i.implementationProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeImplementationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=BMe(i.implementationProvider,e,t,!0,He.None);return mC(()=>n)});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextPeek,title:g(1409,"Peek"),group:"navigation",order:100});class CW{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof CW||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const Xm=class Xm extends gf{static all(){return Xm._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of hi.wrap(t.menu))(i.id===_e.EditorContext||i.id===_e.EditorContextPeek)&&(i.when=he.and(e.precondition,i.when));return t}constructor(e,t){super(Xm._patchConfig(t)),this.configuration=e,Xm._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(bi),r=e.get(Kt),a=e.get(XA),c=e.get(uce),l=e.get(it),d=e.get(we),h=t.getModel(),u=t.getPosition(),f=CW.is(i)?i:new CW(h,u),p=new Jk(t,jo.Value|jo.Position),m=U_(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;Mr(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const y=this._getAlternativeCommand(t);!Xm._activeAlternativeCommands.has(y)&&Xm._allSymbolNavigationCommands.has(y)&&(b=Xm._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=h.getWordAtPosition(u);Lh.get(t)?.showMessage(this._getNoResultFoundMessage(y),u)}}else if(w===1&&b)Xm._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,n).finally(()=>{Xm._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,n)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,o){const r=this._getGoToPreference(i);if(!(i instanceof lf)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,o);else{const a=n.firstReference(),c=n.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,n,o):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,o){let r;if(mGe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:F.collapseToStart(r),selectionRevealType:rA.NearTopIfOutsideViewport,selectionSource:Db.JUMP}},e,n);if(a){if(o){const c=a.getModel(),l=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const n=NM.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Rr(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Xm._allSymbolNavigationCommands=new Map,Xm._activeAlternativeCommands=new Set;let OA=Xm;class Z6 extends OA{async _getLocationModel(e,t,i,n){return new of(await J6(e.definitionProvider,t,i,!1,n),g(1410,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1411,"No definition found for '{0}'",e.word):g(1412,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var GD;At((GD=class extends Z6{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GD.id,title:{...Pe(1413,"Go to Definition"),mnemonicTitle:g(1414,"Go to &&Definition")},precondition:J.hasDefinitionProvider,keybinding:[{when:J.editorTextFocus,primary:S.F12,weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,iRe),primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib}],menu:[{id:_e.EditorContext,group:"navigation",order:1.1},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),_t.registerCommandAlias("editor.action.goToDeclaration",GD.id)}},GD.id="editor.action.revealDefinition",GD));var KD;At((KD=class extends Z6{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:KD.id,title:Pe(1415,"Open Definition to the Side"),precondition:he.and(J.hasDefinitionProvider,J.isInEmbeddedEditor.toNegated()),keybinding:[{when:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,S.F12),weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,iRe),primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.F12),weight:Ae.EditorContrib}]}),_t.registerCommandAlias("editor.action.openDeclarationToTheSide",KD.id)}},KD.id="editor.action.revealDefinitionAside",KD));var qD;At((qD=class extends Z6{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:qD.id,title:Pe(1416,"Peek Definition"),precondition:he.and(J.hasDefinitionProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Alt|S.F12,linux:{primary:U.CtrlCmd|U.Shift|S.F10},weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:2}}),_t.registerCommandAlias("editor.action.previewDeclaration",qD.id)}},qD.id="editor.action.peekDefinition",qD));class $Ze extends OA{async _getLocationModel(e,t,i,n){return new of(await OMe(e.declarationProvider,t,i,!1,n),g(1417,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var PL;At((PL=class extends $Ze{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:PL.id,title:{...Pe(1420,"Go to Declaration"),mnemonicTitle:g(1421,"Go to &&Declaration")},precondition:he.and(J.hasDeclarationProvider,J.isInEmbeddedEditor.toNegated()),menu:[{id:_e.EditorContext,group:"navigation",order:1.3},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}},PL.id="editor.action.revealDeclaration",PL));At(class extends $Ze{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Pe(1422,"Peek Declaration"),precondition:he.and(J.hasDeclarationProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:3}})}});class GZe extends OA{async _getLocationModel(e,t,i,n){return new of(await WMe(e.typeDefinitionProvider,t,i,!1,n),g(1423,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1424,"No type definition found for '{0}'",e.word):g(1425,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var FL;At((FL=class extends GZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:FL.ID,title:{...Pe(1426,"Go to Type Definition"),mnemonicTitle:g(1427,"Go to &&Type Definition")},precondition:J.hasTypeDefinitionProvider,keybinding:{when:J.editorTextFocus,primary:0,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.4},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},FL.ID="editor.action.goToTypeDefinition",FL));var OL;At((OL=class extends GZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:OL.ID,title:Pe(1428,"Peek Type Definition"),precondition:he.and(J.hasTypeDefinitionProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:4}})}},OL.ID="editor.action.peekTypeDefinition",OL));class KZe extends OA{async _getLocationModel(e,t,i,n){return new of(await BMe(e.implementationProvider,t,i,!1,n),g(1429,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1430,"No implementation found for '{0}'",e.word):g(1431,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var BL;At((BL=class extends KZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BL.ID,title:{...Pe(1432,"Go to Implementations"),mnemonicTitle:g(1433,"Go to &&Implementations")},precondition:J.hasImplementationProvider,keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},BL.ID="editor.action.goToImplementation",BL));var WL;At((WL=class extends KZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:WL.ID,title:Pe(1434,"Peek Implementations"),precondition:he.and(J.hasImplementationProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F12,weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:5}})}},WL.ID="editor.action.peekImplementation",WL));class qZe extends OA{_getNoResultFoundMessage(e){return e?g(1435,"No references found for '{0}'",e.word):g(1436,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends qZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Pe(1437,"Go to References"),mnemonicTitle:g(1438,"Go to &&References")},precondition:he.and(J.hasReferenceProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Shift|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new of(await X6(e.referenceProvider,t,i,!0,!1,n),g(1439,"References"))}});At(class extends qZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Pe(1440,"Peek References"),precondition:he.and(J.hasReferenceProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new of(await X6(e.referenceProvider,t,i,!1,!1,n),g(1439,"References"))}});class lFt extends OA{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Pe(1441,"Go to Any Symbol"),precondition:he.and(ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new of(this._references,g(1442,"Locations"))}_getNoResultFoundMessage(e){return e&&g(1443,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}_t.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:N},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(s,e,t,i,n,o,r)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t)),Tt(Array.isArray(i)),Tt(typeof n>"u"||typeof n=="string"),Tt(typeof r>"u"||typeof r=="boolean");const a=s.get(Kt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qr(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,mt.Smooth),c.invokeWithinContext(l=>{const d=new class extends lFt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);l.get(we).invokeFunction(d.run.bind(d),c)})}});_t.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:N},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(s,e,t,i,n)=>{s.get(vi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});_t.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t));const i=s.get(it),n=s.get(Kt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(o=>{if(!Qr(o)||!o.hasModel())return;const r=NM.get(o);if(!r)return;const a=Rr(l=>X6(i.referenceProvider,o.getModel(),oe.lift(t),!1,!1,l).then(d=>new of(d,g(1439,"References")))),c=new F(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});_t.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function dFt(s,e,t,i){const n=s.get(fn),o=s.get(lr),r=s.get(vi),a=s.get(we),c=s.get(bi);if(await i.item.resolve(He.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(jn.getMenuItems(_e.EditorContext).map(f=>bT(f)?f.command.id:ar()));for(const f of OA.all())h.has(f.desc.id)&&d.push(new rn(f.desc.id,Sc.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await n.createModelReference(l.uri);try{const m=new CW(p.object.textEditorModel,F.getStartPosition(l.range)),v=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,m,v)}finally{p.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Ar),d.push(new rn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:Xe.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=Cr(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function QZe(s,e,t,i){const o=await s.get(fn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Le),l=ng.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new Z6({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new CW(o.object.textEditorModel,F.getStartPosition(i.range)),F.lift(i.range))}),o.dispose()}var FP;class SX{constructor(){this._entries=new um(50)}get(e){const t=SX._key(e);return this._entries.get(t)}set(e,t){const i=SX._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const jZe=ae("IInlayHintsCache");ce(jZe,SX,qt.Delayed);class $be{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class hFt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var LC;(function(s){s[s.Normal=0]="Normal",s[s.Invisible=1]="Invisible"})(LC||(LC={}));var HS;let SW=(HS=class{static get(e){return e.getContribution(FP.ID)??void 0}constructor(e,t,i,n,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new aY(this._editor),this._activeRenderMode=LC.Normal,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(c=>{c.hasChanged(x.inlayHints)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(x.inlayHints);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=LC.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=LC.Normal,c=LC.Invisible):(a=LC.Invisible,c=LC.Normal),this._activeRenderMode=a,this._sessionDisposables.add(pb.getInstance().event(l=>{if(!this._editor.hasModel())return;const d=l.altKey&&l.ctrlKey&&!(l.shiftKey||l.metaKey)?c:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const h=this._editor.getModel(),u=this._copyInlayHintsWithCurrentAnchor(h);this._updateHintsDecorators([h.getFullModelRange()],u),r.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Ee(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let n;const o=new Set,r=new cn(async()=>{const a=Date.now();n?.dispose(!0),n=new ci;const c=t.onWillDispose(()=>n?.cancel());try{const l=n.token,d=await CX.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(r.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!o.has(h)&&(o.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){vt(l)}finally{n.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>n?.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{n?.cancel();const c=Math.max(r.delay,1250);r.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new dce(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[o]=n,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ci;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new hFt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new F(l,1,l,a.getLineMaxColumn(l)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Ee(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async n=>{const o=this._getInlayHintLabelPart(n);if(o){const r=o.part;r.location?this._instaService.invokeFunction(QZe,n,this._editor,r.location):Fj.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(He.None),eo(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(o=>Zn.replace(F.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Yr(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(dFt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Rt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof Wk&&t?.attachedData instanceof $be)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Xe.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const r=new VZe(o,n.item.anchor.direction),a=n.item.with({anchor:r});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const o of i.sort(F.compareRangesUsingStarts)){const r=t.validateRange(new F(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!F.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=F.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const i=[],n=(p,m,v,b,w)=>{const y={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:b,attachedData:w};i.push({item:p,classNameRef:m,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:ni.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===LC.Normal?y:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});n(p,v," ",m?w_.Right:w_.None)},{fontSize:r,fontFamily:a,padding:c,isUniform:l}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,a);let h={line:0,totalLen:0};for(const p of t){if(h.line!==p.anchor.range.startLineNumber&&(h={line:p.anchor.range.startLineNumber,totalLen:0}),h.totalLen>FP._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&o(p,!1);const m=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v0&&(A=A.slice(0,-k)+"…",L=!0),n(p,this._ruleFactory.createClassNameRef(C),uFt(A),y&&!p.hint.paddingRight?w_.Right:w_.None,new $be(p,v)),L)break}if(p.hint.paddingRight&&o(p,!0),i.length>FP._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(b=>b.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=vm.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(o=i);const r=e.fontFamily||n;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}getInlayHintsForLine(e){if(!this._editor.hasModel())return[];const t=new Set,i=[];for(const n of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(n.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},FP=HS,HS.ID="editor.contrib.InlayHints",HS._MAX_DECORATORS=1500,HS._MAX_LABEL_LEN=43,HS);SW=FP=D([_(1,it),_(2,Sp),_(3,jZe),_(4,vi),_(5,bi),_(6,we)],SW);function uFt(s){return s.replace(/[ \t]/g," ")}_t.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const{inlayHintsProvider:n}=s.get(it),o=await s.get(fn).createModelReference(t);try{const r=await CX.create(n,o.object.textEditorModel,[F.lift(i)],He.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});class wUe extends aQ{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let AX=class extends j3{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,r,c,n,o,l),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!SW.get(this._editor)||e.target.type!==Rt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof Wk&&i.attachedData instanceof $be?new wUe(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof wUe?new Qd(async n=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Mt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&n.emitOne(new m_(this,e.range,[r],!1,0)),eo(o.item.hint.textEdits)&&n.emitOne(new m_(this,e.range,[new Mt().appendText(g(5175,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Mt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&n.emitOne(new m_(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?Qt?g(5176,"cmd + click"):g(5177,"ctrl + click"):Qt?g(5178,"option + click"):g(5179,"alt + click");o.part.location&&o.part.command?l=new Mt().appendText(g(5180,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Mt().appendText(g(5181,"Go to Definition ({0})",h)):o.part.command&&(l=new Mt(`[${g(5182,"Execute Command")}](${zZe(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&n.emitOne(new m_(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)n.emitOne(l)}):Qd.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Qd.EMPTY;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?RMe(this._languageFeaturesService.hoverProvider,r,new oe(n.startLineNumber,n.startColumn),t).filter(a=>!Q2(a.hover.contents)).map(a=>new m_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Qd.EMPTY}finally{o.dispose()}}};AX=D([_(1,xi),_(2,Ao),_(3,Ut),_(4,ec),_(5,Te),_(6,fn),_(7,it),_(8,vi)],AX);class HMe extends V{constructor(e,t,i,n,o,r){super();const a=t.anchor,c=t.hoverParts;this._renderedHoverParts=this._register(new Gbe(e,i,c,r,o));const{showAtPosition:l,showAtSecondaryPosition:d}=HMe.computeHoverPositions(e,a.range,c);this.shouldAppearBeforeContent=c.some(h=>h.isBeforeContent),this.showAtPosition=l,this.showAtSecondaryPosition=d,this.initialMousePosX=a.initialMousePosX,this.initialMousePosY=a.initialMousePosY,this.shouldFocus=n.shouldFocus,this.source=n.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}getAccessibleWidgetContent(){return this._renderedHoverParts.getAccessibleContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedHoverParts.getAccessibleHoverContentAtIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts.doesHoverAtIndexSupportVerbosityAction(e,t)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),f=d.getLineMinColumn(u.startLineNumber),p=new oe(u.startLineNumber,f);n=h.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===o,f=h.endLineNumber===o;if(u&&f){const m=h.startColumn,v=Math.min(r,m);r=Math.max(v,n)}d.forceShowAtRange&&(a=h)}let c,l;if(a){const d=a.getStartPosition();c=d,l=d}else c=t.getStartPosition(),l=new oe(o,r);return{showAtPosition:c,showAtSecondaryPosition:l}}}class gFt{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}const Nse=class Nse extends V{constructor(e,t,i,n,o){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=o,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,o,n)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return V.None;let i=t[0].range;for(const o of t){const r=o.range;i=F.plusRange(i,r)}const n=e.createDecorationsCollection();return n.set([{range:i,options:Nse._DECORATION_OPTIONS}]),Ee(()=>{n.clear()})}_renderParts(e,t,i,n){const o=new yX(n),r={fragment:this._fragment,statusBar:o,...i},a=new Z;for(const l of e){const d=this._renderHoverPartsForParticipant(t,l,r);a.add(d);for(const h of d.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:l,hoverPart:h.hoverPart,hoverElement:h.hoverElement})}const c=this._renderStatusBar(this._fragment,o);return c&&(a.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),Ee(()=>{a.dispose()})}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(r=>r.owner===t);return n.length>0?t.renderHoverParts(i,n):new UM([])}_renderStatusBar(e,t){if(t.hasContent)return new gFt(e,t)}_registerListenersOnRenderedParts(){const e=new Z;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(ue(n,ke.FOCUS_IN,o=>{o.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ue(n,ke.FOCUS_OUT,o=>{o.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof j3&&!(i instanceof AX));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof Y3)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}getAccessibleContent(){const e=[];for(let t=0;tr.type==="hoverPart"&&r.participant===e);if(o===-1)throw new Ni;return t-o}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};Nse._DECORATION_OPTIONS=Gt.register({description:"content-hover-highlight",className:"hoverHighlight"});let Gbe=Nse,Kbe=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new I),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(bX,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new wX(this._editor,this._participants),this._hoverOperation=this._register(new DZe(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of GN.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>t.handleResize?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new kZe(this._computer.anchor,t,e.isComplete))})),this._register(Ro(this._contentHoverWidget.getDomNode(),"keydown",e=>{e.equals(S.Escape)&&this.hide()})),this._register(Ta.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,o){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1;const a=this._editor.getOption(x.hover).sticky,c=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return a&&c?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._contentHoverWidget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){if(!this._computer.anchor)return e;for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const n=e.hoverParts.length===0,o=this._computer.insistOnKeepingHoverVisible;n&&o||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new HMe(this._editor,e,this._participants,this._computer,t,this._keybindingService),this._renderedContentHover.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover):this._renderedContentHover.dispose()}_hideHover(){this._contentHoverWidget.hide()}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._onContentsChanged.fire(),this._contentHoverWidget.onContentsChanged()},setMinimumDimensions:n=>{this._contentHoverWidget.setMinimumDimensions(n)}}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,oC.Delayed,FA.Mouse,!1,e);const o=i[0];return this._startShowingOrUpdateHover(o,oC.Delayed,FA.Mouse,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const o=n.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;switch(i.type){case Rt.CONTENT_TEXT:{t.push(new Jhe(0,i.range,e.event.posx,e.event.posy));break}case Rt.CONTENT_EMPTY:{const n=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-n.priority),t}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new Jhe(0,e,void 0,void 0),t,i,n,null)}getWidgetContent(){const e=this._contentHoverWidget.getDomNode();if(e.textContent)return e.textContent}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover?.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedContentHover?.doesHoverAtIndexSupportVerbosityAction(e,t)??!1}getAccessibleWidgetContent(){return this._renderedContentHover?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedContentHover?.getAccessibleWidgetContentAtIndex(e)}focusedHoverPartIndex(){return this._renderedContentHover?.focusedHoverPartIndex??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){this._renderedContentHover?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._renderedContentHover?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};Kbe=D([_(1,we),_(2,Ut)],Kbe);var fFt=".monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover-content{box-sizing:border-box;padding-bottom:2px;padding-right:2px}.monaco-editor .monaco-hover{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{display:flex;flex-direction:column;min-width:0}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);display:flex;flex-direction:column;justify-content:end;padding-left:5px;padding-right:5px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}";ut(fFt,{});class pFt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=K_.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??K_.Center;if(!n&&r!==this._laneOrLine)continue;const a=n?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||Q2(a)||i.push(...H_(a).map(e))}return i}}const yUe=fe,Pse=class Pse extends V{constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new CLe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Y_({editor:this._editor},t,i)),this._computer=new pFt(this._editor),this._hoverOperation=this._register(new DZe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Pse.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(oC.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Rt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Rt.GUTTER_LINE_NUMBERS?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(oC.Delayed))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const o=yUe("div.hover-row.markdown-hover"),r=re(o,yUe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-o)/2,c=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};Pse.ID="editor.contrib.modesGlyphHoverWidget";let EX=Pse;var qbe;const mFt=!1;var vF;(function(s){s[s.Content=0]="Content",s[s.Glyph=1]="Glyph"})(vF||(vF={}));var HL;let Pa=(HL=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new I),this.onHoverContentsChanged=this._onHoverContentsChanged.event,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Z,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new cn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(qbe.ID)}_hookListeners(){const e=this._editor.getOption(x.hover);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return!!(this._isMouseOnContentHoverWidget(e)||this._isMouseOnMarginHoverWidget(e)||this._isContentWidgetResizing())}_isMouseOnMarginHoverWidget(e){const t=e.target;return t?t.type===Rt.OVERLAY_WIDGET&&t.detail===EX.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Rt.CONTENT_WIDGET&&t.detail===bX.ID:!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(a,c)=>{const l=this._isMouseOnMarginHoverWidget(a);return c&&l},n=(a,c)=>{const l=this._isMouseOnContentHoverWidget(a);return c&&l},o=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},r=(a,c)=>c&&this._contentWidget?.containsNode(a.event.browserEvent.view?.document.activeElement)&&!a.event.browserEvent.view?.getSelection()?.isCollapsed;return!!(i(e,t)||n(e,t)||o(e)||r(e,t))}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._contentWidget?.isFocused||this._contentWidget?.isResizing))return;const t=this._hoverSettings.sticky;if(t&&this._contentWidget?.isVisibleFromKeyboard)return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const n=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&n>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(n);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),n=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(n==="click"&&!r||n==="hover"&&!o&&!mFt||n==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,vF.Content)||this._tryShowHoverWidget(e,vF.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let o,r;switch(t){case vF.Content:o=i,r=n;break;case vF.Glyph:o=n,r=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=o.showsOrWillShow(e);return a&&r.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===nf.MoreChordsNeeded||t.kind===nf.KbFound&&(t.commandId===xZe||t.commandId===zU||t.commandId===$U)&&this._contentWidget?.isVisible;e.keyCode===S.Ctrl||e.keyCode===S.Alt||e.keyCode===S.Meta||e.keyCode===S.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||_W.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Kbe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(EX,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,n,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}doesHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesHoverAtIndexSupportVerbosityAction(e,t)}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}focusHoverPartWithIndex(e){this._contentWidget?.focusHoverPartWithIndex(e)}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}getWidgetContent(){return this._contentWidget?.getWidgetContent()}getAccessibleWidgetContent(){return this._contentWidget?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._contentWidget?.getAccessibleWidgetContentAtIndex(e)}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose(),this._contentWidget?.dispose()}},qbe=HL,HL.ID="editor.contrib.hover",HL);Pa=qbe=D([_(1,we),_(2,Ut)],Pa);const _Ft=new Q("commentEditorFocused",!1),W5=5*18,vFt=25*18;let AW=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={contributions:[{id:MA.ID,ctor:MA,instantiation:ri.BeforeFirstInteraction},{id:Fb.ID,ctor:Fb,instantiation:ri.BeforeFirstInteraction},{id:Xg.ID,ctor:Xg,instantiation:ri.Eager},{id:fc.ID,ctor:fc,instantiation:ri.Lazy},{id:PA.ID,ctor:PA,instantiation:ri.Eager},{id:nC.ID,ctor:nC,instantiation:ri.Lazy},...ap.getSomeEditorContributions([sC.ID,HM.ID,yW.ID,Lh.ID,Pa.ID,hce,fu.ID,WM.ID])],contextMenuId:_e.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=_Ft.bindTo(i),this._commentEditorEmpty=x_.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=n,this._register(this.onDidFocusEditorWidget(p=>this._commentEditorFocused.set(!0))),this._register(this.onDidChangeModelContent(p=>this._commentEditorEmpty.set(!this.getModel()?.getValueLength()))),this._register(this.onDidBlurEditorWidget(p=>this._commentEditorFocused.reset()))}getParentThread(){return this._parentThread}_getActions(){return ap.getEditorActions()}static getEditorOptions(e){return{wordWrap:"on",glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,scrollbar:{vertical:"visible",verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,lineDecorationsWidth:0,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},dropIntoEditor:{enabled:!0},autoClosingBrackets:e.getValue("editor.autoClosingBrackets"),quickSuggestions:!1,accessibilitySupport:e.getValue("editor.accessibilitySupport"),fontFamily:e.getValue("editor.fontFamily")}}};AW=D([_(4,we),_(5,Kt),_(6,vi),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],AW);function YZe(s,e,t){const i=e.getLayoutInfo(),n=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*n;if(o>i.height||oW5){const r=Math.ceil((o-i.height)/n),a=i.height+n*r;return Ka(a,W5,Ka(s.getLayoutInfo().height-90,W5,vFt))}return t}var QC;(function(s){s.Add="workbench.action.addComment",s.NextThread="editor.action.nextCommentThreadAction",s.PreviousThread="editor.action.previousCommentThreadAction",s.NextRange="editor.action.nextCommentingRange",s.PreviousRange="editor.action.previousCommentingRange",s.ToggleCommenting="workbench.action.toggleCommenting",s.Submit="editor.action.submitComment",s.Hide="workbench.action.hideComment",s.CollapseAll="workbench.action.collapseAllComments",s.ExpandAll="workbench.action.expandAllComments",s.ExpandUnresolved="workbench.action.expandUnresolvedComments"})(QC||(QC={}));const Fse=class Fse extends li{constructor(){super({id:Fse.ID,title:Pe(1570,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:U.CtrlCmd|S.KeyM,mac:{primary:U.WinCtrl|U.Shift|S.KeyM},weight:Ae.EditorContrib},metadata:{description:Pe(1571,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!Pk.getTabFocusMode();Pk.setTabFocusMode(t),Mr(t?g(1572,"Pressing Tab will now move focus to the next focusable element"):g(1573,"Pressing Tab will now insert the tab character"))}};Fse.ID="editor.action.toggleTabFocusMode";let xX=Fse;At(xX);var NE;(function(s){s.intro=g(5352,"The editor contains commentable range(s). Some useful commands include:"),s.tabFocus=g(5353,"This widget contains a text area, for composition of new comments, and actions, that can be tabbed to once tab moves focus mode has been enabled with the command Toggle Tab Key Moves Focus{0}.",``),s.commentCommands=g(5354,"Some useful comment commands include:"),s.escape=g(5355,"- Dismiss Comment (Escape)"),s.nextRange=g(5356,"- Go to Next Commenting Range{0}.",``),s.previousRange=g(5357,"- Go to Previous Commenting Range{0}.",``),s.nextCommentThread=g(5358,"- Go to Next Comment Thread{0}.",``),s.previousCommentThread=g(5359,"- Go to Previous Comment Thread{0}.",``),s.addComment=g(5360,"- Add Comment on Current Selection{0}.",``),s.submitComment=g(5361,"- Submit Comment{0}.",``)})(NE||(NE={}));const bFt="revealInExplorer",wFt="workbench.action.files.revert",yFt="workbench.action.files.saveAs";Pe(5378,"Save As...");const CFt="workbench.action.files.save";Pe(5379,"Save");const SFt="workbench.action.files.saveWithoutFormatting";Pe(5380,"Save without Formatting");const AFt="saveAll";Pe(5381,"Save All");const JZe="workbench.files.action.saveAllInGroup",EFt="workbench.action.files.saveFiles";new Q("groupFocusedInOpenEditors",!1);new Q("dirtyEditorFocusedInOpenEditors",!1);new Q("readonlyEditorFocusedInOpenEditors",!1);new Q("openEditorsSelectedFileOrUntitled",!0);new Q("resourceSelectedForCompare",!1);g(5382,"Remove Folder from Workspace");const xFt="workbench.action.files.newUntitledFile";Pe(5383,"New Untitled Text File");let CUe=class extends V{onClose(){this._editor.focus()}constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=Pb.Editor,this.options={type:wm.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=vr.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(kg.readonlyDiffEditor):t.push(kg.editableDiffEditor):e.get(x.readOnly)?t.push(kg.readonlyEditor):t.push(kg.editableEditor),t.push(kg.listSignalSounds),t.push(kg.listAlerts);const i=DFt(this._keybindingService,this._contextKeyService);i&&t.push(i);const n=XZe(this._keybindingService,this._contextKeyService,this._editor);return n&&t.push(n),e.get(x.stickyScroll).enabled&&t.push(kg.stickScroll),e.get(x.tabFocusMode)?t.push(kg.tabFocusModeOnMsg):t.push(kg.tabFocusModeOffMsg),t.push(kg.setBreakpoint),t.push(kg.debugExecuteSelection),t.join(` +`)}};CUe=D([_(1,Ut),_(2,Le)],CUe);function XZe(s,e,t){if(e.getContext(t.getDomNode()).getValue(x_.activeEditorHasCommentingRange.key))return[NE.intro,NE.addComment,NE.nextCommentThread,NE.previousCommentThread,NE.nextRange,NE.previousRange].join(` +`)}function DFt(s,e){if(YXe.getValue(e))return[kg.quickChat,kg.startInlineChat].join(` +`)}class kFt{constructor(){this.priority=105,this.name="diff-editor",this.when=SN.create("isInDiffEditor",!0),this.type=wm.Help}getProvider(e){const t=e.get(ei),i=e.get(Kt),n=e.get(Ut),o=e.get(Le);if(!(t.activeTextEditorControl instanceof vp))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(4516,"Run the command Diff Editor: Switch Side{0} to toggle between the original and modified editors.",""),c=g(4517,"The setting, accessibility.verbosity.diffEditorActive, controls if a diff editor announcement is made when it becomes the active editor."),l=["accessibility.signals.diffLineDeleted","accessibility.signals.diffLineInserted","accessibility.signals.diffLineModified"],d=[g(4518,"You are in a diff editor."),g(4519,"View the next{0} or previous{1} diff in diff review mode, which is optimized for screen readers.","",""),a,c,g(4520,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=XZe(n,o,r);return h&&d.push(h),new LXe(Pb.DiffEditor,{type:wm.Help},()=>d.join(` +`),()=>r.focus(),vr.DiffEditor)}}var xB;let DX=(xB=class extends V{constructor(e,t,i,n){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=n,!(this._diffEditor instanceof V3)){const a=Kn(this,c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(cu((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(QJ,this._diffEditor.getModifiedEditor(),g(718,"Show Whitespace Differences"),null));l.add(d.onClick(()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.ignoreTrimWhitespace",!1)})),d.render()}})),this._register(this._diffEditor.onDidUpdateDiff(()=>{const c=this._diffEditor.getDiffComputationResult();c&&c.quitEarly&&this._notificationService.prompt(Xe.Warning,g(719,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(720,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},xB.ID="editor.contrib.diffEditorHelper",xB);DX=D([_(1,we),_(2,Ec),_(3,bi)],DX);nKe(DX.ID,DX);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(s,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:s}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);U6.register(new kFt);var DB;let kX=(DB=class extends V{constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(721,"{0}: tokenization, wrapping, folding, codelens, word highlighting and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",Ko(e.uri.path));this._notificationService.prompt(Xe.Info,t,[{label:g(722,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(723,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},DB.ID="editor.contrib.largeFileOptimizationsWarner",DB);kX=D([_(1,bi),_(2,Te)],kX);on(kX.ID,kX,ri.AfterFirstRender);class IFt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=ZZe(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,o=i.length;na.lineNumber===c.lineNumber?a.column-c.column:a.lineNumber-c.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let n=0,o=0;const r=e.length;for(let a=1,c=s.getLineCount();a<=c;a++){const l=s.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof s=="string"?$e.fromString(s):{read:()=>{const e=s.read();return typeof e=="string"?$e.fromString(e):null}}}let Qbe=class extends Bje{constructor(e,t,i,n,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...Vje},l=o.getColorTheme(),d=l.getColor(Hc),u=l.getColor(sce)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,n,c,{ariaLabel:g(10418,"Switch quick diff base")}),this.optionsItems=r}setSelection(e){const t=this.optionsItems.findIndex(i=>i.provider===e);this.select(t)}getActionContext(e,t){return this.optionsItems[t]}render(e){super.render(e),this.setFocusable(!0)}};Qbe=D([_(3,mf),_(4,pn)],Qbe);const tO=class tO extends rn{constructor(e){super(tO.ID,tO.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};tO.ID="quickDiff.base.switch",tO.LABEL=g(10419,"Switch Quick Diff Base");let jbe=tO;var Ybe,d0;class PFt extends $_{runAction(e,t){return e instanceof Sc?e.run(...t):super.runAction(e,t)}}const eet=new Q("dirtyDiffVisible",!1);function FFt(s){const e=s.modifiedEndLineNumber-s.modifiedStartLineNumber+1,t=s.originalEndLineNumber-s.originalStartLineNumber+1;return s.originalEndLineNumber===0?e:s.modifiedEndLineNumber===0?t:e+t}function Jbe(s){return s.modifiedEndLineNumber===0?s.modifiedStartLineNumber===0?1:s.modifiedStartLineNumber:s.modifiedEndLineNumber}function OFt(s,e){return s===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:s>=e.modifiedStartLineNumber&&s<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let H5=class extends rn{constructor(e,t,i,n,o){const r=n.lookupKeybinding(t.id),a=t.label+(r?` (${r.getLabel()})`:"");super(t.id,a,i),this.instantiationService=o,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};H5=D([_(3,Ut),_(4,we)],H5);var dp;(function(s){s[s.Modify=0]="Modify",s[s.Add=1]="Add",s[s.Delete=2]="Delete"})(dp||(dp={}));function UMe(s){return s.originalEndLineNumber===0?dp.Add:s.modifiedEndLineNumber===0?dp.Delete:dp.Modify}function BFt(s,e){switch(e){case dp.Modify:return s.getColor(VMe);case dp.Add:return s.getColor(zMe);case dp.Delete:return s.getColor($Me)}}function eG(s){const e=s.get(Kt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof V3)return t.getParentEditor();return AXe(s)}let Xbe=class extends H3{constructor(e,t,i,n,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},n),this.model=t,this.themeService=i,this.menuService=o,this.contextKeyService=r,this._index=0,this._provider="",this.height=void 0,this._disposables.add(i.onDidColorThemeChange(this._applyTheme,this)),this._applyTheme(i.getColorTheme()),this.model.original.length>0&&(r=r.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=_i(e.getModel().uri):this.title="",this.setTitle(this.title)}get provider(){return this._provider}get index(){return this._index}get visibleRange(){const e=this.diffEditor.getModifiedEditor().getVisibleRanges();return e.length>=0?e[0]:void 0}showChange(e,t=!0){const i=this.model.changes[e],n=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=n,!this.model.original)return;M.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(n),0));const a=this.model.getDiffEditorModel(i.uri.toString());if(!a)return;this.diffEditor.setModel(a),this.dropdown?.setSelection(i.label);const c=new oe(Jbe(n),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(FFt(n)+8,Math.floor(h/3));this.renderTitle(i.label);const f=UMe(n),p=BFt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const b of this.model.changes)b.label===this.model.changes[this._index].label&&(m.push(b.change),i===b&&(v=m.length-1));this._actionbarWidget.context=[a.modified.uri,m,v],t&&(this.show(c,u),this.editor.setPosition(c),this.editor.focus())}renderTitle(e){const t=this.model.mapChanges.get(e),i=t.indexOf(this._index);let n;this.shouldUseDropdown()?(n=this.model.changes.length>1?g(6335,"{0} of {1} changes",i+1,t.length):g(6336,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(n=this.model.changes.length>1?g(6333,"{0} - {1} of {2} changes",e,i+1,t.length):g(6334,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,n)}switchQuickDiff(e){const t=e?.provider;if(t===this.model.changes[this._index].label)return;let i=this._index0?this._index-1:this.model.changes.length-1;for(let r=n;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){n=r;break}const o=Math.abs(this.model.changes[i].change.modifiedEndLineNumber-this.model.changes[this._index].change.modifiedEndLineNumber)1){const t=Array.from(this.model.mapChanges.keys());for(let i=0;i0&&e++}return e>=2}updateActions(){if(!this._actionbarWidget)return;const e=this.instantiationService.createInstance(H5,this.editor,new tet(this.editor),We.asClassName(Skt)),t=this.instantiationService.createInstance(H5,this.editor,new iet(this.editor),We.asClassName(Akt));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(_e.SCMChangeContext,this.contextKeyService),fC(this.menu,{shouldForwardArgs:!0},i),this._actionbarWidget.clear(),this._actionbarWidget.push(i.reverse(),{label:!1,icon:!0}),this._actionbarWidget.push([t,e],{label:!1,icon:!0}),this._actionbarWidget.push(new rn("peekview.close",g(6337,"Close"),We.asClassName(ve.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Ore(this._titleElement,fe(".dropdown")),this.dropdown=this.instantiationService.createInstance(Qbe,new jbe(t=>this.switchQuickDiff(t)),this.model.quickDiffs.map(t=>t.label),this.model.changes[this._index].label),this.dropdown.render(this.dropdownContainer),this.updateActions()}_getActionBarOptions(){const e=new PFt;return e.onDidRun(t=>{!(t.action instanceof H5)&&!t.error&&this.dispose()}),{...super._getActionBarOptions(),actionRunner:e}}_fillBody(e){const t={scrollBeyondLastLine:!0,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1},renderSideBySide:!1,readOnly:!1,renderIndicators:!1,diffAlgorithm:"advanced",ignoreTrimWhitespace:!1,stickyScroll:{enabled:!1}};this.diffEditor=this.instantiationService.createInstance(V3,e,t,{},this.editor),this._disposables.add(this.diffEditor)}_onWidth(e){typeof this.height>"u"||this.diffEditor.layout({height:this.height,width:e})}_doLayoutBody(e,t){super._doLayoutBody(e,t),this.diffEditor.layout({height:e,width:t}),typeof this.height>"u"&&this.change&&this.revealChange(this.change),this.height=e}revealChange(e){let t,i;e.modifiedEndLineNumber===0?(t=e.modifiedStartLineNumber,i=e.modifiedStartLineNumber+1):e.originalEndLineNumber>0?(t=e.modifiedStartLineNumber-1,i=e.modifiedEndLineNumber+1):(t=e.modifiedStartLineNumber,i=e.modifiedEndLineNumber),this.diffEditor.revealLinesInCenter(t,i,mt.Immediate)}_applyTheme(e){const t=e.getColor(uMe)||me.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(sce)||me.transparent,primaryHeadingColor:e.getColor(dMe),secondaryHeadingColor:e.getColor(hMe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,mt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};Xbe=D([_(2,pn),_(3,we),_(4,Oa),_(5,Le)],Xbe);class tet extends tt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(6338,"Show Previous Change"),alias:"Show Previous Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??eG(e);if(!t)return;const i=rC.get(t);i&&i.canNavigate()&&i.previous()}}Re(tet);class iet extends tt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(6339,"Show Next Change"),alias:"Show Next Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??eG(e);if(!t)return;const i=rC.get(t);i&&i.canNavigate()&&i.next()}}Re(iet);jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(6340,"Next &&Change")},order:1});jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(6341,"Previous &&Change")},order:2});class WFt extends tt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(6342,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=eG(e),i=e.get(lv),n=e.get(mr),o=e.get(Kt);if(!t||!t.hasModel())return;const r=rC.get(t);if(!r||!r.modelRegistry)return;const a=t.getPosition().lineNumber,c=r.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await set(d.change,i),net(d.change,t,n,o)}}Re(WFt);class HFt extends tt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(6343,"Go to Next Change"),alias:"Go to Next Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=e.get(lv),i=eG(e),n=e.get(mr),o=e.get(Kt);if(!i||!i.hasModel())return;const r=rC.get(i);if(!r||!r.modelRegistry)return;const a=i.getPosition().lineNumber,c=r.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await set(d,t),net(d,i,n,o)}}function net(s,e,t,i){const n=new oe(s.modifiedStartLineNumber,1);e.setPosition(n),e.revealPositionInCenter(n),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:s.modifiedStartLineNumber,startColumn:0,endLineNumber:s.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function set(s,e){switch(UMe(s)){case dp.Add:e.playSignal(cl.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case dp.Delete:e.playSignal(cl.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case dp.Modify:e.playSignal(cl.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Re(HFt);So.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:Ae.EditorContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(eet),handler:s=>{const e=eG(s);if(!e)return;const t=rC.get(e);t&&t.close()}});var UL;let rC=(UL=class extends V{static get(e){return e.getContribution(Ybe.ID)}constructor(e,t,i,n){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=n,this.modelRegistry=null,this.model=null,this.widget=null,this.session=V.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=gl(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=eet.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=M.filter(i.onDidChangeConfiguration,r=>r.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(o(this.onDidChangeGutterAction,this)),this.onDidChangeGutterAction()}}onDidChangeGutterAction(){const e=this.configurationService.getValue("scm.diffDecorationsGutterAction");this.gutterActionDisposables.clear(),e==="diff"?(this.gutterActionDisposables.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.gutterActionDisposables.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.stylesheet.textContent=` .monaco-editor .dirty-diff-glyph { cursor: pointer; } @@ -731,7 +733,7 @@ Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals? border-top-width: 0; border-bottom-width: 0; } - `):this.stylesheet.textContent=""}canNavigate(){return!this.widget||this.widget?.index===-1||!!this.model&&this.model.changes.length>1}refresh(){this.widget?.showChange(this.widget.index,!1)}next(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&(typeof e=="number"||!this.widget.provider))t=this.model.findNextClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s+1,i.length)]}this.widget.showChange(t)}previous(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&typeof e=="number")t=this.model.findPreviousClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=$.None}assertWidget(){if(!this.enabled)return!1;if(this.widget)return!this.model||this.model.changes.length===0?(this.close(),!1):!0;if(!this.modelRegistry)return!1;const e=this.editor.getModel();if(!e)return!1;const t=this.modelRegistry.getModel(e,this.editor);if(!t||t.changes.length===0)return!1;this.model=t,this.widget=this.instantiationService.createInstance(uSe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(T.once(this.widget.onDidClose)(this.close,this)),T.chain(t.onDidChange,o=>o.filter(r=>r.diff.length>0).map(r=>r.diff))(this.onDidModelChange,this,i),i.add(this.widget),i.add(Ee(()=>{this.model=null,this.widget=null,this.isDirtyDiffVisible.set(!1),this.editor.focus()})),this.session=i,!0}onDidModelChange(e){if(!(!this.model||!this.widget||this.widget.hasFocus())){for(const t of e)if(t.start<=this.widget.index){this.next();return}this.refresh()}}onEditorMouseDown(e){this.mouseDownInfo=null;const t=e.target.range;if(!t||!e.event.leftButton||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,s=e.target.element.offsetLeft,o=i.offsetX-s;o<-3||o>3||(this.mouseDownInfo={lineNumber:t.startLineNumber})}onEditorMouseUp(e){if(!this.mouseDownInfo)return;const{lineNumber:t}=this.mouseDownInfo;this.mouseDownInfo=null;const i=e.target.range;if(!i||i.startLineNumber!==t||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const s=this.editor.getModel();if(!s)return;const o=this.modelRegistry.getModel(s,this.editor);if(!o)return;const r=o.changes.findIndex(a=>JOt(t,a.change));r<0||(r===this.widget?.index?this.close():this.next(t))}getChanges(){if(!this.modelRegistry)return[];if(!this.editor.hasModel())return[];const e=this.modelRegistry.getModel(this.editor.getModel(),this.editor);return e?e.changes.map(t=>t.change):[]}dispose(){this.gutterActionDisposables.dispose(),super.dispose()}},dSe=NN,NN.ID="editor.contrib.dirtydiff",NN);YS=dSe=D([_(1,Pe),_(2,Re),_(3,be)],YS);const PE=B("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(bl,11,"Editor gutter background color for lines that are modified.")),FE=B("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(bl,12,"Editor gutter background color for lines that are added.")),OE=B("editorGutter.deletedBackground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(bl,13,"Editor gutter background color for lines that are deleted.")),V4e=B("minimapGutter.modifiedBackground",{dark:PE,light:PE,hcDark:PE,hcLight:PE},g(bl,14,"Minimap gutter background color for lines that are modified.")),z4e=B("minimapGutter.addedBackground",{dark:FE,light:FE,hcDark:FE,hcLight:FE},g(bl,15,"Minimap gutter background color for lines that are added.")),tBt=B("minimapGutter.deletedBackground",{dark:OE,light:OE,hcDark:OE,hcLight:OE},g(bl,16,"Minimap gutter background color for lines that are deleted.")),$4e=B("editorOverviewRuler.modifiedForeground",{dark:Ie(PE,.6),light:Ie(PE,.6),hcDark:Ie(PE,.6),hcLight:Ie(PE,.6)},g(bl,17,"Overview ruler marker color for modified content.")),G4e=B("editorOverviewRuler.addedForeground",{dark:Ie(FE,.6),light:Ie(FE,.6),hcDark:Ie(FE,.6),hcLight:Ie(FE,.6)},g(bl,18,"Overview ruler marker color for added content.")),iBt=B("editorOverviewRuler.deletedForeground",{dark:Ie(OE,.6),light:Ie(OE,.6),hcDark:Ie(OE,.6),hcLight:Ie(OE,.6)},g(bl,19,"Overview ruler marker color for deleted content."));let gSe=JL=class extends ${static createDecoration(e,t,i){const s={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(s.linesDecorationsClassName=`dirty-diff-glyph ${e}`,s.linesDecorationsTooltip=t),i.overview.active&&(s.overviewRuler={color:Nr(i.overview.color),position:oh.Left}),i.minimap.active&&(s.minimap={color:Nr(i.minimap.color),position:xu.Gutter}),Kt.createDynamic(s)}constructor(e,t,i,s){super(),this.codeEditor=t,this.model=i,this.configurationService=s,this.editorModel=e;const o=s.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(bl,20,"Added lines");this.addedOptions=JL.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0}),this.addedPatternOptions=JL.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0});const d=g(bl,21,"Changed lines");this.modifiedOptions=JL.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.modifiedPatternOptions=JL.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.deletedOptions=JL.createDecoration("dirty-diff-deleted",g(bl,22,"Removed lines"),{gutter:r,overview:{active:a,color:iBt},minimap:{active:c,color:tBt},isWholeLine:!1}),this._register(s.onDidChangeConfiguration(h=>{h.affectsConfiguration("scm.diffDecorationsGutterPattern")&&this.onDidChange()})),this._register(i.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const e=this.configurationService.getValue("scm.diffDecorationsGutterPattern"),t=this.model.changes.map(i=>{const s=i.change,o=pFe(s),r=s.modifiedStartLineNumber,a=s.modifiedEndLineNumber||r;switch(o){case bm.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case bm.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case bm.Modify:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.modified?this.modifiedPatternOptions:this.modifiedOptions}}});this.decorationsCollection?this.decorationsCollection.set(t):this.decorationsCollection=this.codeEditor.createDecorationsCollection(t)}dispose(){super.dispose(),this.decorationsCollection&&this.decorationsCollection?.clear(),this.editorModel=null,this.decorationsCollection=void 0}};gSe=JL=D([_(3,Re)],gSe);function q4e(n,e){let t=n.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=n.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=n.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:n.originalEndLineNumber-e.originalEndLineNumber}async function nBt(n,e,t,i){const s=await n.getQuickDiffs(e,t,i);return s.length>0?s[0].originalResource:null}let fSe=class extends ${get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,s,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=s,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new iQ(200),this.repositoryDisposables=new Set,this.originalModelDisposables=this._register(new Z),this._disposed=!1,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._changes=[],this._mapChanges=new Map,this._model=e,this._register(e.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),this._register(T.filter(o.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsIgnoreTrimWhitespace")||c.affectsConfiguration("diffEditor.ignoreTrimWhitespace"))(this.triggerDiff,this)),this._register(t.onDidAddRepository(this.onDidAddRepository,this));for(const c of t.repositories)this.onDidAddRepository(c);this._register(this._model.onDidChangeEncoding(()=>{this.diffDelayer.cancel(),this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],this._quickDiffsPromise=void 0,this.setChanges([],new Map),this.triggerDiff()})),this._register(this.quickDiffService.onDidChangeQuickDiffProviders(()=>this.triggerDiff())),this.triggerDiff()}get quickDiffs(){return this._quickDiffs}getDiffEditorModel(e){if(!this._originalModels.has(e))return;const t=this._originalModels.get(e);return{modified:this._model.textEditorModel,original:t.textEditorModel}}onDidAddRepository(e){const t=new Z;this.repositoryDisposables.add(t),t.add(Ee(()=>this.repositoryDisposables.delete(t)));const i=T.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const s=T.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(s(()=>St(t),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(e=>{const t=Array.from(this._originalModels.values());!e||this._disposed||this._model.isDisposed()||t.some(i=>i.isDisposed())||(t.every(i=>i.textEditorModel.getValueLength()===0)&&(e.changes=[]),e.changes||(e.changes=[]),this.setChanges(e.changes,e.mapChanges))},e=>bt(e)):Promise.resolve(null)}setChanges(e,t){const i=FRe(this._changes,e,(s,o)=>q4e(s.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:ch.Scm,delay:250},async()=>{const e=await this.getQuickDiffsPromise();if(this._disposed||this._model.isDisposed()||e.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const t=e.filter(c=>this.editorWorkerService.canComputeDirtyDiff(c.originalResource,this._model.resource));if(t.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const i=this.configurationService.getValue("scm.diffDecorationsIgnoreTrimWhitespace"),s=i==="inherit"?this.configurationService.getValue("diffEditor.ignoreTrimWhitespace"):i!=="false",o=[];for(const c of t){const l=await this.editorWorkerService.computeDirtyDiff(c.originalResource,this._model.resource,s);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>q4e(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):Ls(this._quickDiffs,e,(t,i)=>t.originalResource.toString()===i.originalResource.toString()&&t.label===i.label)?e:(this.originalModelDisposables.clear(),this._originalModels.clear(),this._originalTextModels=[],this._quickDiffs=e,(await Promise.all(e.map(async t=>{try{const i=await this.textModelResolverService.createModelReference(t.originalResource);if(this._disposed)return i.dispose(),[];if(this._originalModels.set(t.originalResource.toString(),i.object),this._originalTextModels.push(i.object.textEditorModel),qOt(i.object)){const s=this._model.getEncoding();s&&i.object.setEncoding(s,Z7.Decode)}return this.originalModelDisposables.add(i),this.originalModelDisposables.add(i.object.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),t}catch{return[]}}))).flat())),this._quickDiffsPromise.finally(()=>{this._quickDiffsPromise=void 0}))}async getOriginalResource(){if(this._disposed)return Promise.resolve([]);const e=this._model.resource;return this.quickDiffService.getQuickDiffs(e,this._model.getLanguageId(),this._model.textEditorModel?gS(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let s;!i&&t&&(s=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(s&&a.label!==s)o.push(r);else return r}else if(a.change.modifiedStartLineNumber>e)return r;if(o.length>0&&o.length===c)return o[0]}return o.length>0?o[0]:0}findPreviousClosestChange(e,t=!0,i){for(let s=this.changes.length-1;s>=0;s--){if(i&&this.changes[s].label!==i)continue;const o=this.changes[s].change;if(t){if(o.modifiedStartLineNumber<=e)return s}else if(hSe(o)St(e)),this.repositoryDisposables.clear()}};fSe=D([_(1,MPe),_(2,DQ),_(3,kd),_(4,Re),_(5,Rn),_(6,Cf)],fSe);class sBt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let Q4e=class extends ${constructor(e,t,i,s){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=s,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new wi,this.transientDisposables=this._register(new Z),this.stylesheet=od(void 0,void 0,this._store);const o=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterVisibility"));this._register(a(this.onDidChangeDiffVisibilityConfiguration,this)),this.onDidChangeDiffVisibilityConfiguration()}onDidChangeConfiguration(){this.configurationService.getValue("scm.diffDecorations")!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let e=this.configurationService.getValue("scm.diffDecorationsGutterWidth");(isNaN(e)||e<=0||e>5)&&(e=3),this.setViewState({...this.viewState,width:e})}onDidChangeDiffVisibilityConfiguration(){const e=this.configurationService.getValue("scm.diffDecorationsGutterVisibility");this.setViewState({...this.viewState,visibility:e})}setViewState(e){this.viewState=e,this.stylesheet.textContent=` + `):this.stylesheet.textContent=""}canNavigate(){return!this.widget||this.widget?.index===-1||!!this.model&&this.model.changes.length>1}refresh(){this.widget?.showChange(this.widget.index,!1)}next(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&(typeof e=="number"||!this.widget.provider))t=this.model.findNextClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,n=i.findIndex(o=>o===this.widget.index);t=i[JFe(n+1,i.length)]}this.widget.showChange(t)}previous(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&typeof e=="number")t=this.model.findPreviousClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,n=i.findIndex(o=>o===this.widget.index);t=i[JFe(n-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=V.None}assertWidget(){if(!this.enabled)return!1;if(this.widget)return!this.model||this.model.changes.length===0?(this.close(),!1):!0;if(!this.modelRegistry)return!1;const e=this.editor.getModel();if(!e)return!1;const t=this.modelRegistry.getModel(e,this.editor);if(!t||t.changes.length===0)return!1;this.model=t,this.widget=this.instantiationService.createInstance(Xbe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(M.once(this.widget.onDidClose)(this.close,this)),M.chain(t.onDidChange,o=>o.filter(r=>r.diff.length>0).map(r=>r.diff))(this.onDidModelChange,this,i),i.add(this.widget),i.add(Ee(()=>{this.model=null,this.widget=null,this.isDirtyDiffVisible.set(!1),this.editor.focus()})),this.session=i,!0}onDidModelChange(e){if(!(!this.model||!this.widget||this.widget.hasFocus())){for(const t of e)if(t.start<=this.widget.index){this.next();return}this.refresh()}}onEditorMouseDown(e){this.mouseDownInfo=null;const t=e.target.range;if(!t||!e.event.leftButton||e.target.type!==Rt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,n=e.target.element.offsetLeft,o=i.offsetX-n;o<-3||o>3||(this.mouseDownInfo={lineNumber:t.startLineNumber})}onEditorMouseUp(e){if(!this.mouseDownInfo)return;const{lineNumber:t}=this.mouseDownInfo;this.mouseDownInfo=null;const i=e.target.range;if(!i||i.startLineNumber!==t||e.target.type!==Rt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const n=this.editor.getModel();if(!n)return;const o=this.modelRegistry.getModel(n,this.editor);if(!o)return;const r=o.changes.findIndex(a=>OFt(t,a.change));r<0||(r===this.widget?.index?this.close():this.next(t))}getChanges(){if(!this.modelRegistry)return[];if(!this.editor.hasModel())return[];const e=this.modelRegistry.getModel(this.editor.getModel(),this.editor);return e?e.changes.map(t=>t.change):[]}dispose(){this.gutterActionDisposables.dispose(),super.dispose()}},Ybe=UL,UL.ID="editor.contrib.dirtydiff",UL);rC=Ybe=D([_(1,Le),_(2,Te),_(3,we)],rC);const VMe=W("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(6344,"Editor gutter background color for lines that are modified.")),zMe=W("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(6345,"Editor gutter background color for lines that are added.")),$Me=W("editorGutter.deletedBackground",TN,g(6346,"Editor gutter background color for lines that are deleted.")),SUe=W("minimapGutter.modifiedBackground",VMe,g(6347,"Minimap gutter background color for lines that are modified.")),AUe=W("minimapGutter.addedBackground",zMe,g(6348,"Minimap gutter background color for lines that are added.")),UFt=W("minimapGutter.deletedBackground",$Me,g(6349,"Minimap gutter background color for lines that are deleted.")),EUe=W("editorOverviewRuler.modifiedForeground",st(VMe,.6),g(6350,"Overview ruler marker color for modified content.")),xUe=W("editorOverviewRuler.addedForeground",st(zMe,.6),g(6351,"Overview ruler marker color for added content.")),VFt=W("editorOverviewRuler.deletedForeground",st($Me,.6),g(6352,"Overview ruler marker color for deleted content."));let Zbe=d0=class extends V{static createDecoration(e,t,i){const n={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(n.linesDecorationsClassName=`dirty-diff-glyph ${e}`,n.linesDecorationsTooltip=t),i.overview.active&&(n.overviewRuler={color:$o(i.overview.color),position:kl.Left}),i.minimap.active&&(n.minimap={color:$o(i.minimap.color),position:Th.Gutter}),Gt.createDynamic(n)}constructor(e,t,i,n){super(),this.codeEditor=t,this.model=i,this.configurationService=n,this.editorModel=e;const o=n.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(6353,"Added lines");this.addedOptions=d0.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:xUe},minimap:{active:c,color:AUe},isWholeLine:!0}),this.addedPatternOptions=d0.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:xUe},minimap:{active:c,color:AUe},isWholeLine:!0});const d=g(6354,"Changed lines");this.modifiedOptions=d0.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:EUe},minimap:{active:c,color:SUe},isWholeLine:!0}),this.modifiedPatternOptions=d0.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:EUe},minimap:{active:c,color:SUe},isWholeLine:!0}),this.deletedOptions=d0.createDecoration("dirty-diff-deleted",g(6355,"Removed lines"),{gutter:r,overview:{active:a,color:VFt},minimap:{active:c,color:UFt},isWholeLine:!1}),this._register(n.onDidChangeConfiguration(h=>{h.affectsConfiguration("scm.diffDecorationsGutterPattern")&&this.onDidChange()})),this._register(i.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const e=this.configurationService.getValue("scm.diffDecorationsGutterPattern"),t=this.model.changes.map(i=>{const n=i.change,o=UMe(n),r=n.modifiedStartLineNumber,a=n.modifiedEndLineNumber||r;switch(o){case dp.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case dp.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case dp.Modify:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.modified?this.modifiedPatternOptions:this.modifiedOptions}}});this.decorationsCollection?this.decorationsCollection.set(t):this.decorationsCollection=this.codeEditor.createDecorationsCollection(t)}dispose(){super.dispose(),this.decorationsCollection&&this.decorationsCollection?.clear(),this.editorModel=null,this.decorationsCollection=void 0}};Zbe=d0=D([_(3,Te)],Zbe);function DUe(s,e){let t=s.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=s.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=s.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:s.originalEndLineNumber-e.originalEndLineNumber}async function zFt(s,e,t,i){const n=await s.getQuickDiffs(e,t,i);return n.length>0?n[0].originalResource:null}let ewe=class extends V{get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,n,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=n,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new Y7(200),this.repositoryDisposables=new Set,this.originalModelDisposables=this._register(new Z),this._disposed=!1,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._changes=[],this._mapChanges=new Map,this._model=e,this._register(e.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),this._register(M.filter(o.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsIgnoreTrimWhitespace")||c.affectsConfiguration("diffEditor.ignoreTrimWhitespace"))(this.triggerDiff,this)),this._register(t.onDidAddRepository(this.onDidAddRepository,this));for(const c of t.repositories)this.onDidAddRepository(c);this._register(this._model.onDidChangeEncoding(()=>{this.diffDelayer.cancel(),this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],this._quickDiffsPromise=void 0,this.setChanges([],new Map),this.triggerDiff()})),this._register(this.quickDiffService.onDidChangeQuickDiffProviders(()=>this.triggerDiff())),this.triggerDiff()}get quickDiffs(){return this._quickDiffs}getDiffEditorModel(e){if(!this._originalModels.has(e))return;const t=this._originalModels.get(e);return{modified:this._model.textEditorModel,original:t.textEditorModel}}onDidAddRepository(e){const t=new Z;this.repositoryDisposables.add(t),t.add(Ee(()=>this.repositoryDisposables.delete(t)));const i=M.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const n=M.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(n(()=>bt(t),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(e=>{const t=Array.from(this._originalModels.values());!e||this._disposed||this._model.isDisposed()||t.some(i=>i.isDisposed())||(t.every(i=>i.textEditorModel.getValueLength()===0)&&(e.changes=[]),e.changes||(e.changes=[]),this.setChanges(e.changes,e.mapChanges))},e=>vt(e)):Promise.resolve(null)}setChanges(e,t){const i=F1e(this._changes,e,(n,o)=>DUe(n.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:ud.Scm,delay:250},async()=>{const e=await this.getQuickDiffsPromise();if(this._disposed||this._model.isDisposed()||e.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const t=e.filter(c=>this.editorWorkerService.canComputeDirtyDiff(c.originalResource,this._model.resource));if(t.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const i=this.configurationService.getValue("scm.diffDecorationsIgnoreTrimWhitespace"),n=i==="inherit"?this.configurationService.getValue("diffEditor.ignoreTrimWhitespace"):i!=="false",o=[];for(const c of t){const l=await this.editorWorkerService.computeDirtyDiff(c.originalResource,this._model.resource,n);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>DUe(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):is(this._quickDiffs,e,(t,i)=>t.originalResource.toString()===i.originalResource.toString()&&t.label===i.label)?e:(this.originalModelDisposables.clear(),this._originalModels.clear(),this._originalTextModels=[],this._quickDiffs=e,(await Promise.all(e.map(async t=>{try{const i=await this.textModelResolverService.createModelReference(t.originalResource);if(this._disposed)return i.dispose(),[];if(this._originalModels.set(t.originalResource.toString(),i.object),this._originalTextModels.push(i.object.textEditorModel),RFt(i.object)){const n=this._model.getEncoding();n&&i.object.setEncoding(n,Z3.Decode)}return this.originalModelDisposables.add(i),this.originalModelDisposables.add(i.object.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),t}catch{return[]}}))).flat())),this._quickDiffsPromise.finally(()=>{this._quickDiffsPromise=void 0}))}async getOriginalResource(){if(this._disposed)return Promise.resolve([]);const e=this._model.resource;return this.quickDiffService.getQuickDiffs(e,this._model.getLanguageId(),this._model.textEditorModel?Ly(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let n;!i&&t&&(n=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(n&&a.label!==n)o.push(r);else return r}else if(a.change.modifiedStartLineNumber>e)return r;if(o.length>0&&o.length===c)return o[0]}return o.length>0?o[0]:0}findPreviousClosestChange(e,t=!0,i){for(let n=this.changes.length-1;n>=0;n--){if(i&&this.changes[n].label!==i)continue;const o=this.changes[n].change;if(t){if(o.modifiedStartLineNumber<=e)return n}else if(Jbe(o)bt(e)),this.repositoryDisposables.clear()}};ewe=D([_(1,tMe),_(2,M6),_(3,Ml),_(4,Te),_(5,fn),_(6,cg)],ewe);class $Ft{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let kUe=class extends V{constructor(e,t,i,n){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=n,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new ui,this.transientDisposables=this._register(new Z),this.stylesheet=gl(void 0,void 0,this._store);const o=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterVisibility"));this._register(a(this.onDidChangeDiffVisibilityConfiguration,this)),this.onDidChangeDiffVisibilityConfiguration()}onDidChangeConfiguration(){this.configurationService.getValue("scm.diffDecorations")!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let e=this.configurationService.getValue("scm.diffDecorationsGutterWidth");(isNaN(e)||e<=0||e>5)&&(e=3),this.setViewState({...this.viewState,width:e})}onDidChangeDiffVisibilityConfiguration(){const e=this.configurationService.getValue("scm.diffDecorationsGutterVisibility");this.setViewState({...this.viewState,visibility:e})}setViewState(e){this.viewState=e,this.stylesheet.textContent=` .monaco-editor .dirty-diff-added, .monaco-editor .dirty-diff-modified { border-left-width:${e.width}px; @@ -749,69 +751,98 @@ Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals? .monaco-editor .dirty-diff-deleted { opacity: ${e.visibility==="always"?1:0}; } - `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(T.any(this.editorService.onDidCloseEditor,this.editorService.onDidVisibleEditorsChange)(()=>this.onEditorsChanged())),this.onEditorsChanged(),this.enabled=!0}disable(){if(this.enabled){this.transientDisposables.clear();for(const[,e]of this.items)St(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(Ka(e)){const t=e.getModel(),i=YS.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const s=this.textFileService.files.get(t.uri);if(s?.isResolved()){const o=this.instantiationService.createInstance(fSe,s),r=new gSe(s.textEditorModel,e,o,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new sBt(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(s=>Ka(s)&&s.getModel()?.uri.toString()===e.toString()&&s.getId()===i)||t.has(i)&&(t.get(i)?.dispose(),t.delete(i),t.size===0&&this.items.delete(e))}getModel(e,t){return this.items.get(e.uri)?.get(t.getId())?.model}dispose(){this.disable(),super.dispose()}};Q4e=D([_(0,_i),_(1,be),_(2,Re),_(3,tr)],Q4e);vn(YS.ID,YS,mi.AfterFirstRender);const oBt="vs/workbench/contrib/format/browser/formatModified";Fe(class extends lt{constructor(){super({id:"editor.action.formatChanges",label:g(oBt,0,"Format Modified Lines"),alias:"Format Modified Lines",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(be);if(!t.hasModel())return;const s=await i.invokeFunction(pit,t.getModel());if(mo(s))return i.invokeFunction(Ude,t,s,S_.Explicit,cf.None,qe.None,!0)}});async function pit(n,e){const t=n.get(DQ),i=n.get(kd),s=n.get(Rn),o=await nBt(t,e.uri,e.getLanguageId(),gS(e));if(!o)return null;const r=[],a=await s.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!mo(c))return;for(const l of c)r.push(e.validateRange(new O(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}const OJ="vs/workbench/contrib/codeEditor/browser/saveParticipants";let pSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){if(!e.textEditorModel)return;const i=this.configurationService.getValue("files.trimTrailingWhitespace",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource}),s=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Ln.AUTO,s)}doTrimTrailingWhitespace(e,t,i){let s=[],o=[];const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t)){o=s.map(l=>l.getPosition());const c=mc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=cit(e,o,i);a.length&&e.pushEditOperations(s,a,c=>s)}};pSe=D([_(0,Re),_(1,jt)],pSe);function bhe(n,e){let t=null;if(n.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===n){if(i.hasTextFocus())return i;t=i}}return t}let mSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.insertFinalNewline",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doInsertFinalNewLine(e.textEditorModel)}doInsertFinalNewLine(e){const t=e.getLineCount(),i=e.getLineContent(t),s=Zv(i)===-1;if(!t||s)return;const o=[ds.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=bhe(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};mSe=D([_(0,Re),_(1,jt)],mSe);let _Se=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.trimFinalNewlines",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doTrimFinalNewLines(e.textEditorModel,t.reason===Ln.AUTO)}findLastNonEmptyLine(e){for(let t=e.getLineCount();t>=1;t--)if(e.getLineLength(t)>0)return t;return 0}doTrimFinalNewLines(e,t){const i=e.getLineCount();if(i===1)return;let s=[],o=0;const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t))for(let d=0,h=s.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new O(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(s,[ds.delete(l)],d=>s),r?.setSelections(s))}};_Se=D([_(0,Re),_(1,jt)],_Se);let vSe=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,s){if(!e.textEditorModel||t.reason===Ln.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new cf(h=>{i.report({message:g(OJ,0,"Running '{0}' Formatter ([configure]({1})).",h.displayName||h.extensionId&&h.extensionId.value||"???","command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D")})});if(!this.configurationService.getValue("editor.formatOnSave",r))return;const l=bhe(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(WCe,l,S_.Silent,a,s);else{const h=await this.instantiationService.invokeFunction(pit,Ka(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(WCe,l,S_.Silent,a,s):h&&await this.instantiationService.invokeFunction(Ude,l,h,S_.Silent,a,s,!1)}}};vSe=D([_(0,Re),_(1,jt),_(2,be)],vSe);let wSe=class{constructor(e,t,i){this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i}async participate(e,t,i,s){if(!e.textEditorModel)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",r);if(!a||t.reason===Ln.AUTO||t.reason!==Ln.EXPLICIT&&Array.isArray(a))return;const c=Array.isArray(a)?a:Object.keys(a).filter(u=>a[u]&&a[u]!=="never"),l=this.createCodeActionsOnSave(c);if(Array.isArray(a)||l.sort((u,f)=>ls.SourceFixAll.contains(u)?ls.SourceFixAll.contains(f)?0:-1:ls.SourceFixAll.contains(f)?1:0),!l.length)return;const d=Array.isArray(a)?[]:Object.keys(a).filter(u=>a[u]==="never"||!1).map(u=>new bs(u));i.report({message:g(OJ,1,"Quick Fixes")});const h=Array.isArray(a)?l:l.filter(u=>a[u.value]==="always"||(a[u.value]==="explicit"||a[u.value]===!0)&&t.reason===Ln.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,s)}createCodeActionsOnSave(e){const t=e.map(i=>new bs(i));return t.filter(i=>t.every(s=>s.equals(i)||!s.contains(i)))}async applyOnSaveActions(e,t,i,s,o){const r=new class{constructor(){this._names=new Set}_report(){s.report({message:g(OJ,2,"Getting code actions from '{0}' ([configure]({1})).",[...this._names].map(a=>`'${a}'`).join(", "),"command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D")})}report(a){a.displayName&&!this._names.has(a.displayName)&&(this._names.add(a.displayName),this._report())}};for(const a of t){const c=await this.getActionsToRun(e,a,i,r,o);if(o.isCancellationRequested){c.dispose();return}try{for(const l of c.validActions)if(s.report({message:g(OJ,3,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(Ttt,l,hI.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,s,o){return KW(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:wu.Auto,triggerAction:_f.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},s,o)}};wSe=D([_(0,Re),_(1,be),_(2,ht)],wSe);let bSe=class extends ${constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(pSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(wSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(vSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(mSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(_Se)))}};bSe=D([_(0,be),_(1,tr)],bSe);const rBt=it.as(pf.Workbench);rBt.registerWorkbenchContribution(bSe,Us.Restored);const j4e="vs/workbench/contrib/codeEditor/browser/toggleMinimap",Zae=class Zae extends pi{constructor(){super({id:Zae.ID,title:{...Be(j4e,0,"Toggle Minimap"),mnemonicTitle:g(j4e,1,"&&Minimap")},category:Za.View,f1:!0,toggled:ge.equals("config.editor.minimap.enabled",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Re),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Zae.ID="editor.action.toggleMinimap";let CSe=Zae;At(CSe);const eie="vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier",K2=class K2 extends pi{constructor(){super({id:K2.ID,title:Be(eie,0,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Re),s=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(K2.multiCursorModifierConfigurationKey,s)}};K2.ID="workbench.action.toggleMultiCursorModifier",K2.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let e6=K2;const mFe=new Y("multiCursorModifier","altKey");let ySe=class{constructor(e,t){this.configurationService=e,this._multiCursorModifier=mFe.bindTo(t),this._update(),e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()})}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};ySe=D([_(0,Re),_(1,Pe)],ySe);it.as(pf.Workbench).registerWorkbenchContribution(ySe,Us.Restored);At(e6);Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:g(eie,1,"Switch to Alt+Click for Multi-Cursor")},when:mFe.isEqualTo("ctrlCmd"),order:1});Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:ei?g(eie,2,"Switch to Cmd+Click for Multi-Cursor"):g(eie,3,"Switch to Ctrl+Click for Multi-Cursor")},when:mFe.isEqualTo("altKey"),order:1});const K4e="vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter",ece=class ece extends pi{constructor(){super({id:ece.ID,title:{...Be(K4e,0,"Toggle Control Characters"),mnemonicTitle:g(K4e,1,"Render &&Control Characters")},category:Za.View,f1:!0,toggled:ge.equals("config.editor.renderControlCharacters",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Re),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};ece.ID="editor.action.toggleRenderControlCharacter";let SSe=ece;At(SSe);const jQ="vs/workbench/contrib/codeEditor/browser/toggleWordWrap",mit="transientWordWrapState",_Fe="isWordWrapMinified",vFe="isDominatedByLongLines",_it=new Y("canToggleWordWrap",!1,!0),vit=new Y("editorWordWrap",!1,g(jQ,0,"Whether the editor is currently using word wrapping."));function tie(n,e,t){t.setTransientModelProperty(n,mit,e)}function iie(n,e){return e.getTransientModelProperty(n,mit)}const Che="editor.action.toggleWordWrap";class aBt extends lt{constructor(){super({id:Che,label:g(jQ,1,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:V.Alt|E.KeyZ,weight:ye.EditorContrib}})}run(e,t){const i=e.get(jt);if(!DV(i,t))return;const s=t.getModel(),o=iie(s,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},tie(s,r,i);const a=cBt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;DV(i,d)&&(tie(d.getModel(),r,i),a.updateOptions({}))}}}function cBt(n,e){if(!n.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),s=t.getModifiedEditor();if(i===n||s===n)return t}return null}var xH;let nie=(xH=class extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const o=this._editor.getOptions().get(x.wrappingInfo),r=this._contextKeyService.createKey(_Fe,o.isWordWrapMinified),a=this._contextKeyService.createKey(vFe,o.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);r.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!DV(this._codeEditorService,this._editor))return;const d=iie(this._editor.getModel(),this._codeEditorService);try{c=!0,this._applyWordWrapState(d)}finally{c=!1}}}_applyWordWrapState(e){const t=e?e.wordWrapOverride:"inherit";this._editor.updateOptions({wordWrapOverride2:t})}},xH.ID="editor.contrib.toggleWordWrapController",xH);nie=D([_(1,Pe),_(2,jt)],nie);var DH;let sie=(DH=class extends ${constructor(e,t){super(),this._diffEditor=e,this._codeEditorService=t,this._register(this._diffEditor.onDidChangeModel(()=>{this._ensureSyncedWordWrapToggle()}))}_ensureSyncedWordWrapToggle(){const e=this._diffEditor.getOriginalEditor(),t=this._diffEditor.getModifiedEditor();if(!e.hasModel()||!t.hasModel())return;const i=iie(e.getModel(),this._codeEditorService),s=iie(t.getModel(),this._codeEditorService);i&&!s&&DV(this._codeEditorService,e)&&(tie(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&s&&DV(this._codeEditorService,t)&&(tie(e.getModel(),s,this._codeEditorService),this._diffEditor.updateOptions({}))}},DH.ID="diffeditor.contrib.toggleWordWrapController",DH);sie=D([_(1,jt)],sie);function DV(n,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of n.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var kH;let oie=(kH=class extends ${constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(T.runAndSubscribe(Vb,({window:s,disposables:o})=>{o.add(pe(s,"focus",()=>this._update(),!0)),o.add(pe(s,"blur",()=>this._update(),!0))},{window:yi,disposables:this._store})),this._editorService.onDidActiveEditorChange(()=>this._update()),this._canToggleWordWrap=_it.bindTo(this._contextService),this._editorWordWrap=vit.bindTo(this._contextService),this._activeEditor=null,this._activeEditorListener=new Z,this._update()}_update(){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();this._activeEditor!==e&&(this._activeEditorListener.clear(),this._activeEditor=e,e&&(this._activeEditorListener.add(e.onDidChangeModel(()=>this._updateFromCodeEditor())),this._activeEditorListener.add(e.onDidChangeConfiguration(t=>{t.hasChanged(x.wrappingInfo)&&this._updateFromCodeEditor()})),this._updateFromCodeEditor()))}_updateFromCodeEditor(){if(DV(this._codeEditorService,this._activeEditor)){const e=this._activeEditor.getOption(x.wrappingInfo);this._setValues(!0,e.wrappingColumn!==-1)}else return this._setValues(!1,!1)}_setValues(e,t){this._canToggleWordWrap.set(e),this._editorWordWrap.set(t)}},kH.ID="workbench.contrib.editorWordWrapContextKeyTracker",kH);oie=D([_(0,_i),_(1,jt),_(2,Pe)],oie);gp(oie.ID,oie,Sl.AfterRestored);vn(nie.ID,nie,mi.Eager);Aje(sie.ID,sie);Fe(aBt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,2,"Disable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(ge.has(vFe),ge.has(_Fe))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,3,"Enable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(X.inDiffEditor.negate(),ge.has(vFe),ge.not(_Fe))});Xs.appendMenuItem(Te.MenubarViewMenu,{command:{id:Che,title:g(jQ,4,"&&Word Wrap"),toggled:vit,precondition:_it},order:1,group:"5_editor"});const Y4e="vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace",tce=class tce extends pi{constructor(){super({id:tce.ID,title:{...Be(Y4e,0,"Toggle Render Whitespace"),mnemonicTitle:g(Y4e,1,"&&Render Whitespace")},category:Za.View,f1:!0,toggled:ge.notEquals("config.editor.renderWhitespace","none"),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Re),i=t.getValue("editor.renderWhitespace");let s;return i==="none"?s="all":s="none",t.updateValue("editor.renderWhitespace",s)}};tce.ID="editor.action.toggleRenderWhitespace";let ASe=tce;At(ASe);class lBt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}it.add("gutterActionsRegistry",new lBt);const dBt=it.as("gutterActionsRegistry");var IH;let rie=(IH=class extends ${constructor(e,t,i,s,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=s,this.instantiationService=o,this._register(this.editor.onMouseDown(r=>this.doShow(r,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(ei&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Mt.GUTTER_LINE_NUMBERS&&e.target.type!==Mt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const s=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",s]]),r=this.menuService.createMenu(Te.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of dBt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:s,editor:this.editor,accessor:c},{push:(u,f="navigation")=>{const p=h.get(f)??[];p.push(u),h.set(f,p)}});for(const[u,f]of h.entries())a.push([u,f])}a.sort((d,h)=>d[0].localeCompare(h[0]));const l=r.getActions({arg:{lineNumber:s,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Mt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:s,endLineNumber:s,startColumn:1,endColumn:i.getLineLength(s)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,jb.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Kr.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},IH.ID="workbench.contrib.editorLineNumberContextMenu",IH);rie=D([_(1,Vr),_(2,_c),_(3,Pe),_(4,be)],rie);vn(rie.ID,rie,mi.AfterFirstRender);var Dg;const Hd="vs/workbench/contrib/format/browser/formatActionsMultiple";var Py;let oS=(Py=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=s,this._dialogService=o,this._quickInputService=r,this._languageService=a,this._languageFeaturesService=c,this._languageStatusService=l,this._editorService=d,this._languageStatusStore=this._store.add(new Z),this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(gV.setFormatterSelector((h,u,f,p)=>this._selectFormatter(h,u,f,p))),this._store.add(d.onDidActiveEditorChange(this._updateStatus,this)),this._store.add(c.documentFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(c.documentRangeFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(i.onDidChangeConfiguration(h=>h.affectsConfiguration(Dg.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const s=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return s&&!o?-1:!s&&o?1:t.name.localeCompare(i.name)}),Dg.extensionIds.length=0,Dg.extensionItemLabels.length=0,Dg.extensionDescriptions.length=0,Dg.extensionIds.push(null),Dg.extensionItemLabels.push(g(Hd,0,"None")),Dg.extensionDescriptions.push(g(Hd,1,"None"));for(const t of e)(t.main||t.browser)&&(Dg.extensionIds.push(t.identifier.value),Dg.extensionItemLabels.push(t.displayName??""),Dg.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const s=this._configService.getValue(Dg.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(s){const a=t.find(l=>Cn.equals(l.extensionId,s));if(a)return a;const c=await this._extensionService.getExtension(s);if(c&&this._extensionEnablementService.isEnabled(che(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===uV.File?g(Hd,2,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(Hd,3,"Extension '{0}' is configured as formatter but it can only format '{1}'-files as a whole, not selections or parts of it.",c.displayName||c.name,l)}}else if(t.length===1)return t[0];const o=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return s?g(Hd,5,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",s):g(Hd,4,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",Dg._maybeQuotes(o))}async _selectFormatter(e,t,i,s){const o=await this._analyzeFormatter(s,e,t);if(typeof o!="string")return o;if(i!==S_.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(Hd,6,"Configure Default Formatter"),detail:o,primaryButton:g(Hd,7,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(nt.Info,o,[{label:g(Hd,8,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:jU.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((r,a)=>({index:a,label:r.displayName||(r.extensionId?r.extensionId.value:"?"),description:r.extensionId&&r.extensionId.value})),s=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",Dg._maybeQuotes(s))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(Dg.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=_z(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Hde(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const s=new ai;this._languageStatusStore.add(Ee(()=>s.dispose(!0))),this._analyzeFormatter(uV.File,i,t).then(o=>{if(s.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${Dr()}`,title:g(Hd,10,"Configure...")};this._languageStatusStore.add(yt.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(Hd,11,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:nt.Error,label:g(Hd,12,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},Dg=Py,Py.configName="editor.defaultFormatter",Py.extensionIds=[],Py.extensionItemLabels=[],Py.extensionDescriptions=[],Py);oS=Dg=D([_(0,ho),_(1,Kh),_(2,Re),_(3,Pi),_(4,To),_(5,On),_(6,Di),_(7,ht),_(8,BPe),_(9,_i)],oS);it.as(pf.Workbench).registerWorkbenchContribution(oS,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[oS.configName]:{description:g(Hd,13,"Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter."),type:["string","null"],default:null,enum:oS.extensionIds,enumItemLabels:oS.extensionItemLabels,markdownEnumDescriptions:oS.extensionDescriptions}}});function wit(n,e,t,i){function s(o){return o.extensionId?Cn.toKey(o.extensionId):"unknown"}n.publicLog2("formatterpick",{mode:e,extensions:t.map(s),pick:i?s(i):"none"})}async function bit(n,e,t){const i=n.get(On),s=n.get(Re),o=n.get(Di),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=s.getValue(oS.configName,r);let c;const l=t.map((u,f)=>{const p=Cn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(Hd,14,"(default)"):void 0};return p&&(c=m),m}),d={label:g(Hd,15,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(Hd,16,"Select a formatter"),activeItem:c});if(h)if(h===d){const u=o.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",oS._maybeQuotes(u))});f&&t[f.index].extensionId&&s.updateValue(oS.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(Hd,17,"Format Document With..."),alias:"Format Document...",precondition:ge.and(X.writable,X.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const s=e.get(be),o=e.get(rn),r=e.get(ht),a=t.getModel(),c=Hde(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await s.invokeFunction(bit,a,c);typeof l=="number"&&await s.invokeFunction(mZe,c[l],t,S_.Explicit,qe.None),wit(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Fe(class extends lt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(Hd,18,"Format Selection With..."),alias:"Format Code...",precondition:ge.and(ge.and(X.writable),X.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:ge.and(X.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get(ht),o=e.get(rn),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new O(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=s.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(bit,r,c);typeof l=="number"&&await i.invokeFunction(pZe,c[l],t,a,qe.None,!0),wit(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const Uz="workbench.view.extensions";var Fr;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(Fr||(Fr={}));var ov;(function(n){n.ReloadWindow="reloadWindow",n.RestartExtensions="restartExtensions",n.DownloadUpdate="downloadUpdate",n.ApplyUpdate="applyUpdate",n.QuitAndInstall="quitAndInstall"})(ov||(ov={}));var ESe;(function(n){n.Readme="readme",n.Features="features",n.Changelog="changelog",n.Dependencies="dependencies",n.ExtensionPack="extensionPack"})(ESe||(ESe={}));const hBt="extensions.autoUpdate";let J4e=class extends ${constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?gc(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};J4e=D([_(1,pr)],J4e);const uBt="workbench.extensions.action.toggleIgnoreExtension",gBt="workbench.extensions.action.installVSIX";new Y("hasOutdatedExtensions",!1);new Y("hasGallery",!1);const fBt="_theme_",pBt="0_install",mBt="0_update";new Te("extensionsSearchActionsMenu");const yhe="vs/workbench/common/views";g(yhe,0,"Views");const _Bt=Ki("default-view-icon",Ce.window,g(yhe,1,"Default view icon."));var M1;(function(n){n.ViewContainersRegistry="workbench.registry.view.containers",n.ViewsRegistry="workbench.registry.view"})(M1||(M1={}));var Sr;(function(n){n[n.Sidebar=0]="Sidebar",n[n.Panel=1]="Panel",n[n.AuxiliaryBar=2]="AuxiliaryBar"})(Sr||(Sr={}));Sr.Sidebar,Sr.Panel,Sr.AuxiliaryBar;function aie(n){switch(n){case Sr.Sidebar:return"sidebar";case Sr.Panel:return"panel";case Sr.AuxiliaryBar:return"auxiliarybar"}}class vBt extends ${constructor(){super(...arguments),this._onDidRegister=this._register(new I),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new I),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const s=this.get(e.id);if(s)return s;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},XX(this.viewContainers,t,[]).push(o),i?.isDefault&&this.defaultViewContainers.push(o),this._onDidRegister.fire({viewContainer:o,viewContainerLocation:t}),o}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),s=i?.indexOf(e);if(s!==-1){i?.splice(s,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}it.add(M1.ViewContainersRegistry,new vBt);var cie;(function(n){n.Open="2_open",n.Debug="4_debug",n.SCM="5_scm",n.More="9_more"})(cie||(cie={}));function wBt(n,e){const t=n.group??cie.More,i=e.group??cie.More;return t!==i?t.localeCompare(i):(n.order??5)-(e.order??5)}class bBt extends ${constructor(){super(...arguments),this._onViewsRegistered=this._register(new I),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new I),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new I),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new I),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new Vq}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const s=this.removeViews(e,i);s.length&&(this.addViews(s,t),this._onDidChangeContainer.fire({views:s,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(s=>s.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(s=>s.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),Ee(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[s,o]of t)this._viewWelcomeContents.add(e,o),i.set(s,Ee(()=>{this._viewWelcomeContents.delete(e,o),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(wBt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const s of e){if(this.getView(s.id)!==null)throw new Error(g(yhe,2,"A view with id '{0}' is already registered",s.id));i.push(s)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const s=[],o=[];for(const r of i)e.includes(r)?s.push(r):o.push(r);return s.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),s}}it.add(M1.ViewsRegistry,new bBt);var xSe;(function(n){n[n.Default=0]="Default",n[n.Expand=1]="Expand"})(xSe||(xSe={}));var X4e;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(X4e||(X4e={}));class ppe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,Sm(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const s=await t(i);s&&(this.tooltip=this.tooltip??s.tooltip,this.command=this.command??s.command)}i.isCancellationRequested||(this.resolved=!0)}}get hasResolve(){return this._hasResolve}resetResolve(){this.resolved=!1}asTreeItem(){return{handle:this.handle,parentHandle:this.parentHandle,collapsibleState:this.collapsibleState,label:this.label,description:this.description,icon:this.icon,iconDark:this.iconDark,themeIcon:this.themeIcon,resourceUri:this.resourceUri,tooltip:this.tooltip,contextValue:this.contextValue,command:this.command,children:this.children,accessibilityInformation:this.accessibilityInformation}}}class kC extends Error{constructor(e){super(g(yhe,3,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}const OK="vs/workbench/contrib/format/browser/formatActionsNone";async function CBt(n,e){const t=await n.openPaneComposite(Uz,Sr.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.none",label:g(OK,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.writable,X.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(ji),s=e.get(Nw),o=e.get(Pi),r=e.get(To),a=e.get(ht),c=t.getModel(),l=a.documentFormattingEditProvider.all(c).length;if(l>1)return i.executeCommand("editor.action.formatDocument.multiple");if(l===1)return i.executeCommand("editor.action.formatDocument");if(c.isTooLargeForSyncing())o.warn(g(OK,1,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(OK,2,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(OK,3,"&&Install Formatter...")});u&&CBt(s,`category:formatters ${d}`)}}});var Tf;const DSe="vs/workbench/contrib/folding/browser/folding.contribution";var Fy;let AR=(Fy=class extends ${constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(Ox.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),Tf.extensionIds.length=0,Tf.extensionItemLabels.length=0,Tf.extensionDescriptions.length=0,Tf.extensionIds.push(null),Tf.extensionItemLabels.push(g(DSe,0,"All")),Tf.extensionDescriptions.push(g(DSe,1,"All active folding range providers"));const e=[],t=[];for(const s of this._extensionService.extensions)(s.main||s.browser)&&(s.categories?.find(o=>o==="Programming Languages")?e.push(s):t.push(s));const i=(s,o)=>s.name.localeCompare(o.name);for(const s of e.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"");for(const s of t.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(Tf.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(s=>s.id===i)}},Tf=Fy,Fy.configName="editor.defaultFoldingRangeProvider",Fy.extensionIds=[],Fy.extensionItemLabels=[],Fy.extensionDescriptions=[],Fy);AR=Tf=D([_(0,ho),_(1,Re)],AR);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[AR.configName]:{description:g(DSe,2,"Defines a default folding range provider that takes precedence over all other folding range providers. Must be the identifier of an extension contributing a folding range provider."),type:["string","null"],default:null,enum:AR.extensionIds,enumItemLabels:AR.extensionItemLabels,markdownEnumDescriptions:AR.extensionDescriptions}}});it.as(pf.Workbench).registerWorkbenchContribution(AR,Us.Restored);var yBt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";Ct(yBt,{});let t6=class extends ${get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}set link(e){typeof e.label=="string"?this.el.textContent=e.label:(Yo(this.el),this.el.appendChild(e.label)),this.el.href=e.href,typeof e.tabIndex<"u"&&(this.el.tabIndex=e.tabIndex),this.setTooltip(e.title),this._link=e}constructor(e,t,i={},s,o){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=he(e,we("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??va("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new oi(this.el,"click")),a=this._register(new oi(this.el,"keypress")),c=T.chain(a.event,h=>h.map(u=>new os(u)).filter(u=>u.keyCode===E.Enter)),l=this._register(new oi(this.el,Eo.Tap)).event;this._register(dh.addTarget(this.el));const d=T.any(r.event,c,l);this._register(d(h=>{this.enabled&&(un.stop(h,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupUpdatableHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};t6=D([_(3,el),_(4,fr)],t6);var BJ;const lie="vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty";var b0;let xF=(b0=class{static get(e){return e.getContribution(BJ.ID)??void 0}constructor(e,t,i,s){this._editor=e,this._accessibilitySignalService=i,this._instaService=s,this._sessionDispoosables=new Z,this._ariaElement=document.createElement("span"),this._ariaElement.style.position="fixed",this._ariaElement.className="inlayhint-accessibility-element",this._ariaElement.tabIndex=0,this._ariaElement.setAttribute("aria-description",g(lie,1,"Code with Inlay Hint Information")),this._ctxIsReading=BJ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Yo(this._ariaElement),this._sessionDispoosables.clear(),this._ctxIsReading.reset()}async _read(e,t){if(this._sessionDispoosables.clear(),this._ariaElement.isConnected||this._editor.getDomNode()?.appendChild(this._ariaElement),!this._editor.hasModel()||!this._ariaElement.isConnected){this._ctxIsReading.set(!1);return}const i=new ai;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const s=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(o.push(l),r=c.hint.position.column-1),r>750){o.push("…"),a=!0;break}const d=document.createElement("em"),{label:h}=c.hint;if(typeof h=="string")d.innerText=h;else for(const u of h)if(u.command){const f=this._instaService.createInstance(t6,d,{href:jtt(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;o.push(d)}a||o.push(s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),_a(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(pe(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=AV.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(Zl.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},BJ=b0,b0.IsReading=new Y("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(lie,0,"Whether the current line and its inlay hints are currently focused")}),b0.ID="editor.contrib.InlayHintsAccessibility",b0);xF=BJ=D([_(1,Pe),_(2,Lw),_(3,be)],xF);At(class extends wf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Be(lie,2,"Read Line With Inline Hints"),precondition:X.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){xF.get(t)?.startInlayHintsReading()}});At(class extends wf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Be(lie,3,"Stop Inlay Hints Reading"),precondition:xF.IsReading,f1:!0,keybinding:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(e,t){xF.get(t)?.stopInlayHintsReading()}});vn(xF.ID,xF,mi.Lazy);const xy="vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint";var nb;(function(n){n.languages="languages",n.actions="actions",n.kind="kind",n.title="title",n.description="description"})(nb||(nb={}));const SBt=Object.freeze({type:"array",markdownDescription:g(xy,0,"Configure which editor to use for a resource."),items:{type:"object",required:[nb.languages,nb.actions],properties:{[nb.languages]:{type:"array",description:g(xy,1,"Language modes that the code actions are enabled for."),items:{type:"string"}},[nb.actions]:{type:"object",required:[nb.kind,nb.title],properties:{[nb.kind]:{type:"string",markdownDescription:g(xy,2,"`CodeActionKind` of the contributed code action.")},[nb.title]:{type:"string",description:g(xy,3,"Label for the code action used in the UI.")},[nb.description]:{type:"string",description:g(xy,4,"Description of what the code action does.")}}}}}}),ABt={extensionPoint:"codeActions",deps:[CV],jsonSchema:SBt};class EBt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.codeActions}render(e){const t=e.contributes?.codeActions||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=t.map(r=>r.actions.map(a=>({...a,languages:r.languages}))).flat(),s=[g(xy,5,"Title"),g(xy,6,"Kind"),g(xy,7,"Description"),g(xy,8,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Xt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Xt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:s,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(xy,9,"Code Actions"),access:{canToggle:!1},renderer:new Gi(EBt)});const YO="vs/workbench/contrib/codeActions/common/documentationExtensionPoint";var tk;(function(n){n.when="when",n.title="title",n.command="command"})(tk||(tk={}));const xBt=Object.freeze({type:"object",description:g(YO,0,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(YO,1,"Contributed documentation for refactorings."),items:{type:"object",description:g(YO,2,"Contributed documentation for refactoring."),required:[tk.title,tk.when,tk.command],properties:{[tk.title]:{type:"string",description:g(YO,3,"Label for the documentation used in the UI.")},[tk.when]:{type:"string",description:g(YO,4,"When clause.")},[tk.command]:{type:"string",description:g(YO,5,"Command executed.")}}}}}}),DBt={extensionPoint:"documentation",deps:[CV],jsonSchema:xBt},Ak="vs/workbench/contrib/codeActions/browser/codeActionsContribution",Cit=n=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(Ak,0,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(Ak,1,"Triggers Code Actions only when explicitly saved"),g(Ak,2,"Never triggers Code Actions on save"),g(Ak,3,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(Ak,4,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:n}),kSe=Object.freeze({"source.fixAll":Cit(g(Ak,5,"Controls whether auto fix action should be run on file save."))}),yit={oneOf:[{type:"object",properties:kSe,additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(Ak,6,'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'),type:["object","array"],additionalProperties:{type:"string",enum:["always","explicit","never",!0,!1]},default:{},scope:ut.LANGUAGE_OVERRIDABLE},Sit=Object.freeze({...sA,properties:{"editor.codeActionsOnSave":yit}});let ISe=class extends ${constructor(e,t){super(),this._contributedCodeActions=[],this._onDidChangeContributions=this._register(new I),e.setHandler(i=>{this._contributedCodeActions=i.flatMap(s=>s.value).filter(s=>Array.isArray(s.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateConfigurationSchema(e){const t={...kSe};for(const[i,s]of this.getSourceActions(e))t[i]=Cit(g(Ak,7,"Controls whether '{0}' actions should be run on file save.",s.title));yit.properties=t,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(Sit)}getSourceActions(e){const t=Object.keys(kSe).map(s=>new bs(s)),i=new Map;for(const s of e)for(const o of s.actions){const r=new bs(o.kind);ls.Source.contains(r)&&!t.some(a=>a.contains(r))&&i.set(r.value,o)}return i}getSchemaAdditions(){const e=(i,s)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:s.map(o=>o.kind),enumDescriptions:s.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const s=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of s)!o.has(r.kind)&&i.contains(new bs(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(aFe,t(bs.Empty)),e(lFe,t(ls.Refactor)),e(dFe,t(ls.Source))]}};ISe=D([_(1,ti)],ISe);let LSe=class extends ${constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(s=>{this.contributions=[];for(const o of s)if(o.value.refactoring)for(const r of o.value.refactoring){const a=ge.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,s){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ls.Refactor.value&&!t.some(i=>i.kind&&ls.Refactor.contains(new bs(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};LSe=D([_(1,Pe),_(2,ht)],LSe);const kBt=Ap.registerExtensionPoint(ABt),IBt=Ap.registerExtensionPoint(DBt);it.as(Cs.Configuration).registerConfiguration(Sit);let TSe=class{constructor(e){e.createInstance(ISe,kBt),e.createInstance(LSe,IBt)}};TSe=D([_(0,be)],TSe);it.as(pf.Workbench).registerWorkbenchContribution(TSe,Us.Eventually);var LH;let die=(LH=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},LH.ID="workbench.contrib.listContext",LH);die=D([_(0,Pe)],die);gp(die.ID,die,Sl.BlockStartup);const Ait=[];function KQ(n){Ait.push(n)}function LBt(){return Ait.slice(0)}var TH;let hie=(TH=class extends ${constructor(e,t){super(),this._instantiationService=t,this._instantiated=!1,this._register(e.onWillCreateCodeEditor(()=>this._instantiate())),this._register(e.onWillCreateDiffEditor(()=>this._instantiate())),(e.listCodeEditors().length>0||e.listDiffEditors().length>0)&&this._instantiate()}_instantiate(){if(this._instantiated)return;this._instantiated=!0;const e=LBt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){bt(i)}}},TH.ID="workbench.contrib.editorFeaturesInstantiator",TH);hie=D([_(0,jt),_(1,be)],hie);gp(hie.ID,hie,Sl.BlockRestore);let RSe=class{constructor(e,t){this.disposables=new Z;const i=s=>e.activeContainer.classList.toggle("context-menu-visible",s);t.onDidShowContextMenu(()=>i(!0),null,this.disposables),t.onDidHideContextMenu(()=>i(!1),null,this.disposables)}};RSe=D([_(0,bg),_(1,Vr)],RSe);it.as(pf.Workbench).registerWorkbenchContribution(RSe,Us.Eventually);yt.registerCommand("_executeMappedEditsProvider",async(n,e,t,i)=>{const s=n.get(Rn),o=n.get(ht),r=await s.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ai;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const kO=bg,JO="vs/workbench/browser/actions/textInputActions";var RH;let uie=(RH=class extends ${constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new Ya(()=>this.createActions()),this.registerListeners()}createActions(){return[new xn("undo",g(JO,0,"Undo"),void 0,!0,async()=>Kg().execCommand("undo")),new xn("redo",g(JO,1,"Redo"),void 0,!0,async()=>Kg().execCommand("redo")),new Kr,new xn("editor.action.clipboardCutAction",g(JO,2,"Cut"),void 0,!0,async()=>Kg().execCommand("cut")),new xn("editor.action.clipboardCopyAction",g(JO,3,"Copy"),void 0,!0,async()=>Kg().execCommand("copy")),new xn("editor.action.clipboardPasteAction",g(JO,4,"Paste"),void 0,!0,async e=>{if(rf)Kg().execCommand("paste");else{const t=await this.clipboardService.readText();if(Zut(e)||egt(e)){const i=e.selectionStart||0,s=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(s,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Kr,new xn("editor.action.selectAll",g(JO,5,"Select All"),void 0,!0,async()=>Kg().execCommand("selectAll"))]}registerListeners(){this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(pe(e,"contextmenu",i=>this.onContextMenu(gt(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Ra(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;un.stop(t,!0);const s=new yu(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>s,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},RH.ID="workbench.contrib.textInputActionsProvider",RH);uie=D([_(0,kO),_(1,Vr),_(2,Mu)],uie);gp(uie.ID,uie,Sl.BlockRestore);var TBt='.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-workbench .screencast-mouse{border-radius:50%;border-style:solid;border-width:2px;content:" ";display:none;pointer-events:none;position:absolute;z-index:100000}.monaco-workbench .screencast-keyboard{background-color:rgba(0,0,0,.5);color:#eee;left:0;line-height:1.75em;overflow:hidden;pointer-events:none;position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:100000}.monaco-workbench:not(.reduce-motion) .screencast-keyboard{transition:opacity .3s ease-out}.monaco-workbench .screencast-keyboard:empty{opacity:0}.monaco-workbench .screencast-keyboard>.key{background-color:hsla(0,0%,100%,.05);border:1px solid hsla(0,0%,80%,.4);border-radius:5px;box-shadow:inset 0 -3px 0 hsla(0,0%,73%,.4);margin-right:6px;padding:0 8px}.monaco-workbench .screencast-keyboard>.title{font-weight:600}';Ct(TBt,{});const RBt="rendererLog",MBt="workbench.action.showWindowLog";let Ip;const mpe=globalThis.vscode;if(typeof mpe<"u"&&typeof mpe.context<"u"){const n=mpe.context.configuration();if(n)Ip=n.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Ip=globalThis._VSCODE_PRODUCT_JSON,IU.VSCODE_DEV&&Object.assign(Ip,{nameShort:`${Ip.nameShort} Dev`,nameLong:`${Ip.nameLong} Dev`,dataFolderName:`${Ip.dataFolderName}-dev`,serverDataFolderName:Ip.serverDataFolderName?`${Ip.serverDataFolderName}-dev`:void 0}),!Ip.version){const n=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ip,{version:n.version})}}else Ip={},Object.keys(Ip).length===0&&Object.assign(Ip,{version:"1.90.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var NBt=Ip;const br="vs/workbench/browser/actions/developerActions";class PBt extends pi{constructor(){super({id:"workbench.action.inspectContextKeys",title:Be(br,0,"Inspect Context Keys"),category:Za.Developer,f1:!0})}run(e){const t=e.get(Pe),i=new Z,s=od(void 0,void 0,i);Kp("*","cursor: crosshair !important;",s);const o=document.createElement("div"),r=Kg();r.body.appendChild(o),i.add(Ee(()=>r.body.removeChild(o))),o.style.position="absolute",o.style.pointerEvents="none",o.style.backgroundColor="rgba(255, 0, 0, 0.5)",o.style.zIndex="1000";const a=i.add(new oi(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=ia(h);o.style.top=`${u.top}px`,o.style.left=`${u.left}px`,o.style.width=`${u.width}px`,o.style.height=`${u.height}px`}));const c=i.add(new oi(r,"mousedown",!0));T.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new oi(r,"mouseup",!0));T.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),St(i)},null,i)}}class g2 extends pi{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Be(br,1,"Toggle Screencast Mode"),category:Za.Developer,f1:!0})}run(e){if(g2.disposable){g2.disposable.dispose(),g2.disposable=void 0;return}const t=e.get(bg),i=e.get(Re),s=e.get(ti),o=new Z,r=t.activeContainer,a=he(r,we(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=he(r,we(".screencast-keyboard"));o.add(Ee(()=>c.remove()));const l=o.add(new I),d=o.add(new I),h=o.add(new I);function u(j,re){re.add(re.add(new oi(j,"mousedown",!0)).event(me=>l.fire(me))),re.add(re.add(new oi(j,"mouseup",!0)).event(me=>d.fire(me))),re.add(re.add(new oi(j,"mousemove",!0)).event(me=>h.fire(me)))}for(const{window:j,disposables:re}of N9())u(t.getContainer(j),re);o.add(Vb(({window:j,disposables:re})=>u(t.getContainer(j),re))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=fe.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=kc(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),o.add(l.event(j=>{a.style.top=`${j.clientY-p/2}px`,a.style.left=`${j.clientX-p/2}px`,a.style.display="block",a.style.transform="scale(1)",a.style.transition="transform 0.1s";const re=h.event(me=>{a.style.top=`${me.clientY-p/2}px`,a.style.left=`${me.clientX-p/2}px`,a.style.transform=`scale(${.8})`});T.once(d.event)(()=>{a.style.display="none",re.dispose()})}));const v=()=>{c.style.fontSize=`${kc(i.getValue("screencastMode.fontSize")||56,20,100)}px`},w=()=>{c.style.bottom=`${kc(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let b;const C=()=>{b=kc(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),w(),C(),o.add(i.onDidChangeConfiguration(j=>{j.affectsConfiguration("screencastMode.verticalOffset")&&w(),j.affectsConfiguration("screencastMode.fontSize")&&v(),j.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&C(),j.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),j.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const y=o.add(new I),S=o.add(new I),M=o.add(new I),k=o.add(new I);function F(j,re){re.add(re.add(new oi(j,"keydown",!0)).event(me=>y.fire(me))),re.add(re.add(new oi(j,"compositionstart",!0)).event(me=>S.fire(me))),re.add(re.add(new oi(j,"compositionupdate",!0)).event(me=>M.fire(me))),re.add(re.add(new oi(j,"compositionend",!0)).event(me=>k.fire(me)))}for(const{window:j,disposables:re}of N9())F(j,re);o.add(Vb(({window:j,disposables:re})=>F(j,re)));let N=0,z,U=!1;const J=new yn(()=>{c.textContent="",z=void 0,N=0},b);o.add(S.event(j=>{U=!0})),o.add(M.event(j=>{j.data&&U?(N>20&&(c.innerText="",N=0),z=z??he(c,we("span.key")),z.textContent=j.data):U&&(c.innerText="",he(c,we("span.key",{},"Backspace"))),J.schedule()})),o.add(k.event(j=>{z=void 0,N++})),o.add(y.event(j=>{if(j.key==="Process"||/[\uac00-\ud787\u3131-\u314e\u314f-\u3163\u3041-\u3094\u30a1-\u30f4\u30fc\u3005\u3006\u3024\u4e00-\u9fa5]/u.test(j.key)){j.code==="Backspace"||j.code.includes("Key")?U=!0:(z=void 0,U=!1),J.schedule();return}if(j.isComposing)return;const re=i.getValue("screencastMode.keyboardOptions"),me=new os(j),De=s.softDispatch(me,me.target);if(De.kind===hp.KbFound&&De.commandId&&!(re.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(De.commandId))return;(me.ctrlKey||me.altKey||me.metaKey||me.shiftKey||N>20||me.keyCode===E.Backspace||me.keyCode===E.Escape||me.keyCode===E.UpArrow||me.keyCode===E.DownArrow||me.keyCode===E.LeftArrow||me.keyCode===E.RightArrow)&&(c.innerText="",N=0);const Qe=s.resolveKeyboardEvent(me),Tt=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Oe=Tt?.title,wt=Qe.getLabel();if(Tt&&((re.showCommandGroups??!1)&&Tt.category&&(Oe=`${Tt.category}: ${Oe} `),this._isKbFound(De)&&De.commandId)){const Nt=s.lookupKeybindings(De.commandId).filter(Ji=>Ji.getLabel()?.endsWith(wt??""));Nt.length>0&&(wt=Nt[Nt.length-1].getLabel())}(re.showCommands??!0)&&Oe&&he(c,we("span.title",{},`${Oe} `)),((re.showKeys??!0)||(re.showKeybindings??!0)&&this._isKbFound(De))&&(wt=wt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),he(c,we("span.key",{},wt??""))),N++,J.schedule()})),g2.disposable=o}_isKbFound(e){return e.kind===hp.KbFound}getCommandDetails(e){const t=Xs.getCommand(e);if(t)return{title:typeof t.title=="string"?t.title:t.title.value,category:t.category?typeof t.category=="string"?t.category:t.category.value:void 0};const i=yt.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class FBt extends pi{constructor(){super({id:"workbench.action.logStorage",title:Be(br,2,"Log Storage Database Contents"),category:Za.Developer,f1:!0})}run(e){const t=e.get(on),i=e.get(To);t.log(),i.info(g(br,3,"The storage database contents have been logged to the developer tools."),g(br,4,"Open developer tools from the menu and select the Console tab."))}}class OBt extends pi{constructor(){super({id:"workbench.action.logWorkingCopies",title:Be(br,5,"Log Working Copies"),category:Za.Developer,f1:!0})}async run(e){const t=e.get(Pw),i=e.get(MQ),s=e.get(Ze),o=e.get(nhe),r=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...r.length>0?r.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];s.info(a.join(` -`)),o.showChannel(RBt,!0)}}const ice=class ice extends pi{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Be(br,6,"Remove Large Storage Database Entries..."),category:Za.Developer,f1:!0})}async run(e){const t=e.get(on),i=e.get(On),s=e.get(Rm),o=e.get(To),r=e.get(Il),a=[];for(const h of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE])if(!(h===ke.PROFILE&&s.currentProfile.isDefault))for(const u of[ln.MACHINE,ln.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>ice.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:vl.formatSize(p.length),detail:g(br,7,"Scope: {0}, Target: {1}",h===ke.APPLICATION?g(br,8,"Global"):h===ke.PROFILE?g(br,9,"Profile"):g(br,10,"Workspace"),u===ln.MACHINE?g(br,11,"Machine"):g(br,12,"User"))})}a.sort((h,u)=>u.size-h.size);const c=await new Promise(h=>{const u=new Z,f=u.add(i.createQuickPick());f.items=a,f.canSelectMany=!0,f.ok=!1,f.customButton=!0,f.hideCheckAll=!0,f.customLabel=g(br,13,"Remove"),f.placeholder=g(br,14,"Select large entries to remove from storage"),a.length===0&&(f.description=g(br,15,"There are no large storage entries to remove.")),f.show(),u.add(f.onDidCustom(()=>{h(f.selectedItems),f.hide()})),u.add(f.onDidHide(()=>u.dispose()))});if(c.length===0)return;const{confirmed:l}=await o.confirm({type:"warning",message:g(br,16,"Do you want to remove the selected storage entries from the database?"),detail:g(br,17,`{0} + `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(M.any(this.editorService.onDidCloseEditor,this.editorService.onDidVisibleEditorsChange)(()=>this.onEditorsChanged())),this.onEditorsChanged(),this.enabled=!0}disable(){if(this.enabled){this.transientDisposables.clear();for(const[,e]of this.items)bt(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(Qr(e)){const t=e.getModel(),i=rC.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const n=this.textFileService.files.get(t.uri);if(n?.isResolved()){const o=this.instantiationService.createInstance(ewe,n),r=new Zbe(n.textEditorModel,e,o,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new $Ft(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(n=>Qr(n)&&n.getModel()?.uri.toString()===e.toString()&&n.getId()===i)||t.has(i)&&(t.get(i)?.dispose(),t.delete(i),t.size===0&&this.items.delete(e))}getModel(e,t){return this.items.get(e.uri)?.get(t.getId())?.model}dispose(){this.disable(),super.dispose()}};kUe=D([_(0,ei),_(1,we),_(2,Te),_(3,Fo)],kUe);on(rC.ID,rC,ri.AfterFirstRender);Re(class extends tt{constructor(){super({id:"editor.action.formatChanges",label:g(4522,"Format Modified Lines"),alias:"Format Modified Lines",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(we);if(!t.hasModel())return;const n=await i.invokeFunction(oet,t.getModel());if(eo(n))return i.invokeFunction(Rae,t,n,om.Explicit,lu.None,He.None,!0)}});async function oet(s,e){const t=s.get(M6),i=s.get(Ml),n=s.get(fn),o=await zFt(t,e.uri,e.getLanguageId(),Ly(e));if(!o)return null;const r=[],a=await n.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!eo(c))return;for(const l of c)r.push(e.validateRange(new F(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}let twe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){if(!e.textEditorModel)return;const i=this.configurationService.getValue("files.trimTrailingWhitespace",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource}),n=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Cn.AUTO,n)}doTrimTrailingWhitespace(e,t,i){let n=[],o=[];const r=gce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t)){o=n.map(l=>l.getPosition());const c=fc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=ZZe(e,o,i);a.length&&e.pushEditOperations(n,a,c=>n)}};twe=D([_(0,Te),_(1,Kt)],twe);function gce(s,e){let t=null;if(s.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===s){if(i.hasTextFocus())return i;t=i}}return t}let iwe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.insertFinalNewline",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doInsertFinalNewLine(e.textEditorModel)}doInsertFinalNewLine(e){const t=e.getLineCount(),i=e.getLineContent(t),n=T_(i)===-1;if(!t||n)return;const o=[Zn.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=gce(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};iwe=D([_(0,Te),_(1,Kt)],iwe);let nwe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.trimFinalNewlines",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doTrimFinalNewLines(e.textEditorModel,t.reason===Cn.AUTO)}findLastNonEmptyLine(e){for(let t=e.getLineCount();t>=1;t--)if(e.getLineLength(t)>0)return t;return 0}doTrimFinalNewLines(e,t){const i=e.getLineCount();if(i===1)return;let n=[],o=0;const r=gce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t))for(let d=0,h=n.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new F(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(n,[Zn.delete(l)],d=>n),r?.setSelections(n))}};nwe=D([_(0,Te),_(1,Kt)],nwe);let swe=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,n){if(!e.textEditorModel||t.reason===Cn.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new lu(h=>{i.report({message:g(724,"Running '{0}' Formatter ([configure]({1})).",h.displayName||h.extensionId&&h.extensionId.value||"???","command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D")})});if(!this.configurationService.getValue("editor.formatOnSave",r))return;const l=gce(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(Ave,l,om.Silent,a,n);else{const h=await this.instantiationService.invokeFunction(oet,Qr(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(Ave,l,om.Silent,a,n):h&&await this.instantiationService.invokeFunction(Rae,l,h,om.Silent,a,n,!1)}}};swe=D([_(0,Te),_(1,Kt),_(2,we)],swe);let owe=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i,this.hostService=n,this.editorService=o,this.codeEditorService=r,this._register(this.hostService.onDidChangeFocus(()=>{this.triggerCodeActionsCommand()})),this._register(this.editorService.onDidActiveEditorChange(()=>{this.triggerCodeActionsCommand()}))}async triggerCodeActionsCommand(){if(this.configurationService.getValue("editor.codeActions.triggerOnFocusChange")&&this.configurationService.getValue("files.autoSave")==="afterDelay"){const e=this.codeEditorService.getActiveCodeEditor()?.getModel();if(!e)return;const t={overrideIdentifier:e.getLanguageId(),resource:e.uri},i=this.configurationService.getValue("editor.codeActionsOnSave",t);if(!i||Array.isArray(i))return;const n=Object.keys(i).filter(a=>i[a]&&i[a]==="always"&&ys.Source.contains(new Yn(a))),o=new ci,r=[];for(const a of n)r.push(new Yn(a));await this.applyOnSaveActions(e,r,[],lu.None,o.token)}}async participate(e,t,i,n){if(!e.textEditorModel)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",r);if(!a||t.reason===Cn.AUTO||t.reason!==Cn.EXPLICIT&&Array.isArray(a))return;const c=Array.isArray(a)?a:Object.keys(a).filter(u=>a[u]&&a[u]!=="never"),l=this.createCodeActionsOnSave(c);if(Array.isArray(a)||l.sort((u,f)=>ys.SourceFixAll.contains(u)?ys.SourceFixAll.contains(f)?0:-1:ys.SourceFixAll.contains(f)?1:0),!l.length)return;const d=Array.isArray(a)?[]:Object.keys(a).filter(u=>a[u]==="never"||!1).map(u=>new Yn(u));i.report({message:g(725,"Quick Fixes")});const h=Array.isArray(a)?l:l.filter(u=>a[u.value]==="always"||(a[u.value]==="explicit"||a[u.value]===!0)&&t.reason===Cn.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,n)}createCodeActionsOnSave(e){const t=e.map(i=>new Yn(i));return t.filter(i=>t.every(n=>n.equals(i)||!n.contains(i)))}async applyOnSaveActions(e,t,i,n,o){const r=new class{constructor(){this._names=new Set}_report(){n.report({message:g(726,"Getting code actions from '{0}' ([configure]({1})).",[...this._names].map(a=>`'${a}'`).join(", "),"command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D")})}report(a){a.displayName&&!this._names.has(a.displayName)&&(this._names.add(a.displayName),this._report())}};for(const a of t){const c=await this.getActionsToRun(e,a,i,r,o);if(o.isCancellationRequested){c.dispose();return}try{for(const l of c.validActions)if(n.report({message:g(727,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(mZe,l,Nx.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,n,o){return ZO(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:Ch.Auto,triggerAction:sg.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},n,o)}};owe=D([_(0,Te),_(1,we),_(2,it),_(3,xc),_(4,ei),_(5,Kt)],owe);let rwe=class extends V{constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(twe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(owe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(swe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(iwe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(nwe)))}};rwe=D([_(0,we),_(1,Fo)],rwe);const GFt=Qe.as(cf.Workbench);GFt.registerWorkbenchContribution(rwe,Rs.Restored);const Ose=class Ose extends li{constructor(){super({id:Ose.ID,title:{...Pe(728,"Toggle Minimap"),mnemonicTitle:g(729,"&&Minimap")},category:ca.View,f1:!0,toggled:he.equals("config.editor.minimap.enabled",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Te),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Ose.ID="editor.action.toggleMinimap";let awe=Ose;At(awe);const iO=class iO extends li{constructor(){super({id:iO.ID,title:Pe(730,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Te),n=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(iO.multiCursorModifierConfigurationKey,n)}};iO.ID="workbench.action.toggleMultiCursorModifier",iO.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let e9=iO;const GMe=new Q("multiCursorModifier","altKey");let cwe=class extends V{constructor(e,t){super(),this.configurationService=e,this._multiCursorModifier=GMe.bindTo(t),this._update(),this._register(e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()}))}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};cwe=D([_(0,Te),_(1,Le)],cwe);Qe.as(cf.Workbench).registerWorkbenchContribution(cwe,Rs.Restored);At(e9);jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:e9.ID,title:g(731,"Switch to Alt+Click for Multi-Cursor")},when:GMe.isEqualTo("ctrlCmd"),order:1});jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:e9.ID,title:Qt?g(732,"Switch to Cmd+Click for Multi-Cursor"):g(733,"Switch to Ctrl+Click for Multi-Cursor")},when:GMe.isEqualTo("altKey"),order:1});const Bse=class Bse extends li{constructor(){super({id:Bse.ID,title:{...Pe(734,"Toggle Control Characters"),mnemonicTitle:g(735,"Render &&Control Characters")},category:ca.View,f1:!0,toggled:he.equals("config.editor.renderControlCharacters",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Te),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};Bse.ID="editor.action.toggleRenderControlCharacter";let lwe=Bse;At(lwe);const ret="transientWordWrapState",KMe="isWordWrapMinified",qMe="isDominatedByLongLines",aet=new Q("canToggleWordWrap",!1,!0),cet=new Q("editorWordWrap",!1,g(736,"Whether the editor is currently using word wrapping."));function IX(s,e,t){t.setTransientModelProperty(s,ret,e)}function TX(s,e){return e.getTransientModelProperty(s,ret)}const fce="editor.action.toggleWordWrap";class KFt extends tt{constructor(){super({id:fce,label:g(737,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:U.Alt|S.KeyZ,weight:Ae.EditorContrib}})}run(e,t){const i=e.get(Kt);if(!xW(i,t))return;const n=t.getModel(),o=TX(n,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},IX(n,r,i);const a=qFt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;xW(i,d)&&(IX(d.getModel(),r,i),a.updateOptions({}))}}}function qFt(s,e){if(!s.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),n=t.getModifiedEditor();if(i===s||n===s)return t}return null}var kB;let LX=(kB=class extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const o=this._editor.getOptions().get(x.wrappingInfo),r=this._contextKeyService.createKey(KMe,o.isWordWrapMinified),a=this._contextKeyService.createKey(qMe,o.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);r.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!xW(this._codeEditorService,this._editor))return;const d=TX(this._editor.getModel(),this._codeEditorService);try{c=!0,this._applyWordWrapState(d)}finally{c=!1}}}_applyWordWrapState(e){const t=e?e.wordWrapOverride:"inherit";this._editor.updateOptions({wordWrapOverride2:t})}},kB.ID="editor.contrib.toggleWordWrapController",kB);LX=D([_(1,Le),_(2,Kt)],LX);var IB;let RX=(IB=class extends V{constructor(e,t){super(),this._diffEditor=e,this._codeEditorService=t,this._register(this._diffEditor.onDidChangeModel(()=>{this._ensureSyncedWordWrapToggle()}))}_ensureSyncedWordWrapToggle(){const e=this._diffEditor.getOriginalEditor(),t=this._diffEditor.getModifiedEditor();if(!e.hasModel()||!t.hasModel())return;const i=TX(e.getModel(),this._codeEditorService),n=TX(t.getModel(),this._codeEditorService);i&&!n&&xW(this._codeEditorService,e)&&(IX(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&n&&xW(this._codeEditorService,t)&&(IX(e.getModel(),n,this._codeEditorService),this._diffEditor.updateOptions({}))}},IB.ID="diffeditor.contrib.toggleWordWrapController",IB);RX=D([_(1,Kt)],RX);function xW(s,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of s.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var TB;let MX=(TB=class extends V{constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(M.runAndSubscribe(tm,({window:n,disposables:o})=>{o.add(ue(n,"focus",()=>this._update(),!0)),o.add(ue(n,"blur",()=>this._update(),!0))},{window:si,disposables:this._store})),this._register(this._editorService.onDidActiveEditorChange(()=>this._update())),this._canToggleWordWrap=aet.bindTo(this._contextService),this._editorWordWrap=cet.bindTo(this._contextService),this._activeEditor=null,this._activeEditorListener=new Z,this._update()}_update(){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();this._activeEditor!==e&&(this._activeEditorListener.clear(),this._activeEditor=e,e&&(this._activeEditorListener.add(e.onDidChangeModel(()=>this._updateFromCodeEditor())),this._activeEditorListener.add(e.onDidChangeConfiguration(t=>{t.hasChanged(x.wrappingInfo)&&this._updateFromCodeEditor()})),this._updateFromCodeEditor()))}_updateFromCodeEditor(){if(xW(this._codeEditorService,this._activeEditor)){const e=this._activeEditor.getOption(x.wrappingInfo);this._setValues(!0,e.wrappingColumn!==-1)}else return this._setValues(!1,!1)}_setValues(e,t){this._canToggleWordWrap.set(e),this._editorWordWrap.set(t)}},TB.ID="workbench.contrib.editorWordWrapContextKeyTracker",TB);MX=D([_(0,ei),_(1,Kt),_(2,Le)],MX);Qu(MX.ID,MX,yc.AfterRestored);on(LX.ID,LX,ri.Eager);nKe(RX.ID,RX);Re(KFt);jn.appendMenuItem(_e.EditorTitle,{command:{id:fce,title:g(738,"Disable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(he.has(qMe),he.has(KMe))});jn.appendMenuItem(_e.EditorTitle,{command:{id:fce,title:g(739,"Enable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(J.inDiffEditor.negate(),he.has(qMe),he.not(KMe))});jn.appendMenuItem(_e.MenubarViewMenu,{command:{id:fce,title:g(740,"&&Word Wrap"),toggled:cet,precondition:aet},order:1,group:"5_editor"});const Wse=class Wse extends li{constructor(){super({id:Wse.ID,title:{...Pe(741,"Toggle Render Whitespace"),mnemonicTitle:g(742,"&&Render Whitespace")},category:ca.View,f1:!0,toggled:he.notEquals("config.editor.renderWhitespace","none"),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Te),i=t.getValue("editor.renderWhitespace");let n;return i==="none"?n="all":n="none",t.updateValue("editor.renderWhitespace",n)}};Wse.ID="editor.action.toggleRenderWhitespace";let dwe=Wse;At(dwe);class QFt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}Qe.add("gutterActionsRegistry",new QFt);const jFt=Qe.as("gutterActionsRegistry");var LB;let NX=(LB=class extends V{constructor(e,t,i,n,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=n,this.instantiationService=o,this._register(this.editor.onMouseDown(r=>this.doShow(r,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(Qt&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Rt.GUTTER_LINE_NUMBERS&&e.target.type!==Rt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const n=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",n]]),r=this.menuService.createMenu(_e.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of jFt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:n,editor:this.editor,accessor:c},{push:(u,f="navigation")=>{const p=h.get(f)??[];p.push(u),h.set(f,p)}});for(const[u,f]of h.entries())a.push([u,f])}a.sort((d,h)=>d[0].localeCompare(h[0]));const l=r.getActions({arg:{lineNumber:n,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Rt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:n,endLineNumber:n,startColumn:1,endColumn:i.getLineLength(n)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,Db.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Ar.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},LB.ID="workbench.contrib.editorLineNumberContextMenu",LB);NX=D([_(1,lr),_(2,Oa),_(3,Le),_(4,we)],NX);on(NX.ID,NX,ri.AfterFirstRender);var bu,ty;let Cy=(ty=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=n,this._dialogService=o,this._quickInputService=r,this._languageService=a,this._languageFeaturesService=c,this._languageStatusService=l,this._editorService=d,this._languageStatusStore=this._store.add(new Z),this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(gW.setFormatterSelector((h,u,f,p)=>this._selectFormatter(h,u,f,p))),this._store.add(d.onDidActiveEditorChange(this._updateStatus,this)),this._store.add(c.documentFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(c.documentRangeFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(i.onDidChangeConfiguration(h=>h.affectsConfiguration(bu.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const n=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return n&&!o?-1:!n&&o?1:t.name.localeCompare(i.name)}),bu.extensionIds.length=0,bu.extensionItemLabels.length=0,bu.extensionDescriptions.length=0,bu.extensionIds.push(null),bu.extensionItemLabels.push(g(4529,"None")),bu.extensionDescriptions.push(g(4530,"None"));for(const t of e)(t.main||t.browser)&&(bu.extensionIds.push(t.identifier.value),bu.extensionItemLabels.push(t.displayName??""),bu.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const n=this._configService.getValue(bu.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(n){const a=t.find(l=>Sn.equals(l.extensionId,n));if(a)return a;const c=await this._extensionService.getExtension(n);if(c&&this._extensionEnablementService.isEnabled(ice(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===uW.File?g(4531,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(4532,"Extension '{0}' is configured as formatter but it can only format '{1}'-files as a whole, not selections or parts of it.",c.displayName||c.name,l)}}else if(t.length===1)return t[0];const o=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return n?g(4534,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",n):g(4533,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",bu._maybeQuotes(o))}async _selectFormatter(e,t,i,n){const o=await this._analyzeFormatter(n,e,t);if(typeof o!="string")return o;if(i!==om.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(4535,"Configure Default Formatter"),detail:o,primaryButton:g(4536,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(Xe.Info,o,[{label:g(4537,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:K2.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((r,a)=>({index:a,label:r.displayName||(r.extensionId?r.extensionId.value:"?"),description:r.extensionId&&r.extensionId.value})),n=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(4538,"Select a default formatter for '{0}' files",bu._maybeQuotes(n))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(bu.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=s6(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Lae(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const n=new ci;this._languageStatusStore.add(Ee(()=>n.dispose(!0))),this._analyzeFormatter(uW.File,i,t).then(o=>{if(n.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${ar()}`,title:g(4539,"Configure...")};this._languageStatusStore.add(_t.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(4540,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:Xe.Error,label:g(4541,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},bu=ty,ty.configName="editor.defaultFormatter",ty.extensionIds=[],ty.extensionItemLabels=[],ty.extensionDescriptions=[],ty);Cy=bu=D([_(0,fs),_(1,Nl),_(2,Te),_(3,bi),_(4,to),_(5,In),_(6,xi),_(7,it),_(8,Yae),_(9,ei)],Cy);Qe.as(cf.Workbench).registerWorkbenchContribution(Cy,Rs.Restored);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[Cy.configName]:{description:g(4542,"Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter."),type:["string","null"],default:null,enum:Cy.extensionIds,enumItemLabels:Cy.extensionItemLabels,markdownEnumDescriptions:Cy.extensionDescriptions}}});function det(s,e,t,i){function n(o){return o.extensionId?Sn.toKey(o.extensionId):"unknown"}s.publicLog2("formatterpick",{mode:e,extensions:t.map(n),pick:i?n(i):"none"})}async function het(s,e,t){const i=s.get(In),n=s.get(Te),o=s.get(xi),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=n.getValue(Cy.configName,r);let c;const l=t.map((u,f)=>{const p=Sn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(4543,"(default)"):void 0};return p&&(c=m),m}),d={label:g(4544,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(4545,"Select a formatter"),activeItem:c});if(h)if(h===d){const u=o.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(4538,"Select a default formatter for '{0}' files",Cy._maybeQuotes(u))});f&&t[f.index].extensionId&&n.updateValue(Cy.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Re(class extends tt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(4546,"Format Document With..."),alias:"Format Document...",precondition:he.and(J.writable,J.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const n=e.get(we),o=e.get(Yi),r=e.get(it),a=t.getModel(),c=Lae(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await n.invokeFunction(het,a,c);typeof l=="number"&&await n.invokeFunction(YYe,c[l],t,om.Explicit,He.None),det(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Re(class extends tt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(4547,"Format Selection With..."),alias:"Format Code...",precondition:he.and(he.and(J.writable),J.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:he.and(J.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=e.get(it),o=e.get(Yi),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new F(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=n.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(het,r,c);typeof l=="number"&&await i.invokeFunction(jYe,c[l],t,a,He.None,!0),det(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const GU="workbench.view.extensions";var Qo;(function(s){s[s.Installing=0]="Installing",s[s.Installed=1]="Installed",s[s.Uninstalling=2]="Uninstalling",s[s.Uninstalled=3]="Uninstalled"})(Qo||(Qo={}));var $m;(function(s){s.ReloadWindow="reloadWindow",s.RestartExtensions="restartExtensions",s.DownloadUpdate="downloadUpdate",s.ApplyUpdate="applyUpdate",s.QuitAndInstall="quitAndInstall"})($m||($m={}));var t9;(function(s){s.Readme="readme",s.Features="features",s.Changelog="changelog",s.Dependencies="dependencies",s.ExtensionPack="extensionPack"})(t9||(t9={}));const YFt="extensions.autoUpdate";let IUe=class extends V{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?Ra(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};IUe=D([_(1,Xo)],IUe);const JFt="workbench.extensions.action.toggleIgnoreExtension",XFt="workbench.extensions.action.installVSIX";new Q("hasOutdatedExtensions",!1);new Q("hasGallery",!1);const ZFt="_theme_",eOt="0_install",tOt="0_update";new _e("extensionsSearchActionsMenu");g(5291,"Views");const iOt=oi("default-view-icon",ve.window,g(5292,"Default view icon."));var eI;(function(s){s.ViewContainersRegistry="workbench.registry.view.containers",s.ViewsRegistry="workbench.registry.view"})(eI||(eI={}));var ir;(function(s){s[s.Sidebar=0]="Sidebar",s[s.Panel=1]="Panel",s[s.AuxiliaryBar=2]="AuxiliaryBar"})(ir||(ir={}));ir.Sidebar,ir.Panel,ir.AuxiliaryBar;function PX(s){switch(s){case ir.Sidebar:return"sidebar";case ir.Panel:return"panel";case ir.AuxiliaryBar:return"auxiliarybar"}}class nOt extends V{constructor(){super(...arguments),this._onDidRegister=this._register(new I),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new I),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const n=this.get(e.id);if(n)return n;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},Cj(this.viewContainers,t,[]).push(o),i?.isDefault&&this.defaultViewContainers.push(o),this._onDidRegister.fire({viewContainer:o,viewContainerLocation:t}),o}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),n=i?.indexOf(e);if(n!==-1){i?.splice(n,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}Qe.add(eI.ViewContainersRegistry,new nOt);var FX;(function(s){s.Open="2_open",s.Debug="4_debug",s.SCM="5_scm",s.More="9_more"})(FX||(FX={}));function sOt(s,e){const t=s.group??FX.More,i=e.group??FX.More;return t!==i?t.localeCompare(i):(s.order??5)-(e.order??5)}class oOt extends V{constructor(){super(...arguments),this._onViewsRegistered=this._register(new I),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new I),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new I),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new I),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new P7}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const n=this.removeViews(e,i);n.length&&(this.addViews(n,t),this._onDidChangeContainer.fire({views:n,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(n=>n.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(n=>n.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),Ee(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[n,o]of t)this._viewWelcomeContents.add(e,o),i.set(n,Ee(()=>{this._viewWelcomeContents.delete(e,o),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(sOt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const n of e){if(this.getView(n.id)!==null)throw new Error(g(5293,"A view with id '{0}' is already registered",n.id));i.push(n)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const n=[],o=[];for(const r of i)e.includes(r)?n.push(r):o.push(r);return n.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),n}}Qe.add(eI.ViewsRegistry,new oOt);var hwe;(function(s){s[s.Default=0]="Default",s[s.Expand=1]="Expand"})(hwe||(hwe={}));var TUe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(TUe||(TUe={}));class Xhe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,gp(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const n=await t(i);n&&(this.tooltip=this.tooltip??n.tooltip,this.command=this.command??n.command)}i.isCancellationRequested||(this.resolved=!0)}}get hasResolve(){return this._hasResolve}resetResolve(){this.resolved=!1}asTreeItem(){return{handle:this.handle,parentHandle:this.parentHandle,collapsibleState:this.collapsibleState,label:this.label,description:this.description,icon:this.icon,iconDark:this.iconDark,themeIcon:this.themeIcon,resourceUri:this.resourceUri,tooltip:this.tooltip,contextValue:this.contextValue,command:this.command,children:this.children,accessibilityInformation:this.accessibilityInformation}}}class tw extends Error{constructor(e){super(g(5294,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}async function rOt(s,e){const t=await s.openPaneComposite(GU,ir.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Re(class extends tt{constructor(){super({id:"editor.action.formatDocument.none",label:g(4548,"Format Document"),alias:"Format Document",precondition:he.and(J.writable,J.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(vi),n=e.get(Tm),o=e.get(bi),r=e.get(to),a=e.get(it),c=t.getModel(),l=a.documentFormattingEditProvider.all(c).length;if(l>1)return i.executeCommand("editor.action.formatDocument.multiple");if(l===1)return i.executeCommand("editor.action.formatDocument");if(c.isTooLargeForSyncing())o.warn(g(4549,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(4550,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(4551,"&&Install Formatter...")});u&&rOt(n,`category:formatters ${d}`)}}});var wg,iy;let N1=(iy=class extends V{constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(TA.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),wg.extensionIds.length=0,wg.extensionItemLabels.length=0,wg.extensionDescriptions.length=0,wg.extensionIds.push(null),wg.extensionItemLabels.push(g(743,"All")),wg.extensionDescriptions.push(g(744,"All active folding range providers"));const e=[],t=[];for(const n of this._extensionService.extensions)(n.main||n.browser)&&(n.categories?.find(o=>o==="Programming Languages")?e.push(n):t.push(n));const i=(n,o)=>n.name.localeCompare(o.name);for(const n of e.sort(i))wg.extensionIds.push(n.identifier.value),wg.extensionItemLabels.push(n.displayName??""),wg.extensionDescriptions.push(n.description??"");for(const n of t.sort(i))wg.extensionIds.push(n.identifier.value),wg.extensionItemLabels.push(n.displayName??""),wg.extensionDescriptions.push(n.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(wg.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(n=>n.id===i)}},wg=iy,iy.configName="editor.defaultFoldingRangeProvider",iy.extensionIds=[],iy.extensionItemLabels=[],iy.extensionDescriptions=[],iy);N1=wg=D([_(0,fs),_(1,Te)],N1);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[N1.configName]:{description:g(745,"Defines a default folding range provider that takes precedence over all other folding range providers. Must be the identifier of an extension contributing a folding range provider."),type:["string","null"],default:null,enum:N1.extensionIds,enumItemLabels:N1.extensionItemLabels,markdownEnumDescriptions:N1.extensionDescriptions}}});Qe.as(cf.Workbench).registerWorkbenchContribution(N1,Rs.Restored);var aOt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";ut(aOt,{});let i9=class extends V{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}set link(e){typeof e.label=="string"?this.el.textContent=e.label:(Ms(this.el),this.el.appendChild(e.label)),this.el.href=e.href,typeof e.tabIndex<"u"&&(this.el.tabIndex=e.tabIndex),this.setTooltip(e.title),this._link=e}constructor(e,t,i={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=re(e,fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Pr("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new ii(this.el,"click")),a=this._register(new ii(this.el,"keypress")),c=M.chain(a.event,h=>h.map(u=>new En(u)).filter(u=>u.keyCode===S.Enter)),l=this._register(new ii(this.el,uo.Tap)).event;this._register(fd.addTarget(this.el));const d=M.any(r.event,c,l);this._register(d(h=>{this.enabled&&(en.stop(h,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};i9=D([_(3,ec),_(4,Ao)],i9);var lQ,QD;let zM=(QD=class{static get(e){return e.getContribution(lQ.ID)??void 0}constructor(e,t,i,n){this._editor=e,this._accessibilitySignalService=i,this._instaService=n,this._sessionDispoosables=new Z,this._ariaElement=document.createElement("span"),this._ariaElement.style.position="fixed",this._ariaElement.className="inlayhint-accessibility-element",this._ariaElement.tabIndex=0,this._ariaElement.setAttribute("aria-description",g(747,"Code with Inlay Hint Information")),this._ctxIsReading=lQ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Ms(this._ariaElement),this._sessionDispoosables.clear(),this._ctxIsReading.reset()}async _read(e,t){if(this._sessionDispoosables.clear(),this._ariaElement.isConnected||this._editor.getDomNode()?.appendChild(this._ariaElement),!this._editor.hasModel()||!this._ariaElement.isConnected){this._ctxIsReading.set(!1);return}const i=new ci;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const n=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=n.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(o.push(l),r=c.hint.position.column-1),r>750){o.push("…"),a=!0;break}const d=document.createElement("em"),{label:h}=c.hint;if(typeof h=="string")d.innerText=h;else for(const u of h)if(u.command){const f=this._instaService.createInstance(i9,d,{href:zZe(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;o.push(d)}a||o.push(n.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),aa(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(ue(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=SW.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(cl.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},lQ=QD,QD.IsReading=new Q("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(746,"Whether the current line and its inlay hints are currently focused")}),QD.ID="editor.contrib.InlayHintsAccessibility",QD);zM=lQ=D([_(1,Le),_(2,lv),_(3,we)],zM);At(class extends gf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Pe(748,"Read Line With Inline Hints"),precondition:J.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){zM.get(t)?.startInlayHintsReading()}});At(class extends gf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Pe(749,"Stop Inlay Hints Reading"),precondition:zM.IsReading,f1:!0,keybinding:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(e,t){zM.get(t)?.stopInlayHintsReading()}});on(zM.ID,zM,ri.Lazy);var Lv;(function(s){s.languages="languages",s.actions="actions",s.kind="kind",s.title="title",s.description="description"})(Lv||(Lv={}));const cOt=Object.freeze({type:"array",markdownDescription:g(4552,"Configure which editor to use for a resource."),items:{type:"object",required:[Lv.languages,Lv.actions],properties:{[Lv.languages]:{type:"array",description:g(4553,"Language modes that the code actions are enabled for."),items:{type:"string"}},[Lv.actions]:{type:"object",required:[Lv.kind,Lv.title],properties:{[Lv.kind]:{type:"string",markdownDescription:g(4554,"`CodeActionKind` of the contributed code action.")},[Lv.title]:{type:"string",description:g(4555,"Label for the code action used in the UI.")},[Lv.description]:{type:"string",description:g(4556,"Description of what the code action does.")}}}}}}),lOt={extensionPoint:"codeActions",deps:[wW],jsonSchema:cOt};class dOt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.codeActions}render(e){const t=e.contributes?.codeActions||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=t.map(r=>r.actions.map(a=>({...a,languages:r.languages}))).flat(),n=[g(4557,"Title"),g(4558,"Kind"),g(4559,"Description"),g(4560,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Mt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Mt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:n,rows:o},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(4561,"Code Actions"),access:{canToggle:!1},renderer:new wi(dOt)});var PE;(function(s){s.when="when",s.title="title",s.command="command"})(PE||(PE={}));const hOt=Object.freeze({type:"object",description:g(4562,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(4563,"Contributed documentation for refactorings."),items:{type:"object",description:g(4564,"Contributed documentation for refactoring."),required:[PE.title,PE.when,PE.command],properties:{[PE.title]:{type:"string",description:g(4565,"Label for the documentation used in the UI.")},[PE.when]:{type:"string",description:g(4566,"When clause.")},[PE.command]:{type:"string",description:g(4567,"Command executed.")}}}}}}),uOt={extensionPoint:"documentation",deps:[wW],jsonSchema:hOt},LUe=s=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(4568,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(4569,"Triggers Code Actions only when explicitly saved"),g(4570,"Never triggers Code Actions on save"),g(4571,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4572,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),RUe=s=>({type:["string","boolean"],enum:["explicit","never",!0,!1],enumDescriptions:[g(4573,"Triggers Code Actions only when explicitly saved."),g(4574,"Never triggers Code Actions on save."),g(4575,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4576,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),dQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4577,'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'),type:["object","array"],additionalProperties:{type:"string",enum:["always","explicit","never",!0,!1]},default:{},scope:at.LANGUAGE_OVERRIDABLE},uwe=Object.freeze({...Vb,properties:{"editor.codeActionsOnSave":dQ}}),hQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4578,'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'),type:"object",additionalProperties:{type:["string","boolean"],enum:["explicit","never",!0,!1]},default:{}},gOt=Object.freeze({...Vb,properties:{"notebook.codeActionsOnSave":hQ}});let gwe=class extends V{constructor(e,t,i){super(),this.languageFeatures=i,this._contributedCodeActions=[],this.settings=new Set,this._onDidChangeContributions=this._register(new I),i.codeActionProvider.onDidChange(()=>{this.updateSettingsFromCodeActionProviders(),this.updateConfigurationSchemaFromContribs()},2e3),e.setHandler(n=>{this._contributedCodeActions=n.flatMap(o=>o.value).filter(o=>Array.isArray(o.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateSettingsFromCodeActionProviders(){this.languageFeatures.codeActionProvider.allNoModel().forEach(t=>{t.providedCodeActionKinds&&t.providedCodeActionKinds.forEach(i=>{!this.settings.has(i)&&ys.Source.contains(new Yn(i))&&this.settings.add(i)})})}updateConfigurationSchema(e){const t={},i={};for(const[n,o]of this.getSourceActions(e))this.settings.add(n),t[n]=LUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title)),i[n]=RUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title));dQ.properties=t,hQ.properties=i,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(uwe)}updateConfigurationSchemaFromContribs(){const e={...dQ.properties},t={...hQ.properties};for(const i of this.settings)e[i]||(e[i]=LUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)),t[i]=RUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)));dQ.properties=e,hQ.properties=t,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(uwe)}getSourceActions(e){const t=new Map;for(const i of e)for(const n of i.actions){const o=new Yn(n.kind);ys.Source.contains(o)&&t.set(o.value,n)}return t}getSchemaAdditions(){const e=(i,n)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:n.map(o=>o.kind),enumDescriptions:n.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const n=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of n)!o.has(r.kind)&&i.contains(new Yn(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(DMe,t(Yn.Empty)),e(IMe,t(ys.Refactor)),e(TMe,t(ys.Source))]}};gwe=D([_(1,Ut),_(2,it)],gwe);let fwe=class extends V{constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(n=>{this.contributions=[];for(const o of n)if(o.value.refactoring)for(const r of o.value.refactoring){const a=he.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,n){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ys.Refactor.value&&!t.some(i=>i.kind&&ys.Refactor.contains(new Yn(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};fwe=D([_(1,Le),_(2,it)],fwe);const fOt=eh.registerExtensionPoint(lOt),pOt=eh.registerExtensionPoint(uOt);Qe.as(Nn.Configuration).registerConfiguration(uwe);Qe.as(Nn.Configuration).registerConfiguration(gOt);let pwe=class{constructor(e){e.createInstance(gwe,fOt),e.createInstance(fwe,pOt)}};pwe=D([_(0,we)],pwe);Qe.as(cf.Workbench).registerWorkbenchContribution(pwe,Rs.Eventually);var RB;let OX=(RB=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},RB.ID="workbench.contrib.listContext",RB);OX=D([_(0,Le)],OX);Qu(OX.ID,OX,yc.BlockStartup);var MB;let BX=(MB=class extends V{constructor(e,t){super(),this._instantiationService=t,this._instantiated=!1,this._register(e.onWillCreateCodeEditor(()=>this._instantiate())),this._register(e.onWillCreateDiffEditor(()=>this._instantiate())),(e.listCodeEditors().length>0||e.listDiffEditors().length>0)&&this._instantiate()}_instantiate(){if(this._instantiated)return;this._instantiated=!0;const e=qPt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){vt(i)}}},MB.ID="workbench.contrib.editorFeaturesInstantiator",MB);BX=D([_(0,Kt),_(1,we)],BX);Qu(BX.ID,BX,yc.BlockRestore);let mwe=class extends V{constructor(e,t){super();const i=n=>e.activeContainer.classList.toggle("context-menu-visible",n);this._register(t.onDidShowContextMenu(()=>i(!0))),this._register(t.onDidHideContextMenu(()=>i(!1)))}};mwe=D([_(0,pu),_(1,lr)],mwe);Qe.as(cf.Workbench).registerWorkbenchContribution(mwe,Rs.Eventually);_t.registerCommand("_executeMappedEditsProvider",async(s,e,t,i)=>{const n=s.get(fn),o=s.get(it),r=await n.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ci;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const kI=pu;var NB;let WX=(NB=class extends V{constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new ya(()=>this.createActions()),this.registerListeners()}createActions(){return[new rn("undo",g(750,"Undo"),void 0,!0,async()=>Hu().execCommand("undo")),new rn("redo",g(751,"Redo"),void 0,!0,async()=>Hu().execCommand("redo")),new Ar,new rn("editor.action.clipboardCutAction",g(752,"Cut"),void 0,!0,async()=>Hu().execCommand("cut")),new rn("editor.action.clipboardCopyAction",g(753,"Copy"),void 0,!0,async()=>Hu().execCommand("copy")),new rn("editor.action.clipboardPasteAction",g(754,"Paste"),void 0,!0,async e=>{if(ad)Hu().execCommand("paste");else{const t=await this.clipboardService.readText();if(Mdt(e)||Ndt(e)){const i=e.selectionStart||0,n=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(n,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Ar,new rn("editor.action.selectAll",g(755,"Select All"),void 0,!0,async()=>Hu().execCommand("selectAll"))]}registerListeners(){this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(ue(e,"contextmenu",i=>this.onContextMenu(ct(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Yr(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;en.stop(t,!0);const n=new Eh(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>n,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},NB.ID="workbench.contrib.textInputActionsProvider",NB);WX=D([_(0,kI),_(1,lr),_(2,dg)],WX);Qu(WX.ID,WX,yc.BlockRestore);var mOt='.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-workbench .screencast-mouse{border-radius:50%;border-style:solid;border-width:2px;content:" ";display:none;pointer-events:none;position:absolute;z-index:100000}.monaco-workbench .screencast-keyboard{background-color:rgba(0,0,0,.5);color:#eee;left:0;line-height:1.75em;overflow:hidden;pointer-events:none;position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:100000}.monaco-workbench:not(.reduce-motion) .screencast-keyboard{transition:opacity .3s ease-out}.monaco-workbench .screencast-keyboard:empty{opacity:0}.monaco-workbench .screencast-keyboard>.key{background-color:hsla(0,0%,100%,.05);border:1px solid hsla(0,0%,80%,.4);border-radius:5px;box-shadow:inset 0 -3px 0 hsla(0,0%,73%,.4);margin-right:6px;padding:0 8px}.monaco-workbench .screencast-keyboard>.title{font-weight:600}';ut(mOt,{});const _Ot="rendererLog",uet="workbench.action.showWindowLog";let Ef;const Zhe=globalThis.vscode;if(typeof Zhe<"u"&&typeof Zhe.context<"u"){const s=Zhe.context.configuration();if(s)Ef=s.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Ef=globalThis._VSCODE_PRODUCT_JSON,D2.VSCODE_DEV&&Object.assign(Ef,{nameShort:`${Ef.nameShort} Dev`,nameLong:`${Ef.nameLong} Dev`,dataFolderName:`${Ef.dataFolderName}-dev`,serverDataFolderName:Ef.serverDataFolderName?`${Ef.serverDataFolderName}-dev`:void 0}),!Ef.version){const s=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ef,{version:s.version})}}else Ef={},Object.keys(Ef).length===0&&Object.assign(Ef,{version:"1.91.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var vOt=Ef;class bOt extends li{constructor(){super({id:"workbench.action.inspectContextKeys",title:Pe(756,"Inspect Context Keys"),category:ca.Developer,f1:!0})}run(e){const t=e.get(Le),i=new Z,n=gl(void 0,void 0,i);Uf("*","cursor: crosshair !important;",n);const o=document.createElement("div"),r=Hu();r.body.appendChild(o),i.add(Ee(()=>o.remove())),o.style.position="absolute",o.style.pointerEvents="none",o.style.backgroundColor="rgba(255, 0, 0, 0.5)",o.style.zIndex="1000";const a=i.add(new ii(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=Cr(h);o.style.top=`${u.top}px`,o.style.left=`${u.left}px`,o.style.width=`${u.width}px`,o.style.height=`${u.height}px`}));const c=i.add(new ii(r,"mousedown",!0));M.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new ii(r,"mouseup",!0));M.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),bt(i)},null,i)}}class bF extends li{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Pe(757,"Toggle Screencast Mode"),category:ca.Developer,f1:!0})}run(e){if(bF.disposable){bF.disposable.dispose(),bF.disposable=void 0;return}const t=e.get(pu),i=e.get(Te),n=e.get(Ut),o=new Z,r=t.activeContainer,a=re(r,fe(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=re(r,fe(".screencast-keyboard"));o.add(Ee(()=>c.remove()));const l=o.add(new I),d=o.add(new I),h=o.add(new I);function u(j,ne){ne.add(ne.add(new ii(j,"mousedown",!0)).event(ge=>l.fire(ge))),ne.add(ne.add(new ii(j,"mouseup",!0)).event(ge=>d.fire(ge))),ne.add(ne.add(new ii(j,"mousemove",!0)).event(ge=>h.fire(ge)))}for(const{window:j,disposables:ne}of D8())u(t.getContainer(j),ne);o.add(tm(({window:j,disposables:ne})=>u(t.getContainer(j),ne))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=me.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=Ka(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),o.add(l.event(j=>{a.style.top=`${j.clientY-p/2}px`,a.style.left=`${j.clientX-p/2}px`,a.style.display="block",a.style.transform="scale(1)",a.style.transition="transform 0.1s";const ne=h.event(ge=>{a.style.top=`${ge.clientY-p/2}px`,a.style.left=`${ge.clientX-p/2}px`,a.style.transform=`scale(${.8})`});M.once(d.event)(()=>{a.style.display="none",ne.dispose()})}));const v=()=>{c.style.fontSize=`${Ka(i.getValue("screencastMode.fontSize")||56,20,100)}px`},b=()=>{c.style.bottom=`${Ka(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let w;const y=()=>{w=Ka(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),b(),y(),o.add(i.onDidChangeConfiguration(j=>{j.affectsConfiguration("screencastMode.verticalOffset")&&b(),j.affectsConfiguration("screencastMode.fontSize")&&v(),j.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&y(),j.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),j.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const C=o.add(new I),A=o.add(new I),L=o.add(new I),k=o.add(new I);function P(j,ne){ne.add(ne.add(new ii(j,"keydown",!0)).event(ge=>C.fire(ge))),ne.add(ne.add(new ii(j,"compositionstart",!0)).event(ge=>A.fire(ge))),ne.add(ne.add(new ii(j,"compositionupdate",!0)).event(ge=>L.fire(ge))),ne.add(ne.add(new ii(j,"compositionend",!0)).event(ge=>k.fire(ge)))}for(const{window:j,disposables:ne}of D8())P(j,ne);o.add(tm(({window:j,disposables:ne})=>P(j,ne)));let R=0,z,G=!1;const Y=new cn(()=>{c.textContent="",z=void 0,R=0},w);o.add(A.event(j=>{G=!0})),o.add(L.event(j=>{j.data&&G?(R>20&&(c.innerText="",R=0),z=z??re(c,fe("span.key")),z.textContent=j.data):G&&(c.innerText="",re(c,fe("span.key",{},"Backspace"))),Y.schedule()})),o.add(k.event(j=>{z=void 0,R++})),o.add(C.event(j=>{if(j.key==="Process"||/[\uac00-\ud787\u3131-\u314e\u314f-\u3163\u3041-\u3094\u30a1-\u30f4\u30fc\u3005\u3006\u3024\u4e00-\u9fa5]/u.test(j.key)){j.code==="Backspace"||j.code.includes("Key")?G=!0:(z=void 0,G=!1),Y.schedule();return}if(j.isComposing)return;const ne=i.getValue("screencastMode.keyboardOptions"),ge=new En(j),De=n.softDispatch(ge,ge.target);if(De.kind===nf.KbFound&&De.commandId&&!(ne.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(De.commandId))return;(ge.ctrlKey||ge.altKey||ge.metaKey||ge.shiftKey||R>20||ge.keyCode===S.Backspace||ge.keyCode===S.Escape||ge.keyCode===S.UpArrow||ge.keyCode===S.DownArrow||ge.keyCode===S.LeftArrow||ge.keyCode===S.RightArrow)&&(c.innerText="",R=0);const Oe=n.resolveKeyboardEvent(ge),yt=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Ne=yt?.title,lt=Oe.getLabel();if(yt&&((ne.showCommandGroups??!1)&&yt.category&&(Ne=`${yt.category}: ${Ne} `),this._isKbFound(De)&&De.commandId)){const xt=n.lookupKeybindings(De.commandId).filter(Ji=>Ji.getLabel()?.endsWith(lt??""));xt.length>0&&(lt=xt[xt.length-1].getLabel())}(ne.showCommands??!0)&&Ne&&re(c,fe("span.title",{},`${Ne} `)),((ne.showKeys??!0)||(ne.showKeybindings??!0)&&this._isKbFound(De))&&(lt=lt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),re(c,fe("span.key",{},lt??""))),R++,Y.schedule()})),bF.disposable=o}_isKbFound(e){return e.kind===nf.KbFound}getCommandDetails(e){const t=jn.getCommand(e);if(t)return{title:typeof t.title=="string"?t.title:t.title.value,category:t.category?typeof t.category=="string"?t.category:t.category.value:void 0};const i=_t.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class wOt extends li{constructor(){super({id:"workbench.action.logStorage",title:Pe(758,"Log Storage Database Contents"),category:ca.Developer,f1:!0})}run(e){const t=e.get($i),i=e.get(to);t.log(),i.info(g(759,"The storage database contents have been logged to the developer tools."),g(760,"Open developer tools from the menu and select the Console tab."))}}class yOt extends li{constructor(){super({id:"workbench.action.logWorkingCopies",title:Pe(761,"Log Working Copies"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(Rm),i=e.get(H6),n=e.get(Ge),o=e.get(Jae),r=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...r.length>0?r.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];n.info(a.join(` +`)),o.showChannel(_Ot,!0)}}const Hse=class Hse extends li{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Pe(762,"Remove Large Storage Database Entries..."),category:ca.Developer,f1:!0})}async run(e){const t=e.get($i),i=e.get(In),n=e.get(ug),o=e.get(to),r=e.get(Za),a=[];for(const h of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE])if(!(h===Ie.PROFILE&&n.currentProfile.isDefault))for(const u of[an.MACHINE,an.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>Hse.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:Nc.formatSize(p.length),detail:g(763,"Scope: {0}, Target: {1}",h===Ie.APPLICATION?g(764,"Global"):h===Ie.PROFILE?g(765,"Profile"):g(766,"Workspace"),u===an.MACHINE?g(767,"Machine"):g(768,"User"))})}a.sort((h,u)=>u.size-h.size);const c=await new Promise(h=>{const u=new Z,f=u.add(i.createQuickPick());f.items=a,f.canSelectMany=!0,f.ok=!1,f.customButton=!0,f.hideCheckAll=!0,f.customLabel=g(769,"Remove"),f.placeholder=g(770,"Select large entries to remove from storage"),a.length===0&&(f.description=g(771,"There are no large storage entries to remove.")),f.show(),u.add(f.onDidCustom(()=>{h(f.selectedItems),f.hide()})),u.add(f.onDidHide(()=>u.dispose()))});if(c.length===0)return;const{confirmed:l}=await o.confirm({type:"warning",message:g(772,"Do you want to remove the selected storage entries from the database?"),detail:g(773,`{0} This action is irreversible and may result in data loss!`,c.map(h=>h.label).join(` -`)),primaryButton:g(br,18,"&&Remove")});if(!l)return;const d=new Set;for(const h of c)t.remove(h.key,h.scope),d.add(h.scope);for(const h of d)await t.optimize(h)}};ice.SIZE_THRESHOLD=1024*16;let MSe=ice,ER,gie=new Set;const CM=new Y("dirtyWorkingCopies","stopped");class BBt extends pi{constructor(){super({id:"workbench.action.startTrackDisposables",title:Be(br,19,"Start Tracking Disposables"),category:Za.Developer,f1:!0,precondition:ge.and(CM.isEqualTo("pending").negate(),CM.isEqualTo("started").negate())})}run(e){CM.bindTo(e.get(Pe)).set("started"),gie.clear(),ER=new __e,hQe(ER)}}class WBt extends pi{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Be(br,20,"Snapshot Tracked Disposables"),category:Za.Developer,f1:!0,precondition:CM.isEqualTo("started")})}run(e){CM.bindTo(e.get(Pe)).set("pending"),gie=new Set(ER?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class HBt extends pi{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Be(br,21,"Stop Tracking Disposables"),category:Za.Developer,f1:!0,precondition:CM.isEqualTo("pending")})}run(e){const t=e.get(_i);if(CM.bindTo(e.get(Pe)).set("stopped"),ER){const s=new Set;for(const r of new Set(ER.computeLeakingDisposables(1e3)?.leaks)??[])gie.has(r.value)&&s.add(r);const o=ER.computeLeakingDisposables(1e3,Array.from(s));o&&t.openEditor({resource:void 0,contents:o.details})}hQe(null),ER=void 0,gie.clear()}}At(PBt);At(g2);At(FBt);At(OBt);At(MSe);NBt.commit||(At(BBt),At(WBt),At(HBt));const UBt=it.as(Cs.Configuration);UBt.registerConfiguration({id:"screencastMode",order:9,title:g(br,22,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(br,23,"Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")},"screencastMode.fontSize":{type:"number",default:56,minimum:20,maximum:100,description:g(br,24,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(br,25,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(br,26,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(br,27,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(br,28,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(br,29,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(br,30,"Show single editor cursor move commands.")}},default:{showKeys:!0,showKeybindings:!0,showCommands:!0,showCommandGroups:!1,showSingleEditorCursorMoves:!0},additionalProperties:!1},"screencastMode.keyboardOverlayTimeout":{type:"number",default:800,minimum:500,maximum:5e3,description:g(br,31,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(br,32,"Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")},"screencastMode.mouseIndicatorSize":{type:"number",default:20,minimum:20,maximum:100,description:g(br,33,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});const i6="vs/editor/browser/widget/diffEditor/diffEditor.contribution";At(hNt);At(Uet);At(Vet);Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Vet().desc.id,title:g(i6,0,"Use Inline View When Space Is Limited"),toggled:ge.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ge.has("isInDiffEditor")},order:11,group:"1_diff",when:ge.and(X.diffEditorRenderSideBySideInlineBreakpointReached,ge.has("isInDiffEditor"))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Uet().desc.id,title:g(i6,1,"Show Moved Code Blocks"),icon:Ce.move,toggled:oO.create("config.diffEditor.experimental.showMoves",!0),precondition:ge.has("isInDiffEditor")},order:10,group:"1_diff",when:ge.has("isInDiffEditor")});At(cye);for(const n of[{icon:Ce.arrowRight,key:X.diffEditorInlineMode.toNegated()},{icon:Ce.discard,key:X.diffEditorInlineMode}])Xs.appendMenuItem(Te.DiffEditorHunkToolbar,{command:{id:new cye().desc.id,title:g(i6,2,"Revert Block"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Xs.appendMenuItem(Te.DiffEditorSelectionToolbar,{command:{id:new cye().desc.id,title:g(i6,3,"Revert Selection"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"});At(uNt);At(gNt);At(fNt);At(pNt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:_V.id,title:g(i6,4,"Open Accessible Diff Viewer"),precondition:ge.has("isInDiffEditor")},order:10,group:"2_diff",when:ge.and(X.accessibleDiffViewerVisible.negate(),ge.has("isInDiffEditor"))});yt.registerCommandAlias("editor.action.diffReview.next",_V.id);At(_V);yt.registerCommandAlias("editor.action.diffReview.prev",G7.id);At(G7);var VBt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";Ct(VBt,{});var NSe;const kV="vs/editor/contrib/anchorSelect/browser/anchorSelect",She=new Y("selectionAnchorSet",!1);var PN;let N1=(PN=class{static get(e){return e.getContribution(NSe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=She.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(mt.fromPositions(e,e),{description:"selection-anchor",stickiness:gi.NeverGrowsWhenTypingAtEdges,hoverMessage:new Xt().appendText(g(kV,0,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),sa(g(kV,1,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(mt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},NSe=PN,PN.ID="editor.contrib.selectionAnchorController",PN);N1=NSe=D([_(1,Pe)],N1);class zBt extends lt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(kV,2,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyB),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.setSelectionAnchor()}}class $Bt extends lt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(kV,3,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:She})}async run(e,t){N1.get(t)?.goToSelectionAnchor()}}class GBt extends lt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(kV,4,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyK),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.selectFromAnchorToCursor()}}class qBt extends lt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(kV,5,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:E.Escape,weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.cancelSelectionAnchor()}}vn(N1.ID,N1,mi.Lazy);Fe(zBt);Fe($Bt);Fe(GBt);Fe(qBt);var QBt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";Ct(QBt,{});const IV="vs/editor/contrib/bracketMatching/browser/bracketMatching",jBt=B("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g(IV,0,"Overview ruler marker color for matching brackets."));class KBt extends lt{constructor(){super({id:"editor.action.jumpToBracket",label:g(IV,1,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Backslash,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.jumpToBracket()}}class YBt extends lt{constructor(){super({id:"editor.action.selectToBracket",label:g(IV,2,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Be(IV,3,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let s=!0;i&&i.selectBrackets===!1&&(s=!1),$x.get(t)?.selectToBracket(s)}}class JBt extends lt{constructor(){super({id:"editor.action.removeBrackets",label:g(IV,4,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.Backspace,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.removeBrackets(this.id)}}class XBt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const gk=class gk extends ${static get(e){return e.getContribution(gk.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new yn(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(x.matchBrackets),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(x.matchBrackets)&&(this._matchBrackets=this._editor.getOption(x.matchBrackets),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(r=c.range.getStartPosition())}}return r?new mt(r.lineNumber,r.column,r.lineNumber,r.column):new mt(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const l=t.bracketPairs.findNextBracket(o);l&&l.range&&(r=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(O.compareRangesUsingStarts);const[l,d]=r;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=c,c=h}}a&&c&&i.push(new mt(a.lineNumber,a.column,c.lineNumber,c.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(oe.compare);const a=[];let c=0,l=0;const d=s.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}Fe(n2t);const ag="vs/editor/contrib/clipboard/browser/clipboard",DF="9_cutcopypaste",s2t=rf||document.queryCommandSupported("cut"),Dit=rf||document.queryCommandSupported("copy"),o2t=typeof navigator.clipboard>"u"||pp?document.queryCommandSupported("paste"):!0;function wFe(n){return n.register(),n}const r2t=s2t?wFe(new Z1({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyX,win:{primary:V.CtrlCmd|E.KeyX,secondary:[V.Shift|E.Delete]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,0,"Cu&&t"),order:1},{menuId:Te.EditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1},{menuId:Te.CommandPalette,group:"",title:g(ag,1,"Cut"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1}]})):void 0,a2t=Dit?wFe(new Z1({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyC,win:{primary:V.CtrlCmd|E.KeyC,secondary:[V.CtrlCmd|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,2,"&&Copy"),order:2},{menuId:Te.EditorContext,group:DF,title:g(ag,3,"Copy"),order:2},{menuId:Te.CommandPalette,group:"",title:g(ag,3,"Copy"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,3,"Copy"),order:2}]})):void 0;Xs.appendMenuItem(Te.MenubarEditMenu,{submenu:Te.MenubarCopy,title:Be(ag,4,"Copy As"),group:"2_ccp",order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextCopy,title:Be(ag,4,"Copy As"),group:DF,order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1,when:ge.and(ge.notEquals("resourceScheme","output"),X.editorTextFocus)});Xs.appendMenuItem(Te.ExplorerContext,{submenu:Te.ExplorerContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1});const _pe=o2t?wFe(new Z1({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyV,win:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},linux:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,6,"&&Paste"),order:4},{menuId:Te.EditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4},{menuId:Te.CommandPalette,group:"",title:g(ag,7,"Paste"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4}]})):void 0;class c2t extends lt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(ag,8,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,weight:ye.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(hwe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),hwe.forceCopyWithSyntaxHighlighting=!1)}}function kit(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(jt).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(x.emptySelectionClipboard),r=s.getSelection();return r&&r.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(Kg().execCommand(e),!0)))}kit(r2t,"cut");kit(a2t,"copy");_pe&&(_pe.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(jt),i=n.get(Mu),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?jS.get(s)?.finishedPaste()??Promise.resolve():Jn?(async()=>{const r=await i.readText();if(r!==""){const a=Z9.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=s.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard",Uc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),_pe.addImplementation(0,"generic-dom",(n,e)=>(Kg().execCommand("paste"),!0)));Dit&&Fe(c2t);const Qa="vs/editor/contrib/codeAction/browser/codeActionCommands";function YQ(n){return ge.regex(Ftt.keys()[0],new RegExp("(\\s|^)"+Iu(n.value)+"\\b"))}const bFe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(Qa,0,"Kind of the code action to run.")},apply:{type:"string",description:g(Qa,1,"Controls when the returned actions are applied."),default:th.IfSingle,enum:[th.First,th.IfSingle,th.Never],enumDescriptions:[g(Qa,2,"Always apply the first returned code action."),g(Qa,3,"Apply the first returned code action if it is the only one."),g(Qa,4,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(Qa,5,"Controls if only preferred code actions should be returned.")}}};function IO(n,e,t,i,s=_f.Default){n.hasModel()&&AF.get(n)?.manualTriggerAtCurrentPosition(e,s,t,i)}class l2t extends lt{constructor(){super({id:cFe,label:g(Qa,6,"Quick Fix..."),alias:"Quick Fix...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Period,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(Qa,7,"No code actions available"),void 0,void 0,_f.QuickFix)}}class d2t extends Jc{constructor(){super({id:aFe,precondition:ge.and(X.writable,X.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:bFe}]}})}runEditorCommand(e,t,i){const s=Ey.fromUser(i,{kind:bs.Empty,apply:th.IfSingle});return IO(t,typeof i?.kind=="string"?s.preferred?g(Qa,8,"No preferred code actions for '{0}' available",i.kind):g(Qa,9,"No code actions for '{0}' available",i.kind):s.preferred?g(Qa,10,"No preferred code actions available"):g(Qa,11,"No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class h2t extends lt{constructor(){super({id:lFe,label:g(Qa,12,"Refactor..."),alias:"Refactor...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyR,mac:{primary:V.WinCtrl|V.Shift|E.KeyR},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:ge.and(X.writable,YQ(ls.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:bFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Refactor,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(Qa,13,"No preferred refactorings for '{0}' available",i.kind):g(Qa,14,"No refactorings for '{0}' available",i.kind):s.preferred?g(Qa,15,"No preferred refactorings available"):g(Qa,16,"No refactorings available"),{include:ls.Refactor.contains(s.kind)?s.kind:bs.None,onlyIncludePreferredActions:s.preferred},s.apply,_f.Refactor)}}class u2t extends lt{constructor(){super({id:dFe,label:g(Qa,17,"Source Action..."),alias:"Source Action...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ge.and(X.writable,YQ(ls.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:bFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Source,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(Qa,18,"No preferred source actions for '{0}' available",i.kind):g(Qa,19,"No source actions for '{0}' available",i.kind):s.preferred?g(Qa,20,"No preferred source actions available"):g(Qa,21,"No source actions available"),{include:ls.Source.contains(s.kind)?s.kind:bs.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,_f.SourceAction)}}class g2t extends lt{constructor(){super({id:$ye,label:g(Qa,22,"Organize Imports"),alias:"Organize Imports",precondition:ge.and(X.writable,YQ(ls.SourceOrganizeImports)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|V.Alt|E.KeyO,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(Qa,23,"No organize imports action available"),{include:ls.SourceOrganizeImports,includeSourceActions:!0},th.IfSingle,_f.OrganizeImports)}}class f2t extends lt{constructor(){super({id:Gye,label:g(Qa,24,"Fix All"),alias:"Fix All",precondition:ge.and(X.writable,YQ(ls.SourceFixAll))})}run(e,t){return IO(t,g(Qa,25,"No fix all action available"),{include:ls.SourceFixAll,includeSourceActions:!0},th.IfSingle,_f.FixAll)}}class p2t extends lt{constructor(){super({id:Ltt,label:g(Qa,26,"Auto Fix..."),alias:"Auto Fix...",precondition:ge.and(X.writable,YQ(ls.QuickFix)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Alt|V.Shift|E.Period,mac:{primary:V.CtrlCmd|V.Alt|E.Period},weight:ye.EditorContrib}})}run(e,t){return IO(t,g(Qa,27,"No auto fixes available"),{include:ls.QuickFix,onlyIncludePreferredActions:!0},th.IfSingle,_f.AutoFix)}}const Iit="vs/editor/contrib/codeAction/browser/codeActionContributions";vn(AF.ID,AF,mi.Eventually);vn(J7.ID,J7,mi.Lazy);Fe(l2t);Fe(h2t);Fe(u2t);Fe(g2t);Fe(p2t);Fe(f2t);Ke(new d2t);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,1,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class PSe{constructor(){this.lenses=[],this._disposables=new Z}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function Lit(n,e,t){const i=n.ordered(e),s=new Map,o=new PSe,r=i.map(async(a,c)=>{s.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){er(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:s.get(a.provider)s.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}yt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Bt(P.isUri(t)),Bt(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)throw Ui();const r=[],a=new Z;return Lit(s,o,qe.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,qe.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const Tit=ae("ICodeLensCache");class Z4e{constructor(e,t){this.lineCount=e,this.data=t}}let FSe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new L_(20,.75);const t="codelens/cache";UB(yi,()=>e.remove(t,ke.WORKSPACE));const i="codelens/cache2",s=e.get(i,ke.WORKSPACE,"{}");this._deserialize(s),T.once(e.onWillSaveState)(o=>{o.reason===nS.SHUTDOWN&&e.store(i,this._serialize(),ke.WORKSPACE,ln.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),s=new PSe;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Z4e(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new O(a,1,a,11)});const r=new PSe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Z4e(s.lineCount,r))}}catch{}}};FSe=D([_(0,on)],FSe);ce(Tit,FSe,Yt.Delayed);var m2t=".monaco-editor .codelens-decoration{font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);color:var(--vscode-editorCodeLens-foreground);display:inline-block;font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);overflow:hidden;padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);text-overflow:ellipsis;white-space:nowrap}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{user-select:none;-webkit-user-select:none;vertical-align:sub;white-space:nowrap}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer}.monaco-editor .codelens-decoration>a:hover,.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);vertical-align:middle}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}";Ct(m2t,{});class _2t{constructor(e,t,i){this.afterColumn=Zn.MAX_SAFE_SMALL_INTEGER,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const n9=class n9{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${n9._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:eze},h=>this._decorationIds[d]=h),a?a=O.plusRange(a,l.symbol.range):a=O.lift(l.symbol.range)}),this._viewZone=new _2t(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new OSe(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&O.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:eze},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;tthis._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(x.fontInfo)||a.hasChanged(x.codeLensFontSize)||a.hasChanged(x.codeLensFontFamily))&&this._updateLensStyle(),a.hasChanged(x.codeLens)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(x.lineHeight)/this._editor.getOption(x.fontSize));let t=this._editor.getOption(x.codeLensFontSize);return(!t||t<5)&&(t=this._editor.getOption(x.fontSize)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(x.codeLensFontFamily),s=this._editor.getOption(x.fontInfo),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Gh.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(x.codeLens)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&PS(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new yn(()=>{const s=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=na(o=>Lit(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const r=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},bt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{const r=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?r.push(l):(l.update(o),a=l.getLineNumber())});const c=new vpe;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const s=M_.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==Mt.CONTENT_WIDGET)return;let o=s.target.element;if(o?.tagName==="SPAN"&&(o=o.parentElement),o?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new vpe;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(s&&s[s.length-1].symbol.range.startLineNumber===c?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=M_.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new vpe;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0)return;const s=Date.now(),o=na(r=>{const a=t.map((c,l)=>{const d=new Array(c.length),h=c.map((u,f)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(p=>{d[f]=p},er):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{bt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},MH.ID="css.editor.codeLens",MH);n6=D([_(1,ht),_(2,B_),_(3,ji),_(4,Pi),_(5,Tit)],n6);vn(n6.ID,n6,mi.AfterFirstRender);Fe(class extends lt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:X.hasCodeLensProvider,label:g(ize,0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(On),s=e.get(ji),o=e.get(Pi),r=t.getSelection().positionLineNumber,a=t.getContribution(n6.ID);if(!a)return;const c=await a.getModel();if(!c)return;const l=[];for(const u of c.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(l.length===0)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:g(ize,1,"Select a command")});if(!d)return;let h=d.command;if(c.isDisposed){const f=(await a.getModel())?.lenses.find(p=>p.symbol.range.startLineNumber===r&&p.symbol.command?.title===h.title);if(!f||!f.symbol.command)return;h=f.symbol.command}try{await s.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});class CFe{constructor(e,t){this._editorWorkerClient=new yMe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new fe(new gn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?fe.Format.CSS.formatRGB(a):fe.Format.CSS.formatRGBA(a),l=r?fe.Format.CSS.formatHSL(a):fe.Format.CSS.formatHSLA(a),d=r?fe.Format.CSS.formatHex(a):fe.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:l,textEdit:{range:s,text:l}}),h.push({label:d,textEdit:{range:s,text:d}}),h}}let BSe=class extends ${constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new CFe(e,t)))}};BSe=D([_(0,Ai),_(1,lo),_(2,ht)],BSe);KQ(BSe);async function Rit(n,e,t,i=!0){return yFe(new v2t,n,e,t,i)}function Mit(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class v2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)}}class w2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class b2t{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const o=await e.provideColorPresentations(t,this.colorInfo,qe.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)}}async function yFe(n,e,t,i,s){let o=!1,r;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof CFe)r=d;else try{await n.compute(d,t,i,a)&&(o=!0)}catch(h){er(h)}}return o?a:r&&s?(await n.compute(r,t,i,a),a):[]}function Nit(n,e){const{colorProvider:t}=n.get(ht),i=n.get(Ai).getModel(e);if(!i)throw Ui();const s=n.get(Re).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}yt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof P))throw Ui();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=Nit(n,t);return yFe(new w2t,s,i,qe.None,o)});yt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof P)||!Array.isArray(t)||t.length!==4||!O.isIRange(o))throw Ui();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=Nit(n,s),[l,d,h,u]=t;return yFe(new b2t({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,qe.None,c)});var WSe;const Pit=Object.create({});var C0;let LV=(C0=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Z),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new PZ(this._editor),this._decoratorLimitReporter=new C2t,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:WSe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(x.colorDecoratorsLimit),c=o.hasChanged(x.defaultColorDecorators);(a||c)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(x.colorDecorators)}get limitReporter(){return this._decoratorLimitReporter}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new O_,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=na(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ao(!1),s=await Rit(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){bt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Kt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},WSe=C0,C0.ID="editor.contrib.colorDetector",C0.RECOMPUTE_TIME=1e3,C0);LV=WSe=D([_(1,Re),_(2,ht),_(3,B_)],LV);class C2t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}vn(LV.ID,LV,mi.AfterFirstRender);class y2t{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new I,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new I,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=r.getColor(MZ)||fe.white})),this._register(pe(this._pickedColorNode,xe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(pe(this._originalColorNode,xe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new E2t(this._domNode)))}get domNode(){return this._domNode}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class E2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),he(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),he(this._button,t),he(t,cm(".button"+$e.asCSSSelector(Ki("color-picker-close",Ce.close,g(Fit,1,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}}class x2t extends ${constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=cm(".colorpicker-body"),he(e,this._domNode),this._saturationBox=new D2t(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new k2t(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new I2t(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new L2t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new fe(new Ky(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new fe(new Ky(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new fe(new Ky(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get opacityStrip(){return this._opacityStrip}get hueStrip(){return this._hueStrip}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class D2t extends ${constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._domNode=cm(".saturation-wrap"),he(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",he(this._domNode,this._canvas),this.selection=cm(".saturation-selection"),he(this._domNode,this.selection),this.layout(),this._register(pe(this._domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}get canvas(){return this._canvas}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new vz);const t=ia(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new fe(new Ky(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=fe.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Oit extends ${constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=he(e,cm(".standalone-strip")),this.overlay=he(this.domNode,cm(".standalone-overlay"))):(this.domNode=he(e,cm(".strip")),this.overlay=he(this.domNode,cm(".overlay"))),this.slider=he(this.domNode,cm(".slider")),this.slider.style.top="0px",this._register(pe(this.domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new vz),i=ia(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class k2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new fe(new gn(t,i,s,1)),r=new fe(new gn(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class I2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class L2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=he(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const nce=class nce extends wg{constructor(e,t,i,s,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(B9.getInstance(gt(e)).onDidChange(()=>this.layout()));const r=cm(".colorpicker-widget");e.appendChild(r),this.header=this._register(new A2t(r,this.model,s,o)),this.body=this._register(new x2t(r,this.model,this.pixelRatio,o))}getId(){return nce.ID}layout(){this.body.layout()}};nce.ID="editor.contrib.colorPickerWidget";let HSe=nce;class T2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let fie=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return tg.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const s=LV.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[await Bit(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}};fie=D([_(1,pn)],fie);class R2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let s6=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!LV.get(this._editor))return null;const o=await Rit(i,this._editor.getModel(),qe.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;O.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await Bit(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new O(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await WJ(this._editor.getModel(),t,this._color,i,e),i=Hit(this._editor,i,t))}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};s6=D([_(1,pn)],s6);async function Bit(n,e,t,i){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new gn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new fe(l),h=await Mit(e,t,i,qe.None),u=new y2t(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,s),n instanceof fie?new T2t(n,O.lift(t.range),u,i):new R2t(n,O.lift(t.range),u,i)}function Wit(n,e,t,i,s){if(i.length===0||!e.hasModel())return $.None;if(s.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;s.setMinimumDimensions(new Tn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new HSe(s.fragment,c,e.getOption(x.pixelRatio),t,n instanceof s6));s.setColorPicker(l);let d=!1,h=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(n instanceof s6){const u=i[0].model.color;n.color=u,WJ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{n.color=f}))}else o.add(c.onColorFlushed(async u=>{await WJ(a,c,u,h,r),d=!0,h=Hit(e,h,c)}));return o.add(c.onDidChangeColor(u=>{WJ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(s.hide(),e.focus())})),o}function Hit(n,e,t){const i=[],s=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(s),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=O.lift(s.range),r=n.getModel()._setTrackedRange(null,o,gi.GrowsOnlyWhenTypingAfter);return n.executeEdits("colorpicker",i),n.pushUndoStop(),n.getModel()._getTrackedRange(r)??o}async function WJ(n,e,t,i,s){const o=await Mit(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,qe.None);e.colorPresentations=o||[]}const sce=class sce extends ${constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(x.colorDecoratorsActivatedOn);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==Mt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==Pit||!i.range)return;const s=this._editor.getContribution(Pc.ID);if(s&&!s.isColorPickerVisible){const o=new O(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(o,KS.Immediate,Vx.Mouse,!1,!0)}}};sce.ID="editor.contrib.colorContribution",sce.RECOMPUTE_TIME=1e3;let pie=sce;vn(pie.ID,pie,mi.BeforeFirstInteraction);hL.register(fie);var USe,VSe,FN;let kF=(FN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=X.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=X.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new zSe(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(USe.ID)}},USe=FN,FN.ID="editor.contrib.standaloneColorPickerController",FN);kF=USe=D([_(1,Pe),_(2,Ai),_(3,ti),_(4,be),_(5,ht),_(6,lo)],kF);vn(kF.ID,kF,mi.AfterFirstRender);const nze=8,M2t=22;var ON;let zSe=(ON=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=c,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(s6,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Dd(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const f=u.target.element?.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return VSe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(x.hover).above;return{position:this._position,secondaryPosition:this._position,preference:e?[hs.ABOVE,hs.BELOW]:[hs.BELOW,hs.ABOVE],positionAffinity:jo.None}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new N2t(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new CFe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new jte(this._keybindingService));let o;const r={fragment:i,statusBar:s,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,c=a.saturationBox.domNode.clientWidth,l=a.domNode.clientWidth-c-M2t-nze,d=o.body.enterButton;d?.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,u=h.pickedColorNode;u.style.width=c+nze+"px";const f=h.originalColorNode;f.style.width=l+"px",o.header.closeButton?.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},VSe=ON,ON.ID="editor.contrib.standaloneColorPickerWidget",ON);zSe=VSe=D([_(3,be),_(4,Ai),_(5,ti),_(6,ht),_(7,lo)],zSe);class N2t{constructor(e,t){this.value=e,this.foundInEditor=t}}const yM="vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions";class P2t extends wf{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Be(yM,0,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(yM,1,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Te.CommandPalette}],metadata:{description:Be(yM,2,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){kF.get(t)?.showOrFocus()}}class F2t extends lt{constructor(){super({id:"editor.action.hideColorPicker",label:g(yM,3,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:X.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:E.Escape,weight:ye.EditorContrib},metadata:{description:Be(yM,4,"Hide the standalone color picker.")}})}run(e,t){kF.get(t)?.hide()}}class O2t extends lt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(yM,5,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:X.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:E.Enter,weight:ye.EditorContrib},metadata:{description:Be(yM,6,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){kF.get(t)?.insertColor()}}Fe(F2t);Fe(O2t);At(P2t);class uI{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=Q.A&&a<=Q.Z&&a+32===c)&&!(c>=Q.A&&c<=Q.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(l);let f=h.lastIndexOf(t,c-1+t.length),p=u.indexOf(i,d-1-i.length);if(f!==-1&&p!==-1)if(a===l)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),w=u.substring(0,p);(v.indexOf(i)>=0||w.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(s&&f+t.length0&&u.charCodeAt(p-1)===Q.Space&&(i=" "+i,p-=1),m=uI._createRemoveBlockCommentOperations(new O(a,f+t.length+1,l,p+1),t,i)):(m=uI._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return O.isEmpty(e)?s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ds.delete(new O(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return O.isEmpty(e)?o.push(ds.replace(new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ds.insert(new oe(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ds.insert(new oe(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new mt(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new mt(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}var Dy;(function(n){n[n.Toggle=0]="Toggle",n[n.ForceAdd=1]="ForceAdd",n[n.ForceRemove=2]="ForceRemove"})(Dy||(Dy={}));class kA{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lo?t[c].commentStrOffset=r-1:t[c].commentStrOffset=r}}}const TV="vs/editor/contrib/comment/browser/comment";class SFe extends lt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(lo);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>O.compareRangesUsingStarts(d.selection,h.selection));let l=c[0];for(let d=1;d{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new wpe(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new bpe(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new bpe(new wpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new bpe(new wpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};oce.ID="editor.contrib.cursorUndoRedoController";let RV=oce;class V2t extends lt{constructor(){super({id:"cursorUndo",label:g(Uit,0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyU,weight:ye.EditorContrib}})}run(e,t,i){RV.get(t)?.cursorUndo()}}class z2t extends lt{constructor(){super({id:"cursorRedo",label:g(Uit,1,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){RV.get(t)?.cursorRedo()}}vn(RV.ID,RV,mi.Eager);Fe(V2t);Fe(z2t);var $2t=".monaco-editor.hc-light .dnd-target,.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}";Ct($2t,{});class G2t{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new O(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new mt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new mt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!0),this._mouseDown&&XO(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===BA.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}XO(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new oe(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new mt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new mt(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",Hi.Explicit)}else(!this._dragSelection.containsPosition(t)||(XO(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(BA.ID,new G2t(this._dragSelection,t,XO(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:BA._DECORATION_OPTIONS}]),this._editor.revealPosition(e,vt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Mt.CONTENT_TEXT||e.type===Mt.CONTENT_EMPTY}_hitMargin(e){return e.type===Mt.GUTTER_GLYPH_MARGIN||e.type===Mt.GUTTER_LINE_NUMBERS||e.type===Mt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};BA.ID="editor.contrib.dragAndDrop",BA.TRIGGER_KEY_VALUE=ei?E.Alt:E.Ctrl,BA._DECORATION_OPTIONS=Kt.register({description:"dnd-target",className:"dnd-target"});let mie=BA;vn(mie.ID,mie,mi.BeforeFirstInteraction);const $Se="vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution";vn(jS.ID,jS,mi.Eager);KQ(Hye);Ke(new class extends Jc{constructor(){super({id:ktt,precondition:rFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e){return jS.get(e)?.changePasteType()}});Ke(new class extends Jc{constructor(){super({id:"editor.hidePasteWidget",precondition:rFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e){jS.get(e)?.clearWidgets()}});var BN;Fe((BN=class extends lt{constructor(){super({id:"editor.action.pasteAs",label:g($Se,1,"Paste As..."),alias:"Paste As...",precondition:X.writable,metadata:{description:"Paste as",args:[{name:"args",schema:BN.argsSchema}]}})}run(e,t,i){let s=typeof i?.kind=="string"?i.kind:void 0;return!s&&i&&(s=typeof i.id=="string"?i.id:void 0),jS.get(t)?.pasteAs(s?new bs(s):void 0)}},BN.argsSchema={type:"object",properties:{kind:{type:"string",description:g($Se,0,"The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},BN));Fe(class extends lt{constructor(){super({id:"editor.action.pasteAsText",label:g($Se,2,"Paste as Text"),alias:"Paste as Text",precondition:X.writable})}run(n,e){return jS.get(e)?.pasteAs({providerId:CF.id})}});const q2t="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution";vn(EF.ID,EF,mi.BeforeFirstInteraction);KQ(Wye);Ke(new class extends Jc{constructor(){super({id:Wtt,precondition:hFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e,t){EF.get(e)?.changeDropType()}});Ke(new class extends Jc{constructor(){super({id:"editor.hideDropWidget",precondition:hFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e,t){EF.get(e)?.clearWidgets()}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[Btt]:{type:"object",scope:ut.LANGUAGE_OVERRIDABLE,description:g(q2t,0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const su=class su{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,su._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,su._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new O(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,su._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=su._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=su._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),l=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/l));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,p=e.length;f=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,c=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,su._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rO.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function sze(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function oze(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=Vit([s[a]],r)+t}),o.slice(0,-1)}var MV;(function(n){n[n.StaticValue=0]="StaticValue",n[n.DynamicPieces=1]="DynamicPieces"})(MV||(MV={}));class rze{constructor(e){this.staticValue=e,this.kind=MV.StaticValue}}class j2t{constructor(e){this.pieces=e,this.kind=MV.DynamicPieces}}class NV{static fromStaticValue(e){return new NV([BI.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===MV.DynamicPieces}constructor(e){!e||e.length===0?this._state=new rze(""):e.length===1&&e[0].staticValue!==null?this._state=new rze(e[0].staticValue):this._state=new j2t(e)}buildReplaceString(e,t){if(this._state.kind===MV.StaticValue)return t?Vit(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const c=[],l=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(r.caseOps[d]){case"U":c.push(a[h].toUpperCase());break;case"u":c.push(a[h].toUpperCase()),d++;break;case"L":c.push(a[h].toLowerCase());break;case"l":c.push(a[h].toLowerCase()),d++;break;default:c.push(a[h])}}a=c.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case Q.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case Q.n:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case Q.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case Q.u:case Q.U:case Q.l:case Q.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===Q.DollarSign){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===Q.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===Q.Digit0||r===Q.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(Q.Digit1<=r&&r<=Q.Digit9){let a=r-Q.Digit0;if(i+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Hi.Explicit||i.reason===Hi.Undo||i.reason===Hi.Redo)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,St(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},J2t)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let c=a.endLineNumber;return a.endColumn===1&&(c=c-1),new O(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const s=this._findMatches(i,!1,gI);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=bU(s.map(c=>c.range),c=>O.compareRangesUsingStarts(c,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(x.find).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new oe(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new oe(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()Z$._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=gI?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new UA(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const s=this._editor.getModel(),o=s.getValue(xo.LF),r=s.getFullModelRange(),a=this._getReplacePattern();let c;const l=this._state.preserveCase;a.hasReplacementPatterns||l?c=o.replace(i,function(){return a.buildReplaceString(arguments,l)}):c=o.replace(i,a.buildReplaceString(null,l));const d=new OMe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Zn.MAX_SAFE_SMALL_INTEGER),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Zn.MAX_SAFE_SMALL_INTEGER).map(o=>new mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:Ye(LMe),inputActiveOptionForeground:Ye(TMe),inputActiveOptionBackground:Ye(hR)},o=this._register(C1());this.caseSensitive=this._register(new hXe({appendTitle:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new uXe({appendTitle:this._keybindingLabelFor(cr.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new gXe({appendTitle:this._keybindingLabelFor(cr.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(pe(this._domNode,xe.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(pe(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return rce.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.TOP_RIGHT_CORNER}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};rce.ID="editor.contrib.findOptionsWidget";let qSe=rce;var pu;(function(n){n[n.NotSet=0]="NotSet",n[n.True=1]="True",n[n.False=2]="False"})(pu||(pu={}));function zK(n,e){return n===pu.True?!0:n===pu.False?!1:e}class Z2t extends ${get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return zK(this._isRegexOverride,this._isRegex)}get wholeWord(){return zK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return zK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return zK(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}get isSearching(){return this._isSearching}get filters(){return this._filters}constructor(){super(),this._onFindReplaceStateChange=this._register(new I),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=pu.NotSet,this._wholeWord=!1,this._wholeWordOverride=pu.NotSet,this._matchCase=!1,this._matchCaseOverride=pu.NotSet,this._preserveCase=!1,this._preserveCaseOverride=pu.NotSet,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(O.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,c=this.matchCase,l=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!O.equalsRange(h,d)))||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:pu.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:pu.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:pu.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:pu.NotSet,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),c!==this.matchCase&&(o=!0,s.matchCase=!0),l!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=gI}}var eWt=".monaco-editor .find-widget{background-color:var(--vscode-editorWidget-background);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);box-sizing:border-box;color:var(--vscode-editorWidget-foreground);height:33px;line-height:19px;overflow:hidden;padding:0 4px;position:absolute;transform:translateY(calc(-100% - 10px));transition:transform .2s linear;z-index:35}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-color:var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{display:flex;font-size:12px;margin:3px 25px 0 17px}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-bottom:2px;padding-top:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{align-items:center;display:flex;height:25px}.monaco-editor .find-widget .monaco-findInput{display:flex;flex:1;vertical-align:middle}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{box-sizing:border-box;display:flex;flex:initial;height:25px;line-height:23px;margin:0 0 0 3px;padding:2px 0 0 2px;text-align:center;vertical-align:middle}.monaco-editor .find-widget .button{align-items:center;background-position:50%;background-repeat:no-repeat;border-radius:5px;cursor:pointer;display:flex;flex:initial;height:16px;justify-content:center;margin-left:3px;padding:3px;width:16px}.monaco-editor .find-widget .codicon-find-selection{border-radius:5px;height:22px;padding:3px;width:22px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{padding:1px 6px;top:-1px;width:auto}.monaco-editor .find-widget .button.toggle{border-radius:0;box-sizing:border-box;height:100%;left:3px;position:absolute;top:0;width:18px}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{display:flex;flex:auto;flex-grow:0;flex-shrink:0;position:relative;vertical-align:middle}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);box-sizing:border-box;padding:1px}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}.monaco-editor.hc-black .find-widget .button:before{left:2px;position:relative;top:1px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;right:4px;top:5px}";Ct(eWt,{});function QSe(n){return n.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&n.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const fc="vs/editor/contrib/find/browser/findWidget",aze=Ki("find-collapsed",Ce.chevronRight,g(fc,0,"Icon to indicate that the editor find widget is collapsed.")),cze=Ki("find-expanded",Ce.chevronDown,g(fc,1,"Icon to indicate that the editor find widget is expanded.")),tWt=Ki("find-selection",Ce.selection,g(fc,2,"Icon for 'Find in Selection' in the editor find widget.")),iWt=Ki("find-replace",Ce.replace,g(fc,3,"Icon for 'Replace' in the editor find widget.")),nWt=Ki("find-replace-all",Ce.replaceAll,g(fc,4,"Icon for 'Replace All' in the editor find widget.")),sWt=Ki("find-previous-match",Ce.arrowUp,g(fc,5,"Icon for 'Find Previous' in the editor find widget.")),oWt=Ki("find-next-match",Ce.arrowDown,g(fc,6,"Icon for 'Find Next' in the editor find widget.")),rWt=g(fc,7,"Find / Replace"),aWt=g(fc,8,"Find"),cWt=g(fc,9,"Find"),lWt=g(fc,10,"Previous Match"),dWt=g(fc,11,"Next Match"),hWt=g(fc,12,"Find in Selection"),uWt=g(fc,13,"Close"),gWt=g(fc,14,"Replace"),fWt=g(fc,15,"Replace"),pWt=g(fc,16,"Replace"),mWt=g(fc,17,"Replace All"),_Wt=g(fc,18,"Toggle Replace"),vWt=g(fc,19,"Only the first {0} results are highlighted, but all find operations work on the entire text.",gI),wWt=g(fc,20,"{0} of {1}"),lze=g(fc,21,"No results"),yC=419,bWt=275,CWt=bWt-54;let E5=69;const yWt=33,dze="ctrlEnterReplaceAll.windows.donotask",hze=ei?V.WinCtrl:V.CtrlCmd;class Cpe{constructor(e){this.afterLineNumber=e,this.heightInPx=yWt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function uze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function gze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(x.readOnly)&&(this._codeEditor.getOption(x.readOnly)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(x.layoutInfo)&&this._tryUpdateWidgetWidth(),h.hasChanged(x.accessibilitySupport)&&this.updateAccessibilitySupport(),h.hasChanged(x.find)){const u=this._codeEditor.getOption(x.find).loop;this._state.change({loop:u},!1);const f=this._codeEditor.getOption(x.find).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new Cpe(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const h=await this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}})),this._findInputFocused=Ahe.bindTo(r),this._findFocusTracker=this._register(Dd(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=AFe.bindTo(r),this._replaceFocusTracker=this._register(Dd(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(x.find).addExtraSpaceOnTop&&(this._viewZone=new Cpe(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return ace.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Yf.TOP_RIGHT_CORNER}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(x.readOnly)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=du(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,bt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=E5+"px",this._state.matchesCount>=gI?this._matchesCount.title=vWt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=gI&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=a_(wWt,i,t)}else e=lze;this._matchesCount.appendChild(document.createTextNode(e)),sa(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),E5=Math.max(E5,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===lze)return i===""?g(fc,22,"{0} found",e):g(fc,23,"{0} found for '{1}'",e,i);if(t){const s=g(fc,24,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return g(fc,25,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(x.readOnly);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(x.find).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(x.find).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=ia(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=bZ(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(l?l.left:0)>c&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(x.find).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(x.find).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new Cpe(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(x.padding).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&du(this._domNode)>yC){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=du(this._findInput.domNode);return}if(yC+28+s>=i&&(r=!0),yC+28+s-E5>=i&&(a=!0),yC+28+s-E5>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!O.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(E.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Is&&rf&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(fc,26,"Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(dze,!0,ke.PROFILE,ln.USER)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(E.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.Shift|E.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new bye(null,this._contextViewProvider,{width:CWt,label:aWt,placeholder:cWt,appendCaseSensitiveLabel:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(cr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(cr.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>QSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(V.Shift|E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),jr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(C1());this._prevBtn=this._register(new ZO({label:lWt+this._keybindingLabelFor(cr.PreviousMatchFindAction),icon:sWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.PreviousMatchFindAction)).run().then(void 0,bt)}},this._hoverService)),this._nextBtn=this._register(new ZO({label:dWt+this._keybindingLabelFor(cr.NextMatchFindAction),icon:oWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.NextMatchFindAction)).run().then(void 0,bt)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",s.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new iD({icon:tWt,title:hWt+this._keybindingLabelFor(cr.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:Ye(hR),inputActiveOptionBorder:Ye(LMe),inputActiveOptionForeground:Ye(TMe)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new ZO({label:uWt+this._keybindingLabelFor(cr.CloseFindWidgetCommand),icon:VXe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new Cye(null,void 0,{label:gWt,placeholder:fWt,appendPreserveCaseLabel:this._keybindingLabelFor(cr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>QSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(d=>this._onReplaceInputKeyDown(d))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(d=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(d=>{d.equals(E.Tab)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),d.preventDefault())}));const r=this._register(C1());this._replaceBtn=this._register(new ZO({label:pWt+this._keybindingLabelFor(cr.ReplaceOneAction),icon:iWt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(V.Shift|E.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new ZO({label:mWt+this._keybindingLabelFor(cr.ReplaceAllAction),icon:nWt,hoverDelegate:r,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",a.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new ZO({label:_Wt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=rWt,this._domNode.role="dialog",this._domNode.style.width=`${yC}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Lh(this._domNode,this,{orientation:vi.VERTICAL,size:2})),this._resized=!1;let l=yC;this._register(this._resizeSash.onDidStart(()=>{l=du(this._domNode)})),this._register(this._resizeSash.onDidChange(d=>{this._resized=!0;const h=l+d.startX-d.currentX;if(hu||(this._domNode.style.width=`${h}px`,this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=du(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};ace.ID="editor.contrib.findWidget";let jSe=ace;class ZO extends wg{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+$e.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupUpdatableHover(e.hoverDelegate??va("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,s=>{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{if(s.equals(E.Space)||s.equals(E.Enter)){this._opts.onTrigger(),s.preventDefault();return}this._opts.onKeyDown?.(s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...$e.asClassNameArray(aze)),this._domNode.classList.add(...$e.asClassNameArray(cze))):(this._domNode.classList.remove(...$e.asClassNameArray(cze)),this._domNode.classList.add(...$e.asClassNameArray(aze)))}}Lm((n,e)=>{const t=n.getColor(Uk);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${pS(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(Dmt);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${pS(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(ft);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const o=n.getColor(Emt);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=n.getColor(xmt);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var KSe;const Zg="vs/editor/contrib/find/browser/findController",SWt=524288;function YSe(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(x.find).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,ke.WORKSPACE,ln.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,ke.WORKSPACE,ln.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,ke.WORKSPACE,ln.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,ke.WORKSPACE,ln.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Ahe.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Iu(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=YSe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Iu(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=YSe(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new Z$(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(g(Zg,0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},KSe=WN,WN.ID="editor.contrib.findController",WN);vf=KSe=D([_(1,Pe),_(2,on),_(3,Mu),_(4,Pi),_(5,el)],vf);let JSe=class extends vf{constructor(e,t,i,s,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===bw.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===bw.FocusFindInput&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new jSe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new qSe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};JSe=D([_(1,W_),_(2,Pe),_(3,ti),_(4,pn),_(5,Pi),_(6,on),_(7,Mu),_(8,el)],JSe);const AWt=Sje(new yje({id:cr.StartFindAction,label:g(Zg,1,"Find"),alias:"Find",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyF,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,2,"&&Find"),order:1}}));AWt.addImplementation(0,(n,e,t)=>{const i=vf.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).globalFindClipboard,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const EWt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class xWt extends lt{constructor(){super({id:cr.StartFindWithArgs,label:g(Zg,3,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:ye.EditorContrib},metadata:EWt})}async run(e,t,i){const s=vf.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}}}class DWt extends lt{constructor(){super({id:cr.StartFindWithSelection,label:g(Zg,4,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:V.CtrlCmd|E.KeyE},weight:ye.EditorContrib}})}async run(e,t){const i=vf.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class zit extends lt{async run(e,t){const i=vf.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class kWt extends zit{constructor(){super({id:cr.NextMatchFindAction,label:g(Zg,5,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:E.F3,mac:{primary:V.CtrlCmd|E.KeyG,secondary:[E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class IWt extends zit{constructor(){super({id:cr.PreviousMatchFindAction,label:g(Zg,6,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:V.Shift|E.F3,mac:{primary:V.CtrlCmd|V.Shift|E.KeyG,secondary:[V.Shift|E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:V.Shift|E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class LWt extends lt{constructor(){super({id:cr.GoToMatchFindAction,label:g(Zg,7,"Go to Match..."),alias:"Go to Match...",precondition:cD}),this._highlightDecorations=[]}run(e,t,i){const s=vf.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Pi).notify({severity:nt.Warning,message:g(Zg,8,"No matches. Try searching for something else.")});return}const a=e.get(On).createInputBox();a.placeholder=g(Zg,9,"Type a number to go to a specific match (between 1 and {0})",o);const c=d=>{const h=parseInt(d);if(isNaN(h))return;const u=s.getState().matchesCount;if(h>0&&h<=u)return h-1;if(h<0&&h>=-u)return u+h},l=d=>{const h=c(d);if(typeof h=="number"){a.validationMessage=void 0,s.goToMatch(h);const u=s.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}])})}}class $it extends lt{async run(e,t){const i=vf.get(t);if(!i)return;const s=YSe(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class TWt extends $it{constructor(){super({id:cr.NextSelectionMatchFindAction,label:g(Zg,11,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class RWt extends $it{constructor(){super({id:cr.PreviousSelectionMatchFindAction,label:g(Zg,12,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const MWt=Sje(new yje({id:cr.StartFindReplaceAction,label:g(Zg,13,"Replace"),alias:"Replace",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyH,mac:{primary:V.CtrlCmd|V.Alt|E.KeyF},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,14,"&&Replace"),order:2}}));MWt.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=vf.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?bw.FocusReplaceInput:bw.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop})});vn(vf.ID,JSe,mi.Eager);Fe(xWt);Fe(DWt);Fe(kWt);Fe(IWt);Fe(LWt);Fe(TWt);Fe(RWt);const mC=Jc.bindToContribution(vf.get);Ke(new mC({id:cr.CloseFindWidgetCommand,precondition:cD,handler:n=>n.closeFindWidget(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new mC({id:cr.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:BK.primary,mac:BK.mac,win:BK.win,linux:BK.linux}}));Ke(new mC({id:cr.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:WK.primary,mac:WK.mac,win:WK.win,linux:WK.linux}}));Ke(new mC({id:cr.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:HK.primary,mac:HK.mac,win:HK.win,linux:HK.linux}}));Ke(new mC({id:cr.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:UK.primary,mac:UK.mac,win:UK.win,linux:UK.linux}}));Ke(new mC({id:cr.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:VK.primary,mac:VK.mac,win:VK.win,linux:VK.linux}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.Digit1}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,AFe),primary:E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Alt|E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,AFe),primary:void 0,mac:{primary:V.CtrlCmd|E.Enter}}}));Ke(new mC({id:cr.SelectAllMatchesAction,precondition:cD,handler:n=>n.selectAllMatches(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.Alt|E.Enter}}));const EFe="vs/editor/contrib/fontZoom/browser/fontZoom";class NWt extends lt{constructor(){super({id:"editor.action.fontZoomIn",label:g(EFe,0,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){d_.setZoomLevel(d_.getZoomLevel()+1)}}class PWt extends lt{constructor(){super({id:"editor.action.fontZoomOut",label:g(EFe,1,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){d_.setZoomLevel(d_.getZoomLevel()-1)}}class FWt extends lt{constructor(){super({id:"editor.action.fontZoomReset",label:g(EFe,2,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){d_.setZoomLevel(0)}}Fe(NWt);Fe(PWt);Fe(FWt);const Git="vs/editor/contrib/format/browser/formatActions";var NH;let _ie=(NH=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new Z,this._sessionDisposables=new Z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(x.formatOnType)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(x.formatOnType)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new EZ;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new ai,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{s.token.isCancellationRequested||mo(r)&&(this._accessibilitySignalService.playSignal(Zl.format,{userGesture:!1}),hV.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},NH.ID="editor.contrib.autoFormat",NH);_ie=D([_(1,ht),_(2,kd),_(3,Lw)],_ie);var PH;let vie=(PH=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Z,this._callOnModel=new Z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(x.formatOnPaste)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Ude,this.editor,e,S_.Silent,cf.None,qe.None,!1).catch(bt))}},PH.ID="editor.contrib.formatOnPaste",PH);vie=D([_(1,ht),_(2,be)],vie);class OWt extends lt{constructor(){super({id:"editor.action.formatDocument",label:g(Git,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.notInCompositeEditor,X.writable,X.hasDocumentFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(be);await e.get(eD).showWhile(i.invokeFunction(WCe,t,S_.Explicit,cf.None,qe.None,!0),250)}}}class BWt extends lt{constructor(){super({id:"editor.action.formatSelection",label:g(Git,1,"Format Selection"),alias:"Format Selection",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyF),weight:ye.EditorContrib},contextMenuOpts:{when:X.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new O(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(eD).showWhile(i.invokeFunction(Ude,t,o,S_.Explicit,cf.None,qe.None,!0),250)}}vn(_ie.ID,_ie,mi.BeforeFirstInteraction);vn(vie.ID,vie,mi.BeforeFirstInteraction);Fe(OWt);Fe(BWt);yt.registerCommand("editor.action.format",async n=>{const e=n.get(jt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(ji);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class ky{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static getElementById(e,t){if(!e)return;const i=LS(e,t.id);if(i===e.length)return t;if(!(i0&&O.areIntersecting(e[s-1],t.symbol.range)&&(s-=1)):s=i;const o=[];let r;for(;sr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),iF(e)}}class oy extends ky{static create(e,t,i){const s=new ai(i),o=new oy(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=ky.findId(`provider_${d}`,o),u=new ZSe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,s.token)).then(f=>{for(const p of f||[])oy._makeOutlineElement(p,u);return u},f=>(er(f),u)).then(f=>{ky.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);Ls(l,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?oy.create(e,t,i):o._compact()).finally(()=>{s.dispose(),c.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=ky.findId(e,t),s=new XSe(i,t,e);if(e.children)for(const o of e.children)oy._makeOutlineElement(o,s);t.children.set(s.id,s)}static get(e){for(;e;){if(e instanceof oy)return e;e=e.parent}}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=fi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}merge(e){return this.uri.toString()!==e.uri.toString()||this._groups.size!==e._groups.size?!1:(this._groups=e._groups,this.children=e.children,!0)}getItemEnclosingPosition(e,t){let i;if(t){let o=t.parent;for(;o&&!i;)o instanceof ZSe&&(i=o),o=o.parent}let s;for(const[,o]of this._groups)if(s=o.getItemEnclosingPosition(e),s&&(!i||i===o))break;return s}getItemById(e){return ky.getElementById(e,this)}updateMarker(e){e.sort(O.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof XSe?e.push(t.symbol):e.push(...fi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>O.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return oy._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>oe.compare(O.getStartPosition(i.range),O.getStartPosition(s.range))||oe.compare(O.getEndPosition(s.range),O.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&oy._flattenDocumentSymbols(e,s.children,s.name)}}const JQ=ae("IOutlineModelService");let eAe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new L_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ls(o.provider,s)){const a=new ai;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:oy.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const c=Date.now();o.promise.then(l=>{o.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};eAe=D([_(0,ht),_(1,B_),_(2,Ai)],eAe);ce(JQ,eAe,Yt.Delayed);yt.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;Bt(P.isUri(t));const i=n.get(JQ),o=await n.get(Rn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,qe.None)).getTopLevelSymbols()}finally{o.dispose()}});const aC="vs/editor/contrib/inlineCompletions/browser/commands",cce=class cce extends lt{constructor(){super({id:cce.ID,label:g(aC,0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketRight}})}async run(e,t){_g.get(t)?.model.get()?.next()}};cce.ID=Ket;let tAe=cce;const lce=class lce extends lt{constructor(){super({id:lce.ID,label:g(aC,1,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketLeft}})}async run(e,t){_g.get(t)?.model.get()?.previous()}};lce.ID=jet;let iAe=lce;class WWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(aC,2,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:X.writable})}async run(e,t){const i=_g.get(t);await Hxt(async s=>{await i?.model.get()?.triggerExplicitly(s),i?.playAccessibilitySignal(s)})}}class HWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(aC,3,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|E.RightArrow,kbExpr:ge.and(X.writable,af.inlineSuggestionVisible)},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,4,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class UWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(aC,5,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,6,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class VWt extends lt{constructor(){super({id:Qet,label:g(aC,7,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:af.inlineSuggestionVisible,menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,8,"Accept"),group:"primary",order:1}],kbOpts:{primary:E.Tab,weight:200,kbExpr:ge.and(af.inlineSuggestionVisible,X.tabMovesFocus.toNegated(),af.inlineSuggestionHasIndentationLessThanTabSize,qi.Visible.toNegated(),X.hoverFocused.toNegated())}})}async run(e,t){const i=_g.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const dce=class dce extends lt{constructor(){super({id:dce.ID,label:g(aC,9,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:af.inlineSuggestionVisible,kbOpts:{weight:100,primary:E.Escape}})}async run(e,t){const i=_g.get(t);En(s=>{i?.model.get()?.stop(s)})}};dce.ID="editor.action.inlineSuggest.hide";let nAe=dce;const hce=class hce extends pi{constructor(){super({id:hce.ID,title:g(aC,10,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Te.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ge.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Re),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};hce.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let sAe=hce;const zWt="vs/editor/contrib/inlineCompletions/browser/hoverParticipant";class $Wt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let oAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=_g.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new bM(1e3,this,O.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineSuggest).showToolbar!=="onHover")return[];const i=_g.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new $Wt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.renderScreenReaderText(e,s,i);const o=s.controller.model.get(),r=this._instantiationService.createInstance(vV,this._editor,!1,Au(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands);return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const s=we,o=s("div.hover-row.markdown-hover"),r=he(o,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new vw({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(zWt,0,"Suggestion:"),h=i.add(a.render(new Xt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};i.add(Ni(l=>{const d=t.controller.model.read(l)?.primaryGhostText.read(l);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);c(d.renderForScreenReader(h))}else _a(r)})),e.fragment.appendChild(o)}};oAe=D([_(1,Di),_(2,fr),_(3,Ur),_(4,be),_(5,rn)],oAe);class GWt extends ${getProvider(e){const t=e.get(jt);function i(){const s=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!s)return;const o=_g.get(s)?.model.get(),r=o?.state.get();if(!o||!r)return;const a=o.textModel.getLineContent(r.primaryGhostText.lineNumber),c=r.primaryGhostText.renderForScreenReader(a);if(!c)return;const l=s.getModel()?.getLanguageId()??void 0;return{id:rC.InlineCompletions,verbositySettingKey:"accessibility.verbosity.inlineCompletions",provideContent(){return a+c},onClose(){o.stop(),s.focus()},next(){o.next(),setTimeout(()=>i(),50)},previous(){o.previous(),setTimeout(()=>i(),50)},options:{language:l,type:N_.View}}}return i()}constructor(){super(),this.type=N_.View,this.priority=95,this.name="inline-completions",this.when=ge.and(af.inlineSuggestionVisible)}}vn(_g.ID,_g,mi.Eventually);Fe(WWt);Fe(tAe);Fe(iAe);Fe(HWt);Fe(UWt);Fe(VWt);Fe(nAe);At(sAe);hL.register(oAe);NQ.register(new GWt);var qWt=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";Ct(qWt,{});var R3;const QWt="vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition";var y0;let IF=(y0=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new Z,this.toUnhookForKeyboard=new Z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new phe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{bt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(R3.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===Mt.CONTENT_WIDGET&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new Bde(this.editor,hr.Position|hr.Value|hr.Selection|hr.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=na(r=>this.findDefinition(e,r));let s;try{s=await this.previousPromise}catch(r){bt(r);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=s[0].originSelectionRange?O.lift(s[0].originSelectionRange):new O(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let r=o;for(const{originSelectionRange:a}of s)a&&(r=O.plusRange(r,a));this.addDecoration(r,new Xt().appendText(g(QWt,0,"Click to show {0} definitions.",s.length)))}else{const r=s[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=r.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,d?new Xt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=R3.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new qQ({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Pe);return mf.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},R3=y0,y0.ID="editor.contrib.gotodefinitionatposition",y0.MAX_SOURCE_PREVIEW_LINES=8,y0);IF=R3=D([_(1,Rn),_(2,Di),_(3,ht)],IF);vn(IF.ID,IF,mi.BeforeFirstInteraction);class fze{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let rAe=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._dispoables=new Z,this._markers=[],this._nextIdx=-1,P.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=lw(a.resource.toString(),c.resource.toString());return l===0&&(s==="position"?l=O.compareRangesUsingStarts(a,c)||Ys.compare(a.severity,c.severity):l=Ys.compare(a.severity,c.severity)||O.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:P.isUri(e)?e:void 0,severities:Ys.Error|Ys.Warning|Ys.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new fze(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=CU(this._markers,{resource:e.uri},(r,a)=>lw(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;it())}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new rAe(e,this._markerService,this._configService)}};aAe=D([_(0,U_),_(1,Re)],aAe);ce(qit,aAe,Yt.Delayed);var jWt='.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;margin-right:4px;vertical-align:text-top}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{font-style:italic;opacity:.6}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{padding:8px 12px 0 20px;position:absolute;user-select:text;-webkit-user-select:text;white-space:pre}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{color:inherit;opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-activeForeground);text-decoration:underline;text-underline-position:under}.monaco-editor .marker-widget .descriptioncontainer .filename{color:var(--vscode-textLink-activeForeground);cursor:pointer}';Ct(jWt,{});var KWt=".extension-editor .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.markers-panel .marker-icon .codicon.codicon-error,.markers-panel .marker-icon.error,.monaco-editor .zone-widget .codicon.codicon-error,.preferences-editor .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.extension-editor .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.markers-panel .marker-icon .codicon.codicon-warning,.markers-panel .marker-icon.warning,.monaco-editor .zone-widget .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.extension-editor .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.markers-panel .marker-icon .codicon.codicon-info,.markers-panel .marker-icon.info,.monaco-editor .zone-widget .codicon.codicon-info,.preferences-editor .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}";Ct(KWt,{});var cAe;(function(n){function e(t){switch(t){case nt.Ignore:return"severity-ignore "+$e.asClassName(Ce.info);case nt.Info:return $e.asClassName(Ce.info);case nt.Warning:return $e.asClassName(Ce.warning);case nt.Error:return $e.asClassName(Ce.error);default:return""}}n.className=e})(cAe||(cAe={}));var lAe;const lm="vs/editor/contrib/gotoError/browser/gotoErrorWidget";class YWt{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Xo(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new FKe(r,{horizontal:zo.Auto,vertical:zo.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){St(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=xw(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Yo(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const u of a)c=document.createElement("div"),c.innerText=u,u===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),c.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=we("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(o.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=he(this._codeLink,we("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Yo(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),mo(s)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(x.lineHeight)*.66)}px`,this._lines+=1;for(const f of s){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const l=this._editor.getOption(x.fontInfo),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Ys.Error:t=g(lm,0,"Error");break;case Ys.Warning:t=g(lm,1,"Warning");break;case Ys.Info:t=g(lm,2,"Info");break;case Ys.Hint:t=g(lm,3,"Hint");break}let i=g(lm,4,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var HN;let o6=(HN=class extends V7{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ys.Warning,this._backgroundColor=fe.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(eHt);let t=dAe,i=JWt;this._severity===Ys.Warning?(t=HJ,i=XWt):this._severity===Ys.Info&&(t=hAe,i=ZWt);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(zPe),secondaryHeadingColor:e.getColor($Pe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}focus(){this._parentContainer.focus()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(lAe.TitleMenu,this._contextKeyService);tD(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=he(e,we(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new YWt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=O.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(lm,5,"{0} of {1} problems",t,i):g(lm,6,"{0} of {1} problem",t,i);this.setTitle(ui(a.uri),c)}this._icon.className=`codicon ${cAe.className(Ys.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,vt.Smooth),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},lAe=HN,HN.TitleMenu=new Te("gotoErrorTitleMenu"),HN);o6=lAe=D([_(1,pn),_(2,fr),_(3,_c),_(4,be),_(5,Pe),_(6,eo)],o6);const pze=j9(Vh,Cmt),mze=j9(qc,K9),_ze=j9(Qc,Y9),dAe=B("editorMarkerNavigationError.background",{dark:pze,light:pze,hcDark:ft,hcLight:ft},g(lm,7,"Editor marker navigation widget error color.")),JWt=B("editorMarkerNavigationError.headerBackground",{dark:Ie(dAe,.1),light:Ie(dAe,.1),hcDark:null,hcLight:null},g(lm,8,"Editor marker navigation widget error heading background.")),HJ=B("editorMarkerNavigationWarning.background",{dark:mze,light:mze,hcDark:ft,hcLight:ft},g(lm,9,"Editor marker navigation widget warning color.")),XWt=B("editorMarkerNavigationWarning.headerBackground",{dark:Ie(HJ,.1),light:Ie(HJ,.1),hcDark:"#0C141F",hcLight:Ie(HJ,.2)},g(lm,10,"Editor marker navigation widget warning heading background.")),hAe=B("editorMarkerNavigationInfo.background",{dark:_ze,light:_ze,hcDark:ft,hcLight:ft},g(lm,11,"Editor marker navigation widget info color.")),ZWt=B("editorMarkerNavigationInfo.headerBackground",{dark:Ie(hAe,.1),light:Ie(hAe,.1),hcDark:null,hcLight:null},g(lm,12,"Editor marker navigation widget info heading background.")),eHt=B("editorMarkerNavigation.background",{dark:us,light:us,hcDark:us,hcLight:us},g(lm,13,"Editor marker navigation widget background."));var M3;const P1="vs/editor/contrib/gotoError/browser/gotoError";var UN;let LF=(UN=class{static get(e){return e.getContribution(M3.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Qit.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(o6,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!O.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:O.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new oe(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:px.NearTop,selection:i.selected.marker}},this._editor);s&&(M3.get(s)?.close(),M3.get(s)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},M3=UN,UN.ID="editor.contrib.markerController",UN);LF=M3=D([_(1,qit),_(2,Pe),_(3,jt),_(4,be)],LF);class Ehe extends lt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&LF.get(t)?.nagivate(this._next,this._multiFile)}}const eR=class eR extends Ehe{constructor(){super(!0,!1,{id:eR.ID,label:eR.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:eR.LABEL,icon:Ki("marker-navigation-next",Ce.arrowDown,g(P1,1,"Icon for goto next marker.")),group:"navigation",order:1}})}};eR.ID="editor.action.marker.next",eR.LABEL=g(P1,0,"Go to Next Problem (Error, Warning, Info)");let wie=eR;const tR=class tR extends Ehe{constructor(){super(!1,!1,{id:tR.ID,label:tR.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:tR.LABEL,icon:Ki("marker-navigation-previous",Ce.arrowUp,g(P1,3,"Icon for goto previous marker.")),group:"navigation",order:2}})}};tR.ID="editor.action.marker.prev",tR.LABEL=g(P1,2,"Go to Previous Problem (Error, Warning, Info)");let uAe=tR;class tHt extends Ehe{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(P1,4,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,5,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class iHt extends Ehe{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(P1,6,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,7,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}vn(LF.ID,LF,mi.Lazy);Fe(wie);Fe(uAe);Fe(tHt);Fe(iHt);const Qit=new Y("markersNavigationVisible",!1),nHt=Jc.bindToContribution(LF.get);Ke(new nHt({id:"closeMarkersNavigation",precondition:Qit,handler:n=>n.close(),kbOpts:{weight:ye.EditorContrib+50,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));const Cl="vs/editor/contrib/hover/browser/hoverActions";var sb;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(sb||(sb={}));class sHt extends lt{constructor(){super({id:Vtt,label:g(Cl,0,"Show or Focus Hover"),metadata:{description:Be(Cl,1,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[sb.NoAutoFocus,sb.FocusIfVisible,sb.AutoFocusImmediately],enumDescriptions:[g(Cl,2,"The hover will not automatically take focus."),g(Cl,3,"The hover will take focus only if it is already visible."),g(Cl,4,"The hover will automatically take focus when it appears.")],default:sb.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyI),weight:ye.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const s=Pc.get(t);if(!s)return;const o=i?.focus;let r=sb.FocusIfVisible;Object.values(sb).includes(o)?r=o:typeof o=="boolean"&&o&&(r=sb.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new O(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(h,KS.Immediate,Vx.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Kd.Enabled;s.isHoverVisible?r!==sb.NoAutoFocus?s.focus():a(c):a(c||r===sb.AutoFocusImmediately)}}class oHt extends lt{constructor(){super({id:JFt,label:g(Cl,5,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Be(Cl,6,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Pc.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new O(s.lineNumber,s.column,s.lineNumber,s.column),r=IF.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,KS.Immediate,Vx.Keyboard,!0)})}}class rHt extends lt{constructor(){super({id:XFt,label:g(Cl,7,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.UpArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,8,"Scroll up the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.scrollUp()}}class aHt extends lt{constructor(){super({id:ZFt,label:g(Cl,9,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.DownArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,10,"Scroll down the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.scrollDown()}}class cHt extends lt{constructor(){super({id:eOt,label:g(Cl,11,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.LeftArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,12,"Scroll left the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.scrollLeft()}}class lHt extends lt{constructor(){super({id:tOt,label:g(Cl,13,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.RightArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,14,"Scroll right the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.scrollRight()}}class dHt extends lt{constructor(){super({id:iOt,label:g(Cl,15,"Page Up Hover"),alias:"Page Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageUp,secondary:[V.Alt|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,16,"Page up the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.pageUp()}}class hHt extends lt{constructor(){super({id:nOt,label:g(Cl,17,"Page Down Hover"),alias:"Page Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageDown,secondary:[V.Alt|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,18,"Page down the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.pageDown()}}class uHt extends lt{constructor(){super({id:sOt,label:g(Cl,19,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.Home,secondary:[V.CtrlCmd|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,20,"Go to the top of the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.goToTop()}}class gHt extends lt{constructor(){super({id:oOt,label:g(Cl,21,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.End,secondary:[V.CtrlCmd|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,22,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Pc.get(t);i&&i.goToBottom()}}class fHt extends lt{constructor(){super({id:VQ,label:aOt,alias:"Increase Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Pc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Increase,i?.index,i?.focus)}}class pHt extends lt{constructor(){super({id:zQ,label:lOt,alias:"Decrease Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Pc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Decrease,i?.index,i?.focus)}}const x5="vs/editor/contrib/hover/browser/markerHoverParticipant",j_=we;class mHt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const vze={type:wu.Invoke,filter:{include:ls.QuickFix},triggerAction:_f.QuickFixHover};let gAe=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const c=a.range.startLineNumber===s?a.range.startColumn:1,l=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new O(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new mHt(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return $.None;const i=new Z;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>Ys.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=j_("div.hover-row");i.tabIndex=0;const s=he(i,j_("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(s);const l=he(s,j_("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const d=j_("span");if(o){const p=he(d,j_("span"));p.innerText=o}const h=he(d,j_("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(pe(h,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const u=he(h,j_("span"));u.innerText=a.value;const f=he(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=he(s,j_("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(mo(c))for(const{message:d,resource:h,startLineNumber:u,startColumn:f}of c){const p=he(s,j_("div"));p.style.marginTop="8px";const m=he(p,j_("a"));m.innerText=`${ui(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add(pe(m,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(bt)}));const v=he(p,j_("span"));v.innerText=d,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ys.Error||t.marker.severity===Ys.Warning||t.marker.severity===Ys.Info){const s=LF.get(this._editor);s&&e.statusBar.addAction({label:g(x5,0,"View Problem"),commandId:wie.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const s=e.statusBar.append(j_("div"));this.recentMarkerCodeActionsInfo&&(Eee.makeKey(this.recentMarkerCodeActionsInfo.marker)===Eee.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=g(x5,1,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?$.None:PS(()=>s.textContent=g(x5,2,"Checking for quick fixes..."),200,i);s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ee(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=g(x5,1,"No quick fixes available");return}s.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(x5,3,"Quick Fix..."),commandId:cFe,run:l=>{c=!0;const d=AF.get(this._editor),h=ia(l);e.hide(),d?.showCodeActions(vze,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},bt)}}getCodeActions(e){return na(t=>KW(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),vze,cf.None,t))}};gAe=D([_(1,xMe),_(2,fr),_(3,ht)],gAe);const $K="vs/editor/contrib/hover/browser/hoverAccessibleViews";var xR;(function(n){n.intro=g($K,0,"Focus on the hover widget to cycle through the hover parts with the Tab key."),n.increaseVerbosity=g($K,1,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",VQ),n.decreaseVerbosity=g($K,2,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",zQ),n.hoverContent=g($K,3,"The last focused hover content is the following.")})(xR||(xR={}));class _Ht{constructor(){this.type=N_.View,this.priority=95,this.name="hover",this.when=X.hoverFocused}getProvider(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Pc.get(i);if(!s)return;const o=e.get(ti);return this._provider=e.get(be).createInstance(wHt,o,i,s),this._provider}dispose(){this._provider?.dispose()}}class vHt{constructor(){this.priority=100,this.name="hover",this.type=N_.Help,this.when=X.hoverVisible}getProvider(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Pc.get(i);if(s)return e.get(be).createInstance(Kit,s)}dispose(){this._provider?.dispose()}}class jit extends ${constructor(e){super(),this._hoverController=e,this.id=rC.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._markdownHoverFocusedIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._markdownHoverFocusedIndex=this._hoverController.focusedMarkdownHoverIndex(),this._onHoverContentsChanged=this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._markdownHoverFocusedIndex=-1,this._hoverController.focus(),this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._onHoverContentsChanged?.dispose())}}class Kit extends jit{constructor(e){super(e),this.options={type:N_.Help}}provideContent(){return this.provideContentAtIndex(this._markdownHoverFocusedIndex)}provideContentAtIndex(e){const t=[];return t.push(xR.intro),t.push(...this._descriptionsOfVerbosityActionsForIndex(e)),t.push(...this._descriptionOfFocusedMarkdownHoverAtIndex(e)),t.join(` -`)}_descriptionsOfVerbosityActionsForIndex(e){const t=[],i=this._descriptionOfVerbosityActionForIndex(Yl.Increase,e);i!==void 0&&t.push(i);const s=this._descriptionOfVerbosityActionForIndex(Yl.Decrease,e);return s!==void 0&&t.push(s),t}_descriptionOfVerbosityActionForIndex(e,t){if(this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(t,e))switch(e){case Yl.Increase:return xR.increaseVerbosity;case Yl.Decrease:return xR.decreaseVerbosity}}_descriptionOfFocusedMarkdownHoverAtIndex(e){const t=[],i=this._hoverController.markdownHoverContentAtIndex(e);return i&&(t.push(` -`+xR.hoverContent),t.push(` -`+i)),t}}class wHt extends jit{constructor(e,t,i){super(i),this._keybindingService=e,this._editor=t,this.options={type:N_.View},this._initializeOptions(this._editor,i)}provideContent(){const e=this._hoverController.markdownHoverContentAtIndex(this._markdownHoverFocusedIndex);return e.length>0?e:this._hoverController.getWidgetContent()||xR.intro}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Yl.Increase)),e.push(this._getActionFor(this._editor,Yl.Decrease)),e}_getActionFor(e,t){let i,s,o;switch(t){case Yl.Increase:i=VQ,s=rOt,o=Ce.add;break;case Yl.Decrease:i=zQ,s=cOt,o=Ce.remove;break}const r=qtt(this._keybindingService,t),a=this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(this._markdownHoverFocusedIndex,t);return new xn(s,r,$e.asClassName(o),a,()=>{e.getAction(i)?.run({index:this._markdownHoverFocusedIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new Kit(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._markdownHoverFocusedIndex)}}class bHt{constructor(){this.type=N_.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(W_).getContextViewElement(),s=i?.textContent??void 0,o=e.get(el);if(!(i.classList.contains("accessible-view-container")||!s))return{id:rC.Hover,verbositySettingKey:"accessibility.verbosity.hover",provideContent(){return s},onClose(){o.showAndFocusLastHover()},options:{language:"typescript",type:N_.View}}}dispose(){}}vn(Pc.ID,Pc,mi.BeforeFirstInteraction);Fe(sHt);Fe(oHt);Fe(rHt);Fe(aHt);Fe(cHt);Fe(lHt);Fe(dHt);Fe(hHt);Fe(uHt);Fe(gHt);Fe(fHt);Fe(pHt);hL.register(X7);hL.register(gAe);Lm((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});NQ.register(new _Ht);NQ.register(new vHt);NQ.register(new bHt);function Uf(n,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=n.getOptions(),l=(m,v)=>(v=v||1,u_.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,u_.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=n.getLineContent(t);let f=Uo(u),p=f;o.shouldIncrease(t)?(p=l(p),f=l(f)):o.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(CHt(n,m))continue;const v=n.getLineContent(m),w=Uo(v),b=p;o.shouldDecrease(m,b)&&(p=d(p),f=d(f)),w!==p&&h.push(ds.replaceMove(new mt(m,1,m,w.length+1),FMe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,b)?(f=l(f),p=f):o.shouldIndentNextLine(m,b)?p=l(p):p=f)}return h}function CHt(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===Ar.String:!1}const ih="vs/editor/contrib/indentation/browser/indentation",uce=class uce extends lt{constructor(){super({id:uce.ID,label:g(ih,0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:X.writable,metadata:{description:Be(ih,1,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new xHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};uce.ID="editor.action.indentationToSpaces";let fAe=uce;const gce=class gce extends lt{constructor(){super({id:gce.ID,label:g(ih,2,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:X.writable,metadata:{description:Be(ih,3,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new DHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};gce.ID="editor.action.indentationToTabs";let pAe=gce;class xFe extends lt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(On),s=e.get(Ai),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?g(ih,4,"Configured Tab Size"):d===r.tabSize?g(ih,5,"Default Tab Size"):d===a.tabSize?g(ih,6,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(ih,7,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const fce=class fce extends xFe{constructor(){super(!1,!1,{id:fce.ID,label:g(ih,8,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Be(ih,9,"Use indentation with tabs.")}})}};fce.ID="editor.action.indentUsingTabs";let mAe=fce;const pce=class pce extends xFe{constructor(){super(!0,!1,{id:pce.ID,label:g(ih,10,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Be(ih,11,"Use indentation with spaces.")}})}};pce.ID="editor.action.indentUsingSpaces";let _Ae=pce;const mce=class mce extends xFe{constructor(){super(!0,!0,{id:mce.ID,label:g(ih,12,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Be(ih,13,"Change the space size equivalent of the tab.")}})}};mce.ID="editor.action.changeTabDisplaySize";let vAe=mce;const _ce=class _ce extends lt{constructor(){super({id:_ce.ID,label:g(ih,14,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Be(ih,15,"Detect the indentation from content.")}})}run(e,t){const i=e.get(Ai),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}};_ce.ID="editor.action.detectIndentation";let wAe=_ce;class yHt extends lt{constructor(){super({id:"editor.action.reindentlines",label:g(ih,16,"Reindent Lines"),alias:"Reindent Lines",precondition:X.writable,metadata:{description:Be(ih,17,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=Yit(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class SHt extends lt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(ih,18,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:X.writable,metadata:{description:Be(ih,19,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=Yit(s,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class AHt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(O.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var FH;let bie=(FH=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Z,this.callOnModel=new Z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(x.autoIndent){this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||EHt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(x.autoIndent),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),c=[],l={shiftIndent:f=>u_.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>u_.unshiftIndent(f,f.length+1,o,r,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let h=i.getLineContent(d);if(!/\S/.test(h.substring(0,e.startColumn-1))){const f=w$(s,i,i.getLanguageId(),d,l,this._languageConfigurationService);if(f!==null){const p=Uo(h),m=Uf(f,o),v=Uf(p,o);if(m!==v){const w=e8(m,o,a);c.push({range:new O(d,1,d,p.length+1),text:w}),h=w+h.substr(p.length)}else{const w=MKe(i,d,this._languageConfigurationService);if(w===0||w===Pb.UNINDENT_MASK)return}}}const u=d;for(;di.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,v)=>i.getLanguageIdAtPosition(m,v)},getLineContent:m=>m===u?h:i.getLineContent(m)},i.getLanguageId(),d+1,l,this._languageConfigurationService);if(p!==null){const m=Uf(p,o),v=Uf(Uo(i.getLineContent(d+1)),o);if(m!==v){const w=m-v;for(let b=d+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),y=Uo(C),M=Uf(y,o)+w,k=e8(M,o,a);k!==y&&c.push({range:new O(b,1,b,y.length+1),text:k})}}}}if(c.length>0){this.editor.pushUndoStop();const f=new AHt(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===Ar.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},FH.ID="editor.contrib.autoIndentOnPaste",FH);bie=D([_(1,lo)],bie);function EHt(n,e){const t=i=>Vpt(n,i)===Ar.String;return t(e.getStartPosition())||t(e.getEndPosition())}function Jit(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;rthis.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!r.validate(this.editor))return;const l=O.lift(c.range);let d=c.range;const h=c.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(o=new mt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new kHt(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:UJ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Ta(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(bt)}).catch(bt)):Promise.resolve(void 0)}},UJ=S0,S0.ID="editor.contrib.inPlaceReplaceController",S0.DECORATION=Kt.register({description:"in-place-replace",className:"valueSetReplacement"}),S0);PV=UJ=D([_(1,kd)],PV);class LHt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(Xit,0,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Comma,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class THt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(Xit,1,"Replace with Next Value"),alias:"Replace with Next Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Period,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}vn(PV.ID,PV,mi.Lazy);Fe(LHt);Fe(THt);const RHt="vs/editor/contrib/lineSelection/browser/lineSelection";class MHt extends lt{constructor(){super({id:"expandLineSelection",label:g(RHt,0,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,Hi.Explicit,ud.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}Fe(MHt);class Zit{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=Cv.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumbere.getLanguageId(),s=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberb===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:b=>b===r.startLineNumber?e.getLineContent(h):e.getLineContent(b)},w=w$(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(w!==null){const b=Uo(e.getLineContent(h)),C=Uf(w,a),y=Uf(b,a);C!==y&&(f=e8(C,a,l)+this.trimStart(u))}}t.addEditOperation(new O(r.startLineNumber,1,r.startLineNumber,1),f+` -`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,m);else{const v={tokenization:{getLineTokens:b=>b===r.startLineNumber?e.tokenization.getLineTokens(h):b>=r.startLineNumber+1&&b<=r.endLineNumber+1?e.tokenization.getLineTokens(b-1):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:b=>b===r.startLineNumber?f:b>=r.startLineNumber+1&&b<=r.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b)},w=w$(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(w!==null){const b=Uo(e.getLineContent(r.startLineNumber)),C=Uf(w,a),y=Uf(b,a);if(C!==y){const S=C-y;this.getIndentEditsOfMovingBlock(e,t,r,a,l,S)}}}}else t.addEditOperation(new O(r.startLineNumber,1,r.startLineNumber,1),f+` -`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new O(h,1,h+1,1),null),t.addEditOperation(new O(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` -`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:m=>m===h?e.getLineContent(r.startLineNumber):e.getLineContent(m)},p=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,p);else{const m=w$(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=Uo(e.getLineContent(r.startLineNumber)),w=Uf(m,a),b=Uf(v,a);if(w!==b){const C=w-b;this.getIndentEditsOfMovingBlock(e,t,r,a,l,C)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:s=>u_.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>u_.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===qa.None||o.indentAction===qa.Indent?r=o.indentation+o.appendText:o.indentAction===qa.IndentOutdent?r=o.indentation:o.indentAction===qa.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const c=Uo(e.getLineContent(s));let l=Uo(r);const d=MKe(e,s,this._languageConfigurationService);d!==null&&d&Pb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Uf(l,i),u=Uf(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(Zv(r)>=0){const a=e.getLineMaxColumn(o),c=LW(this._autoIndent,e,new O(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(Zv(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LW(this._autoIndent,e,new O(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),Zv(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LW(this._autoIndent,e,new O(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(r6.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function NHt(n,e,t){const i=ent(n,e,t);return i?ds.replace(new O(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` -`)):null}const wa="vs/editor/contrib/linesOperations/browser/linesOperations";class tnt extends lt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>O.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;rnew oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Re),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new zOt(o,s,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};vce.ID="editor.action.trimTrailingWhitespace";let CAe=vce;class zHt extends lt{constructor(){super({id:"editor.action.deleteLines",label:g(wa,14,"Delete Line"),alias:"Delete Line",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyK,weight:ye.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=s.getLineMaxColumn(h)),r.push(ds.replace(new mt(h,f,u,p),"")),a.push(new mt(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class $Ht extends lt{constructor(){super({id:"editor.action.indentLines",label:g(wa,15,"Indent Line"),alias:"Indent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketRight,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class GHt extends lt{constructor(){super({id:"editor.action.outdentLines",label:g(wa,16,"Outdent Line"),alias:"Outdent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketLeft,weight:ye.EditorContrib}})}run(e,t){TW.Outdent.runEditorCommand(e,t,null)}}class qHt extends lt{constructor(){super({id:"editor.action.insertLineBefore",label:g(wa,17,"Insert Line Above"),alias:"Insert Line Above",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class QHt extends lt{constructor(){super({id:"editor.action.insertLineAfter",label:g(wa,18,"Insert Line Below"),alias:"Insert Line Below",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class snt extends lt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let c=0,l=s.length-1;cds.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class jHt extends snt{constructor(){super({id:"deleteAllLeft",label:g(wa,19,"Delete All Left"),alias:"Delete All Left",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.CtrlCmd|E.Backspace},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new mt(c,r.startColumn,c,r.startColumn)}else a=new mt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(O.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new O(r,a,o.startLineNumber,1)}else return new O(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new O(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class KHt extends snt{constructor(){super({id:"deleteAllRight",label:g(wa,20,"Delete All Right"),alias:"Delete All Right",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyK,secondary:[V.CtrlCmd|E.Delete]},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new O(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new O(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(O.compareRangesUsingStarts),s}}class YHt extends lt{constructor(){super({id:"editor.action.joinLines",label:g(wa,21,"Join Lines"),alias:"Join Lines",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyJ},weight:ye.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(O.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(s.equalsSelection(u)&&(s=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=s,h=0;for(let u=0,f=o.length;u=1){let z=!0;S===""&&(z=!1),z&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(z=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const U=F.substr(N-1);S+=(z?" ":"")+U,z?w=U.length+1:w=U.length}else w=0}const M=new O(m,v,b,C);if(!M.isEmpty()){let k;p.isEmpty()?(c.push(ds.replace(M,S)),k=new mt(M.startLineNumber-h,S.length-w+1,m-h,S.length-w+1)):p.startLineNumber===p.endLineNumber?(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,S.length-y)),O.intersectRanges(M,s)!==null?d=k:l.push(k)}h+=M.endLineNumber-M.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class JHt extends lt{constructor(){super({id:"editor.action.transpose",label:g(wa,22,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:X.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===s.getLineCount())continue;const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new zd(new mt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new OMe(h,u,new mt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class LO extends lt{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(x.wordSeparators),r=[];for(const a of i)if(a.isEmpty()){const c=a.getStartPosition(),l=t.getConfiguredWordAtPosition(c);if(!l)continue;const d=new O(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=s.getValueInRange(d);r.push(ds.replace(d,this._modifyText(h,o)))}else{const c=s.getValueInRange(a);r.push(ds.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class XHt extends LO{constructor(){super({id:"editor.action.transformToUppercase",label:g(wa,23,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class ZHt extends LO{constructor(){super({id:"editor.action.transformToLowercase",label:g(wa,24,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class vx{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const wce=class wce extends LO{constructor(){super({id:"editor.action.transformToTitlecase",label:g(wa,25,"Transform to Title Case"),alias:"Transform to Title Case",precondition:X.writable})}_modifyText(e,t){const i=wce.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};wce.titleBoundary=new vx("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let Cie=wce;const J2=class J2 extends LO{constructor(){super({id:"editor.action.transformToSnakecase",label:g(wa,26,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:X.writable})}_modifyText(e,t){const i=J2.caseBoundary.get(),s=J2.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};J2.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),J2.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let t8=J2;const bce=class bce extends LO{constructor(){super({id:"editor.action.transformToCamelcase",label:g(wa,27,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:X.writable})}_modifyText(e,t){const i=bce.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};bce.wordBoundary=new vx("[_\\s-]","gm");let yie=bce;const X2=class X2 extends LO{constructor(){super({id:"editor.action.transformToPascalcase",label:g(wa,28,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:X.writable})}_modifyText(e,t){const i=X2.wordBoundary.get(),s=X2.wordBoundaryToMaintain.get();return!i||!s?e:e.split(s).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};X2.wordBoundary=new vx("[_\\s-]","gm"),X2.wordBoundaryToMaintain=new vx("(?<=\\.)","gm");let Sie=X2;const fk=class fk extends LO{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(wa,29,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:X.writable})}_modifyText(e,t){const i=fk.caseBoundary.get(),s=fk.singleLetters.get(),o=fk.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};fk.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),fk.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),fk.underscoreBoundary=new vx("(\\S)(_)(\\S)","gm");let Aie=fk;Fe(PHt);Fe(FHt);Fe(OHt);Fe(BHt);Fe(WHt);Fe(HHt);Fe(UHt);Fe(VHt);Fe(CAe);Fe(zHt);Fe($Ht);Fe(GHt);Fe(qHt);Fe(QHt);Fe(jHt);Fe(KHt);Fe(YHt);Fe(JHt);Fe(XHt);Fe(ZHt);t8.caseBoundary.isSupported()&&t8.singleLetters.isSupported()&&Fe(t8);yie.wordBoundary.isSupported()&&Fe(yie);Sie.wordBoundary.isSupported()&&Fe(Sie);Cie.titleBoundary.isSupported()&&Fe(Cie);Aie.isSupported()&&Fe(Aie);var eUt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";Ct(eUt,{});var VJ;const ont="vs/editor/contrib/linkedEditing/browser/linkedEditing",rnt=new Y("LinkedEditingInputVisible",!1),tUt="linked-editing-decoration";var A0;let FV=(A0=class extends ${static get(e){return e.getContribution(VJ.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=rnt.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(x.linkedEditing)||r.hasChanged(x.renameOnType))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(x.linkedEditing)||this._editor.getOption(x.renameOnType))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(T.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new Lu(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Lu(0),a=c=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const l=this._currentDecorations.getRange(0);if(l&&c.changes.every(d=>l.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=this._currentRequestCts=new ai;try{const r=new ao(!1),a=await ant(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let c=[];a?.ranges&&(c=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let l=!1;for(let h=0,u=c.length;h({range:h,options:VJ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Na(r)||bt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},VJ=A0,A0.ID="editor.contrib.linkedEditing",A0.DECORATION=Kt.register({description:"linked-editing",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:tUt}),A0);FV=VJ=D([_(1,Pe),_(2,ht),_(3,lo),_(4,B_)],FV);class iUt extends lt{constructor(){super({id:"editor.action.linkedEditing",label:g(ont,0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F2,weight:ye.EditorContrib}})}runCommand(e,t){const i=e.get(jt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=FV.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const nUt=Jc.bindToContribution(FV.get);Ke(new nUt({id:"cancelLinkedEditingInput",precondition:rnt,handler:n=>n.clearRanges(),kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib+99,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));function ant(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){er(r);return}}),o=>!!o&&mo(o?.ranges))}B("editor.linkedEditingBackground",{dark:fe.fromHex("#f00").transparent(.3),light:fe.fromHex("#f00").transparent(.3),hcDark:fe.fromHex("#f00").transparent(.3),hcLight:fe.white},g(ont,1,"Background color when the editor auto renames on type."));nA("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(ht);return ant(i,e,t,qe.None)});vn(FV.ID,FV,mi.AfterFirstRender);Fe(iUt);const Cce=class Cce extends ${static get(e){return e.getContribution(Cce.ID)}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(x.stopRenderingLineAfter);i>=0&&t.target.type===Mt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};Cce.ID="editor.contrib.longLinesHelper";let Eie=Cce;vn(Eie.ID,Eie,mi.BeforeFirstInteraction);var sUt=".monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);border:1px solid var(--vscode-editor-selectionHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);border:1px solid var(--vscode-editor-wordHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);border:1px solid var(--vscode-editor-wordHighlightStrongBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);border:1px solid var(--vscode-editor-wordHighlightTextBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}";Ct(sUt,{});const lD="vs/editor/contrib/wordHighlighter/browser/highlightDecorations",GK=B("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(lD,0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(lD,1,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightTextBackground",{light:GK,dark:GK,hcDark:GK,hcLight:GK},g(lD,2,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const qK=B("editor.wordHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,3,"Border color of a symbol during read-access, like reading a variable."));B("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,4,"Border color of a symbol during write-access, like writing to a variable."));B("editor.wordHighlightTextBorder",{light:qK,dark:qK,hcDark:qK,hcLight:qK},g(lD,5,"Border color of a textual occurrence for a symbol."));const oUt=B("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(lD,6,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),rUt=B("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},g(lD,7,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aUt=B("editorOverviewRuler.wordHighlightTextForeground",{dark:g3,light:g3,hcDark:g3,hcLight:g3},g(lD,8,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),cUt=Kt.register({description:"word-highlight-strong",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:Nr(rUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),lUt=Kt.register({description:"word-highlight-text",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:Nr(aUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),dUt=Kt.register({description:"selection-highlight-overview",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:Nr(g3),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),hUt=Kt.register({description:"selection-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),uUt=Kt.register({description:"word-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:Nr(oUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}});function gUt(n){return n===D9.Write?cUt:n===D9.Text?lUt:uUt}function fUt(n){return n?hUt:dUt}Lm((n,e)=>{const t=n.getColor(IMe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var yAe;const kl="vs/editor/contrib/multicursor/browser/multicursor";function uL(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?g(kl,0,"Cursor added: {0}",i):g(kl,1,"Cursors added: {0}",i);Cu(s)}}class pUt extends lt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(kl,2,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.UpArrow,linux:{primary:V.Shift|V.Alt|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,3,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Hi.Explicit,ud.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),uL(r,o.getCursorStates())}}class mUt extends lt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(kl,4,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.DownArrow,linux:{primary:V.Shift|V.Alt|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,5,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Hi.Explicit,ud.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),uL(r,o.getCursorStates())}}class _Ut extends lt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(kl,6,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyI,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,7,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new mt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),uL(r,o.getCursorStates())}}class vUt extends lt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(kl,8,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=s;c++)o.push(new mt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),uL(a,r.getCursorStates())}}class wUt extends lt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(kl,9,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new mt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),uL(r,o.getCursorStates())}}class QK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class a6{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new a6(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const c=e.getSelection();let l,d=null;if(c.isEmpty()){const h=e.getConfiguredWordAtPosition(c.getStartPosition());if(!h)return null;l=h.word,d=new mt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` -`);return new a6(e,t,s,l,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}}const yce=class yce extends ${static get(e){return e.getContribution(yce.ID)}constructor(e){super(),this._sessionDispose=this._register(new Z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=a6.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=pu.True,i.matchCaseOverride=pu.True,i.isRegexOverride=pu.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:pu.NotSet,matchCaseOverride:pu.NotSet,isRegexOverride:pu.NotSet};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new mt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!cnt(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};yce.ID="editor.contrib.multiCursorController";let OV=yce;class Vz extends lt{run(e,t){const i=OV.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=vf.get(t);if(r)this._run(i,r);else{const a=e.get(be).createInstance(vf,t);this._run(i,a),a.dispose()}uL(o,s.getCursorStates())}}}class bUt extends Vz{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(kl,10,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.KeyD,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,11,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class CUt extends Vz{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(kl,12,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,13,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class yUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(kl,14,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyD),weight:ye.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class SUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(kl,15,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class AUt extends Vz{constructor(){super({id:"editor.action.selectHighlights",label:g(kl,16,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.KeyL,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,17,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class EUt extends Vz{constructor(){super({id:"editor.action.changeAll",label:g(kl,18,"Change All Occurrences"),alias:"Change All Occurrences",precondition:ge.and(X.writable,X.editorTextFocus),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class xUt{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(O.compareRangesUsingStarts)),this._cachedFindMatches}}var VN;let xie=(VN=class extends ${constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(x.selectionHighlight),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new yn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===Hi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=vf.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(yAe._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=OV.get(i);if(!o)return null;const r=vf.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const u=r.getState().matchCase;if(!cnt(i.getModel(),d,u))return null}a=a6.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=r.getState(),l=c.matchCase;if(c.isRevealed){let d=c.searchString;l||(d=d.toLowerCase());let h=a.searchText;if(l||(h=h.toLowerCase()),d===h&&a.matchCase===c.matchCase&&a.wholeWord===c.wholeWord&&!c.isRegex)return null}return new xUt(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(x.wordSeparators):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(O.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=s.length;l=u)o.push(f),l++;else{const p=O.compareRangesUsingStarts(f,s[d]);p<0?((s[d].isEmpty()||!O.areIntersecting(f,s[d]))&&o.push(f),l++):(p>0||l++,d++)}}const r=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,c=o.map(l=>({range:l,options:fUt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},yAe=VN,VN.ID="editor.contrib.selectionHighlighter",VN);xie=yAe=D([_(1,ht)],xie);function cnt(n,e,t){const i=wze(n,e[0],!t);for(let s=1,o=e.length;sthis.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;let a=this.model.range?.read(s);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const c=(a?a.startLineNumber===a.endLineNumber:!0)&&r.parts.length===1&&r.parts[0].lines.length===1,l=r.parts.length===1&&r.parts[0].lines.every(b=>b.length===0),d=[],h=[];function u(b,C){if(h.length>0){const y=h[h.length-1];C&&y.decorations.push(new ig(y.content.length+1,y.content.length+1+b[0].length,C,Mc.Regular)),y.content+=b[0],b=b.slice(1)}for(const y of b)h.push({content:y,decorations:C?[new ig(1,y.length+1,C,Mc.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l){for(const b of r.parts){let C=b.lines;a&&!c&&(u(C,ype),C=[]),p===void 0?(d.push({column:b.column,text:C[0],preview:b.preview}),C=C.slice(1)):u([f.substring(m,b.column-1)],void 0),C.length>0&&(u(C,ype),p===void 0&&b.column<=f.length&&(p=b.column)),m=b.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new Jet(p,f.length+1):void 0,w=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:w,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l,backgroundColoring:this.model.backgroundColoring.read(s)}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];if(o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const l=o.range.endLineNumber-o.range.startLineNumber;for(let d=0;d{const o=this.uiState.read(s);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};SAe=D([_(2,Di)],SAe);var NUt=".monaco-editor .inlineEditHints.withBorder{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);z-index:39}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}";Ct(NUt,{});var zJ;let AAe=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.widget.model.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(xm((s,o)=>{if(!this.model.read(s)||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(Die,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};AAe=D([_(2,be)],AAe);var E0;let Die=(E0=class extends ${static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,s,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${zJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(s.createInstance(EAe,this.nodes.toolBar,this.editor,Te.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof id)return s.createInstance(PUt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{zJ._dropDownVisible=a})),this._register(Ni(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(Ni(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof id&&c.push(h);c.length>0&&c.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},zJ=E0,E0._dropDownVisible=!1,E0.id=0,E0);Die=zJ=D([_(3,be),_(4,Pe),_(5,_c)],Die);class PUt extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,$c,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let EAe=class extends lV{constructor(e,t,i,s,o,r,a,c,l,d){super(e,{resetMenu:i,...s},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=s,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};EAe=D([_(4,_c),_(5,Pe),_(6,Vr),_(7,ti),_(8,ji),_(9,rn)],EAe);var XL;class FUt{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}var Ab;let zh=(Ab=class extends ${static get(e){return e.getContribution(XL.ID)}constructor(e,t,i,s,o,r){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=s,this._commandService=o,this._configurationService=r,this._isVisibleContext=XL.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=XL.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(_7(this,void 0)),this._isAccepting=xi(this,!1),this._enabled=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily),this._backgroundColoring=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).backgroundColoring);const a=Bh("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Ni(u=>{this._enabled.read(u)&&(a.read(u),!this._isAccepting.read(u)&&this.getInlineEdit(e,!0))}));const c=Wn(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Ni(u=>{if(!this._enabled.read(u))return;const f=c.read(u);f&&this.checkCursorPosition(f)})),this._register(Ni(u=>{const f=this._currentEdit.read(u);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const p=e.getPosition();p&&this.checkCursorPosition(p)}));const l=Bh("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Ni(async u=>{this._enabled.read(u)&&(l.read(u),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const d=Bh("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Ni(u=>{this._enabled.read(u)&&(d.read(u),this.getInlineEdit(e,!0))}));const h=this._register(uje());this._register(Ni(u=>{const f=this._fontFamily.read(u);h.setStyle(f===""||f==="default"?"":` +`)),primaryButton:g(774,"&&Remove")});if(!l)return;const d=new Set;for(const h of c)t.remove(h.key,h.scope),d.add(h.scope);for(const h of d)await t.optimize(h)}};Hse.SIZE_THRESHOLD=1024*16;let _we=Hse,P1,HX=new Set;const TT=new Q("dirtyWorkingCopies","stopped");class COt extends li{constructor(){super({id:"workbench.action.startTrackDisposables",title:Pe(775,"Start Tracking Disposables"),category:ca.Developer,f1:!0,precondition:he.and(TT.isEqualTo("pending").negate(),TT.isEqualTo("started").negate())})}run(e){TT.bindTo(e.get(Le)).set("started"),HX.clear(),P1=new jge,B6e(P1)}}class SOt extends li{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Pe(776,"Snapshot Tracked Disposables"),category:ca.Developer,f1:!0,precondition:TT.isEqualTo("started")})}run(e){TT.bindTo(e.get(Le)).set("pending"),HX=new Set(P1?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class AOt extends li{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Pe(777,"Stop Tracking Disposables"),category:ca.Developer,f1:!0,precondition:TT.isEqualTo("pending")})}run(e){const t=e.get(ei);if(TT.bindTo(e.get(Le)).set("stopped"),P1){const n=new Set;for(const r of new Set(P1.computeLeakingDisposables(1e3)?.leaks)??[])HX.has(r.value)&&n.add(r);const o=P1.computeLeakingDisposables(1e3,Array.from(n));o&&t.openEditor({resource:void 0,contents:o.details})}B6e(null),P1=void 0,HX.clear()}}At(bOt);At(bF);At(wOt);At(yOt);At(_we);vOt.commit||(At(COt),At(SOt),At(AOt));const EOt=Qe.as(Nn.Configuration);EOt.registerConfiguration({id:"screencastMode",order:9,title:g(778,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(779,"Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")},"screencastMode.fontSize":{type:"number",default:56,minimum:20,maximum:100,description:g(780,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(781,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(782,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(783,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(784,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(785,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(786,"Show single editor cursor move commands.")}},default:{showKeys:!0,showKeybindings:!0,showCommands:!0,showCommandGroups:!1,showSingleEditorCursorMoves:!0},additionalProperties:!1},"screencastMode.keyboardOverlayTimeout":{type:"number",default:800,minimum:500,maximum:5e3,description:g(787,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(788,"Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")},"screencastMode.mouseIndicatorSize":{type:"number",default:20,minimum:20,maximum:100,description:g(789,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});At(BRt);At(kXe);At(IXe);jn.appendMenuItem(_e.EditorTitle,{command:{id:new IXe().desc.id,title:g(1324,"Use Inline View When Space Is Limited"),toggled:he.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:he.has("isInDiffEditor")},order:11,group:"1_diff",when:he.and(J.diffEditorRenderSideBySideInlineBreakpointReached,he.has("isInDiffEditor"))});jn.appendMenuItem(_e.EditorTitle,{command:{id:new kXe().desc.id,title:g(1325,"Show Moved Code Blocks"),icon:ve.move,toggled:SN.create("config.diffEditor.experimental.showMoves",!0),precondition:he.has("isInDiffEditor")},order:10,group:"1_diff",when:he.has("isInDiffEditor")});At(jve);for(const s of[{icon:ve.arrowRight,key:J.diffEditorInlineMode.toNegated()},{icon:ve.discard,key:J.diffEditorInlineMode}])jn.appendMenuItem(_e.DiffEditorHunkToolbar,{command:{id:new jve().desc.id,title:g(1326,"Revert Block"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),jn.appendMenuItem(_e.DiffEditorSelectionToolbar,{command:{id:new jve().desc.id,title:g(1327,"Revert Selection"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"});At(WRt);At(HRt);At(URt);At(VRt);jn.appendMenuItem(_e.EditorTitle,{command:{id:mW.id,title:g(1328,"Open Accessible Diff Viewer"),precondition:he.has("isInDiffEditor")},order:10,group:"2_diff",when:he.and(J.accessibleDiffViewerVisible.negate(),he.has("isInDiffEditor"))});_t.registerCommandAlias("editor.action.diffReview.next",mW.id);At(mW);_t.registerCommandAlias("editor.action.diffReview.prev",z3.id);At(z3);var xOt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";ut(xOt,{});var vwe;const pce=new Q("selectionAnchorSet",!1);var VL;let tI=(VL=class{static get(e){return e.getContribution(vwe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=pce.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(dt.fromPositions(e,e),{description:"selection-anchor",stickiness:ni.NeverGrowsWhenTypingAtEdges,hoverMessage:new Mt().appendText(g(1329,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Mr(g(1330,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(dt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},vwe=VL,VL.ID="editor.contrib.selectionAnchorController",VL);tI=vwe=D([_(1,Le)],tI);class DOt extends tt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(1331,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyB),weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.setSelectionAnchor()}}class kOt extends tt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(1332,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:pce})}async run(e,t){tI.get(t)?.goToSelectionAnchor()}}class IOt extends tt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(1333,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:pce,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyK),weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.selectFromAnchorToCursor()}}class TOt extends tt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(1334,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:pce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.Escape,weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.cancelSelectionAnchor()}}on(tI.ID,tI,ri.Lazy);Re(DOt);Re(kOt);Re(IOt);Re(TOt);var LOt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";ut(LOt,{});const ROt=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",g(1337,"Overview ruler marker color for matching brackets."));class MOt extends tt{constructor(){super({id:"editor.action.jumpToBracket",label:g(1338,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Backslash,weight:Ae.EditorContrib}})}run(e,t){BA.get(t)?.jumpToBracket()}}class NOt extends tt{constructor(){super({id:"editor.action.selectToBracket",label:g(1339,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Pe(1340,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),BA.get(t)?.selectToBracket(n)}}class POt extends tt{constructor(){super({id:"editor.action.removeBrackets",label:g(1341,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.Backspace,weight:Ae.EditorContrib}})}run(e,t){BA.get(t)?.removeBrackets(this.id)}}class FOt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const KE=class KE extends V{static get(e){return e.getContribution(KE.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new cn(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(x.matchBrackets),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(x.matchBrackets)&&(this._matchBrackets=this._editor.getOption(x.matchBrackets),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(n);c&&c.range&&(r=c.range.getStartPosition())}}return r?new dt(r.lineNumber,r.column,r.lineNumber,r.column):new dt(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const l=t.bracketPairs.findNextBracket(o);l&&l.range&&(r=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(F.compareRangesUsingStarts);const[l,d]=r;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=c,c=h}}a&&c&&i.push(new dt(a.lineNumber,a.column,c.lineNumber,c.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(oe.compare);const a=[];let c=0,l=0;const d=n.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Re(HOt);const $M="9_cutcopypaste",UOt=ad||document.queryCommandSupported("cut"),fet=ad||document.queryCommandSupported("copy"),VOt=typeof navigator.clipboard>"u"||rf?document.queryCommandSupported("paste"):!0;function QMe(s){return s.register(),s}const zOt=UOt?QMe(new wI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyX,win:{primary:U.CtrlCmd|S.KeyX,secondary:[U.Shift|S.Delete]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1346,"Cu&&t"),order:1},{menuId:_e.EditorContext,group:$M,title:g(1347,"Cut"),when:J.writable,order:1},{menuId:_e.CommandPalette,group:"",title:g(1347,"Cut"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1347,"Cut"),when:J.writable,order:1}]})):void 0,$Ot=fet?QMe(new wI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyC,win:{primary:U.CtrlCmd|S.KeyC,secondary:[U.CtrlCmd|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1348,"&&Copy"),order:2},{menuId:_e.EditorContext,group:$M,title:g(1349,"Copy"),order:2},{menuId:_e.CommandPalette,group:"",title:g(1349,"Copy"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1349,"Copy"),order:2}]})):void 0;jn.appendMenuItem(_e.MenubarEditMenu,{submenu:_e.MenubarCopy,title:Pe(1350,"Copy As"),group:"2_ccp",order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextCopy,title:Pe(1350,"Copy As"),group:$M,order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1,when:he.and(he.notEquals("resourceScheme","output"),J.editorTextFocus)});jn.appendMenuItem(_e.ExplorerContext,{submenu:_e.ExplorerContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1});const eue=VOt?QMe(new wI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyV,win:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},linux:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1352,"&&Paste"),order:4},{menuId:_e.EditorContext,group:$M,title:g(1353,"Paste"),when:J.writable,order:4},{menuId:_e.CommandPalette,group:"",title:g(1353,"Paste"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1353,"Paste"),when:J.writable,order:4}]})):void 0;class GOt extends tt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(1354,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(Xpe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Xpe.forceCopyWithSyntaxHighlighting=!1)}}function pet(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Kt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(x.emptySelectionClipboard),r=n.getSelection();return r&&r.isEmpty()&&!o||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(Hu().execCommand(e),!0)))}pet(zOt,"cut");pet($Ot,"copy");eue&&(eue.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(Kt),i=s.get(dg),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?n.getContainerDomNode().ownerDocument.execCommand("paste")?sC.get(n)?.finishedPaste()??Promise.resolve():Wn?(async()=>{const r=await i.readText();if(r!==""){const a=J8.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=n.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),n.trigger("keyboard",oc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),eue.addImplementation(0,"generic-dom",(s,e)=>(Hu().execCommand("paste"),!0)));fet&&Re(GOt);function tG(s){return he.regex(yZe.keys()[0],new RegExp("(\\s|^)"+Rh(s.value)+"\\b"))}const jMe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(5e3,"Kind of the code action to run.")},apply:{type:"string",description:g(5001,"Controls when the returned actions are applied."),default:sd.IfSingle,enum:[sd.First,sd.IfSingle,sd.Never],enumDescriptions:[g(5002,"Always apply the first returned code action."),g(5003,"Apply the first returned code action if it is the only one."),g(5004,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(5005,"Controls if only preferred code actions should be returned.")}}};function KN(s,e,t,i,n=sg.Default){s.hasModel()&&WM.get(s)?.manualTriggerAtCurrentPosition(e,n,t,i)}class KOt extends tt{constructor(){super({id:kMe,label:g(5006,"Quick Fix..."),alias:"Quick Fix...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Period,weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5007,"No code actions available"),void 0,void 0,sg.QuickFix)}}class qOt extends hc{constructor(){super({id:DMe,precondition:he.and(J.writable,J.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:jMe}]}})}runEditorCommand(e,t,i){const n=qw.fromUser(i,{kind:Yn.Empty,apply:sd.IfSingle});return KN(t,typeof i?.kind=="string"?n.preferred?g(5008,"No preferred code actions for '{0}' available",i.kind):g(5009,"No code actions for '{0}' available",i.kind):n.preferred?g(5010,"No preferred code actions available"):g(5011,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class QOt extends tt{constructor(){super({id:IMe,label:g(5012,"Refactor..."),alias:"Refactor...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyR,mac:{primary:U.WinCtrl|U.Shift|S.KeyR},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:he.and(J.writable,tG(ys.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:jMe}]}})}run(e,t,i){const n=qw.fromUser(i,{kind:ys.Refactor,apply:sd.Never});return KN(t,typeof i?.kind=="string"?n.preferred?g(5013,"No preferred refactorings for '{0}' available",i.kind):g(5014,"No refactorings for '{0}' available",i.kind):n.preferred?g(5015,"No preferred refactorings available"):g(5016,"No refactorings available"),{include:ys.Refactor.contains(n.kind)?n.kind:Yn.None,onlyIncludePreferredActions:n.preferred},n.apply,sg.Refactor)}}class jOt extends tt{constructor(){super({id:TMe,label:g(5017,"Source Action..."),alias:"Source Action...",precondition:he.and(J.writable,J.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:he.and(J.writable,tG(ys.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:jMe}]}})}run(e,t,i){const n=qw.fromUser(i,{kind:ys.Source,apply:sd.Never});return KN(t,typeof i?.kind=="string"?n.preferred?g(5018,"No preferred source actions for '{0}' available",i.kind):g(5019,"No source actions for '{0}' available",i.kind):n.preferred?g(5020,"No preferred source actions available"):g(5021,"No source actions available"),{include:ys.Source.contains(n.kind)?n.kind:Yn.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,sg.SourceAction)}}class YOt extends tt{constructor(){super({id:Ibe,label:g(5022,"Organize Imports"),alias:"Organize Imports",precondition:he.and(J.writable,tG(ys.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|U.Alt|S.KeyO,weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5023,"No organize imports action available"),{include:ys.SourceOrganizeImports,includeSourceActions:!0},sd.IfSingle,sg.OrganizeImports)}}class JOt extends tt{constructor(){super({id:Tbe,label:g(5024,"Fix All"),alias:"Fix All",precondition:he.and(J.writable,tG(ys.SourceFixAll))})}run(e,t){return KN(t,g(5025,"No fix all action available"),{include:ys.SourceFixAll,includeSourceActions:!0},sd.IfSingle,sg.FixAll)}}class XOt extends tt{constructor(){super({id:pZe,label:g(5026,"Auto Fix..."),alias:"Auto Fix...",precondition:he.and(J.writable,tG(ys.QuickFix)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Alt|U.Shift|S.Period,mac:{primary:U.CtrlCmd|U.Alt|S.Period},weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5027,"No auto fixes available"),{include:ys.QuickFix,onlyIncludePreferredActions:!0},sd.IfSingle,sg.AutoFix)}}on(WM.ID,WM,ri.Eventually);on(Q3.ID,Q3,ri.Lazy);Re(KOt);Re(QOt);Re(jOt);Re(YOt);Re(XOt);Re(JOt);qe(new qOt);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1355,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1356,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,markdownDescription:g(1357,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class bwe{constructor(){this.lenses=[],this._disposables=new Z}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function met(s,e,t){const i=s.ordered(e),n=new Map,o=new bwe,r=i.map(async(a,c)=>{n.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){No(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:n.get(a.provider)n.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}_t.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;Tt(N.isUri(t)),Tt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)throw Pi();const r=[],a=new Z;return met(n,o,He.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,He.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const _et=ae("ICodeLensCache");class MUe{constructor(e,t){this.lineCount=e,this.data=t}}let wwe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new um(20,.75);const t="codelens/cache";XP(si,()=>e.remove(t,Ie.WORKSPACE));const i="codelens/cache2",n=e.get(i,Ie.WORKSPACE,"{}");this._deserialize(n);const o=M.filter(e.onWillSaveState,r=>r.reason===wy.SHUTDOWN);M.once(o)(r=>{e.store(i,this._serialize(),Ie.WORKSPACE,an.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new bwe;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new MUe(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const o of i.data.lenses)n.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],o=[];for(const a of n.lines)o.push({range:new F(a,1,a,11)});const r=new bwe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new MUe(n.lineCount,r))}}catch{}}};wwe=D([_(0,$i)],wwe);ce(_et,wwe,qt.Delayed);var ZOt=".monaco-editor .codelens-decoration{font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);color:var(--vscode-editorCodeLens-foreground);display:inline-block;font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);overflow:hidden;padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);text-overflow:ellipsis;white-space:nowrap}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{user-select:none;-webkit-user-select:none;vertical-align:sub;white-space:nowrap}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer}.monaco-editor .codelens-decoration>a:hover,.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);vertical-align:middle}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}";ut(ZOt,{});class eBt{constructor(e,t,i){this.afterColumn=Un.MAX_SAFE_SMALL_INTEGER,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const qz=class qz{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${qz._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:NUe},h=>this._decorationIds[d]=h),a?a=F.plusRange(a,l.symbol.range):a=F.lift(l.symbol.range)}),this._viewZone=new eBt(a.startLineNumber-1,o,r),this._viewZoneId=n.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new ywe(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&F.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:NUe},o=>this._decorationIds[n]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;tthis._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(x.fontInfo)||a.hasChanged(x.codeLensFontSize)||a.hasChanged(x.codeLensFontFamily))&&this._updateLensStyle(),a.hasChanged(x.codeLens)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(x.lineHeight)/this._editor.getOption(x.fontSize));let t=this._editor.getOption(x.codeLensFontSize);return(!t||t<5)&&(t=this._editor.getOption(x.fontSize)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(x.codeLensFontFamily),n=this._editor.getOption(x.fontInfo),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",cd.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(x.codeLens)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&jy(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new cn(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Rr(o=>met(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const r=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},vt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(o=>{const r=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?r.push(l):(l.update(o),a=l.getLineNumber())});const c=new tue;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const n=vm.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==Rt.CONTENT_WIDGET)return;let o=n.target.element;if(o?.tagName==="SPAN"&&(o=o.parentElement),o?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new tue;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(n&&n[n.length-1].symbol.range.startLineNumber===c?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=vm.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new tue;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0)return;const n=Date.now(),o=Rr(r=>{const a=t.map((c,l)=>{const d=new Array(c.length),h=c.map((u,f)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(p=>{d[f]=p},No):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{vt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},PB.ID="css.editor.codeLens",PB);n9=D([_(1,it),_(2,Sp),_(3,vi),_(4,bi),_(5,_et)],n9);on(n9.ID,n9,ri.AfterFirstRender);Re(class extends tt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:J.hasCodeLensProvider,label:g(1358,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(In),n=e.get(vi),o=e.get(bi),r=t.getSelection().positionLineNumber,a=t.getContribution(n9.ID);if(!a)return;const c=await a.getModel();if(!c)return;const l=[];for(const u of c.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(l.length===0)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:g(1359,"Select a command")});if(!d)return;let h=d.command;if(c.isDisposed){const f=(await a.getModel())?.lenses.find(p=>p.symbol.range.startLineNumber===r&&p.symbol.command?.title===h.title);if(!f||!f.symbol.command)return;h=f.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});const Use=class Use extends V{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(x.colorDecoratorsActivatedOn);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==Rt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==OZe||!i.range)return;const n=this._editor.getContribution(Pa.ID);if(n&&!n.isColorPickerVisible){const o=new F(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(o,oC.Immediate,FA.Mouse,!1,!0)}}};Use.ID="editor.contrib.colorContribution",Use.RECOMPUTE_TIME=1e3;let UX=Use;on(UX.ID,UX,ri.BeforeFirstInteraction);GN.register(Y3);var Cwe,Swe,zL;let GM=(zL=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=J.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=J.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new Awe(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(Cwe.ID)}},Cwe=zL,zL.ID="editor.contrib.standaloneColorPickerController",zL);GM=Cwe=D([_(1,Le),_(2,gi),_(3,Ut),_(4,we),_(5,it),_(6,Vs)],GM);on(GM.ID,GM,ri.AfterFirstRender);const FUe=8,tBt=22;var $L;let Awe=($L=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=c,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(J3,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Ac(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const f=u.target.element?.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Swe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(x.hover).above;return{position:this._position,secondaryPosition:this._position,preference:e?[es.ABOVE,es.BELOW]:[es.BELOW,es.ABOVE],positionAffinity:Io.None}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new iBt(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new MMe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new yX(this._keybindingService)),o={fragment:i,statusBar:n,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const r=this._standaloneColorPickerParticipant.renderHoverParts(o,[e]);if(!r)return;this._register(r.disposables);const a=r.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),a.layout();const c=a.body,l=c.saturationBox.domNode.clientWidth,d=c.domNode.clientWidth-l-tBt-FUe,h=a.body.enterButton;h?.onClicked(()=>{this.updateEditor(),this.hide()});const u=a.header,f=u.pickedColorNode;f.style.width=l+FUe+"px";const p=u.originalColorNode;p.style.width=d+"px",a.header.closeButton?.onClicked(()=>{this.hide()}),t&&(h&&(h.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},Swe=$L,$L.ID="editor.contrib.standaloneColorPickerWidget",$L);Awe=Swe=D([_(3,we),_(4,gi),_(5,Ut),_(6,it),_(7,Vs)],Awe);class iBt{constructor(e,t){this.value=e,this.foundInEditor=t}}class nBt extends gf{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Pe(1360,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(1361,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:_e.CommandPalette}],metadata:{description:Pe(1362,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){GM.get(t)?.showOrFocus()}}class sBt extends tt{constructor(){super({id:"editor.action.hideColorPicker",label:g(1363,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:J.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:S.Escape,weight:Ae.EditorContrib},metadata:{description:Pe(1364,"Hide the standalone color picker.")}})}run(e,t){GM.get(t)?.hide()}}class oBt extends tt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(1365,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:J.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:S.Enter,weight:Ae.EditorContrib},metadata:{description:Pe(1366,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){GM.get(t)?.insertColor()}}Re(sBt);Re(oBt);At(nBt);class Px{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,o=e.length;if(i+n>o)return!1;for(let r=0;r=B.A&&a<=B.Z&&a+32===c)&&!(c>=B.A&&c<=B.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,o,r){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(l);let f=h.lastIndexOf(t,c-1+t.length),p=u.indexOf(i,d-1-i.length);if(f!==-1&&p!==-1)if(a===l)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),b=u.substring(0,p);(v.indexOf(i)>=0||b.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(n&&f+t.length0&&u.charCodeAt(p-1)===B.Space&&(i=" "+i,p-=1),m=Px._createRemoveBlockCommentOperations(new F(a,f+t.length+1,l,p+1),t,i)):(m=Px._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return F.isEmpty(e)?n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Zn.delete(new F(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return F.isEmpty(e)?o.push(Zn.replace(new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Zn.insert(new oe(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Zn.insert(new oe(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],o=i[1];return new dt(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new dt(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}var Qw;(function(s){s[s.Toggle=0]="Toggle",s[s.ForceAdd=1]="ForceAdd",s[s.ForceRemove=2]="ForceRemove"})(Qw||(Qw={}));class RC{constructor(e,t,i,n,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lo?t[c].commentStrOffset=r-1:t[c].commentStrOffset=r}}}class YMe extends tt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Vs);if(!t.hasModel())return;const n=t.getModel(),o=[],r=n.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>F.compareRangesUsingStarts(d.selection,h.selection));let l=c[0];for(let d=1;d{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new iue(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new nue(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new nue(new iue(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new nue(new iue(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};Vse.ID="editor.contrib.cursorUndoRedoController";let DW=Vse;class dBt extends tt{constructor(){super({id:"cursorUndo",label:g(1383,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyU,weight:Ae.EditorContrib}})}run(e,t,i){DW.get(t)?.cursorUndo()}}class hBt extends tt{constructor(){super({id:"cursorRedo",label:g(1384,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){DW.get(t)?.cursorRedo()}}on(DW.ID,DW,ri.Eager);Re(dBt);Re(hBt);var uBt=".monaco-editor.hc-light .dnd-target,.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}";ut(uBt,{});class gBt{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new F(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new dt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new dt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(pP(e)&&(this._modifierPressed=!0),this._mouseDown&&pP(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(pP(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===zC.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const n=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}pP(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new oe(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:o,selectionStartColumn:r}=n;i=[new dt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new dt(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",Oi.Explicit)}else(!this._dragSelection.containsPosition(t)||(pP(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(zC.ID,new gBt(this._dragSelection,t,pP(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new F(e.lineNumber,e.column,e.lineNumber,e.column),options:zC._DECORATION_OPTIONS}]),this._editor.revealPosition(e,mt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Rt.CONTENT_TEXT||e.type===Rt.CONTENT_EMPTY}_hitMargin(e){return e.type===Rt.GUTTER_GLYPH_MARGIN||e.type===Rt.GUTTER_LINE_NUMBERS||e.type===Rt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};zC.ID="editor.contrib.dragAndDrop",zC.TRIGGER_KEY_VALUE=Qt?S.Alt:S.Ctrl,zC._DECORATION_OPTIONS=Gt.register({description:"dnd-target",className:"dnd-target"});let VX=zC;on(VX.ID,VX,ri.BeforeFirstInteraction);on(sC.ID,sC,ri.Eager);j6(Ebe);qe(new class extends hc{constructor(){super({id:gZe,precondition:xMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e){return sC.get(e)?.changePasteType()}});qe(new class extends hc{constructor(){super({id:"editor.hidePasteWidget",precondition:xMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e){sC.get(e)?.clearWidgets()}});var GL;Re((GL=class extends tt{constructor(){super({id:"editor.action.pasteAs",label:g(1386,"Paste As..."),alias:"Paste As...",precondition:J.writable,metadata:{description:"Paste as",args:[{name:"args",schema:GL.argsSchema}]}})}run(e,t,i){let n=typeof i?.kind=="string"?i.kind:void 0;return!n&&i&&(n=typeof i.id=="string"?i.id:void 0),sC.get(t)?.pasteAs(n?new Yn(n):void 0)}},GL.argsSchema={type:"object",properties:{kind:{type:"string",description:g(1385,"The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},GL));Re(class extends tt{constructor(){super({id:"editor.action.pasteAsText",label:g(1387,"Paste as Text"),alias:"Paste as Text",precondition:J.writable})}run(s,e){return sC.get(e)?.pasteAs({providerId:FM.id})}});on(HM.ID,HM,ri.BeforeFirstInteraction);j6(Abe);qe(new class extends hc{constructor(){super({id:AZe,precondition:LMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e,t){HM.get(e)?.changeDropType()}});qe(new class extends hc{constructor(){super({id:"editor.hideDropWidget",precondition:LMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e,t){HM.get(e)?.clearWidgets()}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[SZe]:{type:"object",scope:at.LANGUAGE_OVERRIDABLE,description:g(1388,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const ch=class ch{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,ch._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,ch._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new F(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,ch._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=ch._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=ch._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),l=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/l));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,p=e.length;f=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new F(h,1,u,1),options:ch._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new F(h,1,u,1),options:ch._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,c=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,ch._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rF.compareRangesUsingStarts(r.range,a.range));const n=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function OUe(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function BUe(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=vet([n[a]],r)+t}),o.slice(0,-1)}var kW;(function(s){s[s.StaticValue=0]="StaticValue",s[s.DynamicPieces=1]="DynamicPieces"})(kW||(kW={}));class WUe{constructor(e){this.staticValue=e,this.kind=kW.StaticValue}}class pBt{constructor(e){this.pieces=e,this.kind=kW.DynamicPieces}}class IW{static fromStaticValue(e){return new IW([gD.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===kW.DynamicPieces}constructor(e){!e||e.length===0?this._state=new WUe(""):e.length===1&&e[0].staticValue!==null?this._state=new WUe(e[0].staticValue):this._state=new pBt(e)}buildReplaceString(e,t){if(this._state.kind===kW.StaticValue)return t?vet(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n0){const c=[],l=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(r.caseOps[d]){case"U":c.push(a[h].toUpperCase());break;case"u":c.push(a[h].toUpperCase()),d++;break;case"L":c.push(a[h].toLowerCase());break;case"l":c.push(a[h].toLowerCase()),d++;break;default:c.push(a[h])}}a=c.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=n)break;const r=s.charCodeAt(i);switch(r){case B.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case B.n:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case B.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case B.u:case B.U:case B.l:case B.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===B.DollarSign){if(i++,i>=n)break;const r=s.charCodeAt(i);if(r===B.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===B.Digit0||r===B.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(B.Digit1<=r&&r<=B.Digit9){let a=r-B.Digit0;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Oi.Explicit||i.reason===Oi.Undo||i.reason===Oi.Redo)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,bt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},vBt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let c=a.endLineNumber;return a.endColumn===1&&(c=c-1),new F(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const n=this._findMatches(i,!1,Fx);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=w2(n.map(c=>c.range),c=>F.compareRangesUsingStarts(c,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(x.find).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,mt.Smooth),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,mt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new oe(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new oe(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()U5._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Fx?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new GC(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const n=this._editor.getModel(),o=n.getValue(go.LF),r=n.getFullModelRange(),a=this._getReplacePattern();let c;const l=this._state.preserveCase;a.hasReplacementPatterns||l?c=o.replace(i,function(){return a.buildReplaceString(arguments,l)}):c=o.replace(i,a.buildReplaceString(null,l));const d=new UTe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Un.MAX_SAFE_SMALL_INTEGER),n=[];for(let r=0,a=i.length;rr.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Un.MAX_SAFE_SMALL_INTEGER).map(o=>new dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const n=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre),inputActiveOptionBackground:ze(a6)},o=this._register($k());this.caseSensitive=this._register(new Jje({appendTitle:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new Xje({appendTitle:this._keybindingLabelFor(zo.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new Zje({appendTitle:this._keybindingLabelFor(zo.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(ue(this._domNode,ke.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ue(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return zse.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Wg.TOP_RIGHT_CORNER}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};zse.ID="editor.contrib.findOptionsWidget";let xwe=zse;var _h;(function(s){s[s.NotSet=0]="NotSet",s[s.True=1]="True",s[s.False=2]="False"})(_h||(_h={}));function DK(s,e){return s===_h.True?!0:s===_h.False?!1:e}class wBt extends V{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return DK(this._isRegexOverride,this._isRegex)}get wholeWord(){return DK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return DK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return DK(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}get isSearching(){return this._isSearching}get filters(){return this._filters}constructor(){super(),this._onFindReplaceStateChange=this._register(new I),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=_h.NotSet,this._wholeWord=!1,this._wholeWordOverride=_h.NotSet,this._matchCase=!1,this._matchCaseOverride=_h.NotSet,this._preserveCase=!1,this._preserveCaseOverride=_h.NotSet,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(F.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,c=this.matchCase,l=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!F.equalsRange(h,d)))||(this._searchScope=e.searchScope,n.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:_h.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:_h.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:_h.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:_h.NotSet,r!==this.isRegex&&(o=!0,n.isRegex=!0),a!==this.wholeWord&&(o=!0,n.wholeWord=!0),c!==this.matchCase&&(o=!0,n.matchCase=!0),l!==this.preserveCase&&(o=!0,n.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Fx}}var yBt=".monaco-editor .find-widget{background-color:var(--vscode-editorWidget-background);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);box-sizing:border-box;color:var(--vscode-editorWidget-foreground);height:33px;line-height:19px;overflow:hidden;padding:0 4px;position:absolute;transform:translateY(calc(-100% - 10px));transition:transform .2s linear;z-index:35}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-color:var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{display:flex;font-size:12px;margin:3px 25px 0 17px}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-bottom:2px;padding-top:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{align-items:center;display:flex;height:25px}.monaco-editor .find-widget .monaco-findInput{display:flex;flex:1;vertical-align:middle}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{box-sizing:border-box;display:flex;flex:initial;height:25px;line-height:23px;margin:0 0 0 3px;padding:2px 0 0 2px;text-align:center;vertical-align:middle}.monaco-editor .find-widget .button{align-items:center;background-position:50%;background-repeat:no-repeat;border-radius:5px;cursor:pointer;display:flex;flex:initial;height:16px;justify-content:center;margin-left:3px;padding:3px;width:16px}.monaco-editor .find-widget .codicon-find-selection{border-radius:5px;height:22px;padding:3px;width:22px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{padding:1px 6px;top:-1px;width:auto}.monaco-editor .find-widget .button.toggle{border-radius:0;box-sizing:border-box;height:100%;left:3px;position:absolute;top:0;width:18px}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{display:flex;flex:auto;flex-grow:0;flex-shrink:0;position:relative;vertical-align:middle}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);box-sizing:border-box;padding:1px}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}.monaco-editor.hc-black .find-widget .button:before{left:2px;position:relative;top:1px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;right:4px;top:5px}";ut(yBt,{});function zX(s){return s.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&s.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const HUe=oi("find-collapsed",ve.chevronRight,g(5053,"Icon to indicate that the editor find widget is collapsed.")),UUe=oi("find-expanded",ve.chevronDown,g(5054,"Icon to indicate that the editor find widget is expanded.")),CBt=oi("find-selection",ve.selection,g(5055,"Icon for 'Find in Selection' in the editor find widget.")),SBt=oi("find-replace",ve.replace,g(5056,"Icon for 'Replace' in the editor find widget.")),ABt=oi("find-replace-all",ve.replaceAll,g(5057,"Icon for 'Replace All' in the editor find widget.")),EBt=oi("find-previous-match",ve.arrowUp,g(5058,"Icon for 'Find Previous' in the editor find widget.")),xBt=oi("find-next-match",ve.arrowDown,g(5059,"Icon for 'Find Next' in the editor find widget.")),DBt=g(5060,"Find / Replace"),kBt=g(5061,"Find"),IBt=g(5062,"Find"),TBt=g(5063,"Previous Match"),LBt=g(5064,"Next Match"),RBt=g(5065,"Find in Selection"),MBt=g(5066,"Close"),NBt=g(5067,"Replace"),PBt=g(5068,"Replace"),FBt=g(5069,"Replace"),OBt=g(5070,"Replace All"),BBt=g(5071,"Toggle Replace"),WBt=g(5072,"Only the first {0} results are highlighted, but all find operations work on the entire text.",Fx),HBt=g(5073,"{0} of {1}"),VUe=g(5074,"No results"),Yb=419,UBt=275,VBt=UBt-54;let S4=69;const zBt=33,zUe="ctrlEnterReplaceAll.windows.donotask",$Ue=Qt?U.WinCtrl:U.CtrlCmd;class sue{constructor(e){this.afterLineNumber=e,this.heightInPx=zBt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function GUe(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function KUe(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(x.readOnly)&&(this._codeEditor.getOption(x.readOnly)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(x.layoutInfo)&&this._tryUpdateWidgetWidth(),h.hasChanged(x.accessibilitySupport)&&this.updateAccessibilitySupport(),h.hasChanged(x.find)){const u=this._codeEditor.getOption(x.find).loop;this._state.change({loop:u},!1);const f=this._codeEditor.getOption(x.find).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new sue(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const h=await this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}})),this._findInputFocused=mce.bindTo(r),this._findFocusTracker=this._register(Ac(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=JMe.bindTo(r),this._replaceFocusTracker=this._register(Ac(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(x.find).addExtraSpaceOnTop&&(this._viewZone=new sue(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return $se.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Wg.TOP_RIGHT_CORNER}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(x.readOnly)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=Pd(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,vt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=S4+"px",this._state.matchesCount>=Fx?this._matchesCount.title=WBt:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Fx&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=$p(HBt,i,t)}else e=VUe;this._matchesCount.appendChild(document.createTextNode(e)),Mr(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),S4=Math.max(S4,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===VUe)return i===""?g(5075,"{0} found",e):g(5076,"{0} found for '{1}'",e,i);if(t){const n=g(5077,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return g(5078,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(x.readOnly);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(x.find).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(x.find).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=Cr(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=Vj(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(l?l.left:0)>c&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(x.find).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(x.find).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new sue(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(x.padding).top,o<=0)return;i.heightInPx=o,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,n=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&Pd(this._domNode)>Yb){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Pd(this._findInput.domNode);return}if(Yb+28+n>=i&&(r=!0),Yb+28+n-S4>=i&&(a=!0),Yb+28+n-S4>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=Pd(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!F.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals($Ue|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(S.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return GUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(S.DownArrow))return KUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals($Ue|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Qn&&ad&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(5079,"Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(zUe,!0,Ie.PROFILE,an.USER)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(S.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.Shift|S.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return GUe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(S.DownArrow))return KUe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new rbe(null,this._contextViewProvider,{width:VBt,label:kBt,placeholder:IBt,appendCaseSensitiveLabel:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zo.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zo.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>zX(this._keybindingService),inputBoxStyles:EM,toggleStyles:JY},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(U.Shift|S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),pr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register($k());this._prevBtn=this._register(new mP({label:TBt+this._keybindingLabelFor(zo.PreviousMatchFindAction),icon:EBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.PreviousMatchFindAction)).run().then(void 0,vt)}},this._hoverService)),this._nextBtn=this._register(new mP({label:LBt+this._keybindingLabelFor(zo.NextMatchFindAction),icon:xBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.NextMatchFindAction)).run().then(void 0,vt)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ZA({icon:CBt,title:RBt+this._keybindingLabelFor(zo.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:ze(a6),inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new mP({label:MBt+this._keybindingLabelFor(zo.CloseFindWidgetCommand),icon:xYe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new abe(null,void 0,{label:NBt,placeholder:PBt,appendPreserveCaseLabel:this._keybindingLabelFor(zo.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>zX(this._keybindingService),inputBoxStyles:EM,toggleStyles:JY},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(d=>this._onReplaceInputKeyDown(d))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(d=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(d=>{d.equals(S.Tab)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),d.preventDefault())}));const r=this._register($k());this._replaceBtn=this._register(new mP({label:FBt+this._keybindingLabelFor(zo.ReplaceOneAction),icon:SBt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(U.Shift|S.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new mP({label:OBt+this._keybindingLabelFor(zo.ReplaceAllAction),icon:ABt,hoverDelegate:r,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",a.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new mP({label:BBt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Pd(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=DBt,this._domNode.role="dialog",this._domNode.style.width=`${Yb}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Od(this._domNode,this,{orientation:fi.VERTICAL,size:2})),this._resized=!1;let l=Yb;this._register(this._resizeSash.onDidStart(()=>{l=Pd(this._domNode)})),this._register(this._resizeSash.onDidChange(d=>{this._resized=!0;const h=l+d.startX-d.currentX;if(hu||(this._domNode.style.width=`${h}px`,this._isReplaceVisible&&(this._replaceInput.width=Pd(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=Pd(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};$se.ID="editor.contrib.findWidget";let Dwe=$se;class mP extends pd{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+We.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupManagedHover(e.hoverDelegate??Pr("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{if(n.equals(S.Space)||n.equals(S.Enter)){this._opts.onTrigger(),n.preventDefault();return}this._opts.onKeyDown?.(n)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...We.asClassNameArray(HUe)),this._domNode.classList.add(...We.asClassNameArray(UUe))):(this._domNode.classList.remove(...We.asClassNameArray(UUe)),this._domNode.classList.add(...We.asClassNameArray(HUe)))}}Cp((s,e)=>{const t=s.getColor(Cx);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Ry(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(uft);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Ry(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(wt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const o=s.getColor(dft);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=s.getColor(hft);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var kwe;const $Bt=524288;function Iwe(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.getModel().getValueLengthInRange(i)<$Bt)return s.getModel().getValueInRange(i)}return null}var Z_;(function(s){s[s.NoFocusChange=0]="NoFocusChange",s[s.FocusFindInput=1]="FocusFindInput",s[s.FocusReplaceInput=2]="FocusReplaceInput"})(Z_||(Z_={}));var KL;let og=(KL=class extends V{get editor(){return this._editor}static get(e){return e.getContribution(kwe.ID)}constructor(e,t,i,n,o,r){super(),this._editor=e,this._findWidgetVisible=sE.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=o,this._hoverService=r,this._updateHistoryDelayer=new Mh(500),this._state=this._register(new wBt),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",Ie.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.NoFocusChange,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(x.find).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,Ie.WORKSPACE,an.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Ie.WORKSPACE,an.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Ie.WORKSPACE,an.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,Ie.WORKSPACE,an.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",Ie.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!mce.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Rh(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const n=Iwe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Rh(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=Iwe(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(o=>!o.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new U5(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(g(1392,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},kwe=KL,KL.ID="editor.contrib.findController",KL);og=kwe=D([_(1,Le),_(2,$i),_(3,dg),_(4,bi),_(5,ec)],og);let Twe=class extends og{constructor(e,t,i,n,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(e.shouldFocus===Z_.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===Z_.FocusFindInput&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new Dwe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new xwe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Twe=D([_(1,mf),_(2,Le),_(3,Ut),_(4,pn),_(5,bi),_(6,$i),_(7,dg),_(8,ec)],Twe);const GBt=iKe(new tKe({id:zo.StartFindAction,label:g(1393,"Find"),alias:"Find",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyF,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1394,"&&Find"),order:1}}));GBt.addImplementation(0,(s,e,t)=>{const i=og.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).globalFindClipboard,shouldFocus:Z_.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const KBt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class qBt extends tt{constructor(){super({id:zo.StartFindWithArgs,label:g(1395,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:Ae.EditorContrib},metadata:KBt})}async run(e,t,i){const n=og.get(t);if(n){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:Z_.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),n.setGlobalBufferTerm(n.getState().searchString)}}}class QBt extends tt{constructor(){super({id:zo.StartFindWithSelection,label:g(1396,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:U.CtrlCmd|S.KeyE},weight:Ae.EditorContrib}})}async run(e,t){const i=og.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class bet extends tt{async run(e,t){const i=og.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class jBt extends bet{constructor(){super({id:zo.NextMatchFindAction,label:g(1397,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:S.F3,mac:{primary:U.CtrlCmd|S.KeyG,secondary:[S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,mce),primary:S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class YBt extends bet{constructor(){super({id:zo.PreviousMatchFindAction,label:g(1398,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:U.Shift|S.F3,mac:{primary:U.CtrlCmd|U.Shift|S.KeyG,secondary:[U.Shift|S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,mce),primary:U.Shift|S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class JBt extends tt{constructor(){super({id:zo.GoToMatchFindAction,label:g(1399,"Go to Match..."),alias:"Go to Match...",precondition:sE}),this._highlightDecorations=[]}run(e,t,i){const n=og.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1){e.get(bi).notify({severity:Xe.Warning,message:g(1400,"No matches. Try searching for something else.")});return}const a=e.get(In).createInputBox();a.placeholder=g(1401,"Type a number to go to a specific match (between 1 and {0})",o);const c=d=>{const h=parseInt(d);if(isNaN(h))return;const u=n.getState().matchesCount;if(h>0&&h<=u)return h-1;if(h<0&&h>=-u)return u+h},l=d=>{const h=c(d);if(typeof h=="number"){a.validationMessage=void 0,n.goToMatch(h);const u=n.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(n.goToMatch(d),a.hide()):a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:$o(Iqe),position:kl.Full}}}])})}}class wet extends tt{async run(e,t){const i=og.get(t);if(!i)return;const n=Iwe(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class XBt extends wet{constructor(){super({id:zo.NextSelectionMatchFindAction,label:g(1403,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class ZBt extends wet{constructor(){super({id:zo.PreviousSelectionMatchFindAction,label:g(1404,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const e2t=iKe(new tKe({id:zo.StartFindReplaceAction,label:g(1405,"Replace"),alias:"Replace",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyH,mac:{primary:U.CtrlCmd|U.Alt|S.KeyF},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1406,"&&Replace"),order:2}}));e2t.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=og.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?Z_.FocusReplaceInput:Z_.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop})});on(og.ID,Twe,ri.Eager);Re(qBt);Re(QBt);Re(jBt);Re(YBt);Re(JBt);Re(XBt);Re(ZBt);const $b=hc.bindToContribution(og.get);qe(new $b({id:zo.CloseFindWidgetCommand,precondition:sE,handler:s=>s.closeFindWidget(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new $b({id:zo.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:CK.primary,mac:CK.mac,win:CK.win,linux:CK.linux}}));qe(new $b({id:zo.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:SK.primary,mac:SK.mac,win:SK.win,linux:SK.linux}}));qe(new $b({id:zo.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:AK.primary,mac:AK.mac,win:AK.win,linux:AK.linux}}));qe(new $b({id:zo.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:EK.primary,mac:EK.mac,win:EK.win,linux:EK.linux}}));qe(new $b({id:zo.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:xK.primary,mac:xK.mac,win:xK.win,linux:xK.linux}}));qe(new $b({id:zo.ReplaceOneAction,precondition:sE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.Digit1}}));qe(new $b({id:zo.ReplaceOneAction,precondition:sE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,JMe),primary:S.Enter}}));qe(new $b({id:zo.ReplaceAllAction,precondition:sE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Alt|S.Enter}}));qe(new $b({id:zo.ReplaceAllAction,precondition:sE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,JMe),primary:void 0,mac:{primary:U.CtrlCmd|S.Enter}}}));qe(new $b({id:zo.SelectAllMatchesAction,precondition:sE,handler:s=>s.selectAllMatches(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.Alt|S.Enter}}));class t2t extends tt{constructor(){super({id:"editor.action.fontZoomIn",label:g(1389,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(Qp.getZoomLevel()+1)}}class i2t extends tt{constructor(){super({id:"editor.action.fontZoomOut",label:g(1390,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(Qp.getZoomLevel()-1)}}class n2t extends tt{constructor(){super({id:"editor.action.fontZoomReset",label:g(1391,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(0)}}Re(t2t);Re(i2t);Re(n2t);var FB;let $X=(FB=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new Z,this._sessionDisposables=new Z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(x.formatOnType)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(x.formatOnType)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new jj;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const o=n.charCodeAt(n.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new ci,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{n.token.isCancellationRequested||eo(r)&&(this._accessibilitySignalService.playSignal(cl.format,{userGesture:!1}),hW.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},FB.ID="editor.contrib.autoFormat",FB);$X=D([_(1,it),_(2,Ml),_(3,lv)],$X);var OB;let GX=(OB=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Z,this._callOnModel=new Z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(x.formatOnPaste)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Rae,this.editor,e,om.Silent,lu.None,He.None,!1).catch(vt))}},OB.ID="editor.contrib.formatOnPaste",OB);GX=D([_(1,it),_(2,we)],GX);class s2t extends tt{constructor(){super({id:"editor.action.formatDocument",label:g(1407,"Format Document"),alias:"Format Document",precondition:he.and(J.notInCompositeEditor,J.writable,J.hasDocumentFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(we);await e.get(XA).showWhile(i.invokeFunction(Ave,t,om.Explicit,lu.None,He.None,!0),250)}}}class o2t extends tt{constructor(){super({id:"editor.action.formatSelection",label:g(1408,"Format Selection"),alias:"Format Selection",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyF),weight:Ae.EditorContrib},contextMenuOpts:{when:J.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new F(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(XA).showWhile(i.invokeFunction(Rae,t,o,om.Explicit,lu.None,He.None,!0),250)}}on($X.ID,$X,ri.BeforeFirstInteraction);on(GX.ID,GX,ri.BeforeFirstInteraction);Re(s2t);Re(o2t);_t.registerCommand("editor.action.format",async s=>{const e=s.get(Kt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(vi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class jw{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static getElementById(e,t){if(!e)return;const i=$y(e,t.id);if(i===e.length)return t;if(!(i0&&F.areIntersecting(e[n-1],t.symbol.range)&&(n-=1)):n=i;const o=[];let r;for(;nr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),uM(e)}}class Tw extends jw{static create(e,t,i){const n=new ci(i),o=new Tw(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=jw.findId(`provider_${d}`,o),u=new Rwe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,n.token)).then(f=>{for(const p of f||[])Tw._makeOutlineElement(p,u);return u},f=>(No(f),u)).then(f=>{jw.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);is(l,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Tw.create(e,t,i):o._compact()).finally(()=>{n.dispose(),c.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=jw.findId(e,t),n=new Lwe(i,t,e);if(e.children)for(const o of e.children)Tw._makeOutlineElement(o,n);t.children.set(n.id,n)}static get(e){for(;e;){if(e instanceof Tw)return e;e=e.parent}}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=hi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}merge(e){return this.uri.toString()!==e.uri.toString()||this._groups.size!==e._groups.size?!1:(this._groups=e._groups,this.children=e.children,!0)}getItemEnclosingPosition(e,t){let i;if(t){let o=t.parent;for(;o&&!i;)o instanceof Rwe&&(i=o),o=o.parent}let n;for(const[,o]of this._groups)if(n=o.getItemEnclosingPosition(e),n&&(!i||i===o))break;return n}getItemById(e){return jw.getElementById(e,this)}updateMarker(e){e.sort(F.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Lwe?e.push(t.symbol):e.push(...hi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>F.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Tw._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>oe.compare(F.getStartPosition(i.range),F.getStartPosition(n.range))||oe.compare(F.getEndPosition(n.range),F.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Tw._flattenDocumentSymbols(e,n.children,n.name)}}const iG=ae("IOutlineModelService");let Mwe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new um(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!is(o.provider,n)){const a=new ci;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Tw.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const c=Date.now();o.promise.then(l=>{o.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};Mwe=D([_(0,it),_(1,Sp),_(2,gi)],Mwe);ce(iG,Mwe,qt.Delayed);_t.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;Tt(N.isUri(t));const i=s.get(iG),o=await s.get(fn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,He.None)).getTopLevelSymbols()}finally{o.dispose()}});const Gse=class Gse extends tt{constructor(){super({id:Gse.ID,label:g(5080,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){fu.get(t)?.model.get()?.next()}};Gse.ID=PXe;let Nwe=Gse;const Kse=class Kse extends tt{constructor(){super({id:Kse.ID,label:g(5081,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){fu.get(t)?.model.get()?.previous()}};Kse.ID=NXe;let Pwe=Kse;class r2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(5082,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:J.writable})}async run(e,t){const i=fu.get(t);await xje(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class a2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(5083,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|S.RightArrow,kbExpr:he.and(J.writable,ju.inlineSuggestionVisible)},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5084,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=fu.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class c2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(5085,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5086,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=fu.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class l2t extends tt{constructor(){super({id:MXe,label:g(5087,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:ju.inlineSuggestionVisible,menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5088,"Accept"),group:"primary",order:1}],kbOpts:{primary:S.Tab,weight:200,kbExpr:he.and(ju.inlineSuggestionVisible,J.tabMovesFocus.toNegated(),ju.inlineSuggestionHasIndentationLessThanTabSize,Ui.Visible.toNegated(),J.hoverFocused.toNegated())}})}async run(e,t){const i=fu.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const qse=class qse extends tt{constructor(){super({id:qse.ID,label:g(5089,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:ju.inlineSuggestionVisible,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=fu.get(t);ts(n=>{i?.model.get()?.stop(n)})}};qse.ID="editor.action.inlineSuggest.hide";let Fwe=qse;const Qse=class Qse extends li{constructor(){super({id:Qse.ID,title:g(5090,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:_e.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:he.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Te),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};Qse.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let Owe=Qse;class d2t{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Bwe=class{constructor(e,t,i,n,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=fu.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Rt.CONTENT_VIEW_ZONE){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new aQ(1e3,this,F.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===Rt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new aQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Rt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new aQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineSuggest).showToolbar!=="onHover")return[];const i=fu.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new d2t(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&i.add(this.renderScreenReaderText(e,n));const o=n.controller.model.get(),r=this._instantiationService.createInstance(_W,this._editor,!1,nd(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands),a=r.getDomNode();e.fragment.appendChild(a),o.triggerExplicitly(),i.add(r);const c={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new UM([c])}getAccessibleContent(e){return g(5091,"There are inline completions here")}renderScreenReaderText(e,t){const i=new Z,n=fe,o=n("div.hover-row.markdown-hover"),r=re(o,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Y_({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(5092,"Suggestion:"),h=i.add(a.render(new Mt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};return i.add(ai(l=>{const d=t.controller.model.read(l)?.primaryGhostText.read(l);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);c(d.renderForScreenReader(h))}else aa(r)})),e.fragment.appendChild(o),i}};Bwe=D([_(1,xi),_(2,Ao),_(3,mr),_(4,we),_(5,Yi)],Bwe);class h2t{constructor(){this.type=wm.View,this.priority=95,this.name="inline-completions",this.when=he.and(ju.inlineSuggestionVisible)}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=fu.get(i)?.model.get();if(n?.state.get())return new u2t(i,n)}}class u2t extends V{constructor(e,t){super(),this._editor=e,this._model=t,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.id=Pb.InlineCompletions,this.verbositySettingKey="accessibility.verbosity.inlineCompletions",this.options={language:this._editor.getModel()?.getLanguageId()??void 0,type:wm.View}}provideContent(){const e=this._model.state.get();if(!e)throw new Error("Inline completion is visible but state is not available");const t=this._model.textModel.getLineContent(e.primaryGhostText.lineNumber),i=e.primaryGhostText.renderForScreenReader(t);if(!i)throw new Error("Inline completion is visible but ghost text is not available");return t+i}provideNextContent(){this._model.next().then(()=>this._onDidChangeContent.fire())}providePreviousContent(){this._model.previous().then(()=>this._onDidChangeContent.fire())}onClose(){this._model.stop(),this._editor.focus()}}on(fu.ID,fu,ri.Eventually);Re(r2t);Re(Nwe);Re(Pwe);Re(a2t);Re(c2t);Re(l2t);Re(Fwe);At(Owe);GN.register(Bwe);U6.register(new h2t);var g2t=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";ut(g2t,{});var pV,jD;let KM=(jD=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new Z,this.toUnhookForKeyboard=new Z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new dce(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{vt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(pV.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===Rt.CONTENT_WIDGET&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new Tae(this.editor,jo.Position|jo.Value|jo.Selection|jo.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Rr(r=>this.findDefinition(e,r));let n;try{n=await this.previousPromise}catch(r){vt(r);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=n[0].originSelectionRange?F.lift(n[0].originSelectionRange):new F(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let r=o;for(const{originSelectionRange:a}of n)a&&(r=F.plusRange(r,a));this.addDecoration(r,new Mt().appendText(g(1444,"Click to show {0} definitions.",n.length)))}else{const r=n[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=r.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,d?new Mt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=pV.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new Z6({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Le);return ng.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},pV=jD,jD.ID="editor.contrib.gotodefinitionatposition",jD.MAX_SOURCE_PREVIEW_LINES=8,jD);KM=pV=D([_(1,fn),_(2,xi),_(3,it)],KM);on(KM.ID,KM,ri.BeforeFirstInteraction);class qUe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Wwe=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._dispoables=new Z,this._markers=[],this._nextIdx=-1,N.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=gm(a.resource.toString(),c.resource.toString());return l===0&&(n==="position"?l=F.compareRangesUsingStarts(a,c)||Ws.compare(a.severity,c.severity):l=Ws.compare(a.severity,c.severity)||F.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:N.isUri(e)?e:void 0,severities:Ws.Error|Ws.Warning|Ws.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new qUe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=y2(this._markers,{resource:e.uri},(r,a)=>gm(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rn.resource.toString()===e.toString());if(!(i<0)){for(;it())}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Wwe(e,this._markerService,this._configService)}};Hwe=D([_(0,Am),_(1,Te)],Hwe);ce(yet,Hwe,qt.Delayed);var f2t='.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;margin-right:4px;vertical-align:text-top}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{font-style:italic;opacity:.6}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{padding:8px 12px 0 20px;position:absolute;user-select:text;-webkit-user-select:text;white-space:pre}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{color:inherit;opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-activeForeground);text-decoration:underline;text-underline-position:under}.monaco-editor .marker-widget .descriptioncontainer .filename{color:var(--vscode-textLink-activeForeground);cursor:pointer}';ut(f2t,{});var p2t=".extension-editor .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.markers-panel .marker-icon .codicon.codicon-error,.markers-panel .marker-icon.error,.monaco-editor .zone-widget .codicon.codicon-error,.preferences-editor .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.extension-editor .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.markers-panel .marker-icon .codicon.codicon-warning,.markers-panel .marker-icon.warning,.monaco-editor .zone-widget .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.extension-editor .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.markers-panel .marker-icon .codicon.codicon-info,.markers-panel .marker-icon.info,.monaco-editor .zone-widget .codicon.codicon-info,.preferences-editor .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}";ut(p2t,{});var Uwe;(function(s){function e(t){switch(t){case Xe.Ignore:return"severity-ignore "+We.asClassName(ve.info);case Xe.Info:return We.asClassName(ve.info);case Xe.Warning:return We.asClassName(ve.warning);case Xe.Error:return We.asClassName(ve.error);default:return""}}s.className=e})(Uwe||(Uwe={}));var Vwe;class m2t{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Ro(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new Cqe(r,{horizontal:Co.Auto,vertical:Co.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){bt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=ov(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ms(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const u of a)c=document.createElement("div"),c.innerText=u,u===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),c.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=fe("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(o.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=re(this._codeLink,fe("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Ms(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),eo(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(x.lineHeight)*.66)}px`,this._lines+=1;for(const f of n){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const l=this._editor.getOption(x.fontInfo),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Ws.Error:t=g(5123,"Error");break;case Ws.Warning:t=g(5124,"Warning");break;case Ws.Info:t=g(5125,"Info");break;case Ws.Hint:t=g(5126,"Hint");break}let i=g(5127,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}var qL;let s9=(qL=class extends H3{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ws.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(w2t);let t=zwe,i=_2t;this._severity===Ws.Warning?(t=uQ,i=v2t):this._severity===Ws.Info&&(t=$we,i=b2t);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(dMe),secondaryHeadingColor:e.getColor(hMe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}focus(){this._parentContainer.focus()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(Vwe.TitleMenu,this._contextKeyService);fC(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=re(e,fe(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new m2t(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=F.lift(e),o=this.editor.getPosition(),r=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(5128,"{0} of {1} problems",t,i):g(5129,"{0} of {1} problem",t,i);this.setTitle(_i(a.uri),c)}this._icon.className=`codicon ${Uwe.className(Ws.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,mt.Smooth),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},Vwe=qL,qL.TitleMenu=new _e("gotoErrorTitleMenu"),qL);s9=Vwe=D([_(1,pn),_(2,Ao),_(3,Oa),_(4,we),_(5,Le),_(6,Fs)],s9);const QUe=U8(TN,oft),jUe=U8(pm,V8),YUe=U8(mm,z8),zwe=W("editorMarkerNavigationError.background",{dark:QUe,light:QUe,hcDark:wt,hcLight:wt},g(5130,"Editor marker navigation widget error color.")),_2t=W("editorMarkerNavigationError.headerBackground",{dark:st(zwe,.1),light:st(zwe,.1),hcDark:null,hcLight:null},g(5131,"Editor marker navigation widget error heading background.")),uQ=W("editorMarkerNavigationWarning.background",{dark:jUe,light:jUe,hcDark:wt,hcLight:wt},g(5132,"Editor marker navigation widget warning color.")),v2t=W("editorMarkerNavigationWarning.headerBackground",{dark:st(uQ,.1),light:st(uQ,.1),hcDark:"#0C141F",hcLight:st(uQ,.2)},g(5133,"Editor marker navigation widget warning heading background.")),$we=W("editorMarkerNavigationInfo.background",{dark:YUe,light:YUe,hcDark:wt,hcLight:wt},g(5134,"Editor marker navigation widget info color.")),b2t=W("editorMarkerNavigationInfo.headerBackground",{dark:st($we,.1),light:st($we,.1),hcDark:null,hcLight:null},g(5135,"Editor marker navigation widget info heading background.")),w2t=W("editorMarkerNavigation.background",Hc,g(5136,"Editor marker navigation widget background."));var mV,QL;let qM=(QL=class{static get(e){return e.getContribution(mV.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Cet.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(s9,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!F.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:F.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new oe(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const n=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:rA.NearTop,selection:i.selected.marker}},this._editor);n&&(mV.get(n)?.close(),mV.get(n)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},mV=QL,QL.ID="editor.contrib.markerController",QL);qM=mV=D([_(1,yet),_(2,Le),_(3,Kt),_(4,we)],qM);class _ce extends tt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&qM.get(t)?.nagivate(this._next,this._multiFile)}}const m1=class m1 extends _ce{constructor(){super(!0,!1,{id:m1.ID,label:m1.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:s9.TitleMenu,title:m1.LABEL,icon:oi("marker-navigation-next",ve.arrowDown,g(1446,"Icon for goto next marker.")),group:"navigation",order:1}})}};m1.ID="editor.action.marker.next",m1.LABEL=g(1445,"Go to Next Problem (Error, Warning, Info)");let KX=m1;const _1=class _1 extends _ce{constructor(){super(!1,!1,{id:_1.ID,label:_1.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:s9.TitleMenu,title:_1.LABEL,icon:oi("marker-navigation-previous",ve.arrowUp,g(1448,"Icon for goto previous marker.")),group:"navigation",order:2}})}};_1.ID="editor.action.marker.prev",_1.LABEL=g(1447,"Go to Previous Problem (Error, Warning, Info)");let Gwe=_1;class y2t extends _ce{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(1449,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1450,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class C2t extends _ce{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(1451,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1452,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}on(qM.ID,qM,ri.Lazy);Re(KX);Re(Gwe);Re(y2t);Re(C2t);const Cet=new Q("markersNavigationVisible",!1),S2t=hc.bindToContribution(qM.get);qe(new S2t({id:"closeMarkersNavigation",precondition:Cet,handler:s=>s.close(),kbOpts:{weight:Ae.EditorContrib+50,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));var Rv;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Rv||(Rv={}));class A2t extends tt{constructor(){super({id:xZe,label:g(5137,"Show or Focus Hover"),metadata:{description:Pe(5138,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Rv.NoAutoFocus,Rv.FocusIfVisible,Rv.AutoFocusImmediately],enumDescriptions:[g(5139,"The hover will not automatically take focus."),g(5140,"The hover will take focus only if it is already visible."),g(5141,"The hover will automatically take focus when it appears.")],default:Rv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyI),weight:Ae.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const n=Pa.get(t);if(!n)return;const o=i?.focus;let r=Rv.FocusIfVisible;Object.values(Rv).includes(o)?r=o:typeof o=="boolean"&&o&&(r=Rv.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new F(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,oC.Immediate,FA.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Jl.Enabled;n.isHoverVisible?r!==Rv.NoAutoFocus?n.focus():a(c):a(c||r===Rv.AutoFocusImmediately)}}class E2t extends tt{constructor(){super({id:yPt,label:g(5142,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Pe(5143,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Pa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new F(n.lineNumber,n.column,n.lineNumber,n.column),r=KM.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,oC.Immediate,FA.Keyboard,!0)})}}class x2t extends tt{constructor(){super({id:CPt,label:g(5144,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.UpArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5145,"Scroll up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollUp()}}class D2t extends tt{constructor(){super({id:SPt,label:g(5146,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.DownArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5147,"Scroll down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollDown()}}class k2t extends tt{constructor(){super({id:APt,label:g(5148,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.LeftArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5149,"Scroll left the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollLeft()}}class I2t extends tt{constructor(){super({id:EPt,label:g(5150,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.RightArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5151,"Scroll right the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollRight()}}class T2t extends tt{constructor(){super({id:xPt,label:g(5152,"Page Up Hover"),alias:"Page Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageUp,secondary:[U.Alt|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5153,"Page up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageUp()}}class L2t extends tt{constructor(){super({id:DPt,label:g(5154,"Page Down Hover"),alias:"Page Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageDown,secondary:[U.Alt|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5155,"Page down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageDown()}}class R2t extends tt{constructor(){super({id:kPt,label:g(5156,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.Home,secondary:[U.CtrlCmd|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5157,"Go to the top of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToTop()}}class M2t extends tt{constructor(){super({id:IPt,label:g(5158,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.End,secondary:[U.CtrlCmd|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5159,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToBottom()}}class N2t extends tt{constructor(){super({id:zU,label:LPt,alias:"Increase Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Mc.Increase,o,i?.focus)}}class P2t extends tt{constructor(){super({id:$U,label:MPt,alias:"Decrease Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();Pa.get(t)?.updateHoverVerbosityLevel(Mc.Decrease,o,i?.focus)}}const Nm=fe;class F2t{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const JUe={type:Ch.Invoke,filter:{include:ys.QuickFix},triggerAction:sg.QuickFixHover};let Kwe=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==du.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const a of t){const c=a.range.startLineNumber===n?a.range.startColumn:1,l=a.range.endLineNumber===n?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new F(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new F2t(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return new UM([]);const i=new Z,n=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),n.push(a)});const o=t.length===1?t[0]:t.sort((r,a)=>Ws.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,o,i),new UM(n)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new Z,i=Nm("div.hover-row"),n=re(i,Nm("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(n);const l=re(n,Nm("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const h=Nm("span");if(o){const m=re(h,Nm("span"));m.innerText=o}const u=re(h,Nm("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ue(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const f=re(u,Nm("span"));f.innerText=a.value;const p=re(n,h);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const h=re(n,Nm("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(eo(c))for(const{message:h,resource:u,startLineNumber:f,startColumn:p}of c){const m=re(n,Nm("div"));m.style.marginTop="8px";const v=re(m,Nm("a"));v.innerText=`${_i(u)}(${f}, ${p}): `,v.style.cursor="pointer",t.add(ue(v,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:f,startColumn:p}}}).catch(vt)}));const b=re(m,Nm("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ws.Error||t.marker.severity===Ws.Warning||t.marker.severity===Ws.Info){const n=qM.get(this._editor);n&&e.statusBar.addAction({label:g(5169,"View Problem"),commandId:KX.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const n=e.statusBar.append(Nm("div"));this.recentMarkerCodeActionsInfo&&(ZY.makeKey(this.recentMarkerCodeActionsInfo.marker)===ZY.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g(5170,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?V.None:jy(()=>n.textContent=g(5171,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ee(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=g(5170,"No quick fixes available");return}n.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(5172,"Quick Fix..."),commandId:kMe,run:l=>{c=!0;const d=WM.get(this._editor),h=Cr(l);e.hide(),d?.showCodeActions(JUe,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},vt)}}getCodeActions(e){return Rr(t=>ZO(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),JUe,lu.None,t))}};Kwe=D([_(1,DTe),_(2,Ao),_(3,it)],Kwe);var qX;(function(s){s.increaseVerbosity=g(5173,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",``),s.decreaseVerbosity=g(5174,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",``)})(qX||(qX={}));class O2t{constructor(){this.type=wm.View,this.priority=95,this.name="hover",this.when=J.hoverFocused}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(!n)return;const o=e.get(Ut);return e.get(we).createInstance(W2t,o,i,n)}}class B2t{constructor(){this.priority=100,this.name="hover",this.type=wm.Help,this.when=J.hoverVisible}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(n)return e.get(we).createInstance(Eet,n)}}class Aet extends V{constructor(e){super(),this._hoverController=e,this.id=Pb.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._focusedHoverPartIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._focusedHoverPartIndex=this._hoverController.focusedHoverPartIndex(),this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._focusedHoverPartIndex===-1?this._hoverController.focus():this._hoverController.focusHoverPartWithIndex(this._focusedHoverPartIndex),this._focusedHoverPartIndex=-1,this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1)}provideContentAtIndex(e,t){if(e!==-1){const i=this._hoverController.getAccessibleWidgetContentAtIndex(e);if(i===void 0)return"";const n=[];return t&&n.push(...this._descriptionsOfVerbosityActionsForIndex(e)),n.push(i),n.join(` +`)}else{const i=this._hoverController.getAccessibleWidgetContent();if(i===void 0)return"";const n=[];return n.push(i),n.join(` +`)}}_descriptionsOfVerbosityActionsForIndex(e){const t=[],i=this._descriptionOfVerbosityActionForIndex(Mc.Increase,e);i!==void 0&&t.push(i);const n=this._descriptionOfVerbosityActionForIndex(Mc.Decrease,e);return n!==void 0&&t.push(n),t}_descriptionOfVerbosityActionForIndex(e,t){if(this._hoverController.doesHoverAtIndexSupportVerbosityAction(t,e))switch(e){case Mc.Increase:return qX.increaseVerbosity;case Mc.Decrease:return qX.decreaseVerbosity}}}class Eet extends Aet{constructor(e){super(e),this.options={type:wm.Help}}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class W2t extends Aet{constructor(e,t,i){super(i),this._keybindingService=e,this._editor=t,this.options={type:wm.View},this._initializeOptions(this._editor,i)}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!1)}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Mc.Increase)),e.push(this._getActionFor(this._editor,Mc.Decrease)),e}_getActionFor(e,t){let i,n,o;switch(t){case Mc.Increase:i=zU,n=TPt,o=ve.add;break;case Mc.Decrease:i=$U,n=RPt,o=ve.remove;break}const r=RZe(this._keybindingService,t),a=this._hoverController.doesHoverAtIndexSupportVerbosityAction(this._focusedHoverPartIndex,t);return new rn(n,r,We.asClassName(o),a,()=>{e.getAction(i)?.run({index:this._focusedHoverPartIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new Eet(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class H2t{constructor(){this.type=wm.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(mf).getContextViewElement(),n=i?.textContent??void 0,o=e.get(ec);if(!(i.classList.contains("accessible-view-container")||!n))return new LXe(Pb.Hover,{language:"typescript",type:wm.View},()=>n,()=>{o.showAndFocusLastHover()},"accessibility.verbosity.hover")}}on(Pa.ID,Pa,ri.BeforeFirstInteraction);Re(A2t);Re(E2t);Re(x2t);Re(D2t);Re(k2t);Re(I2t);Re(T2t);Re(L2t);Re(R2t);Re(M2t);Re(N2t);Re(P2t);GN.register(j3);GN.register(Kwe);Cp((s,e)=>{const t=s.getColor(ZKe);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});U6.register(new O2t);U6.register(new B2t);U6.register(new H2t);function Tg(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=s.getOptions(),l=(m,v)=>(v=v||1,_m.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,_m.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=s.getLineContent(t);let f=ho(u),p=f;o.shouldIncrease(t)?(p=l(p),f=l(f)):o.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(U2t(s,m))continue;const v=s.getLineContent(m),b=ho(v),w=p;o.shouldDecrease(m,w)&&(p=d(p),f=d(f)),b!==p&&h.push(Zn.replaceMove(new dt(m,1,m,b.length+1),HTe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,w)?(f=l(f),p=f):o.shouldIndentNextLine(m,w)?p=l(p):p=f)}return h}function U2t(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===nr.String:!1}const jse=class jse extends tt{constructor(){super({id:jse.ID,label:g(1453,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:J.writable,metadata:{description:Pe(1454,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new K2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};jse.ID="editor.action.indentationToSpaces";let qwe=jse;const Yse=class Yse extends tt{constructor(){super({id:Yse.ID,label:g(1455,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:J.writable,metadata:{description:Pe(1456,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new q2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};Yse.ID="editor.action.indentationToTabs";let Qwe=Yse;class XMe extends tt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(In),n=e.get(gi),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?g(1457,"Configured Tab Size"):d===r.tabSize?g(1458,"Default Tab Size"):d===a.tabSize?g(1459,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(1460,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const Jse=class Jse extends XMe{constructor(){super(!1,!1,{id:Jse.ID,label:g(1461,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Pe(1462,"Use indentation with tabs.")}})}};Jse.ID="editor.action.indentUsingTabs";let jwe=Jse;const Xse=class Xse extends XMe{constructor(){super(!0,!1,{id:Xse.ID,label:g(1463,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Pe(1464,"Use indentation with spaces.")}})}};Xse.ID="editor.action.indentUsingSpaces";let Ywe=Xse;const Zse=class Zse extends XMe{constructor(){super(!0,!0,{id:Zse.ID,label:g(1465,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Pe(1466,"Change the space size equivalent of the tab.")}})}};Zse.ID="editor.action.changeTabDisplaySize";let Jwe=Zse;const eoe=class eoe extends tt{constructor(){super({id:eoe.ID,label:g(1467,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Pe(1468,"Detect the indentation from content.")}})}run(e,t){const i=e.get(gi),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}};eoe.ID="editor.action.detectIndentation";let Xwe=eoe;class V2t extends tt{constructor(){super({id:"editor.action.reindentlines",label:g(1469,"Reindent Lines"),alias:"Reindent Lines",precondition:J.writable,metadata:{description:Pe(1470,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)return;const o=xet(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class z2t extends tt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(1471,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:J.writable,metadata:{description:Pe(1472,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=xet(n,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class $2t{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(F.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var BB;let QX=(BB=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Z,this.callOnModel=new Z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(x.autoIndent){this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||G2t(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(x.autoIndent),{tabSize:r,indentSize:a,insertSpaces:c}=i.getOptions(),l=[],d={shiftIndent:p=>_m.shiftIndent(p,p.length+1,r,a,c),unshiftIndent:p=>_m.unshiftIndent(p,p.length+1,r,a,c)};let h=e.startLineNumber;for(;h<=e.endLineNumber;){if(this.shouldIgnoreLine(i,h)){h++;continue}break}if(h>e.endLineNumber)return;let u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const p=a5(o,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(p!==null){const m=ho(u),v=Tg(p,r),b=Tg(m,r);if(v!==b){const w=V5(v,r,c);l.push({range:new F(h,1,h,m.length+1),text:w}),u=w+u.substring(m.length)}else{const w=vqe(i,h,this._languageConfigurationService);if(w===0||w===mb.UNINDENT_MASK)return}}}const f=h;for(;hi.tokenization.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,b)=>i.getLanguageIdAtPosition(v,b)},getLineContent:v=>v===f?u:i.getLineContent(v)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(m!==null){const v=Tg(m,r),b=Tg(ho(i.getLineContent(h+1)),r);if(v!==b){const w=v-b;for(let y=h+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),A=ho(C),k=Tg(A,r)+w,P=V5(k,r,c);P!==A&&l.push({range:new F(y,1,y,A.length+1),text:P})}}}}if(l.length>0){this.editor.pushUndoStop();const p=new $2t(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=o=>o.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(r)}else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const r=e.getLineContent(o);if(o===t.startLineNumber){const a=r.substring(t.startColumn-1);n=i(a)}else if(o===t.endLineNumber){const a=r.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(o)===0;if(!n)break}return n}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===nr.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},BB.ID="editor.contrib.autoIndentOnPaste",BB);QX=D([_(1,Vs)],QX);function G2t(s,e){const t=i=>Agt(s,i)===nr.String;return t(e.getStartPosition())||t(e.getEndPosition())}function Det(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let r=0;rthis.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!r.validate(this.editor))return;const l=F.lift(c.range);let d=c.range;const h=c.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(o=new dt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new Q2t(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:gQ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Sr(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(vt)}).catch(vt)):Promise.resolve(void 0)}},gQ=YD,YD.ID="editor.contrib.inPlaceReplaceController",YD.DECORATION=Gt.register({description:"in-place-replace",className:"valueSetReplacement"}),YD);TW=gQ=D([_(1,Ml)],TW);class Y2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(1473,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Comma,weight:Ae.EditorContrib}})}run(e,t){const i=TW.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class J2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(1474,"Replace with Next Value"),alias:"Replace with Next Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Period,weight:Ae.EditorContrib}})}run(e,t){const i=TW.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}on(TW.ID,TW,ri.Lazy);Re(Y2t);Re(J2t);class X2t extends tt{constructor(){super({id:"expandLineSelection",label:g(1475,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,Oi.Explicit,bl.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Re(X2t);class ket{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=c_.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumbere.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberw===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?e.getLineContent(h):e.getLineContent(w)},b=a5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(h)),y=Tg(b,a),C=Tg(w,a);y!==C&&(f=V5(y,a,l)+this.trimStart(u))}}t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` +`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,m);else{const v={tokenization:{getLineTokens:w=>w===r.startLineNumber?e.tokenization.getLineTokens(h):w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.tokenization.getLineTokens(w-1):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?f:w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.getLineContent(w-1):e.getLineContent(w)},b=a5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(r.startLineNumber)),y=Tg(b,a),C=Tg(w,a);if(y!==C){const A=y-C;this.getIndentEditsOfMovingBlock(e,t,r,a,l,A)}}}}else t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` +`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new F(h,1,h+1,1),null),t.addEditOperation(new F(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` +`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:m=>m===h?e.getLineContent(r.startLineNumber):e.getLineContent(m)},p=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,p);else{const m=a5(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=ho(e.getLineContent(r.startLineNumber)),b=Tg(m,a),w=Tg(v,a);if(b!==w){const y=b-w;this.getIndentEditsOfMovingBlock(e,t,r,a,l,y)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>_m.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>_m.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===yr.None||o.indentAction===yr.Indent?r=o.indentation+o.appendText:o.indentAction===yr.IndentOutdent?r=o.indentation:o.indentAction===yr.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const c=ho(e.getLineContent(n));let l=ho(r);const d=vqe(e,n,this._languageConfigurationService);d!==null&&d&mb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Tg(l,i),u=Tg(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(T_(r)>=0){const a=e.getLineMaxColumn(o),c=PO(this._autoIndent,e,new F(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(T_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=PO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}}matchEnterRule(e,t,i,n,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),T_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=PO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent=n)return null;const o=[];for(let a=i;a<=n;a++)o.push(s.getLineContent(a));let r=o.slice(0);return r.sort(o9.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function Z2t(s,e,t){const i=Iet(s,e,t);return i?Zn.replace(new F(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(` +`)):null}class Tet extends tt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>F.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;rnew oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Te),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new IFt(o,n,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};toe.ID="editor.action.trimTrailingWhitespace";let eye=toe;class cWt extends tt{constructor(){super({id:"editor.action.deleteLines",label:g(1490,"Delete Line"),alias:"Delete Line",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyK,weight:Ae.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=n.getLineMaxColumn(h)),r.push(Zn.replace(new dt(h,f,u,p),"")),a.push(new dt(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let o=1;o=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class lWt extends tt{constructor(){super({id:"editor.action.indentLines",label:g(1491,"Indent Line"),alias:"Indent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketRight,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,JE.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class dWt extends tt{constructor(){super({id:"editor.action.outdentLines",label:g(1492,"Outdent Line"),alias:"Outdent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketLeft,weight:Ae.EditorContrib}})}run(e,t){FO.Outdent.runEditorCommand(e,t,null)}}class hWt extends tt{constructor(){super({id:"editor.action.insertLineBefore",label:g(1493,"Insert Line Above"),alias:"Insert Line Above",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zre.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class uWt extends tt{constructor(){super({id:"editor.action.insertLineAfter",label:g(1494,"Insert Line Below"),alias:"Insert Line Below",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zre.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Met extends tt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let c=0,l=n.length-1;cZn.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class gWt extends Met{constructor(){super({id:"deleteAllLeft",label:g(1495,"Delete All Left"),alias:"Delete All Left",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.CtrlCmd|S.Backspace},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new dt(c,r.startColumn,c,r.startColumn)}else a=new dt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(F.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:n.getLineLength(r)+1;return new F(r,a,o.startLineNumber,1)}else return new F(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new F(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class fWt extends Met{constructor(){super({id:"deleteAllRight",label:g(1496,"Delete All Right"),alias:"Delete All Right",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyK,secondary:[U.CtrlCmd|S.Delete]},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new F(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new F(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(F.compareRangesUsingStarts),n}}class pWt extends tt{constructor(){super({id:"editor.action.joinLines",label:g(1497,"Join Lines"),alias:"Join Lines",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyJ},weight:Ae.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(F.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=n,h=0;for(let u=0,f=o.length;u=1){let z=!0;A===""&&(z=!1),z&&(A.charAt(A.length-1)===" "||A.charAt(A.length-1)===" ")&&(z=!1,A=A.replace(/[\s\uFEFF\xA0]+$/g," "));const G=P.substr(R-1);A+=(z?" ":"")+G,z?b=G.length+1:b=G.length}else b=0}const L=new F(m,v,w,y);if(!L.isEmpty()){let k;p.isEmpty()?(c.push(Zn.replace(L,A)),k=new dt(L.startLineNumber-h,A.length-b+1,m-h,A.length-b+1)):p.startLineNumber===p.endLineNumber?(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,A.length-C)),F.intersectRanges(L,n)!==null?d=k:l.push(k)}h+=L.endLineNumber-L.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class mWt extends tt{constructor(){super({id:"editor.action.transpose",label:g(1498,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:J.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===n.getLineCount())continue;const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new td(new dt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new UTe(h,u,new dt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class qN extends tt{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=t.getOption(x.wordSeparators),r=[];for(const a of i)if(a.isEmpty()){const c=a.getStartPosition(),l=t.getConfiguredWordAtPosition(c);if(!l)continue;const d=new F(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=n.getValueInRange(d);r.push(Zn.replace(d,this._modifyText(h,o)))}else{const c=n.getValueInRange(a);r.push(Zn.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class _Wt extends qN{constructor(){super({id:"editor.action.transformToUppercase",label:g(1499,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class vWt extends qN{constructor(){super({id:"editor.action.transformToLowercase",label:g(1500,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class dA{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const ioe=class ioe extends qN{constructor(){super({id:"editor.action.transformToTitlecase",label:g(1501,"Transform to Title Case"),alias:"Transform to Title Case",precondition:J.writable})}_modifyText(e,t){const i=ioe.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}};ioe.titleBoundary=new dA("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let jX=ioe;const sO=class sO extends qN{constructor(){super({id:"editor.action.transformToSnakecase",label:g(1502,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:J.writable})}_modifyText(e,t){const i=sO.caseBoundary.get(),n=sO.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}};sO.caseBoundary=new dA("(\\p{Ll})(\\p{Lu})","gmu"),sO.singleLetters=new dA("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let z5=sO;const noe=class noe extends qN{constructor(){super({id:"editor.action.transformToCamelcase",label:g(1503,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:J.writable})}_modifyText(e,t){const i=noe.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};noe.wordBoundary=new dA("[_\\s-]","gm");let YX=noe;const oO=class oO extends qN{constructor(){super({id:"editor.action.transformToPascalcase",label:g(1504,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:J.writable})}_modifyText(e,t){const i=oO.wordBoundary.get(),n=oO.wordBoundaryToMaintain.get();return!i||!n?e:e.split(n).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};oO.wordBoundary=new dA("[_\\s-]","gm"),oO.wordBoundaryToMaintain=new dA("(?<=\\.)","gm");let JX=oO;const qE=class qE extends qN{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(1505,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:J.writable})}_modifyText(e,t){const i=qE.caseBoundary.get(),n=qE.singleLetters.get(),o=qE.underscoreBoundary.get();return!i||!n||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}};qE.caseBoundary=new dA("(\\p{Ll})(\\p{Lu})","gmu"),qE.singleLetters=new dA("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),qE.underscoreBoundary=new dA("(\\S)(_)(\\S)","gm");let XX=qE;Re(eWt);Re(tWt);Re(iWt);Re(nWt);Re(sWt);Re(oWt);Re(rWt);Re(aWt);Re(eye);Re(cWt);Re(lWt);Re(dWt);Re(hWt);Re(uWt);Re(gWt);Re(fWt);Re(pWt);Re(mWt);Re(_Wt);Re(vWt);z5.caseBoundary.isSupported()&&z5.singleLetters.isSupported()&&Re(z5);YX.wordBoundary.isSupported()&&Re(YX);JX.wordBoundary.isSupported()&&Re(JX);jX.titleBoundary.isSupported()&&Re(jX);XX.isSupported()&&Re(XX);var bWt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";ut(bWt,{});var fQ;const Net=new Q("LinkedEditingInputVisible",!1),wWt="linked-editing-decoration";var JD;let LW=(JD=class extends V{static get(e){return e.getContribution(fQ.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Net.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(x.linkedEditing)||r.hasChanged(x.renameOnType))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(x.linkedEditing)||this._editor.getOption(x.renameOnType))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(M.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new Mh(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Mh(0),a=c=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const l=this._currentDecorations.getRange(0);if(l&&c.changes.every(d=>l.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{n.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=this._currentRequestCts=new ci;try{const r=new js(!1),a=await Pet(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,n!==i.getVersionId()))return;let c=[];a?.ranges&&(c=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let l=!1;for(let h=0,u=c.length;h({range:h,options:fQ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Fr(r)||vt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},fQ=JD,JD.ID="editor.contrib.linkedEditing",JD.DECORATION=Gt.register({description:"linked-editing",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:wWt}),JD);LW=fQ=D([_(1,Le),_(2,it),_(3,Vs),_(4,Sp)],LW);class yWt extends tt{constructor(){super({id:"editor.action.linkedEditing",label:g(1506,"Start Linked Editing"),alias:"Start Linked Editing",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F2,weight:Ae.EditorContrib}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=LW.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const CWt=hc.bindToContribution(LW.get);qe(new CWt({id:"cancelLinkedEditingInput",precondition:Net,handler:s=>s.clearRanges(),kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib+99,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));function Pet(s,e,t,i){const n=s.ordered(e);return Nre(n.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){No(r);return}}),o=>!!o&&eo(o?.ranges))}W("editor.linkedEditingBackground",{dark:me.fromHex("#f00").transparent(.3),light:me.fromHex("#f00").transparent(.3),hcDark:me.fromHex("#f00").transparent(.3),hcLight:me.white},g(1507,"Background color when the editor auto renames on type."));rg("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(it);return Pet(i,e,t,He.None)});on(LW.ID,LW,ri.AfterFirstRender);Re(yWt);const soe=class soe extends V{static get(e){return e.getContribution(soe.ID)}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(x.stopRenderingLineAfter);i>=0&&t.target.type===Rt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};soe.ID="editor.contrib.longLinesHelper";let ZX=soe;on(ZX.ID,ZX,ri.BeforeFirstInteraction);var SWt=".monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);border:1px solid var(--vscode-editor-selectionHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);border:1px solid var(--vscode-editor-wordHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);border:1px solid var(--vscode-editor-wordHighlightStrongBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);border:1px solid var(--vscode-editor-wordHighlightTextBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}";ut(SWt,{});const AWt=W("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(5183,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(5184,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.wordHighlightTextBackground",AWt,g(5185,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const EWt=W("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5186,"Border color of a symbol during read-access, like reading a variable."));W("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5187,"Border color of a symbol during write-access, like writing to a variable."));W("editor.wordHighlightTextBorder",EWt,g(5188,"Border color of a textual occurrence for a symbol."));const xWt=W("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",g(5189,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),DWt=W("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",g(5190,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),kWt=W("editorOverviewRuler.wordHighlightTextForeground",tqe,g(5191,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),IWt=Gt.register({description:"word-highlight-strong",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:$o(DWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),TWt=Gt.register({description:"word-highlight-text",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:$o(kWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),LWt=Gt.register({description:"selection-highlight-overview",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:$o(tqe),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),RWt=Gt.register({description:"selection-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),MWt=Gt.register({description:"word-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:$o(xWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}});function NWt(s){return s===w8.Write?IWt:s===w8.Text?TWt:MWt}function PWt(s){return s?RWt:LWt}Cp((s,e)=>{const t=s.getColor(TTe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var tye;function II(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?g(1518,"Cursor added: {0}",i):g(1519,"Cursors added: {0}",i);Ah(n)}}class FWt extends tt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(1520,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.UpArrow,linux:{primary:U.Shift|U.Alt|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1521,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,bl.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),II(r,o.getCursorStates())}}class OWt extends tt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(1522,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.DownArrow,linux:{primary:U.Shift|U.Alt|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1523,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,bl.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),II(r,o.getCursorStates())}}class BWt extends tt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(1524,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyI,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1525,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new dt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];n.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),II(r,o.getCursorStates())}}class WWt extends tt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(1526,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=n;c++)o.push(new dt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),II(a,r.getCursorStates())}}class HWt extends tt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(1527,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new dt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),II(r,o.getCursorStates())}}class kK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class r9{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new r9(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const c=e.getSelection();let l,d=null;if(c.isEmpty()){const h=e.getConfiguredWordAtPosition(c.getStartPosition());if(!h)return null;l=h.word,d=new dt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` +`);return new r9(e,t,n,l,o,r,d)}constructor(e,t,i,n,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.concat(e),e,mt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new dt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.concat(e),e,mt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new dt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}}const ooe=class ooe extends V{static get(e){return e.getContribution(ooe.ID)}constructor(e){super(),this._sessionDispose=this._register(new Z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=r9.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=_h.True,i.matchCaseOverride=_h.True,i.isRegexOverride=_h.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:_h.NotSet,matchCaseOverride:_h.NotSet,isRegexOverride:_h.NotSet};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new dt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!Fet(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let o=0,r=t.length;onew dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};ooe.ID="editor.contrib.multiCursorController";let RW=ooe;class KU extends tt{run(e,t){const i=RW.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),r=og.get(t);if(r)this._run(i,r);else{const a=e.get(we).createInstance(og,t);this._run(i,a),a.dispose()}II(o,n.getCursorStates())}}}class UWt extends KU{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(1528,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.KeyD,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1529,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class VWt extends KU{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(1530,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1531,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class zWt extends KU{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(1532,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyD),weight:Ae.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class $Wt extends KU{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(1533,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class GWt extends KU{constructor(){super({id:"editor.action.selectHighlights",label:g(1534,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.KeyL,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1535,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class KWt extends KU{constructor(){super({id:"editor.action.changeAll",label:g(1536,"Change All Occurrences"),alias:"Change All Occurrences",precondition:he.and(J.writable,J.editorTextFocus),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class qWt{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(F.compareRangesUsingStarts)),this._cachedFindMatches}}var jL;let eZ=(jL=class extends V{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(x.selectionHighlight),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new cn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===Oi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=og.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(tye._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=RW.get(i);if(!o)return null;const r=og.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const u=r.getState().matchCase;if(!Fet(i.getModel(),d,u))return null}a=r9.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=r.getState(),l=c.matchCase;if(c.isRevealed){let d=c.searchString;l||(d=d.toLowerCase());let h=a.searchText;if(l||(h=h.toLowerCase()),d===h&&a.matchCase===c.matchCase&&a.wholeWord===c.wholeWord&&!c.isRegex)return null}return new qWt(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(x.wordSeparators):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(F.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=n.length;l=u)o.push(f),l++;else{const p=F.compareRangesUsingStarts(f,n[d]);p<0?((n[d].isEmpty()||!F.areIntersecting(f,n[d]))&&o.push(f),l++):(p>0||l++,d++)}}const r=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,c=o.map(l=>({range:l,options:PWt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},tye=jL,jL.ID="editor.contrib.selectionHighlighter",jL);eZ=tye=D([_(1,it)],eZ);function Fet(s,e,t){const i=XUe(s,e[0],!t);for(let n=1,o=e.length;nthis.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;let a=this.model.range?.read(n);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const c=(a?a.startLineNumber===a.endLineNumber:!0)&&r.parts.length===1&&r.parts[0].lines.length===1,l=r.parts.length===1&&r.parts[0].lines.every(w=>w.length===0),d=[],h=[];function u(w,y){if(h.length>0){const C=h[h.length-1];y&&C.decorations.push(new eu(C.content.length+1,C.content.length+1+w[0].length,y,Ja.Regular)),C.content+=w[0],w=w.slice(1)}for(const C of w)h.push({content:C,decorations:y?[new eu(1,C.length+1,y,Ja.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l&&(c||!a)){for(const w of r.parts){let y=w.lines;a&&!c&&(u(y,oue),y=[]),p===void 0?(d.push({column:w.column,text:y[0],preview:w.preview}),y=y.slice(1)):u([f.substring(m,w.column-1)],void 0),y.length>0&&(u(y,oue),p===void 0&&w.column<=f.length&&(p=w.column)),m=w.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new OXe(p,f.length+1):void 0,b=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);if(!o)return[];const r=[];if(o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(!o.isPureRemove){const c=o.range.endLineNumber-o.range.startLineNumber;for(let l=0;l{const o=this.uiState.read(n);return o&&!o.isPureRemove&&(o.isSingleLine||!o.range)?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(BXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};iye=D([_(2,xi)],iye);var tHt=".monaco-editor .inlineEditHints.withBorder{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);z-index:39}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}";ut(tHt,{});var pQ;let nye=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(cu((n,o)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=o.add(this.instantiationService.createInstance(sye,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};nye=D([_(2,we)],nye);var XD;let sye=(XD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${pQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(oye,this.nodes.toolBar,this.editor,_e.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof Sc)return n.createInstance(iHt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{pQ._dropDownVisible=a})),this._register(ai(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(ai(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof Sc&&c.push(h);c.length>0&&c.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},pQ=XD,XD._dropDownVisible=!1,XD.id=0,XD);sye=pQ=D([_(3,we),_(4,Le),_(5,Oa)],sye);class iHt extends Lb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new qk(t,po,{disableTitle:!0,...pYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let oye=class extends lW{constructor(e,t,i,n,o,r,a,c,l,d){super(e,{resetMenu:i,...n},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=n,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];fC(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};oye=D([_(4,Oa),_(5,Le),_(6,lr),_(7,Ut),_(8,vi),_(9,Yi)],oye);var nHt=".monaco-editor .inlineEditSideBySide{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);white-space:pre;z-index:39}";ut(nHt,{});var _V,rye;function*sHt(s,e,t=1){e===void 0&&([e,s]=[s,0]);for(let i=s;ii.replace(new RegExp("^"+e),"")),shift:t}}var YL;let aye=(YL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edit-widget",path:new Date().toString()+String(_V._modelId++)})}constructor(e,t,i,n,o){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=n,this._modelService=o,this._position=Ze(this,r=>{const a=this._model.read(r);if(!a||a.text.length===0||a.range.startLineNumber===a.range.endLineNumber&&!(a.range.startColumn===a.range.endColumn&&a.range.startColumn===1))return null;const c=this._editor.getModel();if(!c)return null;const l=Array.from(sHt(a.range.startLineNumber,a.range.endLineNumber+1)),d=l.map(m=>c.getLineLastNonWhitespaceColumn(m)),h=Math.max(...d),u=l[d.indexOf(h)],f=new oe(u,h);return{top:a.range.startLineNumber,left:f}}),this._text=Ze(this,r=>{const a=this._model.read(r);if(!a)return{text:"",shift:0};const c=rue(a.text.split(` +`));return{text:c.text.join(` +`),shift:c.shift}}),this._originalModel=mh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._modifiedModel=mh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._diff=Ze(this,r=>this._diffPromise.read(r)?.promiseResult.read(r)?.data),this._diffPromise=Ze(this,r=>{const a=this._model.read(r);if(!a)return;const c=this._editor.getModel();if(!c)return;const l=rue(c.getValueInRange(a.range).split(` +`)).text.join(` +`),d=rue(a.text.split(` +`)).text.join(` +`);this._originalModel.get().setValue(l),this._modifiedModel.get().setValue(d);const h=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return E6.fromFn(async()=>{const u=await h.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!u.identical)return u.changes})}),this._register(cu((r,a)=>{if(!this._model.read(r)||this._position.get()===null)return;const l=a.add(this._instantiationService.createInstance(cye,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(l),a.add(Ee(()=>e.removeOverlayWidget(l)))}))}},_V=YL,YL._modelId=0,YL);aye=_V=D([_(2,we),_(3,x6),_(4,gi)],aye);var ZD;let cye=(ZD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this._editor=e,this._position=t,this._text=i,this._shift=n,this._diff=o,this._instantiationService=r,this.id=`InlineEditSideBySideContentWidget${rye.id++}`,this.allowEditorOverflow=!1,this._nodes=fe("div.inlineEditSideBySide",void 0),this._scrollChanged=id("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(lf,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=Xh(this._previewEditor),this._editorObs=Xh(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(C_,"",this._editor.getModel()?.getLanguageId()??Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(a=>{const c=this._text.read(a);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=Ze(this,a=>{this._setText.read(a);const c=this._position.read(a);if(!c)return{org:[],mod:[]};const l=this._diff.read(a);if(!l)return{org:[],mod:[]};const d=[],h=[];if(l.length===1&&l[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const u=this._shift.get(),f=p=>new F(p.startLineNumber+c.top-1,p.startColumn+u,p.endLineNumber+c.top-1,p.endColumn+u);for(const p of l)if(p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:L3}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:AJ}),p.modified.isEmpty||p.original.isEmpty)p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:ARe}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:CRe});else for(const m of p.innerChanges||[])p.original.contains(m.originalRange.startLineNumber)&&d.push({range:f(m.originalRange),options:m.originalRange.isEmpty()?ERe:cW}),p.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()?SRe:EJ});return{org:d,mod:h}}),this._originalDecorations=Ze(this,a=>this._decorations.read(a).org),this._modifiedDecorations=Ze(this,a=>this._decorations.read(a).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(ai(a=>{const c=this._previewEditorObs.contentWidth.read(a),l=this._text.read(a).split(` +`).length-1,d=this._editor.getOption(x.lineHeight)*l;c<=0||this._previewEditor.layout({height:d,width:c})})),this._register(ai(a=>{this._position.read(a),this._editor.layoutOverlayWidget(this)})),this._register(ai(a=>{this._scrollChanged.read(a),this._position.read(a)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new oe(e.top,1));if(!i)return null;const n=i.top-1,o=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+o+10,top:n}}}},rye=ZD,ZD._dropDownVisible=!1,ZD.id=0,ZD);cye=rye=D([_(5,we)],cye);var vV,Up;let iu=(Up=class extends V{static get(e){return e.getContribution(vV.ID)}constructor(e,t,i,n,o,r,a,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=o,this._configurationService=r,this._diffProviderFactoryService=a,this._modelService=c,this._isVisibleContext=vV.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=vV.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=jt(this,void 0),this._currentWidget=mh(this._currentEdit,p=>{const m=this._currentEdit.read(p);if(!m)return;const v=m.range.endLineNumber,b=m.range.endColumn,w=m.text.endsWith(` +`)&&!(m.range.startLineNumber===m.range.endLineNumber&&m.range.startColumn===m.range.endColumn)?m.text.slice(0,-1):m.text,y=new $3(v,[new tX(b,w,!1)]),C=m.range.startLineNumber===m.range.endLineNumber&&y.parts.length===1&&y.parts[0].lines.length===1,A=m.text==="";return!C&&!A?void 0:this.instantiationService.createInstance(iye,this.editor,{ghostText:nd(y),minReservedLineCount:nd(0),targetTextModel:nd(this.editor.getModel()??void 0),range:nd(m.range)})}),this._isAccepting=jt(this,!1),this._enabled=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily);const l=id("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(ai(p=>{this._enabled.read(p)&&(l.read(p),!this._isAccepting.read(p)&&this.getInlineEdit(e,!0))}));const d=Kn(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(ai(p=>{if(!this._enabled.read(p))return;const m=d.read(p);m&&this.checkCursorPosition(m)})),this._register(ai(p=>{const m=this._currentEdit.read(p);if(this._isCursorAtInlineEditContext.set(!1),!m){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const v=e.getPosition();v&&this.checkCursorPosition(v)}));const h=id("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(ai(async p=>{this._enabled.read(p)&&(h.read(p),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const u=id("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(ai(p=>{this._enabled.read(p)&&(u.read(p),this.getInlineEdit(e,!0))}));const f=this._register(GGe());this._register(ai(p=>{const m=this._fontFamily.read(p);f.setStyle(m===""||m==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { - font-family: ${f}; -}`)})),this._register(new AAe(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get()?.edit;if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(O.containsPosition(t.range,e))}validateInlineEdit(e,t){if(t.text.includes(` -`)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const s=t.range.endLineNumber,o=t.range.endColumn,r=e.getModel()?.getLineLength(s)??0;if(o!==r+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const s=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new ai;const a=this._currentRequestCts.token,c=t?MU.Automatic:MU.Invoke;if(t&&await OUt(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)return;const d=await r.provideInlineEdit(i,{triggerKind:c},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);if(!i)return;const s=i.range.endLineNumber,o=i.range.endColumn,r=i.text.endsWith(` -`)&&!(i.range.startLineNumber===i.range.endLineNumber&&i.range.startColumn===i.range.endColumn)?i.text.slice(0,-1):i.text,a=new q7(s,[new Ete(o,r,!1)]),c=this.instantiationService.createInstance(SAe,this.editor,{ghostText:Au(a),minReservedLineCount:Au(0),targetTextModel:Au(this.editor.getModel()??void 0),range:Au(i.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new FUt(c,i),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get()?.edit;if(!e)return;let t=e.text;e.text.startsWith(` -`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ds.replace(O.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,er),this.freeEdit(e),En(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get()?.edit;if(!e)return;const t=oe.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get()?.edit;t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,er),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const i=t.edit,s=t.widget.model;if(O.containsPosition(i.range,e.getStartPosition())||O.containsPosition(i.range,e.getEndPosition()))return!0;const r=s.ghostText.get();return r?r.parts.some(a=>e.containsPosition(new oe(r.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){return this._currentEdit.get()?.widget.ownsViewZone(e)??!1}},XL=Ab,Ab.ID="editor.contrib.inlineEditController",Ab.inlineEditVisibleKey="inlineEditVisible",Ab.inlineEditVisibleContext=new Y(XL.inlineEditVisibleKey,!1),Ab.cursorAtInlineEditKey="cursorAtInlineEdit",Ab.cursorAtInlineEditContext=new Y(XL.cursorAtInlineEditKey,!1),Ab);zh=XL=D([_(1,be),_(2,Pe),_(3,ht),_(4,ji),_(5,Re)],zh);function OUt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class BUt extends lt{constructor(){super({id:IUt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:ge.and(X.writable,zh.inlineEditVisibleContext),kbOpts:[{weight:ye.EditorContrib+1,primary:E.Tab,kbExpr:ge.and(X.writable,zh.inlineEditVisibleContext,zh.cursorAtInlineEditContext)}],menuOpts:[{menuId:Te.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await zh.get(t)?.accept()}}class WUt extends lt{constructor(){const e=ge.and(X.writable,ge.not(zh.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e}})}async run(e,t){zh.get(t)?.trigger()}}class HUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext,ge.not(zh.cursorAtInlineEditKey));super({id:TUt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpToCurrent()}}class UUt extends lt{constructor(){const e=ge.and(X.writable,zh.cursorAtInlineEditContext);super({id:RUt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+10,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpBack()}}class VUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext);super({id:LUt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib,primary:E.Escape,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await zh.get(t)?.clear()}}class zUt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let xAe=class{constructor(e,t,i){this._editor=e,this._instantiationService=t,this._telemetryService=i,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=zh.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId)){const o=i.range;return new bM(1e3,this,o,e.event.posx,e.event.posy,!1)}}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineEdit).showToolbar!=="onHover")return[];const i=zh.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new zUt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z;this._telemetryService.publicLog2("inlineEditHover.shown");const s=this._instantiationService.createInstance(Die,this._editor,!1,Au(null));return e.fragment.appendChild(s.getDomNode()),i.add(s),i}};xAe=D([_(1,be),_(2,rn)],xAe);Fe(BUt);Fe(VUt);Fe(HUt);Fe(UUt);Fe(WUt);vn(zh.ID,zh,mi.Eventually);hL.register(xAe);const TF={Visible:new Y("parameterHintsVisible",!1),MultipleSignatures:new Y("parameterHintsMultipleSignatures",!1)};async function lnt(n,e,t,i,s){const o=n.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,s,i);if(a)return a}catch(a){er(a)}}yt.registerCommand("_executeSignatureHelpProvider",async(n,...e)=>{const[t,i,s]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s);const o=n.get(ht),r=await n.get(Rn).createModelReference(t);try{const a=await lnt(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:dS.Invoke,isRetrigger:!1,triggerCharacter:s},qe.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var nu;(function(n){let e;(function(s){s[s.Default=0]="Default",s[s.Active=1]="Active",s[s.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}n.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}n.Active=i})(nu||(nu={}));const Sce=class Sce extends ${constructor(e,t,i=Sce.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=nu.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Dn),this.triggerChars=new EZ,this.retriggerChars=new EZ,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Lu(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===nu.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=nu.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(bt)}next(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===nu.Type.Active&&(this.state=new nu.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce($Ut);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new nu.Pending(na(c=>lnt(this.providers,r,a,o,c)),i);try{const c=await this.state.request;return e!==this.triggerId?(c?.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new nu.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=nu.Default),bt(c),!1}}getLastActiveHints(){switch(this.state.type){case nu.Type.Active:return this.state.hints;case nu.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:dS.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Sce.DEFAULT_DELAY=120;let DAe=Sce;function $Ut(n,e){switch(e.triggerKind){case dS.Invoke:return e;case dS.ContentChange:return n;case dS.TriggerCharacter:default:return e}}var GUt='.monaco-editor .parameter-hints-widget{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);cursor:default;display:flex;flex-direction:column;line-height:1.5em;z-index:39}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{display:flex;flex-direction:row;max-width:440px}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{border-left:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;height:100%;opacity:.5;position:absolute}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{border-bottom:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;left:0;opacity:.5;padding-top:4px;position:absolute;width:100%}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs code{background-color:var(--vscode-textCodeBlock-background);border-radius:3px;font-family:var(--monaco-monospace-font);padding:0 .4em}.monaco-editor .parameter-hints-widget .docs .code,.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{align-items:center;display:none;flex-direction:column;justify-content:flex-end;min-width:22px}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{background-repeat:no-repeat;cursor:pointer;height:16px;width:16px}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{font-family:var(--monaco-monospace-font);height:12px;line-height:12px;text-align:center}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}';Ct(GUt,{});var kAe;const xhe="vs/editor/contrib/parameterHints/browser/parameterHintsWidget",xp=we,qUt=Ki("parameter-hints-next",Ce.chevronDown,g(xhe,0,"Icon for show next parameter hint.")),QUt=Ki("parameter-hints-previous",Ce.chevronUp,g(xhe,1,"Icon for show previous parameter hint."));var zN;let IAe=(zN=class extends ${constructor(e,t,i,s,o,r){super(),this.editor=e,this.model=t,this.telemetryService=r,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new vw({editor:e},o,s)),this.keyVisible=TF.Visible.bindTo(i),this.keyMultipleSignatures=TF.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xp(".editor-widget.parameter-hints-widget"),t=he(e,xp(".phwrapper"));t.tabIndex=-1;const i=he(t,xp(".controls")),s=he(i,xp(".button"+$e.asCSSSelector(QUt))),o=he(i,xp(".overloads")),r=he(i,xp(".button"+$e.asCSSSelector(qUt)));this._register(pe(s,"click",u=>{un.stop(u),this.previous()})),this._register(pe(r,"click",u=>{un.stop(u),this.next()}));const a=xp(".body"),c=new bz(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=he(a,xp(".signature")),d=he(a,xp(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(x.fontInfo);this.domNodes.element.style.fontSize=`${u.fontSize}px`,this.domNodes.element.style.lineHeight=`${u.lineHeight/u.fontSize}`};h(),this._register(T.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(x.fontInfo)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[hs.ABOVE,hs.BELOW]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=he(this.domNodes.signature,xp(".code")),o=this.editor.getOption(x.fontInfo);s.style.fontSize=`${o.fontSize}px`,s.style.fontFamily=o.fontFamily;const r=i.parameters.length>0,a=i.activeParameter??e.activeParameter;if(r)this.renderParameters(s,i,a);else{const d=he(s,xp("span"));d.textContent=i.label}const c=i.parameters[a];if(c?.documentation){const d=xp("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}he(this.domNodes.docs,xp("p",{},d))}if(i.documentation!==void 0)if(typeof i.documentation=="string")he(this.domNodes.docs,xp("p",{},i.documentation));else{const d=this.renderMarkdownDocs(i.documentation);he(this.domNodes.docs,d.element)}const l=this.hasDocs(i,c);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=i.parameters[a];Array.isArray(h.label)?d=i.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),i.documentation&&(d+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==d&&(sa(g(xhe,2,"{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new ao,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const s=t.elapsed();return s>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:s}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&ws(t.documentation).length>0||t&&typeof t.documentation=="object"&&ws(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&ws(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&ws(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),he(e,r,a,c)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${Iu(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return kAe.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},kAe=zN,zN.ID="editor.widget.parameterHintsWidget",zN);IAe=kAe=D([_(2,Pe),_(3,fr),_(4,Di),_(5,rn)],IAe);B("editorHoverWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g(xhe,3,"Foreground color of the active item in the parameter hint."));var LAe;const jUt="vs/editor/contrib/parameterHints/browser/parameterHints";var $N;let BV=($N=class extends ${static get(e){return e.getContribution(LAe.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new DAe(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{s?(this.widget.value.show(),this.widget.value.render(s)):this.widget.rawValue?.hide()})),this.widget=new Ya(()=>this._register(t.createInstance(IAe,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}},LAe=$N,$N.ID="editor.controller.parameterHints",$N);BV=LAe=D([_(1,be),_(2,ht)],BV);class KUt extends lt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(jUt,0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:X.hasSignatureHelpProvider,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Space,weight:ye.EditorContrib}})}run(e,t){BV.get(t)?.trigger({triggerKind:dS.Invoke})}}vn(BV.ID,BV,mi.BeforeFirstInteraction);Fe(KUt);const DFe=ye.EditorContrib+75,kFe=Jc.bindToContribution(BV.get);Ke(new kFe({id:"closeParameterHints",precondition:TF.Visible,handler:n=>n.cancel(),kbOpts:{weight:DFe,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new kFe({id:"showPrevParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:DFe,kbExpr:X.focus,primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.Alt|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new kFe({id:"showNextParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:DFe,kbExpr:X.focus,primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.Alt|E.DownArrow,V.WinCtrl|E.KeyN]}}}));var YUt=".monaco-editor .rename-box{border-radius:4px;color:inherit;z-index:100}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{border-radius:2px;padding:3px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{padding:0;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{align-items:center;background-color:transparent;border:none;border-radius:5px;cursor:pointer;display:flex;padding:3px}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}";Ct(YUt,{});const JW="vs/editor/contrib/rename/browser/renameWidget",zz=new Y("renameInputVisible",!1,g(JW,0,"Whether the rename input widget is visible"));let TAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=zz.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new ao,this._inputWithButton=new JUt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.fontInfo)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new IFe(this._domNode,{fontInfo:this._editor.getOption(x.fontInfo),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(__),i=e.getColor(UU);this._domNode.style.backgroundColor=String(e.getColor(Zs)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(wKe)??"");const s=e.getColor(_$);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=s?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Bt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(x.fontInfo);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=uw(this.getDomNode().ownerDocument.body),t=ia(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(x.lineHeight),{totalHeight:o}=c6.getLayoutInfo({lineHeight:s}),r=this._nPxAvailableBelow>o*6?[hs.BELOW,hs.ABOVE]:[hs.ABOVE,hs.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(JW,2,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Bt(this._renameCandidateListView),Bt(this._nPxAvailableAbove!==void 0),Bt(this._nPxAvailableBelow!==void 0);const t=Zf(this._inputWithButton.domNode),i=Zf(this._label);let s;e===hs.BELOW?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:du(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),c.add(pe(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(pe(this._inputWithButton.button,xe.KEY_DOWN,d=>{const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new oe(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),c.add(Ee(()=>{this._renameCts=void 0,o.dispose(!0)})),c.add(Ee(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),c.add(Ee(()=>this._candidates.clear()));const l=new sd;return l.p.finally(()=>{c.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Bt(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const p=this._renameCandidateListView.focusedCandidate;if(p!==void 0?(this._trace("using new name from renameSuggestion"),u=p,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},c.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),c.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),l.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Bt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ai;const i=t?rF.Invoke:rF.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){Bt(this._editor.hasModel());const i=this._editor.getSelection();let s=0,o=t.length;return!O.isEmpty(i)&&!O.spansMultipleLines(i)&&O.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,vt.Smooth),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...l)=>this._trace("_updateRenameCandidates",...l);s("start");const o=await dw(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&yl(l.value)?l.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=Tc(r,l=>l.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const c=a.filter(({newSymbolName:l})=>l.trim().length>0&&l!==this._inputWithButton.input.value&&l!==t&&!this._candidates.has(l));if(s(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(c),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};TAe=D([_(2,pn),_(3,ti),_(4,Pe),_(5,Ze)],TAe);class IFe{constructor(e,t){this._disposables=new Z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=IFe._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(CO({listInactiveFocusForeground:zk,listInactiveFocusBackground:$k}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Cu(g(JW,3,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=c6.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new c6(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Fc("NewSymbolNameCandidates",e,s,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class JUt{constructor(){this._onDidInputChange=new I,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",g(JW,4,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=g(JW,5,"Generate new name suggestions"),this._buttonCancelHoverText=g(JW,6,"Cancel"),this._buttonHover=H_().setupUpdatableHover(va("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(pe(this.input,xe.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.KEY_DOWN,e=>{const t=new os(e);(t.keyCode===E.LeftArrow||t.keyCode===E.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(pe(this.input,xe.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(pe(this.input,xe.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Bt(this._inputNode),this._inputNode}get button(){return Bt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=OS(Ce.sparkle),Yo(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHover?.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=OS(Ce.primitiveSquare),Yo(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHover?.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const s9=class s9{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${s9._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=OS(Ce.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Sd(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(T_e.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+s9._PADDING*2}}dispose(){}};s9._PADDING=2;let c6=s9;var RAe;const bb="vs/editor/contrib/rename/browser/rename";class LFe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` -`):void 0}:{range:O.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` -`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,s){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` -`)};const r=await o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(g(bb,0,"No result.")),s);return r}}async function XUt(n,e,t,i){const s=new LFe(e,t,n),o=await s.resolveRenameLocation(qe.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,qe.None)}var GN;let F1=(GN=class{static get(e){return e.getContribution(RAe.ID)}constructor(e,t,i,s,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ai,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(TAe,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ai,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new LFe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new I1(this.editor,hr.Position|hr.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(s.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Rc?e("resolve rename location cancelled",JSON.stringify(p,null," ")):(e("resolve rename location failed",p instanceof Error?p:JSON.stringify(p,null," ")),(typeof p=="string"||ah(p))&&Du.get(this.editor)?.showMessage(p||g(bb,1,"An unknown error occurred while resolving rename location"),t));return}finally{s.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Du.get(this.editor)?.showMessage(o.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new I1(this.editor,hr.Position|hr.Value,o.range,this._cts.token),a=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(a),l=await Promise.all(c.map(async p=>[p,await p.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(p,m)=>{let v=l.slice();return p===rF.Automatic&&(v=v.filter(([w,b])=>b)),v.map(([w])=>w.provideNewSymbolNames(a,o.range,p,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,c.length>0?d:void 0,r);if(e("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=dw(i.provideRenameEdits(u.newName,r.token),r.token).then(async p=>{if(!p){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(p.rejectReason){e(`returning early - rejected with reason: ${p.rejectReason}`),this._notificationService.info(p.rejectReason);return}this.editor.setSelection(O.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(bb,2,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(bb,3,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&sa(g(bb,4,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applying edits ${JSON.stringify(m,null," ")}`),this._notificationService.error(g(bb,5,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(bb,6,"Rename failed to compute edits")),this._logService.error(p)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const s=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",s)}},RAe=GN,GN.ID="editor.contrib.renameController",GN);F1=RAe=D([_(1,be),_(2,Pi),_(3,vO),_(4,eD),_(5,Ze),_(6,dl),_(7,ht),_(8,rn)],F1);class ZUt extends lt{constructor(){super({id:"editor.action.rename",label:g(bb,7,"Rename Symbol"),alias:"Rename Symbol",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(jt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=e.get(Ze),s=F1.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}vn(F1.ID,F1,mi.Lazy);Fe(ZUt);const TFe=Jc.bindToContribution(F1.get);Ke(new TFe({id:"acceptRenameInput",precondition:zz,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Enter}}));Ke(new TFe({id:"acceptRenameInputWithPreview",precondition:ge.and(zz,ge.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:V.CtrlCmd+E.Enter}}));Ke(new TFe({id:"cancelRenameInput",precondition:zz,handler:n=>n.cancelRenameInput(),kbOpts:{weight:ye.EditorContrib+99,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));At(class extends pi{constructor(){super({id:"focusNextRenameSuggestion",title:{...Be(bb,8,"Focus Next Rename Suggestion")},precondition:zz,keybinding:[{primary:E.DownArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(jt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends pi{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Be(bb,9,"Focus Previous Rename Suggestion")},precondition:zz,keybinding:[{primary:E.UpArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(jt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusPreviousRenameSuggestion()}});nA("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;Bt(typeof s=="string");const{renameProvider:o}=n.get(ht);return XUt(o,e,t,s)});nA("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(ht),o=await new LFe(e,t,i).resolveRenameLocation(qe.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:ut.LANGUAGE_OVERRIDABLE,description:g(bb,10,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var OH;let kie=(OH=class extends ${constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(x.minimap)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{const o=this.editor.getModel()?.getLanguageId();o&&s.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new yn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!s?.markers))return{foldingRules:s,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),c=a.findTokenIndexAtOffset(r.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===Ar.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),s=e.map(o=>eVt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,c=r.length;a0&&(h=e.subarray(t,t+d),t+=d),r[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:r}}function Dhe(n){return n&&!!n.data}function hnt(n){return n&&Array.isArray(n.edits)}class sVt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function unt(n,e){return n.has(e)}function oVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function gnt(n,e,t,i,s){const o=oVt(n,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){l=d,c=null}return(!c||!Dhe(c)&&!hnt(c))&&(c=null),new sVt(a,c,l)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function rVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class aVt{constructor(e,t){this.provider=e,this.tokens=t}}function cVt(n,e){return n.has(e)}function fnt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function RFe(n,e,t,i){const s=fnt(n,e),o=await Promise.all(s.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){er(c),a=null}return(!a||!Dhe(a))&&(a=null),new aVt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}yt.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht),o=rVt(s,i);return o?o[0].getLegend():n.get(ji).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});yt.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht);if(!unt(s,i))return n.get(ji).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await gnt(s,i,null,null,qe.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!Dhe(a))return;const c=d6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});yt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P);const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=fnt(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!O.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await RFe(o,s,O.lift(i),qe.None);if(a)return a.provider.getLegend()});yt.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P),Bt(O.isIRange(i));const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=await RFe(o,s,O.lift(i),qe.None);if(!(!r||!r.tokens))return d6({id:0,type:"full",data:r.tokens.data})});const MFe="editor.semanticHighlighting";function $J(n,e,t){const i=t.getValue(MFe,{overrideIdentifier:n.getLanguageId(),resource:n.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var MD;let MAe=class extends ${constructor(e,t,i,s,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new NAe(d,e,i,o,r)},c=(d,h)=>{h.dispose(),delete this._watchers[d.uri.toString()]},l=()=>{for(const d of t.getModels()){const h=this._watchers[d.uri.toString()];$J(d,i,s)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{$J(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{$J(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(MFe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};MAe=D([_(0,gde),_(1,Ai),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],MAe);var x0;let NAe=(x0=class extends ${constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:MD.REQUEST_MIN_DELAY,max:MD.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new yn(()=>this._fetchDocumentSemanticTokensNow(),MD.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!unt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ai,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=gnt(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(c=>{o.push(c)}),a=new ao(!1);s.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,o)}},c=>{c&&(Na(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||bt(c),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(hnt(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=o.data,l=new Uint32Array(c.length+a);let d=c.length,h=l.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>c.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(MD._copy(c,d-p,l,h-p,p),h-=p),f.data&&(MD._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&MD._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(Dhe(t)){this._currentDocumentResponse=new lVt(e,t.resultId,t.data);const a=RYe(t,i,this._model.getLanguageId());if(s.length>0)for(const c of s)for(const l of a)for(const d of c.changes)l.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},MD=x0,x0.REQUEST_MIN_DELAY=300,x0.REQUEST_MAX_DELAY=2e3,x0);NAe=MD=D([_(1,gde),_(2,pn),_(3,B_),_(4,ht)],NAe);class lVt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}KQ(MAe);var PAe,qN;let WV=(qN=class extends ${static get(e){return e.getContribution(PAe.ID)}constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new yn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(MFe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=na(r=>Promise.resolve(RFe(this._provider,e,t,r))),o=new ao(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=r,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,RYe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},PAe=qN,qN.ID="editor.contrib.viewportSemanticTokens",qN);WV=PAe=D([_(1,gde),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],WV);vn(WV.ID,WV,mi.AfterFirstRender);class dVt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===Q.Underline||h===Q.Dash))break;if(Bk(h)&&fy(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new O(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var FAe;const Lie="vs/editor/contrib/smartSelect/browser/smartSelect";class NFe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new NFe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var QN;let RF=(QN=class{static get(e){return e.getContribution(FAe.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await mnt(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),qe.None).then(o=>{if(!(!mo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ls(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),o[r].unshift(t[r]);this._state=o.map(r=>new NFe(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>mt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},FAe=QN,QN.ID="editor.contrib.smartSelectController",QN);RF=FAe=D([_(1,ht)],RF);class pnt extends lt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=RF.get(t);i&&await i.run(this._forward)}}class hVt extends pnt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(Lie,0,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.RightArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.RightArrow,secondary:[V.WinCtrl|V.Shift|E.RightArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,1,"&&Expand Selection"),order:2}})}}yt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class uVt extends pnt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(Lie,2,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.LeftArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.LeftArrow,secondary:[V.WinCtrl|V.Shift|E.LeftArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,3,"&&Shrink Selection"),order:3}})}}vn(RF.ID,RF,mi.Lazy);Fe(hVt);Fe(uVt);async function mnt(n,e,t,i,s){const o=n.all(e).concat(new dVt(i.selectSubwords));o.length===1&&o.unshift(new Tte);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,s)).then(l=>{if(mo(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>oe.isBefore(u.getStartPosition(),f.getStartPosition())?1:oe.isBefore(f.getStartPosition(),u.getStartPosition())||oe.isBefore(u.getEndPosition(),f.getEndPosition())?-1:oe.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const l=[];let d;for(const u of c)(!d||O.containsRange(u,d)&&!O.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;un}),Spe="data-sticky-line-index",yze="data-sticky-is-line",fVt="data-sticky-is-line-number",Sze="data-sticky-is-folding-icon";class pVt extends ${constructor(e){super(),this._editor=e,this._foldingIconStore=new Z,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(x.lineHeight),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof oC),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(x.stickyScroll).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.stickyScroll)&&t(),i.hasChanged(x.lineHeight)&&(this._lineHeight=this._editor.getOption(x.lineHeight))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const s=this._isWidgetHeightZero(e),o=s?void 0:e,r=s?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(o,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,s=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+s.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new oe(t,1)).lineNumber,a=o.getViewLineRenderingData(r),c=this._editor.getOption(x.lineNumbers);let l;try{l=ig.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new tL(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,l,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),h=new fz(2e3),u=lQ(d,h);let f;Cze?f=Cze.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(Spe,String(e)),p.setAttribute(yze,""),p.setAttribute("role","listitem"),p.tabIndex=0,p.className="sticky-line-content",p.classList.add(`stickyLine${t}`),p.style.lineHeight=`${this._lineHeight}px`,p.innerHTML=f;const m=document.createElement("span");m.setAttribute(Spe,String(e)),m.setAttribute(fVt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=s.contentLeft;m.style.width=`${v}px`;const w=document.createElement("span");c.renderType===Qr.On||c.renderType===Qr.Interval&&t%10===0?w.innerText=t.toString():c.renderType===Qr.Relative&&(w.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),w.className="sticky-line-number-inner",w.style.lineHeight=`${this._lineHeight}px`,w.style.width=`${s.lineNumbersWidth}px`,w.style.paddingLeft=`${s.lineNumbersLeft}px`,m.appendChild(w);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(w),m.style.lineHeight=`${this._lineHeight}px`,p.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`;const C=new mVt(e,t,p,m,b,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,s=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,s.style.zIndex=o?r:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=o?c:l,s.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const c=s.isCollapsed(o),l=new _Vt(c,r,s.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute(Sze,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Yf.TOP_CENTER,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=PMe(t.characterMapping,e,0);return new oe(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,Spe);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,yze)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Sze)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class mVt{constructor(e,t,i,s,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class _Vt{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width=`${s}px`,this.domNode.style.height=`${s}px`,this.domNode.className=$e.asClassName(e?ite:tte)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class i8{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Tie{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class _nt{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var n8;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(n8||(n8={}));var fI;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(fI||(fI={}));let OAe=class extends ${constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Lu(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case n8.OUTLINE_MODEL:this._modelProviders.push(new BAe(this._editor,s));case n8.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new HAe(this._editor,t,s));case n8.INDENTATION_MODEL:this._modelProviders.push(new WAe(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const o=await i;if(this._modelPromise!==s)return null;switch(o){case fI.CANCELED:return this._updateOperation.clear(),null;case fI.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};OAe=D([_(2,be),_(3,ht)],OAe);class vnt extends ${constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,fI.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=na(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?fI.CANCELED:(this._stickyModel=this.createStickyModel(e,i),fI.VALID):this._invalid()).then(void 0,i=>(bt(i),fI.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let BAe=class extends vnt{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return oy.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new _nt(o.uri,o.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(fi.first(e.children.values())instanceof ZSe){const a=fi.find(e.children.values(),c=>c.id===t);if(a)i=a.children;else{let c="",l=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>l&&(d=u,l=f,c=u.id)}t=c,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,c)=>{const l=new i8(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new i8(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Tie(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new i8(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Tie(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof XSe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};BAe=D([_(1,ht)],BAe);class wnt extends vnt{constructor(e){super(e),this._foldingLimitReporter=new CZe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new _nt(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new Tie(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new mPe(e.getModel(),s,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};HAe=D([_(2,ht)],HAe);class vVt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var BH;let UAe=(BH=class extends ${constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new I),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Z),this._updateSoon=this._register(new yn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.stickyScroll)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(x.stickyScroll).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Ee(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new OAe(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ai,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(CU(a,e.startLineNumber+s,(d,h)=>d-h));for(let d=c;d<=l;d++){const h=t.children[d];if(!h)return;if(h.range){const u=h.range.startLineNumber,f=h.range.endLineNumber;e.startLineNumber<=f+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new vVt(u,f-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s,o)}}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=this._editor._getViewModel()?.getHiddenAreas();if(i)for(const s of i)t=t.filter(o=>!(o.startLineNumber>=s.startLineNumber&&o.endLineNumber<=s.endLineNumber+1));return t}},BH.ID="store.contrib.stickyScrollController",BH);UAe=D([_(1,ht),_(2,lo)],UAe);var VAe,jN;let Gx=(jN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new Z,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new pVt(this._editor),this._stickyLineCandidateProvider=new UAe(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bze([],[],0),this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(pe(c,xe.CONTEXT_MENU,async d=>{this._onContextMenu(gt(c),d)})),this._stickyScrollFocusedContextKey=X.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=X.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Dd(c));this._register(l.onDidBlur(d=>{this._positionRevealed===!1&&c.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(l.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(pe(c,xe.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(VAe.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,vt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(O.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new phe(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new O(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(Xo(s,xe.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(l===null)return;const d=new oe(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(l===null)return;c=new oe(l,1)}this._revealPosition(c)})),this._register(Xo(s,xe.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(pe(s,xe.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:c,textElement:l}=a;if(!c.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=c,e.clear();else if(l.style.textDecoration==="underline")return;const d=new ai;e.add(Ee(()=>d.dispose(!0)));let h;vhe(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=l;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(iit,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new yu(e,t);this._contextMenuService.showContextMenu({menuId:Te.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;vZe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(x.stickyScroll);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===Qr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(x.stickyScroll)||e.hasChanged(x.minimap)||e.hasChanged(x.lineHeight)||e.hasChanged(x.showFoldingControls)||e.hasChanged(x.lineNumbers))&&this._readConfiguration(),e.hasChanged(x.lineNumbers)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(x.lineHeight);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const i=this._stickyLineCandidateProvider.getVersionId();if(i===void 0||i===t.getVersionId())if(this._foldingModel=await Ox.get(this._editor)?.getFoldingModel()??null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let s=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new i8(a[0].startLineNumber,a[a.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(c);for(const d of l){const h=d.startLineNumber,u=d.endLineNumber,f=d.nestingDepth;if(u-h>0){const p=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(h)-i,w=this._editor.getTopForLineNumber(u)-i,b=this._editor.getBottomForLineNumber(u)-i;if(p>w&&p<=b){o.push(h),r.push(u+1),s=b-m;break}else m>v&&m<=b&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new bze(o,r,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},VAe=jN,jN.ID="store.contrib.stickyScrollController",jN);Gx=VAe=D([_(1,Vr),_(2,ht),_(3,be),_(4,lo),_(5,B_),_(6,Pe)],Gx);const Db="vs/editor/contrib/stickyScroll/browser/stickyScrollActions";class wVt extends pi{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Be(Db,0,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(Db,1,"&&Toggle Editor Sticky Scroll")},metadata:{description:Be(Db,2,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Za.View,toggled:{condition:ge.equals("config.editor.stickyScroll.enabled",!0),title:g(Db,3,"Sticky Scroll"),mnemonicTitle:g(Db,4,"&&Sticky Scroll")},menu:[{id:Te.CommandPalette},{id:Te.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Te.StickyScrollContext}]})}async run(e){const t=e.get(Re),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const khe=ye.EditorContrib;class bVt extends wf{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Be(Db,5,"Focus on the editor sticky scroll"),mnemonicTitle:g(Db,6,"&&Focus Sticky Scroll")},precondition:ge.and(ge.has("config.editor.stickyScroll.enabled"),X.stickyScrollVisible),menu:[{id:Te.CommandPalette}]})}runEditorCommand(e,t){Gx.get(t)?.focus()}}class CVt extends wf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Be(Db,7,"Select the next editor sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.DownArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusNext()}}class yVt extends wf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Be(Db,8,"Select the previous sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.UpArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusPrevious()}}class SVt extends wf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Be(Db,9,"Go to the focused sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Enter}})}runEditorCommand(e,t){Gx.get(t)?.goToFocused()}}class AVt extends wf{constructor(){super({id:"editor.action.selectEditor",title:Be(Db,10,"Select Editor"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Escape}})}runEditorCommand(e,t){Gx.get(t)?.selectEditor()}}vn(Gx.ID,Gx,mi.AfterFirstRender);At(wVt);At(bVt);At(yVt);At(CVt);At(SVt);At(AVt);class EVt{constructor(e,t,i,s,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.completion=r}}let zAe=class extends GRe{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(qe.None)}return e}};zAe=D([_(5,ghe)],zAe);let $Ae=class extends ${constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){if(i.selectedSuggestionInfo)return;let o;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){o=f;break}if(!o)return;const r=o.getOption(x.quickSuggestions);if(d2.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),c=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(r,c)!=="inline")return;let l=e.getWordAtPosition(t),d;if(l?.word||(d=this._getTriggerCharacterInfo(e,t)),!l?.word&&!d||(l||(l=e.getWordUntilPosition(t)),l.endColumn!==t.column))return;let h;const u=e.getValueInRange(new O(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new y4e(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await KPe(this._languageFeatureService.completionProvider,e,t,new Q7(void 0,Mte.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:tf.TriggerCharacter,triggerCharacter:d.ch},s);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new Sk(f.items,t.column,new y4e(u,0),Rte.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new zAe(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(qe.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(O.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&s.add(o);if(s.size!==0)return{providers:s,ch:i}}};$Ae=D([_(0,ht),_(1,Mu),_(2,ghe),_(3,jt)],$Ae);KQ($Ae);const xVt="vs/editor/contrib/tokenization/browser/tokenization";class DVt extends lt{constructor(){super({id:"editor.action.forceRetokenize",label:g(xVt,0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new ao;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}Fe(DVt);var kVt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";Ct(kVt,{});var IVt=".editor-banner{background:var(--vscode-banner-background);box-sizing:border-box;cursor:default;display:flex;font-size:12px;height:26px;overflow:visible;width:100%}.editor-banner .icon-container{align-items:center;display:flex;flex-shrink:0;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-position:50%;background-repeat:no-repeat;background-size:16px;margin:0 6px 0 10px;padding:0;width:16px}.editor-banner .message-container{align-items:center;display:flex;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-banner .message-container p{margin-block-end:0;margin-block-start:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{margin:2px 8px;padding:0 12px;width:inherit}.editor-banner .message-actions-container a{margin-left:12px;padding:3px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}";Ct(IVt,{});const LVt=26;let GAe=class extends ${constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(qAe))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,LVt)}};GAe=D([_(1,be)],GAe);let qAe=class extends ${constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(vw,{}),this.element=we("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=we("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Yo(this.element)}show(e){Yo(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=he(this.element,we("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(we(`div${$e.asCSSSelector(e.icon)}`));const s=he(this.element,we("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=he(this.element,we("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(t6,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=he(this.element,we("div.action-container"));this.actionBar=this._register(new Qh(o)),this.actionBar.push(this._register(new xn("banner.close","Close Banner",$e.asClassName(VXe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};qAe=D([_(0,be)],qAe);const cl="vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter",TVt=Ki("extensions-warning-message",Ce.warning,g(cl,0,"Icon shown with a warning message in the extensions editor."));var WH;let h6=(WH=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:g(cl,1,"This document contains many non-basic ASCII unicode characters"),command:new g6};else if(o.ambiguousCharacterCount>=r)a={message:g(cl,2,"This document contains many ambiguous unicode characters"),command:new MF};else if(o.invisibleCharacterCount>=r)a={message:g(cl,3,"This document contains many invisible unicode characters"),command:new u6};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:TVt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(GAe,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(x.unicodeHighlighting)&&(this._options=e.getOption(x.unicodeHighlighting),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=RVt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Gd:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new QAe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new MVt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},WH.ID="editor.contrib.unicodeHighlighter",WH);h6=D([_(1,kd),_(2,oA),_(3,be)],h6);function RVt(n,e){return{nonBasicASCII:e.nonBasicASCII===Rp?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Rp?!n:e.includeComments,includeStrings:e.includeStrings===Rp?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let QAe=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!rNe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Cnt(i,this._options),inComment:aNe(t,e),inString:cNe(t,e)}}};QAe=D([_(3,kd)],QAe);class MVt extends ${constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=vMe.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return rNe(t,e)?{reason:Cnt(i,this._options),inComment:aNe(t,e),inString:cNe(t,e)}:null}}const bnt=g(cl,4,"Configure Unicode Highlight Options");let jAe=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=this._editor.getContribution(h6.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=s.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=Ape(h);let f;switch(l.reason.kind){case Wv.Ambiguous:{qq(l.reason.confusableWith)?f=g(cl,5,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,Ape(l.reason.confusableWith.codePointAt(0))):f=g(cl,6,"The character {0} could be confused with the character {1}, which is more common in source code.",u,Ape(l.reason.confusableWith.codePointAt(0)));break}case Wv.Invisible:f=g(cl,7,"The character {0} is invisible.",u);break;case Wv.NonBasicAscii:f=g(cl,8,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(cl,9,"Adjust settings"),v=`command:${Mie.ID}?${encodeURIComponent(JSON.stringify(p))}`,w=new Xt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,bnt);o.push(new xb(this,c.range,[w],!1,a++))}return o}renderHoverParts(e,t){return yOt(e,t,this._editor,this._languageService,this._openerService)}};jAe=D([_(1,Di),_(2,fr)],jAe);function KAe(n){return`U+${n.toString(16).padStart(4,"0")}`}function Ape(n){let e=`\`${KAe(n)}\``;return aM.isInvisibleCharacter(n)||(e+=` "${`${NVt(n)}`}"`),e}function NVt(n){return n===Q.BackTick?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function Cnt(n,e){return vMe.computeUnicodeHighlightReason(n,e)}const Ace=class Ace{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=Kt.createDynamic({description:"unicode-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};Ace.instance=new Ace;let Rie=Ace;const ABe=class ABe extends lt{constructor(){super({id:MF.ID,label:g(cl,10,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(cl,11,"Disable Highlight In Comments")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeComments,!1,Ot.USER)}};ABe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let YAe=ABe;const EBe=class EBe extends lt{constructor(){super({id:MF.ID,label:g(cl,12,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(cl,13,"Disable Highlight In Strings")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeStrings,!1,Ot.USER)}};EBe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let JAe=EBe;const Ece=class Ece extends lt{constructor(){super({id:Ece.ID,label:g(cl,14,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(cl,15,"Disable Ambiguous Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.ambiguousCharacters,!1,Ot.USER)}};Ece.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let MF=Ece;const xce=class xce extends lt{constructor(){super({id:xce.ID,label:g(cl,16,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(cl,17,"Disable Invisible Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.invisibleCharacters,!1,Ot.USER)}};xce.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let u6=xce;const Dce=class Dce extends lt{constructor(){super({id:Dce.ID,label:g(cl,18,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(cl,19,"Disable Non ASCII Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.nonBasicASCII,!1,Ot.USER)}};Dce.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let g6=Dce;const kce=class kce extends lt{constructor(){super({id:kce.ID,label:g(cl,20,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:s,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(s),l=e.get(On),d=e.get(Re);function h(p){return aM.isInvisibleCharacter(p)?g(cl,21,"Exclude {0} (invisible character) from being highlighted",KAe(p)):g(cl,22,"Exclude {0} from being highlighted",`${KAe(p)} "${c}"`)}const u=[];if(o.kind===Wv.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(cl,23,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{FVt(d,[p])}});if(u.push({label:h(s),run:()=>PVt(d,[s])}),a){const p=new YAe;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new JAe;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===Wv.Ambiguous){const p=new MF;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.Invisible){const p=new u6;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.NonBasicAscii){const p=new g6;u.push({label:p.label,run:async()=>p.runAction(d)})}else OVt(o);const f=await l.pick(u,{title:bnt});f&&await f.run()}};kce.ID="editor.action.unicodeHighlight.showExcludeOptions";let Mie=kce;async function PVt(n,e){const t=n.getValue(Ug.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(Ug.allowedCharacters,i,Ot.USER)}async function FVt(n,e){const t=n.inspect(Ug.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await n.updateValue(Ug.allowedLocales,i,Ot.USER)}function OVt(n){throw new Error(`Unexpected value: ${n}`)}Fe(MF);Fe(u6);Fe(g6);Fe(Mie);vn(h6.ID,h6,mi.AfterFirstRender);hL.register(jAe);const D5="vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators",ynt="ignoreUnusualLineTerminators";function BVt(n,e,t){n.setModelProperty(e.uri,ynt,t)}function WVt(n,e){return n.getModelProperty(e.uri,ynt)}var HH;let Nie=(HH=class extends ${constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(x.unusualLineTerminators),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||WVt(this._codeEditorService,e)===!0||this._editor.getOption(x.readOnly))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:g(D5,0,"Unusual Line Terminators"),message:g(D5,1,"Detected unusual line terminators"),detail:g(D5,2,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",ui(e.uri)),primaryButton:g(D5,3,"&&Remove Unusual Line Terminators"),cancelButton:g(D5,4,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){BVt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},HH.ID="editor.contrib.unusualLineTerminatorsDetector",HH);Nie=D([_(1,To),_(2,jt)],Nie);vn(Nie.ID,Nie,mi.AfterFirstRender);var nl,XAe;const PFe="vs/editor/contrib/wordHighlighter/browser/wordHighlighter",Ihe=new Y("hasWordHighlights",!1);function Snt(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,er)),mo).then(o=>{if(o){const r=new wi;return r.set(e.uri,o),r}return new wi})}function HVt(n,e,t,i,s,o){const r=n.ordered(e);return Qle(r.map(a=>()=>{const c=o.filter(l=>gS(l)).filter(l=>fde(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,s)).then(void 0,er)}),a=>a instanceof wi&&a.size>0)}class FFe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=na(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new O(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=r&&(c=!0)}return c}cancel(){this.result.cancel()}}class UVt extends FFe{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return Snt(this._providers,e,t.getPosition(),s).then(o=>o||new wi)}}class VVt extends FFe{constructor(e,t,i,s,o){super(e,t,i),this._providers=s,this._otherModels=o}_compute(e,t,i,s){return HVt(this._providers,e,t.getPosition(),i,s,this._otherModels).then(o=>o||new wi)}}class Ant extends FFe{constructor(e,t,i,s,o){super(e,t,s),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,s){return Ta(250,s).then(()=>{const o=new wi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new wi;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:D9.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function zVt(n,e,t,i,s){return n.has(e)?new UVt(e,t,s,n):new Ant(e,t,i,s,[])}function $Vt(n,e,t,i,s,o){return n.has(e)?new VVt(e,t,s,n,o):new Ant(e,t,i,s,o)}nA("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(ht);return(await Snt(i.documentHighlightProvider,e,t,qe.None))?.get(e.uri)});var D0;let ZAe=(D0=class{constructor(e,t,i,s,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=Ihe.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():nl.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(x.occurrencesHighlight);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,nl.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}stop(){this.occurrencesHighlight!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(O.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=nl.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),nl.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const i of e){if(!i.hasModel())continue;const s=nl.storedDecorations.get(i.getModel().uri);if(!s)continue;i.removeDecorations(s),t.push(i.getModel().uri);const o=Cm.get(i);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)nl.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell&&nl.query?.modelInfo?.model.uri.scheme!==_e.vscodeNotebookCell?(nl.query=null,this._run()):nl.query?.modelInfo&&(nl.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==Hi.Explicit&&this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===_e.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===_e.vscodeNotebookCell&&o.push(c)}return o}const i=[],s=this.codeEditorService.listCodeEditors();for(const o of s){if(!ew(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const o of s){const r=o.getModel();r&&r!==e&&i.push(r)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){nl.query=null,this._stopAll();return}const s=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>s||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,i,s){return s.length?$Vt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),s):zVt(this.providers,e,t,i,this.editor.getOption(x.wordSeparators))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=Cm.get(t);if(!i)continue;const s=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=nl.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&s.push({range:l.range,options:gUt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],s)}),nl.storedDecorations=nl.storedDecorations.set(o,c),s.length>0&&(i.wordHighlighter?.decorations.set(s),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},nl=D0,D0.storedDecorations=new wi,D0.query=null,D0);ZAe=nl=D([_(4,jt)],ZAe);var KN;let Cm=(KN=class extends ${static get(e){return e.getContribution(XAe.ID)}constructor(e,t,i,s){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new ZAe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}stopHighlighting(){this._wordHighlighter?.stop()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},XAe=KN,KN.ID="editor.contrib.wordHighlighter",KN);Cm=XAe=D([_(1,Pe),_(2,ht),_(3,jt)],Cm);class Ent extends lt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Cm.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class GVt extends Ent{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(PFe,0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:E.F7,weight:ye.EditorContrib}})}}class qVt extends Ent{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(PFe,1,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|E.F7,weight:ye.EditorContrib}})}}class QVt extends lt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(PFe,2,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Ihe.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:0,weight:ye.EditorContrib}})}run(e,t,i){const s=Cm.get(t);s&&s.restoreViewState(!0)}}vn(Cm.ID,Cm,mi.Eager);Fe(GVt);Fe(qVt);Fe(QVt);const jVt="vs/editor/contrib/wordOperations/browser/wordOperations";class Lhe extends Jc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=new oe(c.positionLineNumber,c.positionColumn),d=this._move(s,o,l,this._wordNavigationType);return this._moveTo(c,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Hi.Explicit,a.map(c=>zn.fromModelSelection(c))),a.length===1){const c=new oe(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(c,vt.Smooth)}}_moveTo(e,t,i){return i?new mt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new mt(t.lineNumber,t.column,t.lineNumber,t.column)}}class gL extends Lhe{_move(e,t,i,s){return Es.moveWordLeft(e,t,i,s)}}class fL extends Lhe{_move(e,t,i,s){return Es.moveWordRight(e,t,i,s)}}class KVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class YVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class JVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.LeftArrow,mac:{primary:V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}class XVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class ZVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class e4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.LeftArrow,mac:{primary:V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}class t4t extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class i4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class n4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class s4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.RightArrow,mac:{primary:V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class o4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordRight",precondition:void 0})}}class r4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class a4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.RightArrow,mac:{primary:V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}class c4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class l4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class d4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class The extends Jc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(lo);if(!t.hasModel())return;const o=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new zd(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class OFe extends The{_delete(e,t){const i=Es.deleteWordLeft(e,t);return i||new O(1,1,1,1)}}class BFe extends The{_delete(e,t){const i=Es.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class h4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartLeft",precondition:X.writable})}}class u4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndLeft",precondition:X.writable})}}class g4t extends OFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Backspace,mac:{primary:V.Alt|E.Backspace},weight:ye.EditorContrib}})}}class f4t extends BFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartRight",precondition:X.writable})}}class p4t extends BFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndRight",precondition:X.writable})}}class m4t extends BFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Delete,mac:{primary:V.Alt|E.Delete},weight:ye.EditorContrib}})}}class _4t extends lt{constructor(){super({id:"deleteInsideWord",precondition:X.writable,label:g(jVt,0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=Es.deleteInsideWord(s,o,c);return new zd(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ke(new KVt);Ke(new YVt);Ke(new JVt);Ke(new XVt);Ke(new ZVt);Ke(new e4t);Ke(new n4t);Ke(new s4t);Ke(new o4t);Ke(new r4t);Ke(new a4t);Ke(new c4t);Ke(new t4t);Ke(new i4t);Ke(new l4t);Ke(new d4t);Ke(new h4t);Ke(new u4t);Ke(new g4t);Ke(new f4t);Ke(new p4t);Ke(new m4t);Fe(_4t);class v4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordPartLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Backspace},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartLeft(e);return i||new O(1,1,1,1)}}class w4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordPartRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Delete},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class xnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartLeft(e,t,i)}}class b4t extends xnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class C4t extends xnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Dnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartRight(e,t,i)}}class y4t extends Dnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class S4t extends Dnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}Ke(new v4t);Ke(new w4t);Ke(new b4t);Ke(new C4t);Ke(new y4t);Ke(new S4t);const Aze="vs/editor/contrib/readOnlyMessage/browser/contribution",xBe=class xBe extends ${constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Du.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Xt(g(Aze,0,"Cannot edit in read-only input")):t=new Xt(g(Aze,1,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};xBe.ID="editor.contrib.readOnlyMessageController";let Pie=xBe;vn(Pie.ID,Pie,mi.BeforeFirstInteraction);let eEe=class extends ${constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=xi(this,void 0);const s=Bh("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Bh("_textModel.onDidChangeContent",T.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(xm(async(r,a)=>{s.read(r),o.read(r);const c=a.add(new l1t),l=await this._outlineModelService.getOrCreate(this._textModel,c.token);a.isDisposed||this._currentModel.set(l,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(Kqe(El(o=>o.range.endLineNumber-o.range.startLineNumber,cg))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};eEe=D([_(1,ht),_(2,JQ)],eEe);Yee.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(eEe,n));var A4t='.monaco-editor .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiM0MjQyNDIiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px;height:36px;margin:0;min-height:0;min-width:0;overflow:hidden;padding:0;position:absolute;resize:none;width:58px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiNDNUM1QzUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #252526}';Ct(A4t,{});const DBe=class DBe extends ${constructor(e){super(),this.editor=e,this.widget=null,I_&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new tEe(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};DBe.ID="editor.contrib.iPadShowKeyboard";let Fie=DBe;const Ice=class Ice extends ${constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(pe(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(pe(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Ice.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}};Ice.ID="editor.contrib.ShowKeyboardWidget";let tEe=Ice;vn(Fie.ID,Fie,mi.Eventually);function iEe(n){return!!n.workspaceUri}function GJ(n){return!!n.folderUri}function E4t(n){return!!n.fileUri}function x4t(n){const e=D4t(n),t=n.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||ei&&rf?"classic":t}var Eze;(function(n){n.TITLE_BAR_STYLE="window.titleBarStyle",n.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(Eze||(Eze={}));var ry;(function(n){n.NATIVE="native",n.CUSTOM="custom"})(ry||(ry={}));var xze;(function(n){n.AUTO="auto",n.WINDOWED="windowed",n.NEVER="never"})(xze||(xze={}));function D4t(n,e){return e||(e=knt(n)),e===ry.NATIVE}function knt(n){if(Jn)return ry.CUSTOM;const e=n.getValue("window");if(e){if(ei&&e.nativeTabs===!0||ei&&e.nativeFullScreen===!1)return ry.NATIVE;const s=e.titleBarStyle;if(s===ry.NATIVE||s===ry.CUSTOM)return s}return jr?ry.NATIVE:ry.CUSTOM}function WFe(n){return{id:Int(n),configPath:n}}function k4t(n){return{id:Int(n),uri:n}}function Int(n){return Ed(n.toString()).toString(16)}const Sn="vs/base/common/date",nEe=60,sEe=nEe*60,f6=sEe*24,Dze=f6*7,kze=f6*30,Ize=f6*365;function HFe(n,e,t,i){typeof n!="number"&&(n=n.getTime());const s=Math.round((new Date().getTime()-n)/1e3);if(s<-30)return g(Sn,0,"in {0}",HFe(new Date().getTime()+s*1e3,!1));if(s<30)return g(Sn,1,"now");let o;return s{await Promise.all(Wnt.map(t=>t(e)))}),await n.invokeFunction(async e=>{RJe((t,i)=>n.createInstance(gF,t,i,{})),KJe(e.get(el))}),await n.invokeFunction(async e=>{const t=e.get(mg);await Promise.all(Hnt.map(i=>i(e))),t.phase=2}),await n.invokeFunction(async e=>{await Promise.all(Unt.map(t=>t(e)))}),VFe.open(),Bnt.fire(),n.invokeFunction(async e=>{const t=e.get(mg);it.as(pf.Workbench).start(e),it.as(zS.EditorFactory).start(e),Fnt.fire(e),Ont.fire(e),await Promise.race([e.get(kO).whenRestored,Ta(2e3)]),t.phase=3,new yn(()=>{AW(window,()=>{t.phase=4},2500)},2500).schedule()})}let Vnt=!1;Lt.withServices(()=>(Vnt=!0,$.None));async function znt(){await VFe.wait()}function B4t(){if(Vnt)throw new Error("Services are already initialized")}const W4t="vs/workbench/browser/quickaccess",$nt="inQuickOpen",H4t=new Y($nt,!1,g(W4t,0,"Whether keyboard focus is inside the quick open control")),aA=ge.has($nt),U4t="inFilesPicker",Gnt=ge.and(aA,ge.has(U4t));function Rhe(n,e){return t=>{const i=t.get(ti),s=t.get(On),r={keybindings:i.lookupKeybindings(n)};s.navigate(!!e,r)}}let Lze=class extends ${constructor(e,t){super(),this.editorService=e,this.editorGroupsService=t,this._editorViewState=void 0,this.openedTransientEditors=new Set}set(){if(this._editorViewState)return;const e=this.editorService.activeEditorPane;e&&(this._editorViewState={group:e.group,editor:e.input,state:gmt(e.getControl())?.saveViewState()??void 0})}async openTransientEditor(e,t){e.options={...e.options,transient:!0};const i=await this.editorService.openEditor(e,t);return i?.input&&i.input!==this._editorViewState?.editor&&i.group.isTransient(i.input)&&this.openedTransientEditors.add(i.input),i}async restore(){if(this._editorViewState){for(const e of this.openedTransientEditors)if(!e.isDirty())for(const t of this.editorGroupsService.groups)t.isTransient(e)&&await t.closeEditor(e,{preserveFocus:!0});await this._editorViewState.group.openEditor(this._editorViewState.editor,{viewState:this._editorViewState.state,preserveFocus:!0}),this.reset()}}reset(){this._editorViewState=void 0,this.openedTransientEditors.clear()}dispose(){super.dispose(),this.reset()}};Lze=D([_(0,_i),_(1,ur)],Lze);let oEe=class extends Vee{constructor(e,t,i,s,o,r){super(t,s,o,r,e),this.keybindingService=i,this.inQuickInputContext=H4t.bindTo(this.contextKeyService),this.registerListeners()}registerListeners(){this._register(this.onShow(()=>this.inQuickInputContext.set(!0))),this._register(this.onHide(()=>this.inQuickInputContext.set(!1)))}createController(){return super.createController(this.layoutService,{ignoreFocusOut:()=>!this.configurationService.getValue("workbench.quickOpen.closeOnFocusLost"),backKeybindingLabel:()=>this.keybindingService.lookupKeybinding("workbench.action.quickInputBack")?.getLabel()||void 0})}};oEe=D([_(0,Re),_(1,be),_(2,ti),_(3,Pe),_(4,pn),_(5,bg)],oEe);function V4t(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class s8{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,s);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return V4t(s8.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const o=s8.termFrequencies(s);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:s,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let c=i.get(o);typeof c!="number"&&(c=this.computeIdf(o),i.set(o,c));const l=a*c;s+=l*r}return s}computeEmbedding(e){const t=s8.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function z4t(n){const e=n.slice(0);e.sort((i,s)=>s.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var BE;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(BE||(BE={}));function Epe(n){const e=n;return Array.isArray(e.items)}function Tze(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class $Fe extends ${constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new Dn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ai(t);const d=o.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,l,d,i),f=(m,v)=>{let w,b;if(Epe(m)?(w=m.items,b=m.active):w=m,w.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(SU(this.options.noResultsPick)?w=[this.options.noResultsPick(h)]:w=[this.options.noResultsPick])}return e.items=w,b&&(e.activeItems=[b]),!0},p=async m=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Ta(m.mergeDelay),d.isCancellationRequested)||w||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const b=await m.additionalPicks;if(d.isCancellationRequested)return;let C,y;Epe(m.picks)?(C=m.picks.items,y=m.picks.active):C=m.picks;let S,M;if(Epe(b)?(S=b.items,M=b.active):S=b,S.length>0||!v){let k;if(!y&&!M){const F=e.activeItems[0];F&&C.indexOf(F)!==-1&&(k=F)}f({items:[...C,...S],active:y||M||k})}}finally{d.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(u!==null)if(Tze(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;Tze(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(l=>{if(i?.handleAccept){l.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0]);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))}));const c=async(l,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(l)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),f=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(f){case BE.NO_ACTION:break;case BE.CLOSE_PICKER:e.hide();break;case BE.REFRESH_PICKER:a();break;case BE.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),w=e.activeItems.filter(C=>C!==v[0]),b=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,w&&(e.activeItems=w),e.keepScrollPosition=b}break}}}};return s.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),s.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),s}}var ZL,Aa;const IL="vs/platform/quickinput/browser/commandsQuickAccess";var Oy;let rEe=(Oy=class extends $Fe{constructor(e,t,i,s,o,r){super(ZL.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(p6)),this.options=e}async _getPicks(e,t,i,s){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=cw(()=>{const f=new s8;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return z4t(p).filter(m=>m.score>ZL.TFIDF_THRESHOLD).slice(0,ZL.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=ZL.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?ZL.WORD_FILTER(e,f.commandAlias)??void 0:void 0;if(p||m)f.highlights={label:p,detail:this.options.showAlias?m:void 0},a.push(f);else if(e===f.commandId)a.push(f);else if(e.length>=3){const v=r();if(i.isCancellationRequested)return[];const w=v.find(b=>b.key===f.commandId);w&&(f.tfIdfScore=w.score,a.push(f))}}const c=new Map;for(const f of a){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}a.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const m=this.commandsHistory.peek(f.commandId),v=this.commandsHistory.peek(p.commandId);if(m&&v)return m>v?-1:1;if(m)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(f.commandId),b=this.options.suggestedCommandIds.has(p.commandId);if(w&&b)return 0;if(w)return-1;if(b)return 1}return f.label.localeCompare(p.label)});const l=[];let d=!1,h=!0,u=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(o,a,e,i);if(i.isCancellationRequested)return[];const p=f.map(m=>this.toCommandPick(m,s));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(IL,1,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?g(IL,4,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Na(o)||this.dialogService.error(g(IL,5,"Command '{0}' resulted in an error",e.label),Ma(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}},ZL=Oy,Oy.PREFIX=">",Oy.TFIDF_THRESHOLD=.5,Oy.TFIDF_MAX_RESULTS=5,Oy.WORD_FILTER=KU(dF,YD,pde),Oy);rEe=ZL=D([_(1,be),_(2,ti),_(3,ji),_(4,rn),_(5,To)],rEe);var Eb;let p6=(Eb=class extends ${constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===nS.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Aa.getConfiguredCommandHistoryLength(this.configurationService),Aa.cache&&Aa.cache.limit!==this.configuredCommandsHistoryLength&&(Aa.cache.limit=this.configuredCommandsHistoryLength,Aa.hasChanges=!0))}load(){const e=this.storageService.get(Aa.PREF_KEY_CACHE,ke.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=Aa.cache=new L_(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Aa.counter=this.storageService.getNumber(Aa.PREF_KEY_COUNTER,ke.PROFILE,Aa.counter)}push(e){Aa.cache&&(Aa.cache.set(e,Aa.counter++),Aa.hasChanges=!0)}peek(e){return Aa.cache?.peek(e)}saveState(){if(!Aa.cache||!Aa.hasChanges)return;const e={usesLRU:!0,entries:[]};Aa.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Aa.PREF_KEY_CACHE,JSON.stringify(e),ke.PROFILE,ln.USER),this.storageService.store(Aa.PREF_KEY_COUNTER,Aa.counter,ke.PROFILE,ln.USER),Aa.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:Aa.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=Aa.getConfiguredCommandHistoryLength(e);Aa.cache=new L_(i),Aa.counter=1,Aa.hasChanges=!0}},Aa=Eb,Eb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Eb.PREF_KEY_CACHE="commandPalette.mru.cache",Eb.PREF_KEY_COUNTER="commandPalette.mru.counter",Eb.counter=1,Eb.hasChanges=!1,Eb);p6=Aa=D([_(0,on),_(1,Re),_(2,Ze)],p6);class $4t extends rEe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let s;i.metadata?.description&&(XJe(i.metadata.description)?s=i.metadata.description:s={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:s,label:mde(i.label)||i.id})}return t}}var G4t=".monaco-pane-view .split-view-view:first-of-type>.pane>.pane-header{border-top:none!important}.monaco-pane-view .split-view-view:first-of-type>.pane{border-left:none!important}.monaco-pane-view .pane>.pane-header{position:relative}.monaco-pane-view .pane>.pane-header.not-collapsible .twisty-container{display:none}.monaco-pane-view .pane>.pane-header.not-collapsible .title{margin-left:8px}.monaco-pane-view .pane.expanded>.pane-header>.actions.show-expanded,.monaco-pane-view .pane>.pane-header>.actions.show-always{display:initial}.monaco-pane-view .pane>.pane-header>.icon{display:none;height:16px;width:16px}.monaco-pane-view .pane.pane.horizontal:not(.expanded)>.pane-header>.icon{display:inline;margin-top:4px}.monaco-pane-view .pane>.pane-header h3.title{-webkit-margin-before:0;-webkit-margin-after:0;font-size:11px;min-width:3ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description{display:block;flex-shrink:100000;font-weight:400;margin-left:10px;opacity:.6;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description .codicon{font-size:9px;margin-left:2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header .description,.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header h3.title,.monaco-pane-view .pane>.pane-header:not(.expanded) .description{display:none}.monaco-pane-view .pane .monaco-progress-container{left:0;position:absolute;top:-2px;z-index:5}.monaco-pane-view .pane:not(.merged-header) .monaco-progress-container{top:20px}";Ct(G4t,{});var q4t=".monaco-pane-view{height:100%;width:100%}.monaco-pane-view .pane{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.monaco-pane-view .pane.horizontal:not(.expanded){flex-direction:row}.monaco-pane-view .pane>.pane-header{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:11px;font-weight:700;height:22px;overflow:hidden}.monaco-pane-view .pane>.pane-header.not-collapsible{cursor:default}.monaco-pane-view .pane>.pane-header>.title{text-transform:uppercase}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header{flex-direction:column;height:100%;width:22px}.monaco-pane-view .pane>.pane-header>.codicon:first-of-type{margin:0 2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header>.codicon:first-of-type{margin:2px}.monaco-pane-view .pane>.pane-header>.actions{display:none;margin-left:auto}.monaco-pane-view .pane>.pane-header>.actions .action-item{margin-right:4px}.monaco-pane-view .pane>.pane-header>.actions .action-label{padding:2px}.monaco-pane-view .pane:focus-within>.pane-header.expanded>.actions,.monaco-pane-view .pane:hover>.pane-header.expanded>.actions,.monaco-pane-view .pane>.pane-header.actions-always-visible.expanded>.actions,.monaco-pane-view .pane>.pane-header.focused.expanded>.actions{display:initial}.monaco-pane-view .pane>.pane-header .monaco-action-bar .action-item.select-container{cursor:default}.monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{cursor:pointer;min-height:18px;min-width:110px;padding:2px 23px 2px 8px}.linux .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box,.windows .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{padding:0 23px 0 8px}.monaco-pane-view:lang(ja) .pane>.pane-header,.monaco-pane-view:lang(ko) .pane>.pane-header,.monaco-pane-view:lang(zh-Hans) .pane>.pane-header,.monaco-pane-view:lang(zh-Hant) .pane>.pane-header{font-weight:400}.monaco-pane-view .pane>.pane-header.hidden{display:none}.monaco-pane-view .pane>.pane-body{flex:1;overflow:hidden}.monaco-pane-view.animated .split-view-view{transition-duration:.15s;transition-timing-function:ease-out}.reduce-motion .monaco-pane-view .split-view-view{transition-duration:0s!important}.monaco-pane-view.animated.vertical .split-view-view{transition-property:height}.monaco-pane-view.animated.horizontal .split-view-view{transition-property:width}#monaco-pane-drop-overlay{box-sizing:border-box;height:100%;left:0;position:absolute;width:100%;z-index:10000}#monaco-pane-drop-overlay>.pane-overlay-indicator{height:100%;min-height:22px;min-width:19px;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:100%}#monaco-pane-drop-overlay>.pane-overlay-indicator.overlay-move-transition{transition:top 70ms ease-out,left 70ms ease-out,width 70ms ease-out,height 70ms ease-out,opacity .15s ease-out}";Ct(q4t,{});const Q4t="vs/base/browser/ui/splitview/paneview",o9=class o9 extends ${get ariaHeaderLabel(){return this._ariaHeaderLabel}set ariaHeaderLabel(e){this._ariaHeaderLabel=e,this.header.setAttribute("aria-label",this.ariaHeaderLabel)}get draggableElement(){return this.header}get dropTargetElement(){return this.element}get dropBackground(){return this.styles.dropBackground}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize=e,this._onDidChange.fire(void 0)}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize=e,this._onDidChange.fire(void 0)}get headerSize(){return this.headerVisible?o9.HEADER_SIZE:0}get minimumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.minimumBodySize:0;return e+i}get maximumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.maximumBodySize:0;return e+i}constructor(e){super(),this.expandedSize=void 0,this._headerVisible=!0,this._collapsible=!0,this._bodyRendered=!1,this.styles={dropBackground:void 0,headerBackground:void 0,headerBorder:void 0,headerForeground:void 0,leftBorder:void 0},this.animationTimer=void 0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeExpansionState=this._register(new I),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this.orthogonalSize=0,this._expanded=typeof e.expanded>"u"?!0:!!e.expanded,this._orientation=typeof e.orientation>"u"?vi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(Q4t,0,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===vi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=we(".pane")}isExpanded(){return this._expanded}setExpanded(e){return!e&&!this.collapsible||this._expanded===!!e?!1:(this.element?.classList.toggle("expanded",e),this._expanded=!!e,this.updateHeader(),e?(this._bodyRendered||(this.renderBody(this.body),this._bodyRendered=!0),typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),he(this.element,this.body)):this.animationTimer=gt(this.element).setTimeout(()=>{this.body.remove()},200),this._onDidChangeExpansionState.fire(e),this._onDidChange.fire(e?this.expandedSize:void 0),!0)}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible!==!!e&&(this._headerVisible=!!e,this.updateHeader(),this._onDidChange.fire(void 0))}get collapsible(){return this._collapsible}set collapsible(e){this._collapsible!==!!e&&(this._collapsible=!!e,this.updateHeader())}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.element&&(this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL),this.header=we(".pane-header"),he(this.element,this.header),this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button"),this.header.setAttribute("aria-label",this.ariaHeaderLabel),this.renderHeader(this.header);const e=Dd(this.header);this._register(e),this._register(e.onDidFocus(()=>this.header.classList.add("focused"),null)),this._register(e.onDidBlur(()=>this.header.classList.remove("focused"),null)),this.updateHeader();const t=this._register(new Z),i=this._register(new oi(this.header,"keydown")),s=T.map(i.event,o=>new os(o),t);this._register(T.filter(s,o=>o.keyCode===E.Enter||o.keyCode===E.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(T.filter(s,o=>o.keyCode===E.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(T.filter(s,o=>o.keyCode===E.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(dh.addTarget(this.header)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=he(this.element,we(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?o9.HEADER_SIZE:0,i=this._orientation===vi.VERTICAL?this.orthogonalSize:e,s=this._orientation===vi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(s,i),this.expandedSize=e)}style(e){this.styles=e,this.header&&this.updateHeader()}updateHeader(){const e=!this.headerVisible||this.isExpanded();this.collapsible?(this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button")):(this.header.removeAttribute("tabindex"),this.header.removeAttribute("role")),this.header.style.lineHeight=`${this.headerSize}px`,this.header.classList.toggle("hidden",!this.headerVisible),this.header.classList.toggle("expanded",e),this.header.classList.toggle("not-collapsible",!this.collapsible),this.header.setAttribute("aria-expanded",String(e)),this.header.style.color=this.collapsible?this.styles.headerForeground??"":"",this.header.style.backgroundColor=(this.collapsible?this.styles.headerBackground:"transparent")??"",this.header.style.borderTop=this.styles.headerBorder&&this.orientation===vi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===vi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};o9.HEADER_SIZE=22;let aEe=o9;const Lce=class Lce extends ${constructor(e,t,i){super(),this.pane=e,this.dnd=t,this.context=i,this.dragOverCounter=0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,e.draggableElement.draggable=!0,this._register(pe(e.draggableElement,"dragstart",s=>this.onDragStart(s))),this._register(pe(e.dropTargetElement,"dragenter",s=>this.onDragEnter(s))),this._register(pe(e.dropTargetElement,"dragleave",s=>this.onDragLeave(s))),this._register(pe(e.dropTargetElement,"dragend",s=>this.onDragEnd(s))),this._register(pe(e.dropTargetElement,"drop",s=>this.onDrop(s)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",pp&&e.dataTransfer?.setData(fm.TEXT,this.pane.draggableElement.textContent||"");const t=he(this.pane.element.ownerDocument.body,we(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>this.pane.element.ownerDocument.body.removeChild(t),0),this.context.draggable=this}onDragEnter(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter++,this.render())}onDragLeave(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter--,this.dragOverCounter===0&&this.render())}onDragEnd(e){this.context.draggable&&(this.dragOverCounter=0,this.render(),this.context.draggable=null)}onDrop(e){this.context.draggable&&(un.stop(e),this.dragOverCounter=0,this.render(),this.dnd.canDrop(this.context.draggable.pane,this.pane)&&this.context.draggable!==this&&this._onDidDrop.fire({from:this.context.draggable.pane,to:this.pane}),this.context.draggable=null)}render(){let e=null;this.dragOverCounter>0&&(e=this.pane.dropBackground??Lce.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Lce.DefaultDragOverBackgroundColor=new fe(new gn(128,128,128,.5));let cEe=Lce;class j4t extends ${constructor(e,t={}){super(),this.dndContext={draggable:null},this.paneItems=[],this.orthogonalSize=0,this.size=0,this.animationTimer=void 0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,this.dnd=t.dnd,this.orientation=t.orientation??vi.VERTICAL,this.element=he(e,we(".monaco-pane-view")),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.onDidSashReset=this.splitview.onDidSashReset,this.onDidSashChange=this.splitview.onDidSashChange,this.onDidScroll=this.splitview.onDidScroll;const i=this._register(new Z),s=this._register(new oi(this.element,"keydown")),o=T.map(T.filter(s.event,r=>Ra(r.target)&&r.target.classList.contains("pane-header"),i),r=>new os(r),i);this._register(T.filter(o,r=>r.keyCode===E.UpArrow,i)(()=>this.focusPrevious())),this._register(T.filter(o,r=>r.keyCode===E.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const s=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,s);const o={pane:e,disposable:s};if(this.paneItems.splice(i,0,o),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const r=new cEe(e,this.dnd,this.dndContext);s.add(r),s.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?A1.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),s=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||s===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,o),this.splitview.moveView(i,s)}resizePane(e,t){const i=this.paneItems.findIndex(s=>s.pane===e);i!==-1&&this.splitview.resizeView(i,t)}getPaneSize(e){const t=this.paneItems.findIndex(i=>i.pane===e);return t===-1?-1:this.splitview.getViewSize(t)}layout(e,t){this.orthogonalSize=this.orientation===vi.VERTICAL?t:e,this.size=this.orientation===vi.HORIZONTAL?t:e;for(const i of this.paneItems)i.pane.orthogonalSize=this.orthogonalSize;this.splitview.layout(this.size)}setBoundarySashes(e){this.boundarySashes=e,this.updateSplitviewOrthogonalSashes(e)}updateSplitviewOrthogonalSashes(e){this.orientation===vi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===vi.VERTICAL?vi.HORIZONTAL:vi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Yo(this.element),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const s=this.orientation===vi.VERTICAL?t:e,o=this.orientation===vi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=s,r.pane.orientation=this.orientation;const c=this.size===0?0:o*i[a]/this.size;this.splitview.addView(r.pane,c,a)}),this.size=o,this.orthogonalSize=s,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=gt(this.element).setTimeout(()=>{this.animationTimer=void 0,this.element.classList.remove("animated")},200)}getPaneHeaderElements(){return[...this.element.querySelectorAll(".pane-header")]}focusPrevious(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.max(t-1,0)].focus()}focusNext(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.min(t+1,e.length-1)].focus()}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose())}}var Nl;(function(n){let e;(function(s){s[s.None=0]="None",s[s.Done=1]="Done",s[s.Infinite=2]="Infinite",s[s.While=3]="While",s[s.Work=4]="Work"})(e=n.Type||(n.Type={})),n.None={type:e.None},n.Done={type:e.Done},n.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}n.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}n.Work=i})(Nl||(Nl={}));class K4t extends ${constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=Nl.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==Nl.Done.type)if(this.progressState.type===Nl.Type.While){let e;if(this.progressState.whileDelay>0){const t=this.progressState.whileDelay-(Date.now()-this.progressState.whileStart);t>0&&(e=t)}this.doShowWhile(e)}else this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===Nl.Type.Work&&(this.progressState.total&&this.progressBar.total(this.progressState.total).show(),this.progressState.worked&&this.progressBar.worked(this.progressState.worked).show())}onDidScopeDeactivate(){this.progressBar.stop().hide()}show(e,t){return typeof e=="boolean"?this.progressState=Nl.Infinite:this.progressState=new Nl.Work(e,void 0),this.scope.isActive&&(this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===Nl.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new Nl.Work(i,this.progressState.type===Nl.Type.Work?this.progressState.worked:void 0),this.scope.isActive&&this.progressBar.total(i)},worked:i=>{!this.scope.isActive||this.progressBar.hasTotal()?(this.progressState=new Nl.Work(this.progressState.type===Nl.Type.Work?this.progressState.total:void 0,this.progressState.type===Nl.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=Nl.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=Nl.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===Nl.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new Nl.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==Nl.Type.While||this.progressState.whilePromise===e)&&(this.progressState=Nl.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class Y4t extends ${get isActive(){return this._isActive}constructor(e,t){super(),this.scopeId=e,this._isActive=t,this._onDidChangeActive=this._register(new I),this.onDidChangeActive=this._onDidChangeActive.event}onScopeOpened(e){e===this.scopeId&&(this._isActive||(this._isActive=!0,this._onDidChangeActive.fire()))}onScopeClosed(e){e===this.scopeId&&this._isActive&&(this._isActive=!1,this._onDidChangeActive.fire())}}class J4t extends ${get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,s){super(),this.options=t,this.menuService=i,this.contextKeyService=s,this._primaryActions=[],this._secondaryActions=[],this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.disposables=this._register(new Z),this.menu=this._register(i.createMenu(e,s)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],tD(this.menu,this.options,{primary:this._primaryActions,secondary:this._secondaryActions}),this.disposables.add(this.updateSubmenus([...this._primaryActions,...this._secondaryActions],{})),this._onDidChange.fire()}updateSubmenus(e,t){const i=new Z;for(const s of e)if(s instanceof uS&&!t[s.item.submenu.id]){const o=t[s.item.submenu.id]=i.add(this.menuService.createMenu(s.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(s.actions,t))}return i}}let Oie=class extends ${constructor(e,t,i,s,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=s,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new J4t(e,this.options,o,s)),this._register(this.menuActions.onDidChange(()=>this._onDidChange.fire()))}getPrimaryActions(){return this.menuActions.primaryActions}getSecondaryActions(){return this.menuActions.secondaryActions}getContextMenuActions(){const e=[];if(this.contextMenuId){const t=this.menuService.createMenu(this.contextMenuId,this.contextKeyService);tD(t,this.options,{primary:[],secondary:e}),t.dispose()}return e}};Oie=D([_(3,Pe),_(4,_c)],Oie);const X4t="vs/workbench/browser/parts/views/viewFilter",qnt=new Te("menu.view.filter"),Mhe=new Te("submenu.view.filter");Xs.appendMenuItem(qnt,{submenu:Mhe,title:g(X4t,0,"More Filters..."),group:"navigation",icon:Ce.filter});class Z4t extends b7{constructor(){super(...arguments),this._checked=!1}set checked(e){this._checked!==e&&(this._checked=e,this.updateChecked())}updateChecked(){this.element&&this.element.classList.toggle("checked",this._checked)}render(e){super.render(e),this.updateChecked()}}let lEe=class extends wg{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,s,o){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=o,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Lu(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Y(e.focusContextKey,!1).bindTo(s)),this.element=we(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=he(this.element,we(".viewpane-filter-controls"));this.filterBadge=this.createBadge(r),this.toolbar=this._register(this.createToolBar(r)),this.adjustInputBox()}hasFocus(){return this.filterInputBox.hasFocus()}focus(){this.filterInputBox.focus()}blur(){this.filterInputBox.blur()}updateBadge(e){this.filterBadge.classList.toggle("hidden",!e),this.filterBadge.textContent=e||"",this.adjustInputBox()}setFilterText(e){this.filterInputBox.value=e}getFilterText(){return this.filterInputBox.value}getHistory(){return this.filterInputBox.getHistory()}layout(e){this.element.parentElement?.classList.toggle("grow",e>700),this.element.classList.toggle("small",e<400),this.adjustInputBox(),this.lastWidth=e}relayout(){this.lastWidth&&this.layout(this.lastWidth)}checkMoreFilters(e){this.isMoreFiltersChecked=e,this.moreFiltersActionViewItem&&(this.moreFiltersActionViewItem.checked=e)}createInput(e){const t=this._register(this.instantiationService.createInstance(wye,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>QSe(this.keybindingService),inputBoxStyles:eV}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(s=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Xo(t.inputElement,xe.KEY_DOWN,s=>this.onInputKeyDown(s,t))),this._register(Xo(e,xe.KEY_DOWN,this.handleKeyboardEvent)),this._register(Xo(e,xe.KEY_UP,this.handleKeyboardEvent)),this._register(Xo(t.inputElement,xe.CLICK,s=>{s.stopPropagation(),s.preventDefault()}));const i=this._register(Dd(t.inputElement));return this.focusContextKey&&(this._register(i.onDidFocus(()=>this.focusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.focusContextKey.set(!1))),this._register(Ee(()=>this.focusContextKey.reset()))),[t,i]}createBadge(e){const t=he(e,we(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=Ye(kW),t.style.color=Ye(kMe),t.style.border=`1px solid ${Ye(ft)}`,t}createToolBar(e){return this.instantiationService.createInstance(nC,e,qnt,{hiddenItemStrategy:wS.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof uS&&t.item.submenu.id===Mhe.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(Z4t,t,i),this.moreFiltersActionViewItem.checked=this.isMoreFiltersChecked,this.moreFiltersActionViewItem}})}onDidInputChange(e){e.addToHistory(),this._onDidChangeFilterText.fire(e.value)}adjustInputBox(){this.filterInputBox.inputElement.style.paddingRight=this.element.classList.contains("small")||this.filterBadge.classList.contains("hidden")?"25px":"150px"}handleKeyboardEvent(e){(e.equals(E.Space)||e.equals(E.LeftArrow)||e.equals(E.RightArrow))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(E.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};lEe=D([_(1,be),_(2,W_),_(3,Pe),_(4,ti)],lEe);var dEe;const Bie="vs/workbench/browser/parts/views/viewPane";var o8;(function(n){n[n.Default=0]="Default",n[n.WhenExpanded=1]="WhenExpanded",n[n.Always=2]="Always"})(o8||(o8={}));const Rze=new xn("viewpane.action.filter"),ezt=Ki("view-pane-container-expanded",Ce.chevronDown,g(Bie,0,"Icon for an expanded view pane container.")),tzt=Ki("view-pane-container-collapsed",Ce.chevronRight,g(Bie,1,"Icon for a collapsed view pane container.")),Mze=it.as(M1.ViewsRegistry);let hEe=class{get enabled(){return this._enabled}constructor(e,t,i,s,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=s,this.telemetryService=o,this.contextKeyService=r,this.items=[],this._enabled=!1,this.disposables=new Z,this.enabledDisposables=this.disposables.add(new Z),this.renderDisposables=this.disposables.add(new Z),this.disposables.add(T.runAndSubscribe(this.delegate.onDidChangeViewWelcomeState,()=>this.onDidChangeViewWelcomeState())),this.disposables.add(a.onWillShutdown(()=>this.dispose()))}layout(e,t){this._enabled&&(this.element.style.height=`${e}px`,this.element.style.width=`${t}px`,this.element.classList.toggle("wide",t>640),this.scrollableElement.scanDomNode())}focus(){this._enabled&&this.element.focus()}onDidChangeViewWelcomeState(){const e=this.delegate.shouldShowWelcome();if(this._enabled===e)return;if(this._enabled=e,!e){this.enabledDisposables.clear();return}this.container.classList.add("welcome");const t=he(this.container,we(".welcome-view"));this.element=we(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new bz(this.element,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible}),he(t,this.scrollableElement.getDomNode()),this.enabledDisposables.add(Ee(()=>{this.container.classList.remove("welcome"),this.scrollableElement.dispose(),t.remove(),this.scrollableElement=void 0,this.element=void 0})),this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.enabledDisposables),T.chain(Mze.onDidChangeViewWelcomeContent,i=>i.filter(s=>s===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=Mze.getViewWelcomeContent(this.delegate.id);this.items=[];for(const t of e)if(t.when==="default")this.defaultItem={descriptor:t,visible:!0};else{const i=t.when?this.contextKeyService.contextMatchesRules(t.when):!0;this.items.push({descriptor:t,visible:i})}this.render()}onDidChangeContext(){let e=!1;for(const t of this.items){if(!t.descriptor.when||t.descriptor.when==="default")continue;const i=this.contextKeyService.contextMatchesRules(t.descriptor.when);t.visible!==i&&(t.visible=i,e=!0)}e&&this.render()}render(){this.renderDisposables.clear(),this.element.innerText="";const e=this.getContentDescriptors();if(e.length===0){this.container.classList.remove("welcome"),this.scrollableElement.scanDomNode();return}for(const{content:t,precondition:i}of e){const s=t.split(` -`);for(let o of s){if(o=o.trim(),!o)continue;const r=aXe(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=he(this.element,we(".button-container")),l=new Tu(c,{title:a.title,supportIcons:!0,...yQ});if(l.label=a.label,l.onDidClick(d=>{this.telemetryService.publicLog2("views.welcomeAction",{viewId:this.delegate.id,uri:a.href}),this.openerService.open(a.href,{allowCommands:!0})},null,this.renderDisposables),this.renderDisposables.add(l),i){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=he(this.element,we("p"));for(const c of r.nodes)if(typeof c=="string")he(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(t6,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}}}}this.container.classList.add("welcome"),this.scrollableElement.scanDomNode()}getContentDescriptors(){const e=this.items.filter(t=>t.visible);return e.length===0&&this.defaultItem?[this.defaultItem.descriptor]:e.map(t=>t.descriptor)}dispose(){this.disposables.dispose()}};hEe=D([_(2,be),_(3,fr),_(4,rn),_(5,Pe),_(6,mg)],hEe);var YN;let Wie=(YN=class extends aEe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===Sr.Panel?vi.HORIZONTAL:vi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=s,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewService=u,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidChangeBodyVisibility=this._register(new I),this.onDidChangeBodyVisibility=this._onDidChangeBodyVisibility.event,this._onDidChangeTitleArea=this._register(new I),this.onDidChangeTitleArea=this._onDidChangeTitleArea.event,this._onDidChangeViewWelcomeState=this._register(new I),this.onDidChangeViewWelcomeState=this._onDidChangeViewWelcomeState.event,this._isVisible=!1,this.id=e.id,this._title=e.title,this._titleDescription=e.titleDescription,this._singleViewPaneContainerTitle=e.singleViewPaneContainerTitle,this.showActions=e.showActions??o8.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",aie(r.getViewLocationById(this.id)));this._register(T.filter(r.onDidChangeLocation,p=>p.views.some(m=>m.id===this.id))(()=>f.set(aie(r.getViewLocationById(this.id))))),this.menuActions=this._register(this.instantiationService.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(Oie,e.titleMenuId??Te.ViewTitle,Te.ViewTitleContext,{shouldForwardArgs:!e.donotForwardArgs,renderShortTitle:!0})),this._register(this.menuActions.onDidChange(()=>this.updateActions()))}get headerVisible(){return super.headerVisible}set headerVisible(e){super.headerVisible=e,this.element.classList.toggle("merged-header",!e)}setVisible(e){this._isVisible!==e&&(this._isVisible=e,this.isExpanded()&&this._onDidChangeBodyVisibility.fire(e))}isVisible(){return this._isVisible}isBodyVisible(){return this._isVisible&&this.isExpanded()}setExpanded(e){const t=super.setExpanded(e);return t&&this._onDidChangeBodyVisibility.fire(e),this.updateTwistyIcon(),t}render(){super.render();const e=Dd(this.element);this._register(e),this._register(e.onDidFocus(()=>this._onDidFocus.fire())),this._register(e.onDidBlur(()=>this._onDidBlur.fire()))}renderHeader(e){this.headerContainer=e,this.twistiesContainer=he(e,we(`.twisty-container${$e.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=he(e,we(".actions"));t.classList.toggle("show-always",this.showActions===o8.Always),t.classList.toggle("show-expanded",this.showActions===o8.WhenExpanded),this.toolbar=this.instantiationService.createInstance(lV,t,{orientation:Qb.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(Bie,2,"{0} actions",this.title),getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id),renderDropdownAsChildElement:!0,actionRunner:this.getActionRunner(),resetMenu:this.menuActions.menuId}),this._register(this.toolbar),this.setActions(),this._register(pe(t,xe.CLICK,o=>o.preventDefault()));const i=this.viewDescriptorService.getViewContainerByViewId(this.id);i?this._register(this.viewDescriptorService.getViewContainerModel(i).onDidChangeContainerInfo(({title:o})=>this.updateTitle(this.title))):console.error(`View container model not found for view ${this.id}`);const s=T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(dEe.AlwaysShowActionsConfig));this._register(s(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...$e.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...$e.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?ezt:tzt}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=hS(e.headerForeground,Ye(Ge));P.isUri(t)?(this.iconContainer.style.backgroundColor=i,this.iconContainer.style.color=""):(this.iconContainer.style.color=i,this.iconContainer.style.backgroundColor="")}}getIcon(){return this.viewDescriptorService.getViewDescriptorById(this.id)?.containerIcon||_Bt}renderHeaderTitle(e,t){this.iconContainer=he(e,we(".icon",void 0));const i=this.getIcon();let s;if(P.isUri(i)){s=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${s}`;Kp(r,` - mask: ${uf(i)} no-repeat 50% 50%; - mask-size: 24px; - -webkit-mask: ${uf(i)} no-repeat 50% 50%; - -webkit-mask-size: 16px; - `)}else $e.isThemeIcon(i)&&(s=$e.asClassName(i));s&&this.iconContainer.classList.add(...s.split(" "));const o=this.calculateTitle(t);this.titleContainer=he(e,we("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewService?.hasShownAccessibleView(this.id);return!t||i?e:g(Bie,3,"Use Alt+F1 for accessibility help {0}",e)}updateTitle(e){const t=this.calculateTitle(e);this.titleContainer&&(this.titleContainer.textContent=t,this.titleContainerHover?.update(t)),this.iconContainer&&(this.iconContainerHover?.update(t),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(t))),this._title=e,this._onDidChangeTitleArea.fire()}setTitleDescription(e){this.titleDescriptionContainer?(this.titleDescriptionContainer.textContent=e??"",this.titleDescriptionContainerHover?.update(e??"")):e&&this.titleContainer&&(this.titleDescriptionContainer=pje(this.titleContainer,we("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleDescriptionContainer,e)))}updateTitleDescription(e){this.setTitleDescription(e),this._titleDescription=e,this._onDidChangeTitleArea.fire()}calculateTitle(e){const t=this.viewDescriptorService.getViewContainerByViewId(this.id),i=this.viewDescriptorService.getViewContainerModel(t),s=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&s?.containerTitle&&i.title!==s.containerTitle?`${s.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(hEe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new y7(this.element,eXe)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new K4t(ws(this.progressBar),new class extends Y4t{constructor(){super(e.id,e.isBodyVisible()),this._register(e.onDidChangeBodyVisibility(t=>t?this.onScopeOpened(e.id):this.onScopeClosed(e.id)))}}))}return this.progressIndicator}getProgressLocation(){return this.viewDescriptorService.getViewContainerByViewId(this.id).id}getLocationBasedColors(){return izt(this.viewDescriptorService.getViewLocationById(this.id))}focus(){this.viewWelcomeController.enabled?this.viewWelcomeController.focus():this.element&&(this.element.focus(),this._onDidFocus.fire())}setActions(){if(this.toolbar){const e=[...this.menuActions.getPrimaryActions()];this.shouldShowFilterInHeader()&&e.unshift(Rze),this.toolbar.setActions(gUe(e),gUe(this.menuActions.getSecondaryActions())),this.toolbar.context=this.getActionsContext()}}updateActionsVisibility(){if(!this.headerContainer)return;const e=this.configurationService.getValue("workbench.view.alwaysShowHeaderActions");this.headerContainer.classList.toggle("actions-always-visible",e)}updateActions(){this.setActions(),this._onDidChangeTitleArea.fire()}getActionViewItem(e,t){if(e.id===Rze.id){const i=this;return new class extends c_{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(s){s.classList.add("viewpane-filter-container");const o=i.getFilterWidget();he(s,o.element),o.relayout()}}}return yO(this.instantiationService,e,{...t,menuAsChild:e instanceof uS})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},dEe=YN,YN.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",YN);Wie=dEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,rn),_(10,el)],Wie);let uEe=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,t,i,s,o,r,a,c,l,d,h,u),this.filterWidget=this._register(a.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(lEe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=he(e,we(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new Tn(t,e);const i=!this.filterContainer?.hasChildNodes(),s=this.shouldShowFilterInHeader();i!==s&&(s&&_a(this.filterContainer),this.updateActions(),s||he(this.filterContainer,this.filterWidget.element)),s||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};uEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,rn),_(10,el)],uEe);function izt(n){let e,t,i,s;switch(n){case Sr.Panel:e=E3,t=GTt,i=qTt,s=QTt;break;case Sr.Sidebar:case Sr.AuxiliaryBar:default:e=RE,t=JTt,i=XTt,s=ZTt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:s}}}class XQ extends pi{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(q_).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}const nzt="copilot",szt="vs/workbench/contrib/chat/browser/chat";async function ozt(n){return(await n.openView(azt))?.widget}const rzt=g(szt,0,"Generating"),azt=`workbench.panel.chat.view.${nzt}`;class cC extends AZe{constructor(){super(...arguments),this._onDidChangeDirty=this._register(new I),this._onDidChangeLabel=this._register(new I),this._onDidChangeCapabilities=this._register(new I),this._onWillDispose=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidChangeLabel=this._onDidChangeLabel.event,this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this.onWillDispose=this._onWillDispose.event}get editorId(){}get capabilities(){return Mi.Readonly}hasCapability(e){return e===Mi.None?this.capabilities===Mi.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Mi.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Gs.SHORT)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,t){return this}async saveAs(e,t){return this}async revert(e,t){}async rename(e,t){}copy(){return this}canMove(e,t){return!0}matches(e){if(ja(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:_n(this.resource,jc.getCanonicalUri(e))}prefersEditorPane(e){return k_(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}const Um="vs/platform/request/common/request";class czt{constructor(e){this.original=e}toJSON(){if(!this.headers){const e=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?e[t]="*****":e[t]=this.original[t];this.headers=e}return this.headers}}class lzt extends ${constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(Um,0,"Network Requests"),when:wSt.isEqualTo(c7(Pn.Trace)).serialize()})}async logAndRequest(e,t,i){const s=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${s} - begin`,t.type,new czt(t.headers??{}));try{const o=await i();return this.logger.trace(`${s} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${s} - error`,t.type,lg(o)),o}}}function Qnt(n){return n.res.statusCode&&n.res.statusCode>=200&&n.res.statusCode<300||n.res.statusCode===1223}function jnt(n){return n.res.statusCode===204}async function dzt(n){return jnt(n)?null:(await II(n.stream)).toString()}async function hzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);return dzt(n)}async function uzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);if(jnt(n))return null;const t=(await II(n.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: -`+t,i}}let xpe;function gzt(n){const e=it.as(Cs.Configuration),t=xpe;xpe={id:"http",order:15,title:g(Um,1,"HTTP"),type:"object",scope:n,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(Um,2,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables."),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:g(Um,3,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(Um,4,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(Um,5,"The value to send as the `Proxy-Authorization` header for every network request."),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[g(Um,6,"Disable proxy support for extensions."),g(Um,7,"Enable proxy support for extensions."),g(Um,8,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(Um,9,"Enable proxy support for extensions, override request options.")],default:"override",description:g(Um,10,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(Um,11,"Controls whether CA certificates should be loaded from the OS. (On Windows and macOS, a reload of the window is required after turning this off.)"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,description:g(Um,12,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implemenation."),restricted:!0}}},e.updateConfigurations({add:[xpe],remove:t?[t]:[]})}gzt(ut.APPLICATION);var N3,lc;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(lc||(lc={}));(function(n){function e(t){switch(t){case"panel":return n.Panel;case"terminal":return n.Terminal;case"notebook":return n.Notebook;case"editor":return n.Editor}return n.Panel}n.fromRaw=e})(lc||(lc={}));var UH;let Nze=(UH=class{constructor(e){this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new I,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentCompletionProviders=new Map,this._hasDefaultAgent=utt.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const s=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||s.contextKeyService.contextMatchesRules(ge.deserialize(a.when)))}};const r={data:t};return this._agents.set(e,r),Ee(()=>{this._agents.delete(e),this._onDidChangeAgents.fire(void 0)})}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new jK(i.data,t)),Ee(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(!1)})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new jK(e,t)),Ee(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new jK(i.data,i.impl))}getDefaultAgent(e){return t1(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return fi.find(this._agents.values(),e=>!!e.data.metadata.isSecondary)?.data}getAgent(e){if(this._agentIsEnabled(e))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=this._agents.get(e);return!t?.data.when||this.contextKeyService.contextMatchesRules(ge.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=fi.find(this._agents.values(),i=>Nhe(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new jK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}async invokeAgent(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return await r.impl.invoke(t,i,s,o)}async getFollowups(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return r.impl?.provideFollowups?r.impl.provideFollowups(t,i,s,o):[]}},UH.AGENT_LEADER="@",UH);Nze=D([_(0,Pe)],Nze);class jK{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get defaultImplicitVariables(){return this.data.defaultImplicitVariables}get locations(){return this.data.locations}async invoke(e,t,i,s){return this.impl.invoke(e,t,i,s)}async provideFollowups(e,t,i,s){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,s):[]}provideWelcomeMessage(e,t){if(this.impl.provideWelcomeMessage)return this.impl.provideWelcomeMessage(e,t)}provideSampleQuestions(e,t){if(this.impl.provideSampleQuestions)return this.impl.provideSampleQuestions(e,t)}}var JN;let Pze=(JN=class{constructor(e,t,i,s){if(this.requestService=t,this.logService=i,this.storageService=s,this.registry=xi(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=s.get(N3.StorageKey,ke.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{s.remove(N3.StorageKey,ke.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Ta(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},qe.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await uzt(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(N3.StorageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE)}getAgentNameRestriction(e){const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(s=>s[e.toLowerCase()]).map(s=>s?s.some(o=>Ba(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},N3=JN,JN.StorageKey="chat.participantNameRegistry",JN);Pze=N3=D([_(0,Xa),_(1,EQ),_(2,Ze),_(3,on)],Pze);function Nhe(n){return`${n.extensionId.value}.${n.id}`}function Knt(n){const e="name"in n?n:{...n,name:n.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Cn("")),Or(e)}var _A;const Ynt="vs/workbench/contrib/chat/browser/chatEditorInput",fzt=Ki("chat-editor-label-icon",Ce.commentDiscussion,g(Ynt,0,"Icon of the chat editor label."));var YE;let gEe=(YE=class extends cC{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return Hie.generate(e)}static getNextCount(){let e=0;for(;_A.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof Hie.parse(e)?.handle!="number")throw new Error("Invalid chat URI");this.sessionId=t.target&&"sessionId"in t.target?t.target.sessionId:void 0,this.inputCount=_A.getNextCount(),_A.countsInUse.add(this.inputCount),this._register(Ee(()=>_A.countsInUse.delete(this.inputCount)))}get editorId(){return _A.EditorID}get capabilities(){return super.capabilities|Mi.Singleton}matches(e){return e instanceof _A&&e.resource.toString()===this.resource.toString()}get typeId(){return _A.TypeID}getName(){return this.model?.title||g(Ynt,1,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return fzt}async resolve(){return typeof this.sessionId=="string"?this.model=this.chatService.getOrRestoreSession(this.sessionId):this.options.target?"data"in this.options.target&&(this.model=this.chatService.loadSessionFromContent(this.options.target.data)):this.model=this.chatService.startSession(lc.Panel,qe.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new pzt(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},_A=YE,YE.countsInUse=new Set,YE.TypeID="workbench.input.chatSession",YE.EditorID="workbench.editor.chatSession",YE);gEe=_A=D([_(2,Rw)],gEe);class pzt extends ${constructor(e){super(),this.model=e,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._isDisposed=!1,this._isResolved=!1}async resolve(){this._isResolved=!0}isResolved(){return this._isResolved}isDisposed(){return this._isDisposed}dispose(){super.dispose(),this._isDisposed=!0}}var Hie;(function(n){n.scheme=_e.vscodeChatSesssion;function e(i){return P.from({scheme:n.scheme,path:`chat-${i}`})}n.generate=e;function t(i){if(i.scheme!==n.scheme)return;const o=i.path.match(/chat-(\d+)/)?.[1];if(typeof o!="string")return;const r=parseInt(o);if(!isNaN(r))return{handle:r}}n.parse=t})(Hie||(Hie={}));const Tce=class Tce{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=Tce.Kind}get promptText(){return this.text}};Tce.Kind="text";let kb=Tce;const GFe="#",$z="@",O1="/",Rce=class Rce{constructor(e,t,i,s,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=s,this.variableId=o,this.kind=Rce.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${GFe}${this.variableName}${e}`}get promptText(){return this.text}};Rce.Kind="var";let m6=Rce;const Mce=class Mce{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=Mce.Kind}get text(){return`${$z}${this.agent.name}`}get promptText(){return""}};Mce.Kind="agent";let tp=Mce;const Nce=class Nce{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=Nce.Kind}get text(){return`${O1}${this.command.name}`}get promptText(){return""}};Nce.Kind="subcommand";let HV=Nce;const Pce=class Pce{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=Pce.Kind}get text(){return`${O1}${this.slashCommand.command}`}get promptText(){return`${O1}${this.slashCommand.command}`}};Pce.Kind="slash";let UV=Pce;const Fce=class Fce{constructor(e,t,i,s,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=s,this.modelDescription=o,this.data=r,this.kind=Fce.Kind}get referenceText(){return this.text.replace(GFe,"")}get promptText(){return this.text}};Fce.Kind="dynamic";let VV=Fce;function mzt(n){return{text:n.text,parts:n.parts.map(e=>{if(e.kind===kb.Kind)return new kb(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===m6.Kind)return new m6(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===tp.Kind){let t=e.agent;return t=Knt(t),new tp(new hi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===HV.Kind)return new HV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===UV.Kind)return new UV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===VV.Kind)return new VV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Or(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function _zt(n){const e=n.parts.find(i=>i instanceof tp),t=n.parts.find(i=>i instanceof HV);return{agentPart:e,commandPart:t}}function vzt(n){return!!n&&typeof n=="object"&&"uri"in n&&n.uri instanceof P&&"version"in n&&typeof n.version=="number"&&"ranges"in n&&Array.isArray(n.ranges)&&n.ranges.every(O.isIRange)}function wzt(n){return!!n&&typeof n=="object"&&"documents"in n&&Array.isArray(n.documents)&&n.documents.every(vzt)}var zV;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(zV||(zV={}));var Fze;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Fze||(Fze={}));var fEe,pEe;const bzt="vs/workbench/contrib/chat/common/chatModel",Oce=class Oce{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}constructor(e,t,i,s=0){this._session=e,this.message=t,this._variableData=i,this._attempt=s,this.id="request_"+Oce.nextId++}adoptTo(e){this._session=e}};Oce.nextId=0;let Uie=Oce,Czt=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseParts=Kb(e).map(t=>ah(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}asString(){return this._responseRepr}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,s=this._responseParts[i];!s||s.kind!=="markdownContent"||!Jnt(s.content,e.content)?this._responseParts.push(e):s.content=qJ(s.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let s=0;!i&&s{this._updateRepr(!1)});e.task?.().then(o=>{s.dispose(),typeof o=="string"&&(this._responseParts[i]={...e,content:new Xt(o)}),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?ui("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(bzt,0,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} + font-family: ${m}; +}`)})),this._register(new nye(this.editor,this._currentWidget,this.instantiationService)),this._register(new aye(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(F.containsPosition(t.range,e))}validateInlineEdit(e,t){if(t.text.includes(` +`)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const n=t.range.endLineNumber,o=t.range.endColumn,r=e.getModel()?.getLineLength(n)??0;if(o!==r+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const n=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new ci;const a=this._currentRequestCts.token,c=t?L2.Automatic:L2.Invoke;if(t&&await oHt(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const d=await r.provideInlineEdit(i,{triggerKind:c},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(i,void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get();if(!e)return;let t=e.text;e.text.startsWith(` +`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Zn.replace(F.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,No),this.freeEdit(e),ts(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get();if(!e)return;const t=oe.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get();t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,No),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get(),i=this._currentWidget.get();if(!t||!i)return!1;const n=t,o=i.model;if(F.containsPosition(n.range,e.getStartPosition())||F.containsPosition(n.range,e.getEndPosition()))return!0;const a=o.ghostText.get();return a?a.parts.some(c=>e.containsPosition(new oe(a.lineNumber,c.column))):!1}shouldShowHoverAtViewZone(e){return this._currentWidget.get()?.ownsViewZone(e)??!1}},vV=Up,Up.ID="editor.contrib.inlineEditController",Up.inlineEditVisibleKey="inlineEditVisible",Up.inlineEditVisibleContext=new Q(Up.inlineEditVisibleKey,!1),Up.cursorAtInlineEditKey="cursorAtInlineEdit",Up.cursorAtInlineEditContext=new Q(Up.cursorAtInlineEditKey,!1),Up);iu=vV=D([_(1,we),_(2,Le),_(3,it),_(4,vi),_(5,Te),_(6,x6),_(7,gi)],iu);function oHt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}let rHt=class extends tt{constructor(){super({id:YWt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:he.and(J.writable,iu.inlineEditVisibleContext),kbOpts:[{weight:Ae.EditorContrib+1,primary:S.Tab,kbExpr:he.and(J.writable,iu.inlineEditVisibleContext,iu.cursorAtInlineEditContext)}],menuOpts:[{menuId:_e.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await iu.get(t)?.accept()}};class aHt extends tt{constructor(){const e=he.and(J.writable,he.not(iu.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e}})}async run(e,t){iu.get(t)?.trigger()}}class cHt extends tt{constructor(){const e=he.and(J.writable,iu.inlineEditVisibleContext,he.not(iu.cursorAtInlineEditKey));super({id:XWt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){iu.get(t)?.jumpToCurrent()}}class lHt extends tt{constructor(){const e=he.and(J.writable,iu.cursorAtInlineEditContext);super({id:ZWt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+10,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){iu.get(t)?.jumpBack()}}class dHt extends tt{constructor(){const e=he.and(J.writable,iu.inlineEditVisibleContext);super({id:JWt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await iu.get(t)?.clear()}}Re(rHt);Re(dHt);Re(cHt);Re(lHt);Re(aHt);on(iu.ID,iu,ri.Eventually);const hHt="editor.action.inlineEdits.accept",uHt="editor.action.inlineEdits.showPrevious",gHt="editor.action.inlineEdits.showNext",MW=new Q("inlineEditsVisible",!1,g(9879,"Whether an inline edit is visible")),fHt=new Q("inlineEditsIsPinned",!1,g(9880,"Whether an inline edit is visible"));var pHt=".monaco-editor div.inline-edits-widget{--widget-color:var(--vscode-notifications-background);.promptEditor .monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground)}.promptEditor,.toolbar{opacity:0;transition:opacity .2s ease-in-out}&.focused,&:hover{.promptEditor,.toolbar{opacity:1}}.preview .monaco-editor{--vscode-editor-background:var(--widget-color);.mtk1{color:var(--vscode-editorGhostText-foreground)}.current-line-margin,.view-overlays .current-line-exact{border:none}}svg{.gradient-start{stop-color:var(--vscode-editor-background)}.gradient-stop{stop-color:var(--widget-color)}}}";ut(pHt,{});const roe=class roe extends V{static get(e){return e.getContribution(roe.ID)}constructor(e){super(),this._editor=e,this._editorObs=Xh(this._editor),this._placeholderText=this._editorObs.getOption(x.placeholder),this._state=Jh({owner:this,equalsFn:jY},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=mHt(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=AI((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const n=Bt("div.editorPlaceholder");i.add(ai(o=>{const r=this._state.read(o),a=r?.placeholder!==void 0;n.root.style.display=a?"block":"none",n.root.innerText=r?.placeholder??""})),i.add(ai(o=>{const r=this._editorObs.layoutInfo.read(o);n.root.style.left=`${r.contentLeft}px`,n.root.style.width=r.contentWidth-r.verticalScrollbarWidth+"px",n.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(ai(o=>{n.root.style.fontFamily=this._editorObs.getOption(x.fontFamily).read(o),n.root.style.fontSize=this._editorObs.getOption(x.fontSize).read(o)+"px",n.root.style.lineHeight=this._editorObs.getOption(x.lineHeight).read(o)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:nd(0),position:nd(null),domNode:n.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};roe.ID="editor.contrib.placeholderText";let a9=roe;function mHt(s,e){return b6(s,(t,i)=>i===!0?!0:e(t))}let _Ht=class{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}},lye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=n,this._editorObs=Xh(this._editor),this._elements=Bt("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[Bt("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[Bt("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),Bt("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),Bt("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),tP("svg",{style:{overflow:"visible",pointerEvents:"none"}},[tP("defs",[tP("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[tP("stop",{offset:"0%",class:"gradient-stop"}),tP("stop",{offset:"100%",class:"gradient-stop"})])]),tP("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._toolbar=this._register(this._instantiationService.createInstance(bm,this._elements.toolbar,_e.InlineEditsActions,{toolbarOptions:{primaryGroup:r=>r.startsWith("primary")}})),this._previewTextModel=this._register(this._instantiationService.createInstance(C_,"",Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(r=>{const a=this._edit.read(r);a&&this._previewTextModel.setValue(a.newLines.join(` +`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(C_,"",Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(lf,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:XTe},{contributions:ap.getSomeEditorContributions([Xg.ID,a9.ID,Fb.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(lf,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=Xh(this._previewEditor),this._decorations=Ze(this,r=>{this._setText.read(r);const a=this._edit.read(r)?.changes;if(!a)return[];const c=[],l=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const d of a)if(d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:L3}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:AJ}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:ARe}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:CRe});else for(const h of d.innerChanges||[])d.original.contains(h.originalRange.startLineNumber)&&c.push({range:h.originalRange,options:h.originalRange.isEmpty()?ERe:cW}),d.modified.contains(h.modifiedRange.startLineNumber)&&l.push({range:h.modifiedRange,options:h.modifiedRange.isEmpty()?SRe:EJ});return l}),this._layout1=Ze(this,r=>{const a=this._editor.getModel(),c=this._edit.read(r);if(!c)return null;const l=c.range;let d=0;for(let f=l.startLineNumber;f{const a=this._edit.read(r);if(!a)return null;const c=a.range,l=this._editorObs.scrollLeft.read(r),d=this._layout1.read(r).left+20-l,h=this._editor.getTopForLineNumber(c.startLineNumber)-this._editorObs.scrollTop.read(r),u=this._editor.getTopForLineNumber(c.endLineNumberExclusive)-this._editorObs.scrollTop.read(r),f=new F1(d,h),p=new F1(d,u),m=u-h,v=50,b=this._editor.getOption(x.lineHeight)*a.newLines.length,w=m-b,y=new F1(d+v,h+w/2),C=new F1(d+v,u-w/2);return{topCode:f,bottomCode:p,codeHeight:m,topEdit:y,bottomEdit:C,editHeight:b}});const o=Ze(this,r=>this._edit.read(r)!==void 0||this._userPrompt.read(r)!==void 0);this._register(IA(this._elements.root,{display:Ze(this,r=>o.read(r)?"block":"none")})),this._register(gF(this._editor.getDomNode(),this._elements.root)),this._register(Xh(e).createOverlayWidget({domNode:this._elements.root,position:nd(null),allowEditorOverflow:!1,minContentWidthInPx:Ze(r=>{const a=this._layout1.read(r)?.left;if(a===void 0)return 0;const c=this._previewEditorObs.contentWidth.read(r);return a+c})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(ai(r=>{const a=this._layout.read(r);if(!a)return;const{topCode:c,bottomCode:l,topEdit:d,bottomEdit:h,editHeight:u}=a,f=10,p=0,m=40,v=new bHt().moveTo(c).lineTo(c.deltaX(f)).curveTo(c.deltaX(f+m),d.deltaX(-m-p),d.deltaX(-p)).lineTo(d).lineTo(h).lineTo(h.deltaX(-p)).curveTo(h.deltaX(-m-p),l.deltaX(f+m),l.deltaX(f)).lineTo(l).build();this._elements.path.setAttribute("d",v),this._elements.editorContainer.style.top=`${d.y}px`,this._elements.editorContainer.style.left=`${d.x}px`,this._elements.editorContainer.style.height=`${u}px`;const b=this._previewEditorObs.contentWidth.read(r);this._previewEditor.layout({height:u,width:b})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(wHt(vHt(this._userPrompt,r=>r??"",r=>r),Xh(this._promptEditor).value)),this._register(ai(r=>{const a=Xh(this._promptEditor).isFocused.read(r);this._elements.root.classList.toggle("focused",a)}))}};lye=D([_(3,we)],lye);function vHt(s,e,t){return _6(void 0,i=>e(s.read(i)),(i,n)=>s.set(t(i),n))}class F1{constructor(e,t){this.x=e,this.y=t}add(e){return new F1(this.x+e.x,this.y+e.y)}deltaX(e){return new F1(this.x+e,this.y)}}class bHt{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}curveTo(e,t,i){return this._data+=`C ${e.x} ${e.y} ${t.x} ${t.y} ${i.x} ${i.y} `,this}build(){return this._data}}function wHt(s,e){const t=new Z;return t.add(ai(i=>{const n=s.read(i);e.set(n,void 0)})),t.add(ai(i=>{const n=e.read(i);s.set(n,void 0)})),t}var bV,JL;let dye=(JL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edits",path:new Date().toString()+String(bV._modelId++)})}constructor(e,t,i,n,o,r,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=n,this.languageFeaturesService=o,this._diffProviderFactoryService=r,this._modelService=a,this._forceUpdateExplicitlySignal=gC(this),this._selectedInlineCompletionId=jt(this,void 0),this._isActive=jt(this,!1),this._originalModel=mh(()=>this._modelService.createModel("",null,bV._createUniqueUri())).keepObserved(this._store),this._modifiedModel=mh(()=>this._modelService.createModel("",null,bV._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new CHt(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(c=>!!c),this.userPrompt=jt(this,void 0),this.inlineEdit=Ze(this,c=>this._inlineEdit.read(c)?.promiseResult.read(c)?.data),this._inlineEdit=Ze(this,c=>{const l=this.selectedInlineEdit.read(c);if(!l)return;const d=l.inlineCompletion.range;if(l.inlineCompletion.insertText.trim()==="")return;let h=l.inlineCompletion.insertText.split(/\r\n|\r|\n/);function u(v){const b=v[0].match(/^\s*/)?.[0]??"";return v.map(w=>w.replace(new RegExp("^"+b),""))}h=u(h);let p=this.textModel.getValueInRange(d).split(/\r\n|\r|\n/);p=u(p),this._originalModel.get().setValue(p.join(` +`)),this._modifiedModel.get().setValue(h.join(` +`));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return E6.fromFn(async()=>{const v=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!v.identical)return new _Ht(pi.fromRangeInclusive(d),u(h),v.changes)})}),this._fetchStore=this._register(new Z),this._inlineEditsFetchResult=f3(this,void 0),this._inlineEdits=Jh({owner:this,equalsFn:jY},c=>this._inlineEditsFetchResult.read(c)?.completions.map(l=>new yHt(l))??[]),this._fetchInlineEditsPromise=Dje({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:em.Automatic}),handleChange:(c,l)=>(c.didChange(this._forceUpdateExplicitlySignal)&&(l.inlineCompletionTriggerKind=em.Explicit),!0)},async(c,l)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(c),this._textModelVersionId.read(c);function d(m,v){return v(m)}const h=this._pinnedRange.range.read(c)??d(this._selection.read(c),m=>m.isEmpty()?void 0:m);if(!h){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const u={triggerKind:l.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(c)},f=Zge(this._fetchStore);await Sr(200,f);const p=await UXe(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(p,void 0)}),this._filteredInlineEditItems=Jh({owner:this,equalsFn:J2()},c=>this._inlineEdits.read(c)),this.selectedInlineCompletionIndex=Ze(this,c=>{const l=this._selectedInlineCompletionId.read(c),d=this._filteredInlineEditItems.read(c),h=this._selectedInlineCompletionId===void 0?-1:d.findIndex(u=>u.semanticId===l);return h===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):h}),this.selectedInlineEdit=Ze(this,c=>{const l=this._filteredInlineEditItems.read(c),d=this.selectedInlineCompletionIndex.read(c);return l[d]}),this.activeCommands=Jh({owner:this,equalsFn:J2()},c=>this.selectedInlineEdit.read(c)?.inlineCompletion.source.inlineCompletions.commands??[]),this._register(FN(this._fetchInlineEditsPromise))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineEditsPromise.get()}async triggerExplicitly(e){SM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){SM(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}togglePin(){this.isPinned.get()?this._pinnedRange.setRange(void 0,void 0):this._pinnedRange.setRange(this._selection.get(),void 0)}async accept(e){if(e.getModel()!==this.textModel)throw new Ni;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},bV=JL,JL._modelId=0,JL);dye=bV=D([_(4,it),_(5,x6),_(6,gi)],dye);class yHt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class CHt extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=jt(this,[]),this.range=Ze(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(Ee(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var hye,XL;let WA=(XL=class extends V{static get(e){return e.getContribution(hye.ID)}constructor(e,t,i,n,o,r){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=o,this._configurationService=r,this._enabled=yRe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=Xh(this.editor),this._selection=Ze(this,a=>this._editorObs.cursorSelection.read(a)??new dt(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=mh(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const c=this._editorObs.model.read(a);return c?this._instantiationService.createInstance(Fg(dye,a),c,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=b6(this,(a,c)=>c||this.model.read(a)?.inlineEdit.read(a)!==void 0),this._widget=mh(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Fg(lye,a),this.editor,this.model.map((c,l)=>c?.inlineEdit.read(l)),SHt(c=>this.model.read(c)?.userPrompt??jt("empty","")))}),this._register(Iv(MW,this._contextKeyService,a=>!!this.model.read(a)?.inlineEdit.read(a))),this._register(Iv(fHt,this._contextKeyService,a=>!!this.model.read(a)?.isPinned.read(a))),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},hye=XL,XL.ID="editor.contrib.inlineEditsController",XL);WA=hye=D([_(1,we),_(2,Le),_(3,Sp),_(4,it),_(5,Te)],WA);function SHt(s){return _6(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function nG(s){return{label:s.value,alias:s.original}}const aoe=class aoe extends tt{constructor(){super({id:aoe.ID,...nG(Pe(5192,"Show Next Inline Edit")),precondition:he.and(J.writable,MW),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){WA.get(t)?.model.get()?.next()}};aoe.ID=gHt;let uye=aoe;const coe=class coe extends tt{constructor(){super({id:coe.ID,...nG(Pe(5193,"Show Previous Inline Edit")),precondition:he.and(J.writable,MW),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){WA.get(t)?.model.get()?.previous()}};coe.ID=uHt;let gye=coe;class AHt extends tt{constructor(){super({id:"editor.action.inlineEdits.trigger",...nG(Pe(5194,"Trigger Inline Edit")),precondition:J.writable})}async run(e,t){const i=WA.get(t);await xje(async n=>{await i?.model.get()?.triggerExplicitly(n)})}}class EHt extends tt{constructor(){super({id:hHt,...nG(Pe(5195,"Accept Inline Edit")),precondition:MW,menuOpts:{menuId:_e.InlineEditsActions,title:g(5196,"Accept Inline Edit"),group:"primary",order:1,icon:ve.check},kbOpts:{primary:U.CtrlCmd|S.Space,weight:2e4,kbExpr:MW}})}async run(e,t){t instanceof lf&&(t=t.getParentEditor());const i=WA.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const loe=class loe extends tt{constructor(){super({id:loe.ID,...nG(Pe(5197,"Hide Inline Edit")),precondition:MW,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=WA.get(t);ts(n=>{i?.model.get()?.stop(n)})}};loe.ID="editor.action.inlineEdits.hide";let fye=loe;on(WA.ID,WA,ri.Eventually);Re(AHt);Re(uye);Re(gye);Re(EHt);Re(fye);const QM={Visible:new Q("parameterHintsVisible",!1),MultipleSignatures:new Q("parameterHintsMultipleSignatures",!1)};async function Oet(s,e,t,i,n){const o=s.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){No(a)}}_t.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n);const o=s.get(it),r=await s.get(fn).createModelReference(t);try{const a=await Oet(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:Dy.Invoke,isRetrigger:!1,triggerCharacter:n},He.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var ah;(function(s){let e;(function(n){n[n.Default=0]="Default",n[n.Active=1]="Active",n[n.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}s.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}s.Active=i})(ah||(ah={}));const doe=class doe extends V{constructor(e,t,i=doe.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=ah.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new wn),this.triggerChars=new jj,this.retriggerChars=new jj,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Mh(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===ah.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=ah.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(vt)}next(){if(this.state.type!==ah.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==ah.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===ah.Type.Active&&(this.state=new ah.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===ah.Type.Active||this.state.type===ah.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(xHt);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new ah.Pending(Rr(c=>Oet(this.providers,r,a,o,c)),i);try{const c=await this.state.request;return e!==this.triggerId?(c?.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new ah.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=ah.Default),vt(c),!1}}getLastActiveHints(){switch(this.state.type){case ah.Type.Active:return this.state.hints;case ah.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===ah.Type.Active||this.state.type===ah.Type.Pending||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Dy.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Dy.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Dy.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};doe.DEFAULT_DELAY=120;let pye=doe;function xHt(s,e){switch(e.triggerKind){case Dy.Invoke:return e;case Dy.ContentChange:return s;case Dy.TriggerCharacter:default:return e}}var DHt='.monaco-editor .parameter-hints-widget{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);cursor:default;display:flex;flex-direction:column;line-height:1.5em;z-index:39}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{display:flex;flex-direction:row;max-width:440px}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{border-left:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;height:100%;opacity:.5;position:absolute}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{border-bottom:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;left:0;opacity:.5;padding-top:4px;position:absolute;width:100%}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs code{background-color:var(--vscode-textCodeBlock-background);border-radius:3px;font-family:var(--monaco-monospace-font);padding:0 .4em}.monaco-editor .parameter-hints-widget .docs .code,.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{align-items:center;display:none;flex-direction:column;justify-content:flex-end;min-width:22px}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{background-repeat:no-repeat;cursor:pointer;height:16px;width:16px}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{font-family:var(--monaco-monospace-font);height:12px;line-height:12px;text-align:center}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}';ut(DHt,{});var mye;const Cf=fe,kHt=oi("parameter-hints-next",ve.chevronDown,g(5198,"Icon for show next parameter hint.")),IHt=oi("parameter-hints-previous",ve.chevronUp,g(5199,"Icon for show previous parameter hint."));var ZL;let _ye=(ZL=class extends V{constructor(e,t,i,n,o,r){super(),this.editor=e,this.model=t,this.telemetryService=r,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Y_({editor:e},o,n)),this.keyVisible=QM.Visible.bindTo(i),this.keyMultipleSignatures=QM.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Cf(".editor-widget.parameter-hints-widget"),t=re(e,Cf(".phwrapper"));t.tabIndex=-1;const i=re(t,Cf(".controls")),n=re(i,Cf(".button"+We.asCSSSelector(IHt))),o=re(i,Cf(".overloads")),r=re(i,Cf(".button"+We.asCSSSelector(kHt)));this._register(ue(n,"click",u=>{en.stop(u),this.previous()})),this._register(ue(r,"click",u=>{en.stop(u),this.next()}));const a=Cf(".body"),c=new EU(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=re(a,Cf(".signature")),d=re(a,Cf(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(x.fontInfo),f=this.domNodes.element;f.style.fontSize=`${u.fontSize}px`,f.style.lineHeight=`${u.lineHeight/u.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",cd.fontFamily)};h(),this._register(M.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(x.fontInfo)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[es.ABOVE,es.BELOW]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=re(this.domNodes.signature,Cf(".code")),o=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(o)this.renderParameters(n,i,r);else{const l=re(n,Cf("span"));l.textContent=i.label}const a=i.parameters[r];if(a?.documentation){const l=Cf("span.documentation");if(typeof a.documentation=="string")l.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);l.appendChild(d.element)}re(this.domNodes.docs,Cf("p",{},l))}if(i.documentation!==void 0)if(typeof i.documentation=="string")re(this.domNodes.docs,Cf("p",{},i.documentation));else{const l=this.renderMarkdownDocs(i.documentation);re(this.domNodes.docs,l.element)}const c=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let l="";const d=i.parameters[r];Array.isArray(d.label)?l=i.label.substring(d.label[0],d.label[1]):l=d.label,d.documentation&&(l+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(l+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==l&&(Mr(g(5200,"{0}, hint",l)),this.announcedLabel=l)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new js,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const n=t.elapsed();return n>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:n}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&qn(t.documentation).length>0||t&&typeof t.documentation=="object"&&qn(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&qn(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&qn(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),re(e,r,a,c)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${Rh(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return mye.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},mye=ZL,ZL.ID="editor.widget.parameterHintsWidget",ZL);_ye=mye=D([_(2,Le),_(3,Ao),_(4,xi),_(5,Yi)],_ye);W("editorHoverWidget.highlightForeground",nF,g(5201,"Foreground color of the active item in the parameter hint."));var vye,eR;let NW=(eR=class extends V{static get(e){return e.getContribution(vye.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new pye(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{n?(this.widget.value.show(),this.widget.value.render(n)):this.widget.rawValue?.hide()})),this.widget=new ya(()=>this._register(t.createInstance(_ye,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}},vye=eR,eR.ID="editor.controller.parameterHints",eR);NW=vye=D([_(1,we),_(2,it)],NW);class THt extends tt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(1541,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:J.hasSignatureHelpProvider,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Space,weight:Ae.EditorContrib}})}run(e,t){NW.get(t)?.trigger({triggerKind:Dy.Invoke})}}on(NW.ID,NW,ri.BeforeFirstInteraction);Re(THt);const ZMe=Ae.EditorContrib+75,eNe=hc.bindToContribution(NW.get);qe(new eNe({id:"closeParameterHints",precondition:QM.Visible,handler:s=>s.cancel(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new eNe({id:"showPrevParameterHint",precondition:he.and(QM.Visible,QM.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.Alt|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new eNe({id:"showNextParameterHint",precondition:he.and(QM.Visible,QM.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.Alt|S.DownArrow,U.WinCtrl|S.KeyN]}}}));var LHt=".monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground);.editorPlaceholder{text-wrap:nowrap;color:var(--vscode-editor-placeholder-foreground);overflow:hidden;pointer-events:none;position:absolute;text-overflow:ellipsis;top:0}}";ut(LHt,{});class Bet{constructor(e){this.instantiationService=e}init(...e){}}function RHt(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=cu((n,o)=>{const r=Fg(s(),n);o.add(this.instantiationService.createInstance(r,...i))})}dispose(){this._autorun?.dispose()}}}let ZUe=class extends Bet{constructor(e){super(e),this.init()}};ZUe=D([_(0,we)],ZUe);function MHt(s){return kae()?RHt(s,bye):s()}let bye=class extends Bet{constructor(e,t){super(t),this.init(e)}};bye=D([_(1,we)],bye);on(a9.ID,MHt(()=>a9),ri.Eager);W("editor.placeholder.foreground",w_t,g(1542,"Foreground color of the placeholder text in the editor."));var NHt=".monaco-editor .rename-box{border-radius:4px;color:inherit;z-index:100}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{border-radius:2px;padding:3px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{padding:0;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{align-items:center;background-color:transparent;border:none;border-radius:5px;cursor:pointer;display:flex;padding:3px}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}";ut(NHt,{});const qU=new Q("renameInputVisible",!1,g(5202,"Whether the rename input widget is visible"));let wye=class{constructor(e,t,i,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=qU.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new js,this._inputWithButton=new PHt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.fontInfo)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new tNe(this._domNode,{fontInfo:this._editor.getOption(x.fontInfo),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(CI),i=e.getColor(H2);this._domNode.style.backgroundColor=String(e.getColor(xh)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(iqe)??"");const n=e.getColor(o5);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(z2)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(z2)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Tt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(x.fontInfo);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=z_(this.getDomNode().ownerDocument.body),t=Cr(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(x.lineHeight),{totalHeight:o}=c9.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>o*6?[es.BELOW,es.ABOVE]:[es.ABOVE,es.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(5204,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Tt(this._renameCandidateListView),Tt(this._nPxAvailableAbove!==void 0),Tt(this._nPxAvailableBelow!==void 0);const t=fb(this._inputWithButton.domNode),i=fb(this._label);let n;e===es.BELOW?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Pd(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),c.add(ue(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(ue(this._inputWithButton.button,ke.KEY_DOWN,d=>{const h=new En(d);(h.equals(S.Enter)||h.equals(S.Space))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new oe(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),c.add(Ee(()=>{this._renameCts=void 0,o.dispose(!0)})),c.add(Ee(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),c.add(Ee(()=>this._candidates.clear()));const l=new dc;return l.p.finally(()=>{c.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Tt(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const p=this._renameCandidateListView.focusedCandidate;if(p!==void 0?(this._trace("using new name from renameSuggestion"),u=p,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},c.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),c.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),l.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Tt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ci;const i=t?mM.Invoke:mM.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){Tt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return!F.isEmpty(i)&&!F.spansMultipleLines(i)&&F.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,mt.Smooth),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...l)=>this._trace("_updateRenameCandidates",...l);n("start");const o=await U_(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&Fc(l.value)?l.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=ja(r,l=>l.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const c=a.filter(({newSymbolName:l})=>l.trim().length>0&&l!==this._inputWithButton.input.value&&l!==t&&!this._candidates.has(l));if(n(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(c),n("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};wye=D([_(2,pn),_(3,Ut),_(4,Le),_(5,Ge)],wye);class tNe{constructor(e,t){this._disposables=new Z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=tNe._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(BN({listInactiveFocusForeground:K8,listInactiveFocusBackground:q8}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Ah(g(5205,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=c9.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new c9(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Xa("NewSymbolNameCandidates",e,n,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class PHt{constructor(){this._onDidInputChange=new I,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",g(5206,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=g(5207,"Generate new name suggestions"),this._buttonCancelHoverText=g(5208,"Cancel"),this._buttonHover=Sm().setupManagedHover(Pr("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ue(this.input,ke.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.KEY_DOWN,e=>{const t=new En(e);(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(ue(this.input,ke.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(ue(this.input,ke.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Tt(this._inputNode),this._inputNode}get button(){return Tt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=Yy(ve.sparkle),Ms(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHover?.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=Yy(ve.primitiveSquare),Ms(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHover?.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const Qz=class Qz{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${Qz._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=Yy(ve.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Dl(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(ufe.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Qz._PADDING*2}}dispose(){}};Qz._PADDING=2;let c9=Qz;var yye;class iNe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`):void 0}:{range:F.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` +`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` +`)};const r=await o.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g(1543,"No result.")),n);return r}}async function FHt(s,e,t,i){const n=new iNe(e,t,s),o=await n.resolveRenameLocation(He.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,He.None)}var tR;let iI=(tR=class{static get(e){return e.getContribution(yye.ID)}constructor(e,t,i,n,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ci,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(wye,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ci,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new iNe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new Jk(this.editor,jo.Position|jo.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(n.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Ma?e("resolve rename location cancelled",JSON.stringify(p,null," ")):(e("resolve rename location failed",p instanceof Error?p:JSON.stringify(p,null," ")),(typeof p=="string"||dd(p))&&Lh.get(this.editor)?.showMessage(p||g(1544,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Lh.get(this.editor)?.showMessage(o.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Jk(this.editor,jo.Position|jo.Value,o.range,this._cts.token),a=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(a),l=await Promise.all(c.map(async p=>[p,await p.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(p,m)=>{let v=l.slice();return p===mM.Automatic&&(v=v.filter(([b,w])=>w)),v.map(([b])=>b.provideNewSymbolNames(a,o.range,p,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,c.length>0?d:void 0,r);if(e("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=U_(i.provideRenameEdits(u.newName,r.token),r.token).then(async p=>{if(!p){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(p.rejectReason){e(`returning early - rejected with reason: ${p.rejectReason}`),this._notificationService.info(p.rejectReason);return}this.editor.setSelection(F.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(1545,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(1546,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&Mr(g(1547,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applying edits ${JSON.stringify(m,null," ")}`),this._notificationService.error(g(1548,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(1549,"Rename failed to compute edits")),this._logService.error(p)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},yye=tR,tR.ID="editor.contrib.renameController",tR);iI=yye=D([_(1,we),_(2,bi),_(3,PN),_(4,XA),_(5,Ge),_(6,Ec),_(7,it),_(8,Yi)],iI);class OHt extends tt{constructor(){super({id:"editor.action.rename",label:g(1550,"Rename Symbol"),alias:"Rename Symbol",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=e.get(Ge),n=iI.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}on(iI.ID,iI,ri.Lazy);Re(OHt);const nNe=hc.bindToContribution(iI.get);qe(new nNe({id:"acceptRenameInput",precondition:qU,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Enter}}));qe(new nNe({id:"acceptRenameInputWithPreview",precondition:he.and(qU,he.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:U.CtrlCmd+S.Enter}}));qe(new nNe({id:"cancelRenameInput",precondition:qU,handler:s=>s.cancelRenameInput(),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));At(class extends li{constructor(){super({id:"focusNextRenameSuggestion",title:{...Pe(1551,"Focus Next Rename Suggestion")},precondition:qU,keybinding:[{primary:S.DownArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=iI.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends li{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Pe(1552,"Focus Previous Rename Suggestion")},precondition:qU,keybinding:[{primary:S.UpArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=iI.get(t);i&&i.focusPreviousRenameSuggestion()}});rg("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Tt(typeof n=="string");const{renameProvider:o}=s.get(it);return FHt(o,e,t,n)});rg("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(it),o=await new iNe(e,t,i).resolveRenameLocation(He.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:at.LANGUAGE_OVERRIDABLE,description:g(1553,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var WB;let tZ=(WB=class extends V{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(x.minimap)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{const o=this.editor.getModel()?.getLanguageId();o&&n.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new cn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!n?.markers))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),c=a.findTokenIndexAtOffset(r.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===nr.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>BHt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,c=r.length;a0&&(h=e.subarray(t,t+d),t+=d),r[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:r}}function vce(s){return s&&!!s.data}function Het(s){return s&&Array.isArray(s.edits)}class VHt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Uet(s,e){return s.has(e)}function zHt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Vet(s,e,t,i,n){const o=zHt(s,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){l=d,c=null}return(!c||!vce(c)&&!Het(c))&&(c=null),new VHt(a,c,l)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function $Ht(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class GHt{constructor(e,t){this.provider=e,this.tokens=t}}function KHt(s,e){return s.has(e)}function zet(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function sNe(s,e,t,i){const n=zet(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){No(c),a=null}return(!a||!vce(a))&&(a=null),new GHt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}_t.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it),o=$Ht(n,i);return o?o[0].getLegend():s.get(vi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});_t.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it);if(!Uet(n,i))return s.get(vi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await Vet(n,i,null,null,He.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!vce(a))return;const c=d9({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});_t.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N);const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=zet(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!F.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await sNe(o,n,F.lift(i),He.None);if(a)return a.provider.getLegend()});_t.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N),Tt(F.isIRange(i));const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=await sNe(o,n,F.lift(i),He.None);if(!(!r||!r.tokens))return d9({id:0,type:"full",data:r.tokens.data})});const oNe="editor.semanticHighlighting";function mQ(s,e,t){const i=t.getValue(oNe,{overrideIdentifier:s.getLanguageId(),resource:s.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var SE;let Cye=class extends V{constructor(e,t,i,n,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new Sye(d,e,i,o,r)},c=(d,h)=>{h.dispose(),delete this._watchers[d.uri.toString()]},l=()=>{for(const d of t.getModels()){const h=this._watchers[d.uri.toString()];mQ(d,i,n)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{mQ(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{mQ(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(oNe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Cye=D([_(0,aae),_(1,gi),_(2,pn),_(3,Te),_(4,Sp),_(5,it)],Cye);var ek;let Sye=(ek=class extends V{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:SE.REQUEST_MIN_DELAY,max:SE.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new cn(()=>this._fetchDocumentSemanticTokensNow(),SE.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{bt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),bt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Uet(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ci,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Vet(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(c=>{o.push(c)}),a=new js(!1);n.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,o)}},c=>{c&&(Fr(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||vt(c),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let r=0;r{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(Het(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=o.data,l=new Uint32Array(c.length+a);let d=c.length,h=l.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>c.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(SE._copy(c,d-p,l,h-p,p),h-=p),f.data&&(SE._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&SE._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(vce(t)){this._currentDocumentResponse=new qHt(e,t.resultId,t.data);const a=wQe(t,i,this._model.getLanguageId());if(n.length>0)for(const c of n)for(const l of a)for(const d of c.changes)l.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},SE=ek,ek.REQUEST_MIN_DELAY=300,ek.REQUEST_MAX_DELAY=2e3,ek);Sye=SE=D([_(1,aae),_(2,pn),_(3,Sp),_(4,it)],Sye);class qHt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}j6(Cye);var Aye,iR;let PW=(iR=class extends V{static get(e){return e.getContribution(Aye.ID)}constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new cn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(oNe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Rr(r=>Promise.resolve(sNe(this._provider,e,t,r))),o=new js(!1);return n.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=r,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,wQe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},Aye=iR,iR.ID="editor.contrib.viewportSemanticTokens",iR);PW=Aye=D([_(1,aae),_(2,pn),_(3,Te),_(4,Sp),_(5,it)],PW);on(PW.ID,PW,ri.AfterFirstRender);class QHt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===B.Underline||h===B.Dash))break;if(bx(h)&&Ow(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new F(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Eye;class rNe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new rNe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var nR;let jM=(nR=class{static get(e){return e.getContribution(Eye.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Get(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),He.None).then(o=>{if(!(!eo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!is(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),o[r].unshift(t[r]);this._state=o.map(r=>new rNe(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>dt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Eye=nR,nR.ID="editor.contrib.smartSelectController",nR);jM=Eye=D([_(1,it)],jM);class $et extends tt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=jM.get(t);i&&await i.run(this._forward)}}class jHt extends $et{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(1554,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.RightArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.RightArrow,secondary:[U.WinCtrl|U.Shift|S.RightArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1555,"&&Expand Selection"),order:2}})}}_t.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class YHt extends $et{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(1556,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.LeftArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.LeftArrow,secondary:[U.WinCtrl|U.Shift|S.LeftArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1557,"&&Shrink Selection"),order:3}})}}on(jM.ID,jM,ri.Lazy);Re(jHt);Re(YHt);async function Get(s,e,t,i,n){const o=s.all(e).concat(new QHt(i.selectSubwords));o.length===1&&o.unshift(new cX);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,n)).then(l=>{if(eo(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>oe.isBefore(u.getStartPosition(),f.getStartPosition())?1:oe.isBefore(f.getStartPosition(),u.getStartPosition())||oe.isBefore(u.getEndPosition(),f.getEndPosition())?-1:oe.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const l=[];let d;for(const u of c)(!d||F.containsRange(u,d)&&!F.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;us}),aue="data-sticky-line-index",t4e="data-sticky-is-line",XHt="data-sticky-is-line-number",i4e="data-sticky-is-folding-icon";class ZHt extends V{constructor(e){super(),this._editor=e,this._foldingIconStore=new Z,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(x.lineHeight),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof lf),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(x.stickyScroll).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.stickyScroll)&&t(),i.hasChanged(x.lineHeight)&&(this._lineHeight=this._editor.getOption(x.lineHeight))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),o=n?void 0:e,r=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(o,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new oe(t,1)).lineNumber,a=o.getViewLineRenderingData(r),c=this._editor.getOption(x.lineNumbers);let l;try{l=eu.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new yI(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,l,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),h=new wU(2e3),u=n6(d,h);let f;e4e?f=e4e.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(aue,String(e)),p.setAttribute(t4e,""),p.setAttribute("role","listitem"),p.tabIndex=0,p.className="sticky-line-content",p.classList.add(`stickyLine${t}`),p.style.lineHeight=`${this._lineHeight}px`,p.innerHTML=f;const m=document.createElement("span");m.setAttribute(aue,String(e)),m.setAttribute(XHt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=n.contentLeft;m.style.width=`${v}px`;const b=document.createElement("span");c.renderType===wr.On||c.renderType===wr.Interval&&t%10===0?b.innerText=t.toString():c.renderType===wr.Relative&&(b.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),b.className="sticky-line-number-inner",b.style.lineHeight=`${this._lineHeight}px`,b.style.width=`${n.lineNumbersWidth}px`,b.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(b);const w=this._renderFoldingIconForLine(i,t);w&&m.appendChild(w.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(b),m.style.lineHeight=`${this._lineHeight}px`,p.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`;const y=new eUt(e,t,p,m,w,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,n.style.zIndex=o?r:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=o?c:l,n.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const n=e.regions,o=n.findRange(t),r=n.getStartLineNumber(o);if(!(t===r))return;const c=n.isCollapsed(o),l=new tUt(c,r,n.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute(i4e,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Wg.TOP_CENTER,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=WTe(t.characterMapping,e,0);return new oe(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,aue);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,t4e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,i4e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class eUt{constructor(e,t,i,n,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class tUt{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=We.asClassName(e?MJ:RJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class G5{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class nZ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Ket{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var K5;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(K5||(K5={}));var Ox;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(Ox||(Ox={}));let xye=class extends V{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Mh(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case K5.OUTLINE_MODEL:this._modelProviders.push(new Dye(this._editor,n));case K5.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new Iye(this._editor,t,n));case K5.INDENTATION_MODEL:this._modelProviders.push(new kye(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const o=await i;if(this._modelPromise!==n)return null;switch(o){case Ox.CANCELED:return this._updateOperation.clear(),null;case Ox.VALID:return t.stickyModel}}return null}).catch(t=>(vt(t),null))}};xye=D([_(2,we),_(3,it)],xye);class qet extends V{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Ox.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Rr(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?Ox.CANCELED:(this._stickyModel=this.createStickyModel(e,i),Ox.VALID):this._invalid()).then(void 0,i=>(vt(i),Ox.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let Dye=class extends qet{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Tw.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new Ket(o.uri,o.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(hi.first(e.children.values())instanceof Rwe){const a=hi.find(e.children.values(),c=>c.id===t);if(a)i=a.children;else{let c="",l=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>l&&(d=u,l=f,c=u.id)}t=c,i=d.children}}else i=e.children;const n=[],o=Array.from(i.values()).sort((a,c)=>{const l=new G5(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new G5(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new nZ(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const n=new G5(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new nZ(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof Lwe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Dye=D([_(1,it)],Dye);class Qet extends qet{constructor(e){super(e),this._foldingLimitReporter=new eJe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Ket(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new nZ(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new FRe(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};Iye=D([_(2,it)],Iye);class iUt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var HB;let Tye=(HB=class extends V{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new I),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Z),this._updateSoon=this._register(new cn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.stickyScroll)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(x.stickyScroll).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Ee(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new xye(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ci,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(y2(a,e.startLineNumber+n,(d,h)=>d-h));for(let d=c;d<=l;d++){const h=t.children[d];if(!h)return;if(h.range){const u=h.range.startLineNumber,f=h.range.endLineNumber;e.startLineNumber<=f+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new iUt(u,f-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,o)}}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=this._editor._getViewModel()?.getHiddenAreas();if(i)for(const n of i)t=t.filter(o=>!(o.startLineNumber>=n.startLineNumber&&o.endLineNumber<=n.endLineNumber+1));return t}},HB.ID="store.contrib.stickyScrollController",HB);Tye=D([_(1,it),_(2,Vs)],Tye);var Lye,sR;let HA=(sR=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new Z,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new ZHt(this._editor),this._stickyLineCandidateProvider=new Tye(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=$5.Empty,this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(ue(c,ke.CONTEXT_MENU,async d=>{this._onContextMenu(ct(c),d)})),this._stickyScrollFocusedContextKey=J.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=J.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ac(c));this._register(l.onDidBlur(d=>{this._positionRevealed===!1&&c.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(l.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(ue(c,ke.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(Lye.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,mt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(F.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new dce(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==Rt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new F(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Ro(n,ke.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(l===null)return;const d=new oe(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(l===null)return;c=new oe(l,1)}this._revealPosition(c)})),this._register(Ro(n,ke.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,ke.MOUSE_LEAVE,o=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:c,textElement:l}=a;if(!c.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=c,e.clear();else if(l.style.textDecoration==="underline")return;const d=new ci;e.add(Ee(()=>d.dispose(!0)));let h;J6(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),!1,d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=l;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==Rt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(QZe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Eh(e,t);this._contextMenuService.showContextMenu({menuId:_e.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;RRe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(x.stickyScroll);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===wr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(x.stickyScroll)||e.hasChanged(x.minimap)||e.hasChanged(x.lineHeight)||e.hasChanged(x.showFoldingControls)||e.hasChanged(x.lineNumbers))&&this._readConfiguration(),e.hasChanged(x.lineNumbers)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(x.lineHeight);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await TA.get(this._editor)?.getFoldingModel()??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=$5.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let n=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new G5(a[0].startLineNumber,a[a.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(c);for(const d of l){const h=d.startLineNumber,u=d.endLineNumber,f=d.nestingDepth;if(u-h>0){const p=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(h)-i,b=this._editor.getTopForLineNumber(u)-i,w=this._editor.getBottomForLineNumber(u)-i;if(p>b&&p<=w){o.push(h),r.push(u+1),n=w-m;break}else m>v&&m<=w&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new $5(o,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Lye=sR,sR.ID="store.contrib.stickyScrollController",sR);HA=Lye=D([_(1,lr),_(2,it),_(3,we),_(4,Vs),_(5,Sp),_(6,Le)],HA);class nUt extends li{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Pe(5217,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(5218,"&&Toggle Editor Sticky Scroll")},metadata:{description:Pe(5219,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:ca.View,toggled:{condition:he.equals("config.editor.stickyScroll.enabled",!0),title:g(5220,"Sticky Scroll"),mnemonicTitle:g(5221,"&&Sticky Scroll")},menu:[{id:_e.CommandPalette},{id:_e.MenubarAppearanceMenu,group:"4_editor",order:3},{id:_e.StickyScrollContext}]})}async run(e){const t=e.get(Te),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const bce=Ae.EditorContrib;class sUt extends gf{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Pe(5222,"Focus on the editor sticky scroll"),mnemonicTitle:g(5223,"&&Focus Sticky Scroll")},precondition:he.and(he.has("config.editor.stickyScroll.enabled"),J.stickyScrollVisible),menu:[{id:_e.CommandPalette}]})}runEditorCommand(e,t){HA.get(t)?.focus()}}class oUt extends gf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Pe(5224,"Select the next editor sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.DownArrow}})}runEditorCommand(e,t){HA.get(t)?.focusNext()}}class rUt extends gf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Pe(5225,"Select the previous sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.UpArrow}})}runEditorCommand(e,t){HA.get(t)?.focusPrevious()}}class aUt extends gf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Pe(5226,"Go to the focused sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.Enter}})}runEditorCommand(e,t){HA.get(t)?.goToFocused()}}class cUt extends gf{constructor(){super({id:"editor.action.selectEditor",title:Pe(5227,"Select Editor"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.Escape}})}runEditorCommand(e,t){HA.get(t)?.selectEditor()}}on(HA.ID,HA,ri.AfterFirstRender);At(nUt);At(sUt);At(rUt);At(oUt);At(aUt);At(cUt);class lUt{constructor(e,t,i,n,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=r}}let Rye=class extends K1e{constructor(e,t,i,n,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(He.None)}return e}};Rye=D([_(5,cce)],Rye);let Mye=class extends V{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){if(i.selectedSuggestionInfo)return;let o;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){o=f;break}if(!o)return;const r=o.getOption(x.quickSuggestions);if(mF.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),c=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(mF.valueFor(r,c)!=="inline")return;let l=e.getWordAtPosition(t),d;if(l?.word||(d=this._getTriggerCharacterInfo(e,t)),!l?.word&&!d||(l||(l=e.getWordUntilPosition(t)),l.endColumn!==t.column))return;let h;const u=e.getValueInRange(new F(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new tUe(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await mMe(this._languageFeatureService.completionProvider,e,t,new G3(void 0,dX.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:Ku.TriggerCharacter,triggerCharacter:d.ch},n);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new nx(f.items,t.column,new tUe(u,0),lX.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Rye(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(He.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(F.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};Mye=D([_(0,it),_(1,dg),_(2,cce),_(3,Kt)],Mye);j6(Mye);class dUt extends tt{constructor(){super({id:"editor.action.forceRetokenize",label:g(1569,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new js;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Re(dUt);var hUt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";ut(hUt,{});var uUt=".editor-banner{background:var(--vscode-banner-background);box-sizing:border-box;cursor:default;display:flex;font-size:12px;height:26px;overflow:visible;width:100%}.editor-banner .icon-container{align-items:center;display:flex;flex-shrink:0;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-position:50%;background-repeat:no-repeat;background-size:16px;margin:0 6px 0 10px;padding:0;width:16px}.editor-banner .message-container{align-items:center;display:flex;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-banner .message-container p{margin-block-end:0;margin-block-start:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{margin:2px 8px;padding:0 12px;width:inherit}.editor-banner .message-actions-container a{margin-left:12px;padding:3px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}";ut(uUt,{});const gUt=26;let Nye=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Pye))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,gUt)}};Nye=D([_(1,we)],Nye);let Pye=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Y_,{}),this.element=fe("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ms(this.element)}show(e){Ms(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=re(this.element,fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fe(`div${We.asCSSSelector(e.icon)}`));const n=re(this.element,fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=re(this.element,fe("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(i9,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=re(this.element,fe("div.action-container"));this.actionBar=this._register(new hd(o)),this.actionBar.push(this._register(new rn("banner.close","Close Banner",We.asClassName(xYe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Pye=D([_(0,we)],Pye);const fUt=oi("extensions-warning-message",ve.warning,g(1574,"Icon shown with a warning message in the extensions editor."));var UB;let h9=(UB=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:g(1575,"This document contains many non-basic ASCII unicode characters"),command:new g9};else if(o.ambiguousCharacterCount>=r)a={message:g(1576,"This document contains many ambiguous unicode characters"),command:new YM};else if(o.invisibleCharacterCount>=r)a={message:g(1577,"This document contains many invisible unicode characters"),command:new u9};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:fUt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(Nye,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(x.unicodeHighlighting)&&(this._options=e.getOption(x.unicodeHighlighting),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=pUt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?ql:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Fye(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new mUt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},UB.ID="editor.contrib.unicodeHighlighter",UB);h9=D([_(1,Ml),_(2,uC),_(3,we)],h9);function pUt(s,e){return{nonBasicASCII:e.nonBasicASCII===kf?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===kf?!s:e.includeComments,includeStrings:e.includeStrings===kf?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let Fye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new cn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:sZ.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!pLe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Yet(i,this._options),inComment:mLe(t,e),inString:_Le(t,e)}}};Fye=D([_(3,Ml)],Fye);class mUt extends V{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new cn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const o=bTe.computeUnicodeHighlights(this._model,this._options,n);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:sZ.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return pLe(t,e)?{reason:Yet(i,this._options),inComment:mLe(t,e),inString:_Le(t,e)}:null}}const jet=g(1578,"Configure Unicode Highlight Options");let Oye=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==du.Range)return[];const i=this._editor.getModel(),n=this._editor.getContribution(h9.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=n.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=cue(h);let f;switch(l.reason.kind){case y_.Ambiguous:{H7(l.reason.confusableWith)?f=g(1579,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,cue(l.reason.confusableWith.codePointAt(0))):f=g(1580,"The character {0} could be confused with the character {1}, which is more common in source code.",u,cue(l.reason.confusableWith.codePointAt(0)));break}case y_.Invisible:f=g(1581,"The character {0} is invisible.",u);break;case y_.NonBasicAscii:f=g(1582,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(1583,"Adjust settings"),v=`command:${oZ.ID}?${encodeURIComponent(JSON.stringify(p))}`,b=new Mt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,jet);o.push(new m_(this,c.range,[b],!1,a++))}return o}renderHoverParts(e,t){return KPt(e,t,this._editor,this._languageService,this._openerService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` +`)}};Oye=D([_(1,xi),_(2,Ao)],Oye);function Bye(s){return`U+${s.toString(16).padStart(4,"0")}`}function cue(s){let e=`\`${Bye(s)}\``;return pT.isInvisibleCharacter(s)||(e+=` "${`${_Ut(s)}`}"`),e}function _Ut(s){return s===B.BackTick?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Yet(s,e){return bTe.computeUnicodeHighlightReason(s,e)}const hoe=class hoe{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Gt.createDynamic({description:"unicode-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};hoe.instance=new hoe;let sZ=hoe;const rFe=class rFe extends tt{constructor(){super({id:YM.ID,label:g(1584,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(1585,"Disable Highlight In Comments")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.includeComments,!1,St.USER)}};rFe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let Wye=rFe;const aFe=class aFe extends tt{constructor(){super({id:YM.ID,label:g(1586,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(1587,"Disable Highlight In Strings")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.includeStrings,!1,St.USER)}};aFe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let Hye=aFe;const uoe=class uoe extends tt{constructor(){super({id:uoe.ID,label:g(1588,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(1589,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.ambiguousCharacters,!1,St.USER)}};uoe.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let YM=uoe;const goe=class goe extends tt{constructor(){super({id:goe.ID,label:g(1590,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(1591,"Disable Invisible Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.invisibleCharacters,!1,St.USER)}};goe.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let u9=goe;const foe=class foe extends tt{constructor(){super({id:foe.ID,label:g(1592,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(1593,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.nonBasicASCII,!1,St.USER)}};foe.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let g9=foe;const poe=class poe extends tt{constructor(){super({id:poe.ID,label:g(1594,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(n),l=e.get(In),d=e.get(Te);function h(p){return pT.isInvisibleCharacter(p)?g(1595,"Exclude {0} (invisible character) from being highlighted",Bye(p)):g(1596,"Exclude {0} from being highlighted",`${Bye(p)} "${c}"`)}const u=[];if(o.kind===y_.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(1597,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{bUt(d,[p])}});if(u.push({label:h(n),run:()=>vUt(d,[n])}),a){const p=new Wye;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new Hye;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===y_.Ambiguous){const p=new YM;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===y_.Invisible){const p=new u9;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===y_.NonBasicAscii){const p=new g9;u.push({label:p.label,run:async()=>p.runAction(d)})}else wUt(o);const f=await l.pick(u,{title:jet});f&&await f.run()}};poe.ID="editor.action.unicodeHighlight.showExcludeOptions";let oZ=poe;async function vUt(s,e){const t=s.getValue(Mu.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(Mu.allowedCharacters,i,St.USER)}async function bUt(s,e){const t=s.inspect(Mu.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await s.updateValue(Mu.allowedLocales,i,St.USER)}function wUt(s){throw new Error(`Unexpected value: ${s}`)}Re(YM);Re(u9);Re(g9);Re(oZ);on(h9.ID,h9,ri.AfterFirstRender);GN.register(Oye);const Jet="ignoreUnusualLineTerminators";function yUt(s,e,t){s.setModelProperty(e.uri,Jet,t)}function CUt(s,e){return s.getModelProperty(e.uri,Jet)}var VB;let rZ=(VB=class extends V{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(x.unusualLineTerminators),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||CUt(this._codeEditorService,e)===!0||this._editor.getOption(x.readOnly))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:g(1598,"Unusual Line Terminators"),message:g(1599,"Detected unusual line terminators"),detail:g(1600,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",_i(e.uri)),primaryButton:g(1601,"&&Remove Unusual Line Terminators"),cancelButton:g(1602,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){yUt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},VB.ID="editor.contrib.unusualLineTerminatorsDetector",VB);rZ=D([_(1,to),_(2,Kt)],rZ);on(rZ.ID,rZ,ri.AfterFirstRender);var _c,Uye;const wce=new Q("hasWordHighlights",!1);function Xet(s,e,t,i){const n=s.ordered(e);return Nre(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,No)),eo).then(o=>{if(o){const r=new ui;return r.set(e.uri,o),r}return new ui})}function SUt(s,e,t,i,n,o){const r=s.ordered(e);return Nre(r.map(a=>()=>{const c=o.filter(l=>Ly(l)).filter(l=>cae(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,n)).then(void 0,No)}),a=>a instanceof ui&&a.size>0)}class aNe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Rr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new F(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=r&&(c=!0)}return c}cancel(){this.result.cancel()}}class AUt extends aNe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Xet(this._providers,e,t.getPosition(),n).then(o=>o||new ui)}}class EUt extends aNe{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return SUt(this._providers,e,t.getPosition(),i,n,this._otherModels).then(o=>o||new ui)}}class Zet extends aNe{constructor(e,t,i,n,o){super(e,t,n),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Sr(250,n).then(()=>{const o=new ui;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new ui;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:w8.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function xUt(s,e,t,i,n){return s.has(e)?new AUt(e,t,n,s):new Zet(e,t,i,n,[])}function DUt(s,e,t,i,n,o){return s.has(e)?new EUt(e,t,n,s,o):new Zet(e,t,i,n,o)}rg("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(it);return(await Xet(i.documentHighlightProvider,e,t,He.None))?.get(e.uri)});var tk;let Vye=(tk=class{constructor(e,t,i,n,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ui,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=wce.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():_c.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(x.occurrencesHighlight);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,_c.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}stop(){this.occurrencesHighlight!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(F.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_c.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_c.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const i of e){if(!i.hasModel())continue;const n=_c.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const o=hp.get(i);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)_c.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell&&_c.query?.modelInfo?.model.uri.scheme!==pe.vscodeNotebookCell?(_c.query=null,this._run()):_c.query?.modelInfo&&(_c.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==Oi.Explicit&&this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===pe.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===pe.vscodeNotebookCell&&o.push(c)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!im(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){_c.query=null,this._stopAll();return}const n=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>n||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},vt)}}computeWithModel(e,t,i,n){return n.length?DUt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),n):xUt(this.providers,e,t,i,this.editor.getOption(x.wordSeparators))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=hp.get(t);if(!i)continue;const n=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=_c.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&n.push({range:l.range,options:NWt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],n)}),_c.storedDecorations=_c.storedDecorations.set(o,c),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},_c=tk,tk.storedDecorations=new ui,tk.query=null,tk);Vye=_c=D([_(4,Kt)],Vye);var oR;let hp=(oR=class extends V{static get(e){return e.getContribution(Uye.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Vye(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}stopHighlighting(){this._wordHighlighter?.stop()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},Uye=oR,oR.ID="editor.contrib.wordHighlighter",oR);hp=Uye=D([_(1,Le),_(2,it),_(3,Kt)],hp);class ett extends tt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=hp.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class kUt extends ett{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(1603,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:wce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.F7,weight:Ae.EditorContrib}})}}class IUt extends ett{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(1604,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:wce,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|S.F7,weight:Ae.EditorContrib}})}}class TUt extends tt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(1605,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:wce.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t,i){const n=hp.get(t);n&&n.restoreViewState(!0)}}on(hp.ID,hp,ri.Eager);Re(kUt);Re(IUt);Re(TUt);class yce extends hc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=fm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),r=t.getSelections(),a=r.length>1,c=r.map(l=>{const d=new oe(l.positionLineNumber,l.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(l,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Oi.Explicit,c.map(l=>Rn.fromModelSelection(l))),c.length===1){const l=new oe(c[0].positionLineNumber,c[0].positionColumn);t.revealPosition(l,mt.Smooth)}}_moveTo(e,t,i){return i?new dt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new dt(t.lineNumber,t.column,t.lineNumber,t.column)}}class TI extends yce{_move(e,t,i,n,o){return hs.moveWordLeft(e,t,i,n,o)}}class LI extends yce{_move(e,t,i,n,o){return hs.moveWordRight(e,t,i,n)}}class LUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class RUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class MUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|S.LeftArrow,mac:{primary:U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}class NUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class PUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class FUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|U.Shift|S.LeftArrow,mac:{primary:U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}class OUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class BUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class WUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class HUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|S.RightArrow,mac:{primary:U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class UUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordRight",precondition:void 0})}}class VUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class zUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|U.Shift|S.RightArrow,mac:{primary:U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}class $Ut extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class GUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class KUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class Cce extends hc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Vs);if(!t.hasModel())return;const o=fm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new td(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class cNe extends Cce{_delete(e,t){const i=hs.deleteWordLeft(e,t);return i||new F(1,1,1,1)}}class lNe extends Cce{_delete(e,t){const i=hs.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class qUt extends cNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartLeft",precondition:J.writable})}}class QUt extends cNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndLeft",precondition:J.writable})}}class jUt extends cNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Backspace,mac:{primary:U.Alt|S.Backspace},weight:Ae.EditorContrib}})}}class YUt extends lNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartRight",precondition:J.writable})}}class JUt extends lNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndRight",precondition:J.writable})}}class XUt extends lNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Delete,mac:{primary:U.Alt|S.Delete},weight:Ae.EditorContrib}})}}class ZUt extends tt{constructor(){super({id:"deleteInsideWord",precondition:J.writable,label:g(1608,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=fm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=hs.deleteInsideWord(n,o,c);return new td(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}qe(new LUt);qe(new RUt);qe(new MUt);qe(new NUt);qe(new PUt);qe(new FUt);qe(new WUt);qe(new HUt);qe(new UUt);qe(new VUt);qe(new zUt);qe(new $Ut);qe(new OUt);qe(new BUt);qe(new GUt);qe(new KUt);qe(new qUt);qe(new QUt);qe(new jUt);qe(new YUt);qe(new JUt);qe(new XUt);Re(ZUt);class e4t extends Cce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordPartLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Backspace},weight:Ae.EditorContrib}})}_delete(e,t){const i=Xre.deleteWordPartLeft(e);return i||new F(1,1,1,1)}}class t4t extends Cce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordPartRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Delete},weight:Ae.EditorContrib}})}_delete(e,t){const i=Xre.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class ttt extends yce{_move(e,t,i,n,o){return Xre.moveWordPartLeft(e,t,i,o)}}class i4t extends ttt{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class n4t extends ttt{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class itt extends yce{_move(e,t,i,n,o){return Xre.moveWordPartRight(e,t,i)}}class s4t extends itt{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class o4t extends itt{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}qe(new e4t);qe(new t4t);qe(new i4t);qe(new n4t);qe(new s4t);qe(new o4t);const cFe=class cFe extends V{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Lh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Mt(g(1606,"Cannot edit in read-only input")):t=new Mt(g(1607,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};cFe.ID="editor.contrib.readOnlyMessageController";let aZ=cFe;on(aZ.ID,aZ,ri.BeforeFirstInteraction);let zye=class extends V{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=jt(this,void 0);const n=id("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=id("_textModel.onDidChangeContent",M.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(cu(async(r,a)=>{n.read(r),o.read(r);const c=a.add(new nIt),l=await this._outlineModelService.getOrCreate(this._textModel,c.token);a.isDisposed||this._currentModel.set(l,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(S6e(Cc(o=>o.range.endLineNumber-o.range.startLineNumber,nu))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};zye=D([_(1,it),_(2,iG)],zye);DJ.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(zye,s));var r4t='.monaco-editor .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiM0MjQyNDIiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px;height:36px;margin:0;min-height:0;min-width:0;overflow:hidden;padding:0;position:absolute;resize:none;width:58px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiNDNUM1QzUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #252526}';ut(r4t,{});const lFe=class lFe extends V{constructor(e){super(),this.editor=e,this.widget=null,dm&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new $ye(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};lFe.ID="editor.contrib.iPadShowKeyboard";let cZ=lFe;const moe=class moe extends V{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return moe.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Wg.BOTTOM_RIGHT_CORNER}}};moe.ID="editor.contrib.ShowKeyboardWidget";let $ye=moe;on(cZ.ID,cZ,ri.Eventually);function Gye(s){return!!s.workspaceUri}function _Q(s){return!!s.folderUri}function a4t(s){return!!s.fileUri}function c4t(s){const e=l4t(s),t=s.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||Qt&&ad?"classic":t}var n4e;(function(s){s.TITLE_BAR_STYLE="window.titleBarStyle",s.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(n4e||(n4e={}));var Lw;(function(s){s.NATIVE="native",s.CUSTOM="custom"})(Lw||(Lw={}));var s4e;(function(s){s.AUTO="auto",s.WINDOWED="windowed",s.NEVER="never"})(s4e||(s4e={}));function l4t(s,e){return e||(e=dNe(s)),e===Lw.NATIVE}function dNe(s){if(Wn)return Lw.CUSTOM;const e=s.getValue("window");if(e){if(Qt&&e.nativeTabs===!0||Qt&&e.nativeFullScreen===!1)return Lw.NATIVE;const n=e.titleBarStyle;if(n===Lw.NATIVE||n===Lw.CUSTOM)return n}return pr?Lw.NATIVE:Lw.CUSTOM}function hNe(s){return{id:ntt(s),configPath:s}}function d4t(s){return{id:ntt(s),uri:s}}function ntt(s){return Wc(s.toString()).toString(16)}const Kye=60,qye=Kye*60,f9=qye*24,o4e=f9*7,r4e=f9*30,a4e=f9*365;function uNe(s,e,t,i){typeof s!="number"&&(s=s.getTime());const n=Math.round((new Date().getTime()-s)/1e3);if(n<-30)return g(793,"in {0}",uNe(new Date().getTime()+n*1e3,!1));if(n<30)return g(794,"now");let o;return n{await Promise.all(ftt.map(t=>t(e)))}),await s.invokeFunction(async e=>{bje((t,i)=>s.createInstance(xM,t,i,{})),Fje(e.get(ec))}),await s.invokeFunction(async e=>{const t=e.get(ig);await Promise.all(ptt.map(i=>i(e))),t.phase=2}),await s.invokeFunction(async e=>{await Promise.all(mtt.map(t=>t(e)))}),fNe.open(),gtt.fire(),s.invokeFunction(async e=>{const t=e.get(ig);Qe.as(cf.Workbench).start(e),Qe.as(tC.EditorFactory).start(e),dtt.fire(e),htt.fire(e),await Promise.race([e.get(kI).whenRestored,Sr(2e3)]),t.phase=3,new cn(()=>{TO(window,()=>{t.phase=4},2500)},2500).schedule()})}let _tt=!1;Dt.withServices(()=>(_tt=!0,V.None));async function vtt(){await fNe.wait()}function btt(){if(_tt)throw new Error("Services are already initialized")}const wtt="inQuickOpen",b4t=new Q(wtt,!1,g(4610,"Whether keyboard focus is inside the quick open control")),_C=he.has(wtt),w4t="inFilesPicker",ytt=he.and(_C,he.has(w4t));function Sce(s,e){return t=>{const i=t.get(Ut),n=t.get(In),r={keybindings:i.lookupKeybindings(s)};n.navigate(!!e,r)}}let c4e=class extends V{constructor(e,t){super(),this.editorService=e,this.editorGroupsService=t,this._editorViewState=void 0,this.openedTransientEditors=new Set}set(){if(this._editorViewState)return;const e=this.editorService.activeEditorPane;e&&(this._editorViewState={group:e.group,editor:e.input,state:jgt(e.getControl())?.saveViewState()??void 0})}async openTransientEditor(e,t){e.options={...e.options,transient:!0};const i=await this.editorService.openEditor(e,t);return i?.input&&i.input!==this._editorViewState?.editor&&i.group.isTransient(i.input)&&this.openedTransientEditors.add(i.input),i}async restore(){if(this._editorViewState){for(const e of this.openedTransientEditors)if(!e.isDirty())for(const t of this.editorGroupsService.groups)t.isTransient(e)&&await t.closeEditor(e,{preserveFocus:!0});await this._editorViewState.group.openEditor(this._editorViewState.editor,{viewState:this._editorViewState.state,preserveFocus:!0}),this.reset()}}reset(){this._editorViewState=void 0,this.openedTransientEditors.clear()}dispose(){super.dispose(),this.reset()}};c4e=D([_(0,ei),_(1,Po)],c4e);let Qye=class extends vJ{constructor(e,t,i,n,o,r){super(t,n,o,r,e),this.keybindingService=i,this.inQuickInputContext=b4t.bindTo(this.contextKeyService),this.registerListeners()}registerListeners(){this._register(this.onShow(()=>this.inQuickInputContext.set(!0))),this._register(this.onHide(()=>this.inQuickInputContext.set(!1)))}createController(){return super.createController(this.layoutService,{ignoreFocusOut:()=>!this.configurationService.getValue("workbench.quickOpen.closeOnFocusLost"),backKeybindingLabel:()=>this.keybindingService.lookupKeybinding("workbench.action.quickInputBack")?.getLabel()||void 0})}};Qye=D([_(0,Te),_(1,we),_(2,Ut),_(3,Le),_(4,pn),_(5,pu)],Qye);function y4t(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class q5{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,n);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return y4t(q5.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const o=q5.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let c=i.get(o);typeof c!="number"&&(c=this.computeIdf(o),i.set(o,c));const l=a*c;n+=l*r}return n}computeEmbedding(e){const t=q5.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function C4t(s){const e=s.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var IS;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(IS||(IS={}));function lue(s){const e=s;return Array.isArray(e.items)}function l4e(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class mNe extends V{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new wn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ci(t);const d=o.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,l,d,i),f=(m,v)=>{let b,w;if(lue(m)?(b=m.items,w=m.active):b=m,b.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(C2(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,w&&(e.activeItems=[w]),!0},p=async m=>{let v=!1,b=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Sr(m.mergeDelay),d.isCancellationRequested)||b||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const w=await m.additionalPicks;if(d.isCancellationRequested)return;let y,C;lue(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let A,L;if(lue(w)?(A=w.items,L=w.active):A=w,A.length>0||!v){let k;if(!C&&!L){const P=e.activeItems[0];P&&y.indexOf(P)!==-1&&(k=P)}f({items:[...y,...A],active:C||L||k})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})()])};if(u!==null)if(l4e(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;l4e(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(l=>{if(i?.handleAccept){l.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0]);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))}));const c=async(l,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(l)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),f=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(f){case IS.NO_ACTION:break;case IS.CLOSE_PICKER:e.hide();break;case IS.REFRESH_PICKER:a();break;case IS.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),b=e.activeItems.filter(y=>y!==v[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,b&&(e.activeItems=b),e.keepScrollPosition=w}break}}}};return n.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),n.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),n}}var h0,na,ny;let jye=(ny=class extends mNe{constructor(e,t,i,n,o,r){super(h0.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(p9)),this.options=e}async _getPicks(e,t,i,n){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=hm(()=>{const f=new q5;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return C4t(p).filter(m=>m.score>h0.TFIDF_THRESHOLD).slice(0,h0.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=h0.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?h0.WORD_FILTER(e,f.commandAlias)??void 0:void 0;if(p||m)f.highlights={label:p,detail:this.options.showAlias?m:void 0},a.push(f);else if(e===f.commandId)a.push(f);else if(e.length>=3){const v=r();if(i.isCancellationRequested)return[];const b=v.find(w=>w.key===f.commandId);b&&(f.tfIdfScore=b.score,a.push(f))}}const c=new Map;for(const f of a){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}a.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const m=this.commandsHistory.peek(f.commandId),v=this.commandsHistory.peek(p.commandId);if(m&&v)return m>v?-1:1;if(m)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const b=this.options.suggestedCommandIds.has(f.commandId),w=this.options.suggestedCommandIds.has(p.commandId);if(b&&w)return 0;if(b)return-1;if(w)return 1}return f.label.localeCompare(p.label)});const l=[];let d=!1,h=!0,u=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(o,a,e,i);if(i.isCancellationRequested)return[];const p=f.map(m=>this.toCommandPick(m,n));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(4612,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?g(4615,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Fr(o)||this.dialogService.error(g(4616,"Command '{0}' resulted in an error",e.label),Nr(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},h0=ny,ny.PREFIX=">",ny.TFIDF_THRESHOLD=.5,ny.TFIDF_MAX_RESULTS=5,ny.WORD_FILTER=q2(CM,TE,lae),ny);jye=h0=D([_(1,we),_(2,Ut),_(3,vi),_(4,Yi),_(5,to)],jye);var Zv;let p9=(Zv=class extends V{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===wy.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=na.getConfiguredCommandHistoryLength(this.configurationService),na.cache&&na.cache.limit!==this.configuredCommandsHistoryLength&&(na.cache.limit=this.configuredCommandsHistoryLength,na.hasChanges=!0))}load(){const e=this.storageService.get(na.PREF_KEY_CACHE,Ie.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=na.cache=new um(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}na.counter=this.storageService.getNumber(na.PREF_KEY_COUNTER,Ie.PROFILE,na.counter)}push(e){na.cache&&(na.cache.set(e,na.counter++),na.hasChanges=!0)}peek(e){return na.cache?.peek(e)}saveState(){if(!na.cache||!na.hasChanges)return;const e={usesLRU:!0,entries:[]};na.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(na.PREF_KEY_CACHE,JSON.stringify(e),Ie.PROFILE,an.USER),this.storageService.store(na.PREF_KEY_COUNTER,na.counter,Ie.PROFILE,an.USER),na.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:na.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=na.getConfiguredCommandHistoryLength(e);na.cache=new um(i),na.counter=1,na.hasChanges=!0}},na=Zv,Zv.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Zv.PREF_KEY_CACHE="commandPalette.mru.cache",Zv.PREF_KEY_COUNTER="commandPalette.mru.counter",Zv.counter=1,Zv.hasChanges=!1,Zv);p9=na=D([_(0,$i),_(1,Te),_(2,Ge)],p9);class S4t extends jye{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(GLe(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:dae(i.label)||i.id})}return t}}class Ob extends nJe{constructor(){super(...arguments),this._onDidChangeDirty=this._register(new I),this._onDidChangeLabel=this._register(new I),this._onDidChangeCapabilities=this._register(new I),this._onWillDispose=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidChangeLabel=this._onDidChangeLabel.event,this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this.onWillDispose=this._onWillDispose.event}get editorId(){}get capabilities(){return Ei.Readonly}hasCapability(e){return e===Ei.None?this.capabilities===Ei.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Ei.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Ls.SHORT)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,t){return this}async saveAs(e,t){return this}async revert(e,t){}async rename(e,t){}copy(){return this}canMove(e,t){return!0}matches(e){if(wa(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:ji(this.resource,Na.getCanonicalUri(e))}prefersEditorPane(e){return lm(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}class A4t{constructor(e){this.original=e}toJSON(){if(!this.headers){const e=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?e[t]="*****":e[t]=this.original[t];this.headers=e}return this.headers}}class E4t extends V{constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(4590,"Network Requests"),when:Ayt.isEqualTo(r3(Gn.Trace)).serialize()})}async logAndRequest(e,t,i){const n=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new A4t(t.headers??{}));try{const o=await i();return this.logger.trace(`${n} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${n} - error`,t.type,su(o)),o}}}function Ctt(s){return s.res.statusCode&&s.res.statusCode>=200&&s.res.statusCode<300||s.res.statusCode===1223}function Stt(s){return s.res.statusCode===204}async function x4t(s){return Stt(s)?null:(await eD(s.stream)).toString()}async function D4t(s){if(!Ctt(s))throw new Error("Server returned "+s.res.statusCode);return x4t(s)}async function k4t(s){if(!Ctt(s))throw new Error("Server returned "+s.res.statusCode);if(Stt(s))return null;const t=(await eD(s.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: +`+t,i}}let due;function I4t(s){const e=Qe.as(Nn.Configuration),t=due;due={id:"http",order:15,title:g(4591,"HTTP"),type:"object",scope:s,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(4592,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables."),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:g(4593,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(4594,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set."),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:g(4595,"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(4596,"The value to send as the `Proxy-Authorization` header for every network request."),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[g(4597,"Disable proxy support for extensions."),g(4598,"Enable proxy support for extensions."),g(4599,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(4600,"Enable proxy support for extensions, override request options.")],default:"override",description:g(4601,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(4602,"Controls whether CA certificates should be loaded from the OS. (On Windows and macOS, a reload of the window is required after turning this off.)"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,description:g(4603,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implemenation."),restricted:!0}}},e.updateConfigurations({add:[due],remove:t?[t]:[]})}I4t(at.APPLICATION);var wV,Ir;(function(s){s.Panel="panel",s.Terminal="terminal",s.Notebook="notebook",s.Editor="editor"})(Ir||(Ir={}));(function(s){function e(t){switch(t){case"panel":return s.Panel;case"terminal":return s.Terminal;case"notebook":return s.Notebook;case"editor":return s.Editor}return s.Panel}s.fromRaw=e})(Ir||(Ir={}));var zB;let d4e=(zB=class{constructor(e){this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new I,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentCompletionProviders=new Map,this._hasDefaultAgent=YXe.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const n=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||n.contextKeyService.contextMatchesRules(he.deserialize(a.when)))}};const r={data:t};return this._agents.set(e,r),Ee(()=>{this._agents.delete(e),this._onDidChangeAgents.fire(void 0)})}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new IK(i.data,t)),Ee(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(!1)})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new IK(e,t)),Ee(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new IK(i.data,i.impl))}getDefaultAgent(e){return Ak(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return hi.find(this._agents.values(),e=>!!e.data.metadata.isSecondary)?.data}getAgent(e){if(this._agentIsEnabled(e))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=this._agents.get(e);return!t?.data.when||this.contextKeyService.contextMatchesRules(he.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=hi.find(this._agents.values(),i=>Ace(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new IK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}agentHasDupeName(e){const t=this.getAgent(e);return t?this.getAgentsByName(t.name).filter(i=>i.extensionId.value!==t.extensionId.value).length>0:!1}async invokeAgent(e,t,i,n,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return await r.impl.invoke(t,i,n,o)}async getFollowups(e,t,i,n,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return r.impl?.provideFollowups?r.impl.provideFollowups(t,i,n,o):[]}},zB.AGENT_LEADER="@",zB);d4e=D([_(0,Le)],d4e);class IK{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get locations(){return this.data.locations}async invoke(e,t,i,n){return this.impl.invoke(e,t,i,n)}async provideFollowups(e,t,i,n){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,n):[]}provideWelcomeMessage(e,t){if(this.impl.provideWelcomeMessage)return this.impl.provideWelcomeMessage(e,t)}provideSampleQuestions(e,t){if(this.impl.provideSampleQuestions)return this.impl.provideSampleQuestions(e,t)}}var rR;let h4e=(rR=class{constructor(e,t,i,n){if(this.requestService=t,this.logService=i,this.storageService=n,this.registry=jt(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=n.get(wV.StorageKey,Ie.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{n.remove(wV.StorageKey,Ie.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Sr(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},He.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await k4t(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(wV.StorageKey,JSON.stringify(i),Ie.APPLICATION,an.MACHINE)}getAgentNameRestriction(e){const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(n=>n[e.toLowerCase()]).map(n=>n?n.some(o=>ua(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},wV=rR,rR.StorageKey="chat.participantNameRegistry",rR);h4e=wV=D([_(0,Er),_(1,I6),_(2,Ge),_(3,$i)],h4e);function Ace(s){return`${s.extensionId.value}.${s.id}`}function Att(s){const e="name"in s?s:{...s,name:s.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Sn("")),Mo(e)}var CC;const T4t=oi("chat-editor-label-icon",ve.commentDiscussion,g(7137,"Icon of the chat editor label."));var US;let Yye=(US=class extends Ob{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return lZ.generate(e)}static getNextCount(){let e=0;for(;CC.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof lZ.parse(e)?.handle!="number")throw new Error("Invalid chat URI");this.sessionId=t.target&&"sessionId"in t.target?t.target.sessionId:void 0,this.inputCount=CC.getNextCount(),CC.countsInUse.add(this.inputCount),this._register(Ee(()=>CC.countsInUse.delete(this.inputCount)))}get editorId(){return CC.EditorID}get capabilities(){return super.capabilities|Ei.Singleton}matches(e){return e instanceof CC&&e.resource.toString()===this.resource.toString()}get typeId(){return CC.TypeID}getName(){return this.model?.title||g(7138,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return T4t}async resolve(){return typeof this.sessionId=="string"?this.model=this.chatService.getOrRestoreSession(this.sessionId):this.options.target?"data"in this.options.target&&(this.model=this.chatService.loadSessionFromContent(this.options.target.data)):this.model=this.chatService.startSession(Ir.Panel,He.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new L4t(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},CC=US,US.countsInUse=new Set,US.TypeID="workbench.input.chatSession",US.EditorID="workbench.editor.chatSession",US);Yye=CC=D([_(2,km)],Yye);class L4t extends V{constructor(e){super(),this.model=e,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._isDisposed=!1,this._isResolved=!1}async resolve(){this._isResolved=!0}isResolved(){return this._isResolved}isDisposed(){return this._isDisposed}dispose(){super.dispose(),this._isDisposed=!0}}var lZ;(function(s){s.scheme=pe.vscodeChatSesssion;function e(i){return N.from({scheme:s.scheme,path:`chat-${i}`})}s.generate=e;function t(i){if(i.scheme!==s.scheme)return;const o=i.path.match(/chat-(\d+)/)?.[1];if(typeof o!="string")return;const r=parseInt(o);if(!isNaN(r))return{handle:r}}s.parse=t})(lZ||(lZ={}));const R4t="copilot";async function M4t(s){return(await s.openView(P4t))?.widget}const N4t=g(7002,"Generating"),P4t=`workbench.panel.chat.view.${R4t}`,_oe=class _oe{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=_oe.Kind}get promptText(){return this.text}};_oe.Kind="text";let cb=_oe;const _Ne="#",QU="@",nI="/",voe=class voe{constructor(e,t,i,n,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=n,this.variableId=o,this.kind=voe.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${_Ne}${this.variableName}${e}`}get promptText(){return this.text}};voe.Kind="var";let m9=voe;const boe=class boe{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=boe.Kind}get text(){return`${QU}${this.agent.name}`}get promptText(){return""}};boe.Kind="agent";let $g=boe;const woe=class woe{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=woe.Kind}get text(){return`${nI}${this.command.name}`}get promptText(){return""}};woe.Kind="subcommand";let JM=woe;const yoe=class yoe{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=yoe.Kind}get text(){return`${nI}${this.slashCommand.command}`}get promptText(){return`${nI}${this.slashCommand.command}`}};yoe.Kind="slash";let FW=yoe;const Coe=class Coe{constructor(e,t,i,n,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=n,this.modelDescription=o,this.data=r,this.kind=Coe.Kind}get referenceText(){return this.text.replace(_Ne,"")}get promptText(){return this.text}};Coe.Kind="dynamic";let OW=Coe;function F4t(s){return{text:s.text,parts:s.parts.map(e=>{if(e.kind===cb.Kind)return new cb(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===m9.Kind)return new m9(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===$g.Kind){let t=e.agent;return t=Att(t),new $g(new mi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===JM.Kind)return new JM(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===FW.Kind)return new FW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===OW.Kind)return new OW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Mo(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function O4t(s){const e=s.parts.find(i=>i instanceof $g),t=s.parts.find(i=>i instanceof JM);return{agentPart:e,commandPart:t}}function B4t(s){return!!s&&typeof s=="object"&&"uri"in s&&s.uri instanceof N&&"version"in s&&typeof s.version=="number"&&"ranges"in s&&Array.isArray(s.ranges)&&s.ranges.every(F.isIRange)}function W4t(s){return!!s&&typeof s=="object"&&"documents"in s&&Array.isArray(s.documents)&&s.documents.every(B4t)}var BW;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(BW||(BW={}));var WW;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(WW||(WW={}));var u4e;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(u4e||(u4e={}));var Jye,Xye;const Soe=class Soe{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}get locationData(){return this._locationData}constructor(e,t,i,n=0,o){this._session=e,this.message=t,this._variableData=i,this._attempt=n,this._locationData=o,this.id="request_"+Soe.nextId++}adoptTo(e){this._session=e}};Soe.nextId=0;let dZ=Soe,H4t=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseRepr="",this._markdownContent="",this._citations=[],this._responseParts=H_(e).map(t=>dd(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}toString(){return this._responseRepr}toMarkdown(){return this._markdownContent}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,n=this._responseParts[i];!n||n.kind!=="markdownContent"||!Ett(n.content,e.content)?this._responseParts.push(e):n.content=vQ(n.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let n=0;!i&&n{this._updateRepr(!1)});e.task?.().then(o=>{n.dispose(),typeof o=="string"&&(this._responseParts[i].content=new Mt(o)),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}addCitation(e){this._citations.push(e),this._updateRepr()}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(7038,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} ${t.message}`:t.content.value).filter(t=>t.length>0).join(` -`),e||this._onDidChangeValue.fire()}};const Bce=class Bce extends ${get session(){return this._session}get isComplete(){return this._isComplete}get isCanceled(){return this._isCanceled}get vote(){return this._vote}get followups(){return this._followups}get response(){return this._response}get result(){return this._result}get username(){return this.session.responderUsername}get avatarIcon(){return this.session.responderAvatarIcon}get agent(){return this._agent}get slashCommand(){return this._slashCommand}get agentOrSlashCommandDetected(){return this._agentOrSlashCommandDetected??!1}get usedContext(){return this._usedContext}get contentReferences(){return this._contentReferences}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}constructor(e,t,i,s,o,r=!1,a=!1,c,l,d){super(),this._session=t,this._agent=i,this._slashCommand=s,this.requestId=o,this._isComplete=r,this._isCanceled=a,this._vote=c,this._result=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._contentReferences=[],this._progressMessages=[],this._isStale=!1,this._isStale=Array.isArray(e)&&(e.length!==0||ah(e)&&e.value.length!==0),this._followups=d?[...d]:void 0,this._response=new Czt(e),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire())),this.id="response_"+Bce.nextId++}updateContent(e,t){this._response.updateContent(e,t)}applyReference(e){e.kind==="usedContext"?this._usedContext=e:e.kind==="reference"&&(this._contentReferences.push(e),this._onDidChange.fire())}setAgent(e,t){this._agent=e,this._slashCommand=t,this._agentOrSlashCommandDetected=!0,this._onDidChange.fire()}setResult(e){this._result=e,this._onDidChange.fire()}complete(){this._result?.errorDetails?.responseIsRedacted&&this._response.clear(),this._isComplete=!0,this._onDidChange.fire()}cancel(){this._isComplete=!0,this._isCanceled=!0,this._onDidChange.fire()}setFollowups(e){this._followups=e,this._onDidChange.fire()}setVote(e){this._vote=e,this._onDidChange.fire()}setEditApplied(e,t){return!this.response.value.includes(e)||!e.state?!1:(e.state.applied=t,this._onDidChange.fire(),!0)}adoptTo(e){this._session=e,this._onDidChange.fire()}};Bce.nextId=0;let f2=Bce;function yzt(n){const e=n;return typeof e=="object"&&typeof e.requesterUsername=="string"}function Dpe(n){const e=n;return yzt(n)&&typeof e.creationDate=="number"&&typeof e.sessionId=="string"&&n.requests.every(t=>!t.usedContext||wzt(t.usedContext))}var _6;(function(n){n[n.Removal=0]="Removal",n[n.Resend=1]="Resend",n[n.Adoption=2]="Adoption"})(_6||(_6={}));var Vf;(function(n){n[n.Created=0]="Created",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Vf||(Vf={}));let Vie=fEe=class extends ${static getDefaultTitle(e){const t=k_(e)?.message??"";return(typeof t=="string"?t:t.text).split(` -`)[0].substring(0,50)}get welcomeMessage(){return this._welcomeMessage}get sessionId(){return this._sessionId}get requestInProgress(){const e=this._requests[this._requests.length-1];return!!e&&!!e.response&&!e.response.isComplete}get hasRequests(){return this._requests.length>0}get creationDate(){return this._creationDate}get _defaultAgent(){return this.chatAgentService.getDefaultAgent(lc.Panel)}get requesterUsername(){return(this._defaultAgent?this._defaultAgent.metadata.requester?.name:this.initialData?.requesterUsername)??""}get responderUsername(){return(this._defaultAgent?this._defaultAgent.fullName:this.initialData?.responderUsername)??""}get requesterAvatarIconUri(){return this._defaultAgent?this._defaultAgent.metadata.requester?.icon:this._initialRequesterAvatarIconUri}get responderAvatarIcon(){return this._defaultAgent?this._defaultAgent?.metadata.themeIcon:this._initialResponderAvatarIconUri}get initState(){return this._initState}get isImported(){return this._isImported}get title(){return fEe.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,s,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._initState=Vf.Created,this._isInitializedDeferred=new sd,this._isImported=!1,this._isImported=!!e&&!Dpe(e)||(e?.isImported??!1),this._sessionId=Dpe(e)&&e.sessionId||Dr(),this._requests=e?this._deserialize(e):[],this._creationDate=Dpe(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&P.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=lZ(e?.responderAvatarIconUri)?P.revive(e.responderAvatarIconUri):e?.responderAvatarIconUri}_deserialize(e){const t=e.requests;if(!Array.isArray(t))return this.logService.error(`Ignoring malformed session data: ${JSON.stringify(e)}`),[];if(e.welcomeMessage){const i=e.welcomeMessage.map(s=>typeof s=="string"?new Xt(s):s);this._welcomeMessage=this.instantiationService.createInstance(mEe,i,[])}try{return t.map(i=>{const s=typeof i.message=="string"?this.getParsedRequestFromString(i.message):mzt(i.message),o=this.reviveVariableData(i.variableData),r=new Uie(this,s,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?Knt(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new f2(i.response??[new Xt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Or(i.usedContext)),i.contentReferences&&i.contentReferences.forEach(l=>r.response.applyReference(Or(l)))}return r})}catch(i){return this.logService.error("Failed to parse chat data",i),[]}}reviveVariableData(e){const t=e&&Array.isArray(e.variables)?e:{variables:[]};return t.variables=t.variables.map(i=>"values"in i&&Array.isArray(i.values)?{id:i.id??"",name:i.name,value:i.values[0]?.value,range:i.range,modelDescription:i.modelDescription,references:i.references}:i),t}getParsedRequestFromString(e){const t=[new kb(new hi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==Vf.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${Vf[this.initState]}`);this._initState=Vf.Initializing}deinitialize(){this._initState=Vf.Created,this._isInitializedDeferred=new sd}initialize(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${Vf[this.initState]}`);this._initState=Vf.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${Vf[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,s,o){const r=new Uie(this,e,t,i);return r.response=new f2([],this,s,o,r.id),this._requests.push(r),this._onDidChange.fire({kind:"addRequest",request:r}),r}adoptRequest(e){const t=e.session,i=t._requests.findIndex(s=>s.id===e.id);i!==-1&&(t._requests.splice(i,1),e.adoptTo(this),e.response?.adoptTo(this),this._requests.push(e),t._onDidChange.fire({kind:"removeRequest",requestId:e.id,responseId:e.response?.id,reason:_6.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");if(t.kind==="markdownContent"||t.kind==="treeData"||t.kind==="inlineReference"||t.kind==="markdownVuln"||t.kind==="progressMessage"||t.kind==="command"||t.kind==="textEdit"||t.kind==="warning"||t.kind==="progressTask"||t.kind==="confirmation")e.response.updateContent(t,i);else if(t.kind==="usedContext"||t.kind==="reference")e.response.applyReference(t);else if(t.kind==="agentDetection"){const s=this.chatAgentService.getAgent(t.agentId);s&&e.response.setAgent(s,t.command)}else this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=_6.Removal){const i=this._requests.findIndex(o=>o.id===e),s=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:s.id,responseId:s.response?.id,reason:t}),this._requests.splice(i,1),s.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.setResult(t)}completeResponse(e){if(!e.response)throw new Error("Call setResponse before completeResponse");e.response.complete()}setFollowups(e,t){e.response&&e.response.setFollowups(t)}setResponseModel(e,t){e.response=t,this._onDidChange.fire({kind:"addResponse",response:t})}toExport(){return{requesterUsername:this.requesterUsername,requesterAvatarIconUri:this.requesterAvatarIconUri,responderUsername:this.responderUsername,responderAvatarIconUri:this.responderAvatarIcon,initialLocation:this.initialLocation,welcomeMessage:this._welcomeMessage?.content.map(e=>Array.isArray(e)?e:e.value),requests:this._requests.map(e=>({message:{...e.message,parts:e.message.parts.map(i=>i&&"toJSON"in i?i.toJSON():i)},variableData:e.variableData,response:e.response?e.response.response.value.map(i=>i.kind==="treeData"?i.treeData:i.kind==="markdownContent"?i.content:i):void 0,result:e.response?.result,followups:e.response?.followups,isCanceled:e.response?.isCanceled,vote:e.response?.vote,agent:e.response?.agent?{...e.response.agent}:void 0,slashCommand:e.response?.slashCommand,usedContext:e.response?.usedContext,contentReferences:e.response?.contentReferences}))}}toJSON(){return{...this.toExport(),sessionId:this.sessionId,creationDate:this._creationDate,isImported:this._isImported}}dispose(){this._requests.forEach(e=>e.response?.dispose()),this._onDidDispose.fire(),super.dispose()}};Vie=fEe=D([_(2,Ze),_(3,yp),_(4,be)],Vie);var XN;let mEe=(XN=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+pEe.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(lc.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(lc.Panel)?.metadata.themeIcon}},pEe=XN,XN.nextId=0,XN);mEe=pEe=D([_(2,yp)],mEe);function Jnt(n,e){if(n.baseUri&&e.baseUri){if(!(n.baseUri.scheme===e.baseUri.scheme&&n.baseUri.authority===e.baseUri.authority&&n.baseUri.path===e.baseUri.path&&n.baseUri.query===e.baseUri.query&&n.baseUri.fragment===e.baseUri.fragment))return!1}else if(n.baseUri||e.baseUri)return!1;return Io(n.isTrusted,e.isTrusted)&&n.supportHtml===e.supportHtml&&n.supportThemeIcons===e.supportThemeIcons}function qJ(n,e){const t=typeof e=="string"?e:e.value;return{value:n.value+t,isTrusted:n.isTrusted,supportThemeIcons:n.supportThemeIcons,supportHtml:n.supportHtml,baseUri:n.baseUri}}const Xnt="http://_vscodecontentref_";function Oze(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="inlineReference"){const s="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=P.parse(Xnt).with({fragment:JSON.stringify(s)}),r=`[${t.name||ui(s.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=qJ(i.content,new Xt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Xt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&Jnt(i.content,t.content)){const s=qJ(i.content,t.content);e[e.length-1]={content:s,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=qJ(i.content,new Xt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Xt(o),kind:"markdownContent"})}else e.push(t)}return e}function Szt(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+t.content.value,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push(t);else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Xt(o),kind:"markdownContent"})}}return e}function Azt(n){const e=[];let t=n,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[s,o,r]=i,a=i.index,c=t.substring(0,a),l=c.split(` +`),this._responseRepr+=this._citations.length?` + +`+xtt(this._citations):"",this._markdownContent=this._responseParts.map(t=>t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="markdownContent"||t.kind==="markdownVuln"?t.content.value:"").filter(t=>t.length>0).join(` + +`),e||this._onDidChangeValue.fire()}};const Aoe=class Aoe extends V{get session(){return this._session}get isComplete(){return this._isComplete}get isCanceled(){return this._isCanceled}get vote(){return this._vote}get followups(){return this._followups}get response(){return this._response}get result(){return this._result}get username(){return this.session.responderUsername}get avatarIcon(){return this.session.responderAvatarIcon}get agent(){return this._agent}get slashCommand(){return this._slashCommand}get agentOrSlashCommandDetected(){return this._agentOrSlashCommandDetected??!1}get usedContext(){return this._usedContext}get contentReferences(){return this._contentReferences}get codeCitations(){return this._codeCitations}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}constructor(e,t,i,n,o,r=!1,a=!1,c,l,d){super(),this._session=t,this._agent=i,this._slashCommand=n,this.requestId=o,this._isComplete=r,this._isCanceled=a,this._vote=c,this._result=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._contentReferences=[],this._codeCitations=[],this._progressMessages=[],this._isStale=!1,this._isStale=Array.isArray(e)&&(e.length!==0||dd(e)&&e.value.length!==0),this._followups=d?[...d]:void 0,this._response=new H4t(e),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire())),this.id="response_"+Aoe.nextId++}updateContent(e,t){this._response.updateContent(e,t)}applyReference(e){e.kind==="usedContext"?this._usedContext=e:e.kind==="reference"&&(this._contentReferences.push(e),this._onDidChange.fire())}applyCodeCitation(e){this._codeCitations.push(e),this._response.addCitation(e),this._onDidChange.fire()}setAgent(e,t){this._agent=e,this._slashCommand=t,this._agentOrSlashCommandDetected=!0,this._onDidChange.fire()}setResult(e){this._result=e,this._onDidChange.fire()}complete(){this._result?.errorDetails?.responseIsRedacted&&this._response.clear(),this._isComplete=!0,this._onDidChange.fire()}cancel(){this._isComplete=!0,this._isCanceled=!0,this._onDidChange.fire()}setFollowups(e){this._followups=e,this._onDidChange.fire()}setVote(e){this._vote=e,this._onDidChange.fire()}setEditApplied(e,t){return!this.response.value.includes(e)||!e.state?!1:(e.state.applied=t,this._onDidChange.fire(),!0)}adoptTo(e){this._session=e,this._onDidChange.fire()}};Aoe.nextId=0;let wF=Aoe;function U4t(s){const e=s;return typeof e=="object"&&typeof e.requesterUsername=="string"}function hue(s){const e=s;return U4t(s)&&typeof e.creationDate=="number"&&typeof e.sessionId=="string"&&s.requests.every(t=>!t.usedContext||W4t(t.usedContext))}var _9;(function(s){s[s.Removal=0]="Removal",s[s.Resend=1]="Resend",s[s.Adoption=2]="Adoption"})(_9||(_9={}));var Lg;(function(s){s[s.Created=0]="Created",s[s.Initializing=1]="Initializing",s[s.Initialized=2]="Initialized"})(Lg||(Lg={}));let hZ=Jye=class extends V{static getDefaultTitle(e){const t=lm(e)?.message??"";return(typeof t=="string"?t:t.text).split(` +`)[0].substring(0,50)}get welcomeMessage(){return this._welcomeMessage}get sessionId(){return this._sessionId}get requestInProgress(){const e=this._requests[this._requests.length-1];return!!e&&!!e.response&&!e.response.isComplete}get hasRequests(){return this._requests.length>0}get creationDate(){return this._creationDate}get _defaultAgent(){return this.chatAgentService.getDefaultAgent(Ir.Panel)}get requesterUsername(){return(this._defaultAgent?this._defaultAgent.metadata.requester?.name:this.initialData?.requesterUsername)??""}get responderUsername(){return(this._defaultAgent?this._defaultAgent.fullName:this.initialData?.responderUsername)??""}get requesterAvatarIconUri(){return this._defaultAgent?this._defaultAgent.metadata.requester?.icon:this._initialRequesterAvatarIconUri}get responderAvatarIcon(){return this._defaultAgent?this._defaultAgent?.metadata.themeIcon:this._initialResponderAvatarIconUri}get initState(){return this._initState}get isImported(){return this._isImported}get title(){return Jye.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,n,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=n,this.instantiationService=o,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._initState=Lg.Created,this._isInitializedDeferred=new dc,this._isImported=!1,this._isImported=!!e&&!hue(e)||(e?.isImported??!1),this._sessionId=hue(e)&&e.sessionId||ar(),this._requests=e?this._deserialize(e):[],this._creationDate=hue(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&N.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=lfe(e?.responderAvatarIconUri)?N.revive(e.responderAvatarIconUri):e?.responderAvatarIconUri}_deserialize(e){const t=e.requests;if(!Array.isArray(t))return this.logService.error(`Ignoring malformed session data: ${JSON.stringify(e)}`),[];if(e.welcomeMessage){const i=e.welcomeMessage.map(n=>typeof n=="string"?new Mt(n):n);this._welcomeMessage=this.instantiationService.createInstance(Zye,i,[])}try{return t.map(i=>{const n=typeof i.message=="string"?this.getParsedRequestFromString(i.message):F4t(i.message),o=this.reviveVariableData(i.variableData),r=new dZ(this,n,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?Att(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new wF(i.response??[new Mt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Mo(i.usedContext)),i.contentReferences?.forEach(l=>r.response.applyReference(Mo(l))),i.codeCitations?.forEach(l=>r.response.applyCodeCitation(Mo(l)))}return r})}catch(i){return this.logService.error("Failed to parse chat data",i),[]}}reviveVariableData(e){const t=e&&Array.isArray(e.variables)?e:{variables:[]};return t.variables=t.variables.map(i=>i&&"values"in i&&Array.isArray(i.values)?{id:i.id??"",name:i.name,value:i.values[0]?.value,range:i.range,modelDescription:i.modelDescription,references:i.references}:i),t}getParsedRequestFromString(e){const t=[new cb(new mi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==Lg.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${Lg[this.initState]}`);this._initState=Lg.Initializing}deinitialize(){this._initState=Lg.Created,this._isInitializedDeferred=new dc}initialize(e){if(this.initState!==Lg.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${Lg[this.initState]}`);this._initState=Lg.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==Lg.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${Lg[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,n,o,r){const a=new dZ(this,e,t,i,r);return a.response=new wF([],this,n,o,a.id),this._requests.push(a),this._onDidChange.fire({kind:"addRequest",request:a}),a}updateRequest(e,t){e.variableData=t,this._onDidChange.fire({kind:"changedRequest",request:e})}adoptRequest(e){const t=e.session,i=t._requests.findIndex(n=>n.id===e.id);i!==-1&&(t._requests.splice(i,1),e.adoptTo(this),e.response?.adoptTo(this),this._requests.push(e),t._onDidChange.fire({kind:"removeRequest",requestId:e.id,responseId:e.response?.id,reason:_9.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new wF([],this,void 0,void 0,e.id)),e.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");if(t.kind==="markdownContent"||t.kind==="treeData"||t.kind==="inlineReference"||t.kind==="markdownVuln"||t.kind==="progressMessage"||t.kind==="command"||t.kind==="textEdit"||t.kind==="warning"||t.kind==="progressTask"||t.kind==="confirmation")e.response.updateContent(t,i);else if(t.kind==="usedContext"||t.kind==="reference")e.response.applyReference(t);else if(t.kind==="agentDetection"){const n=this.chatAgentService.getAgent(t.agentId);n&&(e.response.setAgent(n,t.command),this._onDidChange.fire({kind:"setAgent",agent:n,command:t.command}))}else t.kind==="codeCitation"?e.response.applyCodeCitation(t):this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=_9.Removal){const i=this._requests.findIndex(o=>o.id===e),n=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:n.id,responseId:n.response?.id,reason:t}),this._requests.splice(i,1),n.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new wF([],this,void 0,void 0,e.id)),e.response.setResult(t)}completeResponse(e){if(!e.response)throw new Error("Call setResponse before completeResponse");e.response.complete()}setFollowups(e,t){e.response&&e.response.setFollowups(t)}setResponseModel(e,t){e.response=t,this._onDidChange.fire({kind:"addResponse",response:t})}toExport(){return{requesterUsername:this.requesterUsername,requesterAvatarIconUri:this.requesterAvatarIconUri,responderUsername:this.responderUsername,responderAvatarIconUri:this.responderAvatarIcon,initialLocation:this.initialLocation,welcomeMessage:this._welcomeMessage?.content.map(e=>Array.isArray(e)?e:e.value),requests:this._requests.map(e=>({message:{...e.message,parts:e.message.parts.map(i=>i&&"toJSON"in i?i.toJSON():i)},variableData:e.variableData,response:e.response?e.response.response.value.map(i=>i.kind==="treeData"?i.treeData:i.kind==="markdownContent"?i.content:i):void 0,result:e.response?.result,followups:e.response?.followups,isCanceled:e.response?.isCanceled,vote:e.response?.vote,agent:e.response?.agent?{...e.response.agent}:void 0,slashCommand:e.response?.slashCommand,usedContext:e.response?.usedContext,contentReferences:e.response?.contentReferences,codeCitations:e.response?.codeCitations}))}}toJSON(){return{...this.toExport(),sessionId:this.sessionId,creationDate:this._creationDate,isImported:this._isImported}}dispose(){this._requests.forEach(e=>e.response?.dispose()),this._onDidDispose.fire(),super.dispose()}};hZ=Jye=D([_(2,Ge),_(3,_f),_(4,we)],hZ);var aR;let Zye=(aR=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+Xye.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(Ir.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(Ir.Panel)?.metadata.themeIcon}},Xye=aR,aR.nextId=0,aR);Zye=Xye=D([_(2,_f)],Zye);function Ett(s,e){if(s.baseUri&&e.baseUri){if(!(s.baseUri.scheme===e.baseUri.scheme&&s.baseUri.authority===e.baseUri.authority&&s.baseUri.path===e.baseUri.path&&s.baseUri.query===e.baseUri.query&&s.baseUri.fragment===e.baseUri.fragment))return!1}else if(s.baseUri||e.baseUri)return!1;return Ys(s.isTrusted,e.isTrusted)&&s.supportHtml===e.supportHtml&&s.supportThemeIcons===e.supportThemeIcons}function vQ(s,e){const t=typeof e=="string"?e:e.value;return{value:s.value+t,isTrusted:s.isTrusted,supportThemeIcons:s.supportThemeIcons,supportHtml:s.supportHtml,baseUri:s.baseUri}}function xtt(s){if(s.length===0)return"";const e=s.reduce((i,n)=>i.add(n.license),new Set);return e.size===1?g(7039,"Similar code found with 1 license type",e.size):g(7040,"Similar code found with {0} license types",e.size)}const Dtt="http://_vscodecontentref_";function g4e(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="inlineReference"){const n="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=N.parse(Dtt).with({fragment:JSON.stringify(n)}),r=`[${t.name||_i(n.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=vQ(i.content,new Mt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Mt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&Ett(i.content,t.content)){const n=vQ(i.content,t.content);e[e.length-1]={content:n,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=vQ(i.content,new Mt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Mt(o),kind:"markdownContent"})}else e.push(t)}return e}function V4t(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Mt(i.content.value+t.content.value,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push(t);else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;i?.kind==="markdownContent"?e[e.length-1]={content:new Mt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Mt(o),kind:"markdownContent"})}}return e}function z4t(s){const e=[];let t=s,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[n,o,r]=i,a=i.index,c=t.substring(0,a),l=c.split(` `).length-1,d=r.split(` `).length-1,h=c.lastIndexOf(` `),u=a-(h+1)+1,f=(c+r).lastIndexOf(` -`),p=a+r.length-(f+1)+1;try{JSON.parse(decodeURIComponent(o)).forEach(({title:v,description:w})=>e.push({title:v,description:w,range:{startLineNumber:l+1,startColumn:u,endLineNumber:l+d+1,endColumn:p}}))}catch{}t=t.substring(0,a)+r+t.substring(a+s.length)}return{newText:t,vulnerabilities:e}}function qFe(n,e){const t=Array.from(n.matchAll(/\[([^\]]+)\]\(([^)]+)\)|[^\s\|\-]+/g)),i=t.slice(0,e),s=e>t.length?n.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,o=n.substring(0,s);return{value:o,actualWordCount:i.length===0?o.length?1:0:i.length,isFullString:s>=n.length}}function Znt(n){return qFe(n,Number.MAX_SAFE_INTEGER).actualWordCount}function ip(n){return!!n&&typeof n=="object"&&"message"in n}function As(n){return!!n&&typeof n.setVote<"u"}function XW(n){return!!n&&typeof n=="object"&&"content"in n}let _Ee=class extends ${get inputPlaceholder(){return this._inputPlaceholder}get model(){return this._model}setInputPlaceholder(e){this._inputPlaceholder=e,this._onDidChange.fire({kind:"changePlaceholder"})}resetInputPlaceholder(){this._inputPlaceholder=void 0,this._onDidChange.fire({kind:"changePlaceholder"})}get sessionId(){return this._model.sessionId}get requestInProgress(){return this._model.requestInProgress}get initState(){return this._model.initState}constructor(e,t,i){super(),this._model=e,this.codeBlockModelCollection=t,this.instantiationService=i,this._onDidDisposeModel=this._register(new I),this.onDidDisposeModel=this._onDidDisposeModel.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._items=[],this._inputPlaceholder=void 0,e.getRequests().forEach((s,o)=>{const r=this.instantiationService.createInstance(Bze,s);this._items.push(r),this.updateCodeBlockTextModels(r),s.response&&this.onAddResponse(s.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(s=>{if(s.kind==="addRequest"){const r=this.instantiationService.createInstance(Bze,s.request);this._items.push(r),this.updateCodeBlockTextModels(r),s.request.response&&this.onAddResponse(s.request.response)}else if(s.kind==="addResponse")this.onAddResponse(s.response);else if(s.kind==="removeRequest"){const r=this._items.findIndex(c=>ip(c)&&c.id===s.requestId);r>=0&&this._items.splice(r,1);const a=s.responseId&&this._items.findIndex(c=>As(c)&&c.id===s.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof r8&&l.dispose()}}const o=s.kind==="addRequest"?{kind:"addRequest"}:s.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(o)}))}onAddResponse(e){const t=this.instantiationService.createInstance(r8,e);this._register(t.onDidChange(()=>(t.isComplete&&this.updateCodeBlockTextModels(t),this._onDidChange.fire(null)))),this._items.push(t),this.updateCodeBlockTextModels(t)}getItems(){return[...this._model.welcomeMessage?[this._model.welcomeMessage]:[],...this._items]}dispose(){super.dispose(),this._items.filter(e=>e instanceof r8).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;ip(e)?t=e.messageText:t=Szt(e.response.value).map(o=>o.content.value).join("");let i=0;const s=new Xg.Renderer;s.code=(o,r)=>(r??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:o,languageId:r}),""),Xg.parse(this.ensureFencedCodeBlocksTerminated(t),{renderer:s})}ensureFencedCodeBlocksTerminated(e){const t=e.split(` -`);let i=!1;for(let s=0;se.kind==="reply")}get result(){return this._model.result}get errorDetails(){return this.result?.errorDetails}get vote(){return this._model.vote}get requestId(){return this._model.requestId}get isStale(){return this._model.isStale}get usedReferencesExpanded(){return typeof this._usedReferencesExpanded=="boolean"?this._usedReferencesExpanded:this.response.value.length===0}set usedReferencesExpanded(e){this._usedReferencesExpanded=e}get vulnerabilitiesListExpanded(){return this._vulnerabilitiesListExpanded}set vulnerabilitiesListExpanded(e){this._vulnerabilitiesListExpanded=e}get contentUpdateTimings(){return this._contentUpdateTimings}constructor(e,t,i){super(),this._model=e,this.logService=t,this.chatAgentNameService=i,this._modelChangeCount=0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.renderData=void 0,this._vulnerabilitiesListExpanded=!1,this._contentUpdateTimings=void 0,e.isComplete||(this._contentUpdateTimings={loadingStartTime:Date.now(),lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const s=Date.now(),o=Znt(e.response.asString()),r=s-this._contentUpdateTimings.loadingStartTime,a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={loadingStartTime:this._contentUpdateTimings.loadingStartTime,lastUpdateTime:s,impliedWordLoadRate:a,lastWordCount:o}}else this.logService.warn("ChatResponseViewModel#onDidChange: got model update but contentUpdateTimings is not initialized");this._modelChangeCount++,this._onDidChange.fire()}))}trace(e,t){this.logService.trace(`ChatResponseViewModel#${e}: ${t}`)}setVote(e){this._modelChangeCount++,this._model.setVote(e)}setEditApplied(e,t){this._modelChangeCount++,this._model.setEditApplied(e,t)}};r8=D([_(1,Ze),_(2,Yde)],r8);var v6;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(v6||(v6={}));var Wze;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Wze||(Wze={}));var vEe;(function(n){n[n.FIRST=0]="FIRST",n[n.LAST=1]="LAST",n[n.NEXT=2]="NEXT",n[n.PREVIOUS=3]="PREVIOUS"})(vEe||(vEe={}));var Hze;(function(n){n[n.MAXIMIZE=0]="MAXIMIZE",n[n.EXPAND=1]="EXPAND",n[n.EVEN=2]="EVEN"})(Hze||(Hze={}));var Uze;(function(n){n[n.COPY_EDITORS=0]="COPY_EDITORS",n[n.MOVE_EDITORS=1]="MOVE_EDITORS"})(Uze||(Uze={}));function Vze(n){const e=n;return ja(e?.editor)&&ja(e?.replacement)}var gg;(function(n){n[n.CREATION_TIME=0]="CREATION_TIME",n[n.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",n[n.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(gg||(gg={}));function wEe(n){const e=n;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function w6(n){return n.getValue("workbench.editor.openSideBySideDirection")==="down"?v6.DOWN:v6.RIGHT}const wx=-1,Cw=-2,Ezt=-3;function est(n){return typeof n=="number"||wEe(n)}const xzt="vs/workbench/contrib/chat/browser/actions/chatActions",tst=Be(xzt,0,"Chat"),Dzt="workbench.action.chat.open",Ho="vs/workbench/contrib/inlineChat/common/inlineChat";var pI;(function(n){n.Empty="empty",n.OnlyEdits="onlyEdits",n.OnlyMessages="onlyMessages",n.Mixed="mixed"})(pI||(pI={}));const zze="interactiveEditor";var yS;(function(n){n.Live="live",n.Preview="preview"})(yS||(yS={}));const kzt=new Y("inlineChatHasProvider",!1,g(Ho,0,"Whether a provider for interactive editors exists")),Izt=new Y("inlineChatVisible",!1,g(Ho,1,"Whether the interactive editor input is visible")),Lzt=new Y("inlineChatFocused",!1,g(Ho,2,"Whether the interactive editor input is focused")),Tzt=new Y("inlineChatResponseFocused",!1,g(Ho,3,"Whether the interactive widget's response is focused"));new Y("inlineChatEmpty",!1,g(Ho,4,"Whether the interactive editor input is empty"));new Y("inlineChatInnerCursorFirst",!1,g(Ho,5,"Whether the cursor of the iteractive editor input is on the first line"));new Y("inlineChatInnerCursorLast",!1,g(Ho,6,"Whether the cursor of the iteractive editor input is on the last line"));const Rzt=new Y("inlineChatOuterCursorPosition","",g(Ho,9,"Whether the cursor of the outer editor is above or below the interactive editor input")),Mzt=new Y("inlineChatHasStashedSession",!1,g(Ho,10,"Whether interactive editor has kept a session for quick restore")),Nzt=new Y("inlineChatResponseTypes",pI.Empty,g(Ho,11,"What type was the responses have been receieved")),Pzt=new Y("inlineChatUserDidEdit",void 0,g(Ho,12,"Whether the user did changes ontop of the inline chat")),Fzt=new Y("inlineChatDocumentChanged",!1,g(Ho,13,"Whether the document has changed concurrently")),Ozt=new Y("inlineChatChangeHasDiff",!1,g(Ho,14,"Whether the current change supports showing a diff")),Bzt=new Y("inlineChatChangeShowsDiff",!1,g(Ho,15,"Whether the current change showing a diff"));new Y("config.inlineChat.mode",yS.Live);const Wzt="inlineChat.acceptChanges",Hzt="inlineChat.regenerate",Uzt="inlineChat.toggleDiff",Vzt=Te.for("inlineChatWidget"),zzt=Te.for("inlineChatWidget.status"),bEe=B("inlineChat.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Ho,16,"Background color of the interactive editor widget"));B("inlineChat.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,17,"Border color of the interactive editor widget"));B("inlineChat.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Ho,18,"Shadow color of the interactive editor widget"));B("inlineChat.regionHighlight",{dark:Vk,light:Vk,hcDark:Vk,hcLight:Vk},g(Ho,19,"Background highlighting of the current interactive region. Must be transparent."),!0);B("inlineChatInput.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,20,"Border color of the interactive editor input"));B("inlineChatInput.focusBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(Ho,21,"Border color of the interactive editor input when focused"));B("inlineChatInput.placeholderForeground",{dark:xj,light:xj,hcDark:xj,hcLight:xj},g(Ho,22,"Foreground color of the interactive editor input placeholder"));B("inlineChatInput.background",{dark:SE,light:SE,hcDark:SE,hcLight:SE},g(Ho,23,"Background color of the interactive editor input"));B("inlineChatDiff.inserted",{dark:Ie(m_,.5),light:Ie(m_,.5),hcDark:Ie(m_,.5),hcLight:Ie(m_,.5)},g(Ho,24,"Background color of inserted text in the interactive editor input"));const $zt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content.")),Gzt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content."));B("inlineChatDiff.removed",{dark:Ie(yE,.5),light:Ie(yE,.5),hcDark:Ie(yE,.5),hcLight:Ie(yE,.5)},g(Ho,26,"Background color of removed text in the interactive editor input"));B("editorOverviewRuler.inlineChatRemoved",{dark:Ie(yE,.6),light:Ie(yE,.8),hcDark:Ie(yE,.6),hcLight:Ie(yE,.8)},g(Ho,27,"Overview ruler marker color for inline chat removed content."));it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"interactiveEditor.editMode",migrateFn:n=>[["inlineChat.mode",{value:n}]]}]);var Mv;(function(n){n.Mode="inlineChat.mode",n.FinishOnType="inlineChat.finishOnType",n.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",n.HoldToSpeech="inlineChat.holdToSpeech",n.AccessibleDiffView="inlineChat.accessibleDiffView"})(Mv||(Mv={}));it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{[Mv.Mode]:{description:g(Ho,28,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:yS.Live,type:"string",enum:[yS.Live,yS.Preview],markdownEnumDescriptions:[g(Ho,29,"Changes are applied directly to the document, can be highlighted via inline diffs, and accepted/discarded by hunks. Ending a session will keep the changes."),g(Ho,30,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[Mv.FinishOnType]:{description:g(Ho,31,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[Mv.AcceptedOrDiscardBeforeSave]:{description:g(Ho,32,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[Mv.HoldToSpeech]:{description:g(Ho,33,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[Mv.AccessibleDiffView]:{description:g(Ho,34,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(Ho,35,"The accessible diff viewer is based screen reader mode being enabled."),g(Ho,36,"The accessible diff viewer is always enabled."),g(Ho,37,"The accessible diff viewer is never enabled.")]}}});var eT;const Z2=class Z2{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:Z2._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}trackEdits(e){const t=[];for(const i of e)t.push({range:i.range,options:Z2._options});this._decorationIds.push(...this._textModel.deltaDecorations([],t)),this._onDidChange.fire(this)}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new O(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new O(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:Z2._options})}const[i,...s]=this._decorationIds,o=this._textModel.deltaDecorations(s,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new O(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=O.plusRange(e,i):e=i)}return e}};Z2._options=Kt.register({description:"inlineChat/session/wholeRange"});let CEe=Z2;class qzt{constructor(e,t,i,s,o,r,a,c,l){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=s,this.agent=o,this.session=r,this.wholeRange=a,this.hunkData=c,this.chatModel=l,this._isUnstashed=!1,this._exchange=[],this._startTime=new Date,this.textModelNAltVersion=s.getAlternativeVersionId(),this._teldata={extension:Cn.toKey(o.extensionId),startTime:this._startTime.toISOString(),endTime:this._startTime.toISOString(),edits:0,finishedByEdit:!1,rounds:"",undos:"",editMode:e,unstashed:0,acceptedHunks:0,discardedHunks:0,responseTypes:""}}addInput(e){this._lastInput=e}get lastInput(){return this._lastInput}get isUnstashed(){return this._isUnstashed}markUnstashed(){this._teldata.unstashed+=1,this._isUnstashed=!0}addExchange(e){this._isUnstashed=!1;const t=this._exchange.push(e);this._teldata.rounds+=`${t}|`}get exchanges(){return this._exchange}get lastExchange(){return this._exchange[this._exchange.length-1]}get hasChangedText(){return!this.textModel0.equalsTextBuffer(this.textModelN.getTextBuffer())}asChangedText(e){if(e.length===0)return;let t=Number.MAX_VALUE,i=Number.MIN_VALUE;for(const s of e)t=Math.min(t,s.modified.startLineNumber),i=Math.max(i,s.modified.endLineNumberExclusive);return this.textModelN.getValueInRange(new O(t,1,i,Number.MAX_VALUE))}recordExternalEditOccurred(e){this._teldata.edits+=1,this._teldata.finishedByEdit=e}asTelemetryData(){for(const e of this.hunkData.getInfo())switch(e.getState()){case zu.Accepted:this._teldata.acceptedHunks+=1;break;case zu.Rejected:this._teldata.discardedHunks+=1;break}return this._teldata.endTime=new Date().toISOString(),this._teldata}asRecording(){const e={session:this.session,when:this._startTime,exchanges:[]};for(const t of this._exchange){const i=t.response;i instanceof WI&&e.exchanges.push({prompt:t.prompt.value,res:i.raw})}return e}}class Qzt{constructor(e,t){this.request=e,this.modelAltVersionId=t,this.value=e.message.text}}class jzt{constructor(e,t){this.prompt=e,this.response=t}}class ist{}class yEe{constructor(e){this.error=e,this.message=Ma(e,!1),this.isCancellation=Na(e)}}let WI=class{constructor(e,t,i,s,o,r,a){this.raw=e,this.modelAltVersionId=i,this.chatRequest=s,this.chatResponse=o,this._textFileService=r,this._languageService=a;const c=new wi,l=_Q.convert(e.edits);for(const d of l)if(d instanceof up)d.newResource&&!d.oldResource&&(c.set(d.newResource,[]),d.options.contents&&console.warn("CONTENT not supported"));else if(d instanceof vS){const h=c.get(d.resource);h?h.push([d.textEdit]):c.set(d.resource,[[d.textEdit]])}for(const[d,h]of c){if(h.flat().length===0){c.delete(d);continue}const f=_n(d,t);if(d.scheme===_e.untitled&&!f&&!this.untitledTextModel){const p=this._languageService.createByFilepathOrFirstLine(d,void 0),m=this._textFileService.untitled.create({associatedResource:d,languageId:p.languageId});this.untitledTextModel=m,m.resolve()}}}};WI=D([_(5,tr),_(6,Di)],WI);let SEe=class{constructor(e,t,i,s,o,r){this._undoCancelEdits=i,this._sessionService=o,this._logService=r,this._ctxHasStashedSession=Mzt.bindTo(s),this._session=t,this._ctxHasStashedSession.set(!0),this._listener=T.once(T.any(e.onDidChangeCursorSelection,e.onDidChangeModelContent,e.onDidChangeModel))(()=>{this._session=void 0,this._sessionService.releaseSession(t),this._ctxHasStashedSession.reset()})}dispose(){this._listener.dispose(),this._ctxHasStashedSession.reset(),this._session&&this._sessionService.releaseSession(this._session)}unstash(){if(!this._session)return;this._listener.dispose();const e=this._session;return e.markUnstashed(),e.hunkData.ignoreTextModelNChanges=!0,e.textModelN.pushEditOperations(null,this._undoCancelEdits,()=>null),e.hunkData.ignoreTextModelNChanges=!1,this._session=void 0,this._logService.debug("[IE] Unstashed session"),e}};SEe=D([_(3,Pe),_(4,TPe),_(5,Ze)],SEe);function $ze(n,e){return n.isEmpty?new O(n.startLineNumber,1,n.startLineNumber,e.getLineLength(n.startLineNumber)):new O(n.startLineNumber,1,n.endLineNumberExclusive-1,e.getLineLength(n.endLineNumberExclusive-1))}var k0;let AEe=(k0=class{constructor(e,t,i){this._editorWorkerService=e,this._textModel0=t,this._textModelN=i,this._store=new Z,this._data=new Map,this._ignoreChanges=!1,this._store.add(i.onDidChangeContent(s=>{this._ignoreChanges||this._mirrorChanges(s)}))}dispose(){this._textModelN.isDisposed()||this._textModelN.changeDecorations(e=>{for(const{textModelNDecorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._textModel0.isDisposed()||this._textModel0.changeDecorations(e=>{for(const{textModel0Decorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._data.clear(),this._store.dispose()}set ignoreTextModelNChanges(e){this._ignoreChanges=e}get ignoreTextModelNChanges(){return this._ignoreChanges}_mirrorChanges(e){const t=[],i=[];for(const{textModelNDecorations:o,textModel0Decorations:r,state:a}of this._data.values())if(a===zu.Pending)for(let c=1;cO.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(O.compareRangesUsingStarts);const s=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(O.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(O.areIntersectingOrTouching(f,o.range)){r=!0;break}else break;if(r)continue;const c=o.rangeOffset-a,l=this._textModel0.getPositionAt(c);let d=0;for(const f of i)f.getEndPosition().isBefore(l)&&(d+=this._textModel0.getValueLengthInRange(f));const h=this._textModel0.getPositionAt(c+d),u=this._textModel0.getPositionAt(c+d+o.rangeLength);s.push(ds.replace(O.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,s,()=>null)}async recompute(e){const t=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced");if(!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew Kzt(o.original,o.modified,o.innerChanges??[]));this._textModelN.changeDecorations(o=>{this._textModel0.changeDecorations(r=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(o.removeDecoration,o),c.forEach(r.removeDecoration,r);this._data.clear();for(const a of s){const c=[],l=[];c.push(o.addDecoration($ze(a.modified,this._textModelN),eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration($ze(a.original,this._textModel0),eT._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,eT._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:zu.Pending})}})})}get size(){return this._data.size}get pending(){return fi.reduce(this._data.values(),(e,{state:t})=>e+(t===zu.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),s=e.getRanges0();for(let o=1;o(t.push(i),null)),t.flat()}getInfo(){const e=[];for(const[t,i]of this._data.entries()){const s={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return iF(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return iF(o),o},discardChanges:()=>{if(i.state===zu.Pending){const o=this._discardEdits(s);this._textModelN.pushEditOperations(null,o,()=>null),i.state=zu.Rejected}},acceptChanges:()=>{if(i.state===zu.Pending){const o=[],r=s.getRangesN(),a=s.getRanges0();for(let c=1;cnull),i.state=zu.Accepted,i.editState.applied+=1}}};e.push(s)}return e}},eT=k0,k0._HUNK_TRACKED_RANGE=Kt.register({description:"inline-chat-hunk-tracked-range",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),k0._HUNK_THRESHOLD=8,k0);AEe=eT=D([_(0,kd)],AEe);class Kzt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var zu;(function(n){n[n.Pending=0]="Pending",n[n.Accepted=1]="Accepted",n[n.Rejected=2]="Rejected"})(zu||(zu={}));async function Yzt(n,e,t,i){const[s]=n.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(n.isDisposed())break;const a=n.getDecorationRange(s);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?ds.replace(a,r):ds.insert(a.getEndPosition(),r);i?.start(),n.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function Jzt(n,e,t,i){t=Math.max(30,t);const s=new M9;let o=e.text??"";n.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=qFe(o,1);s.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(n.cancel(),s.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{n.cancel(),s.resolve(),r.dispose()});return{range:e.range,newText:s.asyncIterable}}var Xzt=".interactive-result-code-block{position:relative}.interactive-result-code-block .interactive-result-code-block-toolbar{display:none}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar,.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);height:26px;line-height:26px;max-width:70%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:-13px;z-index:100}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar{left:0}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{right:10px}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .interactive-result-code-block-toolbar:focus-within,.interactive-result-code-block.focused .interactive-result-code-block-toolbar,.interactive-result-code-block:hover .interactive-result-code-block-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-item-container .value .rendered-markdown [data-code]{margin:16px 0}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-result-code-block.compare.no-diff .message{display:inherit}.interactive-result-code-block.compare .message{display:none;padding:6px}.interactive-result-code-block.compare .message A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-result-code-block.compare .message A>CODE{color:var(--vscode-textLink-foreground)}";Ct(Xzt,{});function QFe(n){return{wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden",alwaysConsumeMouseWheel:!1},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",dragAndDrop:!1,revealHorizontalRightPadding:5,minimap:{enabled:!1},guides:{indentation:!1},accessibilitySupport:n.getValue("editor.accessibilitySupport"),cursorBlinking:n.getValue("editor.cursorBlinking")}}function Zzt(){return{isSimpleWidget:!0,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,mm.ID,mc.ID,Ux.ID])}}const $u="vs/workbench/contrib/chat/browser/codeBlockPart",vv=we,e5t="vscode-local-file";function t5t(n){let e;try{e=JSON.parse(n)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=P.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new O(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const Iy=10;let EEe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.currentScrollWidth=0,this.disposableStore=this._register(new Z),this.element=vv(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=o.createChild(new Dl([Pe,this.contextKeyService])),h=he(this.element,vv(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...QFe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const u=he(this.element,vv(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=d.createChild(new Dl([Pe,f]));this.toolbar=this._register(p.createInstance(nC,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=he(this.element,vv(".interactive-result-vulns")),v=he(m,vv(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Tu(v,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0,supportIcons:!0})),this.vulnsListElement=he(m,vv("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const w=this.currentCodeBlockData.element;w.vulnerabilitiesListExpanded=!w.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!w.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(w=>{u.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.editor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),Cm.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),Cm.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(_1,t,i,{isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,Cm.ID,WV.ID,$x.ID,RF.ID,Pc.ID,Du.ID,IF.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.editor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight();this.editor.layout({width:e-2,height:t}),this.updatePaddingForLayout()}getContentHeight(){if(this.currentCodeBlockData?.range){const e=this.currentCodeBlockData.range.endLineNumber-this.currentCodeBlockData.range.startLineNumber+1,t=this.editor.getOption(x.lineHeight);return e*t}return this.editor.getContentHeight()}async render(e,t,i){this.currentCodeBlockData=e,e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e),this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>g1.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>g1.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g($u,3,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Jl(this.toolbar.getElement()):Oh(this.toolbar.getElement()),e.vulns?.length&&As(e.element)?(Yo(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),he(this.vulnsListElement,...e.vulns.map(s=>vv("li",void 0,vv("span.chat-vuln-title",void 0,s.title)," "+s.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns")}reset(){this.clearWidgets()}clearWidgets(){Pc.get(this.editor)?.hideContentHover()}async updateEditor(e){const t=(await e.textModel).textEditorModel;this.editor.setModel(t),e.range&&(this.editor.setSelection(e.range),this.editor.revealRangeInCenter(e.range,vt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),xo.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g($u,4,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g($u,5,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?Ce.chevronDown:Ce.chevronRight)(this.currentCodeBlockData.element).id})`}};EEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur)],EEe);let xEe=class extends ${constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(_e.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};xEe=D([_(0,Rn),_(1,Ai)],xEe);let DEe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this.labelService=d,this.openerService=h,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this._lastDiffEditorViewModel=this._store.add(new Dn),this.currentScrollWidth=0,this.element=vv(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=he(this.element,vv(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=o.createChild(new Dl([Pe,this.contextKeyService])),f=he(this.element,vv(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,f,{...QFe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const p=he(this.element,vv(".interactive-result-code-block-toolbar")),m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(p),v=u.createChild(new Dl([Pe,m]));this.toolbar1=this._register(new Qh(p,{})),this.toolbar2=this._register(v.createInstance(nC,p,t,{menuOptions:{shouldForwardArgs:!0}})),this._register(this.toolbar2.onDidChangeDropdownVisibility(w=>{p.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),Cm.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),Cm.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const s={isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,Cm.ID,WV.ID,$x.ID,RF.ID,Pc.ID,IF.ID])};return this._register(e.createInstance(Dm,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g($u,6,"Original"),modifiedAriaLabel:g($u,7,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!1,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,...i},{originalEditor:s,modifiedEditor:s}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.diffEditor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar2.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight(),s={width:e-2,height:t};this.element.style.height=`${s.height}px`,this.element.style.width=`${s.width}px`,this.diffEditor.layout(s),this.updatePaddingForLayout()}getContentHeight(){return this.diffEditor.getContentHeight()}async render(e,t,i){e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e,i),this.layout(t),this.diffEditor.updateOptions({ariaLabel:g($u,8,"Code Edits")}),this.toolbar1.clear(),this.toolbar1.push(_l({label:ui(e.edit.uri),tooltip:g($u,9,"Open '{0}'",this.labelService.getUriLabel(e.edit.uri,{relative:!0})),run:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},id:""}),{icon:!1,label:!0}),e.hideToolbar?Jl(this.toolbar2.getElement()):Oh(this.toolbar2.getElement())}reset(){this.clearWidgets()}clearWidgets(){Pc.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Pc.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!As(e.element))return;const i=!!(e.edit.state?.applied??0);if(KPt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const o=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0}),r=e.edit.state.applied>1?g($u,10,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o):g($u,11,"Made 1 change in [[``{0}``]]",o),a=mNe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});_a(this.messageElement,a)}const s=await e.diffData;if(s){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:s.original,modified:s.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar2.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}};DEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur),_(9,eo),_(10,fr)],DEe);let kEe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new tV}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const o of this.editorService.listDiffEditors()){if(!o.getContainerDomNode().isConnected)continue;const r=o.getModel();if(!r||!_n(r.original.uri,t.uri)||r.modified.uri.scheme!==_e.vscodeChatCodeCompareBlock){i=o;break}}const s=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,s)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const s=e.getDiffComputationResult();if(!s||s.identical||!await this._checkSha1(i.original,t))return 0;const o=new kCe(i.modified),r=s.changes2.map(a=>a.toRangeMapping().toTextEdit(o).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,r,()=>null),i.original.pushStackElement(),r.length}async _apply(e){const t=await this.modelService.createModelReference(e.uri);try{if(!await this._checkSha1(t.object.textEditorModel,e))return 0;t.object.textEditorModel.pushStackElement();let i=0;for(const s of e.edits){const o=s.map(nMe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,o,()=>null),i+=o.length}return t.object.textEditorModel.pushStackElement(),i}finally{t.dispose()}}async _checkSha1(e,t){return!(t.state?.sha1&&this._sha1.computeSHA1(e)&&this._sha1.computeSHA1(e)!==t.state.sha1&&!(await this.dialogService.confirm({message:g($u,12,"The original file has been modified."),detail:g($u,13,"Do you want to apply the changes anyway?")})).confirmed)}};kEe=D([_(0,Rn),_(1,jt),_(2,To)],kEe);var IEe;const eB="vs/workbench/contrib/inlineChat/browser/inlineChatStrategies";var ZN;let zie=(ZN=class{constructor(e,t,i,s,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=s,this._instaService=o,this._store=new Z,this._onDidAccept=this._store.add(new I),this._onDidDiscard=this._store.add(new I),this.onDidAccept=this._onDidAccept.event,this.onDidDiscard=this._onDidDiscard.event}dispose(){this._store.dispose()}async _doApplyChanges(e){const t=[],i=this._instaService.createInstance(kEe);for(const s of this._session.chatModel.getRequests())if(s.response?.response){for(const o of s.response.response.value)if(o.kind==="textEditGroup"&&!(e&&_n(o.uri,this._session.textModelN.uri))&&(await i.apply(s.response,o,void 0),o.uri.scheme===_e.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const s of t)s.isDisposed()||(await s.resolve(),await s.save({reason:Ln.EXPLICIT}))}cancel(){return this._session.hunkData.discardAll()}async acceptHunk(){this._onDidAccept.fire()}async discardHunk(){this._onDidDiscard.fire()}getWholeRangeDecoration(){const t=[this._session.wholeRange.value].map(i=>i.isEmpty()?void 0:{range:i,options:IEe._decoBlock});return iF(t),t}},IEe=ZN,ZN._decoBlock=Kt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),ZN);zie=IEe=D([_(3,tr),_(4,be)],zie);let LEe=class extends zie{constructor(e,t,i,s,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=Fzt.bindTo(o);const c=s.getModel(e.targetUri);T.debounce(c.onDidChangeContent.bind(c),()=>{},350)(l=>{!c.isDisposed()&&!e.textModel0.isDisposed()&&this._ctxDocumentChanged.set(e.hasChangedText)},void 0,this._store)}dispose(){this._ctxDocumentChanged.reset(),super.dispose()}async apply(){await super._doApplyChanges(!1)}async makeChanges(){}async makeProgressiveChanges(){}async renderChanges(e){}hasFocus(){return this._zone.widget.hasFocus()}};LEe=D([_(3,Ai),_(4,Pe),_(5,tr),_(6,be)],LEe);let TEe=class extends zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=Kt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:oh.Full,color:b2e($zt)},minimap:{position:xu.Inline,color:b2e(Gzt)}}),this._decoInsertedTextRange=Kt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:gi.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=Ozt.bindTo(s),this._ctxCurrentChangeShowsDiff=Bzt.bindTo(s),this._progressiveEditingDecorations=this._editor.createDecorationsCollection()}dispose(){this._resetDiff(),super.dispose()}_resetDiff(){this._ctxCurrentChangeHasDiff.reset(),this._ctxCurrentChangeShowsDiff.reset(),this._zone.widget.updateStatus(""),this._progressiveEditingDecorations.clear();for(const e of this._hunkDisplayData.values())e.remove()}async apply(){this._resetDiff(),this._editCount>0&&this._editor.pushUndoStop(),await super._doApplyChanges(!0)}cancel(){return this._resetDiff(),super.cancel()}async makeChanges(e,t,i){return this._makeChanges(e,t,void 0,void 0,i)}async makeProgressiveChanges(e,t,i,s){const o=new cf(r=>{const a=new Set;for(const d of r)bi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(bi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new O(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,s)}async _makeChanges(e,t,i,s,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=Znt(a.text??"")/r,d=Jzt(new sQ(this._zone.domNode),a,l,i.token);await Yzt(this._session.textModelN,d,s,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(s?.report(r),null)),t.stop()}async renderChanges(e){this._progressiveEditingDecorations.clear();const t=()=>{let i;if(kpe(this._editor,(s,o)=>{const r=new Set(this._hunkDisplayData.keys());i=void 0;for(const a of this._session.hunkData.getInfo()){r.delete(a);const c=a.getRangesN();let l=this._hunkDisplayData.get(a);if(l)if(a.getState()!==zu.Pending)l.remove();else{const d=this._zone.position.lineNumber,h=c[0];l.position=h.getStartPosition().delta(-1),l.distance=d<=h.startLineNumber?h.startLineNumber-d:d-h.endLineNumber}else{const d=[];for(let z=0;z{a.acceptChanges(),t()},u=()=>{a.discardChanges(),t()},f=this._session.textModel0.mightContainNonBasicASCII(),p=this._session.textModel0.mightContainRTL(),m=Ode.fromEditor(this._editor),v=a.getRanges0()[0],w=new rZe(bi.fromRangeInclusive(v).mapToLineArray(z=>this._session.textModel0.tokenization.getLineTokens(z)),[],f,p),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:oZe(w,m,[new DW(new O(v.startLineNumber,1,v.startLineNumber,1),"",Mc.Regular)],b).heightInLines,domNode:b},S=()=>{const z=M_.capture(this._editor);kpe(this._editor,(U,J)=>{if(Bt(l),l.viewZoneId)J.removeZone(l.viewZoneId),l.viewZoneId=void 0;else{const[j]=a.getRangesN();y.afterLineNumber=j.startLineNumber-1,l.viewZoneId=J.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof l?.viewZoneId=="string"),z.restore(this._editor)},M=()=>{kpe(this._editor,(z,U)=>{Bt(l);for(const J of l.decorationIds)z.removeDecoration(J);l.viewZoneId&&U.removeZone(l.viewZoneId),l.decorationIds=[],l.viewZoneId=void 0})},k=z=>{Bt(i);const U=[];for(const J of this._session.hunkData.getInfo())J.getState()===zu.Pending&&U.push(J.getRangesN()[0].getStartPosition().delta(-1));if(!(U.length<2)){for(let J=0;Ji.acceptHunk(),this.discardHunk=async()=>i.discardHunk(),this.move=r=>i.move(r)}else if(this._hunkDisplayData.size>0){let s=!1;for(const o of this._session.hunkData.getInfo())if(o.getState()===zu.Accepted){s=!0;break}s?this._onDidAccept.fire():this._onDidDiscard.fire()}return i};return t()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(Mv.AcceptedOrDiscardBeforeSave);let s;t===0?s=g(eB,0,"Nothing changed."):e===1?s=i?g(eB,1,"$(info) Accept or discard 1 change"):g(eB,2,"1 change"):s=i?g(eB,3,"$(info) Accept or Discard {0} changes",e):g(eB,4,"{0} changes",t);let o;i&&(o=g(eB,5,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(s,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};TEe=D([_(3,Pe),_(4,kd),_(5,Ur),_(6,Re),_(7,tr),_(8,be)],TEe);function kpe(n,e){n.changeDecorations(t=>{n.changeViewZones(i=>{e(t,i)})})}var i5t=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.monaco-workbench .zone-widget-container.inside-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat{background:var(--vscode-inlineChat-background);border:1px solid var(--vscode-inlineChat-border);border-radius:4px;box-shadow:0 2px 4px 0 var(--vscode-widget-shadow);color:inherit;margin-top:8px;padding:0 8px 8px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-input-and-execute-toolbar{border-radius:2px;width:100%}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list{padding:4px 0 0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact{gap:6px;padding:6px 4px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .header .avatar{outline-offset:-1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .progress{position:relative}.monaco-workbench .part.editor>.content .inline-chat .progress .monaco-progress-container{top:0}.monaco-workbench .inline-chat .status{align-items:center;display:flex;justify-content:space-between;margin-top:3px}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:12px;overflow:hidden}.monaco-workbench .inline-chat .status .label.info{margin-right:auto;padding-left:2px}.monaco-workbench .inline-chat .status .label.status{margin-left:auto}.monaco-workbench .inline-chat .status .label.hidden{display:none}.monaco-workbench .inline-chat .status .label.error{color:var(--vscode-errorForeground)}.monaco-workbench .inline-chat .status .label.warn{color:var(--vscode-editorWarning-foreground)}.monaco-workbench .inline-chat .status .label>.codicon{font-size:12px;line-height:18px;padding:0 5px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent .value{overflow:hidden;-webkit-user-select:text;user-select:text}.monaco-workbench .inline-chat .followUps{padding:5px}.monaco-workbench .inline-chat .followUps .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.monaco-workbench .inline-chat .followUps.hidden{display:none}.monaco-workbench .inline-chat .chatMessage{padding:0 3px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent{padding:2px}.monaco-workbench .inline-chat .chatMessage.hidden{display:none}.monaco-workbench .inline-chat .status .actions{display:flex;padding-top:3px}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:6px}.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown>.monaco-dropdown-button{align-items:center;display:flex;padding:0 4px}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon{display:flex}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon:before{align-self:center}.monaco-workbench .inline-chat .status .actions .monaco-text-button{padding:2px 4px;white-space:nowrap}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item{padding:0 2px}.monaco-workbench .inline-chat .status .monaco-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item.button-item .action-label:is(:hover,:focus){background-color:var(--vscode-button-hoverBackground)}.monaco-workbench .inline-chat .preview{display:none}.monaco-workbench .inline-chat .previewCreate,.monaco-workbench .inline-chat .previewDiff{border:1px solid var(--vscode-inlineChat-border);border-radius:2px;display:inherit;margin:6px 0}.monaco-workbench .inline-chat .previewCreateTitle{padding-top:6px}.monaco-workbench .inline-chat .diff-review.hidden,.monaco-workbench .inline-chat .previewCreate.hidden,.monaco-workbench .inline-chat .previewCreateTitle.hidden,.monaco-workbench .inline-chat .previewDiff.hidden{display:none}.monaco-workbench .inline-chat-toolbar{display:flex}.monaco-workbench .inline-chat-toolbar>.monaco-button{margin-right:6px}.monaco-workbench .inline-chat-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat-inserted-range{background-color:var(--vscode-inlineChatDiff-inserted)}.monaco-workbench .inline-chat-inserted-range-linehighlight{background-color:var(--vscode-diffEditor-insertedLineBackground)}.monaco-workbench .inline-chat-original-zone2{background-color:var(--vscode-diffEditor-removedLineBackground);opacity:.8}.monaco-workbench .inline-chat-lines-inserted-range{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .inline-chat-block-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .interactive-session .interactive-input-and-execute-toolbar .monaco-editor .inline-chat-slash-command{background-color:var(--vscode-chat-slashCommandBackground);border-radius:2px;color:var(--vscode-chat-slashCommandForeground);padding:1px}.monaco-workbench .inline-chat-slash-command-detail{opacity:.5}.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-editor-background,.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-workbench .margin-view-overlays,.monaco-workbench .inline-chat-newfile-widget{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat-newfile-widget .title{align-items:center;display:flex;justify-content:space-between}.monaco-workbench .inline-chat-newfile-widget .title .detail{margin-left:4px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget{display:flex;margin-left:auto;margin-right:8px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget>.monaco-button{display:inline-flex;margin-left:4px;white-space:nowrap}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{cursor:pointer;display:block;transition:opacity .2s ease-in-out}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque{opacity:.5}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{opacity:0}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque:hover,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent:hover{opacity:1}";Ct(i5t,{});const n5t="vs/platform/actions/browser/buttonbar";let REe=class extends dkt{constructor(e,t,i,s,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=s,this._hoverService=r,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new gw),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{o.publicLog2("workbenchActionExecuted",{id:a.action.id,from:t.telemetrySource})},void 0,this._store)}dispose(){this._onDidChange.dispose(),this._updateStore.dispose(),this._store.dispose(),super.dispose()}update(e){const t=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const i=this._updateStore.add(C1());for(let s=0;s0,r=e[s];let a,c;if(r instanceof u1&&r.actions.length>0){const[h,...u]=r.actions;a=h,c=this.addButtonWithDropdown({secondary:t(a)?.isSecondary??o,actionRunner:this._actionRunner,actions:u,contextMenuProvider:this._contextMenuService,ariaLabel:a.label})}else a=r,c=this.addButton({secondary:t(a)?.isSecondary??o,ariaLabel:a.label});c.enabled=a.enabled,c.element.classList.add("default-colors"),t(a)?.showLabel??!0?c.label=a.label:c.element.classList.add("monaco-text-button"),t(a)?.showIcon&&(a instanceof id&&$e.isThemeIcon(a.item.icon)?c.icon=a.item.icon:a.class&&c.element.classList.add(...a.class.split(" ")));const l=this._keybindingService.lookupKeybinding(a.id);let d;l?d=g(n5t,0,"{0} ({1})",a.label,l.getLabel()):d=a.label,this._updateStore.add(this._hoverService.setupUpdatableHover(i,c.element,d)),this._updateStore.add(c.onDidClick(async()=>{this._actionRunner.run(a)}))}this._onDidChange.fire(this)}};REe=D([_(2,Vr),_(3,ti),_(4,rn),_(5,el)],REe);let MEe=class extends REe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,r,a,c,l);const d=s.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=d.getActions({renderShortTitle:!0}).flatMap(f=>f[1]);super.update(u)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};MEe=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,rn),_(8,el)],MEe);var s5t='.interactive-session{margin:auto;max-width:850px}.interactive-list>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row>.monaco-tl-row>.monaco-tl-twistie{display:none!important}.interactive-item-container{color:var(--vscode-interactive-session-foreground);cursor:default;display:flex;flex-direction:column;gap:8px;padding:16px 20px;user-select:text;-webkit-user-select:text}.interactive-item-container .header{align-items:center;display:flex;justify-content:space-between;position:relative}.interactive-item-container .header.hidden{display:none}.interactive-item-container .header .user{align-items:center;display:flex;gap:8px}.interactive-item-container .header .username{font-size:13px;font-weight:600;margin:0}.interactive-item-container .header .detail-container{color:var(--vscode-descriptionForeground);font-size:12px}.interactive-item-container .header .detail-container .detail .agentOrSlashCommandDetected A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-item-container .chat-animated-ellipsis{display:inline-block;width:11px}.interactive-item-container:not(.show-detail-progress) .chat-animated-ellipsis{display:none}@keyframes ellipsis{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}.interactive-item-container .chat-animated-ellipsis:after{animation:ellipsis 1s steps(4) infinite;content:"";overflow:hidden;white-space:nowrap;width:3em}.interactive-item-container .header .avatar-container{display:flex;pointer-events:none;user-select:none}.interactive-item-container .header .avatar{align-items:center;border-radius:50%;display:flex;height:24px;justify-content:center;outline:1px solid var(--vscode-chat-requestBorder);width:24px}.interactive-item-container .header .avatar.codicon-avatar{background:var(--vscode-chat-avatarBackground)}.interactive-item-container .header .avatar+.avatar{margin-left:-8px}.interactive-item-container .header .avatar .icon{background-color:var(--vscode-chat-list-background);border-radius:50%;height:24px;width:24px}.interactive-item-container .header .avatar .codicon{color:var(--vscode-chat-avatarForeground)!important;font-size:14px}.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label{display:none}.interactive-item-container .header .monaco-toolbar .monaco-action-bar .actions-container{gap:4px}.interactive-item-container .header .monaco-toolbar .action-label{border:1px solid transparent;padding:2px}.interactive-item-container .header .monaco-toolbar{background-color:var(--vscode-chat-list-background);position:absolute;right:0}.interactive-item-container.interactive-request .header .monaco-toolbar{background-color:inherit}.interactive-item-container .header .monaco-toolbar .checked.action-label,.interactive-item-container .header .monaco-toolbar .checked.action-label:hover{background-color:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);color:var(--vscode-inputOption-activeForeground)!important}.interactive-item-container .value{width:100%}.interactive-item-container .chat-progress-task{padding-bottom:8px}.interactive-item-container .value .rendered-markdown table{margin-bottom:16px;text-align:left;width:100%}.interactive-item-container .value .rendered-markdown table,.interactive-item-container .value .rendered-markdown table td,.interactive-item-container .value .rendered-markdown table th{border:1px solid var(--vscode-chat-requestBorder);border-collapse:collapse;padding:4px 6px}.interactive-item-container .value .interactive-session-followups,.interactive-item-container .value .rendered-markdown a,.interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textLink-foreground)}.interactive-item-container .value .rendered-markdown a:active,.interactive-item-container .value .rendered-markdown a:hover{color:var(--vscode-textLink-activeForeground)}.hc-black .interactive-item-container .value .rendered-markdown a code,.hc-light .interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textPreformat-foreground)}.interactive-list{overflow:hidden}.interactive-request{border-bottom:1px solid var(--vscode-chat-requestBorder);border-top:1px solid var(--vscode-chat-requestBorder)}.hc-black .interactive-request,.hc-light .interactive-request{border-left:3px solid var(--vscode-chat-requestBorder);border-right:3px solid var(--vscode-chat-requestBorder)}.interactive-item-container .value{overflow-wrap:anywhere;white-space:normal}.interactive-item-container .value>:last-child.rendered-markdown>:last-child{margin-bottom:0}.interactive-item-container .value .rendered-markdown h1{font-size:20px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h2{font-size:16px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h3{font-size:14px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown p{line-height:1.5em}.interactive-item-container .value>.rendered-markdown p{margin:0 0 16px}.interactive-item-container .value>.rendered-markdown li>p{margin:0}.interactive-item-container .value .rendered-markdown ul{padding-inline-start:24px}.interactive-item-container .value .rendered-markdown ol{padding-inline-start:28px}.interactive-item-container .value .rendered-markdown li{line-height:1.3rem}.interactive-item-container .value .rendered-markdown img{max-width:100%}.interactive-item-container .monaco-tokenized-source,.interactive-item-container code{background-color:var(--vscode-textPreformat-background);border-radius:4px;color:var(--vscode-textPreformat-foreground);font-family:var(--monaco-monospace-font);font-size:12px;padding:1px 3px}.interactive-item-container.interactive-item-compact{padding:8px 20px}.interactive-item-container.interactive-item-compact.no-padding{gap:unset;padding:unset}.interactive-item-container.interactive-item-compact .header{height:16px}.interactive-item-container.interactive-item-compact .header .avatar{height:18px;width:18px}.interactive-item-container.interactive-item-compact .header .avatar .icon{height:16px;width:16px}.interactive-item-container.interactive-item-compact .header .codicon-avatar .codicon{font-size:12px}.interactive-item-container.interactive-item-compact .header .avatar+.avatar{margin-left:-4px}.interactive-item-container.interactive-item-compact .value{min-height:0}.interactive-item-container.interactive-item-compact .value>.rendered-markdown p{margin:0 0 8px}.interactive-item-container.interactive-item-compact .value>.rendered-markdown li>p{margin:0}.interactive-item-container.interactive-item-compact .value .rendered-markdown h1,.interactive-item-container.interactive-item-compact .value .rendered-markdown h2,.interactive-item-container.interactive-item-compact .value .rendered-markdown h3{margin:8px 0}.interactive-session .interactive-input-and-execute-toolbar{align-items:flex-end;background-color:var(--vscode-input-background);border:1px solid var(--vscode-input-border,transparent);border-radius:4px;box-sizing:border-box;cursor:text;display:flex;justify-content:space-between;margin-bottom:4px;padding:0 6px;position:relative}.interactive-session .interactive-input-part.compact .interactive-input-and-execute-toolbar{border-radius:2px;margin-bottom:0}.interactive-session .interactive-input-and-side-toolbar{align-items:center;display:flex;gap:4px}.interactive-session .interactive-input-and-execute-toolbar.focused{border-color:var(--vscode-focusBorder)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .mtk1{color:var(--vscode-input-foreground)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor,.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .monaco-editor-background{background-color:var(--vscode-input-background)!important}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .cursors-layer{padding-left:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar{height:22px;margin-bottom:7px}.interactive-session .interactive-input-part .interactive-execute-toolbar .monaco-action-bar .actions-container{display:flex;gap:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar .codicon-debug-stop{color:var(--vscode-icon-foreground)!important}.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .margin,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .monaco-editor-background{background-color:var(--vscode-interactive-result-editor-background-color)!important}.interactive-item-compact .interactive-result-code-block{margin:0 0 8px}.interactive-item-container .interactive-result-code-block .monaco-toolbar .monaco-action-bar .actions-container{padding-inline-start:unset}.chat-notification-widget .chat-error-codicon,.chat-notification-widget .chat-info-codicon,.chat-notification-widget .chat-warning-codicon{align-items:start;display:flex;gap:8px}.interactive-item-container .value .chat-notification-widget .rendered-markdown p{margin:0}.interactive-response .interactive-response-error-details{align-items:start;display:flex;gap:6px}.interactive-response .interactive-response-error-details .rendered-markdown :last-child{margin-bottom:0}.chat-notification-widget .chat-error-codicon .codicon,.chat-notification-widget .chat-info-codicon .codicon,.chat-notification-widget .chat-warning-codicon .codicon{margin-top:2px}.interactive-response .interactive-response-error-details .codicon{margin-top:1px}.chat-used-context-list .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-used-context-list .monaco-icon-label-container{color:var(--vscode-interactive-session-foreground)}.chat-notification-widget .chat-warning-codicon .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.chat-notification-widget .chat-error-codicon .codicon-error,.interactive-response .interactive-response-error-details .codicon-error{color:var(--vscode-errorForeground)!important}.chat-notification-widget .chat-info-codicon .codicon-info,.interactive-response .interactive-response-error-details .codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}.interactive-session .interactive-input-part{display:flex;flex-direction:column;margin:0 20px;padding:12px 0}.interactive-session .interactive-input-part.compact{margin:0;padding:8px 0 0}.interactive-session .chat-attached-context .chat-attached-context-attachment{display:flex;gap:4px}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button:hover{cursor:pointer}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button{align-items:center;display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container{display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container .monaco-highlighted-label{align-items:center!important;display:flex!important}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button.codicon.codicon-close,.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .monaco-button.codicon.codicon-close{color:var(--vscode-descriptionForeground)}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .codicon{padding-left:4px}.interactive-session .chat-attached-context{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 8px}.interactive-session .chat-attached-context .chat-attached-context-attachment{border:1px solid var(--vscode-chat-requestBorder,var(--vscode-input-background,transparent));border-radius:4px;height:18px;max-width:100%;padding:2px}.interactive-session-followups{align-items:start;display:flex;flex-direction:column;gap:6px}.interactive-session-followups .monaco-button{text-align:left;width:auto}.interactive-session-followups .monaco-button .codicon{margin-left:0;margin-top:1px}.interactive-item-container .interactive-response-followups .monaco-button{padding:4px 8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups{margin-bottom:8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups code{font-family:var(--monaco-monospace-font);font-size:11px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button .codicon-sparkle{float:left}.interactive-session-followups .monaco-button.interactive-followup-reply{border:none;padding:0}.interactive-welcome .value .interactive-session-followups{margin-bottom:16px}.interactive-item-container .monaco-toolbar .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container.filtered-response .value>.rendered-markdown{-webkit-mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);pointer-events:none}.quick-input-widget .interactive-session .interactive-input-part{margin:0 3px;padding:8px 6px 6px}.quick-input-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar{border-radius:2px;margin:0;padding:0 4px 0 6px}.quick-input-widget .interactive-list{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.quick-input-widget .interactive-response{min-height:86px}.interactive-response-progress-tree .monaco-list-row:not(.selected) .monaco-tl-row:hover{background-color:var(--vscode-list-hoverBackground)}.interactive-response-progress-tree{margin:16px 0}.interactive-response-progress-tree.focused{border-color:var(--vscode-focusBorder,transparent)}.interactive-item-container .value .interactive-response-placeholder-codicon .codicon{color:var(--vscode-editorGhostText-foreground)}.interactive-item-container .value .interactive-response-placeholder-content{color:var(--vscode-editorGhostText-foreground);font-size:12px;margin-bottom:16px}.interactive-item-container .value .interactive-response-placeholder-content p{margin:0}.interactive-response .interactive-response-codicon-details{align-items:start;display:flex;gap:6px}.chat-used-context-list .monaco-list{border:none;border-radius:4px;width:auto}.interactive-item-container .chat-resource-widget{background-color:var(--vscode-chat-slashCommandBackground);color:var(--vscode-chat-slashCommandForeground)}.interactive-item-container .chat-agent-widget .monaco-button,.interactive-item-container .chat-resource-widget{border-radius:4px;padding:1px 3px}.interactive-item-container .chat-agent-widget .monaco-text-button{border:none;display:inline}.interactive-session .chat-used-context.chat-used-context-collapsed .chat-used-context-list{display:none}.interactive-session .chat-used-context{display:flex;flex-direction:column;gap:2px}.interactive-item-container .chat-notification-widget,.interactive-response-progress-tree,.interactive-session .chat-used-context-list{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:8px;padding:6px 8px}.interactive-item-container .chat-notification-widget{padding:8px 12px}.interactive-session .chat-used-context-list .monaco-list .monaco-list-row{border-radius:2px}.interactive-session .chat-used-context-label{color:var(--vscode-descriptionForeground);font-size:12px;user-select:none}.interactive-session .chat-used-context-label:hover{opacity:unset}.interactive-session .chat-used-context-label .monaco-button{border:none;border-radius:4px;display:inline-flex;gap:4px;justify-content:normal;padding:4px 8px 4px 0;text-align:initial;width:100%}.interactive-session .chat-used-context-label .monaco-button:hover{background-color:var(--vscode-list-hoverBackground);color:var(--vscode-foreground)}.interactive-session .chat-used-context-label .monaco-text-button:focus{outline:none}.interactive-session .chat-used-context-label .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-session .chat-used-context .chat-used-context-label .monaco-button .codicon{margin:0 0 0 4px}.interactive-item-container .rendered-markdown.progress-step{display:flex;margin-left:4px;white-space:normal}.interactive-item-container .rendered-markdown.progress-step>p{align-items:center;color:var(--vscode-descriptionForeground);display:flex;font-size:12px;gap:8px;margin-bottom:6px}.interactive-item-container .rendered-markdown.progress-step>p .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container .rendered-markdown.progress-step>p .codicon.codicon-check{color:var(--vscode-debugIcon-startForeground)!important}.interactive-item-container .chat-command-button{display:flex;margin-bottom:16px}.interactive-item-container .chat-notification-widget{display:flex;flex-direction:row;gap:6px}.chat-confirmation-widget .chat-confirmation-buttons-container .monaco-button,.interactive-item-container .chat-command-button .monaco-button{padding:4px 8px;text-align:left;width:auto}.interactive-item-container .chat-command-button .monaco-button .codicon{margin-left:0;margin-top:1px}';Ct(s5t,{});var o5t=".chat-agent-hover{line-height:unset;padding:6px 0}.chat-agent-hover-header{display:flex;gap:8px;margin-bottom:4px}.chat-agent-hover-icon .codicon,.chat-agent-hover-icon img{border-radius:50%;height:32px;outline:1px solid var(--vscode-chat-requestBorder);width:32px}.monaco-hover .markdown-hover .hover-contents .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.monaco-hover .chat-agent-hover .chat-agent-hover-publisher .codicon.codicon-extensions-verified-publisher{color:var(--vscode-extensionIcon-verifiedForeground)}.chat-agent-hover .extension-verified-publisher{display:none}.chat-agent-hover.verifiedPublisher .extension-verified-publisher{display:flex}.chat-agent-hover .chat-agent-hover-warning .codicon{color:var(--vscode-notificationsWarningIcon-foreground)!important;margin-right:3px}.chat-agent-hover.allowedName .chat-agent-hover-warning{display:none}.chat-agent-hover-header .chat-agent-hover-name{font-size:14px;font-weight:600}.chat-agent-hover-extension{color:var(--vscode-descriptionForeground);display:flex;gap:6px}.chat-agent-hover.noExtensionName .chat-agent-hover-extension-name,.chat-agent-hover.noExtensionName .chat-agent-hover-separator{display:none}.chat-agent-hover-separator{opacity:.7}.chat-agent-hover-description,.chat-agent-hover-warning{font-size:13px}";Ct(o5t,{});const uA="vs/workbench/contrib/chat/browser/chatAccessibilityProvider";let NEe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(uA,0,"Chat")}getAriaLabel(e){return ip(e)?e.messageText:As(e)?this._getLabelWithCodeBlockCount(e):XW(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` +`),p=a+r.length-(f+1)+1;try{JSON.parse(decodeURIComponent(o)).forEach(({title:v,description:b})=>e.push({title:v,description:b,range:{startLineNumber:l+1,startColumn:u,endLineNumber:l+d+1,endColumn:p}}))}catch{}t=t.substring(0,a)+r+t.substring(a+n.length)}return{newText:t,vulnerabilities:e}}function vNe(s,e){const t=Array.from(s.matchAll(new RegExp("\\[([^\\]]+)\\]\\(([^)]+)\\)|\\p{sc=Han}|=+|\\++|-+|[^\\s\\|\\p{sc=Han}|=|\\+|\\-]+","gu"))),i=t.slice(0,e),n=e>t.length?s.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,o=s.substring(0,n);return{value:o,returnedWordCount:i.length===0?o.length?1:0:i.length,isFullString:n>=s.length,totalWordCount:t.length}}function ktt(s){return vNe(s,Number.MAX_SAFE_INTEGER).returnedWordCount}function Uu(s){return!!s&&typeof s=="object"&&"message"in s}function vs(s){return!!s&&typeof s.setVote<"u"}function tB(s){return!!s&&typeof s=="object"&&"content"in s}let eCe=class extends V{get inputPlaceholder(){return this._inputPlaceholder}get model(){return this._model}setInputPlaceholder(e){this._inputPlaceholder=e,this._onDidChange.fire({kind:"changePlaceholder"})}resetInputPlaceholder(){this._inputPlaceholder=void 0,this._onDidChange.fire({kind:"changePlaceholder"})}get sessionId(){return this._model.sessionId}get requestInProgress(){return this._model.requestInProgress}get initState(){return this._model.initState}constructor(e,t,i){super(),this._model=e,this.codeBlockModelCollection=t,this.instantiationService=i,this._onDidDisposeModel=this._register(new I),this.onDidDisposeModel=this._onDidDisposeModel.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._items=[],this._inputPlaceholder=void 0,e.getRequests().forEach((n,o)=>{const r=this.instantiationService.createInstance(f4e,n);this._items.push(r),this.updateCodeBlockTextModels(r),n.response&&this.onAddResponse(n.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(n=>{if(n.kind==="addRequest"){const r=this.instantiationService.createInstance(f4e,n.request);this._items.push(r),this.updateCodeBlockTextModels(r),n.request.response&&this.onAddResponse(n.request.response)}else if(n.kind==="addResponse")this.onAddResponse(n.response);else if(n.kind==="removeRequest"){const r=this._items.findIndex(c=>Uu(c)&&c.id===n.requestId);r>=0&&this._items.splice(r,1);const a=n.responseId&&this._items.findIndex(c=>vs(c)&&c.id===n.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof Q5&&l.dispose()}}const o=n.kind==="addRequest"?{kind:"addRequest"}:n.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(o)}))}onAddResponse(e){const t=this.instantiationService.createInstance(Q5,e);this._register(t.onDidChange(()=>(t.isComplete&&this.updateCodeBlockTextModels(t),this._onDidChange.fire(null)))),this._items.push(t),this.updateCodeBlockTextModels(t)}getItems(){return[...this._model.welcomeMessage?[this._model.welcomeMessage]:[],...this._items]}dispose(){super.dispose(),this._items.filter(e=>e instanceof Q5).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;Uu(e)?t=e.messageText:t=V4t(e.response.value).map(o=>o.content.value).join("");let i=0;const n=new zu.Renderer;n.code=(o,r)=>(r??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:o,languageId:r}),""),zu.parse(this.ensureFencedCodeBlocksTerminated(t),{renderer:n})}ensureFencedCodeBlocksTerminated(e){const t=e.split(` +`);let i=!1;for(let n=0;ne.kind==="reply")}get result(){return this._model.result}get errorDetails(){return this.result?.errorDetails}get vote(){return this._model.vote}get requestId(){return this._model.requestId}get isStale(){return this._model.isStale}get usedReferencesExpanded(){return typeof this._usedReferencesExpanded=="boolean"?this._usedReferencesExpanded:this.response.value.length===0}set usedReferencesExpanded(e){this._usedReferencesExpanded=e}get vulnerabilitiesListExpanded(){return this._vulnerabilitiesListExpanded}set vulnerabilitiesListExpanded(e){this._vulnerabilitiesListExpanded=e}get contentUpdateTimings(){return this._contentUpdateTimings}constructor(e,t,i){super(),this._model=e,this.logService=t,this.chatAgentNameService=i,this._modelChangeCount=0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.renderData=void 0,this._vulnerabilitiesListExpanded=!1,this._contentUpdateTimings=void 0,e.isComplete||(this._contentUpdateTimings={firstWordTime:0,lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const n=Date.now(),o=ktt(e.response.toString()),r=Math.max(n-this._contentUpdateTimings.firstWordTime,250),a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over last ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={firstWordTime:this._contentUpdateTimings.firstWordTime===0&&this.response.value.some(c=>c.kind==="markdownContent")?n:this._contentUpdateTimings.firstWordTime,lastUpdateTime:n,impliedWordLoadRate:a,lastWordCount:o}}else this.logService.warn("ChatResponseViewModel#onDidChange: got model update but contentUpdateTimings is not initialized");this._modelChangeCount++,this._onDidChange.fire()}))}trace(e,t){this.logService.trace(`ChatResponseViewModel#${e}: ${t}`)}setVote(e){this._modelChangeCount++,this._model.setVote(e)}setEditApplied(e,t){this._modelChangeCount++,this._model.setEditApplied(e,t)}};Q5=D([_(1,Ge),_(2,zae)],Q5);var HW;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(HW||(HW={}));var p4e;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(p4e||(p4e={}));var tCe;(function(s){s[s.FIRST=0]="FIRST",s[s.LAST=1]="LAST",s[s.NEXT=2]="NEXT",s[s.PREVIOUS=3]="PREVIOUS"})(tCe||(tCe={}));var m4e;(function(s){s[s.MAXIMIZE=0]="MAXIMIZE",s[s.EXPAND=1]="EXPAND",s[s.EVEN=2]="EVEN"})(m4e||(m4e={}));var _4e;(function(s){s[s.COPY_EDITORS=0]="COPY_EDITORS",s[s.MOVE_EDITORS=1]="MOVE_EDITORS"})(_4e||(_4e={}));function v4e(s){const e=s;return wa(e?.editor)&&wa(e?.replacement)}var hu;(function(s){s[s.CREATION_TIME=0]="CREATION_TIME",s[s.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",s[s.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(hu||(hu={}));function bNe(s){const e=s;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function UW(s){return s.getValue("workbench.editor.openSideBySideDirection")==="down"?HW.DOWN:HW.RIGHT}const hA=-1,ev=-2,$4t=-3;function Itt(s){return typeof s=="number"||bNe(s)}const Ttt=Pe(4617,"Chat"),G4t="workbench.action.chat.open";var $h;(function(s){s.Mode="inlineChat.mode",s.FinishOnType="inlineChat.finishOnType",s.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",s.HoldToSpeech="inlineChat.holdToSpeech",s.AccessibleDiffView="inlineChat.accessibleDiffView",s.ExpTextButtons="inlineChat.experimental.textButtons"})($h||($h={}));var Fy;(function(s){s.Live="live",s.Preview="preview"})(Fy||(Fy={}));Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{[$h.Mode]:{description:g(7041,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:Fy.Live,type:"string",enum:[Fy.Live,Fy.Preview],markdownEnumDescriptions:[g(7042,"Changes are applied directly to the document, can be highlighted via inline diffs, and accepted/discarded by hunks. Ending a session will keep the changes."),g(7043,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[$h.FinishOnType]:{description:g(7044,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[$h.AcceptedOrDiscardBeforeSave]:{description:g(7045,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[$h.HoldToSpeech]:{description:g(7046,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[$h.AccessibleDiffView]:{description:g(7047,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(7048,"The accessible diff viewer is based screen reader mode being enabled."),g(7049,"The accessible diff viewer is always enabled."),g(7050,"The accessible diff viewer is never enabled.")]},[$h.ExpTextButtons]:{description:g(7051,"Whether to use textual buttons."),default:!1,type:"boolean",tags:["experimental"]}}});const b4e="interactiveEditor";var O1;(function(s){s.None="none",s.Messages="messages",s.MessagesAndEdits="messagesAndEdits"})(O1||(O1={}));const K4t=new Q("inlineChatHasProvider",!1,g(7052,"Whether a provider for interactive editors exists")),q4t=new Q("inlineChatVisible",!1,g(7053,"Whether the interactive editor input is visible")),Q4t=new Q("inlineChatFocused",!1,g(7054,"Whether the interactive editor input is focused")),j4t=new Q("inlineChatResponseFocused",!1,g(7055,"Whether the interactive widget's response is focused"));new Q("inlineChatEmpty",!1,g(7056,"Whether the interactive editor input is empty"));new Q("inlineChatInnerCursorFirst",!1,g(7057,"Whether the cursor of the iteractive editor input is on the first line"));new Q("inlineChatInnerCursorLast",!1,g(7058,"Whether the cursor of the iteractive editor input is on the last line"));const Y4t=new Q("inlineChatOuterCursorPosition","",g(7061,"Whether the cursor of the outer editor is above or below the interactive editor input")),J4t=new Q("inlineChatHasStashedSession",!1,g(7062,"Whether interactive editor has kept a session for quick restore")),X4t=new Q("inlineChatUserDidEdit",void 0,g(7063,"Whether the user did changes ontop of the inline chat")),Z4t=new Q("inlineChatDocumentChanged",!1,g(7064,"Whether the document has changed concurrently")),eVt=new Q("inlineChatChangeHasDiff",!1,g(7065,"Whether the current change supports showing a diff")),tVt=new Q("inlineChatChangeShowsDiff",!1,g(7066,"Whether the current change showing a diff"));new Q("config.inlineChat.mode",Fy.Live);const iVt=new Q("inlineChatRequestInProgress",!1,g(7067,"Whether an inline chat request is currently in progress")),nVt=new Q("inlineChatResponseType",O1.None,g(7068,"What type was the responses have been receieved, nothing yet, just messages, or messaged and local edits"));he.equals(`config.${[$h.ExpTextButtons]}`,!0);const sVt="inlineChat.acceptChanges",oVt="inlineChat.regenerate",rVt="inlineChat.toggleDiff",Ltt=_e.for("inlineChat.execute"),aVt=_e.for("inlineChat.content.status"),cVt=_e.for("inlineChatWidget.status"),lVt=W("inlineChat.foreground",IN,g(7069,"Foreground color of the interactive editor widget")),iCe=W("inlineChat.background",xh,g(7070,"Background color of the interactive editor widget"));W("inlineChat.border",r6,g(7071,"Border color of the interactive editor widget"));W("inlineChat.shadow",CI,g(7072,"Shadow color of the interactive editor widget"));W("inlineChatInput.border",r6,g(7073,"Border color of the interactive editor input"));W("inlineChatInput.focusBorder",mp,g(7074,"Border color of the interactive editor input when focused"));W("inlineChatInput.placeholderForeground",Mft,g(7075,"Foreground color of the interactive editor input placeholder"));W("inlineChatInput.background",z2,g(7076,"Background color of the interactive editor input"));W("inlineChatDiff.inserted",st(my,.5),g(7077,"Background color of inserted text in the interactive editor input"));const dVt=W("editorOverviewRuler.inlineChatInserted",{dark:st(my,.6),light:st(my,.8),hcDark:st(my,.6),hcLight:st(my,.8)},g(7078,"Overview ruler marker color for inline chat inserted content.")),hVt=W("editorOverviewRuler.inlineChatInserted",{dark:st(my,.6),light:st(my,.8),hcDark:st(my,.6),hcLight:st(my,.8)},g(7078,"Overview ruler marker color for inline chat inserted content."));W("inlineChatDiff.removed",st(iF,.5),g(7079,"Background color of removed text in the interactive editor input"));W("editorOverviewRuler.inlineChatRemoved",{dark:st(iF,.6),light:st(iF,.8),hcDark:st(iF,.6),hcLight:st(iF,.8)},g(7080,"Overview ruler marker color for inline chat removed content."));var u0;const jz=class jz{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:jz._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new F(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new F(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:jz._options})}const[i,...n]=this._decorationIds,o=this._textModel.deltaDecorations(n,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new F(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=F.plusRange(e,i):e=i)}return e}};jz._options=Gt.register({description:"inlineChat/session/wholeRange"});let nCe=jz;class uVt{constructor(e,t,i,n,o,r,a,c){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=n,this.agent=o,this.wholeRange=r,this.hunkData=a,this.chatModel=c,this._isUnstashed=!1,this._exchanges=[],this._startTime=new Date,this.textModelNAltVersion=n.getAlternativeVersionId(),this._teldata={extension:Sn.toKey(o.extensionId),startTime:this._startTime.toISOString(),endTime:this._startTime.toISOString(),edits:0,finishedByEdit:!1,rounds:"",undos:"",editMode:e,unstashed:0,acceptedHunks:0,discardedHunks:0,responseTypes:""}}addInput(e){this._lastInput=e}get lastInput(){return this._lastInput}get isUnstashed(){return this._isUnstashed}markUnstashed(){this._teldata.unstashed+=1,this._isUnstashed=!0}addExchange(e){this._isUnstashed=!1;const t=this._exchanges.push(e);this._teldata.rounds+=`${t}|`}get lastExchange(){return this._exchanges[this._exchanges.length-1]}async undoChangesUntil(e){const t=this._exchanges.findIndex(i=>i.prompt.request.id===e);if(t<0)return!1;this.hunkData.ignoreTextModelNChanges=!0;try{const i=this._exchanges[t].prompt.modelAltVersionId;for(;i{this._session=void 0,this._sessionService.releaseSession(t),this._ctxHasStashedSession.reset()})}dispose(){this._listener.dispose(),this._ctxHasStashedSession.reset(),this._session&&this._sessionService.releaseSession(this._session)}unstash(){if(!this._session)return;this._listener.dispose();const e=this._session;return e.markUnstashed(),e.hunkData.ignoreTextModelNChanges=!0,e.textModelN.pushEditOperations(null,this._undoCancelEdits,()=>null),e.hunkData.ignoreTextModelNChanges=!1,this._session=void 0,this._logService.debug("[IE] Unstashed session"),e}};oCe=D([_(3,Le),_(4,ZRe),_(5,Ge)],oCe);function w4e(s,e){return s.isEmpty?new F(s.startLineNumber,1,s.startLineNumber,e.getLineLength(s.startLineNumber)):new F(s.startLineNumber,1,s.endLineNumberExclusive-1,e.getLineLength(s.endLineNumberExclusive-1))}var ik;let rCe=(ik=class{constructor(e,t,i){this._editorWorkerService=e,this._textModel0=t,this._textModelN=i,this._store=new Z,this._data=new Map,this._ignoreChanges=!1,this._store.add(i.onDidChangeContent(n=>{this._ignoreChanges||this._mirrorChanges(n)}))}dispose(){this._textModelN.isDisposed()||this._textModelN.changeDecorations(e=>{for(const{textModelNDecorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._textModel0.isDisposed()||this._textModel0.changeDecorations(e=>{for(const{textModel0Decorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._data.clear(),this._store.dispose()}set ignoreTextModelNChanges(e){this._ignoreChanges=e}get ignoreTextModelNChanges(){return this._ignoreChanges}_mirrorChanges(e){const t=[],i=[];for(const{textModelNDecorations:o,textModel0Decorations:r,state:a}of this._data.values())if(a===Hh.Pending)for(let c=1;cF.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(F.compareRangesUsingStarts);const n=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(F.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(F.areIntersectingOrTouching(f,o.range)){r=!0;break}else break;if(r)continue;const c=o.rangeOffset-a,l=this._textModel0.getPositionAt(c);let d=0;for(const f of i)f.getEndPosition().isBefore(l)&&(d+=this._textModel0.getValueLengthInRange(f));const h=this._textModel0.getPositionAt(c+d),u=this._textModel0.getPositionAt(c+d+o.rangeLength);n.push(Zn.replace(F.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,n,()=>null)}async recompute(e,t){if(t??=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced"),!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew pVt(o.original,o.modified,o.innerChanges??[]));this._textModelN.changeDecorations(o=>{this._textModel0.changeDecorations(r=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(o.removeDecoration,o),c.forEach(r.removeDecoration,r);this._data.clear();for(const a of n){const c=[],l=[];c.push(o.addDecoration(w4e(a.modified,this._textModelN),u0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(w4e(a.original,this._textModel0),u0._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,u0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,u0._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:Hh.Pending})}})})}get size(){return this._data.size}get pending(){return hi.reduce(this._data.values(),(e,{state:t})=>e+(t===Hh.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),n=e.getRanges0();for(let o=1;o(t.push(i),null)),t.flat()}getInfo(){const e=[];for(const[t,i]of this._data.entries()){const n={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return uM(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return uM(o),o},discardChanges:()=>{if(i.state===Hh.Pending){const o=this._discardEdits(n);this._textModelN.pushEditOperations(null,o,()=>null),i.state=Hh.Rejected}},acceptChanges:()=>{if(i.state===Hh.Pending){const o=[],r=n.getRangesN(),a=n.getRanges0();for(let c=1;cnull),i.state=Hh.Accepted,i.editState.applied+=1}}};e.push(n)}return e}},u0=ik,ik._HUNK_TRACKED_RANGE=Gt.register({description:"inline-chat-hunk-tracked-range",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),ik._HUNK_THRESHOLD=8,ik);rCe=u0=D([_(0,Ml)],rCe);class pVt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var Hh;(function(s){s[s.Pending=0]="Pending",s[s.Accepted=1]="Accepted",s[s.Rejected=2]="Rejected"})(Hh||(Hh={}));async function mVt(s,e,t,i){const[n]=s.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(s.isDisposed())break;const a=s.getDecorationRange(n);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?Zn.replace(a,r):Zn.insert(a.getEndPosition(),r);i?.start(),s.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function _Vt(s,e,t,i){t=Math.max(30,t);const n=new P2;let o=e.text??"";s.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=vNe(o,1);n.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(s.cancel(),n.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{s.cancel(),n.resolve(),r.dispose()});return{range:e.range,newText:n.asyncIterable}}var vVt=".interactive-result-code-block{position:relative}.interactive-result-code-block .interactive-result-code-block-toolbar{display:none}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar,.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);height:26px;line-height:26px;max-width:70%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:-13px;z-index:100}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar{left:0}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{right:10px}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .interactive-result-code-block-toolbar:focus-within,.interactive-result-code-block.focused .interactive-result-code-block-toolbar,.interactive-result-code-block:hover .interactive-result-code-block-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-item-container .value .rendered-markdown [data-code]{margin:16px 0}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-result-code-block.compare.no-diff .message{display:inherit}.interactive-result-code-block.compare .message{display:none;padding:6px}.interactive-result-code-block.compare .message A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-result-code-block.compare .message A>CODE{color:var(--vscode-textLink-foreground)}.interactive-result-code-block.compare .interactive-result-header{align-items:center;border-bottom:1px solid var(--vscode-chat-requestBorder);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 3px}.interactive-result-code-block.compare.no-diff .interactive-result-editor,.interactive-result-code-block.compare.no-diff .interactive-result-header{display:none}";ut(vVt,{});function wNe(s){return{wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden",alwaysConsumeMouseWheel:!1},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",dragAndDrop:!1,revealHorizontalRightPadding:5,minimap:{enabled:!1},guides:{indentation:!1},accessibilitySupport:s.getValue("editor.accessibilitySupport"),cursorBlinking:s.getValue("editor.cursorBlinking")}}function bVt(){return{isSimpleWidget:!0,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,Xg.ID,fc.ID,PA.ID])}}function Jb(s){if(!(!s||!s.resource))return N.isUri(s.resource)?s.resource:s.resource.primary}const wVt={onDidChangeVisibility:M.None};let UA=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=n,this.workspaceService=o,this.languageService=r,this.decorationsService=a,this.themeService=c,this.labelService=l,this.textFileService=d,this._onDidChangeDecorations=this._register(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this.widgets=[],this.labels=[],this.registerListeners(e)}registerListeners(e){this._register(e.onDidChangeVisibility(t=>{this.widgets.forEach(i=>i.notifyVisibilityChanged(t))})),this._register(this.languageService.onDidChange(()=>this.widgets.forEach(t=>t.notifyExtensionsRegistered()))),this._register(this.modelService.onModelLanguageChanged(t=>{t.model.uri&&this.widgets.forEach(i=>i.notifyModelLanguageChanged(t.model))})),this._register(this.modelService.onModelAdded(t=>{t.uri&&this.widgets.forEach(i=>i.notifyModelAdded(t))})),this._register(this.workspaceService.onDidChangeWorkspaceFolders(()=>{this.widgets.forEach(t=>t.notifyWorkspaceFoldersChange())})),this._register(this.decorationsService.onDidChangeDecorations(t=>{let i=!1;this.widgets.forEach(n=>{n.notifyFileDecorationsChanges(t)&&(i=!0)}),i&&this._onDidChangeDecorations.fire()})),this._register(this.themeService.onDidColorThemeChange(()=>this.widgets.forEach(t=>t.notifyThemeChange()))),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(NLe)&&this.widgets.forEach(i=>i.notifyFileAssociationsChange())})),this._register(this.labelService.onDidChangeFormatters(t=>{this.widgets.forEach(i=>i.notifyFormattersChange(t.scheme))})),this._register(this.textFileService.untitled.onDidChangeLabel(t=>{this.widgets.forEach(i=>i.notifyUntitledLabelChange(t.resource))}))}get(e){return this.labels[e]}create(e,t){const i=this.instantiationService.createInstance(cCe,e,t),n={element:i.element,onDidRender:i.onDidRender,setLabel:(o,r,a)=>i.setLabel(o,r,a),setResource:(o,r)=>i.setResource(o,r),setFile:(o,r)=>i.setFile(o,r),clear:()=>i.clear(),dispose:()=>this.disposeWidget(i)};return this.labels.push(n),this.widgets.push(i),n}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),bt(e)}clear(){this.widgets=bt(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};UA=D([_(1,we),_(2,Te),_(3,gi),_(4,yi),_(5,xi),_(6,iE),_(7,pn),_(8,Fs),_(9,Fo)],UA);let aCe=class extends UA{get element(){return this.label}constructor(e,t,i,n,o,r,a,c,l,d,h){super(wVt,i,n,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};aCe=D([_(2,we),_(3,Te),_(4,gi),_(5,yi),_(6,xi),_(7,iE),_(8,pn),_(9,Fs),_(10,Fo)],aCe);var X0;(function(s){s[s.Basic=1]="Basic",s[s.Full=2]="Full"})(X0||(X0={}));let cCe=class extends D3{constructor(e,t,i,n,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=n,this.decorationsService=o,this.labelService=r,this.textFileService=a,this.contextService=c,this.notebookDocumentService=l,this._onDidRender=this._register(new I),this.onDidRender=this._onDidRender.event,this.label=void 0,this.decoration=this._register(new wn),this.options=void 0,this.computedIconClasses=void 0,this.computedLanguageId=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0,this.needsRedraw=void 0,this.isHidden=!1}notifyVisibilityChanged(e){e===this.isHidden&&(this.isHidden=!e,e&&this.needsRedraw&&(this.render({updateIcon:this.needsRedraw===X0.Full,updateDecoration:this.needsRedraw===X0.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=Jb(this.label);t&&ji(e.uri,t)&&this.computedLanguageId!==e.getLanguageId()&&(this.computedLanguageId=e.getLanguageId(),this.render({updateIcon:!0,updateDecoration:!1}))}notifyFileDecorationsChanges(e){if(!this.options)return!1;const t=Jb(this.label);return t&&this.options.fileDecorations&&e.affectsResource(t)?this.render({updateIcon:!1,updateDecoration:!0}):!1}notifyExtensionsRegistered(){this.render({updateIcon:!0,updateDecoration:!1})}notifyThemeChange(){this.render({updateIcon:!1,updateDecoration:!1})}notifyFileAssociationsChange(){this.render({updateIcon:!0,updateDecoration:!1})}notifyFormattersChange(e){Jb(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){ji(e,Jb(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=Jb(this.label);N.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let n;if(!i){if(t?.fileKind===ba.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(n=r.name,this.computedWorkspaceFolderLabel=n)}n||(n=Kw(EA(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(Lr(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:n,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=Jb(e),n=e?.resource&&!N.isUri(e.resource);if(!t.forceLabel&&!n&&i?.scheme===pe.untitled){const l=this.textFileService.untitled.get(i);if(l&&!l.hasAssociatedFilePath){if(typeof e.name=="string"&&(e.name=l.name),typeof e.description=="string"){const h=l.resource.path;e.name!==h?e.description=h:e.description=void 0}const d=l.resource.path;l.name!==d?t.title=`${l.name} • ${d}`:t.title=d}}if(!t.forceLabel&&!n&&i?.scheme===pe.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(9968,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(9968,"{0} • Cell {1}",e.name,`${d+1}`))}const o=this.hasResourceChanged(e),r=o||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,o&&(this.computedLanguageId=void 0),r&&(this.computedPathLabel=void 0),this.render({updateIcon:o||a||c,updateDecoration:o||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=Jb(e),i=Jb(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=Jb(e);return!!t&&this.computedPathLabel!==this.labelService.getUriLabel(t)}hasIconChanged(e){return this.options?.icon!==e?.icon}clear(){this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.setLabel("")}render(e){if(this.isHidden)return this.needsRedraw!==X0.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?X0.Full:X0.Basic),!1;if(e.updateIcon&&(this.computedIconClasses=void 0),!this.label)return!1;const t={title:"",italic:this.options?.italic,strikethrough:this.options?.strikethrough,matches:this.options?.matches,descriptionMatches:this.options?.descriptionMatches,extraClasses:[],separator:this.options?.separator,domId:this.options?.domId,disabledCommand:this.options?.disabledCommand,labelEscapeNewLines:this.options?.labelEscapeNewLines,descriptionTitle:this.options?.descriptionTitle},i=Jb(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==pe.data&&(!this.options?.title||typeof this.options.title!="string"&&!this.options.title.markdownNotSupportedFallback)&&(this.computedPathLabel||(this.computedPathLabel=this.labelService.getUriLabel(i)),!t.title||typeof t.title=="string"?t.title=this.computedPathLabel:t.title.markdownNotSupportedFallback||(t.title.markdownNotSupportedFallback=this.computedPathLabel)),this.options&&!this.options.hideIcon&&(this.computedIconClasses||(this.computedIconClasses=Mx(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),N.isUri(this.options.icon)&&(t.iconPath=this.options.icon),t.extraClasses=this.computedIconClasses.slice(0)),this.options?.extraClasses&&t.extraClasses.push(...this.options.extraClasses),this.options?.fileDecorations&&i){e.updateDecoration&&(this.decoration.value=this.decorationsService.getDecoration(i,this.options.fileKind!==ba.FILE));const n=this.decoration.value;if(n){if(n.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${n.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${n.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}n.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(n.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(n.badgeClassName),t.extraClasses.push(n.iconClassName))}}return this.label.range&&(t.suffix=this.label.range.startLineNumber!==this.label.range.endLineNumber?`:${this.label.range.startLineNumber}-${this.label.range.endLineNumber}`:`:${this.label.range.startLineNumber}`),this.setLabel(this.label.name??"",this.label.description,t),this._onDidRender.fire(),!0}dispose(){super.dispose(),this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0}};cCe=D([_(2,xi),_(3,gi),_(4,iE),_(5,Fs),_(6,Fo),_(7,yi),_(8,dXe)],cCe);const s_=fe,yVt="vscode-local-file";function CVt(s){let e;try{e=JSON.parse(s)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=N.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new F(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const Yw=10;let lCe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.currentScrollWidth=0,this.disposableStore=this._register(new Z),this.isDisposed=!1,this.element=s_(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),h=re(this.element,s_(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...wNe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:Yw,bottom:Yw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()});const u=re(this.element,s_(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=this._register(d.createChild(new Uc([Le,f])));this.toolbar=this._register(p.createInstance(bm,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=re(this.element,s_(".interactive-result-vulns")),v=re(m,s_(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Jd(v,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0,supportIcons:!0})),this.vulnsListElement=re(m,s_("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const b=this.currentCodeBlockData.element;b.vulnerabilitiesListExpanded=!b.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!b.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(b=>{u.classList.toggle("force-visibility",b)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.editor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),hp.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),hp.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}dispose(){this.isDisposed=!0,super.dispose()}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(Hk,t,i,{isSimpleWidget:!1,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,hp.ID,PW.ID,BA.ID,jM.ID,Pa.ID,Lh.ID,KM.ID,VM.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Yw-t,2):Yw;this.editor.updateOptions({padding:{top:Yw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?cd.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight();this.editor.layout({width:e-2,height:t}),this.updatePaddingForLayout()}getContentHeight(){if(this.currentCodeBlockData?.range){const e=this.currentCodeBlockData.range.endLineNumber-this.currentCodeBlockData.range.startLineNumber+1,t=this.editor.getOption(x.lineHeight);return e*t}return this.editor.getContentHeight()}async render(e,t,i){this.currentCodeBlockData=e,e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e),!this.isDisposed&&(this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>Pk.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>Pk.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g(10582,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?zd(this.toolbar.getElement()):Yh(this.toolbar.getElement()),e.vulns?.length&&vs(e.element)?(Ms(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),re(this.vulnsListElement,...e.vulns.map(n=>s_("li",void 0,s_("span.chat-vuln-title",void 0,n.title)," "+n.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns"))}reset(){this.clearWidgets()}clearWidgets(){Pa.get(this.editor)?.hideContentHover()}async updateEditor(e){const t=(await e.textModel).textEditorModel;this.editor.setModel(t),e.range&&(this.editor.setSelection(e.range),this.editor.revealRangeInCenter(e.range,mt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),go.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g(10583,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g(10584,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?ve.chevronDown:ve.chevronRight)(this.currentCodeBlockData.element).id})`}};lCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr)],lCe);let dCe=class extends V{constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(pe.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};dCe=D([_(0,fn),_(1,gi)],dCe);let hCe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this.labelService=d,this.openerService=h,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this._lastDiffEditorViewModel=this._store.add(new wn),this.currentScrollWidth=0,this.element=s_(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=re(this.element,s_(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),f=re(this.element,s_(".interactive-result-header.show-file-icons")),p=re(this.element,s_(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,p,{...wNe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:Yw,bottom:Yw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()}),this.resourceLabel=this._register(u.createInstance(aCe,f,{supportIcons:!0}));const m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(f),v=this._register(u.createChild(new Uc([Le,m])));this.toolbar=this._register(v.createInstance(bm,f,t,{menuOptions:{shouldForwardArgs:!0}})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),hp.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),hp.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const n={isSimpleWidget:!1,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,hp.ID,PW.ID,BA.ID,jM.ID,Pa.ID,KM.ID])};return this._register(e.createInstance(vp,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g(10585,"Original"),modifiedAriaLabel:g(10586,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!0,experimental:{useTrueInlineView:!0},renderSideBySideInlineBreakpoint:300,renderOverviewRuler:!1,compactMode:!0,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,lineNumbersMinChars:1,...i},{originalEditor:n,modifiedEditor:n}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Yw-t,2):Yw;this.diffEditor.updateOptions({padding:{top:Yw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?cd.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight(),n={width:e-2,height:t};this.element.style.height=`${n.height}px`,this.element.style.width=`${n.width}px`,this.diffEditor.layout(n),this.updatePaddingForLayout()}getContentHeight(){return this.diffEditor.getContentHeight()}async render(e,t,i){e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e,i),this.layout(t),this.diffEditor.updateOptions({ariaLabel:g(10587,"Code Edits")}),this.resourceLabel.element.setFile(e.edit.uri,{fileKind:ba.FILE,fileDecorations:{colors:!0,badges:!1}})}reset(){this.clearWidgets()}clearWidgets(){Pa.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Pa.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!vs(e.element))return;const i=!!(e.edit.state?.applied??0);if(CNt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const o=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0});let r;e.edit.state.applied===1?r=g(10588,"Made 1 change in [[``{0}``]]",o):e.edit.state.applied<0?r=g(10589,"Edits in [[``{0}``]] have been rejected",o):r=g(10590,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o);const a=ALe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});aa(this.messageElement,a)}const n=await e.diffData;if(n){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:n.original,modified:n.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}clearModel(){this.diffEditor.setModel(null)}};hCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr),_(9,Fs),_(10,Ao)],hCe);let uCe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new Z2}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const o of this.editorService.listDiffEditors()){if(!o.getContainerDomNode().isConnected)continue;const r=o.getModel();if(!r||!ji(r.original.uri,t.uri)||r.modified.uri.scheme!==pe.vscodeChatCodeCompareBlock){i=o;break}}const n=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,n)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const n=e.getDiffComputationResult();if(!n||n.identical||!await this._checkSha1(i.original,t))return 0;const o=new gve(i.modified),r=n.changes2.map(a=>a.toRangeMapping().toTextEdit(o).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,r,()=>null),i.original.pushStackElement(),r.length}async _apply(e){const t=await this.modelService.createModelReference(e.uri);try{if(!await this._checkSha1(t.object.textEditorModel,e))return 0;t.object.textEditorModel.pushStackElement();let i=0;for(const n of e.edits){const o=n.map(nTe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,o,()=>null),i+=o.length}return t.object.textEditorModel.pushStackElement(),i}finally{t.dispose()}}async _checkSha1(e,t){return!(t.state?.sha1&&this._sha1.computeSHA1(e)&&this._sha1.computeSHA1(e)!==t.state.sha1&&!(await this.dialogService.confirm({message:g(10591,"The original file has been modified."),detail:g(10592,"Do you want to apply the changes anyway?")})).confirmed)}discard(e,t){e.response.value.includes(t)&&(t.state?.applied||e.setEditApplied(t,-1))}};uCe=D([_(0,fn),_(1,Kt),_(2,to)],uCe);var gCe,cR;let uZ=(cR=class{constructor(e,t,i,n,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=n,this._instaService=o,this._store=new Z,this._onDidAccept=this._store.add(new I),this._onDidDiscard=this._store.add(new I),this.onDidAccept=this._onDidAccept.event,this.onDidDiscard=this._onDidDiscard.event}dispose(){this._store.dispose()}async _doApplyChanges(e){const t=[],i=this._instaService.createInstance(uCe);for(const n of this._session.chatModel.getRequests())if(n.response?.response){for(const o of n.response.response.value)if(o.kind==="textEditGroup"&&!(e&&ji(o.uri,this._session.textModelN.uri))&&(await i.apply(n.response,o,void 0),o.uri.scheme===pe.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const n of t)n.isDisposed()||(await n.resolve(),await n.save({reason:Cn.EXPLICIT}))}cancel(){return this._session.hunkData.discardAll()}async acceptHunk(){this._onDidAccept.fire()}async discardHunk(){this._onDidDiscard.fire()}getWholeRangeDecoration(){const t=[this._session.wholeRange.value].map(i=>i.isEmpty()?void 0:{range:i,options:gCe._decoBlock});return uM(t),t}},gCe=cR,cR._decoBlock=Gt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),cR);uZ=gCe=D([_(3,Fo),_(4,we)],uZ);let fCe=class extends uZ{constructor(e,t,i,n,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=Z4t.bindTo(o);const c=n.getModel(e.targetUri);M.debounce(c.onDidChangeContent.bind(c),()=>{},350)(l=>{!c.isDisposed()&&!e.textModel0.isDisposed()&&this._ctxDocumentChanged.set(e.hasChangedText)},void 0,this._store)}dispose(){this._ctxDocumentChanged.reset(),super.dispose()}async apply(){await super._doApplyChanges(!1)}async makeChanges(){}async makeProgressiveChanges(){}async renderChanges(){}hasFocus(){return this._zone.widget.hasFocus()}};fCe=D([_(3,gi),_(4,Le),_(5,Fo),_(6,we)],fCe);let pCe=class extends uZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=Gt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:kl.Full,color:eOe(dVt)},minimap:{position:Th.Inline,color:eOe(hVt)}}),this._decoInsertedTextRange=Gt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:ni.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=eVt.bindTo(n),this._ctxCurrentChangeShowsDiff=tVt.bindTo(n),this._progressiveEditingDecorations=this._editor.createDecorationsCollection()}dispose(){this._resetDiff(),super.dispose()}_resetDiff(){this._ctxCurrentChangeHasDiff.reset(),this._ctxCurrentChangeShowsDiff.reset(),this._zone.widget.updateStatus(""),this._progressiveEditingDecorations.clear();for(const e of this._hunkDisplayData.values())e.remove()}async apply(){this._resetDiff(),this._editCount>0&&this._editor.pushUndoStop(),await super._doApplyChanges(!0)}cancel(){return this._resetDiff(),super.cancel()}async makeChanges(e,t,i){return this._makeChanges(e,t,void 0,void 0,i)}async makeProgressiveChanges(e,t,i,n){const o=new lu(r=>{const a=new Set;for(const d of r)pi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(pi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new F(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,n)}async _makeChanges(e,t,i,n,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=ktt(a.text??"")/r,d=_Vt(new X7(this._zone.domNode),a,l,i.token);await mVt(this._session.textModelN,d,n,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(n?.report(r),null)),t.stop()}async renderChanges(){this._progressiveEditingDecorations.clear();const e=()=>{let t;if(uue(this._editor,(i,n)=>{const o=new Set(this._hunkDisplayData.keys());t=void 0;for(const r of this._session.hunkData.getInfo()){o.delete(r);const a=r.getRangesN();let c=this._hunkDisplayData.get(r);if(c)if(r.getState()!==Hh.Pending)c.remove();else{const l=this._zone.position.lineNumber,d=a[0];c.position=d.getStartPosition().delta(-1),c.distance=l<=d.startLineNumber?d.startLineNumber-l:l-d.endLineNumber}else{const l=[];for(let R=0;R{r.acceptChanges(),e()},h=()=>{r.discardChanges(),e()},u=this._session.textModel0.mightContainNonBasicASCII(),f=this._session.textModel0.mightContainRTL(),p=Iae.fromEditor(this._editor),m=r.getRanges0()[0],v=new WYe(pi.fromRangeInclusive(m).mapToLineArray(R=>this._session.textModel0.tokenization.getLineTokens(R)),[],u,f),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:BYe(v,p,[new MO(new F(m.startLineNumber,1,m.startLineNumber,1),"",Ja.Regular)],b).heightInLines,domNode:b},C=()=>{const R=vm.capture(this._editor);uue(this._editor,(z,G)=>{if(Tt(c),c.viewZoneId)G.removeZone(c.viewZoneId),c.viewZoneId=void 0;else{const[Y]=r.getRangesN();y.afterLineNumber=Y.startLineNumber-1,c.viewZoneId=G.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof c?.viewZoneId=="string"),R.restore(this._editor)},A=()=>{uue(this._editor,(R,z)=>{Tt(c);for(const G of c.decorationIds)R.removeDecoration(G);c.viewZoneId&&z.removeZone(c.viewZoneId),c.decorationIds=[],c.viewZoneId=void 0})},L=R=>{Tt(t);const z=[];for(const G of this._session.hunkData.getInfo())G.getState()===Hh.Pending&&z.push(G.getRangesN()[0].getStartPosition().delta(-1));if(!(z.length<2)){for(let G=0;Gt.acceptHunk(),this.discardHunk=async()=>t.discardHunk(),this.move=o=>t.move(o)}else if(this._hunkDisplayData.size>0){let i=!1;for(const n of this._session.hunkData.getInfo())if(n.getState()===Hh.Accepted){i=!0;break}i?this._onDidAccept.fire():this._onDidDiscard.fire()}return t};return e()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue($h.AcceptedOrDiscardBeforeSave);let n;t===0?n=g(10593,"Nothing changed."):e===1?n=i?g(10594,"$(info) Accept or Discard change"):g(10595,"1 change"):n=i?g(10596,"$(info) Accept or Discard {0} changes",e):g(10597,"{0} changes",t);let o;i&&(o=g(10598,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(n,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};pCe=D([_(3,Le),_(4,Ml),_(5,mr),_(6,Te),_(7,Fo),_(8,we)],pCe);function uue(s,e){s.changeDecorations(t=>{s.changeViewZones(i=>{e(t,i)})})}var SVt=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.monaco-workbench .inline-chat{background:var(--vscode-inlineChat-background);border:1px solid var(--vscode-inlineChat-border);border-radius:4px;box-shadow:0 2px 4px 0 var(--vscode-widget-shadow);color:inherit}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part{padding:4px 6px 0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-input-and-execute-toolbar{border-radius:2px;width:100%}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list{padding:4px 0 0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact{gap:6px;padding-left:6px;padding-right:20px;padding-top:2px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .header .avatar{outline-offset:-1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .chat-notification-widget{border:none;margin-bottom:0;padding:0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.minimal>.header{right:10px;top:5px}.monaco-workbench .inline-chat>.status{align-items:center;display:flex;justify-content:space-between;padding:4px 6px 0}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:flex;font-size:11px;overflow:hidden;white-space:nowrap}.monaco-workbench .inline-chat .status .label.info{margin-right:auto;padding-left:2px}.monaco-workbench .inline-chat .status .label.status{margin-left:auto}.monaco-workbench .inline-chat .status .label.hidden{display:none}.monaco-workbench .inline-chat .status .label.error{color:var(--vscode-errorForeground)}.monaco-workbench .inline-chat .status .label.warn{color:var(--vscode-editorWarning-foreground)}.monaco-workbench .inline-chat .status .label>.codicon{font-size:12px;line-height:18px;padding:0 3px}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget .toolbar{display:flex;height:18px;.actions-container{gap:3px}.action-item.text-only .action-label{border-radius:2px;font-size:12px;line-height:16px;padding:0 4px}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{font-size:12px;height:unset;line-height:16px;width:unset}}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget.contents .toolbar{.monaco-action-bar .action-item.menu-entry.text-only:first-of-type .action-label{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}}.monaco-workbench .inline-chat .status{.actions.text-style{display:none}.actions.button-style{display:inherit}}.monaco-workbench .inline-chat .status.text{.actions.text-style{display:inherit}.actions.button-style{display:none}}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:4px}.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown>.monaco-dropdown-button{align-items:center;display:flex;padding:0 4px}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon{display:flex}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon:before{align-self:center}.monaco-workbench .inline-chat .status .actions .monaco-text-button{padding:0 2px;white-space:nowrap}.monaco-workbench .inline-chat .status .monaco-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item.button-item .action-label:is(:hover,:focus){background-color:var(--vscode-button-hoverBackground)}.monaco-workbench .inline-chat .diff-review{background-color:unset;padding:4px 6px}.monaco-workbench .inline-chat .diff-review.hidden{display:none}.monaco-workbench .inline-chat-inserted-range{background-color:var(--vscode-inlineChatDiff-inserted)}.monaco-workbench .inline-chat-inserted-range-linehighlight{background-color:var(--vscode-diffEditor-insertedLineBackground)}.monaco-workbench .inline-chat-original-zone2{background-color:var(--vscode-diffEditor-removedLineBackground);opacity:.8}.monaco-workbench .inline-chat-lines-inserted-range{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .inline-chat-block-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{cursor:pointer;display:block;transition:opacity .2s ease-in-out}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque{opacity:.5}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{opacity:0}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque:hover,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent:hover{opacity:1}";ut(SVt,{});let mCe=class extends ixt{constructor(e,t,i,n,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=n,this._hoverService=r,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new $_),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{o.publicLog2("workbenchActionExecuted",{id:a.action.id,from:t.telemetrySource})},void 0,this._store)}dispose(){this._onDidChange.dispose(),this._updateStore.dispose(),this._store.dispose(),super.dispose()}update(e,t){const i=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const n=this._updateStore.add($k());for(let o=0;o0,a=e[o];let c,l;if(a instanceof Nk&&a.actions.length>0){const[u,...f]=a.actions;c=u,l=this.addButtonWithDropdown({secondary:i(c)?.isSecondary??r,actionRunner:this._actionRunner,actions:f,contextMenuProvider:this._contextMenuService,ariaLabel:c.label})}else c=a,l=this.addButton({secondary:i(c)?.isSecondary??r,ariaLabel:c.label});l.enabled=c.enabled,l.element.classList.add("default-colors"),i(c)?.showLabel??!0?l.label=c.label:l.element.classList.add("monaco-text-button"),i(c)?.showIcon&&(c instanceof Sc&&We.isThemeIcon(c.item.icon)?l.icon=c.item.icon:c.class&&l.element.classList.add(...c.class.split(" ")));const d=this._keybindingService.lookupKeybinding(c.id);let h;d?h=g(11519,"{0} ({1})",c.label,d.getLabel()):h=c.label,this._updateStore.add(this._hoverService.setupManagedHover(n,l.element,h)),this._updateStore.add(l.onDidClick(async()=>{this._actionRunner.run(c)}))}if(t.length>0){const o=this.addButton({secondary:!0,ariaLabel:g(11520,"More Actions")});o.icon=ve.dropDownButton,o.element.classList.add("default-colors","monaco-text-button"),o.enabled=!0,this._updateStore.add(this._hoverService.setupManagedHover(n,o.element,g(11520,"More Actions"))),this._updateStore.add(o.onDidClick(async()=>{this._contextMenuService.showContextMenu({getAnchor:()=>o.element,getActions:()=>t,actionRunner:this._actionRunner,onHide:()=>o.element.setAttribute("aria-expanded","false")}),o.element.setAttribute("aria-expanded","true")}))}this._onDidChange.fire(this)}};mCe=D([_(2,lr),_(3,Ut),_(4,Yi),_(5,ec)],mCe);let _Ce=class extends mCe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,r,a,c,l);const d=n.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=[],f=[];fC(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup),super.update(u,f)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};_Ce=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,Yi),_(8,ec)],_Ce);var AVt='.interactive-session{margin:auto;max-width:850px}.interactive-list>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row>.monaco-tl-row>.monaco-tl-twistie{display:none!important}.interactive-item-container{color:var(--vscode-interactive-session-foreground);cursor:default;display:flex;flex-direction:column;gap:8px;padding:16px 20px;user-select:text;-webkit-user-select:text}.interactive-item-container .header{align-items:center;display:flex;justify-content:space-between;position:relative}.interactive-item-container .header.hidden{display:none}.interactive-item-container .header .user{align-items:center;display:flex;gap:8px}.interactive-item-container .header .username{font-size:13px;font-weight:600;margin:0}.interactive-item-container .detail-container{color:var(--vscode-descriptionForeground);font-size:12px;overflow:hidden}.interactive-item-container .detail-container .detail .agentOrSlashCommandDetected A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-item-container .chat-animated-ellipsis{display:inline-block;width:11px}.interactive-item-container:not(.show-detail-progress) .chat-animated-ellipsis{display:none}@keyframes ellipsis{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}.interactive-item-container .chat-animated-ellipsis:after{animation:ellipsis 1s steps(4) infinite;content:"";overflow:hidden;white-space:nowrap;width:3em}.interactive-item-container .header .avatar-container{display:flex;pointer-events:none;user-select:none}.interactive-item-container .header .avatar{align-items:center;border-radius:50%;display:flex;height:24px;justify-content:center;outline:1px solid var(--vscode-chat-requestBorder);width:24px}.interactive-item-container .header .avatar.codicon-avatar{background:var(--vscode-chat-avatarBackground)}.interactive-item-container .header .avatar+.avatar{margin-left:-8px}.interactive-item-container .header .avatar .icon{background-color:var(--vscode-chat-list-background);border-radius:50%;height:24px;width:24px}.interactive-item-container .header .avatar .codicon{color:var(--vscode-chat-avatarForeground)!important;font-size:14px}.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label{display:none}.interactive-item-container .header .monaco-toolbar .monaco-action-bar .actions-container{gap:4px}.interactive-item-container .header .monaco-toolbar .action-label{border:1px solid transparent;padding:2px}.interactive-item-container .header .monaco-toolbar{background-color:var(--vscode-chat-list-background);position:absolute;right:0}.interactive-item-container.interactive-request .header .monaco-toolbar{background-color:inherit}.interactive-item-container .header .monaco-toolbar .checked.action-label,.interactive-item-container .header .monaco-toolbar .checked.action-label:hover{background-color:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);color:var(--vscode-inputOption-activeForeground)!important}.interactive-item-container .value{width:100%}.interactive-item-container>.value .chat-used-context{margin-bottom:8px}.interactive-item-container .value .rendered-markdown table{margin-bottom:16px;text-align:left;width:100%}.interactive-item-container .value .rendered-markdown table,.interactive-item-container .value .rendered-markdown table td,.interactive-item-container .value .rendered-markdown table th{border:1px solid var(--vscode-chat-requestBorder);border-collapse:collapse;padding:4px 6px}.interactive-item-container .value .interactive-session-followups,.interactive-item-container .value .rendered-markdown a,.interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textLink-foreground)}.interactive-item-container .value .rendered-markdown a:active,.interactive-item-container .value .rendered-markdown a:hover{color:var(--vscode-textLink-activeForeground)}.hc-black .interactive-item-container .value .rendered-markdown a code,.hc-light .interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textPreformat-foreground)}.interactive-list{overflow:hidden}.interactive-request{border-bottom:1px solid var(--vscode-chat-requestBorder);border-top:1px solid var(--vscode-chat-requestBorder)}.hc-black .interactive-request,.hc-light .interactive-request{border-left:3px solid var(--vscode-chat-requestBorder);border-right:3px solid var(--vscode-chat-requestBorder)}.interactive-item-container .value{overflow-wrap:anywhere;white-space:normal}.interactive-item-container .value>:last-child.rendered-markdown>:last-child{margin-bottom:0}.interactive-item-container .value .rendered-markdown h1{font-size:20px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h2{font-size:16px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h3{font-size:14px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown p{line-height:1.5em}.interactive-item-container .value>.rendered-markdown p{margin:0 0 16px}.interactive-item-container .value>.rendered-markdown li>p{margin:0}.interactive-item-container .value .rendered-markdown ul{padding-inline-start:24px}.interactive-item-container .value .rendered-markdown ol{padding-inline-start:28px}.interactive-item-container .value .rendered-markdown li{line-height:1.3rem}.interactive-item-container .value .rendered-markdown img{max-width:100%}.interactive-item-container .monaco-tokenized-source,.interactive-item-container code{background-color:var(--vscode-textPreformat-background);border-radius:4px;color:var(--vscode-textPreformat-foreground);font-family:var(--monaco-monospace-font);font-size:12px;padding:1px 3px}.interactive-item-container.interactive-item-compact{padding:8px 20px}.interactive-item-container.interactive-item-compact.no-padding{gap:unset;padding:unset}.interactive-item-container.interactive-item-compact .header{height:16px}.interactive-item-container.interactive-item-compact .header .avatar{height:18px;width:18px}.interactive-item-container.interactive-item-compact .header .avatar .icon{height:16px;width:16px}.interactive-item-container.interactive-item-compact .header .codicon-avatar .codicon{font-size:12px}.interactive-item-container.interactive-item-compact .header .avatar+.avatar{margin-left:-4px}.interactive-item-container.interactive-item-compact .value{min-height:0}.interactive-item-container.interactive-item-compact .value>.rendered-markdown p{margin:0 0 8px}.interactive-item-container.interactive-item-compact .value>.rendered-markdown li>p{margin:0}.interactive-item-container.interactive-item-compact .value .rendered-markdown h1,.interactive-item-container.interactive-item-compact .value .rendered-markdown h2,.interactive-item-container.interactive-item-compact .value .rendered-markdown h3{margin:8px 0}.interactive-item-container.minimal{flex-direction:row}.interactive-item-container.minimal .column.left{display:inline-block;flex-grow:0;padding-top:2px}.interactive-item-container.minimal .column.right{display:inline-block;flex-grow:1}.interactive-item-container.minimal .user>.username{display:none}.interactive-item-container.minimal .detail-container{font-size:unset}.interactive-item-container.minimal>.header{position:absolute;right:0}.interactive-session .interactive-input-and-execute-toolbar{align-items:flex-end;background-color:var(--vscode-input-background);border:1px solid var(--vscode-input-border,transparent);border-radius:4px;box-sizing:border-box;cursor:text;display:flex;justify-content:space-between;margin-bottom:4px;padding:0 6px;position:relative}.interactive-session .interactive-input-part.compact .interactive-input-and-execute-toolbar{border-radius:2px;margin-bottom:0}.interactive-session .interactive-input-and-side-toolbar{align-items:center;display:flex;gap:4px}.interactive-session .interactive-input-and-execute-toolbar.focused{border-color:var(--vscode-focusBorder)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .mtk1{color:var(--vscode-input-foreground)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor,.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .monaco-editor-background{background-color:var(--vscode-input-background)!important}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .cursors-layer{padding-left:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar{height:22px;margin-bottom:7px}.interactive-session .interactive-input-part .interactive-execute-toolbar .monaco-action-bar .actions-container{display:flex;gap:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar .codicon-debug-stop{color:var(--vscode-icon-foreground)!important}.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .margin,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .monaco-editor-background{background-color:var(--vscode-interactive-result-editor-background-color)!important}.interactive-item-compact .interactive-result-code-block{margin:0 0 8px}.interactive-item-container .interactive-result-code-block .monaco-toolbar .monaco-action-bar .actions-container{padding-inline-start:unset}.chat-notification-widget .chat-error-codicon,.chat-notification-widget .chat-info-codicon,.chat-notification-widget .chat-warning-codicon{align-items:start;display:flex;gap:8px}.interactive-item-container .value .chat-notification-widget .rendered-markdown p{margin:0}.interactive-response .interactive-response-error-details{align-items:start;display:flex;gap:6px}.interactive-response .interactive-response-error-details .rendered-markdown :last-child{margin-bottom:0}.chat-notification-widget .chat-error-codicon .codicon,.chat-notification-widget .chat-info-codicon .codicon,.chat-notification-widget .chat-warning-codicon .codicon{margin-top:2px}.interactive-response .interactive-response-error-details .codicon{margin-top:1px}.chat-used-context-list .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-used-context-list .monaco-icon-label-container{color:var(--vscode-interactive-session-foreground)}.chat-attached-context .chat-attached-context-attachment .monaco-icon-name-container.warning,.chat-attached-context .chat-attached-context-attachment .monaco-icon-suffix-container.warning,.chat-used-context-list .monaco-icon-name-container.warning,.chat-used-context-list .monaco-icon-suffix-container.warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-attached-context .chat-attached-context-attachment.show-file-icons.warning{border-color:var(--vscode-notificationsWarningIcon-foreground)}.chat-notification-widget .chat-warning-codicon .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.chat-notification-widget .chat-error-codicon .codicon-error,.interactive-response .interactive-response-error-details .codicon-error{color:var(--vscode-errorForeground)!important}.chat-notification-widget .chat-info-codicon .codicon-info,.interactive-response .interactive-response-error-details .codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}.interactive-session .interactive-input-part{display:flex;flex-direction:column;margin:0 20px;padding:12px 0}.interactive-session .interactive-input-part.compact{margin:0;padding:8px 0 0}.interactive-session .chat-attached-context .chat-attached-context-attachment{display:flex;gap:4px}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button:hover{cursor:pointer}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button{align-items:center;display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container{display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container .monaco-highlighted-label{align-items:center!important;display:flex!important}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button.codicon.codicon-close,.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .monaco-button.codicon.codicon-close{color:var(--vscode-descriptionForeground);cursor:pointer}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .codicon{padding-left:4px}.interactive-session .chat-attached-context{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 8px}.interactive-session .interactive-item-container.interactive-request .chat-attached-context{margin-top:-8px}.interactive-session .chat-attached-context .chat-attached-context-attachment{border:1px solid var(--vscode-chat-requestBorder,var(--vscode-input-background,transparent));border-radius:4px;height:18px;max-width:100%;padding:2px}.interactive-session .interactive-item-container.interactive-request .chat-attached-context .chat-attached-context-attachment{padding-right:6px}.interactive-session-followups{align-items:start;display:flex;flex-direction:column;gap:6px}.interactive-session-followups .monaco-button{text-align:left;width:auto}.interactive-session-followups .monaco-button .codicon{margin-left:0;margin-top:1px}.interactive-item-container .interactive-response-followups .monaco-button{padding:4px 8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups{margin-bottom:8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:var(--vscode-textLink-foreground);display:block;display:-webkit-box;font-size:12px;overflow:hidden}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups code{font-family:var(--monaco-monospace-font);font-size:11px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button .codicon-sparkle{float:left}.interactive-session-followups .monaco-button.interactive-followup-reply{border:none;padding:0}.interactive-welcome .value .interactive-session-followups{margin-bottom:16px}.interactive-item-container .monaco-toolbar .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container.filtered-response .value>.rendered-markdown{-webkit-mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);pointer-events:none}.quick-input-widget .interactive-session .interactive-input-part{margin:0 3px;padding:8px 6px 6px}.quick-input-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar{border-radius:2px;margin:0;padding:0 4px 0 6px}.quick-input-widget .interactive-list{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.quick-input-widget .interactive-response{min-height:86px}.interactive-response-progress-tree .monaco-list-row:not(.selected) .monaco-tl-row:hover{background-color:var(--vscode-list-hoverBackground)}.interactive-response-progress-tree{margin:16px 0}.interactive-response-progress-tree.focused{border-color:var(--vscode-focusBorder,transparent)}.interactive-item-container .value .interactive-response-placeholder-codicon .codicon{color:var(--vscode-editorGhostText-foreground)}.interactive-item-container .value .interactive-response-placeholder-content{color:var(--vscode-editorGhostText-foreground);font-size:12px;margin-bottom:16px}.interactive-item-container .value .interactive-response-placeholder-content p{margin:0}.interactive-response .interactive-response-codicon-details{align-items:start;display:flex;gap:6px}.chat-used-context-list .monaco-list{border:none;border-radius:4px;width:auto}.interactive-item-container .chat-resource-widget{background-color:var(--vscode-chat-slashCommandBackground);color:var(--vscode-chat-slashCommandForeground)}.interactive-item-container .chat-agent-widget .monaco-button,.interactive-item-container .chat-resource-widget{border-radius:4px;padding:1px 3px}.interactive-item-container .chat-agent-widget .monaco-text-button{border:none;display:inline}.interactive-session .chat-used-context.chat-used-context-collapsed .chat-used-context-list{display:none}.interactive-session .chat-used-context{display:flex;flex-direction:column;gap:2px}.interactive-item-container .chat-notification-widget,.interactive-response-progress-tree,.interactive-session .chat-used-context-list{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:8px;padding:6px 8px}.interactive-item-container .chat-notification-widget{padding:8px 12px}.interactive-session .chat-used-context-list .monaco-list .monaco-list-row{border-radius:2px}.interactive-session .chat-used-context-label{color:var(--vscode-descriptionForeground);font-size:12px;user-select:none}.interactive-session .chat-used-context-label:hover{opacity:unset}.interactive-session .chat-used-context-label .monaco-button{border:none;border-radius:4px;display:inline-flex;gap:4px;justify-content:normal;padding:4px 8px 4px 0;text-align:initial;width:100%}.interactive-session .chat-used-context-label .monaco-button:hover{background-color:var(--vscode-list-hoverBackground);color:var(--vscode-foreground)}.interactive-session .chat-used-context-label .monaco-text-button:focus{outline:none}.interactive-session .chat-used-context-label .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-session .chat-used-context .chat-used-context-label .monaco-button .codicon{margin:0 0 0 4px}.interactive-item-container .rendered-markdown.progress-step{display:flex;margin-left:4px;white-space:normal}.interactive-item-container .rendered-markdown.progress-step>p{align-items:center;color:var(--vscode-descriptionForeground);display:flex;font-size:12px;gap:8px;margin-bottom:6px}.interactive-item-container .rendered-markdown.progress-step>p .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container .rendered-markdown.progress-step>p .codicon.codicon-check{color:var(--vscode-debugIcon-startForeground)!important}.interactive-item-container .chat-command-button{display:flex;margin-bottom:16px}.interactive-item-container .chat-notification-widget{display:flex;flex-direction:row;gap:6px}.chat-confirmation-widget .chat-confirmation-buttons-container .monaco-button,.interactive-item-container .chat-command-button .monaco-button{padding:4px 8px;text-align:left;width:auto}.interactive-item-container .chat-command-button .monaco-button .codicon{margin-left:0;margin-top:1px}.chat-code-citation-label{opacity:.7;white-space:pre-wrap}.chat-code-citation-button-container{display:inline}.chat-code-citation-button-container .monaco-button{border:none;color:var(--vscode-textLink-foreground);display:inline;padding:0}';ut(AVt,{});var EVt=".chat-agent-hover{line-height:unset;padding:6px 0}.chat-agent-hover-header{display:flex;gap:8px;margin-bottom:4px}.chat-agent-hover-icon .codicon,.chat-agent-hover-icon img{border-radius:50%;height:32px;outline:1px solid var(--vscode-chat-requestBorder);width:32px}.chat-agent-hover .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px!important;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.chat-agent-hover .chat-agent-hover-publisher .codicon.codicon-extensions-verified-publisher{color:var(--vscode-extensionIcon-verifiedForeground)}.chat-agent-hover .extension-verified-publisher{display:none}.chat-agent-hover.verifiedPublisher .extension-verified-publisher{display:flex}.chat-agent-hover .chat-agent-hover-warning .codicon{color:var(--vscode-notificationsWarningIcon-foreground)!important;margin-right:3px}.chat-agent-hover.allowedName .chat-agent-hover-warning{display:none}.chat-agent-hover-header .chat-agent-hover-name{font-size:14px;font-weight:600}.chat-agent-hover-header .chat-agent-hover-details{font-size:12px}.chat-agent-hover-extension{color:var(--vscode-descriptionForeground);display:flex;gap:6px}.chat-agent-hover.noExtensionName .chat-agent-hover-extension-name,.chat-agent-hover.noExtensionName .chat-agent-hover-separator{display:none}.chat-agent-hover-separator{opacity:.7}.chat-agent-hover-description,.chat-agent-hover-warning{font-size:13px}";ut(EVt,{});let vCe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(7005,"Chat")}getAriaLabel(e){return Uu(e)?e.messageText:vs(e)?this._getLabelWithCodeBlockCount(e):tB(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` `)).join(` -`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(ua.Chat);let i="";const s=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(s){case 0:break;case 1:o=g(uA,1,"1 file tree");break;default:o=g(uA,2,"{0} file trees",s);break}const r=Xg.lexer(e.response.asString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(uA,3,"{0} {1} {2}",o,e.response.asString(),t):g(uA,4,"{0} {1}",o,e.response.asString());break;case 1:i=t?g(uA,5,"{0} 1 code block: {1} {2}",o,e.response.asString(),t):g(uA,6,"{0} 1 code block: {1}",o,e.response.asString());break;default:i=t?g(uA,7,"{0} {1} code blocks: {2}",o,r,e.response.asString(),t):g(uA,8,"{0} {1} code blocks",o,r,e.response.asString());break}return i}};NEe=D([_(0,Tw)],NEe);let PEe=class extends c_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c,l,d,h){super(null,e,{hoverDelegate:r?.hoverDelegate}),this._contextMenuProvider=o,this._options=r,this._container=null,this._dropdownContainer=null,this._primaryAction=new eC(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new gx(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:s?["codicon","codicon-chevron-down",s]:["codicon","codicon-chevron-down"],actionRunner:this._options?.actionRunner,keybindingProvider:this._options?.getKeyBinding,hoverDelegate:r?.hoverDelegate})}setActionContext(e){super.setActionContext(e),this._primaryAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-primary");const t=we(".action-container");this._primaryAction.render(he(this._container,t)),this._dropdownContainer=we(".dropdown-action-container"),this._dropdown.render(he(this._container,this._dropdownContainer)),this._register(pe(t,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())})),this._register(pe(this._dropdownContainer,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),s.stopPropagation())})),this.updateEnabled()}focus(e){e?this._dropdown.focus():(this._primaryAction.element.tabIndex=0,this._primaryAction.element.focus())}blur(){this._primaryAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._primaryAction.element.tabIndex=0:(this._primaryAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}updateEnabled(){const e=!this.action.enabled;this.element?.classList.toggle("disabled",e)}update(e,t,i){this._dropdown.dispose(),this._dropdown=new gx(e,t,this._contextMenuProvider,{menuAsChild:!0,classNames:["codicon",i||"codicon-chevron-down"],actionRunner:this._options?.actionRunner,hoverDelegate:this._options?.hoverDelegate,keybindingProvider:this._options?.getKeyBinding}),this._dropdownContainer&&this._dropdown.render(this._dropdownContainer)}dispose(){this._primaryAction.dispose(),this._dropdown.dispose(),super.dispose()}};PEe=D([_(6,ti),_(7,Pi),_(8,Pe),_(9,pn),_(10,Ur)],PEe);const Gze="vs/workbench/browser/labels";function SC(n){if(!(!n||!n.resource))return P.isUri(n.resource)?n.resource:n.resource.primary}const r5t={onDidChangeVisibility:T.None};let B1=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=s,this.workspaceService=o,this.languageService=r,this.decorationsService=a,this.themeService=c,this.labelService=l,this.textFileService=d,this._onDidChangeDecorations=this._register(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this.widgets=[],this.labels=[],this.registerListeners(e)}registerListeners(e){this._register(e.onDidChangeVisibility(t=>{this.widgets.forEach(i=>i.notifyVisibilityChanged(t))})),this._register(this.languageService.onDidChange(()=>this.widgets.forEach(t=>t.notifyExtensionsRegistered()))),this._register(this.modelService.onModelLanguageChanged(t=>{t.model.uri&&this.widgets.forEach(i=>i.notifyModelLanguageChanged(t.model))})),this._register(this.modelService.onModelAdded(t=>{t.uri&&this.widgets.forEach(i=>i.notifyModelAdded(t))})),this._register(this.workspaceService.onDidChangeWorkspaceFolders(()=>{this.widgets.forEach(t=>t.notifyWorkspaceFoldersChange())})),this._register(this.decorationsService.onDidChangeDecorations(t=>{let i=!1;this.widgets.forEach(s=>{s.notifyFileDecorationsChanges(t)&&(i=!0)}),i&&this._onDidChangeDecorations.fire()})),this._register(this.themeService.onDidColorThemeChange(()=>this.widgets.forEach(t=>t.notifyThemeChange()))),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(ANe)&&this.widgets.forEach(i=>i.notifyFileAssociationsChange())})),this._register(this.labelService.onDidChangeFormatters(t=>{this.widgets.forEach(i=>i.notifyFormattersChange(t.scheme))})),this._register(this.textFileService.untitled.onDidChangeLabel(t=>{this.widgets.forEach(i=>i.notifyUntitledLabelChange(t.resource))}))}get(e){return this.labels[e]}create(e,t){const i=this.instantiationService.createInstance(FEe,e,t),s={element:i.element,onDidRender:i.onDidRender,setLabel:(o,r,a)=>i.setLabel(o,r,a),setResource:(o,r)=>i.setResource(o,r),setFile:(o,r)=>i.setFile(o,r),clear:()=>i.clear(),dispose:()=>this.disposeWidget(i)};return this.labels.push(s),this.widgets.push(i),s}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),St(e)}clear(){this.widgets=St(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};B1=D([_(1,be),_(2,Re),_(3,Ai),_(4,Ti),_(5,Di),_(6,rD),_(7,pn),_(8,eo),_(9,tr)],B1);let qze=class extends B1{get element(){return this.label}constructor(e,t,i,s,o,r,a,c,l,d,h){super(r5t,i,s,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};qze=D([_(2,be),_(3,Re),_(4,Ai),_(5,Ti),_(6,Di),_(7,rD),_(8,pn),_(9,eo),_(10,tr)],qze);var NT;(function(n){n[n.Basic=1]="Basic",n[n.Full=2]="Full"})(NT||(NT={}));let FEe=class extends T7{constructor(e,t,i,s,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=s,this.decorationsService=o,this.labelService=r,this.textFileService=a,this.contextService=c,this.notebookDocumentService=l,this._onDidRender=this._register(new I),this.onDidRender=this._onDidRender.event,this.label=void 0,this.decoration=this._register(new Dn),this.options=void 0,this.computedIconClasses=void 0,this.computedLanguageId=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0,this.needsRedraw=void 0,this.isHidden=!1}notifyVisibilityChanged(e){e===this.isHidden&&(this.isHidden=!e,e&&this.needsRedraw&&(this.render({updateIcon:this.needsRedraw===NT.Full,updateDecoration:this.needsRedraw===NT.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=SC(this.label);t&&_n(e.uri,t)&&this.computedLanguageId!==e.getLanguageId()&&(this.computedLanguageId=e.getLanguageId(),this.render({updateIcon:!0,updateDecoration:!1}))}notifyFileDecorationsChanges(e){if(!this.options)return!1;const t=SC(this.label);return t&&this.options.fileDecorations&&e.affectsResource(t)?this.render({updateIcon:!1,updateDecoration:!0}):!1}notifyExtensionsRegistered(){this.render({updateIcon:!0,updateDecoration:!1})}notifyThemeChange(){this.render({updateIcon:!1,updateDecoration:!1})}notifyFileAssociationsChange(){this.render({updateIcon:!0,updateDecoration:!1})}notifyFormattersChange(e){SC(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){_n(e,SC(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=SC(this.label);P.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let s;if(!i){if(t?.fileKind===Lc.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(s=r.name,this.computedWorkspaceFolderLabel=s)}s||(s=Ay(Mx(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(ma(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:s,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=SC(e),s=e?.resource&&!P.isUri(e.resource);if(!t.forceLabel&&!s&&i?.scheme===_e.untitled){const l=this.textFileService.untitled.get(i);if(l&&!l.hasAssociatedFilePath){if(typeof e.name=="string"&&(e.name=l.name),typeof e.description=="string"){const h=l.resource.path;e.name!==h?e.description=h:e.description=void 0}const d=l.resource.path;l.name!==d?t.title=`${l.name} • ${d}`:t.title=d}}if(!t.forceLabel&&!s&&i?.scheme===_e.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`))}const o=this.hasResourceChanged(e),r=o||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,o&&(this.computedLanguageId=void 0),r&&(this.computedPathLabel=void 0),this.render({updateIcon:o||a||c,updateDecoration:o||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=SC(e),i=SC(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=SC(e);return!!t&&this.computedPathLabel!==this.labelService.getUriLabel(t)}hasIconChanged(e){return this.options?.icon!==e?.icon}clear(){this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.setLabel("")}render(e){if(this.isHidden)return this.needsRedraw!==NT.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?NT.Full:NT.Basic),!1;if(e.updateIcon&&(this.computedIconClasses=void 0),!this.label)return!1;const t={title:"",italic:this.options?.italic,strikethrough:this.options?.strikethrough,matches:this.options?.matches,descriptionMatches:this.options?.descriptionMatches,extraClasses:[],separator:this.options?.separator,domId:this.options?.domId,disabledCommand:this.options?.disabledCommand,labelEscapeNewLines:this.options?.labelEscapeNewLines,descriptionTitle:this.options?.descriptionTitle},i=SC(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==_e.data&&(!this.options?.title||typeof this.options.title!="string"&&!this.options.title.markdownNotSupportedFallback)&&(this.computedPathLabel||(this.computedPathLabel=this.labelService.getUriLabel(i)),!t.title||typeof t.title=="string"?t.title=this.computedPathLabel:t.title.markdownNotSupportedFallback||(t.title.markdownNotSupportedFallback=this.computedPathLabel)),this.options&&!this.options.hideIcon&&(this.computedIconClasses||(this.computedIconClasses=lI(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),P.isUri(this.options.icon)&&(t.iconPath=this.options.icon),t.extraClasses=this.computedIconClasses.slice(0)),this.options?.extraClasses&&t.extraClasses.push(...this.options.extraClasses),this.options?.fileDecorations&&i){e.updateDecoration&&(this.decoration.value=this.decorationsService.getDecoration(i,this.options.fileKind!==Lc.FILE));const s=this.decoration.value;if(s){if(s.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${s.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${s.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}s.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(s.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(s.badgeClassName),t.extraClasses.push(s.iconClassName))}}return this.label.range&&(t.suffix=this.label.range.startLineNumber!==this.label.range.endLineNumber?`:${this.label.range.startLineNumber}-${this.label.range.endLineNumber}`:`:${this.label.range.startLineNumber}`),this.setLabel(this.label.name??"",this.label.description,t),this._onDidRender.fire(),!0}dispose(){super.dispose(),this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0}};FEe=D([_(2,Di),_(3,Ai),_(4,rD),_(5,eo),_(6,tr),_(7,Ti),_(8,Aet)],FEe);const jFe="vs/workbench/contrib/chat/browser/actions/chatExecuteActions",Wce=class Wce extends pi{constructor(){super({id:Wce.ID,title:Be(jFe,0,"Send"),f1:!1,category:tst,icon:Ce.send,precondition:ge.and(tFe,j7.negate()),keybinding:{when:iFe,primary:E.Enter,weight:ye.EditorContrib},menu:[{id:Te.ChatExecuteSecondary,group:"group_1"},{id:Te.ChatExecute,when:j7.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],s=e.get(lL);(i?.widget??s.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Wce.ID="workbench.action.chat.submit";let OEe=Wce;const Hce=class Hce extends pi{constructor(){super({id:Hce.ID,title:Be(jFe,1,"Submit to Secondary Agent"),precondition:ge.and(tFe,gtt.negate(),j7.negate()),keybinding:{when:iFe,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib},menu:{id:Te.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(yp).getSecondaryAgent();if(!o)return;const r=e.get(lL),a=i?.widget??r.lastFocusedWidget;a&&(_zt(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${$z}${o.name}`)))}};Hce.ID="workbench.action.chat.submitSecondaryAgent";let BEe=Hce;const Uce=class Uce extends pi{constructor(){super({id:Uce.ID,title:Be(jFe,3,"Cancel"),f1:!1,category:tst,icon:Ce.debugStop,menu:{id:Te.ChatExecute,when:j7,group:"navigation"},keybinding:{weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.Escape}})}run(e,...t){const i=t[0],s=e.get(lL),o=i?.widget??s.lastFocusedWidget;if(!o)return;const r=e.get(Rw);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Uce.ID="workbench.action.chat.cancel";let WEe=Uce;const a5t="vs/workbench/contrib/chat/browser/chatFollowups",c5t=we;let $ie=class extends ${constructor(e,t,i,s,o,r){super(),this.location=i,this.options=s,this.clickHandler=o,this.chatAgentService=r;const a=he(e,c5t(".interactive-session-followups"));t.forEach(c=>this.renderFollowup(a,c))}renderFollowup(e,t){if(!this.chatAgentService.getDefaultAgent(this.location))return;let i="";if("agentId"in t&&t.agentId&&t.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const c=this.chatAgentService.getAgent(t.agentId);if(!c)return;i+=`${$z}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${O1}${t.subCommand} `)}const s=t.kind==="reply"?t.title||t.message:t.title,o=t.kind==="reply"?t.message:t.title,r=(i+("tooltip"in t&&t.tooltip||o)).trim(),a=this._register(new Tu(e,{...this.options,title:r}));t.kind==="reply"?a.element.classList.add("interactive-followup-reply"):t.kind==="command"&&a.element.classList.add("interactive-followup-command"),a.element.ariaLabel=g(a5t,0,"Follow up question: {0}",s),a.label=new Xt(s),this._register(a.onDidClick(()=>this.clickHandler(t)))}};$ie=D([_(5,yp)],$ie);var QJ;const ND="vs/workbench/contrib/chat/browser/chatInputPart",LL=we,Qze=250;var I0;let b6=(I0=class extends ${get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,s,o,r,a,c,l){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=s,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this._onDidLoadInputState=this._register(new I),this.onDidLoadInputState=this._onDidLoadInputState.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidAcceptFollowup=this._register(new I),this.onDidAcceptFollowup=this._onDidAcceptFollowup.event,this._indexOfLastAttachedContextDeletedWithKeyboard=-1,this._attachedContext=new Set,this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.onHistoryEntry=!1,this.inHistoryNavigation=!1,this.inputUri=P.parse(`${QJ.INPUT_SCHEME}:input-${QJ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?Qze/3:Qze,this.inputEditorHasText=tFe.bindTo(r),this.chatCursorAtTop=XPt.bindTo(r),this.inputEditorHasFocus=YPt.bindTo(r),this.history=new Wbe([],5),this._register(this.historyService.onDidClearHistory(()=>this.history.clear())),this._register(this.configurationService.onDidChangeConfiguration(d=>{d.affectsConfiguration(ua.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}_getAriaLabel(){if(this.configurationService.getValue(ua.Chat)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();return t?g(ND,0,"Chat Input, Type to ask questions or type / for topics, press enter to send out the request. Use {0} for Chat Accessibility Help.",t):g(ND,1,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(ND,2,"Chat Input")}setState(e){const t=this.historyService.getHistory(this.location);this.history=new Wbe(t,50),typeof e=="string"&&this.setValue(e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.navigateHistory(!0)}showNextValue(){this.navigateHistory(!1)}navigateHistory(e){const t=(e?this.history.previous()??this.history.first():this.history.next())??{text:""};if(this.onHistoryEntry=e||this.history.current()!==null,Cu(t.text),this.inHistoryNavigation=!0,this.setValue(t.text),this.inHistoryNavigation=!1,this._onDidLoadInputState.fire(t.state),e)this._inputEditor.setPosition({lineNumber:1,column:1});else{const i=this._inputEditor.getModel();if(!i)return;this._inputEditor.setPosition(jze(i))}}setValue(e){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1})}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e,t){if(e){let i=this.history.getHistory().find(s=>s.text===e);i?i.state=t:i={text:e,state:t},this.history.add(i)}this.accessibilityService.isScreenReaderOptimized()&&ei?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(this._inputEditorElement.removeChild(e),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}attachContext(...e){for(const t of e)this.attachedContext.add(t);this.initAttachedContext(this.attachedContextContainer)}render(e,t,i){this.container=he(e,LL(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=he(this.container,LL(".interactive-input-followups")),this.attachedContextContainer=he(this.container,LL(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const s=he(this.container,LL(".interactive-input-and-side-toolbar")),o=he(s,LL(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));iFe.bindTo(r).set(!0);const a=this.instantiationService.createChild(new Dl([Pe,r])),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(dhe(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=QFe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=iYe,d.fontSize=13,d.lineHeight=20,d.padding=this.options.renderStyle==="compact"?{top:2,bottom:2}:{top:8,bottom:8},d.cursorWidth=1,d.wrappingStrategy="advanced",d.bracketPairColorization={enabled:!1},d.suggest={showIcons:!1,showSnippets:!1,showWords:!0,showStatusBar:!1,insertMode:"replace"},d.scrollbar={...d.scrollbar??{},vertical:"hidden"},this._inputEditorElement=he(o,LL(".interactive-input-editor"));const h=Zzt();if(h.contributions?.push(...b_.getSomeEditorContributions([Pc.ID])),this._inputEditor=this._register(a.createInstance(_1,this._inputEditorElement,d,h)),this._register(this._inputEditor.onDidChangeModelContent(()=>{const f=Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight);f!==this.inputEditorHeight&&(this.inputEditorHeight=f,this._onDidChangeHeight.fire());const p=this._inputEditor.getModel(),m=!!p&&p.getValue().trim().length>0;this.inputEditorHasText.set(m),this.inHistoryNavigation||(this.onHistoryEntry=!1),this.onHistoryEntry||(this.historyNavigationForewardsEnablement.set(!m),this.historyNavigationBackwardsEnablement.set(!m))})),this._register(this._inputEditor.onDidFocusEditorText(()=>{this.inputEditorHasFocus.set(!0),this._onDidFocus.fire(),o.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),o.classList.toggle("focused",!1),this._onDidBlur.fire()})),this._register(this._inputEditor.onDidChangeCursorPosition(f=>{const p=this._inputEditor.getModel();if(!p)return;const m=f.position.column===1&&f.position.lineNumber===1;this.chatCursorAtTop.set(m),this.onHistoryEntry&&(this.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(jze(p))))})),this.toolbar=this._register(this.instantiationService.createInstance(nC,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:wS.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===lc.Panel&&(f.id===OEe.ID||f.id===WEe.ID)&&f instanceof id){const m=this.instantiationService.createInstance(id,{id:"chat.moreExecuteActions",title:g(ND,3,"More..."),icon:Ce.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(HEe,f,m)}}})),this.toolbar.getElement().classList.add("interactive-execute-toolbar"),this.toolbar.context={widget:i},this._register(this.toolbar.onDidChangeMenuItems(()=>{this.cachedDimensions&&typeof this.cachedToolbarWidth=="number"&&this.cachedToolbarWidth!==this.toolbar.getItemsWidth()&&this.layout(this.cachedDimensions.height,this.cachedDimensions.width)})),this.options.menus.inputSideToolbar){const f=this._register(this.instantiationService.createInstance(nC,s,this.options.menus.inputSideToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0}}));this.inputSideToolbarContainer=f.getElement(),f.getElement().classList.add("chat-side-toolbar"),f.context={widget:i}}let u=this.modelService.getModel(this.inputUri);if(u||(u=this.modelService.createModel("",null,this.inputUri,!0),this._register(u)),this.inputModel=u,this.inputModel.updateOptions({bracketColorizationOptions:{enabled:!1,independentColorPoolPerBracketType:!1}}),this._inputEditor.setModel(this.inputModel),t){this.inputModel.setValue(t);const f=this.inputModel.getLineCount();this._inputEditor.setPosition({lineNumber:f,column:this.inputModel.getLineMaxColumn(f)})}}initAttachedContext(e){Yo(e),this.attachedContextDisposables.clear(),_je(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((t,i)=>{const s=he(e,LL(".chat-attached-context-attachment.show-file-icons")),o=this._contextResourceLabels.create(s,{supportIcons:!0}),r=P.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&P.isUri(t.value.uri)?t.value.uri:void 0,a=t.value&&typeof t.value=="object"&&"range"in t.value&&O.isIRange(t.value.range)?t.value.range:void 0;if(r&&t.isFile){const d=yr(r.path),h=lS(r.path),u=`${d} ${h}`,f=a?g(ND,4,"Attached file, {0}, line {1} to line {2}",u,a.startLineNumber,a.endLineNumber):g(ND,5,"Attached file, {0}",u);o.setFile(r,{fileKind:Lc.FILE,hidePath:!0,range:a}),s.ariaLabel=f,s.tabIndex=0}else{const d=t.fullName??t.name;o.setLabel(d,void 0),s.ariaLabel=g(ND,6,"Attached context, {0}",t.name),s.tabIndex=0}const c=new Tu(s,{supportIcons:!0});i===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&c.focus(),this.attachedContextDisposables.add(c),c.icon=Ce.close;const l=c.onDidClick(d=>{if(this.attachedContext.delete(t),l.dispose(),Sv(d)){const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=i)}this._onDidChangeHeight.fire(),this._onDidDeleteContext.fire(t)});this.attachedContextDisposables.add(l)})}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Yo(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance($ie,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))))}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new Tn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const s=this.getLayoutData(),o=Math.min(s.inputPartEditorHeight,e-s.followupsHeight-s.inputPartVerticalPadding);this._inputPartHeight=s.followupsHeight+o+s.inputPartVerticalPadding+s.inputEditorBorder+s.implicitContextHeight;const r=this._inputEditor.getScrollWidth(),c={width:t-s.inputPartHorizontalPadding-s.editorBorder-s.editorPadding-s.executeToolbarWidth-s.sideToolbarWidth-s.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==c.width||this.previousInputEditorDimension.height!==c.height)&&(this._inputEditor.layout(c),this.previousInputEditorDimension=c),i&&r<10)return this._layout(e,t,!1)}getLayoutData(){return{inputEditorBorder:2,followupsHeight:this.followupsContainer.offsetHeight,inputPartEditorHeight:Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight),inputPartHorizontalPadding:this.options.renderStyle==="compact"?8:40,inputPartVerticalPadding:this.options.renderStyle==="compact"?12:24,implicitContextHeight:this.attachedContextContainer.offsetHeight,editorBorder:2,editorPadding:12,toolbarPadding:4,executeToolbarWidth:this.cachedToolbarWidth=this.toolbar.getItemsWidth(),sideToolbarWidth:this.inputSideToolbarContainer?du(this.inputSideToolbarContainer)+4:0}}saveState(){const e=this.history.getHistory();this.historyService.saveHistory(this.location,e)}},QJ=I0,I0.INPUT_SCHEME="chatSessionInput",I0._counter=0,I0);b6=QJ=D([_(2,WZe),_(3,Ai),_(4,be),_(5,Pe),_(6,Re),_(7,ti),_(8,Ur)],b6);function jze(n){return{lineNumber:n.getLineCount(),column:n.getLineLength(n.getLineCount())+1}}let HEe=class extends PEe{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,[],"",s,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(Te.ChatExecuteSecondary,r),u=()=>{const f=[];tD(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===BEe.ID&&(m.label=g(ND,7,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};HEe=D([_(2,_c),_(3,Vr),_(4,yp),_(5,Pe),_(6,ti),_(7,Pi),_(8,pn),_(9,Ur)],HEe);var l5t='.monaco-action-bar .action-item .action-label.extension-action{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-action-bar .action-dropdown-item>.action-label.extension-action.label,.monaco-action-bar .action-item>.action-label.extension-action.label{padding:0 5px}.monaco-action-bar .action-dropdown-item>.monaco-dropdown .action-label{padding:0}.monaco-action-bar .action-item .action-label.extension-action.label{outline-offset:1px}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.text{height:auto;line-height:14px;width:auto}.monaco-action-bar .action-item .action-label.extension-action.built-in-status{border-color:var(--vscode-foreground)}.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{background-color:var(--vscode-extensionButton-background)!important}.monaco-action-bar .action-item .action-label.extension-action.label{color:var(--vscode-extensionButton-foreground)!important}.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label:hover{background-color:var(--vscode-extensionButton-hoverBackground)!important}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{background-color:var(--vscode-extensionButton-separator)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator.prominent{background-color:var(--vscode-extensionButton-prominentBackground)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent{color:var(--vscode-extensionButton-prominentForeground)!important}.monaco-action-bar .action-item.action-item:not(.disabled) .action-label.extension-action.label.prominent:hover{background-color:var(--vscode-extensionButton-prominentHoverBackground)}.monaco-action-bar .action-item .action-label.extension-action:not(.disabled){border:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{border-bottom:1px solid var(--vscode-contrastBorder);border-top:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-error{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info{color:var(--vscode-editorInfo-foreground)}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.icon,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.text{margin-top:2px}.monaco-action-bar .action-item .action-label.extension-action.manage.hide,.monaco-action-bar .action-item.action-dropdown-item .action-label.extension-action.hide,.monaco-action-bar .action-item.action-dropdown-item.disabled,.monaco-action-bar .action-item.checkbox-action-item.disabled,.monaco-action-bar .action-item.disabled .action-label.disable-status.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.extension-sync,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide-when-disabled,.monaco-action-bar .action-item.disabled .action-label.extension-action.ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.install:not(.installing),.monaco-action-bar .action-item.disabled .action-label.extension-action.language,.monaco-action-bar .action-item.disabled .action-label.extension-action.migrate,.monaco-action-bar .action-item.disabled .action-label.extension-action.reload,.monaco-action-bar .action-item.disabled .action-label.extension-action.theme,.monaco-action-bar .action-item.disabled .action-label.extension-action.undo-ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.uninstall:not(.uninstalling),.monaco-action-bar .action-item.disabled .action-label.extension-action.update,.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide,.monaco-action-bar .action-item.disabled .action-label.extension-status.hide{display:none}.monaco-action-bar .extension-action.label{display:inherit}.monaco-action-bar .action-item.disabled .action-label.extension-status:before{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-status-label:before{content:"\\2713";padding-right:4px}.monaco-action-bar .action-item.disabled .action-label.extension-action{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-action.text{font-style:italic;opacity:.9}';Ct(l5t,{});const k5="vs/workbench/contrib/extensions/common/extensionsFileTemplate",d5t="vscode://schemas/extensions";g(k5,0,"Extensions"),g(k5,1,"List of extensions which should be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(k5,3,"List of extensions recommended by VS Code that should not be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const Kze=["{"," // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations."," // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp",""," // List of extensions which should be recommended for users of this workspace.",' "recommendations": ['," "," ],"," // List of extensions recommended by VS Code that should not be recommended for users of this workspace.",' "unwantedRecommendations": ['," "," ]","}"].join(` -`),h5t="vs/workbench/services/extensionManagement/common/extensionManagement";var Yze;(function(n){n[n.Local=1]="Local",n[n.Remote=2]="Remote",n[n.Web=3]="Web"})(Yze||(Yze={}));g(h5t,0,"Extensions");var ga;(function(n){n[n.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",n[n.DisabledByExtensionKind=1]="DisabledByExtensionKind",n[n.DisabledByEnvironment=2]="DisabledByEnvironment",n[n.EnabledByEnvironment=3]="EnabledByEnvironment",n[n.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",n[n.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",n[n.DisabledGlobally=6]="DisabledGlobally",n[n.DisabledWorkspace=7]="DisabledWorkspace",n[n.EnabledGlobally=8]="EnabledGlobally",n[n.EnabledWorkspace=9]="EnabledWorkspace"})(ga||(ga={}));var UEe;(function(n){n[n.Workspace=0]="Workspace",n[n.File=1]="File",n[n.Executable=2]="Executable",n[n.WorkspaceConfig=3]="WorkspaceConfig",n[n.DynamicWorkspace=4]="DynamicWorkspace",n[n.Experimental=5]="Experimental",n[n.Application=6]="Application"})(UEe||(UEe={}));const Gie="vs/workbench/browser/actions/workspaceCommands",u5t="addRootFolder";Be(Gie,0,"Add Folder to Workspace...");const g5t="setRootFolder",nst="_workbench.pickWorkspaceFolder";yt.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:n=>n.get(bf).pickFileFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"_files.pickFolderAndOpen",handler:(n,e)=>n.get(bf).pickFolderAndOpen(e)});yt.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:n=>n.get(bf).pickFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:n=>n.get(bf).pickFileAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:n=>n.get(bf).pickWorkspaceAndOpen({forceNewWindow:!0})});yt.registerCommand({id:u5t,handler:async n=>{const e=n.get($S),t=await sst(n);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});yt.registerCommand({id:g5t,handler:async n=>{const e=n.get($S),t=n.get(Ti),i=await sst(n);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(s=>({uri:s})))}});async function sst(n){const e=n.get(bf),t=n.get(Tm);return await e.showOpenDialog({openLabel:JPe(g(Gie,1,"&&Add")),title:g(Gie,2,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}yt.registerCommand(nst,async function(n,e){const t=n.get(On),i=n.get(eo),s=n.get(Ti),o=n.get(Ai),r=n.get(Di),a=s.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(ma(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:lI(o,r,u.uri,Lc.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(Gie,3,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||qe.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});yt.registerCommand({id:"vscode.openFolder",handler:(n,e,t)=>{const i=n.get(ji);if(typeof t=="boolean"&&(t={forceNewWindow:t}),!e){const a={forceNewWindow:t?.forceNewWindow};return t?.forceLocalWindow&&(a.remoteAuthority=null,a.availableFileSystems=["file"]),i.executeCommand("_files.pickFolderAndOpen",a)}const s=P.from(e,!0),o={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},r=yde(s)||s.scheme===_e.untitled?{workspaceUri:s}:{folderUri:s};return i.executeCommand("_files.windowOpen",[r],o)},metadata:{description:"Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.",args:[{name:"uri",description:"(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder",constraint:n=>n==null||n instanceof P},{name:"options",description:"(optional) Options. Object with the following properties: `forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. `noRecentEntry`: Whether the opened URI will appear in the 'Open Recent' list. Defaults to false. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.",constraint:n=>n===void 0||typeof n=="object"||typeof n=="boolean"}]}});yt.registerCommand({id:"vscode.newWindow",handler:(n,e)=>{const t=n.get(ji),i={forceReuseWindow:e&&e.reuseWindow,remoteAuthority:e&&e.remoteAuthority};return t.executeCommand("_files.newWindow",i)},metadata:{description:"Opens an new window depending on the newWindow argument.",args:[{name:"options",description:"(optional) Options. Object with the following properties: `reuseWindow`: Whether to open a new window or the same. Defaults to opening in a new window. ",constraint:n=>n===void 0||typeof n=="object"}]}});yt.registerCommand("_workbench.removeFromRecentlyOpened",function(n,e){return n.get(cL).removeRecentlyOpened([e])});yt.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(n,e)=>{const t=n.get(cL);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?P.parse(e):P.file(e):e=P.revive(e),t.removeRecentlyOpened([e])},metadata:{description:"Removes an entry with the given path from the recently opened list.",args:[{name:"path",description:"URI or URI string to remove from recently opened.",constraint:n=>typeof n=="string"||n instanceof P}]}});yt.registerCommand("_workbench.addToRecentlyOpened",async function(n,e){const t=n.get(cL),i=e.uri,s=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:s,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:s,remoteAuthority:o}:r={fileUri:i,label:s,remoteAuthority:o},t.addRecentlyOpened([r])});yt.registerCommand("_workbench.getRecentlyOpened",async function(n){return n.get(cL).getRecentlyOpened()});const ZQ=pn,tB="vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig",p2=".vscode/extensions.json";let Jze=class extends ${constructor(e,t,i,s,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=s,this.languageService=o,this.jsonEditingService=r,this._onDidChangeExtensionsConfigs=this._register(new I),this.onDidChangeExtensionsConfigs=this._onDidChangeExtensionsConfigs.event,this._register(e.onDidChangeWorkspaceFolders(a=>this._onDidChangeExtensionsConfigs.fire())),this._register(t.onDidFilesChange(a=>{const c=e.getWorkspace();(c.configuration&&a.affects(c.configuration)||c.folders.some(l=>a.affects(l.toResource(p2))))&&this._onDidChangeExtensionsConfigs.fire()}))}async getExtensionsConfigs(){const e=this.workspaceContextService.getWorkspace(),t=[],i=e.configuration?await this.resolveWorkspaceExtensionConfig(e.configuration):void 0;return i&&t.push(i),t.push(...await Promise.all(e.folders.map(s=>this.resolveWorkspaceFolderExtensionConfig(s)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return Tc(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return Tc(e.flatMap(t=>t.unwantedRecommendations?t.unwantedRecommendations.map(i=>i.toLowerCase()):[]))}async toggleRecommendation(e){e=e.toLowerCase();const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>s.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)lbe(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,s.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>s.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)lbe(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,s.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,s){const o=[];if(s){Array.isArray(i.recommendations)?o.push({path:["recommendations",-1],value:e}):o.push({path:["recommendations"],value:[e]});const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","recommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&o.push(a)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,s){const o=[];if(s){const r=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const s=t?[...e,t]:[...e];if(s.length===1)return s;const o=e.map(a=>({label:a.name,description:g(tB,2,"Workspace Folder"),workspaceOrFolder:a,iconClasses:lI(this.modelService,this.languageService,a.uri,Lc.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(tB,3,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(o,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=ow(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(p2)),i=ow(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:Tc((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:Tc((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const s=t?.indexOf(i);if(s!==void 0&&s!==-1)return{path:[...e,s],value:void 0}}};Jze=D([_(0,Ti),_(1,ci),_(2,On),_(3,Ai),_(4,Di),_(5,dL)],Jze);const hl="vs/workbench/contrib/extensions/browser/extensionsIcons";Ki("extensions-view-icon",Ce.extensions,g(hl,0,"View icon of the extensions view."));const f5t=Ki("extensions-manage",Ce.gear,g(hl,1,"Icon for the 'Manage' action in the extensions view."));Ki("extensions-clear-search-results",Ce.clearAll,g(hl,2,"Icon for the 'Clear Search Result' action in the extensions view."));Ki("extensions-refresh",Ce.refresh,g(hl,3,"Icon for the 'Refresh' action in the extensions view."));Ki("extensions-filter",Ce.filter,g(hl,4,"Icon for the 'Filter' action in the extensions view."));Ki("extensions-install-local-in-remote",Ce.cloudDownload,g(hl,5,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));Ki("extensions-install-workspace-recommended",Ce.cloudDownload,g(hl,6,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));Ki("extensions-configure-recommended",Ce.pencil,g(hl,7,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const p5t=Ki("extensions-sync-enabled",Ce.sync,g(hl,8,"Icon to indicate that an extension is synced.")),m5t=Ki("extensions-sync-ignored",Ce.syncIgnored,g(hl,9,"Icon to indicate that an extension is ignored when syncing."));Ki("extensions-remote",Ce.remote,g(hl,10,"Icon to indicate that an extension is remote in the extensions view and editor."));Ki("extensions-install-count",Ce.cloudDownload,g(hl,11,"Icon shown along with the install count in the extensions view and editor."));Ki("extensions-rating",Ce.star,g(hl,12,"Icon shown along with the rating in the extensions view and editor."));const _5t=Ki("extensions-verified-publisher",Ce.verifiedFilled,g(hl,13,"Icon used for the verified extension publisher in the extensions view and editor."));Ki("extensions-pre-release",Ce.versions,g(hl,14,"Icon shown for extensions having pre-release versions in extensions view and editor."));Ki("extensions-sponsor",Ce.heartFilled,g(hl,15,"Icon used for sponsoring extensions in the extensions view and editor."));Ki("extensions-star-full",Ce.starFull,g(hl,16,"Full star icon used for the rating in the extensions editor."));Ki("extensions-star-half",Ce.starHalf,g(hl,17,"Half star icon used for the rating in the extensions editor."));Ki("extensions-star-empty",Ce.starEmpty,g(hl,18,"Empty star icon used for the rating in the extensions editor."));const DR=Ki("extensions-error-message",Ce.error,g(hl,19,"Icon shown with a error message in the extensions editor.")),Of=Ki("extensions-warning-message",Ce.warning,g(hl,20,"Icon shown with a warning message in the extensions editor.")),ay=Ki("extensions-info-message",Ce.info,g(hl,21,"Icon shown with an info message in the extensions editor.")),I5=Ki("extension-workspace-trust",Ce.shield,g(hl,22,"Icon shown with a workspace trust message in the extension editor."));Ki("extension-activation-time",Ce.history,g(hl,23,"Icon shown with a activation time message in the extension editor."));function VEe(n){return n.scheme!==_e.file&&n.scheme!==_e.vscodeRemote}function KFe(n){if(n.folders.length)return n.folders.every(e=>VEe(e.uri))?n.folders[0].uri:void 0;if(n.configuration&&VEe(n.configuration))return n.configuration}function v5t(n){return KFe(n)?.scheme}function ost(n){return KFe(n)!==void 0}const w5t="vs/platform/languagePacks/common/languagePacks";function Phe(n){return n.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let Xze=class extends ${constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ai;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const s=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=Phe(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return s.push(this.createQuickPickItem("en","English")),s}createQuickPickItem(e,t,i){const s=t??e;let o;if(s!==e&&(o=`(${e})`),e.toLowerCase()===Gd.toLowerCase()&&(o??="",o+=g(w5t,0," (Current)")),i?.installCount){o??="";const r=i.installCount;let a;r>1e6?a=`${Math.floor(r/1e5)/10}M`:r>1e3?a=`${Math.floor(r/1e3)}K`:a=String(r),o+=` $(cloud-download) ${a}`}return{id:e,label:s,description:o}}};Xze=D([_(0,aL)],Xze);var zEe,tT,vA,PD,jJ,AB,iT,FD,KJ,YJ,JJ,XJ,ZJ,EB,OD,BD,WD,HD,UD,eX,tX,iX,nX,xB,DB,VD,sX,oX;const Me="vs/workbench/contrib/extensions/browser/extensionsActions";let $V=class extends xn{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=s,this.productService=o,this.openerService=r,this.notificationService=a,this.dialogService=c,this.commandService=l,this.logService=d,this.extensionManagementServerService=h,this.instantiationService=u,this.galleryService=f,this.extensionManifestPropertiesService=p}async run(){if(Na(this.error))return;if(this.logService.error(this.error),this.error.name===EA.Unsupported){const r=Jn?g(Me,0,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(Me,1,"The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",this.extension.displayName||this.extension.identifier.id,r),{confirmed:c}=await this.dialogService.confirm({type:nt.Info,message:a,primaryButton:g(Me,2,"&&More Information"),cancelButton:g(Me,3,"Close")});c&&this.openerService.open(Jn?P.parse("https://aka.ms/vscode-web-extensions-guide"):P.parse("https://aka.ms/vscode-remote"));return}if(EA.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:lg(this.error),buttons:[{label:g(Me,4,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(GV,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}if([EA.Incompatible,EA.IncompatibleTargetPlatform,EA.Malicious,EA.Deprecated].includes(this.error.name)){await this.dialogService.info(lg(this.error));return}if(EA.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(Me,6,"{0} cannot verify the '{1}' extension. Are you sure you want to install it?",this.productService.nameLong,this.extension.displayName||this.extension.identifier.id),buttons:[{label:g(Me,7,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(GV,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}const e=this.installOperation===Bx.Update?g(Me,8,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(Me,9,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],s=await this.getDownloadUrl();s&&(t=g(Me,10,"Please check the [log]({0}) for more details.",`command:${MBt}`),i.push({label:g(Me,11,"Try Downloading Manually..."),run:()=>this.openerService.open(s).then(()=>{this.notificationService.prompt(nt.Info,g(Me,12,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(Me,13,"Install from VSIX..."),run:()=>this.commandService.executeCommand(gBt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(nt.Error,o,i)}async getDownloadUrl(){if(I_||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Hs.UNIVERSAL&&e!==Hs.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,qe.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Hs.UNKNOWN)return P.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Hs.UNDEFINED?`?targetPlatform=${e}`:""}`)}};$V=D([_(4,Xa),_(5,fr),_(6,Pi),_(7,To),_(8,ji),_(9,Ze),_(10,Mw),_(11,be),_(12,aL),_(13,G_)],$V);const WA=class WA extends xn{constructor(){super(...arguments),this._extension=null}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}};WA.EXTENSION_ACTION_CLASS="extension-action",WA.TEXT_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} text`,WA.LABEL_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} label`,WA.ICON_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} icon`;let kn=WA;class YFe extends kn{get menuActions(){return[...this._menuActions]}get extension(){return super.extension}set extension(e){this.extensionActions.forEach(t=>t.extension=e),super.extension=e}constructor(e,t,i){super(e,t),this.actionsGroups=i,this._menuActions=[],this.extensionActions=i.flat(),this.update(),this._register(T.any(...this.extensionActions.map(s=>s.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(s=>this._register(s))}update(e){e||this.extensionActions.forEach(o=>o.update());const t=this.actionsGroups.map(o=>o.filter(r=>r.enabled));let i=[];for(const o of t)o.length&&(i=[...i,...o,new Kr]);i=i.length?i.slice(0,i.length-1):i,this.action=i[0],this._menuActions=i.length>1?i:[],this.enabled=!!this.action,this.action&&(this.label=this.getLabel(this.action),this.tooltip=this.action.tooltip);let s=(this.action||this.extensionActions[0])?.class||"";s=s?`${s} action-dropdown`:"action-dropdown",this._menuActions.length===0&&(s+=" action-dropdown"),this.class=s}run(){return this.extensionActions.filter(t=>t.enabled)[0].run()}getLabel(e){return e.label}}var eP;let GV=(eP=class extends kn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,s,o,r,a,c,l,d){super("extensions.install",g(Me,14,"Install"),zEe.Class,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=s,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new tQ,this.options={...e,isMachineScoped:!1},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Fr.Uninstalled&&await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=this.options.installPreReleaseVersion?this.extension.hasPreReleaseVersion:this.extension.hasReleaseVersion,this.updateLabel()))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(Me,15,"This extension is deprecated as it is no longer being maintained."),i;(function(r){r[r.InstallAnyway=0]="InstallAnyway",r[r.ShowAlternateExtension=1]="ShowAlternateExtension",r[r.ConfigureSettings=2]="ConfigureSettings",r[r.Cancel=3]="Cancel"})(i||(i={}));const s=[{label:g(Me,7,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(Me,16,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;s.push({label:g(Me,17,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],qe.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(Me,18,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;s.push({label:g(Me,19,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Xt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:nt.Warning,message:g(Me,20,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:$t(t)?t:void 0,custom:$t(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:s,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.telemetryService.publicLog("extensions:action:install",{...this.extension.telemetryData,actionId:this.id});const e=await this.install(this.extension);if(e?.local){sa(g(Me,22,"Installing extension {0} is completed.",this.extension.displayName));const t=await this.getRunningExtension(e.local);if(t&&!(t.activationEvents&&t.activationEvents.some(i=>i.startsWith("onLanguage")))){const i=await this.getThemeAction(e);if(i){i.extension=e;try{return i.run({showCurrentTheme:!0,ignoreFocusLost:!0})}finally{i.dispose()}}}}}async getThemeAction(e){if((await this.workbenchThemeService.getColorThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(XEe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(ZEe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(exe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(ME(e))?new Promise((i,s)=>{const o=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const r=await this.runtimeExtensionService.getExtension(e.identifier.id);r&&(o.dispose(),i(r))})}):null)}updateLabel(){this.label=this.getLabel()}getLabel(e){return this.extension?.isWorkspaceScoped&&this.extension.resourceExtension&&this.contextService.isInsideWorkspace(this.extension.resourceExtension.location)?g(Me,23,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(Me,24,"Install Pre-Release"):g(Me,25,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(Me,14,"Install"):g(Me,26,"Install Release Version"):g(Me,14,"Install")}},zEe=eP,eP.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,eP);GV=zEe=D([_(1,pr),_(2,be),_(3,ho),_(4,ZQ),_(5,eo),_(6,To),_(7,TQ),_(8,rn),_(9,Ti)],GV);let Zze=class extends YFe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions","",[[e.createInstance(GV,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(GV,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};Zze=D([_(0,be),_(1,pr)],Zze);const iR=class iR extends kn{constructor(){super("extension.installing",iR.LABEL,iR.CLASS,!1)}update(){this.class=`${iR.CLASS}${this.extension&&this.extension.state===Fr.Installing?"":" hide"}`}};iR.LABEL=g(Me,27,"Installing"),iR.CLASS=`${kn.LABEL_ACTION_CLASS} install installing`;let e5e=iR;var By;let qV=(By=class extends kn{constructor(e,t,i,s,o,r){super(e,tT.INSTALL_LABEL,tT.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=s,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=tT.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>gc(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Fr.Installing&&!e.local&&(this.enabled=!0,this.label=tT.INSTALLING_LABEL,this.class=tT.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Fr.Installed||this.extension.type!==qr.User||this.extension.enablementState===ga.DisabledByEnvironment||this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByVirtualWorkspace?!1:!!(uPe(this.extension.local.manifest)||this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)||this.server===this.extensionManagementServerService.webExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)||this.canInstallAnyWhere&&(this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)))}async run(){if(this.extension?.local&&this.extension?.server&&this.server)return this.extensionsWorkbenchService.open(this.extension),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.extensionsWorkbenchService.installInServer(this.extension,this.server)}},tT=By,By.INSTALL_LABEL=g(Me,14,"Install"),By.INSTALLING_LABEL=g(Me,27,"Installing"),By.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,By.InstallingClass=`${kn.LABEL_ACTION_CLASS} install installing`,By);qV=tT=D([_(3,pr),_(4,Mw),_(5,G_)],qV);let $Ee=class extends qV{constructor(e,t,i,s){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,s)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,28,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):qV.INSTALL_LABEL}};$Ee=D([_(1,pr),_(2,Mw),_(3,G_)],$Ee);let t5e=class extends qV{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,29,"Install Locally")}};t5e=D([_(0,pr),_(1,Mw),_(2,G_)],t5e);let i5e=class extends qV{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,30,"Install in Browser")}};i5e=D([_(0,pr),_(1,Mw),_(2,G_)],i5e);var Wy;let GEe=(Wy=class extends kn{constructor(e,t){super("extensions.uninstall",vA.UninstallLabel,vA.UninstallClass,!1),this.extensionsWorkbenchService=e,this.dialogService=t,this.update()}update(){if(!this.extension){this.enabled=!1;return}const e=this.extension.state;if(e===Fr.Uninstalling){this.label=vA.UninstallingLabel,this.class=vA.UnInstallingClass,this.enabled=!1;return}if(this.label=vA.UninstallLabel,this.class=vA.UninstallClass,this.tooltip=vA.UninstallLabel,e!==Fr.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){sa(g(Me,33,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),sa(g(Me,34,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){this.dialogService.error(lg(e))}}}},vA=Wy,Wy.UninstallLabel=g(Me,31,"Uninstall"),Wy.UninstallingLabel=g(Me,32,"Uninstalling"),Wy.UninstallClass=`${kn.LABEL_ACTION_CLASS} uninstall`,Wy.UnInstallingClass=`${kn.LABEL_ACTION_CLASS} uninstall uninstalling`,Wy);GEe=vA=D([_(0,pr),_(1,To)],GEe);const pk=class pk extends kn{constructor(e,t,i){super(e,t,pk.DisabledClass,!1),this.extensionsWorkbenchService=i,this.updateThrottler=new tQ,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=QEe.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Fr.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?pk.EnabledClass:pk.DisabledClass}};pk.EnabledClass=`${kn.LABEL_ACTION_CLASS} prominent update`,pk.DisabledClass=`${pk.EnabledClass} disabled`;let qEe=pk,QEe=class extends qEe{constructor(e,t,i){super("extensions.update",g(Me,35,"Update"),t),this.verbose=e,this.instantiationService=i}update(){super.update(),this.extension&&(this.label=this.verbose?g(Me,36,"Update to v{0}",this.extension.latestVersion):g(Me,35,"Update"))}async run(){if(this.extension)return sa(g(Me,37,"Updating extension {0} to version {1} started.",this.extension.displayName,this.extension.latestVersion)),this.install(this.extension)}async install(e){try{await this.extensionsWorkbenchService.install(e,e.local?.preRelease?{installPreReleaseVersion:!0}:void 0),sa(g(Me,38,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Update,t).run()}}};QEe=D([_(1,pr),_(2,be)],QEe);var Hy;let jEe=(Hy=class extends kn{constructor(e,t,i,s){super(PD.ID,PD.LABEL.value,PD.DisabledClass),this.enableWhenOutdated=e,this.enableWhenAutoUpdateValue=t,this.extensionsWorkbenchService=i,this._register(s.onDidChangeConfiguration(o=>{o.affectsConfiguration(hBt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=PD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.enableWhenOutdated&&(this.extension.state!==Fr.Installed||!this.extension.outdated)||this.enableWhenAutoUpdateValue.includes(this.extensionsWorkbenchService.getAutoUpdateValue())&&(this.enabled=!0,this.class=PD.EnabledClass,this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)))}async run(){if(!this.extension)return;const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},PD=Hy,Hy.ID="workbench.extensions.action.toggleAutoUpdateForExtension",Hy.LABEL=Be(Me,39,"Auto Update"),Hy.EnabledClass=`${kn.EXTENSION_ACTION_CLASS} auto-update`,Hy.DisabledClass=`${PD.EnabledClass} hide`,Hy);jEe=PD=D([_(2,pr),_(3,Re)],jEe);var L0;let KEe=(L0=class extends kn{constructor(e){super(jJ.ID,jJ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;sa(g(Me,43,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},jJ=L0,L0.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",L0.LABEL=g(Me,42,"Auto Update All (From Publisher)"),L0);KEe=jJ=D([_(0,pr)],KEe);var T0;let n5e=(T0=class extends kn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(Me,44,"Migrate"),AB.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=AB.DisabledClass,!this.extension?.local||this.extension.state!==Fr.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>gc(t.identifier,{id:e}))||(this.enabled=!0,this.class=AB.EnabledClass,this.tooltip=g(Me,45,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(Me,46,"Migrate"):this.tooltip)}async run(){if(!this.extension?.deprecationInfo?.extension)return;const e=this.extension.local;await this.extensionsWorkbenchService.uninstall(this.extension);const[t]=await this.extensionsWorkbenchService.getExtensions([{id:this.extension.deprecationInfo.extension.id,preRelease:this.extension.deprecationInfo?.extension?.preRelease}],qe.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},AB=T0,T0.EnabledClass=`${kn.LABEL_ACTION_CLASS} migrate`,T0.DisabledClass=`${AB.EnabledClass} disabled`,T0);n5e=AB=D([_(1,pr)],n5e);let qie=class extends kn{constructor(e,t,i,s,o){super(e,t,i,s),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(YEe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};qie=D([_(4,be)],qie);let YEe=class extends WS{constructor(e,t,i){super(null,e,{...t,icon:!0,label:!0}),this.contextMenuService=i}showMenu(e,t){if(this.element){const i=this.getActions(e),s=ia(this.element),o={x:s.left,y:s.top+s.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&clt(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Kr];return t.length?t.slice(0,t.length-1):t}};YEe=D([_(2,Vr)],YEe);async function b5t(n,e,t){return t.invokeFunction(async i=>{const s=i.get(pr),o=i.get(_c),r=i.get(bet),a=i.get(ihe),c=i.get(ZQ),l=[];if(n){l.push(["extension",n.identifier.id]),l.push(["isBuiltinExtension",n.isBuiltin]),l.push(["isDefaultApplicationScopedExtension",n.local&&sLt(n.local.manifest)]),l.push(["isApplicationScopedExtension",n.local&&n.local.isApplicationScoped]),l.push(["isWorkspaceScopedExtension",n.isWorkspaceScoped]),n.local&&l.push(["extensionSource",n.local.source]),l.push(["extensionHasConfiguration",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.configuration]),l.push(["extensionHasKeybindings",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.keybindings]),l.push(["extensionHasCommands",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes?.commands]),l.push(["isExtensionRecommended",!!r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]]),l.push(["isExtensionWorkspaceRecommended",r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]?.reasonId===UEe.Workspace]),l.push(["isUserIgnoredRecommendation",a.globalIgnoredRecommendations.some(m=>m===n.identifier.id.toLowerCase())]),n.state===Fr.Installed&&l.push(["extensionStatus","installed"]),l.push(["installedExtensionIsPreReleaseVersion",!!n.local?.isPreReleaseVersion]),l.push(["installedExtensionIsOptedToPreRelease",!!n.local?.preRelease]),l.push(["galleryExtensionIsPreReleaseVersion",!!n.gallery?.properties.isPreReleaseVersion]),l.push(["galleryExtensionHasPreReleaseVersion",n.gallery?.hasPreReleaseVersion]),l.push(["extensionHasReleaseVersion",n.hasReleaseVersion]);const[u,f,p]=await Promise.all([c.getColorThemes(),c.getFileIconThemes(),c.getProductIconThemes()]);l.push(["extensionHasColorThemes",u.some(m=>SS(m,n))]),l.push(["extensionHasFileIconThemes",f.some(m=>SS(m,n))]),l.push(["extensionHasProductIconThemes",p.some(m=>SS(m,n))]),l.push(["canSetLanguage",s.canSetLanguage(n)]),l.push(["isActiveLanguagePackExtension",n.gallery&&Gd===Phe(n.gallery)])}const d=o.createMenu(Te.ExtensionContext,e.createOverlay(l)),h=d.getActions({shouldForwardArgs:!0});return d.dispose(),h})}function KK(n,e){const t=[];for(const[,i]of n)t.push(i.map(s=>s instanceof u1?s:e.createInstance(JEe,s)));return t}var JE;let s5e=(JE=class extends qie{constructor(e,t,i){super(iT.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(Me,47,"Manage"),this.update()}async getActionGroups(){const e=[],t=await b5t(this.extension,this.contextKeyService,this.instantiationService),i=[],s=[],o=[],r=[];for(const[a,c]of t)a===pBt?s.push(...KK([[a,c]],this.instantiationService)[0]):a===mBt?o.push(...KK([[a,c]],this.instantiationService)[0]):a===fBt?i.push(...KK([[a,c]],this.instantiationService)[0]):r.push(...KK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(jie),this.instantiationService.createInstance(Qie)]),e.push([this.instantiationService.createInstance(Yie),this.instantiationService.createInstance(Kie)]),o.length&&e.push(o),e.push([...s.length?s:[],this.instantiationService.createInstance(C6),this.instantiationService.createInstance(GEe)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof kn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=iT.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Fr.Installed,this.class=this.enabled||e===Fr.Uninstalling?iT.Class:iT.HideManageExtensionClass}}},iT=JE,JE.ID="extensions.manage",JE.Class=`${kn.ICON_ACTION_CLASS} manage `+$e.asClassName(f5t),JE.HideManageExtensionClass=`${iT.Class} hide`,JE);s5e=iT=D([_(0,be),_(1,ho),_(2,Pe)],s5e);let JEe=class extends kn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}update(){this.extension&&(this.action.id===uBt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===jEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===KEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?_F(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?_F(this.extension.gallery.publisher,this.extension.gallery.name):this.extension.identifier.id,t={id:this.extension.identifier.id,version:this.extension.version,location:this.extension.local?.location};await this.action.run(e,t)}}};JEe=D([_(1,pr)],JEe);var Uy;let o5e=(Uy=class extends kn{constructor(e){super(FD.ID,FD.LABEL,FD.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=FD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Fr.Installed&&this.extension.hasPreReleaseVersion&&this.extension.gallery&&(this.extension.preRelease&&!this.extension.isPreReleaseVersion||!this.extension.preRelease&&!this.extension.gallery.hasPreReleaseVersion||(this.enabled=!0,this.class=FD.EnabledClass,this.extension.preRelease?(this.label=g(Me,49,"Switch to Release Version"),this.tooltip=g(Me,50,"This will switch and enable updates to release versions")):(this.label=g(Me,51,"Switch to Pre-Release Version"),this.tooltip=g(Me,52,"This will switch to pre-release version and enable updates to latest version always")))))}async run(){this.extension&&(this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:!this.extension.preRelease}),await this.extensionsWorkbenchService.togglePreRelease(this.extension))}},FD=Uy,Uy.ID="workbench.extensions.action.togglePreRlease",Uy.LABEL=g(Me,48,"Pre-Release"),Uy.EnabledClass=`${kn.LABEL_ACTION_CLASS} pre-release`,Uy.DisabledClass=`${FD.EnabledClass} hide`,Uy);o5e=FD=D([_(0,pr)],o5e);var R0;let C6=(R0=class extends kn{constructor(e,t,i,s,o){super(KJ.ID,KJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionGalleryService=t,this.quickInputService=i,this.instantiationService=s,this.dialogService=o,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.gallery&&!!this.extension.local&&!!this.extension.server&&this.extension.state===Fr.Installed&&!this.extension.deprecationInfo}async run(){if(!this.enabled)return;const e=await this.extension.server.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.gallery,this.extension.local.preRelease,e);if(!t.length){await this.dialogService.info(g(Me,54,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${HFe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(Me,55,"pre-release")})`:""}${o.version===this.extension.version?` (${g(Me,56,"current")})`:""}`,latest:r===0,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),s=await this.quickInputService.pick(i,{placeHolder:g(Me,57,"Select Version to Install"),matchOnDetail:!0});if(s){if(this.extension.version===s.id)return;try{if(s.latest){const[o]=s.id!==this.extension?.version?await this.extensionsWorkbenchService.getExtensions([{id:this.extension.identifier.id,preRelease:s.isPreReleaseVersion}],qe.None):[this.extension];await this.extensionsWorkbenchService.install(o??this.extension,{installPreReleaseVersion:s.isPreReleaseVersion})}else await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:s.isPreReleaseVersion,version:s.id})}catch(o){this.instantiationService.createInstance($V,this.extension,s.latest?this.extension.latestVersion:s.id,Bx.Install,o).run()}}return null}},KJ=R0,R0.ID="workbench.extensions.action.install.anotherVersion",R0.LABEL=g(Me,53,"Install Another Version..."),R0);C6=KJ=D([_(0,pr),_(1,aL),_(2,On),_(3,be),_(4,To)],C6);var M0;let Qie=(M0=class extends kn{constructor(e,t){super(YJ.ID,YJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,59,"Enable this extension only in this workspace"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledWorkspace)}},YJ=M0,M0.ID="extensions.enableForWorkspace",M0.LABEL=g(Me,58,"Enable (Workspace)"),M0);Qie=YJ=D([_(0,pr),_(1,Kh)],Qie);var N0;let jie=(N0=class extends kn{constructor(e,t){super(JJ.ID,JJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,61,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledGlobally)}},JJ=N0,N0.ID="extensions.enableGlobally",N0.LABEL=g(Me,60,"Enable"),N0);jie=JJ=D([_(0,pr),_(1,Kh)],jie);var P0;let Kie=(P0=class extends kn{constructor(e,t,i,s){super(XJ.ID,XJ.LABEL,kn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=s,this.tooltip=g(Me,63,"Disable this extension only in this workspace"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>gc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==Nn.EMPTY)&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledWorkspace)}},XJ=P0,P0.ID="extensions.disableForWorkspace",P0.LABEL=g(Me,62,"Disable (Workspace)"),P0);Kie=XJ=D([_(0,Ti),_(1,pr),_(2,Kh),_(3,ho)],Kie);var F0;let Yie=(F0=class extends kn{constructor(e,t,i){super(ZJ.ID,ZJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(Me,65,"Disable this extension"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>gc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledGlobally)}},ZJ=F0,F0.ID="extensions.disableGlobally",F0.LABEL=g(Me,64,"Disable"),F0);Yie=ZJ=D([_(0,pr),_(1,Kh),_(2,ho)],Yie);let r5e=class extends YFe{constructor(e){super("extensions.enable",g(Me,66,"Enable"),[[e.createInstance(jie),e.createInstance(Qie)]])}};r5e=D([_(0,be)],r5e);let a5e=class extends YFe{constructor(e){super("extensions.disable",g(Me,67,"Disable"),[[e.createInstance(Yie),e.createInstance(Kie)]])}};a5e=D([_(0,be)],a5e);var O0;let c5e=(O0=class extends kn{constructor(e,t,i,s,o,r){super("extensions.runtimeState","",EB.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=s,this.productService=o,this.telemetryService=r,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=EB.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Fr.Installing||e===Fr.Uninstalling||this.extension.local&&this.extension.local.manifest&&this.extension.local.manifest.contributes&&this.extension.local.manifest.contributes.localizations&&this.extension.local.manifest.contributes.localizations.length>0)return;const t=this.extension.runtimeState;t&&(this.enabled=!0,this.class=EB.EnabledClass,this.tooltip=t.reason,this.label=t.action===ov.ReloadWindow?g(Me,68,"Reload Window"):t.action===ov.RestartExtensions?g(Me,69,"Restart Extensions"):t.action===ov.QuitAndInstall?g(Me,70,"Restart to Update"):t.action===ov.ApplyUpdate||t.action===ov.DownloadUpdate?g(Me,71,"Update {0}",this.productService.nameShort):"")}async run(){const e=this.extension?.runtimeState;if(e?.action){if(this.telemetryService.publicLog2("extensions:runtimestate:action",{action:e.action}),e?.action===ov.ReloadWindow)return this.hostService.reload();if(e?.action===ov.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===ov.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===ov.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===ov.QuitAndInstall)return this.updateService.quitAndInstall()}}},EB=O0,O0.EnabledClass=`${kn.LABEL_ACTION_CLASS} reload`,O0.DisabledClass=`${EB.EnabledClass} disabled`,O0);c5e=EB=D([_(0,Id),_(1,pr),_(2,NZe),_(3,ho),_(4,Xa),_(5,rn)],c5e);function SS(n,e){return!!(e&&n.extensionData&&Cn.equals(n.extensionData.extensionId,e.identifier.id))}function JFe(n,e,t,i){const s=[];for(const o of n)SS(o,t)&&!(i&&o===e)&&s.push({label:o.label,id:o.id});return i&&(s.push({type:"separator",label:g(Me,56,"current")}),s.push({label:e.label,id:e.id})),s}var Vy;let XEe=(Vy=class extends kn{constructor(e,t,i,s){super(OD.ID,OD.TITLE.value,OD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidColorThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getColorThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?OD.EnabledClass:OD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getColorThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getColorTheme(),o=new Lu(100),r=JFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,73,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:s.id,"auto")}},OD=Vy,Vy.ID="workbench.extensions.action.setColorTheme",Vy.TITLE=Be(Me,72,"Set Color Theme"),Vy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,Vy.DisabledClass=`${OD.EnabledClass} disabled`,Vy);XEe=OD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],XEe);var zy;let ZEe=(zy=class extends kn{constructor(e,t,i,s){super(BD.ID,BD.TITLE.value,BD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidFileIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getFileIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?BD.EnabledClass:BD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getFileIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getFileIconTheme(),o=new Lu(100),r=JFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,75,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:s.id,"auto")}},BD=zy,zy.ID="workbench.extensions.action.setFileIconTheme",zy.TITLE=Be(Me,74,"Set File Icon Theme"),zy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,zy.DisabledClass=`${BD.EnabledClass} disabled`,zy);ZEe=BD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],ZEe);var $y;let exe=($y=class extends kn{constructor(e,t,i,s){super(WD.ID,WD.TITLE.value,WD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidProductIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getProductIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?WD.EnabledClass:WD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getProductIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getProductIconTheme(),o=new Lu(100),r=JFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,77,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:s.id,"auto")}},WD=$y,$y.ID="workbench.extensions.action.setProductIconTheme",$y.TITLE=Be(Me,76,"Set Product Icon Theme"),$y.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,$y.DisabledClass=`${WD.EnabledClass} disabled`,$y);exe=WD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],exe);var Gy;let l5e=(Gy=class extends kn{constructor(e){super(HD.ID,HD.TITLE.value,HD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=HD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd===Phe(this.extension.gallery)||(this.enabled=!0,this.class=HD.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},HD=Gy,Gy.ID="workbench.extensions.action.setDisplayLanguage",Gy.TITLE=Be(Me,78,"Set Display Language"),Gy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,Gy.DisabledClass=`${HD.EnabledClass} disabled`,Gy);l5e=HD=D([_(0,pr)],l5e);var qy;let d5e=(qy=class extends kn{constructor(e,t){super(UD.ID,UD.TITLE.value,UD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=UD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd!==Phe(this.extension.gallery)||(this.enabled=!0,this.class=UD.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},UD=qy,qy.ID="workbench.extensions.action.clearLanguage",qy.TITLE=Be(Me,79,"Clear Display Language"),qy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,qy.DisabledClass=`${UD.EnabledClass} disabled`,qy);d5e=UD=D([_(0,pr),_(1,yet)],d5e);var B0;let h5e=(B0=class extends xn{constructor(e,t,i){super(eX.ID,eX.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);return i?this.extensionWorkbenchService.open(i):null}},eX=B0,B0.ID="workbench.extensions.action.showRecommendedExtension",B0.LABEL=g(Me,80,"Show Recommended Extension"),B0);h5e=eX=D([_(1,Nw),_(2,pr)],h5e);var W0;let u5e=(W0=class extends xn{constructor(e,t,i,s){super(tX.ID,tX.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=s,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(s){this.instantiationService.createInstance($V,i,i.latestVersion,Bx.Install,s).run()}}}},tX=W0,W0.ID="workbench.extensions.action.installRecommendedExtension",W0.LABEL=g(Me,81,"Install Recommended Extension"),W0);u5e=tX=D([_(1,Nw),_(2,be),_(3,pr)],u5e);var H0;let g5e=(H0=class extends xn{constructor(e,t){super(iX.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=iX.Class,this.tooltip=g(Me,82,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},iX=H0,H0.ID="extensions.ignore",H0.Class=`${kn.LABEL_ACTION_CLASS} ignore`,H0);g5e=iX=D([_(1,ihe)],g5e);var U0;let f5e=(U0=class extends xn{constructor(e,t){super(nX.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=nX.Class,this.tooltip=g(Me,83,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},nX=U0,U0.ID="extensions.ignore",U0.Class=`${kn.LABEL_ACTION_CLASS} undo-ignore`,U0);f5e=nX=D([_(1,ihe)],f5e);let Jie=class extends xn{constructor(e,t){super("extensions.searchExtensions",g(Me,84,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};Jie=D([_(1,Nw)],Jie);let Xie=class extends xn{constructor(e,t,i,s,o,r,a,c){super(e,t),this.contextService=i,this.fileService=s,this.textFileService=o,this.editorService=r,this.jsonEditingService=a,this.textModelResolverService=c}openExtensionsFile(e){return this.getOrCreateExtensionsFile(e).then(({created:t,content:i})=>this.getSelectionPosition(i,e,["recommendations"]).then(s=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:s}})),t=>Promise.reject(new Error(g(Me,85,"Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",t))))}openWorkspaceConfigurationFile(e){return this.getOrUpdateWorkspaceConfigurationFile(e).then(t=>this.getSelectionPosition(t.value.toString(),t.resource,["extensions","recommendations"])).then(t=>this.editorService.openEditor({resource:e,options:{selection:t,forceReload:!0}}))}getOrUpdateWorkspaceConfigurationFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>{const i=ow(t.value.toString()).extensions;return!i||!i.recommendations?this.jsonEditingService.write(e,[{path:["extensions"],value:{recommendations:[]}}],!0).then(()=>this.fileService.readFile(e)):t})}getSelectionPosition(e,t,i){const s=_Je(e),o=abe(s,i);if(o&&o.parent&&o.parent.children){const r=o.parent.children[1],a=r.children&&r.children.length?r.children[r.children.length-1]:null,c=a?a.offset+a.length:r.offset+1;return Promise.resolve(this.textModelResolverService.createModelReference(t)).then(l=>{const d=l.object.textEditorModel.getPositionAt(c);return l.dispose(),{startLineNumber:d.lineNumber,startColumn:d.column,endLineNumber:d.lineNumber,endColumn:d.column}})}return Promise.resolve(void 0)}getOrCreateExtensionsFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>({created:!1,extensionsFileResource:e,content:t.value.toString()}),t=>this.textFileService.write(e,Kze).then(()=>({created:!0,extensionsFileResource:e,content:Kze})))}};Xie=D([_(2,Ti),_(3,ci),_(4,tr),_(5,_i),_(6,dL),_(7,Rn)],Xie);var tP;let p5e=(tP=class extends Xie{constructor(e,t,i,s,o,r,a,c){super(e,t,o,i,s,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==Nn.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(p2));case Nn.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},tP.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",tP.LABEL=g(Me,86,"Configure Recommended Extensions (Workspace)"),tP);p5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn)],p5e);var iP;let m5e=(iP=class extends Xie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,i,s,r,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(nst);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(p2)):null)}},iP.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",iP.LABEL=g(Me,87,"Configure Recommended Extensions (Workspace Folder)"),iP);m5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn),_(8,ji)],m5e);var V0;let _5e=(V0=class extends xn{get extension(){return this._extension}set extension(e){this._extension&&e&&gc(this._extension.identifier,e.identifier)||(this.initialStatus=null,this.status=null,this.enablementState=null),this._extension=e,this.update()}constructor(e,t,i){super("extensions.action.statusLabel","",xB.DISABLED_CLASS,!1),this.extensionService=e,this.extensionManagementServerService=t,this.extensionEnablementService=i,this.initialStatus=null,this.status=null,this.version=null,this.enablementState=null,this._extension=null}update(){const e=this.computeLabel();this.label=e||"",this.class=e?xB.ENABLED_CLASS:xB.DISABLED_CLASS}computeLabel(){if(!this.extension)return null;const e=this.status,t=this.version,i=this.enablementState;this.status=this.extension.state,this.version=this.extension.version,this.initialStatus===null&&(this.initialStatus=this.status),this.enablementState=this.extension.enablementState;const s=()=>{const r=this.extensionService.extensions.filter(a=>gc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?r&&this.extension.version===r.version?!0:this.extensionService.canAddExtension(ME(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(gc({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(che(r))))?!0:this.extensionService.canRemoveExtension(ME(this.extension.local)):!1;if(e!==null){if(e===Fr.Installing&&this.status===Fr.Installed)return s()?this.initialStatus===Fr.Installed&&this.version!==t?g(Me,88,"Updated"):g(Me,89,"Installed"):null;if(e===Fr.Uninstalling&&this.status===Fr.Uninstalled)return this.initialStatus=this.status,o()?g(Me,90,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return s()?g(Me,91,"Enabled"):null;if(r&&!a)return o()?g(Me,92,"Disabled"):null}return null}run(){return Promise.resolve()}},xB=V0,V0.ENABLED_CLASS=`${kn.TEXT_ACTION_CLASS} extension-status-label`,V0.DISABLED_CLASS=`${xB.ENABLED_CLASS} hide`,V0);_5e=xB=D([_(0,ho),_(1,Mw),_(2,Kh)],_5e);var z0;let v5e=(z0=class extends qie{constructor(e,t,i,s){super("extensions.sync","",DB.SYNC_CLASS,!1,s),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration("settingsSync.ignoredExtensions"))(()=>this.update())),this._register(i.onDidChangeEnablement(()=>this.update())),this.update()}update(){if(this.enabled=!!this.extension&&this.userDataSyncEnablementService.isEnabled()&&this.extension.state===Fr.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?DB.IGNORED_SYNC_CLASS:DB.SYNC_CLASS,this.tooltip=e?g(Me,93,"This extension is ignored during sync"):g(Me,94,"This extension is synced")}}async run(){return super.run({actionGroups:[[new xn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(Me,95,"Sync this extension"):g(Me,96,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},DB=z0,z0.IGNORED_SYNC_CLASS=`${kn.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(m5t)}`,z0.SYNC_CLASS=`${DB.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(p5t)}`,z0);v5e=DB=D([_(0,Re),_(1,pr),_(2,PZe),_(3,be)],v5e);var nP;let w5e=(nP=class extends kn{get status(){return this._status}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super("extensions.status","",`${VD.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=s,this.workspaceTrustService=o,this.extensionsWorkbenchService=r,this.extensionService=a,this.extensionManifestPropertiesService=c,this.contextService=l,this.productService=d,this.workbenchExtensionEnablementService=h,this.extensionFeaturesManagementService=u,this.updateWhenCounterExtensionChanges=!0,this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new tQ,this._register(this.labelService.onDidChangeFormatters(()=>this.update(),this)),this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this._register(this.extensionFeaturesManagementService.onDidChangeAccessData(()=>this.update())),this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateStatus())}async computeAndUpdateStatus(){if(this.updateStatus(void 0,!0),this.enabled=!1,!this.extension)return;if(this.extension.isMalicious){this.updateStatus({icon:Of,message:new Xt(g(Me,97,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const o=`[${this.extension.deprecationInfo.extension.displayName}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,98,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(Me,99,"settings")}](${P.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,100,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",o))},!0)}else{const o=new Xt(g(Me,101,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:Of,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.gallery&&this.extension.state===Fr.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const o=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),r=new Xt(`${g(Me,102,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,eMt(o))} [${g(Me,103,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:Of,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(Me,0,"{0} for the Web",this.productService.nameLong),r=new Xt(`${g(Me,104,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(Me,105,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:Of,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Fr.Installed)return;if(this.extension.enablementState===ga.DisabledByEnvironment){this.updateStatus({message:new Xt(g(Me,106,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===ga.EnabledByEnvironment){this.updateStatus({message:new Xt(g(Me,107,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===ga.DisabledByVirtualWorkspace){const o=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:ay,message:new Xt(o?b3(o):g(Me,108,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(ost(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:Of,message:new Xt(r?b3(r):g(Me,109,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===ga.DisabledByTrustRequirement)){this.enabled=!0;const o=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:I5,message:new Xt(o?b3(o):g(Me,110,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const o=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:I5,message:new Xt(r?b3(r):g(Me,111,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>gc(o.identifier,this.extension.identifier)&&o.server!==this.extension.server)){let o;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(o=new Xt(`${g(Me,112,"This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)):this.extensionManagementServerService.remoteExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&(this.extensionManagementServerService.localExtensionManagementServer?o=new Xt(`${g(Me,113,"This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Jn&&(o=new Xt(`${g(Me,114,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Xt(`${g(Me,115,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:Of,message:o},!0);return}const e=new Cn(this.extension.identifier.id),t=it.as(GS.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(Me,116,"Manage Access")}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,ESe.Features,!1,o.id]))}`)})`;if(r?.severity===nt.Error){this.updateStatus({icon:DR,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===nt.Warning){this.updateStatus({icon:Of,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(uPe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>gc(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Xt(g(Me,117,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Xt(g(Me,118,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:ay,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>gc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(che(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,119,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,120,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,121,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionDependency){this.updateStatus({icon:Of,message:new Xt(g(Me,122,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),s=this.extensionService.extensions.some(o=>gc({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&s){if(this.extension.enablementState===ga.EnabledWorkspace){this.updateStatus({message:new Xt(g(Me,123,"This extension is enabled for this workspace by the user."))},!0);return}if(this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer&&this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer){this.updateStatus({message:new Xt(g(Me,124,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===ga.EnabledGlobally)return}if(!i&&!s){if(this.extension.enablementState===ga.DisabledGlobally){this.updateStatus({message:new Xt(g(Me,125,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===ga.DisabledWorkspace){this.updateStatus({message:new Xt(g(Me,126,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!s&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===nt.Error).map(([,r])=>r);this.updateStatus({icon:DR,message:new Xt(o.join(" ").trim())},!0)}}updateStatus(e,t){this._status!==e&&(this._status&&e&&this._status.message===e.message&&this._status.icon?.id===e.icon?.id||(this._status=e,t&&(this._status?.icon===DR?this.class=`${VD.CLASS} extension-status-error ${$e.asClassName(DR)}`:this._status?.icon===Of?this.class=`${VD.CLASS} extension-status-warning ${$e.asClassName(Of)}`:this._status?.icon===ay?this.class=`${VD.CLASS} extension-status-info ${$e.asClassName(ay)}`:this._status?.icon===I5?this.class=`${VD.CLASS} ${$e.asClassName(I5)}`:this.class=`${VD.CLASS} hide`),this._onDidChangeStatus.fire()))}async run(){if(this._status?.icon===I5)return this.commandService.executeCommand("workbench.trust.manage")}},VD=nP,nP.CLASS=`${kn.ICON_ACTION_CLASS} extension-status`,nP);w5e=VD=D([_(0,Mw),_(1,eo),_(2,ji),_(3,Sde),_(4,oA),_(5,pr),_(6,ho),_(7,G_),_(8,Ti),_(9,Xa),_(10,Kh),_(11,wet)],w5e);var $0;let b5e=($0=class extends xn{constructor(e=sX.ID,t=sX.LABEL,i,s,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=s,this.quickInputService=o,this.notificationService=r,this.hostService=a,this.instantiationService=c,this.extensionService=l}get enabled(){return this.extensionsWorkbenchService.local.filter(e=>!e.isBuiltin&&e.local).length>0}run(){return this.quickInputService.pick(this.getEntries(),{placeHolder:g(Me,128,"Select Extension to Reinstall")}).then(e=>e&&this.reinstallExtension(e.extension))}getEntries(){return this.extensionsWorkbenchService.queryLocal().then(e=>e.filter(i=>!i.isBuiltin&&i.server!==this.extensionManagementServerService.webExtensionManagementServer).map(i=>({id:i.identifier.id,label:i.displayName,description:i.identifier.id,extension:i})))}reinstallExtension(e){return this.instantiationService.createInstance(Jie,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(ME(t.local))),s=i?g(Me,129,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(Me,130,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(Me,131,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(nt.Info,s,o,{sticky:!0})},t=>this.notificationService.error(t)))}},sX=$0,$0.ID="workbench.extensions.action.reinstall",$0.LABEL=g(Me,127,"Reinstall Extension..."),$0);b5e=sX=D([_(2,pr),_(3,Mw),_(4,On),_(5,Pi),_(6,Id),_(7,be),_(8,ho)],b5e);var G0;let C5e=(G0=class extends xn{constructor(e=oX.ID,t=oX.LABEL,i,s,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=s,this.instantiationService=o,this.extensionEnablementService=r}get enabled(){return this.extensionsWorkbenchService.local.some(e=>this.isEnabled(e))}async run(){const e=await this.quickInputService.pick(this.getExtensionEntries(),{placeHolder:g(Me,133,"Select Extension"),matchOnDetail:!0});if(e&&e.extension){const t=this.instantiationService.createInstance(C6);t.extension=e.extension,await t.run(),await this.instantiationService.createInstance(Jie,e.extension.identifier.id).run()}}isEnabled(e){const t=this.instantiationService.createInstance(C6);return t.extension=e,t.enabled&&!!e.local&&this.extensionEnablementService.isEnabled(e.local)}async getExtensionEntries(){const e=await this.extensionsWorkbenchService.queryLocal(),t=[];for(const i of e)this.isEnabled(i)&&t.push({id:i.identifier.id,label:i.displayName||i.identifier.id,description:i.identifier.id,extension:i});return t.sort((i,s)=>i.extension.displayName.localeCompare(s.extension.displayName))}},oX=G0,G0.ID="workbench.extensions.action.install.specificVersion",G0.LABEL=g(Me,132,"Install Specific Version of Extension..."),G0);C5e=oX=D([_(2,pr),_(3,On),_(4,be),_(5,Kh)],C5e);let Zie=class extends xn{constructor(e,t,i,s,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=s,this.progressService=o,this.extensions=void 0,this.update(),this.extensionsWorkbenchService.queryLocal().then(()=>this.updateExtensions()),this._register(this.extensionsWorkbenchService.onChange(()=>{this.extensions&&this.updateExtensions()}))}updateExtensions(){this.extensions=this.extensionsWorkbenchService.local,this.update()}update(){this.enabled=!!this.extensions&&this.getExtensionsToInstall(this.extensions).length>0,this.tooltip=this.label}async run(){return this.selectAndInstallExtensions()}async queryExtensionsToInstall(){const e=await this.extensionsWorkbenchService.queryLocal();return this.getExtensionsToInstall(e)}async selectAndInstallExtensions(){const e=this.quickInputService.createQuickPick();e.busy=!0;const t=e.onDidAccept(()=>{t.dispose(),e.hide(),e.dispose(),this.onDidAccept(e.selectedItems)});e.show();const i=await this.queryExtensionsToInstall();e.busy=!1,i.length?(e.title=this.getQuickPickTitle(),e.placeholder=g(Me,134,"Select extensions to install"),e.canSelectMany=!0,i.sort((s,o)=>s.displayName.localeCompare(o.displayName)),e.items=i.map(s=>({extension:s,label:s.displayName,description:s.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:nt.Info,message:g(Me,135,"There are no extensions to install.")}))}async onDidAccept(e){if(e.length){const t=e.filter(i=>!!i.extension).map(i=>i.extension);t.length&&(await this.progressService.withProgress({location:ch.Notification,title:g(Me,136,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(Me,137,"Successfully installed extensions.")))}}};Zie=D([_(1,pr),_(2,On),_(3,Pi),_(4,Cf)],Zie);let y5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,s,i),this.extensionManagementServerService=o,this.extensionGalleryService=r,this.instantiationService=a,this.fileService=c,this.logService=l}get label(){return this.extensionManagementServerService&&this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,138,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(Me,139,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance($Ee,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};y5e=D([_(0,pr),_(1,On),_(2,Cf),_(3,Pi),_(4,Mw),_(5,aL),_(6,be),_(7,ci),_(8,Ze)],y5e);let S5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,o,s),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(Me,140,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(Me,141,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===qr.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&gc(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};S5e=D([_(1,pr),_(2,On),_(3,Cf),_(4,Pi),_(5,Mw),_(6,aL),_(7,ci),_(8,Ze)],S5e);yt.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const txe="workbench.extensions.action.showExtensionsWithIds";yt.registerCommand(txe,function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const s=e.map(o=>`@id:${o}`).join(" ");i.search(s),i.focus()})});B("extensionButton.background",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,142,"Button background color for extension actions."));B("extensionButton.foreground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,143,"Button foreground color for extension actions."));B("extensionButton.hoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,144,"Button background hover color for extension actions."));B("extensionButton.separator",{dark:f3,light:f3,hcDark:f3,hcLight:f3},g(Me,145,"Button separator color for extension actions"));B("extensionButton.prominentBackground",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,146,"Button background color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentForeground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,147,"Button foreground color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentHoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,148,"Button background hover color for extension actions that stand out (e.g. install button)."));Lm((n,e)=>{const t=n.getColor(Vh);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(DR)} { color: ${t}; }`));const i=n.getColor(qc);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(Of)} { color: ${i}; }`));const s=n.getColor(Qc);s&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(ay)} { color: ${s}; }`))});const rst="vs/workbench/contrib/chat/browser/chatAgentHover";let ene=class extends ${constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i;const s=di(".chat-agent-hover@root",[di(".chat-agent-hover-header",[di(".chat-agent-hover-icon@icon"),di(".chat-agent-hover-details",[di(".chat-agent-hover-name@name"),di(".chat-agent-hover-extension",[di(".chat-agent-hover-extension-name@extensionName"),di(".chat-agent-hover-separator@separator"),di(".chat-agent-hover-publisher@publisher")])])]),di(".chat-agent-hover-warning@warning"),di("span.chat-agent-hover-description@description")]);this.domNode=s.root,this.icon=s.icon,this.name=s.name,this.extensionName=s.extensionName,this.description=s.description,s.separator.textContent="|";const o=we("span.extension-verified-publisher",void 0,OS(_5t));this.publisherName=we("span.chat-agent-hover-publisher-name"),he(s.publisher,o,this.publisherName),s.warning.appendChild(OS(Ce.warning)),s.warning.appendChild(we("span",void 0,g(rst,0,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof P){const o=we("img.icon");o.src=lp.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(we(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=we($e.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(we(".avatar.codicon-avatar",void 0,o))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:Nhe(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let s=t.description??"";if(s&&(s.match(/[\.\?\!] *$/)||(s+=".")),this.description.textContent=s,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ai);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&this.domNode.classList.toggle("verifiedPublisher",!0)})}}};ene=D([_(0,yp),_(1,pr),_(2,Yde)],ene);function ast(n,e){return{actions:[{commandId:txe,label:g(rst,1,"View Extension"),run:()=>{const t=n();t&&e.executeCommand(txe,[t.extensionId.value])}}]}}var C5t=".chat-confirmation-widget{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:16px;padding:8px 12px 12px}.chat-confirmation-widget .chat-confirmation-widget-title{font-weight:600}.chat-confirmation-widget .chat-confirmation-widget-title p{margin:0 0 4px}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown p{margin-top:0}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown>:last-child{margin-bottom:0}.chat-confirmation-widget .chat-confirmation-buttons-container{display:flex;gap:8px;margin-top:13px}.chat-confirmation-widget.hideButtons .chat-confirmation-buttons-container{display:none}";Ct(C5t,{});let ixe=class extends ${get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,s){super(),this.instantiationService=s,this._onDidClick=this._register(new I);const o=di(".chat-confirmation-widget@root",[di(".chat-confirmation-widget-title@title"),di(".chat-confirmation-widget-message@message"),di(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(vw,{})),a=this._register(r.render(new Xt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Xt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new Tu(o.buttonsContainer,{...yQ,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};ixe=D([_(3,be)],ixe);const Gz="vs/workbench/contrib/chat/common/chatColors";B("chat.requestBorder",{dark:new fe(new gn(255,255,255,.1)),light:new fe(new gn(0,0,0,.1)),hcDark:ft,hcLight:ft},g(Gz,0,"The border color of a chat request."));const y5t=B("chat.requestBackground",{dark:Ie(us,.62),light:Ie(us,.62),hcDark:Zs,hcLight:null},g(Gz,1,"The background color of a chat request.")),A5e=B("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:fe.white,hcLight:kW},g(Gz,2,"The background color of a chat slash command.")),E5e=B("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:fe.black,hcLight:kMe},g(Gz,3,"The foreground color of a chat slash command."));B("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:fe.black,hcLight:fe.white},g(Gz,4,"The background color of a chat avatar."));B("chat.avatarForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Gz,5,"The foreground color of a chat avatar."));const Ipe="http://_vscodedecoration_",rX="http://_chatagent_",S5t="http://_chatslash_";function A5t(n,e,t){const i=t.get(Yde),s=t.get(yp),o=i.getAgentNameRestriction(n);let r=`${o?n.name:Nhe(n)}`;o&&s.getAgentsByName(n.name).length>1&&(r+=` (${n.publisherDisplayName})`);const c={agentId:n.id,name:r,isClickable:e};return`[${n.name}](${rX}?${encodeURIComponent(JSON.stringify(c))})`}let nxe=class{constructor(e,t,i,s,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this.hoverService=r,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof kb)t+=i.text;else if(i instanceof tp)t+=this.instantiationService.invokeFunction(s=>A5t(i.agent,!1,s));else{const s=i instanceof VV&&i.data instanceof P?i.data:void 0,o=s?encodeURIComponent(this.labelService.getUriLabel(s,{relative:!0})):i instanceof tp?i.agent.id:"",r=i.text;t+=`[${r}](${Ipe}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const s=i.getAttribute("data-href");if(s)if(s.startsWith(rX)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(s.startsWith(S5t)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(s.startsWith(Ipe)){const o=decodeURIComponent(s.slice(Ipe.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else s.startsWith(Xnt)?this.renderFileWidget(s,i):s.startsWith("command:")&&this.injectKeybindingHint(i,s,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${$z}${e.name}`;let s;if(e.isClickable){s=we("span.chat-agent-widget");const a=t.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));a.label=i,t.add(a.onDidClick(()=>{const c=this.chatAgentService.getAgent(e.agentId),l=this.chatWidgetService.lastFocusedWidget;!l||!c||this.chatService.sendRequest(l.viewModel.sessionId,c.metadata.sampleRequest??"",{location:l.location,agentId:c.id})}))}else s=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new Ya(()=>t.add(this.instantiationService.createInstance(ene)));return t.add(this.hoverService.setupUpdatableHover(va("element"),s,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&ast(()=>o,this.commandService))),s}renderSlashCommandWidget(e,t,i){const s=we("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));return r.label=e,i.add(r.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!o)return;const c=o.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:o.id,slashCommand:t.command})})),s}renderFileWidget(e,t){const i=P.parse(e);let s;try{s=Or(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Ma(a));return}if(!s.uri||!P.isUri(s.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=s.range?`${s.range.startLineNumber}-${s.range.endLineNumber}`:"";t.setAttribute("data-href",s.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(s.uri,{relative:!0});t.title=s.range?`${r}#${s.range.startLineNumber}-${s.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=we("span.chat-resource-widget"),s=we("span",void 0,e);return t&&(s.title=t),i.appendChild(s),i}injectKeybindingHint(e,t,i){const s=t.match(/command:([^\)]+)/)?.[1];if(s){const o=i.lookupKeybinding(s);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};nxe=D([_(0,ti),_(1,eo),_(2,Ze),_(3,yp),_(4,be),_(5,el),_(6,Rw),_(7,lL),_(8,ji)],nxe);var P3;const Pm="vs/workbench/contrib/files/common/files",E5t="workbench.view.explorer",lC="workbench.explorer.fileView";new Y("explorerViewletVisible",!0,{type:"boolean",description:g(Pm,0,"True when the EXPLORER viewlet is visible.")});const XFe=new Y("foldersViewVisible",!0,{type:"boolean",description:g(Pm,1,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),x5t=new Y("explorerResourceIsFolder",!1,{type:"boolean",description:g(Pm,2,"True when the focused item in the EXPLORER is a folder.")}),cst=new Y("explorerResourceReadonly",!1,{type:"boolean",description:g(Pm,3,"True when the focused item in the EXPLORER is read-only.")}),lst=cst.toNegated(),D5t=new Y("explorerResourceAvailableEditorIds",""),k5t=new Y("explorerResourceIsRoot",!1,{type:"boolean",description:g(Pm,4,"True when the focused item in the EXPLORER is a root folder.")}),I5t=new Y("explorerResourceCut",!1,{type:"boolean",description:g(Pm,5,"True when an item in the EXPLORER has been cut for cut and paste.")}),L5t=new Y("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(Pm,6,"True when the focused item in the EXPLORER can be moved to trash.")}),dst=new Y("filesExplorerFocus",!0,{type:"boolean",description:g(Pm,7,"True when the focus is inside the EXPLORER view.")});new Y("openEditorsFocus",!0,{type:"boolean",description:g(Pm,8,"True when the focus is inside the OPEN EDITORS view.")});const hst=new Y("explorerViewletFocus",!0,{type:"boolean",description:g(Pm,9,"True when the focus is inside the EXPLORER viewlet.")}),T5t=new Y("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(Pm,10,"True when the focused item in the EXPLORER view is a compact item.")}),R5t=new Y("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(Pm,11,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),M5t=new Y("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(Pm,12,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),N5t=new Y("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(Pm,13,"True when a workspace in the EXPLORER view has some collapsible root child.")});ge.and(XFe,dst,ge.not(Lde));ge.and(XFe,hst,ge.not(Lde));const ust="workbench.editors.files.textFileEditor",gst="workbench.editors.files.fileEditorInput",P5t="workbench.editors.files.binaryFileEditor";var sxe;(function(n){n.Default="default",n.Mixed="mixed",n.FilesFirst="filesFirst",n.Type="type",n.Modified="modified",n.FoldersNestsFiles="foldersNestsFiles"})(sxe||(sxe={}));var SM;(function(n){n.Verbose="verbose",n.Default="default",n.Light="light"})(SM||(SM={}));var x5e;(function(n){n.Default="default",n.Upper="upper",n.Lower="lower",n.Unicode="unicode"})(x5e||(x5e={}));let D5e=P3=class extends ${constructor(e,t,i,s){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=s,this.fileWatcherDisposable=this._register(new Dn)}static async open(e,t,i,s,o){await s.openEditor({original:{resource:P3.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:o})}static resourceToTextFile(e,t){return t.with({scheme:e,query:JSON.stringify({scheme:t.scheme,query:t.query})})}static textFileToResource(e){const{scheme:t,query:i}=JSON.parse(e.query);return e.with({scheme:t,query:i})}async provideTextContent(e){if(!e.query)return null;const t=P3.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const s=new Z;this.fileWatcherDisposable.value=s,s.add(this.fileService.onDidFilesChange(o=>{o.contains(t,Ko.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&s.add(T.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=P3.textFileToResource(e),s=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,s.value);else if(t){const r=this.modelService.getModel(i);let a;r?a=this.languageService.createById(r.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),o=this.modelService.createModel(s.value,a,e)}return o}};D5e=P3=D([_(0,tr),_(1,ci),_(2,Di),_(3,Ai)],D5e);const Vce=class Vce{constructor(e,t){this._editor=e,this._group=t,this.id=Vce.COUNTER++}get editor(){return this._editor}get group(){return this._group}get groupId(){return this._group.id}getId(){return`openeditor:${this.groupId}:${this.id}`}isPreview(){return!this._group.isPinned(this.editor)}isSticky(){return this._group.isSticky(this.editor)}getResource(){return jc.getOriginalUri(this.editor,{supportSideBySide:go.PRIMARY})}};Vce.COUNTER=0;let tne=Vce;const k5e="vs/platform/dialogs/common/dialogs";var I5e;(function(n){n[n.Confirmation=1]="Confirmation",n[n.Prompt=2]="Prompt",n[n.Input=3]="Input"})(I5e||(I5e={}));var Ku;(function(n){n[n.SAVE=0]="SAVE",n[n.DONT_SAVE=1]="DONT_SAVE",n[n.CANCEL=2]="CANCEL"})(Ku||(Ku={}));const YK=10;function fst(n){const e=[];return e.push(...n.slice(0,YK).map(t=>typeof t=="string"?t:ui(t))),n.length>YK&&(n.length-YK===1?e.push(g(k5e,3,"...1 additional file not shown")):e.push(g(k5e,4,"...{0} additional files not shown",n.length-YK))),e.push(""),e.join(` -`)}var F5t=".quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-editor:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(F5t,{});const ine=0,L5e=[ine,[]];function T5e(n,e,t,i){if(!n||!e)return L5e;const s=n.length,o=e.length;if(s0,v=n[u],w=e[u];for(let b=0;b0,y=f+b,S=y-1,M=p+b-1,k=C?a[S]:0,F=m&&C?a[M]:0,N=m&&C?c[M]:0;let z;!F&&m?z=0:z=B5t(v,w,i,s,b,N),z&&F+z>=k&&(r||m||s.startsWith(e,b))?(c[y]=N+1,a[y]=F+z):(c[y]=ine,a[y]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===ine||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function B5t(n,e,t,i,s,o){let r=0;if(!W5t(e,i[s]))return r;if(r+=1,o>0&&(r+=o*5),n===t[s]&&(r+=1),s===0)r+=8;else{const a=H5t(t.charCodeAt(s-1));a?r+=a:pQ(t.charCodeAt(s))&&o===0&&(r+=2)}return r}function W5t(n,e){return n===e?!0:n==="/"||n==="\\"?e==="/"||e==="\\":!1}function H5t(n){switch(n){case Q.Slash:case Q.Backslash:return 5;case Q.Underline:case Q.Dash:case Q.Period:case Q.Space:case Q.SingleQuote:case Q.DoubleQuote:case Q.Colon:return 4;default:return 0}}const pst=[void 0,[]];function Lpe(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?U5t(n,s.values,t,i):mst(n,e,t,i)}function U5t(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,c]=mst(n,r,t,i);if(typeof a!="number")return pst;s+=a,o.push(...c)}return[s,cxe(o)]}function mst(n,e,t,i){const s=v1(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],Cz(s)]:pst}const nne=Object.freeze({score:0}),aX=1<<18,oxe=1<<17,rxe=65536;function V5t(n,e,t,i){const s=i.values?i.values:[i];return Ed({[i.normalized]:{values:s.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:n,description:e,allowNonContiguousMatches:t}})}function axe(n,e,t,i,s){if(!n||!e.normalized)return nne;const o=i.getItemLabel(n);if(!o)return nne;const r=i.getItemDescription(n),a=V5t(o,r,t,e),c=s[a];if(c)return c;const l=z5t(o,r,i.getItemPath(n),e);return s[a]=l,l}function z5t(n,e,t,i,s){const o=!t||!i.containsPathSeparator;return t&&(jr?i.pathNormalized===t:Ba(i.pathNormalized,t))?{score:aX,labelMatch:[{start:0,end:n.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?$5t(n,e,t,i.values,o):_st(n,e,t,i,o)}function $5t(n,e,t,i,s,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=_st(n,e,t,l,s);if(d===ine)return nne;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:cxe(a),descriptionMatch:cxe(c)}}function _st(n,e,t,i,s,o){if(s||!e){const[r,a]=T5e(n,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=dF(i.normalized,n);let l;if(c){l=oxe;const d=Math.round(i.normalized.length/n.length*100);l+=d}else l=rxe;return{score:l+r,labelMatch:c||R5e(a)}}}if(e){let r=e;t&&(r=`${e}${dg}`);const a=r.length,c=`${r}${n}`,[l,d]=T5e(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=R5e(d),u=[],f=[];return h.forEach(p=>{p.starta?(u.push({start:0,end:p.end-a}),f.push({start:p.start,end:a})):p.start>=a?u.push({start:p.start-a,end:p.end-a}):f.push(p)}),{score:l,labelMatch:u,descriptionMatch:f}}}return nne}function R5e(n){const e=[];if(!n)return e;let t;for(const i of n)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function cxe(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!G5t(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function G5t(n,e){return!(n.endrxe||l>rxe){if(c!==l)return c>l?-1:1;if(cl?-1:1;const d=Array.isArray(r.labelMatch)&&r.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=M5e(n,r,s),f=M5e(e,a,s);return u&&f&&u!==f?f>u?-1:1:j5t(n,e,t,s)}function M5e(n,e,t){let i=-1,s=-1;if(e.descriptionMatch&&e.descriptionMatch.length?i=e.descriptionMatch[0].start:e.labelMatch&&e.labelMatch.length&&(i=e.labelMatch[0].start),e.labelMatch&&e.labelMatch.length){if(s=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(n);o&&(s+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(s=e.descriptionMatch[e.descriptionMatch.length-1].end);return s-i}function Q5t(n,e){if(!n&&!e||(!n||!n.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!n||!n.length)return 1;const t=n[0].start,s=n[n.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return s===a?0:a=0,r=N5e(n);let a;const c=n.split(vst);if(c.length>1)for(const l of c){const d=N5e(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=P5e(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function P5e(n){let e;Is?e=n.replace(/\//g,dg):e=n.replace(/\\/g,dg);const t=Mlt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function F5e(n){return Array.isArray(n)?y6(n.map(e=>e.original).join(vst)):y6(n.original)}var lxe,dxe,hxe;const L5="vs/workbench/browser/parts/editor/editorQuickAccess";let S6=class extends $Fe{constructor(e,t,i,s,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(L5,0,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=s,this.languageService=o,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(r){r||(this.scorerCache=Object.create(null)),this.isQuickNavigating=r}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=y6(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=axe(o,t,!0,_Ue,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(gg.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):q5t(r,a,t,!0,_Ue,this.pickState.scorerCache))}const s=[];if(this.editorGroupService.count>1){let o;for(const r of i){if(typeof o!="number"||o!==r.groupId){const a=this.editorGroupService.getGroup(r.groupId);a&&s.push({type:"separator",label:a.label}),o=r.groupId}s.push(r)}}else s.push(...i);return s}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const s=this.editorGroupService.getGroup(i);s&&t.set(i,s.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:s})=>{const o=jc.getOriginalUri(i,{supportSideBySide:go.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:s,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(L5,1,"{0}, unsaved changes, {1}",c,t.get(s)):g(L5,2,"{0}, {1}",c,t.get(s)):r?g(L5,3,"{0}, unsaved changes",c):c,description:a,iconClasses:lI(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(s)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+$e.asClassName(Ce.closeDirty):$e.asClassName(Ce.close),tooltip:g(L5,4,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(s);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?BE.REMOVE_ITEM:BE.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(s)?.openEditor(i,{preserveFocus:d.inBackground})}})}};S6=D([_(1,ur),_(2,_i),_(3,Ai),_(4,Di)],S6);var sP;let O5e=(sP=class extends S6{constructor(e,t,i,s){super(lxe.PREFIX,e,t,i,s)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(eg.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},lxe=sP,sP.PREFIX="edt active ",sP);O5e=lxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],O5e);var oP;let B5e=(oP=class extends S6{constructor(e,t,i,s){super(dxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(gg.GRID_APPEARANCE))for(const i of t.getEditors(eg.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},dxe=oP,oP.PREFIX="edt ",oP);B5e=dxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],B5e);var rP;let W5e=(rP=class extends S6{constructor(e,t,i,s){super(hxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(eg.MOST_RECENTLY_ACTIVE))e.push(t);return e}},hxe=rP,rP.PREFIX="edt mru ",rP);W5e=hxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],W5e);var K5t=".side-by-side-editor-container{height:100%;width:100%}";Ct(K5t,{});var kB;const Y5t="vs/workbench/common/editor/sideBySideEditorInput";var aP;let _m=(aP=class extends cC{get typeId(){return kB.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Mi.CanSplitInGroup,this.secondary.hasCapability(Mi.RequiresTrust)&&(e|=Mi.RequiresTrust),this.secondary.hasCapability(Mi.Singleton)&&(e|=Mi.Singleton),e|=Mi.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,s,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=s,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(T.once(T.any(this.primary.onWillDispose,this.secondary.onWillDispose))(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.secondary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.secondary.onDidChangeLabel(()=>this._onDidChangeLabel.fire()))}getName(){const e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():g(Y5t,0,"{0} - {1}",this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){const t=this.getPreferredDescription();return t||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t;this.hasIdenticalSides?t=this.primary.getTitle(e)??this.getName():t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getLabelExtraClasses(){return this.hasIdenticalSides?this.primary.getLabelExtraClasses():super.getLabelExtraClasses()}getAriaLabel(){return this.hasIdenticalSides?this.primary.getAriaLabel():super.getAriaLabel()}getTelemetryDescriptor(){return{...this.primary.getTelemetryDescriptor(),...super.getTelemetryDescriptor()}}isDirty(){return this.primary.isDirty()}isSaving(){return this.primary.isSaving()}async save(e,t){const i=await this.primary.save(e,t);return this.saveResultToEditor(i)}async saveAs(e,t){const i=await this.primary.saveAs(e,t);return this.saveResultToEditor(i)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof cC)return new kB(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!Gv(e)&&!V$(e)&&!LE(e)&&!Wb(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,t){return this.primary.revert(e,t)}async rename(e,t){if(!this.hasIdenticalSides)return;const i=await this.primary.rename(e,t);if(i){if(ja(i.editor))return{editor:new kB(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:qW(this,e,this.editorService)}};if(wb(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:qW(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){const t=this.primary.toUntyped(e),i=this.secondary.toUntyped(e);if(t&&i&&!Gv(t)&&!Gv(i)&&!V$(t)&&!V$(i)&&!LE(t)&&!LE(i)&&!Wb(t)&&!Wb(i)){const s={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(s.options={viewState:qW(this,e.preserveViewState,this.editorService)}),s}}matches(e){return this===e?!0:EZe(e)||Gv(e)?!1:e instanceof kB?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):LE(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},kB=aP,aP.ID="workbench.editorinputs.sidebysideEditorInput",aP);_m=kB=D([_(4,_i)],_m);const Ol=class Ol{constructor(e,t){this.storageService=t,this.id=Ol.COMMON_PREFIX+e}getMemento(e,t){switch(e){case ke.WORKSPACE:{let i=Ol.workspaceMementos.get(this.id);return i||(i=new Tpe(this.id,e,t,this.storageService),Ol.workspaceMementos.set(this.id,i)),i.getMemento()}case ke.PROFILE:{let i=Ol.profileMementos.get(this.id);return i||(i=new Tpe(this.id,e,t,this.storageService),Ol.profileMementos.set(this.id,i)),i.getMemento()}case ke.APPLICATION:{let i=Ol.applicationMementos.get(this.id);return i||(i=new Tpe(this.id,e,t,this.storageService),Ol.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Ol.workspaceMementos.get(this.id)?.save(),Ol.profileMementos.get(this.id)?.save(),Ol.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case ke.APPLICATION:t=Ol.applicationMementos.get(this.id);break;case ke.PROFILE:t=Ol.profileMementos.get(this.id);break;case ke.WORKSPACE:t=Ol.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case ke.WORKSPACE:Ol.workspaceMementos.clear();break;case ke.PROFILE:Ol.profileMementos.clear();break;case ke.APPLICATION:Ol.applicationMementos.clear();break}}};Ol.applicationMementos=new Map,Ol.profileMementos=new Map,Ol.workspaceMementos=new Map,Ol.COMMON_PREFIX="memento/";let W1=Ol;class Tpe{constructor(e,t,i,s){this.id=e,this.scope=t,this.target=i,this.storageService=s,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){bt(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(const e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){n1(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class wst extends zMe{constructor(e,t,i){super(t),this.id=e,this.memento=new W1(this.id,i),this._register(i.onWillSaveState(()=>{this.saveState(),this.memento.saveMemento()}))}getId(){return this.id}getMemento(e,t){return this.memento.getMemento(e,t)}reloadMemento(e){return this.memento.reloadMemento(e)}onDidChangeMementoValue(e,t){return this.memento.onDidChangeValue(e,t)}saveState(){}}class J5t extends wst{get onDidFocus(){return this._onDidFocus||(this._onDidFocus=this.registerFocusTrackEvents().onDidFocus),this._onDidFocus.event}get onDidBlur(){return this._onDidBlur||(this._onDidBlur=this.registerFocusTrackEvents().onDidBlur),this._onDidBlur.event}hasFocus(){return this._hasFocus}registerFocusTrackEvents(){const e=ws(this.getContainer()),t=this._register(Dd(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const s=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,s.fire()})),{onDidFocus:i,onDidBlur:s}}constructor(e,t,i,s){super(e,i,s),this.telemetryService=t,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._hasFocus=!1,this.visible=!1}getTitle(){}create(e){this.parent=e}getContainer(){return this.parent}setVisible(e){this.visible!==!!e&&(this.visible=e)}focus(){}getMenuIds(){return[]}getActions(){return[]}getSecondaryActions(){return[]}getContextMenuActions(){return[]}getActionViewItem(e,t){}getActionsContext(){return null}getActionRunner(){return this.actionRunner||(this.actionRunner=this._register(new gw)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const eW=class eW extends J5t{get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}get input(){return this._input}get options(){return this._options}get window(){return vZ(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,s,o){super(e,i,s,o),this.group=t,this.onDidChangeSizeConstraints=T.None,this._onDidChangeControl=this._register(new I),this.onDidChangeControl=this._onDidChangeControl.event}create(e){super.create(e),this.createEditor(e)}async setInput(e,t,i,s){this._input=e,this._options=t}clearInput(){this._input=void 0,this._options=void 0}setOptions(e){this._options=e}setVisible(e){super.setVisible(e),this.setEditorVisible(e)}setEditorVisible(e){}setBoundarySashes(e){}getEditorMemento(e,t,i,s=10){const o=`${this.getId()}${i}`;let r=eW.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new uxe(this.getId(),i,this.getMemento(ke.WORKSPACE,ln.MACHINE),s,e,t)),eW.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of eW.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};eW.EDITOR_MEMENTOS=new Map;let sne=eW;const tW=class tW extends ${constructor(e,t,i,s,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=s,this.editorGroupService=o,this.configurationService=r,this.cleanedUp=!1,this.shareEditorState=!1,this.updateConfiguration(void 0),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){(!e||e.affectsConfiguration(void 0,"workbench.editor.sharedViewState"))&&(this.shareEditorState=this.configurationService.getValue(void 0,"workbench.editor.sharedViewState")===!0)}saveEditorState(e,t,i){const s=this.doGetResource(t);if(!s||!e)return;const o=this.doLoad();let r=o.get(s.toString());r||(r=Object.create(null),o.set(s.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[tW.SHARED_EDITOR_STATE]=i),ja(t)&&this.clearEditorStateOnDispose(s,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const o=this.doLoad().get(i.toString());if(o){const r=o[e.id];if(r)return r;if(this.shareEditorState)return o[tW.SHARED_EDITOR_STATE]}}clearEditorState(e,t){ja(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const s=this.doLoad();if(t){const o=s.get(i.toString());o&&(delete o[t.id],n1(o)&&s.delete(i.toString()))}else s.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,T.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const s=this.doLoad(),o=[...s.keys()];for(const r of o){const a=P.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(_n(e,a))c=t;else{const d=GQe(a.path,e.path);c=Qt(t,a.path.substr(d+e.path.length+1))}const l=s.get(r,Vd.None);l&&(s.delete(r),s.set(c.toString(),l))}}doGetResource(e){return ja(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new L_(this.limit);const e=this.memento[this.key];Array.isArray(e)&&this.cache.fromJSON(e)}return this.cache}saveState(){const e=this.doLoad();this.cleanedUp||(this.cleanUp(),this.cleanedUp=!0),this.memento[this.key]=e.toJSON()}cleanUp(){const e=this.doLoad(),t=[...e.entries()];for(const[i,s]of t)for(const o of Object.keys(s)){const r=Number(o);r===tW.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete s[r],n1(s)&&e.delete(i))}}};tW.SHARED_EDITOR_STATE=-1;let uxe=tW,one=class extends sne{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,s,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new Dn),this.viewState=this.getEditorMemento(d,a,i,100)}setEditorVisible(e){this.groupListener.value=this.group.onWillCloseEditor(t=>this.onWillCloseEditor(t)),super.setEditorVisible(e)}onWillCloseEditor(e){const t=e.editor;t===this.input&&this.updateEditorViewState(t)}clearInput(){this.updateEditorViewState(this.input),super.clearInput()}saveState(){this.updateEditorViewState(this.input),super.saveState()}updateEditorViewState(e){if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);t&&(this.tracksDisposedEditorViewState()||(this.editorViewStateDisposables||(this.editorViewStateDisposables=new Map),this.editorViewStateDisposables.has(e)||this.editorViewStateDisposables.set(e,T.once(e.onWillDispose)(()=>{this.clearEditorViewState(t,this.group),this.editorViewStateDisposables?.delete(e)}))),e.isDisposed()&&!this.tracksDisposedEditorViewState()||!this.shouldRestoreEditorViewState(e)&&!this.group.contains(e)?this.clearEditorViewState(t,this.group):e.isDisposed()||this.saveEditorViewState(t))}shouldRestoreEditorViewState(e,t){return t?.newInGroup?this.textResourceConfigurationService.getValue(jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}),"workbench.editor.restoreViewState")!==!1:!0}getViewState(){const e=this.input;if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);if(t)return this.computeEditorViewState(t)}saveEditorViewState(e){const t=this.computeEditorViewState(e);t&&this.viewState.saveEditorState(this.group,e,t)}loadEditorViewState(e,t){if(!e||!this.tracksEditorViewState(e)||!this.shouldRestoreEditorViewState(e,t))return;const i=this.toEditorViewStateResource(e);if(i)return this.viewState.loadEditorState(this.group,i)}moveEditorViewState(e,t,i){return this.viewState.moveEditorState(e,t,i)}clearEditorViewState(e,t){this.viewState.clearEditorState(e,t)}dispose(){if(super.dispose(),this.editorViewStateDisposables){for(const[,e]of this.editorViewStateDisposables)e.dispose();this.editorViewStateDisposables=void 0}}tracksDisposedEditorViewState(){return!1}};one=D([_(3,rn),_(4,be),_(5,on),_(6,dl),_(7,pn),_(8,_i),_(9,ur)],one);var nT;const X5t="vs/workbench/browser/parts/editor/sideBySideEditor";function Z5t(n){const e=n;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var XE;let gxe=(XE=class extends one{get minimumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.minimumWidth:0}get maximumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.minimumHeight:0}get maximumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}get minimumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumWidth:0}get maximumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumHeight:0}get maximumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}set minimumWidth(e){}set maximumWidth(e){}set minimumHeight(e){}set maximumHeight(e){}get minimumWidth(){return this.minimumPrimaryWidth+this.minimumSecondaryWidth}get maximumWidth(){return this.maximumPrimaryWidth+this.maximumSecondaryWidth}get minimumHeight(){return this.minimumPrimaryHeight+this.minimumSecondaryHeight}get maximumHeight(){return this.maximumPrimaryHeight+this.maximumSecondaryHeight}constructor(e,t,i,s,o,r,a,c,l){super(nT.ID,e,nT.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,s,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new w_e),this.onDidChangeSizeConstraints=T.any(this.onDidCreateEditors.event,this._onDidChangeSizeConstraints.event),this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this.primaryEditorPane=void 0,this.secondaryEditorPane=void 0,this.splitviewDisposables=this._register(new Z),this.editorDisposables=this._register(new Z),this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.dimension=new Tn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(nT.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=ws(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(e.removeChild(this.splitview.el),this.splitviewDisposables.clear()),this.createSplitView(e,t),this.layout(this.dimension)}getSplitViewRatio(){let e;if(this.splitview){const t=this.splitview.getViewSize(0),i=this.splitview.getViewSize(1);if(Math.abs(t-i)>1){const s=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/s}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new x7(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===vi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=A1.Distribute,s=A1.Distribute;if(t){const a=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),s=a-i,this.splitview.layout(this.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=ws(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},i);const r=ws(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},s),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(X5t,0,"Side by Side Editor")}async setInput(e,t,i,s){const o=this.input;await super.setInput(e,t,i,s),(!o||!e.matches(o))&&(o&&this.disposeEditors(),this.createEditors(e));const{primary:r,secondary:a,viewState:c}=this.loadViewState(e,t,i);if(this.lastFocusedSide=c?.focus,typeof c?.ratio=="number"&&this.splitview){const l=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;this.splitview.resizeView(0,Math.round(l*c.ratio))}else this.splitview?.distributeViewSizes();await Promise.all([this.secondaryEditorPane?.setInput(e.secondary,a,i,s),this.primaryEditorPane?.setInput(e.primary,r,i,s)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const s=Z5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===go.SECONDARY?r={...t}:o={...t},o.viewState=s?.primary,s?.secondary&&(r?r.viewState=s?.secondary:r={viewState:s.secondary}),{primary:o,secondary:r,viewState:s}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,ws(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,ws(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=T.any(T.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),T.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.SECONDARY)))}doCreateEditor(e,t){const i=it.as(zS.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const s=i.instantiate(this.instantiationService,this.group);return s.create(t),s.setVisible(this.isVisible()),uVe(s)&&this.editorDisposables.add(s.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(s),s}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(uVe(e)){const t=e.getSelection();if(t)return new ZFe(t,e===this.primaryEditorPane?go.PRIMARY:go.SECONDARY)}}setOptions(e){super.setOptions(e),typeof e?.target=="number"&&(this.lastFocusedSide=e.target),this.getLastFocusedEditorPane()?.setOptions(e)}setEditorVisible(e){this.primaryEditorPane?.setVisible(e),this.secondaryEditorPane?.setVisible(e),super.setEditorVisible(e)}clearInput(){super.clearInput(),this.primaryEditorPane?.clearInput(),this.secondaryEditorPane?.clearInput(),this.disposeEditors()}focus(){super.focus(),this.getLastFocusedEditorPane()?.focus()}getLastFocusedEditorPane(){return this.lastFocusedSide===go.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,ws(this.splitview).layout(this.orientation===vi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===vi.HORIZONTAL?new Tn(t,this.dimension.height):new Tn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof _m}computeEditorViewState(e){if(!this.input||!_n(e,this.toEditorViewStateResource(this.input)))return;const t=this.primaryEditorPane?.getViewState(),i=this.secondaryEditorPane?.getViewState();if(!(!t||!i))return{primary:t,secondary:i,focus:this.lastFocusedSide,ratio:this.getSplitViewRatio()}}toEditorViewStateResource(e){let t,i;if(e instanceof _m&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return P.from({scheme:"sideBySide",path:`${O9(i.toString())}${O9(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===vi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(HTt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(WTt)??"",this.primaryEditorContainer.style.borderLeftWidth="0"))}dispose(){this.disposeEditors(),super.dispose()}disposeEditors(){this.editorDisposables.clear(),this.secondaryEditorPane=void 0,this.primaryEditorPane=void 0,this.lastFocusedSide=void 0,this.secondaryEditorContainer&&Yo(this.secondaryEditorContainer),this.primaryEditorContainer&&Yo(this.primaryEditorContainer)}},nT=XE,XE.ID=QLt,XE.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",XE.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",XE);gxe=nT=D([_(1,rn),_(2,be),_(3,pn),_(4,on),_(5,Re),_(6,dl),_(7,_i),_(8,ur)],gxe);class ZFe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof ZFe)||this.side!==e.side?Jk.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const H5e="vs/workbench/browser/editor",ey=class ey{static didInstantiateEditorPane(e){return ey.instantiatedEditorPanes.has(e)}static create(e,t,i){return new ey(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){ey._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return ey.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};ey.instantiatedEditorPanes=new Set,ey._onWillInstantiateEditorPane=new I,ey.onWillInstantiateEditorPane=ey._onWillInstantiateEditorPane.event;let U5e=ey;class e3t{constructor(){this.mapEditorPanesToEditors=new Map}registerEditorPane(e,t){return this.mapEditorPanesToEditors.set(e,t),Ee(()=>{this.mapEditorPanesToEditors.delete(e)})}getEditorPane(e){const t=this.findEditorPaneDescriptors(e);if(t.length!==0)return t.length===1?t[0]:e.prefersEditorPane(t)}findEditorPaneDescriptors(e,t){const i=[];for(const s of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(s)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(s);break}else if(t&&e instanceof a){i.push(s);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return fi.find(this.mapEditorPanesToEditors.keys(),t=>t.typeId===e)}getEditorPanes(){return Array.from(this.mapEditorPanesToEditors.keys())}getEditors(){const e=[];for(const t of this.mapEditorPanesToEditors.keys()){const i=this.mapEditorPanesToEditors.get(t);i&&e.push(...i.map(s=>s.ctor))}return e}}it.add(zS.EditorPane,new e3t);function t3t(n,e){const t=n.get(_i),i=n.get(_o),s=n.get(Pw);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===mx.MOVE)return;let l=jc.getOriginalUri(c.editor,{supportSideBySide:go.PRIMARY}),d=jc.getOriginalUri(c.editor,{supportSideBySide:go.SECONDARY});if(c.context===mx.REPLACE){const h=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),u=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(r=r.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==mx.REPLACE&&(l?.scheme===_e.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===_e.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>s.isDirty(u));return h.length>0&&await ko.settled(h.map(async u=>await new Promise(f=>{if(!s.isDirty(u))return f();const p=s.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function i3t(n,e,t,i){let s=n.getAriaLabel();return t&&!t.isPinned(n)&&(s=g(H5e,0,"{0}, preview",s)),t?.isSticky(n)&&(s=g(H5e,1,"{0}, pinned",s)),t&&typeof i=="number"&&i>1&&(s=`${s}, ${t.ariaLabel}`),s}var fxe;const n3t="vs/workbench/browser/parts/editor/textEditor";var cP;let pxe=(cP=class extends one{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,fxe.VIEW_STATE_PREFERENCE_KEY,i,s,o,r,a,c,l),this.fileService=d,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeScroll=this._register(new I),this.onDidChangeScroll=this._onDidChangeScroll.event,this.inputListener=this._register(new Dn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(T.any(this.editorGroupService.onDidAddGroup,this.editorGroupService.onDidRemoveGroup)(()=>{const h=this.computeAriaLabel();this.editorContainer?.setAttribute("aria-label",h),this.updateEditorControlOptions({ariaLabel:h})})),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(h=>this.onDidChangeFileSystemProvider(h.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(h=>this.onDidChangeFileSystemProvider(h.scheme)))}handleConfigurationChangeEvent(e){const t=this.getActiveResource();this.shouldHandleConfigurationChangeEvent(e,t)&&(this.isVisible()?this.updateEditorConfiguration(t):this.hasPendingConfigurationChange=!0)}shouldHandleConfigurationChangeEvent(e,t){return e.affectsConfiguration(t,"editor")||e.affectsConfiguration(t,"problems.visibility")}consumePendingConfigurationChangeEvent(){this.hasPendingConfigurationChange&&(this.updateEditorConfiguration(),this.hasPendingConfigurationChange=!1)}computeConfiguration(e){const t=fo(e.editor)?Vs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?i3t(this.input,void 0,this.group,this.editorGroupService.count):g(n3t,0,"Editor")}onDidChangeFileSystemProvider(e){this.input&&this.getActiveResource()?.scheme===e&&this.updateReadonly(this.input)}onDidChangeInputCapabilities(e){this.input===e&&this.updateReadonly(e)}updateReadonly(e){this.updateEditorControlOptions({...this.getReadonlyConfiguration(e.isReadonly())})}getReadonlyConfiguration(e){return{readOnly:!!e,readOnlyMessage:typeof e!="boolean"?e:void 0}}getConfigurationOverrides(e){return{overviewRulerLanes:3,lineNumbersMinChars:3,fixedOverflowWidgets:!0,...this.getReadonlyConfiguration(this.input?.isReadonly()),renderValidationDecorations:e.problems?.visibility!==!1?"on":"off"}}createEditor(e){this.editorContainer=e,this.createEditorControl(e,this.computeConfiguration(this.textResourceConfigurationService.getValue(this.getActiveResource()))),this.registerCodeEditorListeners()}registerCodeEditorListeners(){const e=this.getMainControl();e&&(this._register(e.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeModel(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeCursorPosition(t=>this._onDidChangeSelection.fire({reason:this.toEditorPaneSelectionChangeReason(t)}))),this._register(e.onDidChangeModelContent(()=>this._onDidChangeSelection.fire({reason:RT.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case jb.PROGRAMMATIC:return RT.PROGRAMMATIC;case jb.NAVIGATION:return RT.NAVIGATION;case jb.JUMP:return RT.JUMP;default:return RT.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new mxe(t)}}async setInput(e,t,i,s){await super.setInput(e,t,i,s),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),ws(this.editorContainer).setAttribute("aria-label",this.computeAriaLabel())}clearInput(){this.inputListener.clear(),super.clearInput()}getScrollPosition(){const e=this.getMainControl();if(!e)throw new Error("Control has not yet been initialized");return{scrollTop:e.getScrollTop()-e.getTopForLineNumber(1),scrollLeft:e.getScrollLeft()}}setScrollPosition(e){const t=this.getMainControl();if(!t)throw new Error("Control has not yet been initialized");t.setScrollTop(e.scrollTop),e.scrollLeft&&t.setScrollLeft(e.scrollLeft)}setEditorVisible(e){e&&this.consumePendingConfigurationChangeEvent(),super.setEditorVisible(e)}toEditorViewStateResource(e){return e.resource}updateEditorConfiguration(e=this.getActiveResource()){let t;if(e&&(t=this.textResourceConfigurationService.getValue(e)),!t)return;const i=this.computeConfiguration(t);let s=i;this.lastAppliedEditorOptions&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(s))}getActiveResource(){const e=this.getMainControl();if(e){const t=e.getModel();if(t)return t.uri}if(this.input)return this.input.resource}dispose(){this.lastAppliedEditorOptions=void 0,super.dispose()}},fxe=cP,cP.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",cP);pxe=fxe=D([_(2,rn),_(3,be),_(4,on),_(5,dl),_(6,pn),_(7,_i),_(8,ur),_(9,ci)],pxe);const r9=class r9{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof r9))return Jk.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Jk.IDENTICAL:Math.abs(t-i){this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get hasLanguageSetExplicitly(){return this._hasLanguageSetExplicitly}setLanguageId(e,t){this._hasLanguageSetExplicitly=!0,this.setLanguageIdInternal(e,t)}setLanguageIdInternal(e,t){this.isResolved()&&(!e||e===this.textEditorModel.getLanguageId()||this.textEditorModel.setLanguage(this.languageService.createById(e),t))}installModelListeners(e){const t=this._register(e.onDidChangeLanguage(i=>{i.source!==V5e&&(this._hasLanguageSetExplicitly=!0,t.dispose())}))}getLanguageId(){return this.textEditorModel?.getLanguageId()}autoDetectLanguage(){return this.autoDetectLanguageThrottler.trigger(()=>this.doAutoDetectLanguage())}async doAutoDetectLanguage(){if(this.hasLanguageSetExplicitly||!this.textEditorModelHandle||!this.languageDetectionService.isEnabledForLanguage(this.getLanguageId()??Yc))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,V5e);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(o3t,0,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const s=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,s);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let s=i&&this.modelService.getModel(i);return s?this.updateTextEditorModel(e,t.languageId):(s=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(s)),this.textEditorModelHandle=s.uri,s}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,s){return!i||i===Yc?t.createByFilepathOrFirstLine(e??null,s):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Yc&&this.textEditorModel.getLanguageId()!==t&&this.textEditorModel.setLanguage(this.languageService.createById(t)))}createSnapshot(){return this.textEditorModel?this.textEditorModel.createSnapshot(!0):null}isResolved(){return!!this.textEditorModelHandle}dispose(){this.modelDisposeListener.dispose(),this.textEditorModelHandle&&this.createdEditorModel&&this.modelService.destroyModel(this.textEditorModelHandle),this.textEditorModelHandle=void 0,this.createdEditorModel=!1,super.dispose()}},_xe=lP,lP.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,lP);H1=_xe=D([_(0,Ai),_(1,Di),_(2,LQ),_(3,Ur)],H1);class bst extends pL{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}class Cst extends bst{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}constructor(e,t){super(e,t),this._textDiffEditorModel=void 0,this._originalModel=e,this._modifiedModel=t,this.updateTextDiffEditorModel()}async resolve(){await super.resolve(),this.updateTextDiffEditorModel()}updateTextDiffEditorModel(){this.originalModel?.isResolved()&&this.modifiedModel?.isResolved()&&(this._textDiffEditorModel?(this._textDiffEditorModel.original=this.originalModel.textEditorModel,this._textDiffEditorModel.modified=this.modifiedModel.textEditorModel):this._textDiffEditorModel={original:this.originalModel.textEditorModel,modified:this.modifiedModel.textEditorModel})}isResolved(){return!!this._textDiffEditorModel}isReadonly(){return!!this.modifiedModel&&this.modifiedModel.isReadonly()}dispose(){this._textDiffEditorModel=void 0,super.dispose()}}var cX;const r3t="vs/workbench/common/editor/diffEditorInput";var dP;let op=(dP=class extends _m{get typeId(){return cX.ID}get editorId(){return this.modified.editorId===this.original.editorId?this.modified.editorId:void 0}get capabilities(){let e=super.capabilities;return this.labels.forceDescription&&(e|=Mi.ForceDescription),e}constructor(e,t,i,s,o,r){super(e,t,i,s,r),this.original=i,this.modified=s,this.forceOpenAsBinary=o,this.cachedModel=void 0,this.labels=this.computeLabels()}computeLabels(){let e,t=!1;if(this.preferredName)e=this.preferredName;else{const d=this.original.getName(),h=this.modified.getName();e=g(r3t,0,"{0} ↔ {1}",d,h),t=d===h}let i,s,o;if(this.preferredDescription)i=this.preferredDescription,s=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Gs.SHORT),this.modified.getDescription(Gs.SHORT)),o=this.computeLabel(this.original.getDescription(Gs.LONG),this.modified.getDescription(Gs.LONG));const d=this.original.getDescription(Gs.MEDIUM),h=this.modified.getDescription(Gs.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=rPt([d,h]);s=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Gs.SHORT)??this.original.getName(),this.modified.getTitle(Gs.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Gs.MEDIUM)??this.original.getName(),this.modified.getTitle(Gs.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Gs.LONG)??this.original.getName(),this.modified.getTitle(Gs.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:s,longDescription:o,forceDescription:t,shortTitle:r,mediumTitle:a,longTitle:c}}computeLabel(e,t,i=" - "){if(!(!e||!t))return e===t?t:`${e}${i}${t}`}getName(){return this.labels.name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.labels.shortDescription;case Gs.LONG:return this.labels.longDescription;case Gs.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Gs.SHORT:return this.labels.shortTitle;case Gs.LONG:return this.labels.longTitle;default:case Gs.MEDIUM:return this.labels.mediumTitle}}async resolve(){const e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(t=>t.typeId===jLt):e.find(t=>t.typeId===SZe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof H1&&e instanceof H1?new Cst(e,t):new bst(mUe(e)?e:void 0,mUe(t)?t:void 0)}toUntyped(e){const t=super.toUntyped(e);if(t)return{...t,modified:t.primary,original:t.secondary}}matches(e){return this===e?!0:e instanceof cX?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:Gv(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},cX=dP,dP.ID="workbench.editors.diffEditorInput",dP);op=cX=D([_(5,_i)],op);var vxe;const Rpe="vs/workbench/browser/parts/editor/textDiffEditor";var hP;let z5e=(hP=class extends pxe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Pe))}constructor(e,t,i,s,o,r,a,c,l,d){super(vxe.ID,e,t,i,s,o,a,r,c,l),this.preferencesService=d,this.diffEditorControl=void 0,this.inputLifecycleStopWatch=void 0,this._previousViewModel=null}getTitle(){return this.input?this.input.getName():g(Rpe,0,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(Dm,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,s){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,s);try{const o=await e.resolve();if(s.isCancellationRequested)return;if(!(o instanceof Cst)){this.openAsBinary(e,t);return}const r=ws(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;_Pe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=rne(t,r,vt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new ao(!1)}catch(o){await this.handleSetInputError(o,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===Zi.FILE_TOO_LARGE){let s;throw e instanceof hJ?s=g(Rpe,1,"At least one file is not displayed in the text compare editor because it is very large ({0}).",vl.formatSize(e.size)):s=g(Rpe,2,"At least one file is not displayed in the text compare editor because it is very large."),ZLt(this.group,t,i,s,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,s){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),s.restoreViewState(o),t?.revealIfVisible&&s.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,s=e.modified,o=this.instantiationService.createInstance(op,e.getName(),e.getDescription(),i,s,!0),r=it.as(zS.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(s)&&s.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:y1.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&rne(e,ws(this.diffEditorControl),vt.Smooth)}shouldHandleConfigurationChangeEvent(e,t){return super.shouldHandleConfigurationChangeEvent(e,t)?!0:e.affectsConfiguration(t,"diffEditor")||e.affectsConfiguration(t,"accessibility.verbosity.diffEditor")}computeConfiguration(e){const t=super.computeConfiguration(e);if(fo(e.diffEditor)){const s=Vs(e.diffEditor);s.diffCodeLens=s.codeLens,delete s.codeLens,s.diffWordWrap=s.wordWrap,delete s.wordWrap,Object.assign(t,s)}const i=e.accessibility?.verbosity?.diffEditor??!1;return t.accessibilityVerbose=i,t}getConfigurationOverrides(e){return{...super.getConfigurationOverrides(e),...this.getReadonlyConfiguration(this.input?.isReadonly()),originalEditable:this.input instanceof op&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof op?this.diffEditorControl?.updateOptions({...this.getReadonlyConfiguration(e.isReadonly()),originalEditable:!e.original.isReadonly()}):super.updateReadonly(e)}isFileBinaryError(e){return Array.isArray(e)?e.some(i=>this.isFileBinaryError(i)):e.textFileOperationResult===xV.FILE_IS_BINARY}clearInput(){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),super.clearInput();const e=this.inputLifecycleStopWatch?.elapsed();this.inputLifecycleStopWatch=void 0,typeof e=="number"&&this.logInputLifecycleTelemetry(e,this.getControl()?.getModel()?.modified?.getLanguageId()),this.diffEditorControl?.setModel(null)}logInputLifecycleTelemetry(e,t){let i=!1;this.diffEditorControl instanceof Dm&&(i=this.diffEditorControl.collapseUnchangedRegions),this.telemetryService.publicLog2("diffEditor.editorVisibleTime",{editorVisibleTimeMs:e,languageId:t??"",collapseUnchangedRegions:i})}getControl(){return this.diffEditorControl}focus(){super.focus(),this.diffEditorControl?.focus()}hasFocus(){return this.diffEditorControl?.hasTextFocus()||super.hasFocus()}setEditorVisible(e){super.setEditorVisible(e),e?this.diffEditorControl?.onVisible():this.diffEditorControl?.onHide()}layout(e){this.diffEditorControl?.layout(e)}setBoundarySashes(e){this.diffEditorControl?.setBoundarySashes(e)}tracksEditorViewState(e){return e instanceof op}computeEditorViewState(e){if(!this.diffEditorControl)return;const t=this.diffEditorControl.getModel();if(!t||!t.modified||!t.original)return;const i=this.toEditorViewStateResource(t);if(i&&_n(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof op?(t=e.original.resource,i=e.modified.resource):ja(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return P.from({scheme:"diff",path:`${O9(t.toString())}${O9(i.toString())}`})}},vxe=hP,hP.ID=SZe,hP);z5e=vxe=D([_(1,rn),_(2,be),_(3,on),_(4,dl),_(5,_i),_(6,pn),_(7,ur),_(8,ci),_(9,TQ)],z5e);function ane(n,e,t=wx){if(t===wx||t===Cw)return t;let i=n.getGroups(gg.GRID_APPEARANCE)[t];if(!i&&t<9){for(let s=0;s<=t;s++){const o=n.getGroups(gg.GRID_APPEARANCE);o[s]||n.addGroup(o[s-1],w6(e))}i=n.getGroups(gg.GRID_APPEARANCE)[t]}return i?.id??Cw}function U1(n,e){const t=typeof e=="number"?n.getGroup(e):e;return n.getGroups(gg.GRID_APPEARANCE).indexOf(t??n.activeGroup)}const a3t="workbench.action.closeEditorsAndGroup";function c3t(n,e,t){const i=e.lastFocusedList;if(i instanceof Fc&&i.getHTMLElement()===xl()){const s=c=>{if(wEe(c))return{groupId:c.id,editorIndex:void 0};const l=t.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?l.getIndexOfEditor(c.editor):-1}},o=c=>wEe(c)||UCe(c),r=i.getFocusedElements().filter(o),a=n||(r.length?r.map(s)[0]:void 0);if(a){const c=i.getSelectedElements().filter(o);return c.length>1?c.map(s):[a]}}else{const s=n?t.getGroup(n.groupId):t.activeGroup,o=n&&n.editorIndex!==void 0?s?.getEditorByIndex(n.editorIndex):s?.activeEditor;if(s&&o&&s.isSelected(o))return s.selectedEditors.map(r=>({groupId:s.id,editorIndex:s.getIndexOfEditor(r)}))}return n?[n]:[]}class l3t{constructor(e){this.root=new cne;for(const[t,i]of e)for(const s of i)this.root.add(t,s)}toString(){return this.root.toString()}getAttributes(e,t){const i=e.lastIndexOf(".");return i<1?{dirname:t,basename:e,extname:""}:{dirname:t,basename:e.substring(0,i),extname:e.substring(i+1)}}nest(e,t){const i=new cne;for(const r of e){const a=this.getAttributes(r,t),c=this.root.get(r,a);for(const l of c)i.add(l,r)}const s=(r,a=new Set)=>{if(a.has(r))return[];a.add(r);const c=this.getAttributes(r,t),l=i.get(r,c);return l.length===0?[r]:l.length===1&&l[0]===r?[r]:l.flatMap(d=>s(d,a))},o=new Map;for(const r of e){let a=s(r);a.length===0&&(a=[r]);for(const c of a){let l=o.get(c);l||o.set(c,l=new Set),r!==c&&l.add(r)}}return o}}class cne{constructor(){this.value=new eOe,this.map=new Map}add(e,t){if(e==="")this.value.add(e,t);else if(e[0]==="*")this.value.add(e,t);else{const i=e[0],s=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new cne),o.add(s,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const s=e[0],o=e.slice(1),r=this.map.get(s);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => +`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(vr.Chat);let i="";const n=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(n){case 0:break;case 1:o=g(7006,"1 file tree");break;default:o=g(7007,"{0} file trees",n);break}const r=zu.lexer(e.response.toString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(7008,"{0} {1} {2}",o,e.response.toString(),t):g(7009,"{0} {1}",o,e.response.toString());break;case 1:i=t?g(7010,"{0} 1 code block: {1} {2}",o,e.response.toString(),t):g(7011,"{0} 1 code block: {1}",o,e.response.toString());break;default:i=t?g(7012,"{0} {1} code blocks: {2}",o,r,e.response.toString(),t):g(7013,"{0} {1} code blocks",o,r,e.response.toString());break}return i}};vCe=D([_(0,Dm)],vCe);let bCe=class extends zf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,o,r,a,c,l,d,h){super(null,e,{hoverDelegate:r?.hoverDelegate}),this._contextMenuProvider=o,this._options=r,this._container=null,this._dropdownContainer=null,this._primaryAction=new Lb(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new sA(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:n?["codicon","codicon-chevron-down",n]:["codicon","codicon-chevron-down"],actionRunner:this._options?.actionRunner,keybindingProvider:this._options?.getKeyBinding,hoverDelegate:r?.hoverDelegate})}setActionContext(e){super.setActionContext(e),this._primaryAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-primary");const t=fe(".action-container");this._primaryAction.render(re(this._container,t)),this._dropdownContainer=fe(".dropdown-action-container"),this._dropdown.render(re(this._container,this._dropdownContainer)),this._register(ue(t,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),n.stopPropagation())})),this._register(ue(this._dropdownContainer,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),n.stopPropagation())})),this.updateEnabled()}focus(e){e?this._dropdown.focus():(this._primaryAction.element.tabIndex=0,this._primaryAction.element.focus())}blur(){this._primaryAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._primaryAction.element.tabIndex=0:(this._primaryAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}updateEnabled(){const e=!this.action.enabled;this.element?.classList.toggle("disabled",e)}update(e,t,i){this._dropdown.dispose(),this._dropdown=new sA(e,t,this._contextMenuProvider,{menuAsChild:!0,classNames:["codicon",i||"codicon-chevron-down"],actionRunner:this._options?.actionRunner,hoverDelegate:this._options?.hoverDelegate,keybindingProvider:this._options?.getKeyBinding}),this._dropdownContainer&&this._dropdown.render(this._dropdownContainer)}dispose(){this._primaryAction.dispose(),this._dropdown.dispose(),super.dispose()}};bCe=D([_(6,Ut),_(7,bi),_(8,Le),_(9,pn),_(10,mr)],bCe);const Eoe=class Eoe extends li{constructor(){super({id:Eoe.ID,title:Pe(7120,"Send"),f1:!1,category:Ttt,icon:ve.send,precondition:he.and(CMe,K3.negate()),keybinding:{when:SMe,primary:S.Enter,weight:Ae.EditorContrib},menu:[{id:_e.ChatExecuteSecondary,group:"group_1"},{id:_e.ChatExecute,when:K3.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],n=e.get(UN);(i?.widget??n.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Eoe.ID="workbench.action.chat.submit";let wCe=Eoe;const xoe=class xoe extends li{constructor(){super({id:xoe.ID,title:Pe(7121,"Submit to Secondary Agent"),precondition:he.and(CMe,JXe.negate(),K3.negate()),keybinding:{when:SMe,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib},menu:{id:_e.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(_f).getSecondaryAgent();if(!o)return;const r=e.get(UN),a=i?.widget??r.lastFocusedWidget;a&&(O4t(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${QU}${o.name}`)))}};xoe.ID="workbench.action.chat.submitSecondaryAgent";let yCe=xoe;const Doe=class Doe extends li{constructor(){super({id:Doe.ID,title:Pe(7123,"Cancel"),f1:!1,category:Ttt,icon:ve.debugStop,menu:{id:_e.ChatExecute,when:K3,group:"navigation"},keybinding:{weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.Escape,win:{primary:U.Alt|S.Backspace}}})}run(e,...t){const i=t[0],n=e.get(UN),o=i?.widget??n.lastFocusedWidget;if(!o)return;const r=e.get(km);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Doe.ID="workbench.action.chat.cancel";let CCe=Doe;const xVt=fe;let gZ=class extends V{constructor(e,t,i,n,o,r){super(),this.location=i,this.options=n,this.clickHandler=o,this.chatAgentService=r;const a=re(e,xVt(".interactive-session-followups"));t.forEach(c=>this.renderFollowup(a,c))}renderFollowup(e,t){if(!this.chatAgentService.getDefaultAgent(this.location))return;let i="";if("agentId"in t&&t.agentId&&t.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const c=this.chatAgentService.getAgent(t.agentId);if(!c)return;i+=`${QU}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${nI}${t.subCommand} `)}const n=t.kind==="reply"?t.title||t.message:t.title,o=t.kind==="reply"?t.message:t.title,r=(i+("tooltip"in t&&t.tooltip||o)).trim(),a=this._register(new Jd(e,{...this.options,title:r}));t.kind==="reply"?a.element.classList.add("interactive-followup-reply"):t.kind==="command"&&a.element.classList.add("interactive-followup-command"),a.element.ariaLabel=g(10555,"Follow up question: {0}",n),a.label=new Mt(n),this._register(a.onDidClick(()=>this.clickHandler(t)))}};gZ=D([_(5,_f)],gZ);var bQ;const zI=fe,y4e=250;var nk;let fZ=(nk=class extends V{get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=n,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this.logService=d,this._onDidLoadInputState=this._register(new I),this.onDidLoadInputState=this._onDidLoadInputState.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.event,this._onDidAcceptFollowup=this._register(new I),this.onDidAcceptFollowup=this._onDidAcceptFollowup.event,this._indexOfLastAttachedContextDeletedWithKeyboard=-1,this._attachedContext=new Set,this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.inHistoryNavigation=!1,this.inputUri=N.parse(`${bQ.INPUT_SCHEME}:input-${bQ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?y4e/3:y4e,this.inputEditorHasText=CMe.bindTo(r),this.chatCursorAtTop=ENt.bindTo(r),this.inputEditorHasFocus=SNt.bindTo(r),this.history=this.loadHistory(),this._register(this.historyService.onDidClearHistory(()=>this.history=new J2e([{text:""}],50,C4e))),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(vr.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}loadHistory(){const e=this.historyService.getHistory(this.location);return e.length===0&&e.push({text:""}),new J2e(e,50,C4e)}_getAriaLabel(){if(this.configurationService.getValue(vr.Chat)){const t=this.keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getLabel();return t?g(7014,"Chat Input, Type to ask questions or type / for topics, press enter to send out the request. Use {0} for Chat Accessibility Help.",t):g(7015,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(7016,"Chat Input")}updateState(e){if(this.inHistoryNavigation)return;const t={text:this._inputEditor.getValue(),state:e};this.history.isAtEnd()?this.history.replaceLast(t):(this.history.replaceLast(t),this.history.resetCursor())}initForNewChatModel(e,t){this.history=this.loadHistory(),this.history.add({text:e??this.history.current().text,state:t}),e&&this.setValue(e,!1)}logInputHistory(){const e=[...this.history].map(t=>JSON.stringify(t)).join(` +`);this.logService.info(`[${this.location}] Chat input history:`,e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.history.isAtEnd()?this.saveCurrentValue():this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!0)}showNextValue(){this.history.isAtEnd()||(this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!1))}navigateHistory(e){const t=e?this.history.previous():this.history.next();if(Ah(t.text),this.inHistoryNavigation=!0,this.setValue(t.text,!0),this.inHistoryNavigation=!1,this._onDidLoadInputState.fire(t.state),e)this._inputEditor.setPosition({lineNumber:1,column:1});else{const i=this._inputEditor.getModel();if(!i)return;this._inputEditor.setPosition(S4e(i))}}setValue(e,t){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1}),t||this.saveCurrentValue()}saveCurrentValue(){const e={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(e)}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e){if(e){const i={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(i),this.history.add({text:""})}this._onDidLoadInputState.fire({}),this.accessibilityService.isScreenReaderOptimized()&&Qt?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(e.remove(),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}clearContext(){if(this._attachedContext.size>0){const e=Array.from(this._attachedContext);this._attachedContext.clear(),this._onDidChangeContext.fire({removed:e})}}attachContext(e,...t){const i=[];if(e&&(i.push(...Array.from(this._attachedContext)),this._attachedContext.clear()),t.length>0)for(const n of t)this._attachedContext.add(n);(i.length>0||t.length>0)&&(this.initAttachedContext(this.attachedContextContainer),e||this._onDidChangeContext.fire({removed:i,added:t}))}render(e,t,i){this.container=re(e,zI(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=re(this.container,zI(".interactive-input-followups")),this.attachedContextContainer=re(this.container,zI(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const n=re(this.container,zI(".interactive-input-and-side-toolbar")),o=re(n,zI(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));SMe.bindTo(r).set(!0);const a=this._register(this.instantiationService.createChild(new Uc([Le,r]))),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(oce(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=wNe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=XTe,d.fontSize=13,d.lineHeight=20,d.padding=this.options.renderStyle==="compact"?{top:2,bottom:2}:{top:8,bottom:8},d.cursorWidth=1,d.wrappingStrategy="advanced",d.bracketPairColorization={enabled:!1},d.suggest={showIcons:!1,showSnippets:!1,showWords:!0,showStatusBar:!1,insertMode:"replace"},d.scrollbar={...d.scrollbar??{},vertical:"hidden"},d.stickyScroll={enabled:!1},this._inputEditorElement=re(o,zI(".interactive-input-editor"));const h=bVt();if(h.contributions?.push(...ap.getSomeEditorContributions([Pa.ID])),this._inputEditor=this._register(a.createInstance(Hk,this._inputEditorElement,d,h)),this._register(this._inputEditor.onDidChangeModelContent(()=>{const f=Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight);f!==this.inputEditorHeight&&(this.inputEditorHeight=f,this._onDidChangeHeight.fire());const p=this._inputEditor.getModel(),m=!!p&&p.getValue().trim().length>0;this.inputEditorHasText.set(m)})),this._register(this._inputEditor.onDidFocusEditorText(()=>{this.inputEditorHasFocus.set(!0),this._onDidFocus.fire(),o.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),o.classList.toggle("focused",!1),this._onDidBlur.fire()})),this._register(this._inputEditor.onDidChangeCursorPosition(f=>{const p=this._inputEditor.getModel();if(!p)return;const m=f.position.column===1&&f.position.lineNumber===1;this.chatCursorAtTop.set(m),this.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(S4e(p)))})),this.toolbar=this._register(this.instantiationService.createInstance(bm,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:aA.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===Ir.Panel&&(f.id===wCe.ID||f.id===CCe.ID)&&f instanceof Sc){const m=this.instantiationService.createInstance(Sc,{id:"chat.moreExecuteActions",title:g(7017,"More..."),icon:ve.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(SCe,f,m)}}})),this.toolbar.getElement().classList.add("interactive-execute-toolbar"),this.toolbar.context={widget:i},this._register(this.toolbar.onDidChangeMenuItems(()=>{this.cachedDimensions&&typeof this.cachedToolbarWidth=="number"&&this.cachedToolbarWidth!==this.toolbar.getItemsWidth()&&this.layout(this.cachedDimensions.height,this.cachedDimensions.width)})),this.options.menus.inputSideToolbar){const f=this._register(this.instantiationService.createInstance(bm,n,this.options.menus.inputSideToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0}}));this.inputSideToolbarContainer=f.getElement(),f.getElement().classList.add("chat-side-toolbar"),f.context={widget:i}}let u=this.modelService.getModel(this.inputUri);if(u||(u=this.modelService.createModel("",null,this.inputUri,!0),this._register(u)),this.inputModel=u,this.inputModel.updateOptions({bracketColorizationOptions:{enabled:!1,independentColorPoolPerBracketType:!1}}),this._inputEditor.setModel(this.inputModel),t){this.inputModel.setValue(t);const f=this.inputModel.getLineCount();this._inputEditor.setPosition({lineNumber:f,column:this.inputModel.getLineMaxColumn(f)})}}initAttachedContext(e){const t=e.offsetHeight;Ms(e),this.attachedContextDisposables.clear(),uTe(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((i,n)=>{const o=re(e,zI(".chat-attached-context-attachment.show-file-icons")),r=this._contextResourceLabels.create(o,{supportIcons:!0}),a=N.isUri(i.value)?i.value:i.value&&typeof i.value=="object"&&"uri"in i.value&&N.isUri(i.value.uri)?i.value.uri:void 0,c=i.value&&typeof i.value=="object"&&"range"in i.value&&F.isIRange(i.value.range)?i.value.range:void 0;if(a&&i.isFile){const h=Ko(a.path),u=Cb(a.path),f=`${h} ${u}`,p=c?g(7018,"Attached file, {0}, line {1} to line {2}",f,c.startLineNumber,c.endLineNumber):g(7019,"Attached file, {0}",f);r.setFile(a,{fileKind:ba.FILE,hidePath:!0,range:c}),o.ariaLabel=p,o.tabIndex=0}else{const h=i.fullName??i.name,u=i.icon?.id?`$(${i.icon.id}) ${h}`:h;r.setLabel(u,void 0),o.ariaLabel=g(7020,"Attached context, {0}",i.name),o.tabIndex=0}const l=new Jd(o,{supportIcons:!0});n===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&l.focus(),this.attachedContextDisposables.add(l),l.icon=ve.close;const d=l.onDidClick(h=>{if(this._attachedContext.delete(i),d.dispose(),d_(h)){const u=new En(h);(u.equals(S.Enter)||u.equals(S.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=n)}this._onDidChangeHeight.fire(),this._onDidChangeContext.fire({removed:[i]})});this.attachedContextDisposables.add(d)}),t!==e.offsetHeight&&this._onDidChangeHeight.fire()}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Ms(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance(gZ,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))),this._onDidChangeHeight.fire())}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new bn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const n=this.getLayoutData(),o=Math.min(n.inputPartEditorHeight,e-n.followupsHeight-n.inputPartVerticalPadding),r=t-n.inputPartHorizontalPadding;this.followupsContainer.style.width=`${r}px`,this._inputPartHeight=n.followupsHeight+o+n.inputPartVerticalPadding+n.inputEditorBorder+n.implicitContextHeight;const a=this._inputEditor.getScrollWidth(),l={width:t-n.inputPartHorizontalPadding-n.editorBorder-n.editorPadding-n.executeToolbarWidth-n.sideToolbarWidth-n.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==l.width||this.previousInputEditorDimension.height!==l.height)&&(this._inputEditor.layout(l),this.previousInputEditorDimension=l),i&&a<10)return this._layout(e,t,!1)}getLayoutData(){return{inputEditorBorder:2,followupsHeight:this.followupsContainer.offsetHeight,inputPartEditorHeight:Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight),inputPartHorizontalPadding:this.options.renderStyle==="compact"?8:40,inputPartVerticalPadding:this.options.renderStyle==="compact"?12:24,implicitContextHeight:this.attachedContextContainer.offsetHeight,editorBorder:2,editorPadding:12,toolbarPadding:4,executeToolbarWidth:this.cachedToolbarWidth=this.toolbar.getItemsWidth(),sideToolbarWidth:this.inputSideToolbarContainer?Pd(this.inputSideToolbarContainer)+4:0}}saveState(){const e=[...this.history];this.historyService.saveHistory(this.location,e)}},bQ=nk,nk.INPUT_SCHEME="chatSessionInput",nk._counter=0,nk);fZ=bQ=D([_(2,kJe),_(3,gi),_(4,we),_(5,Le),_(6,Te),_(7,Ut),_(8,mr),_(9,Ge)],fZ);const C4e=s=>JSON.stringify(s);function S4e(s){return{lineNumber:s.getLineCount(),column:s.getLineLength(s.getLineCount())+1}}let SCe=class extends bCe{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,[],"",n,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(_e.ChatExecuteSecondary,r),u=()=>{const f=[];fC(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===yCe.ID&&(m.label=g(7021,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};SCe=D([_(2,Oa),_(3,lr),_(4,_f),_(5,Le),_(6,Ut),_(7,bi),_(8,pn),_(9,mr)],SCe);var DVt='.monaco-action-bar .action-item .action-label.extension-action{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-action-bar .action-dropdown-item>.action-label.extension-action.label,.monaco-action-bar .action-item>.action-label.extension-action.label{padding:0 5px}.monaco-action-bar .action-dropdown-item>.monaco-dropdown .action-label{padding:0}.monaco-action-bar .action-item .action-label.extension-action.label{outline-offset:1px}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.text{height:auto;line-height:14px;width:auto}.monaco-action-bar .action-item .action-label.extension-action.built-in-status{border-color:var(--vscode-foreground)}.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{background-color:var(--vscode-extensionButton-background)!important}.monaco-action-bar .action-item .action-label.extension-action.label{color:var(--vscode-extensionButton-foreground)!important}.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label:hover{background-color:var(--vscode-extensionButton-hoverBackground)!important}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{background-color:var(--vscode-extensionButton-separator)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator.prominent{background-color:var(--vscode-extensionButton-prominentBackground)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent{color:var(--vscode-extensionButton-prominentForeground)!important}.monaco-action-bar .action-item.action-item:not(.disabled) .action-label.extension-action.label.prominent:hover{background-color:var(--vscode-extensionButton-prominentHoverBackground)}.monaco-action-bar .action-item .action-label.extension-action:not(.disabled){border:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{border-bottom:1px solid var(--vscode-contrastBorder);border-top:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-error:before{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning:before{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info:before{color:var(--vscode-editorInfo-foreground)}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.icon,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.text{margin-top:2px}.monaco-action-bar .action-item .action-label.extension-action.install.hide,.monaco-action-bar .action-item .action-label.extension-action.manage.hide,.monaco-action-bar .action-item.action-dropdown-item .action-label.extension-action.hide,.monaco-action-bar .action-item.action-dropdown-item.hide,.monaco-action-bar .action-item.disabled .action-label.disable-status.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.extension-sync,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide-when-disabled,.monaco-action-bar .action-item.disabled .action-label.extension-action.ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.install-other-server:not(.installing),.monaco-action-bar .action-item.disabled .action-label.extension-action.language,.monaco-action-bar .action-item.disabled .action-label.extension-action.migrate,.monaco-action-bar .action-item.disabled .action-label.extension-action.reload,.monaco-action-bar .action-item.disabled .action-label.extension-action.theme,.monaco-action-bar .action-item.disabled .action-label.extension-action.undo-ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.uninstall:not(.uninstalling),.monaco-action-bar .action-item.disabled .action-label.extension-action.update,.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide,.monaco-action-bar .action-item.disabled .action-label.extension-status.hide{display:none}.monaco-action-bar .action-item.disabled .action-label.extension-action.label{opacity:.4!important}.monaco-action-bar .action-item.checkbox-action-item.disabled{display:none}.monaco-action-bar .extension-action.label{display:inherit}.monaco-action-bar .action-item.disabled .action-label.extension-status:before{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-status-label:before{content:"\\2713";padding-right:4px}.monaco-action-bar .action-item.disabled .action-label.extension-action{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-action.text{font-style:italic;opacity:.9}';ut(DVt,{});const kVt="vscode://schemas/extensions";g(9412,"Extensions"),g(9413,"List of extensions which should be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(9415,"List of extensions recommended by VS Code that should not be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const A4e=["{"," // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations."," // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp",""," // List of extensions which should be recommended for users of this workspace.",' "recommendations": ['," "," ],"," // List of extensions recommended by VS Code that should not be recommended for users of this workspace.",' "unwantedRecommendations": ['," "," ]","}"].join(` +`);var E4e;(function(s){s[s.Local=1]="Local",s[s.Remote=2]="Remote",s[s.Web=3]="Web"})(E4e||(E4e={}));g(7542,"Extensions");var Gr;(function(s){s[s.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",s[s.DisabledByExtensionKind=1]="DisabledByExtensionKind",s[s.DisabledByEnvironment=2]="DisabledByEnvironment",s[s.EnabledByEnvironment=3]="EnabledByEnvironment",s[s.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",s[s.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",s[s.DisabledGlobally=6]="DisabledGlobally",s[s.DisabledWorkspace=7]="DisabledWorkspace",s[s.EnabledGlobally=8]="EnabledGlobally",s[s.EnabledWorkspace=9]="EnabledWorkspace"})(Gr||(Gr={}));var ACe;(function(s){s[s.Workspace=0]="Workspace",s[s.File=1]="File",s[s.Executable=2]="Executable",s[s.WorkspaceConfig=3]="WorkspaceConfig",s[s.DynamicWorkspace=4]="DynamicWorkspace",s[s.Experimental=5]="Experimental",s[s.Application=6]="Application"})(ACe||(ACe={}));const IVt="addRootFolder";Pe(5518,"Add Folder to Workspace...");const TVt="setRootFolder",Mtt="_workbench.pickWorkspaceFolder";_t.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:s=>s.get(ag).pickFileFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"_files.pickFolderAndOpen",handler:(s,e)=>s.get(ag).pickFolderAndOpen(e)});_t.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:s=>s.get(ag).pickFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:s=>s.get(ag).pickFileAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:s=>s.get(ag).pickWorkspaceAndOpen({forceNewWindow:!0})});_t.registerCommand({id:IVt,handler:async s=>{const e=s.get(iC),t=await Ntt(s);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});_t.registerCommand({id:TVt,handler:async s=>{const e=s.get(iC),t=s.get(yi),i=await Ntt(s);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(n=>({uri:n})))}});async function Ntt(s){const e=s.get(ag),t=s.get(bf);return await e.showOpenDialog({openLabel:vMe(g(5519,"&&Add")),title:g(5520,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}_t.registerCommand(Mtt,async function(s,e){const t=s.get(In),i=s.get(Fs),n=s.get(yi),o=s.get(gi),r=s.get(xi),a=n.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(Lr(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:Mx(o,r,u.uri,ba.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(5521,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||He.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});_t.registerCommand({id:"vscode.openFolder",handler:(s,e,t)=>{const i=s.get(vi);if(typeof t=="boolean"&&(t={forceNewWindow:t}),!e){const a={forceNewWindow:t?.forceNewWindow};return t?.forceLocalWindow&&(a.remoteAuthority=null,a.availableFileSystems=["file"]),i.executeCommand("_files.pickFolderAndOpen",a)}const n=N.from(e,!0),o={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},r=mae(n)||n.scheme===pe.untitled?{workspaceUri:n}:{folderUri:n};return i.executeCommand("_files.windowOpen",[r],o)},metadata:{description:"Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.",args:[{name:"uri",description:"(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder",constraint:s=>s==null||s instanceof N},{name:"options",description:"(optional) Options. Object with the following properties: `forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. `noRecentEntry`: Whether the opened URI will appear in the 'Open Recent' list. Defaults to false. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.",constraint:s=>s===void 0||typeof s=="object"||typeof s=="boolean"}]}});_t.registerCommand({id:"vscode.newWindow",handler:(s,e)=>{const t=s.get(vi),i={forceReuseWindow:e&&e.reuseWindow,remoteAuthority:e&&e.remoteAuthority};return t.executeCommand("_files.newWindow",i)},metadata:{description:"Opens an new window depending on the newWindow argument.",args:[{name:"options",description:"(optional) Options. Object with the following properties: `reuseWindow`: Whether to open a new window or the same. Defaults to opening in a new window. ",constraint:s=>s===void 0||typeof s=="object"}]}});_t.registerCommand("_workbench.removeFromRecentlyOpened",function(s,e){return s.get(xI).removeRecentlyOpened([e])});_t.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(s,e)=>{const t=s.get(xI);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?N.parse(e):N.file(e):e=N.revive(e),t.removeRecentlyOpened([e])},metadata:{description:"Removes an entry with the given path from the recently opened list.",args:[{name:"path",description:"URI or URI string to remove from recently opened.",constraint:s=>typeof s=="string"||s instanceof N}]}});_t.registerCommand("_workbench.addToRecentlyOpened",async function(s,e){const t=s.get(xI),i=e.uri,n=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:n,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:n,remoteAuthority:o}:r={fileUri:i,label:n,remoteAuthority:o},t.addRecentlyOpened([r])});_t.registerCommand("_workbench.getRecentlyOpened",async function(s){return s.get(xI).getRecentlyOpened()});const sG=pn,yF=".vscode/extensions.json";let x4e=class extends V{constructor(e,t,i,n,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=n,this.languageService=o,this.jsonEditingService=r,this._onDidChangeExtensionsConfigs=this._register(new I),this.onDidChangeExtensionsConfigs=this._onDidChangeExtensionsConfigs.event,this._register(e.onDidChangeWorkspaceFolders(a=>this._onDidChangeExtensionsConfigs.fire())),this._register(t.onDidFilesChange(a=>{const c=e.getWorkspace();(c.configuration&&a.affects(c.configuration)||c.folders.some(l=>a.affects(l.toResource(yF))))&&this._onDidChangeExtensionsConfigs.fire()}))}async getExtensionsConfigs(){const e=this.workspaceContextService.getWorkspace(),t=[],i=e.configuration?await this.resolveWorkspaceExtensionConfig(e.configuration):void 0;return i&&t.push(i),t.push(...await Promise.all(e.folders.map(n=>this.resolveWorkspaceFolderExtensionConfig(n)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return ja(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return ja(e.flatMap(t=>t.unwantedRecommendations?t.unwantedRecommendations.map(i=>i.toLowerCase()):[]))}async toggleRecommendation(e){e=e.toLowerCase();const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>n.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)Yme(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,n.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>n.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)Yme(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,n.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,n){const o=[];if(n){Array.isArray(i.recommendations)?o.push({path:["recommendations",-1],value:e}):o.push({path:["recommendations"],value:[e]});const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(yF),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,n){const o=[];if(i){if(n){const r=["extensions","recommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&o.push(a)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);r&&o.push(r)}}else n&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,n){const o=[];if(n){const r=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(yF),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,n){const o=[];if(i){if(n){const r=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}}else n&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const n=t?[...e,t]:[...e];if(n.length===1)return n;const o=e.map(a=>({label:a.name,description:g(3849,"Workspace Folder"),workspaceOrFolder:a,iconClasses:Mx(this.modelService,this.languageService,a.uri,ba.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(3850,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(o,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=sf(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(yF)),i=sf(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:ja((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:ja((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const n=t?.indexOf(i);if(n!==void 0&&n!==-1)return{path:[...e,n],value:void 0}}};x4e=D([_(0,yi),_(1,Jt),_(2,In),_(3,gi),_(4,xi),_(5,DI)],x4e);oi("extensions-view-icon",ve.extensions,g(9483,"View icon of the extensions view."));const LVt=oi("extensions-manage",ve.gear,g(9484,"Icon for the 'Manage' action in the extensions view."));oi("extensions-clear-search-results",ve.clearAll,g(9485,"Icon for the 'Clear Search Result' action in the extensions view."));oi("extensions-refresh",ve.refresh,g(9486,"Icon for the 'Refresh' action in the extensions view."));oi("extensions-filter",ve.filter,g(9487,"Icon for the 'Filter' action in the extensions view."));oi("extensions-install-local-in-remote",ve.cloudDownload,g(9488,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));oi("extensions-install-workspace-recommended",ve.cloudDownload,g(9489,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));oi("extensions-configure-recommended",ve.pencil,g(9490,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const RVt=oi("extensions-sync-enabled",ve.sync,g(9491,"Icon to indicate that an extension is synced.")),MVt=oi("extensions-sync-ignored",ve.syncIgnored,g(9492,"Icon to indicate that an extension is ignored when syncing."));oi("extensions-remote",ve.remote,g(9493,"Icon to indicate that an extension is remote in the extensions view and editor."));oi("extensions-install-count",ve.cloudDownload,g(9494,"Icon shown along with the install count in the extensions view and editor."));oi("extensions-rating",ve.star,g(9495,"Icon shown along with the rating in the extensions view and editor."));const NVt=oi("extensions-verified-publisher",ve.verifiedFilled,g(9496,"Icon used for the verified extension publisher in the extensions view and editor."));oi("extensions-pre-release",ve.versions,g(9497,"Icon shown for extensions having pre-release versions in extensions view and editor."));oi("extensions-sponsor",ve.heartFilled,g(9498,"Icon used for sponsoring extensions in the extensions view and editor."));oi("extensions-star-full",ve.starFull,g(9499,"Full star icon used for the rating in the extensions editor."));oi("extensions-star-half",ve.starHalf,g(9500,"Half star icon used for the rating in the extensions editor."));oi("extensions-star-empty",ve.starEmpty,g(9501,"Empty star icon used for the rating in the extensions editor."));const jC=oi("extensions-error-message",ve.error,g(9502,"Icon shown with a error message in the extensions editor.")),dh=oi("extensions-warning-message",ve.warning,g(9503,"Icon shown with a warning message in the extensions editor.")),e_=oi("extensions-info-message",ve.info,g(9504,"Icon shown with an info message in the extensions editor.")),$I=oi("extension-workspace-trust",ve.shield,g(9505,"Icon shown with a workspace trust message in the extension editor."));oi("extension-activation-time",ve.history,g(9506,"Icon shown with a activation time message in the extension editor."));function ECe(s){return s.scheme!==pe.file&&s.scheme!==pe.vscodeRemote}function yNe(s){if(s.folders.length)return s.folders.every(e=>ECe(e.uri))?s.folders[0].uri:void 0;if(s.configuration&&ECe(s.configuration))return s.configuration}function Ptt(s){return yNe(s)?.scheme}function Ftt(s){return yNe(s)!==void 0}function Ece(s){return s.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let D4e=class extends V{constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ci;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const n=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=Ece(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return n.push(this.createQuickPickItem("en","English")),n}createQuickPickItem(e,t,i){const n=t??e;let o;if(n!==e&&(o=`(${e})`),e.toLowerCase()===ql.toLowerCase()&&(o??="",o+=g(3255," (Current)")),i?.installCount){o??="";const r=i.installCount;let a;r>1e6?a=`${Math.floor(r/1e5)/10}M`:r>1e3?a=`${Math.floor(r/1e3)}K`:a=String(r),o+=` $(cloud-download) ${a}`}return{id:e,label:n,description:o}}};D4e=D([_(0,EI)],D4e);var yV,g0,SC,OP,f0,wQ,CV,BP,p0,yQ,CQ,SQ,AQ,EQ,SV,m0,_0,v0,b0,w0,xQ,DQ,kQ,IQ,AV,EV,AE,TQ,LQ;let zW=class extends rn{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=n,this.productService=o,this.openerService=r,this.notificationService=a,this.dialogService=c,this.commandService=l,this.logService=d,this.extensionManagementServerService=h,this.instantiationService=u,this.galleryService=f,this.extensionManifestPropertiesService=p}async run(){if(Fr(this.error))return;if(this.logService.error(this.error),this.error.name===uw.Unsupported){const r=Wn?g(7874,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(7875,"The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",this.extension.displayName||this.extension.identifier.id,r),{confirmed:c}=await this.dialogService.confirm({type:Xe.Info,message:a,primaryButton:g(7876,"&&More Information"),cancelButton:g(7877,"Close")});c&&this.openerService.open(Wn?N.parse("https://aka.ms/vscode-web-extensions-guide"):N.parse("https://aka.ms/vscode-remote"));return}if(uw.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:su(this.error),buttons:[{label:g(7878,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(LT,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}if([uw.Incompatible,uw.IncompatibleApi,uw.IncompatibleTargetPlatform,uw.Malicious,uw.Deprecated].includes(this.error.name)){await this.dialogService.info(su(this.error));return}if(uw.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(7880,"{0} cannot verify the '{1}' extension. Are you sure you want to install it?",this.productService.nameLong,this.extension.displayName||this.extension.identifier.id),buttons:[{label:g(7881,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(LT,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}const e=this.installOperation===LA.Update?g(7882,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(7883,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],n=await this.getDownloadUrl();n&&(t=g(7884,"Please check the [log]({0}) for more details.",`command:${uet}`),i.push({label:g(7885,"Try Downloading Manually..."),run:()=>this.openerService.open(n).then(()=>{this.notificationService.prompt(Xe.Info,g(7886,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(7887,"Install from VSIX..."),run:()=>this.commandService.executeCommand(XFt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(Xe.Error,o,i)}async getDownloadUrl(){if(dm||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Es.UNIVERSAL&&e!==Es.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,He.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Es.UNKNOWN)return N.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Es.UNDEFINED?`?targetPlatform=${e}`:""}`)}};zW=D([_(4,Er),_(5,Ao),_(6,bi),_(7,to),_(8,vi),_(9,Ge),_(10,dv),_(11,we),_(12,EI),_(13,Im)],zW);const Pv=class Pv extends rn{constructor(){super(...arguments),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._extension=null,this._hidden=!1,this.hideOnDisabled=!0}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}get hidden(){return this._hidden}set hidden(e){this._hidden!==e&&(this._hidden=e,this._onDidChange.fire({hidden:e}))}_setEnabled(e){super._setEnabled(e),this.hideOnDisabled&&(this.hidden=!e)}};Pv.EXTENSION_ACTION_CLASS="extension-action",Pv.TEXT_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} text`,Pv.LABEL_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} label`,Pv.PROMINENT_LABEL_ACTION_CLASS=`${Pv.LABEL_ACTION_CLASS} prominent`,Pv.ICON_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} icon`;let yn=Pv;class CNe extends yn{get menuActions(){return[...this._menuActions]}get extension(){return super.extension}set extension(e){this.extensionActions.forEach(t=>t.extension=e),super.extension=e}constructor(e,t,i){t=`${t} action-dropdown`,super(e,void 0,t),this.actionsGroups=i,this.menuActionClassNames=[],this._menuActions=[],this.menuActionClassNames=t.split(" "),this.hideOnDisabled=!1,this.extensionActions=i.flat(),this.update(),this._register(M.any(...this.extensionActions.map(n=>n.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(n=>this._register(n))}update(e){e||this.extensionActions.forEach(n=>n.update());const t=this.actionsGroups.map(n=>n.filter(o=>!o.hidden));let i=[];for(const n of t)n.length&&(i=[...i,...n,new Ar]);i=i.length?i.slice(0,i.length-1):i,this.primaryAction=i[0],this._menuActions=i.length>1?i:[],this._onDidChange.fire({menuActions:this._menuActions}),this.primaryAction?(this.hidden=!1,this.enabled=this.primaryAction.enabled,this.label=this.getLabel(this.primaryAction),this.tooltip=this.primaryAction.tooltip):(this.hidden=!0,this.enabled=!1)}async run(){this.enabled&&await this.primaryAction?.run()}getLabel(e){return e.label}}var sy;let LT=(sy=class extends yn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,n,o,r,a,c,l,d){super("extensions.install",g(7888,"Install"),yV.CLASS,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=n,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new j7,this.hideOnDisabled=!1,this.options={isMachineScoped:!1,...e},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.class=yV.HIDE,this.hidden=!0,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Qo.Uninstalled&&(this.options.installPreReleaseVersion&&!this.extension.hasPreReleaseVersion||!this.options.installPreReleaseVersion&&!this.extension.hasReleaseVersion||(this.hidden=!1,this.class=yV.CLASS,await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=!0,this.updateLabel()))))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(7889,"This extension is deprecated as it is no longer being maintained."),i;(function(r){r[r.InstallAnyway=0]="InstallAnyway",r[r.ShowAlternateExtension=1]="ShowAlternateExtension",r[r.ConfigureSettings=2]="ConfigureSettings",r[r.Cancel=3]="Cancel"})(i||(i={}));const n=[{label:g(7881,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(7890,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;n.push({label:g(7891,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],He.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(7892,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;n.push({label:g(7893,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Mt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:Xe.Warning,message:g(7894,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:Lt(t)?t:void 0,custom:Lt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:n,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),Mr(g(7895,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.telemetryService.publicLog("extensions:action:install",{...this.extension.telemetryData,actionId:this.id});const e=await this.install(this.extension);if(e?.local){Mr(g(7896,"Installing extension {0} is completed.",this.extension.displayName));const t=await this.getRunningExtension(e.local);if(t&&!(t.activationEvents&&t.activationEvents.some(i=>i.startsWith("onLanguage")))){const i=await this.getThemeAction(e);if(i){i.extension=e;try{return i.run({showCurrentTheme:!0,ignoreFocusLost:!0})}finally{i.dispose()}}}}}async getThemeAction(e){if((await this.workbenchThemeService.getColorThemes()).some(o=>Oy(o,e)))return this.instantiationService.createInstance(RCe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>Oy(o,e)))return this.instantiationService.createInstance(MCe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>Oy(o,e)))return this.instantiationService.createInstance(NCe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance(zW,e,e.latestVersion,LA.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(dD(e))?new Promise((i,n)=>{const o=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const r=await this.runtimeExtensionService.getExtension(e.identifier.id);r&&(o.dispose(),i(r))})}):null)}updateLabel(){this.label=this.getLabel()}getLabel(e){return this.extension?.isWorkspaceScoped&&this.extension.resourceExtension&&this.contextService.isInsideWorkspace(this.extension.resourceExtension.location)?g(7897,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(7898,"Install Pre-Release"):g(7899,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(7888,"Install"):g(7900,"Install Release Version"):g(7888,"Install")}},yV=sy,sy.CLASS=`${sy.LABEL_ACTION_CLASS} prominent install`,sy.HIDE=`${sy.CLASS} hide`,sy);LT=yV=D([_(1,Xo),_(2,we),_(3,fs),_(4,sG),_(5,Fs),_(6,to),_(7,B6),_(8,Yi),_(9,yi)],LT);let k4e=class extends CNe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions",LT.CLASS,[[e.createInstance(LT,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(LT,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};k4e=D([_(0,we),_(1,Xo)],k4e);const v1=class v1 extends yn{constructor(){super("extension.installing",v1.LABEL,v1.CLASS,!1)}update(){this.class=`${v1.CLASS}${this.extension&&this.extension.state===Qo.Installing?"":" hide"}`}};v1.LABEL=g(7901,"Installing"),v1.CLASS=`${yn.LABEL_ACTION_CLASS} install installing`;let I4e=v1;var oy;let $W=(oy=class extends yn{constructor(e,t,i,n,o,r){super(e,g0.INSTALL_LABEL,g0.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=n,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=g0.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>Ra(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Qo.Installing&&!e.local&&(this.enabled=!0,this.label=g0.INSTALLING_LABEL,this.class=g0.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Qo.Installed||this.extension.type!==br.User||this.extension.enablementState===Gr.DisabledByEnvironment||this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByVirtualWorkspace?!1:!!(LRe(this.extension.local.manifest)||this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)||this.server===this.extensionManagementServerService.webExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)||this.canInstallAnyWhere&&(this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)))}async run(){if(this.extension?.local&&this.extension?.server&&this.server)return this.extensionsWorkbenchService.open(this.extension),Mr(g(7895,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.extensionsWorkbenchService.installInServer(this.extension,this.server)}},g0=oy,oy.INSTALL_LABEL=g(7888,"Install"),oy.INSTALLING_LABEL=g(7901,"Installing"),oy.Class=`${yn.LABEL_ACTION_CLASS} prominent install-other-server`,oy.InstallingClass=`${yn.LABEL_ACTION_CLASS} install-other-server installing`,oy);$W=g0=D([_(3,Xo),_(4,dv),_(5,Im)],$W);let xCe=class extends $W{constructor(e,t,i,n){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,n)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(7902,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):$W.INSTALL_LABEL}};xCe=D([_(1,Xo),_(2,dv),_(3,Im)],xCe);let T4e=class extends $W{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7903,"Install Locally")}};T4e=D([_(0,Xo),_(1,dv),_(2,Im)],T4e);let L4e=class extends $W{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7904,"Install in Browser")}};L4e=D([_(0,Xo),_(1,dv),_(2,Im)],L4e);var ry;let DCe=(ry=class extends yn{constructor(e,t){super("extensions.uninstall",SC.UninstallLabel,SC.UninstallClass,!1),this.extensionsWorkbenchService=e,this.dialogService=t,this.update()}update(){if(!this.extension){this.enabled=!1;return}const e=this.extension.state;if(e===Qo.Uninstalling){this.label=SC.UninstallingLabel,this.class=SC.UnInstallingClass,this.enabled=!1;return}if(this.label=SC.UninstallLabel,this.class=SC.UninstallClass,this.tooltip=SC.UninstallLabel,e!==Qo.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){Mr(g(7907,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),Mr(g(7908,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){Fr(e)||this.dialogService.error(su(e))}}}},SC=ry,ry.UninstallLabel=g(7905,"Uninstall"),ry.UninstallingLabel=g(7906,"Uninstalling"),ry.UninstallClass=`${yn.LABEL_ACTION_CLASS} uninstall`,ry.UnInstallingClass=`${yn.LABEL_ACTION_CLASS} uninstall uninstalling`,ry);DCe=SC=D([_(0,Xo),_(1,to)],DCe);var ay;let R4e=(ay=class extends yn{constructor(e,t,i,n,o){super("extensions.update",g(7909,"Update"),OP.DisabledClass,!1),this.verbose=e,this.extensionsWorkbenchService=t,this.dialogService=i,this.openerService=n,this.instantiationService=o,this.updateThrottler=new j7,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement()),this.extension&&(this.label=this.verbose?g(7910,"Update to v{0}",this.extension.latestVersion):g(7909,"Update"))}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=OP.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Qo.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?OP.EnabledClass:OP.DisabledClass}async run(){if(!this.extension)return;const e=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(e){const{result:t}=await this.dialogService.prompt({type:"warning",title:g(7911,"Update {0} Extension",this.extension.displayName),message:g(7912,`{0} + +Would you like to update the extension?`,e),buttons:[{label:g(7909,"Update"),run:()=>"update"},{label:g(7913,"Review"),run:()=>"review"},{label:g(7879,"Cancel"),run:()=>"cancel"}]});if(t==="cancel")return;if(t==="review")return this.extension.hasChangelog()?this.extensionsWorkbenchService.open(this.extension,{tab:t9.Changelog}):this.extension.repository?this.openerService.open(this.extension.repository):this.extensionsWorkbenchService.open(this.extension)}return Mr(g(7914,"Updating extension {0} to version {1} started.",this.extension.displayName,this.extension.latestVersion)),this.install(this.extension)}async install(e){try{await this.extensionsWorkbenchService.install(e,e.local?.preRelease?{installPreReleaseVersion:!0}:void 0),Mr(g(7915,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance(zW,e,e.latestVersion,LA.Update,t).run()}}},OP=ay,ay.EnabledClass=`${ay.LABEL_ACTION_CLASS} prominent update`,ay.DisabledClass=`${ay.EnabledClass} disabled`,ay);R4e=OP=D([_(1,Xo),_(2,to),_(3,Ao),_(4,we)],R4e);var eb;let kCe=(eb=class extends yn{constructor(e,t,i){super(f0.ID,f0.LABEL.value,f0.DisabledClass),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration(YFt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=f0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.deprecationInfo?.disallowInstall||this.extensionsWorkbenchService.getAutoUpdateValue()==="onlyEnabledExtensions"&&!this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)||(this.enabled=!0,this.class=f0.EnabledClass,this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)))}async run(){if(!this.extension)return;const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension,e),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},f0=eb,eb.ID="workbench.extensions.action.toggleAutoUpdateForExtension",eb.LABEL=Pe(7916,"Auto Update"),eb.EnabledClass=`${yn.EXTENSION_ACTION_CLASS} auto-update`,eb.DisabledClass=`${eb.EnabledClass} hide`,eb);kCe=f0=D([_(0,Xo),_(1,Nl),_(2,Te)],kCe);var sk;let ICe=(sk=class extends yn{constructor(e){super(wQ.ID,wQ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;Mr(g(7920,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},wQ=sk,sk.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",sk.LABEL=g(7919,"Auto Update All (From Publisher)"),sk);ICe=wQ=D([_(0,Xo)],ICe);var VS;let M4e=(VS=class extends yn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(7921,"Migrate"),CV.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=CV.DisabledClass,!this.extension?.local||this.extension.state!==Qo.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>Ra(t.identifier,{id:e}))||(this.enabled=!0,this.class=CV.EnabledClass,this.tooltip=g(7922,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(7923,"Migrate"):this.tooltip)}async run(){if(!this.extension?.deprecationInfo?.extension)return;const e=this.extension.local;await this.extensionsWorkbenchService.uninstall(this.extension);const[t]=await this.extensionsWorkbenchService.getExtensions([{id:this.extension.deprecationInfo.extension.id,preRelease:this.extension.deprecationInfo?.extension?.preRelease}],He.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},CV=VS,VS.EnabledClass=`${yn.LABEL_ACTION_CLASS} migrate`,VS.DisabledClass=`${VS.EnabledClass} disabled`,VS);M4e=CV=D([_(1,Xo)],M4e);let pZ=class extends yn{constructor(e,t,i,n,o){super(e,t,i,n),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(TCe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};pZ=D([_(4,we)],pZ);let TCe=class extends Jy{constructor(e,t,i){super(null,e,{...t,icon:!0,label:!0}),this.contextMenuService=i}showMenu(e,t){if(this.element){const i=this.getActions(e),n=Cr(this.element),o={x:n.left,y:n.top+n.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&Ort(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Ar];return t.length?t.slice(0,t.length-1):t}};TCe=D([_(2,lr)],TCe);async function PVt(s,e,t){return t.invokeFunction(async i=>{const n=i.get(Xo),o=i.get(Nl),r=i.get(Oa),a=i.get(aXe),c=i.get(jae),l=i.get(sG),d=[];if(s){switch(d.push(["extension",s.identifier.id]),d.push(["isBuiltinExtension",s.isBuiltin]),d.push(["isDefaultApplicationScopedExtension",s.local&&YIt(s.local.manifest)]),d.push(["isApplicationScopedExtension",s.local&&s.local.isApplicationScoped]),d.push(["isWorkspaceScopedExtension",s.isWorkspaceScoped]),d.push(["isGalleryExtension",!!s.identifier.uuid]),s.local&&d.push(["extensionSource",s.local.source]),d.push(["extensionHasConfiguration",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.configuration]),d.push(["extensionHasKeybindings",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.keybindings]),d.push(["extensionHasCommands",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes?.commands]),d.push(["isExtensionRecommended",!!a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]]),d.push(["isExtensionWorkspaceRecommended",a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]?.reasonId===ACe.Workspace]),d.push(["isUserIgnoredRecommendation",c.globalIgnoredRecommendations.some(m=>m===s.identifier.id.toLowerCase())]),d.push(["isExtensionPinned",s.pinned]),d.push(["isExtensionEnabled",o.isEnabledEnablementState(s.enablementState)]),s.state){case Qo.Installing:d.push(["extensionStatus","installing"]);break;case Qo.Installed:d.push(["extensionStatus","installed"]);break;case Qo.Uninstalling:d.push(["extensionStatus","uninstalling"]);break;case Qo.Uninstalled:d.push(["extensionStatus","uninstalled"]);break}d.push(["installedExtensionIsPreReleaseVersion",!!s.local?.isPreReleaseVersion]),d.push(["installedExtensionIsOptedToPreRelease",!!s.local?.preRelease]),d.push(["galleryExtensionIsPreReleaseVersion",!!s.gallery?.properties.isPreReleaseVersion]),d.push(["galleryExtensionHasPreReleaseVersion",s.gallery?.hasPreReleaseVersion]),d.push(["extensionHasPreReleaseVersion",s.hasPreReleaseVersion]),d.push(["extensionHasReleaseVersion",s.hasReleaseVersion]),d.push(["extensionDisallowInstall",!!s.deprecationInfo?.disallowInstall]);const[u,f,p]=await Promise.all([l.getColorThemes(),l.getFileIconThemes(),l.getProductIconThemes()]);d.push(["extensionHasColorThemes",u.some(m=>Oy(m,s))]),d.push(["extensionHasFileIconThemes",f.some(m=>Oy(m,s))]),d.push(["extensionHasProductIconThemes",p.some(m=>Oy(m,s))]),d.push(["canSetLanguage",n.canSetLanguage(s)]),d.push(["isActiveLanguagePackExtension",s.gallery&&ql===Ece(s.gallery)])}return r.getMenuActions(_e.ExtensionContext,e.createOverlay(d),{shouldForwardArgs:!0})})}function TK(s,e){const t=[];for(const[,i]of s)t.push(i.map(n=>n instanceof Nk?n:e.createInstance(LCe,n)));return t}var cy;let N4e=(cy=class extends pZ{constructor(e,t,i){super(BP.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(7924,"Manage"),this.update()}async getActionGroups(){const e=[],t=await PVt(this.extension,this.contextKeyService,this.instantiationService),i=[],n=[],o=[],r=[];for(const[a,c]of t)a===eOt?n.push(...TK([[a,c]],this.instantiationService)[0]):a===tOt?o.push(...TK([[a,c]],this.instantiationService)[0]):a===ZFt?i.push(...TK([[a,c]],this.instantiationService)[0]):r.push(...TK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(_Z),this.instantiationService.createInstance(mZ)]),e.push([this.instantiationService.createInstance(bZ),this.instantiationService.createInstance(vZ)]),o.length&&e.push(o),e.push([...n.length?n:[],this.instantiationService.createInstance(v9,this.extension,!1),this.instantiationService.createInstance(DCe)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof yn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=BP.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Qo.Installed,this.class=this.enabled||e===Qo.Uninstalling?BP.Class:BP.HideManageExtensionClass}}},BP=cy,cy.ID="extensions.manage",cy.Class=`${yn.ICON_ACTION_CLASS} manage `+We.asClassName(LVt),cy.HideManageExtensionClass=`${cy.Class} hide`,cy);N4e=BP=D([_(0,we),_(1,fs),_(2,Le)],N4e);let LCe=class extends yn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}get enabled(){return this.action.enabled}set enabled(e){this.action.enabled=e}update(){this.extension&&(this.action.id===JFt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===kCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===ICe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?LM(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?LM(this.extension.gallery.publisher,this.extension.gallery.name):this.extension.identifier.id,t={id:this.extension.identifier.id,version:this.extension.version,location:this.extension.local?.location};await this.action.run(e,t)}}};LCe=D([_(1,Xo)],LCe);var tb;let P4e=(tb=class extends yn{constructor(e){super(p0.ID,p0.LABEL,p0.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=p0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Qo.Installed&&this.extension.hasPreReleaseVersion&&this.extension.gallery&&(this.extension.preRelease&&!this.extension.isPreReleaseVersion||!this.extension.preRelease&&!this.extension.gallery.hasPreReleaseVersion||(this.enabled=!0,this.class=p0.EnabledClass,this.extension.preRelease?(this.label=g(7926,"Switch to Release Version"),this.tooltip=g(7927,"This will switch and enable updates to release versions")):(this.label=g(7928,"Switch to Pre-Release Version"),this.tooltip=g(7929,"This will switch to pre-release version and enable updates to latest version always")))))}async run(){this.extension&&(this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:!this.extension.preRelease}),await this.extensionsWorkbenchService.togglePreRelease(this.extension))}},p0=tb,tb.ID="workbench.extensions.action.togglePreRlease",tb.LABEL=g(7925,"Pre-Release"),tb.EnabledClass=`${yn.LABEL_ACTION_CLASS} pre-release`,tb.DisabledClass=`${tb.EnabledClass} hide`,tb);P4e=p0=D([_(0,Xo)],P4e);var ok;let v9=(ok=class extends yn{constructor(e,t,i,n,o,r,a,c){super(yQ.ID,yQ.LABEL,yn.LABEL_ACTION_CLASS),this.whenInstalled=t,this.extensionsWorkbenchService=i,this.extensionManagementService=n,this.extensionGalleryService=o,this.quickInputService=r,this.instantiationService=a,this.dialogService=c,this.extension=e,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.identifier.uuid&&!this.extension.deprecationInfo,this.enabled&&this.whenInstalled&&(this.enabled=!!this.extension?.local&&!!this.extension.server&&this.extension.state===Qo.Installed)}async run(){if(!this.enabled||!this.extension)return;const e=this.extension.server?await this.extension.server.extensionManagementService.getTargetPlatform():await this.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.identifier,this.extension.local?.preRelease??this.extension.gallery?.properties.isPreReleaseVersion??!1,e);if(!t.length){await this.dialogService.info(g(7931,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${uNe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(7932,"pre-release")})`:""}${o.version===this.extension?.local?.manifest.version?` (${g(7933,"current")})`:""}`,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),n=await this.quickInputService.pick(i,{placeHolder:g(7934,"Select Version to Install"),matchOnDetail:!0});if(n){if(this.extension.local?.manifest.version===n.id)return;try{await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:n.isPreReleaseVersion,version:n.id})}catch(o){this.instantiationService.createInstance(zW,this.extension,n.id,LA.Install,o).run()}}return null}},yQ=ok,ok.ID="workbench.extensions.action.install.anotherVersion",ok.LABEL=g(7930,"Install Specific Version..."),ok);v9=yQ=D([_(2,Xo),_(3,P6),_(4,EI),_(5,In),_(6,we),_(7,to)],v9);var rk;let mZ=(rk=class extends yn{constructor(e,t){super(CQ.ID,CQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7936,"Enable this extension only in this workspace"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Qo.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledWorkspace)}},CQ=rk,rk.ID="extensions.enableForWorkspace",rk.LABEL=g(7935,"Enable (Workspace)"),rk);mZ=CQ=D([_(0,Xo),_(1,Nl)],mZ);var ak;let _Z=(ak=class extends yn{constructor(e,t){super(SQ.ID,SQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7938,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Qo.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledGlobally)}},SQ=ak,ak.ID="extensions.enableGlobally",ak.LABEL=g(7937,"Enable"),ak);_Z=SQ=D([_(0,Xo),_(1,Nl)],_Z);var ck;let vZ=(ck=class extends yn{constructor(e,t,i,n){super(AQ.ID,AQ.LABEL,yn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=n,this.tooltip=g(7940,"Disable this extension only in this workspace"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==qi.EMPTY)&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledWorkspace)}},AQ=ck,ck.ID="extensions.disableForWorkspace",ck.LABEL=g(7939,"Disable (Workspace)"),ck);vZ=AQ=D([_(0,yi),_(1,Xo),_(2,Nl),_(3,fs)],vZ);var lk;let bZ=(lk=class extends yn{constructor(e,t,i){super(EQ.ID,EQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(7942,"Disable this extension"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledGlobally)}},EQ=lk,lk.ID="extensions.disableGlobally",lk.LABEL=g(7941,"Disable"),lk);bZ=EQ=D([_(0,Xo),_(1,Nl),_(2,fs)],bZ);let F4e=class extends CNe{constructor(e){super("extensions.enable",yn.LABEL_ACTION_CLASS,[[e.createInstance(_Z),e.createInstance(mZ)]])}};F4e=D([_(0,we)],F4e);let O4e=class extends CNe{constructor(e){super("extensions.disable",yn.LABEL_ACTION_CLASS,[[e.createInstance(bZ),e.createInstance(vZ)]])}};O4e=D([_(0,we)],O4e);var zS;let B4e=(zS=class extends yn{constructor(e,t,i,n,o,r){super("extensions.runtimeState","",SV.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=n,this.productService=o,this.telemetryService=r,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=SV.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Qo.Installing||e===Qo.Uninstalling||this.extension.local&&this.extension.local.manifest&&this.extension.local.manifest.contributes&&this.extension.local.manifest.contributes.localizations&&this.extension.local.manifest.contributes.localizations.length>0)return;const t=this.extension.runtimeState;t&&(this.enabled=!0,this.class=SV.EnabledClass,this.tooltip=t.reason,this.label=t.action===$m.ReloadWindow?g(7943,"Reload Window"):t.action===$m.RestartExtensions?g(7944,"Restart Extensions"):t.action===$m.QuitAndInstall?g(7945,"Restart to Update"):t.action===$m.ApplyUpdate||t.action===$m.DownloadUpdate?g(7946,"Update {0}",this.productService.nameShort):"")}async run(){const e=this.extension?.runtimeState;if(e?.action){if(this.telemetryService.publicLog2("extensions:runtimestate:action",{action:e.action}),e?.action===$m.ReloadWindow)return this.hostService.reload();if(e?.action===$m.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===$m.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===$m.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===$m.QuitAndInstall)return this.updateService.quitAndInstall()}}},SV=zS,zS.EnabledClass=`${yn.LABEL_ACTION_CLASS} reload`,zS.DisabledClass=`${zS.EnabledClass} disabled`,zS);B4e=SV=D([_(0,xc),_(1,Xo),_(2,pJe),_(3,fs),_(4,Er),_(5,Yi)],B4e);function Oy(s,e){return!!(e&&s.extensionData&&Sn.equals(s.extensionData.extensionId,e.identifier.id))}function SNe(s,e,t,i){const n=[];for(const o of s)Oy(o,t)&&!(i&&o===e)&&n.push({label:o.label,id:o.id});return i&&(n.push({type:"separator",label:g(7933,"current")}),n.push({label:e.label,id:e.id})),n}var ib;let RCe=(ib=class extends yn{constructor(e,t,i,n){super(m0.ID,m0.TITLE.value,m0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.any(e.onDidChangeExtensions,t.onDidColorThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getColorThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?m0.EnabledClass:m0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getColorThemes();if(!this.computeEnablement(i))return;const n=this.workbenchThemeService.getColorTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7948,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:n.id,"auto")}},m0=ib,ib.ID="workbench.extensions.action.setColorTheme",ib.TITLE=Pe(7947,"Set Color Theme"),ib.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,ib.DisabledClass=`${ib.EnabledClass} disabled`,ib);RCe=m0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],RCe);var nb;let MCe=(nb=class extends yn{constructor(e,t,i,n){super(_0.ID,_0.TITLE.value,_0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.any(e.onDidChangeExtensions,t.onDidFileIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getFileIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?_0.EnabledClass:_0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getFileIconThemes();if(!this.computeEnablement(i))return;const n=this.workbenchThemeService.getFileIconTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7950,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:n.id,"auto")}},_0=nb,nb.ID="workbench.extensions.action.setFileIconTheme",nb.TITLE=Pe(7949,"Set File Icon Theme"),nb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,nb.DisabledClass=`${nb.EnabledClass} disabled`,nb);MCe=_0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],MCe);var sb;let NCe=(sb=class extends yn{constructor(e,t,i,n){super(v0.ID,v0.TITLE.value,v0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.any(e.onDidChangeExtensions,t.onDidProductIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getProductIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?v0.EnabledClass:v0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getProductIconThemes();if(!this.computeEnablement(i))return;const n=this.workbenchThemeService.getProductIconTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7952,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:n.id,"auto")}},v0=sb,sb.ID="workbench.extensions.action.setProductIconTheme",sb.TITLE=Pe(7951,"Set Product Icon Theme"),sb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,sb.DisabledClass=`${sb.EnabledClass} disabled`,sb);NCe=v0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],NCe);var ob;let W4e=(ob=class extends yn{constructor(e){super(b0.ID,b0.TITLE.value,b0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=b0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&ql===Ece(this.extension.gallery)||(this.enabled=!0,this.class=b0.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},b0=ob,ob.ID="workbench.extensions.action.setDisplayLanguage",ob.TITLE=Pe(7953,"Set Display Language"),ob.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,ob.DisabledClass=`${ob.EnabledClass} disabled`,ob);W4e=b0=D([_(0,Xo)],W4e);var rb;let H4e=(rb=class extends yn{constructor(e,t){super(w0.ID,w0.TITLE.value,w0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=w0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&ql!==Ece(this.extension.gallery)||(this.enabled=!0,this.class=w0.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},w0=rb,rb.ID="workbench.extensions.action.clearLanguage",rb.TITLE=Pe(7954,"Clear Display Language"),rb.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,rb.DisabledClass=`${rb.EnabledClass} disabled`,rb);H4e=w0=D([_(0,Xo),_(1,lXe)],H4e);var dk;let U4e=(dk=class extends rn{constructor(e,t,i){super(xQ.ID,xQ.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);return i?this.extensionWorkbenchService.open(i):null}},xQ=dk,dk.ID="workbench.extensions.action.showRecommendedExtension",dk.LABEL=g(7955,"Show Recommended Extension"),dk);U4e=xQ=D([_(1,Tm),_(2,Xo)],U4e);var hk;let V4e=(hk=class extends rn{constructor(e,t,i,n){super(DQ.ID,DQ.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=n,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(n){this.instantiationService.createInstance(zW,i,i.latestVersion,LA.Install,n).run()}}}},DQ=hk,hk.ID="workbench.extensions.action.installRecommendedExtension",hk.LABEL=g(7956,"Install Recommended Extension"),hk);V4e=DQ=D([_(1,Tm),_(2,we),_(3,Xo)],V4e);var uk;let z4e=(uk=class extends rn{constructor(e,t){super(kQ.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=kQ.Class,this.tooltip=g(7957,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},kQ=uk,uk.ID="extensions.ignore",uk.Class=`${yn.LABEL_ACTION_CLASS} ignore`,uk);z4e=kQ=D([_(1,jae)],z4e);var gk;let $4e=(gk=class extends rn{constructor(e,t){super(IQ.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=IQ.Class,this.tooltip=g(7958,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},IQ=gk,gk.ID="extensions.ignore",gk.Class=`${yn.LABEL_ACTION_CLASS} undo-ignore`,gk);$4e=IQ=D([_(1,jae)],$4e);let wZ=class extends rn{constructor(e,t){super("extensions.searchExtensions",g(7959,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};wZ=D([_(1,Tm)],wZ);let yZ=class extends rn{constructor(e,t,i,n,o,r,a,c){super(e,t),this.contextService=i,this.fileService=n,this.textFileService=o,this.editorService=r,this.jsonEditingService=a,this.textModelResolverService=c}openExtensionsFile(e){return this.getOrCreateExtensionsFile(e).then(({created:t,content:i})=>this.getSelectionPosition(i,e,["recommendations"]).then(n=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:n}})),t=>Promise.reject(new Error(g(7960,"Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",t))))}openWorkspaceConfigurationFile(e){return this.getOrUpdateWorkspaceConfigurationFile(e).then(t=>this.getSelectionPosition(t.value.toString(),t.resource,["extensions","recommendations"])).then(t=>this.editorService.openEditor({resource:e,options:{selection:t,forceReload:!0}}))}getOrUpdateWorkspaceConfigurationFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>{const i=sf(t.value.toString()).extensions;return!i||!i.recommendations?this.jsonEditingService.write(e,[{path:["extensions"],value:{recommendations:[]}}],!0).then(()=>this.fileService.readFile(e)):t})}getSelectionPosition(e,t,i){const n=RLe(e),o=jme(n,i);if(o&&o.parent&&o.parent.children){const r=o.parent.children[1],a=r.children&&r.children.length?r.children[r.children.length-1]:null,c=a?a.offset+a.length:r.offset+1;return Promise.resolve(this.textModelResolverService.createModelReference(t)).then(l=>{const d=l.object.textEditorModel.getPositionAt(c);return l.dispose(),{startLineNumber:d.lineNumber,startColumn:d.column,endLineNumber:d.lineNumber,endColumn:d.column}})}return Promise.resolve(void 0)}getOrCreateExtensionsFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>({created:!1,extensionsFileResource:e,content:t.value.toString()}),t=>this.textFileService.write(e,A4e).then(()=>({created:!0,extensionsFileResource:e,content:A4e})))}};yZ=D([_(2,yi),_(3,Jt),_(4,Fo),_(5,ei),_(6,DI),_(7,fn)],yZ);var lR;let G4e=(lR=class extends yZ{constructor(e,t,i,n,o,r,a,c){super(e,t,o,i,n,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case qi.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(yF));case qi.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},lR.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",lR.LABEL=g(7961,"Configure Recommended Extensions (Workspace)"),lR);G4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,DI),_(7,fn)],G4e);var dR;let K4e=(dR=class extends yZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,i,n,r,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(Mtt);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(yF)):null)}},dR.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",dR.LABEL=g(7962,"Configure Recommended Extensions (Workspace Folder)"),dR);K4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,DI),_(7,fn),_(8,vi)],K4e);var $S;let q4e=($S=class extends rn{get extension(){return this._extension}set extension(e){this._extension&&e&&Ra(this._extension.identifier,e.identifier)||(this.initialStatus=null,this.status=null,this.enablementState=null),this._extension=e,this.update()}constructor(e,t,i){super("extensions.action.statusLabel","",AV.DISABLED_CLASS,!1),this.extensionService=e,this.extensionManagementServerService=t,this.extensionEnablementService=i,this.initialStatus=null,this.status=null,this.version=null,this.enablementState=null,this._extension=null}update(){const e=this.computeLabel();this.label=e||"",this.class=e?AV.ENABLED_CLASS:AV.DISABLED_CLASS}computeLabel(){if(!this.extension)return null;const e=this.status,t=this.version,i=this.enablementState;this.status=this.extension.state,this.version=this.extension.version,this.initialStatus===null&&(this.initialStatus=this.status),this.enablementState=this.extension.enablementState;const n=()=>{const r=this.extensionService.extensions.filter(a=>Ra({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?r&&this.extension.version===r.version?!0:this.extensionService.canAddExtension(dD(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(Ra({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(ice(r))))?!0:this.extensionService.canRemoveExtension(dD(this.extension.local)):!1;if(e!==null){if(e===Qo.Installing&&this.status===Qo.Installed)return n()?this.initialStatus===Qo.Installed&&this.version!==t?g(7963,"Updated"):g(7964,"Installed"):null;if(e===Qo.Uninstalling&&this.status===Qo.Uninstalled)return this.initialStatus=this.status,o()?g(7965,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return n()?g(7966,"Enabled"):null;if(r&&!a)return o()?g(7967,"Disabled"):null}return null}run(){return Promise.resolve()}},AV=$S,$S.ENABLED_CLASS=`${yn.TEXT_ACTION_CLASS} extension-status-label`,$S.DISABLED_CLASS=`${$S.ENABLED_CLASS} hide`,$S);q4e=AV=D([_(0,fs),_(1,dv),_(2,Nl)],q4e);var GS;let Q4e=(GS=class extends pZ{constructor(e,t,i,n){super("extensions.sync","",EV.SYNC_CLASS,!1,n),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(M.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration("settingsSync.ignoredExtensions"))(()=>this.update())),this._register(i.onDidChangeEnablement(()=>this.update())),this.update()}update(){if(this.enabled=!!this.extension&&this.userDataSyncEnablementService.isEnabled()&&this.extension.state===Qo.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?EV.IGNORED_SYNC_CLASS:EV.SYNC_CLASS,this.tooltip=e?g(7968,"This extension is ignored during sync"):g(7969,"This extension is synced")}}async run(){return super.run({actionGroups:[[new rn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(7970,"Sync this extension"):g(7971,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},EV=GS,GS.IGNORED_SYNC_CLASS=`${yn.ICON_ACTION_CLASS} extension-sync ${We.asClassName(MVt)}`,GS.SYNC_CLASS=`${GS.ICON_ACTION_CLASS} extension-sync ${We.asClassName(RVt)}`,GS);Q4e=EV=D([_(0,Te),_(1,Xo),_(2,mJe),_(3,we)],Q4e);var hR;let j4e=(hR=class extends yn{get status(){return this._status}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super("extensions.status","",`${AE.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=n,this.workspaceTrustService=o,this.extensionsWorkbenchService=r,this.extensionService=a,this.extensionManifestPropertiesService=c,this.contextService=l,this.productService=d,this.workbenchExtensionEnablementService=h,this.extensionFeaturesManagementService=u,this.updateWhenCounterExtensionChanges=!0,this._status=[],this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new j7,this._register(this.labelService.onDidChangeFormatters(()=>this.update(),this)),this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this._register(this.extensionFeaturesManagementService.onDidChangeAccessData(()=>this.update())),this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateStatus())}async computeAndUpdateStatus(){if(this.updateStatus(void 0,!0),this.enabled=!1,!this.extension)return;if(this.extension.isMalicious){this.updateStatus({icon:dh,message:new Mt(g(7972,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const o=`[${this.extension.deprecationInfo.extension.displayName}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:dh,message:new Mt(g(7973,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(7974,"settings")}](${N.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:dh,message:new Mt(g(7975,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",o))},!0)}else{const o=new Mt(g(7976,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:dh,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.outdated&&this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)){const o=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(o){const r=new Mt;r.appendMarkdown(`${o} `),r.appendMarkdown(g(7977,"Please [review the extension]({0}) and update it manually.",this.extension.hasChangelog()?N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,t9.Changelog]))}`).toString():this.extension.repository?this.extension.repository:N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id]))}`).toString())),this.updateStatus({icon:dh,message:r},!0)}}if(this.extension.gallery&&this.extension.state===Qo.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const o=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),r=new Mt(`${g(7978,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,kLt(o))} [${g(7979,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:dh,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(7874,"{0} for the Web",this.productService.nameLong),r=new Mt(`${g(7980,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(7981,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:dh,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Qo.Installed)return;if(this.extension.enablementState===Gr.DisabledByEnvironment){this.updateStatus({message:new Mt(g(7982,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===Gr.EnabledByEnvironment){this.updateStatus({message:new Mt(g(7983,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===Gr.DisabledByVirtualWorkspace){const o=dK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:e_,message:new Mt(o?sV(o):g(7984,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(Ftt(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=dK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:dh,message:new Mt(r?sV(r):g(7985,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===Gr.DisabledByTrustRequirement)){this.enabled=!0;const o=dK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:$I,message:new Mt(o?sV(o):g(7986,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const o=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),r=dK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:$I,message:new Mt(r?sV(r):g(7987,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>Ra(o.identifier,this.extension.identifier)&&o.server!==this.extension.server)){let o;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(o=new Mt(`${g(7988,"This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)):this.extensionManagementServerService.remoteExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&(this.extensionManagementServerService.localExtensionManagementServer?o=new Mt(`${g(7989,"This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Wn&&(o=new Mt(`${g(7990,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Mt(`${g(7991,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:dh,message:o},!0);return}const e=new Sn(this.extension.identifier.id),t=Qe.as(J_.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(7992,"Manage Access")}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,t9.Features,!1,o.id]))}`)})`;if(r?.severity===Xe.Error){this.updateStatus({icon:jC,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===Xe.Warning){this.updateStatus({icon:dh,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(LRe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>Ra(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Mt(g(7993,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Mt(g(7994,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:e_,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>Ra({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(ice(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:e_,message:new Mt(`${g(7995,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:e_,message:new Mt(`${g(7996,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:e_,message:new Mt(`${g(7997,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionDependency){this.updateStatus({icon:dh,message:new Mt(g(7998,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),n=this.extensionService.extensions.some(o=>Ra({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&n){if(this.extension.enablementState===Gr.EnabledWorkspace){this.updateStatus({message:new Mt(g(7999,"This extension is enabled for this workspace by the user."))},!0);return}if(this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer&&this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer){this.updateStatus({message:new Mt(g(8e3,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===Gr.EnabledGlobally)return}if(!i&&!n){if(this.extension.enablementState===Gr.DisabledGlobally){this.updateStatus({message:new Mt(g(8001,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===Gr.DisabledWorkspace){this.updateStatus({message:new Mt(g(8002,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!n&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===Xe.Error).map(([,r])=>r);this.updateStatus({icon:jC,message:new Mt(o.join(" ").trim())},!0)}}updateStatus(e,t){if(e){if(this._status.some(i=>i.message.value===e.message.value&&i.icon?.id===e.icon?.id))return}else{if(this._status.length===0)return;this._status=[]}e&&(this._status.push(e),this._status.sort((i,n)=>n.icon===$I?-1:i.icon===$I?1:n.icon===jC?-1:i.icon===jC?1:n.icon===dh?-1:i.icon===dh?1:n.icon===e_?-1:i.icon===e_?1:0)),t&&(e?.icon===jC?this.class=`${AE.CLASS} extension-status-error ${We.asClassName(jC)}`:e?.icon===dh?this.class=`${AE.CLASS} extension-status-warning ${We.asClassName(dh)}`:e?.icon===e_?this.class=`${AE.CLASS} extension-status-info ${We.asClassName(e_)}`:e?.icon===$I?this.class=`${AE.CLASS} ${We.asClassName($I)}`:this.class=`${AE.CLASS} hide`),this._onDidChangeStatus.fire()}async run(){if(this._status[0]?.icon===$I)return this.commandService.executeCommand("workbench.trust.manage")}},AE=hR,hR.CLASS=`${yn.ICON_ACTION_CLASS} extension-status`,hR);j4e=AE=D([_(0,dv),_(1,Fs),_(2,vi),_(3,_ae),_(4,uC),_(5,Xo),_(6,fs),_(7,Im),_(8,yi),_(9,Er),_(10,Nl),_(11,rXe)],j4e);var fk;let Y4e=(fk=class extends rn{constructor(e=TQ.ID,t=TQ.LABEL,i,n,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=n,this.quickInputService=o,this.notificationService=r,this.hostService=a,this.instantiationService=c,this.extensionService=l}get enabled(){return this.extensionsWorkbenchService.local.filter(e=>!e.isBuiltin&&e.local).length>0}run(){return this.quickInputService.pick(this.getEntries(),{placeHolder:g(8004,"Select Extension to Reinstall")}).then(e=>e&&this.reinstallExtension(e.extension))}getEntries(){return this.extensionsWorkbenchService.queryLocal().then(e=>e.filter(i=>!i.isBuiltin&&i.server!==this.extensionManagementServerService.webExtensionManagementServer).map(i=>({id:i.identifier.id,label:i.displayName,description:i.identifier.id,extension:i})))}reinstallExtension(e){return this.instantiationService.createInstance(wZ,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(dD(t.local))),n=i?g(8005,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(8006,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(8007,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(Xe.Info,n,o,{sticky:!0})},t=>this.notificationService.error(t)))}},TQ=fk,fk.ID="workbench.extensions.action.reinstall",fk.LABEL=g(8003,"Reinstall Extension..."),fk);Y4e=TQ=D([_(2,Xo),_(3,dv),_(4,In),_(5,bi),_(6,xc),_(7,we),_(8,fs)],Y4e);var pk;let J4e=(pk=class extends rn{constructor(e=LQ.ID,t=LQ.LABEL,i,n,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=n,this.instantiationService=o,this.extensionEnablementService=r}get enabled(){return this.extensionsWorkbenchService.local.some(e=>this.isEnabled(e))}async run(){const e=await this.quickInputService.pick(this.getExtensionEntries(),{placeHolder:g(8009,"Select Extension"),matchOnDetail:!0});e&&e.extension&&(await this.instantiationService.createInstance(v9,e.extension,!0).run(),await this.instantiationService.createInstance(wZ,e.extension.identifier.id).run())}isEnabled(e){return this.instantiationService.createInstance(v9,e,!0).enabled&&!!e.local&&this.extensionEnablementService.isEnabled(e.local)}async getExtensionEntries(){const e=await this.extensionsWorkbenchService.queryLocal(),t=[];for(const i of e)this.isEnabled(i)&&t.push({id:i.identifier.id,label:i.displayName||i.identifier.id,description:i.identifier.id,extension:i});return t.sort((i,n)=>i.extension.displayName.localeCompare(n.extension.displayName))}},LQ=pk,pk.ID="workbench.extensions.action.install.specificVersion",pk.LABEL=g(8008,"Install Specific Version of Extension..."),pk);J4e=LQ=D([_(2,Xo),_(3,In),_(4,we),_(5,Nl)],J4e);let CZ=class extends rn{constructor(e,t,i,n,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=n,this.progressService=o,this.extensions=void 0,this.update(),this.extensionsWorkbenchService.queryLocal().then(()=>this.updateExtensions()),this._register(this.extensionsWorkbenchService.onChange(()=>{this.extensions&&this.updateExtensions()}))}updateExtensions(){this.extensions=this.extensionsWorkbenchService.local,this.update()}update(){this.enabled=!!this.extensions&&this.getExtensionsToInstall(this.extensions).length>0,this.tooltip=this.label}async run(){return this.selectAndInstallExtensions()}async queryExtensionsToInstall(){const e=await this.extensionsWorkbenchService.queryLocal();return this.getExtensionsToInstall(e)}async selectAndInstallExtensions(){const e=this.quickInputService.createQuickPick();e.busy=!0;const t=e.onDidAccept(()=>{t.dispose(),e.hide(),e.dispose(),this.onDidAccept(e.selectedItems)});e.show();const i=await this.queryExtensionsToInstall();e.busy=!1,i.length?(e.title=this.getQuickPickTitle(),e.placeholder=g(8010,"Select extensions to install"),e.canSelectMany=!0,i.sort((n,o)=>n.displayName.localeCompare(o.displayName)),e.items=i.map(n=>({extension:n,label:n.displayName,description:n.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:Xe.Info,message:g(8011,"There are no extensions to install.")}))}async onDidAccept(e){if(e.length){const t=e.filter(i=>!!i.extension).map(i=>i.extension);t.length&&(await this.progressService.withProgress({location:ud.Notification,title:g(8012,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(8013,"Successfully installed extensions.")))}}};CZ=D([_(1,Xo),_(2,In),_(3,bi),_(4,cg)],CZ);let X4e=class extends CZ{constructor(e,t,i,n,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,n,i),this.extensionManagementServerService=o,this.extensionGalleryService=r,this.instantiationService=a,this.fileService=c,this.logService=l}get label(){return this.extensionManagementServerService&&this.extensionManagementServerService.remoteExtensionManagementServer?g(8014,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(8015,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance(xCe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.settled(i.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};X4e=D([_(0,Xo),_(1,In),_(2,cg),_(3,bi),_(4,dv),_(5,EI),_(6,we),_(7,Jt),_(8,Ge)],X4e);let Z4e=class extends CZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,o,n),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(8016,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(8017,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===br.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&Ra(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.settled(i.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};Z4e=D([_(1,Xo),_(2,In),_(3,cg),_(4,bi),_(5,dv),_(6,EI),_(7,Jt),_(8,Ge)],Z4e);_t.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(s,e){return s.get(Tm).openPaneComposite(GU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const PCe="workbench.extensions.action.showExtensionsWithIds";_t.registerCommand(PCe,function(s,e){return s.get(Tm).openPaneComposite(GU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const n=e.map(o=>`@id:${o}`).join(" ");i.search(n),i.focus()})});W("extensionButton.background",{dark:_y,light:_y,hcDark:null,hcLight:null},g(8018,"Button background color for extension actions."));W("extensionButton.foreground",{dark:bM,light:bM,hcDark:null,hcLight:null},g(8019,"Button foreground color for extension actions."));W("extensionButton.hoverBackground",{dark:$8,light:$8,hcDark:null,hcLight:null},g(8020,"Button background hover color for extension actions."));W("extensionButton.separator",rqe,g(8021,"Button separator color for extension actions"));W("extensionButton.prominentBackground",{dark:_y,light:_y,hcDark:null,hcLight:null},g(8022,"Button background color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentForeground",{dark:bM,light:bM,hcDark:null,hcLight:null},g(8023,"Button foreground color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentHoverBackground",{dark:$8,light:$8,hcDark:null,hcLight:null},g(8024,"Button background hover color for extension actions that stand out (e.g. install button)."));Cp((s,e)=>{const t=s.getColor(TN);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(jC)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(jC)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(jC)} { color: ${t}; }`));const i=s.getColor(pm);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(dh)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(dh)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(dh)} { color: ${i}; }`));const n=s.getColor(mm);n&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(e_)} { color: ${n}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(e_)} { color: ${n}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(e_)} { color: ${n}; }`))});let SZ=class extends V{constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i,this._onDidChangeContents=this._register(new I),this.onDidChangeContents=this._onDidChangeContents.event;const n=Bt(".chat-agent-hover@root",[Bt(".chat-agent-hover-header",[Bt(".chat-agent-hover-icon@icon"),Bt(".chat-agent-hover-details",[Bt(".chat-agent-hover-name@name"),Bt(".chat-agent-hover-extension",[Bt(".chat-agent-hover-extension-name@extensionName"),Bt(".chat-agent-hover-separator@separator"),Bt(".chat-agent-hover-publisher@publisher")])])]),Bt(".chat-agent-hover-warning@warning"),Bt("span.chat-agent-hover-description@description")]);this.domNode=n.root,this.icon=n.icon,this.name=n.name,this.extensionName=n.extensionName,this.description=n.description,n.separator.textContent="|";const o=fe("span.extension-verified-publisher",void 0,Yy(NVt));this.publisherName=fe("span.chat-agent-hover-publisher-name"),re(n.publisher,o,this.publisherName),n.warning.appendChild(Yy(ve.warning)),n.warning.appendChild(fe("span",void 0,g(10556,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof N){const o=fe("img.icon");o.src=ef.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(fe(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=fe(We.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(fe(".avatar.codicon-avatar",void 0,o))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:Ace(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let n=t.description??"";if(n&&(n.match(/[\.\?\!] *$/)||(n+=".")),this.description.textContent=n,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ci);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&(this.domNode.classList.toggle("verifiedPublisher",!0),this._onDidChangeContents.fire())})}}};SZ=D([_(0,_f),_(1,Xo),_(2,zae)],SZ);function Ott(s,e){return{actions:[{commandId:PCe,label:g(10557,"View Extension"),run:()=>{const t=s();t&&e.executeCommand(PCe,[t.extensionId.value])}}]}}let FCe=class extends V{constructor(e,t=[],i=fe(".chat-attached-context"),n,o){super(),this.variables=e,this.contentReferences=t,this.domNode=i,this.instantiationService=n,this.openerService=o,this.attachedContextDisposables=this._register(new Z),this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.initAttachedContext(i)}initAttachedContext(e){Ms(e),this.attachedContextDisposables.clear(),uTe(!!this.variables.length,this.domNode),this.variables.forEach(t=>{const i=re(e,fe(".chat-attached-context-attachment.show-file-icons")),n=this._contextResourceLabels.create(i,{supportIcons:!0}),o=N.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&N.isUri(t.value.uri)?t.value.uri:void 0,r=t.value&&typeof t.value=="object"&&"range"in t.value&&F.isIRange(t.value.range)?t.value.range:void 0,a=this.contentReferences.find(h=>"variableName"in h.reference&&h.reference.variableName===t.name),c=a?.options?.status?.kind===BW.Omitted,l=c||a?.options?.status?.kind===BW.Partial;if(o){const h=Ko(o.path),u=Cb(o.path),f=`${h} ${u}`;let p;c?p=r?g(10558,"Omitted: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10559,"Omitted: {0}.",f):l?p=r?g(10560,"Partially attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10561,"Partially attached: {0}.",f):p=r?g(10562,"Attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10563,"Attached: {0}.",f),n.setFile(o,{fileKind:ba.FILE,hidePath:!0,range:r,title:a?.options?.status?.description}),i.ariaLabel=p,i.tabIndex=0,i.style.cursor="pointer",this.attachedContextDisposables.add(ue(i,ke.CLICK,async m=>{en.stop(m,!0),o&&this.openerService.open(o,{fromUserGesture:!0,editorOptions:{selection:r}})}))}else{const h=t.fullName??t.name,u=t.icon?.id?`$(${t.icon.id}) ${h}`:h;n.setLabel(u,a?.options?.status?.description),i.ariaLabel=g(10564,"Attached context: {0}.",t.name),i.tabIndex=0}l&&i.classList.add("warning");const d=a?.options?.status?.description;if(l){i.ariaLabel=`${i.ariaLabel}${d?` ${d}`:""}`;for(const h of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const u=n.element.querySelector(h);u&&u.classList.add("warning")}}})}};FCe=D([_(3,we),_(4,Ao)],FCe);let OCe=class extends V{constructor(e,t,i,n){super(),this.editorService=i,this.telemetryService=n;const o=xtt(e.citations),r=Bt(".chat-code-citation-message@root",[Bt("span.chat-code-citation-label@label"),Bt(".chat-code-citation-button-container@button")]);r.label.textContent=o+" - ";const a=this._register(new Jd(r.button,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0}));a.label=g(10566,"View matches"),this._register(a.onDidClick(()=>{const c=`# Code Citations + +`+e.citations.map(l=>`## License: ${l.license} +${l.value.toString()} + +\`\`\` +${l.snippet} +\`\`\` + +`).join(` +`);this.editorService.openEditor({resource:void 0,contents:c,languageId:"markdown"}),this.telemetryService.publicLog2("openedChatCodeCitations")})),this.domNode=r.root}hasSameContent(e,t,i){return e.kind==="codeCitations"}};OCe=D([_(2,ei),_(3,Yi)],OCe);const FVt=fe;let BCe=class extends V{constructor(e,t,i){super(),this.commandService=i,this.domNode=FVt(".chat-command-button");const n=!vs(t.element)||!t.element.isStale,o=n?e.command.tooltip:g(10565,"Button not available in restored chat"),r=this._register(new Jd(this.domNode,{...y6,supportIcons:!0,title:o}));r.label=e.command.title,r.enabled=n,this._register(r.onDidClick(()=>this.commandService.executeCommand(e.command.id,...e.command.arguments??[])))}hasSameContent(e){return e.kind==="command"}};BCe=D([_(2,vi)],BCe);var OVt=".chat-confirmation-widget{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:16px;padding:8px 12px 12px}.chat-confirmation-widget .chat-confirmation-widget-title{font-weight:600}.chat-confirmation-widget .chat-confirmation-widget-title p{margin:0 0 4px}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown p{margin-top:0}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown>:last-child{margin-bottom:0}.chat-confirmation-widget .chat-confirmation-buttons-container{display:flex;gap:8px;margin-top:13px}.chat-confirmation-widget.hideButtons .chat-confirmation-buttons-container{display:none}";ut(OVt,{});let WCe=class extends V{get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,n){super(),this.instantiationService=n,this._onDidClick=this._register(new I);const o=Bt(".chat-confirmation-widget@root",[Bt(".chat-confirmation-widget-title@title"),Bt(".chat-confirmation-widget-message@message"),Bt(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(Y_,{})),a=this._register(r.render(new Mt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Mt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new Jd(o.buttonsContainer,{...y6,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};WCe=D([_(3,we)],WCe);let HCe=class extends V{constructor(e,t,i,n){super(),this.instantiationService=i,this.chatService=n,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=t.element,r=e.buttons?e.buttons.map(c=>({label:c,data:e.data})):[{label:g(10567,"Accept"),data:e.data},{label:g(10568,"Dismiss"),data:e.data,isSecondary:!0}],a=this._register(this.instantiationService.createInstance(WCe,e.title,e.message,r));a.setShowButtons(!e.isUsed),this._register(a.onDidClick(async c=>{if(vs(o)){const l=`${c.label}: "${e.title}"`,d=c.isSecondary?{rejectedConfirmationData:[c.data]}:{acceptedConfirmationData:[c.data]};d.agentId=o.agent?.id,d.slashCommand=o.slashCommand?.name,await this.chatService.sendRequest(o.sessionId,l,d)&&(e.isUsed=!0,a.setShowButtons(!1),this._onDidChangeHeight.fire())}})),this.domNode=a.domNode}hasSameContent(e){return e.kind==="confirmation"}addDisposable(e){this._register(e)}};HCe=D([_(2,we),_(3,km)],HCe);class xce extends V{get inUse(){return this._inUse}constructor(e){super(),this._itemFactory=e,this.pool=[],this._inUse=new Set}get(){if(this.pool.length>0){const t=this.pool.pop();return this._inUse.add(t),t}const e=this._register(this._itemFactory());return this._inUse.add(e),e}release(e){this._inUse.delete(e),this.pool.push(e)}}W("chat.requestBorder",{dark:new me(new dn(255,255,255,.1)),light:new me(new dn(0,0,0,.1)),hcDark:wt,hcLight:wt},g(7156,"The border color of a chat request."));const BVt=W("chat.requestBackground",{dark:st(Hc,.62),light:st(Hc,.62),hcDark:xh,hcLight:null},g(7157,"The background color of a chat request.")),eVe=W("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:me.white,hcLight:yT},g(7158,"The background color of a chat slash command.")),tVe=W("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:me.black,hcLight:$re},g(7159,"The foreground color of a chat slash command."));W("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:me.black,hcLight:me.white},g(7160,"The background color of a chat avatar."));W("chat.avatarForeground",zi,g(7161,"The foreground color of a chat avatar."));const gue="http://_vscodedecoration_",RQ="http://_chatagent_",WVt="http://_chatslash_";function HVt(s,e,t){const i=t.get(zae),n=t.get(_f),o=i.getAgentNameRestriction(s);let r=`${o?s.name:Ace(s)}`;o&&n.agentHasDupeName(s.id)&&(r+=` (${s.publisherDisplayName})`);const c={agentId:s.id,name:r,isClickable:e};return`[${s.name}](${RQ}?${encodeURIComponent(JSON.stringify(c))})`}let AZ=class{constructor(e,t,i,n,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=n,this.instantiationService=o,this.hoverService=r,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof cb)t+=i.text;else if(i instanceof $g)t+=this.instantiationService.invokeFunction(n=>HVt(i.agent,!1,n));else{const n=i instanceof OW&&i.data instanceof N?i.data:void 0,o=n?encodeURIComponent(this.labelService.getUriLabel(n,{relative:!0})):i instanceof $g?i.agent.id:"",r=i.text;t+=`[${r}](${gue}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const n=i.getAttribute("data-href");if(n)if(n.startsWith(RQ)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(RQ.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(n.startsWith(WVt)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(RQ.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(n.startsWith(gue)){const o=decodeURIComponent(n.slice(gue.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else n.startsWith(Dtt)?this.renderFileWidget(n,i):n.startsWith("command:")&&this.injectKeybindingHint(i,n,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${QU}${e.name}`;let n;if(e.isClickable){n=fe("span.chat-agent-widget");const a=t.add(new Jd(n,{buttonBackground:ze(eVe),buttonForeground:ze(tVe),buttonHoverBackground:void 0}));a.label=i,t.add(a.onDidClick(()=>{const c=this.chatAgentService.getAgent(e.agentId),l=this.chatWidgetService.lastFocusedWidget;!l||!c||this.chatService.sendRequest(l.viewModel.sessionId,c.metadata.sampleRequest??"",{location:l.location,agentId:c.id})}))}else n=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new ya(()=>t.add(this.instantiationService.createInstance(SZ)));return t.add(this.hoverService.setupManagedHover(Pr("element"),n,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&Ott(()=>o,this.commandService))),n}renderSlashCommandWidget(e,t,i){const n=fe("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new Jd(n,{buttonBackground:ze(eVe),buttonForeground:ze(tVe),buttonHoverBackground:void 0}));return r.label=e,i.add(r.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!o)return;const c=o.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:o.id,slashCommand:t.command})})),n}renderFileWidget(e,t){const i=N.parse(e);let n;try{n=Mo(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Nr(a));return}if(!n.uri||!N.isUri(n.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=n.range?`${n.range.startLineNumber}-${n.range.endLineNumber}`:"";t.setAttribute("data-href",n.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(n.uri,{relative:!0});t.title=n.range?`${r}#${n.range.startLineNumber}-${n.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=fe("span.chat-resource-widget"),n=fe("span",void 0,e);return t&&(n.title=t),i.appendChild(n),i}injectKeybindingHint(e,t,i){const n=t.match(/command:([^\)]+)/)?.[1];if(n){const o=i.lookupKeybinding(n);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};AZ=D([_(0,Ut),_(1,Fs),_(2,Ge),_(3,_f),_(4,we),_(5,ec),_(6,km),_(7,UN),_(8,vi)],AZ);const iVe=fe;let EZ=class extends V{constructor(e,t,i,n=!1,o=0,r,a,c,l,d,h,u){super(),this.markdown=e,this.editorPool=i,this.codeBlockModelCollection=c,this.textModelService=h,this.allRefs=[],this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this.codeblocks=[];const f=t.element,p=u.createInstance(AZ),m=[];let v=o;const b=this._register(r.render(e,{fillInIncompleteTokens:n,codeBlockRendererSync:(w,y)=>{const C=v++;let A,L,k;if(ua(w,yVt))try{const G=CVt(y);L=G.range&&F.lift(G.range),A=this.textModelService.createModelReference(G.uri).then(Y=>Y.object)}catch{return iVe("div")}else{if(!Uu(f)&&!vs(f))return console.error("Trying to render code block in welcome",f.id,C),iVe("div");const G=vs(f)||Uu(f)?f.sessionId:"",Y=this.codeBlockModelCollection.getOrCreate(G,f,C);k=Y.vulns,A=Y.model}const P=vs(f)&&f.errorDetails?.responseIsFiltered,R=this.renderCodeBlock({languageId:w,textModel:A,codeBlockIndex:C,element:f,range:L,hideToolbar:P,parentContextKeyService:d,vulns:k},y,a,l.editableCodeBlock);this.allRefs.push(R),this._register(R.object.onDidChangeContentHeight(()=>this._onDidChangeHeight.fire()));const z={codeBlockIndex:C,element:f,focus(){R.object.focus()},uri:R.object.uri};return this.codeblocks.push(z),m.push(R),R.object.element},asyncRenderCallback:()=>this._onDidChangeHeight.fire()}));this._register(p.walkTreeAndAnnotateReferenceLinks(b.element)),m.reverse().forEach(w=>this._register(w)),this.domNode=b.element}renderCodeBlock(e,t,i,n){const o=this.editorPool.get(),r=o.object;return vs(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),r.render(e,i,n),o}hasSameContent(e){return e.kind==="markdownContent"&&e.content.value===this.markdown.value}layout(e){this.allRefs.forEach(t=>t.object.layout(e))}addDisposable(e){this._register(e)}};EZ=D([_(9,Le),_(10,fn),_(11,we)],EZ);let UCe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new xce(()=>n.createInstance(lCe,e,_e.ChatCodeBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};UCe=D([_(3,we)],UCe);class Btt extends V{constructor(e,t,i,n,o){super();const r=i.content.slice(i.index+1);if(this.showSpinner=n??nVe(r,i.element),o!==!0&&r.some(h=>h.kind!=="progressMessage")){this.domNode=fe("");return}this.showSpinner&&Mr(e.content.value);const c=this.showSpinner?We.modify(ve.loading,"spin").id:ve.check.id,l=new Mt(`$(${c}) ${e.content.value}`,{supportThemeIcons:!0}),d=this._register(t.render(l));d.element.classList.add("progress-step"),this.domNode=d.element}hasSameContent(e,t,i){const n=nVe(t,i);return e.kind==="progressMessage"&&this.showSpinner===n}}function nVe(s,e){return vs(e)&&!e.isComplete&&s.length===0}var VCe;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_LIGHT="hcLight",s.HIGH_CONTRAST_DARK="hcDark"})(VCe||(VCe={}));var xV;const UVt="workbench.view.explorer",Bb="workbench.explorer.fileView";new Q("explorerViewletVisible",!0,{type:"boolean",description:g(5364,"True when the EXPLORER viewlet is visible.")});const ANe=new Q("foldersViewVisible",!0,{type:"boolean",description:g(5365,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),VVt=new Q("explorerResourceIsFolder",!1,{type:"boolean",description:g(5366,"True when the focused item in the EXPLORER is a folder.")}),Wtt=new Q("explorerResourceReadonly",!1,{type:"boolean",description:g(5367,"True when the focused item in the EXPLORER is read-only.")}),Htt=Wtt.toNegated(),zVt=new Q("explorerResourceAvailableEditorIds",""),$Vt=new Q("explorerResourceIsRoot",!1,{type:"boolean",description:g(5368,"True when the focused item in the EXPLORER is a root folder.")}),GVt=new Q("explorerResourceCut",!1,{type:"boolean",description:g(5369,"True when an item in the EXPLORER has been cut for cut and paste.")}),KVt=new Q("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(5370,"True when the focused item in the EXPLORER can be moved to trash.")}),Utt=new Q("filesExplorerFocus",!0,{type:"boolean",description:g(5371,"True when the focus is inside the EXPLORER view.")});new Q("openEditorsFocus",!0,{type:"boolean",description:g(5372,"True when the focus is inside the OPEN EDITORS view.")});const Vtt=new Q("explorerViewletFocus",!0,{type:"boolean",description:g(5373,"True when the focus is inside the EXPLORER viewlet.")}),qVt=new Q("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(5374,"True when the focused item in the EXPLORER view is a compact item.")}),QVt=new Q("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(5375,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),jVt=new Q("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(5376,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),YVt=new Q("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(5377,"True when a workspace in the EXPLORER view has some collapsible root child.")});he.and(ANe,Utt,he.not(yae));he.and(ANe,Vtt,he.not(yae));const ztt="workbench.editors.files.textFileEditor",$tt="workbench.editors.files.fileEditorInput",JVt="workbench.editors.files.binaryFileEditor";var zCe;(function(s){s.Default="default",s.Mixed="mixed",s.FilesFirst="filesFirst",s.Type="type",s.Modified="modified",s.FoldersNestsFiles="foldersNestsFiles"})(zCe||(zCe={}));var RT;(function(s){s.Verbose="verbose",s.Default="default",s.Light="light"})(RT||(RT={}));var sVe;(function(s){s.Default="default",s.Upper="upper",s.Lower="lower",s.Unicode="unicode"})(sVe||(sVe={}));let oVe=xV=class extends V{constructor(e,t,i,n){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=n,this.fileWatcherDisposable=this._register(new wn)}static async open(e,t,i,n,o){await n.openEditor({original:{resource:xV.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:o})}static resourceToTextFile(e,t){return t.with({scheme:e,query:JSON.stringify({scheme:t.scheme,query:t.query})})}static textFileToResource(e){const{scheme:t,query:i}=JSON.parse(e.query);return e.with({scheme:t,query:i})}async provideTextContent(e){if(!e.query)return null;const t=xV.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const n=new Z;this.fileWatcherDisposable.value=n,n.add(this.fileService.onDidFilesChange(o=>{o.contains(t,To.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&n.add(M.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=xV.textFileToResource(e),n=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,n.value);else if(t){const r=this.modelService.getModel(i);let a;r?a=this.languageService.createById(r.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),o=this.modelService.createModel(n.value,a,e)}return o}};oVe=xV=D([_(0,Fo),_(1,Jt),_(2,xi),_(3,gi)],oVe);const koe=class koe{constructor(e,t){this._editor=e,this._group=t,this.id=koe.COUNTER++}get editor(){return this._editor}get group(){return this._group}get groupId(){return this._group.id}getId(){return`openeditor:${this.groupId}:${this.id}`}isPreview(){return!this._group.isPinned(this.editor)}isSticky(){return this._group.isSticky(this.editor)}getResource(){return Na.getOriginalUri(this.editor,{supportSideBySide:Hs.PRIMARY})}};koe.COUNTER=0;let xZ=koe;var rVe;(function(s){s[s.Confirmation=1]="Confirmation",s[s.Prompt=2]="Prompt",s[s.Input=3]="Input"})(rVe||(rVe={}));var Gh;(function(s){s[s.SAVE=0]="SAVE",s[s.DONT_SAVE=1]="DONT_SAVE",s[s.CANCEL=2]="CANCEL"})(Gh||(Gh={}));const LK=10;function Gtt(s){const e=[];return e.push(...s.slice(0,LK).map(t=>typeof t=="string"?t:_i(t))),s.length>LK&&(s.length-LK===1?e.push(g(5690,"...1 additional file not shown")):e.push(g(5691,"...{0} additional files not shown",s.length-LK))),e.push(""),e.join(` +`)}var XVt=".quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-editor:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";ut(XVt,{});const DZ=0,aVe=[DZ,[]];function cVe(s,e,t,i){if(!s||!e)return aVe;const n=s.length,o=e.length;if(n0,v=s[u],b=e[u];for(let w=0;w0,C=f+w,A=C-1,L=p+w-1,k=y?a[A]:0,P=m&&y?a[L]:0,R=m&&y?c[L]:0;let z;!P&&m?z=0:z=e5t(v,b,i,n,w,R),z&&P+z>=k&&(r||m||n.startsWith(e,w))?(c[C]=R+1,a[C]=P+z):(c[C]=DZ,a[C]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===DZ||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function e5t(s,e,t,i,n,o){let r=0;if(!t5t(e,i[n]))return r;if(r+=1,o>0&&(r+=o*5),s===t[n]&&(r+=1),n===0)r+=8;else{const a=i5t(t.charCodeAt(n-1));a?r+=a:g6(t.charCodeAt(n))&&o===0&&(r+=2)}return r}function t5t(s,e){return s===e?!0:s==="/"||s==="\\"?e==="/"||e==="\\":!1}function i5t(s){switch(s){case B.Slash:case B.Backslash:return 5;case B.Underline:case B.Dash:case B.Period:case B.Space:case B.SingleQuote:case B.DoubleQuote:case B.Colon:return 4;default:return 0}}const Ktt=[void 0,[]];function fue(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?n5t(s,n.values,t,i):qtt(s,e,t,i)}function n5t(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,c]=qtt(s,r,t,i);if(typeof a!="number")return Ktt;n+=a,o.push(...c)}return[n,qCe(o)]}function qtt(s,e,t,i){const n=Uk(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],xU(n)]:Ktt}const kZ=Object.freeze({score:0}),MQ=1<<18,$Ce=1<<17,GCe=65536;function s5t(s,e,t,i){const n=i.values?i.values:[i];return Wc({[i.normalized]:{values:n.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:s,description:e,allowNonContiguousMatches:t}})}function KCe(s,e,t,i,n){if(!s||!e.normalized)return kZ;const o=i.getItemLabel(s);if(!o)return kZ;const r=i.getItemDescription(s),a=s5t(o,r,t,e),c=n[a];if(c)return c;const l=o5t(o,r,i.getItemPath(s),e);return n[a]=l,l}function o5t(s,e,t,i,n){const o=!t||!i.containsPathSeparator;return t&&(pr?i.pathNormalized===t:ua(i.pathNormalized,t))?{score:MQ,labelMatch:[{start:0,end:s.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?r5t(s,e,t,i.values,o):Qtt(s,e,t,i,o)}function r5t(s,e,t,i,n,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=Qtt(s,e,t,l,n);if(d===DZ)return kZ;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:qCe(a),descriptionMatch:qCe(c)}}function Qtt(s,e,t,i,n,o){if(n||!e){const[r,a]=cVe(s,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=CM(i.normalized,s);let l;if(c){l=$Ce;const d=Math.round(i.normalized.length/s.length*100);l+=d}else l=GCe;return{score:l+r,labelMatch:c||lVe(a)}}}if(e){let r=e;t&&(r=`${e}${ou}`);const a=r.length,c=`${r}${s}`,[l,d]=cVe(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=lVe(d),u=[],f=[];return h.forEach(p=>{p.starta?(u.push({start:0,end:p.end-a}),f.push({start:p.start,end:a})):p.start>=a?u.push({start:p.start-a,end:p.end-a}):f.push(p)}),{score:l,labelMatch:u,descriptionMatch:f}}}return kZ}function lVe(s){const e=[];if(!s)return e;let t;for(const i of s)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function qCe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!a5t(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function a5t(s,e){return!(s.endGCe||l>GCe){if(c!==l)return c>l?-1:1;if(c<$Ce&&l<$Ce){const v=l5t(r.labelMatch,a.labelMatch);if(v!==0)return v}const p=n.getItemLabel(s)||"",m=n.getItemLabel(e)||"";if(p.length!==m.length)return p.length-m.length}if(c!==l)return c>l?-1:1;const d=Array.isArray(r.labelMatch)&&r.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=dVe(s,r,n),f=dVe(e,a,n);return u&&f&&u!==f?f>u?-1:1:d5t(s,e,t,n)}function dVe(s,e,t){let i=-1,n=-1;if(e.descriptionMatch&&e.descriptionMatch.length?i=e.descriptionMatch[0].start:e.labelMatch&&e.labelMatch.length&&(i=e.labelMatch[0].start),e.labelMatch&&e.labelMatch.length){if(n=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(s);o&&(n+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(n=e.descriptionMatch[e.descriptionMatch.length-1].end);return n-i}function l5t(s,e){if(!s&&!e||(!s||!s.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!s||!s.length)return 1;const t=s[0].start,n=s[s.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return n===a?0:a=0,r=hVe(s);let a;const c=s.split(jtt);if(c.length>1)for(const l of c){const d=hVe(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=uVe(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function uVe(s){let e;Qn?e=s.replace(/\//g,ou):e=s.replace(/\\/g,ou);const t=dat(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function gVe(s){return Array.isArray(s)?b9(s.map(e=>e.original).join(jtt)):b9(s.original)}var QCe,jCe,YCe;let w9=class extends mNe{constructor(e,t,i,n,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(9601,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=n,this.languageService=o,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(r){r||(this.scorerCache=Object.create(null)),this.isQuickNavigating=r}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=b9(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=KCe(o,t,!0,j2e,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(hu.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):c5t(r,a,t,!0,j2e,this.pickState.scorerCache))}const n=[];if(this.editorGroupService.count>1){let o;for(const r of i){if(typeof o!="number"||o!==r.groupId){const a=this.editorGroupService.getGroup(r.groupId);a&&n.push({type:"separator",label:a.label}),o=r.groupId}n.push(r)}}else n.push(...i);return n}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const n=this.editorGroupService.getGroup(i);n&&t.set(i,n.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:n})=>{const o=Na.getOriginalUri(i,{supportSideBySide:Hs.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:n,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(9602,"{0}, unsaved changes, {1}",c,t.get(n)):g(9603,"{0}, {1}",c,t.get(n)):r?g(9604,"{0}, unsaved changes",c):c,description:a,iconClasses:Mx(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(n)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+We.asClassName(ve.closeDirty):We.asClassName(ve.close),tooltip:g(9605,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(n);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?IS.REMOVE_ITEM:IS.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(n)?.openEditor(i,{preserveFocus:d.inBackground})}})}};w9=D([_(1,Po),_(2,ei),_(3,gi),_(4,xi)],w9);var uR;let fVe=(uR=class extends w9{constructor(e,t,i,n){super(QCe.PREFIX,e,t,i,n)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(Zh.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},QCe=uR,uR.PREFIX="edt active ",uR);fVe=QCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],fVe);var gR;let pVe=(gR=class extends w9{constructor(e,t,i,n){super(jCe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(hu.GRID_APPEARANCE))for(const i of t.getEditors(Zh.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},jCe=gR,gR.PREFIX="edt ",gR);pVe=jCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],pVe);var fR;let mVe=(fR=class extends w9{constructor(e,t,i,n){super(YCe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(Zh.MOST_RECENTLY_ACTIVE))e.push(t);return e}},YCe=fR,fR.PREFIX="edt mru ",fR);mVe=YCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],mVe);var h5t=".side-by-side-editor-container{height:100%;width:100%}";ut(h5t,{});var WP,pR;let op=(pR=class extends Ob{get typeId(){return WP.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Ei.CanSplitInGroup,this.secondary.hasCapability(Ei.RequiresTrust)&&(e|=Ei.RequiresTrust),this.secondary.hasCapability(Ei.Singleton)&&(e|=Ei.Singleton),e|=Ei.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,n,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=n,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(M.once(M.any(this.primary.onWillDispose,this.secondary.onWillDispose))(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.secondary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.secondary.onDidChangeLabel(()=>this._onDidChangeLabel.fire()))}getName(){const e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():g(6231,"{0} - {1}",this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){const t=this.getPreferredDescription();return t||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t;this.hasIdenticalSides?t=this.primary.getTitle(e)??this.getName():t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getLabelExtraClasses(){return this.hasIdenticalSides?this.primary.getLabelExtraClasses():super.getLabelExtraClasses()}getAriaLabel(){return this.hasIdenticalSides?this.primary.getAriaLabel():super.getAriaLabel()}getTelemetryDescriptor(){return{...this.primary.getTelemetryDescriptor(),...super.getTelemetryDescriptor()}}isDirty(){return this.primary.isDirty()}isSaving(){return this.primary.isSaving()}async save(e,t){const i=await this.primary.save(e,t);return this.saveResultToEditor(i)}async saveAs(e,t){const i=await this.primary.saveAs(e,t);return this.saveResultToEditor(i)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof Ob)return new WP(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!E_(e)&&!L5(e)&&!kS(e)&&!wb(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,t){return this.primary.revert(e,t)}async rename(e,t){if(!this.hasIdenticalSides)return;const i=await this.primary.rename(e,t);if(i){if(wa(i.editor))return{editor:new WP(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:YO(this,e,this.editorService)}};if(Qv(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:YO(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){const t=this.primary.toUntyped(e),i=this.secondary.toUntyped(e);if(t&&i&&!E_(t)&&!E_(i)&&!L5(t)&&!L5(i)&&!kS(t)&&!kS(i)&&!wb(t)&&!wb(i)){const n={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(n.options={viewState:YO(this,e.preserveViewState,this.editorService)}),n}}matches(e){return this===e?!0:sJe(e)||E_(e)?!1:e instanceof WP?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):kS(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},WP=pR,pR.ID="workbench.editorinputs.sidebysideEditorInput",pR);op=WP=D([_(4,ei)],op);const jc=class jc{constructor(e,t){this.storageService=t,this.id=jc.COMMON_PREFIX+e}getMemento(e,t){switch(e){case Ie.WORKSPACE:{let i=jc.workspaceMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.workspaceMementos.set(this.id,i)),i.getMemento()}case Ie.PROFILE:{let i=jc.profileMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.profileMementos.set(this.id,i)),i.getMemento()}case Ie.APPLICATION:{let i=jc.applicationMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){jc.workspaceMementos.get(this.id)?.save(),jc.profileMementos.get(this.id)?.save(),jc.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case Ie.APPLICATION:t=jc.applicationMementos.get(this.id);break;case Ie.PROFILE:t=jc.profileMementos.get(this.id);break;case Ie.WORKSPACE:t=jc.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case Ie.WORKSPACE:jc.workspaceMementos.clear();break;case Ie.PROFILE:jc.profileMementos.clear();break;case Ie.APPLICATION:jc.applicationMementos.clear();break}}};jc.applicationMementos=new Map,jc.profileMementos=new Map,jc.workspaceMementos=new Map,jc.COMMON_PREFIX="memento/";let sI=jc;class pue{constructor(e,t,i,n){this.id=e,this.scope=t,this.target=i,this.storageService=n,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){vt(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(const e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){CA(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class Ytt extends jTe{constructor(e,t,i){super(t),this.id=e,this.memento=new sI(this.id,i),this._register(i.onWillSaveState(()=>{this.saveState(),this.memento.saveMemento()}))}getId(){return this.id}getMemento(e,t){return this.memento.getMemento(e,t)}reloadMemento(e){return this.memento.reloadMemento(e)}onDidChangeMementoValue(e,t){return this.memento.onDidChangeValue(e,t)}saveState(){}}class u5t extends Ytt{get onDidFocus(){return this._onDidFocus||(this._onDidFocus=this.registerFocusTrackEvents().onDidFocus),this._onDidFocus.event}get onDidBlur(){return this._onDidBlur||(this._onDidBlur=this.registerFocusTrackEvents().onDidBlur),this._onDidBlur.event}hasFocus(){return this._hasFocus}registerFocusTrackEvents(){const e=qn(this.getContainer()),t=this._register(Ac(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const n=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,n.fire()})),{onDidFocus:i,onDidBlur:n}}constructor(e,t,i,n){super(e,i,n),this.telemetryService=t,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._hasFocus=!1,this.visible=!1}getTitle(){}create(e){this.parent=e}getContainer(){return this.parent}setVisible(e){this.visible!==!!e&&(this.visible=e)}focus(){}getMenuIds(){return[]}getActions(){return[]}getSecondaryActions(){return[]}getContextMenuActions(){return[]}getActionViewItem(e,t){}getActionsContext(){return null}getActionRunner(){return this.actionRunner||(this.actionRunner=this._register(new $_)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const rO=class rO extends u5t{get minimumWidth(){return Rx.width}get maximumWidth(){return BJ.width}get minimumHeight(){return Rx.height}get maximumHeight(){return BJ.height}get input(){return this._input}get options(){return this._options}get window(){return Hj(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,o){super(e,i,n,o),this.group=t,this.onDidChangeSizeConstraints=M.None,this._onDidChangeControl=this._register(new I),this.onDidChangeControl=this._onDidChangeControl.event}create(e){super.create(e),this.createEditor(e)}async setInput(e,t,i,n){this._input=e,this._options=t}clearInput(){this._input=void 0,this._options=void 0}setOptions(e){this._options=e}setVisible(e){super.setVisible(e),this.setEditorVisible(e)}setEditorVisible(e){}setBoundarySashes(e){}getEditorMemento(e,t,i,n=10){const o=`${this.getId()}${i}`;let r=rO.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new JCe(this.getId(),i,this.getMemento(Ie.WORKSPACE,an.MACHINE),n,e,t)),rO.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of rO.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};rO.EDITOR_MEMENTOS=new Map;let IZ=rO;const aO=class aO extends V{constructor(e,t,i,n,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,this.editorGroupService=o,this.configurationService=r,this.cleanedUp=!1,this.shareEditorState=!1,this.updateConfiguration(void 0),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){(!e||e.affectsConfiguration(void 0,"workbench.editor.sharedViewState"))&&(this.shareEditorState=this.configurationService.getValue(void 0,"workbench.editor.sharedViewState")===!0)}saveEditorState(e,t,i){const n=this.doGetResource(t);if(!n||!e)return;const o=this.doLoad();let r=o.get(n.toString());r||(r=Object.create(null),o.set(n.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[aO.SHARED_EDITOR_STATE]=i),wa(t)&&this.clearEditorStateOnDispose(n,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const o=this.doLoad().get(i.toString());if(o){const r=o[e.id];if(r)return r;if(this.shareEditorState)return o[aO.SHARED_EDITOR_STATE]}}clearEditorState(e,t){wa(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const n=this.doLoad();if(t){const o=n.get(i.toString());o&&(delete o[t.id],CA(o)&&n.delete(i.toString()))}else n.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,M.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const n=this.doLoad(),o=[...n.keys()];for(const r of o){const a=N.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(ji(e,a))c=t;else{const d=SGe(a.path,e.path);c=Pt(t,a.path.substr(d+e.path.length+1))}const l=n.get(r,Gl.None);l&&(n.delete(r),n.set(c.toString(),l))}}doGetResource(e){return wa(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new um(this.limit);const e=this.memento[this.key];Array.isArray(e)&&this.cache.fromJSON(e)}return this.cache}saveState(){const e=this.doLoad();this.cleanedUp||(this.cleanUp(),this.cleanedUp=!0),this.memento[this.key]=e.toJSON()}cleanUp(){const e=this.doLoad(),t=[...e.entries()];for(const[i,n]of t)for(const o of Object.keys(n)){const r=Number(o);r===aO.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete n[r],CA(n)&&e.delete(i))}}};aO.SHARED_EDITOR_STATE=-1;let JCe=aO,TZ=class extends IZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,n,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new wn),this.viewState=this.getEditorMemento(d,a,i,100)}setEditorVisible(e){this.groupListener.value=this.group.onWillCloseEditor(t=>this.onWillCloseEditor(t)),super.setEditorVisible(e)}onWillCloseEditor(e){const t=e.editor;t===this.input&&this.updateEditorViewState(t)}clearInput(){this.updateEditorViewState(this.input),super.clearInput()}saveState(){this.updateEditorViewState(this.input),super.saveState()}updateEditorViewState(e){if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);t&&(this.tracksDisposedEditorViewState()||(this.editorViewStateDisposables||(this.editorViewStateDisposables=new Map),this.editorViewStateDisposables.has(e)||this.editorViewStateDisposables.set(e,M.once(e.onWillDispose)(()=>{this.clearEditorViewState(t,this.group),this.editorViewStateDisposables?.delete(e)}))),e.isDisposed()&&!this.tracksDisposedEditorViewState()||!this.shouldRestoreEditorViewState(e)&&!this.group.contains(e)?this.clearEditorViewState(t,this.group):e.isDisposed()||this.saveEditorViewState(t))}shouldRestoreEditorViewState(e,t){return t?.newInGroup?this.textResourceConfigurationService.getValue(Na.getOriginalUri(e,{supportSideBySide:Hs.PRIMARY}),"workbench.editor.restoreViewState")!==!1:!0}getViewState(){const e=this.input;if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);if(t)return this.computeEditorViewState(t)}saveEditorViewState(e){const t=this.computeEditorViewState(e);t&&this.viewState.saveEditorState(this.group,e,t)}loadEditorViewState(e,t){if(!e||!this.tracksEditorViewState(e)||!this.shouldRestoreEditorViewState(e,t))return;const i=this.toEditorViewStateResource(e);if(i)return this.viewState.loadEditorState(this.group,i)}moveEditorViewState(e,t,i){return this.viewState.moveEditorState(e,t,i)}clearEditorViewState(e,t){this.viewState.clearEditorState(e,t)}dispose(){if(super.dispose(),this.editorViewStateDisposables){for(const[,e]of this.editorViewStateDisposables)e.dispose();this.editorViewStateDisposables=void 0}}tracksDisposedEditorViewState(){return!1}};TZ=D([_(3,Yi),_(4,we),_(5,$i),_(6,Ec),_(7,pn),_(8,ei),_(9,Po)],TZ);var y0;function g5t(s){const e=s;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var KS;let XCe=(KS=class extends TZ{get minimumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.minimumWidth:0}get maximumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.minimumHeight:0}get maximumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}get minimumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumWidth:0}get maximumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumHeight:0}get maximumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}set minimumWidth(e){}set maximumWidth(e){}set minimumHeight(e){}set maximumHeight(e){}get minimumWidth(){return this.minimumPrimaryWidth+this.minimumSecondaryWidth}get maximumWidth(){return this.maximumPrimaryWidth+this.maximumSecondaryWidth}get minimumHeight(){return this.minimumPrimaryHeight+this.minimumSecondaryHeight}get maximumHeight(){return this.maximumPrimaryHeight+this.maximumSecondaryHeight}constructor(e,t,i,n,o,r,a,c,l){super(y0.ID,e,y0.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,n,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new Xge),this.onDidChangeSizeConstraints=M.any(this.onDidCreateEditors.event,this._onDidChangeSizeConstraints.event),this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this.primaryEditorPane=void 0,this.secondaryEditorPane=void 0,this.splitviewDisposables=this._register(new Z),this.editorDisposables=this._register(new Z),this.orientation=this.configurationService.getValue(y0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.dimension=new bn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(y0.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(y0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=qn(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(this.splitview.el.remove(),this.splitviewDisposables.clear()),this.createSplitView(e,t),this.layout(this.dimension)}getSplitViewRatio(){let e;if(this.splitview){const t=this.splitview.getViewSize(0),i=this.splitview.getViewSize(1);if(Math.abs(t-i)>1){const n=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/n}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new C3(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===fi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=Kk.Distribute,n=Kk.Distribute;if(t){const a=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),n=a-i,this.splitview.layout(this.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=qn(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Rx.width:Rx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},i);const r=qn(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Rx.width:Rx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},n),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(8675,"Side by Side Editor")}async setInput(e,t,i,n){const o=this.input;await super.setInput(e,t,i,n),(!o||!e.matches(o))&&(o&&this.disposeEditors(),this.createEditors(e));const{primary:r,secondary:a,viewState:c}=this.loadViewState(e,t,i);if(this.lastFocusedSide=c?.focus,typeof c?.ratio=="number"&&this.splitview){const l=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;this.splitview.resizeView(0,Math.round(l*c.ratio))}else this.splitview?.distributeViewSizes();await Promise.all([this.secondaryEditorPane?.setInput(e.secondary,a,i,n),this.primaryEditorPane?.setInput(e.primary,r,i,n)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const n=g5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===Hs.SECONDARY?r={...t}:o={...t},o.viewState=n?.primary,n?.secondary&&(r?r.viewState=n?.secondary:r={viewState:n.secondary}),{primary:o,secondary:r,viewState:n}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,qn(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,qn(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=M.any(M.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),M.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.SECONDARY)))}doCreateEditor(e,t){const i=Qe.as(tC.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const n=i.instantiate(this.instantiationService,this.group);return n.create(t),n.setVisible(this.isVisible()),VWe(n)&&this.editorDisposables.add(n.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(n),n}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(VWe(e)){const t=e.getSelection();if(t)return new ENe(t,e===this.primaryEditorPane?Hs.PRIMARY:Hs.SECONDARY)}}setOptions(e){super.setOptions(e),typeof e?.target=="number"&&(this.lastFocusedSide=e.target),this.getLastFocusedEditorPane()?.setOptions(e)}setEditorVisible(e){this.primaryEditorPane?.setVisible(e),this.secondaryEditorPane?.setVisible(e),super.setEditorVisible(e)}clearInput(){super.clearInput(),this.primaryEditorPane?.clearInput(),this.secondaryEditorPane?.clearInput(),this.disposeEditors()}focus(){super.focus(),this.getLastFocusedEditorPane()?.focus()}getLastFocusedEditorPane(){return this.lastFocusedSide===Hs.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,qn(this.splitview).layout(this.orientation===fi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===fi.HORIZONTAL?new bn(t,this.dimension.height):new bn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof op}computeEditorViewState(e){if(!this.input||!ji(e,this.toEditorViewStateResource(this.input)))return;const t=this.primaryEditorPane?.getViewState(),i=this.secondaryEditorPane?.getViewState();if(!(!t||!i))return{primary:t,secondary:i,focus:this.lastFocusedSide,ratio:this.getSplitViewRatio()}}toEditorViewStateResource(e){let t,i;if(e instanceof op&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return N.from({scheme:"sideBySide",path:`${T8(i.toString())}${T8(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===fi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(lTt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(cTt)??"",this.primaryEditorContainer.style.borderLeftWidth="0"))}dispose(){this.disposeEditors(),super.dispose()}disposeEditors(){this.editorDisposables.clear(),this.secondaryEditorPane=void 0,this.primaryEditorPane=void 0,this.lastFocusedSide=void 0,this.secondaryEditorContainer&&Ms(this.secondaryEditorContainer),this.primaryEditorContainer&&Ms(this.primaryEditorContainer)}},y0=KS,KS.ID=V0t,KS.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",KS.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",KS);XCe=y0=D([_(1,Yi),_(2,we),_(3,pn),_(4,$i),_(5,Te),_(6,Ec),_(7,ei),_(8,Po)],XCe);class ENe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof ENe)||this.side!==e.side?Lx.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const xw=class xw{static didInstantiateEditorPane(e){return xw.instantiatedEditorPanes.has(e)}static create(e,t,i){return new xw(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){xw._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return xw.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};xw.instantiatedEditorPanes=new Set,xw._onWillInstantiateEditorPane=new I,xw.onWillInstantiateEditorPane=xw._onWillInstantiateEditorPane.event;let _Ve=xw;class f5t{constructor(){this.mapEditorPanesToEditors=new Map}registerEditorPane(e,t){return this.mapEditorPanesToEditors.set(e,t),Ee(()=>{this.mapEditorPanesToEditors.delete(e)})}getEditorPane(e){const t=this.findEditorPaneDescriptors(e);if(t.length!==0)return t.length===1?t[0]:e.prefersEditorPane(t)}findEditorPaneDescriptors(e,t){const i=[];for(const n of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(n)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(n);break}else if(t&&e instanceof a){i.push(n);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return hi.find(this.mapEditorPanesToEditors.keys(),t=>t.typeId===e)}getEditorPanes(){return Array.from(this.mapEditorPanesToEditors.keys())}getEditors(){const e=[];for(const t of this.mapEditorPanesToEditors.keys()){const i=this.mapEditorPanesToEditors.get(t);i&&e.push(...i.map(n=>n.ctor))}return e}}Qe.add(tC.EditorPane,new f5t);function p5t(s,e){const t=s.get(ei),i=s.get(ks),n=s.get(Rm);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===cA.MOVE)return;let l=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.PRIMARY}),d=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.SECONDARY});if(c.context===cA.REPLACE){const h=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),u=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(r=r.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==cA.REPLACE&&(l?.scheme===pe.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===pe.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>n.isDirty(u));return h.length>0&&await Zs.settled(h.map(async u=>await new Promise(f=>{if(!n.isDirty(u))return f();const p=n.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function m5t(s,e,t,i){let n=s.getAriaLabel();return t&&!t.isPinned(s)&&(n=g(4580,"{0}, preview",n)),t?.isSticky(s)&&(n=g(4581,"{0}, pinned",n)),t&&typeof i=="number"&&i>1&&(n=`${n}, ${t.ariaLabel}`),n}var ZCe,mR;let eSe=(mR=class extends TZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,ZCe.VIEW_STATE_PREFERENCE_KEY,i,n,o,r,a,c,l),this.fileService=d,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeScroll=this._register(new I),this.onDidChangeScroll=this._onDidChangeScroll.event,this.inputListener=this._register(new wn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(M.any(this.editorGroupService.onDidAddGroup,this.editorGroupService.onDidRemoveGroup)(()=>{const h=this.computeAriaLabel();this.editorContainer?.setAttribute("aria-label",h),this.updateEditorControlOptions({ariaLabel:h})})),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(h=>this.onDidChangeFileSystemProvider(h.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(h=>this.onDidChangeFileSystemProvider(h.scheme)))}handleConfigurationChangeEvent(e){const t=this.getActiveResource();this.shouldHandleConfigurationChangeEvent(e,t)&&(this.isVisible()?this.updateEditorConfiguration(t):this.hasPendingConfigurationChange=!0)}shouldHandleConfigurationChangeEvent(e,t){return e.affectsConfiguration(t,"editor")||e.affectsConfiguration(t,"problems.visibility")}consumePendingConfigurationChangeEvent(){this.hasPendingConfigurationChange&&(this.updateEditorConfiguration(),this.hasPendingConfigurationChange=!1)}computeConfiguration(e){const t=kn(e.editor)?xs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?m5t(this.input,void 0,this.group,this.editorGroupService.count):g(11473,"Editor")}onDidChangeFileSystemProvider(e){this.input&&this.getActiveResource()?.scheme===e&&this.updateReadonly(this.input)}onDidChangeInputCapabilities(e){this.input===e&&this.updateReadonly(e)}updateReadonly(e){this.updateEditorControlOptions({...this.getReadonlyConfiguration(e.isReadonly())})}getReadonlyConfiguration(e){return{readOnly:!!e,readOnlyMessage:typeof e!="boolean"?e:void 0}}getConfigurationOverrides(e){return{overviewRulerLanes:3,lineNumbersMinChars:3,fixedOverflowWidgets:!0,...this.getReadonlyConfiguration(this.input?.isReadonly()),renderValidationDecorations:e.problems?.visibility!==!1?"on":"off"}}createEditor(e){this.editorContainer=e,this.createEditorControl(e,this.computeConfiguration(this.textResourceConfigurationService.getValue(this.getActiveResource()))),this.registerCodeEditorListeners()}registerCodeEditorListeners(){const e=this.getMainControl();e&&(this._register(e.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeModel(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeCursorPosition(t=>this._onDidChangeSelection.fire({reason:this.toEditorPaneSelectionChangeReason(t)}))),this._register(e.onDidChangeModelContent(()=>this._onDidChangeSelection.fire({reason:Y0.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case Db.PROGRAMMATIC:return Y0.PROGRAMMATIC;case Db.NAVIGATION:return Y0.NAVIGATION;case Db.JUMP:return Y0.JUMP;default:return Y0.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new tSe(t)}}async setInput(e,t,i,n){await super.setInput(e,t,i,n),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),qn(this.editorContainer).setAttribute("aria-label",this.computeAriaLabel())}clearInput(){this.inputListener.clear(),super.clearInput()}getScrollPosition(){const e=this.getMainControl();if(!e)throw new Error("Control has not yet been initialized");return{scrollTop:e.getScrollTop()-e.getTopForLineNumber(1),scrollLeft:e.getScrollLeft()}}setScrollPosition(e){const t=this.getMainControl();if(!t)throw new Error("Control has not yet been initialized");t.setScrollTop(e.scrollTop),e.scrollLeft&&t.setScrollLeft(e.scrollLeft)}setEditorVisible(e){e&&this.consumePendingConfigurationChangeEvent(),super.setEditorVisible(e)}toEditorViewStateResource(e){return e.resource}updateEditorConfiguration(e=this.getActiveResource()){let t;if(e&&(t=this.textResourceConfigurationService.getValue(e)),!t)return;const i=this.computeConfiguration(t);let n=i;this.lastAppliedEditorOptions&&(n=o8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(n))}getActiveResource(){const e=this.getMainControl();if(e){const t=e.getModel();if(t)return t.uri}if(this.input)return this.input.resource}dispose(){this.lastAppliedEditorOptions=void 0,super.dispose()}},ZCe=mR,mR.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",mR);eSe=ZCe=D([_(2,Yi),_(3,we),_(4,$i),_(5,Ec),_(6,pn),_(7,ei),_(8,Po),_(9,Jt)],eSe);const Yz=class Yz{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof Yz))return Lx.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Lx.IDENTICAL:Math.abs(t-i){this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get hasLanguageSetExplicitly(){return this._hasLanguageSetExplicitly}setLanguageId(e,t){this._hasLanguageSetExplicitly=!0,this.setLanguageIdInternal(e,t)}setLanguageIdInternal(e,t){this.isResolved()&&(!e||e===this.textEditorModel.getLanguageId()||this.textEditorModel.setLanguage(this.languageService.createById(e),t))}installModelListeners(e){const t=this._register(e.onDidChangeLanguage(i=>{i.source!==vVe&&(this._hasLanguageSetExplicitly=!0,t.dispose())}))}getLanguageId(){return this.textEditorModel?.getLanguageId()}autoDetectLanguage(){return this.autoDetectLanguageThrottler.trigger(()=>this.doAutoDetectLanguage())}async doAutoDetectLanguage(){if(this.hasLanguageSetExplicitly||!this.textEditorModelHandle||!this.languageDetectionService.isEnabledForLanguage(this.getLanguageId()??Ca))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,vVe);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(9795,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const n=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,n);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let n=i&&this.modelService.getModel(i);return n?this.updateTextEditorModel(e,t.languageId):(n=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(n)),this.textEditorModelHandle=n.uri,n}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(Yj.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,Yj.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,n){return!i||i===Ca?t.createByFilepathOrFirstLine(e??null,n):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Ca&&this.textEditorModel.getLanguageId()!==t&&this.textEditorModel.setLanguage(this.languageService.createById(t)))}createSnapshot(){return this.textEditorModel?this.textEditorModel.createSnapshot(!0):null}isResolved(){return!!this.textEditorModelHandle}dispose(){this.modelDisposeListener.dispose(),this.textEditorModelHandle&&this.createdEditorModel&&this.modelService.destroyModel(this.textEditorModelHandle),this.textEditorModelHandle=void 0,this.createdEditorModel=!1,super.dispose()}},iSe=_R,_R.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,_R);oI=iSe=D([_(0,gi),_(1,xi),_(2,O6),_(3,mr)],oI);class Jtt extends RI{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}class Xtt extends Jtt{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}constructor(e,t){super(e,t),this._textDiffEditorModel=void 0,this._originalModel=e,this._modifiedModel=t,this.updateTextDiffEditorModel()}async resolve(){await super.resolve(),this.updateTextDiffEditorModel()}updateTextDiffEditorModel(){this.originalModel?.isResolved()&&this.modifiedModel?.isResolved()&&(this._textDiffEditorModel?(this._textDiffEditorModel.original=this.originalModel.textEditorModel,this._textDiffEditorModel.modified=this.modifiedModel.textEditorModel):this._textDiffEditorModel={original:this.originalModel.textEditorModel,modified:this.modifiedModel.textEditorModel})}isResolved(){return!!this._textDiffEditorModel}isReadonly(){return!!this.modifiedModel&&this.modifiedModel.isReadonly()}dispose(){this._textDiffEditorModel=void 0,super.dispose()}}var NQ,vR;let qg=(vR=class extends op{get typeId(){return NQ.ID}get editorId(){return this.modified.editorId===this.original.editorId?this.modified.editorId:void 0}get capabilities(){let e=super.capabilities;return this.labels.forceDescription&&(e|=Ei.ForceDescription),e}constructor(e,t,i,n,o,r){super(e,t,i,n,r),this.original=i,this.modified=n,this.forceOpenAsBinary=o,this.cachedModel=void 0,this.labels=this.computeLabels()}computeLabels(){let e,t=!1;if(this.preferredName)e=this.preferredName;else{const d=this.original.getName(),h=this.modified.getName();e=g(8674,"{0} ↔ {1}",d,h),t=d===h}let i,n,o;if(this.preferredDescription)i=this.preferredDescription,n=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Ls.SHORT),this.modified.getDescription(Ls.SHORT)),o=this.computeLabel(this.original.getDescription(Ls.LONG),this.modified.getDescription(Ls.LONG));const d=this.original.getDescription(Ls.MEDIUM),h=this.modified.getDescription(Ls.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=NMt([d,h]);n=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Ls.SHORT)??this.original.getName(),this.modified.getTitle(Ls.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Ls.MEDIUM)??this.original.getName(),this.modified.getTitle(Ls.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Ls.LONG)??this.original.getName(),this.modified.getTitle(Ls.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:n,longDescription:o,forceDescription:t,shortTitle:r,mediumTitle:a,longTitle:c}}computeLabel(e,t,i=" - "){if(!(!e||!t))return e===t?t:`${e}${i}${t}`}getName(){return this.labels.name}getDescription(e=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.labels.shortDescription;case Ls.LONG:return this.labels.longDescription;case Ls.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Ls.SHORT:return this.labels.shortTitle;case Ls.LONG:return this.labels.longTitle;default:case Ls.MEDIUM:return this.labels.mediumTitle}}async resolve(){const e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(t=>t.typeId===z0t):e.find(t=>t.typeId===iJe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof oI&&e instanceof oI?new Xtt(e,t):new Jtt(Q2e(e)?e:void 0,Q2e(t)?t:void 0)}toUntyped(e){const t=super.toUntyped(e);if(t)return{...t,modified:t.primary,original:t.secondary}}matches(e){return this===e?!0:e instanceof NQ?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:E_(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},NQ=vR,vR.ID="workbench.editors.diffEditorInput",vR);qg=NQ=D([_(5,ei)],qg);var nSe,bR;let bVe=(bR=class extends eSe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Le))}constructor(e,t,i,n,o,r,a,c,l,d){super(nSe.ID,e,t,i,n,o,a,r,c,l),this.preferencesService=d,this.diffEditorControl=void 0,this.inputLifecycleStopWatch=void 0,this._previousViewModel=null}getTitle(){return this.input?this.input.getName():g(9537,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(vp,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,n){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,n);try{const o=await e.resolve();if(n.isCancellationRequested)return;if(!(o instanceof Xtt)){this.openAsBinary(e,t);return}const r=qn(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;ORe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=LZ(t,r,mt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new js(!1)}catch(o){await this.handleSetInputError(o,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===Qi.FILE_TOO_LARGE){let n;throw e instanceof Pq?n=g(9538,"At least one file is not displayed in the text compare editor because it is very large ({0}).",Nc.formatSize(e.size)):n=g(9539,"At least one file is not displayed in the text compare editor because it is very large."),Q0t(this.group,t,i,n,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,n){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),n.restoreViewState(o),t?.revealIfVisible&&n.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,n=e.modified,o=this.instantiationService.createInstance(qg,e.getName(),e.getDescription(),i,n,!0),r=Qe.as(tC.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(n)&&n.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:Gk.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&LZ(e,qn(this.diffEditorControl),mt.Smooth)}shouldHandleConfigurationChangeEvent(e,t){return super.shouldHandleConfigurationChangeEvent(e,t)?!0:e.affectsConfiguration(t,"diffEditor")||e.affectsConfiguration(t,"accessibility.verbosity.diffEditor")}computeConfiguration(e){const t=super.computeConfiguration(e);if(kn(e.diffEditor)){const n=xs(e.diffEditor);n.diffCodeLens=n.codeLens,delete n.codeLens,n.diffWordWrap=n.wordWrap,delete n.wordWrap,Object.assign(t,n)}const i=e.accessibility?.verbosity?.diffEditor??!1;return t.accessibilityVerbose=i,t}getConfigurationOverrides(e){return{...super.getConfigurationOverrides(e),...this.getReadonlyConfiguration(this.input?.isReadonly()),originalEditable:this.input instanceof qg&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof qg?this.diffEditorControl?.updateOptions({...this.getReadonlyConfiguration(e.isReadonly()),originalEditable:!e.original.isReadonly()}):super.updateReadonly(e)}isFileBinaryError(e){return Array.isArray(e)?e.some(i=>this.isFileBinaryError(i)):e.textFileOperationResult===EW.FILE_IS_BINARY}clearInput(){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),super.clearInput();const e=this.inputLifecycleStopWatch?.elapsed();this.inputLifecycleStopWatch=void 0,typeof e=="number"&&this.logInputLifecycleTelemetry(e,this.getControl()?.getModel()?.modified?.getLanguageId()),this.diffEditorControl?.setModel(null)}logInputLifecycleTelemetry(e,t){let i=!1;this.diffEditorControl instanceof vp&&(i=this.diffEditorControl.collapseUnchangedRegions),this.telemetryService.publicLog2("diffEditor.editorVisibleTime",{editorVisibleTimeMs:e,languageId:t??"",collapseUnchangedRegions:i})}getControl(){return this.diffEditorControl}focus(){super.focus(),this.diffEditorControl?.focus()}hasFocus(){return this.diffEditorControl?.hasTextFocus()||super.hasFocus()}setEditorVisible(e){super.setEditorVisible(e),e?this.diffEditorControl?.onVisible():this.diffEditorControl?.onHide()}layout(e){this.diffEditorControl?.layout(e)}setBoundarySashes(e){this.diffEditorControl?.setBoundarySashes(e)}tracksEditorViewState(e){return e instanceof qg}computeEditorViewState(e){if(!this.diffEditorControl)return;const t=this.diffEditorControl.getModel();if(!t||!t.modified||!t.original)return;const i=this.toEditorViewStateResource(t);if(i&&ji(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof qg?(t=e.original.resource,i=e.modified.resource):wa(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return N.from({scheme:"diff",path:`${T8(t.toString())}${T8(i.toString())}`})}},nSe=bR,bR.ID=iJe,bR);bVe=nSe=D([_(1,Yi),_(2,we),_(3,$i),_(4,Ec),_(5,ei),_(6,pn),_(7,Po),_(8,Jt),_(9,B6)],bVe);function RZ(s,e,t=hA){if(t===hA||t===ev)return t;let i=s.getGroups(hu.GRID_APPEARANCE)[t];if(!i&&t<9){for(let n=0;n<=t;n++){const o=s.getGroups(hu.GRID_APPEARANCE);o[n]||s.addGroup(o[n-1],UW(e))}i=s.getGroups(hu.GRID_APPEARANCE)[t]}return i?.id??ev}function rI(s,e){const t=typeof e=="number"?s.getGroup(e):e;return s.getGroups(hu.GRID_APPEARANCE).indexOf(t??s.activeGroup)}function v5t(s,e,t,i){const n=b5t(s,e,t,i),o=n.length&&n[0].preserveFocus||!1,r={groupedEditors:[],preserveFocus:o};for(const a of n){const c=C5t(a,t);if(!c)continue;const{group:l,editor:d}=c;let h;for(const u of r.groupedEditors)if(u.group.id===l.id){h=u;break}h||(h={group:l,editors:[]},r.groupedEditors.push(h)),d&&h.editors.push(d)}return r}function b5t(s,e,t,i){const n=i.lastFocusedList;let o=n instanceof Xa&&n.getHTMLElement()===Bc(),r=y5t(s,o,e,t,i);if(!r){const c=t.activeGroup,l=c.activeEditor;r={groupId:c.id,editorIndex:l?c.getIndexOfEditor(l):void 0},o=!1}const a=Ztt(r,o,e,t,i);return w5t(r,a)}function w5t(s,e){if(e.length<=1)return e;const t=e.findIndex(i=>i.groupId===s.groupId&&i.editorIndex===s.editorIndex);if(t!==-1)e.splice(t,1),e.unshift(s);else if(s.editorIndex===void 0)e.unshift(s);else throw new Error("Editor context not found in multi editor context");return e}function y5t(s,e,t,i,n){const o=s.filter(r=>zWe(r)||N.isUri(r));for(const r of o)if(zWe(r))return r;for(const r of o){const a=t.findEditors(r);if(a.length){const c=a[0],l=i.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?.getIndexOfEditor(c.editor)}}}if(e){const r=n.lastFocusedList;for(const a of r.getFocusedElements())if(eit(a))return sSe(a,void 0,i)}}function Ztt(s,e,t,i,n){if(e){const r=n.lastFocusedList.getSelectedElements().filter(eit);if(r.length>1)return r.map(a=>sSe(a,s.preserveFocus,i));if(r.length===0)return Ztt(s,!1,t,i,n)}else{const o=i.getGroup(s.groupId),r=s.editorIndex!==void 0?o?.getEditorByIndex(s.editorIndex):o?.activeEditor;if(o&&r&&o.isSelected(r))return o.selectedEditors.map(a=>sSe({editor:a,groupId:o.id},s.preserveFocus,i))}return[s]}function sSe(s,e,t){if(bNe(s))return{groupId:s.id,editorIndex:void 0,preserveFocus:e};const i=t.getGroup(s.groupId);return{groupId:s.groupId,editorIndex:i?i.getIndexOfEditor(s.editor):-1,preserveFocus:e}}function eit(s){return bNe(s)||xve(s)}function C5t(s,e){const t=e.getGroup(s.groupId);if(!t)return;if(s.editorIndex===void 0)return{group:t,editor:void 0};const i=t.getEditorByIndex(s.editorIndex);return{group:t,editor:i}}const S5t="workbench.action.closeEditorsAndGroup";class A5t{constructor(e){this.root=new MZ;for(const[t,i]of e)for(const n of i)this.root.add(t,n)}toString(){return this.root.toString()}getAttributes(e,t){const i=e.lastIndexOf(".");return i<1?{dirname:t,basename:e,extname:""}:{dirname:t,basename:e.substring(0,i),extname:e.substring(i+1)}}nest(e,t){const i=new MZ;for(const r of e){const a=this.getAttributes(r,t),c=this.root.get(r,a);for(const l of c)i.add(l,r)}const n=(r,a=new Set)=>{if(a.has(r))return[];a.add(r);const c=this.getAttributes(r,t),l=i.get(r,c);return l.length===0?[r]:l.length===1&&l[0]===r?[r]:l.flatMap(d=>n(d,a))},o=new Map;for(const r of e){let a=n(r);a.length===0&&(a=[r]);for(const c of a){let l=o.get(c);l||o.set(c,l=new Set),r!==c&&l.add(r)}}return o}}class MZ{constructor(){this.value=new xNe,this.map=new Map}add(e,t){if(e==="")this.value.add(e,t);else if(e[0]==="*")this.value.add(e,t);else{const i=e[0],n=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new MZ),o.add(n,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const n=e[0],o=e.slice(1),r=this.map.get(n);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => `+this.value.toString(e+" ")),t.map(i=>e+i).join(` -`)}}class eOe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new G5e(t));else if(e==="")this.epsilon.push(new G5e(t));else{const i=e[e.length-1],s=e.slice(0,e.length-1);if(i==="*")throw Error("Unexpected star in SufTrie key: "+e);{let o=this.map.get(i);o||this.map.set(i,o=new eOe),o.add(s,t)}}}get(e,t){const i=[];e===""&&i.push(...this.epsilon.map(a=>a.substitute(t))),this.star.length&&i.push(...this.star.map(a=>a.substitute(t,e)));const s=e[e.length-1],o=e.slice(0,e.length-1),r=this.map.get(s);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.star.length&&t.push("* => "+this.star.join("; ")),this.epsilon.length&&t.push("ε => "+this.epsilon.join("; ")),t.map(i=>e+i).join(` -`)}}var VC;(function(n){n.capture="capture",n.basename="basename",n.dirname="dirname",n.extname="extname"})(VC||(VC={}));const $5e=/\$[({](capture|basename|dirname|extname)[)}]/g;class G5e{constructor(e){this.tokens=[],$5e.lastIndex=0;let t,i=0;for(;t=$5e.exec(e);){const s=e.slice(i,t.index);this.tokens.push(s);const o=t[1];switch(o){case VC.basename:case VC.dirname:case VC.extname:case VC.capture:this.tokens.push({capture:o});break;default:throw Error("unknown substitution type: "+o)}i=t.index+t[0].length}if(i!==e.length){const s=e.slice(i,e.length);this.tokens.push(s)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case VC.basename:return e.basename;case VC.dirname:return e.dirname;case VC.extname:return e.extname;case VC.capture:return t||""}}).join("")}}class Wh{constructor(e,t,i,s,o,r,a,c,l,d=Mx(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=s,this._parent=o,this._isDirectory=r,this._isSymbolicLink=a,this._readonly=c,this._locked=l,this._name=d,this._mtime=h,this._unknown=u,this.error=void 0,this._isExcluded=!1,this._isDirectoryResolved=!1}get isExcluded(){return this._isExcluded?!0:this._parent?this._parent.isExcluded:!1}set isExcluded(e){this._isExcluded=e}hasChildren(e){return this.hasNests?this.nestedChildren?.some(t=>e(t))??!1:this.isDirectory}get hasNests(){return!!this.nestedChildren?.length}get isDirectoryResolved(){return this._isDirectoryResolved}get isSymbolicLink(){return!!this._isSymbolicLink}get isDirectory(){return!!this._isDirectory}get isReadonly(){return this.filesConfigService.isReadonly(this.resource,{resource:this.resource,name:this.name,readonly:this._readonly,locked:this._locked})}get mtime(){return this._mtime}get name(){return this._name}get isUnknown(){return this._unknown}get parent(){return this._parent}get root(){return this._parent?this._parent.root:this}get children(){return new Map}updateName(e){this._parent?.removeChild(this),this._name=e,this._parent?.addChild(this)}getId(){return this.root.resource.toString()+"::"+this.resource.toString()}toString(){return`ExplorerItem: ${this.name}`}get isRoot(){return this===this.root}static create(e,t,i,s,o,r){const a=new Wh(s.resource,e,t,i,o,s.isDirectory,s.isSymbolicLink,s.readonly,s.locked,s.name,s.mtime,!s.isFile&&!s.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!s.children||!!r&&r.some(c=>MS(c,a.resource)),s.children))for(let c=0,l=s.children.length;c{s.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=s.get(o.resource);r?(Wh.mergeLocalWithDisk(o,r),t.addChild(r),s.delete(o.resource)):t.addChild(o)}),s.forEach(o=>{o instanceof Fhe&&t.addChild(o)})}}addChild(e){e._parent=this,e.updateResource(!1),this.children.set(this.getPlatformAwareName(e.name),e)}getChild(e){return this.children.get(this.getPlatformAwareName(e))}fetchChildren(e){const t=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting;return t.enabled&&this.nestedChildren?this.nestedChildren:(async()=>{if(!this._isDirectoryResolved){const s=e===sxe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:s}),r=Wh.create(this.fileService,this.configService,this.filesConfigService,o,this);Wh.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const s=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):s.push(a);const r=this.fileNester.nest(s.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of s){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=ws(this.children.get(d));c.nestedChildren.push(h),h.nestedParent=c}i.push(c)}else c.nestedChildren=void 0}for(const[a,c]of o.values())i.push(c)}else this.children.forEach(s=>{i.push(s)});return i})()}get fileNester(){if(!this.root._fileNester){const e=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting,t=Object.entries(e.patterns).filter(i=>typeof i[0]=="string"&&typeof i[1]=="string"&&i[0]&&i[1]).map(([i,s])=>[this.getPlatformAwareName(i.trim()),s.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new l3t(t)}return this.root._fileNester}removeChild(e){this.nestedChildren=void 0,this.children.delete(this.getPlatformAwareName(e.name))}forgetChildren(){this.children.clear(),this.nestedChildren=void 0,this._isDirectoryResolved=!1,this._fileNester=void 0}getPlatformAwareName(e){return this.fileService.hasCapability(this.resource,es.PathCaseSensitive)?e:e.toLowerCase()}move(e){this.nestedParent?.removeChild(this),this._parent?.removeChild(this),e.removeChild(this),e.addChild(this),this.updateResource(!0)}updateResource(e){this._parent&&(this.resource=Qt(this._parent.resource,this.name)),e&&this.isDirectory&&this.children.forEach(t=>{t.updateResource(!0)})}rename(e){this.updateName(e.name),this._mtime=e.mtime,this.updateResource(!0)}find(e){const t=!this.fileService.hasCapability(e,es.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&Ba(this.resource.authority,e.authority)&&(t?Gq(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(IS(e.path,Qi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(zht(IS(this.resource.path,Qi.sep),e,i))return this;if(this.isDirectory){for(;tthis.doUpload(e,this.toTransfer(t),o,i.token),()=>i.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>s),s}toTransfer(e){if(tgt(e))return e.dataTransfer;const t={items:[]};for(const i of e)t.items.push({webkitGetAsEntry:()=>({name:i.name,isDirectory:!1,isFile:!0,createReader:()=>{throw new Error("Unsupported for files")},file:s=>s(i)})});return t}async doUpload(e,t,i,s){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new XQe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new kve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(r.map(h=>l.queue(async()=>{if(s.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(tOe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new up(Qt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(Mr,1,"Overwrite {0}",h.name),progressLabel:g(Mr,2,"Overwriting {0}",h.name)}),s.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,s);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!s.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,s,o,r){if(r.isCancellationRequested||!e.name||!e.isFile&&!e.isDirectory)return;let a=0;const c=(d,h)=>{a+=h,o.totalBytesUploaded+=h;const u=o.totalBytesUploaded/((Date.now()-o.startTime)/1e3);let f;de.file(h,u));return r.isCancellationRequested?void 0:(typeof d.stream=="function"&&d.size>vl.MB?await this.doUploadFileBuffered(l,d,c,r):await this.doUploadFileUnbuffered(l,d,c),{isFile:!0,resource:l})}else{if(await this.fileService.createFolder(l),r.isCancellationRequested)return;const d=e.createReader(),h=[];let u=!1;do{const w=await new Promise((b,C)=>d.readEntries(b,C));w.length>0?h.push(...w):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const w of h)w.isFile?p.push(w):w.isDirectory&&m.push(w);const v=new kve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(p.map(w=>v.queue(()=>this.doUploadEntry(w,l,f,s,o,r))));for(const w of m)await this.doUploadEntry(w,l,f,s,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,s){const o=Lje({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!s.isCancellationRequested;){const l=ze.wrap(c.value);if(await o.write(l),s.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}s.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((s,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=ze.wrap(new Uint8Array(a.target.result));await this.fileService.writeFile(e,c),i(t.size,c.byteLength)}else throw new Error("Could not read from dropped file.");s()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},lX=uP,uP.MAX_PARALLEL_UPLOADS=20,uP);lne=lX=D([_(0,Cf),_(1,To),_(2,Sp),_(3,_i),_(4,ci)],lne);let wxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=s,this.dialogService=o,this.workspaceEditingService=r,this.explorerService=a,this.editorService=c,this.progressService=l,this.notificationService=d,this.instantiationService=h}async import(e,t,i){const s=new ai,o=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:!0,title:g(Mr,5,"Copying...")},async()=>await this.doImport(e,t,i,s.token),()=>s.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>o),o}async doImport(e,t,i,s){const o=Vi((await this.instantiationService.invokeFunction(l=>btt(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Vi(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(s.isCancellationRequested)return;this.hostService.focus(i);const c=a.filter(l=>l.success&&l.stat?.isDirectory).map(l=>({uri:l.stat.resource}));if(c.length>0&&e.isRoot){let l;(function(p){p[p.Copy=1]="Copy",p[p.Add=2]="Add"})(l||(l={}));const d=[{label:c.length>1?g(Mr,6,"&&Copy Folders"):g(Mr,7,"&&Copy Folder"),run:()=>l.Copy}];let h;const u=this.contextService.getWorkspace().folders.map(p=>p.uri.scheme);c.some(p=>u.indexOf(p.uri.scheme)>=0)?(d.unshift({label:c.length>1?g(Mr,8,"&&Add Folders to Workspace"):g(Mr,9,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(Mr,10,"Do you want to copy the folders or add the folders to the workspace?"):g(Mr,11,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",ui(c[0].uri))):h=c.length>1?g(Mr,12,"Are you sure to want to copy folders?"):g(Mr,13,"Are you sure to want to copy '{0}'?",ui(c[0].uri));const{result:f}=await this.dialogService.prompt({type:nt.Info,message:h,buttons:d,cancelButton:!0});if(f===l.Add)return this.workspaceEditingService.addFolders(c);if(f===l.Copy)return this.importResources(e,r,s)}else if(e instanceof Wh)return this.importResources(e,r,s)}async importResources(e,t,i){if(t&&t.length>0){const s=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,es.PathCaseSensitive);s.children&&s.children.forEach(h=>{o.add(r?h.name:h.name.toLowerCase())});let a=0;const c=Vi(await ko.settled(t.map(async h=>{if(!await this.fileService.exists(h)){a++;return}if(!(o.has(r?ui(h):ui(h).toLowerCase())&&!(await this.dialogService.confirm(tOe(ui(h)))).confirmed))return h})));a>0&&this.notificationService.error(a>1?g(Mr,14,"Some or all of the dropped files could not be accessed for import."):g(Mr,15,"The dropped file could not be accessed for import."));const l=c.map(h=>{const u=ui(h),f=Qt(e.resource,u);return new up(h,f,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(Mr,16,"Import {0}",ui(c[0])):g(Mr,17,"Import {0} resources",c.length),progressLabel:c.length===1?g(Mr,18,"Copying {0}",ui(c[0])):g(Mr,19,"Copying {0} resources",c.length),progressLocation:ch.Window,confirmBeforeUndo:d===SM.Verbose||d===SM.Default}),l.length===1){const h=this.explorerService.findClosest(l[0].newResource);h&&!h.isDirectory&&this.editorService.openEditor({resource:h.resource,options:{pinned:!0}})}}}};wxe=D([_(0,ci),_(1,Id),_(2,Ti),_(3,Re),_(4,To),_(5,$S),_(6,Sp),_(7,_i),_(8,Cf),_(9,Pi),_(10,be)],wxe);var gP;let bxe=(gP=class{constructor(e,t,i,s,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=s,this.fileDialogService=o,this.storageService=r}download(e){const t=new ai,i=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:Jn,title:g(Mr,20,"Downloading")},async s=>this.doDownload(e,s,t),()=>t.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>i),i}async doDownload(e,t,i){for(const s of e){if(i.token.isCancellationRequested)return;Jn?await this.doDownloadBrowser(s.resource,t,i):await this.doDownloadNative(s,t,i)}}async doDownloadBrowser(e,t,i){const s=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*vl.MB,r=s.isDirectory||s.size>o,a=ax();if(r&&Tv.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new XQe(d=>{t.report(d[d.length-1])},1e3),filesTotal:s.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(s.isDirectory){const d=await c.getDirectoryHandle(s.name,{create:!0});await this.downloadFolderBrowser(s,d,l,i.token)}else await this.downloadFileBrowser(c,s,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(s.isFile){let c;try{c=(await this.fileService.readFile(s.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=lp.uriToBrowserUri(s.resource)}i.token.isCancellationRequested||agt(c,s.name)}}async downloadFileBufferedBrowser(e,t,i,s){const o=await this.fileService.readFileStream(e,void 0,s);if(s.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(cw(s.onCancellationRequested)(()=>{l.dispose(),a(rx())})),hO(c,{onData:d=>{t.write(d.buffer),this.reportProgress(o.name,o.size,d.byteLength,i)},onError:d=>{l.dispose(),a(d)},onEnd:()=>{l.dispose(),r()}},s)})}async downloadFileUnbufferedBrowser(e,t,i,s){const o=await this.fileService.readFile(e,void 0,s);s.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,s){i.filesDownloaded++,i.fileBytesDownloaded=0,this.reportProgress(t.name,0,0,i);const r=await(await e.getFileHandle(t.name,{create:!0})).createWritable();return t.size>vl.MB?this.downloadFileBufferedBrowser(t.resource,r,i,s):this.downloadFileUnbufferedBrowser(t.resource,r,i,s)}async downloadFolderBrowser(e,t,i,s){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(s.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,s);else{const r=await t.getDirectoryHandle(o.name,{create:!0}),a=await this.fileService.resolve(o.resource,{resolveMetadata:!0});await this.downloadFolderBrowser(a,r,i,s)}}}}reportProgress(e,t,i,s){s.fileBytesDownloaded+=i,s.totalBytesDownloaded+=i;const o=s.totalBytesDownloaded/((Date.now()-s.startTime)/1e3);let r;t1?{message:g(Mr,30,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",n.length),detail:fst(n)+` -`+g(Mr,28,"This action is irreversible!"),primaryButton:g(Mr,29,"&&Replace"),type:"warning"}:tOe(ui(n[0]))}const ro="vs/workbench/contrib/files/browser/fileActions",iOe="explorer.newFile";Be(ro,0,"New File...");const yst="explorer.newFolder";Be(ro,1,"New Folder...");g(ro,2,"Rename...");g(ro,3,"Delete");g(ro,4,"Copy");g(ro,5,"Paste");const h3t=new Y("fileCopied",!1),u3t="explorer.download";g(ro,6,"Download...");const g3t="explorer.upload";g(ro,7,"Upload...");function f3t(n,e){e.message==="string"&&(e=e.message),n.error(Ma(e,!1))}async function p3t(n,e){n&&(n.indexOf("/")>=0||n.indexOf("\\")>=0)&&await e.refresh()}async function m3t(n,e,t,i,s,o){let r=typeof s.resource=="string"?s.resource:Mx(s.resource),a=Qt(i.resource,r);if(!(o==="disabled"&&!await v3t(e,t,a))){for(;!s.allowOverwrite&&n.findClosest(a);)o!=="disabled"&&(r=_3t(r,!!s.isDirectory,o)),a=Qt(i.resource,r);return a}}function _3t(n,e,t){if(t==="simple"){let h=n,u="";e||(u=T_(n),h=yr(n,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const w=v?parseInt(v):1;return w===0?`${m}`:w{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${n.substr(0,c)}.1${n.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&n.match(l))return n.replace(l,(h,u)=>{const f=parseInt(u);return f{let p=parseInt(f);return isNaN(p)&&(p=0),p{const f=parseInt(u[0]);return f{const f=parseInt(u[0]);return fthis.updateEnablement(e)))}updateEnablement(e){const t=e.isDirty()||this.workingCopyService.hasDirty;this.lastDirtyState!==t&&(this.enabled=t,this.lastDirtyState=this.enabled)}async run(e){try{await this.doRun(e)}catch(t){f3t(this.notificationService,t)}}};Cxe=D([_(2,ji),_(3,Pi),_(4,Pw)],Cxe);const $ce=class $ce extends Cxe{get class(){return"explorer-action "+$e.asClassName(Ce.saveAll)}doRun(e){return this.commandService.executeCommand(rit,{},e)}};$ce.ID="workbench.files.action.saveAllInGroup",$ce.LABEL=g(ro,48,"Save All in Group");let j5e=$ce;var fP;let K5e=(fP=class extends xn{constructor(e,t,i){super(e,t,$e.asClassName(Ce.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(a3t,{},e)}},fP.ID="workbench.files.action.closeGroup",fP.LABEL=g(ro,49,"Close Group"),fP);K5e=D([_(2,ji)],K5e);const nW=class nW extends pi{constructor(){super({id:nW.ID,title:nW.LABEL,f1:!0,category:Za.File,metadata:{description:Be(ro,51,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Nw).openPaneComposite(E5t,Sr.Sidebar,!0)}};nW.ID="workbench.files.action.focusFilesExplorer",nW.LABEL=Be(ro,50,"Focus on Files Explorer");let Y5e=nW;const sW=class sW extends pi{constructor(){super({id:sW.ID,title:sW.LABEL,f1:!0,category:Za.File,metadata:{description:Be(ro,53,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(ji),i=e.get(_i),s=jc.getOriginalUri(i.activeEditor,{supportSideBySide:go.PRIMARY});s&&t.executeCommand(NOt,s)}};sW.ID="workbench.files.action.showActiveFileInExplorer",sW.LABEL=Be(ro,52,"Reveal Active File in Explorer View");let J5e=sW;const oW=class oW extends pi{constructor(){super({id:oW.ID,title:oW.LABEL,f1:!0,category:Za.File,precondition:iTt,metadata:{description:Be(ro,55,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(_i),i=e.get(Id),s=e.get(To),o=e.get(ci),r=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):s.error(g(ro,56,"The active editor must contain an openable resource.")))}};oW.ID="workbench.action.files.showOpenedFileInNewWindow",oW.LABEL=Be(ro,54,"Open Active File in New Empty Workspace");let X5e=oW;function w3t(n,e,t,i){if(t=C3t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(ro,57,"A file or folder name must be provided."),severity:nt.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(ro,58,"A file or folder name cannot start with a slash."),severity:nt.Error};const s=Vi(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(ro,59,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:nt.Error}}if(s.some(r=>!n.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(ro,60,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",b3t(r)),severity:nt.Error}}return s.some(r=>/^\s|\s$/.test(r))?{content:g(ro,61,"Leading or trailing whitespace detected in file or folder name."),severity:nt.Warning}:null}function b3t(n){return n?.length>255?`${n.substr(0,255)}...`:n}function C3t(n){return n&&(n=KRe(n," "),n=IS(n,"/"),n=IS(n,"\\"),n)}const rW=class rW extends pi{constructor(){super({id:rW.ID,title:rW.LABEL,f1:!0,category:Za.File,metadata:{description:Be(ro,63,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(_i).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};rW.ID="workbench.files.action.compareNewUntitledTextFiles",rW.LABEL=Be(ro,62,"Compare New Untitled Text Files");let Z5e=rW;const mk=class mk extends pi{constructor(){super({id:mk.ID,title:mk.LABEL,f1:!0,category:Za.File,keybinding:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyC),weight:ye.WorkbenchContrib},metadata:{description:Be(ro,65,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(_i),i=e.get(be),s=e.get(Rn),o=e.get(ci),r=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),a=`clipboardCompare${mk.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===_e.untitled)){if(!this.registrationDisposal){const d=i.createInstance(yxe);this.registrationDisposal=s.registerTextModelContentProvider(a,d)}const c=ui(r),l=g(ro,66,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{St(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){St(this.registrationDisposal),this.registrationDisposal=void 0}};mk.ID="workbench.files.action.compareWithClipboard",mk.LABEL=Be(ro,64,"Compare Active File with Clipboard"),mk.SCHEME_COUNTER=0;let e3e=mk,yxe=class{constructor(e,t,i){this.clipboardService=e,this.languageService=t,this.modelService=i}async provideTextContent(e){const t=await this.clipboardService.readText();return this.modelService.createModel(t,this.languageService.createByFilepathOrFirstLine(e),e)}};yxe=D([_(0,Mu),_(1,Di),_(2,Ai)],yxe);function y3t(n,e,t){n.prompt(nt.Error,Ma(e,!1),[{label:g(ro,67,"Retry"),run:()=>t()}])}async function Sst(n,e){const t=n.get(Sp),i=n.get(ci),s=n.get(Re),o=n.get(hh),r=n.get(_i),a=n.get(q_),c=n.get(Pi),l=n.get(Sf),d=n.get(ji),h=n.get(Tm),u=!a.isViewVisible(lC),f=await a.openView(lC,!0);if(u&&await Ta(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(HOt)}const p=t.getContext(!1),m=p.length>0?p[0]:void 0;let v;if(m?v=m.isDirectory?m:m.parent||t.roots[0]:v=t.roots[0],v.isReadonly)throw new Error("Parent folder is readonly.");const w=new Fhe(i,s,o,v,e);v.addChild(w);const b=async y=>{try{const S=Qt(v.resource,y);y.endsWith("/")&&(e=!0),await t.applyBulkEdit([new up(void 0,S,{folder:e})],{undoLabel:g(ro,68,"Create {0}",y),progressLabel:g(ro,69,"Creating {0}",y),confirmBeforeUndo:!0}),await p3t(y,t),e?await t.select(S,!0):await r.openEditor({resource:S,options:{pinned:!0}})}catch(S){y3t(c,S,()=>b(y))}},C=(await l.getEnvironment())?.os??$c;await t.setEditable(w,{validationMessage:y=>w3t(h,w,y,C),onFinish:async(y,S)=>{v.removeChild(w),await t.setEditable(w,null),S&&b(y)}})}yt.registerCommand({id:iOe,handler:async n=>{await Sst(n,!1)}});yt.registerCommand({id:yst,handler:async n=>{await Sst(n,!0)}});const S3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!0),o=s.length?s:e.roots,r=i.createInstance(bxe);try{await r.download(o)}catch(a){throw t.error(a),a}};yt.registerCommand({id:u3t,handler:S3t});const A3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!1),o=s.length?s[0]:e.roots[0];try{const r=await cgt();r&&await i.createInstance(lne).upload(o,r)}catch(r){throw t.error(r),r}};yt.registerCommand({id:g3t,handler:A3t});class Ohe extends pi{constructor(e,t,i){super({id:e,title:t,f1:!0,category:Za.File,precondition:sTt}),this.newReadonlyState=i}async run(e){const t=e.get(_i),i=e.get(hh),s=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});s&&await i.updateReadonly(s,this.newReadonlyState)}}const aW=class aW extends Ohe{constructor(){super(aW.ID,aW.LABEL,!0)}};aW.ID="workbench.action.files.setActiveEditorReadonlyInSession",aW.LABEL=Be(ro,85,"Set Active Editor Read-only in Session");let t3e=aW;const cW=class cW extends Ohe{constructor(){super(cW.ID,cW.LABEL,!1)}};cW.ID="workbench.action.files.setActiveEditorWriteableInSession",cW.LABEL=Be(ro,86,"Set Active Editor Writeable in Session");let i3e=cW;const lW=class lW extends Ohe{constructor(){super(lW.ID,lW.LABEL,"toggle")}};lW.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",lW.LABEL=Be(ro,87,"Toggle Active Editor Read-only in Session");let n3e=lW;const dW=class dW extends Ohe{constructor(){super(dW.ID,dW.LABEL,"reset")}};dW.ID="workbench.action.files.resetActiveEditorReadonlyInSession",dW.LABEL=Be(ro,88,"Reset Active Editor Read-only in Session");let s3e=dW;class nOe extends ${constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in yi)try{this.broadcastChannel=new BroadcastChannel(e);const t=i=>{this._onDidReceiveData.fire(i.data)};this.broadcastChannel.addEventListener("message",t),this._register(Ee(()=>{this.broadcastChannel&&(this.broadcastChannel.removeEventListener("message",t),this.broadcastChannel.close())}))}catch(t){console.warn("Error while creating broadcast channel. Falling back to localStorage.",lg(t))}this.broadcastChannel||(this.channelName=`BroadcastDataChannel.${e}`,this.createBroadcastChannel())}createBroadcastChannel(){const e=t=>{t.key===this.channelName&&t.newValue&&this._onDidReceiveData.fire(JSON.parse(t.newValue))};yi.addEventListener("storage",e),this._register(Ee(()=>yi.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let o3e=class{constructor(e,t,i,s,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=s,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,s,o){const r=await this.instantiationService.invokeFunction(l=>btt(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Vi(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===_e.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Vi(r.filter(l=>l.isExternal&&l.resource?.scheme===_e.file).map(l=>l.resource));a.length&&this.workspacesService.addRecentlyOpened(a.map(l=>({fileUri:l})));const c=i?.();await this.editorService.openEditors(r.map(l=>({...l,resource:l.resource,options:{...l.options,...o,pinned:!0}})),c,{validateTrust:!0}),s?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async s=>{if(yde(s)){t.push({workspaceUri:s});return}try{const o=await this.fileService.stat(s);o.isDirectory&&(t.push({folderUri:o.resource}),i.push({uri:o.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):hx(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};o3e=D([_(1,ci),_(2,cL),_(3,_i),_(4,$S),_(5,Id),_(6,Ti),_(7,be)],o3e);function Ast(n,e,t,i){if(e.length===0||!t.dataTransfer)return;const s=n.get(tr),o=n.get(_i),r=n.get(ci),a=n.get(eo),c=Vi(e.map(f=>P.isUri(f)?{resource:f}:UCe(f)?P.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Is?`\r +`)}}class xNe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new yVe(t));else if(e==="")this.epsilon.push(new yVe(t));else{const i=e[e.length-1],n=e.slice(0,e.length-1);if(i==="*")throw Error("Unexpected star in SufTrie key: "+e);{let o=this.map.get(i);o||this.map.set(i,o=new xNe),o.add(n,t)}}}get(e,t){const i=[];e===""&&i.push(...this.epsilon.map(a=>a.substitute(t))),this.star.length&&i.push(...this.star.map(a=>a.substitute(t,e)));const n=e[e.length-1],o=e.slice(0,e.length-1),r=this.map.get(n);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.star.length&&t.push("* => "+this.star.join("; ")),this.epsilon.length&&t.push("ε => "+this.epsilon.join("; ")),t.map(i=>e+i).join(` +`)}}var fw;(function(s){s.capture="capture",s.basename="basename",s.dirname="dirname",s.extname="extname"})(fw||(fw={}));const wVe=/\$[({](capture|basename|dirname|extname)[)}]/g;class yVe{constructor(e){this.tokens=[],wVe.lastIndex=0;let t,i=0;for(;t=wVe.exec(e);){const n=e.slice(i,t.index);this.tokens.push(n);const o=t[1];switch(o){case fw.basename:case fw.dirname:case fw.extname:case fw.capture:this.tokens.push({capture:o});break;default:throw Error("unknown substitution type: "+o)}i=t.index+t[0].length}if(i!==e.length){const n=e.slice(i,e.length);this.tokens.push(n)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case fw.basename:return e.basename;case fw.dirname:return e.dirname;case fw.extname:return e.extname;case fw.capture:return t||""}}).join("")}}class Gd{constructor(e,t,i,n,o,r,a,c,l,d=EA(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=n,this._parent=o,this._isDirectory=r,this._isSymbolicLink=a,this._readonly=c,this._locked=l,this._name=d,this._mtime=h,this._unknown=u,this.error=void 0,this._isExcluded=!1,this._isDirectoryResolved=!1}get isExcluded(){return this._isExcluded?!0:this._parent?this._parent.isExcluded:!1}set isExcluded(e){this._isExcluded=e}hasChildren(e){return this.hasNests?this.nestedChildren?.some(t=>e(t))??!1:this.isDirectory}get hasNests(){return!!this.nestedChildren?.length}get isDirectoryResolved(){return this._isDirectoryResolved}get isSymbolicLink(){return!!this._isSymbolicLink}get isDirectory(){return!!this._isDirectory}get isReadonly(){return this.filesConfigService.isReadonly(this.resource,{resource:this.resource,name:this.name,readonly:this._readonly,locked:this._locked})}get mtime(){return this._mtime}get name(){return this._name}get isUnknown(){return this._unknown}get parent(){return this._parent}get root(){return this._parent?this._parent.root:this}get children(){return new Map}updateName(e){this._parent?.removeChild(this),this._name=e,this._parent?.addChild(this)}getId(){return this.root.resource.toString()+"::"+this.resource.toString()}toString(){return`ExplorerItem: ${this.name}`}get isRoot(){return this===this.root}static create(e,t,i,n,o,r){const a=new Gd(n.resource,e,t,i,o,n.isDirectory,n.isSymbolicLink,n.readonly,n.locked,n.name,n.mtime,!n.isFile&&!n.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!n.children||!!r&&r.some(c=>qy(c,a.resource)),n.children))for(let c=0,l=n.children.length;c{n.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=n.get(o.resource);r?(Gd.mergeLocalWithDisk(o,r),t.addChild(r),n.delete(o.resource)):t.addChild(o)}),n.forEach(o=>{o instanceof Dce&&t.addChild(o)})}}addChild(e){e._parent=this,e.updateResource(!1),this.children.set(this.getPlatformAwareName(e.name),e)}getChild(e){return this.children.get(this.getPlatformAwareName(e))}fetchChildren(e){const t=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting;return t.enabled&&this.nestedChildren?this.nestedChildren:(async()=>{if(!this._isDirectoryResolved){const n=e===zCe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:n}),r=Gd.create(this.fileService,this.configService,this.filesConfigService,o,this);Gd.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const n=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):n.push(a);const r=this.fileNester.nest(n.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of n){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=qn(this.children.get(d));c.nestedChildren.push(h),h.nestedParent=c}i.push(c)}else c.nestedChildren=void 0}for(const[a,c]of o.values())i.push(c)}else this.children.forEach(n=>{i.push(n)});return i})()}get fileNester(){if(!this.root._fileNester){const e=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting,t=Object.entries(e.patterns).filter(i=>typeof i[0]=="string"&&typeof i[1]=="string"&&i[0]&&i[1]).map(([i,n])=>[this.getPlatformAwareName(i.trim()),n.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new A5t(t)}return this.root._fileNester}removeChild(e){this.nestedChildren=void 0,this.children.delete(this.getPlatformAwareName(e.name))}forgetChildren(){this.children.clear(),this.nestedChildren=void 0,this._isDirectoryResolved=!1,this._fileNester=void 0}getPlatformAwareName(e){return this.fileService.hasCapability(this.resource,Vn.PathCaseSensitive)?e:e.toLowerCase()}move(e){this.nestedParent?.removeChild(this),this._parent?.removeChild(this),e.removeChild(this),e.addChild(this),this.updateResource(!0)}updateResource(e){this._parent&&(this.resource=Pt(this._parent.resource,this.name)),e&&this.isDirectory&&this.children.forEach(t=>{t.updateResource(!0)})}rename(e){this.updateName(e.name),this._mtime=e.mtime,this.updateResource(!0)}find(e){const t=!this.fileService.hasCapability(e,Vn.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&ua(this.resource.authority,e.authority)&&(t?W7(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(zy(e.path,Vi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(Slt(zy(this.resource.path,Vi.sep),e,i))return this;if(this.isDirectory){for(;tthis.doUpload(e,this.toTransfer(t),o,i.token),()=>i.dispose(!0));return this.progressService.withProgress({location:Bb,delay:500},()=>n),n}toTransfer(e){if(Fdt(e))return e.dataTransfer;const t={items:[]};for(const i of e)t.items.push({webkitGetAsEntry:()=>({name:i.name,isDirectory:!1,isFile:!0,createReader:()=>{throw new Error("Unsupported for files")},file:n=>n(i)})});return t}async doUpload(e,t,i,n){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new TGe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new dpe(PQ.MAX_PARALLEL_UPLOADS);await Zs.settled(r.map(h=>l.queue(async()=>{if(n.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(DNe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new cp(Pt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(10020,"Overwrite {0}",h.name),progressLabel:g(10021,"Overwriting {0}",h.name)}),n.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,n);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!n.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,n,o,r){if(r.isCancellationRequested||!e.name||!e.isFile&&!e.isDirectory)return;let a=0;const c=(d,h)=>{a+=h,o.totalBytesUploaded+=h;const u=o.totalBytesUploaded/((Date.now()-o.startTime)/1e3);let f;de.file(h,u));return r.isCancellationRequested?void 0:(typeof d.stream=="function"&&d.size>Nc.MB?await this.doUploadFileBuffered(l,d,c,r):await this.doUploadFileUnbuffered(l,d,c),{isFile:!0,resource:l})}else{if(await this.fileService.createFolder(l),r.isCancellationRequested)return;const d=e.createReader(),h=[];let u=!1;do{const b=await new Promise((w,y)=>d.readEntries(w,y));b.length>0?h.push(...b):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const b of h)b.isFile?p.push(b):b.isDirectory&&m.push(b);const v=new dpe(PQ.MAX_PARALLEL_UPLOADS);await Zs.settled(p.map(b=>v.queue(()=>this.doUploadEntry(b,l,f,n,o,r))));for(const b of m)await this.doUploadEntry(b,l,f,n,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,n){const o=lKe({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!n.isCancellationRequested;){const l=$e.wrap(c.value);if(await o.write(l),n.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}n.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((n,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=$e.wrap(new Uint8Array(a.target.result));await this.fileService.writeFile(e,c),i(t.size,c.byteLength)}else throw new Error("Could not read from dropped file.");n()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},PQ=wR,wR.MAX_PARALLEL_UPLOADS=20,wR);NZ=PQ=D([_(0,cg),_(1,to),_(2,vf),_(3,ei),_(4,Jt)],NZ);let oSe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=n,this.dialogService=o,this.workspaceEditingService=r,this.explorerService=a,this.editorService=c,this.progressService=l,this.notificationService=d,this.instantiationService=h}async import(e,t,i){const n=new ci,o=this.progressService.withProgress({location:ud.Window,delay:800,cancellable:!0,title:g(10024,"Copying...")},async()=>await this.doImport(e,t,i,n.token),()=>n.dispose(!0));return this.progressService.withProgress({location:Bb,delay:500},()=>o),o}async doImport(e,t,i,n){const o=Fi((await this.instantiationService.invokeFunction(l=>oZe(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Fi(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(n.isCancellationRequested)return;this.hostService.focus(i);const c=a.filter(l=>l.success&&l.stat?.isDirectory).map(l=>({uri:l.stat.resource}));if(c.length>0&&e.isRoot){let l;(function(p){p[p.Copy=1]="Copy",p[p.Add=2]="Add"})(l||(l={}));const d=[{label:c.length>1?g(10025,"&&Copy Folders"):g(10026,"&&Copy Folder"),run:()=>l.Copy}];let h;const u=this.contextService.getWorkspace().folders.map(p=>p.uri.scheme);c.some(p=>u.indexOf(p.uri.scheme)>=0)?(d.unshift({label:c.length>1?g(10027,"&&Add Folders to Workspace"):g(10028,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(10029,"Do you want to copy the folders or add the folders to the workspace?"):g(10030,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",_i(c[0].uri))):h=c.length>1?g(10031,"Are you sure to want to copy folders?"):g(10032,"Are you sure to want to copy '{0}'?",_i(c[0].uri));const{result:f}=await this.dialogService.prompt({type:Xe.Info,message:h,buttons:d,cancelButton:!0});if(f===l.Add)return this.workspaceEditingService.addFolders(c);if(f===l.Copy)return this.importResources(e,r,n)}else if(e instanceof Gd)return this.importResources(e,r,n)}async importResources(e,t,i){if(t&&t.length>0){const n=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,Vn.PathCaseSensitive);n.children&&n.children.forEach(u=>{o.add(r?u.name:u.name.toLowerCase())});let a=0;const c=Fi(await Zs.settled(t.map(async u=>{if(!await this.fileService.exists(u)){a++;return}if(!(o.has(r?_i(u):_i(u).toLowerCase())&&!(await this.dialogService.confirm(DNe(_i(u)))).confirmed))return u})));a>0&&this.notificationService.error(a>1?g(10033,"Some or all of the dropped files could not be accessed for import."):g(10034,"The dropped file could not be accessed for import."));const l=c.map(u=>{const f=_i(u),p=Pt(e.resource,f);return new cp(u,p,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(10035,"Import {0}",_i(c[0])):g(10036,"Import {0} resources",c.length),progressLabel:c.length===1?g(10037,"Copying {0}",_i(c[0])):g(10038,"Copying {0} resources",c.length),progressLocation:ud.Window,confirmBeforeUndo:d===RT.Verbose||d===RT.Default}),this.configurationService.getValue().explorer.autoOpenDroppedFile&&l.length===1){const u=this.explorerService.findClosest(l[0].newResource);u&&!u.isDirectory&&this.editorService.openEditor({resource:u.resource,options:{pinned:!0}})}}}};oSe=D([_(0,Jt),_(1,xc),_(2,yi),_(3,Te),_(4,to),_(5,iC),_(6,vf),_(7,ei),_(8,cg),_(9,bi),_(10,we)],oSe);var yR;let rSe=(yR=class{constructor(e,t,i,n,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=n,this.fileDialogService=o,this.storageService=r}download(e){const t=new ci,i=this.progressService.withProgress({location:ud.Window,delay:800,cancellable:Wn,title:g(10039,"Downloading")},async n=>this.doDownload(e,n,t),()=>t.dispose(!0));return this.progressService.withProgress({location:Bb,delay:500},()=>i),i}async doDownload(e,t,i){for(const n of e){if(i.token.isCancellationRequested)return;Wn?await this.doDownloadBrowser(n.resource,t,i):await this.doDownloadNative(n,t,i)}}async doDownloadBrowser(e,t,i){const n=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*Nc.MB,r=n.isDirectory||n.size>o,a=ky();if(r&&Yp.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new TGe(d=>{t.report(d[d.length-1])},1e3),filesTotal:n.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(n.isDirectory){const d=await c.getDirectoryHandle(n.name,{create:!0});await this.downloadFolderBrowser(n,d,l,i.token)}else await this.downloadFileBrowser(c,n,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(n.isFile){let c;try{c=(await this.fileService.readFile(n.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=ef.uriToBrowserUri(n.resource)}i.token.isCancellationRequested||Vdt(c,n.name)}}async downloadFileBufferedBrowser(e,t,i,n){const o=await this.fileService.readFileStream(e,void 0,n);if(n.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(hm(n.onCancellationRequested)(()=>{l.dispose(),a(xy())})),kN(c,{onData:d=>{t.write(d.buffer),this.reportProgress(o.name,o.size,d.byteLength,i)},onError:d=>{l.dispose(),a(d)},onEnd:()=>{l.dispose(),r()}},n)})}async downloadFileUnbufferedBrowser(e,t,i,n){const o=await this.fileService.readFile(e,void 0,n);n.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,n){i.filesDownloaded++,i.fileBytesDownloaded=0,this.reportProgress(t.name,0,0,i);const r=await(await e.getFileHandle(t.name,{create:!0})).createWritable();return t.size>Nc.MB?this.downloadFileBufferedBrowser(t.resource,r,i,n):this.downloadFileUnbufferedBrowser(t.resource,r,i,n)}async downloadFolderBrowser(e,t,i,n){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(n.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,n);else{const r=await t.getDirectoryHandle(o.name,{create:!0}),a=await this.fileService.resolve(o.resource,{resolveMetadata:!0});await this.downloadFolderBrowser(a,r,i,n)}}}}reportProgress(e,t,i,n){n.fileBytesDownloaded+=i,n.totalBytesDownloaded+=i;const o=n.totalBytesDownloaded/((Date.now()-n.startTime)/1e3);let r;t1?{message:g(10049,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",s.length),detail:Gtt(s)+` +`+g(10047,"This action is irreversible!"),primaryButton:g(10048,"&&Replace"),type:"warning"}:DNe(_i(s[0]))}const kNe="explorer.newFile";Pe(5429,"New File...");const tit="explorer.newFolder";Pe(5430,"New Folder...");g(5431,"Rename...");g(5432,"Delete");g(5433,"Copy");g(5434,"Paste");const x5t=new Q("fileCopied",!1),D5t="explorer.download";g(5435,"Download...");const k5t="explorer.upload";g(5436,"Upload...");function I5t(s,e){e.message==="string"&&(e=e.message),s.error(Nr(e,!1))}async function T5t(s,e){s&&(s.indexOf("/")>=0||s.indexOf("\\")>=0)&&await e.refresh()}async function L5t(s,e,t,i,n,o){let r=typeof n.resource=="string"?n.resource:EA(n.resource),a=Pt(i.resource,r);if(!(o==="disabled"&&!await M5t(e,t,a))){for(;!n.allowOverwrite&&s.findClosest(a);)o!=="disabled"&&(r=R5t(r,!!n.isDirectory,o)),a=Pt(i.resource,r);return a}}function R5t(s,e,t){if(t==="simple"){let h=s,u="";e||(u=Gy(s),h=Ko(s,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const b=v?parseInt(v):1;return b===0?`${m}`:b{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${s.substr(0,c)}.1${s.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&s.match(l))return s.replace(l,(h,u)=>{const f=parseInt(u);return f{let p=parseInt(f);return isNaN(p)&&(p=0),p{const f=parseInt(u[0]);return f{const f=parseInt(u[0]);return fthis.updateEnablement(e)))}updateEnablement(e){const t=e.isDirty()||this.workingCopyService.hasDirty;this.lastDirtyState!==t&&(this.enabled=t,this.lastDirtyState=this.enabled)}async run(e){try{await this.doRun(e)}catch(t){I5t(this.notificationService,t)}}};aSe=D([_(2,vi),_(3,bi),_(4,Rm)],aSe);const Toe=class Toe extends aSe{get class(){return"explorer-action "+We.asClassName(ve.saveAll)}doRun(e){return this.commandService.executeCommand(JZe,{},e)}};Toe.ID="workbench.files.action.saveAllInGroup",Toe.LABEL=g(5477,"Save All in Group");let AVe=Toe;var CR;let EVe=(CR=class extends rn{constructor(e,t,i){super(e,t,We.asClassName(ve.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(S5t,{},e)}},CR.ID="workbench.files.action.closeGroup",CR.LABEL=g(5478,"Close Group"),CR);EVe=D([_(2,vi)],EVe);const lO=class lO extends li{constructor(){super({id:lO.ID,title:lO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5480,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Tm).openPaneComposite(UVt,ir.Sidebar,!0)}};lO.ID="workbench.files.action.focusFilesExplorer",lO.LABEL=Pe(5479,"Focus on Files Explorer");let xVe=lO;const dO=class dO extends li{constructor(){super({id:dO.ID,title:dO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5482,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(vi),i=e.get(ei),n=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&t.executeCommand(bFt,n)}};dO.ID="workbench.files.action.showActiveFileInExplorer",dO.LABEL=Pe(5481,"Reveal Active File in Explorer View");let DVe=dO;const hO=class hO extends li{constructor(){super({id:hO.ID,title:hO.LABEL,f1:!0,category:ca.File,precondition:rJe,metadata:{description:Pe(5484,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(ei),i=e.get(xc),n=e.get(to),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):n.error(g(5485,"The active editor must contain an openable resource.")))}};hO.ID="workbench.action.files.showOpenedFileInNewWindow",hO.LABEL=Pe(5483,"Open Active File in New Empty Workspace");let kVe=hO;function N5t(s,e,t,i){if(t=F5t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(5486,"A file or folder name must be provided."),severity:Xe.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(5487,"A file or folder name cannot start with a slash."),severity:Xe.Error};const n=Fi(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(5488,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:Xe.Error}}if(n.some(r=>!s.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(5489,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",P5t(r)),severity:Xe.Error}}return n.some(r=>/^\s|\s$/.test(r))?{content:g(5490,"Leading or trailing whitespace detected in file or folder name."),severity:Xe.Warning}:null}function P5t(s){return s?.length>255?`${s.substr(0,255)}...`:s}function F5t(s){return s&&(s=Y1e(s," "),s=zy(s,"/"),s=zy(s,"\\"),s)}const uO=class uO extends li{constructor(){super({id:uO.ID,title:uO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5492,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(ei).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};uO.ID="workbench.files.action.compareNewUntitledTextFiles",uO.LABEL=Pe(5491,"Compare New Untitled Text Files");let IVe=uO;const QE=class QE extends li{constructor(){super({id:QE.ID,title:QE.LABEL,f1:!0,category:ca.File,keybinding:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyC),weight:Ae.WorkbenchContrib},metadata:{description:Pe(5494,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(ei),i=e.get(we),n=e.get(fn),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),a=`clipboardCompare${QE.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===pe.untitled)){if(!this.registrationDisposal){const d=i.createInstance(cSe);this.registrationDisposal=n.registerTextModelContentProvider(a,d)}const c=_i(r),l=g(5495,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{bt(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){bt(this.registrationDisposal),this.registrationDisposal=void 0}};QE.ID="workbench.files.action.compareWithClipboard",QE.LABEL=Pe(5493,"Compare Active File with Clipboard"),QE.SCHEME_COUNTER=0;let TVe=QE,cSe=class{constructor(e,t,i){this.clipboardService=e,this.languageService=t,this.modelService=i}async provideTextContent(e){const t=await this.clipboardService.readText();return this.modelService.createModel(t,this.languageService.createByFilepathOrFirstLine(e),e)}};cSe=D([_(0,dg),_(1,xi),_(2,gi)],cSe);function O5t(s,e,t){s.prompt(Xe.Error,Nr(e,!1),[{label:g(5496,"Retry"),run:()=>t()}])}async function iit(s,e){const t=s.get(vf),i=s.get(Jt),n=s.get(Te),o=s.get(_d),r=s.get(ei),a=s.get(Lm),c=s.get(bi),l=s.get(hg),d=s.get(vi),h=s.get(bf),u=!a.isViewVisible(Bb),f=await a.openView(Bb,!0);if(u&&await Sr(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(xFt)}const p=t.getContext(!1),m=p.length>0?p[0]:void 0;let v;if(m?v=m.isDirectory?m:m.parent||t.roots[0]:v=t.roots[0],v.isReadonly)throw new Error("Parent folder is readonly.");const b=new Dce(i,n,o,v,e);v.addChild(b);const w=async C=>{try{const A=Pt(v.resource,C);C.endsWith("/")&&(e=!0),await t.applyBulkEdit([new cp(void 0,A,{folder:e})],{undoLabel:g(5497,"Create {0}",C),progressLabel:g(5498,"Creating {0}",C),confirmBeforeUndo:!0}),await T5t(C,t),e?await t.select(A,!0):await r.openEditor({resource:A,options:{pinned:!0}})}catch(A){O5t(c,A,()=>w(C))}},y=(await l.getEnvironment())?.os??po;await t.setEditable(b,{validationMessage:C=>N5t(h,b,C,y),onFinish:async(C,A)=>{v.removeChild(b),await t.setEditable(b,null),A&&w(C)}})}_t.registerCommand({id:kNe,handler:async s=>{await iit(s,!1)}});_t.registerCommand({id:tit,handler:async s=>{await iit(s,!0)}});const B5t=async s=>{const e=s.get(vf),t=s.get(bi),i=s.get(we),n=e.getContext(!0),o=n.length?n:e.roots,r=i.createInstance(rSe);try{await r.download(o)}catch(a){throw t.error(a),a}};_t.registerCommand({id:D5t,handler:B5t});const W5t=async s=>{const e=s.get(vf),t=s.get(bi),i=s.get(we),n=e.getContext(!1),o=n.length?n[0]:e.roots[0];try{const r=await zdt();r&&await i.createInstance(NZ).upload(o,r)}catch(r){throw t.error(r),r}};_t.registerCommand({id:k5t,handler:W5t});class kce extends li{constructor(e,t,i){super({id:e,title:t,f1:!0,category:ca.File,precondition:c1t}),this.newReadonlyState=i}async run(e){const t=e.get(ei),i=e.get(_d),n=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&await i.updateReadonly(n,this.newReadonlyState)}}const gO=class gO extends kce{constructor(){super(gO.ID,gO.LABEL,!0)}};gO.ID="workbench.action.files.setActiveEditorReadonlyInSession",gO.LABEL=Pe(5514,"Set Active Editor Read-only in Session");let LVe=gO;const fO=class fO extends kce{constructor(){super(fO.ID,fO.LABEL,!1)}};fO.ID="workbench.action.files.setActiveEditorWriteableInSession",fO.LABEL=Pe(5515,"Set Active Editor Writeable in Session");let RVe=fO;const pO=class pO extends kce{constructor(){super(pO.ID,pO.LABEL,"toggle")}};pO.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",pO.LABEL=Pe(5516,"Toggle Active Editor Read-only in Session");let MVe=pO;const mO=class mO extends kce{constructor(){super(mO.ID,mO.LABEL,"reset")}};mO.ID="workbench.action.files.resetActiveEditorReadonlyInSession",mO.LABEL=Pe(5517,"Reset Active Editor Read-only in Session");let NVe=mO;class INe extends V{constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in si)try{this.broadcastChannel=new BroadcastChannel(e);const t=i=>{this._onDidReceiveData.fire(i.data)};this.broadcastChannel.addEventListener("message",t),this._register(Ee(()=>{this.broadcastChannel&&(this.broadcastChannel.removeEventListener("message",t),this.broadcastChannel.close())}))}catch(t){console.warn("Error while creating broadcast channel. Falling back to localStorage.",su(t))}this.broadcastChannel||(this.channelName=`BroadcastDataChannel.${e}`,this.createBroadcastChannel())}createBroadcastChannel(){const e=t=>{t.key===this.channelName&&t.newValue&&this._onDidReceiveData.fire(JSON.parse(t.newValue))};si.addEventListener("storage",e),this._register(Ee(()=>si.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let PVe=class{constructor(e,t,i,n,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=n,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,n,o){const r=await this.instantiationService.invokeFunction(l=>oZe(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Fi(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===pe.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Fi(r.filter(l=>l.isExternal&&l.resource?.scheme===pe.file).map(l=>l.resource));a.length&&this.workspacesService.addRecentlyOpened(a.map(l=>({fileUri:l})));const c=i?.();await this.editorService.openEditors(r.map(l=>({...l,resource:l.resource,options:{...l.options,...o,pinned:!0}})),c,{validateTrust:!0}),n?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async n=>{if(mae(n)){t.push({workspaceUri:n});return}try{const o=await this.fileService.stat(n);o.isDirectory&&(t.push({folderUri:o.resource}),i.push({uri:o.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):Py(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};PVe=D([_(1,Jt),_(2,xI),_(3,ei),_(4,iC),_(5,xc),_(6,yi),_(7,we)],PVe);function nit(s,e,t,i){if(e.length===0||!t.dataTransfer)return;const n=s.get(Fo),o=s.get(ei),r=s.get(Jt),a=s.get(Fs),c=Fi(e.map(f=>N.isUri(f)?{resource:f}:xve(f)?N.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Qn?`\r `:` -`;t.dataTransfer.setData(fm.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=lp.uriToFileUri(p.resource);m.scheme===_e.file&&t.dataTransfer.setData(fm.DOWNLOAD_URL,[Js.binary,ui(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(fm.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=it.as(sFe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(UCe(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:jc.getCanonicalUri(m)})}else if(P.isUri(f)){const{selection:m,uri:v}=RNe(f);p={resource:v,options:m?{selection:m}:void 0}}else f.isDirectory||(p={resource:f.resource});if(p){{const m=p.resource;if(m){const v=s.files.get(m);v&&(typeof p.languageId!="string"&&(p.languageId=v.getLanguageId()),typeof p.encoding!="string"&&(p.encoding=v.getEncoding()),typeof p.contents!="string"&&v.isDirty()&&!v.textEditorModel.isTooLargeForHeapOperation()&&(p.contents=v.textEditorModel.getValue())),p.options?.viewState||(p.options={...p.options,viewState:(()=>{for(const w of o.visibleEditorPanes)if(_n(w.input.resource,m)){const b=w.getViewState();if(b)return b}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(bF.EDITORS,uJe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):Gv(p)?p.modified.resource&&f.push(p.modified.resource):LE(p)?p.primary.resource&&f.push(p.primary.resource):Wb(p)&&f.push(p.result.resource);t.dataTransfer.setData(Js.uriList,R1.create(f.slice(0,1))),t.dataTransfer.setData(fm.INTERNAL_URI_LIST,R1.create(f))}}class E3t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class T5{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class R5{constructor(e){this.viewId=e}get id(){return this.viewId}}class lE extends ${static get INSTANCE(){return lE.instance||(lE.instance=new lE,xU(lE.instance)),lE.instance}constructor(){super(),this.transferData=Ote.getInstance(),this.onDragStart=this._register(new I),this.onDragEnd=this._register(new I),this._register(this.onDragEnd.event(e=>{const t=e.dragAndDropData.getData().id,i=e.dragAndDropData.getData().type;this.readDragData(i)?.getData().id===t&&this.transferData.clearData(i==="view"?R5.prototype:T5.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?R5.prototype:T5.prototype)){const t=this.transferData.getData(e==="view"?R5.prototype:T5.prototype);if(t&&t[0])return new E3t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new R5(e):new T5(e)],t==="view"?R5.prototype:T5.prototype)}registerTarget(e,t){const i=new Z;return i.add(new yZ(e,{onDragEnter:s=>{if(s.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:s,dragAndDropData:o})}},onDragLeave:s=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:s,dragAndDropData:o})},onDrop:s=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:s,dragAndDropData:o}),this.onDragEnd.fire({eventData:s,dragAndDropData:o})}},onDragOver:s=>{if(s.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:s,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(s=>{t.onDragStart(s)},this,i),t.onDragEnd&&this.onDragEnd.event(s=>{t.onDragEnd(s)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const s=new Z;return s.add(new yZ(e,{onDragStart:o=>{const{id:r,type:a}=t();this.writeDragData(r,a),o.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:o,dragAndDropData:this.readDragData(a)})},onDragEnd:o=>{const{type:r}=t(),a=this.readDragData(r);a&&this.onDragEnd.fire({eventData:o,dragAndDropData:a})},onDragEnter:o=>{if(i.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;r&&i.onDragEnter({eventData:o,dragAndDropData:r})}},onDragLeave:o=>{const r=this.readDragData("composite")||this.readDragData("view");r&&i.onDragLeave?.({eventData:o,dragAndDropData:r})},onDrop:o=>{if(i.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDrop({eventData:o,dragAndDropData:r}),this.onDragEnd.fire({eventData:o,dragAndDropData:r})}},onDragOver:o=>{if(i.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDragOver({eventData:o,dragAndDropData:r})}}})),i.onDragStart&&this.onDragStart.event(o=>{i.onDragStart(o)},this,s),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,s),this._register(s)}}function r3e(n,e,t){n&&(n.dropEffect=t?e:"none")}let a3e=class{constructor(e,t){this.toResource=e,this.instantiationService=t}getDragURI(e){const t=this.toResource(e);return t?t.toString():null}getDragLabel(e){const t=Vi(e.map(this.toResource));return t.length===1?ui(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const s of e.elements){const o=this.toResource(s);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(s=>Ast(s,i,t))}onDragOver(e,t,i,s,o){return!1}drop(e,t,i,s,o){}dispose(){}};a3e=D([_(1,be)],a3e);const Gce=class Gce extends ${constructor(){super(),this.broadcaster=this._register(new nOe(Gce.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(T.runAndSubscribe(Vb,({window:e,disposables:t})=>{t.add(pe(e,xe.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(pe(e,xe.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:yi,disposables:this._store})),this._register(this.broadcaster.onDidReceiveData(e=>{e===!0?this.markDraggedOver(!0):this.clearDraggedOver(!0)}))}get isDraggedOver(){return this.draggedOver}markDraggedOver(e){this.draggedOver!==!0&&(this.draggedOver=!0,e||this.broadcaster.postData(!0))}clearDraggedOver(e){this.draggedOver!==!1&&(this.draggedOver=!1,e||this.broadcaster.postData(!1))}};Gce.CHANNEL_NAME="monaco-workbench-global-dragged-over";let Sxe=Gce;new Sxe;class x3t{constructor(e,t,i){if(this.location=t,this.parent=i,t[t.length-1]==="\\")throw Error("Unexpected path format, do not use trailing backslashes");t[t.length-1]!=="/"&&(t+="/"),this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}updateContents(e){this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}isPathIncludedInTraversal(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);return!this.isPathIgnored(e,t)}isArbitraryPathIgnored(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);const i=e.split("/").filter(r=>r);let s=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of s)o[r]=!0;return _w(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const s=e.split(` -`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=s.filter(m=>!m.endsWith("/")),r=o.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(r,t,!0),c=o.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),l=this.gitignoreLinesToExpression(c,t,!1),d=s.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=s.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),f=this.gitignoreLinesToExpression(u,t,!1);return(m,v)=>m.startsWith(t)?v&&h(m)&&!f(m)||a(m)&&!l(m)?!0:i?i.isPathIgnored(m,v):!1:!1}gitignoreLineToGlob(e,t){const i=e.indexOf("/");return i===-1||i===e.length-1?e="**/"+e:(i===0?t.slice(-1)==="/"&&(e=e.slice(1)):t.slice(-1)!=="/"&&(e="/"+e),e=t+e),e}}var Axe;(function(n){n.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(Axe||(Axe={}));class D3t{constructor(){this._onDidRegisterDescriptor=new I,this.onDidRegisterDescriptor=this._onDidRegisterDescriptor.event,this.descriptors=[]}register(e){this.descriptors.push(e),this._onDidRegisterDescriptor.fire(e)}create(e,t,i){return this.descriptors.map(s=>{const o=s.create(e,t);return i.add(o),o})}}const Exe=new D3t;it.add(Axe.FileContributionRegistry,Exe);var xxe,Qw;const Fp="vs/workbench/contrib/files/browser/views/explorerViewer",qce=class qce{getHeight(e){return qce.ITEM_HEIGHT}getTemplateId(e){return une.ID}};qce.ITEM_HEIGHT=22;let dne=qce;const Dxe=new I;let kxe=class{constructor(e,t,i,s,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=s,this.layoutService=o,this.fileService=r,this.explorerService=a,this.contextService=c,this.filesConfigService=l}hasChildren(e){return Array.isArray(e)||e.hasChildren(t=>this.fileFilter.filter(t,so.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,s=e.fetchChildren(i);if(Array.isArray(s))return s;const o=s.then(r=>(e instanceof Wh&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==Nn.FOLDER&&Dxe.fire(e.resource),r),r=>{if(e instanceof Wh&&e.isRoot)if(this.contextService.getWorkbenchState()===Nn.FOLDER){const a=new Wh(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else Dxe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};kxe=D([_(1,Cf),_(2,Re),_(3,Pi),_(4,kO),_(5,ci),_(6,Sp),_(7,Ti),_(8,hh)],kxe);const kBe=class kBe{get index(){return this._index}get count(){return this.items.length}get current(){return this.items[this._index]}get currentId(){return`${this.id}_${this.index}`}get labels(){return this._labels}constructor(e,t,i,s,o){this.id=e,this.items=t,this.depth=s,this.collapsed=o,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._index=t.length-1,this.updateLabels(i),this._updateLabelDisposable=i.label.onDidRender(()=>this.updateLabels(i))}updateLabels(e){this._labels=Array.from(e.container.querySelectorAll(".label-name"));let t="";for(let i=0;i=this.items.length-1||this.setIndex(this._index+1)}first(){this._index!==0&&this.setIndex(0)}last(){this._index!==this.items.length-1&&this.setIndex(this.items.length-1)}setIndex(e){e<0||e>=this.items.length||(this.labels[this._index].classList.remove("active"),this._index=e,this.labels[this._index].classList.add("active"),this._onDidChange.fire())}updateCollapsed(e){this.collapsed=e;for(let t=0;t{const f=this.configurationService.getValue("workbench.tree.indent"),p=Math.max(22-f,0);e.style.setProperty("--vscode-explorer-align-offset-margin-left",`${p}px`)};this.configListener=this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("explorer")&&(this.config=this.configurationService.getValue()),f.affectsConfiguration("workbench.tree.indent")&&u()}),u()}getWidgetAriaLabel(){return g(Fp,0,"Files Explorer")}get templateId(){return xxe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{o.currentContext&&this.updateWidth(o.currentContext)}catch{}}));const s=Exe.create(this.instantiationService,e,t);t.add(Exe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);s.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:s};return o}renderElement(e,t,i){const s=e.element;i.currentContext=s;const o=this.explorerService.getEditableData(s);i.label.element.classList.remove("compressed"),o?(i.label.element.style.display="none",i.contribs.forEach(r=>r.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,s,o))):(i.label.element.style.display="flex",this.renderStat(s,s.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,s){const o=e.element.elements[e.element.elements.length-1];i.currentContext=o;const r=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=r.length===0?void 0:this.explorerService.getEditableData(r[0]);if(a)i.label.element.classList.remove("compressed"),i.label.element.style.display="none",i.contribs.forEach(c=>c.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,r[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${hne.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new hne(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(o)??[];this.compressedNavigationControllers.set(o,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(pe(i.container,"mousedown",u=>{const f=gne(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(o)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(o):u.splice(f,1)}))}}renderStat(e,t,i,s,o){o.label.element.style.display="flex";const r=["explorer-item"];this.explorerService.isCut(e)&&r.push("cut");const a=this.themeService.getFileIconTheme();o.container.parentElement?.parentElement?.querySelector(".monaco-tl-twistie")?.classList.toggle("force-twistie",e.hasNests&&a.hidesExplorerArrows);const l=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),d=e.nestedParent&&l;o.contribs.forEach(h=>h.setResource(e.resource)),o.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?Lc.ROOT_FOLDER:e.isDirectory?Lc.FOLDER:Lc.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:Cz(s),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const s=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?Lc.ROOT_FOLDER:t.isDirectory?Lc.FOLDER:Lc.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:r,extraClasses:l?[...o,"align-nest-icon-with-parent-icon"]:o},h=t.name?ma(t.resource):t.resource,u=t.name||"";s.setFile(Qt(h,u||" "),d),s.element.firstElementChild.style.display="none";const f=new fXe(s.element,this.contextViewService,{validationOptions:{validation:C=>{const y=i.validationMessage(C);return!y||y.severity!==nt.Error?null:{content:y.content,formatContent:!0,type:Yd.ERROR}}},ariaLabel:g(Fp,1,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:eV}),p=u.lastIndexOf(".");let m="prefix";f.value=u,f.focus(),f.select({start:0,end:p>0&&!t.isDirectory?p:u.length});const v=cw((C,y)=>{s.element.style.display="none";const S=f.value;St(b),s.element.remove(),y&&i.onFinish(S,C)}),w=()=>{if(f.isInputValid()){const C=i.validationMessage(f.value);C?f.showMessage({content:C.content,formatContent:!0,type:C.severity===nt.Info?Yd.INFO:C.severity===nt.Warning?Yd.WARNING:Yd.ERROR}):f.hideMessage()}};w();const b=[f,f.onDidChange(C=>{s.setFile(Qt(h,C||" "),d)}),Xo(f.inputElement,xe.KEY_DOWN,C=>{if(C.equals(E.F2)){const y=f.value.lastIndexOf(".");if(t.isDirectory||y===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:y+1,end:f.value.length})):(m="prefix",f.select({start:0,end:y}))}else C.equals(E.Enter)?f.validate()||v(!0,!0):C.equals(E.Escape)&&v(!1,!0)}),Xo(f.inputElement,xe.KEY_UP,C=>{w()}),pe(f.inputElement,xe.BLUR,async()=>{for(;;){await Ta(0);const C=f.inputElement.ownerDocument;if(!C.hasFocus())break;if(kw(f.inputElement))return;if(Ra(C.activeElement)&&GY(C.activeElement,"context-view"))await T.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),s];return Ee(()=>{v(!1,!1)})}disposeElement(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeCompressedElements(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}getCompressedNavigationController(e){return this.compressedNavigationControllers.get(e)}getAriaLabel(e){return e.name}getAriaLevel(e){let t=0,i=e.parent;for(;i;)i=i.parent,t++;return this.contextService.getWorkbenchState()===Nn.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},xxe=pP,pP.ID="file",pP);une=xxe=D([_(3,W_),_(4,pn),_(5,Re),_(6,Sp),_(7,eo),_(8,Ti),_(9,Vr),_(10,be)],une);let Ixe=class{constructor(e,t,i,s,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=s,this.uriIdentityService=o,this.fileService=r,this.hiddenExpressionPerRoot=new Map,this.editorsAffectingFilter=new Set,this._onDidChange=new I,this.toDispose=[],this.ignoreFileResourcesPerRoot=new Map,this.ignoreTreesPerRoot=new Map,this.toDispose.push(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateConfiguration())),this.toDispose.push(this.configurationService.onDidChangeConfiguration(a=>{(a.affectsConfiguration("files.exclude")||a.affectsConfiguration("explorer.excludeGitIgnore"))&&this.updateConfiguration()})),this.toDispose.push(this.fileService.onDidFilesChange(a=>{for(const[c,l]of this.ignoreFileResourcesPerRoot.entries())l.forEach(async d=>{a.contains(d,Ko.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,Ko.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(ma(d)),l.delete(d),this._onDidChange.fire())})})),this.toDispose.push(this.editorService.onDidVisibleEditorsChange(()=>{const a=this.editorService.visibleEditors;let c=!1;for(const l of a){if(!l.resource)continue;const d=this.explorerService.findClosest(l.resource);if(d&&d.isExcluded){c=!0;break}}for(const l of this.editorsAffectingFilter)if(!a.includes(l)){c=!0;break}c&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())})),this.updateConfiguration()}get onDidChange(){return this._onDidChange.event}updateConfiguration(){let e=!1,t=!1;this.contextService.getWorkspace().folders.forEach(i=>{const s=this.configurationService.getValue({resource:i.uri}),o=s?.files?.exclude||Object.create(null),r=s.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new o1),this.ignoreTreesPerRoot.set(i.uri.toString(),Su.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!r&&this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.delete(i.uri.toString()),this.ignoreTreesPerRoot.delete(i.uri.toString())),!e){const c=this.hiddenExpressionPerRoot.get(i.uri.toString());e=!c||!Io(c.original,o)}const a=Vs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:_w(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const s=ma(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(s))return;const r=await this.fileService.readFile(t);if(i)o.get(s)?.updateContents(r.value.toString());else{const a=o.findSubstr(s),c=new x3t(r.value.toString(),s.path,a);o.set(s,c),this.ignoreFileResourcesPerRoot.get(e)?.has(t)||this.ignoreFileResourcesPerRoot.get(e)?.add(t)}this._onDidChange.fire()}filter(e,t){return e.name===".gitignore"&&this.ignoreTreesPerRoot.has(e.root.resource.toString())?(this.processIgnoreFile(e.root.resource.toString(),e.resource,!1),!0):this.isVisible(e,t)}isVisible(e,t){if(e.isExcluded=!1,t===so.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const s=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(LU(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(s?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||s||e.parent?.isExcluded){e.isExcluded=!0;const l=this.editorService.visibleEditors.find(d=>d.resource&&this.uriIdentityService.extUri.isEqualOrParent(d.resource,e.resource));return l&&e.root===this.explorerService.findClosestRoot(e.resource)?(this.editorsAffectingFilter.add(l),!0):!1}return!0}dispose(){St(this.toDispose)}};Ixe=D([_(0,Ti),_(1,Re),_(2,Sp),_(3,_i),_(4,_o),_(5,ci)],Ixe);let Lxe=class{constructor(e,t){this.explorerService=e,this.contextService=t}compare(e,t){if(e.isRoot){if(t.isRoot){const a=this.contextService.getWorkspaceFolder(e.resource),c=this.contextService.getWorkspaceFolder(t.resource);return a&&c?a.index-c.index:-1}return-1}if(t.isRoot)return 1;const i=this.explorerService.sortOrderConfiguration.sortOrder,s=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(s){case"upper":o=jIt,r=XIt;break;case"lower":o=KIt,r=ZIt;break;case"unicode":o=YIt,r=e0t;break;default:o=QIt,r=JIt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return o(e.name,t.name);break;case"filesFirst":if(e.isDirectory&&!t.isDirectory)return 1;if(t.isDirectory&&!e.isDirectory)return-1;break;case"foldersNestsFiles":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.hasNests&&!t.hasNests)return-1;if(t.hasNests&&!e.hasNests)return 1;break;case"mixed":break;default:if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;break}switch(i){case"type":return r(e.name,t.name);case"modified":return e.mtime!==t.mtime?e.mtime&&t.mtime&&e.mtime{(!u||u.affectsConfiguration("explorer.enableDragAndDrop"))&&(this.dropEnabled=this.configurationService.getValue("explorer.enableDragAndDrop"))};h(void 0),this.disposables.add(this.configurationService.onDidChangeConfiguration(u=>h(u)))}onDragOver(e,t,i,s,o){if(!this.dropEnabled)return!1;if(t){const r=Qw.getCompressedStatFromDragEvent(t,o);if(r){const a=gne(o.target);if(a&&a.index{a.element.classList.remove("drop-target"),this.compressedDragOverElement=void 0}),a.element.classList.add("drop-target")),typeof c=="boolean"?c:{...c,feedback:[]}):(this.compressedDropTargetDisposable.dispose(),!1)}}}return this.compressedDropTargetDisposable.dispose(),this.handleDragOver(e,t,i,s,o)}handleDragOver(e,t,i,s,o){const r=o&&(o.ctrlKey&&!ei||o.altKey&&ei),a=e instanceof fbe,l={type:a||r?_R.Copy:_R.Move,position:iS.Over};if(a){if(!Ctt(o,fm.FILES,bF.FILES,fm.RESOURCES))return!1}else{if(e instanceof NJe)return!1;{const d=Qw.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!r&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:_R.Move,position:iS.After}}:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!r&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!r&&this.uriIdentityService.extUri.isEqual(ma(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(s){case AA.TOP:case AA.CENTER_TOP:u=iS.Before;break;case AA.CENTER_BOTTOM:case AA.BOTTOM:u=iS.After;break}return{accept:!0,effect:{type:_R.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:CR.Up,effect:l}}else return{accept:!0,bubble:CR.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Qw.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Qw.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>Ast(o,i,t));const s=i.filter(o=>o.resource.scheme===_e.file).map(o=>o.resource.fsPath);s.length&&t.dataTransfer.setData(bF.FILES,JSON.stringify(s))}}async drop(e,t,i,s,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=Qw.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],s=AA.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof fbe?!Jn||hx(this.contextService.getWorkspace())&&Tv.supported(yi)?await this.instantiationService.createInstance(wxe).import(r,o,yi):await this.instantiationService.createInstance(lne).upload(t,o):await this.handleExplorerDrop(e,r,i,s,o)}catch(a){this.dialogService.error(Ma(a))}}async handleExplorerDrop(e,t,i,s,o){const r=Qw.getStatsFromDragAndDropData(e),a=new Map(r.map(u=>[u,this.isCollapsed(u)]));for(const[u,f]of a)if(f){const p=u.nestedChildren;if(p)for(const m of p)a.set(m,!0)}const c=Kht([...a.keys()],u=>u.resource),l=o.ctrlKey&&!ei||o.altKey&&ei;if(!l&&this.configurationService.getValue(Qw.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(Fp,2,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(Fp,3,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(Fp,4,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(Fp,5,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?fst(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(Fp,6,"Do not ask me again")},primaryButton:g(Fp,7,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(Qw.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,s);const h=c.filter(u=>!u.isRoot);return l?this.doHandleExplorerDropOnCopy(h,t):this.doHandleExplorerDropOnMove(h,t)}async doHandleRootDrop(e,t,i){if(e.length===0)return;const s=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==s[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case AA.BOTTOM:case AA.CENTER_BOTTOM:o++;break}for(const l of r)l{const c=a.newResource?this.explorerService.findClosest(a.newResource):void 0;return c&&!c.isDirectory}).map(a=>({resource:a.newResource,options:{pinned:!0}}));await this.editorService.openEditors(r)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(r=>!r.isReadonly).map(r=>new up(r.resource,Qt(t.resource,r.name))),s=c3e(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===SM.Verbose,undoLabel:g(Fp,10,"Move {0}",s),progressLabel:g(Fp,11,"Moving {0}",s)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Zi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=d3t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new up(d.oldResource,d.newResource,{overwrite:!0})),o)}else throw r}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Qw.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=gt(t).document.elementFromPoint(t.clientX,t.clientY),s=gne(i);if(s){const{count:o,index:r}=s;let a=o-1;for(;a>r&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Qw=mP,mP.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",mP);Txe=Qw=D([_(1,Sp),_(2,_i),_(3,To),_(4,Ti),_(5,ci),_(6,Re),_(7,be),_(8,$S),_(9,_o)],Txe);function gne(n){if(!Ra(n))return null;let e=n;for(;e&&!e.classList.contains("monaco-list-row");){if(e.classList.contains("label-name")&&e.hasAttribute("data-icon-label-count")){const t=Number(e.getAttribute("data-icon-label-count")),i=Number(e.getAttribute("data-icon-label-index"));if(Kc(t)&&Kc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function k3t(n){return!!gne(n)}class I3t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Fhe||!e.parent||e.parent.isRoot}}function c3e(n){return n.length===1?n[0].name:n.every(e=>e.isDirectory)?g(Fp,12,"{0} folders",n.length):n.every(e=>!e.isDirectory)?g(Fp,13,"{0} files",n.length):`${n.length} files and folders`}const hX="vs/workbench/contrib/files/browser/views/explorerDecorationsProvider";function L3t(n){if(n.isRoot&&n.error)return{tooltip:g(hX,0,"Unable to resolve workspace folder ({0})",Ma(n.error)),letter:"!",color:__t};if(n.isSymbolicLink)return{tooltip:g(hX,1,"Symbolic Link"),letter:"⤷"};if(n.isUnknown)return{tooltip:g(hX,2,"Unknown File Type"),letter:"?"};if(n.isExcluded)return{color:y_t}}let Rxe=class{constructor(e,t){this.explorerService=e,this.label=g(hX,3,"Explorer"),this._onDidChange=new I,this.toDispose=new Z,this.toDispose.add(this._onDidChange),this.toDispose.add(t.onDidChangeWorkspaceFolders(i=>{this._onDidChange.fire(i.changed.concat(i.added).map(s=>s.uri))})),this.toDispose.add(Dxe.event(i=>{this._onDidChange.fire([i])}))}get onDidChange(){return this._onDidChange.event}async provideDecorations(e){const t=this.explorerService.findClosest(e);if(!t)throw new Error("ExplorerItem not found");return L3t(t)}dispose(){this.toDispose.dispose()}};Rxe=D([_(0,Sp),_(1,Ti)],Rxe);var uX;const NF="vs/workbench/contrib/files/browser/views/explorerView";function T3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t)){for(const[,i]of t.children.entries())if(n.hasNode(i)&&n.isCollapsible(i)&&!n.isCollapsed(i))return!0}return!1}function R3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t))return!0;return!1}const M3t={getId:n=>n instanceof Fhe?`new:${n.getId()}`:n.getId()};function N3t(n,e,t,i){let s;s=n.length?n[0]:void 0,t&&e.length>1&&(s=void 0);const o=s&&i.getCompressedNavigationController(s),r=o&&o.length?o[0]:void 0;s=r?r.current:s;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&s&&d===r){c===s&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return s?t&&a.indexOf(s)>=0?a:[s]:t?a:[]}var _P;let QV=(_P=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F){super(e,d,t,u,h,i,s,F,m,v,w),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=b,this.storageService=C,this.clipboardService=y,this.fileService=S,this.uriIdentityService=M,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=s.createInstance(O7),this._register(this.resourceContext),this.folderContext=x5t.bindTo(h),this.readonlyContext=cst.bindTo(h),this.availableEditorIdsContext=D5t.bindTo(h),this.rootContext=k5t.bindTo(h),this.resourceMoveableToTrash=L5t.bindTo(h),this.compressedFocusContext=T5t.bindTo(h),this.compressedFocusFirstContext=R5t.bindTo(h),this.compressedFocusLastContext=M5t.bindTo(h),this.viewHasSomeCollapsibleRootItem=N5t.bindTo(h),this.viewVisibleContextKey=XFe.bindTo(h),this.explorerService.registerView(this)}get autoReveal(){return this._autoReveal}set autoReveal(e){this._autoReveal=e}get name(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get title(){return this.name}set title(e){}setVisible(e){this.viewVisibleContextKey.set(e),super.setVisible(e)}get fileCopiedContextKey(){return h3t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return I5t.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new pxt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(NF,0,"Explorer Section: {0}",this.name),t.setAttribute("aria-label",this.ariaHeaderLabel)};this._register(this.contextService.onDidChangeWorkspaceName(i)),this._register(this.labelService.onDidChangeFormatters(i)),i()}layoutBody(e,t){super.layoutBody(e,t),this.tree.layout(e,t)}renderBody(e){super.renderBody(e),this.container=e,this.treeContainer=he(e,we(".explorer-folders-view")),this.createTree(this.treeContainer),this._register(this.labelService.onDidChangeFormatters(()=>{this._onDidChangeTitleArea.fire()})),this.onConfigurationUpdated(void 0),this._register(this.editorService.onDidActiveEditorChange(()=>{this.selectActiveFile()})),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationUpdated(t))),this._register(this.onDidChangeBodyVisibility(async t=>{t&&(await this.setTreeInput(),this.updateAnyCollapsedContext(),this.selectActiveFile(!0))})),this._register(pe(gt(this.container),xe.PASTE,async t=>{!this.hasFocus()||this.readonlyContext.get()||t.clipboardData?.files?.length&&await this.commandService.executeCommand("filesExplorer.paste",t.clipboardData?.files)}))}focus(){if(super.focus(),this.tree.domFocus(),this.tree.getFocusedPart()===aV.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return lMe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===aV.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return N3t(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,so.Visible):!1}isItemCollapsed(e){return this.tree.isCollapsed(e)}async setEditable(e,t){t?(this.horizontalScrolling=this.tree.options.horizontalScrolling,this.horizontalScrolling&&this.tree.updateOptions({horizontalScrolling:!1}),await this.tree.expand(e.parent)):(this.horizontalScrolling!==void 0&&this.tree.updateOptions({horizontalScrolling:this.horizontalScrolling}),this.horizontalScrolling=void 0,this.treeContainer.classList.remove("highlight")),await this.refresh(!1,e.parent,!1),t?(this.treeContainer.classList.add("highlight"),this.tree.reveal(e)):this.tree.domFocus()}async selectActiveFile(e=this._autoReveal){if(this._autoReveal){const t=jc.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:go.PRIMARY});if(t){const i=this.tree.getFocus(),s=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&s.length===1&&this.uriIdentityService.extUri.isEqual(s[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(Ixe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(une,e,t,i),this._register(this.renderer),this._register(sOe(e,this.themeService));const s=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(Fee,"FileExplorer",e,new dne,new I3t,[this.renderer],this.instantiationService.createInstance(kxe,this.filter),{compressionEnabled:s(),accessibilityProvider:this.renderer,identityProvider:M3t,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>{if(!this.explorerService.isEditable(a))return a.name},getCompressedNodeKeyboardNavigationLabel:a=>{if(!a.some(c=>this.explorerService.isEditable(c)))return a.map(c=>c.name).join("/")}},multipleSelectionSupport:!0,filter:this.filter,sorter:this.instantiationService.createInstance(Lxe),dnd:this.instantiationService.createInstance(Txe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof Wh&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof Wh){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:dne.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=T.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:s()}))),dst.bindTo(this.tree.contextKeyService),hst.bindTo(this.tree.contextKeyService),this._register(this.tree.onDidChangeFocus(a=>this.onFocusChanged(a.elements))),this.onFocusChanged([]),this._register(this.tree.onDidOpen(async a=>{const c=a.element;if(!c)return;if(!(Sv(a.browserEvent)&&a.browserEvent.shiftKey)){if(c.isDirectory||this.explorerService.isEditable(void 0))return;this.telemetryService.publicLog2("workbenchActionExecuted",{id:"workbench.files.openFile",from:"explorer"});try{this.delegate?.willOpenElement(a.browserEvent),await this.editorService.openEditor({resource:c.resource,options:{preserveFocus:a.editorOptions.preserveFocus,pinned:a.editorOptions.pinned,source:C7.USER}},a.sideBySide?Cw:wx)}finally{this.delegate?.didOpenElement()}}})),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidScroll(async a=>{const c=this.explorerService.getEditable();a.scrollTopChanged&&c&&this.tree.getRelativeTop(c.stat)===null&&await c.data.onFinish("",!1)})),this._register(this.tree.onDidChangeCollapseState(a=>{const c=a.node.element?.element;c&&this.renderer.getCompressedNavigationController(c instanceof Array?c[0]:c)?.forEach(d=>d.updateCollapsed(a.node.collapsed)),this.updateAnyCollapsedContext()})),this.updateAnyCollapsedContext(),this._register(this.tree.onMouseDblClick(a=>{const c=this.configurationService.getValue("workbench.list.scrollByPage");a.element===null&&!c&&this.commandService.executeCommand(iOe)})),this._register(this.storageService.onWillSaveState(()=>{this.storeTreeViewState()}))}onConfigurationUpdated(e){if(!e||e.affectsConfiguration("explorer.autoReveal")){const t=this.configurationService.getValue();this._autoReveal=t?.explorer?.autoReveal}e&&(e.affectsConfiguration("explorer.decorations.colors")||e.affectsConfiguration("explorer.decorations.badges"))&&this.refresh(!0)}storeTreeViewState(){this.storageService.store(uX.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),ke.WORKSPACE,ln.MACHINE)}setContextKeys(e){const t=this.contextService.getWorkspace().folders,i=e?e.resource:t[t.length-1].uri;if(e=e||this.explorerService.findClosest(i),this.resourceContext.set(i),this.folderContext.set(!!e&&e.isDirectory),this.readonlyContext.set(!!e&&!!e.isReadonly),this.rootContext.set(!!e&&e.isRoot),i){const s=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(s.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(ux(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Ra(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(Sv(e.browserEvent)||k3t(e.browserEvent.target)?i=a[0].labels[a[0].index]:a.forEach(c=>c.last()))}this.fileCopiedContextKey.set(await this.clipboardService.hasResources()),this.setContextKeys(t);const s=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof Wh){const a=this.renderer.getCompressedNavigationController(t);r=a&&a.length?a[0].current.resource:t.resource}else r=o.length===1?o[0].resource:{};this.contextMenuService.showContextMenu({menuId:Te.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&s&&s.indexOf(t)>=0?s.map(a=>a.resource):t instanceof Wh?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const s=this.configurationService.getValue().files.enableTrash,o=this.fileService.hasCapability(t.resource,es.Trash);this.resourceMoveableToTrash.set(s&&o)}else this.resourceMoveableToTrash.reset();const i=t&&this.renderer.getCompressedNavigationController(t);if(!i){this.compressedFocusContext.set(!1);return}this.compressedFocusContext.set(!0),i.forEach(s=>{this.updateCompressedNavigationContextKeys(s)})}refresh(e,t,i=!0){if(!this.tree||!this.isBodyVisible()||t&&!this.tree.hasNode(t))return Promise.resolve(void 0);i&&this.explorerService.isEditable(void 0)&&this.tree.domFocus();const s=t||this.tree.getInput();return this.tree.updateChildren(s,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return zut(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&vs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==Nn.FOLDER||t[0].error)&&(i=t);let s;if(this.tree&&this.tree.getInput())s=this.tree.getViewState();else{const a=this.storageService.get(uX.TREE_VIEW_STATE_STORAGE_KEY,ke.WORKSPACE);a&&(s=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,s).then(async()=>{if(Array.isArray(i)){if(!s||o instanceof Wh)for(let a=0;a{}),Array.isArray(o)){const a=new wi;o.forEach(c=>a.set(c.resource,!0)),await Promise.all(i.map(async c=>{if(!a.has(c.resource))try{await this.tree.expand(c)}catch{}}))}}e&&vs("code/didResolveExplorer")});this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new Rxe(this.explorerService,this.contextService),this._register(this.decorationService.registerDecorationsProvider(this.decorationsProvider)))}async selectResource(e,t=this._autoReveal,i=0){if(i===2||!e||!this.isBodyVisible())return;this.setTreeInputPromise&&await this.setTreeInputPromise;let s=this.explorerService.findClosestRoot(e);for(;s&&s.resource.toString()!==e.toString();){try{await this.tree.expand(s)}catch{return this.selectResource(e,t,i+1)}if(!s.children.size)s=null;else for(const o of s.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){s=o;break}s=null}}if(s){if(s===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{s.nestedParent&&await this.tree.expand(s.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(s)===null&&this.tree.reveal(s,.5),this.tree.setFocus([s]),this.tree.setSelection([s])}catch{return this.selectResource(e,t,i+1)}}}itemsCopied(e,t,i){this.fileCopiedContextKey.set(e.length>0),this.resourceCutContextKey.set(t&&e.length>0),i?.forEach(s=>this.tree.rerender(s)),t&&e.forEach(s=>this.tree.rerender(s))}expandAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus(),this.tree.expandAll()}collapseAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus();const e=this.tree.getInput();if(Array.isArray(e)&&T3t(this.tree,e)){e.forEach(t=>{t.children.forEach(i=>this.tree.hasNode(i)&&this.tree.collapse(i,!0))});return}this.tree.collapseAll()}previousCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.previous(),this.updateCompressedNavigationContextKeys(i)})}nextCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.next(),this.updateCompressedNavigationContextKeys(i)})}firstCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.first(),this.updateCompressedNavigationContextKeys(i)})}lastCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.last(),this.updateCompressedNavigationContextKeys(i)})}updateCompressedNavigationContextKeys(e){this.compressedFocusFirstContext.set(e.index===0),this.compressedFocusLastContext.set(e.index===e.count-1)}updateAnyCollapsedContext(){const e=this.tree.getInput();if(e===void 0)return;const t=Array.isArray(e)?e:Array.from(e.children.values());this.viewHasSomeCollapsibleRootItem.set(R3t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},uX=_P,_P.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",_P);QV.__decorator=D([ii],QV.prototype,"fileCopiedContextKey",null);QV.__decorator=D([ii],QV.prototype,"resourceCutContextKey",null);QV=uX=D([_(1,Vr),_(2,z_),_(3,be),_(4,Ti),_(5,Cf),_(6,_i),_(7,Pz),_(8,kO),_(9,ti),_(10,Pe),_(11,Re),_(12,rD),_(13,eo),_(14,pn),_(15,rn),_(16,el),_(17,Sp),_(18,on),_(19,Mu),_(20,ci),_(21,_o),_(22,ji),_(23,fr)],QV);function sOe(n,e){n.classList.add("file-icon-themable-tree"),n.classList.add("show-file-icons");const t=i=>{n.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),n.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends pi{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(NF,1,"New File..."),f1:!1,icon:Ce.newFile,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:10}})}run(n){n.get(ji).executeCommand(iOe)}});At(class extends pi{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(NF,2,"New Folder..."),f1:!1,icon:Ce.newFolder,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:20}})}run(n){n.get(ji).executeCommand(yst)}});At(class extends pi{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Be(NF,3,"Refresh Explorer"),f1:!0,icon:Ce.refresh,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:30},metadata:{description:Be(NF,4,"Forces a refresh of the Explorer.")}})}async run(n){const e=n.get(q_),t=n.get(Sp);await e.openView(lC),await t.refresh()}});At(class extends pi{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Be(NF,5,"Collapse Folders in Explorer"),f1:!0,icon:Ce.collapseAll,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:40},metadata:{description:Be(NF,6,"Folds all folders in the Explorer.")}})}run(n){const t=n.get(q_).getViewWithId(lC);t!==null&&t.collapseAll()}});const P3t=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let Mxe=class extends vw{constructor(e,t,i,s){super(e??{},t,i),this.trustedDomainService=s}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:P3t}};const s=e&&e.supportHtml?{...e,value:`${e.value}`}:e;return super.render(s,t,i)}};Mxe=D([_(1,Di),_(2,fr),_(3,lhe)],Mxe);var Nxe,Pxe;const zm="vs/workbench/contrib/chat/browser/chatListRenderer",Pl=we;var vP;let fne=(vP=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(),this.location=t,this.rendererOptions=i,this.delegate=s,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.openerService=d,this.contextKeyService=h,this.themeService=u,this.commandService=f,this.textModelService=p,this.modelService=m,this.hoverService=v,this.chatService=w,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new wi,this.fileTreesByResponseId=new Map,this.focusedFileTreesByResponseId=new Map,this._onDidClickFollowup=this._register(new I),this.onDidClickFollowup=this._onDidClickFollowup.event,this._onDidClickRerunWithAgentOrCommandDetection=new I,this.onDidClickRerunWithAgentOrCommandDetection=this._onDidClickRerunWithAgentOrCommandDetection.event,this._onDidChangeItemHeight=this._register(new I),this.onDidChangeItemHeight=this._onDidChangeItemHeight.event,this._currentLayoutWidth=0,this._isVisible=!0,this._onDidChangeVisibility=this._register(new I),this._usedReferencesEnabled=!1,this.renderer=this._register(this.instantiationService.createInstance(Mxe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(nxe),this._editorPool=this._register(this.instantiationService.createInstance(Oxe,e,s,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(Bxe,e,s,r)),this._treePool=this._register(this.instantiationService.createInstance(Wxe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(Hxe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(xEe)),this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0,this._register(c.onDidChangeConfiguration(b=>{b.affectsConfiguration("chat.experimental.usedReferences")&&(this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0)}))}get templateId(){return Nxe.ID}editorsInUse(){return this._editorPool.inUse()}traceLayout(e,t){this.logService.trace(`ChatListItemRenderer#${e}: ${t}`)}getProgressiveRenderRate(e){if(e.isComplete)return 80;if(e.contentUpdateTimings&&e.contentUpdateTimings.impliedWordLoadRate){const o=e.contentUpdateTimings.impliedWordLoadRate*1.5;return kc(o,12,80)}return 8}getCodeBlockInfosForResponse(e){return this.codeBlocksByResponseId.get(e.id)??[]}getCodeBlockInfoForEditor(e){return this.codeBlocksByEditorUri.get(e)}getFileTreeInfosForResponse(e){return this.fileTreesByResponseId.get(e.id)??[]}getLastFocusedFileTreeForResponse(e){const t=this.fileTreesByResponseId.get(e.id),i=this.focusedFileTreesByResponseId.get(e.id);if(t?.length&&i!==void 0&&iy.actions.length<=1},actionViewItemProvider:(y,S)=>y instanceof id&&(y.item.id==="workbench.action.chat.voteDown"||y.item.id==="workbench.action.chat.voteUp")?p.createInstance(O3t,y,S):yO(p,y,S)}));const v=t.add(this.instantiationService.createInstance(ene)),w=()=>{if(As(C.currentElement)&&C.currentElement.agent)return v.setAgent(C.currentElement.agent.id),v.domNode},b=ast(()=>As(C.currentElement)?C.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupUpdatableHover(va("element"),o,w,b)),t.add(pe(o,xe.KEY_DOWN,y=>{const S=new os(y);if(S.equals(E.Space)||S.equals(E.Enter)){const M=w();M&&this.hoverService.showHover({content:M,target:o,trapFocus:!0,actions:b.actions},!0)}else S.equals(E.Escape)&&this.hoverService.hideHover()}));const C={avatarContainer:r,username:a,detail:l,referencesListContainer:d,value:h,rowContainer:i,elementDisposables:u,titleToolbar:m,templateDisposables:t,contextKeyService:f,agentHover:v};return C}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const s=ip(e)?"request":As(e)?"response":"welcome";this.traceLayout("renderElement",`${s}, index=${t}`),QPt.bindTo(i.contextKeyService).set(As(e)),jPt.bindTo(i.contextKeyService).set(ip(e)),GPt.bindTo(i.contextKeyService).set(As(e)&&e.agentOrSlashCommandDetected),As(e)?(qPt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),A4e.bindTo(i.contextKeyService).set(e.vote===zV.Up?"up":e.vote===zV.Down?"down":"")):A4e.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(As(e)&&e.errorDetails?.responseIsFiltered);if(htt.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",ip(e)),i.rowContainer.classList.toggle("interactive-response",As(e)),i.rowContainer.classList.toggle("interactive-welcome",XW(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",As(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Yo(i.detail),As(e)&&this.renderDetail(e,i),As(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${s}, index=${t}`);const r=i.elementDisposables.add(new Z),a=i.elementDisposables.add(new sQ),c=l=>{try{this.doNextProgressiveRender(e,t,i,!!l,r)&&a.cancel()}catch(d){throw a.cancel(),d}};a.cancelAndSet(c,50,gt(i.rowContainer)),c(!0)}else if(As(e)){const r=Oze(e.response.value);this.basicRenderElement(r,e,t,i)}else if(ip(e)){const r="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);this.basicRenderElement([{content:new Xt(r),kind:"markdownContent"}],e,t,i)}else this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(Ni(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Yo(t.detail),e.slashCommand&&e.agentOrSlashCommandDetected){let i="";const s=`${O1}${e.slashCommand.name}`;e.isComplete?i=g(zm,0,"used {0} [[(rerun without)]]",s):i=g(zm,1,"using {0}",s),_a(t.detail,mNe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:o=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=rzt)}renderAvatar(e,t){const i=As(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??Ce.account;if(i instanceof P){const s=we("img.icon");s.src=lp.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(we(".avatar",void 0,s))}else{const s=we($e.asCSSSelector(i));t.avatarContainer.replaceChildren(we(".avatar.codicon-avatar",void 0,s))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===sf.DARK?e.iconDark:e?.icon?e.icon:Ce.copilot}basicRenderElement(e,t,i,s){const o=As(t)&&(!t.isComplete||t.isCanceled||t.errorDetails?.responseIsFiltered||t.errorDetails?.responseIsIncomplete);Yo(s.value),Yo(s.referencesListContainer),As(t)&&this.renderDetail(t,s),this.renderContentReferencesIfNeeded(t,s,s.elementDisposables);let r=0,a=0;if(e.forEach((d,h)=>{const u=d.kind==="treeData"?this.renderTreeData(d.treeData,t,s,r++):d.kind==="markdownContent"?this.renderMarkdown(d.content,t,s,o,a):d.kind==="progressMessage"&&JK(e,h)?this.renderProgressMessage(d,!1):d.kind==="progressTask"?this.renderProgressTask(d,!1,t,s):d.kind==="command"?this.renderCommandButton(t,d):d.kind==="textEditGroup"?this.renderTextEdit(t,d,s):d.kind==="warning"?this.renderNotification("warning",d.content):d.kind==="confirmation"?this.renderConfirmation(t,d,s):void 0;u&&(s.value.appendChild(u.element),s.elementDisposables.add(u),"codeBlockCount"in u&&(a+=u.codeBlockCount))}),As(t)&&t.errorDetails?.message){const d=this.renderNotification(t.errorDetails.responseIsFiltered?"info":"error",new Xt(t.errorDetails.message));s.elementDisposables.add(d),s.value.appendChild(d.element)}const c=s.rowContainer.offsetHeight,l=!t.currentRenderedHeight||t.currentRenderedHeight!==c;if(t.currentRenderedHeight=c,l){const d=s.elementDisposables.add(xd(gt(s.value),()=>{t.currentRenderedHeight=s.rowContainer.offsetHeight,d.dispose(),this._onDidChangeItemHeight.fire({element:t,height:t.currentRenderedHeight})}))}}updateItemHeight(e){if(!e.currentElement)return;const t=e.rowContainer.offsetHeight;e.currentElement.currentRenderedHeight=t,this._onDidChangeItemHeight.fire({element:e.currentElement,height:t})}renderWelcomeMessage(e,t){Yo(t.value),Yo(t.referencesListContainer),Jl(t.referencesListContainer);for(const o of e.content)if(Array.isArray(o)){const r=this.instantiationService.createChild(new Dl([Pe,t.contextKeyService]));t.elementDisposables.add(r.createInstance($ie,t.value,o,this.location,void 0,a=>this._onDidClickFollowup.fire(a)))}else{const r=this.renderMarkdown(o,e,t);t.value.appendChild(r.element),t.elementDisposables.add(r)}const i=t.rowContainer.offsetHeight,s=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,s){const o=t.elementDisposables.add(xd(gt(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,s,o){if(!this._isVisible)return!0;const r=Oze(e.response.value);let a=!1;if(e.isCanceled)this.traceLayout("runProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(r,e,t,i),a=!0;else{e.renderData??={renderedParts:[]};const l=e.renderData.renderedParts,d=[],h=[];let u=!1;if(r.forEach((f,p)=>{const m=l[p];if(m){if((f.kind==="markdownContent"||f.kind==="progressMessage")&&Q3t(m)){const v=this.getDataForProgressiveRender(e,l3e(f.content),m);v!==void 0&&m.renderedWordCount!==v?.actualWordCount?(this.traceLayout("doNextProgressiveRender",`Rendering changed part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v):!m.isFullyRendered&&!v&&(u=!0)}else if(f.kind==="progressMessage"&&Vxe(m)&&(m.isAtEndOfResponse!==JK(r,p)||m.isLast!==(p===r.length-1)))h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="progressTask"&&d3e(m)){const v=f.isSettled?.()??!0;(m.isSettled!==v||f.progress.length!==m.progressLength||v)&&(h[p]={task:f,isSettled:v,progressLength:f.progress.length})}}else if(f.kind==="treeData")h[p]=f.treeData;else if(f.kind==="progressMessage")h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="command"||f.kind==="textEditGroup"||f.kind==="confirmation"||f.kind==="warning")h[p]=f;else if(f.kind==="progressTask")h[p]={task:f,isSettled:f.isSettled?.()??!0,progressLength:f.progress.length};else{const v=this.getDataForProgressiveRender(e,l3e(f.content),{renderedWordCount:0,lastRenderTime:0});v!==void 0&&(this.traceLayout("doNextProgressiveRender",`Rendering new part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v)}}),a=h.filter(f=>!("isSettled"in f)||!f.isSettled).length===0&&!u,a&&e.isComplete)this.traceLayout("runProgressiveRender",`end progressive render, index=${t} and clearing renderData, response is complete, index=${t}`),e.renderData=void 0,o.clear(),this.basicRenderElement(r,e,t,i);else{if(a)return!1;{o.clear(),this.renderContentReferencesIfNeeded(e,i,o);let f=!1;h.forEach((p,m)=>{if(!p)return;let v;if(U3t(p))v=this.renderTreeData(p,e,i,m);else if(Vxe(p))j3t(h,m)?v=this.renderProgressMessage(p.progressMessage,m===h.length-1):v=null;else if(d3e(p))v=this.renderProgressTask(p.task,!p.isSettled,e,i);else if($3t(p))v=this.renderCommandButton(e,p);else if(G3t(p))v=this.renderTextEdit(e,p,i);else if(q3t(p))v=this.renderConfirmation(e,p,i);else if(z3t(p))v=this.renderNotification("warning",p.content);else if(!f&&d[m]){const{value:b}=d[m],C=h[m],y="originalMarkdown"in C?C.originalMarkdown:void 0,S=new Xt(b,y);v=this.renderMarkdown(S,e,i,!0),f=!0}if(v===void 0)return;l[m]=p;const w=i.value.children[m];w?v===null?i.value.replaceChild(Pl("span.placeholder-for-deleted-thing"),w):i.value.replaceChild(v.element,w):v&&i.value.appendChild(v.element),v&&o.add(v)})}}}const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,s||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),a}renderTreeData(e,t,i,s){const o=new Z,r=o.add(this._treePool.get()),a=r.object;if(o.add(a.onDidOpen(c=>{c.element&&!("children"in c.element)&&this.openerService.open(c.element.uri)})),o.add(a.onDidChangeCollapseState(()=>{this.updateItemHeight(i)})),o.add(a.onContextMenu(c=>{c.browserEvent.preventDefault(),c.browserEvent.stopPropagation()})),a.setInput(e).then(()=>{r.isStale()||(a.layout(),this.updateItemHeight(i))}),As(t)){const c={treeDataId:e.uri.toString(),treeIndex:s,focus(){a.domFocus()}};o.add(a.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(t.id,c.treeIndex)}));const l=this.fileTreesByResponseId.get(t.id)??[];l.push(c),this.fileTreesByResponseId.set(t.id,Tc(l,d=>d.treeDataId)),o.add(Ee(()=>this.fileTreesByResponseId.set(t.id,l.filter(d=>d.treeDataId!==e.uri.toString()))))}return{element:a.getHTMLElement().parentElement,dispose:()=>{o.dispose()}}}renderContentReferencesIfNeeded(e,t,i){if(As(e)&&this._usedReferencesEnabled&&e.contentReferences.length){Oh(t.referencesListContainer);const s=this.renderContentReferencesListData(null,e.contentReferences,e,t);t.referencesListContainer.firstChild?t.referencesListContainer.replaceChild(s.element,t.referencesListContainer.firstChild):t.referencesListContainer.appendChild(s.element),i.add(s)}else Jl(t.referencesListContainer)}renderContentReferencesListData(e,t,i,s){const o=new Z,r=e?.content.value??(t.length>1?g(zm,2,"Used {0} references",t.length):g(zm,3,"Used {0} reference",1)),a=Pl(".chat-used-context-icon"),c=w=>w.usedReferencesExpanded?Ce.chevronDown:Ce.chevronRight;a.classList.add(...$e.asClassNameArray(c(i)));const l=Pl(".chat-used-context-label",void 0),d=o.add(new Tu(l,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0})),h=Pl(".chat-used-context",void 0,l);d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),o.add(d.onDidClick(()=>{a.classList.remove(...$e.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...$e.asClassNameArray(c(i))),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this.updateItemHeight(s),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const f=o.add(this._contentReferencesListPool.get()).object;h.appendChild(f.getHTMLElement().parentElement),o.add(f.onDidOpen(w=>{if(w.element&&"reference"in w.element){const b="variableName"in w.element.reference?w.element.reference.value:w.element.reference,C=P.isUri(b)?b:b?.uri;C&&this.openerService.open(C,{fromUserGesture:!0,editorOptions:{...w.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),o.add(f.onContextMenu(w=>{w.browserEvent.preventDefault(),w.browserEvent.stopPropagation()}));const v=Math.min(t.length,6)*22;return f.layout(v),f.getHTMLElement().style.height=`${v}px`,f.splice(0,f.length,t),{element:h,dispose:()=>{o.dispose()}}}updateAriaLabel(e,t,i){e.ariaLabel=i?g(zm,4,"{0}, expanded",t):g(zm,5,"{0}, collapsed",t)}renderProgressTask(e,t,i,s){if(As(i)){if(e.progress.length){const o=this.renderContentReferencesListData(e,e.progress,i,s),r=we(".chat-progress-task");return r.appendChild(o.element),{element:r,dispose:o.dispose}}return this.renderProgressMessage(e,t)}}renderProgressMessage(e,t){t&&sa(e.content.value);const i=t?$e.modify(Ce.loading,"spin").id:Ce.check.id,s=new Xt(`$(${i}) ${e.content.value}`,{supportThemeIcons:!0}),o=this.renderer.render(s);return o.element.classList.add("progress-step"),o}renderCommandButton(e,t){const i=Pl(".chat-command-button"),s=new Z,o=!As(e)||!e.isStale,r=o?t.command.tooltip:g(zm,6,"Button not available in restored chat"),a=s.add(new Tu(i,{...yQ,supportIcons:!0,title:r}));return a.label=t.command.title,a.enabled=o,s.add(a.onDidClick(()=>this.commandService.executeCommand(t.command.id,...t.command.arguments??[]))),{dispose(){s.dispose()},element:i}}renderNotification(e,t){const i=Pl(".chat-notification-widget");let s,o;switch(e){case"warning":s=Ce.warning,o=".chat-warning-codicon";break;case"error":s=Ce.error,o=".chat-error-codicon";break;case"info":s=Ce.info,o=".chat-info-codicon";break}i.appendChild(Pl(o,void 0,OS(s)));const r=this.renderer.render(t);return i.appendChild(r.element),{element:i,dispose(){r.dispose()}}}renderConfirmation(e,t,i){const s=new Z,o=s.add(this.instantiationService.createInstance(ixe,t.title,t.message,[{label:g(zm,7,"Accept"),data:t.data},{label:g(zm,8,"Dismiss"),data:t.data,isSecondary:!0}]));return o.setShowButtons(!t.isUsed),s.add(o.onDidClick(async r=>{if(As(e)){const a=`${r.label}: "${t.title}"`,c=r.isSecondary?{rejectedConfirmationData:[r.data]}:{acceptedConfirmationData:[r.data]};c.agentId=e.agent?.id,await this.chatService.sendRequest(e.sessionId,a,c)&&(t.isUsed=!0,o.setShowButtons(!1),this.updateItemHeight(i))}})),{element:o.domNode,dispose(){s.dispose()}}}renderTextEdit(e,t,i){if(this.rendererOptions.renderTextEditsAsSummary?.(t.uri))return As(e)&&e.response.value.every(l=>l.kind==="textEditGroup")?{element:Pl(".interactive-edits-summary",void 0,e.isComplete?g(zm,10,"Made changes."):g(zm,9,"Making changes...")),dispose(){}}:void 0;const s=new Z,o=new ai;let r=!1;s.add(Ee(()=>{r=!0,o.dispose(!0)}));const a=this._diffEditorPool.get();s.add(a.object.onDidChangeContentHeight(()=>{a.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)}));const c={element:e,edit:t,diffData:(async()=>{const l=await this.textModelService.createModelReference(t.uri);if(r){l.dispose();return}s.add(l);const d=l.object.textEditorModel;let h="";if(t.state)h=t.state.sha1;else{const m=new tV;m.canComputeSHA1(d)&&(h=m.computeSHA1(d),t.state={sha1:h,applied:0})}const u=this.modelService.createModel(fQ(d.createSnapshot()),{languageId:d.getLanguageId(),onDidChange:T.None},P.from({scheme:_e.vscodeChatCodeBlock,path:d.uri.path,query:Dr()}),!1),f=await this.textModelService.createModelReference(u.uri);s.add(f);const p=[];if(As(e)){const m=this.chatService.getSession(e.sessionId);for(const v of m.getRequests())if(v.response){for(const w of v.response.response.value)if(!(w.kind!=="textEditGroup"||w.state?.applied||!_n(w.uri,t.uri)))for(const b of w.edits){const C=b.map(nMe.asEditOperation);p.push(C)}if(v.response===e.model)break}}for(const m of p)u.pushEditOperations(null,m,()=>null);return{modified:u,original:d,originalSha1:h}})()};return a.object.render(c,this._currentLayoutWidth,o.token),{element:a.object.element,dispose(){s.dispose(),a.dispose()}}}renderMarkdown(e,t,i,s=!1,o=0){const r=new Z,a=[],c=[];let l=o;const d=this.renderer.render(e,{fillInIncompleteTokens:s,codeBlockRendererSync:(h,u)=>{const f=l++;let p,m,v;if(Ba(h,e5t))try{const C=t5t(u);m=C.range&&O.lift(C.range),p=this.textModelService.createModelReference(C.uri).then(y=>y.object)}catch{return Pl("div")}else{if(!ip(t)&&!As(t))return console.error("Trying to render code block in welcome",t.id,f),Pl("div");const C=As(t)||ip(t)?t.sessionId:"",y=this.codeBlockModelCollection.getOrCreate(C,t,f);v=y.vulns,p=y.model}const w=As(t)&&t.errorDetails?.responseIsFiltered,b=this.renderCodeBlock({languageId:h,textModel:p,codeBlockIndex:f,element:t,range:m,hideToolbar:w,parentContextKeyService:i.contextKeyService,vulns:v},u);if(r.add(b.object.onDidChangeContentHeight(()=>{b.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),As(t)){const C={codeBlockIndex:f,element:t,focus(){b.object.focus()}};if(c.push(C),b.object.uri){const y=b.object.uri;this.codeBlocksByEditorUri.set(y,C),r.add(Ee(()=>this.codeBlocksByEditorUri.delete(y)))}}return a.push(b),b.object.element},asyncRenderCallback:()=>this.updateItemHeight(i)});return As(t)&&(this.codeBlocksByResponseId.set(t.id,c),r.add(Ee(()=>this.codeBlocksByResponseId.delete(t.id)))),r.add(this.markdownDecorationsRenderer.walkTreeAndAnnotateReferenceLinks(d.element)),a.reverse().forEach(h=>r.add(h)),{codeBlockCount:l-o,element:d.element,dispose(){d.dispose(),r.dispose()}}}renderCodeBlock(e,t){const i=this._editorPool.get(),s=i.object;return As(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),s.render(e,this._currentLayoutWidth,this.rendererOptions.editableCodeBlock),i}getDataForProgressiveRender(e,t,i){const s=this.getProgressiveRenderRate(e),o=i.lastRenderTime===0?1:i.renderedWordCount+Math.floor((Date.now()-i.lastRenderTime)/1e3*s);if(o!==i.renderedWordCount)return{...qFe(t.value,o),rate:s}}disposeElement(e,t,i){i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},Nxe=vP,vP.ID="item",vP);fne=Nxe=D([_(6,be),_(7,Re),_(8,Ze),_(9,fr),_(10,Pe),_(11,pn),_(12,ji),_(13,Rn),_(14,Ai),_(15,el),_(16,Rw)],fne);let Fxe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=ip(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return fne.ID}hasDynamicHeight(e){return!0}};Fxe=D([_(1,Ze)],Fxe);let Oxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(EEe,e,Te.ChatCodeBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Oxe=D([_(3,be)],Oxe);let Bxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(DEe,e,Te.ChatCompareBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Bxe=D([_(3,be)],Bxe);let Wxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=s,this._pool=this._register(new Bhe(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".interactive-response-progress-tree");return this._register(sOe(t,this.themeService)),this.instantiationService.createInstance(Fee,"ChatListRenderer",t,new Uxe,new B3t,[new W3t(e,this.configService.getValue("explorer.decorations"))],new H3t,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:s=>s.uri.toString()},accessibilityProvider:{getAriaLabel:s=>s.label,getWidgetAriaLabel:()=>g(zm,11,"File Tree")},alwaysConsumeMouseWheel:!1})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Wxe=D([_(1,be),_(2,Re),_(3,pn)],Wxe);let Hxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.themeService=i,this._pool=this._register(new Bhe(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".chat-used-context-list");return this._register(sOe(t,this.themeService)),this.instantiationService.createInstance(qbe,"ChatListRenderer",t,new F3t,[this.instantiationService.createInstance(pne,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:s=>{if(s.kind==="warning")return s.content.value;const o=s.reference;return"variableName"in o?o.variableName:P.isUri(o)?yr(o.path):yr(o.uri.path)},getWidgetAriaLabel:()=>g(zm,12,"Used References")},dnd:{getDragURI:s=>{if(s.kind==="warning")return null;const{reference:o}=s;return"variableName"in o?null:P.isUri(o)?o.toString():o.uri.toString()},dispose:()=>{},onDragOver:()=>!1,drop:()=>{}}})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Hxe=D([_(1,be),_(2,pn)],Hxe);class F3t{getHeight(e){return 22}getTemplateId(e){return pne.TEMPLATE_ID}}var wP;let pne=(wP=class{constructor(e,t,i){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.templateId=Pxe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return $e.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===sf.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,s){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:Ce.warning});return}const o=e.reference,r=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in o)if(o.value){const a=P.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:Mx(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r})}else{const a=this.chatVariablesService.getVariable(o.variableName);i.label.setLabel(`#${o.variableName}`,void 0,{title:a?.description})}else{const a="uri"in o?o.uri:o;L9(a,_e.mailto,_e.http,_e.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??Ce.globe}):i.label.setFile(a,{fileKind:Lc.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0})}}disposeTemplate(e){e.templateDisposables.dispose()}},Pxe=wP,wP.TEMPLATE_ID="contentReferencesListRenderer",wP);pne=Pxe=D([_(1,pn),_(2,Mz)],pne);class Bhe extends ${get inUse(){return this._inUse}constructor(e){super(),this._itemFactory=e,this.pool=[],this._inUse=new Set}get(){if(this.pool.length>0){const t=this.pool.pop();return this._inUse.add(t),t}const e=this._register(this._itemFactory());return this._inUse.add(e),e}release(e){this._inUse.delete(e),this.pool.push(e)}}class O3t extends eC{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}const Qce=class Qce{getHeight(e){return Qce.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Qce.ITEM_HEIGHT=22;let Uxe=Qce;class B3t{isIncompressible(e){return!e.children}}class W3t{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,s){i.label.element.style.display="flex";const o=e.element.elements.map(r=>r.label);i.label.setResource({resource:e.element.elements[0].uri,name:o},{title:e.element.elements[0].label,fileKind:e.children?Lc.FOLDER:Lc.FILE,extraClasses:["explorer-item"],fileDecorations:this.decorations})}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}renderElement(e,t,i,s){i.label.element.style.display="flex",!e.children.length&&e.element.type!==an.Directory?i.label.setFile(e.element.uri,{fileKind:Lc.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:Lc.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class H3t{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}function U3t(n){return"label"in n}function l3e(n){return typeof n=="string"?{value:n}:n}function V3t(n){return n&&"kind"in n&&n.kind==="progressMessage"}function d3e(n){return n&&"isSettled"in n}function z3t(n){return n&&"kind"in n&&n.kind==="warning"}function Vxe(n){return n&&"isAtEndOfResponse"in n}function $3t(n){return n&&"kind"in n&&n.kind==="command"}function G3t(n){return n&&"kind"in n&&n.kind==="textEditGroup"}function q3t(n){return n&&"kind"in n&&n.kind==="confirmation"}function Q3t(n){return n&&"renderedWordCount"in n}function JK(n,e){return n.slice(e).every(V3t)}function j3t(n,e){return n.slice(e).every(Vxe)}var gX,q0;let zxe=(q0=class extends ${get configuration(){return this._config}constructor(e,t,i,s,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=s,this.configurationService=o,this.themeService=r,this.viewDescriptorService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.themeService.onDidColorThemeChange(c=>this.update())),this._register(this.viewDescriptorService.onDidChangeLocation(c=>{c.views.some(l=>l.id===e)&&this.update()})),this._register(this.configurationService.onDidChangeConfiguration(c=>{gX.relevantSettingIds.some(l=>c.affectsConfiguration(l))&&this.update()})),this.update()}update(){const e=this.configurationService.getValue("editor"),t=this.configurationService.getValue("chat")?.editor,i=this.configurationService.getValue("editor.accessibilitySupport");this._config={foreground:this.themeService.getColorTheme().getColor(this.foreground),inputEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.inputEditorBackgroundColor),accessibilitySupport:i},resultEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),fontSize:t.fontSize,fontFamily:t.fontFamily==="default"?e.fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:t.lineHeight?t.lineHeight:gX.lineHeightEm*t.fontSize,bracketPairColorization:{enabled:this.configurationService.getValue("editor.bracketPairColorization.enabled"),independentColorPoolPerBracketType:this.configurationService.getValue("editor.bracketPairColorization.independentColorPoolPerBracketType")},wordWrap:t.wordWrap,fontLigatures:e.fontLigatures}},this._onDidChange.fire()}},gX=q0,q0.lineHeightEm=1.4,q0.relevantSettingIds=["chat.editor.lineHeight","chat.editor.fontSize","chat.editor.fontFamily","chat.editor.fontWeight","chat.editor.wordWrap","editor.cursorBlinking","editor.fontLigatures","editor.accessibilitySupport","editor.bracketPairColorization.enabled","editor.bracketPairColorization.independentColorPoolPerBracketType"],q0);zxe=gX=D([_(4,Re),_(5,pn),_(6,z_)],zxe);const K3t=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,Y3t=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,J3t=/\/([\w_\-]+)(?=(\s|$|\b))/i;let mne=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=lc.Panel,s){const o=[],r=this.variableService.getDynamicVariables(e);let a=1,c=1;for(let h=0;h1&&a?.selectedAgent?a.selectedAgent:f[0];if(!p||!p.locations.includes(r)||o.some(b=>b instanceof tp)||o.some(b=>b instanceof kb&&b.text.trim()!==""||!(b instanceof tp)))return;const v=o.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new tp(h,u,p)}tryToParseVariable(e,t,i,s){const o=e.match(Y3t);if(!o)return;const[r,a]=o,c=o[2]??"",l=new hi(t,t+r.length),d=new O(i.lineNumber,i.column,i.lineNumber,i.column+r.length),h=s.find(p=>p instanceof tp),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new m6(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,s,o){const r=e.match(J3t);if(!r||o.some(u=>u instanceof UV))return;const[a,c]=r,l=new hi(i,i+a.length),d=new O(s.lineNumber,s.column,s.lineNumber,s.column+a.length),h=o.find(u=>u instanceof tp);if(h){if(o.some(v=>v instanceof kb&&v.text.trim()!==""||!(v instanceof tp)&&!(v instanceof kb)))return;const f=o.at(-1)?.range.endExclusive??0;if(t.slice(f,i).trim()!=="")return;const m=h.agent.slashCommands.find(v=>v.name===c);if(m)return new HV(l,d,m)}else{const f=this.slashCommandService.getCommands().find(p=>p.command===c);if(f)return new UV(l,d,f)}}tryToParseDynamicVariable(e,t,i,s){const o=s.find(r=>r.range.startLineNumber===i.lineNumber&&r.range.startColumn===i.column);if(o){const r=o.range.endColumn-o.range.startColumn,a=e.substring(0,r),c=new hi(t,t+r);return new VV(c,o.range,a,o.id,o.modelDescription,o.data)}}};mne=D([_(0,yp),_(1,Mz),_(2,kPe)],mne);let $xe=class extends ${constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new wi}dispose(){super.dispose(),this.clear()}get(e,t,i){const s=this.getUri(e,t,i),o=this._models.get(s);if(o)return{model:o.model.then(r=>r.object),vulns:o.vulns}}getOrCreate(e,t,i){const s=this.get(e,t,i);if(s)return s;const o=this.getUri(e,t,i),r=this.textModelService.createModelReference(o);return this._models.set(o,{model:r,vulns:[]}),{model:r.then(a=>a.object),vulns:[]}}clear(){this._models.forEach(async e=>(await e.model).dispose()),this._models.clear()}async update(e,t,i,s){const o=this.getOrCreate(e,t,i),r=Azt(s.text),a=X3t(r.newText,s.languageId);this.setVulns(e,t,i,r.vulnerabilities);const c=(await o.model).textEditorModel;if(s.languageId){const d=this.languageService.getLanguageIdByLanguageName(s.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(xo.LF);if(a!==l)if(a.startsWith(l)){const d=a.slice(l.length),h=c.getLineCount(),u=c.getLineMaxColumn(h);c.applyEdits([{range:new O(h,u,h,u),text:d}])}else c.setValue(a)}setVulns(e,t,i,s){const o=this.getUri(e,t,i),r=this._models.get(o);r&&(r.vulns=s)}getUri(e,t,i){const s=this.getUriMetaData(t);return P.from({scheme:_e.vscodeChatCodeBlock,authority:e,path:`/${t.id}/${i}`,fragment:s?JSON.stringify(s):void 0})}getUriMetaData(e){if(As(e))return{references:e.contentReferences.map(t=>{const i="variableName"in t.reference?t.reference.value:t.reference;if(i)return P.isUri(i)?{uri:i.toJSON()}:{uri:i.uri.toJSON(),range:i.range}})}}};$xe=D([_(0,Di),_(1,Rn)],$xe);function X3t(n,e){return e==="php"&&!n.trim().startsWith("<")?`e instanceof tp))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(),this.location=e,this.viewContext=t,this.viewOptions=i,this.styles=s,this.contextKeyService=r,this.instantiationService=a,this.chatService=c,this.chatAgentService=l,this.contextMenuService=h,this.chatAccessibilityService=u,this.logService=f,this.themeService=p,this.chatSlashCommandService=m,this._onDidSubmitAgent=this._register(new I),this.onDidSubmitAgent=this._onDidSubmitAgent.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidChangeViewModel=this._register(new I),this.onDidChangeViewModel=this._onDidChangeViewModel.event,this._onDidScroll=this._register(new I),this.onDidScroll=this._onDidScroll.event,this._onDidClear=this._register(new I),this.onDidClear=this._onDidClear.event,this._onDidAcceptInput=this._register(new I),this.onDidAcceptInput=this._onDidAcceptInput.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidChangeContentHeight=new I,this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.contribs=[],this.visibleChangeCount=0,this._visible=!1,this.previousTreeScrollHeight=0,this.viewModelDisposables=this._register(new Z),JPt.bindTo(r).set(!0),ZPt.bindTo(r).set(e),eFt.bindTo(r).set("resource"in t),this.agentInInput=gtt.bindTo(r),this.requestInProgress=j7.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance($xe)),this._register(o.registerCodeEditorOpenHandler(async(v,w,b)=>{let C=v.resource;if(Rx(C,_e.vscodeCopilotBackingChatCodeBlock)&&(C=C.with({scheme:_e.vscodeChatCodeBlock})),C.scheme!==_e.vscodeChatCodeBlock)return null;const y=C.path.split("/").at(1);if(!y)return null;const S=this.viewModel?.getItems().find(M=>M.id===y);if(!S)return null;this.reveal(S),await Ta(0);for(const M of this.renderer.editorsInUse()??[])if(Fn.isEqual(M.uri,C,!0)){const k=M.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.startLineNumber??v.options.selection.endLineNumber,endColumn:v.options.selection.startColumn??v.options.selection.endColumn}),k}return null}))}set lastSelectedAgent(e){this.parsedChatRequest=void 0,this._lastSelectedAgent=e,this._onDidChangeParsedInput.fire()}get lastSelectedAgent(){return this._lastSelectedAgent}get supportsFileReferences(){return!!this.viewOptions.supportsFileReferences}get input(){return this.inputPart}get inputEditor(){return this.inputPart.inputEditor}get inputUri(){return this.inputPart.inputUri}get contentHeight(){return this.inputPart.contentHeight+this.tree.contentHeight}render(e){const t="viewId"in this.viewContext?this.viewContext.viewId:void 0;this.editorOptions=this._register(this.instantiationService.createInstance(zxe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,s=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=he(e,Mpe(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:s,renderStyle:o}),this.listContainer=he(this.container,Mpe(".interactive-list"))):(this.listContainer=he(this.container,Mpe(".interactive-list")),this.createInput(this.container,{renderFollowups:s,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),iB(this.tree)),this.contribs=Gxe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Ma(a));return}}).filter(yl)}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}moveFocus(e,t){if(!As(e))return;const i=this.viewModel?.getItems();if(!i)return;const s=i.filter(a=>As(a)),o=s.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;r<0||r>s.length-1||this.focus(s[r])}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(s=>({element:s,collapsed:!1,collapsible:!1}));this.tree.setChildren(null,t,{diffIdentityProvider:{getId:s=>(As(s)||ip(s)?s.dataId:s.id)+(XW(s)&&this.viewModel?`_${Vf[this.viewModel.initState]}`:"")+`${ip(s)||XW(s)}${As(s)&&s.renderData?`_${this.visibleChangeCount}`:""}`+(As(s)?`_${s.contentReferences.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&As(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&XW(i)?this.renderFollowups(i.sampleQuestions):this.renderFollowups(void 0)}}async renderFollowups(e,t){this.inputPart.renderFollowups(e,t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}setVisible(e){const t=this._visible;this._visible=e,this.visibleChangeCount++,this.renderer.setVisible(e),this.input.setVisible(e),e?this._register(PS(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this.instantiationService.createChild(new Dl([Pe,this.contextKeyService]))),s=i.createInstance(Fxe,this.viewOptions.defaultElementHeight??200),o={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},r=document.createElement("div");r.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(r),this.renderer=this._register(i.createInstance(fne,this.editorOptions,this.location,t,o,this._codeBlockModelCollection,r)),this._register(this.renderer.onDidClickFollowup(a=>{this.acceptInput(a.message)})),this._register(this.renderer.onDidClickRerunWithAgentOrCommandDetection(a=>{const c=this.chatService.getSession(a.sessionId)?.getRequests().find(l=>l.id===a.requestId);c&&this.chatService.resendRequest(c,{noCommandDetection:!0,attempt:c.attempt,location:this.location}).catch(l=>this.logService.error("FAILED to rerun request",l))})),this.tree=i.createInstance(L7,"Chat",e,s,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(NEe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>ip(a)?a.message:As(a)?a.response.value:""},setRowLineHeight:!1,filter:this.viewOptions.filter?{filter:this.viewOptions.filter.bind(this.viewOptions)}:void 0,overrideStyles:{listFocusBackground:this.styles.listBackground,listInactiveFocusBackground:this.styles.listBackground,listActiveSelectionBackground:this.styles.listBackground,listFocusAndSelectionBackground:this.styles.listBackground,listInactiveSelectionBackground:this.styles.listBackground,listHoverBackground:this.styles.listBackground,listBackground:this.styles.listBackground,listFocusForeground:this.styles.listForeground,listHoverForeground:this.styles.listForeground,listInactiveFocusForeground:this.styles.listForeground,listInactiveSelectionForeground:this.styles.listForeground,listActiveSelectionForeground:this.styles.listForeground,listFocusAndSelectionForeground:this.styles.listForeground}}),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidChangeContentHeight(()=>{this.onDidChangeTreeContentHeight()})),this._register(this.renderer.onDidChangeItemHeight(a=>{this.tree.updateElementHeight(a.element,a.height)})),this._register(this.tree.onDidFocus(()=>{this._onDidFocus.fire()})),this._register(this.tree.onDidScroll(()=>{this._onDidScroll.fire()}))}onContextMenu(e){e.browserEvent.preventDefault(),e.browserEvent.stopPropagation();const t=e.element,i=this.contextKeyService.createOverlay([[htt.key,As(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:Te.ChatContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:i,getAnchor:()=>e.anchor,getActionsContext:()=>t})}onDidChangeTreeContentHeight(){this.tree.scrollHeight!==this.previousTreeScrollHeight&&this.tree.scrollTop+this.tree.renderHeight>=this.previousTreeScrollHeight-2&&xd(gt(this.listContainer),()=>{iB(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(b6,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle,menus:{executeToolbar:Te.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(s=>{s.setInputState&&typeof i=="object"&&i?.[s.id]&&s.setInputState(i[s.id])})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidDeleteContext(i=>this._onDidDeleteContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let s="";if(i.followup.agentId&&i.followup.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const o=this.chatAgentService.getAgent(i.followup.agentId);if(!o)return;this.lastSelectedAgent=o,s=`${$z}${o.name} `,i.followup.subCommand&&(s+=`${O1}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(s=`${O1}${i.followup.subCommand} `);s+=i.followup.message,this.acceptInput(s),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,result:i.response.result,action:{kind:"followUp",followup:i.followup}})})),this._register(this.inputPart.onDidChangeHeight(()=>{this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width),this._onDidChangeContentHeight.fire()})),this._register(this.inputEditor.onDidChangeModelContent(()=>this.parsedChatRequest=void 0)),this._register(this.chatAgentService.onDidChangeAgents(()=>this.parsedChatRequest=void 0))}onDidStyleChange(){this.container.style.setProperty("--vscode-interactive-result-editor-background-color",this.editorOptions.configuration.resultEditor.backgroundColor?.toString()??""),this.container.style.setProperty("--vscode-interactive-session-foreground",this.editorOptions.configuration.foreground?.toString()??""),this.container.style.setProperty("--vscode-chat-list-background",this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString()??"")}setModel(e,t){if(!this.container)throw new Error("Call render() before setModel()");this._codeBlockModelCollection.clear(),this.container.setAttribute("data-session-id",e.sessionId),this.viewModel=this.instantiationService.createInstance(_Ee,e,this._codeBlockModelCollection),this.viewModelDisposables.add(T.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(s=>s?.kind==="addRequest")&&this.visible&&(iB(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.setState(t.inputValue),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.tree&&(this.onDidChangeItems(),iB(this.tree))}getFocus(){return this.tree.getFocus()[0]??void 0}reveal(e){this.tree.reveal(e)}focus(e){const i=this.tree.getNode(null).children.find(s=>s.element?.id===e.id);i&&(this.tree.setFocus([i.element]),this.tree.domFocus())}refilter(){this.tree.refilter()}setInputPlaceholder(e){this.viewModel?.setInputPlaceholder(e)}resetInputPlaceholder(){this.viewModel?.resetInputPlaceholder()}setInput(e=""){this.inputPart.setValue(e)}getInput(){return this.inputPart.inputEditor.getValue()}async acceptInput(e){return this._acceptInput(e?{query:e}:void 0)}async acceptInputWithPrefix(e){this._acceptInput({prefix:e})}collectInputState(){const e={};return this.contribs.forEach(t=>{t.getInputState&&(e[t.id]=t.getInputState())}),e}async _acceptInput(e){if(this.viewModel){this._onDidAcceptInput.fire();const t=this.getInput(),i=this.chatAccessibilityService.acceptRequest(),s=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,s,{location:this.location,parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r){this.inputPart.attachedContext.clear();const a=this.collectInputState();return this.inputPart.acceptInput(o?s:void 0,o?a:void 0),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),r.responseCompletePromise.then(()=>{const c=this.viewModel?.getItems().filter(As),l=c?.[c.length-1];this.chatAccessibilityService.acceptResponse(l,i)}),r.responseCreatedPromise}}}setContext(e,...t){e&&this.inputPart.attachedContext.clear(),this.inputPart.attachContext(...t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}getCodeBlockInfosForResponse(e){return this.renderer.getCodeBlockInfosForResponse(e)}getCodeBlockInfoForEditor(e){return this.renderer.getCodeBlockInfoForEditor(e)}getFileTreeInfosForResponse(e){return this.renderer.getFileTreeInfosForResponse(e)}getLastFocusedFileTreeForResponse(e){return this.renderer.getLastFocusedFileTreeForResponse(e)}focusLastMessage(){if(!this.viewModel)return;const e=this.tree.getNode(null).children,t=e[e.length-1];t&&(this.tree.setFocus([t.element]),this.tree.domFocus())}layout(e,t){t=Math.min(t,850),this.bodyDimension=new Tn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,s=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,o=e-i;this.tree.layout(o,t),this.tree.getHTMLElement().style.height=`${o}px`,this.renderer.layout(t),s&&iB(this.tree),this.listContainer.style.height=`${e-i}px`,this._onDidChangeHeight.fire(e)}setDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0},this._register(this.renderer.onDidChangeItemHeight(()=>this.layoutDynamicChatTreeItemMode()));const i=this._register(new Dn);this._register(this.tree.onDidScroll(s=>{this._dynamicMessageLayoutData?.enabled&&(i.value=xd(gt(this.listContainer),()=>{if(!s.scrollTopChanged||s.heightChanged||s.scrollHeightChanged)return;const o=s.height,r=s.scrollHeight-o-s.scrollTop;if(r===0)return;const a=this._dynamicMessageLayoutData?.maxHeight??t,c=this.bodyDimension?.width??this.container.offsetWidth;this.inputPart.layout(a,c);const l=this.inputPart.inputPartHeight,d=Math.min(o+r,a-l);this.layout(d+l,c)}))}))}updateDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0};let i=!1,s=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:s.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&iB(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},Gxe=bP,bP.CONTRIBS=[],bP);A6=Gxe=D([_(4,jt),_(5,Pe),_(6,be),_(7,Rw),_(8,yp),_(9,lL),_(10,Vr),_(11,BZe),_(12,Ze),_(13,pn),_(14,kPe)],A6);var fX;const qxe="vs/workbench/contrib/inlineChat/browser/inlineChatWidget";let Qxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=s,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=di("div.inline-chat@root",[di("div.chat-widget@chatWidget"),di("div.progress@progress"),di("div.followUps.hidden@followUps"),di("div.previewDiff.hidden@previewDiff"),di("div.accessibleViewer@accessibleViewer"),di("div.status@status",[di("div.label.info.hidden@infoLabel"),di("div.actions.hidden@statusToolbar"),di("div.label.status.hidden@statusLabel"),di("div.actions.hidden@feedbackToolbar")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=T.filter(this._onDidChangeHeight.event,S=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this._progressBar=new y7(this._elements.progress),this._store.add(this._progressBar);let u=!1;this.scopedContextKeyService=this._store.add(s.createScoped(this._elements.chatWidget));const f=i.createChild(new Dl([Pe,this.scopedContextKeyService]),this._store);this._chatWidget=f.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!0,editorOverflowWidgetsDomNode:t.editorOverflowWidgetsDomNode,rendererOptions:t.rendererOptions,menus:{executeToolbar:t.inputMenuId,inputSideToolbar:t.widgetMenuId,telemetrySource:t.telemetrySource},filter:S=>XW(S)?!1:ip(S)?u:!0},{listForeground:Nc,listBackground:bEe,inputEditorBackground:SE,resultEditorBackground:us}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(tde(y5t),Ye(bEe)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const p=this._store.add(new Dn);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{const S=this._chatWidget.viewModel;if(!S){u=!1,p.clear();return}const M=()=>{let k=0;for(const N of S.getItems())if(ip(N)&&++k>=2)break;const F=k>=2;F!==u&&(u=F,this._chatWidget.refilter())};p.value=S.onDidChange(M)}));const m=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{m.clear();const S=this._chatWidget.viewModel;S&&m.add(S.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=Tzt.bindTo(this._contextKeyService);const v=this._store.add(Dd(this.domNode));this._store.add(v.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(v.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=Lzt.bindTo(s),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const w=t.statusMenuId instanceof Te?t.statusMenuId:t.statusMenuId.menu,b=t.statusMenuId instanceof Te?void 0:t.statusMenuId.options,C=this._instantiationService.createInstance(MEe,this._elements.statusToolbar,w,b);this._store.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(C);const y={hiddenItemStrategy:wS.NoHide,toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}};if(t.feedbackMenuId){const S=this._instantiationService.createInstance(nC,this._elements.feedbackToolbar,t.feedbackMenuId,{...y,hiddenItemStrategy:wS.Ignore});this._store.add(S.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(S)}this._store.add(this._configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.followUps.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupUpdatableHover(va("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(S=>{S.sessionId===this._chatWidget.viewModel?.model.sessionId&&S.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(Vie,void 0,lc.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(ua.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=Z3t;if(this._configurationService.getValue(ua.InlineChat)){const t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();e=t?g(qxe,0,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(qxe,1,"Inline Chat Input, Run the Inline Chat Accessibility Help command for more information.")}this._chatWidget.inputEditor.updateOptions({ariaLabel:e})}}dispose(){this._store.dispose()}get domNode(){return this._elements.root}get chatWidget(){return this._chatWidget}saveState(){this._chatWidget.saveState()}layout(e){this._isLayouting=!0;try{this._doLayout(e)}finally{this._isLayouting=!1}}_doLayout(e){const t=this._getExtraHeight(),i=Zf(this._elements.progress),s=Zf(this._elements.followUps),o=Zf(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._elements.progress.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-s-o-t,e.width)}get contentHeight(){const e={followUpsHeight:Zf(this._elements.followUps),chatWidgetContentHeight:this._chatWidget.contentHeight,progressHeight:Zf(this._elements.progress),statusHeight:Zf(this._elements.status),extraHeight:this._getExtraHeight()};return e.progressHeight+e.chatWidgetContentHeight+e.followUpsHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(As(i)&&i.response.value.some(s=>s.kind==="textEditGroup"&&!s.state?.applied)){e=270;break}let t=this.contentHeight;return t-=this._chatWidget.contentHeight,t+=Math.min(this._chatWidget.input.contentHeight+e,this._chatWidget.contentHeight),t}_getExtraHeight(){return 26}updateProgress(e){e?(this._progressBar.show(),this._progressBar.infinite()):(this._progressBar.stop(),this._progressBar.hide())}get value(){return this._chatWidget.getInput()}set value(e){this._chatWidget.setInput(e)}selectAll(e=!0){let t=1;if(!e){const i=/^(\/\w+)\s*/.exec(this._chatWidget.inputEditor.getModel().getLineContent(1));i&&(t=i[1].length+1)}this._chatWidget.inputEditor.setSelection(new mt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.statusToolbar.classList.toggle("hidden",!e),this._elements.feedbackToolbar.classList.toggle("hidden",!e),this._elements.status.classList.toggle("actions",e),this._elements.infoLabel.classList.toggle("hidden",e),this._onDidChangeHeight.fire()}async getCodeBlockInfo(e){const{viewModel:t}=this._chatWidget;if(t){for(const i of t.getItems())if(As(i))return t.codeBlockModelCollection.get(t.sessionId,i,e)?.model}}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(mo(e))return Mf(e)?.response?.response.asString()}get usesDefaultChatModel(){return this.getChatModel()===this._defaultChatModel}getChatModel(){return this._chatWidget.viewModel?.model??this._defaultChatModel}setChatModel(e){this._chatWidget.setModel(e,{inputValue:void 0})}addToHistory(e){this._chatWidget.viewModel?.model===this._defaultChatModel&&this._chatWidget.input.acceptInput(e)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const s=this._defaultChatModel;if(!e?.message.value){for(const r of s.getRequests())s.removeRequest(r.id);return}const o=s.addRequest({parts:[],text:""},{variables:[]},0);if(s.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){s.completeResponse(o);return}return{cancel:()=>s.cancelRequest(o),complete:()=>s.completeResponse(o),appendContent:r=>{s.acceptResponseProgress(o,{kind:"markdownContent",content:new Xt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=nw(e);_a(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const o=this._elements.statusLabel.innerText,r=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(o,{classes:a,keepMessage:!0,title:r})},t.resetAfter)}const s=nw(e);_a(this._elements.statusLabel,...s),this._elements.statusLabel.className=`label status ${(t.classes??[]).join(" ")}`,this._elements.statusLabel.classList.toggle("hidden",!e),i?this._elements.statusLabel.dataset.state="temp":delete this._elements.statusLabel.dataset.state,t.title?this._elements.statusLabel.dataset.title=t.title:delete this._elements.statusLabel.dataset.title,this._onDidChangeHeight.fire()}reset(){this._chatWidget.saveState(),this.updateChatMessage(void 0),_a(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.statusToolbar.classList.add("hidden"),this._elements.feedbackToolbar.classList.add("hidden"),this.updateInfo(""),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(xl())}};Qxe=D([_(2,be),_(3,Pe),_(4,ti),_(5,Ur),_(6,Re),_(7,Tw),_(8,Rn),_(9,Rw),_(10,el)],Qxe);const Z3t=g(qxe,2,"Inline Chat Input");let jxe=class extends Qxe{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,{...i,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()},r,s,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new Dn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height),super._doLayout(e.with(void 0,t)),this._elements.root.style.height=`${e.height-this._getExtraHeight()}px`}reset(){this._accessibleViewer.clear(),super.reset()}showAccessibleHunk(e,t){this._elements.accessibleViewer.classList.remove("hidden"),this._accessibleViewer.clear(),this._accessibleViewer.value=this._instantiationService.createInstance(Kxe,this._elements.accessibleViewer,e,t,new e$t(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};jxe=D([_(3,Pe),_(4,ti),_(5,be),_(6,Ur),_(7,Re),_(8,Tw),_(9,Rn),_(10,Rw),_(11,el)],jxe);let Kxe=fX=class extends Kk{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,s,o){const r=xi("width",0),a=xi("diff",fX._asMapping(i)),c=Dt(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=s.getModifiedOptions().get(x.lineHeight)*l;super(e,Au(!0),()=>{},Au(!1),r,Au(d),c,s,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(fX._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),s=bi.fromRangeInclusive(t[0]),o=bi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(jxe,e,this.editor,{telemetrySource:"interactiveEditorWidget-toolbar",inputMenuId:Te.ChatExecute,widgetMenuId:Vzt,statusMenuId:{menu:zzt,options:{buttonConfigProvider:a=>new Set([Hzt,Uzt]).has(a.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:a.id===Wzt?{isSecondary:!1}:{isSecondary:!0}}},rendererOptions:{renderTextEditsAsSummary:a=>_n(a,t.getModel()?.uri)&&o.getValue(Mv.Mode)===yS.Live}}),this._disposables.add(this.widget.onDidChangeHeight(()=>{this.position&&this._relayout(this._computeHeight().linesValue)})),this._disposables.add(this.widget),this.create(),this._disposables.add(pe(this.domNode,"click",a=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const r=()=>{!this.position||!this.editor.hasModel()?this._ctxCursorPosition.reset():this.position.lineNumber===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("above"):this.position.lineNumber+1===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("below"):this._ctxCursorPosition.reset()};this._disposables.add(this.editor.onDidChangeCursorPosition(a=>r())),this._disposables.add(this.editor.onDidFocusEditorText(a=>r())),r()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=Math.min(640,this._availableSpaceGivenIndentation(this._indentationWidth));this._dimension=new Tn(t,e),this.widget.layout(this._dimension)}_availableSpaceGivenIndentation(e){const t=this.editor.getLayoutInfo();return t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth+(e??0))}_computeHeight(){const e=this.widget.contentHeight,t=this.editor.getLayoutInfo().height,i=Math.min(e,Math.max(this.widget.minHeight,t*.42));return{linesValue:i/this.editor.getOption(x.lineHeight),pixelsValue:i}}_onWidth(e){this._dimension&&this._doLayout(this._dimension.height)}show(e){Bt(this.container);const t=Gee.capture(this.editor),i=this.editor.getLayoutInfo(),s=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${s}px`;const o=this._computeHeight();if(super.show(e,o.linesValue),this._setWidgetMargins(e),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),e.lineNumber>1)this.editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e.delta(-1)),vt.Immediate);else{const a=this.editor.getTopForLineNumber(e.lineNumber)-o.pixelsValue,c=this.editor.getScrollHeight()-this.editor.getBottomForLineNumber(e.lineNumber),l=this.editor.getScrollTop()-c,d=Math.max(a,l);dt.startLineNumber&&i=i.startLineNumber;r--){const a=t.getLineFirstNonWhitespaceColumn(r);if(a!==0){o=r,s=a;break}}return Math.max(0,this.editor.getOffsetForColumn(o,s))}_setWidgetMargins(e){const t=this._calculateIndentationWidth(e);this._indentationWidth!==t&&(this._indentationWidth=this._availableSpaceGivenIndentation(t)>400?t:0,this.widget.domNode.style.marginLeft=`${this._indentationWidth}px`,this.widget.domNode.style.marginRight=`${this.editor.getLayoutInfo().minimap.minimapWidth}px`)}hide(){this.container.classList.remove("inside-selection"),this._ctxCursorPosition.reset(),this.widget.reset(),this.widget.chatWidget.setVisible(!1),super.hide(),Cu(g(t$t,0,"Closed inline chat widget"))}};Yxe=D([_(2,be),_(3,Pe),_(4,Re)],Yxe);var i$t=".monaco-workbench .inline-chat-content-widget{background-color:var(--vscode-inlineChat-background);border-radius:4px;box-shadow:0 4px 8px var(--vscode-inlineChat-shadow);padding:6px;z-index:50}.monaco-workbench .inline-chat-content-widget .hidden{display:none}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-session{max-width:unset}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part.compact{padding:0}.monaco-workbench .inline-chat-content-widget .message{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:11px;overflow:hidden}.monaco-workbench .inline-chat-content-widget .message>.codicon{font-size:12px;line-height:18px;padding-right:5px}";Ct(i$t,{});let Jxe=class{constructor(e,t,i,s){this._editor=t,this.suppressMouseDown=!1,this.allowEditorOverflow=!0,this._store=new Z,this._domNode=document.createElement("div"),this._inputContainer=document.createElement("div"),this._messageContainer=document.createElement("div"),this._onDidBlur=this._store.add(new I),this.onDidBlur=this._onDidBlur.event,this._visible=!1,this._focusNext=!1,this._defaultChatModel=this._store.add(i.createInstance(Vie,void 0,lc.Editor));const o=i.createChild(new Dl([Pe,this._store.add(s.createScoped(this._domNode))]),this._store);this._widget=o.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode(),renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!1,menus:{telemetrySource:"inlineChat-content"},filter:a=>!1},{listForeground:Nc,listBackground:bEe,inputEditorBackground:SE,resultEditorBackground:us}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.inputEditor.onDidContentSizeChange(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._messageContainer.classList.add("hidden","message"),this._domNode.appendChild(this._messageContainer);const r=Dd(this._domNode);this._store.add(r.onDidBlur(()=>{this._visible&&this._onDidBlur.fire()})),this._store.add(r)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[hs.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight;return this._widget.layout(Math.min(e,t),360),null}afterRender(){this._focusNext&&(this._focusNext=!1,this._widget.focusInput())}get chatWidget(){return this._widget}get isVisible(){return this._visible}get value(){return this._widget.inputEditor.getValue()}show(e){if(!this._visible){this._visible=!0,this._focusNext=!0,this._editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e),vt.Immediate),this._widget.inputEditor.setValue("");const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.session.placeholder??""),this._updateMessage(e.session.message??"")}_updateMessage(e){if(e){const t=nw(e);_a(this._messageContainer,...t)}this._messageContainer.style.display=e?"inherit":"none",this._editor.layoutContentWidget(this)}};Jxe=D([_(2,be),_(3,Pe)],Jxe);let _ne=class extends cC{get capabilities(){let e=Mi.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,s,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=s,this.filesConfigurationService=o,this.textResourceConfigurationService=r,this.customEditorLabelService=a,this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._preferredResource=t||e,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this._preferredResource.scheme&&this.updateLabel()}updateLabel(){this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}setPreferredResource(e){_n(e,this._preferredResource)||(this._preferredResource=e,this.updateLabel())}getName(){return typeof this._name!="string"&&(this._name=this.customEditorLabelService.getName(this._preferredResource)??this.labelService.getUriBasenameLabel(this._preferredResource)),this._name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this._preferredResource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this._preferredResource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this._preferredResource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=jEt(this.resource);let i;const s=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Aft(s)&&(i=s.value*vl.MB),{size:i??t}}};_ne=D([_(2,eo),_(3,ci),_(4,hh),_(5,dl),_(6,aD)],_ne);let Xxe=class extends H1{constructor(e,t,i,s,o){super(i,t,s,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};Xxe=D([_(1,Di),_(2,Ai),_(3,LQ),_(4,Ur)],Xxe);var pX;let Ib=class extends _ne{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=s}save(e,t){return this.resource.scheme!==_e.untitled&&!this.fileService.hasProvider(this.resource)?this.saveAs(e,t):this.doSave(t,!1,e)}saveAs(e,t){return this.doSave(t,!0,e)}async doSave(e,t,i){let s;if(t?s=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):s=await this.textFileService.save(this.resource,e),!!s)return{resource:s}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};Ib=D([_(2,_i),_(3,tr),_(4,eo),_(5,ci),_(6,hh),_(7,dl),_(8,aD)],Ib);var CP;let AM=(CP=class extends Ib{get typeId(){return pX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,void 0,c,a,d,l,h,u,f),this.name=t,this.description=i,this.preferredLanguageId=s,this.preferredContents=o,this.textModelService=r,this.cachedModel=void 0,this.modelReference=void 0}getName(){return this.name||super.getName()}setName(e){this.name!==e&&(this.name=e,this._onDidChangeLabel.fire())}getDescription(){return this.description}setDescription(e){this.description!==e&&(this.description=e,this._onDidChangeLabel.fire())}setLanguageId(e,t){this.setPreferredLanguageId(e),this.cachedModel?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e}setPreferredContents(e){this.preferredContents=e}async resolve(){const e=this.preferredContents,t=this.preferredLanguageId;this.preferredContents=void 0,this.preferredLanguageId=void 0,this.modelReference||(this.modelReference=this.textModelService.createModelReference(this.resource));const i=await this.modelReference,s=i.object;if(!(s instanceof Xxe))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=s,(typeof e=="string"||typeof t=="string")&&s.updateTextEditorModel(typeof e=="string"?hde(e):void 0,t),s}matches(e){return this===e?!0:e instanceof pX?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},pX=CP,CP.ID="workbench.editors.resourceEditorInput",CP);AM=pX=D([_(5,Rn),_(6,tr),_(7,_i),_(8,ci),_(9,eo),_(10,hh),_(11,dl),_(12,aD)],AM);const ec=Il;var mX,yP;let E6=(yP=class extends Ib{get typeId(){return mX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h){super(e.resource,void 0,s,t,i,o,c,d,h),this.model=e,this.environmentService=r,this.pathService=a,this.textModelService=l,this.modelResolve=void 0,this.modelDisposables=this._register(new Z),this.cachedUntitledTextEditorModelReference=void 0,this.registerModelListeners(e),this._register(this.textFileService.untitled.onDidCreate(u=>this.onDidCreateUntitledModel(u)))}registerModelListeners(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelDisposables.add(e.onDidChangeName(()=>this._onDidChangeLabel.fire())),this.modelDisposables.add(e.onDidRevert(()=>this.dispose()))}onDidCreateUntitledModel(e){_n(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Gs.MEDIUM){if(!this.model.hasAssociatedFilePath){const t=this.resource.path;return t!==this.getName()?t:void 0}return super.getDescription(e)}getTitle(e){if(!this.model.hasAssociatedFilePath){const t=this.getName(),i=this.getDescription();return i&&i!==t?`${t} • ${i}`:t}return super.getTitle(e)}isDirty(){return this.model.isDirty()}getEncoding(){return this.model.getEncoding()}setEncoding(e,t){return this.model.setEncoding(e)}get hasLanguageSetExplicitly(){return this.model.hasLanguageSetExplicitly}get hasAssociatedFilePath(){return this.model.hasAssociatedFilePath}setLanguageId(e,t){this.model.setLanguageId(e,t)}getLanguageId(){return this.model.getLanguageId()}async resolve(){return this.modelResolve||(this.modelResolve=(async()=>{this.cachedUntitledTextEditorModelReference=await this.textModelService.createModelReference(this.resource)})()),await this.modelResolve,this.isDisposed()&&this.disposeModelReference(),this.model}toUntyped(e){const t={resource:this.model.hasAssociatedFilePath?R9(this.model.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme):this.resource,forceUntitled:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=this.model.isModified()?this.model.textEditorModel?.getValue():void 0,t.options.viewState=qW(this,e.preserveViewState,this.editorService),typeof t.contents=="string"&&!this.model.hasAssociatedFilePath&&!e.preserveResource&&(t.resource=void 0)),t}matches(e){return this===e?!0:e instanceof mX?_n(e.resource,this.resource):KLt(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},mX=yP,yP.ID="workbench.editors.untitledEditorInput",yP);E6=mX=D([_(1,tr),_(2,eo),_(3,_i),_(4,ci),_(5,ec),_(6,Tm),_(7,hh),_(8,Rn),_(9,dl),_(10,aD)],E6);const jce=class jce extends Error{constructor(e){super(e),this.name=jce.code}};jce.code="InlineChatError";let vne=jce;const h3e="_inlineChatContext",u3e="_inlineChatDocument",IBe=class IBe{constructor(e,t,i){this.uri=e,this.selection=t,this.wholeRange=i}};IBe.variableName="_inlineChatContext";let Zxe=IBe,g3e=class{constructor(e,t,i,s,o,r,a,c,l,d){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=s,this._logService=o,this._instaService=r,this._editorService=a,this._chatService=c,this._chatAgentService=l,this._store=new Z,this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._onDidMoveSession=this._store.add(new I),this.onDidMoveSession=this._onDidMoveSession.event,this._onDidEndSession=this._store.add(new I),this.onDidEndSession=this._onDidEndSession.event,this._onDidStashSession=this._store.add(new I),this.onDidStashSession=this._onDidStashSession.event,this._sessions=new Map,this._keyComputers=new Map,this._recordings=[],this._store.add(d.registerVariable({id:h3e,name:h3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return JSON.stringify(new Zxe(p.session.textModelN.uri,p.editor.getSelection(),p.session.wholeRange.trackedInitialRange))})),this._store.add(d.registerVariable({id:u3e,name:u3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return p.session.textModelN.uri}))}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const s=this._chatAgentService.getDefaultAgent(lc.Editor);if(!s){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a={id:Math.random(),wholeRange:new O(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn),placeholder:s.description,slashCommands:s.slashCommands},c=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${s.extensionId}`);const l=this._chatService.startSession(lc.Editor,i);if(!l){this._logService.trace("[IE] NO chatModel found");return}c.add(Ee(()=>{this._chatService.clearSession(l.sessionId),l.dispose()}));const d=c.add(new Dn);c.add(l.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const C=o.getAlternativeVersionId(),{response:y}=b.request;d.value=y.onDidChange(()=>{if(!y.isComplete)return;d.clear();let S;if(y.isCanceled)S=new yEe(new Rc);else if(y.result?.errorDetails)S=new yEe(new Error(y.result.errorDetails.message));else if(y.response.value.length===0)S=new ist;else{const M={edits:{edits:[]}};for(const k of y.response.value)if(k.kind==="textEditGroup")for(const F of k.edits)for(const N of F)M.edits.edits.push({resource:k.uri,textEdit:N,versionId:void 0});S=this._instaService.createInstance(WI,M,v.textModelN.uri,C,b.request,y)}v.addExchange(new jzt(v.lastInput,S)),S instanceof WI&&S.untitledTextModel&&this._textModelService.createModelReference(S.untitledTextModel.resource).then(M=>{c.add(M)})})})),c.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(s.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${s.extensionId}`),this._releaseSession(v,!0))}));const h=Dr(),u=o.uri;c.add(await this._textModelService.createModelReference(o.uri));const f=o,p=c.add(this._modelService.createModel(fQ(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:T.None},u.with({scheme:_e.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:h,textModel0:""}).toString()}),!0));u.scheme===_e.untitled&&c.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:u,typeId:E6.ID,editorId:A_.id})||this._releaseSession(v,!0)}));let m=t.wholeRange;if(m||(m=a.wholeRange?O.lift(a.wholeRange):e.getSelection()),i.isCancellationRequested){c.dispose();return}const v=new qzt(t.editMode,u,p,f,s,a,c.add(new CEe(f,m)),c.add(new AEe(this._editorWorkerService,p,f)),l),w=this._key(e,v.targetUri);if(this._sessions.has(w))throw c.dispose(),new Error(`Session already stored for ${w}`);return this._sessions.set(w,{session:v,editor:e,store:c}),v}moveSession(e,t){const i=this._key(t,e.targetUri),s=this._sessions.get(i);if(s){if(s.session!==e)throw new Error("Cannot move session because the target editor already/still has one");return}let o=!1;for(const[r,a]of this._sessions)if(a.session===e){o=!0,this._sessions.delete(r),this._sessions.set(i,{...a,editor:t}),this._logService.trace(`[IE] did MOVE session for ${a.editor.getId()} to NEW EDITOR ${t.getId()}, ${e.agent.extensionId}`),this._onDidMoveSession.fire({session:e,editor:t});break}if(!o)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const r of this._sessions)if(r[1].session===e){i=r;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[s,o]=i;this._sessions.delete(s),this._logService.trace(`[IE] did RELEASED session for ${o.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:o.editor,session:e,endedByExternalCause:t}),o.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const s=this._instaService.createInstance(SEe,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),s}getCodeEditor(e){for(const[,t]of this._sessions)if(t.session===e)return t.editor;throw new Error("session not found")}getSession(e,t){const i=this._key(e,t);return this._sessions.get(i)?.session}_key(e,t){const i=this._keyComputers.get(t.scheme);return i?i.getComparisonKey(e,t):`${e.getId()}@${t.toString()}`}registerSessionKeyComputer(e,t){return this._keyComputers.set(e,t),Ee(()=>this._keyComputers.delete(e))}_keepRecording(e){this._recordings.unshift(e.asRecording())>5&&this._recordings.pop()}recordings(){return this._recordings}};g3e=D([_(0,rn),_(1,Ai),_(2,Rn),_(3,kd),_(4,Ze),_(5,be),_(6,_i),_(7,Rw),_(8,yp),_(9,Mz)],g3e);var VH;let f3e=(VH=class{constructor(e,t){this._ctxHasProvider=kzt.bindTo(e),t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(lc.Editor);this._ctxHasProvider.set(i)})}dispose(){this._ctxHasProvider.reset()}},VH.Id="inlineChat.enabler",VH);f3e=D([_(0,Pe),_(1,yp)],f3e);const TL="vs/workbench/contrib/inlineChat/browser/inlineChatController";var Xr;(function(n){n.CREATE_SESSION="CREATE_SESSION",n.INIT_UI="INIT_UI",n.WAIT_FOR_INPUT="WAIT_FOR_INPUT",n.SHOW_REQUEST="SHOW_REQUEST",n.SHOW_RESPONSE="SHOW_RESPONSE",n.PAUSE="PAUSE",n.CANCEL="CANCEL",n.ACCEPT="DONE"})(Xr||(Xr={}));var Od;(function(n){n[n.NONE=0]="NONE",n[n.ACCEPT_SESSION=1]="ACCEPT_SESSION",n[n.CANCEL_SESSION=2]="CANCEL_SESSION",n[n.PAUSE_SESSION=4]="PAUSE_SESSION",n[n.CANCEL_REQUEST=8]="CANCEL_REQUEST",n[n.CANCEL_INPUT=16]="CANCEL_INPUT",n[n.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Od||(Od={}));let p3e=class{static get(e){return e.getContribution(zze)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=s,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,this._languageFeatureService=h,this._chatWidgetService=u,this._isDisposed=!1,this._store=new Z,this._messages=this._store.add(new I),this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._sessionStore=this._store.add(new Z),this._stashedSession=this._store.add(new Dn),this._forcedPlaceholder=void 0,this._ctxVisible=Izt.bindTo(l),this._ctxUserDidEdit=Pzt.bindTo(l),this._ctxResponseTypes=Nzt.bindTo(l),this._ui=new Ya(()=>{let p=lc.Editor;for(const w of f.listNotebookEditors())for(const[,b]of w.codeEditors)if(b===this._editor){p=lc.Notebook;break}const m=this._store.add(t.createInstance(Jxe,p,this._editor)),v=this._store.add(t.createInstance(Yxe,p,this._editor));return{content:m,zone:v}}),this._store.add(this._editor.onDidChangeModel(async p=>{if(this._session||!p.newModelUrl)return;const m=this._inlineChatSessionService.getSession(this._editor,p.newModelUrl);m&&(this._log("session RESUMING after model change",p),await this.run({existingSession:m}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(p=>{p.session===this._session&&p.endedByExternalCause&&(this._log("session ENDED by external cause"),this._session=void 0,this._strategy?.cancel(),this._resetWidget(),this.cancelSession())})),this._store.add(this._inlineChatSessionService.onDidMoveSession(async p=>{p.editor===this._editor&&(this._log("session RESUMING after move",p),await this.run({existingSession:p.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION),this._store.dispose(),this._isDisposed=!0,this._log("DISPOSED controller")}_log(e,...t){e instanceof Error?this._logService.error(e,...t):this._logService.trace(`[IE] (editor:${this._editor.getId()})${e}`,...t)}getMessage(){return this._ui.value.zone.widget.responseContent}getId(){return zze}_getMode(){return this._configurationService.getValue(Mv.Mode)}getWidgetPosition(){return this._ui.value.zone.position}async run(e={}){try{this.finishExistingSession(),this._currentRun&&await this._currentRun,e.initialSelection&&this._editor.setSelection(e.initialSelection),this._stashedSession.clear(),this._onWillStartSession.fire(),this._currentRun=this._nextState(Xr.CREATE_SESSION,e),await this._currentRun}catch(t){bt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Xr.PAUSE]()}finally{this._currentRun=void 0}}async _nextState(e,t){let i=e;for(;i&&!this._isDisposed;)this._log("setState to ",i),i=await this[i](t)}async[Xr.CREATE_SESSION](e){Bt(this._session===void 0),Bt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const s=this._showWidget(!0,i);let o=g(TL,0,"Failed to start editor chat");if(!t){const r=new ai,a=T.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Od.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateProgress(!0),this._ui.value.zone.widget.updateInfo(g(TL,1,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof vne||c?.name===vne.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Xr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Du.get(this._editor)?.showMessage(o,s),this._log("Failed to start editor chat"),Xr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case yS.Preview:this._strategy=this._instaService.createInstance(LEe,t,this._editor,this._ui.value.zone);break;case yS.Live:default:this._strategy=this._instaService.createInstance(TEe,t,this._editor,this._ui.value.zone);break}return this._session=t,Xr.INIT_UI}async[Xr.INIT_UI](e){Bt(this._session),Bt(this._strategy),_g.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const h=this._strategy?.getWholeRangeDecoration()??[];t.set(h)};this._sessionStore.add(Ee(()=>t.clear())),this._sessionStore.add(this._session.wholeRange.onDidChange(i)),i(),this._sessionStore.add(this._ui.value.content.onDidBlur(()=>this.cancelSession())),this._ui.value.content.setSession(this._session),this._updatePlaceholder();const s=this._session.session.message??g(TL,2,"AI-generated code may be incorrect");this._ui.value.zone.widget.updateInfo(s),this._showWidget(!this._session.chatModel.hasRequests),this._sessionStore.add(this._editor.onDidChangeModel(h=>{const u=this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION;this._log("model changed, pause or cancel session",u,h),this._messages.fire(u)}));const o=this._editor.getModel()?.getAlternativeVersionId();this._sessionStore.add(this._editor.onDidChangeModelContent(h=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(o!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const u=this._session.wholeRange;let f=!1;if(this._configurationService.getValue(Mv.FinishOnType))for(const{range:p}of h.changes)f=!O.areIntersectingOrTouching(p,u.value);this._session.recordExternalEditOccurred(f),f&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async h=>{if(h.kind==="addRequest"&&h.request.response){this._ui.value.zone.widget.updateProgress(!0);const u=h.request.response.onDidChange(()=>{(h.request.response?.isCanceled||h.request.response?.isComplete)&&(this._ui.value.zone.widget.updateProgress(!1),u.dispose())})}else if(h.kind==="removeRequest"){const u=this._session.exchanges.find(f=>f.prompt.request.id===h.requestId);if(u&&this._editor.hasModel()){this._session.hunkData.ignoreTextModelNChanges=!0;try{const f=this._editor.getModel(),p=u.prompt.modelAltVersionId;for(;p{if(u.lineNumber!==1||!this._session||!this._session.session.slashCommands)return;const m=this._chatWidgetService.getWidgetByInputUri(h.uri);if(m!==this._ui.value.zone.widget.chatWidget&&m!==this._ui.value.content.chatWidget)return;const v={suggestions:[],incomplete:!1};for(const w of this._session.session.slashCommands){const b=`/${w.name}`;v.suggestions.push({label:{label:b,description:w.description??""},kind:Ne.Text,insertText:b,range:O.fromPositions(new oe(1,1),u)})}return v}}));const r=(h,u)=>{const f=[];for(const p of(this._session?.session.slashCommands??[]).sort((m,v)=>v.name.length-m.name.length)){const m=`/${p.name}`,v=u.getLineContent(1);if(v.startsWith(m)){f.push({range:new O(1,1,1,m.length+1),options:{description:"inline-chat-slash-command",inlineClassName:"inline-chat-slash-command",after:{content:" "}}}),v.trim()===`/${p.name}`&&f.push({range:new O(1,m.length,1,m.length),options:{description:"inline-chat-slash-command-detail",after:{content:`${p.description}`,inlineClassName:"inline-chat-slash-command-detail"}}});break}}h.set(f)},a=this._ui.value.content.chatWidget.inputEditor,c=this._ui.value.zone.widget.chatWidget.inputEditor,l=a.createDecorationsCollection(),d=c.createDecorationsCollection();return this._sessionStore.add(a.onDidChangeModelContent(()=>r(l,a.getModel()))),this._sessionStore.add(c.onDidChangeModelContent(()=>r(d,c.getModel()))),this._sessionStore.add(Ee(()=>{l.clear(),d.clear()})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Xr.SHOW_RESPONSE):Xr.WAIT_FOR_INPUT}async[Xr.WAIT_FOR_INPUT](e){Bt(this._session),Bt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),sa(e.message),delete e.message,this._showWidget(!1));let t=Od.NONE,i;const s=new Uh,o=new Z;if(o.add(this._session.chatModel.onDidChange(a=>{a.kind==="addRequest"&&(i=a.request,t=Od.ACCEPT_INPUT,s.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(T.once(this._messages.event)(a=>{this._log("state=_waitForInput) message received",a),t=a,s.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await s.wait(),o.dispose(),t&(Od.CANCEL_INPUT|Od.CANCEL_SESSION))return Xr.CANCEL;if(t&Od.PAUSE_SESSION)return Xr.PAUSE;if(t&Od.ACCEPT_SESSION)return this._ui.value.zone.widget.selectAll(!1),Xr.ACCEPT;if(!i?.message.text)return Xr.WAIT_FOR_INPUT;const r=i.message.text;return this._ui.value.zone.widget.value=r,this._session.addInput(new Qzt(i,this._editor.getModel().getAlternativeVersionId())),Xr.SHOW_REQUEST}async[Xr.SHOW_REQUEST](){Bt(this._session),Bt(this._session.chatModel.requestInProgress);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Bt(t),Bt(t.response),this._showWidget(!1),this._ui.value.zone.widget.value=t.message.text,this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,s=new sd,o=new Z,r=o.add(new ai),a=new dNe,c=ao.create(),l=new dO;let d=Xr.SHOW_RESPONSE;o.add(T.once(this._messages.event)(C=>{this._log("state=_makeRequest) message received",C),this._chatService.cancelCurrentRequestForSession(e.sessionId),C&Od.CANCEL_SESSION?d=Xr.CANCEL:C&Od.PAUSE_SESSION?d=Xr.PAUSE:C&Od.ACCEPT_SESSION&&(d=Xr.ACCEPT)})),o.add(e.onDidChange(C=>{C.kind==="removeRequest"&&C.requestId===t.id&&(r.cancel(),s.complete(),C.reason===_6.Resend?d=Xr.SHOW_REQUEST:d=Xr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new tV,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):Dr(),applied:0};let v;const w=()=>{if(v||(v=i.response.value.find(C=>C.kind==="textEditGroup"&&_n(C.uri,this._session?.textModelN.uri))),v){v.state??=m;const C=v.edits,y=C.slice(h);y.length>0&&(h=C.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const S=this._session.wholeRange.value.getStartPosition();for(const k of y)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const M=this._session.wholeRange.value.getStartPosition();(!M.equals(S)||!this._ui.value.zone.position?.equals(M))&&this._showWidget(!1,M.delta(-1))}))}i.isCanceled?(r.cancel(),s.complete()):i.isComplete&&s.complete()};o.add(i.onDidChange(w)),w(),await s.p,await l.whenIdle(),o.dispose();const b=await this._editorWorkerService.computeDiff(this._session.textModel0.uri,this._session.textModelN.uri,{computeMoves:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,ignoreTrimWhitespace:!1},"advanced");return this._session.wholeRange.fixup(b?.changes??[]),await this._session.hunkData.recompute(m),this._ui.value.zone.widget.updateToolbar(!0),this._ui.value.zone.widget.updateProgress(!1),d}async[Xr.SHOW_RESPONSE](){Bt(this._session),Bt(this._strategy);const{response:e}=this._session.lastExchange;let t;for(const s of this._session.chatModel.getRequests()){if(!s.response)continue;const o=s$t(s.response.response);if(t===void 0)t=o;else if(t!==o){t=pI.Mixed;break}}this._ctxResponseTypes.set(t);let i;if(e instanceof ist){const s=g(TL,3,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(s,{classes:["warn"]}),Xr.WAIT_FOR_INPUT}else e instanceof yEe?e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel()):e instanceof WI&&(this._ui.value.zone.widget.updateStatus(""),this._ui.value.zone.widget.updateToolbar(!0),i=await this._strategy.renderChanges(e));return this._showWidget(!1,i),Xr.WAIT_FOR_INPUT}async[Xr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Xr.ACCEPT](){Bt(this._session),Bt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(TL,4,"Failed to apply changes.",Ma(e))),this._log("FAILED to apply changes"),this._log(e)}this._inlineChatSessionService.releaseSession(this._session),this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}async[Xr.CANCEL](){if(this._session){Bt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&!!this._session.lastExchange&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(TL,5,"Failed to discard changes.",Ma(i))),this._log("FAILED to discard changes"),this._log(i)}this._stashedSession.clear(),e?this._stashedSession.value=this._inlineChatSessionService.stashSession(this._session,this._editor,t):this._inlineChatSessionService.releaseSession(this._session)}this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}_showWidget(e=!1,t){Bt(this._editor.hasModel());let i;return t?i=t:this._ui.rawValue?.zone?.position?this._ui.rawValue?.zone.position.lineNumber===1?i=this._ui.rawValue?.zone.position.delta(-1):i=this._ui.rawValue?.zone.position:i=this._editor.getSelection().getStartPosition().delta(-1),this._session&&!t&&(this._session.hasChangedText||this._session.lastExchange)&&(i=this._session.wholeRange.value.getStartPosition().delta(-1)),this._ui.rawValue?.zone?.position?this._ui.value.zone.updatePositionAndHeight(i):e?(i=this._editor.getSelection().getStartPosition(),this._ui.value.content.show(i)):(this._ui.value.content.hide(),this._ui.value.zone.show(i),this._session&&this._ui.value.zone.widget.setChatModel(this._session.chatModel)),this._session&&this._ui.rawValue?.zone&&this._ui.rawValue?.zone.updateBackgroundColor(i,this._session.wholeRange.value),this._ctxVisible.set(!0),i}_resetWidget(){this._sessionStore.clear(),this._ctxVisible.reset(),this._ctxUserDidEdit.reset(),this._ui.rawValue?.content.hide(),this._ui.rawValue?.zone?.hide(),this._editor.hasWidgetFocus()&&this._editor.focus()}async _makeChanges(e,t,i){Bt(this._session),Bt(this._strategy);const s=await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri,e);if(this._log("edits from PROVIDER and after making them MORE MINIMAL",this._session.agent.extensionId,e,s),s?.length===0)return;const r=(!t&&s?s:e).map(nMe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),this._session.wholeRange.trackEdits(r),t?await this._strategy.makeProgressiveChanges(r,a,t,i):await this._strategy.makeChanges(r,a,i)}_updatePlaceholder(){this._ui.value.zone.widget.placeholder=this._getPlaceholderText()}_getPlaceholderText(){return this._forcedPlaceholder??this._session?.session.placeholder??""}showSaveHint(){const e=g(TL,6,"Accept or discard changes to continue saving");this._ui.value.zone.widget.updateStatus(e,{classes:["warn"]})}acceptInput(){return this.chatWidget.acceptInput()}updateInput(e,t=!0){if(this._ui.value.content.chatWidget.setInput(e),this._ui.value.zone.widget.chatWidget.setInput(e),t){const i=new mt(1,1,Number.MAX_SAFE_INTEGER,1);this._ui.value.content.chatWidget.inputEditor.setSelection(i),this._ui.value.zone.widget.chatWidget.inputEditor.setSelection(i)}}cancelCurrentRequest(){this._messages.fire(Od.CANCEL_INPUT|Od.CANCEL_REQUEST)}arrowOut(e){if(this._ui.value.zone.position&&this._editor.hasModel()){const{column:t}=this._editor.getPosition(),{lineNumber:i}=this._ui.value.zone.position,s=e?i:i+1;this._editor.setPosition({lineNumber:s,column:t}),this._editor.focus()}}focus(){this._ui.value.zone.widget.focus()}hasFocus(){return this._ui.value.zone.widget.hasFocus()}moveHunk(e){this.focus(),this._strategy?.move?.(e)}async viewInChat(){if(!this._strategy||!this._session)return;let e=!1,t;const i=this._editor.getModel()?.uri,s=this._session.chatModel.getRequests();for(const r of s)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&_n(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Bt(t),t.edits=[o]),await this._instaService.invokeFunction(n$t,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"accepted"}})}this._messages.fire(Od.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"discarded"}})}this._messages.fire(Od.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===yS.Preview?(this._log("finishing existing session, using CANCEL",this._session.editMode),this.cancelSession()):(this._log("finishing existing session, using APPLY",this._session.editMode),this.acceptSession()))}unstashLastSession(){const e=this._stashedSession.value?.unstash();return e&&this._inlineChatSavingService.markChanged(e),e}joinCurrentRun(){return this._currentRun}};p3e=D([_(1,be),_(2,TPe),_(3,zZe),_(4,kd),_(5,Ze),_(6,Re),_(7,To),_(8,Pe),_(9,Rw),_(10,ht),_(11,lL),_(12,xQ)],p3e);async function n$t(n,e){const t=n.get(q_),i=n.get(Rw),s=await ozt(t);if(s&&s.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(s.viewModel.model.sessionId,o);s.focusLastMessage()}}function s$t(n){let e;for(const t of n.value){let i;switch(t.kind){case"textEditGroup":i=pI.OnlyEdits;break;case"markdownContent":default:i=pI.OnlyMessages;break}if(e===void 0)e=i;else if(e!==i)return pI.Mixed}return e??pI.Empty}const o$t="workbench.action.quickchat.toggle";var eDe;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(eDe||(eDe={}));function r$t(n){const e=[],t=new Map,i=(s,o)=>{if(!t.has(s)&&(t.set(s,!0),!(s[0]==="_"||s.indexOf("vscode.")===0)&&n.get(s)!==!0)){if(!o){const r=yt.getCommand(s);if(r&&typeof r.metadata=="object"&&mo(r.metadata.args))return}e.push(s)}};for(const s of Xs.getMenuItems(Te.CommandPalette))lR(s)&&i(s.command.id,!0);for(const s of b_.getEditorActions())i(s.id,!0);for(const s of yt.getCommands().keys())i(s,!1);return e}var X_;const PF="vs/workbench/services/preferences/browser/keybindingsEditorModel",Npe="keybinding.entry.template",m3e=g(PF,0,"System"),_3e=g(PF,1,"Extension"),v3e=g(PF,2,"User");function a$t(n,e){const t=e?` +when:${e}`:"";return`@command:${n}${t}`}const c$t=KU(dF,YD,pde),l$t=/@command:\s*([^\+]+)/i,d$t=/\+when:\s*(.+)/i,w3e=/@source:\s*(user|default|system|extension)/i,b3e=/@ext:\s*((".+")|([^\s]+))/i,h$t=/@keybinding:\s*((\".+\")|(\S+))/i;let C3e=X_=class extends pL{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:bde.modifierLabels[e],aria:AJe.modifierLabels[e],user:EJe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const s=l$t.exec(e);if(s&&s[1]){const o=s[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=d$t.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:X_.getId(a),keybindingItem:a,templateId:Npe}))}if(w3e.test(e))i=this.filterBySource(i,e),e=e.replace(w3e,"");else{const o=b3e.exec(e);if(o&&(o[2]||o[3])){const r=o[2]?o[2].substring(1,o[2].length-1):o[3];i=this.filterByExtension(i,r),e=e.replace(b3e,"")}else{const r=h$t.exec(e);r&&(r[2]||r[3])&&(e=r[2]||`"${r[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(o=>({id:X_.getId(o),keybindingItem:o,templateId:Npe}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===m3e):/@source:\s*user/i.test(t)?e.filter(i=>i.source===v3e):/@source:\s*extension/i.test(t)?e.filter(i=>!$t(i.source)||i.source===_3e):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!$t(i.source)&&(Cn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',s=t.charAt(t.length-1)==='"',o=i&&s;i&&(t=t.substring(1)),s&&(t=t.substring(0,t.length-1)),t=t.trim();const r=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new u$t(this.modifierLabels,l,t,a,c,o);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&r.push({id:X_.getId(l),templateId:Npe,commandLabelMatches:d.commandLabelMatches||void 0,commandDefaultLabelMatches:d.commandDefaultLabelMatches||void 0,keybindingItem:l,keybindingMatches:d.keybindingMatches||void 0,commandIdMatches:d.commandIdMatches||void 0,sourceMatches:d.sourceMatches||void 0,whenMatches:d.whenMatches||void 0,extensionIdMatches:d.extensionIdMatches||void 0,extensionLabelMatches:d.extensionLabelMatches||void 0})}return r}filterByWhen(e,t,i){if(e.length===0)return[];const s=e.filter(c=>c.when===i);if(s.length)return s;const o=e[0].commandLabel,r=new vee(void 0,t,null,ge.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[X_.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Vi(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const o of this.keybindingsService.getKeybindings())o.command&&(this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const s=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of r$t(i)){const r=new vee(void 0,o,null,void 0,s.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=Tc(this._keybindingItemsSortedByPrecedence,o=>X_.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>X_.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+($t(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new Ga;for(const t of this.extensionService.extensions)e.set(t.identifier,t);return e}static compareKeybindingData(e,t){return e.keybinding&&!t.keybinding?-1:t.keybinding&&!e.keybinding?1:e.commandLabel&&!t.commandLabel?-1:t.commandLabel&&!e.commandLabel?1:e.commandLabel&&t.commandLabel&&e.commandLabel!==t.commandLabel?e.commandLabel.localeCompare(t.commandLabel):e.command===t.command?e.keybindingItem.isDefault?1:-1:e.command.localeCompare(t.command)}static toKeybindingEntry(e,t,i,s){const o=Xs.getCommand(e),r=i.get(e);let a=v3e;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?s.get(c)??_3e:m3e}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:X_.getCommandLabel(o,r),commandDefaultLabel:X_.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!s1.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(PF,3,"{0}: {1}",t,i):i}return null}static getCommandLabel(e,t){if(e){const i=e.category?typeof e.category=="string"?e.category:e.category.value:void 0,s=typeof e.title=="string"?e.title:e.title.value;return i?g(PF,3,"{0}: {1}",i,s):s}return t||""}};C3e=X_=D([_(1,ti),_(2,ho)],C3e);class u$t{constructor(e,t,i,s,o,r){this.modifierLabels=e,this.commandIdMatches=null,this.commandLabelMatches=null,this.commandDefaultLabelMatches=null,this.sourceMatches=null,this.whenMatches=null,this.keybindingMatches=null,this.extensionIdMatches=null,this.extensionLabelMatches=null,r||(this.commandIdMatches=this.matches(i,t.command,KU(YD,lee),s),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>YD(a,t.commandLabel,!0),s):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>YD(a,t.commandDefaultLabel,!0),s):null,this.whenMatches=t.when?this.matches(null,t.when,KU(YD,lee),s):null,$t(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>YD(a,t.source,!0),s):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>YD(a,t.commandLabel,!0),s):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,s){let o=e?c$t(e,t):null;return o||(o=this.matchesWords(s,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let s=[];for(const o of e){const r=i(o,t);if(r)s=[...s||[],...r];else{s=null;break}}return s}filterAndSort(e){return Tc(e,t=>t.start+"."+t.end).filter(t=>!e.some(i=>!(i.start===t.start&&i.end===t.end)&&i.start<=t.start&&i.end>=t.end)).sort((t,i)=>t.start-i.start)}matchesKeybinding(e,t,i,s){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&mE(t,a)===0||c&&mE(t,c)===0||l&&mE(t,l)===0)return{firstPart:this.createCompleteMatch(o),chordPart:this.createCompleteMatch(r)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(WE,0,"No matching commands"),commandId:""})},s,o,r,a,c),this.editorService=e,this.menuService=t,this.extensionService=i,this.configurationService=l,this.editorGroupService=d,this.preferencesService=h,this.productService=u,this.aiRelatedInformationService=f,this.chatAgentService=p,this.extensionRegistrationRace=JQe(this.extensionService.whenInstalledExtensionsRegistered(),800),this.useAiRelatedInfo=!1,this._register(l.onDidChangeConfiguration(m=>this.updateOptions(m))),this.updateOptions()}get configuration(){const e=this.configurationService.getValue().workbench.commandPalette;return{preserveInput:e.preserveInput,experimental:e.experimental}}updateOptions(e){if(e&&!e.affectsConfiguration("workbench.commandPalette.experimental"))return;const t=this.configuration,i=t.experimental.suggestCommands&&this.productService.commandPaletteSuggestedCommandIds?.length?new Set(this.productService.commandPaletteSuggestedCommandIds):void 0;this.options.suggestedCommandIds=i,this.useAiRelatedInfo=t.experimental.enableNaturalLanguageSearch}async getCommandPicks(e){return await this.extensionRegistrationRace,e.isCancellationRequested?[]:[...this.getCodeEditorCommandPicks(),...this.getGlobalCommandPicks()].map(t=>({...t,buttons:[{iconClass:$e.asClassName(Ce.gear),tooltip:g(WE,1,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:a$t(t.commandId,t.commandWhen)}),BE.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,s){if(!this.hasAdditionalCommandPicks(i,s))return[];let o;try{await Ta(F3.AI_RELATED_INFORMATION_DEBOUNCE,s),o=await this.getRelatedInformationPicks(e,t,i,s)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(lc.Panel);return r&&o.push({label:g(WE,2,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?o$t:Dzt,args:[i]}),o}async getRelatedInformationPicks(e,t,i,s){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[eDe.CommandInformation],s);o.sort((c,l)=>l.weight-c.weight);const r=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of o){if(c.weightd.commandId===c.command&&!r.has(d.commandId));l&&a.push(l)}return a}getGlobalCommandPicks(){const e=[],t=this.editorService.activeEditorPane?.scopedContextKeyService||this.editorGroupService.activeGroup.scopedContextKeyService,i=this.menuService.createMenu(Te.CommandPalette,t),s=i.getActions().reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof id&&o.enabled);for(const o of s){let r=(typeof o.item.title=="string"?o.item.title:o.item.title.value)||o.item.id;const a=typeof o.item.category=="string"?o.item.category:o.item.category?.value;a&&(r=g(WE,3,"{0}: {1}",a,r));const c=typeof o.item.title!="string"?o.item.title.original:void 0,l=a&&o.item.category&&typeof o.item.category!="string"?o.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=o.item.metadata?.description,u=h===void 0||XJe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:mde(r),commandDescription:u})}return i.dispose(),e}},F3=ZE,ZE.AI_RELATED_INFORMATION_MAX_PICKS=5,ZE.AI_RELATED_INFORMATION_THRESHOLD=.8,ZE.AI_RELATED_INFORMATION_DEBOUNCE=200,ZE);FF=F3=D([_(0,_i),_(1,_c),_(2,ho),_(3,be),_(4,ti),_(5,ji),_(6,rn),_(7,To),_(8,Re),_(9,ur),_(10,TQ),_(11,Xa),_(12,PPe),_(13,yp)],FF);const Kce=class Kce extends pi{constructor(){super({id:Kce.ID,title:Be(WE,4,"Show All Commands"),keybinding:{weight:ye.WorkbenchContrib,when:void 0,primary:pp?void 0:V.CtrlCmd|V.Shift|E.KeyP,secondary:[E.F1]},f1:!0})}async run(e){e.get(On).quickAccess.show(FF.PREFIX)}};Kce.ID="workbench.action.showCommands";let V1=Kce;class g$t extends pi{constructor(){super({id:"workbench.action.clearCommandHistory",title:Be(WE,5,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Re),i=e.get(on),s=e.get(To);if(p6.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await s.confirm({type:"warning",message:g(WE,6,"Do you want to clear the history of recently used commands?"),detail:g(WE,7,"This action is irreversible!"),primaryButton:g(WE,8,"&&Clear")});if(!r)return;p6.clearHistory(t,i)}}}class Est{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Dn);return o.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=_z(o);if(a){let c=o.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},s.add(cw(t.onCancellationRequested)(()=>r.restoreViewState?.()))}s.add(Ee(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,jb.JUMP),e.revealRangeInCenter(t.range,vt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Cu(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return ew(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const M5="vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess",Yce=class Yce extends Est{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(M5,0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,$.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(s,l.lineNumber))return;this.gotoLocation(e,{range:this.toRange(l.lineNumber,l.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=this.parsePosition(s,t.value.trim().substr(Yce.PREFIX.length)),l=this.getPickLabel(s,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(s,c.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(c.lineNumber,c.column);s.revealRangeInCenter(d,vt.Smooth),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=_z(s);return a&&a.getOptions().get(x.lineNumbers).renderType===Qr.Relative&&(a.updateOptions({lineNumbers:"on"}),o.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(M5,1,"Go to line {0} and character {1}.",t,i):g(M5,2,"Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(M5,3,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):g(M5,4,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Yce.PREFIX=":";let wne=Yce;const tDe="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess";let bne=class extends wne{constructor(e,t,i){super(),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview}}get activeTextEditorControl(){return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}};bne=D([_(0,_i),_(1,ur),_(2,Re)],bne);const Jce=class Jce extends pi{constructor(){super({id:Jce.ID,title:Be(tDe,0,"Go to Line/Column..."),f1:!0,keybinding:{weight:ye.WorkbenchContrib,when:null,primary:V.CtrlCmd|E.KeyG,mac:{primary:V.WinCtrl|E.KeyG}}})}async run(e){e.get(On).quickAccess.show(bne.PREFIX)}};Jce.ID="workbench.action.gotoLine";let Cne=Jce;At(Cne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:bne,prefix:wne.PREFIX,placeholder:g(tDe,1,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(tDe,2,"Go to Line/Column"),commandId:Cne.ID}]});var IB;const Rr="vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess";var ex;let EM=(ex=class extends Est{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,g(Rr,0,"To go to a symbol, first open a text editor with symbol information.")),$.None}provideWithTextEditor(e,t,i,s){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,s):this.doProvideWithoutEditorSymbols(e,r,t,i):$.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new Z;return this.provideLabelPick(i,g(Rr,1,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:_t.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new sd,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,o){const r=e.editor,a=new Z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),o?.handleAccept?.(u),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const c=this.getDocumentSymbols(t,s);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ai(s),i.busy=!0;try{const u=y6(i.value.substr(IB.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(s.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=t1(f,m=>!!(m.type!=="separator"&&m.range&&O.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(Rr,2,"No matching editor symbols")):this.provideLabelPick(i,g(Rr,3,"No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,vt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,o){const r=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(IB.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=F5e(t.values[0]),d=F5e(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?$e.asClassName(Ce.splitHorizontal):$e.asClassName(Ce.splitVertical),tooltip:u==="right"?g(Rr,4,"Open to the Side"):g(Rr,5,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let U=!1;if(l!==t&&([M,k]=Lpe(C,{...t,values:void 0},c,y),typeof M=="number"&&(U=!0)),typeof M!="number"&&([M,k]=Lpe(C,l,c,y),typeof M!="number"))continue;if(!U&&d){if(S&&d.original.length>0&&([F,N]=Lpe(S,d)),typeof F!="number")continue;typeof M=="number"&&(M+=F)}}const z=w.tags&&w.tags.indexOf(k9.Deprecated)>=0;f.push({index:v,kind:w.kind,score:M,label:C,ariaLabel:yht(w.name,w.kind),description:S,highlights:z?void 0:{label:k,description:N},range:{selection:O.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:b,strikethrough:z,buttons:h})}const p=f.sort((v,w)=>a?this.compareByKindAndScore(v,w):this.compareByScore(v,w));let m=[];if(a){let C=function(){w&&typeof v=="number"&&b>0&&(w.label=a_(Fpe[v]||Ppe,b))},v,w,b=0;for(const y of p)v!==y.kind?(C(),v=y.kind,b=1,w={type:"separator"},m.push(w)):b++,m.push(y);C()}else p.length>0&&(m=[{label:g(Rr,6,"symbols ({0})",f.length),type:"separator"},...p]);return m}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=Fpe[e.kind]||Ppe,s=Fpe[t.kind]||Ppe,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},IB=ex,ex.PREFIX="@",ex.SCOPE_PREFIX=":",ex.PREFIX_BY_CATEGORY=`${IB.PREFIX}${IB.SCOPE_PREFIX}`,ex);EM=IB=D([_(0,ht),_(1,JQ)],EM);const Ppe=g(Rr,7,"properties ({0})"),Fpe={[_t.Method]:g(Rr,8,"methods ({0})"),[_t.Function]:g(Rr,9,"functions ({0})"),[_t.Constructor]:g(Rr,10,"constructors ({0})"),[_t.Variable]:g(Rr,11,"variables ({0})"),[_t.Class]:g(Rr,12,"classes ({0})"),[_t.Struct]:g(Rr,13,"structs ({0})"),[_t.Event]:g(Rr,14,"events ({0})"),[_t.Operator]:g(Rr,15,"operators ({0})"),[_t.Interface]:g(Rr,16,"interfaces ({0})"),[_t.Namespace]:g(Rr,17,"namespaces ({0})"),[_t.Package]:g(Rr,18,"packages ({0})"),[_t.TypeParameter]:g(Rr,19,"type parameters ({0})"),[_t.Module]:g(Rr,20,"modules ({0})"),[_t.Property]:g(Rr,7,"properties ({0})"),[_t.Enum]:g(Rr,21,"enumerations ({0})"),[_t.EnumMember]:g(Rr,22,"enumeration members ({0})"),[_t.String]:g(Rr,23,"strings ({0})"),[_t.File]:g(Rr,24,"files ({0})"),[_t.Array]:g(Rr,25,"arrays ({0})"),[_t.Number]:g(Rr,26,"numbers ({0})"),[_t.Boolean]:g(Rr,27,"booleans ({0})"),[_t.Object]:g(Rr,28,"objects ({0})"),[_t.Key]:g(Rr,29,"keys ({0})"),[_t.Field]:g(Rr,30,"fields ({0})"),[_t.Constant]:g(Rr,31,"constants ({0})")};var iDe;(function(n){n[n.OutlinePane=1]="OutlinePane",n[n.Breadcrumbs=2]="Breadcrumbs",n[n.QuickPick=4]="QuickPick"})(iDe||(iDe={}));var y3e;(function(n){n.icons="outline.icons",n.collapseItems="outline.collapseItems",n.problemsEnabled="outline.problems.enabled",n.problemsColors="outline.problems.colors",n.problemsBadges="outline.problems.badges"})(y3e||(y3e={}));var S3e;(function(n){n.Collapsed="alwaysCollapse",n.Expanded="alwaysExpand"})(S3e||(S3e={}));var nDe;const ZW="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess";var SP;let yne=(SP=class extends EM{constructor(e,t,i,s,o,r){super(s,r,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=o,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview,openSideBySideDirection:e?.openSideBySideDirection}}get activeTextEditorControl(){if(!HU(this.editorService.activeEditorPane?.getControl()))return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}async getSymbolPicks(e,t,i,s,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,s),Ta(nDe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),y6(t),i,o,e)}provideWithoutTextEditor(e){return this.canPickWithOutlineService()?this.doGetOutlinePicks(e):super.provideWithoutTextEditor(e)}canPickWithOutlineService(){return this.editorService.activeEditorPane?this.outlineService.canCreateOutline(this.editorService.activeEditorPane):!1}doGetOutlinePicks(e){const t=this.editorService.activeEditorPane;if(!t)return $.None;const i=new ai,s=new Z;return s.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,iDe.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}s.add(o);const r=o.captureViewState();s.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:_t.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));s.add(e.onDidAccept(()=>{e.hide();const[h]=e.selectedItems;h&&a[h.index]&&o.reveal(a[h.index].element,{},!1,!1)}));const l=()=>{const h=c.filter(u=>{if(e.value==="@")return u.score=0,u.highlights=void 0,!0;const f=e.value.substring(EM.PREFIX.length).trim(),p=n2(u.label),m=v1(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:lJ(f,p)??void 0},!0):!1});if(h.length===0){const u=g(ZW,0,"No matching entries");e.items=[{label:u,index:-1,kind:_t.String}],e.ariaLabel=u}else e.items=h};l(),s.add(e.onDidChangeValue(l));const d=new Dn;s.add(d),s.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{bt(o),e.hide()}).finally(()=>{e.busy=!1}),s}},nDe=SP,SP.SYMBOL_PICKS_TIMEOUT=8e3,SP);yne=nDe=D([_(0,_i),_(1,ur),_(2,Re),_(3,ht),_(4,Eet),_(5,JQ)],yne);const Xce=class Xce extends pi{constructor(){super({id:Xce.ID,title:{...Be(ZW,1,"Go to Symbol in Editor..."),mnemonicTitle:g(ZW,2,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:ge.and(km.negate(),T1.negate()),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|V.Shift|E.KeyO},menu:[{id:Te.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(On).quickAccess.show(yne.PREFIX,{itemActivation:Qp.NONE})}};Xce.ID="workbench.action.gotoSymbol";let Sne=Xce;At(Sne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:yne,prefix:EM.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(ZW,3,"Type the name of a symbol to go to."),helpEntries:[{description:g(ZW,4,"Go to Symbol in Editor"),prefix:EM.PREFIX,commandId:Sne.ID,commandCenterOrder:40},{description:g(ZW,5,"Go to Symbol in Editor by Category"),prefix:EM.PREFIX_BY_CATEGORY}]});const qz="vs/workbench/browser/actions/quickAccessActions",bx={primary:V.CtrlCmd|E.KeyP,secondary:[V.CtrlCmd|E.KeyE],mac:{primary:V.CtrlCmd|E.KeyP,secondary:void 0}};xr.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:E.Escape,secondary:[V.Shift|E.Escape],handler:n=>n.get(On).cancel()});xr.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept()});xr.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept({ctrlCmd:!0,alt:!1})});xr.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).focus()}});const A3e="workbench.action.quickOpenNavigateNextInFilePicker";xr.registerCommandAndKeybindingRule({id:A3e,weight:ye.WorkbenchContrib+50,handler:Rhe(A3e,!0),when:Gnt,primary:bx.primary,secondary:bx.secondary,mac:bx.mac});const E3e="workbench.action.quickOpenNavigatePreviousInFilePicker";xr.registerCommandAndKeybindingRule({id:E3e,weight:ye.WorkbenchContrib+50,handler:Rhe(E3e,!1),when:Gnt,primary:bx.primary|V.Shift,secondary:[bx.secondary[0]|V.Shift],mac:{primary:bx.mac.primary|V.Shift,secondary:void 0}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).toggle()}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:ye.WorkbenchContrib+50,when:aA,primary:0,win:{primary:V.Alt|E.LeftArrow},mac:{primary:V.WinCtrl|E.Minus},linux:{primary:V.CtrlCmd|V.Alt|E.Minus},handler:n=>{n.get(On).back()}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpen",title:Be(qz,0,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:ye.WorkbenchContrib,primary:bx.primary,secondary:bx.secondary,mac:bx.mac},f1:!0})}run(e,t){e.get(On).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(qz,1,"Quick Open"),icon:Ce.search,menu:{id:Te.CommandCenterCenter,order:100}})}run(e){e.get(On).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});yt.registerCommand("workbench.action.quickOpenPreviousEditor",async n=>{n.get(On).quickAccess.show("",{itemActivation:Qp.SECOND})});class Whe extends pi{constructor(e,t,i,s,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=s}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:s}:void 0;i.navigate(this.next,o)}}class f$t extends Whe{constructor(){super("workbench.action.quickOpenNavigateNext",Be(qz,2,"Navigate Next in Quick Open"),!0,!0)}}class p$t extends Whe{constructor(){super("workbench.action.quickOpenNavigatePrevious",Be(qz,3,"Navigate Previous in Quick Open"),!1,!0)}}class m$t extends Whe{constructor(){super("workbench.action.quickOpenSelectNext",Be(qz,4,"Select Next in Quick Open"),!0,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyN}})}}class _$t extends Whe{constructor(){super("workbench.action.quickOpenSelectPrevious",Be(qz,5,"Select Previous in Quick Open"),!1,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyP}})}}At(m$t);At(_$t);At(f$t);At(p$t);var O3;const v$t="vs/platform/quickinput/browser/helpQuickAccess";var AP;let a8=(AP=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=it.as(xz.Quickaccess)}provide(e){const t=new Z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(O3.PREFIX.length));s&&s.prefix&&s.prefix!==O3.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==O3.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(v$t,0,"{0}, {1}",s,t.description),description:t.description}})}},O3=AP,AP.PREFIX="?",AP);a8=O3=D([_(0,On),_(1,ti)],a8);const Yi="vs/workbench/contrib/debug/common/debug",x3e="workbench.panel.repl.view";new Y("debugType",void 0,{type:"string",description:g(Yi,0,"Debug type of the active debug session. For example 'python'.")});new Y("debugConfigurationType",void 0,{type:"string",description:g(Yi,1,"Debug type of the selected launch configuration. For example 'python'.")});new Y("debugState","inactive",{type:"string",description:g(Yi,2,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const w$t="debugUx";new Y(w$t,"default",{type:"string",description:g(Yi,3,"Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.")});new Y("hasDebugged",!1,{type:"boolean",description:g(Yi,4,"True when a debug session has been started at least once, false otherwise.")});new Y("inDebugMode",!1,{type:"boolean",description:g(Yi,5,"True when debugging, false otherwise.")});new Y("inDebugRepl",!1,{type:"boolean",description:g(Yi,6,"True when focus is in the debug console, false otherwise.")});new Y("breakpointWidgetVisible",!1,{type:"boolean",description:g(Yi,7,"True when breakpoint editor zone widget is visible, false otherwise.")});new Y("inBreakpointWidget",!1,{type:"boolean",description:g(Yi,8,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Y("breakpointsFocused",!0,{type:"boolean",description:g(Yi,9,"True when the BREAKPOINTS view is focused, false otherwise.")});new Y("watchExpressionsFocused",!0,{type:"boolean",description:g(Yi,10,"True when the WATCH view is focused, false otherwsie.")});new Y("watchExpressionsExist",!1,{type:"boolean",description:g(Yi,11,"True when at least one watch expression exists, false otherwise.")});new Y("variablesFocused",!0,{type:"boolean",description:g(Yi,12,"True when the VARIABLES views is focused, false otherwsie")});new Y("expressionSelected",!1,{type:"boolean",description:g(Yi,13,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new Y("breakpointInputFocused",!1,{type:"boolean",description:g(Yi,14,"True when the input box has focus in the BREAKPOINTS view.")});new Y("callStackItemType",void 0,{type:"string",description:g(Yi,15,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new Y("callStackSessionIsAttach",!1,{type:"boolean",description:g(Yi,16,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new Y("callStackItemStopped",!1,{type:"boolean",description:g(Yi,17,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new Y("callStackSessionHasOneThread",!1,{type:"boolean",description:g(Yi,18,"True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.")});new Y("watchItemType",void 0,{type:"string",description:g(Yi,19,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new Y("canViewMemory",void 0,{type:"boolean",description:g(Yi,20,"Indicates whether the item in the view has an associated memory refrence.")});new Y("breakpointItemType",void 0,{type:"string",description:g(Yi,21,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new Y("breakpointItemBytes",void 0,{type:"boolean",description:g(Yi,22,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Y("breakpointHasModes",!1,{type:"boolean",description:g(Yi,23,"Whether the breakpoint has multiple modes it can switch to.")});new Y("breakpointSupportsCondition",!1,{type:"boolean",description:g(Yi,24,"True when the focused breakpoint supports conditions.")});new Y("loadedScriptsSupported",!1,{type:"boolean",description:g(Yi,25,"True when the focused sessions supports the LOADED SCRIPTS view")});new Y("loadedScriptsItemType",void 0,{type:"string",description:g(Yi,26,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Y("focusedSessionIsAttach",!1,{type:"boolean",description:g(Yi,27,"True when the focused session is 'attach'.")});new Y("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(Yi,28,"True when the focused session is run without debugging.")});new Y("stepBackSupported",!1,{type:"boolean",description:g(Yi,29,"True when the focused session supports 'stepBack' requests.")});new Y("restartFrameSupported",!1,{type:"boolean",description:g(Yi,30,"True when the focused session supports 'restartFrame' requests.")});new Y("stackFrameSupportsRestart",!1,{type:"boolean",description:g(Yi,31,"True when the focused stack frame suppots 'restartFrame'.")});new Y("jumpToCursorSupported",!1,{type:"boolean",description:g(Yi,32,"True when the focused session supports 'jumpToCursor' request.")});new Y("stepIntoTargetsSupported",!1,{type:"boolean",description:g(Yi,33,"True when the focused session supports 'stepIntoTargets' request.")});new Y("breakpointsExist",!1,{type:"boolean",description:g(Yi,34,"True when at least one breakpoint exists.")});new Y("debuggersAvailable",!1,{type:"boolean",description:g(Yi,35,"True when there is at least one debug extensions active.")});new Y("debugExtensionAvailable",!0,{type:"boolean",description:g(Yi,36,"True when there is at least one debug extension installed and enabled.")});new Y("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(Yi,37,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Y("debugSetVariableSupported",!1,{type:"boolean",description:g(Yi,38,"True when the focused session supports 'setVariable' request.")});new Y("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(Yi,39,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Y("debugSetExpressionSupported",!1,{type:"boolean",description:g(Yi,40,"True when the focused session supports 'setExpression' request.")});new Y("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(Yi,41,"True when the focused session supports to break when value changes.")});new Y("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(Yi,42,"True when the focused breakpoint supports to break when value is accessed.")});new Y("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(Yi,43,"True when the focused breakpoint supports to break when value is read.")});new Y("terminateDebuggeeSupported",!1,{type:"boolean",description:g(Yi,44,"True when the focused session supports the terminate debuggee capability.")});new Y("suspendDebuggeeSupported",!1,{type:"boolean",description:g(Yi,45,"True when the focused session supports the suspend debuggee capability.")});new Y("variableEvaluateNamePresent",!1,{type:"boolean",description:g(Yi,46,"True when the focused variable has an 'evalauteName' field set.")});new Y("variableIsReadonly",!1,{type:"boolean",description:g(Yi,47,"True when the focused variable is read-only.")});new Y("variableValue",!1,{type:"string",description:g(Yi,48,"Value of the variable, present for debug visualization clauses.")});new Y("variableType",!1,{type:"string",description:g(Yi,49,"Type of the variable, present for debug visualization clauses.")});new Y("variableInterfaces",!1,{type:"array",description:g(Yi,50,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Y("variableName",!1,{type:"string",description:g(Yi,51,"Name of the variable, present for debug visualization clauses.")});new Y("variableLanguage",!1,{type:"string",description:g(Yi,52,"Language of the variable source, present for debug visualization clauses.")});new Y("variableExtensionId",!1,{type:"string",description:g(Yi,53,"Extension ID of the variable source, present for debug visualization clauses.")});new Y("exceptionWidgetVisible",!1,{type:"boolean",description:g(Yi,54,"True when the exception widget is visible.")});new Y("multiSessionRepl",!1,{type:"boolean",description:g(Yi,55,"True when there is more than 1 debug console.")});new Y("multiSessionDebug",!1,{type:"boolean",description:g(Yi,56,"True when there is more than 1 active debug session.")});new Y("disassembleRequestSupported",!1,{type:"boolean",description:g(Yi,57,"True when the focused sessions supports disassemble request.")});new Y("disassemblyViewFocus",!1,{type:"boolean",description:g(Yi,58,"True when the Disassembly View is focused.")});new Y("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(Yi,59,"True when the language in the current editor supports disassemble request.")});new Y("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(Yi,60,"True when the focused stack frame has instruction pointer reference.")});g(Yi,62,"Controls when the internal Debug Console should open.");var D3e;(function(n){n[n.Inactive=0]="Inactive",n[n.Initializing=1]="Initializing",n[n.Stopped=2]="Stopped",n[n.Running=3]="Running"})(D3e||(D3e={}));var k3e;(function(n){n[n.Valid=0]="Valid",n[n.Unreadable=1]="Unreadable",n[n.Error=2]="Error"})(k3e||(k3e={}));var Ane;(function(n){n[n.Variable=0]="Variable",n[n.Address=1]="Address"})(Ane||(Ane={}));var x6;(function(n){n[n.Initial=1]="Initial",n[n.Dynamic=2]="Dynamic"})(x6||(x6={}));var I3e;(function(n){n.UnverifiedBreakpoints="unverifiedBreakpoints"})(I3e||(I3e={}));var L3e;(function(n){n[n.CONDITION=0]="CONDITION",n[n.HIT_COUNT=1]="HIT_COUNT",n[n.LOG_MESSAGE=2]="LOG_MESSAGE",n[n.TRIGGER_POINT=3]="TRIGGER_POINT"})(L3e||(L3e={}));var Ene;(function(n){n[n.Command=0]="Command",n[n.Tree=1]="Tree"})(Ene||(Ene={}));var sDe;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(sDe||(sDe={}));var oDe;(function(n){n.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:P.revive(e.iconPath.light),dark:P.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),n.serialize=e=>e})(oDe||(oDe={}));var rDe;const zC="vs/workbench/contrib/quickaccess/browser/viewQuickAccess";var EP;let jV=(EP=class extends $Fe{constructor(e,t,i,s,o,r,a,c){super(rDe.PREFIX,{noResultsPick:{label:g(zC,0,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=s,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:dee(e,r.label,!0)??void 0},r.highlights.label||Hlt(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const s=[];let o;for(const r of t){if(o!==r.containerLabel){o=r.containerLabel;let a;i.has(o)?a=`${i.get(o)} / ${o}`:a=o,s.push({type:"separator",label:a})}s.push(r)}return s}doGetViewPickItems(){const e=[],t=(r,a)=>{const c=this.viewDescriptorService.getViewContainerModel(a),l=[];for(const d of c.allViewDescriptors)this.contextKeyService.contextMatchesRules(d.when)&&l.push({label:d.name.value,containerLabel:c.title,accept:()=>this.viewsService.openView(d.id,!0)});return l},i=(r,a)=>{const c=this.paneCompositeService.getPaneComposites(r),l=this.paneCompositeService.getVisiblePaneCompositeIds(r);c.sort((d,h)=>{let u=l.findIndex(p=>d.id===p),f=l.findIndex(p=>h.id===p);return u<0&&(u=c.indexOf(d)+l.length),f<0&&(f=c.indexOf(h)+l.length),u-f});for(const d of c)if(this.includeViewContainer(d)){const h=this.viewDescriptorService.getViewContainerById(d.id);h&&e.push({label:this.viewDescriptorService.getViewContainerModel(h).title,containerLabel:a,accept:()=>this.paneCompositeService.openPaneComposite(d.id,r,!0)})}};i(Sr.Sidebar,g(zC,1,"Side Bar")),i(Sr.Panel,g(zC,2,"Panel")),i(Sr.AuxiliaryBar,g(zC,3,"Secondary Side Bar"));const s=r=>{const a=this.paneCompositeService.getPaneComposites(r);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};s(Sr.Sidebar),s(Sr.Panel),s(Sr.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(zC,4,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(zC,5,"Terminal"),accept:async()=>{await this.terminalGroupService.showPanel(!0),this.terminalService.setActiveInstance(c)}})})}),this.debugService.getModel().getSessions(!0).filter(r=>r.hasSeparateRepl()).forEach((r,a)=>{const c=r.name;e.push({label:c,containerLabel:g(zC,6,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(x3e)||await this.viewsService.openView(x3e,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(zC,7,"Output"),accept:()=>this.outputService.showChannel(r.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},rDe=EP,EP.PREFIX="view ",EP);jV=rDe=D([_(0,z_),_(1,q_),_(2,nhe),_(3,Nz),_(4,NPe),_(5,LPe),_(6,Nw),_(7,Pe)],jV);const Zce=class Zce extends pi{constructor(){super({id:Zce.ID,title:Be(zC,8,"Open View"),category:Za.View,f1:!0})}async run(e){e.get(On).quickAccess.show(jV.PREFIX)}};Zce.ID="workbench.action.openView";let D6=Zce;const nR=class nR extends pi{constructor(){super({id:nR.ID,title:Be(zC,9,"Quick Open View"),category:Za.View,f1:!1,keybinding:{weight:ye.WorkbenchContrib,when:void 0,...nR.KEYBINDING}})}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(nR.ID);i.quickAccess.show(jV.PREFIX,{quickNavigateConfiguration:{keybindings:s},itemActivation:Qp.FIRST})}};nR.ID="workbench.action.quickOpenView",nR.KEYBINDING={primary:V.CtrlCmd|E.KeyQ,mac:{primary:V.WinCtrl|E.KeyQ},linux:{primary:0}};let xne=nR;const E_="vs/workbench/contrib/quickaccess/browser/quickAccess.contribution",oOe=it.as(xz.Quickaccess);oOe.registerQuickAccessProvider({ctor:a8,prefix:a8.PREFIX,placeholder:g(E_,0,"Type '{0}' to get help on the actions you can take from here.",a8.PREFIX),helpEntries:[{description:g(E_,1,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(E_,2,"More")}]});oOe.registerQuickAccessProvider({ctor:jV,prefix:jV.PREFIX,contextKey:"inViewsPicker",placeholder:g(E_,3,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(E_,4,"Open View"),commandId:D6.ID}]});oOe.registerQuickAccessProvider({ctor:FF,prefix:FF.PREFIX,contextKey:"inCommandsPicker",placeholder:g(E_,5,"Type the name of a command to run."),helpEntries:[{description:g(E_,6,"Show and Run Commands"),commandId:V1.ID,commandCenterOrder:20}]});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:V1.ID,title:g(E_,7,"&&Command Palette...")},order:1});Xs.appendMenuItem(Te.MenubarHelpMenu,{group:"1_welcome",command:{id:V1.ID,title:g(E_,8,"Show All Commands")},order:2});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:D6.ID,title:g(E_,9,"&&Open View...")},order:2});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(E_,10,"Go to &&Line/Column...")},order:1});Xs.appendMenuItem(Te.GlobalActivity,{group:"1_command",command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});Xs.appendMenuItem(Te.EditorContext,{group:"z_commands",when:X.editorSimpleInput.toNegated(),command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});At(g$t);At(V1);At(D6);At(xne);const b$t="inViewsPicker",xst=ge.and(aA,ge.has(b$t)),eH=xne.KEYBINDING,T3e="workbench.action.quickOpenNavigateNextInViewPicker";xr.registerCommandAndKeybindingRule({id:T3e,weight:ye.WorkbenchContrib+50,handler:Rhe(T3e,!0),when:xst,primary:eH.primary,linux:eH.linux,mac:eH.mac});const R3e="workbench.action.quickOpenNavigatePreviousInViewPicker";xr.registerCommandAndKeybindingRule({id:R3e,weight:ye.WorkbenchContrib+50,handler:Rhe(R3e,!1),when:xst,primary:eH.primary|V.Shift,linux:eH.linux,mac:{primary:eH.mac.primary|V.Shift}});const Ow=Il;var zH;let Dne=(zH=class extends ${constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},zH.ID="workbench.contrib.externalUriResolver",zH);Dne=D([_(0,fr),_(1,Ow)],Dne);const LB="vs/workbench/contrib/url/browser/trustedDomains",Dst=P.parse("trustedDomains:/Trusted Domains"),Hhe="http.linkProtectionTrustedDomains",aDe="http.linkProtectionTrustedDomainsContent",cDe={id:"workbench.action.manageTrustedDomain",description:{description:Be(LB,0,"Manage Trusted Domains"),args:[]},handler:async n=>{n.get(_i).openEditor({resource:Dst,languageId:"jsonc",options:{pinned:!0}})}};async function C$t(n,e,t,i,s,o,r){const a=P.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(LB,1,"Trust {0}",e),id:"trust",toTrust:e,picked:!0}),c.length===4&&c.every(p=>Number.isInteger(+p)||Number.isInteger(+p.split(":")[0]))){if(a.authority.includes(":")){const p=a.authority.split(":")[0];h.push({type:"item",label:g(LB,2,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(LB,3,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(LB,4,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(LB,5,"Manage Trusted Domains"),id:"manage"});const f=await i.pick(h,{activeItem:h[0]});if(f&&f.id)switch(f.id){case"manage":return await o.openEditor({resource:Dst.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),n;case"trust":{const p=f.toTrust;if(n.indexOf(p)===-1)return s.remove(aDe,ke.APPLICATION),s.store(Hhe,JSON.stringify([...n,p]),ke.APPLICATION,ln.USER),[...n,p]}}return[]}async function y$t(n){const{defaultTrustedDomains:e,trustedDomains:t}=kne(n);return{defaultTrustedDomains:e,trustedDomains:t}}function kne(n){const e=n.get(on),t=n.get(Xa),i=n.get(Ow),s=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Hhe,ke.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:s,trustedDomains:o}}const S$t="trustedDomains",A$t={type:an.File,ctime:Date.now(),mtime:Date.now(),size:0},kst=`// Links matching one or more entries in the list below can be opened without link protection. +`;t.dataTransfer.setData(sp.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=ef.uriToFileUri(p.resource);m.scheme===pe.file&&t.dataTransfer.setData(sp.DOWNLOAD_URL,[Us.binary,_i(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(sp.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=Qe.as(AMe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(xve(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Na.getCanonicalUri(m)})}else if(N.isUri(f)){const{selection:m,uri:v}=KLe(f);p={resource:v,options:m?{selection:m}:void 0}}else f.isDirectory||(p={resource:f.resource});if(p){{const m=p.resource;if(m){const v=n.files.get(m);v&&(typeof p.languageId!="string"&&(p.languageId=v.getLanguageId()),typeof p.encoding!="string"&&(p.encoding=v.getEncoding()),typeof p.contents!="string"&&v.isDirty()&&!v.textEditorModel.isTooLargeForHeapOperation()&&(p.contents=v.textEditorModel.getValue())),p.options?.viewState||(p.options={...p.options,viewState:(()=>{for(const b of o.visibleEditorPanes)if(ji(b.input.resource,m)){const w=b.getViewState();if(w)return w}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(PM.EDITORS,eje(u));const f=[];for(const p of u)p.resource?f.push(p.resource):E_(p)?p.modified.resource&&f.push(p.modified.resource):kS(p)?p.primary.resource&&f.push(p.primary.resource):wb(p)&&f.push(p.result.resource);t.dataTransfer.setData(Us.uriList,Zk.create(f.slice(0,1))),t.dataTransfer.setData(sp.INTERNAL_URI_LIST,Zk.create(f))}}class H5t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class A4{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class E4{constructor(e){this.viewId=e}get id(){return this.viewId}}class gS extends V{static get INSTANCE(){return gS.instance||(gS.instance=new gS,A2(gS.instance)),gS.instance}constructor(){super(),this.transferData=fX.getInstance(),this.onDragStart=this._register(new I),this.onDragEnd=this._register(new I),this._register(this.onDragEnd.event(e=>{const t=e.dragAndDropData.getData().id,i=e.dragAndDropData.getData().type;this.readDragData(i)?.getData().id===t&&this.transferData.clearData(i==="view"?E4.prototype:A4.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?E4.prototype:A4.prototype)){const t=this.transferData.getData(e==="view"?E4.prototype:A4.prototype);if(t&&t[0])return new H5t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new E4(e):new A4(e)],t==="view"?E4.prototype:A4.prototype)}registerTarget(e,t){const i=new Z;return i.add(new $j(e,{onDragEnter:n=>{if(n.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:n,dragAndDropData:o})}},onDragLeave:n=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:n,dragAndDropData:o})},onDrop:n=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:n,dragAndDropData:o}),this.onDragEnd.fire({eventData:n,dragAndDropData:o})}},onDragOver:n=>{if(n.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:n,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(n=>{t.onDragStart(n)},this,i),t.onDragEnd&&this.onDragEnd.event(n=>{t.onDragEnd(n)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const n=new Z;return n.add(new $j(e,{onDragStart:o=>{const{id:r,type:a}=t();this.writeDragData(r,a),o.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:o,dragAndDropData:this.readDragData(a)})},onDragEnd:o=>{const{type:r}=t(),a=this.readDragData(r);a&&this.onDragEnd.fire({eventData:o,dragAndDropData:a})},onDragEnter:o=>{if(i.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;r&&i.onDragEnter({eventData:o,dragAndDropData:r})}},onDragLeave:o=>{const r=this.readDragData("composite")||this.readDragData("view");r&&i.onDragLeave?.({eventData:o,dragAndDropData:r})},onDrop:o=>{if(i.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDrop({eventData:o,dragAndDropData:r}),this.onDragEnd.fire({eventData:o,dragAndDropData:r})}},onDragOver:o=>{if(i.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDragOver({eventData:o,dragAndDropData:r})}}})),i.onDragStart&&this.onDragStart.event(o=>{i.onDragStart(o)},this,n),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,n),this._register(n)}}function FVe(s,e,t){s&&(s.dropEffect=t?e:"none")}let OVe=class{constructor(e,t){this.toResource=e,this.instantiationService=t}getDragURI(e){const t=this.toResource(e);return t?t.toString():null}getDragLabel(e){const t=Fi(e.map(this.toResource));return t.length===1?_i(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const n of e.elements){const o=this.toResource(n);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(n=>nit(n,i,t))}onDragOver(e,t,i,n,o){return!1}drop(e,t,i,n,o){}dispose(){}};OVe=D([_(1,we)],OVe);const Loe=class Loe extends V{constructor(){super(),this.broadcaster=this._register(new INe(Loe.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(M.runAndSubscribe(tm,({window:e,disposables:t})=>{t.add(ue(e,ke.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(ue(e,ke.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:si,disposables:this._store})),this._register(this.broadcaster.onDidReceiveData(e=>{e===!0?this.markDraggedOver(!0):this.clearDraggedOver(!0)}))}get isDraggedOver(){return this.draggedOver}markDraggedOver(e){this.draggedOver!==!0&&(this.draggedOver=!0,e||this.broadcaster.postData(!0))}clearDraggedOver(e){this.draggedOver!==!1&&(this.draggedOver=!1,e||this.broadcaster.postData(!1))}};Loe.CHANNEL_NAME="monaco-workbench-global-dragged-over";let lSe=Loe;new lSe;class U5t{constructor(e,t,i){if(this.location=t,this.parent=i,t[t.length-1]==="\\")throw Error("Unexpected path format, do not use trailing backslashes");t[t.length-1]!=="/"&&(t+="/"),this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}updateContents(e){this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}isPathIncludedInTraversal(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);return!this.isPathIgnored(e,t)}isArbitraryPathIgnored(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);const i=e.split("/").filter(r=>r);let n=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of n)o[r]=!0;return j_(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const n=e.split(` +`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=n.filter(m=>!m.endsWith("/")),r=o.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(r,t,!0),c=o.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),l=this.gitignoreLinesToExpression(c,t,!1),d=n.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=n.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),f=this.gitignoreLinesToExpression(u,t,!1);return(m,v)=>m.startsWith(t)?v&&h(m)&&!f(m)||a(m)&&!l(m)?!0:i?i.isPathIgnored(m,v):!1:!1}gitignoreLineToGlob(e,t){const i=e.indexOf("/");return i===-1||i===e.length-1?e="**/"+e:(i===0?t.slice(-1)==="/"&&(e=e.slice(1)):t.slice(-1)!=="/"&&(e="/"+e),e=t+e),e}}var dSe;(function(s){s.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(dSe||(dSe={}));class V5t{constructor(){this._onDidRegisterDescriptor=new I,this.onDidRegisterDescriptor=this._onDidRegisterDescriptor.event,this.descriptors=[]}register(e){this.descriptors.push(e),this._onDidRegisterDescriptor.fire(e)}create(e,t,i){return this.descriptors.map(n=>{const o=n.create(e,t);return i.add(o),o})}}const hSe=new V5t;Qe.add(dSe.FileContributionRegistry,hSe);var uSe,Cv;const Roe=class Roe{getHeight(e){return Roe.ITEM_HEIGHT}getTemplateId(e){return OZ.ID}};Roe.ITEM_HEIGHT=22;let PZ=Roe;const gSe=new I;let fSe=class{constructor(e,t,i,n,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=n,this.layoutService=o,this.fileService=r,this.explorerService=a,this.contextService=c,this.filesConfigService=l}hasChildren(e){return Array.isArray(e)||e.hasChildren(t=>this.fileFilter.filter(t,qs.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,n=e.fetchChildren(i);if(Array.isArray(n))return n;const o=n.then(r=>(e instanceof Gd&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==qi.FOLDER&&gSe.fire(e.resource),r),r=>{if(e instanceof Gd&&e.isRoot)if(this.contextService.getWorkbenchState()===qi.FOLDER){const a=new Gd(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else gSe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:ud.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};fSe=D([_(1,cg),_(2,Te),_(3,bi),_(4,kI),_(5,Jt),_(6,vf),_(7,yi),_(8,_d)],fSe);const dFe=class dFe{get index(){return this._index}get count(){return this.items.length}get current(){return this.items[this._index]}get currentId(){return`${this.id}_${this.index}`}get labels(){return this._labels}constructor(e,t,i,n,o){this.id=e,this.items=t,this.depth=n,this.collapsed=o,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._index=t.length-1,this.updateLabels(i),this._updateLabelDisposable=i.label.onDidRender(()=>this.updateLabels(i))}updateLabels(e){this._labels=Array.from(e.container.querySelectorAll(".label-name"));let t="";for(let i=0;i=this.items.length-1||this.setIndex(this._index+1)}first(){this._index!==0&&this.setIndex(0)}last(){this._index!==this.items.length-1&&this.setIndex(this.items.length-1)}setIndex(e){e<0||e>=this.items.length||(this.labels[this._index].classList.remove("active"),this._index=e,this.labels[this._index].classList.add("active"),this._onDidChange.fire())}updateCollapsed(e){this.collapsed=e;for(let t=0;t{const f=this.configurationService.getValue("workbench.tree.indent"),p=Math.max(22-f,0);e.style.setProperty("--vscode-explorer-align-offset-margin-left",`${p}px`)};this.configListener=this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("explorer")&&(this.config=this.configurationService.getValue()),f.affectsConfiguration("workbench.tree.indent")&&u()}),u()}getWidgetAriaLabel(){return g(11260,"Files Explorer")}get templateId(){return uSe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{o.currentContext&&this.updateWidth(o.currentContext)}catch{}}));const n=hSe.create(this.instantiationService,e,t);t.add(hSe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);n.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:n};return o}renderElement(e,t,i){const n=e.element;i.currentContext=n;const o=this.explorerService.getEditableData(n);i.label.element.classList.remove("compressed"),o?(i.label.element.style.display="none",i.contribs.forEach(r=>r.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,n,o))):(i.label.element.style.display="flex",this.renderStat(n,n.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,n){const o=e.element.elements[e.element.elements.length-1];i.currentContext=o;const r=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=r.length===0?void 0:this.explorerService.getEditableData(r[0]);if(a)i.label.element.classList.remove("compressed"),i.label.element.style.display="none",i.contribs.forEach(c=>c.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,r[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${FZ.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new FZ(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(o)??[];this.compressedNavigationControllers.set(o,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(ue(i.container,"mousedown",u=>{const f=BZ(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(o)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(o):u.splice(f,1)}))}}renderStat(e,t,i,n,o){o.label.element.style.display="flex";const r=["explorer-item"];this.explorerService.isCut(e)&&r.push("cut");const a=this.themeService.getFileIconTheme();o.container.parentElement?.parentElement?.querySelector(".monaco-tl-twistie")?.classList.toggle("force-twistie",e.hasNests&&a.hidesExplorerArrows);const l=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),d=e.nestedParent&&l;o.contribs.forEach(h=>h.setResource(e.resource)),o.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?ba.ROOT_FOLDER:e.isDirectory?ba.FOLDER:ba.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:xU(n),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const n=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?ba.ROOT_FOLDER:t.isDirectory?ba.FOLDER:ba.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:r,extraClasses:l?[...o,"align-nest-icon-with-parent-icon"]:o},h=t.name?Lr(t.resource):t.resource,u=t.name||"";n.setFile(Pt(h,u||" "),d),n.element.firstElementChild.style.display="none";const f=new eYe(n.element,this.contextViewService,{validationOptions:{validation:y=>{const C=i.validationMessage(y);return!C||C.severity!==Xe.Error?null:{content:C.content,formatContent:!0,type:Xl.ERROR}}},ariaLabel:g(11261,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:EM}),p=u.lastIndexOf(".");let m="prefix";f.value=u,f.focus(),f.select({start:0,end:p>0&&!t.isDirectory?p:u.length});const v=hm((y,C)=>{n.element.style.display="none";const A=f.value;bt(w),n.element.remove(),C&&i.onFinish(A,y)}),b=()=>{if(f.isInputValid()){const y=i.validationMessage(f.value);y?f.showMessage({content:y.content,formatContent:!0,type:y.severity===Xe.Info?Xl.INFO:y.severity===Xe.Warning?Xl.WARNING:Xl.ERROR}):f.hideMessage()}};b();const w=[f,f.onDidChange(y=>{n.setFile(Pt(h,y||" "),d)}),Ro(f.inputElement,ke.KEY_DOWN,y=>{if(y.equals(S.F2)){const C=f.value.lastIndexOf(".");if(t.isDirectory||C===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:C+1,end:f.value.length})):(m="prefix",f.select({start:0,end:C}))}else y.equals(S.Enter)?f.validate()||v(!0,!0):y.equals(S.Escape)&&v(!1,!0)}),Ro(f.inputElement,ke.KEY_UP,y=>{b()}),ue(f.inputElement,ke.BLUR,async()=>{for(;;){await Sr(0);const y=f.inputElement.ownerDocument;if(!y.hasFocus())break;if(av(f.inputElement))return;if(Yr(y.activeElement)&&pq(y.activeElement,"context-view"))await M.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),n];return Ee(()=>{v(!1,!1)})}disposeElement(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeCompressedElements(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}getCompressedNavigationController(e){return this.compressedNavigationControllers.get(e)}getAriaLabel(e){return e.name}getAriaLevel(e){let t=0,i=e.parent;for(;i;)i=i.parent,t++;return this.contextService.getWorkbenchState()===qi.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},uSe=SR,SR.ID="file",SR);OZ=uSe=D([_(3,mf),_(4,pn),_(5,Te),_(6,vf),_(7,Fs),_(8,yi),_(9,lr),_(10,we)],OZ);let pSe=class{constructor(e,t,i,n,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=n,this.uriIdentityService=o,this.fileService=r,this.hiddenExpressionPerRoot=new Map,this.editorsAffectingFilter=new Set,this._onDidChange=new I,this.toDispose=[],this.ignoreFileResourcesPerRoot=new Map,this.ignoreTreesPerRoot=new Map,this.toDispose.push(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateConfiguration())),this.toDispose.push(this.configurationService.onDidChangeConfiguration(a=>{(a.affectsConfiguration("files.exclude")||a.affectsConfiguration("explorer.excludeGitIgnore"))&&this.updateConfiguration()})),this.toDispose.push(this.fileService.onDidFilesChange(a=>{for(const[c,l]of this.ignoreFileResourcesPerRoot.entries())l.forEach(async d=>{a.contains(d,To.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,To.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(Lr(d)),l.delete(d),this._onDidChange.fire())})})),this.toDispose.push(this.editorService.onDidVisibleEditorsChange(()=>{const a=this.editorService.visibleEditors;let c=!1;for(const l of a){if(!l.resource)continue;const d=this.explorerService.findClosest(l.resource);if(d&&d.isExcluded){c=!0;break}}for(const l of this.editorsAffectingFilter)if(!a.includes(l)){c=!0;break}c&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())})),this.updateConfiguration()}get onDidChange(){return this._onDidChange.event}updateConfiguration(){let e=!1,t=!1;this.contextService.getWorkspace().folders.forEach(i=>{const n=this.configurationService.getValue({resource:i.uri}),o=n?.files?.exclude||Object.create(null),r=n.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new Dk),this.ignoreTreesPerRoot.set(i.uri.toString(),Dh.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!r&&this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.delete(i.uri.toString()),this.ignoreTreesPerRoot.delete(i.uri.toString())),!e){const c=this.hiddenExpressionPerRoot.get(i.uri.toString());e=!c||!Ys(c.original,o)}const a=xs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:j_(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const n=Lr(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(n))return;const r=await this.fileService.readFile(t);if(i)o.get(n)?.updateContents(r.value.toString());else{const a=o.findSubstr(n),c=new U5t(r.value.toString(),n.path,a);o.set(n,c),this.ignoreFileResourcesPerRoot.get(e)?.has(t)||this.ignoreFileResourcesPerRoot.get(e)?.add(t)}this._onDidChange.fire()}filter(e,t){return e.name===".gitignore"&&this.ignoreTreesPerRoot.has(e.root.resource.toString())?(this.processIgnoreFile(e.root.resource.toString(),e.resource,!1),!0):this.isVisible(e,t)}isVisible(e,t){if(e.isExcluded=!1,t===qs.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const n=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(k2(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(n?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||n||e.parent?.isExcluded){e.isExcluded=!0;const l=this.editorService.visibleEditors.find(d=>d.resource&&this.uriIdentityService.extUri.isEqualOrParent(d.resource,e.resource));return l&&e.root===this.explorerService.findClosestRoot(e.resource)?(this.editorsAffectingFilter.add(l),!0):!1}return!0}dispose(){bt(this.toDispose)}};pSe=D([_(0,yi),_(1,Te),_(2,vf),_(3,ei),_(4,ks),_(5,Jt)],pSe);let mSe=class{constructor(e,t){this.explorerService=e,this.contextService=t}compare(e,t){if(e.isRoot){if(t.isRoot){const a=this.contextService.getWorkspaceFolder(e.resource),c=this.contextService.getWorkspaceFolder(t.resource);return a&&c?a.index-c.index:-1}return-1}if(t.isRoot)return 1;const i=this.explorerService.sortOrderConfiguration.sortOrder,n=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(n){case"upper":o=GDt,r=jDt;break;case"lower":o=KDt,r=YDt;break;case"unicode":o=qDt,r=JDt;break;default:o=$Dt,r=QDt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return o(e.name,t.name);break;case"filesFirst":if(e.isDirectory&&!t.isDirectory)return 1;if(t.isDirectory&&!e.isDirectory)return-1;break;case"foldersNestsFiles":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.hasNests&&!t.hasNests)return-1;if(t.hasNests&&!e.hasNests)return 1;break;case"mixed":break;default:if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;break}switch(i){case"type":return r(e.name,t.name);case"modified":return e.mtime!==t.mtime?e.mtime&&t.mtime&&e.mtime{(!u||u.affectsConfiguration("explorer.enableDragAndDrop"))&&(this.dropEnabled=this.configurationService.getValue("explorer.enableDragAndDrop"))};h(void 0),this.disposables.add(this.configurationService.onDidChangeConfiguration(u=>h(u)))}onDragOver(e,t,i,n,o){if(!this.dropEnabled)return!1;if(t){const r=Cv.getCompressedStatFromDragEvent(t,o);if(r){const a=BZ(o.target);if(a&&a.index{a.element.classList.remove("drop-target"),this.compressedDragOverElement=void 0}),a.element.classList.add("drop-target")),typeof c=="boolean"?c:{...c,feedback:[]}):(this.compressedDropTargetDisposable.dispose(),!1)}}}return this.compressedDropTargetDisposable.dispose(),this.handleDragOver(e,t,i,n,o)}handleDragOver(e,t,i,n,o){const r=o&&(o.ctrlKey&&!Qt||o.altKey&&Qt),a=e instanceof t_e,l={type:a||r?T1.Copy:T1.Move,position:by.Over};if(a){if(!rZe(o,sp.FILES,PM.FILES,sp.RESOURCES))return!1}else{if(e instanceof yje)return!1;{const d=Cv.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!r&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:T1.Move,position:by.After}}:{accept:!0,bubble:M1.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!r&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!r&&this.uriIdentityService.extUri.isEqual(Lr(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(n){case IC.TOP:case IC.CENTER_TOP:u=by.Before;break;case IC.CENTER_BOTTOM:case IC.BOTTOM:u=by.After;break}return{accept:!0,effect:{type:T1.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:M1.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:M1.Up,effect:l}}else return{accept:!0,bubble:M1.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Cv.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Cv.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>nit(o,i,t));const n=i.filter(o=>o.resource.scheme===pe.file).map(o=>o.resource.fsPath);n.length&&t.dataTransfer.setData(PM.FILES,JSON.stringify(n))}}async drop(e,t,i,n,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=Cv.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],n=IC.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof t_e?!Wn||Py(this.contextService.getWorkspace())&&Yp.supported(si)?await this.instantiationService.createInstance(oSe).import(r,o,si):await this.instantiationService.createInstance(NZ).upload(t,o):await this.handleExplorerDrop(e,r,i,n,o)}catch(a){this.dialogService.error(Nr(a))}}async handleExplorerDrop(e,t,i,n,o){const r=Cv.getStatsFromDragAndDropData(e),a=new Map(r.map(u=>[u,this.isCollapsed(u)]));for(const[u,f]of a)if(f){const p=u.nestedChildren;if(p)for(const m of p)a.set(m,!0)}const c=Ilt([...a.keys()],u=>u.resource),l=o.ctrlKey&&!Qt||o.altKey&&Qt;if(!l&&this.configurationService.getValue(Cv.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(11262,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(11263,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(11264,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(11265,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?Gtt(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(11266,"Do not ask me again")},primaryButton:g(11267,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(Cv.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,n);const h=c.filter(u=>!u.isRoot);return l?this.doHandleExplorerDropOnCopy(h,t):this.doHandleExplorerDropOnMove(h,t)}async doHandleRootDrop(e,t,i){if(e.length===0)return;const n=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==n[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case IC.BOTTOM:case IC.CENTER_BOTTOM:o++;break}for(const l of r)l{const c=a.newResource?this.explorerService.findClosest(a.newResource):void 0;return c&&!c.isDirectory}).map(a=>({resource:a.newResource,options:{pinned:!0}}));await this.editorService.openEditors(r)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(r=>!r.isReadonly).map(r=>new cp(r.resource,Pt(t.resource,r.name))),n=BVe(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===RT.Verbose,undoLabel:g(11270,"Move {0}",n),progressLabel:g(11271,"Moving {0}",n)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Qi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=E5t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new cp(d.oldResource,d.newResource,{overwrite:!0})),o)}else throw r}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Cv.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=ct(t).document.elementFromPoint(t.clientX,t.clientY),n=BZ(i);if(n){const{count:o,index:r}=n;let a=o-1;for(;a>r&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Cv=AR,AR.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",AR);_Se=Cv=D([_(1,vf),_(2,ei),_(3,to),_(4,yi),_(5,Jt),_(6,Te),_(7,we),_(8,iC),_(9,ks)],_Se);function BZ(s){if(!Yr(s))return null;let e=s;for(;e&&!e.classList.contains("monaco-list-row");){if(e.classList.contains("label-name")&&e.hasAttribute("data-icon-label-count")){const t=Number(e.getAttribute("data-icon-label-count")),i=Number(e.getAttribute("data-icon-label-index"));if(lc(t)&&lc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function z5t(s){return!!BZ(s)}class $5t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Dce||!e.parent||e.parent.isRoot}}function BVe(s){return s.length===1?s[0].name:s.every(e=>e.isDirectory)?g(11272,"{0} folders",s.length):s.every(e=>!e.isDirectory)?g(11273,"{0} files",s.length):`${s.length} files and folders`}function G5t(s){if(s.isRoot&&s.error)return{tooltip:g(11256,"Unable to resolve workspace folder ({0})",Nr(s.error)),letter:"!",color:gpt};if(s.isSymbolicLink)return{tooltip:g(11257,"Symbolic Link"),letter:"⤷"};if(s.isUnknown)return{tooltip:g(11258,"Unknown File Type"),letter:"?"};if(s.isExcluded)return{color:vpt}}let vSe=class{constructor(e,t){this.explorerService=e,this.label=g(11259,"Explorer"),this._onDidChange=new I,this.toDispose=new Z,this.toDispose.add(this._onDidChange),this.toDispose.add(t.onDidChangeWorkspaceFolders(i=>{this._onDidChange.fire(i.changed.concat(i.added).map(n=>n.uri))})),this.toDispose.add(gSe.event(i=>{this._onDidChange.fire([i])}))}get onDidChange(){return this._onDidChange.event}async provideDecorations(e){const t=this.explorerService.findClosest(e);if(!t)throw new Error("ExplorerItem not found");return G5t(t)}dispose(){this.toDispose.dispose()}};vSe=D([_(0,vf),_(1,yi)],vSe);var K5t=".monaco-pane-view .split-view-view:first-of-type>.pane>.pane-header{border-top:none!important}.monaco-pane-view .split-view-view:first-of-type>.pane{border-left:none!important}.monaco-pane-view .pane>.pane-header{position:relative}.monaco-pane-view .pane>.pane-header.not-collapsible .twisty-container{display:none}.monaco-pane-view .pane>.pane-header.not-collapsible .title{margin-left:8px}.monaco-pane-view .pane.expanded>.pane-header>.actions.show-expanded,.monaco-pane-view .pane>.pane-header>.actions.show-always{display:initial}.monaco-pane-view .pane>.pane-header>.icon{display:none;height:16px;width:16px}.monaco-pane-view .pane.pane.horizontal:not(.expanded)>.pane-header>.icon{display:inline;margin-top:4px}.monaco-pane-view .pane>.pane-header h3.title{-webkit-margin-before:0;-webkit-margin-after:0;font-size:11px;min-width:3ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description{display:block;flex-shrink:100000;font-weight:400;margin-left:10px;opacity:.6;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description .codicon{font-size:9px;margin-left:2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header .description,.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header h3.title,.monaco-pane-view .pane>.pane-header:not(.expanded) .description{display:none}.monaco-pane-view .pane .monaco-progress-container{left:0;position:absolute;top:-2px;z-index:5}.monaco-pane-view .pane:not(.merged-header) .monaco-progress-container{top:20px}";ut(K5t,{});var q5t=".monaco-pane-view{height:100%;width:100%}.monaco-pane-view .pane{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.monaco-pane-view .pane.horizontal:not(.expanded){flex-direction:row}.monaco-pane-view .pane>.pane-header{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:11px;font-weight:700;height:22px;overflow:hidden}.monaco-pane-view .pane>.pane-header.not-collapsible{cursor:default}.monaco-pane-view .pane>.pane-header>.title{text-transform:uppercase}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header{flex-direction:column;height:100%;width:22px}.monaco-pane-view .pane>.pane-header>.codicon:first-of-type{margin:0 2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header>.codicon:first-of-type{margin:2px}.monaco-pane-view .pane>.pane-header>.actions{display:none;margin-left:auto}.monaco-pane-view .pane>.pane-header>.actions .action-item{margin-right:4px}.monaco-pane-view .pane>.pane-header>.actions .action-label{padding:2px}.monaco-pane-view .pane:focus-within>.pane-header.expanded>.actions,.monaco-pane-view .pane:hover>.pane-header.expanded>.actions,.monaco-pane-view .pane>.pane-header.actions-always-visible.expanded>.actions,.monaco-pane-view .pane>.pane-header.focused.expanded>.actions{display:initial}.monaco-pane-view .pane>.pane-header .monaco-action-bar .action-item.select-container{cursor:default}.monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{cursor:pointer;min-height:18px;min-width:110px;padding:2px 23px 2px 8px}.linux .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box,.windows .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{padding:0 23px 0 8px}.monaco-pane-view:lang(ja) .pane>.pane-header,.monaco-pane-view:lang(ko) .pane>.pane-header,.monaco-pane-view:lang(zh-Hans) .pane>.pane-header,.monaco-pane-view:lang(zh-Hant) .pane>.pane-header{font-weight:400}.monaco-pane-view .pane>.pane-header.hidden{display:none}.monaco-pane-view .pane>.pane-body{flex:1;overflow:hidden}.monaco-pane-view.animated .split-view-view{transition-duration:.15s;transition-timing-function:ease-out}.reduce-motion .monaco-pane-view .split-view-view{transition-duration:0s!important}.monaco-pane-view.animated.vertical .split-view-view{transition-property:height}.monaco-pane-view.animated.horizontal .split-view-view{transition-property:width}#monaco-pane-drop-overlay{box-sizing:border-box;height:100%;left:0;position:absolute;width:100%;z-index:10000}#monaco-pane-drop-overlay>.pane-overlay-indicator{height:100%;min-height:22px;min-width:19px;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:100%}#monaco-pane-drop-overlay>.pane-overlay-indicator.overlay-move-transition{transition:top 70ms ease-out,left 70ms ease-out,width 70ms ease-out,height 70ms ease-out,opacity .15s ease-out}";ut(q5t,{});const Jz=class Jz extends V{get ariaHeaderLabel(){return this._ariaHeaderLabel}set ariaHeaderLabel(e){this._ariaHeaderLabel=e,this.header.setAttribute("aria-label",this.ariaHeaderLabel)}get draggableElement(){return this.header}get dropTargetElement(){return this.element}get dropBackground(){return this.styles.dropBackground}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize=e,this._onDidChange.fire(void 0)}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize=e,this._onDidChange.fire(void 0)}get headerSize(){return this.headerVisible?Jz.HEADER_SIZE:0}get minimumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.minimumBodySize:0;return e+i}get maximumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.maximumBodySize:0;return e+i}constructor(e){super(),this.expandedSize=void 0,this._headerVisible=!0,this._collapsible=!0,this._bodyRendered=!1,this.styles={dropBackground:void 0,headerBackground:void 0,headerBorder:void 0,headerForeground:void 0,leftBorder:void 0},this.animationTimer=void 0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeExpansionState=this._register(new I),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this.orthogonalSize=0,this._expanded=typeof e.expanded>"u"?!0:!!e.expanded,this._orientation=typeof e.orientation>"u"?fi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(9986,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===fi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=fe(".pane")}isExpanded(){return this._expanded}setExpanded(e){return!e&&!this.collapsible||this._expanded===!!e?!1:(this.element?.classList.toggle("expanded",e),this._expanded=!!e,this.updateHeader(),e?(this._bodyRendered||(this.renderBody(this.body),this._bodyRendered=!0),typeof this.animationTimer=="number"&&ct(this.element).clearTimeout(this.animationTimer),re(this.element,this.body)):this.animationTimer=ct(this.element).setTimeout(()=>{this.body.remove()},200),this._onDidChangeExpansionState.fire(e),this._onDidChange.fire(e?this.expandedSize:void 0),!0)}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible!==!!e&&(this._headerVisible=!!e,this.updateHeader(),this._onDidChange.fire(void 0))}get collapsible(){return this._collapsible}set collapsible(e){this._collapsible!==!!e&&(this._collapsible=!!e,this.updateHeader())}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.element&&(this.element.classList.toggle("horizontal",this.orientation===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL),this.header=fe(".pane-header"),re(this.element,this.header),this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button"),this.header.setAttribute("aria-label",this.ariaHeaderLabel),this.renderHeader(this.header);const e=Ac(this.header);this._register(e),this._register(e.onDidFocus(()=>this.header.classList.add("focused"),null)),this._register(e.onDidBlur(()=>this.header.classList.remove("focused"),null)),this.updateHeader();const t=this._register(new Z),i=this._register(new ii(this.header,"keydown")),n=M.map(i.event,o=>new En(o),t);this._register(M.filter(n,o=>o.keyCode===S.Enter||o.keyCode===S.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(M.filter(n,o=>o.keyCode===S.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(M.filter(n,o=>o.keyCode===S.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(fd.addTarget(this.header)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=re(this.element,fe(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?Jz.HEADER_SIZE:0,i=this._orientation===fi.VERTICAL?this.orthogonalSize:e,n=this._orientation===fi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(n,i),this.expandedSize=e)}style(e){this.styles=e,this.header&&this.updateHeader()}updateHeader(){const e=!this.headerVisible||this.isExpanded();this.collapsible?(this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button")):(this.header.removeAttribute("tabindex"),this.header.removeAttribute("role")),this.header.style.lineHeight=`${this.headerSize}px`,this.header.classList.toggle("hidden",!this.headerVisible),this.header.classList.toggle("expanded",e),this.header.classList.toggle("not-collapsible",!this.collapsible),this.header.setAttribute("aria-expanded",String(e)),this.header.style.color=this.collapsible?this.styles.headerForeground??"":"",this.header.style.backgroundColor=(this.collapsible?this.styles.headerBackground:"transparent")??"",this.header.style.borderTop=this.styles.headerBorder&&this.orientation===fi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===fi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};Jz.HEADER_SIZE=22;let bSe=Jz;const Moe=class Moe extends V{constructor(e,t,i){super(),this.pane=e,this.dnd=t,this.context=i,this.dragOverCounter=0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,e.draggableElement.draggable=!0,this._register(ue(e.draggableElement,"dragstart",n=>this.onDragStart(n))),this._register(ue(e.dropTargetElement,"dragenter",n=>this.onDragEnter(n))),this._register(ue(e.dropTargetElement,"dragleave",n=>this.onDragLeave(n))),this._register(ue(e.dropTargetElement,"dragend",n=>this.onDragEnd(n))),this._register(ue(e.dropTargetElement,"drop",n=>this.onDrop(n)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",rf&&e.dataTransfer?.setData(sp.TEXT,this.pane.draggableElement.textContent||"");const t=re(this.pane.element.ownerDocument.body,fe(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>t.remove(),0),this.context.draggable=this}onDragEnter(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter++,this.render())}onDragLeave(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter--,this.dragOverCounter===0&&this.render())}onDragEnd(e){this.context.draggable&&(this.dragOverCounter=0,this.render(),this.context.draggable=null)}onDrop(e){this.context.draggable&&(en.stop(e),this.dragOverCounter=0,this.render(),this.dnd.canDrop(this.context.draggable.pane,this.pane)&&this.context.draggable!==this&&this._onDidDrop.fire({from:this.context.draggable.pane,to:this.pane}),this.context.draggable=null)}render(){let e=null;this.dragOverCounter>0&&(e=this.pane.dropBackground??Moe.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Moe.DefaultDragOverBackgroundColor=new me(new dn(128,128,128,.5));let wSe=Moe;class Q5t extends V{constructor(e,t={}){super(),this.dndContext={draggable:null},this.paneItems=[],this.orthogonalSize=0,this.size=0,this.animationTimer=void 0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,this.dnd=t.dnd,this.orientation=t.orientation??fi.VERTICAL,this.element=re(e,fe(".monaco-pane-view")),this.splitview=this._register(new C3(this.element,{orientation:this.orientation})),this.onDidSashReset=this.splitview.onDidSashReset,this.onDidSashChange=this.splitview.onDidSashChange,this.onDidScroll=this.splitview.onDidScroll;const i=this._register(new Z),n=this._register(new ii(this.element,"keydown")),o=M.map(M.filter(n.event,r=>Yr(r.target)&&r.target.classList.contains("pane-header"),i),r=>new En(r),i);this._register(M.filter(o,r=>r.keyCode===S.UpArrow,i)(()=>this.focusPrevious())),this._register(M.filter(o,r=>r.keyCode===S.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const n=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,n);const o={pane:e,disposable:n};if(this.paneItems.splice(i,0,o),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const r=new wSe(e,this.dnd,this.dndContext);n.add(r),n.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?Kk.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),n=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||n===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,o),this.splitview.moveView(i,n)}resizePane(e,t){const i=this.paneItems.findIndex(n=>n.pane===e);i!==-1&&this.splitview.resizeView(i,t)}getPaneSize(e){const t=this.paneItems.findIndex(i=>i.pane===e);return t===-1?-1:this.splitview.getViewSize(t)}layout(e,t){this.orthogonalSize=this.orientation===fi.VERTICAL?t:e,this.size=this.orientation===fi.HORIZONTAL?t:e;for(const i of this.paneItems)i.pane.orthogonalSize=this.orthogonalSize;this.splitview.layout(this.size)}setBoundarySashes(e){this.boundarySashes=e,this.updateSplitviewOrthogonalSashes(e)}updateSplitviewOrthogonalSashes(e){this.orientation===fi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===fi.VERTICAL?fi.HORIZONTAL:fi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Ms(this.element),this.splitview=this._register(new C3(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const n=this.orientation===fi.VERTICAL?t:e,o=this.orientation===fi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=n,r.pane.orientation=this.orientation;const c=this.size===0?0:o*i[a]/this.size;this.splitview.addView(r.pane,c,a)}),this.size=o,this.orthogonalSize=n,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&&ct(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=ct(this.element).setTimeout(()=>{this.animationTimer=void 0,this.element.classList.remove("animated")},200)}getPaneHeaderElements(){return[...this.element.querySelectorAll(".pane-header")]}focusPrevious(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.max(t-1,0)].focus()}focusNext(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.min(t+1,e.length-1)].focus()}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose())}}var qc;(function(s){let e;(function(n){n[n.None=0]="None",n[n.Done=1]="Done",n[n.Infinite=2]="Infinite",n[n.While=3]="While",n[n.Work=4]="Work"})(e=s.Type||(s.Type={})),s.None={type:e.None},s.Done={type:e.Done},s.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}s.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}s.Work=i})(qc||(qc={}));class j5t extends V{constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=qc.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==qc.Done.type)if(this.progressState.type===qc.Type.While){let e;if(this.progressState.whileDelay>0){const t=this.progressState.whileDelay-(Date.now()-this.progressState.whileStart);t>0&&(e=t)}this.doShowWhile(e)}else this.progressState.type===qc.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===qc.Type.Work&&(this.progressState.total&&this.progressBar.total(this.progressState.total).show(),this.progressState.worked&&this.progressBar.worked(this.progressState.worked).show())}onDidScopeDeactivate(){this.progressBar.stop().hide()}show(e,t){return typeof e=="boolean"?this.progressState=qc.Infinite:this.progressState=new qc.Work(e,void 0),this.scope.isActive&&(this.progressState.type===qc.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===qc.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new qc.Work(i,this.progressState.type===qc.Type.Work?this.progressState.worked:void 0),this.scope.isActive&&this.progressBar.total(i)},worked:i=>{!this.scope.isActive||this.progressBar.hasTotal()?(this.progressState=new qc.Work(this.progressState.type===qc.Type.Work?this.progressState.total:void 0,this.progressState.type===qc.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=qc.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=qc.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===qc.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new qc.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==qc.Type.While||this.progressState.whilePromise===e)&&(this.progressState=qc.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class Y5t extends V{get isActive(){return this._isActive}constructor(e,t){super(),this.scopeId=e,this._isActive=t,this._onDidChangeActive=this._register(new I),this.onDidChangeActive=this._onDidChangeActive.event}onScopeOpened(e){e===this.scopeId&&(this._isActive||(this._isActive=!0,this._onDidChangeActive.fire()))}onScopeClosed(e){e===this.scopeId&&this._isActive&&(this._isActive=!1,this._onDidChangeActive.fire())}}class J5t extends V{get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,n){super(),this.options=t,this.menuService=i,this.contextKeyService=n,this._primaryActions=[],this._secondaryActions=[],this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.disposables=this._register(new Z),this.menu=this._register(i.createMenu(e,n)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],fC(this.menu,this.options,{primary:this._primaryActions,secondary:this._secondaryActions}),this.disposables.add(this.updateSubmenus([...this._primaryActions,...this._secondaryActions],{})),this._onDidChange.fire()}updateSubmenus(e,t){const i=new Z;for(const n of e)if(n instanceof Ty&&!t[n.item.submenu.id]){const o=t[n.item.submenu.id]=i.add(this.menuService.createMenu(n.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(n.actions,t))}return i}}let WZ=class extends V{constructor(e,t,i,n,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=n,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new J5t(e,this.options,o,n)),this._register(this.menuActions.onDidChange(()=>this._onDidChange.fire()))}getPrimaryActions(){return this.menuActions.primaryActions}getSecondaryActions(){return this.menuActions.secondaryActions}getContextMenuActions(){const e=[];if(this.contextMenuId){const t=this.menuService.getMenuActions(this.contextMenuId,this.contextKeyService,this.options);fC(t,{primary:[],secondary:e})}return e}};WZ=D([_(3,Le),_(4,Oa)],WZ);const sit=new _e("menu.view.filter"),Ice=new _e("submenu.view.filter");jn.appendMenuItem(sit,{submenu:Ice,title:g(5623,"More Filters..."),group:"navigation",icon:ve.filter});class X5t extends _3{constructor(){super(...arguments),this._checked=!1}set checked(e){this._checked!==e&&(this._checked=e,this.updateChecked())}updateChecked(){this.element&&this.element.classList.toggle("checked",this._checked)}render(e){super.render(e),this.updateChecked()}}let ySe=class extends pd{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,n,o){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=o,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Mh(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Q(e.focusContextKey,!1).bindTo(n)),this.element=fe(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=re(this.element,fe(".viewpane-filter-controls"));this.filterBadge=this.createBadge(r),this.toolbar=this._register(this.createToolBar(r)),this.adjustInputBox()}hasFocus(){return this.filterInputBox.hasFocus()}focus(){this.filterInputBox.focus()}blur(){this.filterInputBox.blur()}updateBadge(e){this.filterBadge.classList.toggle("hidden",!e),this.filterBadge.textContent=e||"",this.adjustInputBox()}setFilterText(e){this.filterInputBox.value=e}getFilterText(){return this.filterInputBox.value}getHistory(){return this.filterInputBox.getHistory()}layout(e){this.element.parentElement?.classList.toggle("grow",e>700),this.element.classList.toggle("small",e<400),this.adjustInputBox(),this.lastWidth=e}relayout(){this.lastWidth&&this.layout(this.lastWidth)}checkMoreFilters(e){this.isMoreFiltersChecked=e,this.moreFiltersActionViewItem&&(this.moreFiltersActionViewItem.checked=e)}createInput(e){const t=this._register(this.instantiationService.createInstance(iX,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>zX(this.keybindingService),inputBoxStyles:EM}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(n=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Ro(t.inputElement,ke.KEY_DOWN,n=>this.onInputKeyDown(n,t))),this._register(Ro(e,ke.KEY_DOWN,this.handleKeyboardEvent)),this._register(Ro(e,ke.KEY_UP,this.handleKeyboardEvent)),this._register(Ro(t.inputElement,ke.CLICK,n=>{n.stopPropagation(),n.preventDefault()}));const i=this._register(Ac(t.inputElement));return this.focusContextKey&&(this._register(i.onDidFocus(()=>this.focusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.focusContextKey.set(!1))),this._register(Ee(()=>this.focusContextKey.reset()))),[t,i]}createBadge(e){const t=re(e,fe(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=ze(yT),t.style.color=ze($re),t.style.border=`1px solid ${ze(wt)}`,t}createToolBar(e){return this.instantiationService.createInstance(bm,e,sit,{hiddenItemStrategy:aA.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof Ty&&t.item.submenu.id===Ice.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(X5t,t,i),this.moreFiltersActionViewItem.checked=this.isMoreFiltersChecked,this.moreFiltersActionViewItem}})}onDidInputChange(e){e.addToHistory(),this._onDidChangeFilterText.fire(e.value)}adjustInputBox(){this.filterInputBox.inputElement.style.paddingRight=this.element.classList.contains("small")||this.filterBadge.classList.contains("hidden")?"25px":"150px"}handleKeyboardEvent(e){(e.equals(S.Space)||e.equals(S.LeftArrow)||e.equals(S.RightArrow)||e.equals(S.Home)||e.equals(S.End))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(S.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};ySe=D([_(1,we),_(2,mf),_(3,Le),_(4,Ut)],ySe);var CSe,j5;(function(s){s[s.Default=0]="Default",s[s.WhenExpanded=1]="WhenExpanded",s[s.Always=2]="Always"})(j5||(j5={}));const WVe=new rn("viewpane.action.filter"),Z5t=oi("view-pane-container-expanded",ve.chevronDown,g(5342,"Icon for an expanded view pane container.")),ezt=oi("view-pane-container-collapsed",ve.chevronRight,g(5343,"Icon for a collapsed view pane container.")),HVe=Qe.as(eI.ViewsRegistry);let SSe=class{get enabled(){return this._enabled}constructor(e,t,i,n,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=n,this.telemetryService=o,this.contextKeyService=r,this.items=[],this._enabled=!1,this.disposables=new Z,this.enabledDisposables=this.disposables.add(new Z),this.renderDisposables=this.disposables.add(new Z),this.disposables.add(M.runAndSubscribe(this.delegate.onDidChangeViewWelcomeState,()=>this.onDidChangeViewWelcomeState())),this.disposables.add(a.onWillShutdown(()=>this.dispose()))}layout(e,t){this._enabled&&(this.element.style.height=`${e}px`,this.element.style.width=`${t}px`,this.element.classList.toggle("wide",t>640),this.scrollableElement.scanDomNode())}focus(){this._enabled&&this.element.focus()}onDidChangeViewWelcomeState(){const e=this.delegate.shouldShowWelcome();if(this._enabled===e)return;if(this._enabled=e,!e){this.enabledDisposables.clear();return}this.container.classList.add("welcome");const t=re(this.container,fe(".welcome-view"));this.element=fe(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new EU(this.element,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible}),re(t,this.scrollableElement.getDomNode()),this.enabledDisposables.add(Ee(()=>{this.container.classList.remove("welcome"),this.scrollableElement.dispose(),t.remove(),this.scrollableElement=void 0,this.element=void 0})),this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.enabledDisposables),M.chain(HVe.onDidChangeViewWelcomeContent,i=>i.filter(n=>n===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=HVe.getViewWelcomeContent(this.delegate.id);this.items=[];for(const t of e)if(t.when==="default")this.defaultItem={descriptor:t,visible:!0};else{const i=t.when?this.contextKeyService.contextMatchesRules(t.when):!0;this.items.push({descriptor:t,visible:i})}this.render()}onDidChangeContext(){let e=!1;for(const t of this.items){if(!t.descriptor.when||t.descriptor.when==="default")continue;const i=this.contextKeyService.contextMatchesRules(t.descriptor.when);t.visible!==i&&(t.visible=i,e=!0)}e&&this.render()}render(){this.renderDisposables.clear(),this.element.innerText="";const e=this.getContentDescriptors();if(e.length===0){this.container.classList.remove("welcome"),this.scrollableElement.scanDomNode();return}for(const{content:t,precondition:i}of e){const n=t.split(` +`);for(let o of n){if(o=o.trim(),!o)continue;const r=qje(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=re(this.element,fe(".button-container")),l=new Jd(c,{title:a.title,supportIcons:!0,...y6});if(l.label=a.label,l.onDidClick(d=>{this.telemetryService.publicLog2("views.welcomeAction",{viewId:this.delegate.id,uri:a.href}),this.openerService.open(a.href,{allowCommands:!0})},null,this.renderDisposables),this.renderDisposables.add(l),i){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());M.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=re(this.element,fe("p"));for(const c of r.nodes)if(typeof c=="string")re(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(i9,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());M.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}}}}this.container.classList.add("welcome"),this.scrollableElement.scanDomNode()}getContentDescriptors(){const e=this.items.filter(t=>t.visible);return e.length===0&&this.defaultItem?[this.defaultItem.descriptor]:e.map(t=>t.descriptor)}dispose(){this.disposables.dispose()}};SSe=D([_(2,we),_(3,Ao),_(4,Yi),_(5,Le),_(6,ig)],SSe);var ER;let HZ=(ER=class extends bSe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===ir.Panel?fi.HORIZONTAL:fi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=n,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewInformationService=u,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidChangeBodyVisibility=this._register(new I),this.onDidChangeBodyVisibility=this._onDidChangeBodyVisibility.event,this._onDidChangeTitleArea=this._register(new I),this.onDidChangeTitleArea=this._onDidChangeTitleArea.event,this._onDidChangeViewWelcomeState=this._register(new I),this.onDidChangeViewWelcomeState=this._onDidChangeViewWelcomeState.event,this._isVisible=!1,this.id=e.id,this._title=e.title,this._titleDescription=e.titleDescription,this._singleViewPaneContainerTitle=e.singleViewPaneContainerTitle,this.showActions=e.showActions??j5.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",PX(r.getViewLocationById(this.id)));this._register(M.filter(r.onDidChangeLocation,m=>m.views.some(v=>v.id===this.id))(()=>f.set(PX(r.getViewLocationById(this.id)))));const p=this._register(this.instantiationService.createChild(new Uc([Le,this.scopedContextKeyService])));this.menuActions=this._register(p.createInstance(WZ,e.titleMenuId??_e.ViewTitle,_e.ViewTitleContext,{shouldForwardArgs:!e.donotForwardArgs,renderShortTitle:!0})),this._register(this.menuActions.onDidChange(()=>this.updateActions()))}get headerVisible(){return super.headerVisible}set headerVisible(e){super.headerVisible=e,this.element.classList.toggle("merged-header",!e)}setVisible(e){this._isVisible!==e&&(this._isVisible=e,this.isExpanded()&&this._onDidChangeBodyVisibility.fire(e))}isVisible(){return this._isVisible}isBodyVisible(){return this._isVisible&&this.isExpanded()}setExpanded(e){const t=super.setExpanded(e);return t&&this._onDidChangeBodyVisibility.fire(e),this.updateTwistyIcon(),t}render(){super.render();const e=Ac(this.element);this._register(e),this._register(e.onDidFocus(()=>this._onDidFocus.fire())),this._register(e.onDidBlur(()=>this._onDidBlur.fire()))}renderHeader(e){this.headerContainer=e,this.twistiesContainer=re(e,fe(`.twisty-container${We.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=re(e,fe(".actions"));t.classList.toggle("show-always",this.showActions===j5.Always),t.classList.toggle("show-expanded",this.showActions===j5.WhenExpanded),this.toolbar=this.instantiationService.createInstance(lW,t,{orientation:F_.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(5344,"{0} actions",this.title),getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id),renderDropdownAsChildElement:!0,actionRunner:this.getActionRunner(),resetMenu:this.menuActions.menuId}),this._register(this.toolbar),this.setActions(),this._register(ue(t,ke.CLICK,o=>o.preventDefault()));const i=this.viewDescriptorService.getViewContainerByViewId(this.id);i?this._register(this.viewDescriptorService.getViewContainerModel(i).onDidChangeContainerInfo(({title:o})=>this.updateTitle(this.title))):console.error(`View container model not found for view ${this.id}`);const n=M.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(CSe.AlwaysShowActionsConfig));this._register(n(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...We.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...We.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?Z5t:ezt}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=Iy(e.headerForeground,ze(zi));N.isUri(t)?(this.iconContainer.style.backgroundColor=i,this.iconContainer.style.color=""):(this.iconContainer.style.color=i,this.iconContainer.style.backgroundColor="")}}getIcon(){return this.viewDescriptorService.getViewDescriptorById(this.id)?.containerIcon||iOt}renderHeaderTitle(e,t){this.iconContainer=re(e,fe(".icon",void 0));const i=this.getIcon();let n;if(N.isUri(i)){n=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${n}`;Uf(r,` + mask: ${Zu(i)} no-repeat 50% 50%; + mask-size: 24px; + -webkit-mask: ${Zu(i)} no-repeat 50% 50%; + -webkit-mask-size: 16px; + `)}else We.isThemeIcon(i)&&(n=We.asClassName(i));n&&this.iconContainer.classList.add(...n.split(" "));const o=this.calculateTitle(t);this.titleContainer=re(e,fe("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewInformationService?.hasShownAccessibleView(this.id);return!t||i?e:g(5345,"Use Alt+F1 for accessibility help {0}",e)}updateTitle(e){const t=this.calculateTitle(e);this.titleContainer&&(this.titleContainer.textContent=t,this.titleContainerHover?.update(t)),this.iconContainer&&(this.iconContainerHover?.update(t),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(t))),this._title=e,this._onDidChangeTitleArea.fire()}setTitleDescription(e){this.titleDescriptionContainer?(this.titleDescriptionContainer.textContent=e??"",this.titleDescriptionContainerHover?.update(e??"")):e&&this.titleContainer&&(this.titleDescriptionContainer=QGe(this.titleContainer,fe("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.titleDescriptionContainer,e)))}updateTitleDescription(e){this.setTitleDescription(e),this._titleDescription=e,this._onDidChangeTitleArea.fire()}calculateTitle(e){const t=this.viewDescriptorService.getViewContainerByViewId(this.id),i=this.viewDescriptorService.getViewContainerModel(t),n=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&n?.containerTitle&&i.title!==n.containerTitle?`${n.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(SSe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new nJ(this.element,Hje)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new j5t(qn(this.progressBar),new class extends Y5t{constructor(){super(e.id,e.isBodyVisible()),this._register(e.onDidChangeBodyVisibility(t=>t?this.onScopeOpened(e.id):this.onScopeClosed(e.id)))}}))}return this.progressIndicator}getProgressLocation(){return this.viewDescriptorService.getViewContainerByViewId(this.id).id}getLocationBasedColors(){return tzt(this.viewDescriptorService.getViewLocationById(this.id))}focus(){this.viewWelcomeController.enabled?this.viewWelcomeController.focus():this.element&&(this.element.focus(),this._onDidFocus.fire())}setActions(){if(this.toolbar){const e=[...this.menuActions.getPrimaryActions()];this.shouldShowFilterInHeader()&&e.unshift(WVe),this.toolbar.setActions(G2e(e),G2e(this.menuActions.getSecondaryActions())),this.toolbar.context=this.getActionsContext()}}updateActionsVisibility(){if(!this.headerContainer)return;const e=this.configurationService.getValue("workbench.view.alwaysShowHeaderActions");this.headerContainer.classList.toggle("actions-always-visible",e)}updateActions(){this.setActions(),this._onDidChangeTitleArea.fire()}getActionViewItem(e,t){if(e.id===WVe.id){const i=this;return new class extends zf{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(n){n.classList.add("viewpane-filter-container");const o=i.getFilterWidget();re(n,o.element),o.relayout()}}}return WN(this.instantiationService,e,{...t,menuAsChild:e instanceof Ty})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},CSe=ER,ER.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",ER);HZ=CSe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,xm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],HZ);let ASe=class extends HZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,t,i,n,o,r,a,c,l,d,h,u);const f=this._register(a.createChild(new Uc([Le,this.scopedContextKeyService])));this.filterWidget=this._register(f.createInstance(ySe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=re(e,fe(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new bn(t,e);const i=!this.filterContainer?.hasChildNodes(),n=this.shouldShowFilterInHeader();i!==n&&(n&&aa(this.filterContainer),this.updateActions(),n||re(this.filterContainer,this.filterWidget.element)),n||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};ASe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,xm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],ASe);function tzt(s){let e,t,i,n;switch(s){case ir.Panel:e=bJe,t=fTt,i=pTt,n=mTt;break;case ir.Sidebar:case ir.AuxiliaryBar:default:e=qRe,t=STt,i=ATt,n=ETt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:n}}}class oG extends li{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(Lm).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}var OQ;function izt(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t)){for(const[,i]of t.children.entries())if(s.hasNode(i)&&s.isCollapsible(i)&&!s.isCollapsed(i))return!0}return!1}function nzt(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t))return!0;return!1}const szt={getId:s=>s instanceof Dce?`new:${s.getId()}`:s.getId()};function ozt(s,e,t,i){let n;n=s.length?s[0]:void 0,t&&e.length>1&&(n=void 0);const o=n&&i.getCompressedNavigationController(n),r=o&&o.length?o[0]:void 0;n=r?r.current:n;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&n&&d===r){c===n&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return n?t&&a.indexOf(n)>=0?a:[n]:t?a:[]}var xR;let GW=(xR=class extends HZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P){super(e,d,t,u,h,i,n,P,m,v,b),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=w,this.storageService=y,this.clipboardService=C,this.fileService=A,this.uriIdentityService=L,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=n.createInstance(M3),this._register(this.resourceContext),this.folderContext=VVt.bindTo(h),this.readonlyContext=Wtt.bindTo(h),this.availableEditorIdsContext=zVt.bindTo(h),this.rootContext=$Vt.bindTo(h),this.resourceMoveableToTrash=KVt.bindTo(h),this.compressedFocusContext=qVt.bindTo(h),this.compressedFocusFirstContext=QVt.bindTo(h),this.compressedFocusLastContext=jVt.bindTo(h),this.viewHasSomeCollapsibleRootItem=YVt.bindTo(h),this.viewVisibleContextKey=ANe.bindTo(h),this.explorerService.registerView(this)}get autoReveal(){return this._autoReveal}set autoReveal(e){this._autoReveal=e}get name(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get title(){return this.name}set title(e){}setVisible(e){this.viewVisibleContextKey.set(e),super.setVisible(e)}get fileCopiedContextKey(){return x5t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return GVt.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new fAt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(10057,"Explorer Section: {0}",this.name),t.setAttribute("aria-label",this.ariaHeaderLabel)};this._register(this.contextService.onDidChangeWorkspaceName(i)),this._register(this.labelService.onDidChangeFormatters(i)),i()}layoutBody(e,t){super.layoutBody(e,t),this.tree.layout(e,t)}renderBody(e){super.renderBody(e),this.container=e,this.treeContainer=re(e,fe(".explorer-folders-view")),this.createTree(this.treeContainer),this._register(this.labelService.onDidChangeFormatters(()=>{this._onDidChangeTitleArea.fire()})),this.onConfigurationUpdated(void 0),this._register(this.editorService.onDidActiveEditorChange(()=>{this.selectActiveFile()})),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationUpdated(t))),this._register(this.onDidChangeBodyVisibility(async t=>{t&&(await this.setTreeInput(),this.updateAnyCollapsedContext(),this.selectActiveFile(!0))})),this._register(ue(ct(this.container),ke.PASTE,async t=>{!this.hasFocus()||this.readonlyContext.get()||t.clipboardData?.files?.length&&await this.commandService.executeCommand("filesExplorer.paste",t.clipboardData?.files)}))}focus(){if(super.focus(),this.tree.domFocus(),this.tree.getFocusedPart()===oW.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return lTe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===oW.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return ozt(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,qs.Visible):!1}isItemCollapsed(e){return this.tree.isCollapsed(e)}async setEditable(e,t){t?(this.horizontalScrolling=this.tree.options.horizontalScrolling,this.horizontalScrolling&&this.tree.updateOptions({horizontalScrolling:!1}),await this.tree.expand(e.parent)):(this.horizontalScrolling!==void 0&&this.tree.updateOptions({horizontalScrolling:this.horizontalScrolling}),this.horizontalScrolling=void 0,this.treeContainer.classList.remove("highlight")),await this.refresh(!1,e.parent,!1),t?(this.treeContainer.classList.add("highlight"),this.tree.reveal(e)):this.tree.domFocus()}async selectActiveFile(e=this._autoReveal){if(this._autoReveal){const t=Na.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:Hs.PRIMARY});if(t){const i=this.tree.getFocus(),n=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&n.length===1&&this.uriIdentityService.extUri.isEqual(n[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(pSe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(UA,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(OZ,e,t,i),this._register(this.renderer),this._register(TNe(e,this.themeService));const n=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(hJ,"FileExplorer",e,new PZ,new $5t,[this.renderer],this.instantiationService.createInstance(fSe,this.filter),{compressionEnabled:n(),accessibilityProvider:this.renderer,identityProvider:szt,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>{if(!this.explorerService.isEditable(a))return a.name},getCompressedNodeKeyboardNavigationLabel:a=>{if(!a.some(c=>this.explorerService.isEditable(c)))return a.map(c=>c.name).join("/")}},multipleSelectionSupport:!0,filter:this.filter,sorter:this.instantiationService.createInstance(mSe),dnd:this.instantiationService.createInstance(_Se,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof Gd&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof Gd){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:PZ.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=M.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:n()}))),Utt.bindTo(this.tree.contextKeyService),Vtt.bindTo(this.tree.contextKeyService),this._register(this.tree.onDidChangeFocus(a=>this.onFocusChanged(a.elements))),this.onFocusChanged([]),this._register(this.tree.onDidOpen(async a=>{const c=a.element;if(!c)return;if(!(d_(a.browserEvent)&&a.browserEvent.shiftKey)){if(c.isDirectory||this.explorerService.isEditable(void 0))return;this.telemetryService.publicLog2("workbenchActionExecuted",{id:"workbench.files.openFile",from:"explorer"});try{this.delegate?.willOpenElement(a.browserEvent),await this.editorService.openEditor({resource:c.resource,options:{preserveFocus:a.editorOptions.preserveFocus,pinned:a.editorOptions.pinned,source:v3.USER}},a.sideBySide?ev:hA)}finally{this.delegate?.didOpenElement()}}})),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidScroll(async a=>{const c=this.explorerService.getEditable();a.scrollTopChanged&&c&&this.tree.getRelativeTop(c.stat)===null&&await c.data.onFinish("",!1)})),this._register(this.tree.onDidChangeCollapseState(a=>{const c=a.node.element?.element;c&&this.renderer.getCompressedNavigationController(c instanceof Array?c[0]:c)?.forEach(d=>d.updateCollapsed(a.node.collapsed)),this.updateAnyCollapsedContext()})),this.updateAnyCollapsedContext(),this._register(this.tree.onMouseDblClick(a=>{const c=this.configurationService.getValue("workbench.list.scrollByPage");a.element===null&&!c&&this.commandService.executeCommand(kNe)})),this._register(this.storageService.onWillSaveState(()=>{this.storeTreeViewState()}))}onConfigurationUpdated(e){if(!e||e.affectsConfiguration("explorer.autoReveal")){const t=this.configurationService.getValue();this._autoReveal=t?.explorer?.autoReveal}e&&(e.affectsConfiguration("explorer.decorations.colors")||e.affectsConfiguration("explorer.decorations.badges"))&&this.refresh(!0)}storeTreeViewState(){this.storageService.store(OQ.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),Ie.WORKSPACE,an.MACHINE)}setContextKeys(e){const t=this.contextService.getWorkspace().folders,i=e?e.resource:t[t.length-1].uri;if(e=e||this.explorerService.findClosest(i),this.resourceContext.set(i),this.folderContext.set(!!e&&e.isDirectory),this.readonlyContext.set(!!e&&!!e.isReadonly),this.rootContext.set(!!e&&e.isRoot),i){const n=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(n.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(nA(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Yr(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(d_(e.browserEvent)||z5t(e.browserEvent.target)?i=a[0].labels[a[0].index]:a.forEach(c=>c.last()))}this.fileCopiedContextKey.set(await this.clipboardService.hasResources()),this.setContextKeys(t);const n=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof Gd){const a=this.renderer.getCompressedNavigationController(t);r=a&&a.length?a[0].current.resource:t.resource}else r=o.length===1?o[0].resource:{};this.contextMenuService.showContextMenu({menuId:_e.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&n&&n.indexOf(t)>=0?n.map(a=>a.resource):t instanceof Gd?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const n=!!this.configurationService.getValue().files?.enableTrash,o=this.fileService.hasCapability(t.resource,Vn.Trash);this.resourceMoveableToTrash.set(n&&o)}else this.resourceMoveableToTrash.reset();const i=t&&this.renderer.getCompressedNavigationController(t);if(!i){this.compressedFocusContext.set(!1);return}this.compressedFocusContext.set(!0),i.forEach(n=>{this.updateCompressedNavigationContextKeys(n)})}refresh(e,t,i=!0){if(!this.tree||!this.isBodyVisible()||t&&!this.tree.hasNode(t))return Promise.resolve(void 0);i&&this.explorerService.isEditable(void 0)&&this.tree.domFocus();const n=t||this.tree.getInput();return this.tree.updateChildren(n,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return Sdt(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&cs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==qi.FOLDER||t[0].error)&&(i=t);let n;if(this.tree&&this.tree.getInput())n=this.tree.getViewState();else{const a=this.storageService.get(OQ.TREE_VIEW_STATE_STORAGE_KEY,Ie.WORKSPACE);a&&(n=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,n).then(async()=>{if(Array.isArray(i)){if(!n||o instanceof Gd)for(let a=0;a{}),Array.isArray(o)){const a=new ui;o.forEach(c=>a.set(c.resource,!0)),await Promise.all(i.map(async c=>{if(!a.has(c.resource))try{await this.tree.expand(c)}catch{}}))}}e&&cs("code/didResolveExplorer")});this.progressService.withProgress({location:ud.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new vSe(this.explorerService,this.contextService),this._register(this.decorationService.registerDecorationsProvider(this.decorationsProvider)))}async selectResource(e,t=this._autoReveal,i=0){if(i===2||!e||!this.isBodyVisible())return;this.setTreeInputPromise&&await this.setTreeInputPromise;let n=this.explorerService.findClosestRoot(e);for(;n&&n.resource.toString()!==e.toString();){try{await this.tree.expand(n)}catch{return this.selectResource(e,t,i+1)}if(!n.children.size)n=null;else for(const o of n.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){n=o;break}n=null}}if(n){if(n===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{n.nestedParent&&await this.tree.expand(n.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(n)===null&&this.tree.reveal(n,.5),this.tree.setFocus([n]),this.tree.setSelection([n])}catch{return this.selectResource(e,t,i+1)}}}itemsCopied(e,t,i){this.fileCopiedContextKey.set(e.length>0),this.resourceCutContextKey.set(t&&e.length>0),i?.forEach(n=>this.tree.rerender(n)),t&&e.forEach(n=>this.tree.rerender(n))}expandAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus(),this.tree.expandAll()}collapseAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus();const e=this.tree.getInput();if(Array.isArray(e)&&izt(this.tree,e)){e.forEach(t=>{t.children.forEach(i=>this.tree.hasNode(i)&&this.tree.collapse(i,!0))});return}this.tree.collapseAll()}previousCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.previous(),this.updateCompressedNavigationContextKeys(i)})}nextCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.next(),this.updateCompressedNavigationContextKeys(i)})}firstCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.first(),this.updateCompressedNavigationContextKeys(i)})}lastCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.last(),this.updateCompressedNavigationContextKeys(i)})}updateCompressedNavigationContextKeys(e){this.compressedFocusFirstContext.set(e.index===0),this.compressedFocusLastContext.set(e.index===e.count-1)}updateAnyCollapsedContext(){const e=this.tree.getInput();if(e===void 0)return;const t=Array.isArray(e)?e:Array.from(e.children.values());this.viewHasSomeCollapsibleRootItem.set(nzt(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},OQ=xR,xR.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",xR);GW.__decorator=D([Zt],GW.prototype,"fileCopiedContextKey",null);GW.__decorator=D([Zt],GW.prototype,"resourceCutContextKey",null);GW=OQ=D([_(1,lr),_(2,xm),_(3,we),_(4,yi),_(5,cg),_(6,ei),_(7,BU),_(8,kI),_(9,Ut),_(10,Le),_(11,Te),_(12,iE),_(13,Fs),_(14,pn),_(15,Yi),_(16,ec),_(17,vf),_(18,$i),_(19,dg),_(20,Jt),_(21,ks),_(22,vi),_(23,Ao)],GW);function TNe(s,e){s.classList.add("file-icon-themable-tree"),s.classList.add("show-file-icons");const t=i=>{s.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),s.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends li{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(10058,"New File..."),f1:!1,icon:ve.newFile,precondition:Htt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:10}})}run(s){s.get(vi).executeCommand(kNe)}});At(class extends li{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(10059,"New Folder..."),f1:!1,icon:ve.newFolder,precondition:Htt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:20}})}run(s){s.get(vi).executeCommand(tit)}});At(class extends li{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Pe(10060,"Refresh Explorer"),f1:!0,icon:ve.refresh,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:30},metadata:{description:Pe(10061,"Forces a refresh of the Explorer.")}})}async run(s){const e=s.get(Lm),t=s.get(vf);await e.openView(Bb),await t.refresh()}});At(class extends li{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Pe(10062,"Collapse Folders in Explorer"),f1:!0,icon:ve.collapseAll,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:40},metadata:{description:Pe(10063,"Folds all folders in the Explorer.")}})}run(s){const t=s.get(Lm).getViewWithId(Bb);t!==null&&t.collapseAll()}});var UVe;(function(s){s.Null="null",s.Enum="enum",s.String="string",s.MultilineString="multiline-string",s.Integer="integer",s.Number="number",s.Boolean="boolean",s.Array="array",s.Exclude="exclude",s.Include="include",s.Complex="complex",s.NullableInteger="nullable-integer",s.NullableNumber="nullable-number",s.Object="object",s.BooleanObject="boolean-object",s.LanguageTag="language-tag",s.ExtensionToggle="extension-toggle"})(UVe||(UVe={}));var VVe;(function(s){s[s.None=0]="None",s[s.LanguageTagSettingMatch=1]="LanguageTagSettingMatch",s[s.RemoteMatch=2]="RemoteMatch",s[s.DescriptionOrValueMatch=4]="DescriptionOrValueMatch",s[s.KeyMatch=8]="KeyMatch"})(VVe||(VVe={}));const rzt="editor.contrib.defineKeybinding",azt="settings";var ESe;const BQ=fe;let UZ=class extends V{constructor(e,t,i,n,o){super(),this.data=e,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=t??(e.length>1?g(10569,"Used {0} references",e.length):g(10570,"Used {0} reference",1)),a=BQ(".chat-used-context-icon"),c=v=>v.usedReferencesExpanded?ve.chevronDown:ve.chevronRight;a.classList.add(...We.asClassNameArray(c(i)));const l=BQ(".chat-used-context-label",void 0),d=this._register(new Jd(l,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0}));this.domNode=BQ(".chat-used-context",void 0,l),d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._register(d.onDidClick(()=>{a.classList.remove(...We.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...We.asClassNameArray(c(i))),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._onDidChangeHeight.fire(),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const u=this._register(n.get()).object;this.domNode.appendChild(u.getHTMLElement().parentElement),this._register(u.onDidOpen(v=>{if(v.element&&"reference"in v.element){const b="variableName"in v.element.reference?v.element.reference.value:v.element.reference,w=N.isUri(b)?b:b?.uri;w&&o.open(w,{fromUserGesture:!0,editorOptions:{...v.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),this._register(u.onContextMenu(v=>{v.browserEvent.preventDefault(),v.browserEvent.stopPropagation()}));const m=Math.min(e.length,6)*22;u.layout(m),u.getHTMLElement().style.height=`${m}px`,u.splice(0,u.length,e)}hasSameContent(e,t,i){return e.kind==="references"&&e.references.length===this.data.length||e.kind==="codeCitations"&&e.citations.length===this.data.length}updateAriaLabel(e,t,i){e.ariaLabel=i?g(10571,"{0}, expanded",t):g(10572,"{0}, collapsed",t)}addDisposable(e){this._register(e)}};UZ=D([_(4,Ao)],UZ);let xSe=class extends V{get inUse(){return this._pool.inUse}constructor(e,t,i){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.themeService=i,this._pool=this._register(new xce(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=BQ(".chat-used-context-list");return this._register(TNe(t,this.themeService)),this.instantiationService.createInstance(M_e,"ChatListRenderer",t,new czt,[this.instantiationService.createInstance(VZ,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:n=>{if(n.kind==="warning")return n.content.value;const o=n.reference;return"variableName"in o?o.variableName:N.isUri(o)?Ko(o.path):Ko(o.uri.path)},getWidgetAriaLabel:()=>g(10573,"Collapsible Chat List")},dnd:{getDragURI:n=>{if(n.kind==="warning")return null;const{reference:o}=n;return"variableName"in o?null:N.isUri(o)?o.toString():o.uri.toString()},dispose:()=>{},onDragOver:()=>!1,drop:()=>{}}})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};xSe=D([_(1,we),_(2,pn)],xSe);class czt{getHeight(e){return 22}getTemplateId(e){return VZ.TEMPLATE_ID}}var DR;let VZ=(DR=class{constructor(e,t,i,n){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.productService=n,this.templateId=ESe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0,supportIcons:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return We.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===VCe.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,n){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:ve.warning});return}const o=e.reference,r=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in o)if(o.value){const a=N.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:EA(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r,title:e.options?.status?.description??e.title})}else{const a=this.chatVariablesService.getVariable(o.variableName),c=a?.icon?`$(${a.icon.id}) `:"",l=`#${o.variableName}`,d=`${c}${a?.fullName??l}`;i.label.setLabel(d,l,{title:e.options?.status?.description??a?.description})}else{const a="uri"in o?o.uri:o;if(a.scheme==="https"&&R2(a.authority,"github.com")&&a.path.includes("/tree/")){const c=a.path.split("/").slice(1,3).join("/"),l=a.path.split("/").slice(5).join("/");i.label.setResource({resource:a,name:c,description:l},{icon:ve.github,title:e.title})}else if(a.scheme===this.productService.urlProtocol&&R2(a.authority,azt)){const c=a.path.substring(1);i.label.setResource({resource:a,name:c},{icon:ve.settingsGear,title:g(10574,"Open setting '{0}'",c)})}else A8(a,pe.mailto,pe.http,pe.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??ve.globe,title:e.options?.status?.description??e.title??a.toString()}):i.label.setFile(a,{fileKind:ba.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0,title:e.options?.status?.description??e.title})}for(const a of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const c=i.label.element.querySelector(a);c&&(e.options?.status?.kind===BW.Omitted||e.options?.status?.kind===BW.Partial?c.classList.add("warning"):c.classList.remove("warning"))}}disposeTemplate(e){e.templateDisposables.dispose()}},ESe=DR,DR.TEMPLATE_ID="chatCollapsibleListRenderer",DR);VZ=ESe=D([_(1,pn),_(2,L6),_(3,Er)],VZ);let DSe=class extends V{constructor(e,t,i,n,o){if(super(),this.task=e,e.progress.length){const r=this._register(o.createInstance(UZ,e.progress,e.content.value,n.element,t));this.domNode=fe(".chat-progress-task"),this.domNode.appendChild(r.domNode),this.onDidChangeHeight=r.onDidChangeHeight}else{const r=e.isSettled?.()??!0,a=this._register(o.createInstance(Btt,e,i,n,!r,!0));this.domNode=a.domNode,this.onDidChangeHeight=M.None}}hasSameContent(e){return e.kind==="progressTask"&&e.progress.length===this.task.progress.length&&e.isSettled()===this.task.isSettled()}addDisposable(e){this._register(e)}};DSe=D([_(4,we)],DSe);const zVe=fe;let kSe=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.textModelService=r,this.modelService=a,this.chatService=c,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const l=t.element;if(i.renderTextEditsAsSummary?.(e.uri))vs(l)&&l.response.value.every(d=>d.kind==="textEditGroup")?this.domNode=zVe(".interactive-edits-summary",void 0,l.isComplete?l.isCanceled?g(10576,"Making changes was aborted."):g(10577,"Made changes."):g(10575,"Making changes...")):this.domNode=zVe("div");else{const d=new ci;let h=!1;this._register(Ee(()=>{h=!0,d.dispose(!0),this.ref?.object.clearModel()})),this.ref=this._register(n.get()),this._register(this.ref.object.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()}));const u={element:l,edit:e,diffData:(async()=>{const f=await this.textModelService.createModelReference(e.uri);if(h){f.dispose();return}this._register(f);const p=f.object.textEditorModel;let m="";if(e.state)m=e.state.sha1;else{const y=new Z2;y.canComputeSHA1(p)&&(m=y.computeSHA1(p),e.state={sha1:m,applied:0})}const v=this.modelService.createModel(u6(p.createSnapshot()),{languageId:p.getLanguageId(),onDidChange:M.None},N.from({scheme:pe.vscodeChatCodeBlock,path:p.uri.path,query:ar()}),!1),b=await this.textModelService.createModelReference(v.uri);this._register(b);const w=[];if(vs(l)){const y=this.chatService.getSession(l.sessionId);for(const C of y.getRequests())if(C.response){for(const A of C.response.response.value)if(!(A.kind!=="textEditGroup"||A.state?.applied||!ji(A.uri,e.uri)))for(const L of A.edits){const k=L.map(nTe.asEditOperation);w.push(k)}if(C.response===l.model)break}}for(const y of w)v.pushEditOperations(null,y,()=>null);return{modified:v,original:p,originalSha1:m}})()};this.ref.object.render(u,o,d.token),this.domNode=this.ref.object.element}}layout(e){this.ref?.object.layout(e)}hasSameContent(e){return e.kind==="textEditGroup"}addDisposable(e){this._register(e)}};kSe=D([_(5,fn),_(6,gi),_(7,km)],kSe);let ISe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new xce(()=>n.createInstance(hCe,e,_e.ChatCompareBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};ISe=D([_(3,we)],ISe);const lzt=fe;let zZ=class extends V{constructor(e,t,i,n,o){super(),this.openerService=o,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=this._register(i.get());this.tree=r.object,this.onDidFocus=this.tree.onDidFocus,this._register(this.tree.onDidOpen(a=>{a.element&&!("children"in a.element)&&this.openerService.open(a.element.uri)})),this._register(this.tree.onDidChangeCollapseState(()=>{this._onDidChangeHeight.fire()})),this._register(this.tree.onContextMenu(a=>{a.browserEvent.preventDefault(),a.browserEvent.stopPropagation()})),this.tree.setInput(e).then(()=>{r.isStale()||(this.tree.layout(),this._onDidChangeHeight.fire())}),this.domNode=this.tree.getHTMLElement().parentElement}domFocus(){this.tree.domFocus()}hasSameContent(e){return e.kind==="treeData"}addDisposable(e){this._register(e)}};zZ=D([_(4,Ao)],zZ);let TSe=class extends V{get inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=n,this._pool=this._register(new xce(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=lzt(".interactive-response-progress-tree");return this._register(TNe(t,this.themeService)),this.instantiationService.createInstance(hJ,"ChatListRenderer",t,new LSe,new dzt,[new hzt(e,this.configService.getValue("explorer.decorations"))],new uzt,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:n=>n.uri.toString()},accessibilityProvider:{getAriaLabel:n=>n.label,getWidgetAriaLabel:()=>g(10578,"File Tree")},alwaysConsumeMouseWheel:!1})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};TSe=D([_(1,we),_(2,Te),_(3,pn)],TSe);const Noe=class Noe{getHeight(e){return Noe.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Noe.ITEM_HEIGHT=22;let LSe=Noe;class dzt{isIncompressible(e){return!e.children}}class hzt{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,n){i.label.element.style.display="flex";const o=e.element.elements.map(r=>r.label);i.label.setResource({resource:e.element.elements[0].uri,name:o},{title:e.element.elements[0].label,fileKind:e.children?ba.FOLDER:ba.FILE,extraClasses:["explorer-item"],fileDecorations:this.decorations})}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}renderElement(e,t,i,n){i.label.element.style.display="flex",!e.children.length&&e.element.type!==sn.Directory?i.label.setFile(e.element.uri,{fileKind:ba.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:ba.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class uzt{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}const $Ve=fe;class GVe extends V{constructor(e,t,i){super(),this.domNode=$Ve(".chat-notification-widget");let n,o;switch(e){case"warning":n=ve.warning,o=".chat-warning-codicon";break;case"error":n=ve.error,o=".chat-error-codicon";break;case"info":n=ve.info,o=".chat-info-codicon";break}this.domNode.appendChild($Ve(o,void 0,Yy(n)));const r=i.render(t);this.domNode.appendChild(r.element)}hasSameContent(e){return e.kind==="warning"}}const gzt=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","sub","sup","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let RSe=class extends Y_{constructor(e,t,i,n){super(e??{},t,i),this.trustedDomainService=n}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:gzt}};const n=e&&e.supportHtml?{...e,value:` + +${e.value}`}:e;return super.render(n,t,i)}};RSe=D([_(1,xi),_(2,Ao),_(3,nce)],RSe);var MSe;const Pm=fe;var kR;let $Z=(kR=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.location=t,this.rendererOptions=i,this.delegate=n,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.contextKeyService=d,this.themeService=h,this.commandService=u,this.hoverService=f,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new ui,this.fileTreesByResponseId=new Map,this.focusedFileTreesByResponseId=new Map,this._onDidClickFollowup=this._register(new I),this.onDidClickFollowup=this._onDidClickFollowup.event,this._onDidClickRerunWithAgentOrCommandDetection=new I,this.onDidClickRerunWithAgentOrCommandDetection=this._onDidClickRerunWithAgentOrCommandDetection.event,this._onDidChangeItemHeight=this._register(new I),this.onDidChangeItemHeight=this._onDidChangeItemHeight.event,this._currentLayoutWidth=0,this._isVisible=!0,this._onDidChangeVisibility=this._register(new I),this.renderer=this._register(this.instantiationService.createInstance(RSe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(AZ),this._editorPool=this._register(this.instantiationService.createInstance(UCe,e,n,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(ISe,e,n,r)),this._treePool=this._register(this.instantiationService.createInstance(TSe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(xSe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(dCe))}get templateId(){return MSe.ID}editorsInUse(){return this._editorPool.inUse()}traceLayout(e,t){this.logService.trace(`ChatListItemRenderer#${e}: ${t}`)}getProgressiveRenderRate(e){if(e.isComplete)return 80;if(e.contentUpdateTimings&&e.contentUpdateTimings.impliedWordLoadRate){const n=e.contentUpdateTimings.impliedWordLoadRate;return Ka(n,5,80)}return 8}getCodeBlockInfosForResponse(e){return this.codeBlocksByResponseId.get(e.id)??[]}getCodeBlockInfoForEditor(e){return this.codeBlocksByEditorUri.get(e)}getFileTreeInfosForResponse(e){return this.fileTreesByResponseId.get(e.id)??[]}getLastFocusedFileTreeForResponse(e){const t=this.fileTreesByResponseId.get(e.id),i=this.focusedFileTreesByResponseId.get(e.id);if(t?.length&&i!==void 0&&ik.actions.length<=1},actionViewItemProvider:(k,P)=>k instanceof Sc&&(k.item.id==="workbench.action.chat.voteDown"||k.item.id==="workbench.action.chat.voteUp")?b.createInstance(fzt,k,P):WN(b,k,P)}));const y=t.add(this.instantiationService.createInstance(SZ)),C=()=>{if(vs(L.currentElement)&&L.currentElement.agent&&!L.currentElement.agent.isDefault)return y.setAgent(L.currentElement.agent.id),y.domNode},A=Ott(()=>vs(L.currentElement)?L.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupManagedHover(Pr("element"),l,C,A)),t.add(ue(l,ke.KEY_DOWN,k=>{const P=new En(k);if(P.equals(S.Space)||P.equals(S.Enter)){const R=C();R&&this.hoverService.showHover({content:R,target:l,trapFocus:!0,actions:A.actions},!0)}else P.equals(S.Escape)&&this.hoverService.hideHover()}));const L={avatarContainer:d,username:h,detail:f,value:p,rowContainer:i,elementDisposables:m,titleToolbar:w,templateDisposables:t,contextKeyService:v,instantiationService:b,agentHover:y};return L}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const n=Uu(e)?"request":vs(e)?"response":"welcome";this.traceLayout("renderElement",`${n}, index=${t}`),wNt.bindTo(i.contextKeyService).set(vs(e)),yNt.bindTo(i.contextKeyService).set(Uu(e)),vNt.bindTo(i.contextKeyService).set(vs(e)&&e.agentOrSlashCommandDetected),vs(e)?(bNt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),iUe.bindTo(i.contextKeyService).set(e.vote===WW.Up?"up":e.vote===WW.Down?"down":"")):iUe.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(vs(e)&&e.errorDetails?.responseIsFiltered);if(jXe.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",Uu(e)),i.rowContainer.classList.toggle("interactive-response",vs(e)),i.rowContainer.classList.toggle("interactive-welcome",tB(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",vs(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Ms(i.detail),vs(e)&&this.renderDetail(e,i),vs(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${n}, index=${t}`);const r=i.elementDisposables.add(new X7),a=c=>{try{this.doNextProgressiveRender(e,t,i,!!c)&&r.cancel()}catch(l){r.cancel(),this.logService.error(l)}};r.cancelAndSet(a,50,ct(i.rowContainer)),a(!0)}else vs(e)?this.basicRenderElement(e,t,i):Uu(e)?this.basicRenderElement(e,t,i):this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(ai(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Ms(t.detail),e.agentOrSlashCommandDetected){const i=e.slashCommand?g(7022,"used {0} [[(rerun without)]]",`${nI}${e.slashCommand.name}`):g(7023,"[[(rerun without)]]");aa(t.detail,ALe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:n=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=N4t)}renderAvatar(e,t){const i=vs(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??ve.account;if(i instanceof N){const n=fe("img.icon");n.src=ef.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(fe(".avatar",void 0,n))}else{const n=fe(We.asCSSSelector(i));t.avatarContainer.replaceChildren(fe(".avatar.codicon-avatar",void 0,n))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===Jg.DARK?e.iconDark:e?.icon?e.icon:ve.copilot}basicRenderElement(e,t,i){let n=[];if(Uu(e)){const c="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);n=[{content:new Mt(c),kind:"markdownContent"}]}else vs(e)&&(e.contentReferences.length&&n.push({kind:"references",references:e.contentReferences}),n.push(...g4e(e.response.value)),e.codeCitations.length&&n.push({kind:"codeCitations",citations:e.codeCitations}));Ms(i.value),vs(e)&&this.renderDetail(e,i);const o=[];if(n.forEach((c,l)=>{const d={element:e,index:l,content:n,preceedingContentParts:o},h=this.renderChatContentPart(c,i,d);h&&(i.value.appendChild(h.domNode),o.push(h))}),i.renderedParts&&bt(i.renderedParts),i.renderedParts=o,Uu(e)&&e.variables.length){const c=this.renderAttachments(e.variables,e.contentReferences,i);c&&(i.value.appendChild(c.domNode),i.elementDisposables.add(c))}if(vs(e)&&e.errorDetails?.message){const c=this.instantiationService.createInstance(GVe,e.errorDetails.responseIsFiltered?"info":"error",new Mt(e.errorDetails.message),this.renderer);i.elementDisposables.add(c),i.value.appendChild(c.domNode)}const r=i.rowContainer.offsetHeight,a=!e.currentRenderedHeight||e.currentRenderedHeight!==r;if(e.currentRenderedHeight=r,a){const c=i.elementDisposables.add(Ll(ct(i.value),()=>{e.currentRenderedHeight=i.rowContainer.offsetHeight,c.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}updateItemHeight(e){if(!e.currentElement)return;const t=e.rowContainer.offsetHeight;e.currentElement.currentRenderedHeight=t,this._onDidChangeItemHeight.fire({element:e.currentElement,height:t})}renderWelcomeMessage(e,t){Ms(t.value),e.content.forEach((o,r)=>{if(Array.isArray(o)){const a=t.elementDisposables.add(this.instantiationService.createChild(new Uc([Le,t.contextKeyService])));t.elementDisposables.add(a.createInstance(gZ,t.value,o,this.location,void 0,c=>this._onDidClickFollowup.fire(c)))}else{const a={element:e,index:r,content:[],preceedingContentParts:[]},c=this.renderMarkdown(o,t,a);t.value.appendChild(c.domNode),t.elementDisposables.add(c)}});const i=t.rowContainer.offsetHeight,n=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,n){const o=t.elementDisposables.add(Ll(ct(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,n){if(!this._isVisible)return!0;if(e.isCanceled)return this.traceLayout("doNextProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0;let o=!1;this.traceLayout("doNextProgressiveRender",`START progressive render, index=${t}, renderData=${JSON.stringify(e.renderData)}`);const r=this.getNextProgressiveRenderContent(e),a=this.diff(i.renderedParts??[],r,e);if(o=a.every(l=>l===null),o)return e.isComplete?(this.traceLayout("doNextProgressiveRender",`END progressive render, index=${t} and clearing renderData, response is complete`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0):(this.traceLayout("doNextProgressiveRender","caught up with the stream- no new content to render"),!1);this.traceLayout("doNextProgressiveRender",`doing progressive render, ${a.length} parts to render`),this.renderChatContentDiff(a,r,e,i);const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,n||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),!1}renderChatContentDiff(e,t,i,n){const o=n.renderedParts??[];n.renderedParts=o,e.forEach((r,a)=>{if(!r)return;const c=n.renderedParts?.[a];c&&c.dispose();const l=o.slice(0,a),d={element:i,content:t,preceedingContentParts:l,index:a},h=this.renderChatContentPart(r,n,d);if(h){if(c)try{c.domNode.replaceWith(h.domNode)}catch(u){this.logService.error("ChatListItemRenderer#renderChatContentDiff: error replacing part",u)}else n.value.appendChild(h.domNode);o[a]=h}else c&&c.domNode.remove()})}getNextProgressiveRenderContent(e){const t=this.getDataForProgressiveRender(e),i=g4e(e.response.value);this.traceLayout("getNextProgressiveRenderContent",`Want to render ${t.numWordsToRender} at ${t.rate} words/s, counting...`);let n=t.numWordsToRender;const o=[];e.contentReferences.length&&o.push({kind:"references",references:e.contentReferences});for(let l=0;l0&&a!==e.renderData?.renderedWordCount&&(e.renderData={lastRenderTime:Date.now(),renderedWordCount:a,renderedParts:o}),o}getDataForProgressiveRender(e){const t=e.renderData??{lastRenderTime:0,renderedWordCount:0},i=this.getProgressiveRenderRate(e);return{numWordsToRender:t.lastRenderTime===0?1:t.renderedWordCount+Math.floor((Date.now()-t.lastRenderTime)/1e3*i),rate:i}}diff(e,t,i){const n=[];for(let o=0;oa instanceof zZ).length,r=this.instantiationService.createInstance(zZ,n,i.element,this._treePool,o);if(r.addDisposable(r.onDidChangeHeight(()=>{this.updateItemHeight(t)})),vs(i.element)){const a={treeDataId:n.uri.toString(),treeIndex:o,focus(){r.domFocus()}};r.addDisposable(r.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(i.element.id,a.treeIndex)}));const c=this.fileTreesByResponseId.get(i.element.id)??[];c.push(a),this.fileTreesByResponseId.set(i.element.id,ja(c,l=>l.treeDataId)),r.addDisposable(Ee(()=>this.fileTreesByResponseId.set(i.element.id,c.filter(l=>l.treeDataId!==n.uri.toString()))))}return r}renderContentReferencesListData(e,t,i,n){const o=this.instantiationService.createInstance(UZ,e.references,t,i.element,this._contentReferencesListPool);return o.addDisposable(o.onDidChangeHeight(()=>{this.updateItemHeight(n)})),o}renderCodeCitationsListData(e,t,i){return this.instantiationService.createInstance(OCe,e,t)}renderProgressTask(e,t,i){if(!vs(i.element))return;const n=this.instantiationService.createInstance(DSe,e,this._contentReferencesListPool,this.renderer,i);return n.addDisposable(n.onDidChangeHeight(()=>{this.updateItemHeight(t)})),n}renderConfirmation(e,t,i){const n=this.instantiationService.createInstance(HCe,t,e);return n.addDisposable(n.onDidChangeHeight(()=>this.updateItemHeight(i))),n}renderAttachments(e,t,i){return this.instantiationService.createInstance(FCe,e,t,void 0)}renderTextEdit(e,t,i){const n=this.instantiationService.createInstance(kSe,t,e,this.rendererOptions,this._diffEditorPool,this._currentLayoutWidth);return n.addDisposable(n.onDidChangeHeight(()=>{n.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),n}renderMarkdown(e,t,i){const n=i.element,o=vs(n)&&(!n.isComplete||n.isCanceled||n.errorDetails?.responseIsFiltered||n.errorDetails?.responseIsIncomplete||!!n.renderData),r=i.preceedingContentParts.reduce((l,d)=>l+(d instanceof EZ?d.codeblocks.length:0),0),a=this.instantiationService.createInstance(EZ,e,i,this._editorPool,o,r,this.renderer,this._currentLayoutWidth,this.codeBlockModelCollection,this.rendererOptions);a.addDisposable(a.onDidChangeHeight(()=>{a.layout(this._currentLayoutWidth),this.updateItemHeight(t)}));const c=this.codeBlocksByResponseId.get(n.id)??[];return this.codeBlocksByResponseId.set(n.id,c),a.addDisposable(Ee(()=>{const l=this.codeBlocksByResponseId.get(n.id);l&&a.codeblocks.forEach((d,h)=>delete l[r+h])})),a.codeblocks.forEach((l,d)=>{if(c[r+d]=l,l.uri){const h=l.uri;this.codeBlocksByEditorUri.set(h,l),a.addDisposable(Ee(()=>this.codeBlocksByEditorUri.delete(h)))}}),a}disposeElement(e,t,i){if(this.traceLayout("disposeElement",`Disposing element, index=${t}`),i.renderedParts)try{bt(Fi(i.renderedParts)),i.renderedParts=void 0,Ms(i.value)}catch(n){throw n}i.currentElement=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},MSe=kR,kR.ID="item",kR);$Z=MSe=D([_(6,we),_(7,Te),_(8,Ge),_(9,Le),_(10,pn),_(11,vi),_(12,ec)],$Z);let NSe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=Uu(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return $Z.ID}hasDynamicHeight(e){return!0}};NSe=D([_(1,Ge)],NSe);class fzt extends Lb{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}var WQ,mk;let PSe=(mk=class extends V{get configuration(){return this._config}constructor(e,t,i,n,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=n,this.configurationService=o,this.themeService=r,this.viewDescriptorService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.themeService.onDidColorThemeChange(c=>this.update())),this._register(this.viewDescriptorService.onDidChangeLocation(c=>{c.views.some(l=>l.id===e)&&this.update()})),this._register(this.configurationService.onDidChangeConfiguration(c=>{WQ.relevantSettingIds.some(l=>c.affectsConfiguration(l))&&this.update()})),this.update()}update(){const e=this.configurationService.getValue("editor"),t=this.configurationService.getValue("chat")?.editor,i=this.configurationService.getValue("editor.accessibilitySupport");this._config={foreground:this.themeService.getColorTheme().getColor(this.foreground),inputEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.inputEditorBackgroundColor),accessibilitySupport:i},resultEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),fontSize:t.fontSize,fontFamily:t.fontFamily==="default"?e.fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:t.lineHeight?t.lineHeight:WQ.lineHeightEm*t.fontSize,bracketPairColorization:{enabled:this.configurationService.getValue("editor.bracketPairColorization.enabled"),independentColorPoolPerBracketType:this.configurationService.getValue("editor.bracketPairColorization.independentColorPoolPerBracketType")},wordWrap:t.wordWrap,fontLigatures:e.fontLigatures}},this._onDidChange.fire()}},WQ=mk,mk.lineHeightEm=1.4,mk.relevantSettingIds=["chat.editor.lineHeight","chat.editor.fontSize","chat.editor.fontFamily","chat.editor.fontWeight","chat.editor.wordWrap","editor.cursorBlinking","editor.fontLigatures","editor.accessibilitySupport","editor.bracketPairColorization.enabled","editor.bracketPairColorization.independentColorPoolPerBracketType"],mk);PSe=WQ=D([_(4,Te),_(5,pn),_(6,xm)],PSe);const pzt=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,mzt=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,_zt=/\/([\w_\-]+)(?=(\s|$|\b))/i;let GZ=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=Ir.Panel,n){const o=[],r=this.variableService.getDynamicVariables(e);let a=1,c=1;for(let h=0;h1&&a?.selectedAgent?a.selectedAgent:f[0];if(!p||!p.locations.includes(r)||o.some(w=>w instanceof $g)||o.some(w=>w instanceof cb&&w.text.trim()!==""||!(w instanceof $g)))return;const v=o.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new $g(h,u,p)}tryToParseVariable(e,t,i,n){const o=e.match(mzt);if(!o)return;const[r,a]=o,c=o[2]??"",l=new mi(t,t+r.length),d=new F(i.lineNumber,i.column,i.lineNumber,i.column+r.length),h=n.find(p=>p instanceof $g),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new m9(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,n,o,r){const a=e.match(_zt);if(!a||o.some(f=>f instanceof FW))return;const[c,l]=a,d=new mi(i,i+c.length),h=new F(n.lineNumber,n.column,n.lineNumber,n.column+c.length),u=o.find(f=>f instanceof $g);if(u){if(o.some(b=>b instanceof cb&&b.text.trim()!==""||!(b instanceof $g)&&!(b instanceof cb)))return;const p=o.at(-1)?.range.endExclusive??0;if(t.slice(p,i).trim()!=="")return;const v=u.agent.slashCommands.find(b=>b.name===l);if(v)return new JM(d,h,v)}else{const p=this.slashCommandService.getCommands(r).find(m=>m.command===l);if(p)return new FW(d,h,p);{const v=this.agentService.getDefaultAgent(r)?.slashCommands.find(b=>b.name===l);if(v)return new JM(d,h,v)}}}tryToParseDynamicVariable(e,t,i,n){const o=n.find(r=>r.range.startLineNumber===i.lineNumber&&r.range.startColumn===i.column);if(o){const r=o.range.endColumn-o.range.startColumn,a=e.substring(0,r),c=new mi(t,t+r);return new OW(c,o.range,a,o.id,o.modelDescription,o.data)}}};GZ=D([_(0,_f),_(1,L6),_(2,YRe)],GZ);let FSe=class extends V{constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new ui,this.maxModelCount=100}dispose(){super.dispose(),this.clear()}get(e,t,i){const n=this.getUri(e,t,i),o=this._models.get(n);if(o)return{model:o.model.then(r=>r.object),vulns:o.vulns}}getOrCreate(e,t,i){const n=this.get(e,t,i);if(n)return n;const o=this.getUri(e,t,i),r=this.textModelService.createModelReference(o);for(this._models.set(o,{model:r,vulns:[]});this._models.size>this.maxModelCount;){const a=Array.from(this._models.keys()).at(0);if(!a)break;this.delete(a)}return{model:r.then(a=>a.object),vulns:[]}}delete(e){const t=this._models.get(e);t&&(t.model.then(i=>i.dispose()),this._models.delete(e))}clear(){this._models.forEach(async e=>(await e.model).dispose()),this._models.clear()}async update(e,t,i,n){const o=this.getOrCreate(e,t,i),r=z4t(n.text),a=vzt(r.newText,n.languageId);this.setVulns(e,t,i,r.vulnerabilities);const c=(await o.model).textEditorModel;if(n.languageId){const d=this.languageService.getLanguageIdByLanguageName(n.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(go.LF);if(a!==l)if(a.startsWith(l)){const d=a.slice(l.length),h=c.getLineCount(),u=c.getLineMaxColumn(h);c.applyEdits([{range:new F(h,u,h,u),text:d}])}else c.setValue(a)}setVulns(e,t,i,n){const o=this.getUri(e,t,i),r=this._models.get(o);r&&(r.vulns=n)}getUri(e,t,i){const n=this.getUriMetaData(t);return N.from({scheme:pe.vscodeChatCodeBlock,authority:e,path:`/${t.id}/${i}`,fragment:n?JSON.stringify(n):void 0})}getUriMetaData(e){if(vs(e))return{references:e.contentReferences.map(t=>{const i="variableName"in t.reference?t.reference.value:t.reference;if(i)return N.isUri(i)?{uri:i.toJSON()}:{uri:i.uri.toJSON(),range:i.range}})}}};FSe=D([_(0,xi),_(1,fn)],FSe);function vzt(s,e){return e==="php"&&!s.trim().startsWith("<")?`e instanceof $g))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}get location(){return this._location.location}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(),this.viewContext=t,this.viewOptions=i,this.styles=n,this.contextKeyService=r,this.instantiationService=a,this.chatService=c,this.chatAgentService=l,this.contextMenuService=h,this.chatAccessibilityService=u,this.logService=f,this.themeService=p,this.chatSlashCommandService=m,this._onDidSubmitAgent=this._register(new I),this.onDidSubmitAgent=this._onDidSubmitAgent.event,this._onDidChangeAgent=this._register(new I),this.onDidChangeAgent=this._onDidChangeAgent.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidChangeViewModel=this._register(new I),this.onDidChangeViewModel=this._onDidChangeViewModel.event,this._onDidScroll=this._register(new I),this.onDidScroll=this._onDidScroll.event,this._onDidClear=this._register(new I),this.onDidClear=this._onDidClear.event,this._onDidAcceptInput=this._register(new I),this.onDidAcceptInput=this._onDidAcceptInput.event,this._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onWillMaybeChangeHeight=new I,this.onWillMaybeChangeHeight=this._onWillMaybeChangeHeight.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidChangeContentHeight=new I,this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.contribs=[],this.visibleChangeCount=0,this._visible=!1,this.previousTreeScrollHeight=0,this.viewModelDisposables=this._register(new Z),typeof e=="object"?this._location=e:this._location={location:e},ANt.bindTo(r).set(!0),xNt.bindTo(r).set(this._location.location),DNt.bindTo(r).set("resource"in t),this.agentInInput=JXe.bindTo(r),this.requestInProgress=K3.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(FSe)),this._register(o.registerCodeEditorOpenHandler(async(v,b,w)=>{let y=v.resource;if(AA(y,pe.vscodeCopilotBackingChatCodeBlock)&&(y=y.with({scheme:pe.vscodeChatCodeBlock})),y.scheme!==pe.vscodeChatCodeBlock)return null;const C=y.path.split("/").at(1);if(!C)return null;const A=this.viewModel?.getItems().find(L=>L.id===C);if(!A)return null;this.reveal(A),await Sr(0);for(const L of this.renderer.editorsInUse()??[])if(xn.isEqual(L.uri,y,!0)){const k=L.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.endLineNumber??v.options.selection.startLineNumber,endColumn:v.options.selection.endColumn??v.options.selection.startColumn}),k}return null}))}set lastSelectedAgent(e){this.parsedChatRequest=void 0,this._lastSelectedAgent=e,this._onDidChangeParsedInput.fire()}get lastSelectedAgent(){return this._lastSelectedAgent}get supportsFileReferences(){return!!this.viewOptions.supportsFileReferences}get input(){return this.inputPart}get inputEditor(){return this.inputPart.inputEditor}get inputUri(){return this.inputPart.inputUri}get contentHeight(){return this.inputPart.contentHeight+this.tree.contentHeight}render(e){const t="viewId"in this.viewContext?this.viewContext.viewId:void 0;this.editorOptions=this._register(this.instantiationService.createInstance(PSe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,n=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=re(e,mue(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:n,renderStyle:o}),this.listContainer=re(this.container,mue(".interactive-list"))):(this.listContainer=re(this.container,mue(".interactive-list")),this.createInput(this.container,{renderFollowups:n,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),_P(this.tree)),this.contribs=OSe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Nr(a));return}}).filter(Fc),this.contribs.forEach(r=>{r.onDidChangeInputState&&this._register(r.onDidChangeInputState(()=>{const a=this.collectInputState();this.inputPart.updateState(a)}))})}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}getSibling(e,t){if(!vs(e))return;const i=this.viewModel?.getItems();if(!i)return;const n=i.filter(a=>vs(a)),o=n.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;if(!(r<0||r>n.length-1))return n[r]}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(n=>({element:n,collapsed:!1,collapsible:!1}));this._onWillMaybeChangeHeight.fire(),this.tree.setChildren(null,t,{diffIdentityProvider:{getId:n=>(vs(n)||Uu(n)?n.dataId:n.id)+(tB(n)&&this.viewModel?`_${Lg[this.viewModel.initState]}`:"")+`${Uu(n)||tB(n)}${vs(n)&&n.renderData?`_${this.visibleChangeCount}`:""}`+(vs(n)?`_${n.contentReferences.length}`:"")+(Uu(n)&&n.contentReferences?`_${n.contentReferences?.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&vs(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&tB(i)?this.renderFollowups(i.sampleQuestions):this.renderFollowups(void 0)}}async renderFollowups(e,t){this.inputPart.renderFollowups(e,t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}setVisible(e){const t=this._visible;this._visible=e,this.visibleChangeCount++,this.renderer.setVisible(e),this.input.setVisible(e),e?this._register(jy(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this._register(this.instantiationService.createChild(new Uc([Le,this.contextKeyService])))),n=i.createInstance(NSe,this.viewOptions.defaultElementHeight??200),o={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},r=document.createElement("div");r.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(r),this.renderer=this._register(i.createInstance($Z,this.editorOptions,this.location,t,o,this._codeBlockModelCollection,r)),this._register(this.renderer.onDidClickFollowup(a=>{this.acceptInput(a.message)})),this._register(this.renderer.onDidClickRerunWithAgentOrCommandDetection(a=>{const c=this.chatService.getSession(a.sessionId)?.getRequests().find(l=>l.id===a.requestId);c&&this.chatService.resendRequest(c,{noCommandDetection:!0,attempt:c.attempt,location:this.location}).catch(l=>this.logService.error("FAILED to rerun request",l))})),this.tree=i.createInstance(x3,"Chat",e,n,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(vCe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>Uu(a)?a.message:vs(a)?a.response.value:""},setRowLineHeight:!1,filter:this.viewOptions.filter?{filter:this.viewOptions.filter.bind(this.viewOptions)}:void 0,overrideStyles:{listFocusBackground:this.styles.listBackground,listInactiveFocusBackground:this.styles.listBackground,listActiveSelectionBackground:this.styles.listBackground,listFocusAndSelectionBackground:this.styles.listBackground,listInactiveSelectionBackground:this.styles.listBackground,listHoverBackground:this.styles.listBackground,listBackground:this.styles.listBackground,listFocusForeground:this.styles.listForeground,listHoverForeground:this.styles.listForeground,listInactiveFocusForeground:this.styles.listForeground,listInactiveSelectionForeground:this.styles.listForeground,listActiveSelectionForeground:this.styles.listForeground,listFocusAndSelectionForeground:this.styles.listForeground}}),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidChangeContentHeight(()=>{this.onDidChangeTreeContentHeight()})),this._register(this.renderer.onDidChangeItemHeight(a=>{this.tree.updateElementHeight(a.element,a.height)})),this._register(this.tree.onDidFocus(()=>{this._onDidFocus.fire()})),this._register(this.tree.onDidScroll(()=>{this._onDidScroll.fire()}))}onContextMenu(e){e.browserEvent.preventDefault(),e.browserEvent.stopPropagation();const t=e.element,i=this.contextKeyService.createOverlay([[jXe.key,vs(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:_e.ChatContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:i,getAnchor:()=>e.anchor,getActionsContext:()=>t})}onDidChangeTreeContentHeight(){this.tree.scrollHeight!==this.previousTreeScrollHeight&&this.tree.scrollTop+this.tree.renderHeight>=this.previousTreeScrollHeight-2&&Ll(ct(this.listContainer),()=>{_P(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(fZ,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle==="minimal"?"compact":t?.renderStyle,menus:{executeToolbar:_e.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(n=>{if(n.setInputState){const o=(typeof i=="object"&&i?.[n.id])??{};n.setInputState(o)}})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidChangeContext(i=>this._onDidChangeContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let n="";if(i.followup.agentId&&i.followup.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const o=this.chatAgentService.getAgent(i.followup.agentId);if(!o)return;this.lastSelectedAgent=o,n=`${QU}${o.name} `,i.followup.subCommand&&(n+=`${nI}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(n=`${nI}${i.followup.subCommand} `);n+=i.followup.message,this.acceptInput(n),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,command:i.response.slashCommand?.name,result:i.response.result,action:{kind:"followUp",followup:i.followup}})})),this._register(this.inputPart.onDidChangeHeight(()=>{this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width),this._onDidChangeContentHeight.fire()})),this._register(this.inputEditor.onDidChangeModelContent(()=>this.parsedChatRequest=void 0)),this._register(this.chatAgentService.onDidChangeAgents(()=>this.parsedChatRequest=void 0))}onDidStyleChange(){this.container.style.setProperty("--vscode-interactive-result-editor-background-color",this.editorOptions.configuration.resultEditor.backgroundColor?.toString()??""),this.container.style.setProperty("--vscode-interactive-session-foreground",this.editorOptions.configuration.foreground?.toString()??""),this.container.style.setProperty("--vscode-chat-list-background",this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString()??"")}setModel(e,t){if(!this.container)throw new Error("Call render() before setModel()");this._codeBlockModelCollection.clear(),this.container.setAttribute("data-session-id",e.sessionId),this.viewModel=this.instantiationService.createInstance(eCe,e,this._codeBlockModelCollection),this.viewModelDisposables.add(M.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(n=>n?.kind==="addRequest")&&this.visible&&(_P(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.initForNewChatModel(t.inputValue,t.inputState??this.collectInputState()),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.viewModelDisposables.add(e.onDidChange(i=>{i.kind==="setAgent"&&this._onDidChangeAgent.fire({agent:i.agent,slashCommand:i.command})})),this.tree&&(this.onDidChangeItems(),_P(this.tree))}getFocus(){return this.tree.getFocus()[0]??void 0}reveal(e){this.tree.reveal(e)}focus(e){const i=this.tree.getNode(null).children.find(n=>n.element?.id===e.id);i&&(this.tree.setFocus([i.element]),this.tree.domFocus())}refilter(){this.tree.refilter()}setInputPlaceholder(e){this.viewModel?.setInputPlaceholder(e)}resetInputPlaceholder(){this.viewModel?.resetInputPlaceholder()}setInput(e=""){this.inputPart.setValue(e,!1)}getInput(){return this.inputPart.inputEditor.getValue()}logInputHistory(){this.inputPart.logInputHistory()}async acceptInput(e){return this._acceptInput(e?{query:e}:void 0)}async acceptInputWithPrefix(e){this._acceptInput({prefix:e})}collectInputState(){const e={};return this.contribs.forEach(t=>{t.getInputState&&(e[t.id]=t.getInputState())}),e}async _acceptInput(e){if(this.viewModel){this._onDidAcceptInput.fire();const t=this.getInput(),i=this.chatAccessibilityService.acceptRequest(),n=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,n,{location:this.location,locationData:this._location.resolveData?.(),parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r)return this.inputPart.acceptInput(o),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),this.inputPart.updateState(this.collectInputState()),this.inputPart.clearContext(),r.responseCompletePromise.then(()=>{const a=this.viewModel?.getItems().filter(vs),c=a?.[a.length-1];this.chatAccessibilityService.acceptResponse(c,i)}),r.responseCreatedPromise}}setContext(e,...t){this.inputPart.attachContext(e,...t)}getCodeBlockInfosForResponse(e){return this.renderer.getCodeBlockInfosForResponse(e)}getCodeBlockInfoForEditor(e){return this.renderer.getCodeBlockInfoForEditor(e)}getFileTreeInfosForResponse(e){return this.renderer.getFileTreeInfosForResponse(e)}getLastFocusedFileTreeForResponse(e){return this.renderer.getLastFocusedFileTreeForResponse(e)}focusLastMessage(){if(!this.viewModel)return;const e=this.tree.getNode(null).children,t=e[e.length-1];t&&(this.tree.setFocus([t.element]),this.tree.domFocus())}layout(e,t){t=Math.min(t,850),this.bodyDimension=new bn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,n=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,o=e-i;this.tree.layout(o,t),this.tree.getHTMLElement().style.height=`${o}px`,this.renderer.layout(t),n&&_P(this.tree),this.listContainer.style.height=`${e-i}px`,this._onDidChangeHeight.fire(e)}setDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0},this._register(this.renderer.onDidChangeItemHeight(()=>this.layoutDynamicChatTreeItemMode()));const i=this._register(new wn);this._register(this.tree.onDidScroll(n=>{this._dynamicMessageLayoutData?.enabled&&(i.value=Ll(ct(this.listContainer),()=>{if(!n.scrollTopChanged||n.heightChanged||n.scrollHeightChanged)return;const o=n.height,r=n.scrollHeight-o-n.scrollTop;if(r===0)return;const a=this._dynamicMessageLayoutData?.maxHeight??t,c=this.bodyDimension?.width??this.container.offsetWidth;this.inputPart.layout(a,c);const l=this.inputPart.inputPartHeight,d=Math.min(o+r,a-l);this.layout(d+l,c)}))}))}updateDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0};let i=!1,n=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:n.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&_P(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},OSe=IR,IR.CONTRIBS=[],IR);y9=OSe=D([_(4,Kt),_(5,Le),_(6,we),_(7,km),_(8,_f),_(9,UN),_(10,lr),_(11,DJe),_(12,Ge),_(13,pn),_(14,YRe)],y9);var HQ;let BSe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=n,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=Bt("div.inline-chat@root",[Bt("div.chat-widget@chatWidget"),Bt("div.accessibleViewer@accessibleViewer"),Bt("div.status@status",[Bt("div.label.info.hidden@infoLabel"),Bt("div.actions.text-style.hidden@toolbar1"),Bt("div.actions.button-style.hidden@toolbar2"),Bt("div.label.status.hidden@statusLabel")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=M.filter(this._onDidChangeHeight.event,C=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this.scopedContextKeyService=this._store.add(n.createScoped(this._elements.chatWidget));const u=i.createChild(new Uc([Le,this.scopedContextKeyService]),this._store);this._chatWidget=u.createInstance(y9,e,{resource:!0},{defaultElementHeight:32,renderStyle:"minimal",renderInputOnTop:!1,renderFollowups:!0,supportsFileReferences:a.getValue(`chat.experimental.variables.${e.location}`)===!0,filter:C=>!tB(C),...t.chatWidgetViewOptions},{listForeground:lVt,listBackground:iCe,inputEditorBackground:z2,resultEditorBackground:Hc}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(Vre(BVt),ze(iCe)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const f=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{f.clear();const C=this._chatWidget.viewModel;C&&f.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=j4t.bindTo(this._contextKeyService);const p=this._store.add(Ac(this.domNode));this._store.add(p.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(p.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=Q4t.bindTo(n),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const m=t.statusMenuId instanceof _e?t.statusMenuId:t.statusMenuId.menu,v=u.createInstance(bm,this._elements.toolbar1,m,{hiddenItemStrategy:aA.NoHide,telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,actionViewItemProvider:C=>C instanceof Sc?this._instantiationService.createInstance(C6,C,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},menuOptions:{renderShortTitle:!0},label:!0,icon:!1});this._store.add(v.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(v);const b=t.statusMenuId instanceof _e?void 0:t.statusMenuId.options,w=u.createInstance(_Ce,this._elements.toolbar2,m,{toolbarOptions:{primaryGroup:"0_main"},telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,menuOptions:{renderShortTitle:!0},...b});this._store.add(w.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(w);const y=()=>this._elements.status.classList.toggle("text",this._configurationService.getValue($h.ExpTextButtons));this._store.add(this._configurationService.onDidChangeConfiguration(C=>C.affectsConfiguration($h.ExpTextButtons)&&y())),y(),this._store.add(this._configurationService.onDidChangeConfiguration(C=>{C.affectsConfiguration(vr.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupManagedHover(Pr("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(C=>{C.sessionId===this._chatWidget.viewModel?.model.sessionId&&C.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(hZ,void 0,Ir.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(vr.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=bzt;if(this._configurationService.getValue(vr.InlineChat)){const t=this._keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getLabel();e=t?g(11375,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(11376,"Inline Chat Input, Run the Inline Chat Accessibility Help command for more information.")}this._chatWidget.inputEditor.updateOptions({ariaLabel:e})}}dispose(){this._store.dispose()}get domNode(){return this._elements.root}get chatWidget(){return this._chatWidget}saveState(){this._chatWidget.saveState()}layout(e){this._isLayouting=!0;try{this._doLayout(e)}finally{this._isLayouting=!1}}_doLayout(e){const t=this._getExtraHeight(),i=fb(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-t,e.width)}get contentHeight(){const e={chatWidgetContentHeight:this._chatWidget.contentHeight,statusHeight:fb(this._elements.status),extraHeight:this._getExtraHeight()};return e.chatWidgetContentHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(vs(i)&&i.response.value.some(n=>n.kind==="textEditGroup"&&!n.state?.applied)){e=270;break}let t=this.contentHeight;return t-=this._chatWidget.contentHeight,t+=Math.min(this._chatWidget.input.contentHeight+e,this._chatWidget.contentHeight),t}_getExtraHeight(){return 10}get value(){return this._chatWidget.getInput()}set value(e){this._chatWidget.setInput(e)}selectAll(e=!0){let t=1;if(!e){const i=/^(\/\w+)\s*/.exec(this._chatWidget.inputEditor.getModel().getLineContent(1));i&&(t=i[1].length+1)}this._chatWidget.inputEditor.setSelection(new dt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.root.classList.toggle("toolbar",e),this._elements.toolbar1.classList.toggle("hidden",!e),this._elements.toolbar2.classList.toggle("hidden",!e),this._elements.status.classList.toggle("actions",e),this._elements.infoLabel.classList.toggle("hidden",e),this._onDidChangeHeight.fire()}async getCodeBlockInfo(e){const{viewModel:t}=this._chatWidget;if(!t)return;const i=t.getItems().filter(o=>vs(o));if(!i.length)return;const n=i[i.length-1];return t.codeBlockModelCollection.get(t.sessionId,n,e)?.model}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(eo(e))return Cg(e)?.response?.response.toString()}getChatModel(){return this._chatWidget.viewModel?.model??this._defaultChatModel}setChatModel(e){this._chatWidget.setModel(e,{inputValue:void 0})}addToHistory(e){this._chatWidget.viewModel?.model===this._defaultChatModel&&this._chatWidget.input.acceptInput(!0)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const n=this._defaultChatModel;if(!e?.message.value){for(const r of n.getRequests())n.removeRequest(r.id);return}const o=n.addRequest({parts:[],text:""},{variables:[]},0);if(n.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){n.completeResponse(o);return}return{cancel:()=>n.cancelRequest(o),complete:()=>n.completeResponse(o),appendContent:r=>{n.acceptResponseProgress(o,{kind:"markdownContent",content:new Mt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=Eb(e);aa(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const o=this._elements.statusLabel.innerText,r=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(o,{classes:a,keepMessage:!0,title:r})},t.resetAfter)}const n=Eb(e);aa(this._elements.statusLabel,...n),this._elements.statusLabel.className=`label status ${(t.classes??[]).join(" ")}`,this._elements.statusLabel.classList.toggle("hidden",!e),i?this._elements.statusLabel.dataset.state="temp":delete this._elements.statusLabel.dataset.state,t.title?this._elements.statusLabel.dataset.title=t.title:delete this._elements.statusLabel.dataset.title,this._onDidChangeHeight.fire()}reset(){this._chatWidget.setContext(!0),this._chatWidget.saveState(),this.updateChatMessage(void 0),aa(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.toolbar1.classList.add("hidden"),this._elements.toolbar2.classList.add("hidden"),this.updateInfo(""),this.chatWidget.setModel(this._defaultChatModel,{}),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(Bc())}};BSe=D([_(2,we),_(3,Le),_(4,Ut),_(5,mr),_(6,Te),_(7,Dm),_(8,fn),_(9,km),_(10,ec)],BSe);const bzt=g(11377,"Inline Chat Input");let WSe=class extends BSe{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,{...i,chatWidgetViewOptions:{...i.chatWidgetViewOptions,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()}},r,n,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new wn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height+8),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height+8),super._doLayout(e.with(void 0,t)),this._elements.root.style.height=`${e.height-this._getExtraHeight()}px`}reset(){this._accessibleViewer.clear(),super.reset()}showAccessibleHunk(e,t){this._elements.accessibleViewer.classList.remove("hidden"),this._accessibleViewer.clear(),this._accessibleViewer.value=this._instantiationService.createInstance(HSe,this._elements.accessibleViewer,e,t,new wzt(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};WSe=D([_(3,Le),_(4,Ut),_(5,we),_(6,mr),_(7,Te),_(8,Dm),_(9,fn),_(10,km),_(11,ec)],WSe);let HSe=HQ=class extends Ix{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,n,o){const r=jt("width",0),a=jt("diff",HQ._asMapping(i)),c=Ze(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=n.getModifiedOptions().get(x.lineHeight)*l;super(e,nd(!0),()=>{},nd(!1),r,nd(d),c,n,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(HQ._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),n=pi.fromRangeInclusive(t[0]),o=pi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(WSe,e,this.editor,{statusMenuId:{menu:cVt,options:{buttonConfigProvider:l=>new Set([oVt,rVt]).has(l.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:l.id===sVt?{isSecondary:!1}:{isSecondary:!0}}},chatWidgetViewOptions:{menus:{executeToolbar:Ltt,telemetrySource:"interactiveEditorWidget-toolbar"},rendererOptions:{renderTextEditsAsSummary:l=>ji(l,t.getModel()?.uri)&&r.getValue($h.Mode)===Fy.Live}}}),this._disposables.add(this.widget);let a;this._disposables.add(this.widget.chatWidget.onWillMaybeChangeHeight(()=>{this.position&&(a=tx.capture(this.editor))})),this._disposables.add(this.widget.onDidChangeHeight(()=>{if(this.position){a??=tx.capture(this.editor);const l=this._computeHeight();this._relayout(l.linesValue),a.restore(this.editor),a=void 0,this._revealTopOfZoneWidget(this.position,l)}})),this.create(),this._disposables.add(ue(this.domNode,"click",l=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const c=()=>{!this.position||!this.editor.hasModel()?this._ctxCursorPosition.reset():this.position.lineNumber===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("above"):this.position.lineNumber+1===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("below"):this._ctxCursorPosition.reset()};this._disposables.add(this.editor.onDidChangeCursorPosition(l=>c())),this._disposables.add(this.editor.onDidFocusEditorText(l=>c())),c()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=this.editor.getLayoutInfo();let i=t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth);i=Math.min(640,i),this._dimension=new bn(i,e),this.widget.layout(this._dimension)}_computeHeight(){const e=this.widget.contentHeight,t=this.editor.getLayoutInfo().height,i=Math.min(e,Math.max(this.widget.minHeight,t*.42));return{linesValue:i/this.editor.getOption(x.lineHeight),pixelsValue:i}}_onWidth(e){this._dimension&&this._doLayout(this._dimension.height)}show(e){Tt(this.container);const t=tx.capture(this.editor),i=this.editor.getLayoutInfo(),n=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${n}px`;const o=this._computeHeight();super.show(e,o.linesValue),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),this._revealTopOfZoneWidget(e,o)}updatePositionAndHeight(e){const t=tx.capture(this.editor),i=this._computeHeight();super.updatePositionAndHeight(e,i.linesValue),t.restore(this.editor),this._revealTopOfZoneWidget(e,i)}_revealTopOfZoneWidget(e,t){const i=e.lineNumber<=1?1:1+e.lineNumber,n=this.editor.getScrollTop(),o=this.editor.getTopForLineNumber(i),r=o-t.pixelsValue,a=this.editor.getLayoutInfo().height,c=this.editor.getBottomForLineNumber(i);let l=r,d=!1;c>=n+a&&(l=c-a,d=!0),(l!1},{listForeground:Rl,listBackground:iCe,inputEditorBackground:z2,resultEditorBackground:Hc}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.onDidChangeContentHeight(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._toolbarContainer.classList.add("toolbar"),o.getValue($h.ExpTextButtons)&&(this._toolbarContainer.style.display="inherit",this._domNode.style.paddingBottom="4px"),this._domNode.appendChild(this._toolbarContainer);const c=this._store.add(a.createInstance(bm,this._toolbarContainer,aVt,{actionViewItemProvider:h=>h instanceof Sc?i.createInstance(C6,h,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},icon:!1,label:!0}));this._store.add(c.onDidChangeMenuItems(()=>{this._domNode.classList.toggle("contents",c.getItemsLength()>1)}));let l=!1;this._store.add(this._widget.inputEditor.onDidChangeModelContent(()=>{l||=this._widget.inputEditor.getModel()?.getValueLength()!==0})),this._store.add(this._widget.onDidChangeContext(()=>{l||=!0,t.layoutContentWidget(this)}));const d=Ac(this._domNode);this._store.add(d.onDidBlur(()=>{this._visible&&!l&&!r.currentQuickInput&&this._onDidBlur.fire()})),this._store.add(d)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[es.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight,i=Math.min(e,t),n=390;return this._widget.layout(i,n),UGe(this._domNode,n,null),null}afterRender(){this._focusNext&&(this._focusNext=!1,this._widget.focusInput())}get chatWidget(){return this._widget}get isVisible(){return this._visible}get value(){return this._widget.inputEditor.getValue()}show(e){if(!this._visible){this._visible=!0,this._focusNext=!0,this._editor.revealRangeNearTopIfOutsideViewport(F.fromPositions(e),mt.Immediate);const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setContext(!0),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.inputEditor.setValue(""),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.agent.description??"")}};VSe=D([_(2,we),_(3,Le),_(4,Te),_(5,In)],VSe);let KZ=class extends Ob{get capabilities(){let e=Ei.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=n,this.filesConfigurationService=o,this.textResourceConfigurationService=r,this.customEditorLabelService=a,this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._preferredResource=t||e,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this._preferredResource.scheme&&this.updateLabel()}updateLabel(){this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}setPreferredResource(e){ji(e,this._preferredResource)||(this._preferredResource=e,this.updateLabel())}getName(){return typeof this._name!="string"&&(this._name=this.customEditorLabelService.getName(this._preferredResource)??this.labelService.getUriBasenameLabel(this._preferredResource)),this._name}getDescription(e=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(this._preferredResource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this._preferredResource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this._preferredResource)),this._longTitle}getTitle(e){switch(e){case Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=JSt(this.resource);let i;const n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return nut(n)&&(i=n.value*Nc.MB),{size:i??t}}};KZ=D([_(2,Fs),_(3,Jt),_(4,_d),_(5,Ec),_(6,nE)],KZ);let C9=class extends oI{constructor(e,t,i,n,o){super(i,t,n,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};C9=D([_(1,xi),_(2,gi),_(3,O6),_(4,mr)],C9);var UQ;let lb=class extends KZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=n}save(e,t){return this.resource.scheme!==pe.untitled&&!this.fileService.hasProvider(this.resource)?this.saveAs(e,t):this.doSave(t,!1,e)}saveAs(e,t){return this.doSave(t,!0,e)}async doSave(e,t,i){let n;if(t?n=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):n=await this.textFileService.save(this.resource,e),!!n)return{resource:n}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};lb=D([_(2,ei),_(3,Fo),_(4,Fs),_(5,Jt),_(6,_d),_(7,Ec),_(8,nE)],lb);var TR;let MT=(TR=class extends lb{get typeId(){return UQ.ID}get editorId(){return rm.id}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(e,void 0,c,a,d,l,h,u,f),this.name=t,this.description=i,this.preferredLanguageId=n,this.preferredContents=o,this.textModelService=r,this.cachedModel=void 0,this.modelReference=void 0}getName(){return this.name||super.getName()}setName(e){this.name!==e&&(this.name=e,this._onDidChangeLabel.fire())}getDescription(){return this.description}setDescription(e){this.description!==e&&(this.description=e,this._onDidChangeLabel.fire())}setLanguageId(e,t){this.setPreferredLanguageId(e),this.cachedModel?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e}setPreferredContents(e){this.preferredContents=e}async resolve(){const e=this.preferredContents,t=this.preferredLanguageId;this.preferredContents=void 0,this.preferredLanguageId=void 0,this.modelReference||(this.modelReference=this.textModelService.createModelReference(this.resource));const i=await this.modelReference,n=i.object;if(!(n instanceof C9))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=n,(typeof e=="string"||typeof t=="string")&&n.updateTextEditorModel(typeof e=="string"?oae(e):void 0,t),n}matches(e){return this===e?!0:e instanceof UQ?ji(e.resource,this.resource):Qv(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},UQ=TR,TR.ID="workbench.editors.resourceEditorInput",TR);MT=UQ=D([_(5,fn),_(6,Fo),_(7,ei),_(8,Jt),_(9,Fs),_(10,_d),_(11,Ec),_(12,nE)],MT);const Jr=Za;var VQ,LR;let S9=(LR=class extends lb{get typeId(){return VQ.ID}get editorId(){return rm.id}constructor(e,t,i,n,o,r,a,c,l,d,h){super(e.resource,void 0,n,t,i,o,c,d,h),this.model=e,this.environmentService=r,this.pathService=a,this.textModelService=l,this.modelResolve=void 0,this.modelDisposables=this._register(new Z),this.cachedUntitledTextEditorModelReference=void 0,this.registerModelListeners(e),this._register(this.textFileService.untitled.onDidCreate(u=>this.onDidCreateUntitledModel(u)))}registerModelListeners(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelDisposables.add(e.onDidChangeName(()=>this._onDidChangeLabel.fire())),this.modelDisposables.add(e.onDidRevert(()=>this.dispose()))}onDidCreateUntitledModel(e){ji(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Ls.MEDIUM){if(!this.model.hasAssociatedFilePath){const t=this.resource.path;return t!==this.getName()?t:void 0}return super.getDescription(e)}getTitle(e){if(!this.model.hasAssociatedFilePath){const t=this.getName(),i=this.getDescription();return i&&i!==t?`${t} • ${i}`:t}return super.getTitle(e)}isDirty(){return this.model.isDirty()}getEncoding(){return this.model.getEncoding()}setEncoding(e,t){return this.model.setEncoding(e)}get hasLanguageSetExplicitly(){return this.model.hasLanguageSetExplicitly}get hasAssociatedFilePath(){return this.model.hasAssociatedFilePath}setLanguageId(e,t){this.model.setLanguageId(e,t)}getLanguageId(){return this.model.getLanguageId()}async resolve(){return this.modelResolve||(this.modelResolve=(async()=>{this.cachedUntitledTextEditorModelReference=await this.textModelService.createModelReference(this.resource)})()),await this.modelResolve,this.isDisposed()&&this.disposeModelReference(),this.model}toUntyped(e){const t={resource:this.model.hasAssociatedFilePath?x8(this.model.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme):this.resource,forceUntitled:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=this.model.isModified()?this.model.textEditorModel?.getValue():void 0,t.options.viewState=YO(this,e.preserveViewState,this.editorService),typeof t.contents=="string"&&!this.model.hasAssociatedFilePath&&!e.preserveResource&&(t.resource=void 0)),t}matches(e){return this===e?!0:e instanceof VQ?ji(e.resource,this.resource):$0t(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},VQ=LR,LR.ID="workbench.editors.untitledEditorInput",LR);S9=VQ=D([_(1,Fo),_(2,Fs),_(3,ei),_(4,Jt),_(5,Jr),_(6,bf),_(7,_d),_(8,fn),_(9,Ec),_(10,nE)],S9);const Poe=class Poe extends Error{constructor(e){super(e),this.name=Poe.code}};Poe.code="InlineChatError";let qZ=Poe,KVe=class{constructor(e,t,i,n,o,r,a,c,l){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=n,this._logService=o,this._instaService=r,this._editorService=a,this._chatService=c,this._chatAgentService=l,this._store=new Z,this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._onDidMoveSession=this._store.add(new I),this.onDidMoveSession=this._onDidMoveSession.event,this._onDidEndSession=this._store.add(new I),this.onDidEndSession=this._onDidEndSession.event,this._onDidStashSession=this._store.add(new I),this.onDidStashSession=this._onDidStashSession.event,this._sessions=new Map,this._keyComputers=new Map,this._recordings=[]}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const n=this._chatAgentService.getDefaultAgent(Ir.Editor);if(!n){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${n.extensionId}`);const c=this._chatService.startSession(Ir.Editor,i);if(!c){this._logService.trace("[IE] NO chatModel found");return}a.add(Ee(()=>{this._chatService.clearSession(c.sessionId),c.dispose()}));const l=a.add(new wn);a.add(c.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const{response:w}=b.request;l.value=w.onDidChange(()=>{if(!w.isComplete)return;l.clear();let y;w.isCanceled?y=new sCe(new Ma):w.result?.errorDetails?y=new sCe(new Error(w.result.errorDetails.message)):w.response.value.length===0?y=new Rtt:y=this._instaService.createInstance(VW,m.textModelN.uri,b.request,w),m.addExchange(new fVt(m.lastInput,y)),y instanceof VW&&y.untitledTextModel&&this._textModelService.createModelReference(y.untitledTextModel.resource).then(C=>{a.add(C)})})})),a.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(n.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${n.extensionId}`),this._releaseSession(m,!0))}));const d=ar(),h=o.uri;a.add(await this._textModelService.createModelReference(o.uri));const u=o,f=a.add(this._modelService.createModel(u6(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:M.None},h.with({scheme:pe.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:d,textModel0:""}).toString()}),!0));h.scheme===pe.untitled&&a.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:h,typeId:S9.ID,editorId:rm.id})||this._releaseSession(m,!0)}));let p=t.wholeRange;if(p||(p=new F(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn)),i.isCancellationRequested){a.dispose();return}const m=new uVt(t.editMode,h,f,u,n,a.add(new nCe(u,p)),a.add(new rCe(this._editorWorkerService,f,u)),c),v=this._key(e,m.targetUri);if(this._sessions.has(v))throw a.dispose(),new Error(`Session already stored for ${v}`);return this._sessions.set(v,{session:m,editor:e,store:a}),m}moveSession(e,t){const i=this._key(t,e.targetUri),n=this._sessions.get(i);if(n){if(n.session!==e)throw new Error("Cannot move session because the target editor already/still has one");return}let o=!1;for(const[r,a]of this._sessions)if(a.session===e){o=!0,this._sessions.delete(r),this._sessions.set(i,{...a,editor:t}),this._logService.trace(`[IE] did MOVE session for ${a.editor.getId()} to NEW EDITOR ${t.getId()}, ${e.agent.extensionId}`),this._onDidMoveSession.fire({session:e,editor:t});break}if(!o)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const r of this._sessions)if(r[1].session===e){i=r;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[n,o]=i;this._sessions.delete(n),this._logService.trace(`[IE] did RELEASED session for ${o.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:o.editor,session:e,endedByExternalCause:t}),o.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const n=this._instaService.createInstance(oCe,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),n}getCodeEditor(e){for(const[,t]of this._sessions)if(t.session===e)return t.editor;throw new Error("session not found")}getSession(e,t){const i=this._key(e,t);return this._sessions.get(i)?.session}_key(e,t){const i=this._keyComputers.get(t.scheme);return i?i.getComparisonKey(e,t):`${e.getId()}@${t.toString()}`}registerSessionKeyComputer(e,t){return this._keyComputers.set(e,t),Ee(()=>this._keyComputers.delete(e))}_keepRecording(e){this._recordings.unshift(e.asRecording())>5&&this._recordings.pop()}recordings(){return this._recordings}};KVe=D([_(0,Yi),_(1,gi),_(2,fn),_(3,Ml),_(4,Ge),_(5,we),_(6,ei),_(7,km),_(8,_f)],KVe);var $B;let qVe=($B=class{constructor(e,t){this._store=new Z,this._ctxHasProvider=K4t.bindTo(e),this._store.add(t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(Ir.Editor);this._ctxHasProvider.set(i)}))}dispose(){this._ctxHasProvider.reset(),this._store.dispose()}},$B.Id="inlineChat.enabler",$B);qVe=D([_(0,Le),_(1,_f)],qVe);var Dr;(function(s){s.CREATE_SESSION="CREATE_SESSION",s.INIT_UI="INIT_UI",s.WAIT_FOR_INPUT="WAIT_FOR_INPUT",s.SHOW_REQUEST="SHOW_REQUEST",s.SHOW_RESPONSE="SHOW_RESPONSE",s.PAUSE="PAUSE",s.CANCEL="CANCEL",s.ACCEPT="DONE"})(Dr||(Dr={}));var Ul;(function(s){s[s.NONE=0]="NONE",s[s.ACCEPT_SESSION=1]="ACCEPT_SESSION",s[s.CANCEL_SESSION=2]="CANCEL_SESSION",s[s.PAUSE_SESSION=4]="PAUSE_SESSION",s[s.CANCEL_REQUEST=8]="CANCEL_REQUEST",s[s.CANCEL_INPUT=16]="CANCEL_INPUT",s[s.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Ul||(Ul={}));let QVe=class{static get(e){return e.getContribution(b4e)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,n,o,r,a,c,l,d,h){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=n,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,this._isDisposed=!1,this._store=new Z,this._messages=this._store.add(new I),this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._sessionStore=this._store.add(new Z),this._stashedSession=this._store.add(new wn),this._forcedPlaceholder=void 0,this._ctxVisible=q4t.bindTo(l),this._ctxUserDidEdit=X4t.bindTo(l),this._ctxResponseType=nVt.bindTo(l),this._ctxRequestInProgress=iVt.bindTo(l),this._ui=new ya(()=>{const u={location:Ir.Editor,resolveData:()=>(Tt(this._editor.hasModel()),Tt(this._session),{type:Ir.Editor,selection:this._editor.getSelection(),document:this._session.textModelN.uri,wholeRange:this._session?.wholeRange.trackedInitialRange})};for(const m of h.listNotebookEditors())for(const[,v]of m.codeEditors)if(v===this._editor){u.location=Ir.Notebook;break}const f=this._store.add(t.createInstance(VSe,u,this._editor)),p=this._store.add(t.createInstance(USe,u,this._editor));return{content:f,zone:p}}),this._store.add(this._editor.onDidChangeModel(async u=>{if(this._session||!u.newModelUrl)return;const f=this._inlineChatSessionService.getSession(this._editor,u.newModelUrl);f&&(this._log("session RESUMING after model change",u),await this.run({existingSession:f}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(u=>{u.session===this._session&&u.endedByExternalCause&&(this._log("session ENDED by external cause"),this._session=void 0,this._strategy?.cancel(),this._resetWidget(),this.cancelSession())})),this._store.add(this._inlineChatSessionService.onDidMoveSession(async u=>{u.editor===this._editor&&(this._log("session RESUMING after move",u),await this.run({existingSession:u.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Ul.PAUSE_SESSION:Ul.CANCEL_SESSION),this._store.dispose(),this._isDisposed=!0,this._log("DISPOSED controller")}_log(e,...t){e instanceof Error?this._logService.error(e,...t):this._logService.trace(`[IE] (editor:${this._editor.getId()})${e}`,...t)}getMessage(){return this._ui.value.zone.widget.responseContent}getId(){return b4e}_getMode(){return this._configurationService.getValue($h.Mode)}getWidgetPosition(){return this._ui.value.zone.position}async run(e={}){try{this.finishExistingSession(),this._currentRun&&await this._currentRun,e.initialSelection&&this._editor.setSelection(e.initialSelection),this._stashedSession.clear(),this._onWillStartSession.fire(),this._currentRun=this._nextState(Dr.CREATE_SESSION,e),await this._currentRun}catch(t){vt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Dr.PAUSE]()}finally{this._currentRun=void 0}}async _nextState(e,t){let i=e;for(;i&&!this._isDisposed;)this._log("setState to ",i),i=await this[i](t)}async[Dr.CREATE_SESSION](e){Tt(this._session===void 0),Tt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const n=this._showWidget(!0,i);let o=g(7081,"Failed to start editor chat");if(!t){const r=new ci,a=M.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Ul.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateInfo(g(7082,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof qZ||c?.name===qZ.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Dr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Lh.get(this._editor)?.showMessage(o,n),this._log("Failed to start editor chat"),Dr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case Fy.Preview:this._strategy=this._instaService.createInstance(fCe,t,this._editor,this._ui.value.zone);break;case Fy.Live:default:this._strategy=this._instaService.createInstance(pCe,t,this._editor,this._ui.value.zone);break}return this._session=t,Dr.INIT_UI}async[Dr.INIT_UI](e){Tt(this._session),Tt(this._strategy),fu.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const o=this._strategy?.getWholeRangeDecoration()??[];t.set(o)};this._sessionStore.add(Ee(()=>t.clear())),this._sessionStore.add(this._session.wholeRange.onDidChange(i)),i(),this._sessionStore.add(this._ui.value.content.onDidBlur(()=>this.cancelSession())),this._ui.value.content.setSession(this._session),this._updatePlaceholder(),this._showWidget(!this._session.chatModel.hasRequests),this._ui.value.zone.widget.updateToolbar(!0),this._sessionStore.add(this._editor.onDidChangeModel(o=>{const r=this._session?.chatModel.hasRequests?Ul.PAUSE_SESSION:Ul.CANCEL_SESSION;this._log("model changed, pause or cancel session",r,o),this._messages.fire(r)}));const n=this._editor.getModel()?.getAlternativeVersionId();return this._sessionStore.add(this._editor.onDidChangeModelContent(o=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(n!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const r=this._session.wholeRange;let a=!1;if(this._configurationService.getValue($h.FinishOnType))for(const{range:c}of o.changes)a=!F.areIntersectingOrTouching(c,r.value);this._session.recordExternalEditOccurred(a),a&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async o=>{o.kind==="removeRequest"&&await this._session.undoChangesUntil(o.requestId)})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Dr.SHOW_RESPONSE):Dr.WAIT_FOR_INPUT}async[Dr.WAIT_FOR_INPUT](e){Tt(this._session),Tt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),Mr(e.message),delete e.message,this._showWidget(!1));let t=Ul.NONE,i;const n=new qd,o=new Z;return o.add(this._session.chatModel.onDidChange(r=>{r.kind==="addRequest"&&(i=r.request,t=Ul.ACCEPT_INPUT,n.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(M.once(this._messages.event)(r=>{this._log("state=_waitForInput) message received",r),t=r,n.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await n.wait(),o.dispose(),t&(Ul.CANCEL_INPUT|Ul.CANCEL_SESSION)?Dr.CANCEL:t&Ul.PAUSE_SESSION?Dr.PAUSE:t&Ul.ACCEPT_SESSION?(this._ui.value.zone.widget.selectAll(!1),Dr.ACCEPT):i?.message.text?(this._session.addInput(new gVt(i,this._editor.getModel().getAlternativeVersionId())),Dr.SHOW_REQUEST):Dr.WAIT_FOR_INPUT}async[Dr.SHOW_REQUEST](){Tt(this._session),Tt(this._session.chatModel.requestInProgress),this._ctxRequestInProgress.set(!0);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Tt(t),Tt(t.response),this._showWidget(!1),this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,n=new dc,o=new Z,r=o.add(new ci),a=new aTe,c=js.create(),l=new bI;let d=Dr.SHOW_RESPONSE;o.add(M.once(this._messages.event)(y=>{this._log("state=_makeRequest) message received",y),this._chatService.cancelCurrentRequestForSession(e.sessionId),y&Ul.CANCEL_SESSION?d=Dr.CANCEL:y&Ul.PAUSE_SESSION?d=Dr.PAUSE:y&Ul.ACCEPT_SESSION&&(d=Dr.ACCEPT)})),o.add(e.onDidChange(y=>{y.kind==="removeRequest"&&y.requestId===t.id&&(r.cancel(),n.complete(),y.reason===_9.Resend?d=Dr.SHOW_REQUEST:d=Dr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new Z2,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):ar(),applied:0};let v;const b=()=>{if(this._updateCtxResponseType(),v||(v=i.response.value.find(y=>y.kind==="textEditGroup"&&ji(y.uri,this._session?.textModelN.uri))),v){v.state??=m;const y=v.edits,C=y.slice(h);C.length>0&&(h=y.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const A=this._session.wholeRange.value.getStartPosition();for(const k of C)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const L=this._session.wholeRange.value.getStartPosition();(!L.equals(A)||!this._ui.value.zone.position?.equals(L))&&this._showWidget(!1,L.delta(-1))}))}i.isCanceled?(r.cancel(),n.complete()):i.isComplete&&n.complete()};o.add(i.onDidChange(b)),b(),await n.p,await l.whenIdle(),i.isCanceled&&await this._session.undoChangesUntil(i.requestId),o.dispose();const w=await this._editorWorkerService.computeDiff(this._session.textModel0.uri,this._session.textModelN.uri,{computeMoves:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,ignoreTrimWhitespace:!1},"advanced");return this._session.wholeRange.fixup(w?.changes??[]),await this._session.hunkData.recompute(m,w),this._ctxRequestInProgress.set(!1),d}async[Dr.SHOW_RESPONSE](){Tt(this._session),Tt(this._strategy);const{response:e}=this._session.lastExchange;let t;if(e instanceof Rtt){const i=g(7083,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(i,{classes:["warn"]}),Dr.WAIT_FOR_INPUT}else if(e instanceof sCe)e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel());else if(e instanceof VW){this._ui.value.zone.widget.updateStatus("");const i=await this._strategy.renderChanges();if(i){const n=this._editor.getSelection();n?.containsPosition(i)?i.lineNumber-n.startLineNumber>8&&(t=i):t=i}}return this._showWidget(!1,t),Dr.WAIT_FOR_INPUT}async[Dr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Dr.ACCEPT](){Tt(this._session),Tt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(7084,"Failed to apply changes.",Nr(e))),this._log("FAILED to apply changes"),this._log(e)}this._inlineChatSessionService.releaseSession(this._session),this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}async[Dr.CANCEL](){if(this._session){Tt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&this._session.chatModel.hasRequests&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(7085,"Failed to discard changes.",Nr(i))),this._log("FAILED to discard changes"),this._log(i)}this._stashedSession.clear(),e?this._stashedSession.value=this._inlineChatSessionService.stashSession(this._session,this._editor,t):this._inlineChatSessionService.releaseSession(this._session)}this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}_showWidget(e=!1,t){Tt(this._editor.hasModel()),this._ctxVisible.set(!0);let i;return t?i=t:this._ui.rawValue?.zone?.position?this._ui.rawValue?.zone.position.lineNumber===1?i=this._ui.rawValue?.zone.position.delta(-1):i=this._ui.rawValue?.zone.position:i=this._editor.getSelection().getStartPosition().delta(-1),this._session&&!t&&(this._session.hasChangedText||this._session.chatModel.hasRequests)&&(i=this._session.wholeRange.value.getStartPosition().delta(-1)),this._ui.rawValue?.zone?.position?this._ui.value.zone.updatePositionAndHeight(i):e?(i=this._editor.getSelection().getStartPosition(),this._ui.value.content.show(i)):(this._ui.value.content.hide(),this._ui.value.zone.show(i),this._session&&this._ui.value.zone.widget.setChatModel(this._session.chatModel)),i}_resetWidget(){this._sessionStore.clear(),this._ctxVisible.reset(),this._ctxUserDidEdit.reset(),this._ui.rawValue?.content.hide(),this._ui.rawValue?.zone?.hide(),this._editor.hasWidgetFocus()&&this._editor.focus()}_updateCtxResponseType(){if(!this._session){this._ctxResponseType.set(O1.None);return}const e=i=>i.value.some(n=>n.kind==="textEditGroup"&&ji(n.uri,this._session?.textModelN.uri));let t=O1.None;for(const i of this._session.chatModel.getRequests())if(i.response&&(t=O1.Messages,e(i.response.response))){t=O1.MessagesAndEdits;break}this._ctxResponseType.set(t)}async _makeChanges(e,t,i){Tt(this._session),Tt(this._strategy);const n=await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri,e);if(this._log("edits from PROVIDER and after making them MORE MINIMAL",this._session.agent.extensionId,e,n),n?.length===0)return;const r=(!t&&n?n:e).map(nTe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),t?await this._strategy.makeProgressiveChanges(r,a,t,i):await this._strategy.makeChanges(r,a,i)}_updatePlaceholder(){this._ui.value.zone.widget.placeholder=this._getPlaceholderText()}_getPlaceholderText(){return this._forcedPlaceholder??this._session?.agent.description??""}showSaveHint(){const e=g(7086,"Accept or discard changes to continue saving");this._ui.value.zone.widget.updateStatus(e,{classes:["warn"]})}acceptInput(){return this.chatWidget.acceptInput()}updateInput(e,t=!0){if(this._ui.value.content.chatWidget.setInput(e),this._ui.value.zone.widget.chatWidget.setInput(e),t){const i=new dt(1,1,Number.MAX_SAFE_INTEGER,1);this._ui.value.content.chatWidget.inputEditor.setSelection(i),this._ui.value.zone.widget.chatWidget.inputEditor.setSelection(i)}}cancelCurrentRequest(){this._messages.fire(Ul.CANCEL_INPUT|Ul.CANCEL_REQUEST)}arrowOut(e){if(this._ui.value.zone.position&&this._editor.hasModel()){const{column:t}=this._editor.getPosition(),{lineNumber:i}=this._ui.value.zone.position,n=e?i:i+1;this._editor.setPosition({lineNumber:n,column:t}),this._editor.focus()}}focus(){this._ui.value.zone.widget.focus()}hasFocus(){return this._ui.value.zone.widget.hasFocus()}moveHunk(e){this.focus(),this._strategy?.move?.(e)}async viewInChat(){if(!this._strategy||!this._session)return;let e=!1,t;const i=this._editor.getModel()?.uri,n=this._session.chatModel.getRequests();for(const r of n)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&ji(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Tt(t),t.edits=[o]),await this._instaService.invokeFunction(Czt,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"accepted"}}),this._messages.fire(Ul.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"discarded"}}),this._messages.fire(Ul.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===Fy.Preview?(this._log("finishing existing session, using CANCEL",this._session.editMode),this.cancelSession()):(this._log("finishing existing session, using APPLY",this._session.editMode),this.acceptSession()))}unstashLastSession(){const e=this._stashedSession.value?.unstash();return e&&this._inlineChatSavingService.markChanged(e),e}joinCurrentRun(){return this._currentRun}};QVe=D([_(1,we),_(2,ZRe),_(3,RJe),_(4,Ml),_(5,Ge),_(6,Te),_(7,to),_(8,Le),_(9,km),_(10,R6)],QVe);async function Czt(s,e){const t=s.get(Lm),i=s.get(km),n=await M4t(t);if(n&&n.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(n.viewModel.model.sessionId,o);n.focusLastMessage()}}const Szt="workbench.action.quickchat.toggle";var zSe;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(zSe||(zSe={}));function oit(s){const e=[],t=new Map,i=(n,o)=>{if(!t.has(n)&&(t.set(n,!0),!(n[0]==="_"||n.indexOf("vscode.")===0)&&s.get(n)!==!0)){if(!o){const r=_t.getCommand(n);if(r&&typeof r.metadata=="object"&&eo(r.metadata.args))return}e.push(n)}};for(const n of jn.getMenuItems(_e.CommandPalette))bT(n)&&i(n.command.id,!0);for(const n of ap.getEditorActions())i(n.id,!0);for(const n of _t.getCommands().keys())i(n,!1);return e}var Bm;const _ue="keybinding.entry.template",jVe=g(4636,"System"),YVe=g(4637,"Extension"),JVe=g(4638,"User");function Azt(s,e){const t=e?` +when:${e}`:"";return`@command:${s}${t}`}const Ezt=q2(CM,TE,lae),xzt=/@command:\s*([^\+]+)/i,Dzt=/\+when:\s*(.+)/i,XVe=/@source:\s*(user|default|system|extension)/i,ZVe=/@ext:\s*((".+")|([^\s]+))/i,kzt=/@keybinding:\s*((\".+\")|(\S+))/i;let e5e=Bm=class extends RI{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:p6.modifierLabels[e],aria:hje.modifierLabels[e],user:FLe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const n=xzt.exec(e);if(n&&n[1]){const o=n[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=Dzt.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:Bm.getId(a),keybindingItem:a,templateId:_ue}))}if(XVe.test(e))i=this.filterBySource(i,e),e=e.replace(XVe,"");else{const o=ZVe.exec(e);if(o&&(o[2]||o[3])){const r=o[2]?o[2].substring(1,o[2].length-1):o[3];i=this.filterByExtension(i,r),e=e.replace(ZVe,"")}else{const r=kzt.exec(e);r&&(r[2]||r[3])&&(e=r[2]||`"${r[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(o=>({id:Bm.getId(o),keybindingItem:o,templateId:_ue}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===jVe):/@source:\s*user/i.test(t)?e.filter(i=>i.source===JVe):/@source:\s*extension/i.test(t)?e.filter(i=>!Lt(i.source)||i.source===YVe):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!Lt(i.source)&&(Sn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',n=t.charAt(t.length-1)==='"',o=i&&n;i&&(t=t.substring(1)),n&&(t=t.substring(0,t.length-1)),t=t.trim();const r=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new Izt(this.modifierLabels,l,t,a,c,o);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&r.push({id:Bm.getId(l),templateId:_ue,commandLabelMatches:d.commandLabelMatches||void 0,commandDefaultLabelMatches:d.commandDefaultLabelMatches||void 0,keybindingItem:l,keybindingMatches:d.keybindingMatches||void 0,commandIdMatches:d.commandIdMatches||void 0,sourceMatches:d.sourceMatches||void 0,whenMatches:d.whenMatches||void 0,extensionIdMatches:d.extensionIdMatches||void 0,extensionLabelMatches:d.extensionLabelMatches||void 0})}return r}filterByWhen(e,t,i){if(e.length===0)return[];const n=e.filter(c=>c.when===i);if(n.length)return n;const o=e[0].commandLabel,r=new Dx(void 0,t,null,he.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[Bm.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Fi(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const o of this.keybindingsService.getKeybindings())o.command&&(this._keybindingItemsSortedByPrecedence.push(Bm.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const n=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of oit(i)){const r=new Dx(void 0,o,null,void 0,n.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(Bm.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=ja(this._keybindingItemsSortedByPrecedence,o=>Bm.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>Bm.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(Lt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new va;for(const t of this.extensionService.extensions)e.set(t.identifier,t);return e}static compareKeybindingData(e,t){return e.keybinding&&!t.keybinding?-1:t.keybinding&&!e.keybinding?1:e.commandLabel&&!t.commandLabel?-1:t.commandLabel&&!e.commandLabel?1:e.commandLabel&&t.commandLabel&&e.commandLabel!==t.commandLabel?e.commandLabel.localeCompare(t.commandLabel):e.command===t.command?e.keybindingItem.isDefault?1:-1:e.command.localeCompare(t.command)}static toKeybindingEntry(e,t,i,n){const o=jn.getCommand(e),r=i.get(e);let a=JVe;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?n.get(c)??YVe:jVe}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:Bm.getCommandLabel(o,r),commandDefaultLabel:Bm.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!xk.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(4639,"{0}: {1}",t,i):i}return null}static getCommandLabel(e,t){if(e){const i=e.category?typeof e.category=="string"?e.category:e.category.value:void 0,n=typeof e.title=="string"?e.title:e.title.value;return i?g(4639,"{0}: {1}",i,n):n}return t||""}};e5e=Bm=D([_(1,Ut),_(2,fs)],e5e);class Izt{constructor(e,t,i,n,o,r){this.modifierLabels=e,this.commandIdMatches=null,this.commandLabelMatches=null,this.commandDefaultLabelMatches=null,this.sourceMatches=null,this.whenMatches=null,this.keybindingMatches=null,this.extensionIdMatches=null,this.extensionLabelMatches=null,r||(this.commandIdMatches=this.matches(i,t.command,q2(TE,FY),n),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>TE(a,t.commandLabel,!0),n):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>TE(a,t.commandDefaultLabel,!0),n):null,this.whenMatches=t.when?this.matches(null,t.when,q2(TE,FY),n):null,Lt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>TE(a,t.source,!0),n):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>TE(a,t.commandLabel,!0),n):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,n){let o=e?Ezt(e,t):null;return o||(o=this.matchesWords(n,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let n=[];for(const o of e){const r=i(o,t);if(r)n=[...n||[],...r];else{n=null;break}}return n}filterAndSort(e){return ja(e,t=>t.start+"."+t.end).filter(t=>!e.some(i=>!(i.start===t.start&&i.end===t.end)&&i.start<=t.start&&i.end>=t.end)).sort((t,i)=>t.start-i.start)}matchesKeybinding(e,t,i,n){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&wS(t,a)===0||c&&wS(t,c)===0||l&&wS(t,l)===0)return{firstPart:this.createCompleteMatch(o),chordPart:this.createCompleteMatch(r)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(871,"No matching commands"),commandId:""})},n,o,r,a,c),this.editorService=e,this.menuService=t,this.extensionService=i,this.configurationService=l,this.editorGroupService=d,this.preferencesService=h,this.productService=u,this.aiRelatedInformationService=f,this.chatAgentService=p,this.extensionRegistrationRace=IGe(this.extensionService.whenInstalledExtensionsRegistered(),800),this.useAiRelatedInfo=!1,this._register(l.onDidChangeConfiguration(m=>this.updateOptions(m))),this.updateOptions()}get configuration(){const e=this.configurationService.getValue().workbench.commandPalette;return{preserveInput:e.preserveInput,experimental:e.experimental}}updateOptions(e){if(e&&!e.affectsConfiguration("workbench.commandPalette.experimental"))return;const t=this.configuration,i=t.experimental.suggestCommands&&this.productService.commandPaletteSuggestedCommandIds?.length?new Set(this.productService.commandPaletteSuggestedCommandIds):void 0;this.options.suggestedCommandIds=i,this.useAiRelatedInfo=t.experimental.enableNaturalLanguageSearch}async getCommandPicks(e){return await this.extensionRegistrationRace,e.isCancellationRequested?[]:[...this.getCodeEditorCommandPicks(),...this.getGlobalCommandPicks()].map(t=>({...t,buttons:[{iconClass:We.asClassName(ve.gear),tooltip:g(872,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:Azt(t.commandId,t.commandWhen)}),IS.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,n){if(!this.hasAdditionalCommandPicks(i,n))return[];let o;try{await Sr(DV.AI_RELATED_INFORMATION_DEBOUNCE,n),o=await this.getRelatedInformationPicks(e,t,i,n)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(Ir.Panel);return r&&o.push({label:g(873,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?Szt:G4t,args:[i]}),o}async getRelatedInformationPicks(e,t,i,n){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[zSe.CommandInformation],n);o.sort((c,l)=>l.weight-c.weight);const r=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of o){if(c.weightd.commandId===c.command&&!r.has(d.commandId));l&&a.push(l)}return a}getGlobalCommandPicks(){const e=[],t=this.editorService.activeEditorPane?.scopedContextKeyService||this.editorGroupService.activeGroup.scopedContextKeyService,n=this.menuService.getMenuActions(_e.CommandPalette,t).reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof Sc&&o.enabled);for(const o of n){let r=(typeof o.item.title=="string"?o.item.title:o.item.title.value)||o.item.id;const a=typeof o.item.category=="string"?o.item.category:o.item.category?.value;a&&(r=g(874,"{0}: {1}",a,r));const c=typeof o.item.title!="string"?o.item.title.original:void 0,l=a&&o.item.category&&typeof o.item.category!="string"?o.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=o.item.metadata?.description,u=h===void 0||GLe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:dae(r),commandDescription:u})}return e}},DV=qS,qS.AI_RELATED_INFORMATION_MAX_PICKS=5,qS.AI_RELATED_INFORMATION_THRESHOLD=.8,qS.AI_RELATED_INFORMATION_DEBOUNCE=200,qS);XM=DV=D([_(0,ei),_(1,Oa),_(2,fs),_(3,we),_(4,Ut),_(5,vi),_(6,Yi),_(7,to),_(8,Te),_(9,Po),_(10,B6),_(11,Er),_(12,nMe),_(13,_f)],XM);const Foe=class Foe extends li{constructor(){super({id:Foe.ID,title:Pe(875,"Show All Commands"),keybinding:{weight:Ae.WorkbenchContrib,when:void 0,primary:rf?void 0:U.CtrlCmd|U.Shift|S.KeyP,secondary:[S.F1]},f1:!0})}async run(e){e.get(In).quickAccess.show(XM.PREFIX)}};Foe.ID="workbench.action.showCommands";let aI=Foe;class Tzt extends li{constructor(){super({id:"workbench.action.clearCommandHistory",title:Pe(876,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Te),i=e.get($i),n=e.get(to);if(p9.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await n.confirm({type:"warning",message:g(877,"Do you want to clear the history of recently used commands?"),detail:g(878,"This action is irreversible!"),primaryButton:g(879,"&&Clear")});if(!r)return;p9.clearHistory(t,i)}}}class rit{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new wn);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=s6(o);if(a){let c=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},n.add(hm(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(Ee(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,Db.JUMP),e.revealRangeInCenter(t.range,mt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ah(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return im(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:$o(Iqe),position:kl.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Ooe=class Ooe extends rit{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(4642,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,V.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(n,l.lineNumber))return;this.gotoLocation(e,{range:this.toRange(l.lineNumber,l.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=this.parsePosition(n,t.value.trim().substr(Ooe.PREFIX.length)),l=this.getPickLabel(n,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(n,c.lineNumber)){this.clearDecorations(n);return}const d=this.toRange(c.lineNumber,c.column);n.revealRangeInCenter(d,mt.Smooth),this.addDecorations(n,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=s6(n);return a&&a.getOptions().get(x.lineNumbers).renderType===wr.Relative&&(a.updateOptions({lineNumbers:"on"}),o.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(4643,"Go to line {0} and character {1}.",t,i):g(4644,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(4645,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):g(4646,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Ooe.PREFIX=":";let QZ=Ooe,jZ=class extends QZ{constructor(e,t,i){super(),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview}}get activeTextEditorControl(){return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}};jZ=D([_(0,ei),_(1,Po),_(2,Te)],jZ);const Boe=class Boe extends li{constructor(){super({id:Boe.ID,title:Pe(880,"Go to Line/Column..."),f1:!0,keybinding:{weight:Ae.WorkbenchContrib,when:null,primary:U.CtrlCmd|S.KeyG,mac:{primary:U.WinCtrl|S.KeyG}}})}async run(e){e.get(In).quickAccess.show(jZ.PREFIX)}};Boe.ID="workbench.action.gotoLine";let YZ=Boe;At(YZ);Qe.as(RU.Quickaccess).registerQuickAccessProvider({ctor:jZ,prefix:QZ.PREFIX,placeholder:g(881,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(882,"Go to Line/Column"),commandId:YZ.ID}]});var zQ,ab;let NT=(ab=class extends rit{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,g(4647,"To go to a symbol, first open a text editor with symbol information.")),V.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):V.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Z;return this.provideLabelPick(i,g(4648,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:pt.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new dc,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){const r=e.editor,a=new Z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),o?.handleAccept?.(u),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const c=this.getDocumentSymbols(t,n);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ci(n),i.busy=!0;try{const u=b9(i.value.substr(zQ.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(n.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=Ak(f,m=>!!(m.type!=="separator"&&m.range&&F.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(4649,"No matching editor symbols")):this.provideLabelPick(i,g(4650,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,mt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(zQ.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=gVe(t.values[0]),d=gVe(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?We.asClassName(ve.splitHorizontal):We.asClassName(ve.splitVertical),tooltip:u==="right"?g(4651,"Open to the Side"):g(4652,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let G=!1;if(l!==t&&([L,k]=fue(y,{...t,values:void 0},c,C),typeof L=="number"&&(G=!0)),typeof L!="number"&&([L,k]=fue(y,l,c,C),typeof L!="number"))continue;if(!G&&d){if(A&&d.original.length>0&&([P,R]=fue(A,d)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const z=b.tags&&b.tags.indexOf(y8.Deprecated)>=0;f.push({index:v,kind:b.kind,score:L,label:y,ariaLabel:Zct(b.name,b.kind),description:A,highlights:z?void 0:{label:k,description:R},range:{selection:F.collapseToStart(b.selectionRange),decoration:b.range},uri:o.uri,symbolName:w,strikethrough:z,buttons:h})}const p=f.sort((v,b)=>a?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let m=[];if(a){let y=function(){b&&typeof v=="number"&&w>0&&(b.label=$p(bue[v]||vue,w))},v,b,w=0;for(const C of p)v!==C.kind?(y(),v=C.kind,w=1,b={type:"separator"},m.push(b)):w++,m.push(C);y()}else p.length>0&&(m=[{label:g(4653,"symbols ({0})",f.length),type:"separator"},...p]);return m}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=bue[e.kind]||vue,n=bue[t.kind]||vue,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},zQ=ab,ab.PREFIX="@",ab.SCOPE_PREFIX=":",ab.PREFIX_BY_CATEGORY=`${ab.PREFIX}${ab.SCOPE_PREFIX}`,ab);NT=zQ=D([_(0,it),_(1,iG)],NT);const vue=g(4654,"properties ({0})"),bue={[pt.Method]:g(4655,"methods ({0})"),[pt.Function]:g(4656,"functions ({0})"),[pt.Constructor]:g(4657,"constructors ({0})"),[pt.Variable]:g(4658,"variables ({0})"),[pt.Class]:g(4659,"classes ({0})"),[pt.Struct]:g(4660,"structs ({0})"),[pt.Event]:g(4661,"events ({0})"),[pt.Operator]:g(4662,"operators ({0})"),[pt.Interface]:g(4663,"interfaces ({0})"),[pt.Namespace]:g(4664,"namespaces ({0})"),[pt.Package]:g(4665,"packages ({0})"),[pt.TypeParameter]:g(4666,"type parameters ({0})"),[pt.Module]:g(4667,"modules ({0})"),[pt.Property]:g(4654,"properties ({0})"),[pt.Enum]:g(4668,"enumerations ({0})"),[pt.EnumMember]:g(4669,"enumeration members ({0})"),[pt.String]:g(4670,"strings ({0})"),[pt.File]:g(4671,"files ({0})"),[pt.Array]:g(4672,"arrays ({0})"),[pt.Number]:g(4673,"numbers ({0})"),[pt.Boolean]:g(4674,"booleans ({0})"),[pt.Object]:g(4675,"objects ({0})"),[pt.Key]:g(4676,"keys ({0})"),[pt.Field]:g(4677,"fields ({0})"),[pt.Constant]:g(4678,"constants ({0})")};var $Se;(function(s){s[s.OutlinePane=1]="OutlinePane",s[s.Breadcrumbs=2]="Breadcrumbs",s[s.QuickPick=4]="QuickPick"})($Se||($Se={}));var t5e;(function(s){s.icons="outline.icons",s.collapseItems="outline.collapseItems",s.problemsEnabled="outline.problems.enabled",s.problemsColors="outline.problems.colors",s.problemsBadges="outline.problems.badges"})(t5e||(t5e={}));var i5e;(function(s){s.Collapsed="alwaysCollapse",s.Expanded="alwaysExpand"})(i5e||(i5e={}));var GSe,RR;let JZ=(RR=class extends NT{constructor(e,t,i,n,o,r){super(n,r,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=o,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview,openSideBySideDirection:e?.openSideBySideDirection}}get activeTextEditorControl(){if(!W2(this.editorService.activeEditorPane?.getControl()))return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}async getSymbolPicks(e,t,i,n,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,n),Sr(GSe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),b9(t),i,o,e)}provideWithoutTextEditor(e){return this.canPickWithOutlineService()?this.doGetOutlinePicks(e):super.provideWithoutTextEditor(e)}canPickWithOutlineService(){return this.editorService.activeEditorPane?this.outlineService.canCreateOutline(this.editorService.activeEditorPane):!1}doGetOutlinePicks(e){const t=this.editorService.activeEditorPane;if(!t)return V.None;const i=new ci,n=new Z;return n.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,$Se.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}n.add(o);const r=o.captureViewState();n.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:pt.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));n.add(e.onDidAccept(()=>{e.hide();const[h]=e.selectedItems;h&&a[h.index]&&o.reveal(a[h.index].element,{},!1,!1)}));const l=()=>{const h=c.filter(u=>{if(e.value==="@")return u.score=0,u.highlights=void 0,!0;const f=e.value.substring(NT.PREFIX.length).trim(),p=lF(u.label),m=Uk(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:Mq(f,p)??void 0},!0):!1});if(h.length===0){const u=g(883,"No matching entries");e.items=[{label:u,index:-1,kind:pt.String}],e.ariaLabel=u}else e.items=h};l(),n.add(e.onDidChangeValue(l));const d=new wn;n.add(d),n.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{vt(o),e.hide()}).finally(()=>{e.busy=!1}),n}},GSe=RR,RR.SYMBOL_PICKS_TIMEOUT=8e3,RR);JZ=GSe=D([_(0,ei),_(1,Po),_(2,Te),_(3,it),_(4,hXe),_(5,iG)],JZ);const Woe=class Woe extends li{constructor(){super({id:Woe.ID,title:{...Pe(884,"Go to Symbol in Editor..."),mnemonicTitle:g(885,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:he.and(bp.negate(),NA.negate()),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|U.Shift|S.KeyO},menu:[{id:_e.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(In).quickAccess.show(JZ.PREFIX,{itemActivation:Hf.NONE})}};Woe.ID="workbench.action.gotoSymbol";let XZ=Woe;At(XZ);Qe.as(RU.Quickaccess).registerQuickAccessProvider({ctor:JZ,prefix:NT.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(886,"Type the name of a symbol to go to."),helpEntries:[{description:g(887,"Go to Symbol in Editor"),prefix:NT.PREFIX,commandId:XZ.ID,commandCenterOrder:40},{description:g(888,"Go to Symbol in Editor by Category"),prefix:NT.PREFIX_BY_CATEGORY}]});const uA={primary:U.CtrlCmd|S.KeyP,secondary:[U.CtrlCmd|S.KeyE],mac:{primary:U.CtrlCmd|S.KeyP,secondary:void 0}};So.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:Ae.WorkbenchContrib,when:_C,primary:S.Escape,secondary:[U.Shift|S.Escape],handler:s=>s.get(In).cancel()});So.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>s.get(In).accept()});So.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>s.get(In).accept({ctrlCmd:!0,alt:!1})});So.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>{s.get(In).focus()}});const n5e="workbench.action.quickOpenNavigateNextInFilePicker";So.registerCommandAndKeybindingRule({id:n5e,weight:Ae.WorkbenchContrib+50,handler:Sce(n5e,!0),when:ytt,primary:uA.primary,secondary:uA.secondary,mac:uA.mac});const s5e="workbench.action.quickOpenNavigatePreviousInFilePicker";So.registerCommandAndKeybindingRule({id:s5e,weight:Ae.WorkbenchContrib+50,handler:Sce(s5e,!1),when:ytt,primary:uA.primary|U.Shift,secondary:[uA.secondary[0]|U.Shift],mac:{primary:uA.mac.primary|U.Shift,secondary:void 0}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>{s.get(In).toggle()}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:Ae.WorkbenchContrib+50,when:_C,primary:0,win:{primary:U.Alt|S.LeftArrow},mac:{primary:U.WinCtrl|S.Minus},linux:{primary:U.CtrlCmd|U.Alt|S.Minus},handler:s=>{s.get(In).back()}});At(class extends li{constructor(){super({id:"workbench.action.quickOpen",title:Pe(889,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:Ae.WorkbenchContrib,primary:uA.primary,secondary:uA.secondary,mac:uA.mac},f1:!0})}run(e,t){e.get(In).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends li{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(890,"Quick Open"),icon:ve.search,menu:{id:_e.CommandCenterCenter,order:100}})}run(e){e.get(In).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});_t.registerCommand("workbench.action.quickOpenPreviousEditor",async s=>{s.get(In).quickAccess.show("",{itemActivation:Hf.SECOND})});class Tce extends li{constructor(e,t,i,n,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=n}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:n}:void 0;i.navigate(this.next,o)}}class Lzt extends Tce{constructor(){super("workbench.action.quickOpenNavigateNext",Pe(891,"Navigate Next in Quick Open"),!0,!0)}}class Rzt extends Tce{constructor(){super("workbench.action.quickOpenNavigatePrevious",Pe(892,"Navigate Previous in Quick Open"),!1,!0)}}class Mzt extends Tce{constructor(){super("workbench.action.quickOpenSelectNext",Pe(893,"Select Next in Quick Open"),!0,!1,{weight:Ae.WorkbenchContrib+50,when:_C,primary:0,mac:{primary:U.WinCtrl|S.KeyN}})}}class Nzt extends Tce{constructor(){super("workbench.action.quickOpenSelectPrevious",Pe(894,"Select Previous in Quick Open"),!1,!1,{weight:Ae.WorkbenchContrib+50,when:_C,primary:0,mac:{primary:U.WinCtrl|S.KeyP}})}}At(Mzt);At(Nzt);At(Lzt);At(Rzt);var kV,MR;let Y5=(MR=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Qe.as(RU.Quickaccess)}provide(e){const t=new Z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(kV.PREFIX.length));n&&n.prefix&&n.prefix!==kV.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==kV.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(4806,"{0}, {1}",n,t.description),description:t.description}})}},kV=MR,MR.PREFIX="?",MR);Y5=kV=D([_(0,In),_(1,Ut)],Y5);const o5e="workbench.panel.repl.view";new Q("debugType",void 0,{type:"string",description:g(6,"Debug type of the active debug session. For example 'python'.")});new Q("debugConfigurationType",void 0,{type:"string",description:g(7,"Debug type of the selected launch configuration. For example 'python'.")});new Q("debugState","inactive",{type:"string",description:g(8,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const Pzt="debugUx";new Q(Pzt,"default",{type:"string",description:g(9,"Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.")});new Q("hasDebugged",!1,{type:"boolean",description:g(10,"True when a debug session has been started at least once, false otherwise.")});new Q("inDebugMode",!1,{type:"boolean",description:g(11,"True when debugging, false otherwise.")});new Q("inDebugRepl",!1,{type:"boolean",description:g(12,"True when focus is in the debug console, false otherwise.")});new Q("breakpointWidgetVisible",!1,{type:"boolean",description:g(13,"True when breakpoint editor zone widget is visible, false otherwise.")});new Q("inBreakpointWidget",!1,{type:"boolean",description:g(14,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Q("breakpointsFocused",!0,{type:"boolean",description:g(15,"True when the BREAKPOINTS view is focused, false otherwise.")});new Q("watchExpressionsFocused",!0,{type:"boolean",description:g(16,"True when the WATCH view is focused, false otherwise.")});new Q("watchExpressionsExist",!1,{type:"boolean",description:g(17,"True when at least one watch expression exists, false otherwise.")});new Q("variablesFocused",!0,{type:"boolean",description:g(18,"True when the VARIABLES views is focused, false otherwise")});new Q("expressionSelected",!1,{type:"boolean",description:g(19,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new Q("breakpointInputFocused",!1,{type:"boolean",description:g(20,"True when the input box has focus in the BREAKPOINTS view.")});new Q("callStackItemType",void 0,{type:"string",description:g(21,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new Q("callStackSessionIsAttach",!1,{type:"boolean",description:g(22,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new Q("callStackItemStopped",!1,{type:"boolean",description:g(23,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new Q("callStackSessionHasOneThread",!1,{type:"boolean",description:g(24,"True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.")});new Q("watchItemType",void 0,{type:"string",description:g(25,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new Q("canViewMemory",void 0,{type:"boolean",description:g(26,"Indicates whether the item in the view has an associated memory refrence.")});new Q("breakpointItemType",void 0,{type:"string",description:g(27,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new Q("breakpointItemBytes",void 0,{type:"boolean",description:g(28,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Q("breakpointHasModes",!1,{type:"boolean",description:g(29,"Whether the breakpoint has multiple modes it can switch to.")});new Q("breakpointSupportsCondition",!1,{type:"boolean",description:g(30,"True when the focused breakpoint supports conditions.")});new Q("loadedScriptsSupported",!1,{type:"boolean",description:g(31,"True when the focused sessions supports the LOADED SCRIPTS view")});new Q("loadedScriptsItemType",void 0,{type:"string",description:g(32,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Q("focusedSessionIsAttach",!1,{type:"boolean",description:g(33,"True when the focused session is 'attach'.")});new Q("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(34,"True when the focused session is run without debugging.")});new Q("stepBackSupported",!1,{type:"boolean",description:g(35,"True when the focused session supports 'stepBack' requests.")});new Q("restartFrameSupported",!1,{type:"boolean",description:g(36,"True when the focused session supports 'restartFrame' requests.")});new Q("stackFrameSupportsRestart",!1,{type:"boolean",description:g(37,"True when the focused stack frame supports 'restartFrame'.")});new Q("jumpToCursorSupported",!1,{type:"boolean",description:g(38,"True when the focused session supports 'jumpToCursor' request.")});new Q("stepIntoTargetsSupported",!1,{type:"boolean",description:g(39,"True when the focused session supports 'stepIntoTargets' request.")});new Q("breakpointsExist",!1,{type:"boolean",description:g(40,"True when at least one breakpoint exists.")});new Q("debuggersAvailable",!1,{type:"boolean",description:g(41,"True when there is at least one debug extensions active.")});new Q("debugExtensionAvailable",!0,{type:"boolean",description:g(42,"True when there is at least one debug extension installed and enabled.")});new Q("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(43,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Q("debugSetVariableSupported",!1,{type:"boolean",description:g(44,"True when the focused session supports 'setVariable' request.")});new Q("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(45,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Q("debugSetExpressionSupported",!1,{type:"boolean",description:g(46,"True when the focused session supports 'setExpression' request.")});new Q("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(47,"True when the focused session supports to break when value changes.")});new Q("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(48,"True when the focused breakpoint supports to break when value is accessed.")});new Q("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(49,"True when the focused breakpoint supports to break when value is read.")});new Q("terminateDebuggeeSupported",!1,{type:"boolean",description:g(50,"True when the focused session supports the terminate debuggee capability.")});new Q("suspendDebuggeeSupported",!1,{type:"boolean",description:g(51,"True when the focused session supports the suspend debuggee capability.")});new Q("variableEvaluateNamePresent",!1,{type:"boolean",description:g(52,"True when the focused variable has an 'evalauteName' field set.")});new Q("variableIsReadonly",!1,{type:"boolean",description:g(53,"True when the focused variable is read-only.")});new Q("variableValue",!1,{type:"string",description:g(54,"Value of the variable, present for debug visualization clauses.")});new Q("variableType",!1,{type:"string",description:g(55,"Type of the variable, present for debug visualization clauses.")});new Q("variableInterfaces",!1,{type:"array",description:g(56,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Q("variableName",!1,{type:"string",description:g(57,"Name of the variable, present for debug visualization clauses.")});new Q("variableLanguage",!1,{type:"string",description:g(58,"Language of the variable source, present for debug visualization clauses.")});new Q("variableExtensionId",!1,{type:"string",description:g(59,"Extension ID of the variable source, present for debug visualization clauses.")});new Q("exceptionWidgetVisible",!1,{type:"boolean",description:g(60,"True when the exception widget is visible.")});new Q("multiSessionRepl",!1,{type:"boolean",description:g(61,"True when there is more than 1 debug console.")});new Q("multiSessionDebug",!1,{type:"boolean",description:g(62,"True when there is more than 1 active debug session.")});new Q("disassembleRequestSupported",!1,{type:"boolean",description:g(63,"True when the focused sessions supports disassemble request.")});new Q("disassemblyViewFocus",!1,{type:"boolean",description:g(64,"True when the Disassembly View is focused.")});new Q("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(65,"True when the language in the current editor supports disassemble request.")});new Q("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(66,"True when the focused stack frame has instruction pointer reference.")});g(68,"Controls when the internal Debug Console should open.");var r5e;(function(s){s[s.Inactive=0]="Inactive",s[s.Initializing=1]="Initializing",s[s.Stopped=2]="Stopped",s[s.Running=3]="Running"})(r5e||(r5e={}));var a5e;(function(s){s[s.Valid=0]="Valid",s[s.Unreadable=1]="Unreadable",s[s.Error=2]="Error"})(a5e||(a5e={}));var ZZ;(function(s){s[s.Variable=0]="Variable",s[s.Address=1]="Address"})(ZZ||(ZZ={}));var A9;(function(s){s[s.Initial=1]="Initial",s[s.Dynamic=2]="Dynamic"})(A9||(A9={}));var c5e;(function(s){s.UnverifiedBreakpoints="unverifiedBreakpoints"})(c5e||(c5e={}));var l5e;(function(s){s[s.CONDITION=0]="CONDITION",s[s.HIT_COUNT=1]="HIT_COUNT",s[s.LOG_MESSAGE=2]="LOG_MESSAGE",s[s.TRIGGER_POINT=3]="TRIGGER_POINT"})(l5e||(l5e={}));var eee;(function(s){s[s.Command=0]="Command",s[s.Tree=1]="Tree"})(eee||(eee={}));var KSe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(KSe||(KSe={}));var qSe;(function(s){s.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:N.revive(e.iconPath.light),dark:N.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),s.serialize=e=>e})(qSe||(qSe={}));var QSe,NR;let KW=(NR=class extends mNe{constructor(e,t,i,n,o,r,a,c){super(QSe.PREFIX,{noResultsPick:{label:g(4807,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=n,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:OY(e,r.label,!0)??void 0},r.highlights.label||_at(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const n=[];let o;for(const r of t){if(o!==r.containerLabel){o=r.containerLabel;let a;i.has(o)?a=`${i.get(o)} / ${o}`:a=o,n.push({type:"separator",label:a})}n.push(r)}return n}doGetViewPickItems(){const e=[],t=(r,a)=>{const c=this.viewDescriptorService.getViewContainerModel(a),l=[];for(const d of c.allViewDescriptors)this.contextKeyService.contextMatchesRules(d.when)&&l.push({label:d.name.value,containerLabel:c.title,accept:()=>this.viewsService.openView(d.id,!0)});return l},i=(r,a)=>{const c=this.paneCompositeService.getPaneComposites(r),l=this.paneCompositeService.getVisiblePaneCompositeIds(r);c.sort((d,h)=>{let u=l.findIndex(p=>d.id===p),f=l.findIndex(p=>h.id===p);return u<0&&(u=c.indexOf(d)+l.length),f<0&&(f=c.indexOf(h)+l.length),u-f});for(const d of c)if(this.includeViewContainer(d)){const h=this.viewDescriptorService.getViewContainerById(d.id);h&&e.push({label:this.viewDescriptorService.getViewContainerModel(h).title,containerLabel:a,accept:()=>this.paneCompositeService.openPaneComposite(d.id,r,!0)})}};i(ir.Sidebar,g(4808,"Side Bar")),i(ir.Panel,g(4809,"Panel")),i(ir.AuxiliaryBar,g(4810,"Secondary Side Bar"));const n=r=>{const a=this.paneCompositeService.getPaneComposites(r);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};n(ir.Sidebar),n(ir.Panel),n(ir.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(4811,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(4812,"Terminal"),accept:async()=>{await this.terminalGroupService.showPanel(!0),this.terminalService.setActiveInstance(c)}})})}),this.debugService.getModel().getSessions(!0).filter(r=>r.hasSeparateRepl()).forEach((r,a)=>{const c=r.name;e.push({label:c,containerLabel:g(4813,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(o5e)||await this.viewsService.openView(o5e,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(4814,"Output"),accept:()=>this.outputService.showChannel(r.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},QSe=NR,NR.PREFIX="view ",NR);KW=QSe=D([_(0,xm),_(1,Lm),_(2,Jae),_(3,OU),_(4,iMe),_(5,XRe),_(6,Tm),_(7,Le)],KW);const Hoe=class Hoe extends li{constructor(){super({id:Hoe.ID,title:Pe(4815,"Open View"),category:ca.View,f1:!0})}async run(e){e.get(In).quickAccess.show(KW.PREFIX)}};Hoe.ID="workbench.action.openView";let E9=Hoe;const b1=class b1 extends li{constructor(){super({id:b1.ID,title:Pe(4816,"Quick Open View"),category:ca.View,f1:!1,keybinding:{weight:Ae.WorkbenchContrib,when:void 0,...b1.KEYBINDING}})}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(b1.ID);i.quickAccess.show(KW.PREFIX,{quickNavigateConfiguration:{keybindings:n},itemActivation:Hf.FIRST})}};b1.ID="workbench.action.quickOpenView",b1.KEYBINDING={primary:U.CtrlCmd|S.KeyQ,mac:{primary:U.WinCtrl|S.KeyQ},linux:{primary:0}};let tee=b1;const LNe=Qe.as(RU.Quickaccess);LNe.registerQuickAccessProvider({ctor:Y5,prefix:Y5.PREFIX,placeholder:g(895,"Type '{0}' to get help on the actions you can take from here.",Y5.PREFIX),helpEntries:[{description:g(896,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(897,"More")}]});LNe.registerQuickAccessProvider({ctor:KW,prefix:KW.PREFIX,contextKey:"inViewsPicker",placeholder:g(898,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(899,"Open View"),commandId:E9.ID}]});LNe.registerQuickAccessProvider({ctor:XM,prefix:XM.PREFIX,contextKey:"inCommandsPicker",placeholder:g(900,"Type the name of a command to run."),helpEntries:[{description:g(901,"Show and Run Commands"),commandId:aI.ID,commandCenterOrder:20}]});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:aI.ID,title:g(902,"&&Command Palette...")},order:1});jn.appendMenuItem(_e.MenubarHelpMenu,{group:"1_welcome",command:{id:aI.ID,title:g(903,"Show All Commands")},order:2});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:E9.ID,title:g(904,"&&Open View...")},order:2});jn.appendMenuItem(_e.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(905,"Go to &&Line/Column...")},order:1});jn.appendMenuItem(_e.GlobalActivity,{group:"1_command",command:{id:aI.ID,title:g(906,"Command Palette...")},order:1});jn.appendMenuItem(_e.EditorContext,{group:"z_commands",when:J.editorSimpleInput.toNegated(),command:{id:aI.ID,title:g(906,"Command Palette...")},order:1});At(Tzt);At(aI);At(E9);At(tee);const Fzt="inViewsPicker",ait=he.and(_C,he.has(Fzt)),iB=tee.KEYBINDING,d5e="workbench.action.quickOpenNavigateNextInViewPicker";So.registerCommandAndKeybindingRule({id:d5e,weight:Ae.WorkbenchContrib+50,handler:Sce(d5e,!0),when:ait,primary:iB.primary,linux:iB.linux,mac:iB.mac});const h5e="workbench.action.quickOpenNavigatePreviousInViewPicker";So.registerCommandAndKeybindingRule({id:h5e,weight:Ae.WorkbenchContrib+50,handler:Sce(h5e,!1),when:ait,primary:iB.primary|U.Shift,linux:iB.linux,mac:{primary:iB.mac.primary|U.Shift}});const hv=Za;var GB;let iee=(GB=class extends V{constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},GB.ID="workbench.contrib.externalUriResolver",GB);iee=D([_(0,Ao),_(1,hv)],iee);const cit=N.parse("trustedDomains:/Trusted Domains"),Lce="http.linkProtectionTrustedDomains",jSe="http.linkProtectionTrustedDomainsContent",YSe={id:"workbench.action.manageTrustedDomain",description:{description:Pe(4604,"Manage Trusted Domains"),args:[]},handler:async s=>{s.get(ei).openEditor({resource:cit,languageId:"jsonc",options:{pinned:!0}})}};async function Ozt(s,e,t,i,n,o,r){const a=N.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(4605,"Trust {0}",e),id:"trust",toTrust:e,picked:!0}),c.length===4&&c.every(p=>Number.isInteger(+p)||Number.isInteger(+p.split(":")[0]))){if(a.authority.includes(":")){const p=a.authority.split(":")[0];h.push({type:"item",label:g(4606,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(4607,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(4608,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(4609,"Manage Trusted Domains"),id:"manage"});const f=await i.pick(h,{activeItem:h[0]});if(f&&f.id)switch(f.id){case"manage":return await o.openEditor({resource:cit.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),s;case"trust":{const p=f.toTrust;if(s.indexOf(p)===-1)return n.remove(jSe,Ie.APPLICATION),n.store(Lce,JSON.stringify([...s,p]),Ie.APPLICATION,an.USER),[...s,p]}}return[]}async function Bzt(s){const{defaultTrustedDomains:e,trustedDomains:t}=nee(s);return{defaultTrustedDomains:e,trustedDomains:t}}function nee(s){const e=s.get($i),t=s.get(Er),i=s.get(hv),n=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Lce,Ie.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:n,trustedDomains:o}}const Wzt="trustedDomains",Hzt={type:sn.File,ctime:Date.now(),mtime:Date.now(),size:0},lit=`// Links matching one or more entries in the list below can be opened without link protection. // The following examples show what entries can look like: // - "https://microsoft.com": Matches this specific domain using https // - "https://microsoft.com:8080": Matches this specific domain on this port using https @@ -825,121 +856,118 @@ ${n}`:n}var Gxe;const Mpe=we;function iB(n){n.scrollTop=n.scrollHeight-n.renderH // - "http://192.168.0.*: Matches all IP's with this prefix using http // - "*": Match all domains using either http or https // -`,Ist=`// +`,dit=`// // You can use the "Manage Trusted Domains" command to open this file. // Save this file to apply the trusted domains rules. -`,E$t=`[ +`,Uzt=`[ // "https://microsoft.com" -]`;function x$t(n,e,t){let i=kst;return n.length>0?(i+=`// By default, VS Code trusts "localhost" as well as the following domains: -`,n.forEach(s=>{i+=`// - "${s}" +]`;function Vzt(s,e,t){let i=lit;return s.length>0?(i+=`// By default, VS Code trusts "localhost" as well as the following domains: +`,s.forEach(n=>{i+=`// - "${n}" `})):i+=`// By default, VS Code trusts "localhost". -`,i+=Ist,i+=t?` +`,i+=dit,i+=t?` // Currently configuring trust for ${t} -`:"",e.length===0?i+=E$t:i+=JSON.stringify(e,null,2),i}var $H;let Ine=($H=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=es.FileReadWrite,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.fileService.registerProvider(S$t,this)}stat(e){return Promise.resolve(A$t)}async readFile(e){let t=this.storageService.get(aDe,ke.APPLICATION);const i=e.fragment,{defaultTrustedDomains:s,trustedDomains:o}=await this.instantiationService.invokeFunction(y$t);return(!t||t.indexOf(kst)===-1||t.indexOf(Ist)===-1||t.indexOf(i??"")===-1||[...s,...o].some(a=>!ws(t).includes(a)))&&(t=x$t(s,o,i)),ze.fromString(t).buffer}writeFile(e,t,i){try{const s=ze.wrap(t).toString(),o=ow(s);this.storageService.store(aDe,s,ke.APPLICATION,ln.USER),this.storageService.store(Hhe,JSON.stringify(o)||"",ke.APPLICATION,ln.USER)}catch{}return Promise.resolve()}watch(e,t){return{dispose(){}}}mkdir(e){return Promise.resolve(void 0)}readdir(e){return Promise.resolve(void 0)}delete(e,t){return Promise.resolve(void 0)}rename(e,t,i){return Promise.resolve(void 0)}},$H.ID="workbench.contrib.trustedDomainsFileSystemProvider",$H);Ine=D([_(0,ci),_(1,on),_(2,be)],Ine);const D$t=(n,e)=>{let t=n.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const s=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return $C(s,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?$C(s,t,`${o}://${e}`,0,0):!1},$C=(n,e,t,i,s)=>{if(n[i]?.[s]!==void 0)return n[i][s];const o=[];if(i===e.length)return s===t.length;if(s===t.length)return e.slice(i)[0]==="/";if(e[i]===t[s]&&o.push($C(n,e,t,i+1,s+1)),t[s]+t[s+1]==="*."&&(["/",":"].includes(e[i])||o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+2))),t[s]==="*"&&(i+1===e.length?o.push($C(n,e,t,i+1,s+1)):o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+1))),t[s]+t[s+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push($C(n,e,t,r,s+2))}else o.push($C(n,e,t,i,s+2));return n[i][s]=o.some(r=>r===!0)};let lDe=class extends ${constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new d$(yi,()=>{const{defaultTrustedDomains:s,trustedDomains:o}=this._instantiationService.invokeFunction(kne);return[...s,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(ke.APPLICATION,Hhe,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(kne),s=[...t,...i];return Lst(e,s)}};lDe=D([_(0,be),_(1,on)],lDe);const k$t=/^localhost(:\d+)?$/i,I$t=/^127.0.0.1(:\d+)?$/;function L$t(n){return k$t.test(n)||I$t.test(n)}function M3e(n){const e=["github.com"];try{const t=typeof n=="string"?P.parse(n,!0):n;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return n.toString()}}function Lst(n,e){if(n=P.parse(M3e(n)),e=e.map(M3e),L$t(n.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!Rx(e,_e.http)&&!Rx(e,_e.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let s;if(typeof e=="string"?s=P.parse(e):s=e,await this._trustedDomainService.isValid(s))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=s;let d=`${o}://${r}${a}`;const h=`${c?"?"+c:""}${l?"#"+l:""}`,u=Math.max(0,60-d.length),f=Math.min(Math.max(5,u),h.length);f===h.length?d+=h:d+=h.charAt(0)+"..."+h.substring(h.length-f+1);const{result:p}=await this._dialogService.prompt({type:nt.Info,message:g(XK,0,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(XK,1,"&&Open"),run:()=>!0},{label:g(XK,2,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:s.toString(!0)),!1)},{label:g(XK,3,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(kne),v=`${o}://${r}`,w=await C$t(m,v,s,this._quickInputService,this._storageService,this._editorService);return!!(w.indexOf("*")!==-1||Lst(s,w))}}],cancelButton:{run:()=>!1}});return p}}};dDe=D([_(0,fr),_(1,on),_(2,To),_(3,Xa),_(4,On),_(5,_i),_(6,Mu),_(7,rn),_(8,be),_(9,Re),_(10,oA),_(11,lhe)],dDe);const hDe="vs/workbench/contrib/url/browser/url.contribution";class T$t extends pi{constructor(){super({id:"workbench.action.url.openUrl",title:Be(hDe,0,"Open URL"),category:Za.Developer,f1:!0})}async run(e){const t=e.get(On),i=e.get(jde);return t.input({prompt:g(hDe,1,"URL to open")}).then(s=>{if(s){const o=P.parse(s);i.open(o,{originalUrl:s})}})}}At(T$t);yt.registerCommand(cDe);Xs.appendMenuItem(Te.CommandPalette,{command:{id:cDe.id,title:cDe.description.description}});it.as(pf.Workbench).registerWorkbenchContribution(dDe,Us.Restored);gp(Ine.ID,Ine,Sl.BlockRestore);gp(Dne.ID,Dne,Sl.BlockRestore);const R$t=it.as(Cs.Configuration);R$t.registerConfiguration({...PQ,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:ut.APPLICATION,type:"boolean",default:!1,description:g(hDe,2,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var Lne;(function(n){n.TITLEBAR_PART="workbench.parts.titlebar",n.BANNER_PART="workbench.parts.banner",n.ACTIVITYBAR_PART="workbench.parts.activitybar",n.SIDEBAR_PART="workbench.parts.sidebar",n.PANEL_PART="workbench.parts.panel",n.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",n.EDITOR_PART="workbench.parts.editor",n.STATUSBAR_PART="workbench.parts.statusbar"})(Lne||(Lne={}));var N3e;(function(n){n.SHOW_TABS="zenMode.showTabs",n.HIDE_LINENUMBERS="zenMode.hideLineNumbers",n.HIDE_STATUSBAR="zenMode.hideStatusBar",n.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",n.CENTER_LAYOUT="zenMode.centerLayout",n.FULLSCREEN="zenMode.fullScreen",n.RESTORE="zenMode.restore",n.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(N3e||(N3e={}));var g_;(function(n){n.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",n.EDITOR_TABS_MODE="workbench.editor.showTabs",n.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",n.COMMAND_CENTER="window.commandCenter",n.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(g_||(g_={}));var Tne;(function(n){n.DEFAULT="default",n.TOP="top",n.BOTTOM="bottom",n.HIDDEN="hidden"})(Tne||(Tne={}));var xM;(function(n){n.MULTIPLE="multiple",n.SINGLE="single",n.NONE="none"})(xM||(xM={}));var c8;(function(n){n.DEFAULT="default",n.TITLEBAR="titleBar",n.HIDDEN="hidden"})(c8||(c8={}));var kv;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BOTTOM=2]="BOTTOM"})(kv||(kv={}));var Cb;(function(n){n[n.ALWAYS=0]="ALWAYS",n[n.NEVER=1]="NEVER",n[n.REMEMBER_LAST=2]="REMEMBER_LAST"})(Cb||(Cb={}));function l8(n){switch(n){case kv.LEFT:return"left";case kv.RIGHT:return"right";case kv.BOTTOM:return"bottom";default:return"bottom"}}const M$t={[l8(kv.LEFT)]:kv.LEFT,[l8(kv.RIGHT)]:kv.RIGHT,[l8(kv.BOTTOM)]:kv.BOTTOM};function ZK(n){return M$t[n]}function Ope(n){switch(n){case Cb.ALWAYS:return"always";case Cb.NEVER:return"never";case Cb.REMEMBER_LAST:return"preserve";default:return"preserve"}}Ope(Cb.ALWAYS)+"",Cb.ALWAYS,Ope(Cb.NEVER)+"",Cb.NEVER,Ope(Cb.REMEMBER_LAST)+"",Cb.REMEMBER_LAST;var t_;(function(n){n[n.SHORT=0]="SHORT",n[n.MEDIUM=1]="MEDIUM",n[n.LONG=2]="LONG"})(t_||(t_={}));var zD;const Bpe="vs/workbench/browser/parts/titlebar/windowTitle";var GC;(function(n){n.titleSeparator="window.titleSeparator",n.title="window.title"})(GC||(GC={}));const Tst=(()=>{if(ei&&rf)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const n="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Jn?n+"${separator}${remoteName}":n})(),Rst=ei?" — ":" - ";var tx;let P3e=(tx=class extends ${get value(){return this.title??""}get workspaceName(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get fileName(){const e=this.editorService.activeEditor;if(!e)return;const t=e.getTitle(Gs.SHORT);return`${e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:""}${t}`}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=s,this.environmentService=r,this.contextService=a,this.labelService=c,this.userDataProfileService=l,this.productService=d,this.viewsService=h,this.properties={isPure:!0,isAdmin:!1,prefix:void 0},this.variables=new Map,this.activeEditorListeners=this._register(new Z),this.titleUpdater=this._register(new yn(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=o.createScoped(t,this._store),this.windowId=e.vscodeWindowId,this.updateTitleIncludesFocusedView(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationChanged(e))),this._register(this.editorService.onDidActiveEditorChange(()=>this.onActiveEditorChange())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkspaceName(()=>this.titleUpdater.schedule())),this._register(this.labelService.onDidChangeFormatters(()=>this.titleUpdater.schedule())),this._register(this.userDataProfileService.onDidChangeCurrentProfile(()=>this.titleUpdater.schedule())),this._register(this.viewsService.onDidChangeFocusedView(()=>{this.titleIncludesFocusedView&&this.titleUpdater.schedule()})),this._register(this.contextKeyService.onDidChangeContext(e=>{e.affectsSome(this.variables)&&this.titleUpdater.schedule()}))}onConfigurationChanged(e){e.affectsConfiguration(GC.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(GC.title)||e.affectsConfiguration(GC.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(GC.title);this.titleIncludesFocusedView=typeof e=="string"&&e.includes("${focusedView}")}onActiveEditorChange(){this.activeEditorListeners.clear(),this.titleUpdater.schedule();const e=this.editorService.activeEditor;if(e&&(this.activeEditorListeners.add(e.onDidChangeDirty(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(e.onDidChangeLabel(()=>this.titleUpdater.schedule()))),this.titleIncludesFocusedView){const t=this.editorService.activeTextEditorControl,i=[];Ka(t)?i.push(t):ew(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const s of i)this.activeEditorListeners.add(s.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(s.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;KRe(t)||(t=this.productService.nameLong);const i=vZ(this.windowId,!0).window;!i.document.title&&ei&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${zD.TITLE_DIRTY}`),i.document.title=t,this.title=e,this.onDidChangeEmitter.fire()}}getFullWindowTitle(){const{prefix:e,suffix:t}=this.getTitleDecorations();let i=this.getWindowTitle()||this.productService.nameLong;return e&&(i=`${e} ${i}`),t&&(i=`${i} ${t}`),i.replace(/[^\S ]/g," ")}getTitleDecorations(){let e,t;return this.properties.prefix&&(e=this.properties.prefix),this.environmentService.isExtensionDevelopment&&(e=e?`${zD.NLS_EXTENSION_HOST} - ${e}`:zD.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=zD.NLS_USER_IS_ADMIN),{prefix:e,suffix:t}}updateProperties(e){const t=typeof e.isAdmin=="boolean"?e.isAdmin:this.properties.isAdmin,i=typeof e.isPure=="boolean"?e.isPure:this.properties.isPure,s=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||s!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=s,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:s}of e)this.variables.has(s)||(this.variables.set(s,i),t=!0);t&&this.titleUpdater.schedule()}getWindowTitle(){const e=this.editorService.activeEditor,t=this.contextService.getWorkspace();let i;t.configuration?i=t.configuration:t.folders.length&&(i=t.folders[0].uri);const s=jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY});let o=s?ma(s):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===Nn.FOLDER?r=t.folders[0]:s&&(r=this.contextService.getWorkspaceFolder(s)??void 0);let a;if(this.environmentService.remoteAuthority&&!Jn)a=this.labelService.getHostLabel(_e.vscodeRemote,this.environmentService.remoteAuthority);else{const z=KFe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Gs.SHORT):"",l=e?e.getTitle(Gs.MEDIUM):c,d=e?e.getTitle(Gs.LONG):l,h=o?ui(o):"",u=o?this.labelService.getUriLabel(o,{relative:!0}):"",f=o?this.labelService.getUriLabel(o):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:t_.SHORT}),v=i?this.labelService.getUriLabel(i):"",w=r?r.name:"",b=r?this.labelService.getUriLabel(r.uri):"",C=e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:"",y=this.productService.nameLong,S=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,M=this.viewsService.getFocusedViewName(),k={};for(const[z,U]of this.variables)k[U]=this.contextKeyService.getContextKeyValue(z)??"";let F=this.configurationService.getValue(GC.title);typeof F!="string"&&(F=Tst);let N=this.configurationService.getValue(GC.titleSeparator);return typeof N!="string"&&(N=Rst),aPt(F,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:w,folderPath:b,dirty:C,appName:y,remoteName:a,profileName:S,focusedView:M,separator:{label:N}})}isCustomTitleFormat(){const e=this.configurationService.inspect(GC.title),t=this.configurationService.inspect(GC.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},zD=tx,tx.NLS_USER_IS_ADMIN=Is?g(Bpe,0,"[Administrator]"):g(Bpe,1,"[Superuser]"),tx.NLS_EXTENSION_HOST=g(Bpe,2,"[Extension Development Host]"),tx.TITLE_DIRTY="● ",tx);P3e=zD=D([_(2,Re),_(3,Pe),_(4,_i),_(5,Ow),_(6,Ti),_(7,eo),_(8,Rm),_(9,Xa),_(10,q_)],P3e);var TB,Q0;let Rne=(Q0=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceContextService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.patterns=[],this.enabled=!0,this.cache=new olt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|dirname\(([-+]?\d+)\))\}/g,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListernes()}registerListernes(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(TB.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(TB.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(TB.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(TB.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const s=oF(t),o=_w(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:s,parsedPattern:o})}this.patterns.sort((t,i)=>this.patternWeight(i.pattern)-this.patternWeight(t.pattern))}patternWeight(e){let t=0;for(const i of e.split("/"))i==="**"?t+=1:i==="*"?t+=10:i.includes("*")||i.includes("?")?t+=50:i!==""&&(t+=100);return t}getName(e){if(!this.enabled||this.patterns.length===0)return;const t=e.toString(),i=this.cache.get(t);if(i!==void 0)return i??void 0;const s=this.applyPatterns(e);return this.cache.set(t,s??null),s}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const s of this.patterns){let o;if(t&&!s.isAbsolutePath?(i||(i=lO(ma(t.uri),e)??e.path),o=i):o=e.path,s.parsedPattern(o))return this.applyTempate(s.template,e,o)}}applyTempate(e,t,i){let s;return e.replace(this._parsedTemplateExpression,(o,r,a)=>{switch(s=s??cht(t.path),r){case"filename":return s.name;case"extname":return s.ext.slice(1);default:{const c=r==="dirname"?0:parseInt(a),l=this.getNthDirname(lS(i),c);if(l)return l}}return o})}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/"),s=i.length;let o;t<0?o=Math.abs(t)-1:o=s-t-1;const r=i[o];if(!(r===void 0||r===""))return r}},TB=Q0,Q0.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",Q0.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",Q0);Rne=TB=D([_(0,Re),_(1,Ti)],Rne);const Ae="vs/workbench/browser/workbench.contribution",eY=it.as(Cs.Configuration);(function(){gp(wte.ID,wte,Sl.Eventually),gp(bte.ID,bte,Sl.AfterRestored),eY.registerConfiguration({...PQ,properties:{"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(Ae,0,"The default size."),g(Ae,1,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(Ae,2,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[g_.EDITOR_TABS_MODE]:{type:"string",enum:[xM.MULTIPLE,xM.SINGLE,xM.NONE],enumDescriptions:[g(Ae,3,"Each editor is displayed as a tab in the editor title area."),g(Ae,4,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,5,"The editor title area is not displayed.")],description:g(Ae,6,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[g_.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[c8.DEFAULT,c8.TITLEBAR,c8.HIDDEN],markdownEnumDescriptions:[g(Ae,7,"Show editor actions in the window title bar when {0} is set to {1}. Otherwise, editor actions are shown in the editor tab bar.","`#workbench.editor.showTabs#`","`none`"),g(Ae,8,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(Ae,9,"Editor actions are not shown.")],markdownDescription:g(Ae,10,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(Ae,11,"Controls whether to always show the editor actions, even when the editor group is not active."),default:!1},"workbench.editor.wrapTabs":{type:"boolean",markdownDescription:g(Ae,12,"Controls whether tabs should be wrapped over multiple lines when exceeding available space or whether a scrollbar should appear instead. This value is ignored when {0} is not set to '{1}'.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.scrollToSwitchTabs":{type:"boolean",markdownDescription:g(Ae,13,"Controls whether scrolling over tabs will open them or not. By default tabs will only reveal upon scrolling, but not open. You can press and hold the Shift-key while scrolling to change this behavior for that duration. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.highlightModifiedTabs":{type:"boolean",markdownDescription:g(Ae,14,"Controls whether a top border is drawn on tabs for editors that have unsaved changes. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","multiple"),default:!1},"workbench.editor.decorations.badges":{type:"boolean",markdownDescription:g(Ae,15,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(Ae,16,"Controls whether editor file decorations should use colors."),default:!0},[Rne.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(Ae,17,"Controls whether the custom workbench editor labels should be applied."),default:!0},[Rne.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(Ae,18,"Controls the rendering of the editor label. Each __Item__ is a pattern that matches a file path. Both relative and absolute file paths are supported. The relative path must include the WORKSPACE_FOLDER (e.g `WORKSPACE_FOLDER/src/**.tsx` or `*/src/**.tsx`). Absolute patterns must start with a `/`. In case multiple patterns match, the longest matching path will be picked. Each __Value__ is the template for the rendered editor when the __Item__ matches. Variables are substituted based on the context:");return t+=` -- `+[g(Ae,19,"`${dirname}`: name of the folder in which the file is located (e.g. `WORKSPACE_FOLDER/folder/file.txt -> folder`)."),g(Ae,20,"`${dirname(N)}`: name of the nth parent folder in which the file is located (e.g. `N=2: WORKSPACE_FOLDER/static/folder/file.txt -> WORKSPACE_FOLDER`). Folders can be picked from the start of the path by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.txt -> WORKSPACE_FOLDER`). If the __Item__ is an absolute pattern path, the first folder (`N=-1`) refers to the first folder in the absoulte path, otherwise it corresponds to the workspace folder."),g(Ae,21,"`${filename}`: name of the file without the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> file`)."),g(Ae,22,"`${extname}`: the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> txt`).")].join(` +`:"",e.length===0?i+=Uzt:i+=JSON.stringify(e,null,2),i}var KB;let see=(KB=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=Vn.FileReadWrite,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.fileService.registerProvider(Wzt,this)}stat(e){return Promise.resolve(Hzt)}async readFile(e){let t=this.storageService.get(jSe,Ie.APPLICATION);const i=e.fragment,{defaultTrustedDomains:n,trustedDomains:o}=await this.instantiationService.invokeFunction(Bzt);return(!t||t.indexOf(lit)===-1||t.indexOf(dit)===-1||t.indexOf(i??"")===-1||[...n,...o].some(a=>!qn(t).includes(a)))&&(t=Vzt(n,o,i)),$e.fromString(t).buffer}writeFile(e,t,i){try{const n=$e.wrap(t).toString(),o=sf(n);this.storageService.store(jSe,n,Ie.APPLICATION,an.USER),this.storageService.store(Lce,JSON.stringify(o)||"",Ie.APPLICATION,an.USER)}catch{}return Promise.resolve()}watch(e,t){return{dispose(){}}}mkdir(e){return Promise.resolve(void 0)}readdir(e){return Promise.resolve(void 0)}delete(e,t){return Promise.resolve(void 0)}rename(e,t,i){return Promise.resolve(void 0)}},KB.ID="workbench.contrib.trustedDomainsFileSystemProvider",KB);see=D([_(0,Jt),_(1,$i),_(2,we)],see);const zzt=(s,e)=>{let t=s.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const n=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return pw(n,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?pw(n,t,`${o}://${e}`,0,0):!1},pw=(s,e,t,i,n)=>{if(s[i]?.[n]!==void 0)return s[i][n];const o=[];if(i===e.length)return n===t.length;if(n===t.length)return e.slice(i)[0]==="/";if(e[i]===t[n]&&o.push(pw(s,e,t,i+1,n+1)),t[n]+t[n+1]==="*."&&(["/",":"].includes(e[i])||o.push(pw(s,e,t,i+1,n)),o.push(pw(s,e,t,i,n+2))),t[n]==="*"&&(i+1===e.length?o.push(pw(s,e,t,i+1,n+1)):o.push(pw(s,e,t,i+1,n)),o.push(pw(s,e,t,i,n+1))),t[n]+t[n+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push(pw(s,e,t,r,n+2))}else o.push(pw(s,e,t,i,n+2));return s[i][n]=o.some(r=>r===!0)};let JSe=class extends V{constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new XV(si,()=>{const{defaultTrustedDomains:n,trustedDomains:o}=this._instantiationService.invokeFunction(nee);return[...n,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(Ie.APPLICATION,Lce,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(nee),n=[...t,...i];return hit(e,n)}};JSe=D([_(0,we),_(1,$i)],JSe);const $zt=/^localhost(:\d+)?$/i,Gzt=/^127.0.0.1(:\d+)?$/;function Kzt(s){return $zt.test(s)||Gzt.test(s)}function u5e(s){const e=["github.com"];try{const t=typeof s=="string"?N.parse(s,!0):s;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return s.toString()}}function hit(s,e){if(s=N.parse(u5e(s)),e=e.map(u5e),Kzt(s.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!AA(e,pe.http)&&!AA(e,pe.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let n;if(typeof e=="string"?n=N.parse(e):n=e,await this._trustedDomainService.isValid(n))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=n;let d=`${o}://${r}${a}`;const h=`${c?"?"+c:""}${l?"#"+l:""}`,u=Math.max(0,60-d.length),f=Math.min(Math.max(5,u),h.length);f===h.length?d+=h:d+=h.charAt(0)+"..."+h.substring(h.length-f+1);const{result:p}=await this._dialogService.prompt({type:Xe.Info,message:g(4817,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(4818,"&&Open"),run:()=>!0},{label:g(4819,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:n.toString(!0)),!1)},{label:g(4820,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(nee),v=`${o}://${r}`,b=await Ozt(m,v,n,this._quickInputService,this._storageService,this._editorService);return!!(b.indexOf("*")!==-1||hit(n,b))}}],cancelButton:{run:()=>!1}});return p}}};XSe=D([_(0,Ao),_(1,$i),_(2,to),_(3,Er),_(4,In),_(5,ei),_(6,dg),_(7,Yi),_(8,we),_(9,Te),_(10,uC),_(11,nce)],XSe);class qzt extends li{constructor(){super({id:"workbench.action.url.openUrl",title:Pe(907,"Open URL"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(In),i=e.get(Uae);return t.input({prompt:g(908,"URL to open")}).then(n=>{if(n){const o=N.parse(n);i.open(o,{originalUrl:n})}})}}At(qzt);_t.registerCommand(YSe);jn.appendMenuItem(_e.CommandPalette,{command:{id:YSe.id,title:YSe.description.description}});Qe.as(cf.Workbench).registerWorkbenchContribution(XSe,Rs.Restored);Qu(see.ID,see,yc.BlockRestore);Qu(iee.ID,iee,yc.BlockRestore);const Qzt=Qe.as(Nn.Configuration);Qzt.registerConfiguration({...V6,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:at.APPLICATION,type:"boolean",default:!1,description:g(909,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var $v;(function(s){s.TITLEBAR_PART="workbench.parts.titlebar",s.BANNER_PART="workbench.parts.banner",s.ACTIVITYBAR_PART="workbench.parts.activitybar",s.SIDEBAR_PART="workbench.parts.sidebar",s.PANEL_PART="workbench.parts.panel",s.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",s.EDITOR_PART="workbench.parts.editor",s.STATUSBAR_PART="workbench.parts.statusbar"})($v||($v={}));var g5e;(function(s){s.SHOW_TABS="zenMode.showTabs",s.HIDE_LINENUMBERS="zenMode.hideLineNumbers",s.HIDE_STATUSBAR="zenMode.hideStatusBar",s.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",s.CENTER_LAYOUT="zenMode.centerLayout",s.FULLSCREEN="zenMode.fullScreen",s.RESTORE="zenMode.restore",s.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(g5e||(g5e={}));var Jp;(function(s){s.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",s.EDITOR_TABS_MODE="workbench.editor.showTabs",s.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",s.COMMAND_CENTER="window.commandCenter",s.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(Jp||(Jp={}));var oee;(function(s){s.DEFAULT="default",s.TOP="top",s.BOTTOM="bottom",s.HIDDEN="hidden"})(oee||(oee={}));var PT;(function(s){s.MULTIPLE="multiple",s.SINGLE="single",s.NONE="none"})(PT||(PT={}));var J5;(function(s){s.DEFAULT="default",s.TITLEBAR="titleBar",s.HIDDEN="hidden"})(J5||(J5={}));var Ru;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BOTTOM=2]="BOTTOM",s[s.TOP=3]="TOP"})(Ru||(Ru={}));function jzt(s){return s===Ru.BOTTOM||s===Ru.TOP}var jv;(function(s){s[s.ALWAYS=0]="ALWAYS",s[s.NEVER=1]="NEVER",s[s.REMEMBER_LAST=2]="REMEMBER_LAST"})(jv||(jv={}));function B1(s){switch(s){case Ru.LEFT:return"left";case Ru.RIGHT:return"right";case Ru.BOTTOM:return"bottom";case Ru.TOP:return"top";default:return"bottom"}}const Yzt={[B1(Ru.LEFT)]:Ru.LEFT,[B1(Ru.RIGHT)]:Ru.RIGHT,[B1(Ru.BOTTOM)]:Ru.BOTTOM,[B1(Ru.TOP)]:Ru.TOP};function RK(s){return Yzt[s]}function wue(s){switch(s){case jv.ALWAYS:return"always";case jv.NEVER:return"never";case jv.REMEMBER_LAST:return"preserve";default:return"preserve"}}wue(jv.ALWAYS)+"",jv.ALWAYS,wue(jv.NEVER)+"",jv.NEVER,wue(jv.REMEMBER_LAST)+"",jv.REMEMBER_LAST;var Op;(function(s){s[s.SHORT=0]="SHORT",s[s.MEDIUM=1]="MEDIUM",s[s.LONG=2]="LONG"})(Op||(Op={}));var EE,mw;(function(s){s.titleSeparator="window.titleSeparator",s.title="window.title"})(mw||(mw={}));const uit=(()=>{if(Qt&&ad)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const s="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Wn?s+"${separator}${remoteName}":s})(),git=Qt?" — ":" - ";var QS;let f5e=(QS=class extends V{get value(){return this.title??""}get workspaceName(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get fileName(){const e=this.editorService.activeEditor;if(!e)return;const t=e.getTitle(Ls.SHORT);return`${e?.isDirty()&&!e.isSaving()?EE.TITLE_DIRTY:""}${t}`}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=n,this.environmentService=r,this.contextService=a,this.labelService=c,this.userDataProfileService=l,this.productService=d,this.viewsService=h,this.properties={isPure:!0,isAdmin:!1,prefix:void 0},this.variables=new Map,this.activeEditorListeners=this._register(new Z),this.titleUpdater=this._register(new cn(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=o.createScoped(t,this._store),this.windowId=e.vscodeWindowId,this.updateTitleIncludesFocusedView(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationChanged(e))),this._register(this.editorService.onDidActiveEditorChange(()=>this.onActiveEditorChange())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkspaceName(()=>this.titleUpdater.schedule())),this._register(this.labelService.onDidChangeFormatters(()=>this.titleUpdater.schedule())),this._register(this.userDataProfileService.onDidChangeCurrentProfile(()=>this.titleUpdater.schedule())),this._register(this.viewsService.onDidChangeFocusedView(()=>{this.titleIncludesFocusedView&&this.titleUpdater.schedule()})),this._register(this.contextKeyService.onDidChangeContext(e=>{e.affectsSome(this.variables)&&this.titleUpdater.schedule()}))}onConfigurationChanged(e){e.affectsConfiguration(mw.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(mw.title)||e.affectsConfiguration(mw.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(mw.title);this.titleIncludesFocusedView=typeof e=="string"&&e.includes("${focusedView}")}onActiveEditorChange(){this.activeEditorListeners.clear(),this.titleUpdater.schedule();const e=this.editorService.activeEditor;if(e&&(this.activeEditorListeners.add(e.onDidChangeDirty(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(e.onDidChangeLabel(()=>this.titleUpdater.schedule()))),this.titleIncludesFocusedView){const t=this.editorService.activeTextEditorControl,i=[];Qr(t)?i.push(t):im(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const n of i)this.activeEditorListeners.add(n.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(n.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;Y1e(t)||(t=this.productService.nameLong);const i=Hj(this.windowId,!0).window;!i.document.title&&Qt&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${EE.TITLE_DIRTY}`),i.document.title=t,this.title=e,this.onDidChangeEmitter.fire()}}getFullWindowTitle(){const{prefix:e,suffix:t}=this.getTitleDecorations();let i=this.getWindowTitle()||this.productService.nameLong;return e&&(i=`${e} ${i}`),t&&(i=`${i} ${t}`),i.replace(/[^\S ]/g," ")}getTitleDecorations(){let e,t;return this.properties.prefix&&(e=this.properties.prefix),this.environmentService.isExtensionDevelopment&&(e=e?`${EE.NLS_EXTENSION_HOST} - ${e}`:EE.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=EE.NLS_USER_IS_ADMIN),{prefix:e,suffix:t}}updateProperties(e){const t=typeof e.isAdmin=="boolean"?e.isAdmin:this.properties.isAdmin,i=typeof e.isPure=="boolean"?e.isPure:this.properties.isPure,n=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||n!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=n,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:n}of e)this.variables.has(n)||(this.variables.set(n,i),t=!0);t&&this.titleUpdater.schedule()}getWindowTitle(){const e=this.editorService.activeEditor,t=this.contextService.getWorkspace();let i;t.configuration?i=t.configuration:t.folders.length&&(i=t.folders[0].uri);const n=Na.getOriginalUri(e,{supportSideBySide:Hs.PRIMARY});let o=n?Lr(n):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===qi.FOLDER?r=t.folders[0]:n&&(r=this.contextService.getWorkspaceFolder(n)??void 0);let a;if(this.environmentService.remoteAuthority&&!Wn)a=this.labelService.getHostLabel(pe.vscodeRemote,this.environmentService.remoteAuthority);else{const z=yNe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Ls.SHORT):"",l=e?e.getTitle(Ls.MEDIUM):c,d=e?e.getTitle(Ls.LONG):l,h=o?_i(o):"",u=o?this.labelService.getUriLabel(o,{relative:!0}):"",f=o?this.labelService.getUriLabel(o):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:Op.SHORT}),v=i?this.labelService.getUriLabel(i):"",b=r?r.name:"",w=r?this.labelService.getUriLabel(r.uri):"",y=e?.isDirty()&&!e.isSaving()?EE.TITLE_DIRTY:"",C=this.productService.nameLong,A=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,L=this.viewsService.getFocusedViewName(),k={};for(const[z,G]of this.variables)k[G]=this.contextKeyService.getContextKeyValue(z)??"";let P=this.configurationService.getValue(mw.title);typeof P!="string"&&(P=uit);let R=this.configurationService.getValue(mw.titleSeparator);return typeof R!="string"&&(R=git),PMt(P,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:b,folderPath:w,dirty:y,appName:C,remoteName:a,profileName:A,focusedView:L,separator:{label:R}})}isCustomTitleFormat(){const e=this.configurationService.inspect(mw.title),t=this.configurationService.inspect(mw.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},EE=QS,QS.NLS_USER_IS_ADMIN=Qn?g(4821,"[Administrator]"):g(4822,"[Superuser]"),QS.NLS_EXTENSION_HOST=g(4823,"[Extension Development Host]"),QS.TITLE_DIRTY="● ",QS);f5e=EE=D([_(2,Te),_(3,Le),_(4,ei),_(5,hv),_(6,yi),_(7,Fs),_(8,ug),_(9,Er),_(10,Lm)],f5e);var HP,_k;let ree=(_k=class extends V{constructor(e,t){super(),this.configurationService=e,this.workspaceContextService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.patterns=[],this.enabled=!0,this.cache=new Nrt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|extname\((?[-+]?\d+)\)|dirname\((?[-+]?\d+)\))\}/g,this._filenameCaptureExpression=/(?^\.*[^.]*)/,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(HP.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(HP.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(HP.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(HP.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const n=pM(t),o=j_(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:n,parsedPattern:o})}this.patterns.sort((t,i)=>this.patternWeight(i.pattern)-this.patternWeight(t.pattern))}patternWeight(e){let t=0;for(const i of e.split("/"))i==="**"?t+=1:i==="*"?t+=10:i.includes("*")||i.includes("?")?t+=50:i!==""&&(t+=100);return t}getName(e){if(!this.enabled||this.patterns.length===0)return;const t=e.toString(),i=this.cache.get(t);if(i!==void 0)return i??void 0;const n=this.applyPatterns(e);return this.cache.set(t,n??null),n}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const n of this.patterns){let o;if(t&&!n.isAbsolutePath?(i||(i=DN(Lr(t.uri),e)??e.path),o=i):o=e.path,n.parsedPattern(o))return this.applyTemplate(n.template,e,o)}}applyTemplate(e,t,i){let n;return e.replace(this._parsedTemplateExpression,(o,r,...a)=>{n=n??Wct(t.path);const{dirnameN:c="0",extnameN:l="0"}=a.pop();if(r==="filename"){const{filename:d}=this._filenameCaptureExpression.exec(n.base)?.groups??{};if(d)return d}else if(r==="extname"){const d=this.getExtnames(n.base);if(d)return d}else if(r.startsWith("extname")){const d=parseInt(l),h=this.getNthExtname(n.base,d);if(h)return h}else if(r.startsWith("dirname")){const d=parseInt(c),h=this.getNthDirname(Cb(i),d);if(h)return h}return o})}removeLeadingDot(e){let t=e;for(;t.startsWith(".");)t=t.slice(1);return t}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/");return this.getNthFragment(i,t)}getExtnames(e){return this.removeLeadingDot(e).split(".").slice(1).join(".")}getNthExtname(e,t){const i=this.removeLeadingDot(e).split(".");return i.shift(),this.getNthFragment(i,t)}getNthFragment(e,t){const i=e.length;let n;t<0?n=Math.abs(t)-1:n=i-t-1;const o=e[n];if(!(o===void 0||o===""))return o}},HP=_k,_k.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",_k.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",_k);ree=HP=D([_(0,Te),_(1,yi)],ree);const MK=Qe.as(Nn.Configuration);(function(){Qu(jJ.ID,jJ,yc.Eventually),Qu(YJ.ID,YJ,yc.AfterRestored),MK.registerConfiguration({...V6,properties:{"workbench.externalBrowser":{type:"string",markdownDescription:g(910,"Configure the browser to use for opening http or https links externally. This can either be the name of the browser (`edge`, `chrome`, `firefox`) or an absolute path to the browser's executable. Will use the system default if not set."),included:ad,restricted:!0},"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(911,"The default size."),g(912,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(913,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[Jp.EDITOR_TABS_MODE]:{type:"string",enum:[PT.MULTIPLE,PT.SINGLE,PT.NONE],enumDescriptions:[g(914,"Each editor is displayed as a tab in the editor title area."),g(915,"The active editor is displayed as a single large tab in the editor title area."),g(916,"The editor title area is not displayed.")],description:g(917,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[Jp.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[J5.DEFAULT,J5.TITLEBAR,J5.HIDDEN],markdownEnumDescriptions:[g(918,"Show editor actions in the window title bar when {0} is set to {1}. Otherwise, editor actions are shown in the editor tab bar.","`#workbench.editor.showTabs#`","`none`"),g(919,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(920,"Editor actions are not shown.")],markdownDescription:g(921,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(922,"Controls whether to always show the editor actions, even when the editor group is not active."),default:!1},"workbench.editor.wrapTabs":{type:"boolean",markdownDescription:g(923,"Controls whether tabs should be wrapped over multiple lines when exceeding available space or whether a scrollbar should appear instead. This value is ignored when {0} is not set to '{1}'.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.scrollToSwitchTabs":{type:"boolean",markdownDescription:g(924,"Controls whether scrolling over tabs will open them or not. By default tabs will only reveal upon scrolling, but not open. You can press and hold the Shift-key while scrolling to change this behavior for that duration. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.highlightModifiedTabs":{type:"boolean",markdownDescription:g(925,"Controls whether a top border is drawn on tabs for editors that have unsaved changes. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","multiple"),default:!1},"workbench.editor.decorations.badges":{type:"boolean",markdownDescription:g(926,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(927,"Controls whether editor file decorations should use colors."),default:!0},[ree.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(928,"Controls whether the custom workbench editor labels should be applied."),default:!0},[ree.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(929,"Controls the rendering of the editor label. Each __Item__ is a pattern that matches a file path. Both relative and absolute file paths are supported. The relative path must include the WORKSPACE_FOLDER (e.g `WORKSPACE_FOLDER/src/**.tsx` or `*/src/**.tsx`). Absolute patterns must start with a `/`. In case multiple patterns match, the longest matching path will be picked. Each __Value__ is the template for the rendered editor when the __Item__ matches. Variables are substituted based on the context:");return t+=` +- `+[g(930,"`${dirname}`: name of the folder in which the file is located (e.g. `WORKSPACE_FOLDER/folder/file.txt -> folder`)."),g(931,"`${dirname(N)}`: name of the nth parent folder in which the file is located (e.g. `N=2: WORKSPACE_FOLDER/static/folder/file.txt -> WORKSPACE_FOLDER`). Folders can be picked from the start of the path by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.txt -> WORKSPACE_FOLDER`). If the __Item__ is an absolute pattern path, the first folder (`N=-1`) refers to the first folder in the absolute path, otherwise it corresponds to the workspace folder."),g(932,"`${filename}`: name of the file without the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> file`)."),g(933,"`${extname}`: the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> txt`)."),g(934,"`${extname(N)}`: the nth extension of the file separated by '.' (e.g. `N=2: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext1`). Extension can be picked from the start of the extension by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext2`).")].join(` - `),t+=` -`+g(Ae,23,'Example: `"**/static/**/*.html": "${filename} - ${dirname} (${extname})"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.'),t})(),additionalProperties:{type:"string",markdownDescription:g(Ae,24,"The template which should be rendered when the pattern mtches. May include the variables ${dirname}, ${filename} and ${extname}."),minLength:1,pattern:".*[a-zA-Z0-9].*"},default:{}},"workbench.editor.labelFormat":{type:"string",enum:["default","short","medium","long"],enumDescriptions:[g(Ae,25,"Show the name of the file. When tabs are enabled and two files have the same name in one group the distinguishing sections of each file's path are added. When tabs are disabled, the path relative to the workspace folder is shown if the editor is active."),g(Ae,26,"Show the name of the file followed by its directory name."),g(Ae,27,"Show the name of the file followed by its path relative to the workspace folder."),g(Ae,28,"Show the name of the file followed by its absolute path.")],default:"default",description:g(Ae,29,"Controls the format of the label for an editor.")},"workbench.editor.untitled.labelFormat":{type:"string",enum:["content","name"],enumDescriptions:[g(Ae,30,"The name of the untitled file is derived from the contents of its first line unless it has an associated file path. It will fallback to the name in case the line is empty or contains no word characters."),g(Ae,31,"The name of the untitled file is not derived from the contents of the file.")],default:"content",description:g(Ae,32,"Controls the format of the label for an untitled editor.")},"workbench.editor.empty.hint":{type:"string",enum:["text","hidden"],default:"text",markdownDescription:g(Ae,33,"Controls if the empty editor text hint should be visible in the editor.")},"workbench.editor.languageDetection":{type:"boolean",default:!0,description:g(Ae,34,"Controls whether the language in a text editor is automatically detected unless the language has been explicitly set by the language picker. This can also be scoped by language so you can specify which languages you do not want to be switched off of. This is useful for languages like Markdown that often contain other languages that might trick language detection into thinking it's the embedded language and not Markdown."),scope:ut.LANGUAGE_OVERRIDABLE},"workbench.editor.historyBasedLanguageDetection":{type:"boolean",default:!0,tags:["experimental"],description:g(Ae,35,"Enables use of editor history in language detection. This causes automatic language detection to favor languages that have been recently opened and allows for automatic language detection to operate with smaller inputs.")},"workbench.editor.preferHistoryBasedLanguageDetection":{type:"boolean",default:!1,tags:["experimental"],description:g(Ae,36,"When enabled, a language detection model that takes into account editor history will be given higher precedence.")},"workbench.editor.languageDetectionHints":{type:"object",default:{untitledEditors:!0,notebookEditors:!0},tags:["experimental"],description:g(Ae,37,"When enabled, shows a Status bar Quick Fix when the editor language doesn't match detected content language."),additionalProperties:!1,properties:{untitledEditors:{type:"boolean",description:g(Ae,38,"Show in untitled text editors")},notebookEditors:{type:"boolean",description:g(Ae,39,"Show in notebook editors")}}},"workbench.editor.tabActionLocation":{type:"string",enum:["left","right"],default:"right",markdownDescription:g(Ae,40,"Controls the position of the editor's tabs action buttons (close, unpin). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabActionCloseVisibility":{type:"boolean",default:!0,description:g(Ae,41,"Controls the visibility of the tab close action button.")},"workbench.editor.tabActionUnpinVisibility":{type:"boolean",default:!0,description:g(Ae,42,"Controls the visibility of the tab unpin action button.")},"workbench.editor.tabSizing":{type:"string",enum:["fit","shrink","fixed"],default:"fit",enumDescriptions:[g(Ae,43,"Always keep tabs large enough to show the full editor label."),g(Ae,44,"Allow tabs to get smaller when the available space is not enough to show all tabs at once."),g(Ae,45,"Make all tabs the same size, while allowing them to get smaller when the available space is not enough to show all tabs at once.")],markdownDescription:g(Ae,46,"Controls the size of editor tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabSizingFixedMinWidth":{type:"number",default:50,minimum:38,markdownDescription:g(Ae,47,"Controls the minimum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"workbench.editor.tabSizingFixedMaxWidth":{type:"number",default:160,minimum:38,markdownDescription:g(Ae,48,"Controls the maximum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"window.density.editorTabHeight":{type:"string",enum:["default","compact"],default:"default",markdownDescription:g(Ae,49,"Controls the height of editor tabs. Also applies to the title control bar when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabSizing":{type:"string",enum:["normal","compact","shrink"],default:"normal",enumDescriptions:[g(Ae,50,"A pinned tab inherits the look of non pinned tabs."),g(Ae,51,"A pinned tab will show in a compact form with only icon or first letter of the editor name."),g(Ae,52,"A pinned tab shrinks to a compact fixed size showing parts of the editor name.")],markdownDescription:g(Ae,53,"Controls the size of pinned editor tabs. Pinned tabs are sorted to the beginning of all opened tabs and typically do not close until unpinned. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabsOnSeparateRow":{type:"boolean",default:!1,markdownDescription:g(Ae,54,"When enabled, displays pinned tabs in a separate row above all other tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.preventPinnedEditorClose":{type:"string",enum:["keyboardAndMouse","keyboard","mouse","never"],default:"keyboardAndMouse",enumDescriptions:[g(Ae,55,"Always prevent closing the pinned editor when using mouse middle click or keyboard."),g(Ae,56,"Prevent closing the pinned editor when using the keyboard."),g(Ae,57,"Prevent closing the pinned editor when using mouse middle click."),g(Ae,58,"Never prevent closing a pinned editor.")],description:g(Ae,59,"Controls whether pinned editors should close when keyboard or middle mouse click is used for closing.")},"workbench.editor.splitSizing":{type:"string",enum:["auto","distribute","split"],default:"auto",enumDescriptions:[g(Ae,60,"Splits the active editor group to equal parts, unless all editor groups are already in equal parts. In that case, splits all the editor groups to equal parts."),g(Ae,61,"Splits all the editor groups to equal parts."),g(Ae,62,"Splits the active editor group to equal parts.")],description:g(Ae,63,"Controls the size of editor groups when splitting them.")},"workbench.editor.splitOnDragAndDrop":{type:"boolean",default:!0,description:g(Ae,64,"Controls if editor groups can be split from drag and drop operations by dropping an editor or file on the edges of the editor area.")},"workbench.editor.dragToOpenWindow":{type:"boolean",default:!0,markdownDescription:g(Ae,65,"Controls if editors can be dragged out of the window to open them in a new window. Press and hold the `Alt` key while dragging to toggle this dynamically.")},"workbench.editor.focusRecentEditorAfterClose":{type:"boolean",description:g(Ae,66,"Controls whether editors are closed in most recently used order or from left to right."),default:!0},"workbench.editor.showIcons":{type:"boolean",description:g(Ae,67,"Controls whether opened editors should show with an icon or not. This requires a file icon theme to be enabled as well."),default:!0},"workbench.editor.enablePreview":{type:"boolean",description:g(Ae,68,"Controls whether opened editors show as preview editors. Preview editors do not stay open, are reused until explicitly set to be kept open (via double-click or editing), and show file names in italics."),default:!0},"workbench.editor.enablePreviewFromQuickOpen":{type:"boolean",markdownDescription:g(Ae,69,"Controls whether editors opened from Quick Open show as preview editors. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). When enabled, hold Ctrl before selection to open an editor as a non-preview. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.enablePreviewFromCodeNavigation":{type:"boolean",markdownDescription:g(Ae,70,"Controls whether editors remain in preview when a code navigation is started from them. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.closeOnFileDelete":{type:"boolean",description:g(Ae,71,"Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that editors with unsaved changes will never close to preserve your data."),default:!1},"workbench.editor.openPositioning":{type:"string",enum:["left","right","first","last"],default:"right",markdownDescription:g(Ae,72,"Controls where editors open. Select {0} or {1} to open editors to the left or right of the currently active one. Select {2} or {3} to open editors independently from the currently active one.","`left`","`right`","`first`","`last`")},"workbench.editor.openSideBySideDirection":{type:"string",enum:["right","down"],default:"right",markdownDescription:g(Ae,73,"Controls the default direction of editors that are opened side by side (for example, from the Explorer). By default, editors will open on the right hand side of the currently active one. If changed to `down`, the editors will open below the currently active one.")},"workbench.editor.closeEmptyGroups":{type:"boolean",description:g(Ae,74,"Controls the behavior of empty editor groups when the last tab in the group is closed. When enabled, empty groups will automatically close. When disabled, empty groups will remain part of the grid."),default:!0},"workbench.editor.revealIfOpen":{type:"boolean",description:g(Ae,75,"Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, such as when forcing an editor to open in a specific group or to the side of the currently active group."),default:!1},"workbench.editor.mouseBackForwardToNavigate":{type:"boolean",description:g(Ae,76,"Enables the use of mouse buttons four and five for commands 'Go Back' and 'Go Forward'."),default:!0},"workbench.editor.navigationScope":{type:"string",enum:["default","editorGroup","editor"],default:"default",markdownDescription:g(Ae,77,"Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),enumDescriptions:[g(Ae,78,"Navigate across all opened editors and editor groups."),g(Ae,79,"Navigate only in editors of the active editor group."),g(Ae,80,"Navigate only in the active editor.")]},"workbench.editor.restoreViewState":{type:"boolean",markdownDescription:g(Ae,81,"Restores the last editor view state (such as scroll position) when re-opening editors after they have been closed. Editor view state is stored per editor group and discarded when a group closes. Use the {0} setting to use the last known view state across all editor groups in case no previous view state was found for a editor group.","`#workbench.editor.sharedViewState#`"),default:!0,scope:ut.LANGUAGE_OVERRIDABLE},"workbench.editor.sharedViewState":{type:"boolean",description:g(Ae,82,"Preserves the most recent editor view state (such as scroll position) across all editor groups and restores that if no specific editor view state is found for the editor group."),default:!1},"workbench.editor.splitInGroupLayout":{type:"string",enum:["vertical","horizontal"],default:"horizontal",markdownDescription:g(Ae,83,"Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),enumDescriptions:[g(Ae,84,"Editors are positioned from top to bottom."),g(Ae,85,"Editors are positioned from left to right.")]},"workbench.editor.centeredLayoutAutoResize":{type:"boolean",default:!0,description:g(Ae,86,"Controls if the centered layout should automatically resize to maximum width when more than one group is open. Once only one group is open it will resize back to the original centered width.")},"workbench.editor.centeredLayoutFixedWidth":{type:"boolean",default:!1,description:g(Ae,87,"Controls whether the centered layout tries to maintain constant width when the window is resized.")},"workbench.editor.doubleClickTabToToggleEditorGroupSizes":{type:"string",enum:["maximize","expand","off"],default:"expand",markdownDescription:g(Ae,88,"Controls how the editor group is resized when double clicking on a tab. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),enumDescriptions:[g(Ae,89,"All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),g(Ae,90,"The editor group takes as much space as possible by making all other editor groups as small as possible."),g(Ae,91,"No editor group is resized when double clicking on a tab.")]},"workbench.editor.limit.enabled":{type:"boolean",default:!1,description:g(Ae,92,"Controls if the number of opened editors should be limited or not. When enabled, less recently used editors will close to make space for newly opening editors.")},"workbench.editor.limit.value":{type:"number",default:10,exclusiveMinimum:0,markdownDescription:g(Ae,93,"Controls the maximum number of opened editors. Use the {0} setting to control this limit per editor group or across all groups.","`#workbench.editor.limit.perEditorGroup#`")},"workbench.editor.limit.excludeDirty":{type:"boolean",default:!1,description:g(Ae,94,"Controls if the maximum number of opened editors should exclude dirty editors for counting towards the configured limit.")},"workbench.editor.limit.perEditorGroup":{type:"boolean",default:!1,description:g(Ae,95,"Controls if the limit of maximum opened editors should apply per editor group or across all editor groups.")},"workbench.localHistory.enabled":{type:"boolean",default:!0,description:g(Ae,96,"Controls whether local file history is enabled. When enabled, the file contents of an editor that is saved will be stored to a backup location to be able to restore or review the contents later. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.maxFileSize":{type:"number",default:256,minimum:1,description:g(Ae,97,"Controls the maximum size of a file (in KB) to be considered for local file history. Files that are larger will not be added to the local file history. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.maxFileEntries":{type:"number",default:50,minimum:0,description:g(Ae,98,"Controls the maximum number of local file history entries per file. When the number of local file history entries exceeds this number for a file, the oldest entries will be discarded."),scope:ut.RESOURCE},"workbench.localHistory.exclude":{type:"object",patternProperties:{".*":{type:"boolean"}},markdownDescription:g(Ae,99,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files from the local file history. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.mergeWindow":{type:"number",default:10,minimum:1,markdownDescription:g(Ae,100,"Configure an interval in seconds during which the last entry in local file history is replaced with the entry that is being added. This helps reduce the overall number of entries that are added, for example when auto save is enabled. This setting is only applied to entries that have the same source of origin. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.commandPalette.history":{type:"number",description:g(Ae,101,"Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history."),default:50,minimum:0},"workbench.commandPalette.preserveInput":{type:"boolean",description:g(Ae,102,"Controls whether the last typed input to the command palette should be restored when opening it the next time."),default:!1},"workbench.commandPalette.experimental.suggestCommands":{type:"boolean",tags:["experimental"],description:g(Ae,103,"Controls whether the command palette should have a list of commonly used commands."),default:!1},"workbench.commandPalette.experimental.askChatLocation":{type:"string",tags:["experimental"],description:g(Ae,104,"Controls where the command palette should ask chat questions."),default:"chatView",enum:["chatView","quickChat"],enumDescriptions:[g(Ae,105,"Ask chat questions in the Chat view."),g(Ae,106,"Ask chat questions in Quick Chat.")]},"workbench.commandPalette.experimental.enableNaturalLanguageSearch":{type:"boolean",tags:["experimental"],description:g(Ae,107,"Controls whether the command palette should include similar commands. You must have an extension installed that provides Natural Language support."),default:!0},"workbench.quickOpen.closeOnFocusLost":{type:"boolean",description:g(Ae,108,"Controls whether Quick Open should close automatically once it loses focus."),default:!0},"workbench.quickOpen.preserveInput":{type:"boolean",description:g(Ae,109,"Controls whether the last typed input to Quick Open should be restored when opening it the next time."),default:!1},"workbench.settings.openDefaultSettings":{type:"boolean",description:g(Ae,110,"Controls whether opening settings also opens an editor showing all default settings."),default:!1},"workbench.settings.useSplitJSON":{type:"boolean",markdownDescription:g(Ae,111,"Controls whether to use the split JSON editor when editing settings as JSON."),default:!1},"workbench.settings.openDefaultKeybindings":{type:"boolean",description:g(Ae,112,"Controls whether opening keybinding settings also opens an editor showing all default keybindings."),default:!1},"workbench.sideBar.location":{type:"string",enum:["left","right"],default:"left",description:g(Ae,113,"Controls the location of the primary side bar and activity bar. They can either show on the left or right of the workbench. The secondary side bar will show on the opposite side of the workbench.")},"workbench.panel.defaultLocation":{type:"string",enum:["left","bottom","right"],default:"bottom",description:g(Ae,114,"Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, right, or left of the editor area.")},"workbench.panel.opensMaximized":{type:"string",enum:["always","never","preserve"],default:"preserve",description:g(Ae,115,"Controls whether the panel opens maximized. It can either always open maximized, never open maximized, or open to the last state it was in before being closed."),enumDescriptions:[g(Ae,116,"Always maximize the panel when opening it."),g(Ae,117,"Never maximize the panel when opening it. The panel will open un-maximized."),g(Ae,118,"Open the panel to the state that it was in, before it was closed.")]},"workbench.statusBar.visible":{type:"boolean",default:!0,description:g(Ae,119,"Controls the visibility of the status bar at the bottom of the workbench.")},[g_.ACTIVITY_BAR_LOCATION]:{type:"string",enum:["default","top","bottom","hidden"],default:"default",markdownDescription:g(Ae,120,"Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),enumDescriptions:[g(Ae,121,"Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),g(Ae,122,"Show the Activity Bar on top of the Primary and Secondary Side Bars."),g(Ae,123,"Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),g(Ae,124,"Hide the Activity Bar in the Primary and Secondary Side Bars.")]},"workbench.activityBar.iconClickBehavior":{type:"string",enum:["toggle","focus"],default:"toggle",markdownDescription:g(Ae,125,"Controls the behavior of clicking an Activity Bar icon in the workbench. This value is ignored when {0} is not set to {1}.","`#workbench.activityBar.location#`","`default`"),enumDescriptions:[g(Ae,126,"Hide the Primary Side Bar if the clicked item is already visible."),g(Ae,127,"Focus the Primary Side Bar if the clicked item is already visible.")]},"workbench.view.alwaysShowHeaderActions":{type:"boolean",default:!1,description:g(Ae,128,"Controls the visibility of view header actions. View header actions may either be always visible, or only visible when that view is focused or hovered over.")},"workbench.fontAliasing":{type:"string",enum:["default","antialiased","none","auto"],default:"default",description:g(Ae,129,"Controls font aliasing method in the workbench."),enumDescriptions:[g(Ae,130,"Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),g(Ae,131,"Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),g(Ae,132,"Disables font smoothing. Text will show with jagged sharp edges."),g(Ae,133,"Applies `default` or `antialiased` automatically based on the DPI of displays.")],included:ei},"workbench.settings.editor":{type:"string",enum:["ui","json"],enumDescriptions:[g(Ae,134,"Use the settings UI editor."),g(Ae,135,"Use the JSON file editor.")],description:g(Ae,136,"Determines which settings editor to use by default."),default:"ui",scope:ut.WINDOW},"workbench.hover.delay":{type:"number",description:g(Ae,137,"Controls the delay in milliseconds after which the hover is shown for workbench items (ex. some extension provided tree view items). Already visible items may require a refresh before reflecting this setting change."),default:ei?1500:500,minimum:0},"workbench.reduceMotion":{type:"string",description:g(Ae,138,"Controls whether the workbench should render with fewer animations."),enumDescriptions:[g(Ae,139,"Always render with reduced motion."),g(Ae,140,"Do not render with reduced motion"),g(Ae,141,"Render with reduced motion based on OS configuration.")],default:"auto",tags:["accessibility"],enum:["on","off","auto"]},[g_.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Jn?g(Ae,142,"Controls whether the layout control in the title bar is shown."):g(Ae,143,"Controls whether the layout control is shown in the custom title bar. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"workbench.layoutControl.type":{type:"string",enum:["menu","toggles","both"],enumDescriptions:[g(Ae,144,"Shows a single button with a dropdown of layout options."),g(Ae,145,"Shows several buttons for toggling the visibility of the panels and side bar."),g(Ae,146,"Shows both the dropdown and toggle buttons.")],default:"both",description:g(Ae,147,"Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles.")},"workbench.tips.enabled":{type:"boolean",default:!0,description:g(Ae,148,"When enabled, will show the watermark tips when no editor is open.")}}});let e=g(Ae,149,"Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:");e+=` -- `+[g(Ae,150,"`${activeEditorShort}`: the file name (e.g. myFile.txt)."),g(Ae,151,"`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),g(Ae,152,"`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)."),g(Ae,153,"`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder)."),g(Ae,154,"`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)."),g(Ae,155,"`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)."),g(Ae,156,"`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder)."),g(Ae,157,"`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)."),g(Ae,158,"`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace))."),g(Ae,159,"`${rootNameShort}`: shortened name of the workspace without suffixes (e.g. myFolder, myRemoteFolder or myWorkspace)."),g(Ae,160,"`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)."),g(Ae,161,"`${profileName}`: name of the profile in which the workspace is opened (e.g. Data Science (Profile)). Ignored if default profile is used."),g(Ae,162,"`${appName}`: e.g. VS Code."),g(Ae,163,"`${remoteName}`: e.g. SSH"),g(Ae,164,"`${dirty}`: an indicator for when the active editor has unsaved changes."),g(Ae,165,"`${focusedView}`: the name of the view that is currently focused."),g(Ae,166,"`${activeRepositoryName}`: the name of the active repository (e.g. vscode)."),g(Ae,167,"`${activeRepositoryBranchName}`: the name of the active branch in the active repository (e.g. main)."),g(Ae,168,'`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.')].join(` -- `),eY.registerConfiguration({...Het,properties:{"window.title":{type:"string",default:Tst,markdownDescription:e},"window.titleSeparator":{type:"string",default:Rst,markdownDescription:g(Ae,169,"Separator used by {0}.","`#window.title#`")},[g_.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Jn?g(Ae,170,"Show command launcher together with the window title."):g(Ae,171,"Show command launcher together with the window title. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"window.menuBarVisibility":{type:"string",enum:["classic","visible","toggle","hidden","compact"],markdownEnumDescriptions:[g(Ae,172,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(Ae,173,"Menu is always visible at the top of the window even in full screen mode."),ei?g(Ae,174,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(Ae,175,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(Ae,176,"Menu is always hidden."),Jn?g(Ae,177,"Menu is displayed as a compact button in the side bar."):g(Ae,178,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Jn?"compact":"classic",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,179,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and executing `Focus Application Menu` will show it. A setting of 'compact' will move the menu into the side bar."):g(Ae,180,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. A setting of 'compact' will move the menu into the side bar."),included:Is||jr||Jn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:ut.APPLICATION,description:g(Ae,181,"Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),included:Is||jr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:ut.APPLICATION,markdownDescription:g(Ae,182,"Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),included:Is||jr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,183,"Files will open in a new window."),g(Ae,184,"Files will open in the window with the files' folder open or the last active window."),ei?g(Ae,185,"Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder."):g(Ae,186,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,187,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option)."):g(Ae,188,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.openFoldersInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,189,"Folders will open in a new window."),g(Ae,190,"Folders will replace the last active window."),g(Ae,191,"Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu).")],default:"default",scope:ut.APPLICATION,markdownDescription:g(Ae,192,"Controls whether folders should open in a new window or replace the last active window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.confirmBeforeClose":{type:"string",enum:["always","keyboardOnly","never"],enumDescriptions:[Jn?g(Ae,193,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(Ae,194,"Always ask for confirmation."),Jn?g(Ae,195,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(Ae,196,"Only ask for confirmation if a keybinding was used."),Jn?g(Ae,197,"Never explicitly ask for confirmation unless data loss is imminent."):g(Ae,198,"Never explicitly ask for confirmation.")],default:Jn&&!UQe()?"keyboardOnly":"never",markdownDescription:Jn?g(Ae,199,"Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases."):g(Ae,200,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:ut.APPLICATION}}}),gp(Cte.ID,Cte,Sl.Eventually),eY.registerConfiguration({...lNt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(Ae,201,"Controls whether the problems are visible throughout the editor and workbench.")}}}),eY.registerConfiguration({id:"zenMode",order:9,title:g(Ae,202,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(Ae,203,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(Ae,204,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(Ae,205,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(Ae,206,"Each editor is displayed as a tab in the editor title area."),g(Ae,207,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,208,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(Ae,209,"Controls whether turning on Zen Mode also hides the status bar at the bottom of the workbench.")},"zenMode.hideActivityBar":{type:"boolean",default:!0,description:g(Ae,210,"Controls whether turning on Zen Mode also hides the activity bar either at the left or right of the workbench.")},"zenMode.hideLineNumbers":{type:"boolean",default:!0,description:g(Ae,211,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(Ae,212,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(Ae,213,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:n=>{const e=[];return n!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),n===!1&&e.push([g_.ACTIVITY_BAR_LOCATION,{value:Tne.HIDDEN}]),e}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:g_.ACTIVITY_BAR_LOCATION,migrateFn:n=>{const e=[];return n==="side"&&e.push([g_.ACTIVITY_BAR_LOCATION,{value:Tne.DEFAULT}]),e}}]);it.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:n}])),e}},{key:g_.EDITOR_TABS_MODE,migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?xM.MULTIPLE:xM.SINGLE,e.push([g_.EDITOR_TABS_MODE,{value:n}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:n=>{const e=[];return n==="left"||n==="right"?e.push(["workbench.editor.tabActionLocation",{value:n}]):n==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:n=>{const e=[["zenMode.hideTabs",{value:void 0}]];return n===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let Mst=()=>!1,Nst=(n,e)=>!1;const N$t=FF.prototype.getCommandPicks;FF.prototype.getCommandPicks=async function(n){let e=await N$t.call(this,n);return Mst()||(e=e.map(t=>({...t,buttons:void 0}))),e};let uDe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(oEe)}get activeService(){const e=Lt.get(jt).getFocusedCodeEditor();return e==null||Nst(e,e instanceof k1)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(R7)),this.standaloneQuickInputService)}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}createQuickWidget(){return this.activeService.createQuickWidget()}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};uDe=D([_(0,be)],uDe);function P$t({isKeybindingConfigurationVisible:n,shouldUseGlobalPicker:e}={}){return n!=null&&(Mst=n),e!=null&&(Nst=e),{[On.toString()]:new Gi(uDe,[],!0)}}const F$t="vs/platform/files/common/io";async function O$t(n,e,t,i,s,o){let r;try{await B$t(n,e,t,i,s,o)}catch(a){r=a}finally{r&&s.errorTransformer&&(r=s.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function B$t(n,e,t,i,s,o){Wpe(o);const r=await n.open(e,{create:!1});try{Wpe(o);let a=0,c=0,l=s&&typeof s.length=="number"?s.length:void 0,d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),h=s&&typeof s.position=="number"?s.position:0,u=0;do c=await n.read(r,h,d.buffer,u,d.byteLength-u),h+=c,u+=c,a+=c,typeof l=="number"&&(l-=c),u===d.byteLength&&(await t.write(i(d)),d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&Wpe(o)&&W$t(a,s));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw qL(a)}finally{await n.close(r)}}function Wpe(n){if(n.isCancellationRequested)throw rx();return!0}function W$t(n,e){if(typeof e?.limits?.size=="number"&&n>e.limits.size)throw xs(g(F$t,0,"File is too large to open"),rt.FileTooLarge);return!0}var gDe;const oc="vs/platform/files/common/fileService";function Pst(n){return n.scheme===_e.file?n.fsPath:n.toString(!0)}async function Fst(n,e,t){const i=[];for(;!n.isEqual(t,n.dirname(t));)try{if(!((await e.stat(t)).type&an.Directory))throw new Error(g(oc,0,"Unable to create folder '{0}' that already exists but is not a directory",Pst(t)));break}catch(s){if(w1(s)!==rt.FileNotFound)throw s;i.push(n.basename(t)),t=n.dirname(t)}for(let s=i.length-1;s>=0;s--){t=n.joinPath(t,i[s]);try{await e.mkdir(t)}catch(o){if(w1(o)!==rt.FileExists)throw o}}}var xP;let fDe=(xP=class extends ${constructor(e){super(),this.logService=e,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new I),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new I),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new I),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new I),this.onDidRunOperation=this._onDidRunOperation.event,this.internalOnDidFilesChange=this._register(new I),this._onDidUncorrelatedFilesChange=this._register(new I),this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event,this._onDidWatchError=this._register(new I),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new oMe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);vs(`code/registerFilesystem/${e}`);const i=new Z;return this.provider.set(e,t),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:t}),i.add(t.onDidChangeFile(s=>{const o=new mee(s,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(s=>this._onDidWatchError.fire(new Error(s)))),i.add(t.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:t,scheme:e}))),Ee(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:t}),this.provider.delete(e),St(i)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){const t=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(i){t.push(i)}}),!this.provider.has(e)&&await ko.settled(t)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,t){const i=this.provider.get(e.scheme);return!!(i&&i.capabilities&t)}listCapabilities(){return fi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!KQe(e))throw new Ah(g(oc,1,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Zi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new uc;throw i.message=g(oc,2,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t)||dJ(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,t){try{return await this.doResolveFile(e,t)}catch(i){throw w1(i)===rt.FileNotFound?new Ah(g(oc,3,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Zi.FILE_NOT_FOUND):qL(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),s=this.isPathCaseSensitive(i),o=t?.resolveTo,r=t?.resolveSingleChildDescendants,a=t?.resolveMetadata,c=await i.stat(e);let l;return this.toFileStat(i,e,c,void 0,!!a,(d,h)=>(l||(l=Su.forUris(()=>!s),l.set(e,!0),o&&l.fill(!0,o)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&r?h===1:!1))}async toFileStat(e,t,i,s,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&an.File)!==0,isDirectory:(i.type&an.Directory)!==0,isSymbolicLink:(i.type&an.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&wm.Readonly)||!!(e.capabilities&es.Readonly),locked:!!((i.permissions??0)&wm.Locked),etag:_ee({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,s)){try{const l=await e.readdir(t),d=await ko.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=o?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,o,r)}catch(f){return this.logService.trace(f),null}}));c.children=Vi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return ko.settled(e.map(async t=>{try{return{stat:await this.doResolveFile(t.resource,t.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(e){const t=await this.withProvider(e),i=await t.stat(e);return this.toFileStat(t,e,i,void 0,!0,()=>!1)}async exists(e){const t=await this.withProvider(e);try{return!!await t.stat(e)}catch{return!1}}async canCreateFile(e,t){try{await this.doValidateCreateFile(e,t)}catch(i){return i}return!0}async doValidateCreateFile(e,t){if(!t?.overwrite&&await this.exists(e))throw new Ah(g(oc,4,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Zi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=ze.fromString(""),i){await this.doValidateCreateFile(e,i);const s=await this.writeFile(e,t);return this._onDidRunOperation.fire(new qO(e,Li.CREATE,s)),s}async writeFile(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(s);let r=i;if(KHe(s)&&!r?.atomic){const a=s.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(s,e,r)||await this.mkdirp(s,o.dirname(e));let c;if(sv(s)&&!(t instanceof ze))if(KY(t)){const l=await Kgt(t,3);l.ended?c=ze.concat(l.buffer):c=l}else c=jgt(t,l=>ze.concat(l),3);else c=t;!mD(s)||sv(s)&&c instanceof ze||sv(s)&&KHe(s)&&r?.atomic?await this.doWriteUnbuffered(s,e,r,c):await this.doWriteBuffered(s,e,r,c instanceof ze?Ije(c):c),this._onDidRunOperation.fire(new qO(e,Li.WRITE))}catch(a){throw new Ah(g(oc,5,"Unable to write file '{0}' ({1})",this.resourceForError(e),qL(a).toString()),Cy(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const s=!!i?.unlock;if(s&&!(e.capabilities&es.FileWriteUnlock))throw new Error(g(oc,6,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&es.FileAtomicWrite))throw new Error(g(oc,7,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&es.FileReadWrite))throw new Error(g(oc,8,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(s)throw new Error(g(oc,9,"Unable to unlock file '{0}' because atomic write is enabled.",this.resourceForError(t)))}let r;try{r=await e.stat(t)}catch{return}if(r.type&an.Directory)throw new Ah(g(oc,10,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Zi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==zv&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,s);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,s){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},s);return{...o,value:await II(o.value)}}async readFileStream(e,t,i){const s=await this.withReadProvider(e);return this.doReadFileStream(s,e,t,i)}async doReadFileStream(e,t,i,s){const o=new ai(s);let r=i;Rfe(e)&&e.enforceAtomicReadFile?.(t)&&(r={...i,atomic:!0});const a=this.validateReadFile(t,r).then(l=>l,l=>{throw o.dispose(!0),l});let c;try{return typeof r?.etag=="string"&&r.etag!==zv&&await a,r?.atomic&&Rfe(e)||!(mD(e)||dJ(e))||sv(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):dJ(e)?c=this.readFileStreamed(e,t,o.token,r):c=this.readFileBuffered(e,t,o.token,r),c.on("end",()=>o.dispose()),c.on("error",()=>o.dispose()),{...await a,value:c}}catch(l){throw c&&await fMe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const s=g(oc,12,"Unable to read file '{0}' ({1})",this.resourceForError(t),qL(e).toString());return e instanceof P$?new P$(s,e.stat,i):e instanceof hJ?new hJ(s,e.fileOperationResult,e.size,e.options):new Ah(s,Cy(e),i)}readFileStreamed(e,t,i,s=Object.create(null)){const o=e.readFileStream(t,s,i);return Xgt(o,{data:r=>r instanceof ze?r:ze.wrap(r),error:r=>this.restoreReadError(r,t,s)},r=>ze.concat(r))}readFileBuffered(e,t,i,s=Object.create(null)){const o=Lje();return O$t(e,t,o,r=>r,{...s,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,s)},i),o}readFileUnbuffered(e,t,i){const s=Xx(o=>ze.concat(o));return(async()=>{try{let o;i?.atomic&&Rfe(e)?o=await e.readFile(t,{atomic:!0}):o=await e.readFile(t),typeof i?.position=="number"&&(o=o.slice(i.position)),typeof i?.length=="number"&&(o=o.slice(0,i.length)),this.validateReadFileLimits(t,o.byteLength,i),s.end(ze.wrap(o))}catch(o){s.error(o),s.end()}})(),s}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Ah(g(oc,13,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Zi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==zv&&t.etag===i.etag)throw new P$(g(oc,14,"File not modified since"),i,t);return this.validateReadFileLimits(e,i.size,t),i}validateReadFileLimits(e,t,i){if(typeof i?.limits?.size=="number"&&t>i.limits.size)throw new hJ(g(oc,15,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Zi.FILE_TOO_LARGE,t,i)}async canMove(e,t,i){return this.doCanMoveCopy(e,t,"move",i)}async canCopy(e,t,i){return this.doCanMoveCopy(e,t,"copy",i)}async doCanMoveCopy(e,t,i,s){if(e.toString()!==t.toString())try{const o=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(o,e,r,t,i,s)}catch(o){return o}return!0}async move(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="move"?Li.MOVE:Li.COPY,a)),a}async copy(e,t,i){const s=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="copy"?Li.COPY:Li.MOVE,a)),a}async doMoveCopy(e,t,i,s,o,r){if(t.toString()===s.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,s,o,r);if(a&&!c&&r&&await this.del(s,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(s)),o==="copy"){if(e===i&&jHe(e))await e.copy(t,s,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,s):await this.doCopyFile(e,t,i,s)}return o}else return e===i?(await e.rename(t,s,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,s,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,s){if(mD(e)&&mD(i))return this.doPipeBuffered(e,t,i,s);if(mD(e)&&sv(i))return this.doPipeBufferedToUnbuffered(e,t,i,s);if(sv(e)&&mD(i))return this.doPipeUnbufferedToBuffered(e,t,i,s);if(sv(e)&&sv(i))return this.doPipeUnbuffered(e,t,i,s)}async doCopyFolder(e,t,i,s){await i.mkdir(s),Array.isArray(t.children)&&await ko.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(s,o.name);return o.isDirectory?this.doCopyFolder(e,await this.resolve(o.resource),i,r):this.doCopyFile(e,o.resource,i,r)}))}async doValidateMoveCopy(e,t,i,s,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,s)),a&&o==="copy")throw new Error(g(oc,16,"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",this.resourceForError(t),this.resourceForError(s)));if(!a&&l.isEqualOrParent(s,t))throw new Error(g(oc,17,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(s)))}const c=await this.exists(s);if(c&&!a){if(!r)throw new Ah(g(oc,18,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(s)),Zi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,s))throw new Error(g(oc,19,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(s)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?Fn:Gle,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&es.PathCaseSensitive)}async createFolder(e){const t=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(t,e);const i=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,Li.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return Fst(i,e,t)}async canDelete(e,t){try{await this.doValidateDelete(e,t)}catch(i){return i}return!0}async doValidateDelete(e,t){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),s=!!t?.useTrash;if(s&&!(i.capabilities&es.Trash))throw new Error(g(oc,20,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&es.FileAtomicDelete))throw new Error(g(oc,21,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(s&&o)throw new Error(g(oc,22,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let r;try{r=await i.stat(e)}catch{}if(r)this.throwIfFileIsReadonly(e,r);else throw new Ah(g(oc,23,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Zi.FILE_NOT_FOUND);if(!!!t?.recursive){const c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(g(oc,24,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let s=t;if($Et(i)&&!s?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(s={...t,atomic:c})}const o=!!s?.useTrash,r=!!s?.recursive,a=s?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new qO(e,Li.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===s&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===s&&zEt(i)?i.cloneFile(e,t):(await this.mkdirp(s,this.getExtUri(s).providerExtUri.dirname(t)),i===s&&jHe(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,s,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:gDe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let s=!1,o=()=>{s=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);s?St(a):o=()=>St(a)}catch(a){this.logService.error(a)}})();const r=t.correlationId;if(typeof r=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(r)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),s=Ed([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(s);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(s,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(St(o.disposable),this.activeWatchers.delete(s)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)St(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,s){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{KY(s)||Bge(s)?await this.doWriteStreamBufferedQueued(e,o,s):await this.doWriteReadableBufferedQueued(e,o,s)}catch(r){throw qL(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let s=0,o;if(Bge(i)){if(i.buffer.length>0){const r=ze.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,s,0),s+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{hO(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,s,0)}catch(l){return a(l)}s+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let s=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,s,0),s+=o.byteLength}async doWriteBuffer(e,t,i,s,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,s),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,s){let o;s instanceof ze?o=s:KY(s)?o=await II(s):Bge(s)?o=await rft(s):o=oft(s),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,s){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(s,{create:!0,unlock:!1});const a=ze.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(o,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,r,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw qL(a)}finally{await ko.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,s){return i.writeFile(s,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,s){const o=await i.open(s,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,ze.wrap(r),r.byteLength,0,0)}catch(r){throw qL(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,s){const o=await II(this.readFileBuffered(e,t,qe.None));await this.doWriteUnbuffered(i,s,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&es.Readonly)throw new Ah(g(oc,25,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Zi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&wm.Readonly)throw new Ah(g(oc,25,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Zi.FILE_PERMISSION_DENIED)}resourceForError(e){return Pst(e)}},gDe=xP,xP.WATCHER_CORRELATION_IDS=0,xP);fDe=gDe=D([_(0,Ze)],fDe);class F3e{constructor(e){this.type=an.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class N5{constructor(e){this.type=an.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class Mne extends ${constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=es.FileReadWrite|es.PathCaseSensitive,this.root=new N5(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&es.Readonly);e!==t&&(this._capabilities=e?es.Readonly|es.PathCaseSensitive|es.FileReadWrite:es.FileReadWrite|es.PathCaseSensitive,this._onDidChangeCapabilities.fire())}async stat(e){return this._lookup(e,!1)}async readdir(e){const t=this._lookupAsDirectory(e,!1),i=[];return t.entries.forEach((s,o)=>i.push([o,s.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw xs("file not found",rt.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=Xx(s=>ze.concat(s.map(o=>ze.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const s=ui(e),o=this._lookupParentDirectory(e);let r=o.entries.get(s);if(r instanceof N5)throw xs("file is directory",rt.FileIsADirectory);if(!r&&!i.create)throw xs("file not found",rt.FileNotFound);if(r&&i.create&&!i.overwrite)throw xs("file exists already",rt.FileExists);r||(r=new F3e(s),o.entries.set(s,r),this._fireSoon({type:Ko.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:Ko.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const s=this.memoryFdCounter++;return this.fdMemory.set(s,i),Promise.resolve(s)}throw xs("file not found",rt.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),Promise.resolve(a.byteLength)}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw xs("file exists already",rt.FileExists);const s=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=ui(t);o.entries.delete(s.name),s.name=a,r.entries.set(a,s),this._fireSoon({type:Ko.DELETED,resource:e},{type:Ko.ADDED,resource:t})}async delete(e,t){const i=ma(e),s=ui(e),o=this._lookupAsDirectory(i,!1);o.entries.has(s)&&(o.entries.delete(s),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:Ko.UPDATED,resource:i},{resource:e,type:Ko.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new N5(t);s.entries.set(o.name,o),s.mtime=Date.now(),s.size+=1,this._fireSoon({type:Ko.UPDATED,resource:i},{type:Ko.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let s=this.root;for(const o of i){if(!o)continue;let r;if(s instanceof N5&&(r=s.entries.get(o)),!r){if(t)return;throw xs("file not found",rt.FileNotFound)}s=r}return s}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof N5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof F3e)return i;throw xs("file is a directory",rt.FileIsADirectory)}_lookupParentDirectory(e){const t=ma(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return $.None}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}dispose(){super.dispose(),this.fdMemory.clear()}}class O3e extends Error{constructor(e){super("Missing stores"),this.db=e}}class pDe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class PT{static async create(e,t,i){const s=await PT.openDatabase(e,t,i);return new PT(s,e)}static async openDatabase(e,t,i){vs(`code/willOpenDatabase/${e}`);try{return await PT.doOpenDatabase(e,t,i)}catch(s){if(s instanceof O3e){console.info("Attempting to recreate the IndexedDB once.",e);try{await PT.deleteDatabase(s.db)}catch(o){throw console.error("Error while deleting the IndexedDB",lg(o)),o}return await PT.doOpenDatabase(e,t,i)}throw s}finally{vs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((s,o)=>{const r=indexedDB.open(e,t);r.onerror=()=>o(r.error),r.onsuccess=()=>{const a=r.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),o(new O3e(a));return}s(a)},r.onupgradeneeded=()=>{const a=r.result;for(const c of i)a.objectStoreNames.contains(c)||a.createObjectStore(c)}})}static deleteDatabase(e){return new Promise((t,i)=>{e.close();const s=indexedDB.deleteDatabase(e.name);s.onerror=o=>i(s.error),s.onsuccess=()=>t()})}constructor(e,t){this.name=t,this.database=null,this.pendingTransactions=[],this.database=e}hasPendingTransactions(){return this.pendingTransactions.length>0}close(){this.pendingTransactions.length&&this.pendingTransactions.splice(0,this.pendingTransactions.length).forEach(e=>e.abort()),this.database?.close(),this.database=null}async runInTransaction(e,t,i){if(!this.database)throw new pDe(this.name);const s=this.database.transaction(e,t);return this.pendingTransactions.push(s),new Promise((o,r)=>{s.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},s.onerror=()=>r(s.error?uc.fromError(s.error):new uc("unknown error")),s.onabort=()=>r(s.error?uc.fromError(s.error):new uc("unknown error"));const a=i(s.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(s),1))}async getKeyValues(e,t){if(!this.database)throw new pDe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(s=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return s(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):s(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Ma(l,!0)}`),s(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Qz="vs/platform/files/browser/indexedDBFileSystemProvider",Hpe=xs(g(Qz,0,"File does not exist"),rt.FileNotFound),H$t=xs(g(Qz,1,"File is Directory"),rt.FileIsADirectory),B3e=xs(g(Qz,2,"File is not a directory"),rt.FileNotADirectory),U$t=xs(g(Qz,3,"Directory is not empty"),rt.Unknown),V$t=xs(g(Qz,4,"File exceeds available storage quota"),rt.FileExceedsStorageQuota),jw=n=>xs(g(Qz,5,"Internal error occurred in IndexedDB File System Provider. ({0})",n),rt.Unknown);class d8{constructor(e){this.entry=e,this.type=e.type}read(e){return this.doRead(e.split("/").filter(t=>t.length))}doRead(e){if(e.length===0)return this.entry;if(this.entry.type!==an.Directory)throw jw("Internal error reading from IndexedDBFSNode -- expected directory at "+this.entry.path);const t=this.entry.children.get(e[0]);if(t)return t.doRead(e.slice(1))}delete(e){const t=e.split("/").filter(i=>i.length);if(t.length===0){if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode. Expected root entry to be directory");this.entry.children.clear()}else return this.doDelete(t,e)}doDelete(e,t){if(e.length===0)throw jw(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode -- expected directory at "+this.entry.path);if(e.length===1)this.entry.children.delete(e[0]);else{const i=this.entry.children.get(e[0]);if(!i)throw jw("Internal error deleting from IndexedDBFSNode -- expected entry at "+this.entry.path+"/"+i);i.doDelete(e.slice(1),t)}}add(e,t){this.doAdd(e.split("/").filter(i=>i.length),t,e)}doAdd(e,t,i){if(e.length===0)throw jw(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const s=e[0],o=this.entry.children.get(s);if(t.type==="dir"){if(o?.entry.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,o??new d8({type:an.Directory,path:this.entry.path+"/"+s,children:new Map}))}else{if(o?.entry.type===an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,new d8({type:an.File,path:this.entry.path+"/"+s,size:t.size}))}}else if(e.length>1){const s=e[0];let o=this.entry.children.get(s);if(!o)o=new d8({children:new Map,path:this.entry.path+"/"+s,type:an.Directory}),this.entry.children.set(s,o);else if(o.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===an.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class z$t extends ${constructor(e,t,i,s){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=es.FileReadWrite|es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.extUri=new cO(()=>!1),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._onReportError=this._register(new I),this.onReportError=this._onReportError.event,this.mtimes=new Map,this.fileWriteBatch=[],this.writeManyThrottler=new tQ,s&&(this.changesBroadcastChannel=this._register(new nOe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:P.revive(r.resource)})))})))}watch(e,t){return $.None}async mkdir(e){try{if((await this.stat(e)).type===an.File)throw B3e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===an.File)return{type:an.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===an.Directory)return{type:an.Directory,ctime:0,mtime:0,size:0};throw Hpe}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==an.Directory)throw B3e;return[...t.children.entries()].map(([i,s])=>[i,s.type])}catch(t){throw this.reportError("readDir",t),t}}async readFile(e){try{const t=await this.indexedDB.runInTransaction(this.store,"readonly",o=>o.get(e.path));if(t===void 0)throw Hpe;const i=t instanceof Uint8Array?t:$t(t)?ze.fromString(t).buffer:void 0;if(i===void 0)throw jw(`IndexedDB entry at "${e.path}" in unexpected format`);return(await this.getFiletree()).add(e.path,{type:"file",size:i.byteLength}),i}catch(t){throw this.reportError("readFile",t),t}}async writeFile(e,t,i){try{if((await this.stat(e).catch(()=>{}))?.type===an.Directory)throw H$t;await this.bulkWrite([[e,t]])}catch(s){throw this.reportError("writeFile",s),s}}async rename(e,t,i){const s=await this.getFiletree(),o=s.read(e.path);if(!o)throw Hpe;const r=s.read(t.path);if(r){if(!i.overwrite)throw xs("file exists already",rt.FileExists);if(r.type!==o.type)throw xs("Cannot rename files with different types",rt.Unknown);await this.delete(t,{recursive:!0,useTrash:!1,atomic:!1})}const a=d=>this.extUri.joinPath(t,this.extUri.relativePath(e,e.with({path:d}))||""),c=await this.tree(e),l=[];for(const d of c)d[1]===an.File?l.push(d):d[1]===an.Directory&&s.add(a(d[0]).path,{type:"dir"});if(l.length){const d=[],h=await this.indexedDB.runInTransaction(this.store,"readonly",u=>l.map(([f])=>u.get(f)));for(let u=0;ur);else{if(i.type===an.Directory&&(await this.readdir(e)).length)throw U$t;s=[e.path]}await this.deleteKeys(s),(await this.getFiletree()).delete(e.path),s.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(s.map(o=>({resource:e.with({path:o}),type:Ko.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===an.Directory){const s=await this.readdir(e);for(const[o,r]of s){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===an.Directory){const c=await this.tree(a);i.push(...c)}}}return i}triggerChanges(e){e.length&&(this._onDidChangeFile.fire(e),this.changesBroadcastChannel?.postData(e))}getFiletree(){return this.cachedFiletree||(this.cachedFiletree=(async()=>{const e=new d8({children:new Map,path:"",type:an.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",s=>s.getAllKeys())).map(s=>s.toString()).forEach(s=>e.add(s,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,s])=>this.fileWriteBatch.push({content:s,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,s]of e)t.add(i.path,{type:"file",size:s.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:Ko.UPDATED})))}async writeMany(){if(this.fileWriteBatch.length){const e=this.fileWriteBatch.splice(0,this.fileWriteBatch.length);try{await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.put(i.content,i.resource.path)))}catch(t){throw t instanceof DOMException&&t.name==="QuotaExceededError"?V$t:t}}}async deleteKeys(e){e.length&&await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.delete(i)))}async reset(){await this.indexedDB.runInTransaction(this.store,"readwrite",e=>e.clear())}reportError(e,t){this._onReportError.fire({scheme:this.scheme,operation:e,code:t instanceof Nx||t instanceof pDe?t.code:"unknown"})}}class $$t extends ude{constructor(e=hNe){super(),this.buffer=[],this._logger=void 0,this.setLevel(e),this._register(this.onDidChangeLogLevel(t=>{this._logger?.setLevel(t)}))}set logger(e){this._logger=e;for(const{level:t,message:i}of this.buffer)see(e,t,i);this.buffer=[]}log(e,t){this._logger?see(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}var JS;(function(n){n[n.None=0]="None",n[n.Untitled=2]="Untitled",n[n.Scratchpad=4]="Scratchpad"})(JS||(JS={}));const rOe="",G$t="modulepreload",q$t=function(n,e){return new URL(n,e).href},W3e={},Uhe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");s=Promise.allSettled(t.map(l=>{if(l=q$t(l,i),l in W3e)return;W3e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=r.length-1;p>=0;p--){const m=r[p];if(m.href===l&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":G$t,d||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return s.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},Rh="utf8",dE="utf8bom",OF="utf16be",BF="utf16le",_X=[254,255],mDe=[255,254],B3=[239,187,191],Q$t=512,j$t=512,K$t=512*8,Y$t=512*128;var Nne;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(Nne||(Nne={}));class J$t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class aOe{static async create(e){let t;if(e!==Rh)t=(await Uhe(()=>import("./iconv-lite-umd-C0UfZtj6.js").then(s=>s.i),[],import.meta.url).then(s=>s.default??s)).getDecoder(cOe(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new aOe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function X$t(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?K$t:j$t;return new Promise((i,s)=>{const o=Xx(h=>h.join("")),r=[];let a=0,c;const l=new ai,d=async()=>{try{const h=await a8t({buffer:ze.concat(r),bytesRead:a},e.guessEncoding);if(h.seemsBinary&&e.acceptTextOnly)throw new J$t("Stream is binary but only text is accepted for decoding",Nne.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await aOe.create(h.encoding);const u=c.write(ze.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),s(h)}};hO(n,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(n.pause(),await d(),setTimeout(()=>n.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function Z$t(n,e,t){const s=(await Uhe(()=>import("./iconv-lite-umd-C0UfZtj6.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(cOe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=n.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Rh:case dE:return ze.wrap(Uint8Array.from(B3));case OF:return ze.wrap(Uint8Array.from(_X));case BF:return ze.wrap(Uint8Array.from(mDe))}const c=s.end();return c&&c.length>0?(o=!0,ze.wrap(c)):null}return o=!0,ze.wrap(s.write(a))}}}async function e8t(n){return(await Uhe(()=>import("./iconv-lite-umd-C0UfZtj6.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(cOe(n))}function cOe(n){return n===dE||n===null?Rh:n}function t8t(n,e){if(!n||e<_X.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===_X[0]&&i===_X[1])return OF;if(t===mDe[0]&&i===mDe[1])return BF;if(eimport("./index-ZvpXqOGL.js").then(r=>r.i),[],import.meta.url).then(r=>r.default??r),t=n.slice(0,Y$t),i=r8t(t.buffer),s=e.detect(i);if(!s||!s.encoding)return null;const o=s.encoding.toLowerCase();return 0<=i8t.indexOf(o)?null:o8t(s.encoding)}const s8t={ibm866:"cp866",big5:"cp950"};function o8t(n){const e=n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return s8t[e]||e}function r8t(n){let e="";for(let t=0;t({seemsBinary:!1,encoding:o})):{seemsBinary:s,encoding:i}}const P5={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:23},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:24},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:25},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:29},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:30},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:31},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:32},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:33},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:34},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:35},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:36},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:41},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:42},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:43},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:44},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:45},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}};var sT,ix;let _De=(ix=class extends H1{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(a,r,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=s,this.preferredEncoding=o,this.workingCopyBackupService=c,this.textResourceConfigurationService=l,this.workingCopyService=d,this.textFileService=h,this.labelService=u,this.editorService=f,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeName=this._register(new I),this.onDidChangeName=this._onDidChangeName.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this.typeId=rOe,this.capabilities=JS.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),s&&this.setLanguageId(s),this.onConfigurationChange(void 0,!1),this.registerListeners()}registerListeners(){this._register(this.textResourceConfigurationService.onDidChangeConfiguration(e=>this.onConfigurationChange(e,!0)))}onConfigurationChange(e,t){if(!e||e.affectsConfiguration(this.resource,"files.encoding")){const i=this.textResourceConfigurationService.getValue(this.resource,"files.encoding");this.configuredEncoding!==i&&typeof i=="string"&&(this.configuredEncoding=i,t&&!this.preferredEncoding&&this._onDidChangeEncoding.fire())}if(!e||e.affectsConfiguration(this.resource,"workbench.editor.untitled.labelFormat")){const i=this.textResourceConfigurationService.getValue(this.resource,"workbench.editor.untitled.labelFormat");this.configuredLabelFormat!==i&&(i==="content"||i==="name")&&(this.configuredLabelFormat=i,t&&this._onDidChangeName.fire())}}setLanguageId(e,t){const i=e===sT.ACTIVE_EDITOR_LANGUAGE_ID?this.editorService.activeTextEditorLanguageId:e;this.preferredLanguageId=i,i&&super.setLanguageId(i,t)}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}getEncoding(){return this.preferredEncoding||this.configuredEncoding}async setEncoding(e){const t=this.getEncoding();this.preferredEncoding=e,t!==this.preferredEncoding&&this._onDidChangeEncoding.fire()}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){this.dirty!==e&&(this.dirty=e,this._onDidChangeDirty.fire())}async save(e){const t=await this.textFileService.save(this.resource,e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),!!t}async revert(){this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(hde(""))}finally{this.ignoreDirtyOnModelContentChange=!1}this.setDirty(!1),this._onDidRevert.fire()}async backup(e){let t;return this.isResolved()?t=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh}):typeof this.initialValue=="string"&&(t=Ije(ze.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let s;const o=await this.workingCopyBackupService.resolve(this);o?(s=o.value,t=!0):s=aQ(ze.fromString(this.initialValue||""));const r=await tNe(await this.textFileService.getDecodedStream(this.resource,s,{encoding:Rh}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=ws(this.textEditorModel);return this.installModelListeners(i),e&&((t||this.initialValue)&&this.updateNameFromFirstLine(i),this.setDirty(this.hasAssociatedFilePath||!!t||!!this.initialValue),(t||this.initialValue)&&this._onDidChangeContent.fire()),super.resolve()}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t))),this._register(e.onDidChangeLanguage(()=>this.onConfigurationChange(void 0,!0))),super.installModelListeners(e)}onModelContentChanged(e,t){this.ignoreDirtyOnModelContentChange||(!this.hasAssociatedFilePath&&e.getLineCount()===1&&e.getLineLength(1)===0?this.setDirty(!1):this.setDirty(!0)),t.changes.some(i=>(i.range.startLineNumber===1||i.range.endLineNumber===1)&&i.range.startColumn<=sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH)&&this.updateNameFromFirstLine(e),this._onDidChangeContent.fire(),this.autoDetectLanguage()}updateNameFromFirstLine(e){if(this.hasAssociatedFilePath)return;let t,i=e.getValueInRange({startLineNumber:1,endLineNumber:1,startColumn:1,endColumn:sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,bQe(i,sT.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&zq().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},sT=ix,ix.FIRST_LINE_NAME_MAX_LENGTH=40,ix.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=sT.FIRST_LINE_NAME_MAX_LENGTH*10,ix.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ix);_De=sT=D([_(5,Di),_(6,Ai),_(7,MQ),_(8,dl),_(9,Pw),_(10,tr),_(11,eo),_(12,_i),_(13,LQ),_(14,Ur)],_De);var W3;const c8t="vs/workbench/services/textfile/common/textFileEditorModel";var j0;let vDe=(j0=class extends H1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(o,s,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=r,this.textFileService=a,this.workingCopyBackupService=c,this.logService=l,this.workingCopyService=d,this.filesConfigurationService=h,this.labelService=u,this.pathService=m,this.extensionService=v,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.typeId=rOe,this.capabilities=JS.None,this.name=yr(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!Fn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.dirty=!1,this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,this.hasEncodingSetExplicitly=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.filesConfigurationService.onDidChangeFilesAssociation(()=>this.onDidChangeFilesAssociation())),this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}async onDidFilesChange(e){let t=!1,i;if(this.inOrphanMode?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.inOrphanMode!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.inOrphanMode!==e&&(this.inOrphanMode=e,this._onDidChangeOrphaned.fire())}onDidChangeFilesAssociation(){if(!this.isResolved())return;const e=this.getFirstLineText(this.textEditorModel),t=this.getOrCreateLanguage(this.resource,this.languageService,this.preferredLanguageId,e);this.textEditorModel.setLanguage(t)}setLanguageId(e,t){super.setLanguageId(e,t),this.preferredLanguageId=e}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.inOrphanMode});const i=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh});return{meta:t,content:i}}async revert(e){if(!this.isResolved())return;const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Zi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),vs("code/willResolveTextFileEditorModel"),this.isDisposed()){this.trace("resolve() - exit - without resolving because model is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because model is dirty or being saved");return}await this.doResolve(e),vs("code/didResolveTextFileEditorModel")}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents,e);if(!(!this.isResolved()&&await this.resolveFromBackup(e)))return this.resolveFromFile(e)}async resolveFromBuffer(e,t){this.trace("resolveFromBuffer()");let i,s,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,s=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),s=Date.now(),o=0,r=zv,this.setOrphaned(c.fileOperationResult===Zi.FILE_NOT_FOUND)}const a=await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding);this.resolveFromContent({resource:this.resource,name:this.name,mtime:i,ctime:s,size:o,etag:r,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Rh;return t&&(i=(await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding)).encoding),!this.isResolved()?t?(await this.doResolveFromBackup(t,i,e),!0):!1:(this.trace("resolveFromBackup() - exit - without resolving because previously new model got created meanwhile"),!0)}async doResolveFromBackup(e,t,i){this.trace("doResolveFromBackup()"),this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:await tNe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Rh})),encoding:t,readonly:!1,locked:!1},!0,i),e.meta?.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile,i=this.isResolved()||e?.allowBinary;let s;t?s=zv:this.lastResolvedFileStat&&(s=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:s,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),o!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(r,!1,e)}catch(r){const a=r.fileOperationResult;if(this.setOrphaned(a===Zi.FILE_NOT_FOUND),this.isResolved()&&a===Zi.FILE_NOT_MODIFIED_SINCE){r instanceof P$&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Zi.FILE_NOT_FOUND&&!t)return;throw r}}resolveFromContent(e,t,i){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because model is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0});const s=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):s!==this.contentEncoding&&this._onDidChangeEncoding.fire(),this.textEditorModel?this.doUpdateTextModel(e.value):this.doCreateTextModel(e.resource,e.value),this.setDirty(!!t),this._onDidResolve.fire(i?.reason??Zte.OTHER)}doCreateTextModel(e,t){this.trace("doCreateTextModel()");const i=this.createTextEditorModel(t,e,this.preferredLanguageId);this.installModelListeners(i),this.autoDetectLanguage()}doUpdateTextModel(e){this.trace("doUpdateTextModel()"),this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(e,this.preferredLanguageId)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onDidChangeLanguage(()=>this.onMaybeShouldChangeEncoding())),super.installModelListeners(e)}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastModelContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.getAlternativeVersionId()===this.bufferSavedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire(),this.autoDetectLanguage()}async autoDetectLanguage(){await this.extensionService?.whenInstalledExtensionsRegistered();const e=this.getLanguageId();if(this.resource.scheme===this.pathService.defaultUriScheme&&(!e||e===Yc)&&!this.resourceHasExtension)return super.autoDetectLanguage()}async forceResolveFromFile(){this.isDisposed()||await this.textFileService.files.resolve(this.resource,{reload:{async:!1},forceReadFromFile:!0})}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.bufferSavedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.updateSavedVersionId()),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.bufferSavedVersionId=o}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(uu.CONFLICT)||this.hasState(uu.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for model that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(uu.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.textEditorModel.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastModelContentChangeFromUndoRedo;r{try{const r=await this.textFileService.write(s.resource,o.createSnapshot(),{mtime:s.mtime,encoding:this.getEncoding(),etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource,o.getLanguageId())?zv:s.etag,unlock:e.writeUnlock,writeElevated:e.writeElevated});this.handleSaveSuccess(r,t,e)}catch(r){this.handleSaveError(r,t,e)}})())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[text file model] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString()]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Zi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.textFileService.files.saveErrorHandler.onSaveError(e,this,i),this._onDidSaveError.fire()}updateSavedVersionId(){this.isResolved()&&(this.bufferSavedVersionId=this.textEditorModel.getAlternativeVersionId())}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}hasState(e){switch(e){case uu.CONFLICT:return this.inConflictMode;case uu.DIRTY:return this.dirty;case uu.ERROR:return this.inErrorMode;case uu.ORPHAN:return this.inOrphanMode;case uu.PENDING_SAVE:return this.saveSequentializer.isRunning();case uu.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}async onMaybeShouldChangeEncoding(){if(this.hasEncodingSetExplicitly){this.trace("onMaybeShouldChangeEncoding() - ignoring because encoding was set explicitly");return}if(this.contentEncoding===dE||this.contentEncoding===OF||this.contentEncoding===BF){this.trace("onMaybeShouldChangeEncoding() - ignoring because content encoding has a BOM");return}const{encoding:e}=await this.textFileService.encoding.getPreferredReadEncoding(this.resource);if(typeof e!="string"||!this.isNewEncoding(e)){this.trace(`onMaybeShouldChangeEncoding() - ignoring because preferred encoding ${e} is not new`);return}if(this.isDirty()){this.trace("onMaybeShouldChangeEncoding() - ignoring because model is dirty");return}return this.logService.info(`Adjusting encoding based on configured language override to '${e}' for ${this.resource.toString(!0)}.`),this.setEncodingInternal(e,Z7.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Z7.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:W3.TEXTFILE_SAVE_ENCODING_SOURCE});else{if(!this.isNewEncoding(e))return;this.isDirty()&&!this.inConflictMode&&await this.save(),this.updatePreferredEncoding(e),await this.forceResolveFromFile()}}updatePreferredEncoding(e){this.isNewEncoding(e)&&(this.preferredEncoding=e,this._onDidChangeEncoding.fire())}isNewEncoding(e){return!(this.preferredEncoding===e||!this.preferredEncoding&&this.contentEncoding===e)}getEncoding(){return this.preferredEncoding||this.contentEncoding}trace(e){this.logService.trace(`[text file model] ${e}`,this.resource.toString())}isResolved(){return!!this.textEditorModel}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,super.dispose()}},W3=j0,j0.TEXTFILE_SAVE_ENCODING_SOURCE=ote.registerSource("textFileEncoding.source",g(c8t,0,"File Encoding Changed")),j0.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,j0);vDe=W3=D([_(3,Di),_(4,Ai),_(5,ci),_(6,tr),_(7,MQ),_(8,Ze),_(9,Pw),_(10,hh),_(11,eo),_(12,LQ),_(13,Ur),_(14,Tm),_(15,ho)],vDe);const l8t="vs/workbench/services/textfile/common/textFileSaveParticipant";let wDe=class extends ${constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=ORe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(l8t,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.textEditorModel?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||!e.textEditorModel)break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.error(a)}}e.textEditorModel?.pushStackElement()},()=>{s.cancel()}).finally(()=>{s.dispose()})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};wDe=D([_(0,Cf),_(1,Ze)],wDe);const d8t="vs/workbench/services/textfile/common/textFileEditorModelManager";let bDe=class extends ${get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,s,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=s,this.uriIdentityService=o,this._onDidCreate=this._register(new I({leakWarningThreshold:500})),this.onDidCreate=this._onDidCreate.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidRemove=this._register(new I),this.onDidRemove=this._onDidRemove.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this.mapResourceToModel=new wi,this.mapResourceToModelListeners=new wi,this.mapResourceToDisposeListener=new wi,this.mapResourceToPendingModelResolvers=new wi,this.modelResolveQueue=this._register(new oMe),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(d8t,0,"Failed to save '{0}': {1}",c.name,Ma(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(wDe)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onDidChangeFileSystemProviderCapabilities(e))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onDidChangeFileSystemProviderRegistrations(e))),this._register(this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e=>this.onWillRunWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e=>this.onDidFailWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e=>this.onDidRunWorkingCopyFileOperation(e)))}onDidFilesChange(e){for(const t of this.models)t.isDirty()||e.contains(t.resource,Ko.UPDATED,Ko.ADDED)&&this.queueModelReload(t)}onDidChangeFileSystemProviderCapabilities(e){this.queueModelReloads(e.scheme)}onDidChangeFileSystemProviderRegistrations(e){e.added&&this.queueModelReloads(e.scheme)}queueModelReloads(e){for(const t of this.models)t.isDirty()||e===t.resource.scheme&&this.queueModelReload(t)}queueModelReload(e){this.modelResolveQueue.queueSize(e.resource)<=1&&this.modelResolveQueue.queueFor(e.resource,async()=>{try{await this.reload(e)}catch(i){bt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=[];for(const{source:i,target:s}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,s))continue;const o=[];for(const r of this.models)this.uriIdentityService.extUri.isEqualOrParent(r.resource,i)&&o.push(r);for(const r of o){const a=r.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=s:c=Qt(s,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:r.getLanguageId(),encoding:r.getEncoding(),snapshot:r.isDirty()?r.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),t.forEach(i=>{i.snapshot&&this.get(i.source)?.setDirty(!0)}))}}onDidRunWorkingCopyFileOperation(e){switch(e.operation){case Li.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Li.MOVE:case Li.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await ko.settled(t.map(async i=>{const s=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(s,{reload:{async:!1},contents:i.snapshot?fQ(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Yc&&o.getLanguageId()===Yc&&uz(s)!==Gje&&o.updateTextEditorModel(void 0,i.languageId)})))})());break}}get(e){return this.mapResourceToModel.get(e)}has(e){return this.mapResourceToModel.has(e)}async reload(e){await this.joinPendingResolves(e.resource),!(e.isDirty()||e.isDisposed()||!this.has(e.resource))&&await this.doResolve(e,{reload:{async:!1}})}async resolve(e,t){const i=this.joinPendingResolves(e);return i&&await i,this.doResolve(e,t)}async doResolve(e,t){let i,s;P.isUri(e)?(s=e,i=this.get(s)):(s=e.resource,i=e);let o,r=!1;if(i)t?.contents?o=i.resolve(t):t?.reload?t.reload.async?(o=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){bt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(vDe,s,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(s,o),this.add(s,i),r&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await o}catch(a){throw r&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(s)}return t?.languageId&&i.setLanguageId(t.languageId),r&&i.isDirty()&&this._onDidChangeDirty.fire(i),i}joinPendingResolves(e){if(this.mapResourceToPendingModelResolvers.get(e))return this.doJoinPendingResolves(e)}async doJoinPendingResolves(e){let t;for(;this.mapResourceToPendingModelResolvers.has(e);){const i=this.mapResourceToPendingModelResolvers.get(e);if(i===t)return;t=i;try{await i}catch{}}}registerModel(e){const t=new Z;t.add(e.onDidResolve(i=>this._onDidResolve.fire({model:e,reason:i}))),t.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire(e))),t.add(e.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire(e))),t.add(e.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire(e))),t.add(e.onDidSaveError(()=>this._onDidSaveError.fire(e))),t.add(e.onDidSave(i=>this._onDidSave.fire({model:e,...i}))),t.add(e.onDidRevert(()=>this._onDidRevert.fire(e))),t.add(e.onDidChangeEncoding(()=>this._onDidChangeEncoding.fire(e))),this.mapResourceToModelListeners.set(e.resource,t)}add(e,t){if(this.mapResourceToModel.get(e)===t)return;this.mapResourceToDisposeListener.get(e)?.dispose(),this.mapResourceToModel.set(e,t),this.mapResourceToDisposeListener.set(e,t.onWillDispose(()=>this.remove(e)))}remove(e){const t=this.mapResourceToModel.delete(e),i=this.mapResourceToDisposeListener.get(e);i&&(St(i),this.mapResourceToDisposeListener.delete(e));const s=this.mapResourceToModelListeners.get(e);s&&(St(s),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}canDispose(e){return e.isDisposed()||!this.mapResourceToPendingModelResolvers.has(e.resource)&&!e.isDirty()?!0:this.doCanDispose(e)}async doCanDispose(e){const t=this.joinPendingResolves(e.resource);return t?(await t,this.canDispose(e)):e.isDirty()?(await T.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),St(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),St(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};bDe=D([_(0,be),_(1,ci),_(2,Pi),_(3,fC),_(4,_o)],bDe);var vX;const Om="vs/workbench/services/textfile/browser/textFileService";var K0;let CDe=(K0=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=s,this.modelService=o,this.environmentService=r,this.dialogService=a,this.fileDialogService=c,this.textResourceConfigurationService=l,this.filesConfigurationService=d,this.codeEditorService=h,this.pathService=u,this.workingCopyFileService=f,this.uriIdentityService=p,this.languageService=m,this.logService=v,this.elevatedFileService=w,this.decorationsService=b,this.files=this._register(this.instantiationService.createInstance(bDe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends ${constructor(t){super(),this.files=t,this.label=g(Om,2,"Text File Model Decorations"),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.registerListeners()}registerListeners(){this._register(this.files.onDidResolve(({model:t})=>{(t.isReadonly()||t.hasState(uu.ORPHAN))&&this._onDidChange.fire([t.resource])})),this._register(this.files.onDidRemove(t=>this._onDidChange.fire([t]))),this._register(this.files.onDidChangeReadonly(t=>this._onDidChange.fire([t.resource]))),this._register(this.files.onDidChangeOrphaned(t=>this._onDidChange.fire([t.resource])))}provideDecorations(t){const i=this.files.get(t);if(!i||i.isDisposed())return;const s=i.isReadonly(),o=i.hasState(uu.ORPHAN);if(s&&o)return{color:pWe,letter:Ce.lockSmall,strikethrough:!0,tooltip:g(Om,3,"Deleted, Read-only")};if(s)return{letter:Ce.lockSmall,tooltip:g(Om,4,"Read-only")};if(o)return{color:pWe,strikethrough:!0,tooltip:g(Om,5,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(yDe))),this._encoding}async read(e,t){const[i,s]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:s.detected.encoding||Rh,value:await fMe(s.stream,o=>o.join(""))}}async readStream(e,t){const[i,s]=await this.doRead(e,t);return{...i,encoding:s.detected.encoding||Rh,value:await tNe(s.stream)}}async doRead(e,t){const i=new ai;let s;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);s={...o,value:aQ(o.value)}}else s=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,s.value,t);return[s,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===Nne.STREAM_IS_BINARY?new GOt(g(Om,6,"File seems to be binary and cannot be opened as text"),xV.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async s=>{const o=await this.getEncodedReadable(s.resource,s.value);return{resource:s.resource,contents:o,overwrite:s.options?.overwrite}}));return this.workingCopyFileService.create(i,qe.None,t)}async write(e,t,i){const s=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,s,i):this.fileService.writeFile(e,s,i)}async getEncodedReadable(e,t,i){const{encoding:s,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(s===Rh&&!o)return typeof t>"u"?void 0:jOt(t);t=t||"";const r=typeof t=="string"?QOt(t):t;return Z$t(r,s,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return X$t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),overwriteEncoding:async s=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,s??void 0);return o}})}async save(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i){let s;if(i.hasAssociatedFilePath?s=await this.suggestSavePath(e):s=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),s)return this.saveAs(e,s,t)}}else{const i=this.files.get(e);if(i)return await i.save(t)?e:void 0}}async saveAs(e,t,i){if(t||(t=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(i?.suggestedTarget??e),i?.availableFileSystems)),!!t){if(this.filesConfigurationService.isReadonly(t))if(await this.confirmMakeWriteable(t))this.filesConfigurationService.updateReadonly(t,!1);else return;return _n(e,t)?this.save(e,{...i,force:!0}):this.fileService.hasProvider(e)&&this.uriIdentityService.extUri.isEqual(e,t)&&await this.fileService.exists(e)?(await this.workingCopyFileService.move([{file:{source:e,target:t}}],qe.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let s=!1;const o=this.files.get(e);if(o?.isResolved())s=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),s=!0;else{const r=this.modelService.getModel(e);r&&(s=await this.doSaveAsTextFile(r,e,t,i))}if(s){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,s){let o;const r=e;typeof r.getEncoding=="function"&&(o=r.getEncoding());let a=!1,c=this.files.get(i);if(c?.isResolved())a=!0;else{a=await this.fileService.exists(i),a||await this.create([{resource:i,value:""}]);try{c=await this.files.resolve(i,{encoding:o})}catch(u){if(a&&(u.textFileOperationResult===xV.FILE_IS_BINARY||u.fileOperationResult===Zi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,s);throw u}}let l;if(e instanceof _De&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,R9(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof H1?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(o),this.modelService.updateModel(h,fQ(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Yc&&f===Yc&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return s?.source||(s={...s,source:a?vX.TEXTFILE_SAVE_REPLACE_SOURCE:vX.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...s,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Om,7,"'{0}' already exists. Do you want to replace it?",ui(e)),detail:g(Om,8,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",ui(e),ui(ma(e))),primaryButton:g(Om,9,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Om,10,"'{0}' is marked as read-only. Do you want to save anyway?",ui(e)),detail:g(Om,11,"Paths can be configured as read-only via settings."),primaryButton:g(Om,12,"&&Save Anyway")});return t}async suggestSavePath(e){if(this.fileService.hasProvider(e))return e;const t=this.environmentService.remoteAuthority,i=await this.fileDialogService.defaultFilePath();let s;if(e.scheme===_e.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return R9(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(Qt(i,o.name),o.name)?r=o.name:r=ui(e);const a=o.getLanguageId();a&&a!==Yc?s=this.suggestFilename(a,r):s=r}}return s||(s=ui(e)),Qt(i,s)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const s=T_(t),o=this.languageService.getExtensions(e);if(o.includes(s))return t;const r=k_(o);if(r)return s?`${t.substring(0,t.indexOf(s))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:k_(a)??t}async revert(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i)return i.revert(t)}else{const i=this.files.get(e);if(i&&(i.isDirty()||t?.force))return i.revert(t)}}isDirty(e){const t=e.scheme===_e.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},vX=K0,K0.TEXTFILE_SAVE_CREATE_SOURCE=ote.registerSource("textFileCreate.source",g(Om,0,"File Created")),K0.TEXTFILE_SAVE_REPLACE_SOURCE=ote.registerSource("textFileOverwrite.source",g(Om,1,"File Replaced")),K0);CDe=vX=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,ec),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,jt),_(11,Tm),_(12,fC),_(13,_o),_(14,Di),_(15,Ze),_(16,IQ),_(17,rD)],CDe);let yDe=class extends ${get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,s){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=s,this._encodingOverrides=this.getDefaultEncodingOverrides(),this.registerListeners()}registerListeners(){this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.encodingOverrides=this.getDefaultEncodingOverrides()))}getDefaultEncodingOverrides(){const e=[];return e.push({parent:this.environmentService.userRoamingDataHome,encoding:Rh}),e.push({extension:qb,encoding:Rh}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Rh}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Qt(t.uri,".vscode"),encoding:Rh})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:s}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:s}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===OF||i===BF||i===dE}}async getPreferredReadEncoding(e,t,i){let s;t?.encoding?i===dE&&t.encoding===Rh?s=dE:s=t.encoding:typeof i=="string"?s=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===dE&&(s=Rh);const o=await this.getEncodingForResource(e,s);return{encoding:o,hasBOM:o===OF||o===BF||o===dE}}async getEncodingForResource(e,t){let i;const s=this.getEncodingOverride(e);return s?i=s:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Rh&&(!i||!await e8t(i))&&(i=Rh),i}getEncodingOverride(e){if(this.encodingOverrides?.length){for(const t of this.encodingOverrides)if(t.parent&&this.uriIdentityService.extUri.isEqualOrParent(e,t.parent)||t.extension&&uz(e)===`.${t.extension}`)return t.encoding}}};yDe=D([_(0,dl),_(1,ec),_(2,Ti),_(3,_o)],yDe);let SDe=class extends CDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,w,v,b),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(uu.PENDING_SAVE))}};SDe=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,ec),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,jt),_(11,Tm),_(12,fC),_(13,_o),_(14,Di),_(15,IQ),_(16,Ze),_(17,rD)],SDe);var IC,DP;let ADe=(DP=class extends ${constructor(e,t,i,s){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=s,this._onExpressionChange=this._register(new I),this.onExpressionChange=this._onExpressionChange.event,this.mapFolderToParsedExpression=new Map,this.mapFolderToConfiguredExpression=new Map,this.updateExpressions(!1),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{this.shouldUpdate(e)&&this.updateExpressions(!0)})),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateExpressions(!0)))}updateExpressions(e){let t=!1;for(const r of this.contextService.getWorkspace().folders){const a=r.uri.toString(),c=this.doGetExpression(r.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Io(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,_w(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new o1(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==IC.NO_FOLDER&&(i.has(P.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const s=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER);s?(!o||!Io(o.expression,s.expression))&&(t=!0,this.mapFolderToParsedExpression.set(IC.NO_FOLDER,_w(s.expression)),this.mapFolderToConfiguredExpression.set(IC.NO_FOLDER,s)):o&&(t=!0,this.mapFolderToParsedExpression.delete(IC.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(IC.NO_FOLDER)),e&&t&&this._onExpressionChange.fire()}doGetExpression(e){const t=this.getExpression(e);if(!t)return;const i=Object.keys(t);if(i.length===0)return;let s=!1;const o=Object.create(null);for(const r of i){s||(s=oF(r));let a=r;const c=$ht(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:s}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let s,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(s=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(s=this.mapFolderToParsedExpression.get(IC.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER)),!s)return!1;let r;return i?r=lO(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&s(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!s(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.path}},IC=DP,DP.NO_FOLDER=null,DP);ADe=IC=D([_(2,Ti),_(3,Re)],ADe);var Kw;const F5="vs/workbench/services/filesConfiguration/common/filesConfigurationService",h8t=new Y("autoSaveAfterShortDelayContext",!1,!0);var Vc;(function(n){n[n.OFF=0]="OFF",n[n.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",n[n.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",n[n.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",n[n.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(Vc||(Vc={}));var Kf;(function(n){n[n.SETTINGS=1]="SETTINGS",n[n.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",n[n.ERRORS=3]="ERRORS",n[n.DISABLED=4]="DISABLED"})(Kf||(Kf={}));var nx;let EDe=(nx=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=s,this.uriIdentityService=o,this.fileService=r,this.markerService=a,this.textResourceConfigurationService=c,this._onDidChangeAutoSaveConfiguration=this._register(new I),this.onDidChangeAutoSaveConfiguration=this._onDidChangeAutoSaveConfiguration.event,this._onDidChangeAutoSaveDisabled=this._register(new I),this.onDidChangeAutoSaveDisabled=this._onDidChangeAutoSaveDisabled.event,this._onDidChangeFilesAssociation=this._register(new I),this.onDidChangeFilesAssociation=this._onDidChangeFilesAssociation.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.autoSaveConfigurationCache=new L_(1e3),this.autoSaveDisabledOverrides=new wi,this.autoSaveAfterShortDelayContext=h8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new Ive(()=>this.createReadonlyMatcher(wJe))),this.readonlyExcludeMatcher=this._register(new Ive(()=>this.createReadonlyMatcher(bJe))),this.sessionReadonlyOverrides=new wi(d=>this.uriIdentityService.extUri.getComparisonKey(d));const l=t.getValue();this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,l.files),this.currentFilesAssociationConfiguration=l?.files?.associations,this.currentHotExitConfiguration=l?.files?.hotExit||Ng.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new ADe(i=>this.configurationService.getValue(e,{resource:i}),i=>i.affectsConfiguration(e),this.contextService,this.configurationService));return this._register(t.onExpressionChange(()=>this._onDidChangeReadonly.fire())),t}isReadonly(e,t){const i=this.fileService.getProvider(e.scheme);if(i&&GEt(i))return i.readOnlyMessage??Kw.READONLY_MESSAGES.providerReadonly;const s=this.sessionReadonlyOverrides.get(e);return typeof s=="boolean"?s===!0?Kw.READONLY_MESSAGES.sessionReadonly:!1:this.uriIdentityService.extUri.isEqualOrParent(e,this.environmentService.userRoamingDataHome)||this.uriIdentityService.extUri.isEqual(e,this.contextService.getWorkspace().configuration??void 0)?!1:this.readonlyIncludeMatcher.value.matches(e)?this.readonlyExcludeMatcher.value.matches(e)?!1:Kw.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Kw.READONLY_MESSAGES.fileLocked:t?.readonly?Kw.READONLY_MESSAGES.fileReadonly:!1}async updateReadonly(e,t){if(t==="toggle"){let i;try{i=await this.fileService.resolve(e,{resolveMetadata:!0})}catch{}t=!this.isReadonly(e,i)}t==="reset"?this.sessionReadonlyOverrides.delete(e):this.sessionReadonlyOverrides.set(e,t),this._onDidChangeReadonly.fire()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("files")&&this.onFilesConfigurationChange(this.configurationService.getValue(),!0)}))}onFilesConfigurationChange(e,t){this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,e.files),this.autoSaveConfigurationCache.clear(),this.autoSaveAfterShortDelayContext.set(this.getAutoSaveMode(void 0).mode===Vc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Io(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const s=e?.files?.hotExit;s===Ng.OFF||s===Ng.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=s:this.currentHotExitConfiguration=Ng.ON_EXIT;const o=!!e?.files?.readonlyFromPermissions;o!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=o,t&&this._onDidChangeReadonly.fire())}getAutoSaveConfiguration(e){const t=this.toResource(e);if(t){let i=this.autoSaveConfigurationCache.get(t);return i||(i=this.computeAutoSaveConfiguration(t,this.textResourceConfigurationService.getValue(t,"files")),this.autoSaveConfigurationCache.set(t,i)),i}return this.currentGlobalAutoSaveConfiguration}computeAutoSaveConfiguration(e,t){let i,s,o,r,a,c;switch(t.autoSave??Kw.DEFAULT_AUTO_SAVE_MODE){case $l.AFTER_DELAY:{i="afterDelay",s=typeof t.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Kw.DEFAULT_AUTO_SAVE_DELAY,c=s<=Kw.DEFAULT_AUTO_SAVE_DELAY;break}case $l.ON_FOCUS_CHANGE:i="onFocusChange";break;case $l.ON_WINDOW_CHANGE:i="onWindowChange";break}return t.autoSaveWorkspaceFilesOnly===!0&&(o=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t.autoSaveWhenNoErrors===!0&&(r=!0,c=void 0),{autoSave:i,autoSaveDelay:s,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof cC?jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}):e}hasShortAutoSaveDelay(e){const t=this.toResource(e);return this.getAutoSaveConfiguration(t).isShortAutoSaveDelay?!t||!this.autoSaveDisabledOverrides.has(t):!1}getAutoSaveMode(e,t){const i=this.toResource(e);if(i&&this.autoSaveDisabledOverrides.has(i))return{mode:Vc.OFF,reason:Kf.DISABLED};const s=this.getAutoSaveConfiguration(i);if(typeof s.autoSave>"u")return{mode:Vc.OFF,reason:Kf.SETTINGS};if(typeof t=="number"&&(s.autoSave==="afterDelay"&&t!==Ln.AUTO||s.autoSave==="onFocusChange"&&t!==Ln.FOCUS_CHANGE&&t!==Ln.WINDOW_CHANGE||s.autoSave==="onWindowChange"&&t!==Ln.WINDOW_CHANGE))return{mode:Vc.OFF,reason:Kf.SETTINGS};if(i){if(s.autoSaveWorkspaceFilesOnly&&s.isOutOfWorkspace)return{mode:Vc.OFF,reason:Kf.OUT_OF_WORKSPACE};if(s.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ys.Error}).length>0)return{mode:Vc.OFF,reason:Kf.ERRORS}}switch(s.autoSave){case"afterDelay":return typeof s.autoSaveDelay=="number"&&s.autoSaveDelay<=Kw.DEFAULT_AUTO_SAVE_DELAY?{mode:s.autoSaveWhenNoErrors?Vc.AFTER_LONG_DELAY:Vc.AFTER_SHORT_DELAY}:{mode:Vc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:Vc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:Vc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE].some(i=>i===e)?t=$l.OFF:t=$l.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return $.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const s=this.autoSaveDisabledOverrides.get(t)??0;s<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,s-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Ng.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Kw=nx,nx.DEFAULT_AUTO_SAVE_MODE=Jn?$l.AFTER_DELAY:$l.OFF,nx.DEFAULT_AUTO_SAVE_DELAY=1e3,nx.READONLY_MESSAGES={providerReadonly:{value:g(F5,0,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(F5,1,"Editor is read-only because the file was set read-only in this session. [Click here](command:{0}) to set writeable.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},configuredReadonly:{value:g(F5,2,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure.",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`),isTrusted:!0},fileLocked:{value:g(F5,3,"Editor is read-only because of file permissions. [Click here](command:{0}) to set writeable anyway.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},fileReadonly:{value:g(F5,4,"Editor is read-only because the file is read-only."),isTrusted:!0}},nx);EDe=Kw=D([_(0,Pe),_(1,Re),_(2,Ti),_(3,Il),_(4,_o),_(5,ci),_(6,U_),_(7,dl)],EDe);class u8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const dn="vs/workbench/contrib/files/browser/files.contribution",lOe=it.as(Cs.Configuration),g8t=rf?{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,1,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`"),g(dn,2,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it's the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,4,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)};lOe.registerConfiguration({id:"files",order:9,title:g(dn,5,"Files"),type:"object",properties:{[qEt]:{type:"object",markdownDescription:g(dn,6,"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."),default:{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,...Jn?{"**/*.crswap":!0}:void 0},scope:ut.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(dn,7,"Enable the pattern."),g(dn,8,"Disable the pattern.")],description:g(dn,9,"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.")},{type:"object",properties:{when:{type:"string",pattern:"\\w*\\$\\(basename\\)\\w*",default:"$(basename).ext",markdownDescription:g(dn,10,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[ANe]:{type:"object",markdownDescription:g(dn,11,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `"*.extension": "html"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed.'),additionalProperties:{type:"string"}},"files.encoding":{type:"string",enum:Object.keys(P5),default:"utf8",description:g(dn,12,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:ut.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(P5).map(n=>P5[n].labelLong),enumItemLabels:Object.keys(P5).map(n=>P5[n].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(dn,13,"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.","`#files.encoding#`"),scope:ut.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` +`+g(935,'Example: `"**/static/**/*.html": "${filename} - ${dirname} (${extname})"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.'),t})(),additionalProperties:{type:["string","null"],markdownDescription:g(936,"The template which should be rendered when the pattern matches. May include the variables ${dirname}, ${filename} and ${extname}."),minLength:1,pattern:".*[a-zA-Z0-9].*"},default:{}},"workbench.editor.labelFormat":{type:"string",enum:["default","short","medium","long"],enumDescriptions:[g(937,"Show the name of the file. When tabs are enabled and two files have the same name in one group the distinguishing sections of each file's path are added. When tabs are disabled, the path relative to the workspace folder is shown if the editor is active."),g(938,"Show the name of the file followed by its directory name."),g(939,"Show the name of the file followed by its path relative to the workspace folder."),g(940,"Show the name of the file followed by its absolute path.")],default:"default",description:g(941,"Controls the format of the label for an editor.")},"workbench.editor.untitled.labelFormat":{type:"string",enum:["content","name"],enumDescriptions:[g(942,"The name of the untitled file is derived from the contents of its first line unless it has an associated file path. It will fallback to the name in case the line is empty or contains no word characters."),g(943,"The name of the untitled file is not derived from the contents of the file.")],default:"content",description:g(944,"Controls the format of the label for an untitled editor.")},"workbench.editor.empty.hint":{type:"string",enum:["text","hidden"],default:"text",markdownDescription:g(945,"Controls if the empty editor text hint should be visible in the editor.")},"workbench.editor.languageDetection":{type:"boolean",default:!0,description:g(946,"Controls whether the language in a text editor is automatically detected unless the language has been explicitly set by the language picker. This can also be scoped by language so you can specify which languages you do not want to be switched off of. This is useful for languages like Markdown that often contain other languages that might trick language detection into thinking it's the embedded language and not Markdown."),scope:at.LANGUAGE_OVERRIDABLE},"workbench.editor.historyBasedLanguageDetection":{type:"boolean",default:!0,tags:["experimental"],description:g(947,"Enables use of editor history in language detection. This causes automatic language detection to favor languages that have been recently opened and allows for automatic language detection to operate with smaller inputs.")},"workbench.editor.preferHistoryBasedLanguageDetection":{type:"boolean",default:!1,tags:["experimental"],description:g(948,"When enabled, a language detection model that takes into account editor history will be given higher precedence.")},"workbench.editor.languageDetectionHints":{type:"object",default:{untitledEditors:!0,notebookEditors:!0},tags:["experimental"],description:g(949,"When enabled, shows a Status bar Quick Fix when the editor language doesn't match detected content language."),additionalProperties:!1,properties:{untitledEditors:{type:"boolean",description:g(950,"Show in untitled text editors")},notebookEditors:{type:"boolean",description:g(951,"Show in notebook editors")}}},"workbench.editor.tabActionLocation":{type:"string",enum:["left","right"],default:"right",markdownDescription:g(952,"Controls the position of the editor's tabs action buttons (close, unpin). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabActionCloseVisibility":{type:"boolean",default:!0,description:g(953,"Controls the visibility of the tab close action button.")},"workbench.editor.tabActionUnpinVisibility":{type:"boolean",default:!0,description:g(954,"Controls the visibility of the tab unpin action button.")},"workbench.editor.tabSizing":{type:"string",enum:["fit","shrink","fixed"],default:"fit",enumDescriptions:[g(955,"Always keep tabs large enough to show the full editor label."),g(956,"Allow tabs to get smaller when the available space is not enough to show all tabs at once."),g(957,"Make all tabs the same size, while allowing them to get smaller when the available space is not enough to show all tabs at once.")],markdownDescription:g(958,"Controls the size of editor tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabSizingFixedMinWidth":{type:"number",default:50,minimum:38,markdownDescription:g(959,"Controls the minimum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"workbench.editor.tabSizingFixedMaxWidth":{type:"number",default:160,minimum:38,markdownDescription:g(960,"Controls the maximum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"window.density.editorTabHeight":{type:"string",enum:["default","compact"],default:"default",markdownDescription:g(961,"Controls the height of editor tabs. Also applies to the title control bar when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabSizing":{type:"string",enum:["normal","compact","shrink"],default:"normal",enumDescriptions:[g(962,"A pinned tab inherits the look of non pinned tabs."),g(963,"A pinned tab will show in a compact form with only icon or first letter of the editor name."),g(964,"A pinned tab shrinks to a compact fixed size showing parts of the editor name.")],markdownDescription:g(965,"Controls the size of pinned editor tabs. Pinned tabs are sorted to the beginning of all opened tabs and typically do not close until unpinned. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabsOnSeparateRow":{type:"boolean",default:!1,markdownDescription:g(966,"When enabled, displays pinned tabs in a separate row above all other tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.preventPinnedEditorClose":{type:"string",enum:["keyboardAndMouse","keyboard","mouse","never"],default:"keyboardAndMouse",enumDescriptions:[g(967,"Always prevent closing the pinned editor when using mouse middle click or keyboard."),g(968,"Prevent closing the pinned editor when using the keyboard."),g(969,"Prevent closing the pinned editor when using mouse middle click."),g(970,"Never prevent closing a pinned editor.")],description:g(971,"Controls whether pinned editors should close when keyboard or middle mouse click is used for closing.")},"workbench.editor.splitSizing":{type:"string",enum:["auto","distribute","split"],default:"auto",enumDescriptions:[g(972,"Splits the active editor group to equal parts, unless all editor groups are already in equal parts. In that case, splits all the editor groups to equal parts."),g(973,"Splits all the editor groups to equal parts."),g(974,"Splits the active editor group to equal parts.")],description:g(975,"Controls the size of editor groups when splitting them.")},"workbench.editor.splitOnDragAndDrop":{type:"boolean",default:!0,description:g(976,"Controls if editor groups can be split from drag and drop operations by dropping an editor or file on the edges of the editor area.")},"workbench.editor.dragToOpenWindow":{type:"boolean",default:!0,markdownDescription:g(977,"Controls if editors can be dragged out of the window to open them in a new window. Press and hold the `Alt` key while dragging to toggle this dynamically.")},"workbench.editor.focusRecentEditorAfterClose":{type:"boolean",description:g(978,"Controls whether editors are closed in most recently used order or from left to right."),default:!0},"workbench.editor.showIcons":{type:"boolean",description:g(979,"Controls whether opened editors should show with an icon or not. This requires a file icon theme to be enabled as well."),default:!0},"workbench.editor.enablePreview":{type:"boolean",description:g(980,"Controls whether opened editors show as preview editors. Preview editors do not stay open, are reused until explicitly set to be kept open (via double-click or editing), and show file names in italics."),default:!0},"workbench.editor.enablePreviewFromQuickOpen":{type:"boolean",markdownDescription:g(981,"Controls whether editors opened from Quick Open show as preview editors. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). When enabled, hold Ctrl before selection to open an editor as a non-preview. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.enablePreviewFromCodeNavigation":{type:"boolean",markdownDescription:g(982,"Controls whether editors remain in preview when a code navigation is started from them. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.closeOnFileDelete":{type:"boolean",description:g(983,"Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that editors with unsaved changes will never close to preserve your data."),default:!1},"workbench.editor.openPositioning":{type:"string",enum:["left","right","first","last"],default:"right",markdownDescription:g(984,"Controls where editors open. Select {0} or {1} to open editors to the left or right of the currently active one. Select {2} or {3} to open editors independently from the currently active one.","`left`","`right`","`first`","`last`")},"workbench.editor.openSideBySideDirection":{type:"string",enum:["right","down"],default:"right",markdownDescription:g(985,"Controls the default direction of editors that are opened side by side (for example, from the Explorer). By default, editors will open on the right hand side of the currently active one. If changed to `down`, the editors will open below the currently active one.")},"workbench.editor.closeEmptyGroups":{type:"boolean",description:g(986,"Controls the behavior of empty editor groups when the last tab in the group is closed. When enabled, empty groups will automatically close. When disabled, empty groups will remain part of the grid."),default:!0},"workbench.editor.revealIfOpen":{type:"boolean",description:g(987,"Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, such as when forcing an editor to open in a specific group or to the side of the currently active group."),default:!1},"workbench.editor.mouseBackForwardToNavigate":{type:"boolean",description:g(988,"Enables the use of mouse buttons four and five for commands 'Go Back' and 'Go Forward'."),default:!0},"workbench.editor.navigationScope":{type:"string",enum:["default","editorGroup","editor"],default:"default",markdownDescription:g(989,"Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),enumDescriptions:[g(990,"Navigate across all opened editors and editor groups."),g(991,"Navigate only in editors of the active editor group."),g(992,"Navigate only in the active editor.")]},"workbench.editor.restoreViewState":{type:"boolean",markdownDescription:g(993,"Restores the last editor view state (such as scroll position) when re-opening editors after they have been closed. Editor view state is stored per editor group and discarded when a group closes. Use the {0} setting to use the last known view state across all editor groups in case no previous view state was found for a editor group.","`#workbench.editor.sharedViewState#`"),default:!0,scope:at.LANGUAGE_OVERRIDABLE},"workbench.editor.sharedViewState":{type:"boolean",description:g(994,"Preserves the most recent editor view state (such as scroll position) across all editor groups and restores that if no specific editor view state is found for the editor group."),default:!1},"workbench.editor.splitInGroupLayout":{type:"string",enum:["vertical","horizontal"],default:"horizontal",markdownDescription:g(995,"Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),enumDescriptions:[g(996,"Editors are positioned from top to bottom."),g(997,"Editors are positioned from left to right.")]},"workbench.editor.centeredLayoutAutoResize":{type:"boolean",default:!0,description:g(998,"Controls if the centered layout should automatically resize to maximum width when more than one group is open. Once only one group is open it will resize back to the original centered width.")},"workbench.editor.centeredLayoutFixedWidth":{type:"boolean",default:!1,description:g(999,"Controls whether the centered layout tries to maintain constant width when the window is resized.")},"workbench.editor.doubleClickTabToToggleEditorGroupSizes":{type:"string",enum:["maximize","expand","off"],default:"expand",markdownDescription:g(1e3,"Controls how the editor group is resized when double clicking on a tab. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),enumDescriptions:[g(1001,"All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),g(1002,"The editor group takes as much space as possible by making all other editor groups as small as possible."),g(1003,"No editor group is resized when double clicking on a tab.")]},"workbench.editor.limit.enabled":{type:"boolean",default:!1,description:g(1004,"Controls if the number of opened editors should be limited or not. When enabled, less recently used editors will close to make space for newly opening editors.")},"workbench.editor.limit.value":{type:"number",default:10,exclusiveMinimum:0,markdownDescription:g(1005,"Controls the maximum number of opened editors. Use the {0} setting to control this limit per editor group or across all groups.","`#workbench.editor.limit.perEditorGroup#`")},"workbench.editor.limit.excludeDirty":{type:"boolean",default:!1,description:g(1006,"Controls if the maximum number of opened editors should exclude dirty editors for counting towards the configured limit.")},"workbench.editor.limit.perEditorGroup":{type:"boolean",default:!1,description:g(1007,"Controls if the limit of maximum opened editors should apply per editor group or across all editor groups.")},"workbench.localHistory.enabled":{type:"boolean",default:!0,description:g(1008,"Controls whether local file history is enabled. When enabled, the file contents of an editor that is saved will be stored to a backup location to be able to restore or review the contents later. Changing this setting has no effect on existing local file history entries."),scope:at.RESOURCE},"workbench.localHistory.maxFileSize":{type:"number",default:256,minimum:1,description:g(1009,"Controls the maximum size of a file (in KB) to be considered for local file history. Files that are larger will not be added to the local file history. Changing this setting has no effect on existing local file history entries."),scope:at.RESOURCE},"workbench.localHistory.maxFileEntries":{type:"number",default:50,minimum:0,description:g(1010,"Controls the maximum number of local file history entries per file. When the number of local file history entries exceeds this number for a file, the oldest entries will be discarded."),scope:at.RESOURCE},"workbench.localHistory.exclude":{type:"object",patternProperties:{".*":{type:"boolean"}},markdownDescription:g(1011,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files from the local file history. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Changing this setting has no effect on existing local file history entries."),scope:at.RESOURCE},"workbench.localHistory.mergeWindow":{type:"number",default:10,minimum:1,markdownDescription:g(1012,"Configure an interval in seconds during which the last entry in local file history is replaced with the entry that is being added. This helps reduce the overall number of entries that are added, for example when auto save is enabled. This setting is only applied to entries that have the same source of origin. Changing this setting has no effect on existing local file history entries."),scope:at.RESOURCE},"workbench.commandPalette.history":{type:"number",description:g(1013,"Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history."),default:50,minimum:0},"workbench.commandPalette.preserveInput":{type:"boolean",description:g(1014,"Controls whether the last typed input to the command palette should be restored when opening it the next time."),default:!1},"workbench.commandPalette.experimental.suggestCommands":{type:"boolean",tags:["experimental"],description:g(1015,"Controls whether the command palette should have a list of commonly used commands."),default:!1},"workbench.commandPalette.experimental.askChatLocation":{type:"string",tags:["experimental"],description:g(1016,"Controls where the command palette should ask chat questions."),default:"chatView",enum:["chatView","quickChat"],enumDescriptions:[g(1017,"Ask chat questions in the Chat view."),g(1018,"Ask chat questions in Quick Chat.")]},"workbench.commandPalette.experimental.enableNaturalLanguageSearch":{type:"boolean",tags:["experimental"],description:g(1019,"Controls whether the command palette should include similar commands. You must have an extension installed that provides Natural Language support."),default:!0},"workbench.quickOpen.closeOnFocusLost":{type:"boolean",description:g(1020,"Controls whether Quick Open should close automatically once it loses focus."),default:!0},"workbench.quickOpen.preserveInput":{type:"boolean",description:g(1021,"Controls whether the last typed input to Quick Open should be restored when opening it the next time."),default:!1},"workbench.settings.openDefaultSettings":{type:"boolean",description:g(1022,"Controls whether opening settings also opens an editor showing all default settings."),default:!1},"workbench.settings.useSplitJSON":{type:"boolean",markdownDescription:g(1023,"Controls whether to use the split JSON editor when editing settings as JSON."),default:!1},"workbench.settings.openDefaultKeybindings":{type:"boolean",description:g(1024,"Controls whether opening keybinding settings also opens an editor showing all default keybindings."),default:!1},"workbench.sideBar.location":{type:"string",enum:["left","right"],default:"left",description:g(1025,"Controls the location of the primary side bar and activity bar. They can either show on the left or right of the workbench. The secondary side bar will show on the opposite side of the workbench.")},"workbench.panel.defaultLocation":{type:"string",enum:["left","bottom","top","right"],default:"bottom",description:g(1026,"Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, top, right, or left of the editor area.")},"workbench.panel.opensMaximized":{type:"string",enum:["always","never","preserve"],default:"preserve",description:g(1027,"Controls whether the panel opens maximized. It can either always open maximized, never open maximized, or open to the last state it was in before being closed."),enumDescriptions:[g(1028,"Always maximize the panel when opening it."),g(1029,"Never maximize the panel when opening it. The panel will open un-maximized."),g(1030,"Open the panel to the state that it was in, before it was closed.")]},"workbench.statusBar.visible":{type:"boolean",default:!0,description:g(1031,"Controls the visibility of the status bar at the bottom of the workbench.")},[Jp.ACTIVITY_BAR_LOCATION]:{type:"string",enum:["default","top","bottom","hidden"],default:"default",markdownDescription:g(1032,"Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),enumDescriptions:[g(1033,"Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),g(1034,"Show the Activity Bar on top of the Primary and Secondary Side Bars."),g(1035,"Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),g(1036,"Hide the Activity Bar in the Primary and Secondary Side Bars.")]},"workbench.activityBar.iconClickBehavior":{type:"string",enum:["toggle","focus"],default:"toggle",markdownDescription:g(1037,"Controls the behavior of clicking an Activity Bar icon in the workbench. This value is ignored when {0} is not set to {1}.","`#workbench.activityBar.location#`","`default`"),enumDescriptions:[g(1038,"Hide the Primary Side Bar if the clicked item is already visible."),g(1039,"Focus the Primary Side Bar if the clicked item is already visible.")]},"workbench.view.alwaysShowHeaderActions":{type:"boolean",default:!1,description:g(1040,"Controls the visibility of view header actions. View header actions may either be always visible, or only visible when that view is focused or hovered over.")},"workbench.fontAliasing":{type:"string",enum:["default","antialiased","none","auto"],default:"default",description:g(1041,"Controls font aliasing method in the workbench."),enumDescriptions:[g(1042,"Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),g(1043,"Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),g(1044,"Disables font smoothing. Text will show with jagged sharp edges."),g(1045,"Applies `default` or `antialiased` automatically based on the DPI of displays.")],included:Qt},"workbench.settings.editor":{type:"string",enum:["ui","json"],enumDescriptions:[g(1046,"Use the settings UI editor."),g(1047,"Use the JSON file editor.")],description:g(1048,"Determines which settings editor to use by default."),default:"ui",scope:at.WINDOW},"workbench.hover.delay":{type:"number",description:g(1049,"Controls the delay in milliseconds after which the hover is shown for workbench items (ex. some extension provided tree view items). Already visible items may require a refresh before reflecting this setting change."),default:Qt?1500:500,minimum:0},"workbench.reduceMotion":{type:"string",description:g(1050,"Controls whether the workbench should render with fewer animations."),enumDescriptions:[g(1051,"Always render with reduced motion."),g(1052,"Do not render with reduced motion"),g(1053,"Render with reduced motion based on OS configuration.")],default:"auto",tags:["accessibility"],enum:["on","off","auto"]},[Jp.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Wn?g(1054,"Controls whether the layout control in the title bar is shown."):g(1055,"Controls whether the layout control is shown in the custom title bar. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"workbench.layoutControl.type":{type:"string",enum:["menu","toggles","both"],enumDescriptions:[g(1056,"Shows a single button with a dropdown of layout options."),g(1057,"Shows several buttons for toggling the visibility of the panels and side bar."),g(1058,"Shows both the dropdown and toggle buttons.")],default:"both",description:g(1059,"Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles.")},"workbench.tips.enabled":{type:"boolean",default:!0,description:g(1060,"When enabled, will show the watermark tips when no editor is open.")}}});let e=g(1061,"Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:");e+=` +- `+[g(1062,"`${activeEditorShort}`: the file name (e.g. myFile.txt)."),g(1063,"`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),g(1064,"`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)."),g(1065,"`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder)."),g(1066,"`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)."),g(1067,"`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)."),g(1068,"`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder)."),g(1069,"`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)."),g(1070,"`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace))."),g(1071,"`${rootNameShort}`: shortened name of the workspace without suffixes (e.g. myFolder, myRemoteFolder or myWorkspace)."),g(1072,"`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)."),g(1073,"`${profileName}`: name of the profile in which the workspace is opened (e.g. Data Science (Profile)). Ignored if default profile is used."),g(1074,"`${appName}`: e.g. VS Code."),g(1075,"`${remoteName}`: e.g. SSH"),g(1076,"`${dirty}`: an indicator for when the active editor has unsaved changes."),g(1077,"`${focusedView}`: the name of the view that is currently focused."),g(1078,"`${activeRepositoryName}`: the name of the active repository (e.g. vscode)."),g(1079,"`${activeRepositoryBranchName}`: the name of the active branch in the active repository (e.g. main)."),g(1080,'`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.')].join(` +- `),MK.registerConfiguration({...DXe,properties:{"window.title":{type:"string",default:uit,markdownDescription:e},"window.titleSeparator":{type:"string",default:git,markdownDescription:g(1081,"Separator used by {0}.","`#window.title#`")},[Jp.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Wn?g(1082,"Show command launcher together with the window title."):g(1083,"Show command launcher together with the window title. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"window.menuBarVisibility":{type:"string",enum:["classic","visible","toggle","hidden","compact"],markdownEnumDescriptions:[g(1084,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(1085,"Menu is always visible at the top of the window even in full screen mode."),Qt?g(1086,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(1087,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(1088,"Menu is always hidden."),Wn?g(1089,"Menu is displayed as a compact button in the side bar."):g(1090,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Wn?"compact":"classic",scope:at.APPLICATION,markdownDescription:Qt?g(1091,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and executing `Focus Application Menu` will show it. A setting of 'compact' will move the menu into the side bar."):g(1092,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. A setting of 'compact' will move the menu into the side bar."),included:Qn||pr||Wn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:at.APPLICATION,description:g(1093,"Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),included:Qn||pr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:at.APPLICATION,markdownDescription:g(1094,"Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),included:Qn||pr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(1095,"Files will open in a new window."),g(1096,"Files will open in the window with the files' folder open or the last active window."),Qt?g(1097,"Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder."):g(1098,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:at.APPLICATION,markdownDescription:g(Qt?1099:1100,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.openFoldersInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(1101,"Folders will open in a new window."),g(1102,"Folders will replace the last active window."),g(1103,"Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu).")],default:"default",scope:at.APPLICATION,markdownDescription:g(1104,"Controls whether folders should open in a new window or replace the last active window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.confirmBeforeClose":{type:"string",enum:["always","keyboardOnly","never"],enumDescriptions:[Wn?g(1105,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(1106,"Always ask for confirmation."),Wn?g(1107,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(1108,"Only ask for confirmation if a keybinding was used."),Wn?g(1109,"Never explicitly ask for confirmation unless data loss is imminent."):g(1110,"Never explicitly ask for confirmation.")],default:Wn&&!wGe()?"keyboardOnly":"never",markdownDescription:Wn?g(1111,"Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases."):g(1112,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:at.APPLICATION}}}),Qu(JJ.ID,JJ,yc.Eventually),MK.registerConfiguration({...FRt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(1113,"Controls whether the problems are visible throughout the editor and workbench.")}}}),MK.registerConfiguration({id:"zenMode",order:9,title:g(1114,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(1115,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(1116,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(1117,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(1118,"Each editor is displayed as a tab in the editor title area."),g(1119,"The active editor is displayed as a single large tab in the editor title area."),g(1120,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(1121,"Controls whether turning on Zen Mode also hides the status bar at the bottom of the workbench.")},"zenMode.hideActivityBar":{type:"boolean",default:!0,description:g(1122,"Controls whether turning on Zen Mode also hides the activity bar either at the left or right of the workbench.")},"zenMode.hideLineNumbers":{type:"boolean",default:!0,description:g(1123,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(1124,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(1125,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:s=>{const e=[];return s!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),s===!1&&e.push([Jp.ACTIVITY_BAR_LOCATION,{value:oee.HIDDEN}]),e}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:Jp.ACTIVITY_BAR_LOCATION,migrateFn:s=>{const e=[];return s==="side"&&e.push([Jp.ACTIVITY_BAR_LOCATION,{value:oee.DEFAULT}]),e}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:s}])),e}},{key:Jp.EDITOR_TABS_MODE,migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?PT.MULTIPLE:PT.SINGLE,e.push([Jp.EDITOR_TABS_MODE,{value:s}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:s=>{const e=[];return s==="left"||s==="right"?e.push(["workbench.editor.tabActionLocation",{value:s}]):s==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:s=>{const e=[["zenMode.hideTabs",{value:void 0}]];return s===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let fit=()=>!1,pit=(s,e)=>!1;const Jzt=XM.prototype.getCommandPicks;XM.prototype.getCommandPicks=async function(s){let e=await Jzt.call(this,s);return fit()||(e=e.map(t=>({...t,buttons:void 0}))),e};let ZSe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(Qye)}get activeService(){const e=Dt.get(Kt).getFocusedCodeEditor();return e==null||pit(e,e instanceof Yk)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(k3)),this.standaloneQuickInputService)}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}createQuickWidget(){return this.activeService.createQuickWidget()}pick(e,t={},i=He.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};ZSe=D([_(0,we)],ZSe);function Xzt({isKeybindingConfigurationVisible:s,shouldUseGlobalPicker:e}={}){return s!=null&&(fit=s),e!=null&&(pit=e),{[In.toString()]:new wi(ZSe,[],!0)}}async function Zzt(s,e,t,i,n,o){let r;try{await e8t(s,e,t,i,n,o)}catch(a){r=a}finally{r&&n.errorTransformer&&(r=n.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function e8t(s,e,t,i,n,o){yue(o);const r=await s.open(e,{create:!1});try{yue(o);let a=0,c=0,l=n&&typeof n.length=="number"?n.length:void 0,d=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),h=n&&typeof n.position=="number"?n.position:0,u=0;do c=await s.read(r,h,d.buffer,u,d.byteLength-u),h+=c,u+=c,a+=c,typeof l=="number"&&(l-=c),u===d.byteLength&&(await t.write(i(d)),d=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&yue(o)&&t8t(a,n));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw s0(a)}finally{await s.close(r)}}function yue(s){if(s.isCancellationRequested)throw xy();return!0}function t8t(s,e){if(typeof e?.limits?.size=="number"&&s>e.limits.size)throw us(g(4398,"File is too large to open"),ot.FileTooLarge);return!0}var eAe;function mit(s){return s.scheme===pe.file?s.fsPath:s.toString(!0)}async function _it(s,e,t){const i=[];for(;!s.isEqual(t,s.dirname(t));)try{if(!((await e.stat(t)).type&sn.Directory))throw new Error(g(581,"Unable to create folder '{0}' that already exists but is not a directory",mit(t)));break}catch(n){if(Vk(n)!==ot.FileNotFound)throw n;i.push(s.basename(t)),t=s.dirname(t)}for(let n=i.length-1;n>=0;n--){t=s.joinPath(t,i[n]);try{await e.mkdir(t)}catch(o){if(Vk(o)!==ot.FileExists)throw o}}}var PR;let tAe=(PR=class extends V{constructor(e){super(),this.logService=e,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new I),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new I),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new I),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new I),this.onDidRunOperation=this._onDidRunOperation.event,this.internalOnDidFilesChange=this._register(new I),this._onDidUncorrelatedFilesChange=this._register(new I),this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event,this._onDidWatchError=this._register(new I),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new sTe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);cs(`code/registerFilesystem/${e}`);const i=new Z;return this.provider.set(e,t),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:t}),i.add(t.onDidChangeFile(n=>{const o=new zY(n,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(n=>this._onDidWatchError.fire(new Error(n)))),i.add(t.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:t,scheme:e}))),Ee(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:t}),this.provider.delete(e),bt(i)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){const t=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(i){t.push(i)}}),!this.provider.has(e)&&await Zs.settled(t)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,t){const i=this.provider.get(e.scheme);return!!(i&&i.capabilities&t)}listCapabilities(){return hi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!DGe(e))throw new Td(g(582,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Qi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new La;throw i.message=g(583,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(hE(t)||zm(t)||Nq(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){const t=await this.withProvider(e);if(hE(t)||zm(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,t){try{return await this.doResolveFile(e,t)}catch(i){throw Vk(i)===ot.FileNotFound?new Td(g(584,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Qi.FILE_NOT_FOUND):s0(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),n=this.isPathCaseSensitive(i),o=t?.resolveTo,r=t?.resolveSingleChildDescendants,a=t?.resolveMetadata,c=await i.stat(e);let l;return this.toFileStat(i,e,c,void 0,!!a,(d,h)=>(l||(l=Dh.forUris(()=>!n),l.set(e,!0),o&&l.fill(!0,o)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&r?h===1:!1))}async toFileStat(e,t,i,n,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&sn.File)!==0,isDirectory:(i.type&sn.Directory)!==0,isSymbolicLink:(i.type&sn.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&lp.Readonly)||!!(e.capabilities&Vn.Readonly),locked:!!((i.permissions??0)&lp.Locked),etag:$Y({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,n)){try{const l=await e.readdir(t),d=await Zs.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=o?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,o,r)}catch(f){return this.logService.trace(f),null}}));c.children=Fi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return Zs.settled(e.map(async t=>{try{return{stat:await this.doResolveFile(t.resource,t.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(e){const t=await this.withProvider(e),i=await t.stat(e);return this.toFileStat(t,e,i,void 0,!0,()=>!1)}async exists(e){const t=await this.withProvider(e);try{return!!await t.stat(e)}catch{return!1}}async canCreateFile(e,t){try{await this.doValidateCreateFile(e,t)}catch(i){return i}return!0}async doValidateCreateFile(e,t){if(!t?.overwrite&&await this.exists(e))throw new Td(g(585,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Qi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=$e.fromString(""),i){await this.doValidateCreateFile(e,i);const n=await this.writeFile(e,t);return this._onDidRunOperation.fire(new uP(e,Ai.CREATE,n)),n}async writeFile(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(n);let r=i;if(D2e(n)&&!r?.atomic){const a=n.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(n,e,r)||await this.mkdirp(n,o.dirname(e));let c;if(zm(n)&&!(t instanceof $e))if(bq(t)){const l=await kht(t,3);l.ended?c=$e.concat(l.buffer):c=l}else c=Dht(t,l=>$e.concat(l),3);else c=t;!hE(n)||zm(n)&&c instanceof $e||zm(n)&&D2e(n)&&r?.atomic?await this.doWriteUnbuffered(n,e,r,c):await this.doWriteBuffered(n,e,r,c instanceof $e?cKe(c):c),this._onDidRunOperation.fire(new uP(e,Ai.WRITE))}catch(a){throw new Td(g(586,"Unable to write file '{0}' ({1})",this.resourceForError(e),s0(a).toString()),$w(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const n=!!i?.unlock;if(n&&!(e.capabilities&Vn.FileWriteUnlock))throw new Error(g(587,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&Vn.FileAtomicWrite))throw new Error(g(588,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&Vn.FileReadWrite))throw new Error(g(589,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(n)throw new Error(g(590,"Unable to unlock file '{0}' because atomic write is enabled.",this.resourceForError(t)))}let r;try{r=await e.stat(t)}catch{return}if(r.type&sn.Directory)throw new Td(g(591,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Qi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==S_&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,n);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,n){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},n);return{...o,value:await eD(o.value)}}async readFileStream(e,t,i){const n=await this.withReadProvider(e);return this.doReadFileStream(n,e,t,i)}async doReadFileStream(e,t,i,n){const o=new ci(n);let r=i;yhe(e)&&e.enforceAtomicReadFile?.(t)&&(r={...i,atomic:!0});const a=this.validateReadFile(t,r).then(l=>l,l=>{throw o.dispose(!0),l});let c;try{return typeof r?.etag=="string"&&r.etag!==S_&&await a,r?.atomic&&yhe(e)||!(hE(e)||Nq(e))||zm(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):Nq(e)?c=this.readFileStreamed(e,t,o.token,r):c=this.readFileBuffered(e,t,o.token,r),c.on("end",()=>o.dispose()),c.on("error",()=>o.dispose()),{...await a,value:c}}catch(l){throw c&&await pTe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const n=g(593,"Unable to read file '{0}' ({1})",this.resourceForError(t),s0(e).toString());return e instanceof C5?new C5(n,e.stat,i):e instanceof Pq?new Pq(n,e.fileOperationResult,e.size,e.options):new Td(n,$w(e),i)}readFileStreamed(e,t,i,n=Object.create(null)){const o=e.readFileStream(t,n,i);return Lht(o,{data:r=>r instanceof $e?r:$e.wrap(r),error:r=>this.restoreReadError(r,t,n)},r=>$e.concat(r))}readFileBuffered(e,t,i,n=Object.create(null)){const o=lKe();return Zzt(e,t,o,r=>r,{...n,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,n)},i),o}readFileUnbuffered(e,t,i){const n=jA(o=>$e.concat(o));return(async()=>{try{let o;i?.atomic&&yhe(e)?o=await e.readFile(t,{atomic:!0}):o=await e.readFile(t),typeof i?.position=="number"&&(o=o.slice(i.position)),typeof i?.length=="number"&&(o=o.slice(0,i.length)),this.validateReadFileLimits(t,o.byteLength,i),n.end($e.wrap(o))}catch(o){n.error(o),n.end()}})(),n}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Td(g(594,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Qi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==S_&&t.etag===i.etag)throw new C5(g(595,"File not modified since"),i,t);return this.validateReadFileLimits(e,i.size,t),i}validateReadFileLimits(e,t,i){if(typeof i?.limits?.size=="number"&&t>i.limits.size)throw new Pq(g(596,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Qi.FILE_TOO_LARGE,t,i)}async canMove(e,t,i){return this.doCanMoveCopy(e,t,"move",i)}async canCopy(e,t,i){return this.doCanMoveCopy(e,t,"copy",i)}async doCanMoveCopy(e,t,i,n){if(e.toString()!==t.toString())try{const o=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(o,e,r,t,i,n)}catch(o){return o}return!0}async move(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uP(e,r==="move"?Ai.MOVE:Ai.COPY,a)),a}async copy(e,t,i){const n=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uP(e,r==="copy"?Ai.COPY:Ai.MOVE,a)),a}async doMoveCopy(e,t,i,n,o,r){if(t.toString()===n.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,n,o,r);if(a&&!c&&r&&await this.del(n,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),o==="copy"){if(e===i&&x2e(e))await e.copy(t,n,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,n):await this.doCopyFile(e,t,i,n)}return o}else return e===i?(await e.rename(t,n,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,n,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,n){if(hE(e)&&hE(i))return this.doPipeBuffered(e,t,i,n);if(hE(e)&&zm(i))return this.doPipeBufferedToUnbuffered(e,t,i,n);if(zm(e)&&hE(i))return this.doPipeUnbufferedToBuffered(e,t,i,n);if(zm(e)&&zm(i))return this.doPipeUnbuffered(e,t,i,n)}async doCopyFolder(e,t,i,n){await i.mkdir(n),Array.isArray(t.children)&&await Zs.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(n,o.name);return o.isDirectory?this.doCopyFolder(e,await this.resolve(o.resource),i,r):this.doCopyFile(e,o.resource,i,r)}))}async doValidateMoveCopy(e,t,i,n,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,n)),a&&o==="copy")throw new Error(g(597,"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",this.resourceForError(t),this.resourceForError(n)));if(!a&&l.isEqualOrParent(n,t))throw new Error(g(598,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(n)))}const c=await this.exists(n);if(c&&!a){if(!r)throw new Td(g(599,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(n)),Qi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,n))throw new Error(g(600,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(n)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?xn:Rre,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&Vn.PathCaseSensitive)}async createFolder(e){const t=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(t,e);const i=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uP(e,Ai.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return _it(i,e,t)}async canDelete(e,t){try{await this.doValidateDelete(e,t)}catch(i){return i}return!0}async doValidateDelete(e,t){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),n=!!t?.useTrash;if(n&&!(i.capabilities&Vn.Trash))throw new Error(g(601,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&Vn.FileAtomicDelete))throw new Error(g(602,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(n&&o)throw new Error(g(603,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let r;try{r=await i.stat(e)}catch{}if(r)this.throwIfFileIsReadonly(e,r);else throw new Td(g(604,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Qi.FILE_NOT_FOUND);if(!!!t?.recursive){const c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(g(605,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let n=t;if(qSt(i)&&!n?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(n={...t,atomic:c})}const o=!!n?.useTrash,r=!!n?.recursive,a=n?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new uP(e,Ai.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===n&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===n&&KSt(i)?i.cloneFile(e,t):(await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(t)),i===n&&x2e(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,n,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:eAe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let n=!1,o=()=>{n=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);n?bt(a):o=()=>bt(a)}catch(a){this.logService.error(a)}})();const r=t.correlationId;if(typeof r=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(r)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),n=Wc([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(n);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(n,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(bt(o.disposable),this.activeWatchers.delete(n)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)bt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,n){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{bq(n)||Ide(n)?await this.doWriteStreamBufferedQueued(e,o,n):await this.doWriteReadableBufferedQueued(e,o,n)}catch(r){throw s0(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let n=0,o;if(Ide(i)){if(i.buffer.length>0){const r=$e.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,n,0),n+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{kN(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,n,0)}catch(l){return a(l)}n+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let n=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,n,0),n+=o.byteLength}async doWriteBuffer(e,t,i,n,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,n),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,n){let o;n instanceof $e?o=n:bq(n)?o=await eD(n):Ide(n)?o=await Wht(n):o=Bht(n),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,n){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(n,{create:!0,unlock:!1});const a=$e.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(o,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,r,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw s0(a)}finally{await Zs.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,n){return i.writeFile(n,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,n){const o=await i.open(n,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,$e.wrap(r),r.byteLength,0,0)}catch(r){throw s0(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,n){const o=await eD(this.readFileBuffered(e,t,He.None));await this.doWriteUnbuffered(i,n,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&Vn.Readonly)throw new Td(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Qi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&lp.Readonly)throw new Td(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Qi.FILE_PERMISSION_DENIED)}resourceForError(e){return mit(e)}},eAe=PR,PR.WATCHER_CORRELATION_IDS=0,PR);tAe=eAe=D([_(0,Ge)],tAe);class p5e{constructor(e){this.type=sn.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class x4{constructor(e){this.type=sn.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class aee extends V{constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.root=new x4(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&Vn.Readonly);e!==t&&(this._capabilities=e?Vn.Readonly|Vn.PathCaseSensitive|Vn.FileReadWrite:Vn.FileReadWrite|Vn.PathCaseSensitive,this._onDidChangeCapabilities.fire())}async stat(e){return this._lookup(e,!1)}async readdir(e){const t=this._lookupAsDirectory(e,!1),i=[];return t.entries.forEach((n,o)=>i.push([o,n.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw us("file not found",ot.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=jA(n=>$e.concat(n.map(o=>$e.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const n=_i(e),o=this._lookupParentDirectory(e);let r=o.entries.get(n);if(r instanceof x4)throw us("file is directory",ot.FileIsADirectory);if(!r&&!i.create)throw us("file not found",ot.FileNotFound);if(r&&i.create&&!i.overwrite)throw us("file exists already",ot.FileExists);r||(r=new p5e(n),o.entries.set(n,r),this._fireSoon({type:To.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:To.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const n=this.memoryFdCounter++;return this.fdMemory.set(n,i),Promise.resolve(n)}throw us("file not found",ot.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),Promise.resolve(a.byteLength)}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw us("file exists already",ot.FileExists);const n=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=_i(t);o.entries.delete(n.name),n.name=a,r.entries.set(a,n),this._fireSoon({type:To.DELETED,resource:e},{type:To.ADDED,resource:t})}async delete(e,t){const i=Lr(e),n=_i(e),o=this._lookupAsDirectory(i,!1);o.entries.has(n)&&(o.entries.delete(n),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:To.UPDATED,resource:i},{resource:e,type:To.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new x4(t);n.entries.set(o.name,o),n.mtime=Date.now(),n.size+=1,this._fireSoon({type:To.UPDATED,resource:i},{type:To.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let n=this.root;for(const o of i){if(!o)continue;let r;if(n instanceof x4&&(r=n.entries.get(o)),!r){if(t)return;throw us("file not found",ot.FileNotFound)}n=r}return n}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof x4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof p5e)return i;throw us("file is a directory",ot.FileIsADirectory)}_lookupParentDirectory(e){const t=Lr(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return V.None}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}dispose(){super.dispose(),this.fdMemory.clear()}}class m5e extends Error{constructor(e){super("Missing stores"),this.db=e}}class iAe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class Z0{static async create(e,t,i){const n=await Z0.openDatabase(e,t,i);return new Z0(n,e)}static async openDatabase(e,t,i){cs(`code/willOpenDatabase/${e}`);try{return await Z0.doOpenDatabase(e,t,i)}catch(n){if(n instanceof m5e){console.info("Attempting to recreate the IndexedDB once.",e);try{await Z0.deleteDatabase(n.db)}catch(o){throw console.error("Error while deleting the IndexedDB",su(o)),o}return await Z0.doOpenDatabase(e,t,i)}throw n}finally{cs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((n,o)=>{const r=indexedDB.open(e,t);r.onerror=()=>o(r.error),r.onsuccess=()=>{const a=r.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),o(new m5e(a));return}n(a)},r.onupgradeneeded=()=>{const a=r.result;for(const c of i)a.objectStoreNames.contains(c)||a.createObjectStore(c)}})}static deleteDatabase(e){return new Promise((t,i)=>{e.close();const n=indexedDB.deleteDatabase(e.name);n.onerror=o=>i(n.error),n.onsuccess=()=>t()})}constructor(e,t){this.name=t,this.database=null,this.pendingTransactions=[],this.database=e}hasPendingTransactions(){return this.pendingTransactions.length>0}close(){this.pendingTransactions.length&&this.pendingTransactions.splice(0,this.pendingTransactions.length).forEach(e=>e.abort()),this.database?.close(),this.database=null}async runInTransaction(e,t,i){if(!this.database)throw new iAe(this.name);const n=this.database.transaction(e,t);return this.pendingTransactions.push(n),new Promise((o,r)=>{n.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},n.onerror=()=>r(n.error?La.fromError(n.error):new La("unknown error")),n.onabort=()=>r(n.error?La.fromError(n.error):new La("unknown error"));const a=i(n.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(n),1))}async getKeyValues(e,t){if(!this.database)throw new iAe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(n=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return n(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):n(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Nr(l,!0)}`),n(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Cue=us(g(609,"File does not exist"),ot.FileNotFound),i8t=us(g(610,"File is Directory"),ot.FileIsADirectory),_5e=us(g(611,"File is not a directory"),ot.FileNotADirectory),n8t=us(g(612,"Directory is not empty"),ot.Unknown),s8t=us(g(613,"File exceeds available storage quota"),ot.FileExceedsStorageQuota),Sv=s=>us(g(614,"Internal error occurred in IndexedDB File System Provider. ({0})",s),ot.Unknown);class X5{constructor(e){this.entry=e,this.type=e.type}read(e){return this.doRead(e.split("/").filter(t=>t.length))}doRead(e){if(e.length===0)return this.entry;if(this.entry.type!==sn.Directory)throw Sv("Internal error reading from IndexedDBFSNode -- expected directory at "+this.entry.path);const t=this.entry.children.get(e[0]);if(t)return t.doRead(e.slice(1))}delete(e){const t=e.split("/").filter(i=>i.length);if(t.length===0){if(this.entry.type!==sn.Directory)throw Sv("Internal error deleting from IndexedDBFSNode. Expected root entry to be directory");this.entry.children.clear()}else return this.doDelete(t,e)}doDelete(e,t){if(e.length===0)throw Sv(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==sn.Directory)throw Sv("Internal error deleting from IndexedDBFSNode -- expected directory at "+this.entry.path);if(e.length===1)this.entry.children.delete(e[0]);else{const i=this.entry.children.get(e[0]);if(!i)throw Sv("Internal error deleting from IndexedDBFSNode -- expected entry at "+this.entry.path+"/"+i);i.doDelete(e.slice(1),t)}}add(e,t){this.doAdd(e.split("/").filter(i=>i.length),t,e)}doAdd(e,t,i){if(e.length===0)throw Sv(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==sn.Directory)throw Sv(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const n=e[0],o=this.entry.children.get(n);if(t.type==="dir"){if(o?.entry.type===sn.File)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,o??new X5({type:sn.Directory,path:this.entry.path+"/"+n,children:new Map}))}else{if(o?.entry.type===sn.Directory)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,new X5({type:sn.File,path:this.entry.path+"/"+n,size:t.size}))}}else if(e.length>1){const n=e[0];let o=this.entry.children.get(n);if(!o)o=new X5({children:new Map,path:this.entry.path+"/"+n,type:sn.Directory}),this.entry.children.set(n,o);else if(o.type===sn.File)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===sn.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class o8t extends V{constructor(e,t,i,n){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.extUri=new xN(()=>!1),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._onReportError=this._register(new I),this.onReportError=this._onReportError.event,this.mtimes=new Map,this.fileWriteBatch=[],this.writeManyThrottler=new j7,n&&(this.changesBroadcastChannel=this._register(new INe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:N.revive(r.resource)})))})))}watch(e,t){return V.None}async mkdir(e){try{if((await this.stat(e)).type===sn.File)throw _5e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===sn.File)return{type:sn.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===sn.Directory)return{type:sn.Directory,ctime:0,mtime:0,size:0};throw Cue}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==sn.Directory)throw _5e;return[...t.children.entries()].map(([i,n])=>[i,n.type])}catch(t){throw this.reportError("readDir",t),t}}async readFile(e){try{const t=await this.indexedDB.runInTransaction(this.store,"readonly",o=>o.get(e.path));if(t===void 0)throw Cue;const i=t instanceof Uint8Array?t:Lt(t)?$e.fromString(t).buffer:void 0;if(i===void 0)throw Sv(`IndexedDB entry at "${e.path}" in unexpected format`);return(await this.getFiletree()).add(e.path,{type:"file",size:i.byteLength}),i}catch(t){throw this.reportError("readFile",t),t}}async writeFile(e,t,i){try{if((await this.stat(e).catch(()=>{}))?.type===sn.Directory)throw i8t;await this.bulkWrite([[e,t]])}catch(n){throw this.reportError("writeFile",n),n}}async rename(e,t,i){const n=await this.getFiletree(),o=n.read(e.path);if(!o)throw Cue;const r=n.read(t.path);if(r){if(!i.overwrite)throw us("file exists already",ot.FileExists);if(r.type!==o.type)throw us("Cannot rename files with different types",ot.Unknown);await this.delete(t,{recursive:!0,useTrash:!1,atomic:!1})}const a=d=>this.extUri.joinPath(t,this.extUri.relativePath(e,e.with({path:d}))||""),c=await this.tree(e),l=[];for(const d of c)d[1]===sn.File?l.push(d):d[1]===sn.Directory&&n.add(a(d[0]).path,{type:"dir"});if(l.length){const d=[],h=await this.indexedDB.runInTransaction(this.store,"readonly",u=>l.map(([f])=>u.get(f)));for(let u=0;ur);else{if(i.type===sn.Directory&&(await this.readdir(e)).length)throw n8t;n=[e.path]}await this.deleteKeys(n),(await this.getFiletree()).delete(e.path),n.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(n.map(o=>({resource:e.with({path:o}),type:To.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===sn.Directory){const n=await this.readdir(e);for(const[o,r]of n){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===sn.Directory){const c=await this.tree(a);i.push(...c)}}}return i}triggerChanges(e){e.length&&(this._onDidChangeFile.fire(e),this.changesBroadcastChannel?.postData(e))}getFiletree(){return this.cachedFiletree||(this.cachedFiletree=(async()=>{const e=new X5({children:new Map,path:"",type:sn.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",n=>n.getAllKeys())).map(n=>n.toString()).forEach(n=>e.add(n,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,n])=>this.fileWriteBatch.push({content:n,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,n]of e)t.add(i.path,{type:"file",size:n.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:To.UPDATED})))}async writeMany(){if(this.fileWriteBatch.length){const e=this.fileWriteBatch.splice(0,this.fileWriteBatch.length);try{await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.put(i.content,i.resource.path)))}catch(t){throw t instanceof DOMException&&t.name==="QuotaExceededError"?s8t:t}}}async deleteKeys(e){e.length&&await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.delete(i)))}async reset(){await this.indexedDB.runInTransaction(this.store,"readwrite",e=>e.clear())}reportError(e,t){this._onReportError.fire({scheme:this.scheme,operation:e,code:t instanceof xA||t instanceof iAe?t.code:"unknown"})}}class r8t extends rae{constructor(e=bLe){super(),this.buffer=[],this._logger=void 0,this.setLevel(e),this._register(this.onDidChangeLogLevel(t=>{this._logger?.setLevel(t)}))}set logger(e){this._logger=e;for(const{level:t,message:i}of this.buffer)LY(e,t,i);this.buffer=[]}log(e,t){this._logger?LY(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}var aC;(function(s){s[s.None=0]="None",s[s.Untitled=2]="Untitled",s[s.Scratchpad=4]="Scratchpad"})(aC||(aC={}));const RNe="",a8t="modulepreload",c8t=function(s,e){return new URL(s,e).href},v5e={},FT=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(t.map(l=>{if(l=c8t(l,i),l in v5e)return;v5e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=r.length-1;p>=0;p--){const m=r[p];if(m.href===l&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":a8t,d||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return n.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},Wd="utf8",fS="utf8bom",ZM="utf16be",eN="utf16le",$Q=[254,255],nAe=[255,254],IV=[239,187,191],l8t=512,d8t=512,h8t=512*8,u8t=512*128;var cee;(function(s){s[s.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(cee||(cee={}));class g8t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class MNe{static async create(e){let t;if(e!==Wd)t=(await FT(()=>import("./iconv-lite-umd-BTYEJh1e.js").then(n=>n.i),[],import.meta.url).then(n=>n.default??n)).getDecoder(NNe(e));else{const i=new TextDecoder;t={write(n){return i.decode(n,{stream:!0})},end(){return i.decode()}}}return new MNe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function f8t(s,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?h8t:d8t;return new Promise((i,n)=>{const o=jA(h=>h.join("")),r=[];let a=0,c;const l=new ci,d=async()=>{try{const h=await A8t({buffer:$e.concat(r),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new g8t("Stream is binary but only text is accepted for decoding",cee.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await MNe.create(h.encoding);const u=c.write($e.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),n(h)}};kN(s,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(s.pause(),await d(),setTimeout(()=>s.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function p8t(s,e,t){const n=(await FT(()=>import("./iconv-lite-umd-BTYEJh1e.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(NNe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=s.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Wd:case fS:return $e.wrap(Uint8Array.from(IV));case ZM:return $e.wrap(Uint8Array.from($Q));case eN:return $e.wrap(Uint8Array.from(nAe))}const c=n.end();return c&&c.length>0?(o=!0,$e.wrap(c)):null}return o=!0,$e.wrap(n.write(a))}}}async function m8t(s){return(await FT(()=>import("./iconv-lite-umd-BTYEJh1e.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(NNe(s))}function NNe(s){return s===fS||s===null?Wd:s}function _8t(s,e){if(!s||e<$Q.length)return null;const t=s.readUInt8(0),i=s.readUInt8(1);if(t===$Q[0]&&i===$Q[1])return ZM;if(t===nAe[0]&&i===nAe[1])return eN;if(eimport("./index-B-CpF2rS.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=s.slice(0,u8t),n=S8t(i.buffer);e&&(e=Fi(e.map(a=>C8t(a))),e.length===0&&(e=void 0));const o=t.detect(n,e?{detectEncodings:e}:void 0);if(!o||!o.encoding)return null;const r=o.encoding.toLowerCase();return 0<=v8t.indexOf(r)?null:y8t(o.encoding)}const w8t={ibm866:"cp866",big5:"cp950"};function vit(s){return s.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function y8t(s){const e=vit(s);return w8t[e]||e}function C8t(s){const e=vit(s);return GQ[e].guessableName}function S8t(s){let e="";for(let t=0;t({seemsBinary:!1,encoding:r})):{seemsBinary:o,encoding:n}}const sx={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22,guessableName:"KOI8-R"},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:23},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:24},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:25,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28,guessableName:"ISO-8859-8"},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:29},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:30},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:31},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:32},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:33},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:34},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:35},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:36,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40,guessableName:"EUC-KR"},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:41},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:42},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:43},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:44},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:45,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}},GQ=(()=>{const s={};for(const e in sx)sx[e].guessableName&&(s[e]=sx[e]);return s})();var UP,ly;let lee=(ly=class extends oI{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(a,r,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=n,this.preferredEncoding=o,this.workingCopyBackupService=c,this.textResourceConfigurationService=l,this.workingCopyService=d,this.textFileService=h,this.labelService=u,this.editorService=f,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeName=this._register(new I),this.onDidChangeName=this._onDidChangeName.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this.typeId=RNe,this.capabilities=aC.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),n&&this.setLanguageId(n),this.onConfigurationChange(void 0,!1),this.registerListeners()}registerListeners(){this._register(this.textResourceConfigurationService.onDidChangeConfiguration(e=>this.onConfigurationChange(e,!0)))}onConfigurationChange(e,t){if(!e||e.affectsConfiguration(this.resource,"files.encoding")){const i=this.textResourceConfigurationService.getValue(this.resource,"files.encoding");this.configuredEncoding!==i&&typeof i=="string"&&(this.configuredEncoding=i,t&&!this.preferredEncoding&&this._onDidChangeEncoding.fire())}if(!e||e.affectsConfiguration(this.resource,"workbench.editor.untitled.labelFormat")){const i=this.textResourceConfigurationService.getValue(this.resource,"workbench.editor.untitled.labelFormat");this.configuredLabelFormat!==i&&(i==="content"||i==="name")&&(this.configuredLabelFormat=i,t&&this._onDidChangeName.fire())}}setLanguageId(e,t){const i=e===UP.ACTIVE_EDITOR_LANGUAGE_ID?this.editorService.activeTextEditorLanguageId:e;this.preferredLanguageId=i,i&&super.setLanguageId(i,t)}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}getEncoding(){return this.preferredEncoding||this.configuredEncoding}async setEncoding(e){const t=this.getEncoding();this.preferredEncoding=e,t!==this.preferredEncoding&&this._onDidChangeEncoding.fire()}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){this.dirty!==e&&(this.dirty=e,this._onDidChangeDirty.fire())}async save(e){const t=await this.textFileService.save(this.resource,e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),!!t}async revert(){this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(oae(""))}finally{this.ignoreDirtyOnModelContentChange=!1}this.setDirty(!1),this._onDidRevert.fire()}async backup(e){let t;return this.isResolved()?t=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Wd}):typeof this.initialValue=="string"&&(t=cKe($e.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let n;const o=await this.workingCopyBackupService.resolve(this);o?(n=o.value,t=!0):n=t6($e.fromString(this.initialValue||""));const r=await dLe(await this.textFileService.getDecodedStream(this.resource,n,{encoding:Wd}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=qn(this.textEditorModel);return this.installModelListeners(i),e&&((t||this.initialValue)&&this.updateNameFromFirstLine(i),this.setDirty(this.hasAssociatedFilePath||!!t||!!this.initialValue),(t||this.initialValue)&&this._onDidChangeContent.fire()),super.resolve()}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t))),this._register(e.onDidChangeLanguage(()=>this.onConfigurationChange(void 0,!0))),super.installModelListeners(e)}onModelContentChanged(e,t){this.ignoreDirtyOnModelContentChange||(!this.hasAssociatedFilePath&&e.getLineCount()===1&&e.getLineLength(1)===0?this.setDirty(!1):this.setDirty(!0)),t.changes.some(i=>(i.range.startLineNumber===1||i.range.endLineNumber===1)&&i.range.startColumn<=UP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH)&&this.updateNameFromFirstLine(e),this._onDidChangeContent.fire(),this.autoDetectLanguage()}updateNameFromFirstLine(e){if(this.hasAssociatedFilePath)return;let t,i=e.getValueInRange({startLineNumber:1,endLineNumber:1,startColumn:1,endColumn:UP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,Q6e(i,UP.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&O7().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},UP=ly,ly.FIRST_LINE_NAME_MAX_LENGTH=40,ly.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=ly.FIRST_LINE_NAME_MAX_LENGTH*10,ly.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ly);lee=UP=D([_(5,xi),_(6,gi),_(7,H6),_(8,Ec),_(9,Rm),_(10,Fo),_(11,Fs),_(12,ei),_(13,O6),_(14,mr)],lee);var TV,vk;let dee=(vk=class extends oI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(o,n,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=r,this.textFileService=a,this.workingCopyBackupService=c,this.logService=l,this.workingCopyService=d,this.filesConfigurationService=h,this.labelService=u,this.pathService=m,this.extensionService=v,this.progressService=b,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.typeId=RNe,this.capabilities=aC.None,this.name=Ko(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!xn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new RGe,this.dirty=!1,this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,this.hasEncodingSetExplicitly=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.filesConfigurationService.onDidChangeFilesAssociation(()=>this.onDidChangeFilesAssociation())),this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}async onDidFilesChange(e){let t=!1,i;if(this.inOrphanMode?e.contains(this.resource,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.inOrphanMode!==n&&!this.isDisposed()&&this.setOrphaned(n)}}setOrphaned(e){this.inOrphanMode!==e&&(this.inOrphanMode=e,this._onDidChangeOrphaned.fire())}onDidChangeFilesAssociation(){if(!this.isResolved())return;const e=this.getFirstLineText(this.textEditorModel),t=this.getOrCreateLanguage(this.resource,this.languageService,this.preferredLanguageId,e);this.textEditorModel.setLanguage(t)}setLanguageId(e,t){super.setLanguageId(e,t),this.preferredLanguageId=e}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.inOrphanMode});const i=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Wd});return{meta:t,content:i}}async revert(e){if(!this.isResolved())return;const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),cs("code/willResolveTextFileEditorModel"),this.isDisposed()){this.trace("resolve() - exit - without resolving because model is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because model is dirty or being saved");return}await this.doResolve(e),cs("code/didResolveTextFileEditorModel")}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents,e);if(!(!this.isResolved()&&await this.resolveFromBackup(e)))return this.resolveFromFile(e)}async resolveFromBuffer(e,t){this.trace("resolveFromBuffer()");let i,n,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,n=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),n=Date.now(),o=0,r=S_,this.setOrphaned(c.fileOperationResult===Qi.FILE_NOT_FOUND)}const a=await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding);this.resolveFromContent({resource:this.resource,name:this.name,mtime:i,ctime:n,size:o,etag:r,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Wd;return t&&(i=(await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding)).encoding),!this.isResolved()?t?(await this.doResolveFromBackup(t,i,e),!0):!1:(this.trace("resolveFromBackup() - exit - without resolving because previously new model got created meanwhile"),!0)}async doResolveFromBackup(e,t,i){this.trace("doResolveFromBackup()"),this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:S_,value:await dLe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Wd})),encoding:t,readonly:!1,locked:!1},!0,i),e.meta?.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile,i=this.isResolved()||e?.allowBinary;let n;t?n=S_:this.lastResolvedFileStat&&(n=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:n,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),o!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(r,!1,e)}catch(r){const a=r.fileOperationResult;if(this.setOrphaned(a===Qi.FILE_NOT_FOUND),this.isResolved()&&a===Qi.FILE_NOT_MODIFIED_SINCE){r instanceof C5&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Qi.FILE_NOT_FOUND&&!t)return;throw r}}resolveFromContent(e,t,i){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because model is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0});const n=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):n!==this.contentEncoding&&this._onDidChangeEncoding.fire(),this.textEditorModel?this.doUpdateTextModel(e.value):this.doCreateTextModel(e.resource,e.value),this.setDirty(!!t),this._onDidResolve.fire(i?.reason??X3.OTHER)}doCreateTextModel(e,t){this.trace("doCreateTextModel()");const i=this.createTextEditorModel(t,e,this.preferredLanguageId);this.installModelListeners(i),this.autoDetectLanguage()}doUpdateTextModel(e){this.trace("doUpdateTextModel()"),this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(e,this.preferredLanguageId)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onDidChangeLanguage(()=>this.onMaybeShouldChangeEncoding())),super.installModelListeners(e)}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastModelContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.getAlternativeVersionId()===this.bufferSavedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire(),this.autoDetectLanguage()}async autoDetectLanguage(){await this.extensionService?.whenInstalledExtensionsRegistered();const e=this.getLanguageId();if(this.resource.scheme===this.pathService.defaultUriScheme&&(!e||e===Ca)&&!this.resourceHasExtension)return super.autoDetectLanguage()}async forceResolveFromFile(){this.isDisposed()||await this.textFileService.files.resolve(this.resource,{reload:{async:!1},forceReadFromFile:!0})}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,n=this.inErrorMode,o=this.bufferSavedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.updateSavedVersionId()),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=n,this.bufferSavedVersionId=o}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(gh.CONFLICT)||this.hasState(gh.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for model that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(gh.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.textEditorModel.pushStackElement();const i=new ci;return this.progressService.withProgress({title:g(5736,"Saving '{0}'",this.name),location:ud.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastModelContentChangeFromUndoRedo;a{try{const a=await this.textFileService.write(o.resource,r.createSnapshot(),{mtime:o.mtime,encoding:this.getEncoding(),etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource,r.getLanguageId())?S_:o.etag,unlock:t.writeUnlock,writeElevated:t.writeElevated});this.handleSaveSuccess(a,e,t)}catch(a){this.handleSaveError(a,e,t)}})())})(),()=>n.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[text file model] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString()]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Qi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.textFileService.files.saveErrorHandler.onSaveError(e,this,i),this._onDidSaveError.fire()}updateSavedVersionId(){this.isResolved()&&(this.bufferSavedVersionId=this.textEditorModel.getAlternativeVersionId())}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}hasState(e){switch(e){case gh.CONFLICT:return this.inConflictMode;case gh.DIRTY:return this.dirty;case gh.ERROR:return this.inErrorMode;case gh.ORPHAN:return this.inOrphanMode;case gh.PENDING_SAVE:return this.saveSequentializer.isRunning();case gh.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}async onMaybeShouldChangeEncoding(){if(this.hasEncodingSetExplicitly){this.trace("onMaybeShouldChangeEncoding() - ignoring because encoding was set explicitly");return}if(this.contentEncoding===fS||this.contentEncoding===ZM||this.contentEncoding===eN){this.trace("onMaybeShouldChangeEncoding() - ignoring because content encoding has a BOM");return}const{encoding:e}=await this.textFileService.encoding.getPreferredReadEncoding(this.resource);if(typeof e!="string"||!this.isNewEncoding(e)){this.trace(`onMaybeShouldChangeEncoding() - ignoring because preferred encoding ${e} is not new`);return}if(this.isDirty()){this.trace("onMaybeShouldChangeEncoding() - ignoring because model is dirty");return}return this.logService.info(`Adjusting encoding based on configured language override to '${e}' for ${this.resource.toString(!0)}.`),this.setEncodingInternal(e,Z3.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Z3.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:TV.TEXTFILE_SAVE_ENCODING_SOURCE});else{if(!this.isNewEncoding(e))return;this.isDirty()&&!this.inConflictMode&&await this.save(),this.updatePreferredEncoding(e),await this.forceResolveFromFile()}}updatePreferredEncoding(e){this.isNewEncoding(e)&&(this.preferredEncoding=e,this._onDidChangeEncoding.fire())}isNewEncoding(e){return!(this.preferredEncoding===e||!this.preferredEncoding&&this.contentEncoding===e)}getEncoding(){return this.preferredEncoding||this.contentEncoding}trace(e){this.logService.trace(`[text file model] ${e}`,this.resource.toString())}isResolved(){return!!this.textEditorModel}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,super.dispose()}},TV=vk,vk.TEXTFILE_SAVE_ENCODING_SOURCE=PJ.registerSource("textFileEncoding.source",g(5735,"File Encoding Changed")),vk.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,vk);dee=TV=D([_(3,xi),_(4,gi),_(5,Jt),_(6,Fo),_(7,H6),_(8,Ge),_(9,Rm),_(10,_d),_(11,Fs),_(12,O6),_(13,mr),_(14,bf),_(15,fs),_(16,cg)],dee);let sAe=class extends V{constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=B1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.textEditorModel?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||!e.textEditorModel)break;try{const r=o.participate(e,t,i,n);await U_(r,n)}catch(r){this.logService.error(r)}}e.textEditorModel?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};sAe=D([_(0,Ge)],sAe);let oAe=class extends V{get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=n,this.uriIdentityService=o,this._onDidCreate=this._register(new I({leakWarningThreshold:500})),this.onDidCreate=this._onDidCreate.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidRemove=this._register(new I),this.onDidRemove=this._onDidRemove.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this.mapResourceToModel=new ui,this.mapResourceToModelListeners=new ui,this.mapResourceToDisposeListener=new ui,this.mapResourceToPendingModelResolvers=new ui,this.modelResolveQueue=this._register(new sTe),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(9794,"Failed to save '{0}': {1}",c.name,Nr(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(sAe)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onDidChangeFileSystemProviderCapabilities(e))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onDidChangeFileSystemProviderRegistrations(e))),this._register(this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e=>this.onWillRunWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e=>this.onDidFailWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e=>this.onDidRunWorkingCopyFileOperation(e)))}onDidFilesChange(e){for(const t of this.models)t.isDirty()||e.contains(t.resource,To.UPDATED,To.ADDED)&&this.queueModelReload(t)}onDidChangeFileSystemProviderCapabilities(e){this.queueModelReloads(e.scheme)}onDidChangeFileSystemProviderRegistrations(e){e.added&&this.queueModelReloads(e.scheme)}queueModelReloads(e){for(const t of this.models)t.isDirty()||e===t.resource.scheme&&this.queueModelReload(t)}queueModelReload(e){this.modelResolveQueue.queueSize(e.resource)<=1&&this.modelResolveQueue.queueFor(e.resource,async()=>{try{await this.reload(e)}catch(i){vt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Ai.MOVE||e.operation===Ai.COPY){const t=[];for(const{source:i,target:n}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,n))continue;const o=[];for(const r of this.models)this.uriIdentityService.extUri.isEqualOrParent(r.resource,i)&&o.push(r);for(const r of o){const a=r.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=n:c=Pt(n,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:r.getLanguageId(),encoding:r.getEncoding(),snapshot:r.isDirty()?r.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Ai.MOVE||e.operation===Ai.COPY){const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),t.forEach(i=>{i.snapshot&&this.get(i.source)?.setDirty(!0)}))}}onDidRunWorkingCopyFileOperation(e){switch(e.operation){case Ai.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Ai.MOVE:case Ai.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await Zs.settled(t.map(async i=>{const n=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(n,{reload:{async:!1},contents:i.snapshot?u6(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Ca&&o.getLanguageId()===Ca&&vU(n)!==EKe&&o.updateTextEditorModel(void 0,i.languageId)})))})());break}}get(e){return this.mapResourceToModel.get(e)}has(e){return this.mapResourceToModel.has(e)}async reload(e){await this.joinPendingResolves(e.resource),!(e.isDirty()||e.isDisposed()||!this.has(e.resource))&&await this.doResolve(e,{reload:{async:!1}})}async resolve(e,t){const i=this.joinPendingResolves(e);return i&&await i,this.doResolve(e,t)}async doResolve(e,t){let i,n;N.isUri(e)?(n=e,i=this.get(n)):(n=e.resource,i=e);let o,r=!1;if(i)t?.contents?o=i.resolve(t):t?.reload?t.reload.async?(o=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){vt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(dee,n,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(n,o),this.add(n,i),r&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await o}catch(a){throw r&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(n)}return t?.languageId&&i.setLanguageId(t.languageId),r&&i.isDirty()&&this._onDidChangeDirty.fire(i),i}joinPendingResolves(e){if(this.mapResourceToPendingModelResolvers.get(e))return this.doJoinPendingResolves(e)}async doJoinPendingResolves(e){let t;for(;this.mapResourceToPendingModelResolvers.has(e);){const i=this.mapResourceToPendingModelResolvers.get(e);if(i===t)return;t=i;try{await i}catch{}}}registerModel(e){const t=new Z;t.add(e.onDidResolve(i=>this._onDidResolve.fire({model:e,reason:i}))),t.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire(e))),t.add(e.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire(e))),t.add(e.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire(e))),t.add(e.onDidSaveError(()=>this._onDidSaveError.fire(e))),t.add(e.onDidSave(i=>this._onDidSave.fire({model:e,...i}))),t.add(e.onDidRevert(()=>this._onDidRevert.fire(e))),t.add(e.onDidChangeEncoding(()=>this._onDidChangeEncoding.fire(e))),this.mapResourceToModelListeners.set(e.resource,t)}add(e,t){if(this.mapResourceToModel.get(e)===t)return;this.mapResourceToDisposeListener.get(e)?.dispose(),this.mapResourceToModel.set(e,t),this.mapResourceToDisposeListener.set(e,t.onWillDispose(()=>this.remove(e)))}remove(e){const t=this.mapResourceToModel.delete(e),i=this.mapResourceToDisposeListener.get(e);i&&(bt(i),this.mapResourceToDisposeListener.delete(e));const n=this.mapResourceToModelListeners.get(e);n&&(bt(n),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}canDispose(e){return e.isDisposed()||!this.mapResourceToPendingModelResolvers.has(e.resource)&&!e.isDirty()?!0:this.doCanDispose(e)}async doCanDispose(e){const t=this.joinPendingResolves(e.resource);return t?(await t,this.canDispose(e)):e.isDirty()?(await M.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),bt(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),bt(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};oAe=D([_(0,we),_(1,Jt),_(2,bi),_(3,zb),_(4,ks)],oAe);var KQ,bk;let rAe=(bk=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=n,this.modelService=o,this.environmentService=r,this.dialogService=a,this.fileDialogService=c,this.textResourceConfigurationService=l,this.filesConfigurationService=d,this.codeEditorService=h,this.pathService=u,this.workingCopyFileService=f,this.uriIdentityService=p,this.languageService=m,this.logService=v,this.elevatedFileService=b,this.decorationsService=w,this.files=this._register(this.instantiationService.createInstance(oAe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends V{constructor(t){super(),this.files=t,this.label=g(4401,"Text File Model Decorations"),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.registerListeners()}registerListeners(){this._register(this.files.onDidResolve(({model:t})=>{(t.isReadonly()||t.hasState(gh.ORPHAN))&&this._onDidChange.fire([t.resource])})),this._register(this.files.onDidRemove(t=>this._onDidChange.fire([t]))),this._register(this.files.onDidChangeReadonly(t=>this._onDidChange.fire([t.resource]))),this._register(this.files.onDidChangeOrphaned(t=>this._onDidChange.fire([t.resource])))}provideDecorations(t){const i=this.files.get(t);if(!i||i.isDisposed())return;const n=i.isReadonly(),o=i.hasState(gh.ORPHAN);if(n&&o)return{color:jOe,letter:ve.lockSmall,strikethrough:!0,tooltip:g(4402,"Deleted, Read-only")};if(n)return{letter:ve.lockSmall,tooltip:g(4403,"Read-only")};if(o)return{color:jOe,strikethrough:!0,tooltip:g(4404,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(aAe))),this._encoding}async read(e,t){const[i,n]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:n.detected.encoding||Wd,value:await pTe(n.stream,o=>o.join(""))}}async readStream(e,t){const[i,n]=await this.doRead(e,t);return{...i,encoding:n.detected.encoding||Wd,value:await dLe(n.stream)}}async doRead(e,t){const i=new ci;let n;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);n={...o,value:t6(o.value)}}else n=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,n.value,t);return[n,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===cee.STREAM_IS_BINARY?new LFt(g(4405,"File seems to be binary and cannot be opened as text"),EW.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async n=>{const o=await this.getEncodedReadable(n.resource,n.value);return{resource:n.resource,contents:o,overwrite:n.options?.overwrite}}));return this.workingCopyFileService.create(i,He.None,t)}async write(e,t,i){const n=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,n,i):this.fileService.writeFile(e,n,i)}async getEncodedReadable(e,t,i){const{encoding:n,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(n===Wd&&!o)return typeof t>"u"?void 0:NFt(t);t=t||"";const r=typeof t=="string"?MFt(t):t;return p8t(r,n,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return f8t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),candidateGuessEncodings:i?.candidateGuessEncodings||this.textResourceConfigurationService.getValue(e,"files.candidateGuessEncodings"),overwriteEncoding:async n=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,n??void 0);return o}})}async save(e,t){if(e.scheme===pe.untitled){const i=this.untitled.get(e);if(i){let n;if(i.hasAssociatedFilePath?n=await this.suggestSavePath(e):n=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),n)return this.saveAs(e,n,t)}}else{const i=this.files.get(e);if(i)return await i.save(t)?e:void 0}}async saveAs(e,t,i){if(t||(t=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(i?.suggestedTarget??e),i?.availableFileSystems)),!!t){if(this.filesConfigurationService.isReadonly(t))if(await this.confirmMakeWriteable(t))this.filesConfigurationService.updateReadonly(t,!1);else return;return ji(e,t)?this.save(e,{...i,force:!0}):this.fileService.hasProvider(e)&&this.uriIdentityService.extUri.isEqual(e,t)&&await this.fileService.exists(e)?(await this.workingCopyFileService.move([{file:{source:e,target:t}}],He.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let n=!1;const o=this.files.get(e);if(o?.isResolved())n=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),n=!0;else{const r=this.modelService.getModel(e);r&&(n=await this.doSaveAsTextFile(r,e,t,i))}if(n){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,n){let o;const r=e;typeof r.getEncoding=="function"&&(o=r.getEncoding());let a=!1,c=this.files.get(i);if(c?.isResolved())a=!0;else{a=await this.fileService.exists(i),a||await this.create([{resource:i,value:""}]);try{c=await this.files.resolve(i,{encoding:o})}catch(u){if(a&&(u.textFileOperationResult===EW.FILE_IS_BINARY||u.fileOperationResult===Qi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,n);throw u}}let l;if(e instanceof lee&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,x8(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof oI?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(o),this.modelService.updateModel(h,u6(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Ca&&f===Ca&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return n?.source||(n={...n,source:a?KQ.TEXTFILE_SAVE_REPLACE_SOURCE:KQ.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...n,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4406,"'{0}' already exists. Do you want to replace it?",_i(e)),detail:g(4407,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",_i(e),_i(Lr(e))),primaryButton:g(4408,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4409,"'{0}' is marked as read-only. Do you want to save anyway?",_i(e)),detail:g(4410,"Paths can be configured as read-only via settings."),primaryButton:g(4411,"&&Save Anyway")});return t}async suggestSavePath(e){if(this.fileService.hasProvider(e))return e;const t=this.environmentService.remoteAuthority,i=await this.fileDialogService.defaultFilePath();let n;if(e.scheme===pe.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return x8(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(Pt(i,o.name),o.name)?r=o.name:r=_i(e);const a=o.getLanguageId();a&&a!==Ca?n=this.suggestFilename(a,r):n=r}}return n||(n=_i(e)),Pt(i,n)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const n=Gy(t),o=this.languageService.getExtensions(e);if(o.includes(n))return t;const r=lm(o);if(r)return n?`${t.substring(0,t.indexOf(n))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:lm(a)??t}async revert(e,t){if(e.scheme===pe.untitled){const i=this.untitled.get(e);if(i)return i.revert(t)}else{const i=this.files.get(e);if(i&&(i.isDirty()||t?.force))return i.revert(t)}}isDirty(e){const t=e.scheme===pe.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},KQ=bk,bk.TEXTFILE_SAVE_CREATE_SOURCE=PJ.registerSource("textFileCreate.source",g(4399,"File Created")),bk.TEXTFILE_SAVE_REPLACE_SOURCE=PJ.registerSource("textFileOverwrite.source",g(4400,"File Replaced")),bk);rAe=KQ=D([_(0,Jt),_(1,W6),_(2,ig),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,ag),_(8,Ec),_(9,_d),_(10,Kt),_(11,bf),_(12,zb),_(13,ks),_(14,xi),_(15,Ge),_(16,F6),_(17,iE)],rAe);let aAe=class extends V{get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,n){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=n,this._encodingOverrides=this.getDefaultEncodingOverrides(),this.registerListeners()}registerListeners(){this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.encodingOverrides=this.getDefaultEncodingOverrides()))}getDefaultEncodingOverrides(){const e=[];return e.push({parent:this.environmentService.userRoamingDataHome,encoding:Wd}),e.push({extension:xb,encoding:Wd}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Wd}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Pt(t.uri,".vscode"),encoding:Wd})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:n}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:n}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===ZM||i===eN||i===fS}}async getPreferredReadEncoding(e,t,i){let n;t?.encoding?i===fS&&t.encoding===Wd?n=fS:n=t.encoding:typeof i=="string"?n=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===fS&&(n=Wd);const o=await this.getEncodingForResource(e,n);return{encoding:o,hasBOM:o===ZM||o===eN||o===fS}}async getEncodingForResource(e,t){let i;const n=this.getEncodingOverride(e);return n?i=n:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Wd&&(!i||!await m8t(i))&&(i=Wd),i}getEncodingOverride(e){if(this.encodingOverrides?.length){for(const t of this.encodingOverrides)if(t.parent&&this.uriIdentityService.extUri.isEqualOrParent(e,t.parent)||t.extension&&vU(e)===`.${t.extension}`)return t.encoding}}};aAe=D([_(0,Ec),_(1,Jr),_(2,yi),_(3,ks)],aAe);let cAe=class extends rAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,b,v,w),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(gh.PENDING_SAVE))}};cAe=D([_(0,Jt),_(1,W6),_(2,ig),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,ag),_(8,Ec),_(9,_d),_(10,Kt),_(11,bf),_(12,zb),_(13,ks),_(14,xi),_(15,F6),_(16,Ge),_(17,iE)],cAe);var iw,FR;let lAe=(FR=class extends V{constructor(e,t,i,n){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=n,this._onExpressionChange=this._register(new I),this.onExpressionChange=this._onExpressionChange.event,this.mapFolderToParsedExpression=new Map,this.mapFolderToConfiguredExpression=new Map,this.updateExpressions(!1),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{this.shouldUpdate(e)&&this.updateExpressions(!0)})),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateExpressions(!0)))}updateExpressions(e){let t=!1;for(const r of this.contextService.getWorkspace().folders){const a=r.uri.toString(),c=this.doGetExpression(r.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Ys(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,j_(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new Dk(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==iw.NO_FOLDER&&(i.has(N.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const n=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(iw.NO_FOLDER);n?(!o||!Ys(o.expression,n.expression))&&(t=!0,this.mapFolderToParsedExpression.set(iw.NO_FOLDER,j_(n.expression)),this.mapFolderToConfiguredExpression.set(iw.NO_FOLDER,n)):o&&(t=!0,this.mapFolderToParsedExpression.delete(iw.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(iw.NO_FOLDER)),e&&t&&this._onExpressionChange.fire()}doGetExpression(e){const t=this.getExpression(e);if(!t)return;const i=Object.keys(t);if(i.length===0)return;let n=!1;const o=Object.create(null);for(const r of i){n||(n=pM(r));let a=r;const c=Alt(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:n}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let n,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(n=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(n=this.mapFolderToParsedExpression.get(iw.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(iw.NO_FOLDER)),!n)return!1;let r;return i?r=DN(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&n(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!n(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}},iw=FR,FR.NO_FOLDER=null,FR);lAe=iw=D([_(2,yi),_(3,Te)],lAe);var Av;const E8t=new Q("autoSaveAfterShortDelayContext",!1,!0);var rc;(function(s){s[s.OFF=0]="OFF",s[s.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",s[s.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",s[s.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",s[s.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(rc||(rc={}));var Bg;(function(s){s[s.SETTINGS=1]="SETTINGS",s[s.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",s[s.ERRORS=3]="ERRORS",s[s.DISABLED=4]="DISABLED"})(Bg||(Bg={}));var jS;let dAe=(jS=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=n,this.uriIdentityService=o,this.fileService=r,this.markerService=a,this.textResourceConfigurationService=c,this._onDidChangeAutoSaveConfiguration=this._register(new I),this.onDidChangeAutoSaveConfiguration=this._onDidChangeAutoSaveConfiguration.event,this._onDidChangeAutoSaveDisabled=this._register(new I),this.onDidChangeAutoSaveDisabled=this._onDidChangeAutoSaveDisabled.event,this._onDidChangeFilesAssociation=this._register(new I),this.onDidChangeFilesAssociation=this._onDidChangeFilesAssociation.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.autoSaveConfigurationCache=new um(1e3),this.autoSaveDisabledOverrides=new ui,this.autoSaveAfterShortDelayContext=E8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new hpe(()=>this.createReadonlyMatcher(oje))),this.readonlyExcludeMatcher=this._register(new hpe(()=>this.createReadonlyMatcher(rje))),this.sessionReadonlyOverrides=new ui(d=>this.uriIdentityService.extUri.getComparisonKey(d));const l=t.getValue();this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,l.files),this.currentFilesAssociationConfiguration=l?.files?.associations,this.currentHotExitConfiguration=l?.files?.hotExit||Eu.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new lAe(i=>this.configurationService.getValue(e,{resource:i}),i=>i.affectsConfiguration(e),this.contextService,this.configurationService));return this._register(t.onExpressionChange(()=>this._onDidChangeReadonly.fire())),t}isReadonly(e,t){const i=this.fileService.getProvider(e.scheme);if(i&&QSt(i))return i.readOnlyMessage??Av.READONLY_MESSAGES.providerReadonly;const n=this.sessionReadonlyOverrides.get(e);return typeof n=="boolean"?n===!0?Av.READONLY_MESSAGES.sessionReadonly:!1:this.uriIdentityService.extUri.isEqualOrParent(e,this.environmentService.userRoamingDataHome)||this.uriIdentityService.extUri.isEqual(e,this.contextService.getWorkspace().configuration??void 0)?!1:this.readonlyIncludeMatcher.value.matches(e)?this.readonlyExcludeMatcher.value.matches(e)?!1:Av.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Av.READONLY_MESSAGES.fileLocked:t?.readonly?Av.READONLY_MESSAGES.fileReadonly:!1}async updateReadonly(e,t){if(t==="toggle"){let i;try{i=await this.fileService.resolve(e,{resolveMetadata:!0})}catch{}t=!this.isReadonly(e,i)}t==="reset"?this.sessionReadonlyOverrides.delete(e):this.sessionReadonlyOverrides.set(e,t),this._onDidChangeReadonly.fire()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("files")&&this.onFilesConfigurationChange(this.configurationService.getValue(),!0)}))}onFilesConfigurationChange(e,t){this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,e.files),this.autoSaveConfigurationCache.clear(),this.autoSaveAfterShortDelayContext.set(this.getAutoSaveMode(void 0).mode===rc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Ys(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const n=e?.files?.hotExit;n===Eu.OFF||n===Eu.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=n:this.currentHotExitConfiguration=Eu.ON_EXIT;const o=!!e?.files?.readonlyFromPermissions;o!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=o,t&&this._onDidChangeReadonly.fire())}getAutoSaveConfiguration(e){const t=this.toResource(e);if(t){let i=this.autoSaveConfigurationCache.get(t);return i||(i=this.computeAutoSaveConfiguration(t,this.textResourceConfigurationService.getValue(t,"files")),this.autoSaveConfigurationCache.set(t,i)),i}return this.currentGlobalAutoSaveConfiguration}computeAutoSaveConfiguration(e,t){let i,n,o,r,a,c;switch(t?.autoSave??Av.DEFAULT_AUTO_SAVE_MODE){case tl.AFTER_DELAY:{i="afterDelay",n=typeof t?.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Av.DEFAULT_AUTO_SAVE_DELAY,c=n<=Av.DEFAULT_AUTO_SAVE_DELAY;break}case tl.ON_FOCUS_CHANGE:i="onFocusChange";break;case tl.ON_WINDOW_CHANGE:i="onWindowChange";break}return t?.autoSaveWorkspaceFilesOnly===!0&&(o=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t?.autoSaveWhenNoErrors===!0&&(r=!0,c=void 0),{autoSave:i,autoSaveDelay:n,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof Ob?Na.getOriginalUri(e,{supportSideBySide:Hs.PRIMARY}):e}hasShortAutoSaveDelay(e){const t=this.toResource(e);return this.getAutoSaveConfiguration(t).isShortAutoSaveDelay?!t||!this.autoSaveDisabledOverrides.has(t):!1}getAutoSaveMode(e,t){const i=this.toResource(e);if(i&&this.autoSaveDisabledOverrides.has(i))return{mode:rc.OFF,reason:Bg.DISABLED};const n=this.getAutoSaveConfiguration(i);if(typeof n.autoSave>"u")return{mode:rc.OFF,reason:Bg.SETTINGS};if(typeof t=="number"&&(n.autoSave==="afterDelay"&&t!==Cn.AUTO||n.autoSave==="onFocusChange"&&t!==Cn.FOCUS_CHANGE&&t!==Cn.WINDOW_CHANGE||n.autoSave==="onWindowChange"&&t!==Cn.WINDOW_CHANGE))return{mode:rc.OFF,reason:Bg.SETTINGS};if(i){if(n.autoSaveWorkspaceFilesOnly&&n.isOutOfWorkspace)return{mode:rc.OFF,reason:Bg.OUT_OF_WORKSPACE};if(n.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ws.Error}).length>0)return{mode:rc.OFF,reason:Bg.ERRORS}}switch(n.autoSave){case"afterDelay":return typeof n.autoSaveDelay=="number"&&n.autoSaveDelay<=Av.DEFAULT_AUTO_SAVE_DELAY?{mode:n.autoSaveWhenNoErrors?rc.AFTER_LONG_DELAY:rc.AFTER_SHORT_DELAY}:{mode:rc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:rc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:rc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE].some(i=>i===e)?t=tl.OFF:t=tl.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return V.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const n=this.autoSaveDisabledOverrides.get(t)??0;n<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,n-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Eu.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Av=jS,jS.DEFAULT_AUTO_SAVE_MODE=Wn?tl.AFTER_DELAY:tl.OFF,jS.DEFAULT_AUTO_SAVE_DELAY=1e3,jS.READONLY_MESSAGES={providerReadonly:{value:g(615,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(616,"Editor is read-only because the file was set read-only in this session. [Click here](command:{0}) to set writeable.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},configuredReadonly:{value:g(617,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure or [toggle for this session](command:{1}).",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`,"workbench.action.files.toggleActiveEditorReadonlyInSession"),isTrusted:!0},fileLocked:{value:g(618,"Editor is read-only because of file permissions. [Click here](command:{0}) to set writeable anyway.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},fileReadonly:{value:g(619,"Editor is read-only because the file is read-only."),isTrusted:!0}},jS);dAe=Av=D([_(0,Le),_(1,Te),_(2,yi),_(3,Za),_(4,ks),_(5,Jt),_(6,Am),_(7,Ec)],dAe);class x8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const PNe=Qe.as(Nn.Configuration),D8t=ad?{type:"string",scope:at.APPLICATION,enum:[Eu.OFF,Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE],default:Eu.ON_EXIT,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(621,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`"),g(622,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it's the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`")],markdownDescription:g(623,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:at.APPLICATION,enum:[Eu.OFF,Eu.ON_EXIT_AND_WINDOW_CLOSE],default:Eu.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(624,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(623,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE)};PNe.registerConfiguration({id:"files",order:9,title:g(625,"Files"),type:"object",properties:{[jSt]:{type:"object",markdownDescription:g(626,"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."),default:{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,...Wn?{"**/*.crswap":!0}:void 0},scope:at.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(627,"Enable the pattern."),g(628,"Disable the pattern.")],description:g(629,"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.")},{type:"object",properties:{when:{type:"string",pattern:"\\w*\\$\\(basename\\)\\w*",default:"$(basename).ext",markdownDescription:g(630,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[NLe]:{type:"object",markdownDescription:g(631,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `"*.extension": "html"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed.'),additionalProperties:{type:"string"}},"files.encoding":{type:"string",enum:Object.keys(sx),default:"utf8",description:g(632,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:at.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(sx).map(s=>sx[s].labelLong),enumItemLabels:Object.keys(sx).map(s=>sx[s].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(633,"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.","`#files.encoding#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.candidateGuessEncodings":{type:"array",items:{type:"string",enum:Object.keys(GQ),enumDescriptions:Object.keys(GQ).map(s=>GQ[s].labelLong)},default:[],markdownDescription:g(634,"List of character set encodings that the editor should attempt to guess in the order they are listed. In case it cannot be determined, {0} is respected","`#files.encoding#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` `,`\r -`,"auto"],enumDescriptions:[g(dn,14,"LF"),g(dn,15,"CRLF"),g(dn,16,"Uses operating system specific end of line character.")],default:"auto",description:g(dn,17,"The default end of line character."),scope:ut.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(dn,18,"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.")},"files.trimTrailingWhitespace":{type:"boolean",default:!1,description:g(dn,19,"When enabled, will trim trailing whitespace when saving a file."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(dn,20,"When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."),scope:ut.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(dn,21,"When enabled, insert a final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(dn,22,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(dn,23,"An editor with changes is never automatically saved."),g(dn,24,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(dn,25,"An editor with changes is automatically saved when the editor loses focus."),g(dn,26,"An editor with changes is automatically saved when the window loses focus.")],default:Jn?$l.AFTER_DELAY:$l.OFF,markdownDescription:g(dn,27,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE,$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(dn,28,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(dn,29,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(dn,30,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.watcherExclude":{type:"object",patternProperties:{".*":{type:"boolean"}},default:{"**/.git/objects/**":!0,"**/.git/subtree-cache/**":!0,"**/node_modules/*/**":!0,"**/.hg/store/**":!0},markdownDescription:g(dn,31,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."),scope:ut.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(dn,32,"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."),scope:ut.RESOURCE},"files.hotExit":g8t,"files.defaultLanguage":{type:"string",markdownDescription:g(dn,33,"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.")},[wJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,34,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[bJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,35,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[QEt]:{type:"boolean",markdownDescription:g(dn,36,"Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."),default:!1},"files.restoreUndoStack":{type:"boolean",description:g(dn,37,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(dn,38,"Will refuse to save and ask for resolving the save conflict manually."),g(dn,39,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(dn,40,"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."),default:"askUser",scope:ut.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(dn,41,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(dn,42,"Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."),scope:ut.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(dn,43,"Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."),default:!1},"files.participants.timeout":{type:"number",default:6e4,markdownDescription:g(dn,44,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});lOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});lOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});class O5{constructor(){this.type=an.Directory,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.type=an.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:an.Directory}}delete(){this._onDidDelete.fire()}addChild(e,t){this.entries.set(e,t),this._onDidChange.fire();const i={dispose:()=>{this.deleteChild(e)}};return t.onDidDelete(()=>{i.dispose()}),i}deleteChild(e){return this.entries.delete(e)?(this.mtime=Date.now(),this._onDidChange.fire(),this.entries.size===0&&this.delete(),!0):!1}getChildren(e){return this.entries.get(e)}read(){return Array.from(this.entries.entries()).map(([e,t])=>[e,t.type])}}class f8t{constructor(e,t){this.uri=e,this.readonly=t,this.type=an.File,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.onDidChange(()=>{this.mtime=Date.now()})}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:await this.getSize(),type:an.File,permissions:this.readonly?wm.Readonly:void 0}}async delete(){if(this.readonly)throw xs("Not allowed",rt.FileWriteLocked);this._onDidDelete.fire()}}new TextEncoder;class p8t extends ${constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[],this.rootByAuthority=new Map,this.capabilities=1042,e&&(this.capabilities|=2048)}async open(e){const t=await this.readFile(e),i=this.memoryFdCounter++;return this.fdMemory.set(i,t),i}async close(e){this.fdMemory.delete(e)}async read(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),a.byteLength}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}_lookupRoot(e){const t=e.toLowerCase();let i=this.rootByAuthority.get(t);return i==null&&(i=new O5,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let o=this._lookupRoot(e.authority);for(const r of i){if(r.length===0)continue;let a;if(o instanceof O5&&(a=o.getChildren(r)),a==null){if(t)return;throw xs("file not found",rt.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof O5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===an.File)return i;throw xs("file is a directory",rt.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),s=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;s=Fn.joinPath(s,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(s)),!(c instanceof O5))throw new Error(`file '${s.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${Fn.joinPath(s,o).toString()}/' already exists`);const r=new Z;return r.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),r.add(e.onDidDelete(()=>{r.dispose()})),r.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),r.add(i.addChild(o,e)),this._fireSoon({resource:e.uri,type:1}),r}async stat(e){return this._lookup(e,!1).stats()}readdirSync(e){return this._lookupAsDirectory(e,!1).read()}async readdir(e){return this.readdirSync(e)}async readFile(e){return await this._lookupAsFile(e,!1).read()}readFileStream(e,t,i){const s=this._lookupAsFile(e,!1),o=Xx(r=>ze.concat(r.map(a=>ze.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(s.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await s.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await s.readStream()).getReader();let a=await r.read();for(;!a.done&&!(i.isCancellationRequested||(await o.write(a.value),i.isCancellationRequested));)a=await r.read();o.end(void 0)}}catch(r){o.error(xs(r,rt.Unknown)),o.end()}})(),o}watch(){return $.None}async writeFile(e,t,i){const s=this._lookup(e,!0);if(s!=null&&!(s instanceof f8t))throw xs("file is directory",rt.FileIsADirectory);if(s==null)throw xs("file not found",rt.FileNotFound);if(!i.overwrite)throw xs("file exists already",rt.FileExists);await s.write(t)}async rename(){throw xs("Not allowed",rt.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new O5,r=new Z;return r.add(o.onDidDelete(()=>{r.dispose(),this._fireSoon({resource:e,type:2})})),r.add(o.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),s.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw xs("Can' create a directory",rt.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw xs("Not found",rt.FileNotFound);if(t.type===an.Directory)throw xs("Can't delete a directory",rt.NoPermissions);t.delete()}async delete(e){this.deleteSync(e)}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle!=null&&(clearTimeout(this._fireSoonHandle),this._fireSoonHandle=void 0),this._fireSoonHandle=window.setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}}function H3e(n){return n.status==="fulfilled"}class Ost{constructor(){this.providers=[],this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._onDidChangeOverlays=new I,this.onDidChangeOverlays=this._onDidChangeOverlays.event,this.capabilities=1042}register(e,t){const i={priority:e,provider:t};this.providers.push(i),this.providers.sort((o,r)=>r.priority-o.priority);const s=new Z;return s.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),s.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),s}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);let i;for(const s of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(s)}catch(o){if(i??(i=o),o instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(i.code))continue;throw i}throw xs("Not allowed",rt.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),s=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(s?wm.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(dJ(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;hO(r,{onData(d){l=!0,s.write(d)},onEnd(){s.end(),a()},onError(d){l?s.error(d):c(d)}},i)})}else{let r=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),s.end(r)}},i).catch(o=>{s.error(o)}),s}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(H3e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(H3e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const s of this.delegates)i.add(s.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async s=>{let o;try{o=await s.stat(e)}catch{}if(o!=null&&((o.permissions??0)&wm.Readonly)>0)throw xs("Not allowed",rt.NoPermissions);return s.writeFile(e,t,i)})}async mkdir(e){await this.writeToDelegates(t=>t.mkdir(e))}async delete(e,t){await this.writeToDelegates(i=>i.delete(e,t))}async rename(e,t,i){await this.writeToDelegates(s=>s.rename(e,t,i))}}class m8t extends Mne{async writeFile(e,t,i){return await Fst(Fn,this,Fn.dirname(e)),super.writeFile(e,t,i)}}const Bst=new Ost;Bst.register(0,new m8t);const _8t=new p8t(!0),Wst=new Mne;Wst.mkdir(P.from({scheme:_e.vscodeUserData,path:"/User/"}));var k6;(function(n){n.extensionFile="extension-file"})(k6||(k6={}));const v8t={[k6.extensionFile]:_8t,[Pnt.scheme]:new Mne,[_e.vscodeUserData]:Wst,[_e.tmp]:new Mne,[_e.file]:Bst};let xDe=class extends fDe{constructor(e,t){super(e);for(const[i,s]of Object.entries(v8t)){let o=this.registerProvider(i,s);s instanceof Ost&&s.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,s)}),s instanceof z$t&&this._register(s.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};xDe=D([_(1,rn)],xDe);const Hst=new $$t;zFe(async n=>{Hst.logger=n.get(Ze)});function dOe(){return{[ci.toString()]:new Gi(xDe,[Hst],!0),[tr.toString()]:new Gi(SDe,[],!0),[hh.toString()]:new Gi(EDe,[],!0),[IQ.toString()]:new Gi(u8t,[],!0)}}function w8t(n,e){if(n.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const s of n){if(s===!0)return Promise.resolve(!0);NS(s)&&t.push(s.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return ko.settled(t).then(()=>i)}var KV;(function(n){n[n.WebSocket=0]="WebSocket",n[n.Managed=1]="Managed"})(KV||(KV={}));class Ust{constructor(e){this.id=e,this.type=KV.Managed}toString(){return`Managed(${this.id})`}}class Vst{constructor(e,t){this.host=e,this.port=t,this.type=KV.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var Xd;(function(n){n.Unknown="Unknown",n.NotAvailable="NotAvailable",n.TemporarilyNotAvailable="TemporarilyNotAvailable",n.NoResolverFound="NoResolverFound",n.InvalidAuthority="InvalidAuthority"})(Xd||(Xd={}));let HI=class oT extends uc{static isNotAvailable(e){return e instanceof oT&&e._code===Xd.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof oT&&e._code===Xd.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof oT&&e._code===Xd.NoResolverFound}static isInvalidAuthority(e){return e instanceof oT&&e._code===Xd.InvalidAuthority}static isHandled(e){return e instanceof oT&&e.isHandled}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===Xd.NotAvailable&&i===!0,Object.setPrototypeOf(this,oT.prototype)}};function Pne(n){const e=n.indexOf("+");return e===-1?n:n.substring(0,e)}class b8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class UI{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const s=i.getExtensionDescription(e);return s?!!((s.main||s.browser)&&s.api==="none"):!1}constructor(e,t){this._activationEventsReader=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(x8t),this._extensionsMap=new Ga,this._extensionsArr=[],this._activationMap=new Map;for(const e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);const t=this._activationEventsReader.readActivationEvents(e);for(const i of t)this._activationMap.has(i)||this._activationMap.set(i,[]),this._activationMap.get(i).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(e,t){this._extensionDescriptions=U3e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=UI._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=U3e(this._extensionDescriptions,i.map(s=>s.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new b8t(this._versionId,i)}static _findLoopingExtensions(e){const t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(a){this._nodesSet.has(a)||(this._nodesSet.add(a),this._nodesArr.push(a))}addArc(a,c){this.addNode(a),this.addNode(c),this._arcs.has(a)?this._arcs.get(a).push(c):this._arcs.set(a,[c])}getArcs(a){return this._arcs.has(a)?this._arcs.get(a):[]}hasOnlyGoodArcs(a,c){const l=t.getArcs(a);for(let d=0;dt.getArcs(a).length===0).forEach(a=>s.add(a));const o=t.getNodes().filter(a=>!s.has(a));let r;do{r=!1;for(let a=0;ai.get(a))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){const t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new C8t(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){const t=this._extensionsMap.get(e);return t||void 0}getExtensionDescriptionByUUID(e){for(const t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}}class C8t{constructor(e,t){this.versionId=e,this.extensions=t}}class y8t{constructor(e){this._lock=new E8t,this._actual=new UI(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new S8t(this,t)}deltaExtensions(e,t,i){if(!e.isAcquiredFor(this))throw new Error("Lock is not held");return this._actual.deltaExtensions(t,i)}containsActivationEvent(e){return this._actual.containsActivationEvent(e)}containsExtension(e){return this._actual.containsExtension(e)}getExtensionDescriptionsForActivationEvent(e){return this._actual.getExtensionDescriptionsForActivationEvent(e)}getAllExtensionDescriptions(){return this._actual.getAllExtensionDescriptions()}getSnapshot(){return this._actual.getSnapshot()}getExtensionDescription(e){return this._actual.getExtensionDescription(e)}getExtensionDescriptionByUUID(e){return this._actual.getExtensionDescriptionByUUID(e)}getExtensionDescriptionByIdOrUUID(e,t){return this._actual.getExtensionDescriptionByIdOrUUID(e,t)}}class S8t extends ${constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class A8t{constructor(e){this.name=e;const t=NU();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class E8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new A8t(e);return this._pendingCustomers.push(t),this._advance(),t.promise}_advance(){if(this._isLocked||this._pendingCustomers.length===0)return;const e=this._pendingCustomers.shift();this._isLocked=!0;let t=!0;const i=setTimeout(()=>{t&&console.warn(`The customer named ${e.name} has been holding on to the lock for 30s. This might be a problem.`)},30*1e3),s=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(s))}}var ik;(function(n){n[n.Builtin=0]="Builtin",n[n.User=1]="User",n[n.Dev=2]="Dev"})(ik||(ik={}));function x8t(n,e){const t=n.isBuiltin?ik.Builtin:n.isUnderDevelopment?ik.Dev:ik.User,i=e.isBuiltin?ik.Builtin:e.isUnderDevelopment?ik.Dev:ik.User;if(t!==i)return t-i;const s=Qi.basename(n.extensionLocation.path),o=Qi.basename(e.extensionLocation.path);return so?1:0}function U3e(n,e){const t=new $v(e);return n.filter(i=>!t.has(i.identifier))}function hOe(n){const e=n.isExtensionDevelopment;let t=!0;const i=n.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==_e.file&&(t=!1);const s=t&&typeof n.debugExtensionHost.port=="number",o=t&&!!n.debugExtensionHost.break,r=e&&!!n.extensionTestsLocationURI&&!n.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:s,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var Ao;(function(n){n[n.LocalProcess=1]="LocalProcess",n[n.LocalWebWorker=2]="LocalWebWorker",n[n.Remote=3]="Remote"})(Ao||(Ao={}));function hE(n){if(n===null)return"None";switch(n){case Ao.LocalProcess:return"LocalProcess";case Ao.LocalWebWorker:return"LocalWebWorker";case Ao.Remote:return"Remote"}}var rp;(function(n){n[n.None=0]="None",n[n.Local=1]="Local",n[n.Remote=2]="Remote"})(rp||(rp={}));function D8t(n){switch(n){case rp.None:return"None";case rp.Local:return"Local";case rp.Remote:return"Remote"}}function k8t(n,e,t,i){const s=V3e(n,t),o=V3e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=s.get(l.key)||null,h=o.get(l.key)||null,u=new L8t(d,h);r.set(u.key,u)};s.forEach(l=>a(l)),o.forEach(l=>a(l));const c=new Map;return r.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=rp.None;u&&!f?p=rp.Local:f&&!u&&(p=rp.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function V3e(n,e){const t=new Map;return n.forEach(i=>{const s=new I8t(i,e(i));t.set(s.key,s)}),t}class I8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Cn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class L8t{constructor(e,t){this.local=e,this.remote=t}get key(){return this.local?this.local.key:this.remote.key}get identifier(){return this.local?this.local.desc.identifier:this.remote.desc.identifier}get kind(){return this.local?this.local.kind:this.remote.kind}}function en(n){return function(e){YV.INSTANCE.registerNamedCustomer(n,e)}}function TO(n){YV.INSTANCE.registerCustomer(n)}var Fne;(function(n){function e(){return YV.INSTANCE.getNamedCustomers()}n.getNamedCustomers=e;function t(){return YV.INSTANCE.getCustomers()}n.getCustomers=t})(Fne||(Fne={}));const ele=class ele{constructor(){this._namedCustomers=[],this._customers=[]}registerNamedCustomer(e,t){const i=[e,t];this._namedCustomers.push(i)}getNamedCustomers(){return this._namedCustomers}registerCustomer(e){this._customers.push(e)}getCustomers(){return this._customers}};ele.INSTANCE=new ele;let YV=ele;function zst(n,e,t,i){if(!n||i>200)return null;if(typeof n=="object"){if(n.$mid===Fs.Uri)return t?P.revive(e.transformIncoming(n)):e.transformIncoming(n);if(n instanceof ze)return null;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const o=zst(n[s],e,t,i+1);o!==null&&(n[s]=o)}}return null}function B5(n,e){const t=zst(n,e,!1,0);return t===null?n:t}class $st{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||(this._actual=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)})),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):bt(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}}class T8t extends $st{constructor(){super(),this._hasErr=!0,this._err=new Rc}}const tle=class tle{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++tle.count}};tle.count=0;let One=tle;const Gst=[];function Xe(n){const e=new One(n);return Gst[e.nid]=e,e}function tY(n){return Gst[n].sid}class $h{constructor(e){this.value=e}}var z3e;function DDe(n,e){try{return JSON.stringify(n,e)}catch{return"null"}}const uOe="$$ref$$",R8t={[uOe]:-1};function $3e(n,e=null,t=!1){const i=[];return{jsonString:(t?DDe:JSON.stringify)(n,(o,r)=>{if(typeof r>"u")return R8t;if(typeof r=="object"){if(r instanceof ze){const a=i.push(r)-1;return{[uOe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function qst(n,e,t){return JSON.parse(n,(i,s)=>{if(s){const o=s[uOe];if(typeof o=="number")return e[o];if(t&&s.$mid===Fs.Uri)return t.transformIncoming(s)}return s})}function G3e(n,e){return JSON.stringify(n,e)}function M8t(n){return n?(e,t)=>t&&t.$mid===Fs.Uri?n.transformOutgoing(t):t:null}var zf;(function(n){n[n.LocalSide=0]="LocalSide",n[n.OtherSide=1]="OtherSide"})(zf||(zf={}));var DM;(function(n){n[n.Responsive=0]="Responsive",n[n.Unresponsive=1]="Unresponsive"})(DM||(DM={}));const N8t=()=>{},P8t=Symbol.for("rpcProtocol"),F8t=Symbol.for("rpcProxy"),a9=class a9 extends ${constructor(e,t=null,i=null){super(),this[z3e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=M8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let s=0,o=One.count;sthis._checkUnresponsive(),1e3)),this._protocol.onMessage(s=>this._receiveOneMessage(s))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(rx())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(DM.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(DM.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?B5(e,this._uriTransformer):e}getProxy(e){const{nid:t,sid:i}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,i)),this._proxies[t]}_createProxy(e,t){const i={get:(s,o)=>(typeof o=="string"&&!s[o]&&o.charCodeAt(0)===Q.DollarSign&&(s[o]=(...r)=>this._remoteCall(e,o,r)),o===F8t?t:s[o])};return new Proxy(Object.create(null),i)}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,i=e.length;th.cancel()}else c=this._invokeHandler(i,s,o),l=N8t;this._cancelInvokedHandlers[a]=l;const d=Bm.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,zf.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Bm.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Bm.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,zf.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReply:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReplyErr:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s];let r;i&&(i.$isError?(r=new Error,r.name=i.name,r.message=i.message,r.stack=i.stack):r=i),o.resolveErr(r)}_invokeHandler(e,t,i){try{return Promise.resolve(this._doInvokeHandler(e,t,i))}catch(s){return Promise.reject(s)}}_doInvokeHandler(e,t,i){const s=this._locals[e];if(!s)throw new Error("Unknown actor "+tY(e));const o=s[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+tY(e));return o.apply(s,i)}_remoteCall(e,t,i){if(this._isDisposed)return new T8t;let s=null;if(i.length>0&&qe.isCancellationToken(i[i.length-1])&&(s=i.pop()),s&&s.isCancellationRequested)return Promise.reject(rx());const o=Bm.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new $st,l=new Z;s&&l.add(s.onCancellationRequested(()=>{const h=Bm.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,zf.LocalSide,"cancel"),this._protocol.send(Bm.serializeCancel(r))})),this._pendingRPCReplies[a]=new O8t(c,l),this._onWillSendRequest(r);const d=Bm.serializeRequest(r,e,t,o,!!s);return this._logger?.logOutgoing(d.byteLength,r,zf.LocalSide,`request: ${tY(e)}.${t}(`,i),this._protocol.send(d),c}};z3e=P8t,a9.UNRESPONSIVE_TIME=3*1e3;let Bne=a9;class O8t{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}}var Y0;let fl=(Y0=class{static alloc(e,t,i){const s=new Y0(ze.alloc(i+1+4),0);return s.writeUInt8(e),s.writeUInt32(t),s}static read(e,t){return new Y0(e,t)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){const e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){const e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){const e=this._buff.readUInt8(this._offset);this._offset+=1;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let i=0,s=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let s=0,o=e.length;s"u")i[s]={type:fd.Undefined};else if(r instanceof $h){const{jsonString:a,referencedBuffers:c}=$3e(r.value,t);i[s]={type:fd.SerializedObjectWithBuffers,value:ze.fromString(a),buffers:c}}else i[s]={type:fd.String,value:ze.fromString(G3e(r,t))}}return{type:m2.Mixed,args:i}}return{type:m2.Simple,args:G3e(e,t)}}static serializeRequest(e,t,i,s,o){switch(s.type){case m2.Simple:return this._requestJSONArgs(e,t,i,s.args,o);case m2.Mixed:return this._requestMixedArgs(e,t,i,s.args,o)}}static _requestJSONArgs(e,t,i,s,o){const r=ze.fromString(i),a=ze.fromString(s);let c=0;c+=fl.sizeUInt8(),c+=fl.sizeShortString(r),c+=fl.sizeLongString(a);const l=fl.alloc(o?Wa.RequestJSONArgsWithCancellation:Wa.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(r),l.writeLongString(a),l.buffer}static deserializeRequestJSONArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(s)}}static _requestMixedArgs(e,t,i,s,o){const r=ze.fromString(i);let a=0;a+=fl.sizeUInt8(),a+=fl.sizeShortString(r),a+=fl.sizeMixedArray(s);const c=fl.alloc(o?Wa.RequestMixedArgsWithCancellation:Wa.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(s),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readMixedArray(),o=new Array(s.length);for(let r=0,a=s.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof ze)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof $h){const{jsonString:s,referencedBuffers:o}=$3e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,s,o)}else return this._serializeReplyOKJSON(e,DDe(t,i))}static _serializeReplyOKEmpty(e){return fl.alloc(Wa.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=fl.sizeVSBuffer(t);const s=fl.alloc(Wa.ReplyOKVSBuffer,e,i);return s.writeVSBuffer(t),s.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=ze.fromString(t);let s=0;s+=fl.sizeLongString(i);const o=fl.alloc(Wa.ReplyOKJSON,e,s);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const s=ze.fromString(t);let o=0;o+=fl.sizeUInt32,o+=fl.sizeLongString(s);for(const a of i)o+=fl.sizeVSBuffer(a);const r=fl.alloc(Wa.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(s);for(const a of i)r.writeBuffer(a);return r.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),s=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:hE(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${hE(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:hE(this.kind)};return l&&l.name&&(d.errorName=l.name),l&&l.message&&(d.errorMessage=l.message),l&&l.stack&&(d.errorStack=l.stack),this._telemetryService.publicLog2("extensionHostStartup",d),null}),this._proxy.then(()=>{t.forEach(l=>this.activateByEvent(l,sC.Normal)),this._register(V8t({measure:()=>this.measure()}))})}dispose(){this._extensionHost&&this._extensionHost.dispose(),this._rpcProtocol&&this._rpcProtocol.dispose();for(let e=0,t=this._customers.length;ethis._onDidChangeResponsiveState.fire(l)));let s=null,o=[];const r={remoteAuthority:this._extensionHost.remoteAuthority,extensionHostKind:this.kind,getProxy:l=>this._rpcProtocol.getProxy(l),set:(l,d)=>this._rpcProtocol.set(l,d),dispose:()=>this._rpcProtocol.dispose(),assertRegistered:l=>this._rpcProtocol.assertRegistered(l),drain:()=>this._rpcProtocol.drain(),internalExtensionService:this._internalExtensionService,_setExtensionHostProxy:l=>{s=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=Fne.getNamedCustomers();for(let l=0,d=a.length;l`[${hE(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${s()}${l}`),r=(l,d=void 0)=>this._logService.error(`${s()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:Xd.Unknown,detail:void 0}};o("invoking...");const c=new nQ;try{c.cancelAndSet(()=>o("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?o(`returned ${l.value.authority.connectTo}`):r("returned an error",l.error),l}catch(l){return c.dispose(),r("returned an error",l),{type:"error",error:{message:l.message,code:Xd.Unknown,detail:l}}}}async getCanonicalURI(e,t){const i=await this._proxy;if(!i)throw new Error("Cannot resolve canonical URI");return i.getCanonicalURI(e,t)}async start(e,t,i){const s=await this._proxy;if(!s)return;const o=this._extensionHost.extensions.set(e,t,i);return s.startExtensionHost(o)}async extensionTestsExecute(){const e=await this._proxy;if(!e)throw new Error("Could not obtain Extension Host Proxy");return e.extensionTestsExecute()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){const t=await this._proxy;if(!t)return;const i=this._extensionHost.extensions.delta(e);if(i)return t.deltaExtensions(i)}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async setRemoteEnvironment(e){const t=await this._proxy;if(t)return t.setRemoteEnvironment(e)}};Wne=wX=D([_(3,be),_(4,ec),_(5,rn),_(6,Ze)],Wne);function Qst(n,e){return e?`${hE(n)} pid: ${e}`:`${hE(n)}`}const W8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function q3e(n){if(Array.isArray(n))return n;if(n&&typeof n=="object"&&typeof n.toString=="function"){const e=n.toString();if(e!=="[object Object]")return e}return n}function H8t(n){return Array.isArray(n)?n.map(q3e):q3e(n)}class U8t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,s,o,r,a){a=H8t(a);const c=W8t[o],l=c[s%c.length];let d=[`%c[${hE(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(s).padStart(5)} - ${r}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(r)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,s,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,s,o)}logOutgoing(e,t,i,s,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,s,o)}}let Hne=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,s){if(i===zf.LocalSide&&/^receiveReply(Err)?:/.test(s)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s} ${o}`,length:e})}i===zf.OtherSide&&/^receiveRequest /.test(s)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s}`,length:e})}logOutgoing(e,t,i,s){i===zf.LocalSide&&s.startsWith("request: ")&&(this._pendingRequests.set(t,s),this._telemetryService.publicLog2("extensionhost.outgoing",{type:s,length:e}))}};Hne=D([_(0,rn)],Hne);const H3=[];function V8t(n){return H3.push(n),{dispose:()=>{for(let e=0;es.measure()));t.openEditor({resource:void 0,contents:i.map(bX._print).join(` +`,"auto"],enumDescriptions:[g(635,"LF"),g(636,"CRLF"),g(637,"Uses operating system specific end of line character.")],default:"auto",description:g(638,"The default end of line character."),scope:at.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(639,"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.")},"files.trimTrailingWhitespace":{type:"boolean",default:!1,description:g(640,"When enabled, will trim trailing whitespace when saving a file."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(641,"When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."),scope:at.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(642,"When enabled, insert a final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(643,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[tl.OFF,tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(644,"An editor with changes is never automatically saved."),g(645,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(646,"An editor with changes is automatically saved when the editor loses focus."),g(647,"An editor with changes is automatically saved when the window loses focus.")],default:Wn?tl.AFTER_DELAY:tl.OFF,markdownDescription:g(648,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",tl.OFF,tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE,tl.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(649,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",tl.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(650,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when {0} is enabled.","`#files.autoSave#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(651,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when {0} is enabled.","`#files.autoSave#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.watcherExclude":{type:"object",patternProperties:{".*":{type:"boolean"}},default:{"**/.git/objects/**":!0,"**/.git/subtree-cache/**":!0,"**/node_modules/*/**":!0,"**/.hg/store/**":!0},markdownDescription:g(652,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."),scope:at.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(653,"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."),scope:at.RESOURCE},"files.hotExit":D8t,"files.defaultLanguage":{type:"string",markdownDescription:g(654,"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.")},[oje]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(655,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."),scope:at.RESOURCE},[rje]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(656,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."),scope:at.RESOURCE},[YSt]:{type:"boolean",markdownDescription:g(657,"Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."),default:!1},"files.restoreUndoStack":{type:"boolean",description:g(658,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(659,"Will refuse to save and ask for resolving the save conflict manually."),g(660,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(661,"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."),default:"askUser",scope:at.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(662,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(663,"Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."),scope:at.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(664,"Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."),default:!1},"files.participants.timeout":{type:"number",default:6e4,markdownDescription:g(665,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});PNe.registerConfiguration({...Vb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});PNe.registerConfiguration({...Vb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});class D4{constructor(){this.type=sn.Directory,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.type=sn.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:sn.Directory}}delete(){this._onDidDelete.fire()}addChild(e,t){this.entries.set(e,t),this._onDidChange.fire();const i={dispose:()=>{this.deleteChild(e)}};return t.onDidDelete(()=>{i.dispose()}),i}deleteChild(e){return this.entries.delete(e)?(this.mtime=Date.now(),this._onDidChange.fire(),this.entries.size===0&&this.delete(),!0):!1}getChildren(e){return this.entries.get(e)}read(){return Array.from(this.entries.entries()).map(([e,t])=>[e,t.type])}}class bit{constructor(e,t){this.uri=e,this.readonly=t,this.type=sn.File,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.onDidChange(()=>{this.mtime=Date.now()})}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:await this.getSize(),type:sn.File,permissions:this.readonly?lp.Readonly:void 0}}async delete(){if(this.readonly)throw us("Not allowed",ot.FileWriteLocked);this._onDidDelete.fire()}}const k8t=new TextEncoder;function I8t(s){return s instanceof Uint8Array?s:k8t.encode(s)}class T8t extends bit{constructor(e,t){super(e,!1),this.content=I8t(t)}async getSize(){return this.content.length}async read(){return this.content}async write(e){this.content=e,this._onDidChange.fire()}}class wit extends V{constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=M.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[],this.rootByAuthority=new Map,this.capabilities=1042,e&&(this.capabilities|=2048)}async open(e){const t=await this.readFile(e),i=this.memoryFdCounter++;return this.fdMemory.set(i,t),i}async close(e){this.fdMemory.delete(e)}async read(e,t,i,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),a.byteLength}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}_lookupRoot(e){const t=e.toLowerCase();let i=this.rootByAuthority.get(t);return i==null&&(i=new D4,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let o=this._lookupRoot(e.authority);for(const r of i){if(r.length===0)continue;let a;if(o instanceof D4&&(a=o.getChildren(r)),a==null){if(t)return;throw us("file not found",ot.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof D4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===sn.File)return i;throw us("file is a directory",ot.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),n=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;n=xn.joinPath(n,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(n)),!(c instanceof D4))throw new Error(`file '${n.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${xn.joinPath(n,o).toString()}/' already exists`);const r=new Z;return r.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),r.add(e.onDidDelete(()=>{r.dispose()})),r.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),r.add(i.addChild(o,e)),this._fireSoon({resource:e.uri,type:1}),r}async stat(e){return this._lookup(e,!1).stats()}readdirSync(e){return this._lookupAsDirectory(e,!1).read()}async readdir(e){return this.readdirSync(e)}async readFile(e){return await this._lookupAsFile(e,!1).read()}readFileStream(e,t,i){const n=this._lookupAsFile(e,!1),o=jA(r=>$e.concat(r.map(a=>$e.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(n.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await n.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await n.readStream()).getReader();let a=await r.read();for(;!a.done&&!(i.isCancellationRequested||(await o.write(a.value),i.isCancellationRequested));)a=await r.read();o.end(void 0)}}catch(r){o.error(us(r,ot.Unknown)),o.end()}})(),o}watch(){return V.None}async writeFile(e,t,i){const n=this._lookup(e,!0);if(n!=null&&!(n instanceof bit))throw us("file is directory",ot.FileIsADirectory);if(n==null)throw us("file not found",ot.FileNotFound);if(!i.overwrite)throw us("file exists already",ot.FileExists);await n.write(t)}async rename(){throw us("Not allowed",ot.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new D4,r=new Z;return r.add(o.onDidDelete(()=>{r.dispose(),this._fireSoon({resource:e,type:2})})),r.add(o.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),n.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw us("Can' create a directory",ot.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw us("Not found",ot.FileNotFound);if(t.type===sn.Directory)throw us("Can't delete a directory",ot.NoPermissions);t.delete()}async delete(e){this.deleteSync(e)}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle!=null&&(clearTimeout(this._fireSoonHandle),this._fireSoonHandle=void 0),this._fireSoonHandle=window.setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}}function b5e(s){return s.status==="fulfilled"}class yit{constructor(){this.providers=[],this.onDidChangeCapabilities=M.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._onDidChangeOverlays=new I,this.onDidChangeOverlays=this._onDidChangeOverlays.event,this.capabilities=1042}register(e,t){const i={priority:e,provider:t};this.providers.push(i),this.providers.sort((o,r)=>r.priority-o.priority);const n=new Z;return n.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),n.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),n}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);let i;for(const n of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(n)}catch(o){if(i??(i=o),o instanceof xA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof xA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(i.code))continue;throw i}throw us("Not allowed",ot.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),n=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(n?lp.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const n=jA(o=>$e.concat(o.map(r=>$e.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(Nq(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;kN(r,{onData(d){l=!0,n.write(d)},onEnd(){n.end(),a()},onError(d){l?n.error(d):c(d)}},i)})}else{let r=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),n.end(r)}},i).catch(o=>{n.error(o)}),n}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(b5e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(b5e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const n of this.delegates)i.add(n.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async n=>{let o;try{o=await n.stat(e)}catch{}if(o!=null&&((o.permissions??0)&lp.Readonly)>0)throw us("Not allowed",ot.NoPermissions);return n.writeFile(e,t,i)})}async mkdir(e){await this.writeToDelegates(t=>t.mkdir(e))}async delete(e,t){await this.writeToDelegates(i=>i.delete(e,t))}async rename(e,t,i){await this.writeToDelegates(n=>n.rename(e,t,i))}}class L8t extends aee{async writeFile(e,t,i){return await _it(xn,this,xn.dirname(e)),super.writeFile(e,t,i)}}const Cit=new yit;Cit.register(0,new L8t);const R8t=new wit(!0),Sit=new aee;Sit.mkdir(N.from({scheme:pe.vscodeUserData,path:"/User/"}));var hee;(function(s){s.extensionFile="extension-file"})(hee||(hee={}));const Ait={[hee.extensionFile]:R8t,[ltt.scheme]:new aee,[pe.vscodeUserData]:Sit,[pe.tmp]:new aee,[pe.file]:Cit};let hAe=class extends tAe{constructor(e,t){super(e);for(const[i,n]of Object.entries(Ait)){let o=this.registerProvider(i,n);n instanceof yit&&n.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,n)}),n instanceof o8t&&this._register(n.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};hAe=D([_(1,Yi)],hAe);const Eit=new r8t;pNe(async s=>{Eit.logger=s.get(Ge)});function Rce(){return{[Jt.toString()]:new wi(hAe,[Eit],!0),[Fo.toString()]:new wi(cAe,[],!0),[_d.toString()]:new wi(dAe,[],!0),[F6.toString()]:new wi(x8t,[],!0)}}function M8t(s,e){btt(),Ait[s]=e}function N8t(s,e){if(s.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const n of s){if(n===!0)return Promise.resolve(!0);Qy(n)&&t.push(n.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return Zs.settled(t).then(()=>i)}var qW;(function(s){s[s.WebSocket=0]="WebSocket",s[s.Managed=1]="Managed"})(qW||(qW={}));class xit{constructor(e){this.id=e,this.type=qW.Managed}toString(){return`Managed(${this.id})`}}class Dit{constructor(e,t){this.host=e,this.port=t,this.type=qW.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var ed;(function(s){s.Unknown="Unknown",s.NotAvailable="NotAvailable",s.TemporarilyNotAvailable="TemporarilyNotAvailable",s.NoResolverFound="NoResolverFound",s.InvalidAuthority="InvalidAuthority"})(ed||(ed={}));let fD=class C0 extends La{static isNotAvailable(e){return e instanceof C0&&e._code===ed.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof C0&&e._code===ed.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof C0&&e._code===ed.NoResolverFound}static isInvalidAuthority(e){return e instanceof C0&&e._code===ed.InvalidAuthority}static isHandled(e){return e instanceof C0&&e.isHandled}constructor(e,t=ed.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===ed.NotAvailable&&i===!0,Object.setPrototypeOf(this,C0.prototype)}};function uee(s){const e=s.indexOf("+");return e===-1?s:s.substring(0,e)}class P8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class pD{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const n=i.getExtensionDescription(e);return n?!!((n.main||n.browser)&&n.api==="none"):!1}constructor(e,t){this._activationEventsReader=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(U8t),this._extensionsMap=new va,this._extensionsArr=[],this._activationMap=new Map;for(const e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);const t=this._activationEventsReader.readActivationEvents(e);for(const i of t)this._activationMap.has(i)||this._activationMap.set(i,[]),this._activationMap.get(i).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(e,t){this._extensionDescriptions=w5e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=pD._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=w5e(this._extensionDescriptions,i.map(n=>n.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new P8t(this._versionId,i)}static _findLoopingExtensions(e){const t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(a){this._nodesSet.has(a)||(this._nodesSet.add(a),this._nodesArr.push(a))}addArc(a,c){this.addNode(a),this.addNode(c),this._arcs.has(a)?this._arcs.get(a).push(c):this._arcs.set(a,[c])}getArcs(a){return this._arcs.has(a)?this._arcs.get(a):[]}hasOnlyGoodArcs(a,c){const l=t.getArcs(a);for(let d=0;dt.getArcs(a).length===0).forEach(a=>n.add(a));const o=t.getNodes().filter(a=>!n.has(a));let r;do{r=!1;for(let a=0;ai.get(a))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){const t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new F8t(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){const t=this._extensionsMap.get(e);return t||void 0}getExtensionDescriptionByUUID(e){for(const t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}}class F8t{constructor(e,t){this.versionId=e,this.extensions=t}}class O8t{constructor(e){this._lock=new H8t,this._actual=new pD(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new B8t(this,t)}deltaExtensions(e,t,i){if(!e.isAcquiredFor(this))throw new Error("Lock is not held");return this._actual.deltaExtensions(t,i)}containsActivationEvent(e){return this._actual.containsActivationEvent(e)}containsExtension(e){return this._actual.containsExtension(e)}getExtensionDescriptionsForActivationEvent(e){return this._actual.getExtensionDescriptionsForActivationEvent(e)}getAllExtensionDescriptions(){return this._actual.getAllExtensionDescriptions()}getSnapshot(){return this._actual.getSnapshot()}getExtensionDescription(e){return this._actual.getExtensionDescription(e)}getExtensionDescriptionByUUID(e){return this._actual.getExtensionDescriptionByUUID(e)}getExtensionDescriptionByIdOrUUID(e,t){return this._actual.getExtensionDescriptionByIdOrUUID(e,t)}}class B8t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class W8t{constructor(e){this.name=e;const t=M2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class H8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new W8t(e);return this._pendingCustomers.push(t),this._advance(),t.promise}_advance(){if(this._isLocked||this._pendingCustomers.length===0)return;const e=this._pendingCustomers.shift();this._isLocked=!0;let t=!0;const i=setTimeout(()=>{t&&console.warn(`The customer named ${e.name} has been holding on to the lock for 30s. This might be a problem.`)},30*1e3),n=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(n))}}var FE;(function(s){s[s.Builtin=0]="Builtin",s[s.User=1]="User",s[s.Dev=2]="Dev"})(FE||(FE={}));function U8t(s,e){const t=s.isBuiltin?FE.Builtin:s.isUnderDevelopment?FE.Dev:FE.User,i=e.isBuiltin?FE.Builtin:e.isUnderDevelopment?FE.Dev:FE.User;if(t!==i)return t-i;const n=Vi.basename(s.extensionLocation.path),o=Vi.basename(e.extensionLocation.path);return no?1:0}function w5e(s,e){const t=new A_(e);return s.filter(i=>!t.has(i.identifier))}function FNe(s){const e=s.isExtensionDevelopment;let t=!0;const i=s.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==pe.file&&(t=!1);const n=t&&typeof s.debugExtensionHost.port=="number",o=t&&!!s.debugExtensionHost.break,r=e&&!!s.extensionTestsLocationURI&&!s.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:n,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var lo;(function(s){s[s.LocalProcess=1]="LocalProcess",s[s.LocalWebWorker=2]="LocalWebWorker",s[s.Remote=3]="Remote"})(lo||(lo={}));function pS(s){if(s===null)return"None";switch(s){case lo.LocalProcess:return"LocalProcess";case lo.LocalWebWorker:return"LocalWebWorker";case lo.Remote:return"Remote"}}var Qg;(function(s){s[s.None=0]="None",s[s.Local=1]="Local",s[s.Remote=2]="Remote"})(Qg||(Qg={}));function V8t(s){switch(s){case Qg.None:return"None";case Qg.Local:return"Local";case Qg.Remote:return"Remote"}}function z8t(s,e,t,i){const n=y5e(s,t),o=y5e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=n.get(l.key)||null,h=o.get(l.key)||null,u=new G8t(d,h);r.set(u.key,u)};n.forEach(l=>a(l)),o.forEach(l=>a(l));const c=new Map;return r.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=Qg.None;u&&!f?p=Qg.Local:f&&!u&&(p=Qg.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function y5e(s,e){const t=new Map;return s.forEach(i=>{const n=new $8t(i,e(i));t.set(n.key,n)}),t}class $8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Sn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class G8t{constructor(e,t){this.local=e,this.remote=t}get key(){return this.local?this.local.key:this.remote.key}get identifier(){return this.local?this.local.desc.identifier:this.remote.desc.identifier}get kind(){return this.local?this.local.kind:this.remote.kind}}function Gi(s){return function(e){QW.INSTANCE.registerNamedCustomer(s,e)}}function QN(s){QW.INSTANCE.registerCustomer(s)}var gee;(function(s){function e(){return QW.INSTANCE.getNamedCustomers()}s.getNamedCustomers=e;function t(){return QW.INSTANCE.getCustomers()}s.getCustomers=t})(gee||(gee={}));const Uoe=class Uoe{constructor(){this._namedCustomers=[],this._customers=[]}registerNamedCustomer(e,t){const i=[e,t];this._namedCustomers.push(i)}getNamedCustomers(){return this._namedCustomers}registerCustomer(e){this._customers.push(e)}getCustomers(){return this._customers}};Uoe.INSTANCE=new Uoe;let QW=Uoe;function kit(s,e,t,i){if(!s||i>200)return null;if(typeof s=="object"){if(s.$mid===ws.Uri)return t?N.revive(e.transformIncoming(s)):e.transformIncoming(s);if(s instanceof $e)return null;for(const n in s)if(Object.hasOwnProperty.call(s,n)){const o=kit(s[n],e,t,i+1);o!==null&&(s[n]=o)}}return null}function k4(s,e){const t=kit(s,e,!1,0);return t===null?s:t}class Iit{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||(this._actual=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)})),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):vt(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}}class K8t extends Iit{constructor(){super(),this._hasErr=!0,this._err=new Ma}}const Voe=class Voe{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++Voe.count}};Voe.count=0;let fee=Voe;const Tit=[];function je(s){const e=new fee(s);return Tit[e.nid]=e,e}function NK(s){return Tit[s].sid}class jd{constructor(e){this.value=e}}var C5e;function uAe(s,e){try{return JSON.stringify(s,e)}catch{return"null"}}const ONe="$$ref$$",q8t={[ONe]:-1};function S5e(s,e=null,t=!1){const i=[];return{jsonString:(t?uAe:JSON.stringify)(s,(o,r)=>{if(typeof r>"u")return q8t;if(typeof r=="object"){if(r instanceof $e){const a=i.push(r)-1;return{[ONe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function Lit(s,e,t){return JSON.parse(s,(i,n)=>{if(n){const o=n[ONe];if(typeof o=="number")return e[o];if(t&&n.$mid===ws.Uri)return t.transformIncoming(n)}return n})}function A5e(s,e){return JSON.stringify(s,e)}function Q8t(s){return s?(e,t)=>t&&t.$mid===ws.Uri?s.transformOutgoing(t):t:null}var Rg;(function(s){s[s.LocalSide=0]="LocalSide",s[s.OtherSide=1]="OtherSide"})(Rg||(Rg={}));var OT;(function(s){s[s.Responsive=0]="Responsive",s[s.Unresponsive=1]="Unresponsive"})(OT||(OT={}));const j8t=()=>{},Y8t=Symbol.for("rpcProtocol"),J8t=Symbol.for("rpcProxy"),Xz=class Xz extends V{constructor(e,t=null,i=null){super(),this[C5e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=Q8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let n=0,o=fee.count;nthis._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(n=>this._receiveOneMessage(n)))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(xy())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+Xz.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+Xz.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(OT.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(OT.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?k4(e,this._uriTransformer):e}getProxy(e){const{nid:t,sid:i}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,i)),this._proxies[t]}_createProxy(e,t){const i={get:(n,o)=>(typeof o=="string"&&!n[o]&&o.charCodeAt(0)===B.DollarSign&&(n[o]=(...r)=>this._remoteCall(e,o,r)),o===J8t?t:n[o])};return new Proxy(Object.create(null),i)}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,i=e.length;th.cancel()}else c=this._invokeHandler(i,n,o),l=j8t;this._cancelInvokedHandlers[a]=l;const d=Ep.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,Rg.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Ep.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,Rg.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Ep.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,Rg.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,Rg.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,Rg.LocalSide,"receiveReply:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,Rg.LocalSide,"receiveReplyErr:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n];let r;i&&(i.$isError?(r=new Error,r.name=i.name,r.message=i.message,r.stack=i.stack):r=i),o.resolveErr(r)}_invokeHandler(e,t,i){try{return Promise.resolve(this._doInvokeHandler(e,t,i))}catch(n){return Promise.reject(n)}}_doInvokeHandler(e,t,i){const n=this._locals[e];if(!n)throw new Error("Unknown actor "+NK(e));const o=n[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+NK(e));return o.apply(n,i)}_remoteCall(e,t,i){if(this._isDisposed)return new K8t;let n=null;if(i.length>0&&He.isCancellationToken(i[i.length-1])&&(n=i.pop()),n&&n.isCancellationRequested)return Promise.reject(xy());const o=Ep.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new Iit,l=new Z;n&&l.add(n.onCancellationRequested(()=>{const h=Ep.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,Rg.LocalSide,"cancel"),this._protocol.send(Ep.serializeCancel(r))})),this._pendingRPCReplies[a]=new X8t(c,l),this._onWillSendRequest(r);const d=Ep.serializeRequest(r,e,t,o,!!n);return this._logger?.logOutgoing(d.byteLength,r,Rg.LocalSide,`request: ${NK(e)}.${t}(`,i),this._protocol.send(d),c}};C5e=Y8t,Xz.UNRESPONSIVE_TIME=3*1e3;let pee=Xz;class X8t{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}}var wk;let Tc=(wk=class{static alloc(e,t,i){const n=new wk($e.alloc(i+1+4),0);return n.writeUInt8(e),n.writeUInt32(t),n}static read(e,t){return new wk(e,t)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){const e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){const e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){const e=this._buff.readUInt8(this._offset);this._offset+=1;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let i=0,n=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let n=0,o=e.length;n"u")i[n]={type:wl.Undefined};else if(r instanceof jd){const{jsonString:a,referencedBuffers:c}=S5e(r.value,t);i[n]={type:wl.SerializedObjectWithBuffers,value:$e.fromString(a),buffers:c}}else i[n]={type:wl.String,value:$e.fromString(A5e(r,t))}}return{type:CF.Mixed,args:i}}return{type:CF.Simple,args:A5e(e,t)}}static serializeRequest(e,t,i,n,o){switch(n.type){case CF.Simple:return this._requestJSONArgs(e,t,i,n.args,o);case CF.Mixed:return this._requestMixedArgs(e,t,i,n.args,o)}}static _requestJSONArgs(e,t,i,n,o){const r=$e.fromString(i),a=$e.fromString(n);let c=0;c+=Tc.sizeUInt8(),c+=Tc.sizeShortString(r),c+=Tc.sizeLongString(a);const l=Tc.alloc(o?ga.RequestJSONArgsWithCancellation:ga.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(r),l.writeLongString(a),l.buffer}static deserializeRequestJSONArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(n)}}static _requestMixedArgs(e,t,i,n,o){const r=$e.fromString(i);let a=0;a+=Tc.sizeUInt8(),a+=Tc.sizeShortString(r),a+=Tc.sizeMixedArray(n);const c=Tc.alloc(o?ga.RequestMixedArgsWithCancellation:ga.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(n),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readMixedArray(),o=new Array(n.length);for(let r=0,a=n.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof $e)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof jd){const{jsonString:n,referencedBuffers:o}=S5e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,n,o)}else return this._serializeReplyOKJSON(e,uAe(t,i))}static _serializeReplyOKEmpty(e){return Tc.alloc(ga.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=Tc.sizeVSBuffer(t);const n=Tc.alloc(ga.ReplyOKVSBuffer,e,i);return n.writeVSBuffer(t),n.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=$e.fromString(t);let n=0;n+=Tc.sizeLongString(i);const o=Tc.alloc(ga.ReplyOKJSON,e,n);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const n=$e.fromString(t);let o=0;o+=Tc.sizeUInt32,o+=Tc.sizeLongString(n);for(const a of i)o+=Tc.sizeVSBuffer(a);const r=Tc.alloc(ga.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(n);for(const a of i)r.writeBuffer(a);return r.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),n=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:pS(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${pS(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:pS(this.kind)};return l&&l.name&&(d.errorName=l.name),l&&l.message&&(d.errorMessage=l.message),l&&l.stack&&(d.errorStack=l.stack),this._telemetryService.publicLog2("extensionHostStartup",d),null}),this._proxy.then(()=>{t.forEach(l=>this.activateByEvent(l,Nb.Normal)),this._register(i3t({measure:()=>this.measure()}))})}dispose(){this._extensionHost&&this._extensionHost.dispose(),this._rpcProtocol&&this._rpcProtocol.dispose();for(let e=0,t=this._customers.length;ethis._onDidChangeResponsiveState.fire(l)));let n=null,o=[];const r={remoteAuthority:this._extensionHost.remoteAuthority,extensionHostKind:this.kind,getProxy:l=>this._rpcProtocol.getProxy(l),set:(l,d)=>this._rpcProtocol.set(l,d),dispose:()=>this._rpcProtocol.dispose(),assertRegistered:l=>this._rpcProtocol.assertRegistered(l),drain:()=>this._rpcProtocol.drain(),internalExtensionService:this._internalExtensionService,_setExtensionHostProxy:l=>{n=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=gee.getNamedCustomers();for(let l=0,d=a.length;l`[${pS(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${uee(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${n()}${l}`),r=(l,d=void 0)=>this._logService.error(`${n()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:ed.Unknown,detail:void 0}};o("invoking...");const c=new J7;try{c.cancelAndSet(()=>o("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?o(`returned ${l.value.authority.connectTo}`):r("returned an error",l.error),l}catch(l){return c.dispose(),r("returned an error",l),{type:"error",error:{message:l.message,code:ed.Unknown,detail:l}}}}async getCanonicalURI(e,t){const i=await this._proxy;if(!i)throw new Error("Cannot resolve canonical URI");return i.getCanonicalURI(e,t)}async start(e,t,i){const n=await this._proxy;if(!n)return;const o=this._extensionHost.extensions.set(e,t,i);return n.startExtensionHost(o)}async extensionTestsExecute(){const e=await this._proxy;if(!e)throw new Error("Could not obtain Extension Host Proxy");return e.extensionTestsExecute()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){const t=await this._proxy;if(!t)return;const i=this._extensionHost.extensions.delta(e);if(i)return t.deltaExtensions(i)}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async setRemoteEnvironment(e){const t=await this._proxy;if(t)return t.setRemoteEnvironment(e)}};mee=qQ=D([_(3,we),_(4,Jr),_(5,Yi),_(6,Ge)],mee);function Rit(s,e){return e?`${pS(s)} pid: ${e}`:`${pS(s)}`}const Z8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function E5e(s){if(Array.isArray(s))return s;if(s&&typeof s=="object"&&typeof s.toString=="function"){const e=s.toString();if(e!=="[object Object]")return e}return s}function e3t(s){return Array.isArray(s)?s.map(E5e):E5e(s)}class t3t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,n,o,r,a){a=e3t(a);const c=Z8t[o],l=c[n%c.length];let d=[`%c[${pS(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(n).padStart(5)} - ${r}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(r)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,n,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,n,o)}logOutgoing(e,t,i,n,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,n,o)}}let _ee=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,n){if(i===Rg.LocalSide&&/^receiveReply(Err)?:/.test(n)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n} ${o}`,length:e})}i===Rg.OtherSide&&/^receiveRequest /.test(n)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n}`,length:e})}logOutgoing(e,t,i,n){i===Rg.LocalSide&&n.startsWith("request: ")&&(this._pendingRequests.set(t,n),this._telemetryService.publicLog2("extensionhost.outgoing",{type:n,length:e}))}};_ee=D([_(0,Yi)],_ee);const LV=[];function i3t(s){return LV.push(s),{dispose:()=>{for(let e=0;en.measure()));t.openEditor({resource:void 0,contents:i.map(QQ._print).join(` `),options:{pinned:!0}})}static _print(e){return e?`${e.remoteAuthority?`Authority: ${e.remoteAuthority} `:""}Roundtrip latency: ${e.latency.toFixed(3)}ms -Up: ${bX._printSpeed(e.up)} -Down: ${bX._printSpeed(e.down)} -`:""}static _printSpeed(e){return e<=1024?`${e} bps`:e<1024*1024?`${(e/1024).toFixed(1)} kbps`:`${(e/1024/1024).toFixed(1)} Mbps`}});class Une{constructor(e){this.affinity=e,this.kind=Ao.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class kDe{constructor(e){this.affinity=e,this.kind=Ao.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class Vne{constructor(){this.kind=Ao.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let IDe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,s,o,r){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=s,this._logService=o,this._extensionManifestPropertiesService=r,this._runningLocation=new Ga,this._maxLocalProcessAffinity=0,this._maxLocalWebWorkerAffinity=0}set(e,t){this._runningLocation.set(e,t)}readExtensionKinds(e){return e.isUnderDevelopment&&this._environmentService.extensionDevelopmentKind?this._environmentService.extensionDevelopmentKind:this._extensionManifestPropertiesService.getExtensionKind(e)}getRunningLocation(e){return this._runningLocation.get(e)||null}filterByRunningLocation(e,t){return CX(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return CX(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return CX(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const s=new Ga;for(const h of e)(h.main||h.browser)&&s.set(h.identifier,h);for(const h of this._registry.getAllExtensionDescriptions())if(h.main||h.browser){const u=this._runningLocation.get(h.identifier);u&&u.kind===t&&s.set(h.identifier,h)}const o=new Ga;let r=0;for(const[h,u]of s)o.set(u.identifier,++r);const a=(h,u)=>{for(const[f,p]of o)p===h&&o.set(f,u)};for(const[h,u]of s){if(!u.extensionDependencies)continue;const f=o.get(u.identifier);for(const p of u.extensionDependencies){const m=o.get(p);m&&m!==f&&a(m,f)}}const c=new Map;let l=0;for(const[h,u]of s){const f=this._runningLocation.get(u.identifier);if(f){const p=o.get(u.identifier);c.set(p,f.affinity),l=Math.max(l,f.affinity)}}if(!this._environmentService.isExtensionDevelopment){const h=this._configurationService.getValue("extensions.experimental.affinity")||{},u=Object.keys(h),f=new Map;for(const p of u){const m=h[p];if(typeof m!="number"||m<=0||Math.floor(m)!==m){this._logService.info(`Ignoring configured affinity for '${p}' because the value is not a positive integer.`);continue}const v=o.get(p);if(!v)continue;const w=c.get(v);if(w){f.set(m,w);continue}const b=f.get(m);if(b){c.set(v,b);continue}if(!i){this._logService.info(`Ignoring configured affinity for '${p}' because extension host(s) are already running. Reload window.`);continue}const C=++l;f.set(m,C),c.set(v,C)}}const d=new Ga;for(const h of e){const u=o.get(h.identifier)||0,f=c.get(u)||0;d.set(h.identifier,f)}if(l>0&&i)for(let h=1;h<=l;h++){const u=[];for(const f of e)d.get(f.identifier)===h&&u.push(f.identifier);this._logService.info(`Placing extension(s) ${u.map(f=>f.value).join(", ")} on a separate extension host.`)}return{affinities:d,maxAffinity:l}}computeRunningLocation(e,t,i){return this._doComputeRunningLocation(this._runningLocation,e,t,i).runningLocation}_doComputeRunningLocation(e,t,i,s){t=t.filter(p=>!e.has(p.identifier)),i=i.filter(p=>!e.has(p.identifier));const o=k8t(t,i,p=>this.readExtensionKinds(p),(p,m,v,w,b)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,w,b)),r=new Ga;for(const p of t)r.set(p.identifier,p);for(const p of i)r.set(p.identifier,p);const a=new Ga,c=[],l=[];for(const[p,m]of o){let v=null;if(m===Ao.LocalProcess){const w=r.get(p);w&&c.push(w)}else if(m===Ao.LocalWebWorker){const w=r.get(p);w&&l.push(w)}else m===Ao.Remote&&(v=new Vne);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,Ao.LocalProcess,s);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new Une(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,Ao.LocalWebWorker,s);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new kDe(m))}for(const[p,m]of e)m&&a.set(p,m);return{runningLocation:a,maxLocalProcessAffinity:h,maxLocalWebWorkerAffinity:f}}initializeRunningLocation(e,t){const{runningLocation:i,maxLocalProcessAffinity:s,maxLocalWebWorkerAffinity:o}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=s,this._maxLocalWebWorkerAffinity=o}deltaExtensions(e,t){const i=new Ga;for(const s of t){const o=s;i.set(o,this._runningLocation.get(o)||null),this._runningLocation.delete(o)}return this._updateRunningLocationForAddedExtensions(e),i}_updateRunningLocationForAddedExtensions(e){const t=[],i=[];for(const r of e){const a=this.readExtensionKinds(r),c=r.extensionLocation.scheme===_e.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(r.identifier,a,!c,c,rp.None);let d=null;l===Ao.LocalProcess?t.push(r):l===Ao.LocalWebWorker?i.push(r):l===Ao.Remote&&(d=new Vne),this._runningLocation.set(r.identifier,d)}const{affinities:s}=this._computeAffinity(t,Ao.LocalProcess,!1);for(const r of t){const a=s.get(r.identifier)||0;this._runningLocation.set(r.identifier,new Une(a))}const{affinities:o}=this._computeAffinity(i,Ao.LocalWebWorker,!1);for(const r of i){const a=o.get(r.identifier)||0;this._runningLocation.set(r.identifier,new kDe(a))}}};IDe=D([_(2,ec),_(3,Re),_(4,Ze),_(5,G_)],IDe);function CX(n,e,t){return n.filter(i=>{const s=e.get(i.identifier);return s&&t(s)})}function $8t(n,e,t){return n.filter(i=>{const s=e.get(i);return s&&t(s)})}let LDe=class extends ${get pid(){return this._actual?this._actual.pid:null}get kind(){return this._extensionHost.runningLocation.kind}get startup(){return this._extensionHost.startup}get friendyName(){return Qst(this.kind,this.pid)}constructor(e,t,i,s){super(),this._internalExtensionService=t,this._instantiationService=i,this._logService=s,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._extensionHost=e,this.onDidExit=e.onExit,this._startCalled=new Uh,this._actual=null,this._lazyStartExtensions=null}_createActual(e){return this._logService.info(`Creating lazy extension host (${this.friendyName}). Reason: ${e}`),this._actual=this._register(this._instantiationService.createInstance(Wne,this._extensionHost,[],this._internalExtensionService)),this._register(this._actual.onDidChangeResponsiveState(t=>this._onDidChangeResponsiveState.fire(t))),this._actual}async _getOrCreateActualAndStart(e){if(this._actual)return this._actual;const t=this._createActual(e);return await t.start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions),t}async ready(){await this._startCalled.wait(),this._actual&&await this._actual.ready()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){if(await this._startCalled.wait(),this._actual)return this._actual.deltaExtensions(e);if(this._lazyStartExtensions.delta(e),e.myToAdd.length>0){await this._createActual(`contains ${e.myToAdd.length} new extension(s) (installed or enabled): ${e.myToAdd.map(i=>i.value)}`).start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions);return}}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async activate(e,t){return await this._startCalled.wait(),this._actual?this._actual.activate(e,t):!1}async activateByEvent(e,t){if(t===sC.Immediate)return this._actual?this._actual.activateByEvent(e,t):void 0;if(await this._startCalled.wait(),this._actual)return this._actual.activateByEvent(e,t)}activationEventIsDone(e){return this._startCalled.isOpen()?this._actual?this._actual.activationEventIsDone(e):!0:!1}async getInspectPort(e){return await this._startCalled.wait(),this._actual?.getInspectPort(e)}async resolveAuthority(e,t){return await this._startCalled.wait(),this._actual?this._actual.resolveAuthority(e,t):{type:"error",error:{message:"Cannot resolve authority",code:Xd.Unknown,detail:void 0}}}async getCanonicalURI(e,t){if(await this._startCalled.wait(),this._actual)return this._actual.getCanonicalURI(e,t);throw new Error("Cannot resolve canonical URI")}async start(e,t,i){if(i.length>0){const o=this._createActual(`contains ${i.length} extension(s): ${i.map(r=>r.value)}.`).start(e,t,i);return this._startCalled.open(),o}this._lazyStartExtensions=new xJ(e,t,i),this._startCalled.open()}async extensionTestsExecute(){return await this._startCalled.wait(),(await this._getOrCreateActualAndStart("execute tests.")).extensionTestsExecute()}async setRemoteEnvironment(e){if(await this._startCalled.wait(),this._actual)return this._actual.setRemoteEnvironment(e)}};LDe=D([_(2,be),_(3,Ze)],LDe);var zne;(function(n){n[n.Information=1]="Information",n[n.Warning=2]="Warning"})(zne||(zne={}));const jst="⟪ ",Kst=" characters skipped ⟫",G8t=(jst.length+Kst.length+5)*2;var h8;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(h8||(h8={}));var z1;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(z1||(z1={}));function q8t(n){return!!n.preview}var Q3e;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(Q3e||(Q3e={}));class Q8t{constructor(e,t,i,s){this.ranges=t,this.webviewIndex=s;const o=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&j8t(o)){e=Ult(e,i.matchLines);let r="",a=0,c=0;const l=Math.floor(i.charsPerLine/5),d=[];for(const h of o){const u=Math.max(h.startColumn-l,0),f=h.startColumn+i.charsPerLine;if(u>c+l+G8t){const p=jst+(u-c)+Kst;r+=p+e.slice(u,f),a+=u-(c+p.length)}else r+=e.slice(c,f);d.push(new K8t(0,h.startColumn-a,h.endColumn-a)),c=f}this.preview={text:r,matches:Array.isArray(this.ranges)?d:d[0]}}else{const r=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber;this.preview={text:e,matches:u9(t,a=>new Yst(a.startLineNumber-r,a.startColumn,a.endLineNumber-r,a.endColumn))}}}}function j8t(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class Yst{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class K8t extends Yst{constructor(e,t,i){super(e,t,e,i)}}var j3e;(function(n){n.List="list",n.Tree="tree"})(j3e||(j3e={}));var K3e;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(K3e||(K3e={}));function Y8t(n,e=!0){const t=n&&n.files&&n.files.exclude,i=e&&n&&n.search&&n.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i;let s=Object.create(null);return s=Sm(s,Vs(t)),s=Sm(s,Vs(i),!0),s}function Y3e(n,e){return n.excludePattern&&WW(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&WW(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(mZ(e,i)){const s=LU(i,e);return!t.includePattern||!!WW(t.includePattern,s)}else return!1}):!1:!0}var J3e;(function(n){n[n.unknownEncoding=1]="unknownEncoding",n[n.regexParseError=2]="regexParseError",n[n.globParseError=3]="globParseError",n[n.invalidLiteral=4]="invalidLiteral",n[n.rgProcessError=5]="rgProcessError",n[n.other=6]="other",n[n.canceled=7]="canceled"})(J3e||(J3e={}));function $ne(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class Jst{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=_w(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=_w(i))}matchesExcludesSync(e,t,i){return!!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i))}includedInQuerySync(e,t,i){return!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,i))}includedInQuery(e,t,i){const s=this._parsedExcludeExpression(e,t,i),o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return NS(s)?s.then(r=>r?!1:o()):o()}hasSiblingExcludeClauses(){return J8t(this._excludeExpression)}}function J8t(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function X8t(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?Xst(i):{})),e.then(i=>!!i[t]))}function Z8t(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?Xst(i):{}}return!!e[t]}}function Xst(n){const e={};for(const t of n)e[t]=!0;return e}const e9t="vs/workbench/services/search/common/queryBuilder";let Gne=class{constructor(e,t,i,s,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=s,this.pathService=o}text(e,t,i={}){e=this.getContentPattern(e,i);const s=this.configurationService.getValue(),o=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(wee),i),type:z1.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:s.search.usePCRE2||o||!1,beforeContext:i.beforeContext,afterContext:i.afterContext,userDisabledExcludesAndIgnoreFiles:i.disregardExcludeSettings&&i.disregardIgnoreFiles}}getContentPattern(e,t){const i=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,"\\n"));const s={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(s.isCaseSensitive=!0),this.isMultiline(e)&&(s.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),s}file(e,t={}){return{...this.commonQuery(e,t),type:z1.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){return e?(e=Array.isArray(e)?e.map(yX):yX(e),t?this.parseSearchPaths(e):{pattern:Upe(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),s=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),o=e.length>1,r=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,s)):e.map(l=>this.getFolderQueryForRoot(l,t,s,o))).filter(l=>!!l),a={_reason:t._reason,folderQueries:r,usingSearchPaths:!!(i.searchPaths&&i.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:s.pattern,includePattern:i.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults};if(t.onlyOpenEditors){const l=Vi(this.editorGroupsService.groups.flatMap(u=>u.editors.map(f=>f.resource)));this.logService.trace("QueryBuilder#commonQuery - openEditor URIs",JSON.stringify(l));const d=l.filter(u=>Y3e(a,u.fsPath)),h=this.commonQueryFromFileList(d);return this.logService.trace("QueryBuilder#commonQuery - openEditor Query",JSON.stringify(h)),{...a,...h}}const c=t.extraFileResources&&t.extraFileResources.filter(l=>Y3e(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new wi,s={};let o=!1;return e.forEach(r=>{if(r.scheme===_e.walkThrough)return;if(KQe(r)){const c=this.workspaceContextService.getWorkspaceFolder(r)?.uri??r.with({path:lS(r.fsPath)});let l=i.get(c);l||(o=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=LU(c.fsPath,r.fsPath);ws(l.includePattern)[d.replace(/\\/g,"/")]=!0}else r.fsPath&&(o=!0,s[r.fsPath]=!0)}),{folderQueries:t,includePattern:s,usingSearchPaths:!0,excludePattern:o?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(C_e(e.pattern,!0))return!0}else if(C_e(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&Xje(e.pattern)||e.pattern.indexOf(` -`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>oF(h)||/^\.\.?([\/\\]|$)/.test(h),s=(Array.isArray(e)?e:i9t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?oPt(h,u.scheme===_e.file?u.fsPath:u.path):h}),o=cQe(s,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>IS(h,"/")).map(h=>IS(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),n9t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=Upe(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:Y8t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(s=>{let{pathPortion:o,globPortion:r}=t9t(s);return r&&(r=Vpe(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(s=>{const o=s.searchPath.toString(),r=i.get(o);r?s.pattern&&(r.pattern=r.pattern||{},r.pattern[s.pattern]=!0):i.set(o,{searchPath:s.searchPath,pattern:s.pattern?Upe(s.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(oF(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==_e.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:P.file(d1(e))}]}if(this.workspaceContextService.getWorkbenchState()===Nn.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=yX(e),e.startsWith("../")||e===".."){const s=Qi.resolve(t.path,e);return[{searchPath:t.with({path:s})}]}const i=Vpe(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),s=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Iu(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(yl);if(s.length)return s.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&Vpe(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(e9t,0,"Workspace folder does not exist: {0}",r);throw new Error(a)}}}}resolveOneSearchPathPattern(e,t){const i=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,s=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&s.push({searchPath:e.searchPath,pattern:i+"/**"}),s}getFolderQueryForSearchPath(e,t,i){const s=this.getFolderQueryForRoot(wee(e.searchPath),t,i,!1);return s?{...s,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,s){let o;const r=P.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>_n(u.searchPath,r))[0];if(h&&!h.pattern)return null;h&&(o=h.pattern)}const a=this.configurationService.getValue({resource:r}),l={...this.getExcludesForFolder(a,t)||{},...o||{}},d=P.isUri(e)?ui(e):e.name;return{folder:r,folderName:s?d:void 0,excludePattern:Object.keys(l).length>0?l:void 0,fileEncoding:a.files&&a.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles=="boolean"?t.disregardIgnoreFiles:!a.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles=="boolean"?t.disregardGlobalIgnoreFiles:!a.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles=="boolean"?t.disregardParentIgnoreFiles:!a.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks=="boolean"?t.ignoreSymlinks:!a.search?.followSymlinks}}};Gne=D([_(0,Re),_(1,Ti),_(2,ur),_(3,Ze),_(4,Tm)],Gne);function t9t(n){const e=n.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=n.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let s=n.substr(0,i.index);return s.match(/[/\\]/)||(s+="/"),{pathPortion:s,globPortion:n.substr((i.index||0)+1)}}}return{pathPortion:n}}function Upe(...n){return n.length?n.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function i9t(n){return Qwe(n,",").map(e=>e.trim()).filter(e=>!!e.length)}function n9t(n){return[`**/${n}/**`,`**/${n}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function yX(n){return n.replace(/\\/g,"/")}function Vpe(n){return yX(n).replace(/^\.\//,"").replace(/\/+$/g,"")}const s9t=7e3;function Zst(n,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],s=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||n.forceUsingSearch?s.push(h):i.push(h)}if(i.length===0&&s.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=NU(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>o9t(n,d,a))).then(()=>{}),l=r9t(n,e.identifier,s,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function o9t(n,e,t){for(const i of n.folders)if(await n.exists(Qt(P.revive(i),e))){t(`workspaceContains:${e}`);return}}async function r9t(n,e,t,i){if(t.length===0)return Promise.resolve(void 0);const s=new ai,o=n.checkExists(n.folders,t,s.token),r=setTimeout(async()=>{s.cancel(),n.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},s9t);let a=!1;try{a=await o}catch(c){Na(c)||bt(c)}s.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function eot(n,e,t,i){const s=n.get(be),o=n.get(ohe),a=s.createInstance(Gne).file(e.map(c=>wee(P.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Na(c)?!1:Promise.reject(c))}var TDe;const Yw="vs/workbench/services/extensions/common/abstractExtensionService",zpe=Object.hasOwnProperty,a9t=Promise.resolve(void 0);let RDe=TDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=s,this._notificationService=o,this._environmentService=r,this._telemetryService=a,this._extensionEnablementService=c,this._fileService=l,this._productService=d,this._extensionManagementService=h,this._contextService=u,this._configurationService=f,this._extensionManifestPropertiesService=p,this._logService=m,this._remoteAgentService=v,this._remoteExtensionsScannerService=w,this._lifecycleService=b,this._remoteAuthorityResolverService=C,this._dialogService=y,this._onDidRegisterExtensions=this._register(new I),this.onDidRegisterExtensions=this._onDidRegisterExtensions.event,this._onDidChangeExtensionsStatus=this._register(new I),this.onDidChangeExtensionsStatus=this._onDidChangeExtensionsStatus.event,this._onDidChangeExtensions=this._register(new I({leakWarningThreshold:400})),this.onDidChangeExtensions=this._onDidChangeExtensions.event,this._onWillActivateByEvent=this._register(new I),this.onWillActivateByEvent=this._onWillActivateByEvent.event,this._onDidChangeResponsiveChange=this._register(new I),this.onDidChangeResponsiveChange=this._onDidChangeResponsiveChange.event,this._onWillStop=this._register(new I),this.onWillStop=this._onWillStop.event,this._activationEventReader=new u9t,this._registry=new y8t(this._activationEventReader),this._installedExtensionsReady=new Uh,this._extensionStatus=new Ga,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new NDe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=[],this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(S=>{S.scheme!==_e.vscodeRemote&&S.join(this.activateByEvent(`onFileSystem:${S.scheme}`))})),this._runningLocations=new IDe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(S=>{const M=[],k=[];for(const F of S)this._safeInvokeIsEnabled(F)?M.push(F):k.push(F);Vu&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${S.map(F=>F.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:S,removed:M})=>{(S.length||M.length)&&(Vu&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new rT(S,M)))})),this._register(this._extensionManagementService.onDidEnableExtensions(S=>{S.length&&(Vu&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new rT(S,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(S=>{const M=[];for(const{local:k,operation:F}of S)k&&k.isValid&&F!==Bx.Migrate&&this._safeInvokeIsEnabled(k)&&M.push(k);M.length&&(Vu&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${M.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(S=>{S.error||(Vu&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${S.identifier.id}`),this._handleDeltaExtensions(new rT([],[S.identifier.id])))})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.filter(t=>t.kind===e)}_getExtensionHostManagerByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.representsRunningLocation(e))return t;return null}async _handleDeltaExtensions(e){if(this._deltaExtensionsQueue.push(e),this._inHandleDeltaExtensions)return;let t=null;try{for(this._inHandleDeltaExtensions=!0,await this._installedExtensionsReady.wait(),t=await this._registry.acquireLock("handleDeltaExtensions");this._deltaExtensionsQueue.length>0;){const i=this._deltaExtensionsQueue.shift();await this._deltaExtensions(t,i.toAdd,i.toRemove)}}finally{this._inHandleDeltaExtensions=!1,t?.dispose()}}async _deltaExtensions(e,t,i){Vu&&this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${t.map(a=>a.identifier.id).join(",")}] toRemove: [${i.map(a=>typeof a=="string"?a:a.identifier.id).join(",")}]`);let s=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:s}),s=s.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",r.removedDueToLooping.map(a=>`'${a.identifier.value}'`).join(", "))}),this._extensionsProposedApi.updateEnabledApiProposals(o),this._doHandleExtensionPoints([].concat(o).concat(s)),await this._updateExtensionsOnExtHosts(r.versionId,o,s.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,s));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,s,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=$8t(s,o,l=>e.representsRunningLocation(l)),c=QW.createActivationEventsMap(i);if(Vu){const l=h=>h.map(u=>u.identifier.value).join(","),d=h=>h.map(u=>u.value).join(",");this._logService.info(`AbstractExtensionService: Calling deltaExtensions: toRemove: [${d(s)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:s,toAdd:i,addActivationEvents:c,myToRemove:a,myToAdd:r.map(l=>l.identifier)})}canAddExtension(e){return this._canAddExtension(e,[])}_canAddExtension(e,t){if(this._registry.getExtensionDescriptionByIdOrUUID(e.identifier,e.id)&&!t.some(c=>Cn.equals(e.identifier,c.identifier)))return!1;const s=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===_e.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,s,!o,o,rp.None)!==null}canRemoveExtension(e){const t=this._registry.getExtensionDescription(e.identifier);return!(!t||this._extensionStatus.get(t.identifier)?.activationStarted)}async _activateAddedExtensionIfNeeded(e){let t=!1,i=null,s=!1;const o=this._activationEventReader.readActivationEvents(e);for(const r of o){if(this._allRequestedActivateEvents.has(r)){t=!0,i=r;break}if(r==="*"){t=!0,i=r;break}if(/^workspaceContains/.test(r)&&(s=!0),r==="onStartupFinished"){t=!0,i=r;break}}if(t)await Promise.all(this._extensionHostManagers.map(r=>r.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:i}))).then(()=>{});else if(s){const r=await this._contextService.getCompleteWorkspace(),a=!!this._environmentService.remoteAuthority,c={logService:this._logService,folders:r.folders.map(d=>d.uri),forceUsingSearch:a,exists:d=>this._fileService.exists(d),checkExists:(d,h,u)=>this._instantiationService.invokeFunction(f=>eot(f,d,h,u))},l=await Zst(c,e);if(!l)return;await Promise.all(this._extensionHostManagers.map(d=>d.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:l.activationEvent}))).then(()=>{})}}async _initialize(){vs("code/willLoadExtensions"),this._startExtensionHostsIfNecessary(!0,[]);const e=await this._registry.acquireLock("_initialize");try{const t=await this._resolveExtensions();this._processExtensions(e,t);const i=this._registry.getSnapshot();for(const s of this._extensionHostManagers)if(s.startup!==Wx.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,s);s.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),vs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:s}=t,o=MDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=MDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,Ao.LocalWebWorker):[],c=s?this._runningLocations.filterByExtensionHostKind(o,Ao.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,Ao.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,Ao.Remote);for(const u of a)d9t(l,u.identifier)||l.push(u);const d=r.concat(c).concat(l),h=this._registry.deltaExtensions(e,d,[]);h.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",h.removedDueToLooping.map(u=>`'${u.identifier.value}'`).join(", "))}),this._doHandleExtensionPoints(this._registry.getAllExtensionDescriptions())}async _handleExtensionTests(){if(!this._environmentService.isExtensionDevelopment||!this._environmentService.extensionTestsLocationURI)return;const e=this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);if(!e){const i=g(Yw,1,"No extension host found that can launch the test runner at {0}.",this._environmentService.extensionTestsLocationURI.toString());console.error(i),this._notificationService.error(i);return}let t;try{t=await e.extensionTestsExecute(),Vu&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Vu&&this._logService.error("Extension host test runner error",i),console.error(i),t=1}this._onExtensionHostExit(t)}findTestExtensionHost(e){let t=null;for(const i of this._registry.getAllExtensionDescriptions())if(MS(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===_e.vscodeRemote?t=new Vne:t=new Une(0)),t!==null?this._getExtensionHostManagerByRunningLocation(t):null}_releaseBarrier(){this._installedExtensionsReady.open(),this._onDidRegisterExtensions.fire(void 0),this._onDidChangeExtensionsStatus.fire(this._registry.getAllExtensionDescriptions().map(e=>e.identifier))}async _resolveAuthorityInitial(e){for(let i=1;;i++)try{return this._resolveAuthorityWithLogging(e)}catch(s){if(HI.isNoResolverFound(s)||HI.isNotAvailable(s)||i>=5)throw s}}async _resolveAuthorityAgain(){const e=this._environmentService.remoteAuthority;if(e){this._remoteAuthorityResolverService._clearResolvedAuthority(e);try{const t=await this._resolveAuthorityWithLogging(e);this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options)}catch(t){this._remoteAuthorityResolverService._setResolvedAuthorityError(e,t)}}}async _resolveAuthorityWithLogging(e){const t=Pne(e),i=ao.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{vs(`code/willResolveAuthority/${t}`);const s=await this._resolveAuthority(e);return vs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${s.authority.connectTo}' after ${i.elapsed()} ms`),s}catch(s){throw vs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,s),s}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const s=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of s){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===Xd.Unknown,c=r.error.code===Xd.Unknown;a&&!c&&(o=r)}throw new HI(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e){return this._doStopExtensionHostsWithVeto(e)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);for(let t=this._extensionHostManagers.length-1;t>=0;t--)this._extensionHostManagers[t].dispose();this._extensionHostManagers=[];for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e){const t=[],i=new Set;this._onWillStop.fire({reason:e,veto(o,r){t.push(o),typeof o=="boolean"?o===!0&&i.add(r):o.then(a=>{a&&i.add(r)}).catch(a=>{i.add(g(Yw,2,"{0} (Error: {1})",r,Ma(a)))})}});const s=await w8t(t,o=>this._logService.error(o));if(!s)this._doStopExtensionHosts();else{const o=Array.from(i);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${o.join(", ")})`),await this._dialogService.warn(g(Yw,3,"The following operation was blocked: {0}",e),o.length===1?g(Yw,4,"The reason for blocking the operation: {0}",o[0]):g(Yw,5,`The reasons for blocking the operation: -- {0}`,o.join(` - -`)))}return!s}_startExtensionHostsIfNecessary(e,t){const i=[];for(let s=0;s<=this._runningLocations.maxLocalProcessAffinity;s++)i.push(new Une(s));for(let s=0;s<=this._runningLocations.maxLocalWebWorkerAffinity;s++)i.push(new kDe(s));i.push(new Vne);for(const s of i){if(this._getExtensionHostManagerByRunningLocation(s))continue;const o=this._createExtensionHostManager(s,e,t);o&&this._extensionHostManagers.push(o)}}_createExtensionHostManager(e,t,i){const s=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!s)return null;const o=this._doCreateExtensionHostManager(s,i);return o.onDidExit(([r,a])=>this._onExtensionHostCrashOrExit(o,r,a)),o.onDidChangeResponsiveState(r=>{this._logService.info(`Extension host (${o.friendyName}) is ${r===DM.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:r===DM.Responsive,getInspectListener:a=>o.getInspectPort(a)})}),o}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===Wx.Lazy&&t.length===0?this._instantiationService.createInstance(LDe,e,i):this._instantiationService.createInstance(Wne,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!hOe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){if(console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===Ao.LocalProcess)this._doStopExtensionHosts();else if(e.kind===Ao.Remote){i&&this._onRemoteExtensionHostCrashed(e,i);for(let s=0;s{const s=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(s),t(o)},i)})}async _onRemoteExtensionHostCrashed(e,t){try{const i=await this._getExtensionHostExitInfoWithTimeout(t);i&&this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly with code ${i.code}.`),this._logExtensionHostCrash(e),this._remoteCrashTracker.registerCrash(),this._remoteCrashTracker.shouldAutomaticallyRestart()?(this._logService.info("Automatically restarting the remote extension host."),this._notificationService.status(g(Yw,6,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(nt.Error,g(Yw,7,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(Yw,8,"Restart Remote Extension Host"),run:()=>{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))}}])}catch{}}_logExtensionHostCrash(e){const t=[];for(const i of this._extensionStatus.values())i.activationStarted&&e.containsExtension(i.id)&&t.push(i.id);t.length>0?this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. The following extensions were running: ${t.map(i=>i.value).join(", ")}`):this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. No extensions were activated.`)}async startExtensionHosts(e){this._doStopExtensionHosts(),e&&await this._handleDeltaExtensions(new rT(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(Ao.LocalProcess);await Promise.all(i.map(s=>s.ready()))}finally{t.dispose()}}activateByEvent(e,t=sC.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):a9t):(this._allRequestedActivateEvents.add(e),t===sC.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(s=>s.activateByEvent(e,t))).then(()=>{});return this._onWillActivateByEvent.fire({event:e,activation:i}),i}activateById(e,t){return this._activateById(e,t)}activationEventIsDone(e){return this._installedExtensionsReady.isOpen()?this._registry.containsActivationEvent(e)?this._extensionHostManagers.every(t=>t.activationEventIsDone(e)):!0:!1}whenInstalledExtensionsRegistered(){return this._installedExtensionsReady.wait()}get extensions(){return this._registry.getAllExtensionDescriptions()}_getExtensionRegistrySnapshotWhenReady(){return this._installedExtensionsReady.wait().then(()=>this._registry.getSnapshot())}getExtension(e){return this._installedExtensionsReady.wait().then(()=>this._registry.getExtensionDescription(e))}readExtensionPointContributions(e){return this._installedExtensionsReady.wait().then(()=>{const t=this._registry.getAllExtensionDescriptions(),i=[];for(const s of t)s.contributes&&zpe.call(s.contributes,e.name)&&i.push(new lMt(s,s.contributes[e.name]));return i})}getExtensionsStatus(){const e=Object.create(null);if(this._registry){const t=this._registry.getAllExtensionDescriptions();for(const i of t){const s=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:s?.messages??[],activationStarted:s?.activationStarted??!1,activationTimes:s?.activationTimes??void 0,runtimeErrors:s?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(s=>s.getInspectPort(t)))).filter(yl)}async setRemoteEnvironment(e){await this._extensionHostManagers.map(t=>t.setRemoteEnvironment(e))}_safeInvokeIsEnabled(e){try{return this._extensionEnablementService.isEnabled(e)}catch{return!1}}_doHandleExtensionPoints(e){const t=Object.create(null);for(const r of e)if(r.contributes)for(const a in r.contributes)zpe.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),s=this._registry.getAllExtensionDescriptions(),o=Ap.getExtensionPoints();vs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(vs(`code/willHandleExtensionPoint/${r.name}`),TDe._handleExtensionPoint(r,s,i),vs(`code/didHandleExtensionPoint/${r.name}`));vs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new h9t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),s=`[${e.extensionId.value}]: ${e.message}`;if(e.type===nt.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Error,message:s}),this._logService.error(s)):e.type===nt.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Warning,message:s}),this._logService.warn(s)):this._logService.info(s),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:o,extensionId:r,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:o,extensionId:r.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const s=[];for(const o of t)o.contributes&&zpe.call(o.contributes,e.name)&&s.push({description:o,value:o.contributes[e.name],collector:new kMt(i,o,e.name)});e.acceptUsers(s)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,s,o,r)=>this._onDidActivateExtension(t,i,s,o,r),_onDidActivateExtensionError:(t,i)=>this._onDidActivateExtensionError(t,i),_onExtensionRuntimeError:(t,i)=>this._onExtensionRuntimeError(t,i)}}async _activateById(e,t){if(!(await Promise.all(this._extensionHostManagers.map(o=>o.activate(e,t)))).some(o=>o))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,s,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new cMt(t,i,s,o)),this._onDidChangeExtensionsStatus.fire([e])}_onDidActivateExtensionError(e,t){this._telemetryService.publicLog2("extensionActivationError",{extensionId:e.value,error:t.message})}_onExtensionRuntimeError(e,t){this._getOrCreateExtensionStatus(e).addRuntimeError(t),this._onDidChangeExtensionsStatus.fire([e])}};RDe=TDe=D([_(3,be),_(4,Pi),_(5,ec),_(6,rn),_(7,Kh),_(8,ci),_(9,Xa),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,Ze),_(15,Sf),_(16,Gde),_(17,mg),_(18,rA),_(19,To)],RDe);class c9t{constructor(e,t,i,s){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=s}}class rT{constructor(e,t){this.toAdd=e,this.toRemove=t}}function MDe(n,e,t,i,s){return t.updateEnabledApiProposals(i),l9t(n,e,i,s)}function l9t(n,e,t,i){const s=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?s.push(c):(o.push(c),r.push(che(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(Yw,9,"Activation Events"),access:{canToggle:!1},renderer:new Gi(g9t)});var i_;(function(n){n[n.Open=1]="Open",n[n.OpenInNewWindow=2]="OpenInNewWindow",n[n.Cancel=3]="Cancel"})(i_||(i_={}));const f9t="security.workspace.trust.enabled",X3e="security.workspace.trust.untrustedFiles",p9t="security.workspace.trust.emptyWindow",m9t="extensions.supportUntrustedWorkspaces",_9t="content.trust.model.key";class v9t{constructor(e,t,i){this.originalWorkspace=e,this.canonicalFolderUris=t,this.canonicalConfiguration=i}get folders(){return this.originalWorkspace.folders.map((e,t)=>({index:e.index,name:e.name,toResource:e.toResource,uri:this.canonicalFolderUris[t]}))}get transient(){return this.originalWorkspace.transient}get configuration(){return this.canonicalConfiguration??this.originalWorkspace.configuration}get id(){return this.originalWorkspace.id}}let Z3e=class extends ${constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(f9t)}};Z3e=D([_(0,Re),_(1,ec)],Z3e);let e$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=s,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=_9t,this._onDidChangeTrust=this._register(new I),this.onDidChangeTrust=this._onDidChangeTrust.event,this._onDidChangeTrustedFolders=this._register(new I),this.onDidChangeTrustedFolders=this._onDidChangeTrustedFolders.event,this._canonicalStartupFiles=[],this._canonicalUrisResolved=!1,this._canonicalWorkspace=this.workspaceService.getWorkspace(),{promise:this._workspaceResolvedPromise,resolve:this._workspaceResolvedPromiseResolve}=NU(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=NU(),this._storedTrustState=new b9t(Jn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new w9t),this._trustStateInfo=this.loadTrustInfo(),this._isTrusted=this.calculateWorkspaceTrust(),this.initializeWorkspaceTrust(),this.registerListeners()}initializeWorkspaceTrust(){this.resolveCanonicalUris().then(async()=>{this._canonicalUrisResolved=!0,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceResolvedPromiseResolve(),this.environmentService.remoteAuthority||this._workspaceTrustInitializedPromiseResolve()}),this.environmentService.remoteAuthority&&this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority).then(async e=>{this._remoteAuthority=e,await this.fileService.activateProvider(_e.vscodeRemote),await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceTrustInitializedPromiseResolve()}),this.isEmptyWorkspace()&&this._workspaceTrustInitializedPromise.then(()=>{this._storedTrustState.isEmptyWorkspaceTrusted===void 0&&(this._storedTrustState.isEmptyWorkspaceTrusted=this.isWorkspaceTrusted())})}registerListeners(){this._register(this.workspaceService.onDidChangeWorkspaceFolders(async()=>await this.updateWorkspaceTrust())),this._register(this.storageService.onDidChangeValue(ke.APPLICATION,this.storageKey,this._register(new Z))(async()=>{JSON.stringify(this._trustStateInfo)!==JSON.stringify(this.loadTrustInfo())&&(this._trustStateInfo=this.loadTrustInfo(),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust())}))}async getCanonicalUri(e){let t=e;if(this.environmentService.remoteAuthority&&e.scheme===_e.vscodeRemote)t=await this.remoteAuthorityResolverService.getCanonicalURI(e);else if(e.scheme==="vscode-vfs"){const i=e.authority.indexOf("+");i!==-1&&(t=e.with({authority:e.authority.substr(0,i)}))}return t.with({query:null,fragment:null})}async resolveCanonicalUris(){const e=[];if(this.environmentService.filesToOpenOrCreate&&e.push(...this.environmentService.filesToOpenOrCreate),this.environmentService.filesToDiff&&e.push(...this.environmentService.filesToDiff),this.environmentService.filesToMerge&&e.push(...this.environmentService.filesToMerge),e.length){const o=e.filter(a=>!!a.fileUri).map(a=>a.fileUri),r=await Promise.all(o.map(a=>this.getCanonicalUri(a)));this._canonicalStartupFiles.push(...r.filter(a=>this._canonicalStartupFiles.every(c=>!this.uriIdentityService.extUri.isEqual(a,c))))}const t=this.workspaceService.getWorkspace().folders.map(o=>o.uri),i=await Promise.all(t.map(o=>this.getCanonicalUri(o)));let s=this.workspaceService.getWorkspace().configuration;s&&dbe(s,this.environmentService)&&(s=await this.getCanonicalUri(s)),this._canonicalWorkspace=new v9t(this.workspaceService.getWorkspace(),i,s)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,ke.APPLICATION);let t;try{e&&(t=JSON.parse(e))}catch{}return t||(t={uriTrustInfo:[]}),t.uriTrustInfo||(t.uriTrustInfo=[]),t.uriTrustInfo=t.uriTrustInfo.map(i=>({uri:P.revive(i.uri),trusted:i.trusted})),t.uriTrustInfo=t.uriTrustInfo.filter(i=>i.trusted),t}async saveTrustInfo(){this.storageService.store(this.storageKey,JSON.stringify(this._trustStateInfo),ke.APPLICATION,ln.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&dbe(t,this.environmentService)&&e.push(t),e}calculateWorkspaceTrust(){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this._canonicalUrisResolved?this.environmentService.remoteAuthority&&this._remoteAuthority?.options?.isTrusted?this._remoteAuthority.options.isTrusted:this.isEmptyWorkspace()?this._storedTrustState.isEmptyWorkspaceTrusted!==void 0?this._storedTrustState.isEmptyWorkspaceTrusted:this._canonicalStartupFiles.length?this.getUrisTrust(this._canonicalStartupFiles):!!this.configurationService.getValue(p9t):this.getUrisTrust(this.getWorkspaceUris()):!1:!0}async updateWorkspaceTrust(e){this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&(e===void 0&&(await this.resolveCanonicalUris(),e=this.calculateWorkspaceTrust()),this.isWorkspaceTrusted()!==e&&(this.isTrusted=e,await this._trustTransitionManager.participate(e),this._onDidChangeTrust.fire(e)))}getUrisTrust(e){let t=!0;for(const i of e){const{trusted:s}=this.doGetUriTrustInfo(i);if(!s)return t=s,t}return t}doGetUriTrustInfo(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled())return{trusted:!0,uri:e};if(this.isTrustedVirtualResource(e))return{trusted:!0,uri:e};if(this.isTrustedByRemote(e))return{trusted:!0,uri:e};let t=!1,i=-1,s=e;for(const o of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(e,o.uri)){const r=o.uri.fsPath;r.length>i&&(i=r.length,t=o.trusted,s=o.uri)}return{trusted:t,uri:s}}async doSetUrisTrust(e,t){let i=!1;for(const s of e)if(t){if(this.isTrustedVirtualResource(s)||this.isTrustedByRemote(s))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,s))||(this._trustStateInfo.uriTrustInfo.push({uri:s,trusted:!0}),i=!0)}else{const o=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(r=>!this.uriIdentityService.extUri.isEqual(r.uri,s)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===Nn.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?hx(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return VEe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:_Z(uZe(e),this._remoteAuthority.authority.authority)&&!!this._remoteAuthority.options?.isTrusted}set isTrusted(e){this._isTrusted=e,e||(this._storedTrustState.acceptsOutOfWorkspaceFiles=!1),this.isEmptyWorkspace()&&(this._storedTrustState.isEmptyWorkspaceTrusted=e)}get workspaceResolved(){return this._workspaceResolvedPromise}get workspaceTrustInitialized(){return this._workspaceTrustInitializedPromise}get acceptsOutOfWorkspaceFiles(){return this._storedTrustState.acceptsOutOfWorkspaceFiles}set acceptsOutOfWorkspaceFiles(e){this._storedTrustState.acceptsOutOfWorkspaceFiles=e}isWorkspaceTrusted(){return this._isTrusted}isWorkspaceTrustForced(){return!!(this.environmentService.remoteAuthority&&this._remoteAuthority&&this._remoteAuthority.options?.isTrusted!==void 0||this.getWorkspaceUris().filter(t=>!this.isTrustedVirtualResource(t)).length===0)}canSetParentFolderTrust(){const e=UW(this._canonicalWorkspace);if(!BS(e)||e.uri.scheme!==_e.file&&e.uri.scheme!==_e.vscodeRemote)return!1;const t=this.uriIdentityService.extUri.dirname(e.uri);return!this.uriIdentityService.extUri.isEqual(e.uri,t)}async setParentFolderTrust(e){if(this.canSetParentFolderTrust()){const t=UW(this._canonicalWorkspace).uri,i=this.uriIdentityService.extUri.dirname(t);await this.setUrisTrust([i],e)}}canSetWorkspaceTrust(){if(this.environmentService.remoteAuthority&&(!this._remoteAuthority||this._remoteAuthority.options?.isTrusted!==void 0))return!1;if(this.isEmptyWorkspace())return!0;if(this.getWorkspaceUris().filter(s=>!this.isTrustedVirtualResource(s)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=UW(this._canonicalWorkspace);if(!BS(t)||t.uri.scheme!==_e.file&&t.uri.scheme!=="vscode-vfs")return!1;const i=this.doGetUriTrustInfo(t.uri);if(!i.trusted||!this.uriIdentityService.extUri.isEqual(t.uri,i.uri))return!1;if(this.canSetParentFolderTrust()){const s=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(s).trusted)return!1}return!0}async setWorkspaceTrust(e){if(this.isEmptyWorkspace()){await this.updateWorkspaceTrust(e);return}const t=this.getWorkspaceUris();await this.setUrisTrust(t,e)}async getUriTrustInfo(e){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this.isTrustedByRemote(e)?{trusted:!0,uri:e}:this.doGetUriTrustInfo(await this.getCanonicalUri(e)):{trusted:!0,uri:e}}async setUrisTrust(e,t){this.doSetUrisTrust(await Promise.all(e.map(i=>this.getCanonicalUri(i))),t)}getTrustedUris(){return this._trustStateInfo.uriTrustInfo.map(e=>e.uri)}async setTrustedUris(e){this._trustStateInfo.uriTrustInfo=[];for(const t of e){const i=await this.getCanonicalUri(t),s=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,s)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:s})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};e$e=D([_(0,Re),_(1,rA),_(2,on),_(3,_o),_(4,ec),_(5,Ti),_(6,Sde),_(7,ci)],e$e);let t$e=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceTrustManagementService=t,this._onDidInitiateOpenFilesTrustRequest=this._register(new I),this.onDidInitiateOpenFilesTrustRequest=this._onDidInitiateOpenFilesTrustRequest.event,this._onDidInitiateWorkspaceTrustRequest=this._register(new I),this.onDidInitiateWorkspaceTrustRequest=this._onDidInitiateWorkspaceTrustRequest.event,this._onDidInitiateWorkspaceTrustRequestOnStartup=this._register(new I),this.onDidInitiateWorkspaceTrustRequestOnStartup=this._onDidInitiateWorkspaceTrustRequestOnStartup.event}get untrustedFilesSetting(){return this.configurationService.getValue(X3e)}set untrustedFilesSetting(e){this.configurationService.updateValue(X3e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===i_.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===i_.Open&&(this.untrustedFilesSetting="open"),e===i_.OpenInNewWindow&&(this.untrustedFilesSetting="newWindow")),this._openFilesTrustRequestResolver(e),this._openFilesTrustRequestResolver=void 0,this._openFilesTrustRequestPromise=void 0)}async requestOpenFilesTrust(e){if(!this.workspaceTrustManagementService.isWorkspaceTrusted()||(await Promise.all(e.map(i=>this.workspaceTrustManagementService.getUriTrustInfo(i)))).map(i=>i.trusted).every(i=>i))return i_.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return i_.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return i_.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return i_.Open;if(!this._openFilesTrustRequestPromise)this._openFilesTrustRequestPromise=new Promise(i=>{this._openFilesTrustRequestResolver=i});else return this._openFilesTrustRequestPromise;return this._onDidInitiateOpenFilesTrustRequest.fire(),this._openFilesTrustRequestPromise}resolveWorkspaceTrustRequest(e){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(e??this.workspaceTrustManagementService.isWorkspaceTrusted()),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}cancelWorkspaceTrustRequest(){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(void 0),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}async completeWorkspaceTrustRequest(e){if(e===void 0||e===this.workspaceTrustManagementService.isWorkspaceTrusted()){this.resolveWorkspaceTrustRequest(e);return}T.once(this.workspaceTrustManagementService.onDidChangeTrust)(t=>this.resolveWorkspaceTrustRequest(t)),await this.workspaceTrustManagementService.setWorkspaceTrust(e)}async requestWorkspaceTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return this.workspaceTrustManagementService.isWorkspaceTrusted();if(!this._workspaceTrustRequestPromise)this._workspaceTrustRequestPromise=new Promise(t=>{this._workspaceTrustRequestResolver=t});else return this._workspaceTrustRequestPromise;return this._onDidInitiateWorkspaceTrustRequest.fire(e),this._workspaceTrustRequestPromise}requestWorkspaceTrustOnStartup(){this._workspaceTrustRequestPromise||(this._workspaceTrustRequestPromise=new Promise(e=>{this._workspaceTrustRequestResolver=e})),this._onDidInitiateWorkspaceTrustRequestOnStartup.fire()}};t$e=D([_(0,Re),_(1,oA)],t$e);class w9t extends ${constructor(){super(...arguments),this.participants=new td}addWorkspaceTrustTransitionParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e){for(const t of this.participants)await t.participate(e)}dispose(){this.participants.clear(),super.dispose()}}class b9t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new W1("workspaceTrust",e),this._mementoObject=this._memento.getMemento(ke.WORKSPACE,ln.MACHINE)):this._mementoObject={}}get acceptsOutOfWorkspaceFiles(){return this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]??!1}set acceptsOutOfWorkspaceFiles(e){this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]=e,this._memento?.saveMemento()}get isEmptyWorkspaceTrusted(){return this._mementoObject[this._isEmptyWorkspaceTrustedKey]}set isEmptyWorkspaceTrusted(e){this._mementoObject[this._isEmptyWorkspaceTrustedKey]=e,this._memento?.saveMemento()}}let PDe=class extends ${constructor(e,t,i,s){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=s,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new Ga;const o=t.inspect(m9t).userValue||{};for(const r of Object.keys(o))this._configuredExtensionWorkspaceTrustRequestMap.set(r,o[r]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,e.extensionUntrustedWorkspaceSupport)for(const r of Object.keys(e.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(r,e.extensionUntrustedWorkspaceSupport[r])}prefersExecuteOnUI(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="ui"}prefersExecuteOnWorkspace(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="workspace"}prefersExecuteOnWeb(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="web"}canExecuteOnUI(e){return this.getExtensionKind(e).some(i=>i==="ui")}canExecuteOnWorkspace(e){return this.getExtensionKind(e).some(i=>i==="workspace")}canExecuteOnWeb(e){return this.getExtensionKind(e).some(i=>i==="web")}getExtensionKind(e){const t=this.deduceExtensionKind(e),i=this.getConfiguredExtensionKind(e);if(i&&i.length>0){const s=[];for(const o of i)o!=="-web"&&s.push(o);return i.includes("-web")&&!s.length&&(s.push("ui"),s.push("workspace")),Jn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&s.push("web"),s}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new Ga,s=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(s))i.set(o,s[o]);this._configuredExtensionKindsMap=i}const t=this._configuredExtensionKindsMap.get(e.id);return t?this.toArray(t):void 0}getExtensionUntrustedWorkspaceSupportType(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||!e.main)return!0;const t=this.getConfiguredExtensionWorkspaceTrustRequest(e),i=this.getProductExtensionWorkspaceTrustRequest(e);return t!==void 0?t:i?.override!==void 0?i.override:e.capabilities?.untrustedWorkspaces?.supported!==void 0?e.capabilities.untrustedWorkspaces.supported:i?.default!==void 0?i.default:!1}getExtensionVirtualWorkspaceSupportType(e){const t=this.getConfiguredVirtualWorkspaceSupport(e);if(t!==void 0)return t;const i=this.getProductVirtualWorkspaceSupport(e);if(i?.override!==void 0)return i.override;const s=e.capabilities?.virtualWorkspaces;if(g9(s))return s;if(s){const o=s.supported;if(g9(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Jn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...nLt];if((mo(e.extensionPack)||mo(e.extensionDependencies))&&(t=Jn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const s=this.getSupportedExtensionKindsForExtensionPoint(i);s.length&&(t=t.filter(o=>s.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",ny(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;Ap.getExtensionPoints().forEach(s=>i.set(s.name,s.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Jn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:ny(e.publisher,e.name)};let i=this.getUserConfiguredExtensionKind(t);return typeof i<"u"?this.toArray(i):(i=this.getProductExtensionKind(e),typeof i<"u"?i:(i=e.extensionKind,typeof i<"u"?(i=this.toArray(i),i.filter(s=>["ui","workspace"].includes(s))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new Ga;if(this.productService.extensionKind)for(const s of Object.keys(this.productService.extensionKind))i.set(s,this.productService.extensionKind[s]);this._productExtensionKindsMap=i}const t=ny(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new Ga;if(this.productService.extensionVirtualWorkspacesSupport)for(const s of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(s,this.productService.extensionVirtualWorkspacesSupport[s]);this._productVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new Ga,s=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(s))s[o]!==void 0&&i.set(o,s[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name),i=this._configuredExtensionWorkspaceTrustRequestMap.get(t);if(i&&(i.version===void 0||i.version===e.version))return i.supported}getProductExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};PDe=D([_(0,Xa),_(1,Re),_(2,Sde),_(3,Ze)],PDe);let FDe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(s=>Cn.toKey(s))),this._envEnablesProposedApiForAll=!t.isBuilt||t.isExtensionDevelopment&&i.quality!=="stable"||this._envEnabledExtensions.size===0&&Array.isArray(t.extensionEnabledProposedApi),this._productEnabledExtensions=new Map,i.extensionEnabledApiProposals)for(const[s,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Cn.toKey(s),a=o.filter(c=>mV[c]?!0:(e.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${r}' wants API proposal '${c}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),!1));this._productEnabledExtensions.set(r,a)}}updateEnabledApiProposals(e){for(const t of e)this.doUpdateEnabledApiProposals(t)}doUpdateEnabledApiProposals(e){const t=e,i=Cn.toKey(e.identifier);if(mo(t.enabledApiProposals)&&(t.enabledApiProposals=t.enabledApiProposals.filter(s=>{const o=!!mV[s];return o||this._logService.error(`Extension '${i}' wants API proposal '${s}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),o})),this._productEnabledExtensions.has(i)){const s=this._productEnabledExtensions.get(i),o=new Set(s),r=new Set(t.enabledApiProposals),a=new Set([...r].filter(c=>!o.has(c)));a.size>0&&(this._logService.error(`Extension '${i}' appears in product.json but enables LESS API proposals than the extension wants. -package.json (LOSES): ${[...r].join(", ")} -product.json (WINS): ${[...o].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...a].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),s.push(...a))),t.enabledApiProposals=s;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(i)||!t.isBuiltin&&mo(t.enabledApiProposals)&&(this._logService.error(`Extension '${t.identifier.value} CANNOT USE these API proposals '${t.enabledApiProposals?.join(", ")||"*"}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`),t.enabledApiProposals=[])}};FDe=D([_(0,Ze),_(1,ec),_(2,Xa)],FDe);async function C9t(n,e){const t=[];return await tot(n,t,e.logsHome,e.logsHome),t}async function tot(n,e,t,i){const s=await n.resolve(t);for(const{resource:o,isDirectory:r}of s.children||[])if(r)await tot(n,e,o,i);else{const a=(await n.readFile(o)).value.toString();if(a){const c=lO(i,o);c&&e.push({relativePath:c,contents:a})}}}var zp;(function(n){n[n.Promise=100]="Promise",n[n.PromiseCancel=101]="PromiseCancel",n[n.EventListen=102]="EventListen",n[n.EventDispose=103]="EventDispose"})(zp||(zp={}));function i$e(n){switch(n){case zp.Promise:return"req";case zp.PromiseCancel:return"cancel";case zp.EventListen:return"subscribe";case zp.EventDispose:return"unsubscribe"}}var Fg;(function(n){n[n.Initialize=200]="Initialize",n[n.PromiseSuccess=201]="PromiseSuccess",n[n.PromiseError=202]="PromiseError",n[n.PromiseErrorObj=203]="PromiseErrorObj",n[n.EventFire=204]="EventFire"})(Fg||(Fg={}));function n$e(n){switch(n){case Fg.Initialize:return"init";case Fg.PromiseSuccess:return"reply:";case Fg.PromiseError:case Fg.PromiseErrorObj:return"replyErr:";case Fg.EventFire:return"event:"}}var _2;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Idle=1]="Idle"})(_2||(_2={}));function nB(n){let e=0;for(let t=0;;t+=7){const i=n.read(1);if(e|=(i.buffer[0]&127)<>>7)t++;const i=ze.alloc(t);for(let s=0;e!==0;s++)i.buffer[s]=e&127,e=e>>>7,e>0&&(i.buffer[s]|=128);n.write(i)}class S9t{constructor(e){this.buffer=e,this.pos=0}read(e){const t=this.buffer.slice(this.pos,this.pos+e);return this.pos+=t.byteLength,t}}class A9t{constructor(){this.buffers=[]}get buffer(){return ze.concat(this.buffers)}write(e){this.buffers.push(e)}}var Gg;(function(n){n[n.Undefined=0]="Undefined",n[n.String=1]="String",n[n.Buffer=2]="Buffer",n[n.VSBuffer=3]="VSBuffer",n[n.Array=4]="Array",n[n.Object=5]="Object",n[n.Int=6]="Int"})(Gg||(Gg={}));function $D(n){const e=ze.alloc(1);return e.writeUInt8(n,0),e}const RL={Undefined:$D(Gg.Undefined),String:$D(Gg.String),Buffer:$D(Gg.Buffer),VSBuffer:$D(Gg.VSBuffer),Array:$D(Gg.Array),Object:$D(Gg.Object),Uint:$D(Gg.Int)},E9t=typeof Buffer<"u";function ODe(n,e){if(typeof e>"u")n.write(RL.Undefined);else if(typeof e=="string"){const t=ze.fromString(e);n.write(RL.String),sB(n,t.byteLength),n.write(t)}else if(E9t&&Buffer.isBuffer(e)){const t=ze.wrap(e);n.write(RL.Buffer),sB(n,t.byteLength),n.write(t)}else if(e instanceof ze)n.write(RL.VSBuffer),sB(n,e.byteLength),n.write(e);else if(Array.isArray(e)){n.write(RL.Array),sB(n,e.length);for(const t of e)ODe(n,t)}else if(typeof e=="number"&&(e|0)===e)n.write(RL.Uint),sB(n,e);else{const t=ze.fromString(JSON.stringify(e));n.write(RL.Object),sB(n,t.byteLength),n.write(t)}}function BDe(n){switch(n.read(1).readUInt8(0)){case Gg.Undefined:return;case Gg.String:return n.read(nB(n)).toString();case Gg.Buffer:return n.read(nB(n)).buffer;case Gg.VSBuffer:return n.read(nB(n));case Gg.Array:{const t=nB(n),i=[];for(let s=0;sthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,s,o){return t.isDisposed?Promise.reject(new Rc):t.requestPromise(e,i,s,o)},listen(i,s){return t.isDisposed?T.None:t.requestEvent(e,i,s)}}}requestPromise(e,t,i,s=qe.None){const o=this.lastRequestId++,r=zp.Promise,a={id:o,type:r,channelName:e,name:t,arg:i};if(s.isCancellationRequested)return Promise.reject(new Rc);let c;return new Promise((d,h)=>{if(s.isCancellationRequested)return h(new Rc);const u=()=>{const v=w=>{switch(w.type){case Fg.PromiseSuccess:this.handlers.delete(o),d(w.data);break;case Fg.PromiseError:{this.handlers.delete(o);const b=new Error(w.data.message);b.stack=Array.isArray(w.data.stack)?w.data.stack.join(` -`):w.data.stack,b.name=w.data.name,h(b);break}case Fg.PromiseErrorObj:this.handlers.delete(o),h(w.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===_2.Idle?u():(f=na(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:zp.PromiseCancel}),h(new Rc)},m=s.onCancellationRequested(p);c=pa(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const s=this.lastRequestId++,o=zp.EventListen,r={id:s,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=na(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(r)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:s,type:zp.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(s,l),c.event}sendRequest(e){switch(e.type){case zp.Promise:case zp.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,v2.LocalSide,`${i$e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case zp.PromiseCancel:case zp.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,v2.LocalSide,i$e(e.type));return}}}send(e,t=void 0){const i=new A9t;return ODe(i,e),ODe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new S9t(e),i=BDe(t),s=BDe(t),o=i[0];switch(o){case Fg.Initialize:return this.logger?.logIncoming(e.byteLength,0,v2.LocalSide,n$e(o)),this.onResponse({type:i[0]});case Fg.PromiseSuccess:case Fg.PromiseError:case Fg.EventFire:case Fg.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],v2.LocalSide,n$e(o),s),this.onResponse({type:i[0],id:i[1],data:s})}}onResponse(e){if(e.type===Fg.Initialize){this.state=_2.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return T.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===_2.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),St(this.activeRequests.values()),this.activeRequests.clear()}}s$e.__decorator=D([ii],s$e.prototype,"onDidInitializePromise",null);var kM;(function(n){n.Created="created",n.Read="read",n.Write="write",n.Open="open",n.Error="error",n.Close="close",n.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",n.NodeEndReceived="nodeEndReceived",n.NodeEndSent="nodeEndSent",n.NodeDrainBegin="nodeDrainBegin",n.NodeDrainEnd="nodeDrainEnd",n.zlibInflateError="zlibInflateError",n.zlibInflateData="zlibInflateData",n.zlibInflateInitialWrite="zlibInflateInitialWrite",n.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",n.zlibInflateWrite="zlibInflateWrite",n.zlibInflateFlushFired="zlibInflateFlushFired",n.zlibDeflateError="zlibDeflateError",n.zlibDeflateData="zlibDeflateData",n.zlibDeflateWrite="zlibDeflateWrite",n.zlibDeflateFlushFired="zlibDeflateFlushFired",n.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",n.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",n.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",n.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",n.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",n.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",n.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",n.ProtocolHeaderRead="protocolHeaderRead",n.ProtocolMessageRead="protocolMessageRead",n.ProtocolHeaderWrite="protocolHeaderWrite",n.ProtocolMessageWrite="protocolMessageWrite",n.ProtocolWrite="protocolWrite"})(kM||(kM={}));var WDe;(function(n){n.enableDiagnostics=!1,n.records=[];const e=new WeakMap;let t=0;function i(o,r){if(!e.has(o)){const a=String(++t);e.set(o,a)}return e.get(o)}function s(o,r,a,c){if(!n.enableDiagnostics)return;const l=i(o);if(c instanceof ze||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=ze.alloc(c.byteLength);d.set(c),n.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else n.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}n.traceSocketEvent=s})(WDe||(WDe={}));var qne;(function(n){n[n.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",n[n.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(qne||(qne={}));let $pe=null;function GD(){return $pe||($pe=ze.alloc(0)),$pe}class x9t{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(e){this._chunks.push(e),this._totalLength+=e.byteLength}read(e){return this._read(e,!0)}peek(e){return this._read(e,!1)}_read(e,t){if(e===0)return GD();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),r}if(this._chunks[0].byteLength>e){const r=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),r}const i=ze.alloc(e);let s=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,s),s+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,s),s+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var la;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Control=2]="Control",n[n.Ack=3]="Ack",n[n.Disconnect=5]="Disconnect",n[n.ReplayRequest=6]="ReplayRequest",n[n.Pause=7]="Pause",n[n.Resume=8]="Resume",n[n.KeepAlive=9]="KeepAlive"})(la||(la={}));function iot(n){switch(n){case la.None:return"None";case la.Regular:return"Regular";case la.Control:return"Control";case la.Ack:return"Ack";case la.Disconnect:return"Disconnect";case la.ReplayRequest:return"ReplayRequest";case la.Pause:return"PauseWriting";case la.Resume:return"ResumeWriting";case la.KeepAlive:return"KeepAlive"}}var Wp;(function(n){n[n.HeaderLength=13]="HeaderLength",n[n.AcknowledgeTime=2e3]="AcknowledgeTime",n[n.TimeoutTime=2e4]="TimeoutTime",n[n.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",n[n.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",n[n.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(Wp||(Wp={}));class LC{constructor(e,t,i,s){this.type=e,this.id=t,this.ack=i,this.data=s,this.writtenTime=0}get size(){return this.data.byteLength}}class o$e extends ${constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Wp.HeaderLength,messageType:la.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new x9t,this._register(this._socket.onData(t=>this.acceptChunk(t))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){const t=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=t.readUInt32BE(9),this._state.messageType=t.readUInt8(0),this._state.id=t.readUInt32BE(1),this._state.ack=t.readUInt32BE(5),this._socket.traceSocketEvent(kM.ProtocolHeaderRead,{messageType:iot(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,s=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Wp.HeaderLength,this._state.messageType=la.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(kM.ProtocolMessageRead,t),this._onMessage.fire(new LC(i,s,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class r$e{constructor(e){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=e,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(e){if(this._isDisposed)return;e.writtenTime=Date.now(),this.lastWriteTime=Date.now();const t=ze.alloc(Wp.HeaderLength);t.writeUInt8(e.type,0),t.writeUInt32BE(e.id,1),t.writeUInt32BE(e.ack,5),t.writeUInt32BE(e.data.byteLength,9),this._socket.traceSocketEvent(kM.ProtocolHeaderWrite,{messageType:iot(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(kM.ProtocolMessageWrite,e.data),this._writeSoon(t,e.data)}_bufferAdd(e,t){const i=this._totalLength===0;return this._data.push(e,t),this._totalLength+=e.byteLength+t.byteLength,i}_bufferTake(){const e=ze.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,e}_writeSoon(e,t){this._bufferAdd(e,t)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const e=this._bufferTake();this._socket.traceSocketEvent(kM.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class FT{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new I({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(e){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(e):this._emitter.fire(e):this._bufferedMessages.push(e)}flushBuffer(){this._bufferedMessages=[]}}class D9t{constructor(e){this.data=e,this.next=null}}class k9t{constructor(){this._first=null,this._last=null}length(){let e=0,t=this._first;for(;t;)t=t.next,e++;return e}peek(){return this._first?this._first.data:null}toArray(){const e=[];let t=0,i=this._first;for(;i;)e[t++]=i.data,i=i.next;return e}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(e){const t=new D9t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const Qm=class Qm{static getInstance(){return Qm._INSTANCE||(Qm._INSTANCE=new Qm),Qm._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=Qm._HISTORY_LENGTH;t>=1;t--)this.lastRuns[t]=this.lastRuns[t-1];this.lastRuns[0]=Date.now()},1e3)}load(){const e=Date.now(),t=(1+Qm._HISTORY_LENGTH)*1e3;let i=0;for(let s=0;s=.5}};Qm._HISTORY_LENGTH=10,Qm._INSTANCE=null;let HDe=Qm;class I9t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new FT,this.onControlMessage=this._onControlMessage.event,this._onMessage=new FT,this.onMessage=this._onMessage.event,this._onDidDispose=new FT,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new FT,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new FT,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??HDe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new k9t,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socketDisposables=new Z,this._socket=e.socket,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(t=>this._receiveMessage(t))),this._socketDisposables.add(this._socket.onClose(t=>this._onSocketClose.fire(t))),e.initialChunk&&this._socketReader.acceptChunk(e.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},Wp.KeepAliveSendTime):this._keepAliveInterval=null}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){const e=new LC(la.Disconnect,0,0,GD());this._socketWriter.write(e),this._socketWriter.flush()}sendPause(){const e=new LC(la.Pause,0,0,GD());this._socketWriter.write(e)}sendResume(){const e=new LC(la.Resume,0,0,GD());this._socketWriter.write(e)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(e,t){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new Z,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=e,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(i=>this._receiveMessage(i))),this._socketDisposables.add(this._socket.onClose(i=>this._onSocketClose.fire(i))),this._socketReader.acceptChunk(t)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;ithis._outgoingAckId){this._outgoingAckId=e.ack;do{const t=this._outgoingUnackMsg.peek();if(t&&t.id<=e.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(e.type){case la.None:break;case la.Regular:{if(e.id>this._incomingMsgId)if(e.id!==this._incomingMsgId+1){const t=Date.now();t-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=t,this._socketWriter.write(new LC(la.ReplayRequest,0,0,GD())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case la.Control:{this._onControlMessage.fire(e.data);break}case la.Ack:break;case la.Disconnect:{this._onDidDispose.fire();break}case la.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;i=Wp.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Wp.AcknowledgeTime-e+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const e=this._outgoingUnackMsg.peek(),t=Date.now()-e.writtenTime,i=Date.now()-this._socketReader.lastReadTime,s=Date.now()-this._lastSocketTimeoutTime;if(t>=Wp.TimeoutTime&&i>=Wp.TimeoutTime&&s>=Wp.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(Wp.TimeoutTime-t,Wp.TimeoutTime-i,Wp.TimeoutTime-s,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new LC(la.KeepAlive,0,this._incomingAckId,GD());this._socketWriter.write(e)}}const L9t=30*1e3;var IM;(function(n){n[n.Management=1]="Management",n[n.ExtensionHost=2]="ExtensionHost",n[n.Tunnel=3]="Tunnel"})(IM||(IM={}));function UDe(n){switch(n){case IM.Management:return"Management";case IM.ExtensionHost:return"ExtensionHost";case IM.Tunnel:return"Tunnel"}}function not(n){const e=new ai;return setTimeout(()=>e.cancel(),n),e.token}function T9t(n,e){if(n.isCancellationRequested||e.isCancellationRequested)return qe.Cancelled;const t=new ai;return n.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Vhe{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=NU(),e.isCancellationRequested?this._timeout():this._disposables.add(e.onCancellationRequested(()=>this._timeout()))}registerDisposable(e){this._state==="pending"?this._disposables.add(e):e.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const e=new Error("Time limit reached");return e.code="ETIMEDOUT",e.syscall="connect",e}resolve(e){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(e))}reject(e){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(e))}}function R9t(n,e){const t=new Vhe(e);return t.registerDisposable(n.onControlMessage(i=>{const s=JSON.parse(i.toString()),o=rot(s);o?t.reject(o):t.resolve(s)})),t.promise}function M9t(n,e,t,i,s,o,r,a){const c=new Vhe(a),l=ao.create(!1);return n.info(`Creating a socket (${r})...`),vs(`code/willCreateSocket/${o}`),e.connect(t,i,s,r).then(d=>{c.didTimeout?(vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(vs(`code/didCreateSocketOK/${o}`),n.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),n.error(d),c.reject(d)}),c.promise}function Gpe(n,e){const t=new Vhe(e);return n.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function N9t(n,e,t,i){const s=aot(n,e);n.logService.trace(`${s} 1/6. invoking socketFactory.connect().`);let o;try{o=await M9t(n.logService,n.remoteSocketFactoryService,n.connectTo,T9.getServerRootPath(),`reconnectionToken=${n.reconnectionToken}&reconnection=${n.reconnectionProtocol?"true":"false"}`,UDe(e),`renderer-${UDe(e)}-${n.reconnectionToken}`,i)}catch(d){throw n.logService.error(`${s} socketFactory.connect() failed or timed out. Error:`),n.logService.error(d),d}n.logService.trace(`${s} 2/6. socketFactory.connect() was successful.`);let r,a;n.reconnectionProtocol?(n.reconnectionProtocol.beginAcceptReconnection(o,null),r=n.reconnectionProtocol,a=!1):(r=new I9t({socket:o}),a=!0),n.logService.trace(`${s} 3/6. sending AuthRequest control message.`);const c=await Gpe(n.signService.createNewMessage(Dr()),i),l={type:"auth",auth:n.connectionToken||"00000000000000000000",data:c.data};r.sendControl(ze.fromString(JSON.stringify(l)));try{const d=await R9t(r,T9t(i,not(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(n.logService.trace(`${s} 4/6. received SignRequest control message.`),!await Gpe(n.signService.validate(c,d.signedData),i)){const p=new Error("Refused to connect to unsupported server");throw p.code="VSCODE_CONNECTION_ERROR",p}const u=await Gpe(n.signService.sign(d.data),i),f={type:"connectionType",commit:n.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),n.logService.trace(`${s} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl(ze.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(n.logService.error(`${s} the handshake timed out. Error:`),n.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(n.logService.error(`${s} received error control message when negotiating connection. Error:`),n.logService.error(d)),a&&gOe(r),d}}async function P9t(n,e,t,i){const s=Date.now(),o=aot(n,e),{protocol:r,ownsProtocol:a}=await N9t(n,e,t,i),c=new Vhe(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=rot(d);h?(n.logService.error(`${o} received error control message when negotiating connection. Error:`),n.logService.error(h),a&&gOe(r),c.reject(h)):(n.reconnectionProtocol?.endAcceptReconnection(),n.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${q9t(s)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function sot(n,e,t){const{protocol:i,firstMessage:s}=await P9t(n,IM.ExtensionHost,e,t),o=s&&s.debugPort;return{protocol:i,debugPort:o}}async function oot(n,e,t){const{connectTo:i,connectionToken:s}=await n.addressProvider.getAddress();return{commit:n.commit,quality:n.quality,connectTo:i,connectionToken:s,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:n.remoteSocketFactoryService,signService:n.signService,logService:n.logService}}async function F9t(n,e){return O9t(n,async t=>{const{protocol:i,debugPort:s}=await sot(t,e,qe.None);return new z9t(n,e,t.reconnectionToken,i,s)})}async function O9t(n,e){for(let i=1;;i++)try{const s=Dr(),o=await oot(n,s,null);return await e(o)}catch(s){if(i<5)n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),n.logService.error(s);else throw n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),n.logService.error(s),Qne.triggerPermanentFailure(0,0,HI.isHandled(s)),s}}function B9t(n){return na(e=>new Promise((t,i)=>{const s=setTimeout(t,n*1e3);e.onCancellationRequested(()=>{clearTimeout(s),t()})}))}var $1;(function(n){n[n.ConnectionLost=0]="ConnectionLost",n[n.ReconnectionWait=1]="ReconnectionWait",n[n.ReconnectionRunning=2]="ReconnectionRunning",n[n.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",n[n.ConnectionGain=4]="ConnectionGain"})($1||($1={}));class W9t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=$1.ConnectionLost}}class H9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=s,this.type=$1.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class U9t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ReconnectionRunning}}class a$e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ConnectionGain}}class V9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=s,this.type=$1.ReconnectionPermanentFailure}}const Ff=class Ff extends ${static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(s=>s._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}get _isPermanentFailure(){return this._permanentFailure||Ff._permanentFailure}constructor(e,t,i,s,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=s,this._reconnectionFailureIsFatal=o,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new a$e(this.reconnectionToken,0,0)),this._register(s.onSocketClose(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);r?r.type===qne.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${r.hadError}).`),r.error&&this._options.logService.error(r.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${r.wasClean}, code: ${r.code}, reason: ${r.reason}).`),r.event&&this._options.logService.error(r.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(s.onSocketTimeout(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${r.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${r.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${r.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Ff._instances.push(this),this._register(Ee(()=>{const r=Ff._instances.indexOf(this);r>=0&&Ff._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Ff._permanentFailureMillisSinceLastIncomingData,Ff._permanentFailureAttempt,Ff._permanentFailureHandled)}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;const e=SX(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${e} starting reconnecting loop. You can get more information with the trace log level.`),this._onDidStateChange.fire(new W9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const s=i0){const r=B9t(s);this._onDidStateChange.fire(new H9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s,r)),this._options.logService.info(`${e} waiting for ${s} seconds before reconnecting...`);try{await r}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new U9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await oot(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,not(L9t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new a$e(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(o){if(o.code==="VSCODE_CONNECTION_ERROR"){this._options.logService.error(`${e} A permanent error occurred in the reconnecting loop! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(i>360){this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(HI.isTemporarilyNotAvailable(o)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if((o.code==="ETIMEDOUT"||o.code==="ENETUNREACH"||o.code==="ECONNREFUSED"||o.code==="ECONNRESET")&&o.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(Na(o)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(o instanceof HI){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,HI.isHandled(o));break}this._options.logService.error(`${e} An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?Ff.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new V9t(this.reconnectionToken,e,t,i)),gOe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Ff._permanentFailure=!1,Ff._permanentFailureMillisSinceLastIncomingData=0,Ff._permanentFailureAttempt=0,Ff._permanentFailureHandled=!1,Ff._instances=[];let Qne=Ff;class z9t extends Qne{constructor(e,t,i,s,o){super(IM.ExtensionHost,e,i,s,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await sot(e,this._startArguments,t)}}function gOe(n){try{n.acceptDisconnect();const e=n.getSocket();n.dispose(),e.dispose()}catch(e){bt(e)}}function rot(n){if(n&&n.type==="error"){const e=new Error(`Connection error: ${n.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function $9t(n,e){for(;n.length"u"&&(l=Dr(),this._storageService.store(c,l,ke.WORKSPACE,ln.MACHINE));const d=await Fht(yi.origin,l),h=o.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",r).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",yi.origin),u.searchParams.set("salt",l),u.toString()}}return`${lp.asBrowserUri(i).toString(!0)}${t}`}async start(){return this._protocolPromise||(this._protocolPromise=this._startInsideIframe(),this._protocolPromise.then(e=>this._protocol=e)),this._protocolPromise}async _startInsideIframe(){const e=await this._getWebWorkerExtensionHostIframeSrc(),t=this._register(new I),i=document.createElement("iframe");i.setAttribute("class","web-worker-ext-host-iframe"),i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("allow","usb; serial; hid; cross-origin-isolated;"),i.setAttribute("aria-hidden","true"),i.style.display="none";const s=Dr();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${s}`);const o=new Uh;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,bt(a),clearTimeout(l),this._onDidExit.fire([u8.UnexpectedError,a.message]),o.open()},h=p=>{r=p,clearTimeout(l),o.open()};if(l=setTimeout(()=>{console.warn("The Web Worker Extension Host did not start in 60s, that might be a problem.")},6e4),this._register(pe(yi,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==s)return;if(p.data.error){const{name:v,message:w,stack:b}=p.data.error,C=new Error;return C.message=w,C.name=v,C.stack=b,d(u8.UnexpectedError,C)}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(u8.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await o.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),r.onmessage=p=>{const{data:m}=p;if(!(m instanceof ArrayBuffer)){console.warn("UNKNOWN data received",m),this._onDidExit.fire([77,"UNKNOWN data received"]);return}t.fire(ze.wrap(new Uint8Array(m,0,m.byteLength)))};const f={onMessage:t.event,send:p=>{const m=p.buffer.buffer.slice(p.buffer.byteOffset,p.buffer.byteOffset+p.buffer.byteLength);r.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await T.toPromise(T.filter(e.onMessage,t=>jne(t,ym.Ready))),this._isTerminating||(e.send(ze.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await T.toPromise(T.filter(e.onMessage,t=>jne(t,ym.Initialized))),this._isTerminating))throw rx();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(cot(ym.Terminate)),super.dispose())}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i&&this._productService.commit&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:SPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?void 0:{configuration:t.configuration||void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:this.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===Wx.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}};Kne=D([_(3,rn),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,V_),_(10,Xa),_(11,bg),_(12,on)],Kne);class Q9t{constructor(){this.capabilities=es.Readonly+es.FileReadWrite+es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw xs(t.statusText,rt.Unknown)}catch(t){throw xs(t,rt.Unknown)}}async stat(e){return{type:an.File,size:0,mtime:0,ctime:0}}watch(){return $.None}writeFile(e,t,i){throw new tE}readdir(e){throw new tE}mkdir(e){throw new tE}delete(e,t){throw new tE}rename(e,t,i){throw new tE}}var VDe={exports:{}},qpe={};(function(n,e){e=n.exports=Qn;var t;typeof process=="object"&&qpe&&qpe.NODE_DEBUG&&/\bsemver\b/i.test(qpe.NODE_DEBUG)?t=function(){var G=Array.prototype.slice.call(arguments,0);G.unshift("SEMVER"),console.log.apply(console,G)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,r=e.re=[],a=e.src=[],c=0,l=c++;a[l]="0|[1-9]\\d*";var d=c++;a[d]="[0-9]+";var h=c++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=c++;a[u]="("+a[l]+")\\.("+a[l]+")\\.("+a[l]+")";var f=c++;a[f]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var p=c++;a[p]="(?:"+a[l]+"|"+a[h]+")";var m=c++;a[m]="(?:"+a[d]+"|"+a[h]+")";var v=c++;a[v]="(?:-("+a[p]+"(?:\\."+a[p]+")*))";var w=c++;a[w]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var b=c++;a[b]="[0-9A-Za-z-]+";var C=c++;a[C]="(?:\\+("+a[b]+"(?:\\."+a[b]+")*))";var y=c++,S="v?"+a[u]+a[v]+"?"+a[C]+"?";a[y]="^"+S+"$";var M="[v=\\s]*"+a[f]+a[w]+"?"+a[C]+"?",k=c++;a[k]="^"+M+"$";var F=c++;a[F]="((?:<|>)?=?)";var N=c++;a[N]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var U=c++;a[U]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[C]+"?)?)?";var J=c++;a[J]="[v=\\s]*("+a[N]+")(?:\\.("+a[N]+")(?:\\.("+a[N]+")(?:"+a[w]+")?"+a[C]+"?)?)?";var j=c++;a[j]="^"+a[F]+"\\s*"+a[U]+"$";var re=c++;a[re]="^"+a[F]+"\\s*"+a[J]+"$";var me=c++;a[me]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Qe=c++;a[Qe]="(\\s*)"+a[De]+"\\s+",r[Qe]=new RegExp(a[Qe],"g");var Tt="$1~",Oe=c++;a[Oe]="^"+a[De]+a[U]+"$";var wt=c++;a[wt]="^"+a[De]+a[J]+"$";var Nt=c++;a[Nt]="(?:\\^)";var Ji=c++;a[Ji]="(\\s*)"+a[Nt]+"\\s+",r[Ji]=new RegExp(a[Ji],"g");var zi="$1^",Gn=c++;a[Gn]="^"+a[Nt]+a[U]+"$";var Ro=c++;a[Ro]="^"+a[Nt]+a[J]+"$";var qn=c++;a[qn]="^"+a[F]+"\\s*("+M+")$|^$";var tc=c++;a[tc]="^"+a[F]+"\\s*("+S+")$|^$";var ys=c++;a[ys]="(\\s*)"+a[F]+"\\s*("+M+"|"+a[U]+")",r[ys]=new RegExp(a[ys],"g");var mr="$1$2$3",ba=c++;a[ba]="^\\s*("+a[U]+")\\s+-\\s+("+a[U]+")\\s*$";var ki=c++;a[ki]="^\\s*("+a[J]+")\\s+-\\s+("+a[J]+")\\s*$";var gs=c++;a[gs]="(<|>)?=?\\s*\\*";for(var ir=0;iri)return null;var L=de?r[k]:r[y];if(!L.test(G))return null;try{return new Qn(G,de)}catch{return null}}e.valid=vc;function vc(G,de){var L=Hn(G,de);return L?L.version:null}e.clean=gh;function gh(G,de){var L=Hn(G.trim().replace(/^[=v]+/,""),de);return L?L.version:null}e.SemVer=Qn;function Qn(G,de){if(G instanceof Qn){if(G.loose===de)return G;G=G.version}else if(typeof G!="string")throw new TypeError("Invalid Version: "+G);if(G.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Qn))return new Qn(G,de);t("SemVer",G,de),this.loose=de;var L=G.trim().match(de?r[k]:r[y]);if(!L)throw new TypeError("Invalid Version: "+G);if(this.raw=G,this.major=+L[1],this.minor=+L[2],this.patch=+L[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");L[4]?this.prerelease=L[4].split(".").map(function(ne){if(/^[0-9]+$/.test(ne)){var R=+ne;if(R>=0&&R=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);L===-1&&this.prerelease.push(0)}de&&(this.prerelease[0]===de?isNaN(this.prerelease[1])&&(this.prerelease=[de,0]):this.prerelease=[de,0]);break;default:throw new Error("invalid increment argument: "+G)}return this.format(),this.raw=this.version,this},e.inc=Yh;function Yh(G,de,L,ne){typeof L=="string"&&(ne=L,L=void 0);try{return new Qn(G,L).inc(de,ne).version}catch{return null}}e.diff=tl;function tl(G,de){if(Ld(G,de))return null;var L=Hn(G),ne=Hn(de);if(L.prerelease.length||ne.prerelease.length){for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return"pre"+R;return"prerelease"}for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return R}e.compareIdentifiers=to;var Tl=/^[0-9]+$/;function to(G,de){var L=Tl.test(G),ne=Tl.test(de);return L&&ne&&(G=+G,de=+de),L&&!ne?-1:ne&&!L?1:Gde?1:0}e.rcompareIdentifiers=Oc;function Oc(G,de){return to(de,G)}e.major=rd;function rd(G,de){return new Qn(G,de).major}e.minor=Jh;function Jh(G,de){return new Qn(G,de).minor}e.patch=Af;function Af(G,de){return new Qn(G,de).patch}e.compare=il;function il(G,de,L){return new Qn(G,L).compare(new Qn(de,L))}e.compareLoose=Rl;function Rl(G,de){return il(G,de,!0)}e.rcompare=Xh;function Xh(G,de,L){return il(de,G,L)}e.sort=ul;function ul(G,de){return G.sort(function(L,ne){return e.compare(L,ne,de)})}e.rsort=ad;function ad(G,de){return G.sort(function(L,ne){return e.rcompare(L,ne,de)})}e.gt=wc;function wc(G,de,L){return il(G,de,L)>0}e.lt=Ca;function Ca(G,de,L){return il(G,de,L)<0}e.eq=Ld;function Ld(G,de,L){return il(G,de,L)===0}e.neq=fh;function fh(G,de,L){return il(G,de,L)!==0}e.gte=Fu;function Fu(G,de,L){return il(G,de,L)>=0}e.lte=bc;function bc(G,de,L){return il(G,de,L)<=0}e.cmp=Zh;function Zh(G,de,L,ne){var R;switch(de){case"===":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G===L;break;case"!==":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G!==L;break;case"":case"=":case"==":R=Ld(G,L,ne);break;case"!=":R=fh(G,L,ne);break;case">":R=wc(G,L,ne);break;case">=":R=Fu(G,L,ne);break;case"<":R=Ca(G,L,ne);break;case"<=":R=bc(G,L,ne);break;default:throw new TypeError("Invalid operator: "+de)}return R}e.Comparator=Cc;function Cc(G,de){if(G instanceof Cc){if(G.loose===de)return G;G=G.value}if(!(this instanceof Cc))return new Cc(G,de);t("comparator",G,de),this.loose=de,this.parse(G),this.semver===nr?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var nr={};Cc.prototype.parse=function(G){var de=this.loose?r[qn]:r[tc],L=G.match(de);if(!L)throw new TypeError("Invalid comparator: "+G);this.operator=L[1],this.operator==="="&&(this.operator=""),L[2]?this.semver=new Qn(L[2],this.loose):this.semver=nr},Cc.prototype.toString=function(){return this.value},Cc.prototype.test=function(G){return t("Comparator.test",G,this.loose),this.semver===nr?!0:(typeof G=="string"&&(G=new Qn(G,this.loose)),Zh(G,this.operator,this.semver,this.loose))},Cc.prototype.intersects=function(G,de){if(!(G instanceof Cc))throw new TypeError("a Comparator is required");var L;if(this.operator==="")return L=new Rs(G.value,de),Ou(this.value,L,de);if(G.operator==="")return L=new Rs(this.value,de),Ou(G.semver,L,de);var ne=(this.operator===">="||this.operator===">")&&(G.operator===">="||G.operator===">"),R=(this.operator==="<="||this.operator==="<")&&(G.operator==="<="||G.operator==="<"),H=this.semver.version===G.semver.version,ie=(this.operator===">="||this.operator==="<=")&&(G.operator===">="||G.operator==="<="),je=Zh(this.semver,"<",G.semver,de)&&(this.operator===">="||this.operator===">")&&(G.operator==="<="||G.operator==="<"),pt=Zh(this.semver,">",G.semver,de)&&(this.operator==="<="||this.operator==="<")&&(G.operator===">="||G.operator===">");return ne||R||H&&ie||je||pt},e.Range=Rs;function Rs(G,de){if(G instanceof Rs)return G.loose===de?G:new Rs(G.raw,de);if(G instanceof Cc)return new Rs(G.value,de);if(!(this instanceof Rs))return new Rs(G,de);if(this.loose=de,this.raw=G,this.set=G.split(/\s*\|\|\s*/).map(function(L){return this.parseRange(L.trim())},this).filter(function(L){return L.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+G);this.format()}Rs.prototype.format=function(){return this.range=this.set.map(function(G){return G.join(" ").trim()}).join("||").trim(),this.range},Rs.prototype.toString=function(){return this.range},Rs.prototype.parseRange=function(G){var de=this.loose;G=G.trim(),t("range",G,de);var L=de?r[ki]:r[ba];G=G.replace(L,ya),t("hyphen replace",G),G=G.replace(r[ys],mr),t("comparator trim",G,r[ys]),G=G.replace(r[Qe],Tt),G=G.replace(r[Ji],zi),G=G.split(/\s+/).join(" ");var ne=de?r[qn]:r[tc],R=G.split(" ").map(function(H){return Se(H,de)}).join(" ").split(/\s+/);return this.loose&&(R=R.filter(function(H){return!!H.match(ne)})),R=R.map(function(H){return new Cc(H,de)}),R},Rs.prototype.intersects=function(G,de){if(!(G instanceof Rs))throw new TypeError("a Range is required");return this.set.some(function(L){return L.every(function(ne){return G.set.some(function(R){return R.every(function(H){return ne.intersects(H,de)})})})})},e.toComparators=Ml;function Ml(G,de){return new Rs(G,de).set.map(function(L){return L.map(function(ne){return ne.value}).join(" ").trim().split(" ")})}function Se(G,de){return t("comp",G),G=Le(G,de),t("caret",G),G=cd(G,de),t("tildes",G),G=ts(G,de),t("xrange",G),G=sr(G,de),t("stars",G),G}function Mo(G){return!G||G.toLowerCase()==="x"||G==="*"}function cd(G,de){return G.trim().split(/\s+/).map(function(L){return K(L,de)}).join(" ")}function K(G,de){var L=de?r[wt]:r[Oe];return G.replace(L,function(ne,R,H,ie,je){t("tilde",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":je?(t("replaceTilde pr",je),je.charAt(0)!=="-"&&(je="-"+je),pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0"):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0",t("tilde return",pt),pt})}function Le(G,de){return G.trim().split(/\s+/).map(function(L){return ri(L,de)}).join(" ")}function ri(G,de){t("caret",G,de);var L=de?r[Ro]:r[Gn];return G.replace(L,function(ne,R,H,ie,je){t("caret",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?R==="0"?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+".0 <"+(+R+1)+".0.0":je?(t("replaceCaret pr",je),je.charAt(0)!=="-"&&(je="-"+je),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+je+" <"+(+R+1)+".0.0"):(t("no pr"),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+" <"+(+R+1)+".0.0"),t("caret return",pt),pt})}function ts(G,de){return t("replaceXRanges",G,de),G.split(/\s+/).map(function(L){return Os(L,de)}).join(" ")}function Os(G,de){G=G.trim();var L=de?r[re]:r[j];return G.replace(L,function(ne,R,H,ie,je,pt){t("xRange",G,ne,R,H,ie,je,pt);var is=Mo(H),Ss=is||Mo(ie),ld=Ss||Mo(je),Eg=ld;return R==="="&&Eg&&(R=""),is?R===">"||R==="<"?ne="<0.0.0":ne="*":R&&Eg?(Ss&&(ie=0),ld&&(je=0),R===">"?(R=">=",Ss?(H=+H+1,ie=0,je=0):ld&&(ie=+ie+1,je=0)):R==="<="&&(R="<",Ss?H=+H+1:ie=+ie+1),ne=R+H+"."+ie+"."+je):Ss?ne=">="+H+".0.0 <"+(+H+1)+".0.0":ld&&(ne=">="+H+"."+ie+".0 <"+H+"."+(+ie+1)+".0"),t("xRange return",ne),ne})}function sr(G,de){return t("replaceStars",G,de),G.trim().replace(r[gs],"")}function ya(G,de,L,ne,R,H,ie,je,pt,is,Ss,ld,Eg){return Mo(L)?de="":Mo(ne)?de=">="+L+".0.0":Mo(R)?de=">="+L+"."+ne+".0":de=">="+de,Mo(pt)?je="":Mo(is)?je="<"+(+pt+1)+".0.0":Mo(Ss)?je="<"+pt+"."+(+is+1)+".0":ld?je="<="+pt+"."+is+"."+Ss+"-"+ld:je="<="+je,(de+" "+je).trim()}Rs.prototype.test=function(G){if(!G)return!1;typeof G=="string"&&(G=new Qn(G,this.loose));for(var de=0;de0){var ne=G[L].semver;if(ne.major===de.major&&ne.minor===de.minor&&ne.patch===de.patch)return!0}return!1}return!0}e.satisfies=Ou;function Ou(G,de,L){try{de=new Rs(de,L)}catch{return!1}return de.test(G)}e.maxSatisfying=le;function le(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===-1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.minSatisfying=_r;function _r(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.validRange=No;function No(G,de){try{return new Rs(G,de).range||"*"}catch{return null}}e.ltr=mn;function mn(G,de,L){return ct(G,de,"<",L)}e.gtr=ve;function ve(G,de,L){return ct(G,de,">",L)}e.outside=ct;function ct(G,de,L,ne){G=new Qn(G,ne),de=new Rs(de,ne);var R,H,ie,je,pt;switch(L){case">":R=wc,H=bc,ie=Ca,je=">",pt=">=";break;case"<":R=Ca,H=Fu,ie=wc,je="<",pt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ou(G,de,ne))return!1;for(var is=0;is=0.0.0")),ld=ld||Bw,Eg=Eg||Bw,R(Bw.semver,ld.semver,ne)?ld=Bw:ie(Bw.semver,Eg.semver,ne)&&(Eg=Bw)}),ld.operator===je||ld.operator===pt||(!Eg.operator||Eg.operator===je)&&H(G,Eg.semver))return!1;if(Eg.operator===pt&&ie(G,Eg.semver))return!1}return!0}e.prerelease=Ht;function Ht(G,de){var L=Hn(G,de);return L&&L.prerelease.length?L.prerelease:null}e.intersects=Ei;function Ei(G,de,L){return G=new Rs(G,L),de=new Rs(de,L),G.intersects(de)}e.coerce=Ut;function Ut(G){if(G instanceof Qn)return G;if(typeof G!="string")return null;var de=G.match(r[me]);return de==null?null:Hn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(VDe,VDe.exports);var JV=VDe.exports;const iY="vs/workbench/services/extensions/common/extensionsUtil";function j9t(n,e,t,i,s){const o=new Ga;return n.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),e.forEach(r=>{const a=o.get(r.identifier);if(a)if(a.isBuiltin){if(JV.gte(a.version,r.version)){s.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){s.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,1,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{s.info(g(iY,2,"Loading development extension at {0}",r.extensionLocation.fsPath));const a=o.get(r.identifier);a&&a.isBuiltin&&(r.isBuiltin=!0),o.set(r.identifier,r)}),Array.from(o.values())}let zDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=s,this._environmentService=o,this._telemetryService=r,this._logService=a,this._loggerService=c,this._labelService=l,this.remoteAuthorityResolverService=d,this._extensionHostDebugService=h,this._productService=u,this._signService=f,this.pid=null,this.startup=Wx.EagerAutoStart,this.extensions=null,this._onExit=this._register(new I),this.onExit=this._onExit.event,this.remoteAuthority=this._initDataProvider.remoteAuthority,this._protocol=null,this._hasLostConnection=!1,this._terminating=!1;const p=hOe(this._environmentService);this._isExtensionDevHost=p.isExtensionDevHost}start(){const e={commit:this._productService.commit,quality:this._productService.quality,addressProvider:{getAddress:async()=>{const{authority:t}=await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);return{connectTo:t.connectTo,connectionToken:t.connectionToken}}},remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this._signService,logService:this._logService,ipcLogger:null};return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then(t=>{const i={language:Gd,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},s=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return s&&s.length>0&&s[0].scheme===_e.file&&(o=!1),o||(i.break=!1),F9t(e,i).then(r=>{this._register(r);const{protocol:a,debugPort:c,reconnectionToken:l}=r,d=typeof c=="number";return o&&this._environmentService.isExtensionDevelopment&&this._environmentService.debugExtensionHost.debugId&&c&&this._extensionHostDebugService.attachSession(this._environmentService.debugExtensionHost.debugId,c,this._initDataProvider.remoteAuthority),a.onDidDispose(()=>{this._onExtHostConnectionLost(l)}),a.onSocketClose(()=>{this._isExtensionDevHost&&this._onExtHostConnectionLost(l)}),new Promise((h,u)=>{const f=setTimeout(()=>{u("The remote extension host took longer than 60s to send its ready message.")},6e4),p=a.onMessage(m=>{if(jne(m,ym.Ready)){this._createExtHostInitData(d).then(v=>{a.send(ze.fromString(JSON.stringify(v)))});return}if(jne(m,ym.Initialized)){clearTimeout(f),p.dispose(),this._protocol=a,h(a);return}console.error("received unexpected message during handshake phase from the extension host: ",m)})})})})}_onExtHostConnectionLost(e){this._hasLostConnection||(this._hasLostConnection=!0,this._isExtensionDevHost&&this._environmentService.debugExtensionHost.debugId&&this._extensionHostDebugService.close(this._environmentService.debugExtensionHost.debugId),!this._terminating&&this._onExit.fire([0,e]))}async _createExtHostInitData(e){const t=await this._initDataProvider.getInitData();this.extensions=t.extensions;const i=this._contextService.getWorkspace();return{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:t.pid,environment:{isExtensionDevelopmentDebug:e,appRoot:t.appRoot,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier||"desktop",appUriScheme:this._productService.urlProtocol,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:SPe(this._productService,this._environmentService),appLanguage:Gd,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:i.configuration,id:i.id,name:this._labelService.getWorkspaceLabel(i),transient:i.transient},remote:{isRemote:!0,authority:this._initDataProvider.remoteAuthority,connectionData:t.connectionData},consoleForward:{includeStack:!1,logNative:!!this._environmentService.debugExtensionHost.debugId},extensions:this.extensions.toSnapshot(),telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:t.extensionHostLogsPath,autoStart:this.startup===Wx.EagerAutoStart,uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(cot(ym.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};zDe=D([_(2,yPe),_(3,Ti),_(4,ec),_(5,rn),_(6,Ze),_(7,wp),_(8,eo),_(9,rA),_(10,kZe),_(11,Xa),_(12,MZe)],zDe);var $De;let GDe=class extends RDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F,N){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,v,w,b,C,y,N),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=S,this._userDataProfileService=M,this._workspaceTrustManagementService=k,this._remoteExplorerService=F,C.when(Us.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}async _scanSingleExtension(e){if(e.location.scheme===_e.vscodeRemote)return this._remoteExtensionsScannerService.scanSingleExtension(e.location,e.type===qr.System);const t=await this._webExtensionsScannerService.scanExistingExtension(e.location,e.type,this._userDataProfileService.currentProfile.extensionsResource);return t?ME(t):null}_initFetchFileSystem(){const e=new Q9t;this._register(this._fileService.registerProvider(_e.http,e)),this._register(this._fileService.registerProvider(_e.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(s=>e.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(s=>t.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(s=>i.push(...s.map(o=>ME(o,!0))))])}catch(s){this._logService.error(s)}return j9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new c9t(e,t,!1,!0)}async _resolveExtensions(){if(!this._browserEnvironmentService.expectsResolverExtension)return this._resolveExtensionsDefault();const e=this._environmentService.remoteAuthority;await this._workspaceTrustManagementService.workspaceResolved;let t;try{t=await this._resolveAuthorityInitial(e)}catch(s){return HI.isHandled(s)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,s),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async s=>{s.type===$1.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=yi;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await C9t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(Ao.LocalWebWorker,e)}};GDe=D([_(3,be),_(4,Pi),_(5,Ow),_(6,rn),_(7,Kh),_(8,ci),_(9,Xa),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,OPe),_(15,Ze),_(16,Sf),_(17,Gde),_(18,mg),_(19,rA),_(20,ahe),_(21,Rm),_(22,oA),_(23,she),_(24,To)],GDe);let qDe=class{constructor(e,t,i,s,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=s,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case Ao.LocalProcess:return null;case Ao.LocalWebWorker:{const s=i?Wx.EagerManualStart:Wx.EagerAutoStart;return this._instantiationService.createInstance(Kne,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case Ao.Remote:{const s=this._remoteAgentService.getConnection();return s?this._instantiationService.createInstance(zDe,t,this._createRemoteExtensionHostDataProvider(e,s.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const s=MDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(s,[],!1),r=CX(s,o,c=>t.equals(c));return{extensions:new xJ(0,s,r.map(c=>c.identifier))}}else{const s=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(s.extensions,t);return{extensions:new xJ(s.versionId,s.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),s=await this._remoteAgentService.getEnvironment();if(!s)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,Ao.Remote),r=new xJ(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:s.pid,appRoot:s.appRoot,extensionHostLogsPath:s.extensionHostLogsPath,globalStorageHome:s.globalStorageHome,workspaceStorageHome:s.workspaceStorageHome,extensions:r}}}}};qDe=D([_(3,be),_(4,Sf),_(5,rA),_(6,Kh),_(7,Ze)],qDe);let QDe=$De=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,s,o){const r=$De.pickRunningLocation(t,i,s,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${s}, preference: ${D8t(o)} => ${hE(r)}`),r}static pickRunningLocation(e,t,i,s){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(s===rp.Remote)return Ao.Remote;r=!0}if(a==="workspace"&&i){if(s===rp.None||s===rp.Remote)return Ao.Remote;o.push(Ao.Remote)}if(a==="web"&&(t||i)){if(s===rp.None||s===rp.Local)return Ao.LocalWebWorker;o.push(Ao.LocalWebWorker)}}return r&&o.push(Ao.Remote),o.length>0?o[0]:null}};QDe=$De=D([_(0,Ze)],QDe);async function K9t(n,e,t){let i=t&&t.get("storage.serviceMachineId",ke.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(n.serviceMachineIdResource)).value.toString();i=xDt(o)?o:null}catch{i=null}if(!i){i=Dr();try{await e.writeFile(n.serviceMachineIdResource,ze.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,ke.APPLICATION,ln.MACHINE),i}const Y9t="/web-extension-resource/";class J9t{constructor(e,t,i,s,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=s,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(P.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:s},o){if(this._extensionGalleryResourceUrlTemplate){const r=P.parse(b_e(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:s!==void 0&&s!==Hs.UNDEFINED&&s!==Hs.UNKNOWN&&s!==Hs.UNIVERSAL?`${i}+${s}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:T9.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Jn?"-web":""}`,"X-Client-Version":this._productService.version};return EJ(this._productService,this._environmentService)&&vTt(this._configurationService)===sp.USAGE&&(e["X-Machine-Id"]=await this._getServiceMachineId()),this._productService.commit&&(e["X-Client-Commit"]=this._productService.commit),e}_getServiceMachineId(){return this._serviceMachineIdPromise||(this._serviceMachineIdPromise=K9t(this._environmentService,this._fileService,this._storageService)),this._serviceMachineIdPromise}_getExtensionGalleryAuthority(e){if(this._isWebExtensionResourceEndPoint(e))return e.authority;const t=e.authority.indexOf(".");return t!==-1?e.authority.substring(t+1):void 0}_isWebExtensionResourceEndPoint(e){const t=e.path,i=T9.getServerRootPath();return t.startsWith(i)&&t.startsWith(Y9t,i.length)}}let jDe=class extends J9t{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._logService=r}async readExtensionResource(e){if(e=lp.uriToBrowserUri(e),e.scheme!==_e.http&&e.scheme!==_e.https&&e.scheme!==_e.data)return(await this._fileService.readFile(e)).value.toString();const t={};this.isExtensionGalleryResource(e)&&(t.headers=await this.getExtensionGalleryRequestHeaders(),t.mode="cors");const i=await fetch(e.toString(!0),t);if(i.status!==200)throw this._logService.info(`Request to '${e.toString(!0)}' failed with status code ${i.status}`),new Error(i.statusText);return i.text()}};jDe=D([_(0,ci),_(1,on),_(2,Xa),_(3,Il),_(4,Re),_(5,Ze)],jDe);var RB,KDe;const pl="vs/workbench/services/extensionManagement/browser/extensionBisect";class g8{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new g8(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,s=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=s}}var kP;let YDe=(kP=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const s=t.get(RB._storageKey,ke.APPLICATION);if(this._state=g8.fromJSON(s),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&agc({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(s=>s.identifier.id),i=new g8(t,0,t.length,0);this._storageService.store(RB._storageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async next(e){if(!this._state)throw new Error("invalid state");if(e&&this._state.mid===0&&this._state.high===this._state.extensions.length)return{bad:!0,id:""};if(this._state.low===this._state.high-1)return await this.reset(),{id:this._state.extensions[this._state.low],bad:e};const t=new g8(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(RB._storageKey,JSON.stringify(t),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(RB._storageKey,ke.APPLICATION),await this._storageService.flush()}},RB=kP,kP._storageKey="extensionBisectState",kP);YDe=RB=D([_(0,Ze),_(1,on),_(2,ec)],YDe);var IP;let XV=(IP=class{constructor(e,t,i,s){this._extensionBisectService=t,this._notificationService=i,this._commandService=s,t.isActive&&(KDe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(pl,0,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(pl,1,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},s=this._extensionBisectService.disabledCount===1?g(pl,2,"Extension Bisect is active and has disabled 1 extension. Check if you can still reproduce the problem and proceed by selecting from these options."):g(pl,3,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",this._extensionBisectService.disabledCount);this._notificationService.prompt(nt.Info,s,[e,t,i],{sticky:!0,priority:jU.URGENT})}},KDe=IP,IP.ctxIsBisectActive=new Y("isExtensionBisectActive",!1),IP);XV=KDe=D([_(0,Pe),_(1,Fz),_(2,Pi),_(3,ji)],XV);it.as(pf.Workbench).registerWorkbenchContribution(XV,Us.Restored);At(class extends pi{constructor(){super({id:"extension.bisect.start",title:Be(pl,4,"Start Extension Bisect"),category:Za.Help,f1:!0,precondition:XV.ctxIsBisectActive.negate(),menu:{id:Te.ViewContainerTitle,when:ge.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(n){const e=n.get(To),t=n.get(Id),i=n.get(Rz),s=n.get(Kh),o=n.get(Fz),r=(await i.getInstalled(qr.User)).filter(c=>s.isEnabled(c));(await e.confirm({message:g(pl,5,"Extension Bisect"),detail:g(pl,6,"Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~{0} times). Each time you must confirm if you are still seeing problems.",2+Math.log2(r.length)|0),primaryButton:g(pl,7,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends pi{constructor(){super({id:"extension.bisect.next",title:Be(pl,8,"Continue Extension Bisect"),category:Za.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n,e){const t=n.get(To),i=n.get(Id),s=n.get(Fz),o=n.get(Xa),r=n.get(IZe),a=n.get(ji);if(!s.isActive)return;if(e===void 0){const l=await this._checkForBad(t,s);if(l===null)return;e=l}if(e===void 0){await s.reset(),i.reload();return}const c=await s.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(pl,9,"Extension Bisect"),g(pl,10,"Extension Bisect is done but no extension has been identified. This might be a problem with {0}.",o.nameShort));else{const l=await t.confirm({type:nt.Info,message:g(pl,9,"Extension Bisect"),primaryButton:g(pl,11,"&&Report Issue & Continue"),cancelButton:g(pl,12,"Continue"),detail:g(pl,13,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(pl,14,"Keep this extension disabled"),checked:!0}});l.checkboxChecked&&await r.disableExtension({id:c.id},void 0),l.confirmed&&await a.executeCommand("workbench.action.openIssueReporter",c.id)}await s.reset(),i.reload()}async _checkForBad(n,e){const{result:t}=await n.prompt({type:nt.Info,message:g(pl,15,"Extension Bisect"),detail:g(pl,16,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",e.disabledCount),buttons:[{label:g(pl,17,"I ca&&n't reproduce"),run:()=>!1},{label:g(pl,18,"I can &&reproduce"),run:()=>!0},{label:g(pl,19,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(pl,20,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends pi{constructor(){super({id:"extension.bisect.stop",title:Be(pl,21,"Stop Extension Bisect"),category:Za.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n){const e=n.get(Fz),t=n.get(Id);await e.reset(),t.reload()}});function X9t(n,e){return n}function Z9t(n){for(const[e,t]of Object.entries(n))lp.registerAppResourcePathUrl(e,t)}const gA="vs/base/common/jsonErrorMessages";function JDe(n){switch(n){case or.InvalidSymbol:return g(gA,0,"Invalid symbol");case or.InvalidNumberFormat:return g(gA,1,"Invalid number format");case or.PropertyNameExpected:return g(gA,2,"Property name expected");case or.ValueExpected:return g(gA,3,"Value expected");case or.ColonExpected:return g(gA,4,"Colon expected");case or.CommaExpected:return g(gA,5,"Comma expected");case or.CloseBraceExpected:return g(gA,6,"Closing brace expected");case or.CloseBracketExpected:return g(gA,7,"Closing bracket expected");case or.EndOfFileExpected:return g(gA,8,"End of file expected");default:return""}}const au="vs/platform/extensions/common/extensionValidator",lot=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,e7t=/^-(\d{4})(\d{2})(\d{2})$/;function t7t(n){return n=n.trim(),n==="*"||lot.test(n)}function I6(n){if(!t7t(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=n.match(lot);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function L6(n){if(!n)return null;const e=n.majorBase,t=n.majorMustEqual,i=n.minorBase;let s=n.minorMustEqual;const o=n.patchBase;let r=n.patchMustEqual;n.hasCaret&&(e===0||(s=!1),r=!1);let a=0;if(n.preRelease){const c=e7t.exec(n.preRelease);if(c){const[,l,d,h]=c;a=Date.UTC(Number(l),Number(d)-1,Number(h))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:s,patchBase:o,patchMustEqual:r,isMinimum:n.hasGreaterEquals,notBefore:a}}function i7t(n,e,t){let i;typeof n=="string"?i=L6(I6(n)):i=n;let s;e instanceof Date?s=e.getTime():typeof e=="string"&&(s=new Date(e).getTime());let o;if(typeof t=="string"?o=L6(I6(t)):o=t,!i||!o)return!1;const r=i.majorBase,a=i.minorBase,c=i.patchBase;let l=o.majorBase,d=o.minorBase,h=o.patchBase;const u=o.notBefore;let f=o.majorMustEqual,p=o.minorMustEqual,m=o.patchMustEqual;return o.isMinimum?r>l?!0:rd?!0:a=h:(r===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),rl?!f:ad?!p:ch?!m:!(s&&s"u"&&typeof i.browser>"u")return o.push([nt.Error,g(au,7,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),o}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&o.push([nt.Warning,g(au,8,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return o.push([nt.Error,g(au,9,"property `{0}` can be omitted or must be of type `string`","main")]),o;{const c=Qt(t,i.main);MS(c,t)||o.push([nt.Warning,g(au,10,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return o.push([nt.Error,g(au,11,"property `{0}` can be omitted or must be of type `string`","browser")]),o;{const c=Qt(t,i.browser);MS(c,t)||o.push([nt.Warning,g(au,12,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(!JV.valid(i.version))return o.push([nt.Error,g(au,13,"Extension version is not semver compatible.")]),o;const r=[];if(!s7t(n,e,i,s,r))for(const c of r)o.push([nt.Error,c]);return o}function s7t(n,e,t,i,s){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:o7t(n,e,t.engines.vscode,s)}function o7t(n,e,t,i=[]){const s=L6(I6(t));if(!s)return i.push(g(au,14,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(s.majorBase===0){if(!s.majorMustEqual||!s.minorMustEqual)return i.push(g(au,15,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions before 1.0.0, please define at a minimum the major and minor desired version. E.g. ^0.10.0, 0.10.x, 0.11.0, etc.",t)),!1}else if(!s.majorMustEqual)return i.push(g(au,16,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions after 1.0.0, please define at a minimum the major desired version. E.g. ^1.10.0, 1.10.x, 1.x.x, 2.x.x, etc.",t)),!1;return i7t(n,e,s)?!0:(i.push(g(au,17,"Extension is not compatible with Code {0}. Extension requires: {1}.",n,t)),!1)}function c$e(n){if(!Array.isArray(n))return!1;for(let e=0,t=n.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>gc(l.identifier,c.identifier)&&l.manifest.version!==c.version)?s.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>gc(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(o.push(h),a.push(h)):a.splice(d,1,h)}return o.length&&this._onAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onRemoveExtensions.fire({extensions:s,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,s=>{const o=[];for(const r of s){const a=e.find(([c])=>gc(c.identifier,r.identifier)&&c.manifest.version===r.version);a&&(r.metadata={...r.metadata,...a[1]},i.push(r)),o.push(r)}return o}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,s=>{const o=[];for(const r of s)gc(r.identifier,e.identifier)?i.push(r):o.push(r);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),o}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:t})}catch(s){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:s,profileLocation:t}),s}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let s=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if(Cy(r)!==Zi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Yne(lg(r),ZV.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){d$e(a)||this.reportAndThrowInvalidConentError(e);let c;if($t(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if($t(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=P.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}ll(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),s.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,ze.fromString(JSON.stringify(o)))}if(t){s=t(s);const r=s.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.toRelativePath(a.location),metadata:a.metadata}));await this.fileService.writeFile(e,ze.fromString(JSON.stringify(r)))}return s})}reportAndThrowInvalidConentError(e){const t=new Yne(`Invalid extensions content in ${e.toString()}`,ZV.ERROR_INVALID_CONTENT);throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:t.code}),t}toRelativePath(e){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(e),this.extensionsLocation)?this.uriIdentityService.extUri.basename(e):void 0}resolveExtensionLocation(e){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,e)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{const e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),t=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let i;try{i=(await this.fileService.readFile(e)).value.toString()}catch(o){if(Cy(o)===Zi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let s;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>d$e(r))?s=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(s)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify(s)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(o){if(Cy(o)===Zi.FILE_MODIFIED_SINCE)this.logService.info("Migration from old default profile location to new location is done by another window",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw o}try{await this.fileService.del(e)}catch(o){Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(o)}return s})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new dO,this.resourcesAccessQueueMap.set(e,t)),t}};l$e=D([_(1,ci),_(2,V_),_(3,_o),_(4,rn),_(5,Ze)],l$e);function d$e(n){return fo(n)&&iMt(n.identifier)&&(r7t(n.location)||$t(n.location)&&n.location)&&(ll(n.relativeLocation)||$t(n.relativeLocation))&&n.version&&$t(n.version)}function r7t(n){return n?$t(n.path)&&$t(n.scheme):!1}const a7t="vs/platform/extensionManagement/common/extensionNls";function c7t(n,e,t,i){try{l7t(n,e,t,i)}catch(s){n.error(s?.message??s)}return e}function l7t(n,e,t,i){const s=(o,r,a)=>{const c=o[r];if($t(c)){const l=c,d=l.length;if(d>1&&l[0]==="%"&&l[d-1]==="%"){const h=l.substr(1,d-2);let u=t[h];u===void 0&&i&&(u=i[h]);const f=typeof u=="string"?u:u?.message,p=i?.[h],m=typeof p=="string"?p:p?.message;if(!f){m||n.warn(`[${e.name}]: ${g(a7t,0,"Couldn't find message for key {0}.",h)}`);return}if(a&&(r==="title"||r==="category")&&m&&m!==f){const v={value:f,original:m};o[r]=v}else o[r]=f}}else if(fo(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?s(c,l,!0):s(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(qr.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(qr.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=rMt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[s,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...s,...o]):[];return this.dedupExtensions(s,o,r,await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){const t=[];t.push(this.scanDefaultSystemExtensions(!!e.useCache,e.language)),t.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));const[i,s]=await Promise.all(t);return this.applyScanOptions([...i,...s],qr.System,e,!1)}async scanUserExtensions(e){const t=e.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",t);const i=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,s=await this.createExtensionScannerInput(t,!!e.profileLocation,qr.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!s.devMode&&s.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(s)}catch(a){if(a instanceof Yne&&a.code===ZV.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(s);else throw a}return r=await this.applyScanOptions(r,qr.User,e,!0),this.logService.trace("Scanned user extensions:",r.length),r}async scanExtensionsUnderDevelopment(e,t){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const i=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(s=>s.scheme===_e.file).map(async s=>{const o=await this.createExtensionScannerInput(s,!1,qr.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>gc(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,o)))}))).flat();return this.applyScanOptions(i,"development",e,!0)}return[]}async scanExistingExtension(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(s);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(s);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const s=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);s.push(...r)})),this.applyScanOptions(s,t,i,!0)}async scanMetadata(e){const t=Qt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Qt(e,"package.json"),s=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(s);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(Qt(e,"package.json"),ze.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Yne&&e.code===ZV.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions();else throw e}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const e=await this.scanUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(t=>[t,t.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify([])))}catch(t){Cy(t)!==Zi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),lg(t))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,t,i,s){return i.includeAllVersions||(e=this.dedupExtensions(t===qr.System?e:void 0,t===qr.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),s)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=yr(o.location.fsPath),c=yr(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,s,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&JV.gt(c.manifest.version,l.manifest.version))return this.logService.debug(`Skipping extension ${l.location.path} with lower version ${l.manifest.version} in favour of ${c.location.path} with version ${c.manifest.version}`),!1;if(JV.eq(c.manifest.version,l.manifest.version)){if(c.type===qr.System)return this.logService.debug(`Skipping extension ${l.location.path} in favour of system extension ${c.location.path} with same version`),!1;if(c.targetPlatform===s)return this.logService.debug(`Skipping extension ${l.location.path} from different target platform ${l.targetPlatform}`),!1}}return d?this.logService.warn(`Overwriting user extension ${c.location.path} with ${l.location.path}.`):this.logService.debug(`Overwriting user extension ${c.location.path} with ${l.location.path}.`),!0},a=new Ga;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===qr.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!0))&&a.set(c.identifier.id,c),a.set(c.identifier.id,c)}),[...a.values()]}async scanDefaultSystemExtensions(e,t){this.logService.trace("Started scanning system extensions");const i=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,qr.System,!0,t,!0,void 0,this.getProductVersion()),o=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",o.length),o}async scanDevSystemExtensions(e,t){const i=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!i?.length)return[];this.logService.trace("Started scanning dev system extensions");const s=t?await this.getBuiltInExtensionControl():{},o=[],r=P.file(d1(k_e(lp.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=s[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(Qt(r,c.name));break;default:o.push(P.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,qr.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Vi(a)}async getBuiltInExtensionControl(){try{const e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,t,i,s,o,r,a,c){const l=await this.getTranslations(o??Gd),d=await this.getMtime(e),h=t&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,u=h?await this.getMtime(h):void 0;return new f8(e,d,h,u,t,a,i,s,r,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,o,l)}async getMtime(e){try{const t=await this.fileService.stat(e);if(typeof t.mtime=="number")return t.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};h$e=D([_(4,V_),_(5,$de),_(6,ci),_(7,Ze),_(8,Il),_(9,Xa),_(10,_o),_(11,be)],h$e);class f8{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=s,this.profile=o,this.profileScanOptions=r,this.type=a,this.excludeObsolete=c,this.validate=l,this.productVersion=d,this.productDate=h,this.productCommit=u,this.devMode=f,this.language=p,this.translations=m}static createNlsConfiguration(e){return{language:e.language,pseudo:e.language==="pseudo",devMode:e.devMode,translations:e.translations}}static equals(e,t){return _n(e.location,t.location)&&e.mtime===t.mtime&&_n(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Io(e.profileScanOptions,t.profileScanOptions)&&e.type===t.type&&e.excludeObsolete===t.excludeObsolete&&e.validate===t.validate&&e.productVersion===t.productVersion&&e.productDate===t.productDate&&e.productCommit===t.productCommit&&e.devMode===t.devMode&&e.language===t.language&&XDe.equals(e.translations,t.translations)}}let ZDe=class extends ${constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const s=Qt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",l?.path,JDe(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=P.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=ow(d,h);return h.length>0?(o(l,h),{values:void 0,default:s}):HW(u)!=="object"?(r(l),{values:void 0,default:s}):{values:u.contents?u.contents.package:void 0,default:s}}catch{return{values:void 0,default:s}}else{if(!await this.fileService.exists(s))return;let d;try{d=await this.findMessageBundles(e,i)}catch{return}if(!d.localized)return{values:void 0,default:d.original};try{const h=(await this.fileService.readFile(d.localized)).value.toString(),u=[],f=ow(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):HW(f)!=="object"?(r(d.localized),{values:void 0,default:d.original}):{values:f,default:d.original}}catch{return{values:void 0,default:d.original}}}}async translateManifest(e,t,i){const s=await this.getLocalizedMessages(e,t,i);if(s)try{const o=[],r=await this.resolveOriginalMessageBundle(s.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",s.default?.path,JDe(c.error))))}),t;if(HW(s)!=="object")return this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",s.default?.path))),t;const a=s.values||Object.create(null);return c7t(this.logService,t,a,r)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return ow(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,s)=>{const o=r=>{const a=Qt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Qt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:Qt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Qt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};ZDe=D([_(0,ci),_(1,Ze)],ZDe);let Jne=class extends ZDe{constructor(e,t,i,s,o){super(s,o),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===qr.User)try{const s=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(s)}catch{}return n1(i)?t:t.filter(s=>!i[G$.create(s).toString()])}async scanExtensionsFromLocation(e){const t=await this.fileService.resolve(e.location);if(!t.children?.length)return[];const i=await Promise.all(t.children.map(async s=>{if(!s.isDirectory||e.type===qr.User&&ui(s.resource).indexOf(".")===0)return null;const o=new f8(s.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.excludeObsolete,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(o)}));return Vi(i).sort((s,o)=>s.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(s=>!s.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,s=>!!s.metadata?.isBuiltin||!!s.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const s=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!s.length)return[];const o=await Promise.all(s.map(async r=>{if(t(r)){const a=new f8(r.location,i.mtime,i.applicationExtensionslocation,i.applicationExtensionslocationMtime,i.profile,i.profileScanOptions,i.type,i.excludeObsolete,i.validate,i.productVersion,i.productDate,i.productCommit,i.devMode,i.language,i.translations);return this.scanExtension(a,r.metadata)}return null}));return Vi(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Qt(e.location,"package.json"))){const t=await this.scanExtension(e);return t?[t]:[]}else return await this.scanExtensions(e)}catch(t){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,lg(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=gZe),t=t??i.__metadata,delete i.__metadata;const s=ny(i.publisher,i.name),o=t?.id?{id:s,uuid:t.id}:{id:s},r=t?.isSystem?qr.System:e.type,a=r===qr.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,f8.createNlsConfiguration(e));const c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Hs.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate?this.validate(c,e):c}}catch(i){e.type!==qr.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const s=n7t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin);for(const[o,r]of s)o===nt.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,r)));return e.isValid=i,e.validations=s,e}async scanExtensionManifest(e){const t=Qt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(kR,2,"Cannot read file {0}: {1}.",t.path,o.message))),null}let s;try{s=JSON.parse(i)}catch{const r=[];ow(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(kR,3,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,JDe(a.error))));return null}return HW(s)!=="object"?(this.logService.error(this.formatMessage(e,g(kR,4,"Invalid manifest file {0}: Not an JSON object.",t.path))),null):s}};Jne=D([_(1,$de),_(2,_o),_(3,ci),_(4,Ze)],Jne);let Xne=class extends Jne{constructor(e,t,i,s,o,r,a){super(t,s,o,r,a),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new iQ(3e3)),this._onDidChangeCache=this._register(new I),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){const t=this.getCacheFile(e),i=await this.readExtensionCache(t);if(this.input=e,i&&i.input&&f8.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=P.revive(o.location),o));const s=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:s}),s}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Or(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,lg(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,ze.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,lg(i))}}async validateCache(){if(!this.input)return;const e=this.getCacheFile(this.input),t=await this.readExtensionCache(e);if(!t)return;const i=t.result,s=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Io(s,i))try{this.logService.info("Invalidating Cache",i,s),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(o){this.logService.error(o)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===qr.System?iLt:tLt)}getProfile(e){return e.type===qr.System?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(t=>this.uriIdentityService.extUri.isEqual(e.location,t.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};Xne=D([_(2,V_),_(3,$de),_(4,_o),_(5,ci),_(6,Ze)],Xne);const eke=["W","X","Y","Z","a","b","c","d","e","f"],d7t=new RegExp(`^[${eke.join("")}]+`),dot=7;function h7t(n){if(n.scheme!==_e.vscodeNotebookCell)return;const e=n.fragment.indexOf("s");if(e<0)return;const t=parseInt(n.fragment.substring(0,e).replace(d7t,""),dot),i=Tje(n.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:n.with({scheme:i,fragment:null})}}function u7t(n,e){const t=e.toString(dot),s=`${t.lengthze.wrap(r))),o=y7t(s);return i=i||o.byteLength!==s.byteLength,{data:o,didCompression:i}}const AX="\x1B[A",Qpe=AX.split("").map(n=>n.charCodeAt(0)),m7t=10;function _7t(n){let e=!1;return n.forEach((t,i)=>{if(i===0||t.length-1;){const e=n.match(/^(.*)\r+/m)[1];let t=n.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),n=n.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return n}const b7t=8,C7t=13;function y7t(n){return!n.buffer.includes(b7t)&&!n.buffer.includes(C7t)?n:ze.fromString(w7t(v7t(f7t.decode(n.buffer))))}var nke,aT,wA,ske,cT,qD,lT,oke,rke,EX,U3,ake,TC,RC,cke,Rf,lke;function Ri(n){return Object.assign(n,{apply:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(n,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const[i,...s]=t;return Reflect.construct(n,s,i.constructor)}}})}var tse;(function(n){n[n.Top=0]="Top",n[n.Bottom=1]="Bottom"})(tse||(tse={}));var OR,Hqe;let oo=nke=(Hqe=class{constructor(e){kt(this,OR);st(this,OR,e)}static from(...e){let t=e;return new nke(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof se(this,OR)=="function"&&(se(this,OR).call(this),st(this,OR,void 0))}},OR=new WeakMap,Hqe);oo=nke=D([Ri],oo);let Ps=aT=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;ie.line?1:this._charactere._character?1:0}translate(e,t=0){if(e===null||t===null)throw Ui();let i;return typeof e>"u"?i=0:typeof e=="number"?i=e:(i=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),i===0&&t===0?this:new aT(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Ui();let i;return typeof e>"u"?i=this.line:typeof e=="number"?i=e:(i=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),i===this.line&&t===this.character?this:new aT(i,t)}toJSON(){return{line:this.line,character:this.character}}};Ps=aT=D([Ri],Ps);let rs=wA=class{static isRange(e){return e instanceof wA?!0:e?Ps.isPosition(e.start)&&Ps.isPosition(e.end):!1}static of(e){if(e instanceof wA)return e;if(this.isRange(e))return new wA(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");o.isBefore(r)?(this._start=o,this._end=r):(this._start=r,this._end=o)}contains(e){return wA.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ps.isPosition(e)?!(Ps.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){const t=Ps.Max(e.start,this._start),i=Ps.Min(e.end,this._end);if(!t.isAfter(i))return new wA(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=Ps.Min(e.start,this._start),i=Ps.Max(e.end,this.end);return new wA(t,i)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw Ui();let i;return e?Ps.isPosition(e)?i=e:(i=e.start||this.start,t=e.end||this.end):i=this.start,i.isEqual(this._start)&&t.isEqual(this.end)?this:new wA(i,t)}toJSON(){return[this.start,this.end]}};rs=wA=D([Ri],rs);let XS=ske=class extends rs{static isSelection(e){return e instanceof ske?!0:e?rs.isRange(e)&&Ps.isPosition(e.anchor)&&Ps.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");super(o,r),this._anchor=o,this._active=r}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}};XS=ske=D([Ri],XS);const uot=n=>{if(typeof n!="string"||n.length===0||!/^[0-9A-Za-z_\-]+$/.test(n))throw Ui("connectionToken")};let got=class{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,i){if(typeof e!="string"||e.length===0)throw Ui("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Ui("port");typeof i<"u"&&uot(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},m8=class{static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t){this.makeConnection=e,this.connectionToken=t,typeof t<"u"&&uot(t)}},OT=class xX extends Error{static NotAvailable(e,t){return new xX(e,Xd.NotAvailable,t)}static TemporarilyNotAvailable(e){return new xX(e,Xd.TemporarilyNotAvailable)}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,xX.prototype)}};var jv;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(jv||(jv={}));var LM;(function(n){n[n.Replace=1]="Replace",n[n.Append=2]="Append",n[n.Prepend=3]="Prepend"})(LM||(LM={}));let qx=cT=class{static isTextEdit(e){return e instanceof cT?!0:e?rs.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new cT(e,t)}static insert(e,t){return cT.replace(new rs(e,e),t)}static delete(e){return cT.replace(e,"")}static setEndOfLine(e){const t=new cT(new rs(new Ps(0,0),new Ps(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!rs.isRange(e))throw Ui("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Ui("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Ui("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};qx=cT=D([Ri],qx);let T6=qD=class{static isNotebookCellEdit(e){return e instanceof qD?!0:e?rS.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new qD(e,t)}static insertCells(e,t){return new qD(new rS(e,e),t)}static deleteCells(e){return new qD(e,[])}static updateCellMetadata(e,t){const i=new qD(new rS(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new qD(new rS(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};T6=qD=D([Ri],T6);let zhe=class DX{static isSnippetTextEdit(e){return e instanceof DX?!0:e?rs.isRange(e.range)&&Q1.isSnippetString(e.snippet):!1}static replace(e,t){return new DX(e,t)}static insert(e,t){return DX.replace(new rs(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var sl;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.Cell=3]="Cell",n[n.CellReplace=5]="CellReplace",n[n.Snippet=6]="Snippet"})(sl||(sl={}));let q1=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,s){this._edits.push({_type:sl.File,from:e,to:t,options:i,metadata:s})}createFile(e,t,i){this._edits.push({_type:sl.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:sl.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:sl.Cell,metadata:i,uri:e,edit:{editType:G1.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,s){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:sl.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:s})}replaceNotebookCellMetadata(e,t,i,s){this._edits.push({_type:sl.Cell,metadata:s,uri:e,edit:{editType:G1.Metadata,index:t,metadata:i}})}replace(e,t,i,s){this._edits.push({_type:sl.Text,uri:e,edit:new qx(t,i),metadata:s})}insert(e,t,i,s){this.replace(e,new rs(t,t),i,s)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===sl.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let s,o;Array.isArray(i)?(s=i[0],o=i[1]):s=i,T6.isNotebookCellEdit(s)?s.newCellMetadata?this.replaceNotebookCellMetadata(e,s.range.start,s.newCellMetadata,o):s.newNotebookMetadata?this.replaceNotebookMetadata(e,s.newNotebookMetadata,o):this.replaceNotebookCells(e,s.range,s.newCells,o):zhe.isSnippetTextEdit(s)?this._edits.push({_type:sl.Snippet,uri:e,range:s.range,edit:s.snippet,metadata:o}):this._edits.push({_type:sl.Text,uri:e,edit:s,metadata:o})}else{for(let i=0;is.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){const i=new lT;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};Q1=lT=D([Ri],Q1);var mI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(mI||(mI={}));var Th;(function(n){n[n.Hint=3]="Hint",n[n.Information=2]="Information",n[n.Warning=1]="Warning",n[n.Error=0]="Error"})(Th||(Th={}));let _p=oke=class{static isLocation(e){return e instanceof oke?!0:e?rs.isRange(e.range)&&P.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(rs.isRange(t))this.range=rs.of(t);else if(Ps.isPosition(t))this.range=new rs(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};_p=oke=D([Ri],_p);let e4=class{static is(e){return e?typeof e.message=="string"&&e.location&&rs.isRange(e.location.range)&&P.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};e4=D([Ri],e4);let R6=class{constructor(e,t,i=Th.Error){if(!rs.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=i}toJSON(){return{severity:Th[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&Ls(e.tags,t.tags)&&Ls(e.relatedInformation,t.relatedInformation,e4.isEqual)}};R6=D([Ri],R6);let M6=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};M6=D([Ri],M6);let ise=class extends M6{constructor(e,t,i,s){super(e,t),this.canIncreaseHover=i,this.canDecreaseHover=s}};ise=D([Ri],ise);var dke;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(dke||(dke={}));var t4;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(t4||(t4={}));let N6=class{constructor(e,t=t4.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:t4[this.kind]}}};N6=D([Ri],N6);let P6=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};P6=D([Ri],P6);var Gr;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(Gr||(Gr={}));var i4;(function(n){n[n.Deprecated=1]="Deprecated"})(i4||(i4={}));let n4=rke=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,s,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),s instanceof _p?this.location=s:i instanceof rs&&(this.location=new _p(s,i)),rke.validate(this)}toJSON(){return{name:this.name,kind:Gr[this.kind],location:this.location,containerName:this.containerName}}};n4=rke=D([Ri],n4);let s4=EX=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(EX.validate)}constructor(e,t,i,s,o){this.name=e,this.detail=t,this.kind=i,this.range=s,this.selectionRange=o,this.children=[],EX.validate(this)}};s4=EX=D([Ri],s4);var o4;(function(n){n[n.Invoke=1]="Invoke",n[n.Automatic=2]="Automatic"})(o4||(o4={}));let F6=class{constructor(e,t){this.title=e,this.kind=t}};F6=D([Ri],F6);var LP;let Ja=(LP=class{constructor(e){this.value=e}append(e){return new U3(this.value?this.value+U3.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+U3.sep)}},U3=LP,LP.sep=".",LP);Ja=U3=D([Ri],Ja);Ja.Empty=new Ja("");Ja.QuickFix=Ja.Empty.append("quickfix");Ja.Refactor=Ja.Empty.append("refactor");Ja.RefactorExtract=Ja.Refactor.append("extract");Ja.RefactorInline=Ja.Refactor.append("inline");Ja.RefactorMove=Ja.Refactor.append("move");Ja.RefactorRewrite=Ja.Refactor.append("rewrite");Ja.Source=Ja.Empty.append("source");Ja.SourceOrganizeImports=Ja.Source.append("organizeImports");Ja.SourceFixAll=Ja.Source.append("fixAll");Ja.Notebook=Ja.Empty.append("notebook");let r4=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};r4=D([Ri],r4);let $he=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}},fOe=class{constructor(e,t){this.fromRanges=t,this.from=e}},pOe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var TM;(function(n){n[n.Information=0]="Information",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(TM||(TM={}));let O6=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};O6=D([Ri],O6);var Uu,Uqe;let vp=ake=(Uqe=class{constructor(e,t=!1){kt(this,Uu);st(this,Uu,new Xt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof ake?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return se(this,Uu).value}set value(e){se(this,Uu).value=e}get isTrusted(){return se(this,Uu).isTrusted}set isTrusted(e){se(this,Uu).isTrusted=e}get supportThemeIcons(){return se(this,Uu).supportThemeIcons}set supportThemeIcons(e){se(this,Uu).supportThemeIcons=e}get supportHtml(){return se(this,Uu).supportHtml}set supportHtml(e){se(this,Uu).supportHtml=e}get baseUri(){return se(this,Uu).baseUri}set baseUri(e){se(this,Uu).baseUri=e}appendText(e){return se(this,Uu).appendText(e),this}appendMarkdown(e){return se(this,Uu).appendMarkdown(e),this}appendCodeblock(e,t){return se(this,Uu).appendCodeblock(t??"",e),this}},Uu=new WeakMap,Uqe);vp=ake=D([Ri],vp);let nse=class{constructor(e,t){this.label=e,this.documentation=t}};nse=D([Ri],nse);let sse=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};sse=D([Ri],sse);let ose=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};ose=D([Ri],ose);var rse;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(rse||(rse={}));var ase;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(ase||(ase={}));let B6=class{constructor(e){this.value=e}};B6=D([Ri],B6);let W6=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};W6=D([Ri],W6);var RM;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(RM||(RM={}));var nn;(function(n){n[n.Text=0]="Text",n[n.Method=1]="Method",n[n.Function=2]="Function",n[n.Constructor=3]="Constructor",n[n.Field=4]="Field",n[n.Variable=5]="Variable",n[n.Class=6]="Class",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Unit=10]="Unit",n[n.Value=11]="Value",n[n.Enum=12]="Enum",n[n.Keyword=13]="Keyword",n[n.Snippet=14]="Snippet",n[n.Color=15]="Color",n[n.File=16]="File",n[n.Reference=17]="Reference",n[n.Folder=18]="Folder",n[n.EnumMember=19]="EnumMember",n[n.Constant=20]="Constant",n[n.Struct=21]="Struct",n[n.Event=22]="Event",n[n.Operator=23]="Operator",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue"})(nn||(nn={}));var a4;(function(n){n[n.Deprecated=1]="Deprecated"})(a4||(a4={}));let H6=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&nn[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};H6=D([Ri],H6);let WF=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};WF=D([Ri],WF);let cse=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};cse=D([Ri],cse);let lse=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};lse=D([Ri],lse);var IR;(function(n){n[n.Unknown=0]="Unknown",n[n.Word=1]="Word",n[n.Line=2]="Line",n[n.Suggest=3]="Suggest"})(IR||(IR={}));var c4;(function(n){n[n.Active=-1]="Active",n[n.Beside=-2]="Beside",n[n.One=1]="One",n[n.Two=2]="Two",n[n.Three=3]="Three",n[n.Four=4]="Four",n[n.Five=5]="Five",n[n.Six=6]="Six",n[n.Seven=7]="Seven",n[n.Eight=8]="Eight",n[n.Nine=9]="Nine"})(c4||(c4={}));var HE;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(HE||(HE={}));function S7t(n,e){return`${Cn.toKey(n)}.${e}`}var wv;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval"})(wv||(wv={}));var MM;(function(n){n[n.Manual=1]="Manual",n[n.AfterDelay=2]="AfterDelay",n[n.FocusOut=3]="FocusOut"})(MM||(MM={}));var U6;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(U6||(U6={}));var HF;(function(n){n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command"})(HF||(HF={}));var l4;(function(n){n[n.Undo=1]="Undo",n[n.Redo=2]="Redo"})(l4||(l4={}));var _I;(function(n){n[n.OpenOpen=0]="OpenOpen",n[n.ClosedClosed=1]="ClosedClosed",n[n.OpenClosed=2]="OpenClosed",n[n.ClosedOpen=3]="ClosedOpen"})(_I||(_I={}));(function(n){function e(t){switch(t){case"keyboard":return n.Keyboard;case"mouse":return n.Mouse;case"api":return n.Command}}n.fromValue=e})(HF||(HF={}));var UF;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UF||(UF={}));(function(n){function e(t){switch(t){case n.Other:return"other";case n.Comment:return"comment";case n.String:return"string";case n.RegEx:return"regex"}return"other"}n.toString=e})(UF||(UF={}));let V6=class{constructor(e,t){if(t&&!P.isUri(t))throw Ui("target");if(!rs.isRange(e)||e.isEmpty)throw Ui("range");this.range=e,this.target=t}};V6=D([Ri],V6);let VF=class{constructor(e,t,i,s){this.red=e,this.green=t,this.blue=i,this.alpha=s}};VF=D([Ri],VF);let z6=class{constructor(e,t){if(t&&!(t instanceof VF))throw Ui("color");if(!rs.isRange(e)||e.isEmpty)throw Ui("range");this.range=e,this.color=t}};z6=D([Ri],z6);let $6=class{constructor(e){if(!e||typeof e!="string")throw Ui("label");this.label=e}};$6=D([Ri],$6);var dse;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Information=2]="Information"})(dse||(dse={}));var hse;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(hse||(hse={}));var NM;(function(n){n[n.Low=0]="Low",n[n.Medium=1]="Medium",n[n.High=2]="High"})(NM||(NM={}));let fot=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Ui("startIndex");if(typeof t!="number"||t<1)throw Ui("length");if(i!==void 0&&typeof i!="string")throw Ui("tooltip")}},pot=class{constructor(e){this.uri=e}};class mot{constructor(e){this.terminalCommand=e}}var use;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(use||(use={}));let _ot=class{constructor(e){if(this.options=e,typeof e!="object")throw Ui("options")}};var gse;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(gse||(gse={}));var fse;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(fse||(fse={}));var Qy;let d4=(Qy=class{static from(e){switch(e){case"clean":return TC.Clean;case"build":return TC.Build;case"rebuild":return TC.Rebuild;case"test":return TC.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Ui("name");this._id=e}get id(){return this._id}},TC=Qy,Qy.Clean=new TC("clean","Clean"),Qy.Build=new TC("build","Build"),Qy.Rebuild=new TC("rebuild","Rebuild"),Qy.Test=new TC("test","Test"),Qy);d4=TC=D([Ri],d4);function vot(n){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return vot(e)}};zF=D([Ri],zF);let j1=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Ui("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Ui("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Ui("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Ui("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Ui("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(const t of this._args)e.push(typeof t=="string"?t:t.value);return vot(e)}};j1=D([Ri],j1);var pse;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(pse||(pse={}));var K1;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace"})(K1||(K1={}));let Ghe=class{constructor(e){this._callback=e}computeId(){return"customExecution"+Dr()}set callback(e){this._callback=e}get callback(){return this._callback}};var jy;let G6=(jy=class{constructor(e,t,i,s,o,r){this.__deprecated=!1,this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=i,this.execution=s,a=o,this.__deprecated=!0):t===K1.Global||t===K1.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof zF?this._definition={type:RC.ProcessType,id:this._execution.computeId()}:this._execution instanceof j1?this._definition={type:RC.ShellType,id:this._execution.computeId()}:this._execution instanceof Ghe?this._definition={type:RC.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:RC.EmptyType,id:Dr()}}get definition(){return this._definition}set definition(e){if(e==null)throw Ui("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw Ui("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;const t=this._definition.type;(RC.EmptyType===t||RC.ProcessType===t||RC.ShellType===t||RC.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw Ui("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}},RC=jy,jy.ExtensionCallbackType="customExecution",jy.ProcessType="process",jy.ShellType="shell",jy.EmptyType="$empty",jy);G6=RC=D([Ri],G6);var VI;(function(n){n[n.SourceControl=1]="SourceControl",n[n.Window=10]="Window",n[n.Notification=15]="Notification"})(VI||(VI={}));var hke;(function(n){function e(t){const i=t;return Kc(i.value)?i.tooltip&&!$t(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}n.isViewBadge=e})(hke||(hke={}));let q6=cke=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const s=Kc(i.checkboxState)?i.checkboxState:fo(i.checkboxState)&&Kc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!Kc(i.checkboxState)&&fo(i.checkboxState)?i.checkboxState.tooltip:void 0;if(s===void 0||s!==Lb.Checked&&s!==Lb.Unchecked||o!==void 0&&!$t(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof cke)return!0;if(i.label!==void 0&&!$t(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!$t(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!$t(i.iconPath)&&!P.isUri(i.iconPath)&&(!i.iconPath||!$t(i.iconPath.id))){const s=i.iconPath;if(!s||!$t(s.light)&&!P.isUri(s.light)&&!$t(s.dark)&&!P.isUri(s.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!$t(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!P.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!$t(i.tooltip)&&!(i.tooltip instanceof vp)?(console.log("INVALID tree item, invalid tooltip",i.tooltip),!1):i.command!==void 0&&!i.command.command?(console.log("INVALID tree item, invalid command",i.command),!1):i.collapsibleState!==void 0&&i.collapsibleStatezI.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!$t(i.contextValue)?(console.log("INVALID tree item, invalid contextValue",i.contextValue),!1):i.accessibilityInformation!==void 0&&!i.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",i.accessibilityInformation),!1):!0}constructor(e,t=zI.None){this.collapsibleState=t,P.isUri(e)?this.resourceUri=e:this.label=e}};q6=cke=D([Ri],q6);var zI;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(zI||(zI={}));var Lb;(function(n){n[n.Unchecked=0]="Unchecked",n[n.Checked=1]="Checked"})(Lb||(Lb={}));let Q6=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Q6=D([Ri],Q6);class mse extends Q6{}var wq;class A7t extends mse{constructor(t){super("");kt(this,wq);st(this,wq,t)}asFile(){return se(this,wq)}}wq=new WeakMap;class E7t{constructor(e,t,i,s){this.name=e,this.uri=t,this._itemId=i,this._getData=s}data(){return this._getData()}}var jA,BR,V3,Vqe;let h4=(Vqe=class{constructor(e){kt(this,BR);kt(this,jA,new Map);for(const[t,i]of e??[]){const s=se(this,jA).get(Zz(this,BR,V3).call(this,t));s?s.push(i):se(this,jA).set(Zz(this,BR,V3).call(this,t),[i])}}get(e){return se(this,jA).get(Zz(this,BR,V3).call(this,e))?.[0]}set(e,t){se(this,jA).set(Zz(this,BR,V3).call(this,e),[t])}forEach(e,t){for(const[i,s]of se(this,jA))for(const o of s)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of se(this,jA))for(const i of t)yield[e,i]}},jA=new WeakMap,BR=new WeakSet,V3=function(e){return e.toLowerCase()},Vqe);h4=D([Ri],h4);let _se=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};_se=D([Ri],_se);var uke;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(uke||(uke={}));const gW=class gW{constructor(e){this.value=e}append(...e){return new gW((this.value?[this.value,...e]:e).join(gW.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+gW.sep)}};gW.sep=".";let u4=gW;u4.Empty=new u4("");let wot=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},fg=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};fg=D([Ri],fg);fg.File=new fg("file");fg.Folder=new fg("folder");let g4=class{constructor(e){this.id=e}};g4=D([Ri],g4);var PM;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.WorkspaceFolder=3]="WorkspaceFolder"})(PM||(PM={}));let FM=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=P.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!P.isUri(e)&&!P.isUri(e.uri)))throw Ui("base");if(typeof t!="string")throw Ui("pattern");typeof e=="string"?this.baseUri=P.file(e):P.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};FM=D([Ri],FM);const bot=new WeakMap;function x7t(n,e){bot.set(n,e)}let $F=class{constructor(e,t,i,s,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof s=="string"&&(this.logMessage=s),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=bot.get(this)??Dr()),this._id}};$F=D([Ri],$F);let vI=class extends $F{constructor(e,t,i,s,o,r){if(super(t,i,s,o,r),e===null)throw Ui("location");this.location=e}};vI=D([Ri],vI);let wI=class extends $F{constructor(e,t,i,s,o,r){super(t,i,s,o,r),this.functionName=e}};wI=D([Ri],wI);let vse=class extends $F{constructor(e,t,i,s,o,r,a,c){if(super(s,o,r,a,c),!t)throw Ui("dataId");this.label=e,this.dataId=t,this.canPersist=i}};vse=D([Ri],vse);let j6=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};j6=D([Ri],j6);let f4=class{constructor(e,t){this.port=e,this.host=t}};f4=D([Ri],f4);let K6=class{constructor(e){this.path=e}};K6=D([Ri],K6);let Y6=class{constructor(e){this.implementation=e}};Y6=D([Ri],Y6);class Cot{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}}class yot{constructor(e,t){this.session=e,this.threadId=t}}let J6=class{constructor(e,t){this.range=e,this.expression=t}};J6=D([Ri],J6);var p4;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(p4||(p4={}));let X6=class{constructor(e,t){this.range=e,this.text=t}};X6=D([Ri],X6);let Z6=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};Z6=D([Ri],Z6);let eG=class{constructor(e,t){this.range=e,this.expression=t}};eG=D([Ri],eG);let gke=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};gke=D([Ri],gke);var fke;(function(n){n[n.AIGenerated=1]="AIGenerated"})(fke||(fke={}));var tG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(tG||(tG={}));class D7t{constructor(e,t){this.newSymbolName=e,this.tags=t}}var OM;(function(n){n[n.Changed=1]="Changed",n[n.Created=2]="Created",n[n.Deleted=3]="Deleted"})(OM||(OM={}));let Wl=Rf=class extends Error{static FileExists(e){return new Rf(e,rt.FileExists,Rf.FileExists)}static FileNotFound(e){return new Rf(e,rt.FileNotFound,Rf.FileNotFound)}static FileNotADirectory(e){return new Rf(e,rt.FileNotADirectory,Rf.FileNotADirectory)}static FileIsADirectory(e){return new Rf(e,rt.FileIsADirectory,Rf.FileIsADirectory)}static NoPermissions(e){return new Rf(e,rt.NoPermissions,Rf.NoPermissions)}static Unavailable(e){return new Rf(e,rt.Unavailable,Rf.Unavailable)}constructor(e,t=rt.Unknown,i){super(P.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",vJe(this,t),Object.setPrototypeOf(this,Rf.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Wl=Rf=D([Ri],Wl);let wse=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};wse=D([Ri],wse);var vy;(function(n){n[n.Comment=1]="Comment",n[n.Imports=2]="Imports",n[n.Region=3]="Region"})(vy||(vy={}));var m4;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(m4||(m4={}));var bse;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(bse||(bse={}));var Cse;(function(n){n[n.Published=0]="Published",n[n.Draft=1]="Draft"})(Cse||(Cse={}));var _4;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(_4||(_4={}));var iG;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(iG||(iG={}));let yse=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function k7t(n){return typeof n>"u"||Yqe(n)}let Sot=class Aot{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,i=e.tokenTypes.length;t"u"))return typeof o>"u"&&(o=0),this._pushEncoded(e,t,i,s,o);if(rs.isRange(e)&&typeof t=="string"&&k7t(i))return this._push(e,t,i);throw Ui()}_push(e,t,i){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");const s=e.start.line,o=e.start.character,r=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t);let c=0;if(i)for(const l of i){if(!this._tokenModifierStrToInt.has(l))throw new Error("`tokenModifier` is not in the provided legend");const d=this._tokenModifierStrToInt.get(l);c|=1<>>0}this._pushEncoded(s,o,r,a,c)}_pushEncoded(e,t,i,s,o){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(r-=this._prevLine,r===0&&(a-=this._prevChar)),this._data[this._dataLen++]=r,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){const t=[],i=e.length/5|0;for(let a=0;a{const l=e[5*a],d=e[5*c];if(l===d){const h=e[5*a+1],u=e[5*c+1];return h-u}return l-d});const s=new Uint32Array(e.length);let o=0,r=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!fg.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,i){this.badge=e,this.tooltip=t,this.color=i}},Sse=class{constructor(e){this.kind=e}};Sse=D([Ri],Sse);var uE;(function(n){n[n.Light=1]="Light",n[n.Dark=2]="Dark",n[n.HighContrast=3]="HighContrast",n[n.HighContrastLight=4]="HighContrastLight"})(uE||(uE={}));let rS=class pke{static isNotebookRange(e){return e instanceof pke?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw Ui("start must be positive");if(t<0)throw Ui("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,i=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(i=e.end),t===this._start&&i===this._end?this:new pke(t,i)}},ej=class mke{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>mke.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,s,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=s,this.outputs=o??[],this.metadata=r,this.executionSummary=a,mke.validate(this)}},_Oe=class{constructor(e){this.cells=e}};var Gp,ile;let vOe=(Gp=class{static isNotebookCellOutputItem(e){return e instanceof Gp?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){const t={name:e.name,message:e.message,stack:e.stack};return Gp.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Gp.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Gp.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Gp(e,t)}static text(e,t=Js.text){const i=se(Gp,ile).encode(String(e));return new Gp(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Gp.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=Oje(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},ile=new WeakMap,kt(Gp,ile,new TextEncoder),Gp),oG=class _ke{static isNotebookCellOutput(e){return e instanceof _ke?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,s=new Set;for(let o=0;o!s.has(r))}constructor(e,t,i){this.items=_ke.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=Dr(),this.metadata=t??i)}};var bI;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(bI||(bI={}));var qF;(function(n){n[n.Idle=1]="Idle",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(qF||(qF={}));var rG;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(rG||(rG={}));var aG;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(aG||(aG={}));let xot=class{constructor(e,t){this.text=e,this.alignment=t}};var Ase;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred"})(Ase||(Ase={}));var cG;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred",n[n.Hidden=-1]="Hidden"})(cG||(cG={}));let wOe=class{constructor(e,t=[]){this.uri=e,this.provides=Kb(t)}},Dot=class{constructor(e){this.label=e}};var lG;(function(n){n[n.Named=1]="Named",n[n.Indexed=2]="Indexed"})(lG||(lG={}));let Ese=class{constructor(e,t){this.label=e,this.timestamp=t}};Ese=D([Ri],Ese);var WM;(function(n){n[n.Production=1]="Production",n[n.Development=2]="Development",n[n.Test=3]="Test"})(WM||(WM={}));var dG;(function(n){n[n.Node=1]="Node",n[n.Webworker=2]="Webworker"})(dG||(dG={}));var UE;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UE||(UE={}));let kot=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},Iot=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var xse;(function(n){n[n.Queued=1]="Queued",n[n.Running=2]="Running",n[n.Passed=3]="Passed",n[n.Failed=4]="Failed",n[n.Skipped=5]="Skipped",n[n.Errored=6]="Errored"})(xse||(xse={}));var HM;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(HM||(HM={}));let hG=class{constructor(e=void 0,t=void 0,i=void 0,s=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=s,this.preserveFocus=o}};hG=D([Ri],hG);let b4=lke=class{static diff(e,t,i){const s=new lke(e);return s.expectedOutput=t,s.actualOutput=i,s}constructor(e){this.message=e}};b4=lke=D([Ri],b4);let C4=class{constructor(e){this.id=e}};C4=D([Ri],C4);class kX{constructor(e,t){this.covered=e,this.total=t,IX(this)}}function IX(n){if(n){if(n.covered>n.total)throw new Error(`The total number of covered items (${n.covered}) cannot be greater than the total (${n.total})`);if(n.total<0)throw new Error(`The number of covered items (${n.total}) cannot be negative`)}}let uG=class Lot{static fromDetails(e,t){const i=new kX(0,0),s=new kX(0,0),o=new kX(0,0);for(const a of t)if("branches"in a){i.total+=1,i.covered+=a.executed?1:0;for(const c of a.branches)s.total+=1,s.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new Lot(e,i,s.total>0?s:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,s,o){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=s,this.testItem=o}},Tot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i=[]){this.executed=e,this.location=t,this.branches=i}},Rot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.executed=e,this.location=t,this.label=i}};class Mot{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.name=e,this.executed=t,this.location=i}}var Dse;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(Dse||(Dse={}));var kse;(function(n){n[n.Untrusted=0]="Untrusted",n[n.Trusted=1]="Trusted",n[n.Unspecified=2]="Unspecified"})(kse||(kse={}));var Ise;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(Ise||(Ise={}));let qhe=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}};class Qhe{constructor(e){this.uri=e}}class gG{constructor(e,t){this.original=e,this.modified=t}}class bOe{constructor(e,t,i,s){this.base=e,this.input1=t,this.input2=i,this.result=s}}class jhe{constructor(e,t){this.uri=e,this.viewType=t}}class COe{constructor(e){this.viewType=e}}class Khe{constructor(e,t){this.uri=e,this.notebookType=t}}class Yhe{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class yOe{constructor(){}}class SOe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class AOe{constructor(){}}class Not{constructor(e){this.textDiffs=e}}var Lse;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(Lse||(Lse={}));var Tse;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Tse||(Tse={}));var Rse;(function(n){n[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Full=3]="Full"})(Rse||(Rse={}));let Pot=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var Mse;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful",n[n.Undone=2]="Undone",n[n.Accepted=3]="Accepted",n[n.Bug=4]="Bug"})(Mse||(Mse={}));var y4;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful"})(y4||(y4={}));let Jhe=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},fG=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e,this.vulnerabilities=t}},pG=class{constructor(e,t){this.participant=e,this.command=t}},vke=class{constructor(e,t,i){this.title=e,this.message=t,this.data=i}};class Xhe{constructor(e,t){this.value=e,this.baseUri=t}}let Zhe=class{constructor(e,t){this.value=e,this.title=t}},mG=class{constructor(e){this.value=e}};class Fot{constructor(e,t){this.value=e,this.task=t}}let _G=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},eue=class{constructor(e){this.value=e}},GI=class{constructor(e,t){this.value=e,this.iconPath=t}},vG=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}};class Oot{constructor(e,t,i,s){this.prompt=e,this.command=t,this.references=i,this.participant=s}}class Bot{constructor(e,t,i,s){this.response=e,this.result=t,this.participant=i,this.command=s}}var cb;(function(n){n[n.Panel=1]="Panel",n[n.Terminal=2]="Terminal",n[n.Notebook=3]="Notebook",n[n.Editor=4]="Editor"})(cb||(cb={}));var Iv;(function(n){n[n.User=1]="User",n[n.Assistant=2]="Assistant",n[n.System=3]="System"})(Iv||(Iv={}));let v8=class wke{static User(e,t){return new wke(Iv.User,e,t)}static Assistant(e,t){return new wke(Iv.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.name=i}};class I7t{constructor(e){this.content=e}}class L7t{constructor(e,t){this.content=e,this.name=t}}class T7t{constructor(e,t){this.content=e,this.name=t}}class qg extends Error{static NotFound(e){return new qg(e,qg.NotFound.name)}static NoPermissions(e){return new qg(e,qg.NoPermissions.name)}static Blocked(e){return new qg(e,qg.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}}var Nse;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Nse||(Nse={}));var Pse;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(Pse||(Pse={}));var bke;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(bke||(bke={}));var Fse;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped"})(Fse||(Fse={}));class R7t{constructor(e,t){this.text=e,this.range=t}}var wG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(wG||(wG={}));var b2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(b2||(b2={}));var Oa;(function(n){n[n.UnknownInput=0]="UnknownInput",n[n.TextInput=1]="TextInput",n[n.TextDiffInput=2]="TextDiffInput",n[n.TextMergeInput=3]="TextMergeInput",n[n.NotebookInput=4]="NotebookInput",n[n.NotebookDiffInput=5]="NotebookDiffInput",n[n.CustomEditorInput=6]="CustomEditorInput",n[n.WebviewEditorInput=7]="WebviewEditorInput",n[n.TerminalEditorInput=8]="TerminalEditorInput",n[n.InteractiveEditorInput=9]="InteractiveEditorInput",n[n.ChatEditorInput=10]="ChatEditorInput",n[n.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(Oa||(Oa={}));var gu;(function(n){n[n.TAB_OPEN=0]="TAB_OPEN",n[n.TAB_CLOSE=1]="TAB_CLOSE",n[n.TAB_UPDATE=2]="TAB_UPDATE",n[n.TAB_MOVE=3]="TAB_MOVE"})(gu||(gu={}));var ol;(function(n){n[n.Int8Array=1]="Int8Array",n[n.Uint8Array=2]="Uint8Array",n[n.Uint8ClampedArray=3]="Uint8ClampedArray",n[n.Int16Array=4]="Int16Array",n[n.Uint16Array=5]="Uint16Array",n[n.Int32Array=6]="Int32Array",n[n.Uint32Array=7]="Uint32Array",n[n.Float32Array=8]="Float32Array",n[n.Float64Array=9]="Float64Array",n[n.BigInt64Array=10]="BigInt64Array",n[n.BigUint64Array=11]="BigUint64Array"})(ol||(ol={}));var C2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(C2||(C2={}));var UM;(function(n){n[n.None=0]="None",n[n.Process=1]="Process",n[n.Output=2]="Output",n[n.Hybrid=3]="Hybrid"})(UM||(UM={}));var Oi;(function(n){n.label="a",n.kind="b",n.detail="c",n.documentation="d",n.sortText="e",n.filterText="f",n.preselect="g",n.insertText="h",n.insertTextRules="i",n.range="j",n.commitCharacters="k",n.additionalTextEdits="l",n.kindModifier="m",n.commandIdent="n",n.commandId="o",n.commandArguments="p"})(Oi||(Oi={}));var aS;(function(n){n.defaultRanges="a",n.completions="b",n.isIncomplete="c",n.duration="d"})(aS||(aS={}));const Ue={MainThreadAuthentication:Xe("MainThreadAuthentication"),MainThreadBulkEdits:Xe("MainThreadBulkEdits"),MainThreadLanguageModels:Xe("MainThreadLanguageModels"),MainThreadEmbeddings:Xe("MainThreadEmbeddings"),MainThreadChatAgents2:Xe("MainThreadChatAgents2"),MainThreadChatVariables:Xe("MainThreadChatVariables"),MainThreadClipboard:Xe("MainThreadClipboard"),MainThreadCommands:Xe("MainThreadCommands"),MainThreadComments:Xe("MainThreadComments"),MainThreadConfiguration:Xe("MainThreadConfiguration"),MainThreadConsole:Xe("MainThreadConsole"),MainThreadDebugService:Xe("MainThreadDebugService"),MainThreadDecorations:Xe("MainThreadDecorations"),MainThreadDiagnostics:Xe("MainThreadDiagnostics"),MainThreadDialogs:Xe("MainThreadDiaglogs"),MainThreadDocuments:Xe("MainThreadDocuments"),MainThreadDocumentContentProviders:Xe("MainThreadDocumentContentProviders"),MainThreadTextEditors:Xe("MainThreadTextEditors"),MainThreadEditorInsets:Xe("MainThreadEditorInsets"),MainThreadEditorTabs:Xe("MainThreadEditorTabs"),MainThreadErrors:Xe("MainThreadErrors"),MainThreadTreeViews:Xe("MainThreadTreeViews"),MainThreadDownloadService:Xe("MainThreadDownloadService"),MainThreadLanguageFeatures:Xe("MainThreadLanguageFeatures"),MainThreadLanguages:Xe("MainThreadLanguages"),MainThreadLogger:Xe("MainThreadLogger"),MainThreadMessageService:Xe("MainThreadMessageService"),MainThreadOutputService:Xe("MainThreadOutputService"),MainThreadProgress:Xe("MainThreadProgress"),MainThreadQuickDiff:Xe("MainThreadQuickDiff"),MainThreadQuickOpen:Xe("MainThreadQuickOpen"),MainThreadStatusBar:Xe("MainThreadStatusBar"),MainThreadSecretState:Xe("MainThreadSecretState"),MainThreadStorage:Xe("MainThreadStorage"),MainThreadSpeech:Xe("MainThreadSpeechProvider"),MainThreadTelemetry:Xe("MainThreadTelemetry"),MainThreadTerminalService:Xe("MainThreadTerminalService"),MainThreadTerminalShellIntegration:Xe("MainThreadTerminalShellIntegration"),MainThreadWebviews:Xe("MainThreadWebviews"),MainThreadWebviewPanels:Xe("MainThreadWebviewPanels"),MainThreadWebviewViews:Xe("MainThreadWebviewViews"),MainThreadCustomEditors:Xe("MainThreadCustomEditors"),MainThreadUrls:Xe("MainThreadUrls"),MainThreadUriOpeners:Xe("MainThreadUriOpeners"),MainThreadProfileContentHandlers:Xe("MainThreadProfileContentHandlers"),MainThreadWorkspace:Xe("MainThreadWorkspace"),MainThreadFileSystem:Xe("MainThreadFileSystem"),MainThreadFileSystemEventService:Xe("MainThreadFileSystemEventService"),MainThreadExtensionService:Xe("MainThreadExtensionService"),MainThreadSCM:Xe("MainThreadSCM"),MainThreadSearch:Xe("MainThreadSearch"),MainThreadShare:Xe("MainThreadShare"),MainThreadTask:Xe("MainThreadTask"),MainThreadWindow:Xe("MainThreadWindow"),MainThreadLabelService:Xe("MainThreadLabelService"),MainThreadNotebook:Xe("MainThreadNotebook"),MainThreadNotebookDocuments:Xe("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:Xe("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:Xe("MainThreadNotebookKernels"),MainThreadNotebookRenderers:Xe("MainThreadNotebookRenderers"),MainThreadInteractive:Xe("MainThreadInteractive"),MainThreadTheming:Xe("MainThreadTheming"),MainThreadTunnelService:Xe("MainThreadTunnelService"),MainThreadManagedSockets:Xe("MainThreadManagedSockets"),MainThreadTimeline:Xe("MainThreadTimeline"),MainThreadTesting:Xe("MainThreadTesting"),MainThreadLocalization:Xe("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:Xe("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:Xe("MainThreadAiEmbeddingVector")},et={ExtHostCommands:Xe("ExtHostCommands"),ExtHostConfiguration:Xe("ExtHostConfiguration"),ExtHostDiagnostics:Xe("ExtHostDiagnostics"),ExtHostDebugService:Xe("ExtHostDebugService"),ExtHostDecorations:Xe("ExtHostDecorations"),ExtHostDocumentsAndEditors:Xe("ExtHostDocumentsAndEditors"),ExtHostDocuments:Xe("ExtHostDocuments"),ExtHostDocumentContentProviders:Xe("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:Xe("ExtHostDocumentSaveParticipant"),ExtHostEditors:Xe("ExtHostEditors"),ExtHostTreeViews:Xe("ExtHostTreeViews"),ExtHostFileSystem:Xe("ExtHostFileSystem"),ExtHostFileSystemInfo:Xe("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:Xe("ExtHostFileSystemEventService"),ExtHostLanguages:Xe("ExtHostLanguages"),ExtHostLanguageFeatures:Xe("ExtHostLanguageFeatures"),ExtHostQuickOpen:Xe("ExtHostQuickOpen"),ExtHostQuickDiff:Xe("ExtHostQuickDiff"),ExtHostStatusBar:Xe("ExtHostStatusBar"),ExtHostShare:Xe("ExtHostShare"),ExtHostExtensionService:Xe("ExtHostExtensionService"),ExtHostLogLevelServiceShape:Xe("ExtHostLogLevelServiceShape"),ExtHostTerminalService:Xe("ExtHostTerminalService"),ExtHostTerminalShellIntegration:Xe("ExtHostTerminalShellIntegration"),ExtHostSCM:Xe("ExtHostSCM"),ExtHostSearch:Xe("ExtHostSearch"),ExtHostTask:Xe("ExtHostTask"),ExtHostWorkspace:Xe("ExtHostWorkspace"),ExtHostWindow:Xe("ExtHostWindow"),ExtHostWebviews:Xe("ExtHostWebviews"),ExtHostWebviewPanels:Xe("ExtHostWebviewPanels"),ExtHostCustomEditors:Xe("ExtHostCustomEditors"),ExtHostWebviewViews:Xe("ExtHostWebviewViews"),ExtHostEditorInsets:Xe("ExtHostEditorInsets"),ExtHostEditorTabs:Xe("ExtHostEditorTabs"),ExtHostProgress:Xe("ExtHostProgress"),ExtHostComments:Xe("ExtHostComments"),ExtHostSecretState:Xe("ExtHostSecretState"),ExtHostStorage:Xe("ExtHostStorage"),ExtHostUrls:Xe("ExtHostUrls"),ExtHostUriOpeners:Xe("ExtHostUriOpeners"),ExtHostProfileContentHandlers:Xe("ExtHostProfileContentHandlers"),ExtHostOutputService:Xe("ExtHostOutputService"),ExtHostLabelService:Xe("ExtHostLabelService"),ExtHostNotebook:Xe("ExtHostNotebook"),ExtHostNotebookDocuments:Xe("ExtHostNotebookDocuments"),ExtHostNotebookEditors:Xe("ExtHostNotebookEditors"),ExtHostNotebookKernels:Xe("ExtHostNotebookKernels"),ExtHostNotebookRenderers:Xe("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:Xe("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:Xe("ExtHostInteractive"),ExtHostChatAgents2:Xe("ExtHostChatAgents"),ExtHostChatVariables:Xe("ExtHostChatVariables"),ExtHostChatProvider:Xe("ExtHostChatProvider"),ExtHostSpeech:Xe("ExtHostSpeech"),ExtHostEmbeddings:Xe("ExtHostEmbeddings"),ExtHostAiRelatedInformation:Xe("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:Xe("ExtHostAiEmbeddingVector"),ExtHostTheming:Xe("ExtHostTheming"),ExtHostTunnelService:Xe("ExtHostTunnelService"),ExtHostManagedSockets:Xe("ExtHostManagedSockets"),ExtHostAuthentication:Xe("ExtHostAuthentication"),ExtHostTimeline:Xe("ExtHostTimeline"),ExtHostTesting:Xe("ExtHostTesting"),ExtHostTelemetry:Xe("ExtHostTelemetry"),ExtHostLocalization:Xe("ExtHostLocalization")};var Ose;(function(n){n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None"})(Ose||(Ose={}));let Cke;function Wot(n){Cke=n}function tu(n){return new Proxy({},{get(e,t){if(Cke==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return Cke[n][t]}})}const M7t={version:"1.90.2",tasks:tu("tasks"),notebooks:tu("notebooks"),scm:tu("scm"),comments:tu("comments"),authentication:tu("authentication"),tests:tu("tests"),extensions:tu("extensions"),debug:tu("debug"),env:tu("env"),commands:tu("commands"),window:tu("window"),workspace:tu("workspace"),languages:tu("languages"),l10n:tu("l10n"),interactive:tu("interactive"),ai:tu("ai"),chat:tu("chat"),speech:tu("speech"),Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:fOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:pOe,CancellationError:Rc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ja,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CompletionItem:H6,CompletionItemKind:nn,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:wm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,IndentAction:qa,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:mOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentDropEdit:_se,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:_Oe,NotebookRendererScript:wOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:vOe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestMessage2:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,FileCoverage:uG,StatementCoverage:Tot,BranchCoverage:Rot,FunctionCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:bOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:COe,TabInputTerminal:yOe,TabInputInteractiveWindow:SOe,TabInputChat:AOe,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,RelatedInformationType:Nse,SpeechToTextStatus:Pse,KeywordRecognitionStatus:Fse},{version:N7t,tasks:P7t,notebooks:F7t,scm:O7t,comments:B7t,authentication:W7t,tests:H7t,extensions:U7t,debug:V7t,env:z7t,commands:$7t,window:G7t,workspace:q7t,languages:Q7t,l10n:j7t,interactive:K7t,ai:Y7t,chat:J7t,speech:X7t,Breakpoint:Z7t,TerminalOutputAnchor:e6t,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,ChatCompletionItem:n6t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentHighlight:V6t,DocumentHighlightKind:z6t,MultiDocumentHighlight:$6t,DocumentLink:G6t,DocumentSymbol:q6t,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InlineValueEvaluatableExpression:X6t,InlineCompletionTriggerKind:Z6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileDecoration:oGt,FileDecoration2:rGt,FileSystemError:aGt,FileType:cGt,FilePermission:lGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,InlineCompletionItem:gGt,InlineCompletionList:fGt,Hover:pGt,IndentAction:mGt,Location:_Gt,MarkdownString:vGt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,Range:xGt,RelativePattern:DGt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SourceBreakpoint:UGt,StandardTokenType:VGt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TerminalLink:XGt,TerminalQuickFixTerminalCommand:ZGt,TerminalQuickFixOpener:eqt,TerminalLocation:tqt,TerminalProfile:iqt,TerminalExitReason:nqt,TextDocumentSaveReason:sqt,TextEdit:oqt,SnippetTextEdit:rqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,SyntaxTokenType:hqt,TextDocumentChangeReason:uqt,ThemeColor:gqt,ThemeIcon:fqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,DocumentDropEdit:Sqt,DocumentPasteEdit:Aqt,InlayHint:Eqt,InlayHintLabelPart:xqt,InlayHintKind:Dqt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,ManagedResolvedAuthority:Lqt,SourceControlInputBoxValidationType:Tqt,ExtensionRuntime:Rqt,TimelineItem:Mqt,NotebookRange:Nqt,NotebookCellKind:Pqt,NotebookCellExecutionState:Fqt,NotebookCellData:Oqt,NotebookData:Bqt,NotebookRendererScript:Wqt,NotebookCellStatusBarAlignment:Hqt,NotebookEditorRevealType:Uqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookEdit:Qqt,NotebookKernelSourceAction:jqt,PortAttributes:Kqt,LinkedEditingRanges:Yqt,TestResultState:Jqt,TestRunRequest:Xqt,TestMessage:Zqt,TestMessage2:eQt,TestTag:tQt,TestRunProfileKind:iQt,TextSearchCompleteMessageType:nQt,DataTransfer:sQt,DataTransferItem:oQt,FileCoverage:rQt,StatementCoverage:aQt,BranchCoverage:cQt,FunctionCoverage:lQt,WorkspaceTrustState:dQt,LanguageStatusSeverity:hQt,QuickPickItemKind:uQt,InputBoxValidationSeverity:gQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputCustom:_Qt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputWebview:bQt,TabInputTerminal:CQt,TabInputInteractiveWindow:yQt,TabInputChat:SQt,TelemetryTrustedValue:AQt,LogLevel:EQt,EditSessionIdentityMatch:xQt,InteractiveSessionVoteDirection:DQt,ChatCopyKind:kQt,InteractiveEditorResponseFeedbackKind:IQt,RelatedInformationType:LQt,SpeechToTextStatus:TQt,KeywordRecognitionStatus:RQt}=M7t,MQt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:cQt,Breakpoint:Z7t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,ChatCompletionItem:n6t,ChatCopyKind:kQt,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DataTransfer:sQt,DataTransferItem:oQt,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentDropEdit:Sqt,DocumentHighlight:V6t,DocumentHighlightKind:z6t,DocumentLink:G6t,DocumentPasteEdit:Aqt,DocumentSymbol:q6t,EditSessionIdentityMatch:xQt,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExtensionRuntime:Rqt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileCoverage:rQt,FileDecoration:oGt,FileDecoration2:rGt,FilePermission:lGt,FileSystemError:aGt,FileType:cGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,FunctionCoverage:lQt,Hover:pGt,IndentAction:mGt,InlayHint:Eqt,InlayHintKind:Dqt,InlayHintLabelPart:xqt,InlineCompletionItem:gGt,InlineCompletionList:fGt,InlineCompletionTriggerKind:Z6t,InlineValueEvaluatableExpression:X6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InputBoxValidationSeverity:gQt,InteractiveEditorResponseFeedbackKind:IQt,InteractiveSessionVoteDirection:DQt,KeywordRecognitionStatus:RQt,LanguageStatusSeverity:hQt,LinkedEditingRanges:Yqt,Location:_Gt,LogLevel:EQt,ManagedResolvedAuthority:Lqt,MarkdownString:vGt,MultiDocumentHighlight:$6t,NotebookCellData:Oqt,NotebookCellExecutionState:Fqt,NotebookCellKind:Pqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarAlignment:Hqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookData:Bqt,NotebookEdit:Qqt,NotebookEditorRevealType:Uqt,NotebookKernelSourceAction:jqt,NotebookRange:Nqt,NotebookRendererScript:Wqt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAttributes:Kqt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,QuickPickItemKind:uQt,Range:xGt,RelatedInformationType:LQt,RelativePattern:DGt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SnippetTextEdit:rqt,SourceBreakpoint:UGt,SourceControlInputBoxValidationType:Tqt,SpeechToTextStatus:TQt,StandardTokenType:VGt,StatementCoverage:aQt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,SyntaxTokenType:hqt,TabInputChat:SQt,TabInputCustom:_Qt,TabInputInteractiveWindow:yQt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputTerminal:CQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputWebview:bQt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TelemetryTrustedValue:AQt,TerminalExitReason:nqt,TerminalLink:XGt,TerminalLocation:tqt,TerminalOutputAnchor:e6t,TerminalProfile:iqt,TerminalQuickFixOpener:eqt,TerminalQuickFixTerminalCommand:ZGt,TestMessage:Zqt,TestMessage2:eQt,TestResultState:Jqt,TestRunProfileKind:iQt,TestRunRequest:Xqt,TestTag:tQt,TextDocumentChangeReason:uqt,TextDocumentSaveReason:sqt,TextEdit:oqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,TextSearchCompleteMessageType:nQt,ThemeColor:gqt,ThemeIcon:fqt,TimelineItem:Mqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,WorkspaceTrustState:dQt,ai:Y7t,authentication:W7t,chat:J7t,commands:$7t,comments:B7t,debug:V7t,env:z7t,extensions:U7t,interactive:K7t,l10n:j7t,languages:Q7t,notebooks:F7t,scm:O7t,setDefaultApi:Wot,speech:X7t,tasks:P7t,tests:H7t,version:N7t,window:G7t,workspace:q7t},Symbol.toStringTag,{value:"Module"}));bMt(async({toAdd:n,toRemove:e})=>{await znt(),await Lt.get(ho).deltaExtensions(n,e)},(n,e)=>({toAdd:[...n.toAdd,...e.toAdd],toRemove:[...n.toRemove,...e.toRemove]}),0);const NQt=new Map;function PQt(n){return NQt.get(n)}let _$e=class extends ${constructor(e,t,i){super(),this.fileService=t,this.languagePackService=i}async $fetchBuiltInBundleUri(e,t){try{return await this.languagePackService.getBuiltInExtensionTranslationsUri(e,t)}catch{return}}async $fetchBundleContents(e){return(await this.fileService.readFile(P.revive(e))).value.toString()}};_$e=D([en(Ue.MainThreadLocalization),_(1,ci),_(2,LZe)],_$e);class tj{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var z3;const FQt="vs/workbench/contrib/notebook/common/notebookEditorInput";var TP;let VM=(TP=class extends _ne{static getOrCreate(e,t,i,s,o={}){const r=e.createInstance(z3,t,i,s,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=s,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this._editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!s.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(bt)}),this._register(h.onWillStop(m=>{this.isDirty()&&m.veto((async()=>{const v=u.findEditors(this);return!(v.length>0&&(await u.save(v[0])).success)})(),g(FQt,0,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,super.dispose()}get typeId(){return z3.ID}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),this._editorModelReference?this._editorModelReference.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}getDescription(e=Gs.MEDIUM){if(!this.hasCapability(Mi.Untitled)||this._editorModelReference?.object.hasAssociatedFilePath())return super.getDescription(e)}isReadonly(){return this._editorModelReference?this._editorModelReference.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._editorModelReference?this._editorModelReference.object.isDirty():this._defaultDirtyState}isSaving(){const e=this._editorModelReference?.object;return!e||!e.isDirty()||e.hasErrorState||this.hasCapability(Mi.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.object.save(t),this)}async saveAs(e,t){if(!this._editorModelReference)return;const i=this._notebookService.getContributedNotebookType(this.viewType);if(!i)return;const s=this.hasCapability(Mi.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this._editorModelReference.object.resource;let o;if(this._editorModelReference.object.hasAssociatedFilePath())o=s;else if(o=await this._fileDialogService.pickFileToSave(s,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:NYe(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${o} is not supported by ${i.providerDisplayName}. +Up: ${QQ._printSpeed(e.up)} +Down: ${QQ._printSpeed(e.down)} +`:""}static _printSpeed(e){return e<=1024?`${e} bps`:e<1024*1024?`${(e/1024).toFixed(1)} kbps`:`${(e/1024/1024).toFixed(1)} Mbps`}});class vee{constructor(e){this.affinity=e,this.kind=lo.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class gAe{constructor(e){this.affinity=e,this.kind=lo.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class bee{constructor(){this.kind=lo.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let fAe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,n,o,r){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=n,this._logService=o,this._extensionManifestPropertiesService=r,this._runningLocation=new va,this._maxLocalProcessAffinity=0,this._maxLocalWebWorkerAffinity=0}set(e,t){this._runningLocation.set(e,t)}readExtensionKinds(e){return e.isUnderDevelopment&&this._environmentService.extensionDevelopmentKind?this._environmentService.extensionDevelopmentKind:this._extensionManifestPropertiesService.getExtensionKind(e)}getRunningLocation(e){return this._runningLocation.get(e)||null}filterByRunningLocation(e,t){return jQ(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return jQ(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return jQ(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const n=new va;for(const h of e)(h.main||h.browser)&&n.set(h.identifier,h);for(const h of this._registry.getAllExtensionDescriptions())if(h.main||h.browser){const u=this._runningLocation.get(h.identifier);u&&u.kind===t&&n.set(h.identifier,h)}const o=new va;let r=0;for(const[h,u]of n)o.set(u.identifier,++r);const a=(h,u)=>{for(const[f,p]of o)p===h&&o.set(f,u)};for(const[h,u]of n){if(!u.extensionDependencies)continue;const f=o.get(u.identifier);for(const p of u.extensionDependencies){const m=o.get(p);m&&m!==f&&a(m,f)}}const c=new Map;let l=0;for(const[h,u]of n){const f=this._runningLocation.get(u.identifier);if(f){const p=o.get(u.identifier);c.set(p,f.affinity),l=Math.max(l,f.affinity)}}if(!this._environmentService.isExtensionDevelopment){const h=this._configurationService.getValue("extensions.experimental.affinity")||{},u=Object.keys(h),f=new Map;for(const p of u){const m=h[p];if(typeof m!="number"||m<=0||Math.floor(m)!==m){this._logService.info(`Ignoring configured affinity for '${p}' because the value is not a positive integer.`);continue}const v=o.get(p);if(!v)continue;const b=c.get(v);if(b){f.set(m,b);continue}const w=f.get(m);if(w){c.set(v,w);continue}if(!i){this._logService.info(`Ignoring configured affinity for '${p}' because extension host(s) are already running. Reload window.`);continue}const y=++l;f.set(m,y),c.set(v,y)}}const d=new va;for(const h of e){const u=o.get(h.identifier)||0,f=c.get(u)||0;d.set(h.identifier,f)}if(l>0&&i)for(let h=1;h<=l;h++){const u=[];for(const f of e)d.get(f.identifier)===h&&u.push(f.identifier);this._logService.info(`Placing extension(s) ${u.map(f=>f.value).join(", ")} on a separate extension host.`)}return{affinities:d,maxAffinity:l}}computeRunningLocation(e,t,i){return this._doComputeRunningLocation(this._runningLocation,e,t,i).runningLocation}_doComputeRunningLocation(e,t,i,n){t=t.filter(p=>!e.has(p.identifier)),i=i.filter(p=>!e.has(p.identifier));const o=z8t(t,i,p=>this.readExtensionKinds(p),(p,m,v,b,w)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,b,w)),r=new va;for(const p of t)r.set(p.identifier,p);for(const p of i)r.set(p.identifier,p);const a=new va,c=[],l=[];for(const[p,m]of o){let v=null;if(m===lo.LocalProcess){const b=r.get(p);b&&c.push(b)}else if(m===lo.LocalWebWorker){const b=r.get(p);b&&l.push(b)}else m===lo.Remote&&(v=new bee);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,lo.LocalProcess,n);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new vee(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,lo.LocalWebWorker,n);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new gAe(m))}for(const[p,m]of e)m&&a.set(p,m);return{runningLocation:a,maxLocalProcessAffinity:h,maxLocalWebWorkerAffinity:f}}initializeRunningLocation(e,t){const{runningLocation:i,maxLocalProcessAffinity:n,maxLocalWebWorkerAffinity:o}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=n,this._maxLocalWebWorkerAffinity=o}deltaExtensions(e,t){const i=new va;for(const n of t){const o=n;i.set(o,this._runningLocation.get(o)||null),this._runningLocation.delete(o)}return this._updateRunningLocationForAddedExtensions(e),i}_updateRunningLocationForAddedExtensions(e){const t=[],i=[];for(const r of e){const a=this.readExtensionKinds(r),c=r.extensionLocation.scheme===pe.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(r.identifier,a,!c,c,Qg.None);let d=null;l===lo.LocalProcess?t.push(r):l===lo.LocalWebWorker?i.push(r):l===lo.Remote&&(d=new bee),this._runningLocation.set(r.identifier,d)}const{affinities:n}=this._computeAffinity(t,lo.LocalProcess,!1);for(const r of t){const a=n.get(r.identifier)||0;this._runningLocation.set(r.identifier,new vee(a))}const{affinities:o}=this._computeAffinity(i,lo.LocalWebWorker,!1);for(const r of i){const a=o.get(r.identifier)||0;this._runningLocation.set(r.identifier,new gAe(a))}}};fAe=D([_(2,Jr),_(3,Te),_(4,Ge),_(5,Im)],fAe);function jQ(s,e,t){return s.filter(i=>{const n=e.get(i.identifier);return n&&t(n)})}function s3t(s,e,t){return s.filter(i=>{const n=e.get(i);return n&&t(n)})}let pAe=class extends V{get pid(){return this._actual?this._actual.pid:null}get kind(){return this._extensionHost.runningLocation.kind}get startup(){return this._extensionHost.startup}get friendyName(){return Rit(this.kind,this.pid)}constructor(e,t,i,n){super(),this._internalExtensionService=t,this._instantiationService=i,this._logService=n,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._extensionHost=e,this.onDidExit=e.onExit,this._startCalled=new qd,this._actual=null,this._lazyStartExtensions=null}_createActual(e){return this._logService.info(`Creating lazy extension host (${this.friendyName}). Reason: ${e}`),this._actual=this._register(this._instantiationService.createInstance(mee,this._extensionHost,[],this._internalExtensionService)),this._register(this._actual.onDidChangeResponsiveState(t=>this._onDidChangeResponsiveState.fire(t))),this._actual}async _getOrCreateActualAndStart(e){if(this._actual)return this._actual;const t=this._createActual(e);return await t.start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions),t}async ready(){await this._startCalled.wait(),this._actual&&await this._actual.ready()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){if(await this._startCalled.wait(),this._actual)return this._actual.deltaExtensions(e);if(this._lazyStartExtensions.delta(e),e.myToAdd.length>0){await this._createActual(`contains ${e.myToAdd.length} new extension(s) (installed or enabled): ${e.myToAdd.map(i=>i.value)}`).start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions);return}}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async activate(e,t){return await this._startCalled.wait(),this._actual?this._actual.activate(e,t):!1}async activateByEvent(e,t){if(t===Nb.Immediate)return this._actual?this._actual.activateByEvent(e,t):void 0;if(await this._startCalled.wait(),this._actual)return this._actual.activateByEvent(e,t)}activationEventIsDone(e){return this._startCalled.isOpen()?this._actual?this._actual.activationEventIsDone(e):!0:!1}async getInspectPort(e){return await this._startCalled.wait(),this._actual?.getInspectPort(e)}async resolveAuthority(e,t){return await this._startCalled.wait(),this._actual?this._actual.resolveAuthority(e,t):{type:"error",error:{message:"Cannot resolve authority",code:ed.Unknown,detail:void 0}}}async getCanonicalURI(e,t){if(await this._startCalled.wait(),this._actual)return this._actual.getCanonicalURI(e,t);throw new Error("Cannot resolve canonical URI")}async start(e,t,i){if(i.length>0){const o=this._createActual(`contains ${i.length} extension(s): ${i.map(r=>r.value)}.`).start(e,t,i);return this._startCalled.open(),o}this._lazyStartExtensions=new Jq(e,t,i),this._startCalled.open()}async extensionTestsExecute(){return await this._startCalled.wait(),(await this._getOrCreateActualAndStart("execute tests.")).extensionTestsExecute()}async setRemoteEnvironment(e){if(await this._startCalled.wait(),this._actual)return this._actual.setRemoteEnvironment(e)}};pAe=D([_(2,we),_(3,Ge)],pAe);var wee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(wee||(wee={}));let BNe=class{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}},WNe=class{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}};var Rw;(function(s){s[s.none=1]="none",s[s.filesExclude=2]="filesExclude",s[s.searchAndFilesExclude=3]="searchAndFilesExclude"})(Rw||(Rw={}));var yee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(yee||(yee={}));function o3t(s){return"uri"in s&&"ranges"in s&&"preview"in s}function r3t(s){if(o3t(s)){const e=H_(s.ranges).map(t=>({sourceRange:t,previewRange:t}));return new BNe(s.uri,e,s.preview.text)}else return new WNe(s.uri,s.text,s.lineNumber)}const a3t=2e4,Mit="⟪ ",Nit=" characters skipped ⟫",c3t=(Mit.length+Nit.length+5)*2;var Z5;(function(s){s[s.file=0]="file",s[s.text=1]="text",s[s.aiText=2]="aiText"})(Z5||(Z5={}));var cI;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.aiText=3]="aiText"})(cI||(cI={}));function l3t(s){return!!s.preview}var x5e;(function(s){s[s.Normal=0]="Normal",s[s.NewSearchStarted=1]="NewSearchStarted"})(x5e||(x5e={}));class d3t{constructor(e,t,i,n){this.ranges=t,this.webviewIndex=n;const o=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&h3t(o)){e=vat(e,i.matchLines);let r="",a=0,c=0;const l=Math.floor(i.charsPerLine/5),d=[];for(const h of o){const u=Math.max(h.startColumn-l,0),f=h.startColumn+i.charsPerLine;if(u>c+l+c3t){const p=Mit+(u-c)+Nit;r+=p+e.slice(u,f),a+=u-(c+p.length)}else r+=e.slice(c,f);d.push(new u3t(0,h.startColumn-a,h.endColumn-a)),c=f}this.preview={text:r,matches:Array.isArray(this.ranges)?d:d[0]}}else{const r=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber;this.preview={text:e,matches:n8(t,a=>new Pit(a.startLineNumber-r,a.startColumn,a.endLineNumber-r,a.endColumn))}}}}function h3t(s){const e=s[0].startLineNumber;for(const t of s)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class Pit{constructor(e,t,i,n){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n}}class u3t extends Pit{constructor(e,t,i){super(e,t,e,i)}}var D5e;(function(s){s.List="list",s.Tree="tree"})(D5e||(D5e={}));var k5e;(function(s){s.Default="default",s.FileNames="fileNames",s.Type="type",s.Modified="modified",s.CountDescending="countDescending",s.CountAscending="countAscending"})(k5e||(k5e={}));function g3t(s,e=!0){const t=s&&s.files&&s.files.exclude,i=e&&s&&s.search&&s.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i||void 0;let n=Object.create(null);return n=gp(n,xs(t)),n=gp(n,xs(i),!0),n}function I5e(s,e){return s.excludePattern&&zO(s.excludePattern,e)?!1:s.includePattern||s.usingSearchPaths?s.includePattern&&zO(s.includePattern,e)?!0:s.usingSearchPaths?!!s.folderQueries&&s.folderQueries.some(t=>{const i=t.folder.fsPath;if(Wj(e,i)){const n=k2(i,e);return!t.includePattern||!!zO(t.includePattern,n)}else return!1}):!1:!0}var T5e;(function(s){s[s.unknownEncoding=1]="unknownEncoding",s[s.regexParseError=2]="regexParseError",s[s.globParseError=3]="globParseError",s[s.invalidLiteral=4]="invalidLiteral",s[s.rgProcessError=5]="rgProcessError",s[s.other=6]="other",s[s.canceled=7]="canceled"})(T5e||(T5e={}));function Cee(s,e){const t={...s||{},...e||{}};return Object.keys(t).filter(i=>{const n=t[i];return typeof n=="boolean"&&n})}class Fit{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=j_(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=j_(i))}matchesExcludesSync(e,t,i){return!!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i))}includedInQuerySync(e,t,i){return!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,i))}includedInQuery(e,t,i){const n=this._parsedExcludeExpression(e,t,i),o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Qy(n)?n.then(r=>r?!1:o()):o()}hasSiblingExcludeClauses(){return f3t(this._excludeExpression)}}function f3t(s){for(const e in s)if(typeof s[e]!="boolean")return!0;return!1}function p3t(s){if(!s)return;let e;return t=>(e||(e=(s()||Promise.resolve([])).then(i=>i?Oit(i):{})),e.then(i=>!!i[t]))}function m3t(s){if(!s)return;let e;return t=>{if(!e){const i=s();e=i?Oit(i):{}}return!!e[t]}}function Oit(s){const e={};for(const t of s)e[t]=!0;return e}let See=class{constructor(e,t,i,n,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=n,this.pathService=o}text(e,t,i={}){e=this.getContentPattern(e,i);const n=this.configurationService.getValue(),o=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(KY),i),type:cI.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:n.search.usePCRE2||o||!1,beforeContext:i.beforeContext,afterContext:i.afterContext,userDisabledExcludesAndIgnoreFiles:i.disregardExcludeSettings&&i.disregardIgnoreFiles}}getContentPattern(e,t){const i=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,"\\n"));const n={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(n.isCaseSensitive=!0),this.isMultiline(e)&&(n.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),n}file(e,t={}){return{...this.commonQuery(e,t),type:cI.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){return e?(e=Array.isArray(e)?e.map(YQ):YQ(e),t?this.parseSearchPaths(e):{pattern:Sue(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),n=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),o=e.length>1,r=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,n)):e.map(l=>this.getFolderQueryForRoot(l,t,n,o))).filter(l=>!!l),a={_reason:t._reason,folderQueries:r,usingSearchPaths:!!(i.searchPaths&&i.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:n.pattern,includePattern:i.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults};if(t.onlyOpenEditors){const l=Fi(this.editorGroupsService.groups.flatMap(u=>u.editors.map(f=>f.resource)));this.logService.trace("QueryBuilder#commonQuery - openEditor URIs",JSON.stringify(l));const d=l.filter(u=>I5e(a,u.fsPath)),h=this.commonQueryFromFileList(d);return this.logService.trace("QueryBuilder#commonQuery - openEditor Query",JSON.stringify(h)),{...a,...h}}const c=t.extraFileResources&&t.extraFileResources.filter(l=>I5e(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new ui,n={};let o=!1;return e.forEach(r=>{if(r.scheme===pe.walkThrough)return;if(DGe(r)){const c=this.workspaceContextService.getWorkspaceFolder(r)?.uri??r.with({path:Cb(r.fsPath)});let l=i.get(c);l||(o=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=k2(c.fsPath,r.fsPath);qn(l.includePattern)[d.replace(/\\/g,"/")]=!0}else r.fsPath&&(o=!0,n[r.fsPath]=!0)}),{folderQueries:t,includePattern:n,usingSearchPaths:!0,excludePattern:o?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(tfe(e.pattern,!0))return!0}else if(tfe(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&RKe(e.pattern)||e.pattern.indexOf(` +`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>pM(h)||/^\.\.?([\/\\]|$)/.test(h),n=(Array.isArray(e)?e:v3t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?MMt(h,u.scheme===pe.file?u.fsPath:u.path):h}),o=P6e(n,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>zy(h,"/")).map(h=>zy(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),b3t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=Sue(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:g3t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(n=>{let{pathPortion:o,globPortion:r}=_3t(n);return r&&(r=Aue(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(n=>{const o=n.searchPath.toString(),r=i.get(o);r?n.pattern&&(r.pattern=r.pattern||{},r.pattern[n.pattern]=!0):i.set(o,{searchPath:n.searchPath,pattern:n.pattern?Sue(n.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(pM(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==pe.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:N.file(Rk(e))}]}if(this.workspaceContextService.getWorkbenchState()===qi.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=YQ(e),e.startsWith("../")||e===".."){const n=Vi.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}const i=Aue(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),n=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Rh(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(Fc);if(n.length)return n.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&Aue(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(4397,"Workspace folder does not exist: {0}",r);throw new Error(a)}}}}resolveOneSearchPathPattern(e,t){const i=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,n=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&n.push({searchPath:e.searchPath,pattern:i+"/**"}),n}getFolderQueryForSearchPath(e,t,i){const n=this.getFolderQueryForRoot(KY(e.searchPath),t,i,!1);return n?{...n,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,n){let o;const r=N.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>ji(u.searchPath,r))[0];if(h&&!h.pattern)return null;h&&(o=h.pattern)}const a=this.configurationService.getValue({resource:r}),l={...this.getExcludesForFolder(a,t)||{},...o||{}},d=N.isUri(e)?_i(e):e.name;return{folder:r,folderName:n?d:void 0,excludePattern:Object.keys(l).length>0?l:void 0,fileEncoding:a.files&&a.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles=="boolean"?t.disregardIgnoreFiles:!a.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles=="boolean"?t.disregardGlobalIgnoreFiles:!a.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles=="boolean"?t.disregardParentIgnoreFiles:!a.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks=="boolean"?t.ignoreSymlinks:!a.search?.followSymlinks}}};See=D([_(0,Te),_(1,yi),_(2,Po),_(3,Ge),_(4,bf)],See);function _3t(s){const e=s.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=s.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let n=s.substr(0,i.index);return n.match(/[/\\]/)||(n+="/"),{pathPortion:n,globPortion:s.substr((i.index||0)+1)}}}return{pathPortion:s}}function Sue(...s){return s.length?s.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function v3t(s){return Pme(s,",").map(e=>e.trim()).filter(e=>!!e.length)}function b3t(s){return[`**/${s}/**`,`**/${s}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function YQ(s){return s.replace(/\\/g,"/")}function Aue(s){return YQ(s).replace(/^\.\//,"").replace(/\/+$/g,"")}const w3t=7e3;function Bit(s,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],n=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||s.forceUsingSearch?n.push(h):i.push(h)}if(i.length===0&&n.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=M2(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>y3t(s,d,a))).then(()=>{}),l=C3t(s,e.identifier,n,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function y3t(s,e,t){for(const i of s.folders)if(await s.exists(Pt(N.revive(i),e))){t(`workspaceContains:${e}`);return}}async function C3t(s,e,t,i){if(t.length===0)return Promise.resolve(void 0);const n=new ci,o=s.checkExists(s.folders,t,n.token),r=setTimeout(async()=>{n.cancel(),s.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},w3t);let a=!1;try{a=await o}catch(c){Fr(c)||vt(c)}n.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function Wit(s,e,t,i){const n=s.get(we),o=s.get(Zae),a=n.createInstance(See).file(e.map(c=>KY(N.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Fr(c)?!1:Promise.reject(c))}var mAe;const Eue=Object.hasOwnProperty,S3t=Promise.resolve(void 0);let _Ae=mAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=n,this._notificationService=o,this._environmentService=r,this._telemetryService=a,this._extensionEnablementService=c,this._fileService=l,this._productService=d,this._extensionManagementService=h,this._contextService=u,this._configurationService=f,this._extensionManifestPropertiesService=p,this._logService=m,this._remoteAgentService=v,this._remoteExtensionsScannerService=b,this._lifecycleService=w,this._remoteAuthorityResolverService=y,this._dialogService=C,this._onDidRegisterExtensions=this._register(new I),this.onDidRegisterExtensions=this._onDidRegisterExtensions.event,this._onDidChangeExtensionsStatus=this._register(new I),this.onDidChangeExtensionsStatus=this._onDidChangeExtensionsStatus.event,this._onDidChangeExtensions=this._register(new I({leakWarningThreshold:400})),this.onDidChangeExtensions=this._onDidChangeExtensions.event,this._onWillActivateByEvent=this._register(new I),this.onWillActivateByEvent=this._onWillActivateByEvent.event,this._onDidChangeResponsiveChange=this._register(new I),this.onDidChangeResponsiveChange=this._onDidChangeResponsiveChange.event,this._onWillStop=this._register(new I),this.onWillStop=this._onWillStop.event,this._activationEventReader=new T3t,this._registry=new O8t(this._activationEventReader),this._installedExtensionsReady=new qd,this._extensionStatus=new va,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new bAe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=this._register(new A3t),this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(A=>{A.scheme!==pe.vscodeRemote&&A.join(this.activateByEvent(`onFileSystem:${A.scheme}`))})),this._runningLocations=new fAe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(A=>{const L=[],k=[];for(const P of A)this._safeInvokeIsEnabled(P)?L.push(P):k.push(P);Wh&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${A.map(P=>P.identifier.id).join(", ")}`),this._handleDeltaExtensions(new S0(L,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:A,removed:L})=>{(A.length||L.length)&&(Wh&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new S0(A,L)))})),this._register(this._extensionManagementService.onDidEnableExtensions(A=>{A.length&&(Wh&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new S0(A,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(A=>{const L=[];for(const{local:k,operation:P}of A)k&&k.isValid&&P!==LA.Migrate&&this._safeInvokeIsEnabled(k)&&L.push(k);L.length&&(Wh&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${L.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new S0(L,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(A=>{A.error||(Wh&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${A.identifier.id}`),this._handleDeltaExtensions(new S0([],[A.identifier.id])))})),this._register(this._lifecycleService.onWillShutdown(A=>{this._remoteAgentService.getConnection()&&A.join(()=>this._remoteAgentService.endConnection(),{id:"join.disconnectRemote",label:g(1126,"Disconnect Remote Agent"),order:Mve.Last})})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.getByKind(e)}async _handleDeltaExtensions(e){if(this._deltaExtensionsQueue.push(e),this._inHandleDeltaExtensions)return;let t=null;try{for(this._inHandleDeltaExtensions=!0,await this._installedExtensionsReady.wait(),t=await this._registry.acquireLock("handleDeltaExtensions");this._deltaExtensionsQueue.length>0;){const i=this._deltaExtensionsQueue.shift();await this._deltaExtensions(t,i.toAdd,i.toRemove)}}finally{this._inHandleDeltaExtensions=!1,t?.dispose()}}async _deltaExtensions(e,t,i){Wh&&this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${t.map(a=>a.identifier.id).join(",")}] toRemove: [${i.map(a=>typeof a=="string"?a:a.identifier.id).join(",")}]`);let n=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:n}),n=n.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:Xe.Error,message:g(1127,"The following extensions contain dependency loops and have been disabled: {0}",r.removedDueToLooping.map(a=>`'${a.identifier.value}'`).join(", "))}),this._extensionsProposedApi.updateEnabledApiProposals(o),this._doHandleExtensionPoints([].concat(o).concat(n)),await this._updateExtensionsOnExtHosts(r.versionId,o,n.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,n));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,n,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=s3t(n,o,l=>e.representsRunningLocation(l)),c=JO.createActivationEventsMap(i);if(Wh){const l=h=>h.map(u=>u.identifier.value).join(","),d=h=>h.map(u=>u.value).join(",");this._logService.info(`AbstractExtensionService: Calling deltaExtensions: toRemove: [${d(n)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:n,toAdd:i,addActivationEvents:c,myToRemove:a,myToAdd:r.map(l=>l.identifier)})}canAddExtension(e){return this._canAddExtension(e,[])}_canAddExtension(e,t){if(this._registry.getExtensionDescriptionByIdOrUUID(e.identifier,e.id)&&!t.some(c=>Sn.equals(e.identifier,c.identifier)))return!1;const n=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===pe.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,n,!o,o,Qg.None)!==null}canRemoveExtension(e){const t=this._registry.getExtensionDescription(e.identifier);return!(!t||this._extensionStatus.get(t.identifier)?.activationStarted)}async _activateAddedExtensionIfNeeded(e){let t=!1,i=null,n=!1;const o=this._activationEventReader.readActivationEvents(e);for(const r of o){if(this._allRequestedActivateEvents.has(r)){t=!0,i=r;break}if(r==="*"){t=!0,i=r;break}if(/^workspaceContains/.test(r)&&(n=!0),r==="onStartupFinished"){t=!0,i=r;break}}if(t)await Promise.all(this._extensionHostManagers.map(r=>r.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:i}))).then(()=>{});else if(n){const r=await this._contextService.getCompleteWorkspace(),a=!!this._environmentService.remoteAuthority,c={logService:this._logService,folders:r.folders.map(d=>d.uri),forceUsingSearch:a,exists:d=>this._fileService.exists(d),checkExists:(d,h,u)=>this._instantiationService.invokeFunction(f=>Wit(f,d,h,u))},l=await Bit(c,e);if(!l)return;await Promise.all(this._extensionHostManagers.map(d=>d.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:l.activationEvent}))).then(()=>{})}}async _initialize(){cs("code/willLoadExtensions"),this._startExtensionHostsIfNecessary(!0,[]);const e=await this._registry.acquireLock("_initialize");try{const t=await this._resolveExtensions();this._processExtensions(e,t);const i=this._registry.getSnapshot();for(const n of this._extensionHostManagers)if(n.startup!==RA.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,n);n.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),cs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:n}=t,o=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,lo.LocalWebWorker):[],c=n?this._runningLocations.filterByExtensionHostKind(o,lo.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,lo.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,lo.Remote);for(const u of a)k3t(l,u.identifier)||l.push(u);const d=r.concat(c).concat(l),h=this._registry.deltaExtensions(e,d,[]);h.removedDueToLooping.length>0&&this._notificationService.notify({severity:Xe.Error,message:g(1127,"The following extensions contain dependency loops and have been disabled: {0}",h.removedDueToLooping.map(u=>`'${u.identifier.value}'`).join(", "))}),this._doHandleExtensionPoints(this._registry.getAllExtensionDescriptions())}async _handleExtensionTests(){if(!this._environmentService.isExtensionDevelopment||!this._environmentService.extensionTestsLocationURI)return;const e=this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);if(!e){const i=g(1128,"No extension host found that can launch the test runner at {0}.",this._environmentService.extensionTestsLocationURI.toString());console.error(i),this._notificationService.error(i);return}let t;try{t=await e.extensionTestsExecute(),Wh&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Wh&&this._logService.error("Extension host test runner error",i),console.error(i),t=1}this._onExtensionHostExit(t)}findTestExtensionHost(e){let t=null;for(const i of this._registry.getAllExtensionDescriptions())if(qy(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===pe.vscodeRemote?t=new bee:t=new vee(0)),t!==null?this._extensionHostManagers.getByRunningLocation(t):null}_releaseBarrier(){this._installedExtensionsReady.open(),this._onDidRegisterExtensions.fire(void 0),this._onDidChangeExtensionsStatus.fire(this._registry.getAllExtensionDescriptions().map(e=>e.identifier))}async _resolveAuthorityInitial(e){for(let i=1;;i++)try{return this._resolveAuthorityWithLogging(e)}catch(n){if(fD.isNoResolverFound(n)||fD.isNotAvailable(n)||i>=5)throw n}}async _resolveAuthorityAgain(){const e=this._environmentService.remoteAuthority;if(e){this._remoteAuthorityResolverService._clearResolvedAuthority(e);try{const t=await this._resolveAuthorityWithLogging(e);this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options)}catch(t){this._remoteAuthorityResolverService._setResolvedAuthorityError(e,t)}}}async _resolveAuthorityWithLogging(e){const t=uee(e),i=js.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{cs(`code/willResolveAuthority/${t}`);const n=await this._resolveAuthority(e);return cs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${n.authority.connectTo}' after ${i.elapsed()} ms`),n}catch(n){throw cs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,n),n}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const n=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of n){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===ed.Unknown,c=r.error.code===ed.Unknown;a&&!c&&(o=r)}throw new fD(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e,t){return this._doStopExtensionHostsWithVeto(e,t)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);this._extensionHostManagers.disposeAllInReverse();for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e,t){const i=[],n=new Set;this._onWillStop.fire({reason:e,veto(r,a){i.push(r),typeof r=="boolean"?r===!0&&n.add(a):r.then(c=>{c&&n.add(a)}).catch(c=>{n.add(g(1129,"{0} (Error: {1})",a,Nr(c)))})}});const o=await N8t(i,r=>this._logService.error(r));if(!o)this._doStopExtensionHosts();else if(!t){const r=Array.from(n);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${r.join(", ")})`),await this._dialogService.warn(g(1130,"The following operation was blocked: {0}",e),r.length===1?g(1131,"The reason for blocking the operation: {0}",r[0]):g(1132,`The reasons for blocking the operation: +- {0}`,r.join(` + -`)))}return!o}_startExtensionHostsIfNecessary(e,t){const i=[];for(let n=0;n<=this._runningLocations.maxLocalProcessAffinity;n++)i.push(new vee(n));for(let n=0;n<=this._runningLocations.maxLocalWebWorkerAffinity;n++)i.push(new gAe(n));i.push(new bee);for(const n of i){if(this._extensionHostManagers.getByRunningLocation(n))continue;const o=this._createExtensionHostManager(n,e,t);if(o){const[r,a]=o;this._extensionHostManagers.add(r,a)}}}_createExtensionHostManager(e,t,i){const n=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!n)return null;const o=this._doCreateExtensionHostManager(n,i),r=new Z;return r.add(o.onDidExit(([a,c])=>this._onExtensionHostCrashOrExit(o,a,c))),r.add(o.onDidChangeResponsiveState(a=>{this._logService.info(`Extension host (${o.friendyName}) is ${a===OT.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:a===OT.Responsive,getInspectListener:c=>o.getInspectPort(c)})})),[o,r]}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===RA.Lazy&&t.length===0?this._instantiationService.createInstance(pAe,e,i):this._instantiationService.createInstance(mee,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!FNe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===lo.LocalProcess?this._doStopExtensionHosts():e.kind===lo.Remote&&(i&&this._onRemoteExtensionHostCrashed(e,i),this._extensionHostManagers.disposeOne(e))}_getExtensionHostExitInfoWithTimeout(e){return new Promise((t,i)=>{const n=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(n),t(o)},i)})}async _onRemoteExtensionHostCrashed(e,t){try{const i=await this._getExtensionHostExitInfoWithTimeout(t);i&&this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly with code ${i.code}.`),this._logExtensionHostCrash(e),this._remoteCrashTracker.registerCrash(),this._remoteCrashTracker.shouldAutomaticallyRestart()?(this._logService.info("Automatically restarting the remote extension host."),this._notificationService.status(g(1133,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(Xe.Error,g(1134,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(1135,"Restart Remote Extension Host"),run:()=>{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))}}])}catch{}}_logExtensionHostCrash(e){const t=[];for(const i of this._extensionStatus.values())i.activationStarted&&e.containsExtension(i.id)&&t.push(i.id);t.length>0?this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. The following extensions were running: ${t.map(i=>i.value).join(", ")}`):this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. No extensions were activated.`)}async startExtensionHosts(e){this._doStopExtensionHosts(),e&&await this._handleDeltaExtensions(new S0(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(lo.LocalProcess);await Promise.all(i.map(n=>n.ready()))}finally{t.dispose()}}activateByEvent(e,t=Nb.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):S3t):(this._allRequestedActivateEvents.add(e),t===Nb.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(n=>n.activateByEvent(e,t))).then(()=>{});return this._onWillActivateByEvent.fire({event:e,activation:i}),i}activateById(e,t){return this._activateById(e,t)}activationEventIsDone(e){return this._installedExtensionsReady.isOpen()?this._registry.containsActivationEvent(e)?this._extensionHostManagers.every(t=>t.activationEventIsDone(e)):!0:!1}whenInstalledExtensionsRegistered(){return this._installedExtensionsReady.wait()}get extensions(){return this._registry.getAllExtensionDescriptions()}_getExtensionRegistrySnapshotWhenReady(){return this._installedExtensionsReady.wait().then(()=>this._registry.getSnapshot())}getExtension(e){return this._installedExtensionsReady.wait().then(()=>this._registry.getExtensionDescription(e))}readExtensionPointContributions(e){return this._installedExtensionsReady.wait().then(()=>{const t=this._registry.getAllExtensionDescriptions(),i=[];for(const n of t)n.contributes&&Eue.call(n.contributes,e.name)&&i.push(new OLt(n,n.contributes[e.name]));return i})}getExtensionsStatus(){const e=Object.create(null);if(this._registry){const t=this._registry.getAllExtensionDescriptions();for(const i of t){const n=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:n?.messages??[],activationStarted:n?.activationStarted??!1,activationTimes:n?.activationTimes??void 0,runtimeErrors:n?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(n=>n.getInspectPort(t)))).filter(Fc)}async setRemoteEnvironment(e){await this._extensionHostManagers.map(t=>t.setRemoteEnvironment(e))}_safeInvokeIsEnabled(e){try{return this._extensionEnablementService.isEnabled(e)}catch{return!1}}_doHandleExtensionPoints(e){const t=Object.create(null);for(const r of e)if(r.contributes)for(const a in r.contributes)Eue.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),n=this._registry.getAllExtensionDescriptions(),o=eh.getExtensionPoints();cs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(cs(`code/willHandleExtensionPoint/${r.name}`),mAe._handleExtensionPoint(r,n,i),cs(`code/didHandleExtensionPoint/${r.name}`));cs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new I3t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),n=`[${e.extensionId.value}]: ${e.message}`;if(e.type===Xe.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Error,message:n}),this._logService.error(n)):e.type===Xe.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Warning,message:n}),this._logService.warn(n)):this._logService.info(n),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:o,extensionId:r,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:o,extensionId:r.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const n=[];for(const o of t)o.contributes&&Eue.call(o.contributes,e.name)&&n.push({description:o,value:o.contributes[e.name],collector:new iRt(i,o,e.name)});e.acceptUsers(n)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,n,o,r)=>this._onDidActivateExtension(t,i,n,o,r),_onDidActivateExtensionError:(t,i)=>this._onDidActivateExtensionError(t,i),_onExtensionRuntimeError:(t,i)=>this._onExtensionRuntimeError(t,i)}}async _activateById(e,t){if(!(await Promise.all(this._extensionHostManagers.map(o=>o.activate(e,t)))).some(o=>o))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,n,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new FLt(t,i,n,o)),this._onDidChangeExtensionsStatus.fire([e])}_onDidActivateExtensionError(e,t){this._telemetryService.publicLog2("extensionActivationError",{extensionId:e.value,error:t.message})}_onExtensionRuntimeError(e,t){this._getOrCreateExtensionStatus(e).addRuntimeError(t),this._onDidChangeExtensionsStatus.fire([e])}};_Ae=mAe=D([_(3,we),_(4,bi),_(5,Jr),_(6,Yi),_(7,Nl),_(8,Jt),_(9,Er),_(10,P6),_(11,yi),_(12,Te),_(13,Im),_(14,Ge),_(15,hg),_(16,Bae),_(17,ig),_(18,pC),_(19,to)],_Ae);class A3t extends V{constructor(){super(...arguments),this._extensionHostManagers=[]}dispose(){this.disposeAllInReverse(),super.dispose()}add(e,t){this._extensionHostManagers.push(new E3t(e,t))}disposeAllInReverse(){for(let e=this._extensionHostManagers.length-1;e>=0;e--)this._extensionHostManagers[e].dispose();this._extensionHostManagers=[]}disposeOne(e){const t=this._extensionHostManagers.findIndex(i=>i.extensionHost===e);t>=0&&(this._extensionHostManagers.splice(t,1),e.dispose())}getByKind(e){return this.filter(t=>t.kind===e)}getByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.extensionHost.representsRunningLocation(e))return t.extensionHost;return null}*[Symbol.iterator](){for(const e of this._extensionHostManagers)yield e.extensionHost}map(e){return this._extensionHostManagers.map(t=>e(t.extensionHost))}every(e){return this._extensionHostManagers.every(t=>e(t.extensionHost))}filter(e){return this._extensionHostManagers.filter(t=>e(t.extensionHost)).map(t=>t.extensionHost)}}class E3t{constructor(e,t){this.extensionHost=e,this.disposableStore=t}dispose(){this.disposableStore.dispose(),this.extensionHost.dispose()}}class x3t{constructor(e,t,i,n){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=n}}class S0{constructor(e,t){this.toAdd=e,this.toRemove=t}}function vAe(s,e,t,i,n){return t.updateEnabledApiProposals(i),D3t(s,e,i,n)}function D3t(s,e,t,i){const n=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?n.push(c):(o.push(c),r.push(ice(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(1136,"Activation Events"),access:{canToggle:!1},renderer:new wi(L3t)});var Bp;(function(s){s[s.Open=1]="Open",s[s.OpenInNewWindow=2]="OpenInNewWindow",s[s.Cancel=3]="Cancel"})(Bp||(Bp={}));const R3t="security.workspace.trust.enabled",L5e="security.workspace.trust.untrustedFiles",M3t="security.workspace.trust.emptyWindow",N3t="extensions.supportUntrustedWorkspaces",P3t="content.trust.model.key";class F3t{constructor(e,t,i){this.originalWorkspace=e,this.canonicalFolderUris=t,this.canonicalConfiguration=i}get folders(){return this.originalWorkspace.folders.map((e,t)=>({index:e.index,name:e.name,toResource:e.toResource,uri:this.canonicalFolderUris[t]}))}get transient(){return this.originalWorkspace.transient}get configuration(){return this.canonicalConfiguration??this.originalWorkspace.configuration}get id(){return this.originalWorkspace.id}}let R5e=class extends V{constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(R3t)}};R5e=D([_(0,Te),_(1,Jr)],R5e);let M5e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=n,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=P3t,this._onDidChangeTrust=this._register(new I),this.onDidChangeTrust=this._onDidChangeTrust.event,this._onDidChangeTrustedFolders=this._register(new I),this.onDidChangeTrustedFolders=this._onDidChangeTrustedFolders.event,this._canonicalStartupFiles=[],this._canonicalUrisResolved=!1,this._canonicalWorkspace=this.workspaceService.getWorkspace(),{promise:this._workspaceResolvedPromise,resolve:this._workspaceResolvedPromiseResolve}=M2(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=M2(),this._storedTrustState=new B3t(Wn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new O3t),this._trustStateInfo=this.loadTrustInfo(),this._isTrusted=this.calculateWorkspaceTrust(),this.initializeWorkspaceTrust(),this.registerListeners()}initializeWorkspaceTrust(){this.resolveCanonicalUris().then(async()=>{this._canonicalUrisResolved=!0,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceResolvedPromiseResolve(),this.environmentService.remoteAuthority||this._workspaceTrustInitializedPromiseResolve()}),this.environmentService.remoteAuthority&&this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority).then(async e=>{this._remoteAuthority=e,await this.fileService.activateProvider(pe.vscodeRemote),await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceTrustInitializedPromiseResolve()}),this.isEmptyWorkspace()&&this._workspaceTrustInitializedPromise.then(()=>{this._storedTrustState.isEmptyWorkspaceTrusted===void 0&&(this._storedTrustState.isEmptyWorkspaceTrusted=this.isWorkspaceTrusted())})}registerListeners(){this._register(this.workspaceService.onDidChangeWorkspaceFolders(async()=>await this.updateWorkspaceTrust())),this._register(this.storageService.onDidChangeValue(Ie.APPLICATION,this.storageKey,this._register(new Z))(async()=>{JSON.stringify(this._trustStateInfo)!==JSON.stringify(this.loadTrustInfo())&&(this._trustStateInfo=this.loadTrustInfo(),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust())}))}async getCanonicalUri(e){let t=e;if(this.environmentService.remoteAuthority&&e.scheme===pe.vscodeRemote)t=await this.remoteAuthorityResolverService.getCanonicalURI(e);else if(e.scheme==="vscode-vfs"){const i=e.authority.indexOf("+");i!==-1&&(t=e.with({authority:e.authority.substr(0,i)}))}return t.with({query:null,fragment:null})}async resolveCanonicalUris(){const e=[];if(this.environmentService.filesToOpenOrCreate&&e.push(...this.environmentService.filesToOpenOrCreate),this.environmentService.filesToDiff&&e.push(...this.environmentService.filesToDiff),this.environmentService.filesToMerge&&e.push(...this.environmentService.filesToMerge),e.length){const o=e.filter(a=>!!a.fileUri).map(a=>a.fileUri),r=await Promise.all(o.map(a=>this.getCanonicalUri(a)));this._canonicalStartupFiles.push(...r.filter(a=>this._canonicalStartupFiles.every(c=>!this.uriIdentityService.extUri.isEqual(a,c))))}const t=this.workspaceService.getWorkspace().folders.map(o=>o.uri),i=await Promise.all(t.map(o=>this.getCanonicalUri(o)));let n=this.workspaceService.getWorkspace().configuration;n&&Jme(n,this.environmentService)&&(n=await this.getCanonicalUri(n)),this._canonicalWorkspace=new F3t(this.workspaceService.getWorkspace(),i,n)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,Ie.APPLICATION);let t;try{e&&(t=JSON.parse(e))}catch{}return t||(t={uriTrustInfo:[]}),t.uriTrustInfo||(t.uriTrustInfo=[]),t.uriTrustInfo=t.uriTrustInfo.map(i=>({uri:N.revive(i.uri),trusted:i.trusted})),t.uriTrustInfo=t.uriTrustInfo.filter(i=>i.trusted),t}async saveTrustInfo(){this.storageService.store(this.storageKey,JSON.stringify(this._trustStateInfo),Ie.APPLICATION,an.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&Jme(t,this.environmentService)&&e.push(t),e}calculateWorkspaceTrust(){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this._canonicalUrisResolved?this.environmentService.remoteAuthority&&this._remoteAuthority?.options?.isTrusted?this._remoteAuthority.options.isTrusted:this.isEmptyWorkspace()?this._storedTrustState.isEmptyWorkspaceTrusted!==void 0?this._storedTrustState.isEmptyWorkspaceTrusted:this._canonicalStartupFiles.length?this.getUrisTrust(this._canonicalStartupFiles):!!this.configurationService.getValue(M3t):this.getUrisTrust(this.getWorkspaceUris()):!1:!0}async updateWorkspaceTrust(e){this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&(e===void 0&&(await this.resolveCanonicalUris(),e=this.calculateWorkspaceTrust()),this.isWorkspaceTrusted()!==e&&(this.isTrusted=e,await this._trustTransitionManager.participate(e),this._onDidChangeTrust.fire(e)))}getUrisTrust(e){let t=!0;for(const i of e){const{trusted:n}=this.doGetUriTrustInfo(i);if(!n)return t=n,t}return t}doGetUriTrustInfo(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled())return{trusted:!0,uri:e};if(this.isTrustedVirtualResource(e))return{trusted:!0,uri:e};if(this.isTrustedByRemote(e))return{trusted:!0,uri:e};let t=!1,i=-1,n=e;for(const o of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(e,o.uri)){const r=o.uri.fsPath;r.length>i&&(i=r.length,t=o.trusted,n=o.uri)}return{trusted:t,uri:n}}async doSetUrisTrust(e,t){let i=!1;for(const n of e)if(t){if(this.isTrustedVirtualResource(n)||this.isTrustedByRemote(n))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,n))||(this._trustStateInfo.uriTrustInfo.push({uri:n,trusted:!0}),i=!0)}else{const o=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(r=>!this.uriIdentityService.extUri.isEqual(r.uri,n)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===qi.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?Py(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return ECe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:R2(KYe(e),this._remoteAuthority.authority.authority)&&!!this._remoteAuthority.options?.isTrusted}set isTrusted(e){this._isTrusted=e,e||(this._storedTrustState.acceptsOutOfWorkspaceFiles=!1),this.isEmptyWorkspace()&&(this._storedTrustState.isEmptyWorkspaceTrusted=e)}get workspaceResolved(){return this._workspaceResolvedPromise}get workspaceTrustInitialized(){return this._workspaceTrustInitializedPromise}get acceptsOutOfWorkspaceFiles(){return this._storedTrustState.acceptsOutOfWorkspaceFiles}set acceptsOutOfWorkspaceFiles(e){this._storedTrustState.acceptsOutOfWorkspaceFiles=e}isWorkspaceTrusted(){return this._isTrusted}isWorkspaceTrustForced(){return!!(this.environmentService.remoteAuthority&&this._remoteAuthority&&this._remoteAuthority.options?.isTrusted!==void 0||this.getWorkspaceUris().filter(t=>!this.isTrustedVirtualResource(t)).length===0)}canSetParentFolderTrust(){const e=GO(this._canonicalWorkspace);if(!P_(e)||e.uri.scheme!==pe.file&&e.uri.scheme!==pe.vscodeRemote)return!1;const t=this.uriIdentityService.extUri.dirname(e.uri);return!this.uriIdentityService.extUri.isEqual(e.uri,t)}async setParentFolderTrust(e){if(this.canSetParentFolderTrust()){const t=GO(this._canonicalWorkspace).uri,i=this.uriIdentityService.extUri.dirname(t);await this.setUrisTrust([i],e)}}canSetWorkspaceTrust(){if(this.environmentService.remoteAuthority&&(!this._remoteAuthority||this._remoteAuthority.options?.isTrusted!==void 0))return!1;if(this.isEmptyWorkspace())return!0;if(this.getWorkspaceUris().filter(n=>!this.isTrustedVirtualResource(n)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=GO(this._canonicalWorkspace);if(!P_(t)||t.uri.scheme!==pe.file&&t.uri.scheme!=="vscode-vfs")return!1;const i=this.doGetUriTrustInfo(t.uri);if(!i.trusted||!this.uriIdentityService.extUri.isEqual(t.uri,i.uri))return!1;if(this.canSetParentFolderTrust()){const n=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(n).trusted)return!1}return!0}async setWorkspaceTrust(e){if(this.isEmptyWorkspace()){await this.updateWorkspaceTrust(e);return}const t=this.getWorkspaceUris();await this.setUrisTrust(t,e)}async getUriTrustInfo(e){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this.isTrustedByRemote(e)?{trusted:!0,uri:e}:this.doGetUriTrustInfo(await this.getCanonicalUri(e)):{trusted:!0,uri:e}}async setUrisTrust(e,t){this.doSetUrisTrust(await Promise.all(e.map(i=>this.getCanonicalUri(i))),t)}getTrustedUris(){return this._trustStateInfo.uriTrustInfo.map(e=>e.uri)}async setTrustedUris(e){this._trustStateInfo.uriTrustInfo=[];for(const t of e){const i=await this.getCanonicalUri(t),n=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,n)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:n})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};M5e=D([_(0,Te),_(1,pC),_(2,$i),_(3,ks),_(4,Jr),_(5,yi),_(6,_ae),_(7,Jt)],M5e);let N5e=class extends V{constructor(e,t){super(),this.configurationService=e,this.workspaceTrustManagementService=t,this._onDidInitiateOpenFilesTrustRequest=this._register(new I),this.onDidInitiateOpenFilesTrustRequest=this._onDidInitiateOpenFilesTrustRequest.event,this._onDidInitiateWorkspaceTrustRequest=this._register(new I),this.onDidInitiateWorkspaceTrustRequest=this._onDidInitiateWorkspaceTrustRequest.event,this._onDidInitiateWorkspaceTrustRequestOnStartup=this._register(new I),this.onDidInitiateWorkspaceTrustRequestOnStartup=this._onDidInitiateWorkspaceTrustRequestOnStartup.event}get untrustedFilesSetting(){return this.configurationService.getValue(L5e)}set untrustedFilesSetting(e){this.configurationService.updateValue(L5e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===Bp.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===Bp.Open&&(this.untrustedFilesSetting="open"),e===Bp.OpenInNewWindow&&(this.untrustedFilesSetting="newWindow")),this._openFilesTrustRequestResolver(e),this._openFilesTrustRequestResolver=void 0,this._openFilesTrustRequestPromise=void 0)}async requestOpenFilesTrust(e){if(!this.workspaceTrustManagementService.isWorkspaceTrusted()||(await Promise.all(e.map(i=>this.workspaceTrustManagementService.getUriTrustInfo(i)))).map(i=>i.trusted).every(i=>i))return Bp.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return Bp.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return Bp.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return Bp.Open;if(!this._openFilesTrustRequestPromise)this._openFilesTrustRequestPromise=new Promise(i=>{this._openFilesTrustRequestResolver=i});else return this._openFilesTrustRequestPromise;return this._onDidInitiateOpenFilesTrustRequest.fire(),this._openFilesTrustRequestPromise}resolveWorkspaceTrustRequest(e){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(e??this.workspaceTrustManagementService.isWorkspaceTrusted()),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}cancelWorkspaceTrustRequest(){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(void 0),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}async completeWorkspaceTrustRequest(e){if(e===void 0||e===this.workspaceTrustManagementService.isWorkspaceTrusted()){this.resolveWorkspaceTrustRequest(e);return}M.once(this.workspaceTrustManagementService.onDidChangeTrust)(t=>this.resolveWorkspaceTrustRequest(t)),await this.workspaceTrustManagementService.setWorkspaceTrust(e)}async requestWorkspaceTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return this.workspaceTrustManagementService.isWorkspaceTrusted();if(!this._workspaceTrustRequestPromise)this._workspaceTrustRequestPromise=new Promise(t=>{this._workspaceTrustRequestResolver=t});else return this._workspaceTrustRequestPromise;return this._onDidInitiateWorkspaceTrustRequest.fire(e),this._workspaceTrustRequestPromise}requestWorkspaceTrustOnStartup(){this._workspaceTrustRequestPromise||(this._workspaceTrustRequestPromise=new Promise(e=>{this._workspaceTrustRequestResolver=e})),this._onDidInitiateWorkspaceTrustRequestOnStartup.fire()}};N5e=D([_(0,Te),_(1,uC)],N5e);class O3t extends V{constructor(){super(...arguments),this.participants=new hl}addWorkspaceTrustTransitionParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e){for(const t of this.participants)await t.participate(e)}dispose(){this.participants.clear(),super.dispose()}}class B3t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new sI("workspaceTrust",e),this._mementoObject=this._memento.getMemento(Ie.WORKSPACE,an.MACHINE)):this._mementoObject={}}get acceptsOutOfWorkspaceFiles(){return this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]??!1}set acceptsOutOfWorkspaceFiles(e){this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]=e,this._memento?.saveMemento()}get isEmptyWorkspaceTrusted(){return this._mementoObject[this._isEmptyWorkspaceTrustedKey]}set isEmptyWorkspaceTrusted(e){this._mementoObject[this._isEmptyWorkspaceTrustedKey]=e,this._memento?.saveMemento()}}let wAe=class extends V{constructor(e,t,i,n){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=n,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new va;const o=t.inspect(N3t).userValue||{};for(const r of Object.keys(o))this._configuredExtensionWorkspaceTrustRequestMap.set(r,o[r]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,e.extensionUntrustedWorkspaceSupport)for(const r of Object.keys(e.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(r,e.extensionUntrustedWorkspaceSupport[r])}prefersExecuteOnUI(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="ui"}prefersExecuteOnWorkspace(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="workspace"}prefersExecuteOnWeb(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="web"}canExecuteOnUI(e){return this.getExtensionKind(e).some(i=>i==="ui")}canExecuteOnWorkspace(e){return this.getExtensionKind(e).some(i=>i==="workspace")}canExecuteOnWeb(e){return this.getExtensionKind(e).some(i=>i==="web")}getExtensionKind(e){const t=this.deduceExtensionKind(e),i=this.getConfiguredExtensionKind(e);if(i&&i.length>0){const n=[];for(const o of i)o!=="-web"&&n.push(o);return i.includes("-web")&&!n.length&&(n.push("ui"),n.push("workspace")),Wn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&n.push("web"),n}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new va,n=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(n))i.set(o,n[o]);this._configuredExtensionKindsMap=i}const t=this._configuredExtensionKindsMap.get(e.id);return t?this.toArray(t):void 0}getExtensionUntrustedWorkspaceSupportType(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||!e.main)return!0;const t=this.getConfiguredExtensionWorkspaceTrustRequest(e),i=this.getProductExtensionWorkspaceTrustRequest(e);return t!==void 0?t:i?.override!==void 0?i.override:e.capabilities?.untrustedWorkspaces?.supported!==void 0?e.capabilities.untrustedWorkspaces.supported:i?.default!==void 0?i.default:!1}getExtensionVirtualWorkspaceSupportType(e){const t=this.getConfiguredVirtualWorkspaceSupport(e);if(t!==void 0)return t;const i=this.getProductVirtualWorkspaceSupport(e);if(i?.override!==void 0)return i.override;const n=e.capabilities?.virtualWorkspaces;if(s8(n))return n;if(n){const o=n.supported;if(s8(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Wn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...jIt];if((eo(e.extensionPack)||eo(e.extensionDependencies))&&(t=Wn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const n=this.getSupportedExtensionKindsForExtensionPoint(i);n.length&&(t=t.filter(o=>n.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",Iw(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;eh.getExtensionPoints().forEach(n=>i.set(n.name,n.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Wn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:Iw(e.publisher,e.name)};let i=this.getUserConfiguredExtensionKind(t);return typeof i<"u"?this.toArray(i):(i=this.getProductExtensionKind(e),typeof i<"u"?i:(i=e.extensionKind,typeof i<"u"?(i=this.toArray(i),i.filter(n=>["ui","workspace"].includes(n))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new va;if(this.productService.extensionKind)for(const n of Object.keys(this.productService.extensionKind))i.set(n,this.productService.extensionKind[n]);this._productExtensionKindsMap=i}const t=Iw(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new va;if(this.productService.extensionVirtualWorkspacesSupport)for(const n of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(n,this.productService.extensionVirtualWorkspacesSupport[n]);this._productVirtualWorkspaceSupportMap=i}const t=Iw(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new va,n=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(n))n[o]!==void 0&&i.set(o,n[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=Iw(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=Iw(e.publisher,e.name),i=this._configuredExtensionWorkspaceTrustRequestMap.get(t);if(i&&(i.version===void 0||i.version===e.version))return i.supported}getProductExtensionWorkspaceTrustRequest(e){const t=Iw(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};wAe=D([_(0,Er),_(1,Te),_(2,_ae),_(3,Ge)],wAe);let yAe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(n=>Sn.toKey(n))),this._envEnablesProposedApiForAll=!t.isBuilt||t.isExtensionDevelopment&&i.quality!=="stable"||this._envEnabledExtensions.size===0&&Array.isArray(t.extensionEnabledProposedApi),this._productEnabledExtensions=new Map,i.extensionEnabledApiProposals)for(const[n,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Sn.toKey(n),a=o.filter(c=>RM[c]?!0:(e.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${r}' wants API proposal '${c}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),!1));this._productEnabledExtensions.set(r,a)}}updateEnabledApiProposals(e){for(const t of e)this.doUpdateEnabledApiProposals(t)}doUpdateEnabledApiProposals(e){const t=Sn.toKey(e.identifier);if(eo(e.enabledApiProposals)&&(e.enabledApiProposals=e.enabledApiProposals.filter(i=>{const n=!!RM[i];return n||this._logService.error(`Extension '${t}' wants API proposal '${i}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),n})),this._productEnabledExtensions.has(t)){const i=this._productEnabledExtensions.get(t),n=new Set(i),o=new Set(e.enabledApiProposals),r=new Set([...o].filter(a=>!n.has(a)));r.size>0&&(this._logService.error(`Extension '${t}' appears in product.json but enables LESS API proposals than the extension wants. +package.json (LOSES): ${[...o].join(", ")} +product.json (WINS): ${[...n].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...r].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),i.push(...r))),e.enabledApiProposals=i;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(t)||!e.isBuiltin&&eo(e.enabledApiProposals)&&(this._logService.error(`Extension '${e.identifier.value} CANNOT USE these API proposals '${e.enabledApiProposals?.join(", ")||"*"}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`),e.enabledApiProposals=[])}};yAe=D([_(0,Ge),_(1,Jr),_(2,Er)],yAe);class W3t extends V{constructor(){super(...arguments),this.type="markdown"}shouldRender(e){return!!e.originalEnabledApiProposals?.length||!!e.enabledApiProposals?.length}render(e){const t=e.originalEnabledApiProposals??e.enabledApiProposals??[],i=new Mt;if(t.length)for(const n of t)i.appendMarkdown(`- \`${n}\` +`);return{data:i,dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"enabledApiProposals",label:g(1137,"API Proposals"),access:{canToggle:!1},renderer:new wi(W3t)});async function H3t(s,e){const t=[];return await Hit(s,t,e.logsHome,e.logsHome),t}async function Hit(s,e,t,i){const n=await s.resolve(t);for(const{resource:o,isDirectory:r}of n.children||[])if(r)await Hit(s,e,o,i);else{const a=(await s.readFile(o)).value.toString();if(a){const c=DN(i,o);c&&e.push({relativePath:c,contents:a})}}}var Ff;(function(s){s[s.Promise=100]="Promise",s[s.PromiseCancel=101]="PromiseCancel",s[s.EventListen=102]="EventListen",s[s.EventDispose=103]="EventDispose"})(Ff||(Ff={}));function P5e(s){switch(s){case Ff.Promise:return"req";case Ff.PromiseCancel:return"cancel";case Ff.EventListen:return"subscribe";case Ff.EventDispose:return"unsubscribe"}}var Du;(function(s){s[s.Initialize=200]="Initialize",s[s.PromiseSuccess=201]="PromiseSuccess",s[s.PromiseError=202]="PromiseError",s[s.PromiseErrorObj=203]="PromiseErrorObj",s[s.EventFire=204]="EventFire"})(Du||(Du={}));function F5e(s){switch(s){case Du.Initialize:return"init";case Du.PromiseSuccess:return"reply:";case Du.PromiseError:case Du.PromiseErrorObj:return"replyErr:";case Du.EventFire:return"event:"}}var SF;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Idle=1]="Idle"})(SF||(SF={}));function vP(s){let e=0;for(let t=0;;t+=7){const i=s.read(1);if(e|=(i.buffer[0]&127)<>>7)t++;const i=$e.alloc(t);for(let n=0;e!==0;n++)i.buffer[n]=e&127,e=e>>>7,e>0&&(i.buffer[n]|=128);s.write(i)}class V3t{constructor(e){this.buffer=e,this.pos=0}read(e){const t=this.buffer.slice(this.pos,this.pos+e);return this.pos+=t.byteLength,t}}class z3t{constructor(){this.buffers=[]}get buffer(){return $e.concat(this.buffers)}write(e){this.buffers.push(e)}}var Fu;(function(s){s[s.Undefined=0]="Undefined",s[s.String=1]="String",s[s.Buffer=2]="Buffer",s[s.VSBuffer=3]="VSBuffer",s[s.Array=4]="Array",s[s.Object=5]="Object",s[s.Int=6]="Int"})(Fu||(Fu={}));function xE(s){const e=$e.alloc(1);return e.writeUInt8(s,0),e}const GI={Undefined:xE(Fu.Undefined),String:xE(Fu.String),Buffer:xE(Fu.Buffer),VSBuffer:xE(Fu.VSBuffer),Array:xE(Fu.Array),Object:xE(Fu.Object),Uint:xE(Fu.Int)},$3t=typeof Buffer<"u";function CAe(s,e){if(typeof e>"u")s.write(GI.Undefined);else if(typeof e=="string"){const t=$e.fromString(e);s.write(GI.String),bP(s,t.byteLength),s.write(t)}else if($3t&&Buffer.isBuffer(e)){const t=$e.wrap(e);s.write(GI.Buffer),bP(s,t.byteLength),s.write(t)}else if(e instanceof $e)s.write(GI.VSBuffer),bP(s,e.byteLength),s.write(e);else if(Array.isArray(e)){s.write(GI.Array),bP(s,e.length);for(const t of e)CAe(s,t)}else if(typeof e=="number"&&(e|0)===e)s.write(GI.Uint),bP(s,e);else{const t=$e.fromString(JSON.stringify(e));s.write(GI.Object),bP(s,t.byteLength),s.write(t)}}function SAe(s){switch(s.read(1).readUInt8(0)){case Fu.Undefined:return;case Fu.String:return s.read(vP(s)).toString();case Fu.Buffer:return s.read(vP(s)).buffer;case Fu.VSBuffer:return s.read(vP(s));case Fu.Array:{const t=vP(s),i=[];for(let n=0;nthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,n,o){return t.isDisposed?Promise.reject(new Ma):t.requestPromise(e,i,n,o)},listen(i,n){return t.isDisposed?M.None:t.requestEvent(e,i,n)}}}requestPromise(e,t,i,n=He.None){const o=this.lastRequestId++,r=Ff.Promise,a={id:o,type:r,channelName:e,name:t,arg:i};if(n.isCancellationRequested)return Promise.reject(new Ma);let c;return new Promise((d,h)=>{if(n.isCancellationRequested)return h(new Ma);const u=()=>{const v=b=>{switch(b.type){case Du.PromiseSuccess:this.handlers.delete(o),d(b.data);break;case Du.PromiseError:{this.handlers.delete(o);const w=new Error(b.data.message);w.stack=Array.isArray(b.data.stack)?b.data.stack.join(` +`):b.data.stack,w.name=b.data.name,h(w);break}case Du.PromiseErrorObj:this.handlers.delete(o),h(b.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===SF.Idle?u():(f=Rr(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:Ff.PromiseCancel}),h(new Ma)},m=n.onCancellationRequested(p);c=jr(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const n=this.lastRequestId++,o=Ff.EventListen,r={id:n,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=Rr(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(r)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:n,type:Ff.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(n,l),c.event}sendRequest(e){switch(e.type){case Ff.Promise:case Ff.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,AF.LocalSide,`${P5e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case Ff.PromiseCancel:case Ff.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,AF.LocalSide,P5e(e.type));return}}}send(e,t=void 0){const i=new z3t;return CAe(i,e),CAe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new V3t(e),i=SAe(t),n=SAe(t),o=i[0];switch(o){case Du.Initialize:return this.logger?.logIncoming(e.byteLength,0,AF.LocalSide,F5e(o)),this.onResponse({type:i[0]});case Du.PromiseSuccess:case Du.PromiseError:case Du.EventFire:case Du.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],AF.LocalSide,F5e(o),n),this.onResponse({type:i[0],id:i[1],data:n})}}onResponse(e){if(e.type===Du.Initialize){this.state=SF.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return M.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===SF.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),bt(this.activeRequests.values()),this.activeRequests.clear()}}O5e.__decorator=D([Zt],O5e.prototype,"onDidInitializePromise",null);var BT;(function(s){s.Created="created",s.Read="read",s.Write="write",s.Open="open",s.Error="error",s.Close="close",s.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",s.NodeEndReceived="nodeEndReceived",s.NodeEndSent="nodeEndSent",s.NodeDrainBegin="nodeDrainBegin",s.NodeDrainEnd="nodeDrainEnd",s.zlibInflateError="zlibInflateError",s.zlibInflateData="zlibInflateData",s.zlibInflateInitialWrite="zlibInflateInitialWrite",s.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",s.zlibInflateWrite="zlibInflateWrite",s.zlibInflateFlushFired="zlibInflateFlushFired",s.zlibDeflateError="zlibDeflateError",s.zlibDeflateData="zlibDeflateData",s.zlibDeflateWrite="zlibDeflateWrite",s.zlibDeflateFlushFired="zlibDeflateFlushFired",s.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",s.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",s.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",s.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",s.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",s.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",s.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",s.ProtocolHeaderRead="protocolHeaderRead",s.ProtocolMessageRead="protocolMessageRead",s.ProtocolHeaderWrite="protocolHeaderWrite",s.ProtocolMessageWrite="protocolMessageWrite",s.ProtocolWrite="protocolWrite"})(BT||(BT={}));var AAe;(function(s){s.enableDiagnostics=!1,s.records=[];const e=new WeakMap;let t=0;function i(o,r){if(!e.has(o)){const a=String(++t);e.set(o,a)}return e.get(o)}function n(o,r,a,c){if(!s.enableDiagnostics)return;const l=i(o);if(c instanceof $e||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=$e.alloc(c.byteLength);d.set(c),s.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else s.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}s.traceSocketEvent=n})(AAe||(AAe={}));var Aee;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(Aee||(Aee={}));let xue=null;function DE(){return xue||(xue=$e.alloc(0)),xue}class G3t{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(e){this._chunks.push(e),this._totalLength+=e.byteLength}read(e){return this._read(e,!0)}peek(e){return this._read(e,!1)}_read(e,t){if(e===0)return DE();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),r}if(this._chunks[0].byteLength>e){const r=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),r}const i=$e.alloc(e);let n=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,n),n+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,n),n+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var Vr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Control=2]="Control",s[s.Ack=3]="Ack",s[s.Disconnect=5]="Disconnect",s[s.ReplayRequest=6]="ReplayRequest",s[s.Pause=7]="Pause",s[s.Resume=8]="Resume",s[s.KeepAlive=9]="KeepAlive"})(Vr||(Vr={}));function Uit(s){switch(s){case Vr.None:return"None";case Vr.Regular:return"Regular";case Vr.Control:return"Control";case Vr.Ack:return"Ack";case Vr.Disconnect:return"Disconnect";case Vr.ReplayRequest:return"ReplayRequest";case Vr.Pause:return"PauseWriting";case Vr.Resume:return"ResumeWriting";case Vr.KeepAlive:return"KeepAlive"}}var Rf;(function(s){s[s.HeaderLength=13]="HeaderLength",s[s.AcknowledgeTime=2e3]="AcknowledgeTime",s[s.TimeoutTime=2e4]="TimeoutTime",s[s.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",s[s.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",s[s.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(Rf||(Rf={}));class nw{constructor(e,t,i,n){this.type=e,this.id=t,this.ack=i,this.data=n,this.writtenTime=0}get size(){return this.data.byteLength}}class B5e extends V{constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Rf.HeaderLength,messageType:Vr.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new G3t,this._register(this._socket.onData(t=>this.acceptChunk(t))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){const t=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=t.readUInt32BE(9),this._state.messageType=t.readUInt8(0),this._state.id=t.readUInt32BE(1),this._state.ack=t.readUInt32BE(5),this._socket.traceSocketEvent(BT.ProtocolHeaderRead,{messageType:Uit(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,n=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Rf.HeaderLength,this._state.messageType=Vr.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(BT.ProtocolMessageRead,t),this._onMessage.fire(new nw(i,n,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class W5e{constructor(e){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=e,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(e){if(this._isDisposed)return;e.writtenTime=Date.now(),this.lastWriteTime=Date.now();const t=$e.alloc(Rf.HeaderLength);t.writeUInt8(e.type,0),t.writeUInt32BE(e.id,1),t.writeUInt32BE(e.ack,5),t.writeUInt32BE(e.data.byteLength,9),this._socket.traceSocketEvent(BT.ProtocolHeaderWrite,{messageType:Uit(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(BT.ProtocolMessageWrite,e.data),this._writeSoon(t,e.data)}_bufferAdd(e,t){const i=this._totalLength===0;return this._data.push(e,t),this._totalLength+=e.byteLength+t.byteLength,i}_bufferTake(){const e=$e.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,e}_writeSoon(e,t){this._bufferAdd(e,t)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const e=this._bufferTake();this._socket.traceSocketEvent(BT.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class e1{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new I({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(e){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(e):this._emitter.fire(e):this._bufferedMessages.push(e)}flushBuffer(){this._bufferedMessages=[]}}class K3t{constructor(e){this.data=e,this.next=null}}class q3t{constructor(){this._first=null,this._last=null}length(){let e=0,t=this._first;for(;t;)t=t.next,e++;return e}peek(){return this._first?this._first.data:null}toArray(){const e=[];let t=0,i=this._first;for(;i;)e[t++]=i.data,i=i.next;return e}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(e){const t=new K3t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const Lp=class Lp{static getInstance(){return Lp._INSTANCE||(Lp._INSTANCE=new Lp),Lp._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=Lp._HISTORY_LENGTH;t>=1;t--)this.lastRuns[t]=this.lastRuns[t-1];this.lastRuns[0]=Date.now()},1e3)}load(){const e=Date.now(),t=(1+Lp._HISTORY_LENGTH)*1e3;let i=0;for(let n=0;n=.5}};Lp._HISTORY_LENGTH=10,Lp._INSTANCE=null;let EAe=Lp;class Q3t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new e1,this.onControlMessage=this._onControlMessage.event,this._onMessage=new e1,this.onMessage=this._onMessage.event,this._onDidDispose=new e1,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new e1,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new e1,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??EAe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new q3t,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socketDisposables=new Z,this._socket=e.socket,this._socketWriter=this._socketDisposables.add(new W5e(this._socket)),this._socketReader=this._socketDisposables.add(new B5e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(t=>this._receiveMessage(t))),this._socketDisposables.add(this._socket.onClose(t=>this._onSocketClose.fire(t))),e.initialChunk&&this._socketReader.acceptChunk(e.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},Rf.KeepAliveSendTime):this._keepAliveInterval=null}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;const e=new nw(Vr.Disconnect,0,0,DE());this._socketWriter.write(e),this._socketWriter.flush()}}sendPause(){const e=new nw(Vr.Pause,0,0,DE());this._socketWriter.write(e)}sendResume(){const e=new nw(Vr.Resume,0,0,DE());this._socketWriter.write(e)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(e,t){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new Z,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=e,this._socketWriter=this._socketDisposables.add(new W5e(this._socket)),this._socketReader=this._socketDisposables.add(new B5e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(i=>this._receiveMessage(i))),this._socketDisposables.add(this._socket.onClose(i=>this._onSocketClose.fire(i))),this._socketReader.acceptChunk(t)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const e=new nw(Vr.Ack,0,this._incomingAckId,DE());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;ithis._outgoingAckId){this._outgoingAckId=e.ack;do{const t=this._outgoingUnackMsg.peek();if(t&&t.id<=e.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(e.type){case Vr.None:break;case Vr.Regular:{if(e.id>this._incomingMsgId)if(e.id!==this._incomingMsgId+1){const t=Date.now();t-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=t,this._socketWriter.write(new nw(Vr.ReplayRequest,0,0,DE())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case Vr.Control:{this._onControlMessage.fire(e.data);break}case Vr.Ack:break;case Vr.Disconnect:{this._onDidDispose.fire();break}case Vr.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;i=Rf.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Rf.AcknowledgeTime-e+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const e=this._outgoingUnackMsg.peek(),t=Date.now()-e.writtenTime,i=Date.now()-this._socketReader.lastReadTime,n=Date.now()-this._lastSocketTimeoutTime;if(t>=Rf.TimeoutTime&&i>=Rf.TimeoutTime&&n>=Rf.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(Rf.TimeoutTime-t,Rf.TimeoutTime-i,Rf.TimeoutTime-n,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new nw(Vr.Ack,0,this._incomingAckId,DE());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new nw(Vr.KeepAlive,0,this._incomingAckId,DE());this._socketWriter.write(e)}}const j3t=30*1e3;var WT;(function(s){s[s.Management=1]="Management",s[s.ExtensionHost=2]="ExtensionHost",s[s.Tunnel=3]="Tunnel"})(WT||(WT={}));function xAe(s){switch(s){case WT.Management:return"Management";case WT.ExtensionHost:return"ExtensionHost";case WT.Tunnel:return"Tunnel"}}function Vit(s){const e=new ci;return setTimeout(()=>e.cancel(),s),e.token}function Y3t(s,e){if(s.isCancellationRequested||e.isCancellationRequested)return He.Cancelled;const t=new ci;return s.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Mce{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=M2(),e.isCancellationRequested?this._timeout():this._disposables.add(e.onCancellationRequested(()=>this._timeout()))}registerDisposable(e){this._state==="pending"?this._disposables.add(e):e.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const e=new Error("Time limit reached");return e.code="ETIMEDOUT",e.syscall="connect",e}resolve(e){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(e))}reject(e){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(e))}}function J3t(s,e){const t=new Mce(e);return t.registerDisposable(s.onControlMessage(i=>{const n=JSON.parse(i.toString()),o=Git(n);o?t.reject(o):t.resolve(n)})),t.promise}function X3t(s,e,t,i,n,o,r,a){const c=new Mce(a),l=js.create(!1);return s.info(`Creating a socket (${r})...`),cs(`code/willCreateSocket/${o}`),e.connect(t,i,n,r).then(d=>{c.didTimeout?(cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(cs(`code/didCreateSocketOK/${o}`),s.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),s.error(d),c.reject(d)}),c.promise}function Due(s,e){const t=new Mce(e);return s.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function Z3t(s,e,t,i){const n=Kit(s,e);s.logService.trace(`${n} 1/6. invoking socketFactory.connect().`);let o;try{o=await X3t(s.logService,s.remoteSocketFactoryService,s.connectTo,E8.getServerRootPath(),`reconnectionToken=${s.reconnectionToken}&reconnection=${s.reconnectionProtocol?"true":"false"}`,xAe(e),`renderer-${xAe(e)}-${s.reconnectionToken}`,i)}catch(d){throw s.logService.error(`${n} socketFactory.connect() failed or timed out. Error:`),s.logService.error(d),d}s.logService.trace(`${n} 2/6. socketFactory.connect() was successful.`);let r,a;s.reconnectionProtocol?(s.reconnectionProtocol.beginAcceptReconnection(o,null),r=s.reconnectionProtocol,a=!1):(r=new Q3t({socket:o}),a=!0),s.logService.trace(`${n} 3/6. sending AuthRequest control message.`);const c=await Due(s.signService.createNewMessage(ar()),i),l={type:"auth",auth:s.connectionToken||"00000000000000000000",data:c.data};r.sendControl($e.fromString(JSON.stringify(l)));try{const d=await J3t(r,Y3t(i,Vit(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(s.logService.trace(`${n} 4/6. received SignRequest control message.`),!await Due(s.signService.validate(c,d.signedData),i)){const p=new Error("Refused to connect to unsupported server");throw p.code="VSCODE_CONNECTION_ERROR",p}const u=await Due(s.signService.sign(d.data),i),f={type:"connectionType",commit:s.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),s.logService.trace(`${n} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl($e.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(s.logService.error(`${n} the handshake timed out. Error:`),s.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(s.logService.error(`${n} received error control message when negotiating connection. Error:`),s.logService.error(d)),a&&HNe(r),d}}async function e9t(s,e,t,i){const n=Date.now(),o=Kit(s,e),{protocol:r,ownsProtocol:a}=await Z3t(s,e,t,i),c=new Mce(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=Git(d);h?(s.logService.error(`${o} received error control message when negotiating connection. Error:`),s.logService.error(h),a&&HNe(r),c.reject(h)):(s.reconnectionProtocol?.endAcceptReconnection(),s.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${h9t(n)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function zit(s,e,t){const{protocol:i,firstMessage:n}=await e9t(s,WT.ExtensionHost,e,t),o=n&&n.debugPort;return{protocol:i,debugPort:o}}async function $it(s,e,t){const{connectTo:i,connectionToken:n}=await s.addressProvider.getAddress();return{commit:s.commit,quality:s.quality,connectTo:i,connectionToken:n,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:s.remoteSocketFactoryService,signService:s.signService,logService:s.logService}}async function t9t(s,e){return i9t(s,async t=>{const{protocol:i,debugPort:n}=await zit(t,e,He.None);return new c9t(s,e,t.reconnectionToken,i,n)})}async function i9t(s,e){for(let i=1;;i++)try{const n=ar(),o=await $it(s,n,null);return await e(o)}catch(n){if(i<5)s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),s.logService.error(n);else throw s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),s.logService.error(n),Eee.triggerPermanentFailure(0,0,fD.isHandled(n)),n}}function n9t(s){return Rr(e=>new Promise((t,i)=>{const n=setTimeout(t,s*1e3);e.onCancellationRequested(()=>{clearTimeout(n),t()})}))}var lI;(function(s){s[s.ConnectionLost=0]="ConnectionLost",s[s.ReconnectionWait=1]="ReconnectionWait",s[s.ReconnectionRunning=2]="ReconnectionRunning",s[s.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",s[s.ConnectionGain=4]="ConnectionGain"})(lI||(lI={}));class s9t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=lI.ConnectionLost}}class o9t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=n,this.type=lI.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class r9t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=lI.ReconnectionRunning}}class H5e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=lI.ConnectionGain}}class a9t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=n,this.type=lI.ReconnectionPermanentFailure}}const Eg=class Eg extends V{static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(n=>n._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}get _isPermanentFailure(){return this._permanentFailure||Eg._permanentFailure}constructor(e,t,i,n,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=n,this._reconnectionFailureIsFatal=o,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new H5e(this.reconnectionToken,0,0)),this._register(n.onSocketClose(r=>{const a=JQ(this._connectionType,this.reconnectionToken,!0);r?r.type===Aee.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${r.hadError}).`),r.error&&this._options.logService.error(r.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${r.wasClean}, code: ${r.code}, reason: ${r.reason}).`),r.event&&this._options.logService.error(r.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(n.onSocketTimeout(r=>{const a=JQ(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${r.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${r.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${r.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Eg._instances.push(this),this._register(Ee(()=>{const r=Eg._instances.indexOf(this);r>=0&&Eg._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Eg._permanentFailureMillisSinceLastIncomingData,Eg._permanentFailureAttempt,Eg._permanentFailureHandled)}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;const e=JQ(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${e} starting reconnecting loop. You can get more information with the trace log level.`),this._onDidStateChange.fire(new s9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const n=i0){const r=n9t(n);this._onDidStateChange.fire(new o9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),n,r)),this._options.logService.info(`${e} waiting for ${n} seconds before reconnecting...`);try{await r}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new r9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await $it(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,Vit(j3t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new H5e(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(o){if(o.code==="VSCODE_CONNECTION_ERROR"){this._options.logService.error(`${e} A permanent error occurred in the reconnecting loop! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(i>360){this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(fD.isTemporarilyNotAvailable(o)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if((o.code==="ETIMEDOUT"||o.code==="ENETUNREACH"||o.code==="ECONNREFUSED"||o.code==="ECONNRESET")&&o.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(Fr(o)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(o instanceof fD){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,fD.isHandled(o));break}this._options.logService.error(`${e} An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?Eg.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new a9t(this.reconnectionToken,e,t,i)),HNe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Eg._permanentFailure=!1,Eg._permanentFailureMillisSinceLastIncomingData=0,Eg._permanentFailureAttempt=0,Eg._permanentFailureHandled=!1,Eg._instances=[];let Eee=Eg;class c9t extends Eee{constructor(e,t,i,n,o){super(WT.ExtensionHost,e,i,n,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await zit(e,this._startArguments,t)}}function HNe(s){try{s.acceptDisconnect();const e=s.getSocket();s.dispose(),e.dispose()}catch(e){vt(e)}}function Git(s){if(s&&s.type==="error"){const e=new Error(`Connection error: ${s.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function l9t(s,e){for(;s.length"u"&&(l=ar(),this._storageService.store(c,l,Ie.WORKSPACE,an.MACHINE));const d=await plt(si.origin,l),h=o.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",r).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",si.origin),u.searchParams.set("salt",l),u.toString()}}return`${ef.asBrowserUri(i).toString(!0)}${t}`}async start(){return this._protocolPromise||(this._protocolPromise=this._startInsideIframe(),this._protocolPromise.then(e=>this._protocol=e)),this._protocolPromise}async _startInsideIframe(){const e=await this._getWebWorkerExtensionHostIframeSrc(),t=this._register(new I),i=document.createElement("iframe");i.setAttribute("class","web-worker-ext-host-iframe"),i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("allow","usb; serial; hid; cross-origin-isolated;"),i.setAttribute("aria-hidden","true"),i.style.display="none";const n=ar();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${n}`);const o=new qd;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,vt(a),clearTimeout(l),this._onDidExit.fire([ez.UnexpectedError,a.message]),o.open()},h=p=>{r=p,clearTimeout(l),o.open()};if(l=setTimeout(()=>{console.warn("The Web Worker Extension Host did not start in 60s, that might be a problem.")},6e4),this._register(ue(si,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==n)return;if(p.data.error){const{name:v,message:b,stack:w}=p.data.error,y=new Error;return y.message=b,y.name=v,y.stack=w,d(ez.UnexpectedError,y)}if(p.data.type==="vscode.bootstrap.nls"){const v="vs/base/worker/workerMain.js",b=require.toUrl(v).slice(0,-v.length);i.contentWindow.postMessage({type:p.data.type,data:{baseUrl:b,workerUrl:require.toUrl(v),nls:{messages:globalThis._VSCODE_NLS_MESSAGES,language:globalThis._VSCODE_NLS_LANGUAGE}}},"*");return}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(ez.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await o.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),r.onmessage=p=>{const{data:m}=p;if(!(m instanceof ArrayBuffer)){console.warn("UNKNOWN data received",m),this._onDidExit.fire([77,"UNKNOWN data received"]);return}t.fire($e.wrap(new Uint8Array(m,0,m.byteLength)))};const f={onMessage:t.event,send:p=>{const m=p.buffer.buffer.slice(p.buffer.byteOffset,p.buffer.byteOffset+p.buffer.byteLength);r.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await M.toPromise(M.filter(e.onMessage,t=>xee(t,up.Ready))),this._isTerminating||(e.send($e.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await M.toPromise(M.filter(e.onMessage,t=>xee(t,up.Initialized))),this._isTerminating))throw xy();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(qit(up.Terminate)),super.dispose())}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let n;return i&&this._productService.commit&&!xk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,xk.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:ql,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:VRe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===qi.EMPTY?void 0:{configuration:t.configuration||void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:this.extensions.toSnapshot(),nlsBaseUrl:n,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===RA.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Wn?tv.Web:tv.Desktop}}};Dee=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,uf),_(8,hv),_(9,Em),_(10,Er),_(11,pu),_(12,$i)],Dee);class u9t{constructor(){this.capabilities=Vn.Readonly+Vn.FileReadWrite+Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw us(t.statusText,ot.Unknown)}catch(t){throw us(t,ot.Unknown)}}async stat(e){return{type:sn.File,size:0,mtime:0,ctime:0}}watch(){return V.None}writeFile(e,t,i){throw new rS}readdir(e){throw new rS}mkdir(e){throw new rS}delete(e,t){throw new rS}rename(e,t,i){throw new rS}}var DAe={exports:{}},kue={};(function(s,e){e=s.exports=Fn;var t;typeof process=="object"&&kue&&kue.NODE_DEBUG&&/\bsemver\b/i.test(kue.NODE_DEBUG)?t=function(){var K=Array.prototype.slice.call(arguments,0);K.unshift("SEMVER"),console.log.apply(console,K)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,r=e.re=[],a=e.src=[],c=0,l=c++;a[l]="0|[1-9]\\d*";var d=c++;a[d]="[0-9]+";var h=c++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=c++;a[u]="("+a[l]+")\\.("+a[l]+")\\.("+a[l]+")";var f=c++;a[f]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var p=c++;a[p]="(?:"+a[l]+"|"+a[h]+")";var m=c++;a[m]="(?:"+a[d]+"|"+a[h]+")";var v=c++;a[v]="(?:-("+a[p]+"(?:\\."+a[p]+")*))";var b=c++;a[b]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var w=c++;a[w]="[0-9A-Za-z-]+";var y=c++;a[y]="(?:\\+("+a[w]+"(?:\\."+a[w]+")*))";var C=c++,A="v?"+a[u]+a[v]+"?"+a[y]+"?";a[C]="^"+A+"$";var L="[v=\\s]*"+a[f]+a[b]+"?"+a[y]+"?",k=c++;a[k]="^"+L+"$";var P=c++;a[P]="((?:<|>)?=?)";var R=c++;a[R]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var G=c++;a[G]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[y]+"?)?)?";var Y=c++;a[Y]="[v=\\s]*("+a[R]+")(?:\\.("+a[R]+")(?:\\.("+a[R]+")(?:"+a[b]+")?"+a[y]+"?)?)?";var j=c++;a[j]="^"+a[P]+"\\s*"+a[G]+"$";var ne=c++;a[ne]="^"+a[P]+"\\s*"+a[Y]+"$";var ge=c++;a[ge]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Oe=c++;a[Oe]="(\\s*)"+a[De]+"\\s+",r[Oe]=new RegExp(a[Oe],"g");var yt="$1~",Ne=c++;a[Ne]="^"+a[De]+a[G]+"$";var lt=c++;a[lt]="^"+a[De]+a[Y]+"$";var xt=c++;a[xt]="(?:\\^)";var Ji=c++;a[Ji]="(\\s*)"+a[xt]+"\\s+",r[Ji]=new RegExp(a[Ji],"g");var Ii="$1^",ns=c++;a[ns]="^"+a[xt]+a[G]+"$";var zs=c++;a[zs]="^"+a[xt]+a[Y]+"$";var Pn=c++;a[Pn]="^"+a[P]+"\\s*("+L+")$|^$";var Xr=c++;a[Xr]="^"+a[P]+"\\s*("+A+")$|^$";var ds=c++;a[ds]="(\\s*)"+a[P]+"\\s*("+L+"|"+a[G]+")",r[ds]=new RegExp(a[ds],"g");var Zo="$1$2$3",Zr=c++;a[Zr]="^\\s*("+a[G]+")\\s+-\\s+("+a[G]+")\\s*$";var Di=c++;a[Di]="^\\s*("+a[Y]+")\\s+-\\s+("+a[Y]+")\\s*$";var ss=c++;a[ss]="(<|>)?=?\\s*\\*";for(var Oo=0;Ooi)return null;var T=de?r[k]:r[C];if(!T.test(K))return null;try{return new Fn(K,de)}catch{return null}}e.valid=Ba;function Ba(K,de){var T=Tn(K,de);return T?T.version:null}e.clean=vd;function vd(K,de){var T=Tn(K.trim().replace(/^[=v]+/,""),de);return T?T.version:null}e.SemVer=Fn;function Fn(K,de){if(K instanceof Fn){if(K.loose===de)return K;K=K.version}else if(typeof K!="string")throw new TypeError("Invalid Version: "+K);if(K.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Fn))return new Fn(K,de);t("SemVer",K,de),this.loose=de;var T=K.trim().match(de?r[k]:r[C]);if(!T)throw new TypeError("Invalid Version: "+K);if(this.raw=K,this.major=+T[1],this.minor=+T[2],this.patch=+T[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");T[4]?this.prerelease=T[4].split(".").map(function(ie){if(/^[0-9]+$/.test(ie)){var ye=+ie;if(ye>=0&&ye=0;)typeof this.prerelease[T]=="number"&&(this.prerelease[T]++,T=-2);T===-1&&this.prerelease.push(0)}de&&(this.prerelease[0]===de?isNaN(this.prerelease[1])&&(this.prerelease=[de,0]):this.prerelease=[de,0]);break;default:throw new Error("invalid increment argument: "+K)}return this.format(),this.raw=this.version,this},e.inc=th;function th(K,de,T,ie){typeof T=="string"&&(ie=T,T=void 0);try{return new Fn(K,T).inc(de,ie).version}catch{return null}}e.diff=pc;function pc(K,de){if(ml(K,de))return null;var T=Tn(K),ie=Tn(de);if(T.prerelease.length||ie.prerelease.length){for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ie[ye])return"pre"+ye;return"prerelease"}for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ie[ye])return ye}e.compareIdentifiers=$s;var zc=/^[0-9]+$/;function $s(K,de){var T=zc.test(K),ie=zc.test(de);return T&&ie&&(K=+K,de=+de),T&&!ie?-1:ie&&!T?1:Kde?1:0}e.rcompareIdentifiers=tc;function tc(K,de){return $s(de,K)}e.major=fl;function fl(K,de){return new Fn(K,de).major}e.minor=ih;function ih(K,de){return new Fn(K,de).minor}e.patch=gg;function gg(K,de){return new Fn(K,de).patch}e.compare=mc;function mc(K,de,T){return new Fn(K,T).compare(new Fn(de,T))}e.compareLoose=$c;function $c(K,de){return mc(K,de,!0)}e.rcompare=nh;function nh(K,de,T){return mc(de,K,T)}e.sort=Dc;function Dc(K,de){return K.sort(function(T,ie){return e.compare(T,ie,de)})}e.rsort=pl;function pl(K,de){return K.sort(function(T,ie){return e.rcompare(T,ie,de)})}e.gt=ic;function ic(K,de,T){return mc(K,de,T)>0}e.lt=Or;function Or(K,de,T){return mc(K,de,T)<0}e.eq=ml;function ml(K,de,T){return mc(K,de,T)===0}e.neq=sh;function sh(K,de,T){return mc(K,de,T)!==0}e.gte=oh;function oh(K,de,T){return mc(K,de,T)>=0}e.lte=Gc;function Gc(K,de,T){return mc(K,de,T)<=0}e.cmp=Kc;function Kc(K,de,T,ie){var ye;switch(de){case"===":typeof K=="object"&&(K=K.version),typeof T=="object"&&(T=T.version),ye=K===T;break;case"!==":typeof K=="object"&&(K=K.version),typeof T=="object"&&(T=T.version),ye=K!==T;break;case"":case"=":case"==":ye=ml(K,T,ie);break;case"!=":ye=sh(K,T,ie);break;case">":ye=ic(K,T,ie);break;case">=":ye=oh(K,T,ie);break;case"<":ye=Or(K,T,ie);break;case"<=":ye=Gc(K,T,ie);break;default:throw new TypeError("Invalid operator: "+de)}return ye}e.Comparator=Wa;function Wa(K,de){if(K instanceof Wa){if(K.loose===de)return K;K=K.value}if(!(this instanceof Wa))return new Wa(K,de);t("comparator",K,de),this.loose=de,this.parse(K),this.semver===Bo?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Bo={};Wa.prototype.parse=function(K){var de=this.loose?r[Pn]:r[Xr],T=K.match(de);if(!T)throw new TypeError("Invalid comparator: "+K);this.operator=T[1],this.operator==="="&&(this.operator=""),T[2]?this.semver=new Fn(T[2],this.loose):this.semver=Bo},Wa.prototype.toString=function(){return this.value},Wa.prototype.test=function(K){return t("Comparator.test",K,this.loose),this.semver===Bo?!0:(typeof K=="string"&&(K=new Fn(K,this.loose)),Kc(K,this.operator,this.semver,this.loose))},Wa.prototype.intersects=function(K,de){if(!(K instanceof Wa))throw new TypeError("a Comparator is required");var T;if(this.operator==="")return T=new Is(K.value,de),Ph(this.value,T,de);if(K.operator==="")return T=new Is(this.value,de),Ph(K.semver,T,de);var ie=(this.operator===">="||this.operator===">")&&(K.operator===">="||K.operator===">"),ye=(this.operator==="<="||this.operator==="<")&&(K.operator==="<="||K.operator==="<"),O=this.semver.version===K.semver.version,$=(this.operator===">="||this.operator==="<=")&&(K.operator===">="||K.operator==="<="),se=Kc(this.semver,"<",K.semver,de)&&(this.operator===">="||this.operator===">")&&(K.operator==="<="||K.operator==="<"),Ke=Kc(this.semver,">",K.semver,de)&&(this.operator==="<="||this.operator==="<")&&(K.operator===">="||K.operator===">");return ie||ye||O&&$||se||Ke},e.Range=Is;function Is(K,de){if(K instanceof Is)return K.loose===de?K:new Is(K.raw,de);if(K instanceof Wa)return new Is(K.value,de);if(!(this instanceof Is))return new Is(K,de);if(this.loose=de,this.raw=K,this.set=K.split(/\s*\|\|\s*/).map(function(T){return this.parseRange(T.trim())},this).filter(function(T){return T.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+K);this.format()}Is.prototype.format=function(){return this.range=this.set.map(function(K){return K.join(" ").trim()}).join("||").trim(),this.range},Is.prototype.toString=function(){return this.range},Is.prototype.parseRange=function(K){var de=this.loose;K=K.trim(),t("range",K,de);var T=de?r[Di]:r[Zr];K=K.replace(T,Ha),t("hyphen replace",K),K=K.replace(r[ds],Zo),t("comparator trim",K,r[ds]),K=K.replace(r[Oe],yt),K=K.replace(r[Ji],Ii),K=K.split(/\s+/).join(" ");var ie=de?r[Pn]:r[Xr],ye=K.split(" ").map(function(O){return Nh(O,de)}).join(" ").split(/\s+/);return this.loose&&(ye=ye.filter(function(O){return!!O.match(ie)})),ye=ye.map(function(O){return new Wa(O,de)}),ye},Is.prototype.intersects=function(K,de){if(!(K instanceof Is))throw new TypeError("a Range is required");return this.set.some(function(T){return T.every(function(ie){return K.set.some(function(ye){return ye.every(function(O){return ie.intersects(O,de)})})})})},e.toComparators=kc;function kc(K,de){return new Is(K,de).set.map(function(T){return T.map(function(ie){return ie.value}).join(" ").trim().split(" ")})}function Nh(K,de){return t("comp",K),K=xe(K,de),t("caret",K),K=Aa(K,de),t("tildes",K),K=zn(K,de),t("xrange",K),K=Wo(K,de),t("stars",K),K}function be(K){return!K||K.toLowerCase()==="x"||K==="*"}function Aa(K,de){return K.trim().split(/\s+/).map(function(T){return ee(T,de)}).join(" ")}function ee(K,de){var T=de?r[lt]:r[Ne];return K.replace(T,function(ie,ye,O,$,se){t("tilde",K,ie,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":se?(t("replaceTilde pr",se),se.charAt(0)!=="-"&&(se="-"+se),Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0"):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0",t("tilde return",Ke),Ke})}function xe(K,de){return K.trim().split(/\s+/).map(function(T){return gt(T,de)}).join(" ")}function gt(K,de){t("caret",K,de);var T=de?r[zs]:r[ns];return K.replace(T,function(ie,ye,O,$,se){t("caret",K,ie,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?ye==="0"?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+".0 <"+(+ye+1)+".0.0":se?(t("replaceCaret pr",se),se.charAt(0)!=="-"&&(se="-"+se),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+se+" <"+(+ye+1)+".0.0"):(t("no pr"),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+" <"+(+ye+1)+".0.0"),t("caret return",Ke),Ke})}function zn(K,de){return t("replaceXRanges",K,de),K.split(/\s+/).map(function(T){return Cs(T,de)}).join(" ")}function Cs(K,de){K=K.trim();var T=de?r[ne]:r[j];return K.replace(T,function(ie,ye,O,$,se,Ke){t("xRange",K,ie,ye,O,$,se,Ke);var Bi=be(O),Wi=Bi||be($),ta=Wi||be(se),Pl=ta;return ye==="="&&Pl&&(ye=""),Bi?ye===">"||ye==="<"?ie="<0.0.0":ie="*":ye&&Pl?(Wi&&($=0),ta&&(se=0),ye===">"?(ye=">=",Wi?(O=+O+1,$=0,se=0):ta&&($=+$+1,se=0)):ye==="<="&&(ye="<",Wi?O=+O+1:$=+$+1),ie=ye+O+"."+$+"."+se):Wi?ie=">="+O+".0.0 <"+(+O+1)+".0.0":ta&&(ie=">="+O+"."+$+".0 <"+O+"."+(+$+1)+".0"),t("xRange return",ie),ie})}function Wo(K,de){return t("replaceStars",K,de),K.trim().replace(r[ss],"")}function Ha(K,de,T,ie,ye,O,$,se,Ke,Bi,Wi,ta,Pl){return be(T)?de="":be(ie)?de=">="+T+".0.0":be(ye)?de=">="+T+"."+ie+".0":de=">="+de,be(Ke)?se="":be(Bi)?se="<"+(+Ke+1)+".0.0":be(Wi)?se="<"+Ke+"."+(+Bi+1)+".0":ta?se="<="+Ke+"."+Bi+"."+Wi+"-"+ta:se="<="+se,(de+" "+se).trim()}Is.prototype.test=function(K){if(!K)return!1;typeof K=="string"&&(K=new Fn(K,this.loose));for(var de=0;de0){var ie=K[T].semver;if(ie.major===de.major&&ie.minor===de.minor&&ie.patch===de.patch)return!0}return!1}return!0}e.satisfies=Ph;function Ph(K,de,T){try{de=new Is(de,T)}catch{return!1}return de.test(K)}e.maxSatisfying=le;function le(K,de,T){var ie=null,ye=null;try{var O=new Is(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===-1)&&(ie=$,ye=new Fn(ie,T))}),ie}e.minSatisfying=dr;function dr(K,de,T){var ie=null,ye=null;try{var O=new Is(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===1)&&(ie=$,ye=new Fn(ie,T))}),ie}e.validRange=io;function io(K,de){try{return new Is(K,de).range||"*"}catch{return null}}e.ltr=un;function un(K,de,T){return rt(K,de,"<",T)}e.gtr=Se;function Se(K,de,T){return rt(K,de,">",T)}e.outside=rt;function rt(K,de,T,ie){K=new Fn(K,ie),de=new Is(de,ie);var ye,O,$,se,Ke;switch(T){case">":ye=ic,O=Gc,$=Or,se=">",Ke=">=";break;case"<":ye=Or,O=oh,$=ic,se="<",Ke="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ph(K,de,ie))return!1;for(var Bi=0;Bi=0.0.0")),ta=ta||fg,Pl=Pl||fg,ye(fg.semver,ta.semver,ie)?ta=fg:$(fg.semver,Pl.semver,ie)&&(Pl=fg)}),ta.operator===se||ta.operator===Ke||(!Pl.operator||Pl.operator===se)&&O(K,Pl.semver))return!1;if(Pl.operator===Ke&&$(K,Pl.semver))return!1}return!0}e.prerelease=Ft;function Ft(K,de){var T=Tn(K,de);return T&&T.prerelease.length?T.prerelease:null}e.intersects=Ci;function Ci(K,de,T){return K=new Is(K,T),de=new Is(de,T),K.intersects(de)}e.coerce=Ot;function Ot(K){if(K instanceof Fn)return K;if(typeof K!="string")return null;var de=K.match(r[ge]);return de==null?null:Tn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(DAe,DAe.exports);var jW=DAe.exports;function g9t(s,e,t,i,n){const o=new va;return s.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),e.forEach(r=>{const a=o.get(r.identifier);if(a)if(a.isBuiltin){if(jW.gte(a.version,r.version)){n.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){n.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4826,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{n.info(g(4827,"Loading development extension at {0}",r.extensionLocation.fsPath));const a=o.get(r.identifier);a&&a.isBuiltin&&(r.isBuiltin=!0),o.set(r.identifier,r)}),Array.from(o.values())}let kAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=n,this._environmentService=o,this._telemetryService=r,this._logService=a,this._loggerService=c,this._labelService=l,this.remoteAuthorityResolverService=d,this._extensionHostDebugService=h,this._productService=u,this._signService=f,this.pid=null,this.startup=RA.EagerAutoStart,this.extensions=null,this._onExit=this._register(new I),this.onExit=this._onExit.event,this.remoteAuthority=this._initDataProvider.remoteAuthority,this._protocol=null,this._hasLostConnection=!1,this._terminating=!1;const p=FNe(this._environmentService);this._isExtensionDevHost=p.isExtensionDevHost}start(){const e={commit:this._productService.commit,quality:this._productService.quality,addressProvider:{getAddress:async()=>{const{authority:t}=await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);return{connectTo:t.connectTo,connectionToken:t.connectionToken}}},remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this._signService,logService:this._logService,ipcLogger:null};return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then(t=>{const i={language:ql,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},n=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return n&&n.length>0&&n[0].scheme===pe.file&&(o=!1),o||(i.break=!1),t9t(e,i).then(r=>{this._register(r);const{protocol:a,debugPort:c,reconnectionToken:l}=r,d=typeof c=="number";return o&&this._environmentService.isExtensionDevelopment&&this._environmentService.debugExtensionHost.debugId&&c&&this._extensionHostDebugService.attachSession(this._environmentService.debugExtensionHost.debugId,c,this._initDataProvider.remoteAuthority),a.onDidDispose(()=>{this._onExtHostConnectionLost(l)}),a.onSocketClose(()=>{this._isExtensionDevHost&&this._onExtHostConnectionLost(l)}),new Promise((h,u)=>{const f=setTimeout(()=>{u("The remote extension host took longer than 60s to send its ready message.")},6e4),p=a.onMessage(m=>{if(xee(m,up.Ready)){this._createExtHostInitData(d).then(v=>{a.send($e.fromString(JSON.stringify(v)))});return}if(xee(m,up.Initialized)){clearTimeout(f),p.dispose(),this._protocol=a,h(a);return}console.error("received unexpected message during handshake phase from the extension host: ",m)})})})})}_onExtHostConnectionLost(e){this._hasLostConnection||(this._hasLostConnection=!0,this._isExtensionDevHost&&this._environmentService.debugExtensionHost.debugId&&this._extensionHostDebugService.close(this._environmentService.debugExtensionHost.debugId),!this._terminating&&this._onExit.fire([0,e]))}async _createExtHostInitData(e){const t=await this._initDataProvider.getInitData();this.extensions=t.extensions;const i=this._contextService.getWorkspace();return{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:t.pid,environment:{isExtensionDevelopmentDebug:e,appRoot:t.appRoot,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier||"desktop",appUriScheme:this._productService.urlProtocol,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:VRe(this._productService,this._environmentService),appLanguage:ql,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===qi.EMPTY?null:{configuration:i.configuration,id:i.id,name:this._labelService.getWorkspaceLabel(i),transient:i.transient},remote:{isRemote:!0,authority:this._initDataProvider.remoteAuthority,connectionData:t.connectionData},consoleForward:{includeStack:!1,logNative:!!this._environmentService.debugExtensionHost.debugId},extensions:this.extensions.toSnapshot(),telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:t.extensionHostLogsPath,autoStart:this.startup===RA.EagerAutoStart,uiKind:Wn?tv.Web:tv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(qit(up.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};kAe=D([_(2,URe),_(3,yi),_(4,Jr),_(5,Yi),_(6,Ge),_(7,uf),_(8,Fs),_(9,pC),_(10,lJe),_(11,Er),_(12,fJe)],kAe);var IAe;let TAe=class extends _Ae{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P,R){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,v,b,w,y,C,R),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=A,this._userDataProfileService=L,this._workspaceTrustManagementService=k,this._remoteExplorerService=P,y.when(Rs.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}_initFetchFileSystem(){const e=new u9t;this._register(this._fileService.registerProvider(pe.http,e)),this._register(this._fileService.registerProvider(pe.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(n=>e.push(...n.map(o=>dD(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(n=>t.push(...n.map(o=>dD(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(n=>i.push(...n.map(o=>dD(o,!0))))])}catch(n){this._logService.error(n)}return g9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new x3t(e,t,!1,!0)}async _resolveExtensions(){if(!this._browserEnvironmentService.expectsResolverExtension)return this._resolveExtensionsDefault();const e=this._environmentService.remoteAuthority;await this._workspaceTrustManagementService.workspaceResolved;let t;try{t=await this._resolveAuthorityInitial(e)}catch(n){return fD.isHandled(n)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,n),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async n=>{n.type===lI.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=si;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await H3t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(lo.LocalWebWorker,e)}};TAe=D([_(3,we),_(4,bi),_(5,hv),_(6,Yi),_(7,Nl),_(8,Jt),_(9,Er),_(10,P6),_(11,yi),_(12,Te),_(13,Im),_(14,rMe),_(15,Ge),_(16,hg),_(17,Bae),_(18,ig),_(19,pC),_(20,tce),_(21,ug),_(22,uC),_(23,Xae),_(24,to)],TAe);let LAe=class{constructor(e,t,i,n,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=n,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case lo.LocalProcess:return null;case lo.LocalWebWorker:{const n=i?RA.EagerManualStart:RA.EagerAutoStart;return this._instantiationService.createInstance(Dee,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case lo.Remote:{const n=this._remoteAgentService.getConnection();return n?this._instantiationService.createInstance(kAe,t,this._createRemoteExtensionHostDataProvider(e,n.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const n=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(n,[],!1),r=jQ(n,o,c=>t.equals(c));return{extensions:new Jq(0,n,r.map(c=>c.identifier))}}else{const n=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(n.extensions,t);return{extensions:new Jq(n.versionId,n.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),n=await this._remoteAgentService.getEnvironment();if(!n)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,lo.Remote),r=new Jq(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:n.pid,appRoot:n.appRoot,extensionHostLogsPath:n.extensionHostLogsPath,globalStorageHome:n.globalStorageHome,workspaceStorageHome:n.workspaceStorageHome,extensions:r}}}}};LAe=D([_(3,we),_(4,hg),_(5,pC),_(6,Nl),_(7,Ge)],LAe);let RAe=IAe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,n,o){const r=IAe.pickRunningLocation(t,i,n,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${n}, preference: ${V8t(o)} => ${pS(r)}`),r}static pickRunningLocation(e,t,i,n){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(n===Qg.Remote)return lo.Remote;r=!0}if(a==="workspace"&&i){if(n===Qg.None||n===Qg.Remote)return lo.Remote;o.push(lo.Remote)}if(a==="web"&&(t||i)){if(n===Qg.None||n===Qg.Local)return lo.LocalWebWorker;o.push(lo.LocalWebWorker)}}return r&&o.push(lo.Remote),o.length>0?o[0]:null}};RAe=IAe=D([_(0,Ge)],RAe);async function f9t(s,e,t){let i=t&&t.get("storage.serviceMachineId",Ie.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(s.serviceMachineIdResource)).value.toString();i=CEt(o)?o:null}catch{i=null}if(!i){i=ar();try{await e.writeFile(s.serviceMachineIdResource,$e.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,Ie.APPLICATION,an.MACHINE),i}const p9t="/web-extension-resource/";class m9t{constructor(e,t,i,n,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=n,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(N.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:n},o){if(this._extensionGalleryResourceUrlTemplate){const r=N.parse(efe(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:n!==void 0&&n!==Es.UNDEFINED&&n!==Es.UNKNOWN&&n!==Es.UNIVERSAL?`${i}+${n}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:E8.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Wn?"-web":""}`,"X-Client-Version":this._productService.version};return Yq(this._productService,this._environmentService)&&H1t(this._configurationService)===Kg.USAGE&&(e["X-Machine-Id"]=await this._getServiceMachineId()),this._productService.commit&&(e["X-Client-Commit"]=this._productService.commit),e}_getServiceMachineId(){return this._serviceMachineIdPromise||(this._serviceMachineIdPromise=f9t(this._environmentService,this._fileService,this._storageService)),this._serviceMachineIdPromise}_getExtensionGalleryAuthority(e){if(this._isWebExtensionResourceEndPoint(e))return e.authority;const t=e.authority.indexOf(".");return t!==-1?e.authority.substring(t+1):void 0}_isWebExtensionResourceEndPoint(e){const t=e.path,i=E8.getServerRootPath();return t.startsWith(i)&&t.startsWith(p9t,i.length)}}let MAe=class extends m9t{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._logService=r}async readExtensionResource(e){if(e=ef.uriToBrowserUri(e),e.scheme!==pe.http&&e.scheme!==pe.https&&e.scheme!==pe.data)return(await this._fileService.readFile(e)).value.toString();const t={};this.isExtensionGalleryResource(e)&&(t.headers=await this.getExtensionGalleryRequestHeaders(),t.mode="cors");const i=await fetch(e.toString(!0),t);if(i.status!==200)throw this._logService.info(`Request to '${e.toString(!0)}' failed with status code ${i.status}`),new Error(i.statusText);return i.text()}};MAe=D([_(0,Jt),_(1,$i),_(2,Er),_(3,Za),_(4,Te),_(5,Ge)],MAe);var VP,NAe;class tz{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new tz(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,n=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=n}}var OR;let PAe=(OR=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const n=t.get(VP._storageKey,Ie.APPLICATION);if(this._state=tz.fromJSON(n),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&aRa({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(n=>n.identifier.id),i=new tz(t,0,t.length,0);this._storageService.store(VP._storageKey,JSON.stringify(i),Ie.APPLICATION,an.MACHINE),await this._storageService.flush()}async next(e){if(!this._state)throw new Error("invalid state");if(e&&this._state.mid===0&&this._state.high===this._state.extensions.length)return{bad:!0,id:""};if(this._state.low===this._state.high-1)return await this.reset(),{id:this._state.extensions[this._state.low],bad:e};const t=new tz(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(VP._storageKey,JSON.stringify(t),Ie.APPLICATION,an.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(VP._storageKey,Ie.APPLICATION),await this._storageService.flush()}},VP=OR,OR._storageKey="extensionBisectState",OR);PAe=VP=D([_(0,Ge),_(1,$i),_(2,Jr)],PAe);var BR;let YW=(BR=class{constructor(e,t,i,n){this._extensionBisectService=t,this._notificationService=i,this._commandService=n,t.isActive&&(NAe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(1138,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(1139,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},n=this._extensionBisectService.disabledCount===1?g(1140,"Extension Bisect is active and has disabled 1 extension. Check if you can still reproduce the problem and proceed by selecting from these options."):g(1141,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",this._extensionBisectService.disabledCount);this._notificationService.prompt(Xe.Info,n,[e,t,i],{sticky:!0,priority:K2.URGENT})}},NAe=BR,BR.ctxIsBisectActive=new Q("isExtensionBisectActive",!1),BR);YW=NAe=D([_(0,Le),_(1,WU),_(2,bi),_(3,vi)],YW);Qe.as(cf.Workbench).registerWorkbenchContribution(YW,Rs.Restored);At(class extends li{constructor(){super({id:"extension.bisect.start",title:Pe(1142,"Start Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive.negate(),menu:{id:_e.ViewContainerTitle,when:he.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(s){const e=s.get(to),t=s.get(xc),i=s.get(k6),n=s.get(Nl),o=s.get(WU),r=(await i.getInstalled(br.User)).filter(c=>n.isEnabled(c));(await e.confirm({message:g(1143,"Extension Bisect"),detail:g(1144,"Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~{0} times). Each time you must confirm if you are still seeing problems.",2+Math.log2(r.length)|0),primaryButton:g(1145,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends li{constructor(){super({id:"extension.bisect.next",title:Pe(1146,"Continue Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive})}async run(s,e){const t=s.get(to),i=s.get(xc),n=s.get(WU),o=s.get(Er),r=s.get(dJe),a=s.get(vi);if(!n.isActive)return;if(e===void 0){const l=await this._checkForBad(t,n);if(l===null)return;e=l}if(e===void 0){await n.reset(),i.reload();return}const c=await n.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(1147,"Extension Bisect"),g(1148,"Extension Bisect is done but no extension has been identified. This might be a problem with {0}.",o.nameShort));else{const l=await t.confirm({type:Xe.Info,message:g(1147,"Extension Bisect"),primaryButton:g(1149,"&&Report Issue & Continue"),cancelButton:g(1150,"Continue"),detail:g(1151,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(1152,"Keep this extension disabled"),checked:!0}});l.checkboxChecked&&await r.disableExtension({id:c.id},void 0),l.confirmed&&await a.executeCommand("workbench.action.openIssueReporter",c.id)}await n.reset(),i.reload()}async _checkForBad(s,e){const{result:t}=await s.prompt({type:Xe.Info,message:g(1153,"Extension Bisect"),detail:g(1154,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",e.disabledCount),buttons:[{label:g(1155,"I ca&&n't reproduce"),run:()=>!1},{label:g(1156,"I can &&reproduce"),run:()=>!0},{label:g(1157,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(1158,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends li{constructor(){super({id:"extension.bisect.stop",title:Pe(1159,"Stop Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive})}async run(s){const e=s.get(WU),t=s.get(xc);await e.reset(),t.reload()}});function _9t(s,e){return s}function v9t(s){for(const[e,t]of Object.entries(s))ef.registerAppResourcePathUrl(e,t)}function kee(s){switch(s){case Ho.InvalidSymbol:return g(1162,"Invalid symbol");case Ho.InvalidNumberFormat:return g(1163,"Invalid number format");case Ho.PropertyNameExpected:return g(1164,"Property name expected");case Ho.ValueExpected:return g(1165,"Value expected");case Ho.ColonExpected:return g(1166,"Colon expected");case Ho.CommaExpected:return g(1167,"Comma expected");case Ho.CloseBraceExpected:return g(1168,"Closing brace expected");case Ho.CloseBracketExpected:return g(1169,"Closing bracket expected");case Ho.EndOfFileExpected:return g(1170,"End of file expected");default:return""}}const Qit=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,b9t=/^-(\d{4})(\d{2})(\d{2})$/;function w9t(s){return s=s.trim(),s==="*"||Qit.test(s)}function x9(s){if(!w9t(s))return null;if(s=s.trim(),s==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=s.match(Qit);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function D9(s){if(!s)return null;const e=s.majorBase,t=s.majorMustEqual,i=s.minorBase;let n=s.minorMustEqual;const o=s.patchBase;let r=s.patchMustEqual;s.hasCaret&&(e===0||(n=!1),r=!1);let a=0;if(s.preRelease){const c=b9t.exec(s.preRelease);if(c){const[,l,d,h]=c;a=Date.UTC(Number(l),Number(d)-1,Number(h))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:n,patchBase:o,patchMustEqual:r,isMinimum:s.hasGreaterEquals,notBefore:a}}function y9t(s,e,t){let i;typeof s=="string"?i=D9(x9(s)):i=s;let n;e instanceof Date?n=e.getTime():typeof e=="string"&&(n=new Date(e).getTime());let o;if(typeof t=="string"?o=D9(x9(t)):o=t,!i||!o)return!1;const r=i.majorBase,a=i.minorBase,c=i.patchBase;let l=o.majorBase,d=o.minorBase,h=o.patchBase;const u=o.notBefore;let f=o.majorMustEqual,p=o.minorMustEqual,m=o.patchMustEqual;return o.isMinimum?r>l?!0:rd?!0:a=h:(r===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),rl?!f:ad?!p:ch?!m:!(n&&n"u"&&typeof i.browser>"u")return r.push([Xe.Error,g(1178,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),r}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&r.push([Xe.Warning,g(1179,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return r.push([Xe.Error,g(1180,"property `{0}` can be omitted or must be of type `string`","main")]),r;{const l=Pt(t,i.main);qy(l,t)||r.push([Xe.Warning,g(1181,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return r.push([Xe.Error,g(1182,"property `{0}` can be omitted or must be of type `string`","browser")]),r;{const l=Pt(t,i.browser);qy(l,t)||r.push([Xe.Warning,g(1183,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(!jW.valid(i.version))return r.push([Xe.Error,g(1184,"Extension version is not semver compatible.")]),r;const a=[];if(!S9t(s,e,i,n,a))for(const l of a)r.push([Xe.Error,l]);if(o&&i.enabledApiProposals?.length){const l=[];if(!A9t([...i.enabledApiProposals],l))for(const d of l)r.push([Xe.Error,d])}return r}function S9t(s,e,t,i,n){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:E9t(s,e,t.engines.vscode,n)}function A9t(s,e){if(s.length===0)return!0;const t=Array.isArray(e)?e:void 0,i=(t?void 0:e)??RM,n=[],o=XIt(s);for(const{proposalName:r,version:a}of o){const c=i[r];c&&a&&c.version!==a&&n.push(g(1185,"Extension is using an API proposal '{0}' that is not compatible with the current version of VS Code.",r))}return t?.push(...n),n.length===0}function E9t(s,e,t,i=[]){const n=D9(x9(t));if(!n)return i.push(g(1186,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(n.majorBase===0){if(!n.majorMustEqual||!n.minorMustEqual)return i.push(g(1187,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions before 1.0.0, please define at a minimum the major and minor desired version. E.g. ^0.10.0, 0.10.x, 0.11.0, etc.",t)),!1}else if(!n.majorMustEqual)return i.push(g(1188,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions after 1.0.0, please define at a minimum the major desired version. E.g. ^1.10.0, 1.10.x, 1.x.x, 2.x.x, etc.",t)),!1;return y9t(s,e,n)?!0:(i.push(g(1189,"Extension is not compatible with Code {0}. Extension requires: {1}.",s,t)),!1)}function U5e(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>Ra(l.identifier,c.identifier)&&l.manifest.version!==c.version)?n.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>Ra(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(o.push(h),a.push(h)):a.splice(d,1,h)}return o.length&&this._onAddExtensions.fire({extensions:o,profileLocation:t}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,n=>{const o=[];for(const r of n){const a=e.find(([c])=>Ra(c.identifier,r.identifier)&&c.manifest.version===r.version);a&&(r.metadata={...r.metadata,...a[1]},i.push(r)),o.push(r)}return o}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,n=>{const o=[];for(const r of n)Ra(r.identifier,e.identifier)?i.push(r):o.push(r);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),o}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:t})}catch(n){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:n,profileLocation:t}),n}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let n=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if($w(r)!==Qi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Iee(su(r),JW.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){z5e(a)||this.reportAndThrowInvalidConentError(e);let c;if(Lt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(Lt(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=N.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}Ya(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),n.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,$e.fromString(JSON.stringify(o)))}if(t){n=t(n);const r=n.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.toRelativePath(a.location),metadata:a.metadata}));await this.fileService.writeFile(e,$e.fromString(JSON.stringify(r)))}return n})}reportAndThrowInvalidConentError(e){const t=new Iee(`Invalid extensions content in ${e.toString()}`,JW.ERROR_INVALID_CONTENT);throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:t.code}),t}toRelativePath(e){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(e),this.extensionsLocation)?this.uriIdentityService.extUri.basename(e):void 0}resolveExtensionLocation(e){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,e)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{const e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),t=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let i;try{i=(await this.fileService.readFile(e)).value.toString()}catch(o){if($w(o)===Qi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let n;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>z5e(r))?n=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(n)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,$e.fromString(JSON.stringify(n)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(o){if($w(o)===Qi.FILE_MODIFIED_SINCE)this.logService.info("Migration from old default profile location to new location is done by another window",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw o}try{await this.fileService.del(e)}catch(o){$w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){$w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}return n})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new bI,this.resourcesAccessQueueMap.set(e,t)),t}};V5e=D([_(1,Jt),_(2,Em),_(3,ks),_(4,Yi),_(5,Ge)],V5e);function z5e(s){return kn(s)&&TLt(s.identifier)&&(x9t(s.location)||Lt(s.location)&&s.location)&&(Ya(s.relativeLocation)||Lt(s.relativeLocation))&&s.version&&Lt(s.version)}function x9t(s){return s?Lt(s.path)&&Lt(s.scheme):!1}function D9t(s,e,t,i){try{k9t(s,e,t,i)}catch(n){s.error(n?.message??n)}return e}function k9t(s,e,t,i){const n=(o,r,a)=>{const c=o[r];if(Lt(c)){const l=c,d=l.length;if(d>1&&l[0]==="%"&&l[d-1]==="%"){const h=l.substr(1,d-2);let u=t[h];u===void 0&&i&&(u=i[h]);const f=typeof u=="string"?u:u?.message,p=i?.[h],m=typeof p=="string"?p:p?.message;if(!f){m||s.warn(`[${e.name}]: ${g(1190,"Couldn't find message for key {0}.",h)}`);return}if(a&&(r==="title"||r==="category")&&m&&m!==f){const v={value:f,original:m};o[r]=v}else o[r]=f}}else if(kn(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?n(c,l,!0):n(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(br.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(br.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=NLt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[n,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...n,...o]):[];return this.dedupExtensions(n,o,r,await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){const t=[];t.push(this.scanDefaultSystemExtensions(!!e.useCache,e.language)),t.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));const[i,n]=await Promise.all(t);return this.applyScanOptions([...i,...n],br.System,e,!1)}async scanUserExtensions(e){const t=e.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",t);const i=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,n=await this.createExtensionScannerInput(t,!!e.profileLocation,br.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!n.devMode&&n.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(n)}catch(a){if(a instanceof Iee&&a.code===JW.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(n);else throw a}return r=await this.applyScanOptions(r,br.User,e,!0),this.logService.trace("Scanned user extensions:",r.length),r}async scanExtensionsUnderDevelopment(e,t){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const i=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(n=>n.scheme===pe.file).map(async n=>{const o=await this.createExtensionScannerInput(n,!1,br.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>Ra(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,o)))}))).flat();return this.applyScanOptions(i,"development",e,!0)}return[]}async scanExistingExtension(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(n);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(n);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const n=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);n.push(...r)})),this.applyScanOptions(n,t,i,!0)}async scanMetadata(e){const t=Pt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Pt(e,"package.json"),n=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(n);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(Pt(e,"package.json"),$e.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Iee&&e.code===JW.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions();else throw e}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const e=await this.scanUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(t=>[t,t.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,$e.fromString(JSON.stringify([])))}catch(t){$w(t)!==Qi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),su(t))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,t,i,n){return i.includeAllVersions||(e=this.dedupExtensions(t===br.System?e:void 0,t===br.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),n)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=Ko(o.location.fsPath),c=Ko(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,n,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&jW.gt(c.manifest.version,l.manifest.version))return this.logService.debug(`Skipping extension ${l.location.path} with lower version ${l.manifest.version} in favour of ${c.location.path} with version ${c.manifest.version}`),!1;if(jW.eq(c.manifest.version,l.manifest.version)){if(c.type===br.System)return this.logService.debug(`Skipping extension ${l.location.path} in favour of system extension ${c.location.path} with same version`),!1;if(c.targetPlatform===n)return this.logService.debug(`Skipping extension ${l.location.path} from different target platform ${l.targetPlatform}`),!1}}return d?this.logService.warn(`Overwriting user extension ${c.location.path} with ${l.location.path}.`):this.logService.debug(`Overwriting user extension ${c.location.path} with ${l.location.path}.`),!0},a=new va;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===br.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!0))&&a.set(c.identifier.id,c),a.set(c.identifier.id,c)}),[...a.values()]}async scanDefaultSystemExtensions(e,t){this.logService.trace("Started scanning system extensions");const i=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,br.System,!0,t,!0,void 0,this.getProductVersion()),o=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",o.length),o}async scanDevSystemExtensions(e,t){const i=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!i?.length)return[];this.logService.trace("Started scanning dev system extensions");const n=t?await this.getBuiltInExtensionControl():{},o=[],r=N.file(Rk(cfe(ef.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=n[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(Pt(r,c.name));break;default:o.push(N.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,br.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Fi(a)}async getBuiltInExtensionControl(){try{const e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,t,i,n,o,r,a,c){const l=await this.getTranslations(o??ql),d=await this.getMtime(e),h=t&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,u=h?await this.getMtime(h):void 0;return new iz(e,d,h,u,t,a,i,n,r,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,o,l)}async getMtime(e){try{const t=await this.fileService.stat(e);if(typeof t.mtime=="number")return t.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};$5e=D([_(4,Em),_(5,Pae),_(6,Jt),_(7,Ge),_(8,Za),_(9,Er),_(10,ks),_(11,we)],$5e);class iz{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=n,this.profile=o,this.profileScanOptions=r,this.type=a,this.excludeObsolete=c,this.validate=l,this.productVersion=d,this.productDate=h,this.productCommit=u,this.devMode=f,this.language=p,this.translations=m}static createNlsConfiguration(e){return{language:e.language,pseudo:e.language==="pseudo",devMode:e.devMode,translations:e.translations}}static equals(e,t){return ji(e.location,t.location)&&e.mtime===t.mtime&&ji(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Ys(e.profileScanOptions,t.profileScanOptions)&&e.type===t.type&&e.excludeObsolete===t.excludeObsolete&&e.validate===t.validate&&e.productVersion===t.productVersion&&e.productDate===t.productDate&&e.productCommit===t.productCommit&&e.devMode===t.devMode&&e.language===t.language&&FAe.equals(e.translations,t.translations)}}let OAe=class extends V{constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const n=Pt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",l?.path,kee(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=N.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=sf(d,h);return h.length>0?(o(l,h),{values:void 0,default:n}):sD(u)!=="object"?(r(l),{values:void 0,default:n}):{values:u.contents?u.contents.package:void 0,default:n}}catch{return{values:void 0,default:n}}else{if(!await this.fileService.exists(n))return;let d;try{d=await this.findMessageBundles(e,i)}catch{return}if(!d.localized)return{values:void 0,default:d.original};try{const h=(await this.fileService.readFile(d.localized)).value.toString(),u=[],f=sf(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):sD(f)!=="object"?(r(d.localized),{values:void 0,default:d.original}):{values:f,default:d.original}}catch{return{values:void 0,default:d.original}}}}async translateManifest(e,t,i){const n=await this.getLocalizedMessages(e,t,i);if(n)try{const o=[],r=await this.resolveOriginalMessageBundle(n.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",n.default?.path,kee(c.error))))}),t;if(sD(n)!=="object")return this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",n.default?.path))),t;const a=n.values||Object.create(null);return D9t(this.logService,t,a,r)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return sf(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,n)=>{const o=r=>{const a=Pt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Pt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:Pt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Pt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};OAe=D([_(0,Jt),_(1,Ge)],OAe);let Tee=class extends OAe{constructor(e,t,i,n,o,r,a){super(n,a),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i,this.environmentService=r,this.extensionsEnabledWithApiProposalVersion=o.extensionsEnabledWithApiProposalVersion?.map(c=>c.toLowerCase())??[]}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===br.User)try{const n=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(n)}catch{}return CA(i)?t:t.filter(n=>!i[N5.create(n).toString()])}async scanExtensionsFromLocation(e){const t=await this.fileService.resolve(e.location);if(!t.children?.length)return[];const i=await Promise.all(t.children.map(async n=>{if(!n.isDirectory||e.type===br.User&&_i(n.resource).indexOf(".")===0)return null;const o=new iz(n.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.excludeObsolete,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(o)}));return Fi(i).sort((n,o)=>n.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(n=>!n.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,n=>!!n.metadata?.isBuiltin||!!n.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const n=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!n.length)return[];const o=await Promise.all(n.map(async r=>{if(t(r)){const a=new iz(r.location,i.mtime,i.applicationExtensionslocation,i.applicationExtensionslocationMtime,i.profile,i.profileScanOptions,i.type,i.excludeObsolete,i.validate,i.productVersion,i.productDate,i.productCommit,i.devMode,i.language,i.translations);return this.scanExtension(a,r.metadata)}return null}));return Fi(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Pt(e.location,"package.json"))){const t=await this.scanExtension(e);return t?[t]:[]}else return await this.scanExtensions(e)}catch(t){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,su(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=qYe),t=t??i.__metadata,delete i.__metadata;const n=Iw(i.publisher,i.name),o=t?.id?{id:n,uuid:t.id}:{id:n},r=t?.isSystem?br.System:e.type,a=r===br.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,iz.createNlsConfiguration(e));let c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Es.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate&&(c=this.validate(c,e)),i.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(n.toLowerCase()))&&(i.originalEnabledApiProposals=i.enabledApiProposals,i.enabledApiProposals=ZIt([...i.enabledApiProposals])),c}}catch(i){e.type!==br.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const n=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),o=C9t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,n);for(const[r,a]of o)r===Xe.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,a)));return e.isValid=i,e.validations=o,e}async scanExtensionManifest(e){const t=Pt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return $w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(446,"Cannot read file {0}: {1}.",t.path,o.message))),null}let n;try{n=JSON.parse(i)}catch{const r=[];sf(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(447,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,kee(a.error))));return null}return sD(n)!=="object"?(this.logService.error(this.formatMessage(e,g(448,"Invalid manifest file {0}: Not a JSON object.",t.path))),null):n}};Tee=D([_(1,Pae),_(2,ks),_(3,Jt),_(4,Er),_(5,Za),_(6,Ge)],Tee);let Lee=class extends Tee{constructor(e,t,i,n,o,r,a,c,l){super(t,n,o,r,a,c,l),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new Y7(3e3)),this._onDidChangeCache=this._register(new I),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){const t=this.getCacheFile(e),i=await this.readExtensionCache(t);if(this.input=e,i&&i.input&&iz.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===br.System?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=N.revive(o.location),o));const n=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:n}),n}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Mo(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,su(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,$e.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,su(i))}}async validateCache(){if(!this.input)return;const e=this.getCacheFile(this.input),t=await this.readExtensionCache(e);if(!t)return;const i=t.result,n=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Ys(n,i))try{this.logService.info("Invalidating Cache",i,n),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(o){this.logService.error(o)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===br.System?QIt:qIt)}getProfile(e){return e.type===br.System?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(t=>this.uriIdentityService.extUri.isEqual(e.location,t.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};Lee=D([_(2,Em),_(3,Pae),_(4,ks),_(5,Jt),_(6,Er),_(7,Za),_(8,Ge)],Lee);const BAe=["W","X","Y","Z","a","b","c","d","e","f"],I9t=new RegExp(`^[${BAe.join("")}]+`),jit=7;function T9t(s){if(s.scheme!==pe.vscodeNotebookCell)return;const e=s.fragment.indexOf("s");if(e<0)return;const t=parseInt(s.fragment.substring(0,e).replace(I9t,""),jit),i=dKe(s.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:s.with({scheme:i,fragment:null})}}function L9t(s,e){const t=e.toString(jit),n=`${t.length$e.wrap(r))),o=V9t(n);return i=i||o.byteLength!==n.byteLength,{data:o,didCompression:i}}const XQ="\x1B[A",Iue=XQ.split("").map(s=>s.charCodeAt(0)),F9t=10;function O9t(s){let e=!1;return s.forEach((t,i)=>{if(i===0||t.length-1;){const e=s.match(/^(.*)\r+/m)[1];let t=s.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),s=s.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return s}const H9t=8,U9t=13;function V9t(s){return!s.buffer.includes(H9t)&&!s.buffer.includes(U9t)?s:$e.fromString(W9t(B9t(N9t.decode(s.buffer))))}var UAe,A0,AC,VAe,E0,kE,x0,zAe,$Ae,ZQ,RV,GAe,sw,ow,KAe,yg,qAe;function ki(s){return Object.assign(s,{apply:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(s,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const[i,...n]=t;return Reflect.construct(s,n,i.constructor)}}})}var Nee;(function(s){s[s.Top=0]="Top",s[s.Bottom=1]="Bottom"})(Nee||(Nee={}));var K1,f6e;let Qs=UAe=(f6e=class{constructor(e){Wt(this,K1);Ct(this,K1,e)}static from(...e){let t=e;return new UAe(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof Ce(this,K1)=="function"&&(Ce(this,K1).call(this),Ct(this,K1,void 0))}},K1=new WeakMap,f6e);Qs=UAe=D([ki],Qs);let bs=A0=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;ie.line?1:this._charactere._character?1:0}translate(e,t=0){if(e===null||t===null)throw Pi();let i;return typeof e>"u"?i=0:typeof e=="number"?i=e:(i=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),i===0&&t===0?this:new A0(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Pi();let i;return typeof e>"u"?i=this.line:typeof e=="number"?i=e:(i=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),i===this.line&&t===this.character?this:new A0(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};bs=A0=D([ki],bs);let Jn=AC=class{static isRange(e){return e instanceof AC?!0:e?bs.isPosition(e.start)&&bs.isPosition(e.end):!1}static of(e){if(e instanceof AC)return e;if(this.isRange(e))return new AC(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,i,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.of(t)),!o||!r)throw new Error("Invalid arguments");o.isBefore(r)?(this._start=o,this._end=r):(this._start=r,this._end=o)}contains(e){return AC.isRange(e)?this.contains(e.start)&&this.contains(e.end):bs.isPosition(e)?!(bs.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){const t=bs.Max(e.start,this._start),i=bs.Min(e.end,this._end);if(!t.isAfter(i))return new AC(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=bs.Min(e.start,this._start),i=bs.Max(e.end,this.end);return new AC(t,i)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw Pi();let i;return e?bs.isPosition(e)?i=e:(i=e.start||this.start,t=e.end||this.end):i=this.start,i.isEqual(this._start)&&t.isEqual(this.end)?this:new AC(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Jit(this)}};Jn=AC=D([ki],Jn);let cC=VAe=class extends Jn{static isSelection(e){return e instanceof VAe?!0:e?Jn.isRange(e)&&bs.isPosition(e.anchor)&&bs.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.of(t)),!o||!r)throw new Error("Invalid arguments");super(o,r),this._anchor=o,this._active=r}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return z9t(this)}};cC=VAe=D([ki],cC);function Jit(s){return s.isEmpty?`[${s.start.line}:${s.start.character})`:`[${s.start.line}:${s.start.character} -> ${s.end.line}:${s.end.character})`}function z9t(s){let e=Jit(s);return s.isEmpty||(s.active.isEqual(s.start)?e=`|${e}`:e=`${e}|`),e}const Xit=s=>{if(typeof s!="string"||s.length===0||!/^[0-9A-Za-z_\-]+$/.test(s))throw Pi("connectionToken")};let Zit=class{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,i){if(typeof e!="string"||e.length===0)throw Pi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Pi("port");typeof i<"u"&&Xit(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},sz=class{static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t){this.makeConnection=e,this.connectionToken=t,typeof t<"u"&&Xit(t)}},t1=class ej extends Error{static NotAvailable(e,t){return new ej(e,ed.NotAvailable,t)}static TemporarilyNotAvailable(e){return new ej(e,ed.TemporarilyNotAvailable)}constructor(e,t=ed.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,ej.prototype)}};var D_;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(D_||(D_={}));var HT;(function(s){s[s.Replace=1]="Replace",s[s.Append=2]="Append",s[s.Prepend=3]="Prepend"})(HT||(HT={}));let VA=E0=class{static isTextEdit(e){return e instanceof E0?!0:e?Jn.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new E0(e,t)}static insert(e,t){return E0.replace(new Jn(e,e),t)}static delete(e){return E0.replace(e,"")}static setEndOfLine(e){const t=new E0(new Jn(new bs(0,0),new bs(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Jn.isRange(e))throw Pi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Pi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Pi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};VA=E0=D([ki],VA);let k9=kE=class{static isNotebookCellEdit(e){return e instanceof kE?!0:e?Sy.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new kE(e,t)}static insertCells(e,t){return new kE(new Sy(e,e),t)}static deleteCells(e){return new kE(e,[])}static updateCellMetadata(e,t){const i=new kE(new Sy(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new kE(new Sy(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};k9=kE=D([ki],k9);let Nce=class tj{static isSnippetTextEdit(e){return e instanceof tj?!0:e?Jn.isRange(e.range)&&uI.isSnippetString(e.snippet):!1}static replace(e,t){return new tj(e,t)}static insert(e,t){return tj.replace(new Jn(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var vc;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.Cell=3]="Cell",s[s.CellReplace=5]="CellReplace",s[s.Snippet=6]="Snippet"})(vc||(vc={}));let hI=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,n){this._edits.push({_type:vc.File,from:e,to:t,options:i,metadata:n})}createFile(e,t,i){this._edits.push({_type:vc.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:vc.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:vc.Cell,metadata:i,uri:e,edit:{editType:dI.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,n){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:vc.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:n})}replaceNotebookCellMetadata(e,t,i,n){this._edits.push({_type:vc.Cell,metadata:n,uri:e,edit:{editType:dI.Metadata,index:t,metadata:i}})}replace(e,t,i,n){this._edits.push({_type:vc.Text,uri:e,edit:new VA(t,i),metadata:n})}insert(e,t,i,n){this.replace(e,new Jn(t,t),i,n)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===vc.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let n,o;Array.isArray(i)?(n=i[0],o=i[1]):n=i,k9.isNotebookCellEdit(n)?n.newCellMetadata?this.replaceNotebookCellMetadata(e,n.range.start,n.newCellMetadata,o):n.newNotebookMetadata?this.replaceNotebookMetadata(e,n.newNotebookMetadata,o):this.replaceNotebookCells(e,n.range,n.newCells,o):Nce.isSnippetTextEdit(n)?this._edits.push({_type:vc.Snippet,uri:e,range:n.range,edit:n.snippet,metadata:o}):this._edits.push({_type:vc.Text,uri:e,edit:n,metadata:o})}else{for(let i=0;in.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){const i=new x0;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};uI=x0=D([ki],uI);var Bx;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(Bx||(Bx={}));var Bd;(function(s){s[s.Hint=3]="Hint",s[s.Information=2]="Information",s[s.Warning=1]="Warning",s[s.Error=0]="Error"})(Bd||(Bd={}));let yp=zAe=class{static isLocation(e){return e instanceof zAe?!0:e?Jn.isRange(e.range)&&N.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Jn.isRange(t))this.range=Jn.of(t);else if(bs.isPosition(t))this.range=new Jn(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};yp=zAe=D([ki],yp);let XW=class{static is(e){return e?typeof e.message=="string"&&e.location&&Jn.isRange(e.location.range)&&N.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};XW=D([ki],XW);let I9=class{constructor(e,t,i=Bd.Error){if(!Jn.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=i}toJSON(){return{severity:Bd[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&is(e.tags,t.tags)&&is(e.relatedInformation,t.relatedInformation,XW.isEqual)}};I9=D([ki],I9);let T9=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};T9=D([ki],T9);let L9=class extends T9{constructor(e,t,i,n){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=n}};L9=D([ki],L9);var Pee;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Pee||(Pee={}));var ZW;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(ZW||(ZW={}));let R9=class{constructor(e,t=ZW.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:ZW[this.kind]}}};R9=D([ki],R9);let M9=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};M9=D([ki],M9);var _r;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(_r||(_r={}));var eH;(function(s){s[s.Deprecated=1]="Deprecated"})(eH||(eH={}));let tH=$Ae=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,n,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),n instanceof yp?this.location=n:i instanceof Jn&&(this.location=new yp(n,i)),$Ae.validate(this)}toJSON(){return{name:this.name,kind:_r[this.kind],location:this.location,containerName:this.containerName}}};tH=$Ae=D([ki],tH);let iH=ZQ=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(ZQ.validate)}constructor(e,t,i,n,o){this.name=e,this.detail=t,this.kind=i,this.range=n,this.selectionRange=o,this.children=[],ZQ.validate(this)}};iH=ZQ=D([ki],iH);var nH;(function(s){s[s.Invoke=1]="Invoke",s[s.Automatic=2]="Automatic"})(nH||(nH={}));let N9=class{constructor(e,t){this.title=e,this.kind=t}};N9=D([ki],N9);var WR;let Sa=(WR=class{constructor(e){this.value=e}append(e){return new RV(this.value?this.value+RV.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+RV.sep)}},RV=WR,WR.sep=".",WR);Sa=RV=D([ki],Sa);Sa.Empty=new Sa("");Sa.QuickFix=Sa.Empty.append("quickfix");Sa.Refactor=Sa.Empty.append("refactor");Sa.RefactorExtract=Sa.Refactor.append("extract");Sa.RefactorInline=Sa.Refactor.append("inline");Sa.RefactorMove=Sa.Refactor.append("move");Sa.RefactorRewrite=Sa.Refactor.append("rewrite");Sa.Source=Sa.Empty.append("source");Sa.SourceOrganizeImports=Sa.Source.append("organizeImports");Sa.SourceFixAll=Sa.Source.append("fixAll");Sa.Notebook=Sa.Empty.append("notebook");let sH=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};sH=D([ki],sH);let Pce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}},UNe=class{constructor(e,t){this.fromRanges=t,this.from=e}},VNe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var UT;(function(s){s[s.Information=0]="Information",s[s.Warning=1]="Warning",s[s.Error=2]="Error"})(UT||(UT={}));let P9=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};P9=D([ki],P9);var Bh,p6e;let df=GAe=(p6e=class{constructor(e,t=!1){Wt(this,Bh);Ct(this,Bh,new Mt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof GAe?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Ce(this,Bh).value}set value(e){Ce(this,Bh).value=e}get isTrusted(){return Ce(this,Bh).isTrusted}set isTrusted(e){Ce(this,Bh).isTrusted=e}get supportThemeIcons(){return Ce(this,Bh).supportThemeIcons}set supportThemeIcons(e){Ce(this,Bh).supportThemeIcons=e}get supportHtml(){return Ce(this,Bh).supportHtml}set supportHtml(e){Ce(this,Bh).supportHtml=e}get baseUri(){return Ce(this,Bh).baseUri}set baseUri(e){Ce(this,Bh).baseUri=e}appendText(e){return Ce(this,Bh).appendText(e),this}appendMarkdown(e){return Ce(this,Bh).appendMarkdown(e),this}appendCodeblock(e,t){return Ce(this,Bh).appendCodeblock(t??"",e),this}},Bh=new WeakMap,p6e);df=GAe=D([ki],df);let Fee=class{constructor(e,t){this.label=e,this.documentation=t}};Fee=D([ki],Fee);let Oee=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Oee=D([ki],Oee);let Bee=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Bee=D([ki],Bee);var Wee;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Wee||(Wee={}));var Hee;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Hee||(Hee={}));let F9=class{constructor(e){this.value=e}};F9=D([ki],F9);let O9=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};O9=D([ki],O9);var VT;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(VT||(VT={}));var Zi;(function(s){s[s.Text=0]="Text",s[s.Method=1]="Method",s[s.Function=2]="Function",s[s.Constructor=3]="Constructor",s[s.Field=4]="Field",s[s.Variable=5]="Variable",s[s.Class=6]="Class",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Unit=10]="Unit",s[s.Value=11]="Value",s[s.Enum=12]="Enum",s[s.Keyword=13]="Keyword",s[s.Snippet=14]="Snippet",s[s.Color=15]="Color",s[s.File=16]="File",s[s.Reference=17]="Reference",s[s.Folder=18]="Folder",s[s.EnumMember=19]="EnumMember",s[s.Constant=20]="Constant",s[s.Struct=21]="Struct",s[s.Event=22]="Event",s[s.Operator=23]="Operator",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue"})(Zi||(Zi={}));var oH;(function(s){s[s.Deprecated=1]="Deprecated"})(oH||(oH={}));let B9=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&Zi[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};B9=D([ki],B9);let tN=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};tN=D([ki],tN);let Uee=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};Uee=D([ki],Uee);let Vee=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};Vee=D([ki],Vee);var Wx;(function(s){s[s.Unknown=0]="Unknown",s[s.Word=1]="Word",s[s.Line=2]="Line",s[s.Suggest=3]="Suggest"})(Wx||(Wx={}));var rH;(function(s){s[s.Active=-1]="Active",s[s.Beside=-2]="Beside",s[s.One=1]="One",s[s.Two=2]="Two",s[s.Three=3]="Three",s[s.Four=4]="Four",s[s.Five=5]="Five",s[s.Six=6]="Six",s[s.Seven=7]="Seven",s[s.Eight=8]="Eight",s[s.Nine=9]="Nine"})(rH||(rH={}));var TS;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(TS||(TS={}));function $9t(s,e){return`${Sn.toKey(s)}.${e}`}var o_;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval"})(o_||(o_={}));var zT;(function(s){s[s.Manual=1]="Manual",s[s.AfterDelay=2]="AfterDelay",s[s.FocusOut=3]="FocusOut"})(zT||(zT={}));var W9;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(W9||(W9={}));var iN;(function(s){s[s.Keyboard=1]="Keyboard",s[s.Mouse=2]="Mouse",s[s.Command=3]="Command"})(iN||(iN={}));var aH;(function(s){s[s.Undo=1]="Undo",s[s.Redo=2]="Redo"})(aH||(aH={}));var Hx;(function(s){s[s.OpenOpen=0]="OpenOpen",s[s.ClosedClosed=1]="ClosedClosed",s[s.OpenClosed=2]="OpenClosed",s[s.ClosedOpen=3]="ClosedOpen"})(Hx||(Hx={}));(function(s){function e(t){switch(t){case"keyboard":return s.Keyboard;case"mouse":return s.Mouse;case"api":return s.Command}}s.fromValue=e})(iN||(iN={}));var nN;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(nN||(nN={}));(function(s){function e(t){switch(t){case s.Other:return"other";case s.Comment:return"comment";case s.String:return"string";case s.RegEx:return"regex"}return"other"}s.toString=e})(nN||(nN={}));let H9=class{constructor(e,t){if(t&&!N.isUri(t))throw Pi("target");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.target=t}};H9=D([ki],H9);let sN=class{constructor(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n}};sN=D([ki],sN);let U9=class{constructor(e,t){if(t&&!(t instanceof sN))throw Pi("color");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.color=t}};U9=D([ki],U9);let V9=class{constructor(e){if(!e||typeof e!="string")throw Pi("label");this.label=e}};V9=D([ki],V9);var zee;(function(s){s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Information=2]="Information"})(zee||(zee={}));var $ee;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})($ee||($ee={}));var mD;(function(s){s[s.Low=0]="Low",s[s.Medium=1]="Medium",s[s.High=2]="High"})(mD||(mD={}));let ent=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Pi("startIndex");if(typeof t!="number"||t<1)throw Pi("length");if(i!==void 0&&typeof i!="string")throw Pi("tooltip")}},tnt=class{constructor(e){this.uri=e}};class int{constructor(e){this.terminalCommand=e}}var Gee;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(Gee||(Gee={}));let nnt=class{constructor(e){if(this.options=e,typeof e!="object")throw Pi("options")}};var Kee;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(Kee||(Kee={}));var qee;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(qee||(qee={}));var dy;let cH=(dy=class{static from(e){switch(e){case"clean":return sw.Clean;case"build":return sw.Build;case"rebuild":return sw.Rebuild;case"test":return sw.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Pi("name");this._id=e}get id(){return this._id}},sw=dy,dy.Clean=new sw("clean","Clean"),dy.Build=new sw("build","Build"),dy.Rebuild=new sw("rebuild","Rebuild"),dy.Test=new sw("test","Test"),dy);cH=sw=D([ki],cH);function snt(s){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return snt(e)}};oN=D([ki],oN);let gI=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Pi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Pi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Pi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Pi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Pi("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(const t of this._args)e.push(typeof t=="string"?t:t.value);return snt(e)}};gI=D([ki],gI);var Qee;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(Qee||(Qee={}));var fI;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace"})(fI||(fI={}));let Fce=class{constructor(e){this._callback=e}computeId(){return"customExecution"+ar()}set callback(e){this._callback=e}get callback(){return this._callback}};var hy;let z9=(hy=class{constructor(e,t,i,n,o,r){this.__deprecated=!1,this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=i,this.execution=n,a=o,this.__deprecated=!0):t===fI.Global||t===fI.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=o,a=r),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof oN?this._definition={type:ow.ProcessType,id:this._execution.computeId()}:this._execution instanceof gI?this._definition={type:ow.ShellType,id:this._execution.computeId()}:this._execution instanceof Fce?this._definition={type:ow.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:ow.EmptyType,id:ar()}}get definition(){return this._definition}set definition(e){if(e==null)throw Pi("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw Pi("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;const t=this._definition.type;(ow.EmptyType===t||ow.ProcessType===t||ow.ShellType===t||ow.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw Pi("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}},ow=hy,hy.ExtensionCallbackType="customExecution",hy.ProcessType="process",hy.ShellType="shell",hy.EmptyType="$empty",hy);z9=ow=D([ki],z9);var _D;(function(s){s[s.SourceControl=1]="SourceControl",s[s.Window=10]="Window",s[s.Notification=15]="Notification"})(_D||(_D={}));var QAe;(function(s){function e(t){const i=t;return lc(i.value)?i.tooltip&&!Lt(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}s.isViewBadge=e})(QAe||(QAe={}));let $9=KAe=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const n=lc(i.checkboxState)?i.checkboxState:kn(i.checkboxState)&&lc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!lc(i.checkboxState)&&kn(i.checkboxState)?i.checkboxState.tooltip:void 0;if(n===void 0||n!==db.Checked&&n!==db.Unchecked||o!==void 0&&!Lt(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof KAe)return!0;if(i.label!==void 0&&!Lt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!Lt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!Lt(i.iconPath)&&!N.isUri(i.iconPath)&&(!i.iconPath||!Lt(i.iconPath.id))){const n=i.iconPath;if(!n||!Lt(n.light)&&!N.isUri(n.light)&&!Lt(n.dark)&&!N.isUri(n.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!Lt(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!N.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!Lt(i.tooltip)&&!(i.tooltip instanceof df)?(console.log("INVALID tree item, invalid tooltip",i.tooltip),!1):i.command!==void 0&&!i.command.command?(console.log("INVALID tree item, invalid command",i.command),!1):i.collapsibleState!==void 0&&i.collapsibleStatevD.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!Lt(i.contextValue)?(console.log("INVALID tree item, invalid contextValue",i.contextValue),!1):i.accessibilityInformation!==void 0&&!i.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",i.accessibilityInformation),!1):!0}constructor(e,t=vD.None){this.collapsibleState=t,N.isUri(e)?this.resourceUri=e:this.label=e}};$9=KAe=D([ki],$9);var vD;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(vD||(vD={}));var db;(function(s){s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked"})(db||(db={}));let G9=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};G9=D([ki],G9);class jee extends G9{}var f7;class G9t extends jee{constructor(t){super("");Wt(this,f7);Ct(this,f7,t)}asFile(){return Ce(this,f7)}}f7=new WeakMap;class K9t{constructor(e,t,i,n){this.name=e,this.uri=t,this._itemId=i,this._getData=n}data(){return this._getData()}}var ZC,q1,MV,m6e;let lH=(m6e=class{constructor(e){Wt(this,q1);Wt(this,ZC,new Map);for(const[t,i]of e??[]){const n=Ce(this,ZC).get(ZU(this,q1,MV).call(this,t));n?n.push(i):Ce(this,ZC).set(ZU(this,q1,MV).call(this,t),[i])}}get(e){return Ce(this,ZC).get(ZU(this,q1,MV).call(this,e))?.[0]}set(e,t){Ce(this,ZC).set(ZU(this,q1,MV).call(this,e),[t])}forEach(e,t){for(const[i,n]of Ce(this,ZC))for(const o of n)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of Ce(this,ZC))for(const i of t)yield[e,i]}},ZC=new WeakMap,q1=new WeakSet,MV=function(e){return e.toLowerCase()},m6e);lH=D([ki],lH);let Yee=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};Yee=D([ki],Yee);var Jee;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(Jee||(Jee={}));var YS;let K9=(YS=class{constructor(e){this.value=e}append(...e){return new YS((this.value?[this.value,...e]:e).join(YS.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+YS.sep)}},YS.sep=".",YS);K9.Empty=new K9("");let ont=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},uu=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};uu=D([ki],uu);uu.File=new uu("file");uu.Folder=new uu("folder");let dH=class{constructor(e){this.id=e}};dH=D([ki],dH);var $T;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.WorkspaceFolder=3]="WorkspaceFolder"})($T||($T={}));let GT=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=N.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!N.isUri(e)&&!N.isUri(e.uri)))throw Pi("base");if(typeof t!="string")throw Pi("pattern");typeof e=="string"?this.baseUri=N.file(e):N.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};GT=D([ki],GT);const rnt=new WeakMap;function q9t(s,e){rnt.set(s,e)}let rN=class{constructor(e,t,i,n,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof n=="string"&&(this.logMessage=n),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=rnt.get(this)??ar()),this._id}};rN=D([ki],rN);let Ux=class extends rN{constructor(e,t,i,n,o,r){if(super(t,i,n,o,r),e===null)throw Pi("location");this.location=e}};Ux=D([ki],Ux);let Vx=class extends rN{constructor(e,t,i,n,o,r){super(t,i,n,o,r),this.functionName=e}};Vx=D([ki],Vx);let Xee=class extends rN{constructor(e,t,i,n,o,r,a,c){if(super(n,o,r,a,c),!t)throw Pi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};Xee=D([ki],Xee);let q9=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};q9=D([ki],q9);let hH=class{constructor(e,t){this.port=e,this.host=t}};hH=D([ki],hH);let Q9=class{constructor(e){this.path=e}};Q9=D([ki],Q9);let j9=class{constructor(e){this.implementation=e}};j9=D([ki],j9);let zNe=class{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}},$Ne=class{constructor(e,t){this.session=e,this.threadId=t}},Y9=class{constructor(e,t){this.range=e,this.expression=t}};Y9=D([ki],Y9);var uH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(uH||(uH={}));let J9=class{constructor(e,t){this.range=e,this.text=t}};J9=D([ki],J9);let X9=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};X9=D([ki],X9);let Z9=class{constructor(e,t){this.range=e,this.expression=t}};Z9=D([ki],Z9);let jAe=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};jAe=D([ki],jAe);var Zee;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Zee||(Zee={}));var gH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(gH||(gH={}));let ant=class{constructor(e,t){this.newSymbolName=e,this.tags=t}};var KT;(function(s){s[s.Changed=1]="Changed",s[s.Created=2]="Created",s[s.Deleted=3]="Deleted"})(KT||(KT={}));let Jc=yg=class extends Error{static FileExists(e){return new yg(e,ot.FileExists,yg.FileExists)}static FileNotFound(e){return new yg(e,ot.FileNotFound,yg.FileNotFound)}static FileNotADirectory(e){return new yg(e,ot.FileNotADirectory,yg.FileNotADirectory)}static FileIsADirectory(e){return new yg(e,ot.FileIsADirectory,yg.FileIsADirectory)}static NoPermissions(e){return new yg(e,ot.NoPermissions,yg.NoPermissions)}static Unavailable(e){return new yg(e,ot.Unavailable,yg.Unavailable)}constructor(e,t=ot.Unknown,i){super(N.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",sje(this,t),Object.setPrototypeOf(this,yg.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Jc=yg=D([ki],Jc);let ete=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};ete=D([ki],ete);var Uw;(function(s){s[s.Comment=1]="Comment",s[s.Imports=2]="Imports",s[s.Region=3]="Region"})(Uw||(Uw={}));var fH;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(fH||(fH={}));var tte;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(tte||(tte={}));var ite;(function(s){s[s.Published=0]="Published",s[s.Draft=1]="Draft"})(ite||(ite={}));var pH;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(pH||(pH={}));var mH;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(mH||(mH={}));var _H;(function(s){s[s.Reply=1]="Reply",s[s.Comment=2]="Comment"})(_H||(_H={}));let nte=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function Q9t(s){return typeof s>"u"||A6e(s)}let cnt=class lnt{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,i=e.tokenTypes.length;t"u"))return typeof o>"u"&&(o=0),this._pushEncoded(e,t,i,n,o);if(Jn.isRange(e)&&typeof t=="string"&&Q9t(i))return this._push(e,t,i);throw Pi()}_push(e,t,i){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");const n=e.start.line,o=e.start.character,r=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t);let c=0;if(i)for(const l of i){if(!this._tokenModifierStrToInt.has(l))throw new Error("`tokenModifier` is not in the provided legend");const d=this._tokenModifierStrToInt.get(l);c|=1<>>0}this._pushEncoded(n,o,r,a,c)}_pushEncoded(e,t,i,n,o){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(r-=this._prevLine,r===0&&(a-=this._prevChar)),this._data[this._dataLen++]=r,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){const t=[],i=e.length/5|0;for(let a=0;a{const l=e[5*a],d=e[5*c];if(l===d){const h=e[5*a+1],u=e[5*c+1];return h-u}return l-d});const n=new Uint32Array(e.length);let o=0,r=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!uu.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,i){this.badge=e,this.tooltip=t,this.color=i}},ote=class{constructor(e){this.kind=e}};ote=D([ki],ote);var mS;(function(s){s[s.Light=1]="Light",s[s.Dark=2]="Dark",s[s.HighContrast=3]="HighContrast",s[s.HighContrastLight=4]="HighContrastLight"})(mS||(mS={}));let Sy=class YAe{static isNotebookRange(e){return e instanceof YAe?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw Pi("start must be positive");if(t<0)throw Pi("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,i=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(i=e.end),t===this._start&&i===this._end?this:new YAe(t,i)}},rG=class JAe{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>JAe.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,n,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=n,this.outputs=o??[],this.metadata=r,this.executionSummary=a,JAe.validate(this)}},KNe=class{constructor(e){this.cells=e}};var Bf,zoe;let qNe=(Bf=class{static isNotebookCellOutputItem(e){return e instanceof Bf?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){const t={name:e.name,message:e.message,stack:e.stack};return Bf.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Bf.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Bf.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Bf(e,t)}static text(e,t=Us.text){const i=Ce(Bf,zoe).encode(String(e));return new Bf(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Bf.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=mKe(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},zoe=new WeakMap,Wt(Bf,zoe,new TextEncoder),Bf),i$=class XAe{static isNotebookCellOutput(e){return e instanceof XAe?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,n=new Set;for(let o=0;o!n.has(r))}constructor(e,t,i){this.items=XAe.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=ar(),this.metadata=t??i)}};var zx;(function(s){s[s.Markup=1]="Markup",s[s.Code=2]="Code"})(zx||(zx={}));var cN;(function(s){s[s.Idle=1]="Idle",s[s.Pending=2]="Pending",s[s.Executing=3]="Executing"})(cN||(cN={}));var n$;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(n$||(n$={}));var s$;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(s$||(s$={}));let hnt=class{constructor(e,t){this.text=e,this.alignment=t}};var rte;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred"})(rte||(rte={}));var o$;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred",s[s.Hidden=-1]="Hidden"})(o$||(o$={}));let QNe=class{constructor(e,t=[]){this.uri=e,this.provides=H_(t)}},unt=class{constructor(e){this.label=e}};var wH;(function(s){s[s.Named=1]="Named",s[s.Indexed=2]="Indexed"})(wH||(wH={}));let ate=class{constructor(e,t){this.label=e,this.timestamp=t}};ate=D([ki],ate);var QT;(function(s){s[s.Production=1]="Production",s[s.Development=2]="Development",s[s.Test=3]="Test"})(QT||(QT={}));var r$;(function(s){s[s.Node=1]="Node",s[s.Webworker=2]="Webworker"})(r$||(r$={}));var LS;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(LS||(LS={}));let gnt=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},fnt=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var cte;(function(s){s[s.Queued=1]="Queued",s[s.Running=2]="Running",s[s.Passed=3]="Passed",s[s.Failed=4]="Failed",s[s.Skipped=5]="Skipped",s[s.Errored=6]="Errored"})(cte||(cte={}));var jT;(function(s){s[s.Run=1]="Run",s[s.Debug=2]="Debug",s[s.Coverage=3]="Coverage"})(jT||(jT={}));let a$=class{constructor(e=void 0,t=void 0,i=void 0,n=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=n,this.preserveFocus=o}};a$=D([ki],a$);let lN=qAe=class{static diff(e,t,i){const n=new qAe(e);return n.expectedOutput=t,n.actualOutput=i,n}constructor(e){this.message=e}};lN=qAe=D([ki],lN);let yH=class{constructor(e){this.id=e}};yH=D([ki],yH);let pnt=class{constructor(e,t,i){this.label=e,this.file=t,this.position=i}},rz=class{constructor(e,t){this.covered=e,this.total=t,ij(this)}};function ij(s){if(s){if(s.covered>s.total)throw new Error(`The total number of covered items (${s.covered}) cannot be greater than the total (${s.total})`);if(s.total<0)throw new Error(`The number of covered items (${s.total}) cannot be negative`)}}let dN=class mnt{static fromDetails(e,t){const i=new rz(0,0),n=new rz(0,0),o=new rz(0,0);for(const a of t)if("branches"in a){i.total+=1,i.covered+=a.executed?1:0;for(const c of a.branches)n.total+=1,n.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new mnt(e,i,n.total>0?n:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,n,o=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=n,this.fromTests=o}},_nt=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i=[]){this.executed=e,this.location=t,this.branches=i}},vnt=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.executed=e,this.location=t,this.label=i}},bnt=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.name=e,this.executed=t,this.location=i}};var lte;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(lte||(lte={}));var ZAe;(function(s){s[s.Untrusted=0]="Untrusted",s[s.Trusted=1]="Trusted",s[s.Unspecified=2]="Unspecified"})(ZAe||(ZAe={}));var dte;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(dte||(dte={}));let Oce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}};class Bce{constructor(e){this.uri=e}}class c${constructor(e,t){this.original=e,this.modified=t}}class jNe{constructor(e,t,i,n){this.base=e,this.input1=t,this.input2=i,this.result=n}}class Wce{constructor(e,t){this.uri=e,this.viewType=t}}class YNe{constructor(e){this.viewType=e}}class Hce{constructor(e,t){this.uri=e,this.notebookType=t}}class Uce{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class JNe{constructor(){}}class XNe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class ZNe{constructor(){}}class ePe{constructor(e){this.textDiffs=e}}var eEe;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(eEe||(eEe={}));var hte;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(hte||(hte={}));var ute;(function(s){s[s.Short=1]="Short",s[s.Medium=2]="Medium",s[s.Full=3]="Full"})(ute||(ute={}));let wnt=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var tEe;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful",s[s.Undone=2]="Undone",s[s.Accepted=3]="Accepted",s[s.Bug=4]="Bug"})(tEe||(tEe={}));var CH;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful"})(CH||(CH={}));let aG=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new df(e):e}},SH=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new df(e):e,this.vulnerabilities=t}},AH=class{constructor(e,t){this.participant=e,this.command=t}},l$=class{constructor(e,t,i,n){this.title=e,this.message=t,this.data=i,this.buttons=n}},cG=class{constructor(e,t){this.value=e,this.baseUri=t}},lG=class{constructor(e,t){this.value=e,this.title=t}},EH=class{constructor(e){this.value=e}},tPe=class{constructor(e,t){this.value=e,this.task=t}},xH=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new df(e):e}},dG=class{constructor(e){this.value=e}},kb=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},d$=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},DH=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}},iPe=class{constructor(e,t,i,n){this.prompt=e,this.command=t,this.references=i,this.participant=n}},nPe=class{constructor(e,t,i,n){this.response=e,this.result=t,this.participant=i,this.command=n}};var r_;(function(s){s[s.Panel=1]="Panel",s[s.Terminal=2]="Terminal",s[s.Notebook=3]="Notebook",s[s.Editor=4]="Editor"})(r_||(r_={}));var gte;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(gte||(gte={}));let sPe=class{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}},oPe=class{constructor(e){this.cell=e}};var Kp;(function(s){s[s.User=1]="User",s[s.Assistant=2]="Assistant",s[s.System=3]="System"})(Kp||(Kp={}));class h${constructor(e,t,i){this.name=e,this.content=t,this.isError=i??!1}}let rPe=class iEe{static User(e,t){const i=new iEe(Kp.User,typeof e=="string"?e:"",t);return i.content2=e,i}static Assistant(e,t){return new iEe(Kp.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.content2=t,this.name=i}};class Vce{constructor(e,t){this.name=e,this.parameters=t}}class kH{constructor(e){this.value=e}}let Mw=class D0 extends Error{static NotFound(e){return new D0(e,D0.NotFound.name)}static NoPermissions(e){return new D0(e,D0.NoPermissions.name)}static Blocked(e){return new D0(e,D0.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}};var fte;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(fte||(fte={}));var pte;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(pte||(pte={}));var mte;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(mte||(mte={}));var _te;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped"})(_te||(_te={}));let ynt=class{constructor(e,t){this.text=e,this.range=t}};var IH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(IH||(IH={}));var xF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(xF||(xF={}));var ha;(function(s){s[s.UnknownInput=0]="UnknownInput",s[s.TextInput=1]="TextInput",s[s.TextDiffInput=2]="TextDiffInput",s[s.TextMergeInput=3]="TextMergeInput",s[s.NotebookInput=4]="NotebookInput",s[s.NotebookDiffInput=5]="NotebookDiffInput",s[s.CustomEditorInput=6]="CustomEditorInput",s[s.WebviewEditorInput=7]="WebviewEditorInput",s[s.TerminalEditorInput=8]="TerminalEditorInput",s[s.InteractiveEditorInput=9]="InteractiveEditorInput",s[s.ChatEditorInput=10]="ChatEditorInput",s[s.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(ha||(ha={}));var fh;(function(s){s[s.TAB_OPEN=0]="TAB_OPEN",s[s.TAB_CLOSE=1]="TAB_CLOSE",s[s.TAB_UPDATE=2]="TAB_UPDATE",s[s.TAB_MOVE=3]="TAB_MOVE"})(fh||(fh={}));var bc;(function(s){s[s.Int8Array=1]="Int8Array",s[s.Uint8Array=2]="Uint8Array",s[s.Uint8ClampedArray=3]="Uint8ClampedArray",s[s.Int16Array=4]="Int16Array",s[s.Uint16Array=5]="Uint16Array",s[s.Int32Array=6]="Int32Array",s[s.Uint32Array=7]="Uint32Array",s[s.Float32Array=8]="Float32Array",s[s.Float64Array=9]="Float64Array",s[s.BigInt64Array=10]="BigInt64Array",s[s.BigUint64Array=11]="BigUint64Array"})(bc||(bc={}));var DF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(DF||(DF={}));var YT;(function(s){s[s.None=0]="None",s[s.Process=1]="Process",s[s.Output=2]="Output",s[s.Hybrid=3]="Hybrid"})(YT||(YT={}));var Li;(function(s){s.label="a",s.kind="b",s.detail="c",s.documentation="d",s.sortText="e",s.filterText="f",s.preselect="g",s.insertText="h",s.insertTextRules="i",s.range="j",s.commitCharacters="k",s.additionalTextEdits="l",s.kindModifier="m",s.commandIdent="n",s.commandId="o",s.commandArguments="p"})(Li||(Li={}));var Ay;(function(s){s.defaultRanges="a",s.completions="b",s.isIncomplete="c",s.duration="d"})(Ay||(Ay={}));const Be={MainThreadAuthentication:je("MainThreadAuthentication"),MainThreadBulkEdits:je("MainThreadBulkEdits"),MainThreadLanguageModels:je("MainThreadLanguageModels"),MainThreadEmbeddings:je("MainThreadEmbeddings"),MainThreadChatAgents2:je("MainThreadChatAgents2"),MainThreadChatVariables:je("MainThreadChatVariables"),MainThreadLanguageModelTools:je("MainThreadChatSkills"),MainThreadClipboard:je("MainThreadClipboard"),MainThreadCommands:je("MainThreadCommands"),MainThreadComments:je("MainThreadComments"),MainThreadConfiguration:je("MainThreadConfiguration"),MainThreadConsole:je("MainThreadConsole"),MainThreadDebugService:je("MainThreadDebugService"),MainThreadDecorations:je("MainThreadDecorations"),MainThreadDiagnostics:je("MainThreadDiagnostics"),MainThreadDialogs:je("MainThreadDiaglogs"),MainThreadDocuments:je("MainThreadDocuments"),MainThreadDocumentContentProviders:je("MainThreadDocumentContentProviders"),MainThreadTextEditors:je("MainThreadTextEditors"),MainThreadEditorInsets:je("MainThreadEditorInsets"),MainThreadEditorTabs:je("MainThreadEditorTabs"),MainThreadErrors:je("MainThreadErrors"),MainThreadTreeViews:je("MainThreadTreeViews"),MainThreadDownloadService:je("MainThreadDownloadService"),MainThreadLanguageFeatures:je("MainThreadLanguageFeatures"),MainThreadLanguages:je("MainThreadLanguages"),MainThreadLogger:je("MainThreadLogger"),MainThreadMessageService:je("MainThreadMessageService"),MainThreadOutputService:je("MainThreadOutputService"),MainThreadProgress:je("MainThreadProgress"),MainThreadQuickDiff:je("MainThreadQuickDiff"),MainThreadQuickOpen:je("MainThreadQuickOpen"),MainThreadStatusBar:je("MainThreadStatusBar"),MainThreadSecretState:je("MainThreadSecretState"),MainThreadStorage:je("MainThreadStorage"),MainThreadSpeech:je("MainThreadSpeechProvider"),MainThreadTelemetry:je("MainThreadTelemetry"),MainThreadTerminalService:je("MainThreadTerminalService"),MainThreadTerminalShellIntegration:je("MainThreadTerminalShellIntegration"),MainThreadWebviews:je("MainThreadWebviews"),MainThreadWebviewPanels:je("MainThreadWebviewPanels"),MainThreadWebviewViews:je("MainThreadWebviewViews"),MainThreadCustomEditors:je("MainThreadCustomEditors"),MainThreadUrls:je("MainThreadUrls"),MainThreadUriOpeners:je("MainThreadUriOpeners"),MainThreadProfileContentHandlers:je("MainThreadProfileContentHandlers"),MainThreadWorkspace:je("MainThreadWorkspace"),MainThreadFileSystem:je("MainThreadFileSystem"),MainThreadFileSystemEventService:je("MainThreadFileSystemEventService"),MainThreadExtensionService:je("MainThreadExtensionService"),MainThreadSCM:je("MainThreadSCM"),MainThreadSearch:je("MainThreadSearch"),MainThreadShare:je("MainThreadShare"),MainThreadTask:je("MainThreadTask"),MainThreadWindow:je("MainThreadWindow"),MainThreadLabelService:je("MainThreadLabelService"),MainThreadNotebook:je("MainThreadNotebook"),MainThreadNotebookDocuments:je("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:je("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:je("MainThreadNotebookKernels"),MainThreadNotebookRenderers:je("MainThreadNotebookRenderers"),MainThreadInteractive:je("MainThreadInteractive"),MainThreadTheming:je("MainThreadTheming"),MainThreadTunnelService:je("MainThreadTunnelService"),MainThreadManagedSockets:je("MainThreadManagedSockets"),MainThreadTimeline:je("MainThreadTimeline"),MainThreadTesting:je("MainThreadTesting"),MainThreadLocalization:je("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:je("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:je("MainThreadAiEmbeddingVector")},Ye={ExtHostCommands:je("ExtHostCommands"),ExtHostConfiguration:je("ExtHostConfiguration"),ExtHostDiagnostics:je("ExtHostDiagnostics"),ExtHostDebugService:je("ExtHostDebugService"),ExtHostDecorations:je("ExtHostDecorations"),ExtHostDocumentsAndEditors:je("ExtHostDocumentsAndEditors"),ExtHostDocuments:je("ExtHostDocuments"),ExtHostDocumentContentProviders:je("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:je("ExtHostDocumentSaveParticipant"),ExtHostEditors:je("ExtHostEditors"),ExtHostTreeViews:je("ExtHostTreeViews"),ExtHostFileSystem:je("ExtHostFileSystem"),ExtHostFileSystemInfo:je("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:je("ExtHostFileSystemEventService"),ExtHostLanguages:je("ExtHostLanguages"),ExtHostLanguageFeatures:je("ExtHostLanguageFeatures"),ExtHostQuickOpen:je("ExtHostQuickOpen"),ExtHostQuickDiff:je("ExtHostQuickDiff"),ExtHostStatusBar:je("ExtHostStatusBar"),ExtHostShare:je("ExtHostShare"),ExtHostExtensionService:je("ExtHostExtensionService"),ExtHostLogLevelServiceShape:je("ExtHostLogLevelServiceShape"),ExtHostTerminalService:je("ExtHostTerminalService"),ExtHostTerminalShellIntegration:je("ExtHostTerminalShellIntegration"),ExtHostSCM:je("ExtHostSCM"),ExtHostSearch:je("ExtHostSearch"),ExtHostTask:je("ExtHostTask"),ExtHostWorkspace:je("ExtHostWorkspace"),ExtHostWindow:je("ExtHostWindow"),ExtHostWebviews:je("ExtHostWebviews"),ExtHostWebviewPanels:je("ExtHostWebviewPanels"),ExtHostCustomEditors:je("ExtHostCustomEditors"),ExtHostWebviewViews:je("ExtHostWebviewViews"),ExtHostEditorInsets:je("ExtHostEditorInsets"),ExtHostEditorTabs:je("ExtHostEditorTabs"),ExtHostProgress:je("ExtHostProgress"),ExtHostComments:je("ExtHostComments"),ExtHostSecretState:je("ExtHostSecretState"),ExtHostStorage:je("ExtHostStorage"),ExtHostUrls:je("ExtHostUrls"),ExtHostUriOpeners:je("ExtHostUriOpeners"),ExtHostProfileContentHandlers:je("ExtHostProfileContentHandlers"),ExtHostOutputService:je("ExtHostOutputService"),ExtHostLabelService:je("ExtHostLabelService"),ExtHostNotebook:je("ExtHostNotebook"),ExtHostNotebookDocuments:je("ExtHostNotebookDocuments"),ExtHostNotebookEditors:je("ExtHostNotebookEditors"),ExtHostNotebookKernels:je("ExtHostNotebookKernels"),ExtHostNotebookRenderers:je("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:je("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:je("ExtHostInteractive"),ExtHostChatAgents2:je("ExtHostChatAgents"),ExtHostChatVariables:je("ExtHostChatVariables"),ExtHostLanguageModelTools:je("ExtHostChatSkills"),ExtHostChatProvider:je("ExtHostChatProvider"),ExtHostSpeech:je("ExtHostSpeech"),ExtHostEmbeddings:je("ExtHostEmbeddings"),ExtHostAiRelatedInformation:je("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:je("ExtHostAiEmbeddingVector"),ExtHostTheming:je("ExtHostTheming"),ExtHostTunnelService:je("ExtHostTunnelService"),ExtHostManagedSockets:je("ExtHostManagedSockets"),ExtHostAuthentication:je("ExtHostAuthentication"),ExtHostTimeline:je("ExtHostTimeline"),ExtHostTesting:je("ExtHostTesting"),ExtHostTelemetry:je("ExtHostTelemetry"),ExtHostLocalization:je("ExtHostLocalization")};var vte;(function(s){s[s.Complete=100]="Complete",s[s.Partial=50]="Partial",s[s.None=0]="None"})(vte||(vte={}));let nEe;function Cnt(s){nEe=s}function yd(s){return new Proxy({},{get(e,t){if(nEe==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return nEe[s][t]}})}const j9t={version:"1.92.2",tasks:yd("tasks"),notebooks:yd("notebooks"),scm:yd("scm"),comments:yd("comments"),authentication:yd("authentication"),tests:yd("tests"),extensions:yd("extensions"),debug:yd("debug"),env:yd("env"),commands:yd("commands"),window:yd("window"),workspace:yd("workspace"),languages:yd("languages"),l10n:yd("l10n"),interactive:yd("interactive"),ai:yd("ai"),chat:yd("chat"),speech:yd("speech"),lm:yd("lm"),Breakpoint:rN,TerminalOutputAnchor:Nee,ChatResultFeedbackKind:CH,ChatVariableLevel:ute,ChatCompletionItem:wnt,CallHierarchyIncomingCall:UNe,CallHierarchyItem:Pce,CallHierarchyOutgoingCall:VNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:YT,CodeAction:N9,CodeActionKind:Sa,CodeActionTriggerKind:nH,CodeLens:P9,Color:sN,ColorInformation:U9,ColorPresentation:V9,ColorThemeKind:mS,CommentMode:tte,CommentState:ite,CommentThreadCollapsibleState:fH,CommentThreadState:pH,CommentThreadApplicability:mH,CommentThreadFocus:_H,CompletionItem:B9,CompletionItemKind:Zi,CompletionItemTag:oH,CompletionList:tN,CompletionTriggerKind:VT,ConfigurationTarget:$T,CustomExecution:Fce,DebugAdapterExecutable:q9,DebugAdapterInlineImplementation:j9,DebugAdapterNamedPipeServer:Q9,DebugAdapterServer:hH,DebugConfigurationProviderTriggerKind:A9,DebugConsoleMode:e$,DebugVisualization:dnt,DecorationRangeBehavior:Hx,Diagnostic:I9,DiagnosticRelatedInformation:XW,DiagnosticSeverity:Bd,DiagnosticTag:Bx,Disposable:Qs,DocumentHighlight:R9,DocumentHighlightKind:ZW,MultiDocumentHighlight:M9,DocumentLink:H9,DocumentSymbol:iH,EndOfLine:D_,EnvironmentVariableMutatorType:HT,EvaluatableExpression:Y9,InlineValueText:J9,InlineValueVariableLookup:X9,InlineValueEvaluatableExpression:Z9,InlineCompletionTriggerKind:uH,EventEmitter:I,ExtensionKind:bD,ExtensionMode:QT,ExternalUriOpenerPriority:lte,FileChangeType:KT,FileDecoration:t$,FileDecoration2:t$,FileSystemError:Jc,FileType:sn,FilePermission:lp,FoldingRange:ete,FoldingRangeKind:Uw,FunctionBreakpoint:Vx,InlineCompletionItem:Uee,InlineCompletionList:Vee,Hover:T9,VerboseHover:L9,HoverVerbosityAction:Pee,IndentAction:yr,Location:yp,MarkdownString:df,OverviewRulerLane:kl,ParameterInformation:Fee,PortAutoForwardAction:dte,Position:bs,ProcessExecution:oN,ProgressLocation:_D,QuickInputButtonLocation:ste,QuickInputButtons:vH,Range:Jn,RelativePattern:GT,Selection:cC,SelectionRange:sH,SemanticTokens:aN,SemanticTokensBuilder:cnt,SemanticTokensEdit:GNe,SemanticTokensEdits:oz,SemanticTokensLegend:nte,ShellExecution:gI,ShellQuoting:Qee,SignatureHelp:Bee,SignatureHelpTriggerKind:Wee,SignatureInformation:Oee,SnippetString:uI,SourceBreakpoint:Ux,StandardTokenType:LS,StatusBarAlignment:TS,SymbolInformation:tH,SymbolKind:_r,SymbolTag:eH,Task:z9,TaskGroup:cH,TaskPanelKind:qee,TaskRevealKind:Kee,TaskScope:fI,TerminalLink:ent,TerminalQuickFixTerminalCommand:int,TerminalQuickFixOpener:tnt,TerminalLocation:Gee,TerminalProfile:nnt,TerminalExitReason:$ee,TerminalShellExecutionCommandLineConfidence:mD,TextDocumentSaveReason:zT,TextEdit:VA,SnippetTextEdit:Nce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:o_,TextEditorRevealType:W9,TextEditorSelectionChangeKind:iN,SyntaxTokenType:nN,TextDocumentChangeReason:aH,ThemeColor:dH,ThemeIcon:uu,TreeItem:$9,TreeItemCheckboxState:db,TreeItemCollapsibleState:vD,TypeHierarchyItem:Oce,UIKind:tv,Uri:N,ViewColumn:rH,WorkspaceEdit:hI,DocumentPasteTriggerKind:Jee,DocumentDropEdit:Yee,DocumentDropOrPasteEditKind:K9,DocumentPasteEdit:ont,InlayHint:O9,InlayHintLabelPart:F9,InlayHintKind:Hee,RemoteAuthorityResolverError:t1,ResolvedAuthority:Zit,ManagedResolvedAuthority:sz,SourceControlInputBoxValidationType:zee,ExtensionRuntime:r$,TimelineItem:ate,NotebookRange:Sy,NotebookCellKind:zx,NotebookCellExecutionState:cN,NotebookCellData:rG,NotebookData:KNe,NotebookRendererScript:QNe,NotebookCellStatusBarAlignment:n$,NotebookEditorRevealType:s$,NotebookCellOutput:i$,NotebookCellOutputItem:qNe,NotebookCellStatusBarItem:hnt,NotebookControllerAffinity:rte,NotebookControllerAffinity2:o$,NotebookEdit:k9,NotebookKernelSourceAction:unt,NotebookVariablesRequestKind:wH,PortAttributes:fnt,LinkedEditingRanges:gnt,TestResultState:cte,TestRunRequest:a$,TestMessage:lN,TestMessage2:lN,TestMessageStackFrame:pnt,TestTag:yH,TestRunProfileKind:jT,TextSearchCompleteMessageType:wee,DataTransfer:lH,DataTransferItem:G9,TestCoverageCount:rz,FileCoverage:dN,FileCoverage2:dN,StatementCoverage:_nt,BranchCoverage:vnt,DeclarationCoverage:bnt,LanguageStatusSeverity:UT,QuickPickItemKind:bH,InputBoxValidationSeverity:qT,TabInputText:Bce,TabInputTextDiff:c$,TabInputTextMerge:jNe,TabInputCustom:Wce,TabInputNotebook:Hce,TabInputNotebookDiff:Uce,TabInputWebview:YNe,TabInputTerminal:JNe,TabInputInteractiveWindow:XNe,TabInputChat:ZNe,TabInputTextMultiDiff:ePe,TelemetryTrustedValue:Wae,LogLevel:Gn,EditSessionIdentityMatch:vte,ChatCopyKind:hte,DebugStackFrame:zNe,DebugThread:$Ne,RelatedInformationType:fte,SpeechToTextStatus:pte,TextToSpeechStatus:mte,PartialAcceptTriggerKind:Wx,KeywordRecognitionStatus:_te,ChatResponseMarkdownPart:aG,ChatResponseFileTreePart:cG,ChatResponseAnchorPart:lG,ChatResponseProgressPart:EH,ChatResponseProgressPart2:tPe,ChatResponseReferencePart:kb,ChatResponseReferencePart2:kb,ChatResponseCodeCitationPart:d$,ChatResponseWarningPart:xH,ChatResponseTextEditPart:DH,ChatResponseMarkdownWithVulnerabilitiesPart:SH,ChatResponseCommandButtonPart:dG,ChatResponseDetectedParticipantPart:AH,ChatResponseConfirmationPart:l$,ChatResponseReferencePartStatusKind:gte,ChatRequestTurn:iPe,ChatResponseTurn:nPe,ChatLocation:r_,ChatRequestEditorData:sPe,ChatRequestNotebookData:oPe,LanguageModelChatMessageRole:Kp,LanguageModelChatMessage:rPe,LanguageModelChatMessageFunctionResultPart:h$,LanguageModelChatResponseTextPart:kH,LanguageModelChatResponseFunctionUsePart:Vce,LanguageModelError:Mw,NewSymbolName:ant,NewSymbolNameTag:Zee,NewSymbolNameTriggerKind:gH,InlineEdit:ynt,InlineEditTriggerKind:IH,ExcludeSettingOptions:Rw,TextSearchContextNew:WNe,TextSearchMatchNew:BNe,TextSearchCompleteMessageTypeNew:yee},{version:Y9t,tasks:J9t,notebooks:X9t,scm:Z9t,comments:e$t,authentication:t$t,tests:i$t,extensions:n$t,debug:s$t,env:o$t,commands:r$t,window:a$t,workspace:c$t,languages:l$t,l10n:d$t,interactive:h$t,ai:u$t,chat:g$t,speech:f$t,lm:p$t,Breakpoint:m$t,TerminalOutputAnchor:_$t,ChatResultFeedbackKind:v$t,ChatVariableLevel:b$t,ChatCompletionItem:w$t,CallHierarchyIncomingCall:y$t,CallHierarchyItem:C$t,CallHierarchyOutgoingCall:S$t,CancellationError:A$t,CancellationTokenSource:E$t,CandidatePortSource:x$t,CodeAction:D$t,CodeActionKind:k$t,CodeActionTriggerKind:I$t,CodeLens:T$t,Color:L$t,ColorInformation:R$t,ColorPresentation:M$t,ColorThemeKind:N$t,CommentMode:P$t,CommentState:F$t,CommentThreadCollapsibleState:O$t,CommentThreadState:B$t,CommentThreadApplicability:W$t,CommentThreadFocus:H$t,CompletionItem:U$t,CompletionItemKind:V$t,CompletionItemTag:z$t,CompletionList:$$t,CompletionTriggerKind:G$t,ConfigurationTarget:K$t,CustomExecution:q$t,DebugAdapterExecutable:Q$t,DebugAdapterInlineImplementation:j$t,DebugAdapterNamedPipeServer:Y$t,DebugAdapterServer:J$t,DebugConfigurationProviderTriggerKind:X$t,DebugConsoleMode:Z$t,DebugVisualization:e7t,DecorationRangeBehavior:t7t,Diagnostic:i7t,DiagnosticRelatedInformation:n7t,DiagnosticSeverity:s7t,DiagnosticTag:o7t,Disposable:r7t,DocumentHighlight:a7t,DocumentHighlightKind:c7t,MultiDocumentHighlight:l7t,DocumentLink:d7t,DocumentSymbol:h7t,EndOfLine:u7t,EnvironmentVariableMutatorType:g7t,EvaluatableExpression:f7t,InlineValueText:p7t,InlineValueVariableLookup:m7t,InlineValueEvaluatableExpression:_7t,InlineCompletionTriggerKind:v7t,EventEmitter:b7t,ExtensionKind:w7t,ExtensionMode:y7t,ExternalUriOpenerPriority:C7t,FileChangeType:S7t,FileDecoration:A7t,FileDecoration2:E7t,FileSystemError:x7t,FileType:D7t,FilePermission:k7t,FoldingRange:I7t,FoldingRangeKind:T7t,FunctionBreakpoint:L7t,InlineCompletionItem:R7t,InlineCompletionList:M7t,Hover:N7t,VerboseHover:P7t,HoverVerbosityAction:F7t,IndentAction:O7t,Location:B7t,MarkdownString:W7t,OverviewRulerLane:H7t,ParameterInformation:U7t,PortAutoForwardAction:V7t,Position:z7t,ProcessExecution:$7t,ProgressLocation:G7t,QuickInputButtonLocation:K7t,QuickInputButtons:q7t,Range:Q7t,RelativePattern:j7t,Selection:Y7t,SelectionRange:J7t,SemanticTokens:X7t,SemanticTokensBuilder:Z7t,SemanticTokensEdit:e6t,SemanticTokensEdits:t6t,SemanticTokensLegend:i6t,ShellExecution:n6t,ShellQuoting:s6t,SignatureHelp:o6t,SignatureHelpTriggerKind:r6t,SignatureInformation:a6t,SnippetString:c6t,SourceBreakpoint:l6t,StandardTokenType:d6t,StatusBarAlignment:h6t,SymbolInformation:u6t,SymbolKind:g6t,SymbolTag:f6t,Task:p6t,TaskGroup:m6t,TaskPanelKind:_6t,TaskRevealKind:v6t,TaskScope:b6t,TerminalLink:w6t,TerminalQuickFixTerminalCommand:y6t,TerminalQuickFixOpener:C6t,TerminalLocation:S6t,TerminalProfile:A6t,TerminalExitReason:E6t,TerminalShellExecutionCommandLineConfidence:x6t,TextDocumentSaveReason:D6t,TextEdit:k6t,SnippetTextEdit:I6t,TextEditorCursorStyle:T6t,TextEditorLineNumbersStyle:L6t,TextEditorRevealType:R6t,TextEditorSelectionChangeKind:M6t,SyntaxTokenType:N6t,TextDocumentChangeReason:P6t,ThemeColor:F6t,ThemeIcon:O6t,TreeItem:B6t,TreeItemCheckboxState:W6t,TreeItemCollapsibleState:H6t,TypeHierarchyItem:U6t,UIKind:V6t,Uri:z6t,ViewColumn:$6t,WorkspaceEdit:G6t,DocumentPasteTriggerKind:K6t,DocumentDropEdit:q6t,DocumentDropOrPasteEditKind:Q6t,DocumentPasteEdit:j6t,InlayHint:Y6t,InlayHintLabelPart:J6t,InlayHintKind:X6t,RemoteAuthorityResolverError:Z6t,ResolvedAuthority:eGt,ManagedResolvedAuthority:tGt,SourceControlInputBoxValidationType:iGt,ExtensionRuntime:nGt,TimelineItem:sGt,NotebookRange:oGt,NotebookCellKind:rGt,NotebookCellExecutionState:aGt,NotebookCellData:cGt,NotebookData:lGt,NotebookRendererScript:dGt,NotebookCellStatusBarAlignment:hGt,NotebookEditorRevealType:uGt,NotebookCellOutput:gGt,NotebookCellOutputItem:fGt,NotebookCellStatusBarItem:pGt,NotebookControllerAffinity:mGt,NotebookControllerAffinity2:_Gt,NotebookEdit:vGt,NotebookKernelSourceAction:bGt,NotebookVariablesRequestKind:wGt,PortAttributes:yGt,LinkedEditingRanges:CGt,TestResultState:SGt,TestRunRequest:AGt,TestMessage:EGt,TestMessage2:xGt,TestMessageStackFrame:DGt,TestTag:kGt,TestRunProfileKind:IGt,TextSearchCompleteMessageType:TGt,DataTransfer:LGt,DataTransferItem:RGt,TestCoverageCount:MGt,FileCoverage:NGt,FileCoverage2:PGt,StatementCoverage:FGt,BranchCoverage:OGt,DeclarationCoverage:BGt,LanguageStatusSeverity:WGt,QuickPickItemKind:HGt,InputBoxValidationSeverity:UGt,TabInputText:VGt,TabInputTextDiff:zGt,TabInputTextMerge:$Gt,TabInputCustom:GGt,TabInputNotebook:KGt,TabInputNotebookDiff:qGt,TabInputWebview:QGt,TabInputTerminal:jGt,TabInputInteractiveWindow:YGt,TabInputChat:JGt,TabInputTextMultiDiff:XGt,TelemetryTrustedValue:ZGt,LogLevel:eKt,EditSessionIdentityMatch:tKt,ChatCopyKind:iKt,DebugStackFrame:nKt,DebugThread:sKt,RelatedInformationType:oKt,SpeechToTextStatus:rKt,TextToSpeechStatus:aKt,PartialAcceptTriggerKind:cKt,KeywordRecognitionStatus:lKt,ChatResponseMarkdownPart:dKt,ChatResponseFileTreePart:hKt,ChatResponseAnchorPart:uKt,ChatResponseProgressPart:gKt,ChatResponseProgressPart2:fKt,ChatResponseReferencePart:pKt,ChatResponseReferencePart2:mKt,ChatResponseCodeCitationPart:_Kt,ChatResponseWarningPart:vKt,ChatResponseTextEditPart:bKt,ChatResponseMarkdownWithVulnerabilitiesPart:wKt,ChatResponseCommandButtonPart:yKt,ChatResponseDetectedParticipantPart:CKt,ChatResponseConfirmationPart:SKt,ChatResponseReferencePartStatusKind:AKt,ChatRequestTurn:EKt,ChatResponseTurn:xKt,ChatLocation:DKt,ChatRequestEditorData:kKt,ChatRequestNotebookData:IKt,LanguageModelChatMessageRole:TKt,LanguageModelChatMessage:LKt,LanguageModelChatMessageFunctionResultPart:RKt,LanguageModelChatResponseTextPart:MKt,LanguageModelChatResponseFunctionUsePart:NKt,LanguageModelError:PKt,NewSymbolName:FKt,NewSymbolNameTag:OKt,NewSymbolNameTriggerKind:BKt,InlineEdit:WKt,InlineEditTriggerKind:HKt,ExcludeSettingOptions:UKt,TextSearchContextNew:VKt,TextSearchMatchNew:zKt,TextSearchCompleteMessageTypeNew:$Kt}=j9t,GKt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:OGt,Breakpoint:m$t,CallHierarchyIncomingCall:y$t,CallHierarchyItem:C$t,CallHierarchyOutgoingCall:S$t,CancellationError:A$t,CancellationTokenSource:E$t,CandidatePortSource:x$t,ChatCompletionItem:w$t,ChatCopyKind:iKt,ChatLocation:DKt,ChatRequestEditorData:kKt,ChatRequestNotebookData:IKt,ChatRequestTurn:EKt,ChatResponseAnchorPart:uKt,ChatResponseCodeCitationPart:_Kt,ChatResponseCommandButtonPart:yKt,ChatResponseConfirmationPart:SKt,ChatResponseDetectedParticipantPart:CKt,ChatResponseFileTreePart:hKt,ChatResponseMarkdownPart:dKt,ChatResponseMarkdownWithVulnerabilitiesPart:wKt,ChatResponseProgressPart:gKt,ChatResponseProgressPart2:fKt,ChatResponseReferencePart:pKt,ChatResponseReferencePart2:mKt,ChatResponseReferencePartStatusKind:AKt,ChatResponseTextEditPart:bKt,ChatResponseTurn:xKt,ChatResponseWarningPart:vKt,ChatResultFeedbackKind:v$t,ChatVariableLevel:b$t,CodeAction:D$t,CodeActionKind:k$t,CodeActionTriggerKind:I$t,CodeLens:T$t,Color:L$t,ColorInformation:R$t,ColorPresentation:M$t,ColorThemeKind:N$t,CommentMode:P$t,CommentState:F$t,CommentThreadApplicability:W$t,CommentThreadCollapsibleState:O$t,CommentThreadFocus:H$t,CommentThreadState:B$t,CompletionItem:U$t,CompletionItemKind:V$t,CompletionItemTag:z$t,CompletionList:$$t,CompletionTriggerKind:G$t,ConfigurationTarget:K$t,CustomExecution:q$t,DataTransfer:LGt,DataTransferItem:RGt,DebugAdapterExecutable:Q$t,DebugAdapterInlineImplementation:j$t,DebugAdapterNamedPipeServer:Y$t,DebugAdapterServer:J$t,DebugConfigurationProviderTriggerKind:X$t,DebugConsoleMode:Z$t,DebugStackFrame:nKt,DebugThread:sKt,DebugVisualization:e7t,DeclarationCoverage:BGt,DecorationRangeBehavior:t7t,Diagnostic:i7t,DiagnosticRelatedInformation:n7t,DiagnosticSeverity:s7t,DiagnosticTag:o7t,Disposable:r7t,DocumentDropEdit:q6t,DocumentDropOrPasteEditKind:Q6t,DocumentHighlight:a7t,DocumentHighlightKind:c7t,DocumentLink:d7t,DocumentPasteEdit:j6t,DocumentPasteTriggerKind:K6t,DocumentSymbol:h7t,EditSessionIdentityMatch:tKt,EndOfLine:u7t,EnvironmentVariableMutatorType:g7t,EvaluatableExpression:f7t,EventEmitter:b7t,ExcludeSettingOptions:UKt,ExtensionKind:w7t,ExtensionMode:y7t,ExtensionRuntime:nGt,ExternalUriOpenerPriority:C7t,FileChangeType:S7t,FileCoverage:NGt,FileCoverage2:PGt,FileDecoration:A7t,FileDecoration2:E7t,FilePermission:k7t,FileSystemError:x7t,FileType:D7t,FoldingRange:I7t,FoldingRangeKind:T7t,FunctionBreakpoint:L7t,Hover:N7t,HoverVerbosityAction:F7t,IndentAction:O7t,InlayHint:Y6t,InlayHintKind:X6t,InlayHintLabelPart:J6t,InlineCompletionItem:R7t,InlineCompletionList:M7t,InlineCompletionTriggerKind:v7t,InlineEdit:WKt,InlineEditTriggerKind:HKt,InlineValueEvaluatableExpression:_7t,InlineValueText:p7t,InlineValueVariableLookup:m7t,InputBoxValidationSeverity:UGt,KeywordRecognitionStatus:lKt,LanguageModelChatMessage:LKt,LanguageModelChatMessageFunctionResultPart:RKt,LanguageModelChatMessageRole:TKt,LanguageModelChatResponseFunctionUsePart:NKt,LanguageModelChatResponseTextPart:MKt,LanguageModelError:PKt,LanguageStatusSeverity:WGt,LinkedEditingRanges:CGt,Location:B7t,LogLevel:eKt,ManagedResolvedAuthority:tGt,MarkdownString:W7t,MultiDocumentHighlight:l7t,NewSymbolName:FKt,NewSymbolNameTag:OKt,NewSymbolNameTriggerKind:BKt,NotebookCellData:cGt,NotebookCellExecutionState:aGt,NotebookCellKind:rGt,NotebookCellOutput:gGt,NotebookCellOutputItem:fGt,NotebookCellStatusBarAlignment:hGt,NotebookCellStatusBarItem:pGt,NotebookControllerAffinity:mGt,NotebookControllerAffinity2:_Gt,NotebookData:lGt,NotebookEdit:vGt,NotebookEditorRevealType:uGt,NotebookKernelSourceAction:bGt,NotebookRange:oGt,NotebookRendererScript:dGt,NotebookVariablesRequestKind:wGt,OverviewRulerLane:H7t,ParameterInformation:U7t,PartialAcceptTriggerKind:cKt,PortAttributes:yGt,PortAutoForwardAction:V7t,Position:z7t,ProcessExecution:$7t,ProgressLocation:G7t,QuickInputButtonLocation:K7t,QuickInputButtons:q7t,QuickPickItemKind:HGt,Range:Q7t,RelatedInformationType:oKt,RelativePattern:j7t,RemoteAuthorityResolverError:Z6t,ResolvedAuthority:eGt,Selection:Y7t,SelectionRange:J7t,SemanticTokens:X7t,SemanticTokensBuilder:Z7t,SemanticTokensEdit:e6t,SemanticTokensEdits:t6t,SemanticTokensLegend:i6t,ShellExecution:n6t,ShellQuoting:s6t,SignatureHelp:o6t,SignatureHelpTriggerKind:r6t,SignatureInformation:a6t,SnippetString:c6t,SnippetTextEdit:I6t,SourceBreakpoint:l6t,SourceControlInputBoxValidationType:iGt,SpeechToTextStatus:rKt,StandardTokenType:d6t,StatementCoverage:FGt,StatusBarAlignment:h6t,SymbolInformation:u6t,SymbolKind:g6t,SymbolTag:f6t,SyntaxTokenType:N6t,TabInputChat:JGt,TabInputCustom:GGt,TabInputInteractiveWindow:YGt,TabInputNotebook:KGt,TabInputNotebookDiff:qGt,TabInputTerminal:jGt,TabInputText:VGt,TabInputTextDiff:zGt,TabInputTextMerge:$Gt,TabInputTextMultiDiff:XGt,TabInputWebview:QGt,Task:p6t,TaskGroup:m6t,TaskPanelKind:_6t,TaskRevealKind:v6t,TaskScope:b6t,TelemetryTrustedValue:ZGt,TerminalExitReason:E6t,TerminalLink:w6t,TerminalLocation:S6t,TerminalOutputAnchor:_$t,TerminalProfile:A6t,TerminalQuickFixOpener:C6t,TerminalQuickFixTerminalCommand:y6t,TerminalShellExecutionCommandLineConfidence:x6t,TestCoverageCount:MGt,TestMessage:EGt,TestMessage2:xGt,TestMessageStackFrame:DGt,TestResultState:SGt,TestRunProfileKind:IGt,TestRunRequest:AGt,TestTag:kGt,TextDocumentChangeReason:P6t,TextDocumentSaveReason:D6t,TextEdit:k6t,TextEditorCursorStyle:T6t,TextEditorLineNumbersStyle:L6t,TextEditorRevealType:R6t,TextEditorSelectionChangeKind:M6t,TextSearchCompleteMessageType:TGt,TextSearchCompleteMessageTypeNew:$Kt,TextSearchContextNew:VKt,TextSearchMatchNew:zKt,TextToSpeechStatus:aKt,ThemeColor:F6t,ThemeIcon:O6t,TimelineItem:sGt,TreeItem:B6t,TreeItemCheckboxState:W6t,TreeItemCollapsibleState:H6t,TypeHierarchyItem:U6t,UIKind:V6t,Uri:z6t,VerboseHover:P7t,ViewColumn:$6t,WorkspaceEdit:G6t,ai:u$t,authentication:t$t,chat:g$t,commands:r$t,comments:e$t,debug:s$t,env:o$t,extensions:n$t,interactive:h$t,l10n:d$t,languages:l$t,lm:p$t,notebooks:X9t,scm:Z9t,setDefaultApi:Cnt,speech:f$t,tasks:J9t,tests:i$t,version:Y9t,window:a$t,workspace:c$t},Symbol.toStringTag,{value:"Module"}));zLt(async({toAdd:s,toRemove:e})=>{await vtt(),await Dt.get(fs).deltaExtensions(s,e)},(s,e)=>({toAdd:[...s.toAdd,...e.toAdd],toRemove:[...s.toRemove,...e.toRemove]}),0);const KKt=new Map;function qKt(s){return KKt.get(s)}let J5e=class extends V{constructor(e,t,i){super(),this.fileService=t,this.languagePackService=i}async $fetchBuiltInBundleUri(e,t){try{return await this.languagePackService.getBuiltInExtensionTranslationsUri(e,t)}catch{return}}async $fetchBundleContents(e){return(await this.fileService.readFile(N.revive(e))).value.toString()}};J5e=D([Gi(Be.MainThreadLocalization),_(1,Jt),_(2,hJe)],J5e);class hG{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var NV,HR;let JT=(HR=class extends KZ{static getOrCreate(e,t,i,n,o={}){const r=e.createInstance(NV,t,i,n,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=n,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this.editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!n.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(vt)}),this._register(h.onWillStop(m=>{this.isDirty()&&m.veto((async()=>{const v=u.findEditors(this);return!(v.length>0&&(await u.save(v[0])).success)})(),g(7872,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this.editorModelReference?.dispose(),this.editorModelReference=null,super.dispose()}get typeId(){return NV.ID}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),this.editorModelReference?this.editorModelReference.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}getDescription(e=Ls.MEDIUM){if(!this.hasCapability(Ei.Untitled)||this.editorModelReference?.object.hasAssociatedFilePath())return super.getDescription(e)}isReadonly(){return this.editorModelReference?this.editorModelReference.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this.editorModelReference?this.editorModelReference.object.isDirty():this._defaultDirtyState}isSaving(){const e=this.editorModelReference?.object;return!e||!e.isDirty()||e.hasErrorState||this.hasCapability(Ei.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this.editorModelReference)return this.hasCapability(Ei.Untitled)?this.saveAs(e,t):(await this.editorModelReference.object.save(t),this)}async saveAs(e,t){if(!this.editorModelReference)return;const i=this._notebookService.getContributedNotebookType(this.viewType);if(!i)return;const n=this.hasCapability(Ei.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this.editorModelReference.object.resource;let o;if(this.editorModelReference.object.hasAssociatedFilePath())o=n;else if(o=await this._fileDialogService.pickFileToSave(n,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:CQe(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${o} is not supported by ${i.providerDisplayName}. Please make sure the file name matches following patterns: -${r}`)}return await this._editorModelReference.object.saveAs(o)}async _suggestName(e,t){const i=e.selectors[0];let s=i&&typeof i=="string"?i:void 0;if(!s&&i){const o=i.include;typeof o=="string"&&(s=o)}if(s){const o=/^\*\.([A-Za-z_-]*)$/.exec(s);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return Qt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return Qt(await this._fileDialogService.defaultFilePath(),t)}async rename(e,t){if(this._editorModelReference)return{editor:{resource:t},options:{override:this.viewType}}}async revert(e,t){this._editorModelReference&&this._editorModelReference.object.isDirty()&&await this._editorModelReference.object.revert(t)}async resolve(e,t){if(!await this._notebookService.canResolve(this.viewType))return null;if(t?.mark("extensionActivated"),this._sideLoadedListener.dispose(),this._editorModelReference)this._editorModelReference.object.load({limits:this.ensureLimits(e)});else{const i=await this._notebookModelResolverService.resolve(this.resource,this.viewType,this.ensureLimits(e));if(this._editorModelReference)return i.dispose(),this._editorModelReference.object;if(this._editorModelReference=i,this.isDisposed())return this._editorModelReference.dispose(),this._editorModelReference=null,null;this._register(this._editorModelReference.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._editorModelReference.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._register(this._editorModelReference.object.onDidRevertUntitled(()=>this.dispose())),this._editorModelReference.object.isDirty()&&this._onDidChangeDirty.fire()}if(this.options._backupId){const i=await this._notebookService.withNotebookDataProvider(this._editorModelReference.object.notebook.viewType);if(!(i instanceof tj))throw new Error("CANNOT open file notebook with this provider");const s=await i.serializer.dataToNotebook(ze.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this._editorModelReference.object.notebook.applyEdits([{editType:G1.Replace,index:0,count:this._editorModelReference.object.notebook.length,cells:s.cells}],!0,void 0,()=>{},void 0,!1),this.options._workingCopy&&(this.options._backupId=void 0,this.options._workingCopy=void 0,this.options.startDirty=void 0)}return this._editorModelReference.object}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}matches(e){return super.matches(e)?!0:e instanceof z3?this.viewType===e.viewType&&_n(this.resource,e.resource):!1}},z3=TP,TP.ID="workbench.input.notebook",TP);VM=z3=D([_(4,oD),_(5,Jde),_(6,bf),_(7,eo),_(8,ci),_(9,hh),_(10,ho),_(11,_i),_(12,dl),_(13,aD)],VM);function OQt(n){return!!n&&typeof n=="object"&&Array.isArray(n.editorInputs)&&n.editorInputs.every(e=>e instanceof VM)}const Hot="jupyter-notebook",BQt="ms-toolsai.jupyter",Uot=new Map;Uot.set(Hot,new Map);Uot.get(Hot)?.set("python",{extensionIds:["ms-python.python",BQt],displayName:"Python + Jupyter"});var v$e;(function(n){n[n.Html=0]="Html",n[n.Extension=1]="Extension"})(v$e||(v$e={}));var w$e;(function(n){n[n.fullCell=0]="fullCell",n[n.firstLine=1]="firstLine"})(w$e||(w$e={}));var b$e;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Estimated=1]="Estimated",n[n.FromCache=2]="FromCache",n[n.Measured=3]="Measured"})(b$e||(b$e={}));var C$e;(function(n){n[n.Fold=0]="Fold"})(C$e||(C$e={}));var y$e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(y$e||(y$e={}));var S$e;(function(n){n[n.Default=1]="Default",n[n.Top=2]="Top",n[n.Center=3]="Center",n[n.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",n[n.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",n[n.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(S$e||(S$e={}));var A$e;(function(n){n[n.Default=1]="Default",n[n.Center=2]="Center",n[n.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(A$e||(A$e={}));var E$e;(function(n){n[n.Preview=0]="Preview",n[n.Editing=1]="Editing"})(E$e||(E$e={}));var x$e;(function(n){n[n.Container=0]="Container",n[n.Editor=1]="Editor",n[n.Output=2]="Output",n[n.ChatInput=3]="ChatInput"})(x$e||(x$e={}));var D$e;(function(n){n[n.None=0]="None",n[n.Top=1]="Top",n[n.Bottom=2]="Bottom",n[n.Both=3]="Both"})(D$e||(D$e={}));var k$e;(function(n){n[n.None=0]="None",n[n.Start=1]="Start",n[n.End=2]="End",n[n.Both=3]="Both"})(k$e||(k$e={}));function tH(n){if(!n)return;if(n.getId()===g7t)return n.getControl();const e=n.input;if(e&&OQt(e))return n.getControl()?.notebookEditor}var I$e;(function(n){n[n.None=0]="None",n[n.Expanded=1]="Expanded",n[n.Collapsed=2]="Collapsed"})(I$e||(I$e={}));class iH extends _Q{static is(e){return e instanceof iH?!0:P.isUri(e.resource)&&fo(e.cellEdit)}static lift(e){return e instanceof iH?e:new iH(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let L$e=class{constructor(e,t,i,s,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=s,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Zne.scheme){const l=Zne.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new iH(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=yU(this._edits,(i,s)=>lw(i.resource.toString(),s.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[s]=i,o=await this._notebookModelService.resolve(s.resource);if(typeof s.notebookVersionId=="number"&&o.object.notebook.versionId!==s.notebookVersionId)throw o.dispose(),new Error(`Notebook '${s.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=tH(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:tke.Index,focus:c.getFocus(),selections:c.getSelections()}:void 0;o.object.notebook.applyEdits(r,!0,l,()=>{},this._undoRedoGroup,a),o.dispose(),this._progress.report(void 0),e.push(s.resource)}return e}};L$e=D([_(5,_i),_(6,Jde)],L$e);let T$e=class{constructor(e,t,i,s){this._bulkEditService=t,this._logService=i,this._uriIdentService=s}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const s=AS(e.value,this._uriIdentService);return this._bulkEditService.apply(s,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};T$e=D([en(Ue.MainThreadBulkEdits),_(1,vO),_(2,Ze),_(3,_o)],T$e);function AS(n,e,t){if(!n||!n.edits)return n;const i=Or(n);for(const s of i.edits){if(vS.is(s)&&(s.resource=e.asCanonicalUri(s.resource)),up.is(s)){if(s.options){const o=s.options?.contents;if(o)if(o.type==="base64")s.options.contents=Promise.resolve(Tje(o.value));else if(t)s.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}s.newResource=s.newResource&&e.asCanonicalUri(s.newResource),s.oldResource=s.oldResource&&e.asCanonicalUri(s.oldResource)}if(iH.is(s)){s.resource=e.asCanonicalUri(s.resource);const o=s.cellEdit;o.editType===G1.Replace&&(s.cellEdit={...o,cells:o.cells.map(r=>({...r,outputs:r.outputs.map(a=>({...a,outputs:a.items.map(c=>({mime:c.mime,data:c.valueBytes}))}))}))})}}return n}const tue="__",WQt="vs/workbench/api/browser/mainThreadLanguageModels";let R$e=class{constructor(e,t,i,s,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=s,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatProvider),this._proxy.$acceptChatModelMetadata({added:t.getLanguageModelIds().map(c=>({identifier:c,metadata:t.lookupLanguageModel(c)}))}),this._store.add(t.onDidChangeLanguageModels(this._proxy.$acceptChatModelMetadata,this._proxy))}dispose(){this._providerRegistrations.dispose(),this._store.dispose()}$registerLanguageModelProvider(e,t,i){const s=new Z;s.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,provideChatResponse:async(o,r,a,c,l)=>{const d=Math.random()*1e6|0;this._pendingProgress.set(d,c);try{await this._proxy.$provideLanguageModelResponse(e,d,r,o,a,l)}finally{this._pendingProgress.delete(d)}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&s.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,s)}async $handleProgressChunk(e,t){this._pendingProgress.get(e)?.report(t)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,s){this._languageModelStatsService.update(e,t,i,s)}async $fetchResponse(e,t,i,s,o,r){this._logService.debug("[CHAT] extension request STARTED",e.value,i);const a=this._chatProviderService.makeLanguageModelChatRequest(t,e,s,o,new cf(c=>{this._proxy.$handleResponseFragment(i,c)}),r);return a.catch(c=>{throw this._logService.error("[CHAT] extension request ERRORED",c,e.value,i),c}).finally(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i)}),a}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=tue+e.value;if(this._authenticationService.getProviderIds().includes(i))return $.None;const s=t.accountLabel??g(WQt,0,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new HQt(i,t.providerLabel,s)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,s),c=[];for(const l of a){const d=await this._extensionService.getExtension(l.id);d&&c.push({from:d.identifier,to:e,enabled:l.allowed??!0})}this._proxy.$updateModelAccesslist(c)})),o}};R$e=D([en(Ue.MainThreadLanguageModels),_(1,HZe),_(2,Ret),_(3,Ze),_(4,FPe),_(5,ehe),_(6,ho)],R$e);class HQt{constructor(e,t,i){this.id=e,this.label=t,this._accountLabel=i,this.supportsMultipleAccounts=!1,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event}async getSessions(e){return e===void 0&&!this._session?[]:this._session?[this._session]:[await this.createSession(e||[],{})]}async createSession(e,t){return this._session=this._createFakeSession(e),this._onDidChangeSessions.fire({added:[this._session],changed:[],removed:[]}),this._session}removeSession(e){return this._session&&(this._onDidChangeSessions.fire({added:[],changed:[],removed:[this._session]}),this._session=void 0),Promise.resolve()}_createFakeSession(e){return{id:"fake-session",account:{id:this.id,label:this._accountLabel},accessToken:"fake-access-token",scopes:e}}}var yke;const M$e="vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables",UQt="chat-dynamic-variable";var RP;let bG=(RP=class extends ${get variables(){return[...this._variables]}get id(){return yke.ID}constructor(e,t,i){super(),this.widget=e,this.labelService=t,this.logService=i,this._variables=[],this._register(e.inputEditor.onDidChangeModelContent(s=>{s.changes.forEach(o=>{this._variables=Vi(this._variables.map(r=>{const a=O.intersectRanges(r.range,o.range);if(a&&!a.isEmpty()){const c=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);return this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}]),null}else if(O.compareRangesUsingStarts(r.range,o.range)>0){const c=o.text.length-o.rangeLength;return{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r}))}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){if(!Array.isArray(e)){this.logService.warn("ChatDynamicVariableModel.setInputState called with invalid state: "+JSON.stringify(e));return}this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",UQt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return P.isUri(t)?new Xt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},yke=RP,RP.ID="chatDynamicVariableModel",RP);bG=yke=D([_(1,eo),_(2,Ze)],bG);A6.CONTRIBS.push(bG);function VQt(n){return"widget"in n&&"range"in n}const ty=class ty extends pi{constructor(){super({id:ty.ID,title:""})}async run(e,...t){const i=e.get(Rn),s=e.get(Ze),o=e.get(On),r=e.get(Mz),a=t[0];if(!VQt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(ty.Name)&&(l={providerOptions:{additionPicks:[ty.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){s.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===ty.Item){const w=`#${ty.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:w+" "}])||(s.trace(`SelectAndInsertFileAction: failed to insert "${w}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){s.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${ui(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){s.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(bG.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};ty.Name="files",ty.Item={label:g(M$e,0,"All Files"),description:g(M$e,1,"Search for relevant files in the workspace and provide context from them")},ty.ID="workbench.action.chat.selectAndInsertFile";let Ske=ty;At(Ske);function zQt(n){return"widget"in n&&"range"in n&&"variableData"in n}const nle=class nle extends pi{constructor(){super({id:nle.ID,title:""})}async run(e,...t){const i=t[0];if(!zQt(i))return;let s=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(ji).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new O(s.startLineNumber,s.endColumn,s.endLineNumber,s.endColumn+l.length);if(s=new O(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(bG.ID)?.addReference({id:i.id,range:s,data:o})}};nle.ID="workbench.action.chat.addDynamicVariable";let Bse=nle;At(Bse);class $Qt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new sd,this._onDidAddProgress=new I,this.progress=[]}task(){return this.deferred.p}isSettled(){return this.deferred.isSettled}complete(e){this.deferred.complete(e)}add(e){this.progress.push(e),this._onDidAddProgress.fire(e)}}let N$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=s,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new Zo),this._agentCompletionProviders=this._register(new Zo),this._agentIdsToCompletionProviders=this._register(new Zo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(et.ExtHostChatAgents2),this._register(this._chatService.onDidDisposeSession(l=>{this._proxy.$releaseSession(l.sessionId)})),this._register(this._chatService.onDidPerformUserAction(l=>{if(typeof l.agentId=="string"){for(const[d,h]of this._agents)if(h.id===l.agentId){l.action.kind==="vote"?this._proxy.$acceptFeedback(d,l.result??{},l.action.direction):this._proxy.$acceptAction(d,l.result||{},l);break}}}))}$unregisterAgent(e){this._agents.deleteAndDispose(e)}$transferActiveChatSession(e){const t=this._chatWidgetService.lastFocusedWidget,i=t?.viewModel?.model.sessionId;if(!i){this._logService.error("MainThreadChat#$transferActiveChatSession: No active chat session found");return}const s=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:s},P.revive(e))}$registerAgent(e,t,i,s,o){const r=this._chatAgentService.getAgent(i);if(!r&&!o)throw this._chatAgentService.getAgentsByName(i).length?new Error(`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${i}"`):new Error(`chatParticipant must be declared in package.json: ${i}`);const a={invoke:async(l,d,h,u)=>{this._pendingProgress.set(l.requestId,d);try{return await this._proxy.$invokeAgent(e,l,{history:h},u)??{}}finally{this._pendingProgress.delete(l.requestId)}},provideFollowups:async(l,d,h,u)=>this._agents.get(e)?.hasFollowups?this._proxy.$provideFollowups(l,e,d,{history:h},u):[],provideWelcomeMessage:(l,d)=>this._proxy.$provideWelcomeMessage(e,l,d),provideSampleQuestions:(l,d)=>this._proxy.$provideSampleQuestions(e,l,d)};let c;if(!r&&o){const l=this._extensionService.extensions.find(d=>Cn.equals(d.identifier,t));c=this._chatAgentService.registerDynamicAgent({id:i,name:o.name??"",description:o.description,extensionId:t,extensionDisplayName:l?.displayName??t.value,extensionPublisherId:l?.publisher??"",publisherDisplayName:o.publisherName,fullName:o.fullName,metadata:Or(s),slashCommands:[],locations:[lc.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:s.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i)throw new Error(`No agent with handle ${e} registered`);i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Or(t))}async $handleProgressChunk(e,t,i){const s=Or(t);if(s.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new $Qt(s.content);return this._activeTasks.set(r,a),this._pendingProgress.get(e)?.(a),o}else if(i!==void 0){const o=`${e}_${i}`,r=this._activeTasks.get(o);switch(s.kind){case"progressTaskResult":return r&&s.content?(r.complete(s.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(s);return}}this._pendingProgress.get(e)?.(s)}$registerAgentCompletionsProvider(e,t,i){const s=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?$e.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,s)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:b6.INPUT_SCHEME,hasAccessToAllModels:!0},{_debugDisplayName:"chatAgentCompletions:"+e,triggerCharacters:i,provideCompletionItems:async(o,r,a,c)=>{const l=this._chatWidgetService.getWidgetByInputUri(o.uri);if(!l||!l.viewModel)return;const d=i.map(C=>Iu(C)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=a1(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(C=>u.startsWith(C)))return;const p=this._instantiationService.createInstance(mne).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(C=>C instanceof tp),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=GQt(o,r,h);return v?{suggestions:(await s(u,c)).map(C=>{const y=C.insertText??(typeof C.label=="string"?C.label:C.label.label),S=new O(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+y.length);return{label:C.label,range:v,insertText:y+" ",kind:Ne.Text,detail:C.detail,documentation:C.documentation,command:{id:Bse.ID,title:"",arguments:[{id:C.id,widget:l,range:S,variableData:Or(C.value),command:C.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};N$e=D([en(Ue.MainThreadChatAgents2),_(1,yp),_(2,Rw),_(3,ht),_(4,lL),_(5,be),_(6,Ze),_(7,ho)],N$e);function GQt(n,e,t){const i=a1(e.column,t,n.getLineContent(e.lineNumber),0);if(!i&&n.getWordUntilPosition(e).word)return;let s,o;return i?(s=new O(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new O(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):s=o=O.fromPositions(e),{insert:s,replace:o}}let P$e=class{constructor(e,t){this._chatVariablesService=t,this._variables=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(s,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Or(await this._proxy.$resolveVariable(e,l,s,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Or(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}$attachContext(e,t,i){this._chatVariablesService.attachContext(e,Or(t),i)}};P$e=D([en(Ue.MainThreadChatVariables),_(1,Mz)],P$e);const Vot=ae("embeddingsService");class qQt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.providers=new Map}get allProviders(){return this.providers.keys()}registerProvider(e,t){return this.providers.set(e,t),this._onDidChange.fire(),{dispose:()=>{this.providers.delete(e),this._onDidChange.fire()}}}computeEmbeddings(e,t,i){const s=this.providers.get(e);return s?s.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(Vot,qQt,Yt.Delayed);let F$e=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new Zo),this._proxy=e.getProxy(et.ExtHostEmbeddings),this._store.add(t.onDidChange(()=>{this._proxy.$acceptEmbeddingModels(Array.from(t.allProviders))}))}dispose(){this._store.dispose()}$registerEmbeddingProvider(e,t){const i=this.embeddingsService.registerProvider(t,{provideEmbeddings:(s,o)=>this._proxy.$provideEmbeddings(e,s,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};F$e=D([en(Ue.MainThreadEmbeddings),_(1,Vot)],F$e);class QQt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function zot(n,e){if(e.serializeBuffersForPostMessage){const t=new QQt,s=JSON.stringify(n,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=jQt(a);if(c)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:c,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),o=t.buffers.map(r=>{const a=new Uint8Array(r);return ze.wrap(a)});return{message:s,buffers:o}}else return{message:JSON.stringify(n),buffers:[]}}function jQt(n){switch(n.constructor.name){case"Int8Array":return ol.Int8Array;case"Uint8Array":return ol.Uint8Array;case"Uint8ClampedArray":return ol.Uint8ClampedArray;case"Int16Array":return ol.Int16Array;case"Uint16Array":return ol.Uint16Array;case"Int32Array":return ol.Int32Array;case"Uint32Array":return ol.Uint32Array;case"Float32Array":return ol.Float32Array;case"Float64Array":return ol.Float64Array;case"BigInt64Array":return ol.BigInt64Array;case"BigUint64Array":return ol.BigUint64Array}}function $ot(n,e){const t=e.map(o=>{const r=new ArrayBuffer(o.byteLength);return new Uint8Array(r).set(o.buffer),r}),i=e.length?(o,r)=>{if(r&&typeof r=="object"&&r.$$vscode_array_buffer_reference$$){const a=r,{index:c}=a,l=t[c];if(a.view)switch(a.view.type){case ol.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case ol.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case ol.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case ol.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case ol.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case ol.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case ol.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case ol.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case ol.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case ol.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case ol.BigUint64Array:return new BigUint64Array(l,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return l}return r}:void 0;return{message:JSON.parse(n,i),arrayBuffers:t}}var Ake;const KQt="vs/workbench/api/browser/mainThreadWebviews";var MP;let Eke=(MP=class extends ${constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(et.ExtHostWebviews)}addWebview(e,t,i){if(this._webviews.has(e))throw new Error("Webview already registered");this._webviews.set(e,t),this.hookupWebviewEventDelegate(e,t,i)}$setHtml(e,t){this.tryGetWebview(e)?.setHtml(t)}$setOptions(e,t){const i=this.tryGetWebview(e);i&&(i.contentOptions=Hse(t))}async $postMessage(e,t,...i){const s=this.tryGetWebview(e);if(!s)return!1;const{message:o,arrayBuffers:r}=$ot(t,i);return s.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const s=new Z;s.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),s.add(t.onMessage(o=>{const r=zot(o.message,i);this._proxy.$onMessage(e,r.message,new $h(r.buffers))})),s.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),s.add(t.onDidDispose(()=>{s.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,P.parse(t))&&this._openerService.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Array.isArray(i.contentOptions.enableCommandUris)||i.contentOptions.enableCommandUris===!0,fromWorkspace:!0})}isSupportedLink(e,t){return Ake.standardSupportedLinkSchemes.has(t.scheme)||!Jn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===_e.command?Array.isArray(e.contentOptions.enableCommandUris)?e.contentOptions.enableCommandUris.includes(t.path):e.contentOptions.enableCommandUris===!0:!1}tryGetWebview(e){return this._webviews.get(e)}getWebview(e){const t=this.tryGetWebview(e);if(!t)throw new Error(`Unknown webview handle:${e}`);return t}getWebviewResolvedFailedContent(e){return` +${r}`)}return await this.editorModelReference.object.saveAs(o)}async _suggestName(e,t){const i=e.selectors[0];let n=i&&typeof i=="string"?i:void 0;if(!n&&i){const o=i.include;typeof o=="string"&&(n=o)}if(n){const o=/^\*\.([A-Za-z_-]*)$/.exec(n);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return Pt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return Pt(await this._fileDialogService.defaultFilePath(),t)}async rename(e,t){if(this.editorModelReference)return{editor:{resource:t},options:{override:this.viewType}}}async revert(e,t){this.editorModelReference&&this.editorModelReference.object.isDirty()&&await this.editorModelReference.object.revert(t)}async resolve(e,t){if(!await this._notebookService.canResolve(this.viewType))return null;if(t?.mark("extensionActivated"),this._sideLoadedListener.dispose(),this.editorModelReference)this.editorModelReference.object.load({limits:this.ensureLimits(e)});else{const i=!!(this.capabilities&Ei.Scratchpad),n=await this._notebookModelResolverService.resolve(this.resource,this.viewType,{limits:this.ensureLimits(e),scratchpad:i});if(this.editorModelReference)return n.dispose(),this.editorModelReference.object;if(this.editorModelReference=n,this.isDisposed())return this.editorModelReference.dispose(),this.editorModelReference=null,null;this._register(this.editorModelReference.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.editorModelReference.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._register(this.editorModelReference.object.onDidRevertUntitled(()=>this.dispose())),this.editorModelReference.object.isDirty()&&this._onDidChangeDirty.fire()}if(this.options._backupId){const i=await this._notebookService.withNotebookDataProvider(this.editorModelReference.object.notebook.viewType);if(!(i instanceof hG))throw new Error("CANNOT open file notebook with this provider");const n=await i.serializer.dataToNotebook($e.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this.editorModelReference.object.notebook.applyEdits([{editType:dI.Replace,index:0,count:this.editorModelReference.object.notebook.length,cells:n.cells}],!0,void 0,()=>{},void 0,!1),this.options._workingCopy&&(this.options._backupId=void 0,this.options._workingCopy=void 0,this.options.startDirty=void 0)}return this.editorModelReference.object}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}matches(e){return super.matches(e)?!0:e instanceof NV?this.viewType===e.viewType&&ji(this.resource,e.resource):!1}},NV=HR,HR.ID="workbench.input.notebook",HR);JT=NV=D([_(4,tE),_(5,$ae),_(6,ag),_(7,Fs),_(8,Jt),_(9,_d),_(10,fs),_(11,ei),_(12,Ec),_(13,nE)],JT);function QKt(s){return!!s&&typeof s=="object"&&Array.isArray(s.editorInputs)&&s.editorInputs.every(e=>e instanceof JT)}const Snt="jupyter-notebook",jKt="ms-toolsai.jupyter",Ant=new Map;Ant.set(Snt,new Map);Ant.get(Snt)?.set("python",{extensionIds:["ms-python.python",jKt],displayName:"Python + Jupyter"});var X5e;(function(s){s[s.Html=0]="Html",s[s.Extension=1]="Extension"})(X5e||(X5e={}));var Z5e;(function(s){s[s.fullCell=0]="fullCell",s[s.firstLine=1]="firstLine"})(Z5e||(Z5e={}));var eze;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Estimated=1]="Estimated",s[s.FromCache=2]="FromCache",s[s.Measured=3]="Measured"})(eze||(eze={}));var tze;(function(s){s[s.Fold=0]="Fold"})(tze||(tze={}));var ize;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(ize||(ize={}));var nze;(function(s){s[s.Default=1]="Default",s[s.Top=2]="Top",s[s.Center=3]="Center",s[s.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",s[s.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",s[s.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(nze||(nze={}));var sze;(function(s){s[s.Default=1]="Default",s[s.Center=2]="Center",s[s.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(sze||(sze={}));var oze;(function(s){s[s.Preview=0]="Preview",s[s.Editing=1]="Editing"})(oze||(oze={}));var rze;(function(s){s[s.Container=0]="Container",s[s.Editor=1]="Editor",s[s.Output=2]="Output",s[s.ChatInput=3]="ChatInput"})(rze||(rze={}));var aze;(function(s){s[s.None=0]="None",s[s.Top=1]="Top",s[s.Bottom=2]="Bottom",s[s.Both=3]="Both"})(aze||(aze={}));var cze;(function(s){s[s.None=0]="None",s[s.Start=1]="Start",s[s.End=2]="End",s[s.Both=3]="Both"})(cze||(cze={}));function nB(s){if(!s)return;if(s.getId()===R9t)return s.getControl();const e=s.input;if(e&&QKt(e)||s.getId()===M9t)return s.getControl()?.notebookEditor}var lze;(function(s){s[s.None=0]="None",s[s.Expanded=1]="Expanded",s[s.Collapsed=2]="Collapsed"})(lze||(lze={}));class sB extends gae{static is(e){return e instanceof sB?!0:N.isUri(e.resource)&&kn(e.cellEdit)}static lift(e){return e instanceof sB?e:new sB(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let dze=class{constructor(e,t,i,n,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=n,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Ree.scheme){const l=Ree.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new sB(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=i8(this._edits,(i,n)=>gm(i.resource.toString(),n.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[n]=i,o=await this._notebookModelService.resolve(n.resource);if(typeof n.notebookVersionId=="number"&&o.object.notebook.versionId!==n.notebookVersionId)throw o.dispose(),new Error(`Notebook '${n.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=nB(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:WAe.Index,focus:c.getFocus(),selections:c.getSelections()}:void 0;o.object.notebook.applyEdits(r,!0,l,()=>{},this._undoRedoGroup,a),o.dispose(),this._progress.report(void 0),e.push(n.resource)}return e}};dze=D([_(5,ei),_(6,$ae)],dze);let hze=class{constructor(e,t,i,n){this._bulkEditService=t,this._logService=i,this._uriIdentService=n}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const n=By(e.value,this._uriIdentService);return this._bulkEditService.apply(n,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};hze=D([Gi(Be.MainThreadBulkEdits),_(1,PN),_(2,Ge),_(3,ks)],hze);function By(s,e,t){if(!s||!s.edits)return s;const i=Mo(s);for(const n of i.edits){if(tA.is(n)&&(n.resource=e.asCanonicalUri(n.resource)),cp.is(n)){if(n.options){const o=n.options?.contents;if(o)if(o.type==="base64")n.options.contents=Promise.resolve(dKe(o.value));else if(t)n.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}n.newResource=n.newResource&&e.asCanonicalUri(n.newResource),n.oldResource=n.oldResource&&e.asCanonicalUri(n.oldResource)}if(sB.is(n)){n.resource=e.asCanonicalUri(n.resource);const o=n.cellEdit;o.editType===dI.Replace&&(n.cellEdit={...o,cells:o.cells.map(r=>({...r,outputs:r.outputs.map(a=>({...a,outputs:a.items.map(c=>({mime:c.mime,data:c.valueBytes}))}))}))})}}return s}const zce="__";let uze=class{constructor(e,t,i,n,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=n,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.ExtHostChatProvider),this._proxy.$acceptChatModelMetadata({added:t.getLanguageModelIds().map(c=>({identifier:c,metadata:t.lookupLanguageModel(c)}))}),this._store.add(t.onDidChangeLanguageModels(this._proxy.$acceptChatModelMetadata,this._proxy))}dispose(){this._providerRegistrations.dispose(),this._store.dispose()}$registerLanguageModelProvider(e,t,i){const n=new Z;n.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,sendChatRequest:async(o,r,a,c)=>{const l=Math.random()*1e6|0,d=new dc,h=new P2;try{this._pendingProgress.set(l,{defer:d,stream:h}),await this._proxy.$startChatRequest(e,l,r,o,a,c)}catch(u){throw this._pendingProgress.delete(l),u}return{result:d.p,stream:h.asyncIterable}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&n.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,n)}async $reportResponsePart(e,t){const i=this._pendingProgress.get(e);this._logService.trace("[LM] report response PART",!!i,e,t),i&&i.stream.emitOne(t)}async $reportResponseDone(e,t){const i=this._pendingProgress.get(e);if(this._logService.trace("[LM] report response DONE",!!i,e,t),i)if(this._pendingProgress.delete(e),t){const n=l8(t);i.stream.reject(n),i.defer.error(n)}else i.stream.resolve(),i.defer.complete(void 0)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,n){this._languageModelStatsService.update(e,t,i,n)}async $tryStartChatRequest(e,t,i,n,o,r){this._logService.trace("[CHAT] request STARTED",e.value,i);const a=await this._chatProviderService.sendChatRequest(t,e,n,o,r),c=(async()=>{try{for await(const l of a.stream)this._logService.trace("[CHAT] request PART",e.value,i,l),await this._proxy.$acceptResponsePart(i,l);this._logService.trace("[CHAT] request DONE",e.value,i)}catch(l){this._logService.error("[CHAT] extension request ERRORED in STREAM",l,e.value,i),this._proxy.$acceptResponseDone(i,SA(l))}})();Promise.allSettled([a.result,c]).then(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i),this._proxy.$acceptResponseDone(i,void 0)},l=>{this._logService.error("[CHAT] extension request ERRORED",l,e.value,i),this._proxy.$acceptResponseDone(i,SA(l))})}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=zce+e.value;if(this._authenticationService.getProviderIds().includes(i))return V.None;const n=t.accountLabel??g(4828,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new YKt(i,t.providerLabel,n)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,n),c=[];for(const l of a){const d=await this._extensionService.getExtension(l.id);d&&c.push({from:d.identifier,to:e,enabled:l.allowed??!0})}this._proxy.$updateModelAccesslist(c)})),o}};uze=D([Gi(Be.MainThreadLanguageModels),_(1,IJe),_(2,_Xe),_(3,Ge),_(4,sMe),_(5,Qae),_(6,fs)],uze);class YKt{constructor(e,t,i){this.id=e,this.label=t,this._accountLabel=i,this.supportsMultipleAccounts=!1,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event}async getSessions(e){return e===void 0&&!this._session?[]:this._session?[this._session]:[await this.createSession(e||[])]}async createSession(e){return this._session=this._createFakeSession(e),this._onDidChangeSessions.fire({added:[this._session],changed:[],removed:[]}),this._session}removeSession(e){return this._session&&(this._onDidChangeSessions.fire({added:[],changed:[],removed:[this._session]}),this._session=void 0),Promise.resolve()}_createFakeSession(e){return{id:"fake-session",account:{id:this.id,label:this._accountLabel},accessToken:"fake-access-token",scopes:e}}}var sEe;const JKt="chat-dynamic-variable";var UR;let u$=(UR=class extends V{get variables(){return[...this._variables]}get id(){return sEe.ID}constructor(e,t){super(),this.widget=e,this.labelService=t,this._variables=[],this._onDidChangeInputState=this._register(new I),this.onDidChangeInputState=this._onDidChangeInputState.event,this._register(e.inputEditor.onDidChangeModelContent(i=>{i.changes.forEach(n=>{let o=!1;this._variables=Fi(this._variables.map(r=>{const a=F.intersectRanges(r.range,n.range);if(a&&!a.isEmpty()){if(!F.containsRange(n.range,r.range)){const c=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}])}return o=!0,null}else if(F.compareRangesUsingStarts(r.range,n.range)>0){const c=n.text.length-n.rangeLength;return o=!0,{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r})),o&&this._onDidChangeInputState.fire()}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){Array.isArray(e)||(e=[]),this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations(),this._onDidChangeInputState.fire()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",JKt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return N.isUri(t)?new Mt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},sEe=UR,UR.ID="chatDynamicVariableModel",UR);u$=sEe=D([_(1,Fs)],u$);y9.CONTRIBS.push(u$);function XKt(s){return"widget"in s&&"range"in s}const Dw=class Dw extends li{constructor(){super({id:Dw.ID,title:""})}async run(e,...t){const i=e.get(fn),n=e.get(Ge),o=e.get(In),r=e.get(L6),a=t[0];if(!XKt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(Dw.Name)&&(l={providerOptions:{additionPicks:[Dw.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){n.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===Dw.Item){const b=`#${Dw.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:b+" "}])||(n.trace(`SelectAndInsertFileAction: failed to insert "${b}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){n.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${_i(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){n.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(u$.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};Dw.Name="files",Dw.Item={label:g(7003,"All Files"),description:g(7004,"Search for relevant files in the workspace and provide context from them")},Dw.ID="workbench.action.chat.selectAndInsertFile";let oEe=Dw;At(oEe);function ZKt(s){return"widget"in s&&"range"in s&&"variableData"in s}const $oe=class $oe extends li{constructor(){super({id:$oe.ID,title:""})}async run(e,...t){const i=t[0];if(!ZKt(i))return;let n=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(vi).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new F(n.startLineNumber,n.endColumn,n.endLineNumber,n.endColumn+l.length);if(n=new F(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(u$.ID)?.addReference({id:i.id,range:n,data:o})}};$oe.ID="workbench.action.chat.addDynamicVariable";let bte=$oe;At(bte);class eqt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new dc,this._onDidAddProgress=new I,this.progress=[]}task(){return this.deferred.p}isSettled(){return this.deferred.isSettled}complete(e){this.deferred.complete(e)}add(e){this.progress.push(e),this._onDidAddProgress.fire(e)}}let gze=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=n,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new mo),this._agentCompletionProviders=this._register(new mo),this._agentIdsToCompletionProviders=this._register(new mo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(Ye.ExtHostChatAgents2),this._register(this._chatService.onDidDisposeSession(l=>{this._proxy.$releaseSession(l.sessionId)})),this._register(this._chatService.onDidPerformUserAction(l=>{if(typeof l.agentId=="string"){for(const[d,h]of this._agents)if(h.id===l.agentId){l.action.kind==="vote"?this._proxy.$acceptFeedback(d,l.result??{},l.action.direction):this._proxy.$acceptAction(d,l.result||{},l);break}}}))}$unregisterAgent(e){this._agents.deleteAndDispose(e)}$transferActiveChatSession(e){const t=this._chatWidgetService.lastFocusedWidget,i=t?.viewModel?.model.sessionId;if(!i){this._logService.error("MainThreadChat#$transferActiveChatSession: No active chat session found");return}const n=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:n},N.revive(e))}$registerAgent(e,t,i,n,o){const r=this._chatAgentService.getAgent(i);if(!r&&!o)throw this._chatAgentService.getAgentsByName(i).length?new Error(`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${i}"`):new Error(`chatParticipant must be declared in package.json: ${i}`);const a={invoke:async(l,d,h,u)=>{this._pendingProgress.set(l.requestId,d);try{return await this._proxy.$invokeAgent(e,l,{history:h},u)??{}}finally{this._pendingProgress.delete(l.requestId)}},provideFollowups:async(l,d,h,u)=>this._agents.get(e)?.hasFollowups?this._proxy.$provideFollowups(l,e,d,{history:h},u):[],provideWelcomeMessage:(l,d)=>this._proxy.$provideWelcomeMessage(e,l,d),provideSampleQuestions:(l,d)=>this._proxy.$provideSampleQuestions(e,l,d)};let c;if(!r&&o){const l=this._extensionService.extensions.find(d=>Sn.equals(d.identifier,t));c=this._chatAgentService.registerDynamicAgent({id:i,name:o.name??"",description:o.description,extensionId:t,extensionDisplayName:l?.displayName??t.value,extensionPublisherId:l?.publisher??"",publisherDisplayName:o.publisherName,fullName:o.fullName,metadata:Mo(n),slashCommands:[],locations:[Ir.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:n.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i){this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${e} registered`);return}i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Mo(t))}async $handleProgressChunk(e,t,i){const n=Mo(t);if(n.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new eqt(n.content);return this._activeTasks.set(r,a),this._pendingProgress.get(e)?.(a),o}else if(i!==void 0){const o=`${e}_${i}`,r=this._activeTasks.get(o);switch(n.kind){case"progressTaskResult":return r&&n.content?(r.complete(n.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(n);return}}this._pendingProgress.get(e)?.(n)}$registerAgentCompletionsProvider(e,t,i){const n=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?We.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,n)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:fZ.INPUT_SCHEME,hasAccessToAllModels:!0},{_debugDisplayName:"chatAgentCompletions:"+e,triggerCharacters:i,provideCompletionItems:async(o,r,a,c)=>{const l=this._chatWidgetService.getWidgetByInputUri(o.uri);if(!l||!l.viewModel)return;const d=i.map(y=>Rh(y)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=Ik(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(y=>u.startsWith(y)))return;const p=this._instantiationService.createInstance(GZ).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(y=>y instanceof $g),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=tqt(o,r,h);return v?{suggestions:(await n(u,c)).map(y=>{const C=y.insertText??(typeof y.label=="string"?y.label:y.label.label),A=new F(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+C.length);return{label:y.label,range:v,insertText:C+" ",kind:Me.Text,detail:y.detail,documentation:y.documentation,command:{id:bte.ID,title:"",arguments:[{id:y.id,widget:l,range:A,variableData:Mo(y.value),command:y.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};gze=D([Gi(Be.MainThreadChatAgents2),_(1,_f),_(2,km),_(3,it),_(4,UN),_(5,we),_(6,Ge),_(7,fs)],gze);function tqt(s,e,t){const i=Ik(e.column,t,s.getLineContent(e.lineNumber),0);if(!i&&s.getWordUntilPosition(e).word)return;let n,o;return i?(n=new F(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new F(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):n=o=F.fromPositions(e),{insert:n,replace:o}}let fze=class{constructor(e,t){this._chatVariablesService=t,this._variables=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(n,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Mo(await this._proxy.$resolveVariable(e,l,n,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Mo(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}};fze=D([Gi(Be.MainThreadChatVariables),_(1,L6)],fze);let pze=class extends V{constructor(e,t){super(),this._languageModelToolsService=t,this._tools=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostLanguageModelTools),this._register(this._languageModelToolsService.onDidChangeTools(i=>this._proxy.$acceptToolDelta(i)))}async $getTools(){return Array.from(this._languageModelToolsService.getTools())}$invokeTool(e,t,i){return this._languageModelToolsService.invokeTool(e,t,i)}$registerTool(e){const t=this._languageModelToolsService.registerToolImplementation(e,{invoke:async(i,n)=>await this._proxy.$invokeTool(e,i,n)});this._tools.set(e,t)}$unregisterTool(e){this._tools.deleteAndDispose(e)}};pze=D([Gi(Be.MainThreadLanguageModelTools),_(1,vXe)],pze);const Ent=ae("embeddingsService");class iqt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.providers=new Map}get allProviders(){return this.providers.keys()}registerProvider(e,t){return this.providers.set(e,t),this._onDidChange.fire(),{dispose:()=>{this.providers.delete(e),this._onDidChange.fire()}}}computeEmbeddings(e,t,i){const n=this.providers.get(e);return n?n.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(Ent,iqt,qt.Delayed);let mze=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new mo),this._proxy=e.getProxy(Ye.ExtHostEmbeddings),this._store.add(t.onDidChange(()=>{this._proxy.$acceptEmbeddingModels(Array.from(t.allProviders))}))}dispose(){this._store.dispose()}$registerEmbeddingProvider(e,t){const i=this.embeddingsService.registerProvider(t,{provideEmbeddings:(n,o)=>this._proxy.$provideEmbeddings(e,n,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};mze=D([Gi(Be.MainThreadEmbeddings),_(1,Ent)],mze);class nqt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function xnt(s,e){if(e.serializeBuffersForPostMessage){const t=new nqt,n=JSON.stringify(s,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=sqt(a);if(c)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:c,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),o=t.buffers.map(r=>{const a=new Uint8Array(r);return $e.wrap(a)});return{message:n,buffers:o}}else return{message:JSON.stringify(s),buffers:[]}}function sqt(s){switch(s.constructor.name){case"Int8Array":return bc.Int8Array;case"Uint8Array":return bc.Uint8Array;case"Uint8ClampedArray":return bc.Uint8ClampedArray;case"Int16Array":return bc.Int16Array;case"Uint16Array":return bc.Uint16Array;case"Int32Array":return bc.Int32Array;case"Uint32Array":return bc.Uint32Array;case"Float32Array":return bc.Float32Array;case"Float64Array":return bc.Float64Array;case"BigInt64Array":return bc.BigInt64Array;case"BigUint64Array":return bc.BigUint64Array}}function Dnt(s,e){const t=e.map(o=>{const r=new ArrayBuffer(o.byteLength);return new Uint8Array(r).set(o.buffer),r}),i=e.length?(o,r)=>{if(r&&typeof r=="object"&&r.$$vscode_array_buffer_reference$$){const a=r,{index:c}=a,l=t[c];if(a.view)switch(a.view.type){case bc.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case bc.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case bc.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case bc.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case bc.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case bc.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case bc.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case bc.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case bc.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case bc.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case bc.BigUint64Array:return new BigUint64Array(l,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return l}return r}:void 0;return{message:JSON.parse(s,i),arrayBuffers:t}}var rEe,VR;let aEe=(VR=class extends V{constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(Ye.ExtHostWebviews)}addWebview(e,t,i){if(this._webviews.has(e))throw new Error("Webview already registered");this._webviews.set(e,t),this.hookupWebviewEventDelegate(e,t,i)}$setHtml(e,t){this.tryGetWebview(e)?.setHtml(t)}$setOptions(e,t){const i=this.tryGetWebview(e);i&&(i.contentOptions=yte(t))}async $postMessage(e,t,...i){const n=this.tryGetWebview(e);if(!n)return!1;const{message:o,arrayBuffers:r}=Dnt(t,i);return n.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const n=new Z;n.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),n.add(t.onMessage(o=>{const r=xnt(o.message,i);this._proxy.$onMessage(e,r.message,new jd(r.buffers))})),n.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),n.add(t.onDidDispose(()=>{n.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,N.parse(t))&&this._openerService.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Array.isArray(i.contentOptions.enableCommandUris)||i.contentOptions.enableCommandUris===!0,fromWorkspace:!0})}isSupportedLink(e,t){return rEe.standardSupportedLinkSchemes.has(t.scheme)||!Wn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===pe.command?Array.isArray(e.contentOptions.enableCommandUris)?e.contentOptions.enableCommandUris.includes(t.path):e.contentOptions.enableCommandUris===!0:!1}tryGetWebview(e){return this._webviews.get(e)}getWebview(e){const t=this.tryGetWebview(e);if(!t)throw new Error(`Unknown webview handle:${e}`);return t}getWebviewResolvedFailedContent(e){return` - ${g(KQt,0,"An error occurred while loading view: {0}",rM(e))} - `}},Ake=MP,MP.standardSupportedLinkSchemes=new Set([_e.http,_e.https,_e.mailto,_e.vscode,"vscode-insider"]),MP);Eke=Ake=D([_(1,fr),_(2,Xa)],Eke);function Wse(n){return{id:n.id,location:P.revive(n.location)}}function Hse(n){return{allowScripts:n.enableScripts,allowForms:n.enableForms,enableCommandUris:n.enableCommandUris,localResourceRoots:Array.isArray(n.localResourceRoots)?n.localResourceRoots.map(e=>P.revive(e)):void 0,portMapping:n.portMapping}}class YQt{constructor(e,t,i,s){this.editor=e,this.line=t,this.height=i,this.webview=s,this.domNode=document.createElement("div"),this.domNode.style.zIndex="10",this.afterLineNumber=t,this.afterColumn=1,this.heightInLines=i,e.changeViewZones(o=>this._id=o.addZone(this)),s.mountTo(this.domNode,gt(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let O$e=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(et.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,s,o,r,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&_n(p.getModel().uri,P.revive(i))){l=p;break}if(!l){setTimeout(()=>this._proxy.$onDidDispose(e));return}const d=new Z,h=this._webviewService.createWebviewElement({title:void 0,options:{enableFindWidget:!1},contentOptions:Hse(r),extension:{id:a,location:P.revive(c)}}),u=new YQt(l,s,o,h),f=()=>{d.dispose(),this._proxy.$onDidDispose(e),this._insets.delete(e)};d.add(l.onDidChangeModel(f)),d.add(l.onDidDispose(f)),d.add(u),d.add(h),d.add(h.onMessage(p=>this._proxy.$onDidReceiveMessage(e,p.message))),this._insets.set(e,u)}$disposeEditorInset(e){const t=this.getInset(e);this._insets.delete(e),t.dispose()}$setHtml(e,t){this.getInset(e).webview.setHtml(t)}$setOptions(e,t){const i=this.getInset(e);i.webview.contentOptions=Hse(t)}async $postMessage(e,t){return this.getInset(e).webview.postMessage(t),!0}getInset(e){const t=this._insets.get(e);if(!t)throw new Error("Unknown inset");return t}};O$e=D([en(Ue.MainThreadEditorInsets),_(1,jt),_(2,Zde)],O$e);const $r="vs/platform/extensionManagement/common/extensionManagementCLI",JQt=n=>g($r,0,"Extension '{0}' not found.",n),B$e=g($r,1,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let xke=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let s=await this.extensionManagementService.getInstalled(qr.User,i);const o=fZe.map(a=>a.toLowerCase());if(t&&t!==""){if(o.indexOf(t.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}s=s.filter(a=>a.manifest.categories?a.manifest.categories.map(l=>l.toLowerCase()).indexOf(t.toLowerCase())>-1:!1)}else if(t===""){this.logger.info("Possible Categories: "),o.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(g($r,2,"Extensions installed on {0}:",this.location)),s=s.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of s)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,s){const o=[];try{e.length&&this.logger.info(this.location?g($r,3,"Installing extensions on {0}...",this.location):g($r,4,"Installing extensions..."));const r=[],a=[],c=(d,h,u)=>{a.push({id:d,version:h!=="prerelease"?h:void 0,installOptions:{...i,isBuiltin:u,installPreReleaseVersion:h==="prerelease"||i.installPreReleaseVersion}})};for(const d of e)if(d instanceof P)r.push({vsix:d,installOptions:i});else{const[h,u]=HVe(d);c(h,u,!1)}for(const d of t)if(d instanceof P)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=HVe(d);c(h,u,!0)}const l=await this.extensionManagementService.getInstalled(void 0,i.profileLocation);if(r.length&&await Promise.all(r.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,s,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,s);o.push(...d)}}catch(r){throw this.logger.error(g($r,5,"Error while installing extensions: {0}",lg(r))),r}if(o.length)throw new Error(g($r,6,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(qr.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g($r,7,"Fetching latest versions for {0} extensions",i.length));const s=await this.extensionGalleryService.getExtensions(i,{compatible:!0},qe.None),o=[];for(const a of s)for(const c of t)gc(c.identifier,a.identifier)&&JV.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:Bx.Update,installPreReleaseVersion:c.preRelease,profileLocation:e}});if(!o.length){this.logger.info(g($r,8,"No extension to update"));return}this.logger.info(g($r,9,"Updating extensions: {0}",o.map(a=>a.extension.identifier.id).join(", ")));const r=await this.extensionManagementService.installGalleryExtensions(o);for(const a of r)a.error?this.logger.error(g($r,10,"Error while updating extension {0}: {1}",a.identifier.id,lg(a.error))):this.logger.info(g($r,11,"Extension '{0}' v{1} was successfully updated.",a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(e,t,i){if(e=e.filter(({id:a,version:c})=>{const l=t.find(d=>gc(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g($r,12,"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: '{2}@1.2.3'.",a,l.manifest.version,a)),!1;if(c&&l.manifest.version===c)return this.logger.info(g($r,13,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const s=[],o=[],r=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=r.get(a.toLowerCase());if(!d){this.logger.error(`${JQt(c?`${a}@${c}`:a)} -${B$e}`),s.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,qe.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),s.push(a);return}const h=t.find(u=>gc(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g($r,13,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g($r,14,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g($r,15,"Installing builtin extension '{0}' v{1}...",a,c):g($r,16,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g($r,17,"Installing extension '{0}' v{1}...",a,c):g($r,18,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g($r,19,"Error while installing extension {0}: {1}",c.identifier.id,lg(c.error))),s.push(c.identifier.id)):this.logger.info(g($r,20,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return s}async installVSIX(e,t,i,s){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,s))try{await this.extensionManagementService.install(e,t),this.logger.info(g($r,21,"Extension '{0}' was successfully installed.",ui(e)))}catch(a){if(Na(a))this.logger.info(g($r,22,"Cancelled installing extension '{0}'.",ui(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),s=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)ZRt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:s},qe.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,s){if(!t){const o={id:ny(e.publisher,e.name)},r=s.find(a=>gc(o,a.identifier)&&JV.gt(a.manifest.version,e.version));if(r)return this.logger.info(g($r,23,"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",r.identifier.id,r.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const s=async o=>{if(o instanceof P){const r=await this.extensionManagementService.getManifest(o);return _F(r.publisher,r.name)}return o};for(const o of e){const r=await s(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>gc(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} -${B$e}`);if(c.some(l=>l.type===qr.System)){this.logger.info(g($r,24,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g($r,25,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g($r,26,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g($r,27,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g($r,28,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(s=>{if(s.identifier.id===i&&s.location.scheme===_e.file){this.logger.info(s.location.fsPath);return}})})}notInstalled(e){return this.location?g($r,29,"Extension '{0}' is not installed on {1}.",e,this.location):g($r,30,"Extension '{0}' is not installed.",e)}};xke=D([_(1,Rz),_(2,aL)],xke);const XQt="vs/workbench/api/browser/mainThreadCLICommands";yt.registerCommand("_remoteCLI.openExternal",function(n,e){return n.get(fr).open($t(e)?e:P.revive(e),{openExternal:!0,allowTunneling:!0})});yt.registerCommand("_remoteCLI.windowOpen",function(n,e,t){const i=n.get(ji);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});yt.registerCommand("_remoteCLI.getSystemStatus",function(n){return n.get(ji).executeCommand("_issues.getSystemStatus")});yt.registerCommand("_remoteCLI.manageExtensions",async function(n,e){const t=n.get(be),s=n.get(Mw).remoteExtensionManagementServer?.extensionManagementService;if(!s)return;const o=[],r=new class extends ude{log(c,l){o.push(l)}},a=t.createChild(new Dl([Rz,s])).createInstance(Dke,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>$t(d)?d:P.revive(d));if(Array.isArray(e.install)&&e.install.length)try{await a.installExtensions(c(e.install),[],{isMachineScoped:!0},!!e.force)}catch(l){o.push(l.message)}if(Array.isArray(e.uninstall)&&e.uninstall.length)try{await a.uninstallExtensions(c(e.uninstall),!!e.force,void 0)}catch(l){o.push(l.message)}}return o.join(` -`)});let Dke=class extends xke{constructor(e,t,i,s,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?s.getHostLabel(_e.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Jn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(XQt,0,"Cannot install the '{0}' extension because it is declared to not run in this setup.",_F(e.publisher,e.name))),!1):!0}};Dke=D([_(1,Rz),_(2,aL),_(3,eo),_(4,ec),_(5,G_)],Dke);let W$e=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};W$e=D([en(Ue.MainThreadClipboard),_(1,Mu)],W$e);let H$e=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new Zo,this._proxy=e.getProxy(et.ExtHostCommands),this._generateCommandsDocumentationRegistration=yt.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=yt.getCommands();for(const[s,o]of t)o.metadata&&(e[s]=o.metadata);const i=[];for(const s in e)i.push("`"+s+"` - "+ZQt(e[s]));console.log(i.join(` -`))}$registerCommand(e){this._commandRegistrations.set(e,yt.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(s=>Or(s))))}$unregisterCommand(e){this._commandRegistrations.deleteAndDispose(e)}$fireCommandActivationEvent(e){const t=`onCommand:${e}`;this._extensionService.activationEventIsDone(t)||this._extensionService.activateByEvent(t)}async $executeCommand(e,t,i){t instanceof $h&&(t=t.value);for(let s=0;s0&&!yt.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([...yt.getCommands().keys()])}};H$e=D([en(Ue.MainThreadCommands),_(1,ji),_(2,ho)],H$e);function ZQt(n){if(typeof n=="string")return n;{const t=[$t(n.description)?n.description:n.description.original];if(t.push(` - -`),n.args)for(const i of n.args)t.push(`* _${i.name}_ - ${i.description||""} -`);return n.returns&&t.push(`* _(returns)_ - ${n.returns}`),t.push(` - -`),t.join("")}}let U$e=class{constructor(e,t,i,s){this._workspaceContextService=t,this.configurationService=i,this._environmentService=s;const o=e.getProxy(et.ExtHostConfiguration);o.$initializeConfiguration(this._getConfigurationData()),this._configurationListener=i.onDidChangeConfiguration(r=>{o.$acceptConfigurationChanged(this._getConfigurationData(),r.change)})}_getConfigurationData(){const e={...this.configurationService.getConfigurationData(),configurationScopes:[]};return(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment)&&(e.configurationScopes=Tft()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,s,o){return s={resource:s?.resource?P.revive(s.resource):void 0,overrideIdentifier:s?.overrideIdentifier},this.writeConfiguration(e,t,i,s,o)}$removeConfigurationOption(e,t,i,s){return i={resource:i?.resource?P.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,s)}writeConfiguration(e,t,i,s,o){e=e??this.deriveConfigurationTarget(t,s);const r=this.configurationService.inspect(t,s);switch(e){case Ot.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,s,o);case Ot.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,s,o);case Ot.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,s,o);case Ot.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,s,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,s,o)}}_updateValue(e,t,i,s,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&s!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===Nn.WORKSPACE){const i=it.as(Cs.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===ut.RESOURCE||i[e].scope===ut.LANGUAGE_OVERRIDABLE))return Ot.WORKSPACE_FOLDER}return Ot.WORKSPACE}};U$e=D([en(Ue.MainThreadConfiguration),_(1,Ti),_(2,Re),_(3,Il)],U$e);function EOe(n){const e=[];let t;try{const i=JSON.parse(n.arguments),s=i[i.length-1];s&&s.__$stack&&(i.pop(),t=s.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",n.arguments)}return{args:e,stack:t}}function ejt(n){if(!n)return n;const e=n.indexOf(` -`);return e===-1?n:n.substring(0,e)}function tjt(n,e){const{args:t,stack:i}=EOe(n),s=typeof t[0]=="string"&&t.length===1;let o=ejt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&s?r=[`%c[${e}] %c${t[0]} %c${o}`,oB("blue"),oB(""),oB("grey")]:r=[`%c[${e}] %c${t[0]}`,oB("blue"),oB(""),...t.slice(1)]:r=[`%c[${e}]%`,oB("blue"),...t],o&&!s&&r.push(o),typeof console[n.severity]!="function")throw new Error("Unknown console method");console[n.severity].apply(console,r)}function oB(n){return`color: ${n}`}function ijt(n,e,t=null){const i=EOe(e).args;let s=i.shift();if(typeof s=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s=t+s),e.severity){case"log":case"info":n.info(s,...i);break;case"warn":n.warn(s,...i);break;case"error":n.error(s,...i);break}}function njt(n,e,t){const i=EOe(e).args,s=i.shift();typeof s!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n.error(t+s,...i))}let V$e=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const s=hOe(this._environmentService);this._isExtensionDevTestFromCli=s.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?ijt(this._logService,e):(njt(this._logService,e,"Extension Host"),tjt(e,"Extension Host"))}};V$e=D([en(Ue.MainThreadConsole),_(1,Il),_(2,Ze)],V$e);const sjt="vs/workbench/contrib/debug/common/abstractDebugAdapter";class Got{constructor(){this.pendingRequests=new Map,this.queue=[],this._onError=new I,this._onExit=new I,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,i,s){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof s=="number"){const r=setTimeout(()=>{clearTimeout(r);const a=this.pendingRequests.get(o.seq);if(a){this.pendingRequests.delete(o.seq);const c={type:"response",seq:0,request_seq:o.seq,success:!1,command:e,message:g(sjt,0,"Timeout after {0} ms for '{1}'",s,e)};a(c)}},s)}return i&&this.pendingRequests.set(o.seq,i),o.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Ta(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{const t=e,i=this.pendingRequests.get(t.request_seq);i&&(this.pendingRequests.delete(t.request_seq),i(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();const e=new Map;this.pendingRequests.forEach((t,i)=>e.set(i,t)),await Ta(500),e.forEach((t,i)=>{t({type:"response",seq:0,request_seq:i,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(i)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this.queue=[]}}function qot(n){return n.configuration.request==="attach"&&!Qot(n)&&(!n.parentSession||qot(n.parentSession))}function Qot(n){let e=n.configuration.type;if(e)return e==="vslsShare"&&(e=n.configuration.adapterProxy.configuration.type),Ba(e,"extensionhost")||Ba(e,"pwa-extensionhost")?n:n.parentSession?Qot(n.parentSession):void 0}function ojt(n){return n.type&&(n.label||n.program||n.runtime)}const rjt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function ajt(n){return!!(n&&n.match(rjt))}function jot(n){if(typeof n.path=="string"&&!(typeof n.sourceReference=="number"&&n.sourceReference>0)){if(ajt(n.path))return P.parse(n.path);if(oF(n.path))return P.file(n.path)}return n.path}function Kot(n){if(typeof n.path=="object"){const e=P.revive(n.path);if(e)return e.scheme===_e.file?e.fsPath:e.toString()}return n.path}function Yot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{s&&o&&(o.path=t(o))}),i}function Jot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{!s&&o&&(o.path=t(o))}),i}function Xot(n,e){switch(n.type){case"event":{const t=n;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break}break}case"request":{const t=n;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(i=>e(!1,i));break}break}case"response":{const t=n;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(i=>e(!1,i.source));break;case"loadedSources":t.body.sources.forEach(i=>e(!1,i));break;case"scopes":t.body.scopes.forEach(i=>e(!1,i.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"setBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"disassemble":t.body?.instructions.forEach(s=>e(!1,s.location));break}break}}}let z$e=class{constructor(e,t,i){this.debugService=t,this.visualizerService=i,this._toDispose=new Z,this._debugAdaptersHandleCounter=1,this._visualizerHandles=new Map,this._visualizerTreeHandles=new Map,this._proxy=e.getProxy(et.ExtHostDebugService);const s=new Zo;this._toDispose.add(s),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),s.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=s.get(r);a||(a=new Z,s.set(r,a)),a.add(r.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(r),c)))})),this._toDispose.add(t.onDidEndSession(({session:r,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(r)),this._extHostKnownSessions.delete(r.getId()),a||s.deleteAndDispose(r);for(const[c,l]of this._debugAdapters)l.session===r&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(r=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(r))})),this._toDispose.add(Ee(()=>{for(const[r,a]of this._debugAdapters)a.fireError(r,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const o=this.debugService.getViewModel();this._toDispose.add(T.any(o.onDidFocusStackFrame,o.onDidFocusThread)(()=>{const r=o.focusedStackFrame,a=o.focusedThread;r?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:r.thread.threadId,frameId:r.frameId,sessionId:r.thread.session.getId()}):a?this._proxy.$acceptStackFrameFocus({kind:"thread",threadId:a.threadId,sessionId:a.session.getId()}):this._proxy.$acceptStackFrameFocus(void 0)})),this.sendBreakpointsAndListen()}$registerDebugVisualizerTree(e,t){this.visualizerService.registerTree(e,{disposeItem:i=>this._proxy.$disposeVisualizedTree(i),getChildren:i=>this._proxy.$getVisualizerTreeItemChildren(e,i),getTreeItem:i=>this._proxy.$getVisualizerTreeItem(e,i),editItem:t?(i,s)=>this._proxy.$editVisualizerTreeItem(i,s):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Cn(e),id:t,disposeDebugVisualizers:s=>this._proxy.$disposeDebugVisualizers(s),executeDebugVisualizerCommand:s=>this._proxy.$executeDebugVisualizerCommand(s),provideDebugVisualizers:(s,o)=>this._proxy.$provideDebugVisualizers(e,t,s,o).then(r=>r.map(oDe.deserialize)),resolveDebugVisualizer:(s,o)=>this._proxy.$resolveDebugVisualizer(s.id,o)});this._visualizerHandles.set(`${e}/${t}`,i)}$unregisterDebugVisualizer(e,t){const i=`${e}/${t}`;this._visualizerHandles.get(i)?.dispose(),this._visualizerHandles.delete(i)}sendBreakpointsAndListen(){this._toDispose.add(this.debugService.getModel().onDidChangeBreakpoints(s=>{if(s&&!s.sessionOnly){const o={};s.added&&(o.added=this.convertToDto(s.added)),s.removed&&(o.removed=s.removed.map(r=>r.getId())),s.changed&&(o.changed=this.convertToDto(s.changed)),(o.added||o.removed||o.changed)&&this._proxy.$acceptBreakpointsDelta(o)}}));const e=this.debugService.getModel().getBreakpoints(),t=this.debugService.getModel().getFunctionBreakpoints(),i=this.debugService.getModel().getDataBreakpoints();(e.length>0||t.length>0)&&this._proxy.$acceptBreakpointsDelta({added:this.convertToDto(e).concat(this.convertToDto(t)).concat(this.convertToDto(i))})}dispose(){this._toDispose.dispose()}createDebugAdapter(e){const t=this._debugAdaptersHandleCounter++,i=new cjt(this,t,this._proxy,e);return this._debugAdapters.set(t,i),i}substituteVariables(e,t){return Promise.resolve(this._proxy.$substituteVariables(e?e.uri:void 0,t))}runInTerminal(e,t){return this._proxy.$runInTerminal(e,t)}$registerDebugTypes(e){this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterFactory(e,this))}$registerBreakpoints(e){for(const t of e)if(t.type==="sourceMulti"){const i=t.lines.map(s=>({id:s.id,enabled:s.enabled,lineNumber:s.line+1,column:s.character>0?s.character+1:void 0,condition:s.condition,hitCondition:s.hitCondition,logMessage:s.logMessage,mode:s.mode}));this.debugService.addBreakpoints(P.revive(t.uri),i)}else t.type==="function"?this.debugService.addFunctionBreakpoint({name:t.functionName,mode:t.mode,condition:t.condition,hitCondition:t.hitCondition,enabled:t.enabled,logMessage:t.logMessage},t.id):t.type==="data"&&this.debugService.addDataBreakpoint({description:t.label,src:{type:Ane.Variable,dataId:t.dataId},canPersist:t.canPersist,accessTypes:t.accessTypes,accessType:t.accessType,mode:t.mode});return Promise.resolve()}$unregisterBreakpoints(e,t,i){return e.forEach(s=>this.debugService.removeBreakpoints(s)),t.forEach(s=>this.debugService.removeFunctionBreakpoints(s)),i.forEach(s=>this.debugService.removeDataBreakpoints(s)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,s,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),s&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(r,c,l,d)),o&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(r,c,l,d)),this._debugConfigurationProviders.set(r,a),this._toDispose.add(this.debugService.getConfigurationManager().registerDebugConfigurationProvider(a)),Promise.resolve(void 0)}$unregisterDebugConfigurationProvider(e){const t=this._debugConfigurationProviders.get(e);t&&(this._debugConfigurationProviders.delete(e),this.debugService.getConfigurationManager().unregisterDebugConfigurationProvider(t))}$registerDebugAdapterDescriptorFactory(e,t){const i={type:e,createDebugAdapterDescriptor:s=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(s)))};return this._debugAdapterDescriptorFactories.set(t,i),this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterDescriptorFactory(i)),Promise.resolve(void 0)}$unregisterDebugAdapterDescriptorFactory(e){const t=this._debugAdapterDescriptorFactories.get(e);t&&(this._debugAdapterDescriptorFactories.delete(e),this.debugService.getAdapterManager().unregisterDebugAdapterDescriptorFactory(t))}getSession(e){if(e)return this.debugService.getModel().getSession(e,!0)}async $startDebugging(e,t,i){const s=e?P.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(s),r=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:r,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:r?.compoundRoot,saveBeforeRestart:a,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new uc(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const s=this.debugService.getModel().getSession(e,!0);return s?s.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new uc(o?o.message:"custom request failed"))):Promise.reject(new uc("debug session not found"))}$getDebugProtocolBreakpoint(e,t){const i=this.debugService.getModel().getSession(e,!0);return i?Promise.resolve(i.getDebugProtocolBreakpoint(t)):Promise.reject(new uc("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,qot(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new uc("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:nt.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(Jot(t,!1))}$acceptDAError(e,t,i,s){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} -${s}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAdapter(e){const t=this._debugAdapters.get(e);if(!t)throw new Error("Invalid debug adapter");return t}$sessionCached(e){this._extHostKnownSessions.add(e)}getSessionDto(e){if(e){const t=e.getId();return this._extHostKnownSessions.has(t)?t:{id:t,type:e.configuration.type,name:e.name,folderUri:e.root?e.root.uri:void 0,configuration:e.configuration,parent:e.parentSession?.getId()}}}convertToDto(e){return e.map(t=>{if("name"in t){const i=t;return{type:"function",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,functionName:i.name}}else if("src"in t){const i=t;return{type:"data",id:i.getId(),dataId:i.src.type===Ane.Variable?i.src.dataId:i.src.address,enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,accessType:i.accessType,label:i.description,canPersist:i.canPersist}}else if("uri"in t){const i=t;return{type:"source",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,uri:i.uri,line:i.lineNumber>0?i.lineNumber-1:0,character:typeof i.column=="number"&&i.column>0?i.column-1:0}}else return}).filter(yl)}};z$e=D([en(Ue.MainThreadDebugService),_(1,LPe),_(2,UZe)],z$e);class cjt extends Got{constructor(e,t,i,s){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=s}fireError(e,t){this._onError.fire(t)}fireExit(e,t,i){this._onExit.fire(t)}startSession(){return Promise.resolve(this._proxy.$startDASession(this._handle,this._ds.getSessionDto(this.session)))}sendMessage(e){this._proxy.$sendDAMessage(this._handle,Yot(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class ljt{constructor(e,t){this._proxy=e,this._handle=t,this._idPool=0,this._requests=new Map,this._resolver=new Map}enqueue(e,t){const i=++this._idPool,s=new Promise(r=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,r),this._processQueue()}),o=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return s.finally(()=>o.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],qe.None).then(i=>{for(const[s,o]of t)o(i[s])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let $$e=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(et.ExtHostDecorations)}dispose(){this._provider.forEach(e=>St(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,s=new ljt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await s.enqueue(r,a);if(!c)return;const[l,d,h,u]=c;return{weight:10,bubble:l??!1,color:u?.id,tooltip:d,letter:h}}});this._provider.set(e,[i,o])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[s]=i;s.fire(t&&t.map(o=>P.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(St(t),this._provider.delete(e))}};$$e=D([en(Ue.MainThreadDecorations),_(1,rD)],$$e);let G$e=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(et.ExtHostDiagnostics),this._markerListener=this._markerService.onMarkerChanged(this._forwardMarkers,this)}dispose(){this._markerListener.dispose(),this._activeOwners.forEach(e=>this._markerService.changeAll(e,[])),this._activeOwners.clear()}_forwardMarkers(e){const t=[];for(const i of e){const s=this._markerService.read({resource:i});if(s.length===0)t.push([i,[]]);else{const o=s.filter(r=>!this._activeOwners.has(r.owner));o.length>0&&t.push([i,o])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[s,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=P.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=P.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(P.revive(s)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};G$e=D([en(Ue.MainThreadDiagnostics),_(1,U_),_(2,_o)],G$e);var LX;let q$e=LX=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=LX._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=LX._convertSaveOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showSaveDialog(t))}static _convertOpenOptions(e){const t={openLabel:e?.openLabel||void 0,canSelectFiles:e?.canSelectFiles||!e?.canSelectFiles&&!e?.canSelectFolders,canSelectFolders:e?.canSelectFolders,canSelectMany:e?.canSelectMany,defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[_e.vscodeRemote,_e.file]:[]};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}};q$e=LX=D([en(Ue.MainThreadDialogs),_(1,bf)],q$e);let Q$e=class{constructor(e,t,i,s,o){this._textModelResolverService=t,this._languageService=i,this._modelService=s,this._editorWorkerService=o,this._resourceContentProvider=new Zo,this._pendingUpdate=new Map,this._proxy=e.getProxy(et.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),St(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:s=>this._proxy.$provideTextDocumentContent(e,s).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(s,r);return this._modelService.createModel(o,a,s)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(P.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ai;this._pendingUpdate.set(i.id,o);try{const r=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),o.token.isCancellationRequested)return;r&&r.length>0&&i.applyEdits(r.map(a=>ds.replace(O.lift(a.range),a.text)))}catch(r){bt(r)}}};Q$e=D([en(Ue.MainThreadDocumentContentProviders),_(1,Rn),_(2,Di),_(3,Ai),_(4,kd)],Q$e);class Zot{constructor(e,t=1e3*60*3,i=1024*1024*80,s=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=s,this._data=new Array,this._length=0}dispose(){this._data=St(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const s=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(s,this._maxAge),r={uri:e,length:i,dispose:s};this._data.push(r),this._length+=i,this._cleanup()}_cleanup(){for(;this._length>this._maxLength;)this._data[0].dispose();const e=Math.ceil(this._maxSize*1.2);this._data.length>=e&&St(this._data.slice(0,e-this._maxSize))}}class djt extends ${constructor(e,t,i,s){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=s,this._knownVersionId=this._model.getVersionId(),this._store.add(this._model.onDidChangeContent(o=>{this._knownVersionId=o.versionId,this._proxy.$acceptModelChanged(this._model.uri,o,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let kke=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=s,this._textModelResolverService=o,this._environmentService=r,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new wi,this._modelReferenceCollection=this._store.add(new Zot(a.extUri)),this._proxy=e.getProxy(et.ExtHostDocuments),this._store.add(t.onModelLanguageChanged(this._onModelModeChanged,this)),this._store.add(i.files.onDidSave(d=>{this._shouldHandleFileEvent(d.model.resource)&&this._proxy.$acceptModelSaved(d.model.resource)})),this._store.add(i.files.onDidChangeDirty(d=>{this._shouldHandleFileEvent(d.resource)&&this._proxy.$acceptDirtyStateChanged(d.resource,d.isDirty())})),this._store.add(c.onDidRunWorkingCopyFileOperation(d=>{const h=d.operation===Li.MOVE;if(h||d.operation===Li.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){St(this._modelTrackers.values()),this._modelTrackers.clear(),super.dispose()}isCaughtUpWithContentChanges(e){const t=this._modelTrackers.get(e);return t?t.isCaughtUpWithContentChanges():!0}_shouldHandleFileEvent(e){const t=this._modelService.getModel(e);return!!t&&gS(t)}handleModelAdded(e){gS(e)&&this._modelTrackers.set(e.uri,new djt(e,this._onIsCaughtUpWithContentChanges,this._proxy,this._textFileService))}_onModelModeChanged(e){const{model:t}=e;this._modelTrackers.has(t.uri)&&this._proxy.$acceptModelLanguageChanged(t.uri,t.getLanguageId())}handleModelRemoved(e){this._modelTrackers.has(e)&&(this._modelTrackers.get(e).dispose(),this._modelTrackers.delete(e))}async $trySaveDocument(e){return!!await this._textFileService.save(P.revive(e))}async $tryOpenDocument(e){const t=P.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new uc("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let s;switch(i.scheme){case _e.untitled:s=this._handleUntitledScheme(i);break;case _e.file:default:s=this._handleAsResourceInput(i);break}let o;try{o=await s}catch(r){throw new uc(`cannot open ${i.toString()}. Detail: ${Ma(r)}`)}if(o)if(Fn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new uc(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new uc(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new uc(`cannot open ${i.toString()}`)}$tryCreateDocument(e){return this._doCreateUntitled(void 0,e?e.language:void 0,e?e.content:void 0)}async _handleAsResourceInput(e){const t=await this._textModelResolverService.createModelReference(e);return this._modelReferenceCollection.add(e,t,t.object.textEditorModel.getValueLength()),t.object.textEditorModel.uri}async _handleUntitledScheme(e){const t=R9(e,this._environmentService.remoteAuthority,this._pathService.defaultUriScheme);return await this._fileService.exists(t)?Promise.reject(new Error("file already exists")):await this._doCreateUntitled(e.path?e:void 0)}async _doCreateUntitled(e,t,i){const s=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=s.resource,r=await this._textModelResolverService.createModelReference(o);if(!this._modelTrackers.has(o))throw r.dispose(),new Error(`expected URI ${o.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(o,r,r.object.textEditorModel.getValueLength()),T.once(s.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};kke=D([_(1,Ai),_(2,tr),_(3,ci),_(4,Rn),_(5,ec),_(6,_o),_(7,fC),_(8,Tm)],kke);class cy{static readFromEditor(e,t,i){const s=cy._readSelectionsFromCodeEditor(e,i),o=cy._readOptionsFromCodeEditor(e,t,i),r=cy._readVisibleRangesFromCodeEditor(e,i);return new cy(s,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new mt(1,1,1,1)]),i}static _readOptionsFromCodeEditor(e,t,i){if(t.isDisposed()){if(e)return e.options;throw new Error("No valid properties")}let s,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);s=a.get(x.cursorStyle),o=c.renderType}else e?(s=e.options.cursorStyle,o=e.options.lineNumbers):(s=fa.Line,o=Qr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:s,lineNumbers:o}}static _readVisibleRangesFromCodeEditor(e,t){return t?t.getVisibleRanges():[]}constructor(e,t,i){this.selections=e,this.options=t,this.visibleRanges=i}generateDelta(e,t){const i={options:null,selections:null,visibleRanges:null};return(!e||!cy._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!cy._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!cy._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return Ls(e,t,(i,s)=>i.equalsSelection(s))}static _rangesEqual(e,t){return Ls(e,t,(i,s)=>i.equalsRange(s))}static _optionsEqual(e,t){return e&&!t||!e&&t?!1:!e&&!t?!0:e.tabSize===t.tabSize&&e.indentSize===t.indentSize&&e.insertSpaces===t.insertSpaces&&e.cursorStyle===t.cursorStyle&&e.lineNumbers===t.lineNumbers}}class hjt{constructor(e,t,i,s,o,r,a){this._modelListeners=new Z,this._codeEditorListeners=new Z,this._id=e,this._model=t,this._codeEditor=null,this._properties=null,this._focusTracker=s,this._mainThreadDocuments=o,this._modelService=r,this._clipboardService=a,this._onPropertiesChanged=new I,this._modelListeners.add(this._model.onDidChangeOptions(c=>{this._updatePropertiesNow(null)})),this.setCodeEditor(i),this._updatePropertiesNow(null)}dispose(){this._modelListeners.dispose(),this._codeEditor=null,this._codeEditorListeners.dispose()}_updatePropertiesNow(e){this._setProperties(cy.readFromEditor(this._properties,this._model,this._codeEditor),e)}_setProperties(e,t){const i=e.generateDelta(this._properties,t);this._properties=e,i&&this._onPropertiesChanged.fire(i)}getId(){return this._id}getModel(){return this._model}getCodeEditor(){return this._codeEditor}hasCodeEditor(e){return this._codeEditor===e}setCodeEditor(e){if(!this.hasCodeEditor(e)&&(this._codeEditorListeners.clear(),this._codeEditor=e,this._codeEditor)){this._codeEditorListeners.add(this._codeEditor.onDidChangeModel(()=>{this.setCodeEditor(null)})),this._codeEditorListeners.add(this._codeEditor.onDidFocusEditorWidget(()=>{this._focusTracker.onGainedFocus()})),this._codeEditorListeners.add(this._codeEditor.onDidBlurEditorWidget(()=>{this._focusTracker.onLostFocus()}));let t=null;this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(o=>{if(o.toString()===this._model.uri.toString()){const r=t;t=null,this._updatePropertiesNow(r)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,s=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&s(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&s(null)})),this._updatePropertiesNow(null)}}isVisible(){return!!this._codeEditor}getProperties(){return this._properties}get onPropertiesChanged(){return this._onPropertiesChanged.event}setSelections(e){if(this._codeEditor){this._codeEditor.setSelections(e);return}const t=e.map(mt.liftSelection);this._setProperties(new cy(t,this._properties.options,this._properties.visibleRanges),null)}_setIndentConfiguration(e){const t=this._modelService.getCreationOptions(this._model.getLanguageId(),this._model.uri,this._model.isForSimpleWidget);if(e.tabSize==="auto"||e.insertSpaces==="auto"){let s=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(s=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(s,o);return}const i={};typeof e.insertSpaces<"u"&&(i.insertSpaces=e.insertSpaces),typeof e.tabSize<"u"&&(i.tabSize=e.tabSize),typeof e.indentSize<"u"&&(i.indentSize=e.indentSize),this._model.updateOptions(i)}setConfiguration(e){if(this._setIndentConfiguration(e),!!this._codeEditor){if(e.cursorStyle){const t=ddt(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case Qr.On:t="on";break;case Qr.Relative:t="relative";break;case Qr.Interval:t="interval";break;default:t="off"}this._codeEditor.updateOptions({lineNumbers:t})}}}setDecorations(e,t){this._codeEditor&&this._codeEditor.setDecorationsByType("exthost-api",e,t)}setDecorationsFast(e,t){if(!this._codeEditor)return;const i=[];for(let s=0,o=Math.floor(t.length/4);s({range:O.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",s),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,s){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(ww.guessNeedsClipboard(t)){const l=new Bde(this._codeEditor,hr.Value|hr.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=mc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:O.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:s.undoStopBefore,undoStopAfter:s.undoStopAfter,clipboardText:o}),!0}}var Ike,NP;let Lke=(NP=class{constructor(e,t,i,s,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=s,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++Ike.INSTANCE_COUNT),this._proxy=t.getProxy(et.ExtHostEditors),this._textEditorsListenersMap=Object.create(null),this._editorPositionData=null,this._toDispose.add(this._editorService.onDidVisibleEditorsChange(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidRemoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidMoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._registeredDecorationTypes=Object.create(null)}dispose(){Object.keys(this._textEditorsListenersMap).forEach(e=>{St(this._textEditorsListenersMap[e])}),this._textEditorsListenersMap=Object.create(null),this._toDispose.dispose();for(const e in this._registeredDecorationTypes)this._codeEditorService.removeDecorationType(e);this._registeredDecorationTypes=Object.create(null)}handleTextEditorAdded(e){const t=e.getId(),i=[];i.push(e.onPropertiesChanged(s=>{this._proxy.$acceptEditorPropertiesChanged(t,s)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){St(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Io(this._editorPositionData,e)||(this._editorPositionData=e,this._proxy.$acceptEditorPositionData(this._editorPositionData))}_getTextEditorPositionData(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=this._editorLocator.findTextEditorIdFor(t);i&&(e[i]=U1(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=P.revive(e),s={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?y1.RESTORE:void 0,override:Ibe.EXCLUSIVE_ONLY},o={resource:i,options:s},r=await this._editorService.openEditor(o,ane(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=_z(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const s=i.getModel();await this._editorService.openEditor({resource:s.uri,options:{preserveFocus:!1}},ane(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const s of i)if(t.matches(s)){await s.group.closeEditor(s.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Ui(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Ui(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Ui(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const s=this._editorLocator.getEditor(e);return s?(s.revealRange(t,i),Promise.resolve()):Promise.reject(Ui(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Ui(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,s){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,s)):Promise.reject(Ui(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,s,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,s,o)):Promise.reject(Ui(`TextEditor(${e})`))}$registerTextEditorDecorationType(e,t,i){t=`${this._instanceId}-${t}`,this._registeredDecorationTypes[t]=!0,this._codeEditorService.registerDecorationType(`exthost-api-${e}`,t,i)}$removeTextEditorDecorationType(e){e=`${this._instanceId}-${e}`,delete this._registeredDecorationTypes[e],this._codeEditorService.removeDecorationType(e)}$getDiffInformation(e){const t=this._editorLocator.getEditor(e);if(!t)return Promise.reject(new Error("No such TextEditor"));const i=t.getCodeEditor();if(!i)return Promise.reject(new Error("No such CodeEditor"));const s=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===s||c.getModifiedEditor().getId()===s);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},Ike=NP,NP.INSTANCE_COUNT=0,NP);Lke=Ike=D([_(2,jt),_(3,_i),_(4,ur),_(5,Re)],Lke);yt.registerCommand("_workbench.revertAllDirty",async function(n){if(!n.get(Il).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=n.get(Pw);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let j$e=class{};class ujt{static[Symbol.hasInstance](e){return j$e!=null&&e instanceof j$e}}class gjt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class Tke{constructor(e,t,i,s,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=s,this.oldActiveEditor=o,this.newActiveEditor=r,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&o===r}toString(){let e=`DocumentAndEditorStateDelta + ${g(9799,"An error occurred while loading view: {0}",fT(e))} + `}},rEe=VR,VR.standardSupportedLinkSchemes=new Set([pe.http,pe.https,pe.mailto,pe.vscode,"vscode-insider"]),VR);aEe=rEe=D([_(1,Ao),_(2,Er)],aEe);function wte(s){return{id:s.id,location:N.revive(s.location)}}function yte(s){return{allowScripts:s.enableScripts,allowForms:s.enableForms,enableCommandUris:s.enableCommandUris,localResourceRoots:Array.isArray(s.localResourceRoots)?s.localResourceRoots.map(e=>N.revive(e)):void 0,portMapping:s.portMapping}}class oqt{constructor(e,t,i,n){this.editor=e,this.line=t,this.height=i,this.webview=n,this.domNode=document.createElement("div"),this.domNode.style.zIndex="10",this.afterLineNumber=t,this.afterColumn=1,this.heightInLines=i,e.changeViewZones(o=>this._id=o.addZone(this)),n.mountTo(this.domNode,ct(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let _ze=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(Ye.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,n,o,r,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&ji(p.getModel().uri,N.revive(i))){l=p;break}if(!l){setTimeout(()=>this._proxy.$onDidDispose(e));return}const d=new Z,h=this._webviewService.createWebviewElement({title:void 0,options:{enableFindWidget:!1},contentOptions:yte(r),extension:{id:a,location:N.revive(c)}}),u=new oqt(l,n,o,h),f=()=>{d.dispose(),this._proxy.$onDidDispose(e),this._insets.delete(e)};d.add(l.onDidChangeModel(f)),d.add(l.onDidDispose(f)),d.add(u),d.add(h),d.add(h.onMessage(p=>this._proxy.$onDidReceiveMessage(e,p.message))),this._insets.set(e,u)}$disposeEditorInset(e){const t=this.getInset(e);this._insets.delete(e),t.dispose()}$setHtml(e,t){this.getInset(e).webview.setHtml(t)}$setOptions(e,t){const i=this.getInset(e);i.webview.contentOptions=yte(t)}async $postMessage(e,t){return this.getInset(e).webview.postMessage(t),!0}getInset(e){const t=this._insets.get(e);if(!t)throw new Error("Unknown inset");return t}};_ze=D([Gi(Be.MainThreadEditorInsets),_(1,Kt),_(2,qae)],_ze);const rqt=s=>g(9800,"Extension '{0}' not found.",s),vze=g(9801,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let cEe=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let n=await this.extensionManagementService.getInstalled(br.User,i);const o=QYe.map(a=>a.toLowerCase());if(t&&t!==""){if(o.indexOf(t.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}n=n.filter(a=>a.manifest.categories?a.manifest.categories.map(l=>l.toLowerCase()).indexOf(t.toLowerCase())>-1:!1)}else if(t===""){this.logger.info("Possible Categories: "),o.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(g(9802,"Extensions installed on {0}:",this.location)),n=n.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of n)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,n){const o=[];try{e.length&&this.logger.info(this.location?g(9803,"Installing extensions on {0}...",this.location):g(9804,"Installing extensions..."));const r=[],a=[],c=(d,h,u)=>{a.push({id:d,version:h!=="prerelease"?h:void 0,installOptions:{...i,isBuiltin:u,installPreReleaseVersion:h==="prerelease"||i.installPreReleaseVersion}})};for(const d of e)if(d instanceof N)r.push({vsix:d,installOptions:i});else{const[h,u]=_He(d);c(h,u,!1)}for(const d of t)if(d instanceof N)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=_He(d);c(h,u,!0)}const l=await this.extensionManagementService.getInstalled(void 0,i.profileLocation);if(r.length&&await Promise.all(r.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,n,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,n);o.push(...d)}}catch(r){throw this.logger.error(g(9805,"Error while installing extensions: {0}",su(r))),r}if(o.length)throw new Error(g(9806,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(br.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g(9807,"Fetching latest versions for {0} extensions",i.length));const n=await this.extensionGalleryService.getExtensions(i,{compatible:!0},He.None),o=[];for(const a of n)for(const c of t)Ra(c.identifier,a.identifier)&&jW.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:LA.Update,installPreReleaseVersion:c.preRelease,profileLocation:e,isApplicationScoped:c.isApplicationScoped}});if(!o.length){this.logger.info(g(9808,"No extension to update"));return}this.logger.info(g(9809,"Updating extensions: {0}",o.map(a=>a.extension.identifier.id).join(", ")));const r=await this.extensionManagementService.installGalleryExtensions(o);for(const a of r)a.error?this.logger.error(g(9810,"Error while updating extension {0}: {1}",a.identifier.id,su(a.error))):this.logger.info(g(9811,"Extension '{0}' v{1} was successfully updated.",a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(e,t,i){if(e=e.filter(({id:a,version:c})=>{const l=t.find(d=>Ra(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g(9812,"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: '{2}@1.2.3'.",a,l.manifest.version,a)),!1;if(c&&l.manifest.version===c)return this.logger.info(g(9813,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const n=[],o=[],r=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=r.get(a.toLowerCase());if(!d){this.logger.error(`${rqt(c?`${a}@${c}`:a)} +${vze}`),n.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,He.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),n.push(a);return}const h=t.find(u=>Ra(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g(9813,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g(9814,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g(9815,"Installing builtin extension '{0}' v{1}...",a,c):g(9816,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g(9817,"Installing extension '{0}' v{1}...",a,c):g(9818,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c,isApplicationScoped:l.isApplicationScoped||h?.isApplicationScoped}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g(9819,"Error while installing extension {0}: {1}",c.identifier.id,su(c.error))),n.push(c.identifier.id)):this.logger.info(g(9820,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return n}async installVSIX(e,t,i,n){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,n))try{await this.extensionManagementService.install(e,{...t,installGivenVersion:!0}),this.logger.info(g(9821,"Extension '{0}' was successfully installed.",_i(e)))}catch(a){if(Fr(a))this.logger.info(g(9822,"Cancelled installing extension '{0}'.",_i(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),n=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)DLt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:n},He.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,n){if(!t){const o={id:Iw(e.publisher,e.name)},r=n.find(a=>Ra(o,a.identifier)&&jW.gt(a.manifest.version,e.version));if(r)return this.logger.info(g(9823,"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",r.identifier.id,r.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const n=async o=>{if(o instanceof N){const r=await this.extensionManagementService.getManifest(o);return LM(r.publisher,r.name)}return o};for(const o of e){const r=await n(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>Ra(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} +${vze}`);if(c.some(l=>l.type===br.System)){this.logger.info(g(9824,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g(9825,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g(9826,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g(9827,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g(9828,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(n=>{if(n.identifier.id===i&&n.location.scheme===pe.file){this.logger.info(n.location.fsPath);return}})})}notInstalled(e){return this.location?g(9829,"Extension '{0}' is not installed on {1}.",e,this.location):g(9830,"Extension '{0}' is not installed.",e)}};cEe=D([_(1,k6),_(2,EI)],cEe);_t.registerCommand("_remoteCLI.openExternal",function(s,e){return s.get(Ao).open(Lt(e)?e:N.revive(e),{openExternal:!0,allowTunneling:!0})});_t.registerCommand("_remoteCLI.windowOpen",function(s,e,t){const i=s.get(vi);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});_t.registerCommand("_remoteCLI.getSystemStatus",function(s){return s.get(vi).executeCommand("_issues.getSystemStatus")});_t.registerCommand("_remoteCLI.manageExtensions",async function(s,e){const t=s.get(we),n=s.get(dv).remoteExtensionManagementServer?.extensionManagementService;if(!n)return;const o=[],r=new class extends rae{log(c,l){o.push(l)}},a=t.createChild(new Uc([k6,n])).createInstance(lEe,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>Lt(d)?d:N.revive(d));if(Array.isArray(e.install)&&e.install.length)try{await a.installExtensions(c(e.install),[],{isMachineScoped:!0},!!e.force)}catch(l){o.push(l.message)}if(Array.isArray(e.uninstall)&&e.uninstall.length)try{await a.uninstallExtensions(c(e.uninstall),!!e.force,void 0)}catch(l){o.push(l.message)}}return o.join(` +`)});let lEe=class extends cEe{constructor(e,t,i,n,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?n.getHostLabel(pe.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Wn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(4829,"Cannot install the '{0}' extension because it is declared to not run in this setup.",LM(e.publisher,e.name))),!1):!0}};lEe=D([_(1,k6),_(2,EI),_(3,Fs),_(4,Jr),_(5,Im)],lEe);let bze=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};bze=D([Gi(Be.MainThreadClipboard),_(1,dg)],bze);let wze=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new mo,this._proxy=e.getProxy(Ye.ExtHostCommands),this._generateCommandsDocumentationRegistration=_t.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=_t.getCommands();for(const[n,o]of t)o.metadata&&(e[n]=o.metadata);const i=[];for(const n in e)i.push("`"+n+"` - "+aqt(e[n]));console.log(i.join(` +`))}$registerCommand(e){this._commandRegistrations.set(e,_t.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(n=>Mo(n))))}$unregisterCommand(e){this._commandRegistrations.deleteAndDispose(e)}$fireCommandActivationEvent(e){const t=`onCommand:${e}`;this._extensionService.activationEventIsDone(t)||this._extensionService.activateByEvent(t)}async $executeCommand(e,t,i){t instanceof jd&&(t=t.value);for(let n=0;n0&&!_t.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([..._t.getCommands().keys()])}};wze=D([Gi(Be.MainThreadCommands),_(1,vi),_(2,fs)],wze);function aqt(s){if(typeof s=="string")return s;{const t=[Lt(s.description)?s.description:s.description.original];if(t.push(` + +`),s.args)for(const i of s.args)t.push(`* _${i.name}_ - ${i.description||""} +`);return s.returns&&t.push(`* _(returns)_ - ${s.returns}`),t.push(` + +`),t.join("")}}let yze=class{constructor(e,t,i,n){this._workspaceContextService=t,this.configurationService=i,this._environmentService=n;const o=e.getProxy(Ye.ExtHostConfiguration);o.$initializeConfiguration(this._getConfigurationData()),this._configurationListener=i.onDidChangeConfiguration(r=>{o.$acceptConfigurationChanged(this._getConfigurationData(),r.change)})}_getConfigurationData(){const e={...this.configurationService.getConfigurationData(),configurationScopes:[]};return(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment)&&(e.configurationScopes=uut()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,n,o){return n={resource:n?.resource?N.revive(n.resource):void 0,overrideIdentifier:n?.overrideIdentifier},this.writeConfiguration(e,t,i,n,o)}$removeConfigurationOption(e,t,i,n){return i={resource:i?.resource?N.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,n)}writeConfiguration(e,t,i,n,o){e=e??this.deriveConfigurationTarget(t,n);const r=this.configurationService.inspect(t,n);switch(e){case St.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,n,o);case St.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,n,o);case St.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,n,o);case St.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,n,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,n,o)}}_updateValue(e,t,i,n,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&n!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===qi.WORKSPACE){const i=Qe.as(Nn.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===at.RESOURCE||i[e].scope===at.LANGUAGE_OVERRIDABLE))return St.WORKSPACE_FOLDER}return St.WORKSPACE}};yze=D([Gi(Be.MainThreadConfiguration),_(1,yi),_(2,Te),_(3,Za)],yze);function aPe(s){const e=[];let t;try{const i=JSON.parse(s.arguments),n=i[i.length-1];n&&n.__$stack&&(i.pop(),t=n.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",s.arguments)}return{args:e,stack:t}}function cqt(s){if(!s)return s;const e=s.indexOf(` +`);return e===-1?s:s.substring(0,e)}function lqt(s,e){const{args:t,stack:i}=aPe(s),n=typeof t[0]=="string"&&t.length===1;let o=cqt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&n?r=[`%c[${e}] %c${t[0]} %c${o}`,wP("blue"),wP(""),wP("grey")]:r=[`%c[${e}] %c${t[0]}`,wP("blue"),wP(""),...t.slice(1)]:r=[`%c[${e}]%`,wP("blue"),...t],o&&!n&&r.push(o),typeof console[s.severity]!="function")throw new Error("Unknown console method");console[s.severity].apply(console,r)}function wP(s){return`color: ${s}`}function dqt(s,e,t=null){const i=aPe(e).args;let n=i.shift();if(typeof n=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n=t+n),e.severity){case"log":case"info":s.info(n,...i);break;case"warn":s.warn(n,...i);break;case"error":s.error(n,...i);break}}function hqt(s,e,t){const i=aPe(e).args,n=i.shift();typeof n!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s.error(t+n,...i))}let Cze=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const n=FNe(this._environmentService);this._isExtensionDevTestFromCli=n.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?dqt(this._logService,e):(hqt(this._logService,e,"Extension Host"),lqt(e,"Extension Host"))}};Cze=D([Gi(Be.MainThreadConsole),_(1,Za),_(2,Ge)],Cze);class knt{constructor(){this.pendingRequests=new Map,this.queue=[],this._onError=new I,this._onExit=new I,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,i,n){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof n=="number"){const r=setTimeout(()=>{clearTimeout(r);const a=this.pendingRequests.get(o.seq);if(a){this.pendingRequests.delete(o.seq);const c={type:"response",seq:0,request_seq:o.seq,success:!1,command:e,message:g(3793,"Timeout after {0} ms for '{1}'",n,e)};a(c)}},n)}return i&&this.pendingRequests.set(o.seq,i),o.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Sr(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{const t=e,i=this.pendingRequests.get(t.request_seq);i&&(this.pendingRequests.delete(t.request_seq),i(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();const e=new Map;this.pendingRequests.forEach((t,i)=>e.set(i,t)),await Sr(500),e.forEach((t,i)=>{t({type:"response",seq:0,request_seq:i,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(i)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this.queue=[]}}function Int(s){return s.configuration.request==="attach"&&!Tnt(s)&&(!s.parentSession||Int(s.parentSession))}function Tnt(s){let e=s.configuration.type;if(e)return e==="vslsShare"&&(e=s.configuration.adapterProxy.configuration.type),ua(e,"extensionhost")||ua(e,"pwa-extensionhost")?s:s.parentSession?Tnt(s.parentSession):void 0}function uqt(s){return s.type&&(s.label||s.program||s.runtime)}const gqt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function fqt(s){return!!(s&&s.match(gqt))}function Lnt(s){if(typeof s.path=="string"&&!(typeof s.sourceReference=="number"&&s.sourceReference>0)){if(fqt(s.path))return N.parse(s.path);if(pM(s.path))return N.file(s.path)}return s.path}function Rnt(s){if(typeof s.path=="object"){const e=N.revive(s.path);if(e)return e.scheme===pe.file?e.fsPath:e.toString()}return s.path}function Mnt(s,e){const t=e?Lnt:Rnt,i=xs(s);return Pnt(i,(n,o)=>{n&&o&&(o.path=t(o))}),i}function Nnt(s,e){const t=e?Lnt:Rnt,i=xs(s);return Pnt(i,(n,o)=>{!n&&o&&(o.path=t(o))}),i}function Pnt(s,e){switch(s.type){case"event":{const t=s;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break}break}case"request":{const t=s;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(i=>e(!1,i));break}break}case"response":{const t=s;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(i=>e(!1,i.source));break;case"loadedSources":t.body.sources.forEach(i=>e(!1,i));break;case"scopes":t.body.scopes.forEach(i=>e(!1,i.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"setBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"disassemble":t.body?.instructions.forEach(n=>e(!1,n.location));break}break}}}let Sze=class{constructor(e,t,i){this.debugService=t,this.visualizerService=i,this._toDispose=new Z,this._debugAdaptersHandleCounter=1,this._visualizerHandles=new Map,this._visualizerTreeHandles=new Map,this._proxy=e.getProxy(Ye.ExtHostDebugService);const n=new mo;this._toDispose.add(n),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),n.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=n.get(r);a||(a=new Z,n.set(r,a)),a.add(r.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(r),c)))})),this._toDispose.add(t.onDidEndSession(({session:r,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(r)),this._extHostKnownSessions.delete(r.getId()),a||n.deleteAndDispose(r);for(const[c,l]of this._debugAdapters)l.session===r&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(r=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(r))})),this._toDispose.add(Ee(()=>{for(const[r,a]of this._debugAdapters)a.fireError(r,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const o=this.debugService.getViewModel();this._toDispose.add(M.any(o.onDidFocusStackFrame,o.onDidFocusThread)(()=>{const r=o.focusedStackFrame,a=o.focusedThread;r?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:r.thread.threadId,frameId:r.frameId,sessionId:r.thread.session.getId()}):a?this._proxy.$acceptStackFrameFocus({kind:"thread",threadId:a.threadId,sessionId:a.session.getId()}):this._proxy.$acceptStackFrameFocus(void 0)})),this.sendBreakpointsAndListen()}$registerDebugVisualizerTree(e,t){this.visualizerService.registerTree(e,{disposeItem:i=>this._proxy.$disposeVisualizedTree(i),getChildren:i=>this._proxy.$getVisualizerTreeItemChildren(e,i),getTreeItem:i=>this._proxy.$getVisualizerTreeItem(e,i),editItem:t?(i,n)=>this._proxy.$editVisualizerTreeItem(i,n):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Sn(e),id:t,disposeDebugVisualizers:n=>this._proxy.$disposeDebugVisualizers(n),executeDebugVisualizerCommand:n=>this._proxy.$executeDebugVisualizerCommand(n),provideDebugVisualizers:(n,o)=>this._proxy.$provideDebugVisualizers(e,t,n,o).then(r=>r.map(qSe.deserialize)),resolveDebugVisualizer:(n,o)=>this._proxy.$resolveDebugVisualizer(n.id,o)});this._visualizerHandles.set(`${e}/${t}`,i)}$unregisterDebugVisualizer(e,t){const i=`${e}/${t}`;this._visualizerHandles.get(i)?.dispose(),this._visualizerHandles.delete(i)}sendBreakpointsAndListen(){this._toDispose.add(this.debugService.getModel().onDidChangeBreakpoints(n=>{if(n&&!n.sessionOnly){const o={};n.added&&(o.added=this.convertToDto(n.added)),n.removed&&(o.removed=n.removed.map(r=>r.getId())),n.changed&&(o.changed=this.convertToDto(n.changed)),(o.added||o.removed||o.changed)&&this._proxy.$acceptBreakpointsDelta(o)}}));const e=this.debugService.getModel().getBreakpoints(),t=this.debugService.getModel().getFunctionBreakpoints(),i=this.debugService.getModel().getDataBreakpoints();(e.length>0||t.length>0)&&this._proxy.$acceptBreakpointsDelta({added:this.convertToDto(e).concat(this.convertToDto(t)).concat(this.convertToDto(i))})}dispose(){this._toDispose.dispose()}createDebugAdapter(e){const t=this._debugAdaptersHandleCounter++,i=new pqt(this,t,this._proxy,e);return this._debugAdapters.set(t,i),i}substituteVariables(e,t){return Promise.resolve(this._proxy.$substituteVariables(e?e.uri:void 0,t))}runInTerminal(e,t){return this._proxy.$runInTerminal(e,t)}$registerDebugTypes(e){this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterFactory(e,this))}$registerBreakpoints(e){for(const t of e)if(t.type==="sourceMulti"){const i=t.lines.map(n=>({id:n.id,enabled:n.enabled,lineNumber:n.line+1,column:n.character>0?n.character+1:void 0,condition:n.condition,hitCondition:n.hitCondition,logMessage:n.logMessage,mode:n.mode}));this.debugService.addBreakpoints(N.revive(t.uri),i)}else t.type==="function"?this.debugService.addFunctionBreakpoint({name:t.functionName,mode:t.mode,condition:t.condition,hitCondition:t.hitCondition,enabled:t.enabled,logMessage:t.logMessage},t.id):t.type==="data"&&this.debugService.addDataBreakpoint({description:t.label,src:{type:ZZ.Variable,dataId:t.dataId},canPersist:t.canPersist,accessTypes:t.accessTypes,accessType:t.accessType,mode:t.mode});return Promise.resolve()}$unregisterBreakpoints(e,t,i){return e.forEach(n=>this.debugService.removeBreakpoints(n)),t.forEach(n=>this.debugService.removeFunctionBreakpoints(n)),i.forEach(n=>this.debugService.removeDataBreakpoints(n)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,n,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),n&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(r,c,l,d)),o&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(r,c,l,d)),this._debugConfigurationProviders.set(r,a),this._toDispose.add(this.debugService.getConfigurationManager().registerDebugConfigurationProvider(a)),Promise.resolve(void 0)}$unregisterDebugConfigurationProvider(e){const t=this._debugConfigurationProviders.get(e);t&&(this._debugConfigurationProviders.delete(e),this.debugService.getConfigurationManager().unregisterDebugConfigurationProvider(t))}$registerDebugAdapterDescriptorFactory(e,t){const i={type:e,createDebugAdapterDescriptor:n=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(n)))};return this._debugAdapterDescriptorFactories.set(t,i),this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterDescriptorFactory(i)),Promise.resolve(void 0)}$unregisterDebugAdapterDescriptorFactory(e){const t=this._debugAdapterDescriptorFactories.get(e);t&&(this._debugAdapterDescriptorFactories.delete(e),this.debugService.getAdapterManager().unregisterDebugAdapterDescriptorFactory(t))}getSession(e){if(e)return this.debugService.getModel().getSession(e,!0)}async $startDebugging(e,t,i){const n=e?N.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(n),r=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:r,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:r?.compoundRoot,saveBeforeRestart:a,testRun:i.testRun,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new La(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const n=this.debugService.getModel().getSession(e,!0);return n?n.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new La(o?o.message:"custom request failed"))):Promise.reject(new La("debug session not found"))}$getDebugProtocolBreakpoint(e,t){const i=this.debugService.getModel().getSession(e,!0);return i?Promise.resolve(i.getDebugProtocolBreakpoint(t)):Promise.reject(new La("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,Int(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new La("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:Xe.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(Nnt(t,!1))}$acceptDAError(e,t,i,n){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} +${n}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAdapter(e){const t=this._debugAdapters.get(e);if(!t)throw new Error("Invalid debug adapter");return t}$sessionCached(e){this._extHostKnownSessions.add(e)}getSessionDto(e){if(e){const t=e.getId();return this._extHostKnownSessions.has(t)?t:{id:t,type:e.configuration.type,name:e.name,folderUri:e.root?e.root.uri:void 0,configuration:e.configuration,parent:e.parentSession?.getId()}}}convertToDto(e){return e.map(t=>{if("name"in t){const i=t;return{type:"function",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,functionName:i.name}}else if("src"in t){const i=t;return{type:"data",id:i.getId(),dataId:i.src.type===ZZ.Variable?i.src.dataId:i.src.address,enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,accessType:i.accessType,label:i.description,canPersist:i.canPersist}}else if("uri"in t){const i=t;return{type:"source",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,uri:i.uri,line:i.lineNumber>0?i.lineNumber-1:0,character:typeof i.column=="number"&&i.column>0?i.column-1:0}}else return}).filter(Fc)}};Sze=D([Gi(Be.MainThreadDebugService),_(1,XRe),_(2,TJe)],Sze);class pqt extends knt{constructor(e,t,i,n){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=n}fireError(e,t){this._onError.fire(t)}fireExit(e,t,i){this._onExit.fire(t)}startSession(){return Promise.resolve(this._proxy.$startDASession(this._handle,this._ds.getSessionDto(this.session)))}sendMessage(e){this._proxy.$sendDAMessage(this._handle,Mnt(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class mqt{constructor(e,t){this._proxy=e,this._handle=t,this._idPool=0,this._requests=new Map,this._resolver=new Map}enqueue(e,t){const i=++this._idPool,n=new Promise(r=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,r),this._processQueue()}),o=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return n.finally(()=>o.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],He.None).then(i=>{for(const[n,o]of t)o(i[n])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let Aze=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(Ye.ExtHostDecorations)}dispose(){this._provider.forEach(e=>bt(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,n=new mqt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await n.enqueue(r,a);if(!c)return;const[l,d,h,u]=c;return{weight:10,bubble:l??!1,color:u?.id,tooltip:d,letter:h}}});this._provider.set(e,[i,o])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[n]=i;n.fire(t&&t.map(o=>N.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(bt(t),this._provider.delete(e))}};Aze=D([Gi(Be.MainThreadDecorations),_(1,iE)],Aze);let Eze=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(Ye.ExtHostDiagnostics),this._markerListener=this._markerService.onMarkerChanged(this._forwardMarkers,this)}dispose(){this._markerListener.dispose(),this._activeOwners.forEach(e=>this._markerService.changeAll(e,[])),this._activeOwners.clear()}_forwardMarkers(e){const t=[];for(const i of e){const n=this._markerService.read({resource:i});if(n.length===0)t.push([i,[]]);else{const o=n.filter(r=>!this._activeOwners.has(r.owner));o.length>0&&t.push([i,o])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[n,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=N.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=N.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(N.revive(n)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};Eze=D([Gi(Be.MainThreadDiagnostics),_(1,Am),_(2,ks)],Eze);var nj;let xze=nj=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=nj._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=nj._convertSaveOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showSaveDialog(t))}static _convertOpenOptions(e){const t={openLabel:e?.openLabel||void 0,canSelectFiles:e?.canSelectFiles||!e?.canSelectFiles&&!e?.canSelectFolders,canSelectFolders:e?.canSelectFolders,canSelectMany:e?.canSelectMany,defaultUri:e?.defaultUri?N.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[pe.vscodeRemote,pe.file]:[]};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?N.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}};xze=nj=D([Gi(Be.MainThreadDialogs),_(1,ag)],xze);let Dze=class{constructor(e,t,i,n,o){this._textModelResolverService=t,this._languageService=i,this._modelService=n,this._editorWorkerService=o,this._resourceContentProvider=new mo,this._pendingUpdate=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),bt(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:n=>this._proxy.$provideTextDocumentContent(e,n).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(n,r);return this._modelService.createModel(o,a,n)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(N.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ci;this._pendingUpdate.set(i.id,o);try{const r=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),o.token.isCancellationRequested)return;r&&r.length>0&&i.applyEdits(r.map(a=>Zn.replace(F.lift(a.range),a.text)))}catch(r){vt(r)}}};Dze=D([Gi(Be.MainThreadDocumentContentProviders),_(1,fn),_(2,xi),_(3,gi),_(4,Ml)],Dze);class Fnt{constructor(e,t=1e3*60*3,i=1024*1024*80,n=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=n,this._data=new Array,this._length=0}dispose(){this._data=bt(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const n=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(n,this._maxAge),r={uri:e,length:i,dispose:n};this._data.push(r),this._length+=i,this._cleanup()}_cleanup(){for(;this._length>this._maxLength;)this._data[0].dispose();const e=Math.ceil(this._maxSize*1.2);this._data.length>=e&&bt(this._data.slice(0,e-this._maxSize))}}class _qt extends V{constructor(e,t,i,n){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=n,this._knownVersionId=this._model.getVersionId(),this._store.add(this._model.onDidChangeContent(o=>{this._knownVersionId=o.versionId,this._proxy.$acceptModelChanged(this._model.uri,o,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let dEe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=n,this._textModelResolverService=o,this._environmentService=r,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new ui,this._modelReferenceCollection=this._store.add(new Fnt(a.extUri)),this._proxy=e.getProxy(Ye.ExtHostDocuments),this._store.add(t.onModelLanguageChanged(this._onModelModeChanged,this)),this._store.add(i.files.onDidSave(d=>{this._shouldHandleFileEvent(d.model.resource)&&this._proxy.$acceptModelSaved(d.model.resource)})),this._store.add(i.files.onDidChangeDirty(d=>{this._shouldHandleFileEvent(d.resource)&&this._proxy.$acceptDirtyStateChanged(d.resource,d.isDirty())})),this._store.add(c.onDidRunWorkingCopyFileOperation(d=>{const h=d.operation===Ai.MOVE;if(h||d.operation===Ai.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){bt(this._modelTrackers.values()),this._modelTrackers.clear(),super.dispose()}isCaughtUpWithContentChanges(e){const t=this._modelTrackers.get(e);return t?t.isCaughtUpWithContentChanges():!0}_shouldHandleFileEvent(e){const t=this._modelService.getModel(e);return!!t&&Ly(t)}handleModelAdded(e){Ly(e)&&this._modelTrackers.set(e.uri,new _qt(e,this._onIsCaughtUpWithContentChanges,this._proxy,this._textFileService))}_onModelModeChanged(e){const{model:t}=e;this._modelTrackers.has(t.uri)&&this._proxy.$acceptModelLanguageChanged(t.uri,t.getLanguageId())}handleModelRemoved(e){this._modelTrackers.has(e)&&(this._modelTrackers.get(e).dispose(),this._modelTrackers.delete(e))}async $trySaveDocument(e){return!!await this._textFileService.save(N.revive(e))}async $tryOpenDocument(e){const t=N.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new La("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let n;switch(i.scheme){case pe.untitled:n=this._handleUntitledScheme(i);break;case pe.file:default:n=this._handleAsResourceInput(i);break}let o;try{o=await n}catch(r){throw new La(`cannot open ${i.toString()}. Detail: ${Nr(r)}`)}if(o)if(xn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new La(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new La(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new La(`cannot open ${i.toString()}`)}$tryCreateDocument(e){return this._doCreateUntitled(void 0,e?e.language:void 0,e?e.content:void 0)}async _handleAsResourceInput(e){const t=await this._textModelResolverService.createModelReference(e);return this._modelReferenceCollection.add(e,t,t.object.textEditorModel.getValueLength()),t.object.textEditorModel.uri}async _handleUntitledScheme(e){const t=x8(e,this._environmentService.remoteAuthority,this._pathService.defaultUriScheme);return await this._fileService.exists(t)?Promise.reject(new Error("file already exists")):await this._doCreateUntitled(e.path?e:void 0)}async _doCreateUntitled(e,t,i){const n=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=n.resource,r=await this._textModelResolverService.createModelReference(o);if(!this._modelTrackers.has(o))throw r.dispose(),new Error(`expected URI ${o.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(o,r,r.object.textEditorModel.getValueLength()),M.once(n.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};dEe=D([_(1,gi),_(2,Fo),_(3,Jt),_(4,fn),_(5,Jr),_(6,ks),_(7,zb),_(8,bf)],dEe);class Nw{static readFromEditor(e,t,i){const n=Nw._readSelectionsFromCodeEditor(e,i),o=Nw._readOptionsFromCodeEditor(e,t,i),r=Nw._readVisibleRangesFromCodeEditor(e,i);return new Nw(n,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new dt(1,1,1,1)]),i}static _readOptionsFromCodeEditor(e,t,i){if(t.isDisposed()){if(e)return e.options;throw new Error("No valid properties")}let n,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);n=a.get(x.cursorStyle),o=c.renderType}else e?(n=e.options.cursorStyle,o=e.options.lineNumbers):(n=qr.Line,o=wr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:n,lineNumbers:o}}static _readVisibleRangesFromCodeEditor(e,t){return t?t.getVisibleRanges():[]}constructor(e,t,i){this.selections=e,this.options=t,this.visibleRanges=i}generateDelta(e,t){const i={options:null,selections:null,visibleRanges:null};return(!e||!Nw._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!Nw._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!Nw._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return is(e,t,(i,n)=>i.equalsSelection(n))}static _rangesEqual(e,t){return is(e,t,(i,n)=>i.equalsRange(n))}static _optionsEqual(e,t){return e&&!t||!e&&t?!1:!e&&!t?!0:e.tabSize===t.tabSize&&e.indentSize===t.indentSize&&e.insertSpaces===t.insertSpaces&&e.cursorStyle===t.cursorStyle&&e.lineNumbers===t.lineNumbers}}class vqt{constructor(e,t,i,n,o,r,a){this._modelListeners=new Z,this._codeEditorListeners=new Z,this._id=e,this._model=t,this._codeEditor=null,this._properties=null,this._focusTracker=n,this._mainThreadDocuments=o,this._modelService=r,this._clipboardService=a,this._onPropertiesChanged=new I,this._modelListeners.add(this._model.onDidChangeOptions(c=>{this._updatePropertiesNow(null)})),this.setCodeEditor(i),this._updatePropertiesNow(null)}dispose(){this._modelListeners.dispose(),this._codeEditor=null,this._codeEditorListeners.dispose()}_updatePropertiesNow(e){this._setProperties(Nw.readFromEditor(this._properties,this._model,this._codeEditor),e)}_setProperties(e,t){const i=e.generateDelta(this._properties,t);this._properties=e,i&&this._onPropertiesChanged.fire(i)}getId(){return this._id}getModel(){return this._model}getCodeEditor(){return this._codeEditor}hasCodeEditor(e){return this._codeEditor===e}setCodeEditor(e){if(!this.hasCodeEditor(e)&&(this._codeEditorListeners.clear(),this._codeEditor=e,this._codeEditor)){this._codeEditorListeners.add(this._codeEditor.onDidChangeModel(()=>{this.setCodeEditor(null)})),this._codeEditorListeners.add(this._codeEditor.onDidFocusEditorWidget(()=>{this._focusTracker.onGainedFocus()})),this._codeEditorListeners.add(this._codeEditor.onDidBlurEditorWidget(()=>{this._focusTracker.onLostFocus()}));let t=null;this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(o=>{if(o.toString()===this._model.uri.toString()){const r=t;t=null,this._updatePropertiesNow(r)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,n=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&n(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&n(null)})),this._updatePropertiesNow(null)}}isVisible(){return!!this._codeEditor}getProperties(){return this._properties}get onPropertiesChanged(){return this._onPropertiesChanged.event}setSelections(e){if(this._codeEditor){this._codeEditor.setSelections(e);return}const t=e.map(dt.liftSelection);this._setProperties(new Nw(t,this._properties.options,this._properties.visibleRanges),null)}_setIndentConfiguration(e){const t=this._modelService.getCreationOptions(this._model.getLanguageId(),this._model.uri,this._model.isForSimpleWidget);if(e.tabSize==="auto"||e.insertSpaces==="auto"){let n=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(n=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(n,o);return}const i={};typeof e.insertSpaces<"u"&&(i.insertSpaces=e.insertSpaces),typeof e.tabSize<"u"&&(i.tabSize=e.tabSize),typeof e.indentSize<"u"&&(i.indentSize=e.indentSize),this._model.updateOptions(i)}setConfiguration(e){if(this._setIndentConfiguration(e),!!this._codeEditor){if(e.cursorStyle){const t=Vat(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case wr.On:t="on";break;case wr.Relative:t="relative";break;case wr.Interval:t="interval";break;default:t="off"}this._codeEditor.updateOptions({lineNumbers:t})}}}setDecorations(e,t){this._codeEditor&&this._codeEditor.setDecorationsByType("exthost-api",e,t)}setDecorationsFast(e,t){if(!this._codeEditor)return;const i=[];for(let n=0,o=Math.floor(t.length/4);n({range:F.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",n),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,n){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(X_.guessNeedsClipboard(t)){const l=new Tae(this._codeEditor,jo.Value|jo.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=fc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:F.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:n.undoStopBefore,undoStopAfter:n.undoStopAfter,clipboardText:o}),!0}}var hEe,zR;let uEe=(zR=class{constructor(e,t,i,n,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=n,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++hEe.INSTANCE_COUNT),this._proxy=t.getProxy(Ye.ExtHostEditors),this._textEditorsListenersMap=Object.create(null),this._editorPositionData=null,this._toDispose.add(this._editorService.onDidVisibleEditorsChange(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidRemoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidMoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._registeredDecorationTypes=Object.create(null)}dispose(){Object.keys(this._textEditorsListenersMap).forEach(e=>{bt(this._textEditorsListenersMap[e])}),this._textEditorsListenersMap=Object.create(null),this._toDispose.dispose();for(const e in this._registeredDecorationTypes)this._codeEditorService.removeDecorationType(e);this._registeredDecorationTypes=Object.create(null)}handleTextEditorAdded(e){const t=e.getId(),i=[];i.push(e.onPropertiesChanged(n=>{this._proxy.$acceptEditorPropertiesChanged(t,n)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){bt(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Ys(this._editorPositionData,e)||(this._editorPositionData=e,this._proxy.$acceptEditorPositionData(this._editorPositionData))}_getTextEditorPositionData(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=this._editorLocator.findTextEditorIdFor(t);i&&(e[i]=rI(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=N.revive(e),n={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?Gk.RESTORE:void 0,override:__e.EXCLUSIVE_ONLY},o={resource:i,options:n},r=await this._editorService.openEditor(o,RZ(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=s6(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const n=i.getModel();await this._editorService.openEditor({resource:n.uri,options:{preserveFocus:!1}},RZ(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const n of i)if(t.matches(n)){await n.group.closeEditor(n.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const n=this._editorLocator.getEditor(e);return n?(n.revealRange(t,i),Promise.resolve()):Promise.reject(Pi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,n){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,n)):Promise.reject(Pi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,n,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,n,o)):Promise.reject(Pi(`TextEditor(${e})`))}$registerTextEditorDecorationType(e,t,i){t=`${this._instanceId}-${t}`,this._registeredDecorationTypes[t]=!0,this._codeEditorService.registerDecorationType(`exthost-api-${e}`,t,i)}$removeTextEditorDecorationType(e){e=`${this._instanceId}-${e}`,delete this._registeredDecorationTypes[e],this._codeEditorService.removeDecorationType(e)}$getDiffInformation(e){const t=this._editorLocator.getEditor(e);if(!t)return Promise.reject(new Error("No such TextEditor"));const i=t.getCodeEditor();if(!i)return Promise.reject(new Error("No such CodeEditor"));const n=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===n||c.getModifiedEditor().getId()===n);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},hEe=zR,zR.INSTANCE_COUNT=0,zR);uEe=hEe=D([_(2,Kt),_(3,ei),_(4,Po),_(5,Te)],uEe);_t.registerCommand("_workbench.revertAllDirty",async function(s){if(!s.get(Za).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=s.get(Rm);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let kze=class{};class bqt{static[Symbol.hasInstance](e){return kze!=null&&e instanceof kze}}class wqt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class gEe{constructor(e,t,i,n,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=n,this.oldActiveEditor=o,this.newActiveEditor=r,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&o===r}toString(){let e=`DocumentAndEditorStateDelta `;return e+=` Removed Documents: [${this.removedDocuments.map(t=>t.uri.toString(!0)).join(", ")}] `,e+=` Added Documents: [${this.addedDocuments.map(t=>t.uri.toString(!0)).join(", ")}] `,e+=` Removed Editors: [${this.removedEditors.map(t=>t.id).join(", ")}] `,e+=` Added Editors: [${this.addedEditors.map(t=>t.id).join(", ")}] `,e+=` New Active Editor: ${this.newActiveEditor} -`,e}}class jpe{static compute(e,t){if(!e)return new Tke([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=Ple(e.documents,t.documents),s=m_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new Tke(i.removed,i.added,s.removed,s.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var BT;(function(n){n[n.Editor=0]="Editor",n[n.Panel=1]="Panel"})(BT||(BT={}));let Rke=class{constructor(e,t,i,s,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=s,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new Zo,this._activeEditorOrder=BT.Editor,this._modelService.onModelAdded(this._updateStateOnModelAdd,this,this._toDispose),this._modelService.onModelRemoved(r=>this._updateState(),this,this._toDispose),this._editorService.onDidActiveEditorChange(r=>this._updateState(),this,this._toDispose),this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor,this,this._toDispose),this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor,this,this._toDispose),this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor,this),T.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Panel,void 0,this._toDispose),T.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusEditorText(()=>this._updateState()),e.onDidFocusEditorWidget(()=>this._updateState(e)))),this._updateState()}_onDidRemoveEditor(e){const t=e.getId();this._toDisposeOnEditorRemove.has(t)&&(this._toDisposeOnEditorRemove.deleteAndDispose(t),this._updateState())}_updateStateOnModelAdd(e){if(gS(e)){if(!this._currentState){this._updateState();return}this._currentState=new jpe(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new Tke([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())gS(a)&&t.add(a);const i=new Map;let s=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&gS(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new gjt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(s=l.id)}}if(!s){let a;if(this._activeEditorOrder===BT.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(s=c.id)}const o=new jpe(t,i,s),r=jpe.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(Sr.Panel);if(e instanceof ujt){const t=e.getControl();if(Ka(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return ew(e)&&(e=e.getModifiedEditor()),e}};Rke=D([_(1,Ai),_(2,jt),_(3,_i),_(4,Nw)],Rke);let K$e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=s,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(et.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new kke(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Ue.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new Lke(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Ue.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new Rke(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],s=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new hjt(a.id,a.editor.getModel(),a.editor,{onGainedFocus(){},onLostFocus(){}},this._mainThreadDocuments,this._modelService,this._clipboardService);this._textEditors.set(a.id,c),i.push(c)}for(const{id:a}of e.removedEditors){const c=this._textEditors.get(a);c&&(c.dispose(),this._textEditors.delete(a),t.push(a))}const o=Object.create(null);let r=!0;e.newActiveEditor!==void 0&&(r=!1,o.newActiveEditor=e.newActiveEditor),s.length>0&&(r=!1,o.removedDocuments=s),t.length>0&&(r=!1,o.removedEditors=t),e.addedDocuments.length>0&&(r=!1,o.addedDocuments=e.addedDocuments.map(a=>this._toModelAddData(a))),e.addedEditors.length>0&&(r=!1,o.addedEditors=i.map(a=>this._toTextEditorAddData(a))),r||(this._proxy.$acceptDocumentsAndEditorsDelta(o),s.forEach(this._mainThreadDocuments.handleModelRemoved,this._mainThreadDocuments),e.addedDocuments.forEach(this._mainThreadDocuments.handleModelAdded,this._mainThreadDocuments),t.forEach(this._mainThreadEditors.handleTextEditorRemoved,this._mainThreadEditors),i.forEach(this._mainThreadEditors.handleTextEditorAdded,this._mainThreadEditors))}_toModelAddData(e){return{uri:e.uri,versionId:e.getVersionId(),lines:e.getLinesContent(),EOL:e.getEOL(),languageId:e.getLanguageId(),isDirty:this._textFileService.isDirty(e.uri)}}_toTextEditorAddData(e){const t=e.getProperties();return{id:e.getId(),documentUri:e.getModel().uri,options:t.options,selections:t.selections,visibleRanges:t.visibleRanges,editorPosition:this._findEditorPosition(e)}}_findEditorPosition(e){for(const t of this._editorService.visibleEditorPanes)if(e.matches(t))return U1(this._editorGroupService,t.group)}findTextEditorIdFor(e){for(const[t,i]of this._textEditors)if(i.matches(e))return t}getIdOfCodeEditor(e){for(const[t,i]of this._textEditors)if(i.getCodeEditor()===e)return t}getEditor(e){return this._textEditors.get(e)}};K$e=D([TO,_(1,Ai),_(2,tr),_(3,_i),_(4,jt),_(5,ci),_(6,Rn),_(7,ur),_(8,Nw),_(9,ec),_(10,fC),_(11,_o),_(12,Mu),_(13,Tm),_(14,Re)],K$e);var dT;const Kpe={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function fjt(n){const e=n;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function pjt(n){const e=n;return e.kind===qo.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var PP;let Y$e=(PP=class extends ${get id(){return this._id}get active(){return this.selection[0]??null}constructor(e,t,i){super(),this.instantiationService=t,this.configurationService=i,this._onDidModelChange=this._register(new I({leakWarningThreshold:500})),this.onDidModelChange=this._onDidModelChange.event,this.editors=[],this.mru=[],this.editorListeners=new Set,this.locked=!1,this.selection=[],this.preview=null,this.sticky=-1,this.transient=new Set,fjt(e)?this._id=this.deserialize(e):this._id=dT.IDS++,this.onConfigurationUpdated(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e&&!e.affectsConfiguration("workbench.editor.openPositioning")&&!e.affectsConfiguration("workbench.editor.focusRecentEditorAfterClose")||(this.editorOpenPositioning=this.configurationService.getValue("workbench.editor.openPositioning"),this.focusRecentEditorAfterClose=this.configurationService.getValue("workbench.editor.focusRecentEditorAfterClose"))}get count(){return this.editors.length}get stickyCount(){return this.sticky+1}getEditors(e,t){const i=e===eg.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===eg.MOST_RECENTLY_ACTIVE?i.filter(s=>!this.isSticky(s)):i.slice(this.sticky+1):i}getEditorByIndex(e){return this.editors[e]}get activeEditor(){return this.active}isActive(e){return this.matches(this.active,e)}get previewEditor(){return this.preview}openEditor(e,t){const i=t?.sticky||typeof t?.index=="number"&&this.isSticky(t.index),s=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!s&&this.preview===this.activeEditor,a=this.findEditor(e,t);if(a){const[c,l]=a;return this.doSetTransient(c,l,o===!1?!1:this.isTransient(c)),s&&this.doPin(c,l),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),t&&typeof t.index=="number"&&this.moveEditor(c,t.index),i&&this.doStick(c,this.indexOf(c)),{editor:c,isNew:!1}}else{const c=e,l=this.indexOf(this.active);let d;if(t&&typeof t.index=="number"?d=t.index:this.editorOpenPositioning===Kpe.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===Kpe.LAST?d=this.editors.length:(this.editorOpenPositioning===Kpe.LEFT?l===0||!this.editors.length?d=0:d=l:d=l+1,!i&&this.isSticky(d)&&(d=this.sticky+1)),i&&(this.sticky++,this.isSticky(d)||(d=this.sticky)),(s||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!s){if(this.preview){const u=this.indexOf(this.preview);d>u&&d--,this.replaceEditor(this.preview,c,d,!r)}this.preview=c}this.registerEditorListeners(c);const h={kind:qo.EDITOR_OPEN,editor:c,editorIndex:d};return this._onDidModelChange.fire(h),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),{editor:c,isNew:!0}}}registerEditorListeners(e){const t=new Z;this.editorListeners.add(t),t.add(T.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const s={kind:qo.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:qo.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:qo.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:qo.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===qo.EDITOR_CLOSE&&i.editor?.matches(e)&&(St(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,s=!0){const o=this.doCloseEditor(e,mx.REPLACE,s);if(this.splice(i,!1,t),o){const r={kind:qo.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=mx.UNKNOWN,i=!0){const s=this.doCloseEditor(e,t,i);if(s){const o={kind:qo.EDITOR_CLOSE,...s};return this._onDidModelChange.fire(o),s}}doCloseEditor(e,t,i){const s=this.indexOf(e);if(s===-1)return;const o=this.editors[s],r=this.isSticky(s),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:s===this.editors.length-1?c=this.editors[s-1]:c=this.editors[s+1];const l=this.selection.filter(d=>d!==o&&d!==c);this.doSetSelection(c,this.editors.indexOf(c),l)}else this.doSetSelection(null,void 0,[]);else if(!a&&this.doIsSelected(o)){const c=this.selection.filter(l=>l!==o&&l!==this.activeEditor);this.doSetSelection(this.activeEditor,this.indexOf(this.activeEditor),c)}return this.preview===o&&(this.preview=null),this.transient.delete(o),this.splice(s,!0),{editor:o,sticky:r,editorIndex:s,context:t}}moveEditor(e,t){t>=this.editors.length?t=this.editors.length-1:t<0&&(t=0);const i=this.indexOf(e);if(i<0||t===i)return;const s=this.editors[i],o=this.sticky;this.isSticky(i)&&t>this.sticky?this.sticky--:!this.isSticky(i)&&t<=this.sticky&&this.sticky++,this.editors.splice(i,1),this.editors.splice(t,0,s);const r={kind:qo.EDITOR_MOVE,editor:s,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:qo.EDITOR_STICKY,editor:s,editorIndex:t};this._onDidModelChange.fire(a)}return s}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:qo.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doSetSelection(i,s,[]),i}get selectedEditors(){return this.editors.filter(e=>this.doIsSelected(e))}isSelected(e){let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.doIsSelected(t)}doIsSelected(e){return this.selection.includes(e)}setSelection(e,t){const i=this.findEditor(e);if(!i)return;const[s,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==s&&r.add(l)}this.doSetSelection(s,o,Array.from(r))}doSetSelection(e,t,i){const s=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&s!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:qo.EDITOR_ACTIVE,editor:e,editorIndex:t};this._onDidModelChange.fire(l)}if(a||o.length!==r.length||o.some(c=>!r.includes(c))){const c={kind:qo.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:qo.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:qo.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doPin(i,s),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnpin(i,s),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const s={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(s),i&&this.closeEditor(i,mx.UNPIN)}isPinned(e){let t;return typeof e=="number"?t=this.editors[e]:t=e,!this.matches(this.preview,t)}stick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doStick(i,s),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnstick(i,s),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}isSticky(e){if(this.sticky<0)return!1;let t;return typeof e=="number"?t=e:t=this.indexOf(e),t<0?!1:t<=this.sticky}setTransient(e,t){if(!t&&this.transient.size===0)return;const i=this.findEditor(e);if(!i)return;const[s,o]=i;return this.doSetTransient(s,o,t),s}doSetTransient(e,t,i){if(i){if(this.transient.has(e))return;this.transient.add(e)}else{if(!this.transient.has(e))return;this.transient.delete(e)}const s={kind:qo.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(s)}isTransient(e){if(this.transient.size===0)return!1;let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.transient.has(t)}splice(e,t,i){const s=this.editors[e];if(t&&this.isSticky(e)&&this.sticky--,i?this.editors.splice(e,t?1:0,i):this.editors.splice(e,t?1:0),!t&&i)this.mru.length===0?this.mru.push(i):this.mru.splice(1,0,i);else{const o=this.indexOf(s,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let s=-1;if(!e)return s;for(let o=0;othis.indexOf(a,t)).filter(a=>a>=0);return{id:this.id,locked:this.locked?!0:void 0,editors:i,mru:r,preview:s,sticky:o>=0?o:void 0}}deserialize(e){const t=it.as(zS.EditorFactory);return typeof e.id=="number"?(this._id=e.id,dT.IDS=Math.max(e.id+1,dT.IDS)):this._id=dT.IDS++,e.locked&&(this.locked=!0),this.editors=Vi(e.editors.map((i,s)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof cC&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&s<=e.sticky&&e.sticky--,o})),this.mru=Vi(e.mru.map(i=>this.editors[i])),this.selection=this.mru.length>0?[this.mru[0]]:[],typeof e.preview=="number"&&(this.preview=this.editors[e.preview]),typeof e.sticky=="number"&&(this.sticky=e.sticky),this._id}dispose(){St(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},dT=PP,PP.IDS=0,PP);Y$e=dT=D([_(1,be),_(2,Re)],Y$e);class mjt extends ${constructor(e,t){super(),this._register(pe(e,xe.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(pe(e,xe.DRAG_END,i)),this._register(pe(e,xe.MOUSE_MOVE,s=>{s.buttons===0&&i()}))}}const sle=class sle extends cC{get typeId(){return sle.typeId}get editorId(){return this.viewType}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor}get resource(){return P.from({scheme:_e.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=Dr(),this._hasTransfered=!1,this.viewType=e.viewType,this.providedId=e.providedId,this._name=e.name,this._webview=t}dispose(){this.isDisposed()||this._hasTransfered||this._webview?.dispose(),super.dispose()}getName(){return this._name}getTitle(e){return this.getName()}getDescription(){}setName(e){this._name=e,this.webview.setTitle(e),this._onDidChangeLabel.fire()}get webview(){return this._webview}get extension(){return this.webview.extension}get iconPath(){return this._iconPath}set iconPath(e){this._iconPath=e,this._iconManager.setIcons(this._resourceId,e)}matches(e){return super.matches(e)||e===this}get group(){return this._group}updateGroup(e){this._group=e}transfer(e){if(!this._hasTransfered)return this._hasTransfered=!0,e._webview=this._webview,e}claim(e,t,i){return this._webview.claim(e,t,i)}};sle.typeId="workbench.editors.webviewInput";let Qg=sle;var Mke;const _jt="vs/workbench/contrib/webviewPanel/browser/webviewEditor",vjt=new Y("activeWebviewPanelId","",{type:"string",description:g(_jt,0,"The viewType of the currently active webview panel.")});var FP;let J$e=(FP=class extends sne{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,s,o,r,a,c,l){super(Mke.ID,e,t,i,s),this._editorGroupsService=o,this._editorService=r,this._workbenchLayoutService=a,this._hostService=c,this._contextKeyService=l,this._visible=!1,this._isDisposed=!1,this._webviewVisibleDisposables=this._register(new Z),this._onFocusWindowHandler=this._register(new Dn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new Dn);const d=o.getPart(e);this._register(T.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Qg?this.input.webview:void 0}get scopedContextKeyService(){return this._scopedContextKeyService.value}createEditor(e){const t=document.createElement("div");this._element=t,this._element.id=`webview-editor-element-${Dr()}`,e.appendChild(t),this._scopedContextKeyService.value=this._register(this._contextKeyService.createScoped(t))}dispose(){this._isDisposed=!0,this._element?.remove(),this._element=void 0,super.dispose()}layout(e){this._dimension=e,this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview,e)}focus(){super.focus(),!this._onFocusWindowHandler.value&&!Jn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus(Lne.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Qg&&this.webview&&(e?this.claimWebview(this.input):this.webview.release(this)),super.setEditorVisible(e)}clearInput(){this.webview&&(this.webview.release(this),this._webviewVisibleDisposables.clear()),super.clearInput()}async setInput(e,t,i,s){if(this.input&&e.matches(this.input))return;const o=e instanceof Qg&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,s),await e.resolve(),!(s.isCancellationRequested||this._isDisposed)&&e instanceof Qg&&(e.updateGroup(this.group.id),o||this.claimWebview(e),this._dimension&&this.layout(this._dimension))}claimWebview(e){e.claim(this,this.window,this.scopedContextKeyService),this._element&&(this._element.setAttribute("aria-flowto",e.webview.container.id),$ut(e.webview.container,this._element)),this._webviewVisibleDisposables.clear(),this._webviewVisibleDisposables.add(this._editorGroupsService.createEditorDropTarget(e.webview.container,{containsGroup:t=>this.group.id===t.id})),this._webviewVisibleDisposables.add(new mjt(this.window,()=>this.webview)),this.synchronizeWebviewContainerDimensions(e.webview),this._webviewVisibleDisposables.add(this.trackFocus(e.webview))}synchronizeWebviewContainerDimensions(e,t){if(!this._element?.isConnected)return;const i=this._workbenchLayoutService.getContainer(this.window,Lne.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Dd(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},Mke=FP,FP.ID="WebviewEditor",FP);J$e=Mke=D([_(1,rn),_(2,pn),_(3,on),_(4,ur),_(5,_i),_(6,kO),_(7,Id),_(8,Pe)],J$e);let Nke=class{constructor(e,t){this._lifecycleService=e,this._configService=t,this._icons=new Map,this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()})}dispose(){this._styleElementDisposable?.dispose(),this._styleElementDisposable=void 0,this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElementDisposable=new Z,this._styleElement=od(void 0,void 0,this._styleElementDisposable),this._styleElement.className="webview-icons"),this._styleElement}setIcons(e,t){t?this._icons.set(e,t):this._icons.delete(e),this.updateStyleSheet()}async updateStyleSheet(){await this._lifecycleService.when(Us.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const s=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${s}, .monaco-workbench.hc-light ${s} { content: ""; background-image: ${uf(i.light)}; }`,`.monaco-workbench.vs-dark ${s}, .monaco-workbench.hc-black ${s} { content: ""; background-image: ${uf(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` -`)}};Nke=D([_(0,mg),_(1,Re)],Nke);function Use(n,e){return n.canResolve(e)}let QF=class extends Qg{constructor(e,t,i){super(e,t,i.iconManager),this._webviewWorkbenchService=i,this._resolved=!1}dispose(){super.dispose(),this._resolvePromise?.cancel(),this._resolvePromise=void 0}async resolve(){if(!this._resolved){this._resolved=!0,this._resolvePromise=na(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Na(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};QF.__decorator=D([ii],QF.prototype,"resolve",null);QF=D([_(2,kQ)],QF);class wjt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new sd,s=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=pa(e.webview.onDidDispose(s),t.onCancellationRequested(()=>{s(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:s})=>Use(e,s));this._awaitingRevival=this._awaitingRevival.filter(({input:s})=>!Use(e,s));for(const{input:s,promise:o,disposable:r}of i)e.resolveWebview(s,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let X$e=class extends ${constructor(e,t,i,s){super(),this._editorService=t,this._instantiationService=i,this._webviewService=s,this._revivers=new Set,this._revivalPool=new wjt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(Nke)),this._register(e.registerContextKeyProvider({contextKey:vjt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(s.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg?t=e.primary:e.secondary instanceof Qg&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Qg&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,s){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Qg,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:s.preserveFocus,activation:s.preserveFocus?y1.RESTORE:void 0},s.group),r}revealWebview(e,t,i){const s=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(s,{preserveFocus:i,activation:i?y1.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof op&&(e===t.primary||e===t.secondary))return t;return e}openRevivedWebview(e){const t=this._webviewService.createWebviewOverlay(e.webviewInitInfo);t.state=e.state;const i=this._instantiationService.createInstance(QF,{viewType:e.viewType,providedId:e.webviewInitInfo.providedViewType,name:e.title},t);return i.iconPath=e.iconPath,typeof e.group=="number"&&i.updateGroup(e.group),i}registerResolver(e){this._revivers.add(e);const t=new ai;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof QF?!0:fi.some(this._revivers.values(),t=>Use(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Use(i,e))return await i.resolveWebview(e,t),!0;return!1}async resolveWebview(e,t){if(!await this.tryRevive(e,t)&&!t.isCancellationRequested)return this._revivalPool.enqueueForRestoration(e,t)}setIcons(e,t){this._iconManager.setIcons(e,t)}};X$e=D([_(0,ur),_(1,_i),_(2,be),_(3,Zde)],X$e);var MB;const Ype="vs/workbench/contrib/customEditor/browser/customEditorInput";var OP;let nH=(OP=class extends QF{static create(e,t,i,s,o){return e.invokeFunction(r=>{const a=r.get(RQ).getValue(t),c=a?ze.fromString(a):void 0,l=r.get(Zde).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(MB,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof s<"u"&&d.updateGroup(s),d})}get resource(){return this._editorResource}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,s),this.instantiationService=o,this.labelService=r,this.customEditorService=a,this.fileDialogService=c,this.undoRedoService=l,this.fileService=d,this.filesConfigurationService=h,this.editorGroupsService=u,this.layoutService=f,this.customEditorLabelService=p,this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._editorResource=e.resource,this.oldResource=i.oldResource,this._defaultDirtyState=i.startsDirty,this._backupId=i.backupId,this._untitledDocumentData=i.untitledDocumentData,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this.resource.scheme&&this.updateLabel()}updateLabel(){this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}get typeId(){return MB.typeId}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return e|=Mi.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Mi.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??yr(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this.resource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this.resource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this.resource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof MB&&this.viewType===e.viewType&&_n(this.resource,e.resource)}copy(){return MB.create(this.instantiationService,this.resource,this.viewType,this.group,this.webview.options)}isReadonly(){return this._modelRef?this._modelRef.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._modelRef?this._modelRef.object.isDirty():!!this._defaultDirtyState}async save(e,t){if(!this._modelRef)return;const i=await this._modelRef.object.saveCustomEditor(t);if(i)return _n(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,s=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(s&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,s,t))return(await this.rename(e,s))?.editor}async revert(e,t){if(this._modelRef)return this._modelRef.object.revert(t);this._defaultDirtyState=!1,this._onDidChangeDirty.fire()}async resolve(){if(await super.resolve(),this.isDisposed())return null;if(!this._modelRef){const e=this.capabilities;this._modelRef=this._register(ws(await this.customEditorService.models.tryRetain(this.resource,this.viewType))),this._register(this._modelRef.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._modelRef.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._untitledDocumentData&&(this._defaultDirtyState=!0),this.isDirty()&&this._onDidChangeDirty.fire(),this.capabilities!==e&&this._onDidChangeCapabilities.fire()}return null}async rename(e,t){return{editor:{resource:t}}}undo(){return ws(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return ws(this._modelRef),this.undoRedoService.redo(this.resource)}onMove(e){this._moveHandler=e}transfer(e){if(super.transfer(e))return e._moveHandler=this._moveHandler,this._moveHandler=void 0,e}get backupId(){return this._modelRef?this._modelRef.object.backupId:this._backupId}get untitledDocumentData(){return this._untitledDocumentData}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}claim(e,t,i){if(this.doCanMove(t.vscodeWindowId)!==!0)throw xZe(g(Ype,0,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[_l({id:"openInOriginalWindow",label:g(Ype,1,"Open in Original Window"),run:async()=>{const s=this.editorGroupsService.getPart(this.layoutService.getContainer(gt(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,s.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const s=this.doCanMove(i.windowId);if(typeof s=="string")return s}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&>(this.webview.container).vscodeWindowId!==e?g(Ype,2,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},MB=OP,OP.typeId="workbench.editors.webviewEditor",OP);nH=MB=D([_(3,kQ),_(4,be),_(5,eo),_(6,IPe),_(7,bf),_(8,pO),_(9,ci),_(10,hh),_(11,ur),_(12,kO),_(13,aD)],nH);var NB,J0;let Pke=(J0=class extends cC{static create(e,t,i,s,o){return e.createInstance(NB,t,i,s,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return NB.ID}get language(){return this._inputModelRef?.object.textEditorModel.getLanguageId()??this._initLanguage}get notebookEditorInput(){return this._notebookEditorInput}get editorInputs(){return[this._notebookEditorInput]}get resource(){return this._resource}get inputResource(){return this._inputResource}get primary(){return this._notebookEditorInput}constructor(e,t,i,s,o,r,a,c,l,d,h){const u=VM.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(ike.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??NB.windowNames[e.path]??yr(e.path,T_(e.path)),this._initLanguage=s,this._resource=e,this._inputResource=t,this._inputResolver=null,this._editorModelReference=null,this._inputModelRef=null,this._textModelService=r,this._interactiveDocumentService=a,this._historyService=c,this._registerListeners()}_registerListeners(){const e=T.once(this.primary.onWillDispose);this._register(e(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire()))}get capabilities(){const e=this.isScratchpad?Mi.Scratchpad:0;return Mi.Untitled|Mi.Readonly|e}async _resolveEditorModel(){return this._editorModelReference||(this._editorModelReference=await this._notebookEditorInput.resolve()),this._editorModelReference}async resolve(){return this._editorModelReference?this._editorModelReference:this._inputResolver?this._inputResolver:(this._inputResolver=this._resolveEditorModel(),this._inputResolver)}async resolveInput(e){if(this._inputModelRef)return this._inputModelRef.object.textEditorModel;const t=e??this._initLanguage??Yc;return this._interactiveDocumentService.willCreateInteractiveDocument(this.resource,this.inputResource,t),this._inputModelRef=await this._textModelService.createModelReference(this.inputResource),this._inputModelRef.object.textEditorModel}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const s=this.getName()+".ipynb",o=Qt(await this._fileDialogService.defaultFilePath(),s),r=await this._fileDialogService.pickFileToSave(o,t?.availableFileSystems);if(!r)return;const a=await this._editorModelReference.saveAs(r);return a&&"resource"in a&&a.resource&&this._notebookService.getNotebookTextModel(a.resource)?.dispose(),a}matches(e){return super.matches(e)?!0:e instanceof NB?_n(this.resource,e.resource)&&_n(this.inputResource,e.inputResource):!1}getName(){return this.name}isDirty(){return this.isScratchpad?!1:this._editorModelReference?.isDirty()??!1}isModified(){return this._editorModelReference?.isModified()??!1}async revert(e,t){this._editorModelReference&&this._editorModelReference.isDirty()&&await this._editorModelReference.revert(t)}dispose(){this._editorModelReference?.revert({soft:!0}),this._notebookEditorInput?.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,this._interactiveDocumentService.willRemoveInteractiveDocument(this.resource,this.inputResource),this._inputModelRef?.dispose(),this._inputModelRef=null,super.dispose()}get historyService(){return this._historyService}},NB=J0,J0.windowNames={},J0.ID="workbench.input.interactive",J0);Pke=NB=D([_(4,be),_(5,Rn),_(6,RPe),_(7,$Ze),_(8,oD),_(9,bf),_(10,Re)],Pke);const HA=class HA{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const s of e)t=Math.min(t,s.startLineNumber),i=Math.max(i,s.startLineNumber+s.lineCount);return new HA(t,i-t)}static fromLineNumbers(e,t){return new HA(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new cn}join(e){return new HA(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive)-this.startLineNumber)}get endLineNumberExclusive(){return this.startLineNumber+this.lineCount}get isEmpty(){return this.lineCount===0}touches(e){return this.endLineNumberExclusive>=e.startLineNumber&&e.endLineNumberExclusive>=this.startLineNumber}isAfter(e){return this.startLineNumber>=e.endLineNumberExclusive}isBefore(e){return e.startLineNumber>=this.endLineNumberExclusive}delta(e){return new HA(this.startLineNumber+e,this.lineCount)}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}equals(e){return this.startLineNumber===e.startLineNumber&&this.lineCount===e.lineCount}contains(e){return this.startLineNumber<=e&&ee.startLineNumber,cg);let ap=HA;const bjt={start:"<<<<<<<",end:">>>>>>>"};function*Cjt(n,e,t){const i=new DS(e);for(const s of n){i.takeWhile(r=>i1.isGreaterThan(t(s,r)));const o=i.takeWhile(r=>i1.isNeitherLessOrGreaterThan(t(s,r)));yield{left:s,rights:o||[]}}}function ert(...n){return[].concat(...n)}let Z$e=class{constructor(e,t){this.key=e,this.storageService=t,this.hasValue=!1,this.value=void 0}get(){if(!this.hasValue){const e=this.storageService.get(this.key,ke.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){bt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),ke.PROFILE,ln.USER)}};Z$e=D([_(1,on)],Z$e);class CG{constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&Ls(this.newLines,e.newLines)}toEdits(e){return new Sjt([this]).toEdits(e)}}class yjt{constructor(e,t){this.range=e,this.newText=t}equals(e){return O.equalsRange(this.range,e.range)&&this.newText===e.newText}}class Sjt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new O(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` -`).join("")}:t.range.startLineNumber===1?{range:new O(1,1,e,Number.MAX_SAFE_INTEGER),text:t.newLines.join(` -`)}:{range:new O(t.range.startLineNumber-1,Number.MAX_SAFE_INTEGER,e,Number.MAX_SAFE_INTEGER),text:t.newLines.map(i=>` -`+i).join("")})}}function Ajt(n,e){return!(e.lineNumbern.endLineNumber||e.lineNumber===n.startLineNumber&&e.column=n.endColumn)}function Ejt(n,e){return n.lineNumber===e.lineNumber?new gf(0,e.column-n.column):new gf(e.lineNumber-n.lineNumber,e.column-1)}function xjt(n,e){return e.lineCount===0?new oe(n.lineNumber,n.column+e.columnCount):new oe(n.lineNumber+e.lineCount,e.columnCount+1)}function e8e(n,e){return n.endLineNumbert?t.join(i):i,void 0)}constructor(e,t){this.inputRange=e,this.outputRange=t}extendInputRange(e){if(!e.containsRange(this.inputRange))throw new cn;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new ef(e,new ap(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new ef(this.inputRange.join(e.inputRange),this.outputRange.join(e.outputRange))}get resultingDeltaFromOriginalToModified(){return this.outputRange.endLineNumberExclusive-this.inputRange.endLineNumberExclusive}toString(){return`${this.inputRange.toString()} -> ${this.outputRange.toString()}`}addOutputLineDelta(e){return new ef(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new ef(this.inputRange.delta(e),this.outputRange)}reverse(){return new ef(this.outputRange,this.inputRange)}}class LR{static betweenOutputs(e,t,i){const o=iue.compute(e,t).map(r=>new ef(r.output1Range,r.output2Range));return new LR(o,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,fw(()=>gz(e,(i,s)=>i.inputRange.isBefore(s.inputRange)&&i.outputRange.isBefore(s.outputRange)&&s.inputRange.startLineNumber-i.inputRange.endLineNumberExclusive===s.outputRange.startLineNumber-i.outputRange.endLineNumberExclusive))}project(e){const t=t1(this.lineRangeMappings,o=>o.inputRange.startLineNumber<=e);if(!t)return new ef(new ap(e,1),new ap(e,1));if(t.inputRange.contains(e))return t;const i=new ap(e,1),s=new ap(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new ef(i,s)}get outputLineCount(){const e=Gqe(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new LR(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class iue{static compute(e,t){const i=El(d=>d.inputRange.startLineNumber,cg),s=ert(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(El(d=>d.diff,i)),o=[new Array,new Array],r=[0,0],a=new Array;function c(d){const h=ef.join(o[0])||new ef(d,d.delta(r[0])),u=ef.join(o[1])||new ef(d,d.delta(r[1]));a.push(new iue(l,h.extendInputRange(l).outputRange,o[0],u.extendInputRange(l).outputRange,o[1])),o[0]=[],o[1]=[]}let l;for(const d of s){const h=d.diff.inputRange;l&&!l.touches(h)&&(c(l),l=void 0),r[d.source]=d.diff.resultingDeltaFromOriginalToModified,l=l?l.join(h):h,o[d.source].push(d.diff)}return l&&c(l),a}constructor(e,t,i,s,o){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=s,this.output2LineMappings=o}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class qI extends ef{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,s,o){super(e,i),this.inputTextModel=t,this.outputTextModel=s,this.rangeMappings=o||[new Cx(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new qI(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new qI(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new qI(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new CG(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new CG(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class Cx{constructor(e,t){this.inputRange=e,this.outputRange=t}toString(){function e(t){return`[${t.startLineNumber}:${t.startColumn}, ${t.endLineNumber}:${t.endColumn})`}return`${e(this.inputRange)} -> ${e(this.outputRange)}`}addOutputLineDelta(e){return new Cx(this.inputRange,new O(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new Cx(new O(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new Cx(this.outputRange,this.inputRange)}}class y2{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,fw(()=>gz(e,(i,s)=>e8e(i.inputRange,s.inputRange)&&e8e(i.outputRange,s.outputRange)))}project(e){const t=t1(this.rangeMappings,o=>o.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new Cx(O.fromPositions(e,e),O.fromPositions(e,e));if(Ajt(t.inputRange,e))return t;const i=Ejt(t.inputRange.getEndPosition(),e),s=xjt(t.outputRange.getEndPosition(),i);return new Cx(O.fromPositions(e),O.fromPositions(s))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new Cx(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=Gqe(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new y2(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Vse=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=eZe("mergeEditor.diffAlgorithm","advanced",this.configurationService).map(i=>i==="smart"?"legacy":i==="experimental"?"advanced":i)}async computeDiff(e,t,i){const s=this.mergeAlgorithm.read(i),o=e.getVersionId(),r=t.getVersionId(),a=await this.editorWorkerService.computeDiff(e.uri,t.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1},s);if(!a)throw new Error("Diff computation failed");if(e.isDisposed()||t.isDisposed())return{diffs:null};const c=a.changes.map(h=>new qI(t8e(h.original),e,t8e(h.modified),t,h.innerChanges?.map(u=>Djt(u)))),l=e.getVersionId(),d=t.getVersionId();return o!==l||r!==d?{diffs:null}:(fw(()=>{for(const h of c){const u=h.inputRange,f=h.outputRange,p=h.inputTextModel,m=h.outputTextModel;for(const v of h.rangeMappings){let w=u.startLineNumber-1<=v.inputRange.startLineNumber&&v.inputRange.endLineNumber<=u.endLineNumberExclusive;w&&v.inputRange.startLineNumber===u.startLineNumber-1&&(w=v.inputRange.endColumn>=p.getLineMaxColumn(v.inputRange.startLineNumber)),w&&v.inputRange.endLineNumber===u.endLineNumberExclusive&&(w=v.inputRange.endColumn===1);let b=f.startLineNumber-1<=v.outputRange.startLineNumber&&v.outputRange.endLineNumber<=f.endLineNumberExclusive;if(b&&v.outputRange.startLineNumber===f.startLineNumber-1&&(b=v.outputRange.endColumn>=m.getLineMaxColumn(v.outputRange.endLineNumber)),b&&v.outputRange.endLineNumber===f.endLineNumberExclusive&&(b=v.outputRange.endColumn===1),!w||!b)return!1}}return c.length===0||c[0].inputRange.startLineNumber===c[0].outputRange.startLineNumber&&gz(c,(h,u)=>u.inputRange.startLineNumber-h.inputRange.endLineNumberExclusive===u.outputRange.startLineNumber-h.outputRange.endLineNumberExclusive&&h.inputRange.endLineNumberExclusive{if(!this._isOccupied){this._isOccupied=!0;try{return e(...t)}finally{this._isOccupied=!1}}}}}class Jpe extends ${get isApplyingChange(){return this._barrier.isOccupied}constructor(e,t,i){super(),this.baseTextModel=e,this.textModel=t,this.diffComputer=i,this._recomputeCount=0,this._state=xi(this,r_.initializing),this._diffs=xi(this,[]),this._barrier=new kjt,this._isDisposed=!1,this._isInitializing=!0;const s=oL("recompute");this._register(Ni(o=>{s.read(o),this._recompute(o)})),this._register(e.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{s.trigger(void 0)}))),this._register(t.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{s.trigger(void 0)}))),this._register(Ee(()=>{this._isDisposed=!0}))}get state(){return this._state}get diffs(){return this._diffs}_recompute(e){this._recomputeCount++;const t=this._recomputeCount;this._state.get()===r_.initializing&&(this._isInitializing=!0),En(s=>{this._state.set(this._isInitializing?r_.initializing:r_.updating,s,GA.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(s=>{this._isDisposed||t===this._recomputeCount&&En(o=>{s.diffs?(this._state.set(r_.upToDate,o,GA.textChange),this._diffs.set(s.diffs,o,GA.textChange)):this._state.set(r_.error,o,GA.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==r_.upToDate)throw new cn("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(El(o=>o.inputRange.startLineNumber,cg)),e.reverse();let s=this._diffs.get();for(const o of e){const r=s.length;if(s=s.filter(a=>a!==o),r===s.length)throw new cn;this._barrier.runExclusivelyOrThrow(()=>{const a=o.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),s=s.map(a=>a.outputRange.isAfter(o.outputRange)?a.addOutputLineDelta(o.inputRange.lineCount-o.outputRange.lineCount):a)}this._diffs.set(s,t,GA.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const s=new qI(e.range,this.baseTextModel,new ap(e.range.startLineNumber,e.newLines.length),this.textModel);let o=!1,r=0;const a=new Array;for(const c of this.diffs.get()){if(c.inputRange.touches(e.range))throw new cn("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(o||(o=!0,a.push(s.addOutputLineDelta(r))),a.push(c.addOutputLineDelta(e.newLines.length-e.range.lineCount))):a.push(c),o||(r+=c.outputRange.lineCount-c.inputRange.lineCount)}o||(o=!0,a.push(s.addOutputLineDelta(r))),this._barrier.runExclusivelyOrThrow(()=>{const c=new CG(e.range.delta(r),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,GA.other)}findTouchingDiffs(e){return this.diffs.get().filter(t=>t.inputRange.touches(e))}getResultLine(e,t){let i=0;const s=t?this.diffs.read(t):this.diffs.get();for(const o of s){if(o.inputRange.contains(e)||o.inputRange.endLineNumberExclusive===e)return o;if(o.inputRange.endLineNumberExclusivenew xOe(a.inputRange,i,a.output1Range,s,a.output1LineMappings,a.output2Range,o,a.output2LineMappings))}constructor(e,t,i,s,o,r,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=s,this.input1Diffs=o,this.input2Range=r,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=qI.join(this.input1Diffs),this.input2CombinedDiff=qI.join(this.input2Diffs),this.isEqualChange=Ls(this.input1Diffs,this.input2Diffs,(l,d)=>l.getLineEdit().equals(d.getLineEdit())),this.smartInput1LineRangeEdit=null,this.smartInput2LineRangeEdit=null,this.dumbInput1LineRangeEdit=null,this.dumbInput2LineRangeEdit=null,this.input1Diffs.length===0&&this.input2Diffs.length===0)throw new cn("must have at least one diff")}getInputRange(e){return e===1?this.input1Range:this.input2Range}getInputCombinedDiff(e){return e===1?this.input1CombinedDiff:this.input2CombinedDiff}getInputDiffs(e){return e===1?this.input1Diffs:this.input2Diffs}get isConflicting(){return this.input1Diffs.length>0&&this.input2Diffs.length>0}get canBeCombined(){return this.smartCombineInputs(1)!==void 0}get isOrderRelevant(){const e=this.smartCombineInputs(1),t=this.smartCombineInputs(2);return!e||!t?!1:!e.equals(t)}getEditForBase(e){const t=[];if(e.includesInput1&&this.input1CombinedDiff&&t.push({diff:this.input1CombinedDiff,inputNumber:1}),e.includesInput2&&this.input2CombinedDiff&&t.push({diff:this.input2CombinedDiff,inputNumber:2}),t.length===0)return{edit:void 0,effectiveState:Sh.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Sh.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==rr.both)throw new cn;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[Fke(e.firstInput)-1].diff.getLineEdit(),effectiveState:Sh.base.withInputValue(Fke(e.firstInput),!0,!1)}}smartCombineInputs(e){if(e===1&&this.smartInput1LineRangeEdit!==null)return this.smartInput1LineRangeEdit;if(e===2&&this.smartInput2LineRangeEdit!==null)return this.smartInput2LineRangeEdit;const i=ert(this.input1Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:1}))),this.input2Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:2})))).sort(jqe(El(o=>o.diff.inputRange,O.compareRangesUsingStarts),El(o=>o.input===e?1:2,cg))).map(o=>{const r=o.input===1?this.input1TextModel:this.input2TextModel;return new yjt(o.diff.inputRange,r.getValueInRange(o.diff.outputRange))}),s=Ijt(this.baseRange,i,this.baseTextModel);return e===1?this.smartInput1LineRangeEdit=s:this.smartInput2LineRangeEdit=s,s}dumbCombineInputs(e){if(e===1&&this.dumbInput1LineRangeEdit!==null)return this.dumbInput1LineRangeEdit;if(e===2&&this.dumbInput2LineRangeEdit!==null)return this.dumbInput2LineRangeEdit;let t=this.input1Range.getLines(this.input1TextModel),i=this.input2Range.getLines(this.input2TextModel);e===2&&([t,i]=[i,t]);const s=new CG(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=s:this.dumbInput2LineRangeEdit=s,s}}function Ijt(n,e,t){let i="";const s=n.startLineNumber>1;let o=s?new oe(n.startLineNumber-1,t.getLineMaxColumn(n.startLineNumber-1)):new oe(n.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!o.isBeforeOrEqual(h))return;let u=t.getValueInRange(O.fromPositions(o,h));h.lineNumber>t.getLineCount()&&(u+=` -`),i+=u,i+=d.newText,o=d.range.getEndPosition()}const r=n.endLineNumberExclusive<=t.getLineCount(),a=r?new oe(n.endLineNumberExclusive,1):new oe(n.endLineNumberExclusive-1,Zn.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(O.fromPositions(o,a));i+=c;const l=xw(i);if(s){if(l[0]!=="")return;l.shift()}if(r){if(l[l.length-1]!=="")return;l.pop()}return new CG(n,l)}var rr;(function(n){n[n.base=0]="base",n[n.input1=1]="input1",n[n.input2=2]="input2",n[n.both=3]="both",n[n.unrecognized=4]="unrecognized"})(rr||(rr={}));function Fke(n){return n===1?2:1}class ij{constructor(){}get includesInput1(){return!1}get includesInput2(){return!1}includesInput(e){return e===1?this.includesInput1:this.includesInput2}isInputIncluded(e){return e===1?this.includesInput1:this.includesInput2}toggle(e){return this.withInputValue(e,!this.includesInput(e),!0)}getInput(e){return this.isInputIncluded(e)?S4.first:S4.excluded}}class DOe extends ij{get kind(){return rr.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new nue:this:t?new jF:this}equals(e){return e.kind===rr.base}}class nue extends ij{get kind(){return rr.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new jF}withInputValue(e,t,i=!1){return e===1?t?this:new DOe:t?new sue(1,i):new jF}equals(e){return e.kind===rr.input1}}class jF extends ij{get kind(){return rr.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new nue}withInputValue(e,t,i=!1){return e===2?t?this:new DOe:t?new sue(2,i):new jF}equals(e){return e.kind===rr.input2}}class sue extends ij{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return rr.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new sue(Fke(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new jF:new nue}equals(e){return e.kind===rr.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?S4.first:S4.second}}class Ljt extends ij{get kind(){return rr.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new nue:new jF:this}equals(e){return e.kind===rr.unrecognized}}var Sh;(function(n){n.base=new DOe,n.unrecognized=new Ljt})(Sh||(Sh={}));var S4;(function(n){n[n.excluded=0]="excluded",n[n.first=1]="first",n[n.second=2]="second",n[n.unrecognized=3]="unrecognized"})(S4||(S4={}));const trt="vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel";let zse=class extends pL{constructor(e,t,i,s,o,r,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=s,this.diffComputer=o,this.options=r,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Jpe(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Jpe(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Jpe(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=Dt(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return xOe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=Dt(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new i8e(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=Dt(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=Dt(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=Dt(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=Dt(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=Dt(this,h=>{const u=new LR(this.baseResultDiffs.read(h),-1);return new LR(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new ef(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=Dt(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=Dt(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===r_.initializing)?rv.initializing:u.some(f=>f===r_.updating)?rv.updating:rv.upToDate}),this.inputDiffComputingState=Dt(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===r_.initializing)?rv.initializing:u.some(f=>f===r_.updating)?rv.updating:rv.upToDate}),this.isUpToDate=Dt(this,h=>this.diffComputingState.read(h)===rv.upToDate),this.onInitialized=U$(this.diffComputingState,h=>h===rv.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=Dt(this,h=>{const u=this.modifiedBaseRangeResultStates.read(h);let f=0;for(const[p,m]of u)m.handled.read(h)||f++;return f}),this.hasUnhandledConflicts=this.unhandledConflictsCount.map(h=>h>0),this._register(gJ(this.modifiedBaseRangeResultStates)),this._register(gJ(this.input1ResultMapping)),this._register(gJ(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(Az({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===GA.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);En(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,w]of f){const b=w.accepted.get(),C=!(b.kind===rr.base||b.kind===rr.unrecognized);w.handledInput1.set(C,m),w.handledInput2.set(C,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await U$(this.inputDiffComputingState,t=>t===rv.upToDate);const e=this.modifiedBaseRangeResultStates.get();En(t=>{for(const[i,s]of e){let o,r=!1;i.input1Diffs.length===0?(o=Sh.base.withInputValue(2,!0),r=!0):i.input2Diffs.length===0||i.isEqualChange?(o=Sh.base.withInputValue(1,!0),r=!0):(o=Sh.base,r=!1),s.accepted.set(o,t),s.computedFromDiffing=!1,s.previousNonDiffingState=void 0,s.handledInput1.set(r,t),s.handledInput2.set(r,t)}this.resultTextModel.pushEditOperations(null,[{range:new O(1,1,Number.MAX_SAFE_INTEGER,1),text:this.computeAutoMergedResult()}],()=>null)})}computeAutoMergedResult(){const e=this.modifiedBaseRanges.get(),t=this.base.getLinesContent(),i=this.input1.textModel.getLinesContent(),s=this.input2.textModel.getLinesContent(),o=[];function r(c,l){for(let d=l.startLineNumber;do.inputRange.isEmpty||o.outputRange.isEmpty?new ef(o.inputRange.deltaStart(-1),o.outputRange.deltaStart(-1)):o),s.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new y2(i.flatMap(o=>o.rangeMappings),0).reverse().projectRange(t).outputRange}translateBaseRangeToInput(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new y2(i.flatMap(o=>o.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new y2(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new y2(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).projectRange(e).outputRange}findModifiedBaseRangesInRange(e){return this.modifiedBaseRanges.get().filter(t=>t.baseRange.intersects(e))}updateBaseRangeAcceptedState(e,t,i){const s=Cjt(t,e,(o,r)=>o[0].baseRange.touches(r.inputRange)?i1.neitherLessOrGreaterThan:ap.compareByStart(o[0].baseRange,r.inputRange));for(const o of s){const r=this.computeState(o.left[0],o.rights),a=o.left[1],c=a.accepted.get();c.equals(r)||(!this.firstRun&&!a.computedFromDiffing&&(a.computedFromDiffing=!0,a.previousNonDiffingState=c),a.accepted.set(r,i))}this.firstRun&&(this.firstRun=!1)}computeState(e,t){if(t.length===0)return Sh.base;const i=t.map(r=>r.getLineEdit());function s(r){return Ls(i,r.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(s(e.input1Diffs))return Sh.base.withInputValue(1,!0);if(s(e.input2Diffs))return Sh.base.withInputValue(2,!0);const o=[Sh.base.withInputValue(1,!0).withInputValue(2,!0,!0),Sh.base.withInputValue(2,!0).withInputValue(1,!0,!0),Sh.base.withInputValue(1,!0).withInputValue(2,!0,!1),Sh.base.withInputValue(2,!0).withInputValue(1,!0,!1)];for(const r of o){const{edit:a}=e.getEditForBase(r);if(a){const l=this.resultTextModelDiffs.getResultLineRange(e.baseRange).getLines(this.resultTextModel);if(Ls(a.newLines,l,(d,h)=>d===h))return r}}return Sh.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new cn("object must be from this instance");return t.accepted}setState(e,t,i,s,o=!1){if(!this.isUpToDate.get())throw new cn("Cannot set state while updating");const r=this.modifiedBaseRangeResultStates.get().get(e);if(!r)throw new cn("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new qZ;a&&this.resultTextModelDiffs.removeDiffs(a,s,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);r.accepted.set(d,s),r.previousNonDiffingState=void 0,r.computedFromDiffing=!1;const h=r.handledInput1.get(),u=r.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new Tjt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(r),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,s,c),this.resultTextModel.pushStackElement()),r.handledInput1.set(!0,s),r.handledInput2.set(!0,s)}resetDirtyConflictsToBase(){En(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===rr.unrecognized&&this.setState(t,Sh.base,!1,e,!1);this.resultTextModel.pushStackElement()})}isHandled(e){return this.modifiedBaseRangeResultStates.get().get(e).handled}isInputHandled(e,t){const i=this.modifiedBaseRangeResultStates.get().get(e);return t===1?i.handledInput1:i.handledInput2}setInputHandled(e,t,i,s){const o=this.modifiedBaseRangeResultStates.get().get(e);if(o.handled.get()===i)return;const r=new WeakRef(i8e),a=new WeakRef(this);this.undoRedoService.pushElement({type:wd.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(trt,0,"Set Input Handled"),redo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&En(d=>{t===1?o.handledInput1.set(i,d):o.handledInput2.set(i,d)})},undo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&En(d=>{t===1?o.handledInput1.set(!i,d):o.handledInput2.set(!i,d)})}}),t===1?o.handledInput1.set(i,s):o.handledInput2.set(i,s)}setHandled(e,t,i){const s=this.modifiedBaseRangeResultStates.get().get(e);s.handled.get()!==t&&(s.handledInput1.set(t,i),s.handledInput2.set(t,i))}setLanguageId(e,t){const i=this.languageService.createById(e);this.base.setLanguage(i,t),this.input1.textModel.setLanguage(i,t),this.input2.textModel.setLanguage(i,t),this.resultTextModel.setLanguage(i,t)}getInitialResultValue(){const e=[];for(;;){const t=this.resultSnapshot.read();if(t===null)break;e.push(t)}return e.join()}async getResultValueWithConflictMarkers(){if(await U$(this.diffComputingState,c=>c===rv.upToDate),this.unhandledConflictsCount.get()===0)return this.resultTextModel.getValue();const e=this.resultTextModel.getLinesContent(),t=this.input1.textModel.getLinesContent(),i=this.input2.textModel.getLinesContent(),s=this.modifiedBaseRangeResultStates.get(),o=[];function r(c,l){for(let d=l.startLineNumber;d>>>>>>")}return r(e,ap.fromLineNumbers(a,e.length+1)),o.join(` -`)}get conflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.base)}get conflictsResolvedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input1)}get conflictsResolvedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input2)}get conflictsResolvedWithSmartCombination(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input1})}get manuallySolvedConflictCountThatEqualInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&t.previousNonDiffingState?.smartCombination})}};zse=D([_(7,Di),_(8,pO)],zse);function Df(n,e){let t=0;for(const i of n)e(i)&&t++;return t}class i8e{constructor(e){this.baseRange=e,this.accepted=xi(`BaseRangeState${this.baseRange.baseRange}`,Sh.base),this.handledInput1=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Dt(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var rv;(function(n){n[n.initializing=1]="initializing",n[n.upToDate=2]="upToDate",n[n.updating=3]="updating"})(rv||(rv={}));class Tjt{constructor(e,t,i,s,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=s,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(trt,1,"Undo Mark As Handled"),this.type=wd.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(!0,i),t.handledInput2.set(!0,i)})}undo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}const mL="vs/workbench/contrib/mergeEditor/common/mergeEditor";new Y("isMergeEditor",!1,{type:"boolean",description:g(mL,0,"The editor is a merge editor")});new Y("isMergeResultEditor",!1,{type:"boolean",description:g(mL,1,"The editor is a the result editor of a merge editor.")});new Y("mergeEditorLayout","mixed",{type:"string",description:g(mL,2,"The layout mode of a merge editor")});new Y("mergeEditorShowBase",!1,{type:"boolean",description:g(mL,3,"If the merge editor shows the base version")});new Y("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(mL,4,"If base should be shown at the top")});new Y("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(mL,5,"If the merge editor shows non-conflicting changes")});new Y("mergeEditorBaseUri","",{type:"string",description:g(mL,6,"The uri of the baser of a merge editor")});new Y("mergeEditorResultUri","",{type:"string",description:g(mL,7,"The uri of the result of a merge editor")});const n8e="mergeEditorCloseWithConflicts";var Oke;const ka="vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel";let Bke=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=s}async createInputModel(e){const t=new Z,[i,s,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);t.add(i),t.add(s);const a=s.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:s.object.textEditorModel.getLanguageId(),onDidChange:T.None},a);t.add(c);const l=this._instantiationService.createInstance(Vse),d=this._instantiationService.createInstance(zse,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(Wke,d,t,s.object,e.result)}};Bke=D([_(1,be),_(2,Rn),_(3,Ai)],Bke);let Wke=class extends pL{constructor(e,t,i,s,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=s,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=xi(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Wn(c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Dt(this,c=>this.altVersionId.read(c)!==this.savedAltVersionId.read(c)),this.finished=!1}dispose(){this.disposable.dispose(),super.dispose()}async accept(){const e=await this.model.resultTextModel.getValue();this.result.textEditorModel.setValue(e),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),await this.textFileService.save(this.result.textEditorModel.uri),this.finished=!0}async _discard(){await this.textFileService.revert(this.model.resultTextModel.uri),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),this.finished=!0}shouldConfirmClose(){return!0}async confirmClose(e){fw(()=>e.some(s=>s===this));const t=e.some(s=>s.isDirty.get());let i;if(t){const s=e.length>1,o=s?g(ka,0,"Do you want keep the merge result of {0} files?",e.length):g(ka,1,"Do you want keep the merge result of {0}?",ui(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(ka,2,"&&Save With Conflicts"):g(ka,3,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,4,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}];i=(await this.dialogService.prompt({type:nt.Info,message:o,detail:r?s?g(ka,5,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(ka,6,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):s?g(ka,7,"The merge results will be lost if you don't save them."):g(ka,8,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>Ku.CANCEL}})).result}else i=Ku.DONT_SAVE;return i===Ku.SAVE?await Promise.all(e.map(s=>s.accept())):i===Ku.DONT_SAVE&&await Promise.all(e.map(s=>s._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(ka,9,"Do you want to accept the merge result?"),detail:g(ka,10,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(ka,11,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(s=>s.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};Wke=D([_(4,tr),_(5,To),_(6,_i)],Wke);var BP;let Hke=(BP=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=s}async createInputModel(e){const t=new Z;let i;const s=t.add(new Z),o=m=>{_n(e.result,m.resource)&&(s.clear(),i=m)};s.add(this.textFileService.files.onDidCreate(o)),this.textFileService.files.models.forEach(o);const[r,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new cn;await i.save({source:Oke.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(bjt.start)),f=this._instantiationService.createInstance(Vse),p=this._instantiationService.createInstance(zse,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(Uke,p,t,i,this._mergeEditorTelemetry)}},Oke=BP,BP.FILE_SAVED_SOURCE=ote.registerSource("merge-editor.source",g(ka,12,"Before Resolving Conflicts In Merge Editor")),BP);Hke=Oke=D([_(1,be),_(2,Rn),_(3,tr)],Hke);let Uke=class extends pL{constructor(e,t,i,s,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=s,this._dialogService=o,this._storageService=r,this.isDirty=Wn(T.any(this.resultTextFileModel.onDidChangeDirty,this.resultTextFileModel.onDidSaveError),()=>this.resultTextFileModel.isDirty()),this.reported=!1,this.dateTimeOpened=new Date}dispose(){this.disposableStore.dispose(),super.dispose(),this.reportClose(!1)}reportClose(e){if(!this.reported){const t=this.model.unhandledConflictsCount.get(),i=new Date().getTime()-this.dateTimeOpened.getTime();this.telemetry.reportMergeEditorClosed({durationOpenedSecs:i/1e3,remainingConflictCount:t,accepted:e,conflictCount:this.model.conflictCount,combinableConflictCount:this.model.combinableConflictCount,conflictsResolvedWithBase:this.model.conflictsResolvedWithBase,conflictsResolvedWithInput1:this.model.conflictsResolvedWithInput1,conflictsResolvedWithInput2:this.model.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:this.model.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:this.model.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:this.model.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:this.model.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:this.model.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart}),this.reported=!0}}async accept(){this.reportClose(!0),await this.resultTextFileModel.save()}get resultUri(){return this.resultTextFileModel.resource}async save(e){await this.resultTextFileModel.save(e)}async revert(e){await this.resultTextFileModel.revert(e)}shouldConfirmClose(){return!0}async confirmClose(e){const t=e.length>1,i=e.some(o=>o.isDirty.get()),s=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(ka,13,"Do you want to save the changes you made to {0} files?",e.length):g(ka,14,"Do you want to save the changes you made to {0}?",ui(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:nt.Info,message:o,detail:s?t?g(ka,15,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(ka,16,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):t?g(ka,17,"Your changes will be lost if you don't save them."):g(ka,18,"Your changes will be lost if you don't save them."),buttons:[{label:s?g(ka,19,"&&Save with Conflicts"):g(ka,20,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,21,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}],cancelButton:{run:()=>Ku.CANCEL}});return r}else if(s&&!this._storageService.getBoolean(n8e,ke.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(ka,22,"Do you want to close {0} merge editors?",e.length):g(ka,23,"Do you want to close the merge editor for {0}?",ui(e[0].resultUri)),detail:s?t?g(ka,24,"The files contain unhandled conflicts."):g(ka,25,"The file contains unhandled conflicts."):void 0,primaryButton:s?g(ka,26,"&&Close with Conflicts"):g(ka,27,"&&Close"),checkbox:{label:g(ka,28,"Do not ask me again")}});return r&&this._storageService.store(n8e,!0,ke.PROFILE,ln.USER),o?Ku.SAVE:Ku.CANCEL}else return Ku.SAVE}};Uke=D([_(4,To),_(5,on)],Uke);async function $se(n,e,t){const i=await e.createModelReference(n.uri);return t.add(i),{textModel:i.object.textEditorModel,title:n.title,description:n.description,detail:n.detail}}let Vke=class{constructor(e){this.telemetryService=e}reportMergeEditorOpened(e){this.telemetryService.publicLog2("mergeEditor.opened",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportLayoutChange(e){this.telemetryService.publicLog2("mergeEditor.layoutChanged",{baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportMergeEditorClosed(e){this.telemetryService.publicLog2("mergeEditor.closed",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,durationOpenedSecs:e.durationOpenedSecs,remainingConflictCount:e.remainingConflictCount,accepted:e.accepted,conflictsResolvedWithBase:e.conflictsResolvedWithBase,conflictsResolvedWithInput1:e.conflictsResolvedWithInput1,conflictsResolvedWithInput2:e.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:e.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:e.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:e.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:e.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:e.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart})}reportAcceptInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.accept",{otherAccepted:t,isInput1:e===1})}reportSmartCombinationInvoked(e){this.telemetryService.publicLog2("mergeEditor.action.smartCombination",{otherAccepted:e})}reportRemoveInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.remove",{otherAccepted:t,isInput1:e===1})}reportResetToBaseInvoked(){this.telemetryService.publicLog2("mergeEditor.action.resetToBase",{})}reportNavigationToNextConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToNextConflict",{})}reportNavigationToPreviousConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToPreviousConflict",{})}reportConflictCounterClicked(){this.telemetryService.publicLog2("mergeEditor.action.conflictCounterClicked",{})}};Vke=D([_(0,rn)],Vke);var $3;const Rjt="vs/workbench/contrib/mergeEditor/browser/mergeEditorInput";var WP;let zke=(WP=class extends Ib{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(s,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=s,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{fw(()=>p.every(v=>v.editor instanceof $3));const m=p.map(v=>v.editor._inputModel).filter(yl);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?Bke:Hke,this._instaService.createInstance(Vke))}dispose(){super.dispose()}get typeId(){return $3.ID}get editorId(){return A_.id}get capabilities(){let e=super.capabilities|Mi.MultipleEditors;return this.useWorkingCopy&&(e|=Mi.Untitled),e}getName(){return g(Rjt,0,"Merging: {0}",super.getName())}async resolve(){if(!this._inputModel){const e=this._register(await this.mergeEditorModeFactory.createInputModel({base:this.base,input1:this.input1,input2:this.input2,result:this.result}));this._inputModel=e,this._register(Ni(t=>{e.isDirty.read(t),this._onDidChangeDirty.fire()})),await this._inputModel.model.onInitialized}return this._inputModel}async accept(){await this._inputModel?.accept()}async save(e,t){await this._inputModel?.save(t)}toUntyped(){return{input1:{resource:this.input1.uri,label:this.input1.title,description:this.input1.description,detail:this.input1.detail},input2:{resource:this.input2.uri,label:this.input2.title,description:this.input2.description,detail:this.input2.detail},base:{resource:this.base},result:{resource:this.result},options:{override:this.typeId}}}matches(e){return this===e?!0:e instanceof $3?_n(this.base,e.base)&&_n(this.input1.uri,e.input1.uri)&&_n(this.input2.uri,e.input2.uri)&&_n(this.result,e.result):Wb(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&_n(this.base,e.base.resource)&&_n(this.input1.uri,e.input1.resource)&&_n(this.input2.uri,e.input2.resource)&&_n(this.result,e.result.resource):!1}async revert(e,t){return this._inputModel?.revert(t)}isDirty(){return this._inputModel?.isDirty.get()??!1}setLanguageId(e,t){this._inputModel?.model.setLanguageId(e,t)}},$3=WP,WP.ID="mergeEditor.Input",WP);zke=$3=D([_(4,be),_(5,_i),_(6,tr),_(7,eo),_(8,ci),_(9,Re),_(10,hh),_(11,dl),_(12,aD)],zke);class Mjt{constructor(e){this._value=e,this.onHasValueDidChange=T.None}request(){return Promise.resolve(this._value)}get value(){return this._value}}const Njt="vs/workbench/contrib/multiDiffEditor/browser/icons.contribution",Pjt=Ki("multi-diff-editor-label-icon",Ce.diffMultiple,g(Njt,0,"Icon of the multi diff editor label."));class s8e{constructor(e,t){if(this.original=e,this.modified=t,!e&&!t)throw new cn("Invalid arguments")}getKey(){return JSON.stringify([this.modified?.toString(),this.original?.toString()])}}const Fjt="vs/workbench/services/editor/common/editorResolverService",Ojt=it.as(Cs.Configuration),Bjt={...PQ,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(Fjt,0,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};Ojt.registerConfiguration(Bjt);var Gse;(function(n){n.builtin="builtin",n.option="option",n.exclusive="exclusive",n.default="default"})(Gse||(Gse={}));var w8;(function(n){n[n.ABORT=1]="ABORT",n[n.NONE=2]="NONE"})(w8||(w8={}));function Wjt(n,e){if(new Set([_e.extension,_e.webviewPanel,_e.vscodeWorkspaceTrust,_e.vscodeSettings]).has(e.scheme))return!1;const s=typeof n=="string"&&n.indexOf(Qi.sep)>=0?`${e.scheme}:${e.path}`:ui(e);return WW(typeof n=="string"?n.toLowerCase():n,s.toLowerCase())}var PB;const o8e="vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput";var HP;let sH=(HP=class extends cC{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new cn("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??P.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(PB,i,e.label,e.resources?.map(s=>new s8e(s.original.resource,s.modified.resource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(PB,P.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new s8e(i.originalUri?P.parse(i.originalUri):void 0,i.modifiedUri?P.parse(i.modifiedUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Mi.Readonly}get typeId(){return PB.ID}getName(){return this._name}get editorId(){return A_.id}getIcon(){return Pjt}constructor(e,t,i,s=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=s,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new tut(async()=>{const d=await this._createModel();this._register(d);const h=new dZe(d,this._instantiationService);return this._register(h),await JQe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new N1t(async()=>{const d=this.initialResources?{resources:gQe.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?VJe(this,d.resources):Au([])}}),this.resources=Dt(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=yee(this,this.resources.map(d=>d??[]),d=>{const h=d.modified?r8e(this._textFileService,d.modified):Au(!1),u=d.original?r8e(this._textFileService,d.original):Au(!1);return Dt(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Dt(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=T.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return Ku.DONT_SAVE},showConfirm(){return!1}},this._register(Ni(d=>{const h=this.resources.read(d),u=this.label??g(o8e,0,"Multi Diff Editor");h?this._name=u+g(o8e,1," ({0} files)",h.length):this._name=u,this._onDidChangeLabel.fire()}))}serialize(){return{label:this.label,multiDiffSourceUri:this.multiDiffSource.toString(),resources:this.initialResources?.map(e=>({originalUri:e.original?.toString(),modifiedUri:e.modified?.toString()}))}}setLanguageId(e,t){const s=this._viewModel.requireValue().activeDiffItem.get()?.entry?.value;if(!s)return;const o=s.modified??s.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=new Z,s=yee(this,e.resources,async(l,d)=>{let h,u;const f=new Z;d.add(Ee(()=>{i.add(f)}));try{[h,u]=await Promise.all([l.original?this._textModelService.createModelReference(l.original):void 0,l.modified?this._textModelService.createModelReference(l.modified):void 0]),h&&f.add(h),u&&f.add(u)}catch(m){console.error(m),bt(m);return}const p=l.modified??l.original;return new Mjt({original:h?.object.textEditorModel,modified:u?.object.textEditorModel,get options(){return{...Hjt(u?.object.isReadonly()??!0),...Ujt(t.getValue(p))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(p,"editor")||v.affectsConfiguration(p,"diffEditor"))&&m()})})},l=>JSON.stringify([l.modified?.toString(),l.original?.toString()])),o=xi("documents",[]),r=Dt(async l=>{const d=s.read(l),u=(await Promise.all(d)).filter(yl);o.set(u,void 0),i.clear()}),a=Ez(r);return await r.get(),{dispose:()=>{a.dispose(),i.dispose()},documents:new TNe(o),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof PB?this.multiDiffSource.toString()===e.multiDiffSource.toString():!1}isDirty(){return this._isDirtyObservable.get()}async save(e,t){return await this.doSaveOrRevert("save",e,t),this}revert(e,t){return this.doSaveOrRevert("revert",e,t)}async doSaveOrRevert(e,t,i){const s=this._viewModel.currentValue?.items.get();s&&await Promise.all(s.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==_e.untitled&&this._textFileService.isDirty(r.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(r.original.uri,i):this._textFileService.revert(r.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(r.modified.uri,i):this._textFileService.revert(r.modified.uri,i)])}))}},PB=HP,HP.ID="workbench.input.multiDiffEditor",HP);sH=PB=D([_(4,Rn),_(5,dl),_(6,be),_(7,GZe),_(8,tr)],sH);function r8e(n,e){return Wn(T.filter(n.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>n.isDirty(e))}function Hjt(n){return{readOnly:!!n,readOnlyMessage:typeof n!="boolean"?n:void 0}}function Ujt(n){const e=Vs(n.editor);if(fo(n.diffEditor)){const t=Vs(n.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var qH;let a8e=(qH=class extends ${constructor(e,t){super(),this._register(e.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createMultiDiffEditorInput:i=>({editor:sH.fromResourceMultiDiffEditorInput(i,t)})}))}},qH.ID="workbench.contrib.multiDiffEditorResolver",qH);a8e=D([_(0,Pz),_(1,be)],a8e);var c8e;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.Up=2]="Up",n[n.Down=3]="Down"})(c8e||(c8e={}));var l8e;(function(n){n[n.Connecting=0]="Connecting",n[n.Connected=1]="Connected"})(l8e||(l8e={}));const d8e="terminalEditor";var h8e;(function(n){n[n.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(h8e||(h8e={}));var u8e;(function(n){n[n.Unknown=1]="Unknown",n[n.Fedora=2]="Fedora",n[n.Ubuntu=3]="Ubuntu"})(u8e||(u8e={}));var g8e;(function(n){n.Terminals="Terminals"})(g8e||(g8e={}));const uh="vs/workbench/contrib/terminal/common/terminalColorRegistry";B("terminal.background",null,g(uh,0,"The background color of the terminal, this allows coloring the terminal differently to the panel."));B("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(uh,1,"The foreground color of the terminal."));B("terminalCursor.foreground",null,g(uh,2,"The foreground color of the terminal cursor."));B("terminalCursor.background",null,g(uh,3,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const nY=B("terminal.selectionBackground",{light:Hv,dark:Hv,hcDark:Hv,hcLight:Hv},g(uh,4,"The selection background color of the terminal."));B("terminal.inactiveSelectionBackground",{light:Ie(nY,.5),dark:Ie(nY,.5),hcDark:Ie(nY,.7),hcLight:Ie(nY,.5)},g(uh,5,"The selection background color of the terminal when it does not have focus."));B("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(uh,6,"The selection foreground color of the terminal. When this is null the selection foreground will be retained and have the minimum contrast ratio feature applied."));B("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(uh,7,"The default terminal command decoration background color."));B("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(uh,8,"The terminal command decoration background color for successful commands."));B("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(uh,9,"The terminal command decoration background color for error commands."));B("terminalOverviewRuler.cursorForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(uh,10,"The overview ruler cursor color."));B("terminal.border",{dark:TE,light:TE,hcDark:TE,hcLight:TE},g(uh,11,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));B("terminal.findMatchBackground",{dark:lWe,light:lWe,hcDark:null,hcLight:"#0F4A85"},g(uh,12,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.hoverHighlightBackground",{dark:Ie(Vk,.5),light:Ie(Vk,.5),hcDark:Ie(Vk,.5),hcLight:Ie(Vk,.5)},g(uh,13,"Border color of the other search matches in the terminal."));B("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,14,"Border color of the current search match in the terminal."));B("terminal.findMatchHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(uh,15,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,13,"Border color of the other search matches in the terminal."));B("terminalOverviewRuler.findMatchForeground",{dark:m$,light:m$,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,16,"Overview ruler marker color for find matches in the terminal."));B("terminal.dropBackground",{dark:qv,light:qv,hcDark:qv,hcLight:qv},g(uh,17,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);B("terminal.tab.activeBorder",{dark:a2,light:a2,hcDark:a2,hcLight:a2},g(uh,18,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));function Vjt(n){let e;if(typeof n=="string"?e=n:n.color?e=n.color.replace(/\./g,"_"):$e.isThemeIcon(n.icon)&&n.icon.color&&(e=n.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function zjt(n,e,t){const i=n.icon;if(!i)return;const s=[];let o;if(i instanceof P?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===sf.LIGHT?i.light:i.dark),o instanceof P){const a=`terminal-uri-icon-${Ed(o.path).toString(36)}`;s.push(a),s.push("terminal-uri-icon")}return s}var $ke;(function(n){n.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",n.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",n.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",n.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",n.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})($ke||($ke={}));const $jt=[$ke.FocusAccessibleBuffer];var qC;(function(n){n.FindFocus="workbench.action.terminal.focusFind",n.FindHide="workbench.action.terminal.hideFind",n.FindNext="workbench.action.terminal.findNext",n.FindPrevious="workbench.action.terminal.findPrevious",n.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",n.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",n.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",n.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(qC||(qC={}));const Gjt=[qC.FindFocus,qC.FindHide,qC.FindNext,qC.FindPrevious,qC.ToggleFindRegex,qC.ToggleFindWholeWord,qC.ToggleFindCaseSensitive,qC.SearchWorkspace];var nk;(function(n){n.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",n.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",n.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",n.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",n.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",n.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget"})(nk||(nk={}));const qjt=[nk.SelectPrevSuggestion,nk.SelectPrevPageSuggestion,nk.SelectNextSuggestion,nk.SelectNextPageSuggestion,nk.AcceptSelectedSuggestion,nk.HideSuggestWidget],ML="vs/workbench/contrib/terminal/common/terminal",Qjt="terminal";var f8e;(function(n){n[n.Uninitialized=1]="Uninitialized",n[n.Launching=2]="Launching",n[n.Running=3]="Running",n[n.KilledDuringLaunch=4]="KilledDuringLaunch",n[n.KilledByUser=5]="KilledByUser",n[n.KilledByProcess=6]="KilledByProcess"})(f8e||(f8e={}));var wn;(function(n){n.Toggle="workbench.action.terminal.toggleTerminal",n.Kill="workbench.action.terminal.kill",n.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",n.KillEditor="workbench.action.terminal.killEditor",n.KillActiveTab="workbench.action.terminal.killActiveTab",n.KillAll="workbench.action.terminal.killAll",n.QuickKill="workbench.action.terminal.quickKill",n.ConfigureTerminalSettings="workbench.action.terminal.openSettings",n.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",n.RunRecentCommand="workbench.action.terminal.runRecentCommand",n.CopyLastCommand="workbench.action.terminal.copyLastCommand",n.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",n.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",n.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",n.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",n.CopySelection="workbench.action.terminal.copySelection",n.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",n.SelectAll="workbench.action.terminal.selectAll",n.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",n.DeleteWordRight="workbench.action.terminal.deleteWordRight",n.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",n.MoveToLineStart="workbench.action.terminal.moveToLineStart",n.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",n.New="workbench.action.terminal.new",n.NewWithCwd="workbench.action.terminal.newWithCwd",n.NewLocal="workbench.action.terminal.newLocal",n.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",n.NewWithProfile="workbench.action.terminal.newWithProfile",n.Split="workbench.action.terminal.split",n.SplitActiveTab="workbench.action.terminal.splitActiveTab",n.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",n.Unsplit="workbench.action.terminal.unsplit",n.JoinActiveTab="workbench.action.terminal.joinActiveTab",n.Join="workbench.action.terminal.join",n.Relaunch="workbench.action.terminal.relaunch",n.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",n.CreateTerminalEditor="workbench.action.createTerminalEditor",n.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",n.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",n.FocusTabs="workbench.action.terminal.focusTabs",n.FocusNextPane="workbench.action.terminal.focusNextPane",n.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",n.ResizePaneRight="workbench.action.terminal.resizePaneRight",n.ResizePaneUp="workbench.action.terminal.resizePaneUp",n.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",n.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",n.ResizePaneDown="workbench.action.terminal.resizePaneDown",n.Focus="workbench.action.terminal.focus",n.FocusNext="workbench.action.terminal.focusNext",n.FocusPrevious="workbench.action.terminal.focusPrevious",n.Paste="workbench.action.terminal.paste",n.PasteSelection="workbench.action.terminal.pasteSelection",n.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",n.RunSelectedText="workbench.action.terminal.runSelectedText",n.RunActiveFile="workbench.action.terminal.runActiveFile",n.SwitchTerminal="workbench.action.terminal.switchTerminal",n.ScrollDownLine="workbench.action.terminal.scrollDown",n.ScrollDownPage="workbench.action.terminal.scrollDownPage",n.ScrollToBottom="workbench.action.terminal.scrollToBottom",n.ScrollUpLine="workbench.action.terminal.scrollUp",n.ScrollUpPage="workbench.action.terminal.scrollUpPage",n.ScrollToTop="workbench.action.terminal.scrollToTop",n.Clear="workbench.action.terminal.clear",n.ClearSelection="workbench.action.terminal.clearSelection",n.ChangeIcon="workbench.action.terminal.changeIcon",n.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",n.ChangeColor="workbench.action.terminal.changeColor",n.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",n.Rename="workbench.action.terminal.rename",n.RenameActiveTab="workbench.action.terminal.renameActiveTab",n.RenameWithArgs="workbench.action.terminal.renameWithArg",n.QuickOpenTerm="workbench.action.quickOpenTerm",n.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",n.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",n.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",n.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",n.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",n.SelectToNextLine="workbench.action.terminal.selectToNextLine",n.SendSequence="workbench.action.terminal.sendSequence",n.AttachToSession="workbench.action.terminal.attachToSession",n.DetachSession="workbench.action.terminal.detachSession",n.MoveToEditor="workbench.action.terminal.moveToEditor",n.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",n.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",n.SetDimensions="workbench.action.terminal.setDimensions",n.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",n.FocusHover="workbench.action.terminal.focusHover",n.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",n.StartVoice="workbench.action.terminal.startVoice",n.StopVoice="workbench.action.terminal.stopVoice"})(wn||(wn={}));[wn.ClearSelection,wn.Clear,wn.CopyAndClearSelection,wn.CopySelection,wn.CopySelectionAsHtml,wn.CopyLastCommand,wn.CopyLastCommandOutput,wn.CopyLastCommandAndLastCommandOutput,wn.DeleteToLineStart,wn.DeleteWordLeft,wn.DeleteWordRight,wn.GoToRecentDirectory,wn.FocusNextPane,wn.FocusNext,wn.FocusPreviousPane,wn.FocusPrevious,wn.Focus,wn.SizeToContentWidth,wn.Kill,wn.KillEditor,wn.MoveToEditor,wn.MoveToLineEnd,wn.MoveToLineStart,wn.MoveToTerminalPanel,wn.NewInActiveWorkspace,wn.New,wn.Paste,wn.PasteSelection,wn.ResizePaneDown,wn.ResizePaneLeft,wn.ResizePaneRight,wn.ResizePaneUp,wn.RunActiveFile,wn.RunSelectedText,wn.RunRecentCommand,wn.ScrollDownLine,wn.ScrollDownPage,wn.ScrollToBottom,wn.ScrollToNextCommand,wn.ScrollToPreviousCommand,wn.ScrollToTop,wn.ScrollUpLine,wn.ScrollUpPage,wn.SendSequence,wn.SelectAll,wn.SelectToNextCommand,wn.SelectToNextLine,wn.SelectToPreviousCommand,wn.SelectToPreviousLine,wn.SplitInActiveWorkspace,wn.Split,wn.Toggle,wn.FocusHover,Ru.OpenAccessibilityHelp,...$jt,...Gjt,...qjt];g(ML,0,"Contributes terminal functionality."),g(ML,1,"Defines additional terminal profiles that the user can create."),g(ML,2,"The ID of the terminal profile provider."),g(ML,3,"Title for this terminal profile."),g(ML,4,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(ML,5,"Icon path when a light theme is used"),g(ML,6,"Icon path when a dark theme is used");const xg="vs/workbench/contrib/terminal/common/terminalContextKey";var Lr;(function(n){n.IsOpen="terminalIsOpen",n.Count="terminalCount",n.GroupCount="terminalGroupCount",n.TabsNarrow="isTerminalTabsNarrow",n.HasFixedWidth="terminalHasFixedWidth",n.ProcessSupported="terminalProcessSupported",n.Focus="terminalFocus",n.FocusInAny="terminalFocusInAny",n.AccessibleBufferFocus="terminalAccessibleBufferFocus",n.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",n.EditorFocus="terminalEditorFocus",n.TabsFocus="terminalTabsFocus",n.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",n.TerminalHasBeenCreated="terminalHasBeenCreated",n.TerminalEditorActive="terminalEditorActive",n.TabsMouse="terminalTabsMouse",n.AltBufferActive="terminalAltBufferActive",n.SuggestWidgetVisible="terminalSuggestWidgetVisible",n.A11yTreeFocus="terminalA11yTreeFocus",n.ViewShowing="terminalViewShowing",n.TextSelected="terminalTextSelected",n.TextSelectedInFocused="terminalTextSelectedInFocused",n.FindVisible="terminalFindVisible",n.FindInputFocused="terminalFindInputFocused",n.FindFocused="terminalFindFocused",n.TabsSingularSelection="terminalTabsSingularSelection",n.SplitTerminal="terminalSplitTerminal",n.ShellType="terminalShellType",n.InTerminalRunCommandPicker="inTerminalRunCommandPicker",n.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(Lr||(Lr={}));var Gke;(function(n){n.isOpen=new Y(Lr.IsOpen,!1,!0),n.focus=new Y(Lr.Focus,!1,g(xg,0,"Whether the terminal is focused.")),n.focusInAny=new Y(Lr.FocusInAny,!1,g(xg,1,"Whether any terminal is focused, including detached terminals used in other UI.")),n.editorFocus=new Y(Lr.EditorFocus,!1,g(xg,2,"Whether a terminal in the editor area is focused.")),n.count=new Y(Lr.Count,0,g(xg,3,"The current number of terminals.")),n.groupCount=new Y(Lr.GroupCount,0,!0),n.tabsNarrow=new Y(Lr.TabsNarrow,!1,!0),n.terminalHasFixedWidth=new Y(Lr.HasFixedWidth,!1,!0),n.tabsFocus=new Y(Lr.TabsFocus,!1,g(xg,4,"Whether the terminal tabs widget is focused.")),n.webExtensionContributedProfile=new Y(Lr.WebExtensionContributedProfile,!1,!0),n.terminalHasBeenCreated=new Y(Lr.TerminalHasBeenCreated,!1,!0),n.terminalEditorActive=new Y(Lr.TerminalEditorActive,!1,!0),n.tabsMouse=new Y(Lr.TabsMouse,!1,!0),n.shellType=new Y(Lr.ShellType,void 0,{type:"string",description:g(xg,5,"The shell type of the active terminal, this is set to the last known value when no terminals exist.")}),n.altBufferActive=new Y(Lr.AltBufferActive,!1,g(xg,6,"Whether the terminal's alt buffer is active.")),n.suggestWidgetVisible=new Y(Lr.SuggestWidgetVisible,!1,g(xg,7,"Whether the terminal's suggest widget is visible.")),n.notFocus=n.focus.toNegated(),n.viewShowing=new Y(Lr.ViewShowing,!1,g(xg,8,"Whether the terminal view is showing")),n.textSelected=new Y(Lr.TextSelected,!1,g(xg,9,"Whether text is selected in the active terminal.")),n.textSelectedInFocused=new Y(Lr.TextSelectedInFocused,!1,g(xg,10,"Whether text is selected in a focused terminal.")),n.notTextSelected=n.textSelected.toNegated(),n.findVisible=new Y(Lr.FindVisible,!1,!0),n.notFindVisible=n.findVisible.toNegated(),n.findInputFocus=new Y(Lr.FindInputFocused,!1,!0),n.findFocus=new Y(Lr.FindFocused,!1,!0),n.notFindFocus=n.findInputFocus.toNegated(),n.processSupported=new Y(Lr.ProcessSupported,!1,g(xg,11,"Whether terminal processes can be launched in the current workspace.")),n.tabsSingularSelection=new Y(Lr.TabsSingularSelection,!1,g(xg,12,"Whether one terminal is selected in the terminal tabs list.")),n.splitTerminal=new Y(Lr.SplitTerminal,!1,g(xg,13,"Whether the focused tab's terminal is a split terminal.")),n.inTerminalRunCommandPicker=new Y(Lr.InTerminalRunCommandPicker,!1,g(xg,14,"Whether the terminal run command picker is currently open.")),n.terminalShellIntegrationEnabled=new Y(Lr.TerminalShellIntegrationEnabled,!1,g(xg,15,"Whether shell integration is enabled in the active terminal")),n.shouldShowViewInlineActions=ge.and(ge.equals("view",Qjt),ge.notEquals(`config.${_y.TabsHideCondition}`,"never"),ge.or(ge.not(`config.${_y.TabsEnabled}`),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminal"),ge.equals(Lr.GroupCount,1)),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminalOrNarrow"),ge.or(ge.equals(Lr.GroupCount,1),ge.has(Lr.TabsNarrow))),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleGroup"),ge.equals(Lr.GroupCount,1)),ge.equals(`config.${_y.TabsShowActions}`,"always")))})(Gke||(Gke={}));var TX;const sY="vs/workbench/contrib/terminal/browser/terminalEditorInput";var UP;let qke=(UP=class extends cC{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return TX.ID}get editorId(){return d8e}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor|Mi.ForceDescription}setTerminalInstance(e){if(this._terminalInstance)throw new Error("cannot set instance that has already been set");this._terminalInstance=e,this._setupInstanceListeners()}copy(){const e=this._terminalInstanceService.createInstance(this._copyLaunchConfig||{},fV.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(TX,e.resource,e)}setCopyLaunchConfig(e){this._copyLaunchConfig=e}get terminalInstance(){return this._isDetached?void 0:this._terminalInstance}showConfirm(){if(this._isReverted)return!1;const e=this._configurationService.getValue(_y.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:nt.Warning,message:g(sY,0,"Do you want to terminate running processes?"),primaryButton:g(sY,1,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` +`,e}}class Tue{static compute(e,t){if(!e)return new gEe([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=Sre(e.documents,t.documents),n=Qge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new gEe(i.removed,i.added,n.removed,n.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var i1;(function(s){s[s.Editor=0]="Editor",s[s.Panel=1]="Panel"})(i1||(i1={}));let fEe=class{constructor(e,t,i,n,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=n,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new mo,this._activeEditorOrder=i1.Editor,this._modelService.onModelAdded(this._updateStateOnModelAdd,this,this._toDispose),this._modelService.onModelRemoved(r=>this._updateState(),this,this._toDispose),this._editorService.onDidActiveEditorChange(r=>this._updateState(),this,this._toDispose),this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor,this,this._toDispose),this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor,this,this._toDispose),this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor,this),M.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=i1.Panel,void 0,this._toDispose),M.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=i1.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=i1.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),jr(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusEditorText(()=>this._updateState()),e.onDidFocusEditorWidget(()=>this._updateState(e)))),this._updateState()}_onDidRemoveEditor(e){const t=e.getId();this._toDisposeOnEditorRemove.has(t)&&(this._toDisposeOnEditorRemove.deleteAndDispose(t),this._updateState())}_updateStateOnModelAdd(e){if(Ly(e)){if(!this._currentState){this._updateState();return}this._currentState=new Tue(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new gEe([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())Ly(a)&&t.add(a);const i=new Map;let n=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&Ly(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new wqt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(n=l.id)}}if(!n){let a;if(this._activeEditorOrder===i1.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(n=c.id)}const o=new Tue(t,i,n),r=Tue.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(ir.Panel);if(e instanceof bqt){const t=e.getControl();if(Qr(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return im(e)&&(e=e.getModifiedEditor()),e}};fEe=D([_(1,gi),_(2,Kt),_(3,ei),_(4,Tm)],fEe);let Ize=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=n,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new dEe(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Be.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new uEe(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Be.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new fEe(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],n=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new vqt(a.id,a.editor.getModel(),a.editor,{onGainedFocus(){},onLostFocus(){}},this._mainThreadDocuments,this._modelService,this._clipboardService);this._textEditors.set(a.id,c),i.push(c)}for(const{id:a}of e.removedEditors){const c=this._textEditors.get(a);c&&(c.dispose(),this._textEditors.delete(a),t.push(a))}const o=Object.create(null);let r=!0;e.newActiveEditor!==void 0&&(r=!1,o.newActiveEditor=e.newActiveEditor),n.length>0&&(r=!1,o.removedDocuments=n),t.length>0&&(r=!1,o.removedEditors=t),e.addedDocuments.length>0&&(r=!1,o.addedDocuments=e.addedDocuments.map(a=>this._toModelAddData(a))),e.addedEditors.length>0&&(r=!1,o.addedEditors=i.map(a=>this._toTextEditorAddData(a))),r||(this._proxy.$acceptDocumentsAndEditorsDelta(o),n.forEach(this._mainThreadDocuments.handleModelRemoved,this._mainThreadDocuments),e.addedDocuments.forEach(this._mainThreadDocuments.handleModelAdded,this._mainThreadDocuments),t.forEach(this._mainThreadEditors.handleTextEditorRemoved,this._mainThreadEditors),i.forEach(this._mainThreadEditors.handleTextEditorAdded,this._mainThreadEditors))}_toModelAddData(e){return{uri:e.uri,versionId:e.getVersionId(),lines:e.getLinesContent(),EOL:e.getEOL(),languageId:e.getLanguageId(),isDirty:this._textFileService.isDirty(e.uri)}}_toTextEditorAddData(e){const t=e.getProperties();return{id:e.getId(),documentUri:e.getModel().uri,options:t.options,selections:t.selections,visibleRanges:t.visibleRanges,editorPosition:this._findEditorPosition(e)}}_findEditorPosition(e){for(const t of this._editorService.visibleEditorPanes)if(e.matches(t))return rI(this._editorGroupService,t.group)}findTextEditorIdFor(e){for(const[t,i]of this._textEditors)if(i.matches(e))return t}getIdOfCodeEditor(e){for(const[t,i]of this._textEditors)if(i.getCodeEditor()===e)return t}getEditor(e){return this._textEditors.get(e)}};Ize=D([QN,_(1,gi),_(2,Fo),_(3,ei),_(4,Kt),_(5,Jt),_(6,fn),_(7,Po),_(8,Tm),_(9,Jr),_(10,zb),_(11,ks),_(12,dg),_(13,bf),_(14,Te)],Ize);var k0;const Lue={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function yqt(s){const e=s;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function Cqt(s){const e=s;return e.kind===Do.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var $R;let Tze=($R=class extends V{get id(){return this._id}get active(){return this.selection[0]??null}constructor(e,t,i){super(),this.instantiationService=t,this.configurationService=i,this._onDidModelChange=this._register(new I({leakWarningThreshold:500})),this.onDidModelChange=this._onDidModelChange.event,this.editors=[],this.mru=[],this.editorListeners=new Set,this.locked=!1,this.selection=[],this.preview=null,this.sticky=-1,this.transient=new Set,yqt(e)?this._id=this.deserialize(e):this._id=k0.IDS++,this.onConfigurationUpdated(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e&&!e.affectsConfiguration("workbench.editor.openPositioning")&&!e.affectsConfiguration("workbench.editor.focusRecentEditorAfterClose")||(this.editorOpenPositioning=this.configurationService.getValue("workbench.editor.openPositioning"),this.focusRecentEditorAfterClose=this.configurationService.getValue("workbench.editor.focusRecentEditorAfterClose"))}get count(){return this.editors.length}get stickyCount(){return this.sticky+1}getEditors(e,t){const i=e===Zh.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===Zh.MOST_RECENTLY_ACTIVE?i.filter(n=>!this.isSticky(n)):i.slice(this.sticky+1):i}getEditorByIndex(e){return this.editors[e]}get activeEditor(){return this.active}isActive(e){return this.matches(this.active,e)}get previewEditor(){return this.preview}openEditor(e,t){const i=t?.sticky||typeof t?.index=="number"&&this.isSticky(t.index),n=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!n&&this.preview===this.activeEditor,a=this.findEditor(e,t);if(a){const[c,l]=a;return this.doSetTransient(c,l,o===!1?!1:this.isTransient(c)),n&&this.doPin(c,l),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),t&&typeof t.index=="number"&&this.moveEditor(c,t.index),i&&this.doStick(c,this.indexOf(c)),{editor:c,isNew:!1}}else{const c=e,l=this.indexOf(this.active);let d;if(t&&typeof t.index=="number"?d=t.index:this.editorOpenPositioning===Lue.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===Lue.LAST?d=this.editors.length:(this.editorOpenPositioning===Lue.LEFT?l===0||!this.editors.length?d=0:d=l:d=l+1,!i&&this.isSticky(d)&&(d=this.sticky+1)),i&&(this.sticky++,this.isSticky(d)||(d=this.sticky)),(n||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!n){if(this.preview){const u=this.indexOf(this.preview);d>u&&d--,this.replaceEditor(this.preview,c,d,!r)}this.preview=c}this.registerEditorListeners(c);const h={kind:Do.EDITOR_OPEN,editor:c,editorIndex:d};return this._onDidModelChange.fire(h),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),{editor:c,isNew:!0}}}registerEditorListeners(e){const t=new Z;this.editorListeners.add(t),t.add(M.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const n={kind:Do.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:Do.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:Do.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:Do.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===Do.EDITOR_CLOSE&&i.editor?.matches(e)&&(bt(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,n=!0){const o=this.doCloseEditor(e,cA.REPLACE,n);if(this.splice(i,!1,t),o){const r={kind:Do.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=cA.UNKNOWN,i=!0){const n=this.doCloseEditor(e,t,i);if(n){const o={kind:Do.EDITOR_CLOSE,...n};return this._onDidModelChange.fire(o),n}}doCloseEditor(e,t,i){const n=this.indexOf(e);if(n===-1)return;const o=this.editors[n],r=this.isSticky(n),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:n===this.editors.length-1?c=this.editors[n-1]:c=this.editors[n+1];const l=this.selection.filter(d=>d!==o&&d!==c);this.doSetSelection(c,this.editors.indexOf(c),l)}else this.doSetSelection(null,void 0,[]);else if(!a&&this.doIsSelected(o)){const c=this.selection.filter(l=>l!==o&&l!==this.activeEditor);this.doSetSelection(this.activeEditor,this.indexOf(this.activeEditor),c)}return this.preview===o&&(this.preview=null),this.transient.delete(o),this.splice(n,!0),{editor:o,sticky:r,editorIndex:n,context:t}}moveEditor(e,t){t>=this.editors.length?t=this.editors.length-1:t<0&&(t=0);const i=this.indexOf(e);if(i<0||t===i)return;const n=this.editors[i],o=this.sticky;this.isSticky(i)&&t>this.sticky?this.sticky--:!this.isSticky(i)&&t<=this.sticky&&this.sticky++,this.editors.splice(i,1),this.editors.splice(t,0,n);const r={kind:Do.EDITOR_MOVE,editor:n,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:Do.EDITOR_STICKY,editor:n,editorIndex:t};this._onDidModelChange.fire(a)}return n}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:Do.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doSetSelection(i,n,[]),i}get selectedEditors(){return this.editors.filter(e=>this.doIsSelected(e))}isSelected(e){let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.doIsSelected(t)}doIsSelected(e){return this.selection.includes(e)}setSelection(e,t){const i=this.findEditor(e);if(!i)return;const[n,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==n&&r.add(l)}this.doSetSelection(n,o,Array.from(r))}doSetSelection(e,t,i){const n=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&n!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:Do.EDITOR_ACTIVE,editor:e,editorIndex:t};this._onDidModelChange.fire(l)}if(a||o.length!==r.length||o.some(c=>!r.includes(c))){const c={kind:Do.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:Do.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:Do.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doPin(i,n),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnpin(i,n),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const n={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(n),i&&this.closeEditor(i,cA.UNPIN)}isPinned(e){let t;return typeof e=="number"?t=this.editors[e]:t=e,!this.matches(this.preview,t)}stick(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doStick(i,n),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnstick(i,n),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}isSticky(e){if(this.sticky<0)return!1;let t;return typeof e=="number"?t=e:t=this.indexOf(e),t<0?!1:t<=this.sticky}setTransient(e,t){if(!t&&this.transient.size===0)return;const i=this.findEditor(e);if(!i)return;const[n,o]=i;return this.doSetTransient(n,o,t),n}doSetTransient(e,t,i){if(i){if(this.transient.has(e))return;this.transient.add(e)}else{if(!this.transient.has(e))return;this.transient.delete(e)}const n={kind:Do.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(n)}isTransient(e){if(this.transient.size===0)return!1;let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.transient.has(t)}splice(e,t,i){const n=this.editors[e];if(t&&this.isSticky(e)&&this.sticky--,i?this.editors.splice(e,t?1:0,i):this.editors.splice(e,t?1:0),!t&&i)this.mru.length===0?this.mru.push(i):this.mru.splice(1,0,i);else{const o=this.indexOf(n,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let n=-1;if(!e)return n;for(let o=0;othis.indexOf(a,t)).filter(a=>a>=0);return{id:this.id,locked:this.locked?!0:void 0,editors:i,mru:r,preview:n,sticky:o>=0?o:void 0}}deserialize(e){const t=Qe.as(tC.EditorFactory);return typeof e.id=="number"?(this._id=e.id,k0.IDS=Math.max(e.id+1,k0.IDS)):this._id=k0.IDS++,e.locked&&(this.locked=!0),this.editors=Fi(e.editors.map((i,n)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof Ob&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&n<=e.sticky&&e.sticky--,o})),this.mru=Fi(e.mru.map(i=>this.editors[i])),this.selection=this.mru.length>0?[this.mru[0]]:[],typeof e.preview=="number"&&(this.preview=this.editors[e.preview]),typeof e.sticky=="number"&&(this.sticky=e.sticky),this._id}dispose(){bt(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},k0=$R,$R.IDS=0,$R);Tze=k0=D([_(1,we),_(2,Te)],Tze);class Sqt extends V{constructor(e,t){super(),this._register(ue(e,ke.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(ue(e,ke.DRAG_END,i)),this._register(ue(e,ke.MOUSE_MOVE,n=>{n.buttons===0&&i()}))}}const Goe=class Goe extends Ob{get typeId(){return Goe.typeId}get editorId(){return this.viewType}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor}get resource(){return N.from({scheme:pe.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=ar(),this._hasTransfered=!1,this.viewType=e.viewType,this.providedId=e.providedId,this._name=e.name,this._webview=t}dispose(){this.isDisposed()||this._hasTransfered||this._webview?.dispose(),super.dispose()}getName(){return this._name}getTitle(e){return this.getName()}getDescription(){}setName(e){this._name=e,this.webview.setTitle(e),this._onDidChangeLabel.fire()}get webview(){return this._webview}get extension(){return this.webview.extension}get iconPath(){return this._iconPath}set iconPath(e){this._iconPath=e,this._iconManager.setIcons(this._resourceId,e)}matches(e){return super.matches(e)||e===this}get group(){return this._group}updateGroup(e){this._group=e}transfer(e){if(!this._hasTransfered)return this._hasTransfered=!0,e._webview=this._webview,e}claim(e,t,i){return this._webview.claim(e,t,i)}};Goe.typeId="workbench.editors.webviewInput";let Ou=Goe;var pEe;const Aqt=new Q("activeWebviewPanelId","",{type:"string",description:g(9520,"The viewType of the currently active webview panel.")});var GR;let Lze=(GR=class extends IZ{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,n,o,r,a,c,l){super(pEe.ID,e,t,i,n),this._editorGroupsService=o,this._editorService=r,this._workbenchLayoutService=a,this._hostService=c,this._contextKeyService=l,this._visible=!1,this._isDisposed=!1,this._webviewVisibleDisposables=this._register(new Z),this._onFocusWindowHandler=this._register(new wn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new wn);const d=o.getPart(e);this._register(M.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Ou?this.input.webview:void 0}get scopedContextKeyService(){return this._scopedContextKeyService.value}createEditor(e){const t=document.createElement("div");this._element=t,this._element.id=`webview-editor-element-${ar()}`,e.appendChild(t),this._scopedContextKeyService.value=this._register(this._contextKeyService.createScoped(t))}dispose(){this._isDisposed=!0,this._element?.remove(),this._element=void 0,super.dispose()}layout(e){this._dimension=e,this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview,e)}focus(){super.focus(),!this._onFocusWindowHandler.value&&!Wn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus($v.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Ou&&this.webview&&(e?this.claimWebview(this.input):this.webview.release(this)),super.setEditorVisible(e)}clearInput(){this.webview&&(this.webview.release(this),this._webviewVisibleDisposables.clear()),super.clearInput()}async setInput(e,t,i,n){if(this.input&&e.matches(this.input))return;const o=e instanceof Ou&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,n),await e.resolve(),!(n.isCancellationRequested||this._isDisposed)&&e instanceof Ou&&(e.updateGroup(this.group.id),o||this.claimWebview(e),this._dimension&&this.layout(this._dimension))}claimWebview(e){e.claim(this,this.window,this.scopedContextKeyService),this._element&&(this._element.setAttribute("aria-flowto",e.webview.container.id),Adt(e.webview.container,this._element)),this._webviewVisibleDisposables.clear(),this._webviewVisibleDisposables.add(this._editorGroupsService.createEditorDropTarget(e.webview.container,{containsGroup:t=>this.group.id===t.id})),this._webviewVisibleDisposables.add(new Sqt(this.window,()=>this.webview)),this.synchronizeWebviewContainerDimensions(e.webview),this._webviewVisibleDisposables.add(this.trackFocus(e.webview))}synchronizeWebviewContainerDimensions(e,t){if(!this._element?.isConnected)return;const i=this._workbenchLayoutService.getContainer(this.window,$v.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Ac(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},pEe=GR,GR.ID="WebviewEditor",GR);Lze=pEe=D([_(1,Yi),_(2,pn),_(3,$i),_(4,Po),_(5,ei),_(6,kI),_(7,xc),_(8,Le)],Lze);let mEe=class extends V{constructor(e,t){super(),this._lifecycleService=e,this._configService=t,this._icons=new Map,this._register(this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()}))}dispose(){super.dispose(),this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElement=gl(void 0,void 0,this._store),this._styleElement.className="webview-icons"),this._styleElement}setIcons(e,t){t?this._icons.set(e,t):this._icons.delete(e),this.updateStyleSheet()}async updateStyleSheet(){await this._lifecycleService.when(Rs.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const n=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${n}, .monaco-workbench.hc-light ${n} { content: ""; background-image: ${Zu(i.light)}; }`,`.monaco-workbench.vs-dark ${n}, .monaco-workbench.hc-black ${n} { content: ""; background-image: ${Zu(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` +`)}};mEe=D([_(0,ig),_(1,Te)],mEe);function Cte(s,e){return s.canResolve(e)}let hN=class extends Ou{constructor(e,t,i){super(e,t,i.iconManager),this._webviewWorkbenchService=i,this._resolved=!1}dispose(){super.dispose(),this._resolvePromise?.cancel(),this._resolvePromise=void 0}async resolve(){if(!this._resolved){this._resolved=!0,this._resolvePromise=Rr(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Fr(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};hN.__decorator=D([Zt],hN.prototype,"resolve",null);hN=D([_(2,N6)],hN);class Eqt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new dc,n=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=jr(e.webview.onDidDispose(n),t.onCancellationRequested(()=>{n(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:n})=>Cte(e,n));this._awaitingRevival=this._awaitingRevival.filter(({input:n})=>!Cte(e,n));for(const{input:n,promise:o,disposable:r}of i)e.resolveWebview(n,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let Rze=class extends V{constructor(e,t,i,n){super(),this._editorService=t,this._instantiationService=i,this._webviewService=n,this._revivers=new Set,this._revivalPool=new Eqt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(mEe)),this._register(e.registerContextKeyProvider({contextKey:Aqt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(n.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Ou?t=e:e instanceof qg&&(e.primary instanceof Ou?t=e.primary:e.secondary instanceof Ou&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Ou?t=e:e instanceof qg&&(e.primary instanceof Ou&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Ou&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,n){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Ou,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:n.preserveFocus,activation:n.preserveFocus?Gk.RESTORE:void 0},n.group),r}revealWebview(e,t,i){const n=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(n,{preserveFocus:i,activation:i?Gk.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof qg&&(e===t.primary||e===t.secondary))return t;return e}openRevivedWebview(e){const t=this._webviewService.createWebviewOverlay(e.webviewInitInfo);t.state=e.state;const i=this._instantiationService.createInstance(hN,{viewType:e.viewType,providedId:e.webviewInitInfo.providedViewType,name:e.title},t);return i.iconPath=e.iconPath,typeof e.group=="number"&&i.updateGroup(e.group),i}registerResolver(e){this._revivers.add(e);const t=new ci;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof hN?!0:hi.some(this._revivers.values(),t=>Cte(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Cte(i,e))return await i.resolveWebview(e,t),!0;return!1}async resolveWebview(e,t){if(!await this.tryRevive(e,t)&&!t.isCancellationRequested)return this._revivalPool.enqueueForRestoration(e,t)}setIcons(e,t){this._iconManager.setIcons(e,t)}};Rze=D([_(0,Po),_(1,ei),_(2,we),_(3,qae)],Rze);var zP,KR;let oB=(KR=class extends hN{static create(e,t,i,n,o){return e.invokeFunction(r=>{const a=r.get(W6).getValue(t),c=a?$e.fromString(a):void 0,l=r.get(qae).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(zP,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof n<"u"&&d.updateGroup(n),d})}get resource(){return this._editorResource}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,n),this.instantiationService=o,this.labelService=r,this.customEditorService=a,this.fileDialogService=c,this.undoRedoService=l,this.fileService=d,this.filesConfigurationService=h,this.editorGroupsService=u,this.layoutService=f,this.customEditorLabelService=p,this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._editorResource=e.resource,this.oldResource=i.oldResource,this._defaultDirtyState=i.startsDirty,this._backupId=i.backupId,this._untitledDocumentData=i.untitledDocumentData,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this.resource.scheme&&this.updateLabel()}updateLabel(){this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}get typeId(){return zP.typeId}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return e|=Ei.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Ei.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??Ko(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(this.resource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this.resource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this.resource)),this._longTitle}getTitle(e){switch(e){case Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof zP&&this.viewType===e.viewType&&ji(this.resource,e.resource)}copy(){return zP.create(this.instantiationService,this.resource,this.viewType,this.group,this.webview.options)}isReadonly(){return this._modelRef?this._modelRef.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._modelRef?this._modelRef.object.isDirty():!!this._defaultDirtyState}async save(e,t){if(!this._modelRef)return;const i=await this._modelRef.object.saveCustomEditor(t);if(i)return ji(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,n=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(n&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,n,t))return(await this.rename(e,n))?.editor}async revert(e,t){if(this._modelRef)return this._modelRef.object.revert(t);this._defaultDirtyState=!1,this._onDidChangeDirty.fire()}async resolve(){if(await super.resolve(),this.isDisposed())return null;if(!this._modelRef){const e=this.capabilities;this._modelRef=this._register(qn(await this.customEditorService.models.tryRetain(this.resource,this.viewType))),this._register(this._modelRef.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._modelRef.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._untitledDocumentData&&(this._defaultDirtyState=!0),this.isDirty()&&this._onDidChangeDirty.fire(),this.capabilities!==e&&this._onDidChangeCapabilities.fire()}return null}async rename(e,t){return{editor:{resource:t}}}undo(){return qn(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return qn(this._modelRef),this.undoRedoService.redo(this.resource)}onMove(e){this._moveHandler=e}transfer(e){if(super.transfer(e))return e._moveHandler=this._moveHandler,this._moveHandler=void 0,e}get backupId(){return this._modelRef?this._modelRef.object.backupId:this._backupId}get untitledDocumentData(){return this._untitledDocumentData}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}claim(e,t,i){if(this.doCanMove(t.vscodeWindowId)!==!0)throw oJe(g(9516,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[rl({id:"openInOriginalWindow",label:g(9517,"Open in Original Window"),run:async()=>{const n=this.editorGroupsService.getPart(this.layoutService.getContainer(ct(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,n.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const n=this.doCanMove(i.windowId);if(typeof n=="string")return n}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&&ct(this.webview.container).vscodeWindowId!==e?g(9518,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},zP=KR,KR.typeId="workbench.editors.webviewEditor",KR);oB=zP=D([_(3,N6),_(4,we),_(5,Fs),_(6,JRe),_(7,ag),_(8,JA),_(9,Jt),_(10,_d),_(11,Po),_(12,kI),_(13,nE)],oB);var $P,yk;let _Ee=(yk=class extends Ob{static create(e,t,i,n,o){return e.createInstance($P,t,i,n,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return $P.ID}get language(){return this._inputModelRef?.object.textEditorModel.getLanguageId()??this._initLanguage}get notebookEditorInput(){return this._notebookEditorInput}get editorInputs(){return[this._notebookEditorInput]}get resource(){return this._resource}get inputResource(){return this._inputResource}get primary(){return this._notebookEditorInput}constructor(e,t,i,n,o,r,a,c,l,d,h){const u=JT.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(HAe.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??$P.windowNames[e.path]??Ko(e.path,Gy(e.path)),this._initLanguage=n,this._resource=e,this._inputResource=t,this._inputResolver=null,this._editorModelReference=null,this._inputModelRef=null,this._textModelService=r,this._interactiveDocumentService=a,this._historyService=c,this._registerListeners()}_registerListeners(){const e=M.once(this.primary.onWillDispose);this._register(e(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire()))}get capabilities(){const e=this.isScratchpad?Ei.Scratchpad:0;return Ei.Untitled|Ei.Readonly|e}async _resolveEditorModel(){return this._editorModelReference||(this._editorModelReference=await this._notebookEditorInput.resolve()),this._editorModelReference}async resolve(){return this._editorModelReference?this._editorModelReference:this._inputResolver?this._inputResolver:(this._inputResolver=this._resolveEditorModel(),this._inputResolver)}async resolveInput(e){if(this._inputModelRef)return this._inputModelRef.object.textEditorModel;const t=e??this._initLanguage??Ca;return this._interactiveDocumentService.willCreateInteractiveDocument(this.resource,this.inputResource,t),this._inputModelRef=await this._textModelService.createModelReference(this.inputResource),this._inputModelRef.object.textEditorModel}async save(e,t){if(this._editorModelReference)return this.hasCapability(Ei.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const n=this.getName()+".ipynb",o=Pt(await this._fileDialogService.defaultFilePath(),n),r=await this._fileDialogService.pickFileToSave(o,t?.availableFileSystems);if(!r)return;const a=await this._editorModelReference.saveAs(r);return a&&"resource"in a&&a.resource&&this._notebookService.getNotebookTextModel(a.resource)?.dispose(),a}matches(e){return super.matches(e)?!0:e instanceof $P?ji(this.resource,e.resource)&&ji(this.inputResource,e.inputResource):!1}getName(){return this.name}isDirty(){return this.isScratchpad?!1:this._editorModelReference?.isDirty()??!1}isModified(){return this._editorModelReference?.isModified()??!1}async revert(e,t){this._editorModelReference&&this._editorModelReference.isDirty()&&await this._editorModelReference.revert(t)}dispose(){this._editorModelReference?.revert({soft:!0}),this._notebookEditorInput?.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,this._interactiveDocumentService.willRemoveInteractiveDocument(this.resource,this.inputResource),this._inputModelRef?.dispose(),this._inputModelRef=null,super.dispose()}get historyService(){return this._historyService}},$P=yk,yk.windowNames={},yk.ID="workbench.input.interactive",yk);_Ee=$P=D([_(4,we),_(5,fn),_(6,eMe),_(7,MJe),_(8,tE),_(9,ag),_(10,Te)],_Ee);const $C=class $C{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const n of e)t=Math.min(t,n.startLineNumber),i=Math.max(i,n.startLineNumber+n.lineCount);return new $C(t,i-t)}static fromLineNumbers(e,t){return new $C(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new Ni}join(e){return new $C(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive)-this.startLineNumber)}get endLineNumberExclusive(){return this.startLineNumber+this.lineCount}get isEmpty(){return this.lineCount===0}touches(e){return this.endLineNumberExclusive>=e.startLineNumber&&e.endLineNumberExclusive>=this.startLineNumber}isAfter(e){return this.startLineNumber>=e.endLineNumberExclusive}isBefore(e){return e.startLineNumber>=this.endLineNumberExclusive}delta(e){return new $C(this.startLineNumber+e,this.lineCount)}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}equals(e){return this.startLineNumber===e.startLineNumber&&this.lineCount===e.lineCount}contains(e){return this.startLineNumber<=e&&ee.startLineNumber,nu);let jg=$C;const xqt={start:"<<<<<<<",end:">>>>>>>"};function*Dqt(s,e,t){const i=new Uy(e);for(const n of s){i.takeWhile(r=>Ek.isGreaterThan(t(n,r)));const o=i.takeWhile(r=>Ek.isNeitherLessOrGreaterThan(t(n,r)));yield{left:n,rights:o||[]}}}function Ont(...s){return[].concat(...s)}let Mze=class{constructor(e,t){this.key=e,this.storageService=t,this.hasValue=!1,this.value=void 0}get(){if(!this.hasValue){const e=this.storageService.get(this.key,Ie.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){vt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),Ie.PROFILE,an.USER)}};Mze=D([_(1,$i)],Mze);class g${constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&is(this.newLines,e.newLines)}toEdits(e){return new Iqt([this]).toEdits(e)}}class kqt{constructor(e,t){this.range=e,this.newText=t}equals(e){return F.equalsRange(this.range,e.range)&&this.newText===e.newText}}class Iqt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new F(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` +`).join("")}:t.range.startLineNumber===1?{range:new F(1,1,e,Number.MAX_SAFE_INTEGER),text:t.newLines.join(` +`)}:{range:new F(t.range.startLineNumber-1,Number.MAX_SAFE_INTEGER,e,Number.MAX_SAFE_INTEGER),text:t.newLines.map(i=>` +`+i).join("")})}}function Tqt(s,e){return!(e.lineNumbers.endLineNumber||e.lineNumber===s.startLineNumber&&e.column=s.endColumn)}function Lqt(s,e){return s.lineNumber===e.lineNumber?new eg(0,e.column-s.column):new eg(e.lineNumber-s.lineNumber,e.column-1)}function Rqt(s,e){return e.lineCount===0?new oe(s.lineNumber,s.column+e.columnCount):new oe(s.lineNumber+e.lineCount,e.columnCount+1)}function Nze(s,e){return s.endLineNumbert?t.join(i):i,void 0)}constructor(e,t){this.inputRange=e,this.outputRange=t}extendInputRange(e){if(!e.containsRange(this.inputRange))throw new Ni;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new $u(e,new jg(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new $u(this.inputRange.join(e.inputRange),this.outputRange.join(e.outputRange))}get resultingDeltaFromOriginalToModified(){return this.outputRange.endLineNumberExclusive-this.inputRange.endLineNumberExclusive}toString(){return`${this.inputRange.toString()} -> ${this.outputRange.toString()}`}addOutputLineDelta(e){return new $u(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new $u(this.inputRange.delta(e),this.outputRange)}reverse(){return new $u(this.outputRange,this.inputRange)}}class W1{static betweenOutputs(e,t,i){const o=$ce.compute(e,t).map(r=>new $u(r.output1Range,r.output2Range));return new W1(o,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,G_(()=>bU(e,(i,n)=>i.inputRange.isBefore(n.inputRange)&&i.outputRange.isBefore(n.outputRange)&&n.inputRange.startLineNumber-i.inputRange.endLineNumberExclusive===n.outputRange.startLineNumber-i.outputRange.endLineNumberExclusive))}project(e){const t=Ak(this.lineRangeMappings,o=>o.inputRange.startLineNumber<=e);if(!t)return new $u(new jg(e,1),new jg(e,1));if(t.inputRange.contains(e))return t;const i=new jg(e,1),n=new jg(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new $u(i,n)}get outputLineCount(){const e=b6e(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new W1(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class $ce{static compute(e,t){const i=Cc(d=>d.inputRange.startLineNumber,nu),n=Ont(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(Cc(d=>d.diff,i)),o=[new Array,new Array],r=[0,0],a=new Array;function c(d){const h=$u.join(o[0])||new $u(d,d.delta(r[0])),u=$u.join(o[1])||new $u(d,d.delta(r[1]));a.push(new $ce(l,h.extendInputRange(l).outputRange,o[0],u.extendInputRange(l).outputRange,o[1])),o[0]=[],o[1]=[]}let l;for(const d of n){const h=d.diff.inputRange;l&&!l.touches(h)&&(c(l),l=void 0),r[d.source]=d.diff.resultingDeltaFromOriginalToModified,l=l?l.join(h):h,o[d.source].push(d.diff)}return l&&c(l),a}constructor(e,t,i,n,o){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=n,this.output2LineMappings=o}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class wD extends $u{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,n,o){super(e,i),this.inputTextModel=t,this.outputTextModel=n,this.rangeMappings=o||[new gA(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new wD(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new wD(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new wD(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new g$(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new g$(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class gA{constructor(e,t){this.inputRange=e,this.outputRange=t}toString(){function e(t){return`[${t.startLineNumber}:${t.startColumn}, ${t.endLineNumber}:${t.endColumn})`}return`${e(this.inputRange)} -> ${e(this.outputRange)}`}addOutputLineDelta(e){return new gA(this.inputRange,new F(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new gA(new F(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new gA(this.outputRange,this.inputRange)}}class kF{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,G_(()=>bU(e,(i,n)=>Nze(i.inputRange,n.inputRange)&&Nze(i.outputRange,n.outputRange)))}project(e){const t=Ak(this.rangeMappings,o=>o.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new gA(F.fromPositions(e,e),F.fromPositions(e,e));if(Tqt(t.inputRange,e))return t;const i=Lqt(t.inputRange.getEndPosition(),e),n=Rqt(t.outputRange.getEndPosition(),i);return new gA(F.fromPositions(e),F.fromPositions(n))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new gA(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=b6e(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new kF(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Ste=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=yRe("mergeEditor.diffAlgorithm","advanced",this.configurationService).map(i=>i==="smart"?"legacy":i==="experimental"?"advanced":i)}async computeDiff(e,t,i){const n=this.mergeAlgorithm.read(i),o=e.getVersionId(),r=t.getVersionId(),a=await this.editorWorkerService.computeDiff(e.uri,t.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1},n);if(!a)throw new Error("Diff computation failed");if(e.isDisposed()||t.isDisposed())return{diffs:null};const c=a.changes.map(h=>new wD(Pze(h.original),e,Pze(h.modified),t,h.innerChanges?.map(u=>Mqt(u)))),l=e.getVersionId(),d=t.getVersionId();return o!==l||r!==d?{diffs:null}:(G_(()=>{for(const h of c){const u=h.inputRange,f=h.outputRange,p=h.inputTextModel,m=h.outputTextModel;for(const v of h.rangeMappings){let b=u.startLineNumber-1<=v.inputRange.startLineNumber&&v.inputRange.endLineNumber<=u.endLineNumberExclusive;b&&v.inputRange.startLineNumber===u.startLineNumber-1&&(b=v.inputRange.endColumn>=p.getLineMaxColumn(v.inputRange.startLineNumber)),b&&v.inputRange.endLineNumber===u.endLineNumberExclusive&&(b=v.inputRange.endColumn===1);let w=f.startLineNumber-1<=v.outputRange.startLineNumber&&v.outputRange.endLineNumber<=f.endLineNumberExclusive;if(w&&v.outputRange.startLineNumber===f.startLineNumber-1&&(w=v.outputRange.endColumn>=m.getLineMaxColumn(v.outputRange.endLineNumber)),w&&v.outputRange.endLineNumber===f.endLineNumberExclusive&&(w=v.outputRange.endColumn===1),!b||!w)return!1}}return c.length===0||c[0].inputRange.startLineNumber===c[0].outputRange.startLineNumber&&bU(c,(h,u)=>u.inputRange.startLineNumber-h.inputRange.endLineNumberExclusive===u.outputRange.startLineNumber-h.outputRange.endLineNumberExclusive&&h.inputRange.endLineNumberExclusive{if(!this._isOccupied){this._isOccupied=!0;try{return e(...t)}finally{this._isOccupied=!1}}}}}class Rue extends V{get isApplyingChange(){return this._barrier.isOccupied}constructor(e,t,i){super(),this.baseTextModel=e,this.textModel=t,this.diffComputer=i,this._recomputeCount=0,this._state=jt(this,zp.initializing),this._diffs=jt(this,[]),this._barrier=new Nqt,this._isDisposed=!1,this._isInitializing=!0;const n=gC("recompute");this._register(ai(o=>{n.read(o),this._recompute(o)})),this._register(e.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.trigger(void 0)}))),this._register(t.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.trigger(void 0)}))),this._register(Ee(()=>{this._isDisposed=!0}))}get state(){return this._state}get diffs(){return this._diffs}_recompute(e){this._recomputeCount++;const t=this._recomputeCount;this._state.get()===zp.initializing&&(this._isInitializing=!0),ts(n=>{this._state.set(this._isInitializing?zp.initializing:zp.updating,n,YC.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(n=>{this._isDisposed||t===this._recomputeCount&&ts(o=>{n.diffs?(this._state.set(zp.upToDate,o,YC.textChange),this._diffs.set(n.diffs,o,YC.textChange)):this._state.set(zp.error,o,YC.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==zp.upToDate)throw new Ni("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(Cc(o=>o.inputRange.startLineNumber,nu)),e.reverse();let n=this._diffs.get();for(const o of e){const r=n.length;if(n=n.filter(a=>a!==o),r===n.length)throw new Ni;this._barrier.runExclusivelyOrThrow(()=>{const a=o.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),n=n.map(a=>a.outputRange.isAfter(o.outputRange)?a.addOutputLineDelta(o.inputRange.lineCount-o.outputRange.lineCount):a)}this._diffs.set(n,t,YC.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const n=new wD(e.range,this.baseTextModel,new jg(e.range.startLineNumber,e.newLines.length),this.textModel);let o=!1,r=0;const a=new Array;for(const c of this.diffs.get()){if(c.inputRange.touches(e.range))throw new Ni("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(o||(o=!0,a.push(n.addOutputLineDelta(r))),a.push(c.addOutputLineDelta(e.newLines.length-e.range.lineCount))):a.push(c),o||(r+=c.outputRange.lineCount-c.inputRange.lineCount)}o||(o=!0,a.push(n.addOutputLineDelta(r))),this._barrier.runExclusivelyOrThrow(()=>{const c=new g$(e.range.delta(r),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,YC.other)}findTouchingDiffs(e){return this.diffs.get().filter(t=>t.inputRange.touches(e))}getResultLine(e,t){let i=0;const n=t?this.diffs.read(t):this.diffs.get();for(const o of n){if(o.inputRange.contains(e)||o.inputRange.endLineNumberExclusive===e)return o;if(o.inputRange.endLineNumberExclusivenew cPe(a.inputRange,i,a.output1Range,n,a.output1LineMappings,a.output2Range,o,a.output2LineMappings))}constructor(e,t,i,n,o,r,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=n,this.input1Diffs=o,this.input2Range=r,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=wD.join(this.input1Diffs),this.input2CombinedDiff=wD.join(this.input2Diffs),this.isEqualChange=is(this.input1Diffs,this.input2Diffs,(l,d)=>l.getLineEdit().equals(d.getLineEdit())),this.smartInput1LineRangeEdit=null,this.smartInput2LineRangeEdit=null,this.dumbInput1LineRangeEdit=null,this.dumbInput2LineRangeEdit=null,this.input1Diffs.length===0&&this.input2Diffs.length===0)throw new Ni("must have at least one diff")}getInputRange(e){return e===1?this.input1Range:this.input2Range}getInputCombinedDiff(e){return e===1?this.input1CombinedDiff:this.input2CombinedDiff}getInputDiffs(e){return e===1?this.input1Diffs:this.input2Diffs}get isConflicting(){return this.input1Diffs.length>0&&this.input2Diffs.length>0}get canBeCombined(){return this.smartCombineInputs(1)!==void 0}get isOrderRelevant(){const e=this.smartCombineInputs(1),t=this.smartCombineInputs(2);return!e||!t?!1:!e.equals(t)}getEditForBase(e){const t=[];if(e.includesInput1&&this.input1CombinedDiff&&t.push({diff:this.input1CombinedDiff,inputNumber:1}),e.includesInput2&&this.input2CombinedDiff&&t.push({diff:this.input2CombinedDiff,inputNumber:2}),t.length===0)return{edit:void 0,effectiveState:Id.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Id.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==Uo.both)throw new Ni;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[vEe(e.firstInput)-1].diff.getLineEdit(),effectiveState:Id.base.withInputValue(vEe(e.firstInput),!0,!1)}}smartCombineInputs(e){if(e===1&&this.smartInput1LineRangeEdit!==null)return this.smartInput1LineRangeEdit;if(e===2&&this.smartInput2LineRangeEdit!==null)return this.smartInput2LineRangeEdit;const i=Ont(this.input1Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:1}))),this.input2Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:2})))).sort(C6e(Cc(o=>o.diff.inputRange,F.compareRangesUsingStarts),Cc(o=>o.input===e?1:2,nu))).map(o=>{const r=o.input===1?this.input1TextModel:this.input2TextModel;return new kqt(o.diff.inputRange,r.getValueInRange(o.diff.outputRange))}),n=Pqt(this.baseRange,i,this.baseTextModel);return e===1?this.smartInput1LineRangeEdit=n:this.smartInput2LineRangeEdit=n,n}dumbCombineInputs(e){if(e===1&&this.dumbInput1LineRangeEdit!==null)return this.dumbInput1LineRangeEdit;if(e===2&&this.dumbInput2LineRangeEdit!==null)return this.dumbInput2LineRangeEdit;let t=this.input1Range.getLines(this.input1TextModel),i=this.input2Range.getLines(this.input2TextModel);e===2&&([t,i]=[i,t]);const n=new g$(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=n:this.dumbInput2LineRangeEdit=n,n}}function Pqt(s,e,t){let i="";const n=s.startLineNumber>1;let o=n?new oe(s.startLineNumber-1,t.getLineMaxColumn(s.startLineNumber-1)):new oe(s.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!o.isBeforeOrEqual(h))return;let u=t.getValueInRange(F.fromPositions(o,h));h.lineNumber>t.getLineCount()&&(u+=` +`),i+=u,i+=d.newText,o=d.range.getEndPosition()}const r=s.endLineNumberExclusive<=t.getLineCount(),a=r?new oe(s.endLineNumberExclusive,1):new oe(s.endLineNumberExclusive-1,Un.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(F.fromPositions(o,a));i+=c;const l=ov(i);if(n){if(l[0]!=="")return;l.shift()}if(r){if(l[l.length-1]!=="")return;l.pop()}return new g$(s,l)}var Uo;(function(s){s[s.base=0]="base",s[s.input1=1]="input1",s[s.input2=2]="input2",s[s.both=3]="both",s[s.unrecognized=4]="unrecognized"})(Uo||(Uo={}));function vEe(s){return s===1?2:1}class uG{constructor(){}get includesInput1(){return!1}get includesInput2(){return!1}includesInput(e){return e===1?this.includesInput1:this.includesInput2}isInputIncluded(e){return e===1?this.includesInput1:this.includesInput2}toggle(e){return this.withInputValue(e,!this.includesInput(e),!0)}getInput(e){return this.isInputIncluded(e)?TH.first:TH.excluded}}class lPe extends uG{get kind(){return Uo.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new Gce:this:t?new uN:this}equals(e){return e.kind===Uo.base}}class Gce extends uG{get kind(){return Uo.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new uN}withInputValue(e,t,i=!1){return e===1?t?this:new lPe:t?new Kce(1,i):new uN}equals(e){return e.kind===Uo.input1}}class uN extends uG{get kind(){return Uo.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Gce}withInputValue(e,t,i=!1){return e===2?t?this:new lPe:t?new Kce(2,i):new uN}equals(e){return e.kind===Uo.input2}}class Kce extends uG{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return Uo.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Kce(vEe(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new uN:new Gce}equals(e){return e.kind===Uo.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?TH.first:TH.second}}class Fqt extends uG{get kind(){return Uo.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new Gce:new uN:this}equals(e){return e.kind===Uo.unrecognized}}var Id;(function(s){s.base=new lPe,s.unrecognized=new Fqt})(Id||(Id={}));var TH;(function(s){s[s.excluded=0]="excluded",s[s.first=1]="first",s[s.second=2]="second",s[s.unrecognized=3]="unrecognized"})(TH||(TH={}));let Ate=class extends RI{constructor(e,t,i,n,o,r,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=n,this.diffComputer=o,this.options=r,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Rue(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Rue(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Rue(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=Ze(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return cPe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=Ze(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new Fze(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=Ze(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=Ze(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=Ze(this,h=>{const u=new W1(this.baseResultDiffs.read(h),-1);return new W1(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new $u(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=Ze(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===zp.initializing)?Gm.initializing:u.some(f=>f===zp.updating)?Gm.updating:Gm.upToDate}),this.inputDiffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===zp.initializing)?Gm.initializing:u.some(f=>f===zp.updating)?Gm.updating:Gm.upToDate}),this.isUpToDate=Ze(this,h=>this.diffComputingState.read(h)===Gm.upToDate),this.onInitialized=T5(this.diffComputingState,h=>h===Gm.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=Ze(this,h=>{const u=this.modifiedBaseRangeResultStates.read(h);let f=0;for(const[p,m]of u)m.handled.read(h)||f++;return f}),this.hasUnhandledConflicts=this.unhandledConflictsCount.map(h=>h>0),this._register(Oq(this.modifiedBaseRangeResultStates)),this._register(Oq(this.input1ResultMapping)),this._register(Oq(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(LU({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===YC.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);ts(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,b]of f){const w=b.accepted.get(),y=!(w.kind===Uo.base||w.kind===Uo.unrecognized);b.handledInput1.set(y,m),b.handledInput2.set(y,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await T5(this.inputDiffComputingState,t=>t===Gm.upToDate);const e=this.modifiedBaseRangeResultStates.get();ts(t=>{for(const[i,n]of e){let o,r=!1;i.input1Diffs.length===0?(o=Id.base.withInputValue(2,!0),r=!0):i.input2Diffs.length===0||i.isEqualChange?(o=Id.base.withInputValue(1,!0),r=!0):(o=Id.base,r=!1),n.accepted.set(o,t),n.computedFromDiffing=!1,n.previousNonDiffingState=void 0,n.handledInput1.set(r,t),n.handledInput2.set(r,t)}this.resultTextModel.pushEditOperations(null,[{range:new F(1,1,Number.MAX_SAFE_INTEGER,1),text:this.computeAutoMergedResult()}],()=>null)})}computeAutoMergedResult(){const e=this.modifiedBaseRanges.get(),t=this.base.getLinesContent(),i=this.input1.textModel.getLinesContent(),n=this.input2.textModel.getLinesContent(),o=[];function r(c,l){for(let d=l.startLineNumber;do.inputRange.isEmpty||o.outputRange.isEmpty?new $u(o.inputRange.deltaStart(-1),o.outputRange.deltaStart(-1)):o),n.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new kF(i.flatMap(o=>o.rangeMappings),0).reverse().projectRange(t).outputRange}translateBaseRangeToInput(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new kF(i.flatMap(o=>o.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new kF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new kF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).projectRange(e).outputRange}findModifiedBaseRangesInRange(e){return this.modifiedBaseRanges.get().filter(t=>t.baseRange.intersects(e))}updateBaseRangeAcceptedState(e,t,i){const n=Dqt(t,e,(o,r)=>o[0].baseRange.touches(r.inputRange)?Ek.neitherLessOrGreaterThan:jg.compareByStart(o[0].baseRange,r.inputRange));for(const o of n){const r=this.computeState(o.left[0],o.rights),a=o.left[1],c=a.accepted.get();c.equals(r)||(!this.firstRun&&!a.computedFromDiffing&&(a.computedFromDiffing=!0,a.previousNonDiffingState=c),a.accepted.set(r,i))}this.firstRun&&(this.firstRun=!1)}computeState(e,t){if(t.length===0)return Id.base;const i=t.map(r=>r.getLineEdit());function n(r){return is(i,r.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(n(e.input1Diffs))return Id.base.withInputValue(1,!0);if(n(e.input2Diffs))return Id.base.withInputValue(2,!0);const o=[Id.base.withInputValue(1,!0).withInputValue(2,!0,!0),Id.base.withInputValue(2,!0).withInputValue(1,!0,!0),Id.base.withInputValue(1,!0).withInputValue(2,!0,!1),Id.base.withInputValue(2,!0).withInputValue(1,!0,!1)];for(const r of o){const{edit:a}=e.getEditForBase(r);if(a){const l=this.resultTextModelDiffs.getResultLineRange(e.baseRange).getLines(this.resultTextModel);if(is(a.newLines,l,(d,h)=>d===h))return r}}return Id.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new Ni("object must be from this instance");return t.accepted}setState(e,t,i,n,o=!1){if(!this.isUpToDate.get())throw new Ni("Cannot set state while updating");const r=this.modifiedBaseRangeResultStates.get().get(e);if(!r)throw new Ni("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new bY;a&&this.resultTextModelDiffs.removeDiffs(a,n,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);r.accepted.set(d,n),r.previousNonDiffingState=void 0,r.computedFromDiffing=!1;const h=r.handledInput1.get(),u=r.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new Oqt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(r),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,n,c),this.resultTextModel.pushStackElement()),r.handledInput1.set(!0,n),r.handledInput2.set(!0,n)}resetDirtyConflictsToBase(){ts(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===Uo.unrecognized&&this.setState(t,Id.base,!1,e,!1);this.resultTextModel.pushStackElement()})}isHandled(e){return this.modifiedBaseRangeResultStates.get().get(e).handled}isInputHandled(e,t){const i=this.modifiedBaseRangeResultStates.get().get(e);return t===1?i.handledInput1:i.handledInput2}setInputHandled(e,t,i,n){const o=this.modifiedBaseRangeResultStates.get().get(e);if(o.handled.get()===i)return;const r=new WeakRef(Fze),a=new WeakRef(this);this.undoRedoService.pushElement({type:Al.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(11380,"Set Input Handled"),redo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&ts(d=>{t===1?o.handledInput1.set(i,d):o.handledInput2.set(i,d)})},undo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&ts(d=>{t===1?o.handledInput1.set(!i,d):o.handledInput2.set(!i,d)})}}),t===1?o.handledInput1.set(i,n):o.handledInput2.set(i,n)}setHandled(e,t,i){const n=this.modifiedBaseRangeResultStates.get().get(e);n.handled.get()!==t&&(n.handledInput1.set(t,i),n.handledInput2.set(t,i))}setLanguageId(e,t){const i=this.languageService.createById(e);this.base.setLanguage(i,t),this.input1.textModel.setLanguage(i,t),this.input2.textModel.setLanguage(i,t),this.resultTextModel.setLanguage(i,t)}getInitialResultValue(){const e=[];for(;;){const t=this.resultSnapshot.read();if(t===null)break;e.push(t)}return e.join()}async getResultValueWithConflictMarkers(){if(await T5(this.diffComputingState,c=>c===Gm.upToDate),this.unhandledConflictsCount.get()===0)return this.resultTextModel.getValue();const e=this.resultTextModel.getLinesContent(),t=this.input1.textModel.getLinesContent(),i=this.input2.textModel.getLinesContent(),n=this.modifiedBaseRangeResultStates.get(),o=[];function r(c,l){for(let d=l.startLineNumber;d>>>>>>")}return r(e,jg.fromLineNumbers(a,e.length+1)),o.join(` +`)}get conflictCount(){return _g(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return _g(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.base)}get conflictsResolvedWithInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input1)}get conflictsResolvedWithInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input2)}get conflictsResolvedWithSmartCombination(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&t.previousNonDiffingState?.smartCombination})}};Ate=D([_(7,xi),_(8,JA)],Ate);function _g(s,e){let t=0;for(const i of s)e(i)&&t++;return t}class Fze{constructor(e){this.baseRange=e,this.accepted=jt(`BaseRangeState${this.baseRange.baseRange}`,Id.base),this.handledInput1=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Ze(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var Gm;(function(s){s[s.initializing=1]="initializing",s[s.upToDate=2]="upToDate",s[s.updating=3]="updating"})(Gm||(Gm={}));class Oqt{constructor(e,t,i,n,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=n,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(11381,"Undo Mark As Handled"),this.type=Al.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&ts(i=>{t.handledInput1.set(!0,i),t.handledInput2.set(!0,i)})}undo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&ts(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}new Q("isMergeEditor",!1,{type:"boolean",description:g(10824,"The editor is a merge editor")});new Q("isMergeResultEditor",!1,{type:"boolean",description:g(10825,"The editor is a the result editor of a merge editor.")});new Q("mergeEditorLayout","mixed",{type:"string",description:g(10826,"The layout mode of a merge editor")});new Q("mergeEditorShowBase",!1,{type:"boolean",description:g(10827,"If the merge editor shows the base version")});new Q("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(10828,"If base should be shown at the top")});new Q("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(10829,"If the merge editor shows non-conflicting changes")});new Q("mergeEditorBaseUri","",{type:"string",description:g(10830,"The uri of the baser of a merge editor")});new Q("mergeEditorResultUri","",{type:"string",description:g(10831,"The uri of the result of a merge editor")});const Oze="mergeEditorCloseWithConflicts";var bEe;let wEe=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=n}async createInputModel(e){const t=new Z,[i,n,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Ete(e.input1,this._textModelService,t),Ete(e.input2,this._textModelService,t)]);t.add(i),t.add(n);const a=n.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:n.object.textEditorModel.getLanguageId(),onDidChange:M.None},a);t.add(c);const l=this._instantiationService.createInstance(Ste),d=this._instantiationService.createInstance(Ate,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(yEe,d,t,n.object,e.result)}};wEe=D([_(1,we),_(2,fn),_(3,gi)],wEe);let yEe=class extends RI{constructor(e,t,i,n,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=n,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=jt(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Kn(this,c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Ze(this,c=>this.altVersionId.read(c)!==this.savedAltVersionId.read(c)),this.finished=!1}dispose(){this.disposable.dispose(),super.dispose()}async accept(){const e=await this.model.resultTextModel.getValue();this.result.textEditorModel.setValue(e),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),await this.textFileService.save(this.result.textEditorModel.uri),this.finished=!0}async _discard(){await this.textFileService.revert(this.model.resultTextModel.uri),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),this.finished=!0}shouldConfirmClose(){return!0}async confirmClose(e){G_(()=>e.some(n=>n===this));const t=e.some(n=>n.isDirty.get());let i;if(t){const n=e.length>1,o=n?g(10663,"Do you want keep the merge result of {0} files?",e.length):g(10664,"Do you want keep the merge result of {0}?",_i(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(10665,"&&Save With Conflicts"):g(10666,"&&Save"),run:()=>Gh.SAVE},{label:g(10667,"Do&&n't Save"),run:()=>Gh.DONT_SAVE}];i=(await this.dialogService.prompt({type:Xe.Info,message:o,detail:r?n?g(10668,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(10669,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):n?g(10670,"The merge results will be lost if you don't save them."):g(10671,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>Gh.CANCEL}})).result}else i=Gh.DONT_SAVE;return i===Gh.SAVE?await Promise.all(e.map(n=>n.accept())):i===Gh.DONT_SAVE&&await Promise.all(e.map(n=>n._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(10672,"Do you want to accept the merge result?"),detail:g(10673,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(10674,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(n=>n.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};yEe=D([_(4,Fo),_(5,to),_(6,ei)],yEe);var qR;let CEe=(qR=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=n}async createInputModel(e){const t=new Z;let i;const n=t.add(new Z),o=m=>{ji(e.result,m.resource)&&(n.clear(),i=m)};n.add(this.textFileService.files.onDidCreate(o)),this.textFileService.files.models.forEach(o);const[r,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Ete(e.input1,this._textModelService,t),Ete(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new Ni;await i.save({source:bEe.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(xqt.start)),f=this._instantiationService.createInstance(Ste),p=this._instantiationService.createInstance(Ate,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(SEe,p,t,i,this._mergeEditorTelemetry)}},bEe=qR,qR.FILE_SAVED_SOURCE=PJ.registerSource("merge-editor.source",g(10675,"Before Resolving Conflicts In Merge Editor")),qR);CEe=bEe=D([_(1,we),_(2,fn),_(3,Fo)],CEe);let SEe=class extends RI{constructor(e,t,i,n,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=n,this._dialogService=o,this._storageService=r,this.isDirty=Kn(this,M.any(this.resultTextFileModel.onDidChangeDirty,this.resultTextFileModel.onDidSaveError),()=>this.resultTextFileModel.isDirty()),this.reported=!1,this.dateTimeOpened=new Date}dispose(){this.disposableStore.dispose(),super.dispose(),this.reportClose(!1)}reportClose(e){if(!this.reported){const t=this.model.unhandledConflictsCount.get(),i=new Date().getTime()-this.dateTimeOpened.getTime();this.telemetry.reportMergeEditorClosed({durationOpenedSecs:i/1e3,remainingConflictCount:t,accepted:e,conflictCount:this.model.conflictCount,combinableConflictCount:this.model.combinableConflictCount,conflictsResolvedWithBase:this.model.conflictsResolvedWithBase,conflictsResolvedWithInput1:this.model.conflictsResolvedWithInput1,conflictsResolvedWithInput2:this.model.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:this.model.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:this.model.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:this.model.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:this.model.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:this.model.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart}),this.reported=!0}}async accept(){this.reportClose(!0),await this.resultTextFileModel.save()}get resultUri(){return this.resultTextFileModel.resource}async save(e){await this.resultTextFileModel.save(e)}async revert(e){await this.resultTextFileModel.revert(e)}shouldConfirmClose(){return!0}async confirmClose(e){const t=e.length>1,i=e.some(o=>o.isDirty.get()),n=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(10676,"Do you want to save the changes you made to {0} files?",e.length):g(10677,"Do you want to save the changes you made to {0}?",_i(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:Xe.Info,message:o,detail:n?t?g(10678,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(10679,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):g(t?10680:10681,"Your changes will be lost if you don't save them."),buttons:[{label:n?g(10682,"&&Save with Conflicts"):g(10683,"&&Save"),run:()=>Gh.SAVE},{label:g(10684,"Do&&n't Save"),run:()=>Gh.DONT_SAVE}],cancelButton:{run:()=>Gh.CANCEL}});return r}else if(n&&!this._storageService.getBoolean(Oze,Ie.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(10685,"Do you want to close {0} merge editors?",e.length):g(10686,"Do you want to close the merge editor for {0}?",_i(e[0].resultUri)),detail:n?t?g(10687,"The files contain unhandled conflicts."):g(10688,"The file contains unhandled conflicts."):void 0,primaryButton:n?g(10689,"&&Close with Conflicts"):g(10690,"&&Close"),checkbox:{label:g(10691,"Do not ask me again")}});return r&&this._storageService.store(Oze,!0,Ie.PROFILE,an.USER),o?Gh.SAVE:Gh.CANCEL}else return Gh.SAVE}};SEe=D([_(4,to),_(5,$i)],SEe);async function Ete(s,e,t){const i=await e.createModelReference(s.uri);return t.add(i),{textModel:i.object.textEditorModel,title:s.title,description:s.description,detail:s.detail}}let AEe=class{constructor(e){this.telemetryService=e}reportMergeEditorOpened(e){this.telemetryService.publicLog2("mergeEditor.opened",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportLayoutChange(e){this.telemetryService.publicLog2("mergeEditor.layoutChanged",{baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportMergeEditorClosed(e){this.telemetryService.publicLog2("mergeEditor.closed",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,durationOpenedSecs:e.durationOpenedSecs,remainingConflictCount:e.remainingConflictCount,accepted:e.accepted,conflictsResolvedWithBase:e.conflictsResolvedWithBase,conflictsResolvedWithInput1:e.conflictsResolvedWithInput1,conflictsResolvedWithInput2:e.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:e.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:e.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:e.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:e.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:e.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart})}reportAcceptInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.accept",{otherAccepted:t,isInput1:e===1})}reportSmartCombinationInvoked(e){this.telemetryService.publicLog2("mergeEditor.action.smartCombination",{otherAccepted:e})}reportRemoveInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.remove",{otherAccepted:t,isInput1:e===1})}reportResetToBaseInvoked(){this.telemetryService.publicLog2("mergeEditor.action.resetToBase",{})}reportNavigationToNextConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToNextConflict",{})}reportNavigationToPreviousConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToPreviousConflict",{})}reportConflictCounterClicked(){this.telemetryService.publicLog2("mergeEditor.action.conflictCounterClicked",{})}};AEe=D([_(0,Yi)],AEe);var PV,QR;let EEe=(QR=class extends lb{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(n,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=n,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{G_(()=>p.every(v=>v.editor instanceof PV));const m=p.map(v=>v.editor._inputModel).filter(Fc);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?wEe:CEe,this._instaService.createInstance(AEe))}dispose(){super.dispose()}get typeId(){return PV.ID}get editorId(){return rm.id}get capabilities(){let e=super.capabilities|Ei.MultipleEditors;return this.useWorkingCopy&&(e|=Ei.Untitled),e}getName(){return g(7873,"Merging: {0}",super.getName())}async resolve(){if(!this._inputModel){const e=this._register(await this.mergeEditorModeFactory.createInputModel({base:this.base,input1:this.input1,input2:this.input2,result:this.result}));this._inputModel=e,this._register(ai(t=>{e.isDirty.read(t),this._onDidChangeDirty.fire()})),await this._inputModel.model.onInitialized}return this._inputModel}async accept(){await this._inputModel?.accept()}async save(e,t){await this._inputModel?.save(t)}toUntyped(){return{input1:{resource:this.input1.uri,label:this.input1.title,description:this.input1.description,detail:this.input1.detail},input2:{resource:this.input2.uri,label:this.input2.title,description:this.input2.description,detail:this.input2.detail},base:{resource:this.base},result:{resource:this.result},options:{override:this.typeId}}}matches(e){return this===e?!0:e instanceof PV?ji(this.base,e.base)&&ji(this.input1.uri,e.input1.uri)&&ji(this.input2.uri,e.input2.uri)&&ji(this.result,e.result):wb(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&ji(this.base,e.base.resource)&&ji(this.input1.uri,e.input1.resource)&&ji(this.input2.uri,e.input2.resource)&&ji(this.result,e.result.resource):!1}async revert(e,t){return this._inputModel?.revert(t)}isDirty(){return this._inputModel?.isDirty.get()??!1}setLanguageId(e,t){this._inputModel?.model.setLanguageId(e,t)}},PV=QR,QR.ID="mergeEditor.Input",QR);EEe=PV=D([_(4,we),_(5,ei),_(6,Fo),_(7,Fs),_(8,Jt),_(9,Te),_(10,_d),_(11,Ec),_(12,nE)],EEe);const Bqt=oi("multi-diff-editor-label-icon",ve.diffMultiple,g(10264,"Icon of the multi diff editor label."));class Bze{constructor(e,t,i){if(this.originalUri=e,this.modifiedUri=t,this.goToFileUri=i,!e&&!t)throw new Ni("Invalid arguments")}getKey(){return JSON.stringify([this.modifiedUri?.toString(),this.originalUri?.toString()])}}const Wqt=Qe.as(Nn.Configuration),Hqt={...V6,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(5659,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};Wqt.registerConfiguration(Hqt);var f$;(function(s){s.builtin="builtin",s.option="option",s.exclusive="exclusive",s.default="default"})(f$||(f$={}));var az;(function(s){s[s.ABORT=1]="ABORT",s[s.NONE=2]="NONE"})(az||(az={}));function Uqt(s,e){if(new Set([pe.extension,pe.webviewPanel,pe.vscodeWorkspaceTrust,pe.vscodeSettings]).has(e.scheme))return!1;const n=typeof s=="string"&&s.indexOf(Vi.sep)>=0?`${e.scheme}:${e.path}`:_i(e);return zO(typeof s=="string"?s.toLowerCase():s,n.toLowerCase())}var GP,jR;let rB=(jR=class extends Ob{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new Ni("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??N.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(GP,i,e.label,e.resources?.map(n=>new Bze(n.original.resource,n.modified.resource,n.goToFileResource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(GP,N.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new Bze(i.originalUri?N.parse(i.originalUri):void 0,i.modifiedUri?N.parse(i.modifiedUri):void 0,i.goToFileUri?N.parse(i.goToFileUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Ei.Readonly}get typeId(){return GP.ID}getName(){return this._name}get editorId(){return rm.id}getIcon(){return Bqt}constructor(e,t,i,n=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=n,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new Nlt(async()=>{const d=await this._createModel();this._register(d);const h=new $Ye(d,this._instantiationService);return this._register(h),await IGe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new CIt(async()=>{const d=this.initialResources?{resources:H6e.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?Ije(this,d.resources):nd([])}}),this.resources=Ze(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=YY(this,this.resources.map(d=>d??[]),d=>{const h=d.modifiedUri?Wze(this._textFileService,d.modifiedUri):nd(!1),u=d.originalUri?Wze(this._textFileService,d.originalUri):nd(!1);return Ze(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Ze(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=M.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return Gh.DONT_SAVE},showConfirm(){return!1}},this._register(ai(d=>{const h=this.resources.read(d),u=this.label??g(6140,"Multi Diff Editor");h?this._name=u+g(6141," ({0} files)",h.length):this._name=u,this._onDidChangeLabel.fire()}))}serialize(){return{label:this.label,multiDiffSourceUri:this.multiDiffSource.toString(),resources:this.initialResources?.map(e=>({originalUri:e.originalUri?.toString(),modifiedUri:e.modifiedUri?.toString(),goToFileUri:e.goToFileUri?.toString()}))}}setLanguageId(e,t){const n=this._viewModel.requireValue().activeDiffItem.get()?.documentDiffItem;if(!n)return;const o=n.modified??n.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=YY(this,e.resources,async(c,l)=>{let d,h;const u=new Z;try{[d,h]=await Promise.all([c.originalUri?this._textModelService.createModelReference(c.originalUri):void 0,c.modifiedUri?this._textModelService.createModelReference(c.modifiedUri):void 0]),d&&u.add(d),h&&u.add(h)}catch(m){console.error(m),vt(m);return}const f=c.modifiedUri??c.originalUri,p={multiDiffEditorItem:c,original:d?.object.textEditorModel,modified:h?.object.textEditorModel,get options(){return{...Vqt(h?.object.isReadonly()??!0),...zqt(t.getValue(f))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(f,"editor")||v.affectsConfiguration(f,"diffEditor"))&&m()})};return l.add(aW.createOfNonDisposable(p,u,this))},c=>JSON.stringify([c.modifiedUri?.toString(),c.originalUri?.toString()])),n=jt("documents",[]),o=Ze(async c=>{const l=i.read(c),h=(await Promise.all(l)).filter(Fc);n.set(h,void 0)}),r=FN(o);return await o.get(),{dispose:()=>r.dispose(),documents:new $Le(n),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof GP?this.multiDiffSource.toString()===e.multiDiffSource.toString():!1}isDirty(){return this._isDirtyObservable.get()}async save(e,t){return await this.doSaveOrRevert("save",e,t),this}revert(e,t){return this.doSaveOrRevert("revert",e,t)}async doSaveOrRevert(e,t,i){const n=this._viewModel.currentValue?.items.get();n&&await Promise.all(n.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==pe.untitled&&this._textFileService.isDirty(r.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(r.original.uri,i):this._textFileService.revert(r.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(r.modified.uri,i):this._textFileService.revert(r.modified.uri,i)])}))}},GP=jR,jR.ID="workbench.input.multiDiffEditor",jR);rB=GP=D([_(4,fn),_(5,Ec),_(6,we),_(7,NJe),_(8,Fo)],rB);function Wze(s,e){return Kn(M.filter(s.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>s.isDirty(e))}function Vqt(s){return{readOnly:!!s,readOnlyMessage:typeof s!="boolean"?s:void 0}}function zqt(s){const e=xs(s.editor);if(kn(s.diffEditor)){const t=xs(s.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var QB;let Hze=(QB=class extends V{constructor(e,t){super(),this._register(e.registerEditor("*",{id:rm.id,label:rm.displayName,detail:rm.providerDisplayName,priority:f$.builtin},{},{createMultiDiffEditorInput:i=>({editor:rB.fromResourceMultiDiffEditorInput(i,t)})}))}},QB.ID="workbench.contrib.multiDiffEditorResolver",QB);Hze=D([_(0,BU),_(1,we)],Hze);var Uze;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down"})(Uze||(Uze={}));var Vze;(function(s){s[s.Connecting=0]="Connecting",s[s.Connected=1]="Connected"})(Vze||(Vze={}));const zze="terminalEditor";var $ze;(function(s){s[s.SearchHighlightLimit=1e3]="SearchHighlightLimit"})($ze||($ze={}));var Gze;(function(s){s[s.Unknown=1]="Unknown",s[s.Fedora=2]="Fedora",s[s.Ubuntu=3]="Ubuntu"})(Gze||(Gze={}));var Kze;(function(s){s.Terminals="Terminals"})(Kze||(Kze={}));W("terminal.background",null,g(9046,"The background color of the terminal, this allows coloring the terminal differently to the panel."));W("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(9047,"The foreground color of the terminal."));W("terminalCursor.foreground",null,g(9048,"The foreground color of the terminal cursor."));W("terminalCursor.background",null,g(9049,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const PK=W("terminal.selectionBackground",AS,g(9050,"The selection background color of the terminal."));W("terminal.inactiveSelectionBackground",{light:st(PK,.5),dark:st(PK,.5),hcDark:st(PK,.7),hcLight:st(PK,.5)},g(9051,"The selection background color of the terminal when it does not have focus."));W("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(9052,"The selection foreground color of the terminal. When this is null the selection foreground will be retained and have the minimum contrast ratio feature applied."));W("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(9053,"The default terminal command decoration background color."));W("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(9054,"The terminal command decoration background color for successful commands."));W("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(9055,"The terminal command decoration background color for error commands."));W("terminalOverviewRuler.cursorForeground","#A0A0A0CC",g(9056,"The overview ruler cursor color."));W("terminal.border",KRe,g(9057,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));W("terminalOverviewRuler.border",kqe,g(9058,"The overview ruler left-side border color."));W("terminal.findMatchBackground",{dark:zOe,light:zOe,hcDark:null,hcLight:"#0F4A85"},g(9059,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.hoverHighlightBackground",st(gft,.5),g(9060,"Border color of the other search matches in the terminal."));W("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9061,"Border color of the current search match in the terminal."));W("terminal.findMatchHighlightBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(9062,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9060,"Border color of the other search matches in the terminal."));W("terminalOverviewRuler.findMatchForeground",{dark:s5,light:s5,hcDark:"#f38518",hcLight:"#0F4A85"},g(9063,"Overview ruler marker color for find matches in the terminal."));W("terminal.dropBackground",GRe,g(9064,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);W("terminal.tab.activeBorder",Ive,g(9065,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));W("terminal.initialHintForeground",{dark:"#ffffff56",light:"#0007",hcDark:null,hcLight:null},g(9066,"Foreground color of the terminal initial hint."));function $qt(s){let e;if(typeof s=="string"?e=s:s.color?e=s.color.replace(/\./g,"_"):We.isThemeIcon(s.icon)&&s.icon.color&&(e=s.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function Gqt(s,e,t){const i=s.icon;if(!i)return;const n=[];let o;if(i instanceof N?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===Jg.LIGHT?i.light:i.dark),o instanceof N){const a=`terminal-uri-icon-${Wc(o.path).toString(36)}`;n.push(a),n.push("terminal-uri-icon")}return n}var xEe;(function(s){s.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",s.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",s.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",s.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",s.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})(xEe||(xEe={}));const Kqt=[xEe.FocusAccessibleBuffer];var _w;(function(s){s.FindFocus="workbench.action.terminal.focusFind",s.FindHide="workbench.action.terminal.hideFind",s.FindNext="workbench.action.terminal.findNext",s.FindPrevious="workbench.action.terminal.findPrevious",s.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",s.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",s.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",s.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(_w||(_w={}));const qqt=[_w.FindFocus,_w.FindHide,_w.FindNext,_w.FindPrevious,_w.ToggleFindRegex,_w.ToggleFindWholeWord,_w.ToggleFindCaseSensitive,_w.SearchWorkspace];var vw;(function(s){s.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",s.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",s.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",s.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",s.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",s.AcceptSelectedSuggestionEnter="workbench.action.terminal.acceptSelectedSuggestionEnter",s.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget",s.ClearSuggestCache="workbench.action.terminal.clearSuggestCache"})(vw||(vw={}));const Qqt=[vw.SelectPrevSuggestion,vw.SelectPrevPageSuggestion,vw.SelectNextSuggestion,vw.SelectNextPageSuggestion,vw.AcceptSelectedSuggestion,vw.AcceptSelectedSuggestionEnter,vw.HideSuggestWidget,vw.ClearSuggestCache],jqt="terminal";var qze;(function(s){s[s.Uninitialized=1]="Uninitialized",s[s.Launching=2]="Launching",s[s.Running=3]="Running",s[s.KilledDuringLaunch=4]="KilledDuringLaunch",s[s.KilledByUser=5]="KilledByUser",s[s.KilledByProcess=6]="KilledByProcess"})(qze||(qze={}));var mn;(function(s){s.Toggle="workbench.action.terminal.toggleTerminal",s.Kill="workbench.action.terminal.kill",s.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",s.KillEditor="workbench.action.terminal.killEditor",s.KillActiveTab="workbench.action.terminal.killActiveTab",s.KillAll="workbench.action.terminal.killAll",s.QuickKill="workbench.action.terminal.quickKill",s.ConfigureTerminalSettings="workbench.action.terminal.openSettings",s.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",s.RunRecentCommand="workbench.action.terminal.runRecentCommand",s.CopyLastCommand="workbench.action.terminal.copyLastCommand",s.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",s.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",s.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",s.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",s.CopySelection="workbench.action.terminal.copySelection",s.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",s.SelectAll="workbench.action.terminal.selectAll",s.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",s.DeleteWordRight="workbench.action.terminal.deleteWordRight",s.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",s.MoveToLineStart="workbench.action.terminal.moveToLineStart",s.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",s.New="workbench.action.terminal.new",s.NewWithCwd="workbench.action.terminal.newWithCwd",s.NewLocal="workbench.action.terminal.newLocal",s.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",s.NewWithProfile="workbench.action.terminal.newWithProfile",s.Split="workbench.action.terminal.split",s.SplitActiveTab="workbench.action.terminal.splitActiveTab",s.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",s.Unsplit="workbench.action.terminal.unsplit",s.JoinActiveTab="workbench.action.terminal.joinActiveTab",s.Join="workbench.action.terminal.join",s.Relaunch="workbench.action.terminal.relaunch",s.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",s.CreateTerminalEditor="workbench.action.createTerminalEditor",s.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",s.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",s.FocusTabs="workbench.action.terminal.focusTabs",s.FocusNextPane="workbench.action.terminal.focusNextPane",s.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",s.ResizePaneRight="workbench.action.terminal.resizePaneRight",s.ResizePaneUp="workbench.action.terminal.resizePaneUp",s.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",s.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",s.ResizePaneDown="workbench.action.terminal.resizePaneDown",s.Focus="workbench.action.terminal.focus",s.FocusNext="workbench.action.terminal.focusNext",s.FocusPrevious="workbench.action.terminal.focusPrevious",s.Paste="workbench.action.terminal.paste",s.PasteSelection="workbench.action.terminal.pasteSelection",s.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",s.RunSelectedText="workbench.action.terminal.runSelectedText",s.RunActiveFile="workbench.action.terminal.runActiveFile",s.SwitchTerminal="workbench.action.terminal.switchTerminal",s.ScrollDownLine="workbench.action.terminal.scrollDown",s.ScrollDownPage="workbench.action.terminal.scrollDownPage",s.ScrollToBottom="workbench.action.terminal.scrollToBottom",s.ScrollUpLine="workbench.action.terminal.scrollUp",s.ScrollUpPage="workbench.action.terminal.scrollUpPage",s.ScrollToTop="workbench.action.terminal.scrollToTop",s.Clear="workbench.action.terminal.clear",s.ClearSelection="workbench.action.terminal.clearSelection",s.ChangeIcon="workbench.action.terminal.changeIcon",s.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",s.ChangeColor="workbench.action.terminal.changeColor",s.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",s.Rename="workbench.action.terminal.rename",s.RenameActiveTab="workbench.action.terminal.renameActiveTab",s.RenameWithArgs="workbench.action.terminal.renameWithArg",s.QuickOpenTerm="workbench.action.quickOpenTerm",s.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",s.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",s.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",s.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",s.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",s.SelectToNextLine="workbench.action.terminal.selectToNextLine",s.SendSequence="workbench.action.terminal.sendSequence",s.AttachToSession="workbench.action.terminal.attachToSession",s.DetachSession="workbench.action.terminal.detachSession",s.MoveToEditor="workbench.action.terminal.moveToEditor",s.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",s.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",s.SetDimensions="workbench.action.terminal.setDimensions",s.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",s.FocusHover="workbench.action.terminal.focusHover",s.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",s.StartVoice="workbench.action.terminal.startVoice",s.StopVoice="workbench.action.terminal.stopVoice"})(mn||(mn={}));[mn.ClearSelection,mn.Clear,mn.CopyAndClearSelection,mn.CopySelection,mn.CopySelectionAsHtml,mn.CopyLastCommand,mn.CopyLastCommandOutput,mn.CopyLastCommandAndLastCommandOutput,mn.DeleteToLineStart,mn.DeleteWordLeft,mn.DeleteWordRight,mn.GoToRecentDirectory,mn.FocusNextPane,mn.FocusNext,mn.FocusPreviousPane,mn.FocusPrevious,mn.Focus,mn.SizeToContentWidth,mn.Kill,mn.KillEditor,mn.MoveToEditor,mn.MoveToLineEnd,mn.MoveToLineStart,mn.MoveToTerminalPanel,mn.NewInActiveWorkspace,mn.New,mn.Paste,mn.PasteSelection,mn.ResizePaneDown,mn.ResizePaneLeft,mn.ResizePaneRight,mn.ResizePaneUp,mn.RunActiveFile,mn.RunSelectedText,mn.RunRecentCommand,mn.ScrollDownLine,mn.ScrollDownPage,mn.ScrollToBottom,mn.ScrollToNextCommand,mn.ScrollToPreviousCommand,mn.ScrollToTop,mn.ScrollUpLine,mn.ScrollUpPage,mn.SendSequence,mn.SelectAll,mn.SelectToNextCommand,mn.SelectToNextLine,mn.SelectToPreviousCommand,mn.SelectToPreviousLine,mn.SplitInActiveWorkspace,mn.Split,mn.Toggle,mn.FocusHover,Xd.OpenAccessibilityHelp,...Kqt,...qqt,...Qqt];g(8944,"Contributes terminal functionality."),g(8945,"Defines additional terminal profiles that the user can create."),g(8946,"The ID of the terminal profile provider."),g(8947,"Title for this terminal profile."),g(8948,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(8949,"Icon path when a light theme is used"),g(8950,"Icon path when a dark theme is used");var gr;(function(s){s.IsOpen="terminalIsOpen",s.Count="terminalCount",s.GroupCount="terminalGroupCount",s.TabsNarrow="isTerminalTabsNarrow",s.HasFixedWidth="terminalHasFixedWidth",s.ProcessSupported="terminalProcessSupported",s.Focus="terminalFocus",s.FocusInAny="terminalFocusInAny",s.AccessibleBufferFocus="terminalAccessibleBufferFocus",s.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",s.EditorFocus="terminalEditorFocus",s.TabsFocus="terminalTabsFocus",s.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",s.TerminalHasBeenCreated="terminalHasBeenCreated",s.TerminalEditorActive="terminalEditorActive",s.TabsMouse="terminalTabsMouse",s.AltBufferActive="terminalAltBufferActive",s.SuggestWidgetVisible="terminalSuggestWidgetVisible",s.A11yTreeFocus="terminalA11yTreeFocus",s.ViewShowing="terminalViewShowing",s.TextSelected="terminalTextSelected",s.TextSelectedInFocused="terminalTextSelectedInFocused",s.FindVisible="terminalFindVisible",s.FindInputFocused="terminalFindInputFocused",s.FindFocused="terminalFindFocused",s.TabsSingularSelection="terminalTabsSingularSelection",s.SplitTerminal="terminalSplitTerminal",s.ShellType="terminalShellType",s.InTerminalRunCommandPicker="inTerminalRunCommandPicker",s.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(gr||(gr={}));var DEe;(function(s){s.isOpen=new Q(gr.IsOpen,!1,!0),s.focus=new Q(gr.Focus,!1,g(8951,"Whether the terminal is focused.")),s.focusInAny=new Q(gr.FocusInAny,!1,g(8952,"Whether any terminal is focused, including detached terminals used in other UI.")),s.editorFocus=new Q(gr.EditorFocus,!1,g(8953,"Whether a terminal in the editor area is focused.")),s.count=new Q(gr.Count,0,g(8954,"The current number of terminals.")),s.groupCount=new Q(gr.GroupCount,0,!0),s.tabsNarrow=new Q(gr.TabsNarrow,!1,!0),s.terminalHasFixedWidth=new Q(gr.HasFixedWidth,!1,!0),s.tabsFocus=new Q(gr.TabsFocus,!1,g(8955,"Whether the terminal tabs widget is focused.")),s.webExtensionContributedProfile=new Q(gr.WebExtensionContributedProfile,!1,!0),s.terminalHasBeenCreated=new Q(gr.TerminalHasBeenCreated,!1,!0),s.terminalEditorActive=new Q(gr.TerminalEditorActive,!1,!0),s.tabsMouse=new Q(gr.TabsMouse,!1,!0),s.shellType=new Q(gr.ShellType,void 0,{type:"string",description:g(8956,"The shell type of the active terminal, this is set if the type can be detected.")}),s.altBufferActive=new Q(gr.AltBufferActive,!1,g(8957,"Whether the terminal's alt buffer is active.")),s.suggestWidgetVisible=new Q(gr.SuggestWidgetVisible,!1,g(8958,"Whether the terminal's suggest widget is visible.")),s.notFocus=s.focus.toNegated(),s.viewShowing=new Q(gr.ViewShowing,!1,g(8959,"Whether the terminal view is showing")),s.textSelected=new Q(gr.TextSelected,!1,g(8960,"Whether text is selected in the active terminal.")),s.textSelectedInFocused=new Q(gr.TextSelectedInFocused,!1,g(8961,"Whether text is selected in a focused terminal.")),s.notTextSelected=s.textSelected.toNegated(),s.findVisible=new Q(gr.FindVisible,!1,!0),s.notFindVisible=s.findVisible.toNegated(),s.findInputFocus=new Q(gr.FindInputFocused,!1,!0),s.findFocus=new Q(gr.FindFocused,!1,!0),s.notFindFocus=s.findInputFocus.toNegated(),s.processSupported=new Q(gr.ProcessSupported,!1,g(8962,"Whether terminal processes can be launched in the current workspace.")),s.tabsSingularSelection=new Q(gr.TabsSingularSelection,!1,g(8963,"Whether one terminal is selected in the terminal tabs list.")),s.splitTerminal=new Q(gr.SplitTerminal,!1,g(8964,"Whether the focused tab's terminal is a split terminal.")),s.inTerminalRunCommandPicker=new Q(gr.InTerminalRunCommandPicker,!1,g(8965,"Whether the terminal run command picker is currently open.")),s.terminalShellIntegrationEnabled=new Q(gr.TerminalShellIntegrationEnabled,!1,g(8966,"Whether shell integration is enabled in the active terminal")),s.shouldShowViewInlineActions=he.and(he.equals("view",jqt),he.notEquals(`config.${Ww.TabsHideCondition}`,"never"),he.or(he.not(`config.${Ww.TabsEnabled}`),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleTerminal"),he.equals(gr.GroupCount,1)),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleTerminalOrNarrow"),he.or(he.equals(gr.GroupCount,1),he.has(gr.TabsNarrow))),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleGroup"),he.equals(gr.GroupCount,1)),he.equals(`config.${Ww.TabsShowActions}`,"always")))})(DEe||(DEe={}));var sj,YR;let kEe=(YR=class extends Ob{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return sj.ID}get editorId(){return zze}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor|Ei.ForceDescription}setTerminalInstance(e){if(this._terminalInstance)throw new Error("cannot set instance that has already been set");this._terminalInstance=e,this._setupInstanceListeners()}copy(){const e=this._terminalInstanceService.createInstance(this._copyLaunchConfig||{},fW.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(sj,e.resource,e)}setCopyLaunchConfig(e){this._copyLaunchConfig=e}get terminalInstance(){return this._isDetached?void 0:this._terminalInstance}showConfirm(){if(this._isReverted)return!1;const e=this._configurationService.getValue(Ww.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:Xe.Warning,message:g(8929,"Do you want to terminate running processes?"),primaryButton:g(8930,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` `)+` -`+g(sY,2,"Closing will terminate the running processes in the terminals."):g(sY,3,"Closing will terminate the running processes in this terminal.")});return t?Ku.DONT_SAVE:Ku.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,s,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=s,this._instantiationService=o,this._configurationService=r,this._lifecycleService=a,this._contextKeyService=c,this._dialogService=l,this.closeHandler=this,this._isDetached=!1,this._isShuttingDown=!1,this._isReverted=!1,this._onDidRequestAttach=this._register(new I),this.onDidRequestAttach=this._onDidRequestAttach.event,this._terminalEditorFocusContextKey=Gke.editorFocus.bindTo(c),t&&this._setupInstanceListeners()}_setupInstanceListeners(){const e=this._terminalInstance;if(!e)return;const t=e.onDidFocus(()=>this._terminalEditorFocusContextKey.set(!0)),i=e.onDidBlur(()=>this._terminalEditorFocusContextKey.reset());this._register(Ee(()=>{!this._isDetached&&!this._isShuttingDown&&e.dispose(vM.User),St([t,i])}));const s=[e.onExit(o=>{e.waitOnExit||this.dispose()}),e.onDisposed(()=>this.dispose()),e.onTitleChanged(()=>this._onDidChangeLabel.fire()),e.onIconChanged(()=>this._onDidChangeLabel.fire()),t,i,e.statusList.onDidChangePrimaryStatus(()=>this._onDidChangeLabel.fire())];this._lifecycleService.onWillShutdown(o=>{this._isShuttingDown=!0,St(s),this._configurationService.getValue(_y.EnablePersistentSessions)&&o.reason===PI.RELOAD?e.detachProcessAndDispose(vM.Shutdown):e.dispose(vM.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!$e.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=Vjt(this._terminalInstance);t&&e.push(t);const i=zjt(this._terminalInstance,this._themeService.getColorTheme().type);return i&&e.push(...i),e}detachInstance(){this._isShuttingDown||(this._terminalInstance?.detachFromElement(),this._terminalInstance?.setParentContextKeyService(this._contextKeyService),this._isDetached=!0)}getDescription(){return this._terminalInstance?.description}toUntyped(){return{resource:this.resource,options:{override:d8e,pinned:!0,forceReload:!0}}}},TX=UP,UP.ID="workbench.editors.terminal",UP);qke=TX=D([_(2,pn),_(3,eet),_(4,be),_(5,Re),_(6,mg),_(7,Pe),_(8,To)],qke);let p8e=class{constructor(e,t,i,s,o){this._editorGroupsService=t,this._configurationService=i,this._logService=s,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new Zo,this._proxy=e.getProxy(et.ExtHostEditorTabs),this._dispoables.add(o.onDidEditorsChange(r=>{try{this._updateTabsModel(r)}catch{this._logService.error("Failed to update model, rebuilding"),this._createTabsModel()}})),this._dispoables.add(this._multiDiffEditorInputListeners),this._dispoables.add(this._editorGroupsService.onDidAddGroup(()=>this._createTabsModel())),this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(()=>this._createTabsModel())),this._editorGroupsService.whenReady.then(()=>this._createTabsModel())}dispose(){this._groupLookup.clear(),this._tabInfoLookup.clear(),this._dispoables.dispose()}_buildTabObject(e,t,i){const s=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:s,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof zke)return{kind:Oa.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof Ib)return{kind:Oa.TextInput,uri:e.resource};if(e instanceof _m&&!(e instanceof op)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof Ib&&e.secondary instanceof Ib&&_n(t,i)&&t&&i?{kind:Oa.TextInput,uri:t}:{kind:Oa.UnknownInput}}if(e instanceof VM)return{kind:Oa.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof nH)return{kind:Oa.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Qg)return{kind:Oa.WebviewEditorInput,viewType:e.viewType};if(e instanceof qke)return{kind:Oa.TerminalEditorInput};if(e instanceof op){if(e.modified instanceof Ib&&e.original instanceof Ib)return{kind:Oa.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof VM&&e.original instanceof VM)return{kind:Oa.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof Pke)return{kind:Oa.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof gEe)return{kind:Oa.ChatEditorInput};if(e instanceof sH){const t=[];for(const i of e?.resources.get()??[])i.original&&i.modified&&t.push({kind:Oa.TextDiffInput,original:i.original,modified:i.modified});return{kind:Oa.MultiDiffEditorInput,diffEditors:t}}return{kind:Oa.UnknownInput}}_generateTabId(e,t){let i;const s=jc.getCanonicalUri(e,{supportSideBySide:go.BOTH});return s instanceof P?i=s.toString():i=`${s?.primary?.toString()}-${s?.secondary?.toString()}`,`${t}~${e.editorId}-${e.typeId}-${i} `}_onDidGroupActivate(){const e=this._editorGroupsService.activeGroup.id,t=this._groupLookup.get(e);t&&(t.isActive=!0,this._proxy.$acceptTabGroupUpdate(t))}_onDidTabLabelChange(e,t,i){const s=this._generateTabId(t,e),o=this._tabInfoLookup.get(s);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:gu.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const s=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!s||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(s,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:s,editorInput:t,tab:a}),t instanceof sH&&this._multiDiffEditorInputListeners.set(t,T.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(s,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:gu.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:gu.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),s=this._groupLookup.get(e)?.tabs;if(!i||!s){this._createTabsModel();return}const o=s.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof sH&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:gu.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const s=i[t];s.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:s,kind:gu.TAB_UPDATE})}_onDidTabDirty(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s);if(!o){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}o.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o.tab,kind:gu.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=r.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:gu.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!r.isPinned(t),this._proxy.$acceptTabOperation({kind:gu.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,s){const o=this._groupLookup.get(e)?.tabs;if(!o){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const r=o.splice(i,1);r.length!==0&&(o.splice(t,0,r[0]),this._proxy.$acceptTabOperation({kind:gu.TAB_MOVE,groupId:e,tabDto:r[0],index:t,oldIndex:i}))}_createTabsModel(){if(this._editorGroupsService.groups.length===0)return;this._tabGroupModel=[],this._groupLookup.clear(),this._tabInfoLookup.clear();let e=[];for(const t of this._editorGroupsService.groups){const i={groupId:t.id,isActive:t.id===this._editorGroupsService.activeGroup.id,viewColumn:U1(this._editorGroupsService,t),tabs:[]};t.editors.forEach((s,o)=>{const r=this._buildTabObject(t,s,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(s,t.id),{group:t,tab:r,editorInput:s})}),i.tabs=e,this._tabGroupModel.push(i),this._groupLookup.set(t.id,i),e=[]}this._proxy.$acceptEditorTabModel(this._tabGroupModel)}_updateTabsModel(e){const t=e.event,i=e.groupId;switch(t.kind){case qo.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case qo.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case qo.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case qo.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case qo.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case qo.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case qo.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_TRANSIENT:break;case qo.EDITOR_MOVE:if(pjt(t)&&t.editor&&t.editorIndex!==void 0&&t.oldEditorIndex!==void 0){this._onDidTabMove(i,t.editorIndex,t.oldEditorIndex,t.editor);break}default:this._createTabsModel()}}$moveTab(e,t,i,s){const o=ane(this._editorGroupsService,this._configurationService,i),r=this._tabInfoLookup.get(e);if(!r?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(r.group.id);if(!l)return;if(this._groupLookup.get(o)===void 0){let h=v6.RIGHT;i===Cw&&(h=w6(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(o);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=r?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:s})}async $closeTab(e,t){const i=new Map;for(const o of e){const r=this._tabInfoLookup.get(o),a=r?.tab,c=r?.group,l=r?.editorInput;if(!c||!a||!r||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const s=[];for(const[o,r]of i)s.push(await o.closeEditors(r,{preserveFocus:t}));return s.every(o=>o)}async $closeGroup(e,t){const i=[];for(const s of e){const o=this._editorGroupsService.getGroup(s);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(s=>s)}};p8e=D([en(Ue.MainThreadEditorTabs),_(1,ur),_(2,Re),_(3,Ze),_(4,_i)],p8e);let m8e=class{dispose(){}$onUnexpectedError(e){if(e&&e.$isError){const{name:t,message:i,stack:s}=e;e=e.noTelemetry?new uc:new Error,e.message=i,e.name=t,e.stack=s}bt(e)}};m8e=D([en(Ue.MainThreadErrors)],m8e);const Uw="vs/workbench/api/browser/mainThreadExtensionService";let _8e=class{constructor(e,t,i,s,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=s,this._hostService=o,this._extensionEnablementService=r,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new jjt(e.getProxy(et.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Ue).map(h=>Ue[h]))}dispose(){}$getExtension(e){return this._extensionService.getExtension(e)}$activateExtension(e,t){return this._internalExtensionService._activateById(e,t)}async $onWillActivateExtension(e){this._internalExtensionService._onWillActivateExtension(e)}$onDidActivateExtension(e,t,i,s,o){this._internalExtensionService._onDidActivateExtension(e,t,i,s,o)}$onExtensionRuntimeError(e,t){const i=new Error;i.name=t.name,i.message=t.message,i.stack=t.stack,this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const s=new Error;if(s.name=t.name,s.message=t.message,s.stack=t.stack,this._internalExtensionService._onDidActivateExtensionError(e,s),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>gc(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(r,c.local);return}else{await this._handleMissingNotInstalledDependency(r,i.dependency);return}}}if(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment){this._notificationService.error(s);return}console.error(s.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:nt.Error,message:g(Uw,0,"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("reload",g(Uw,1,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const s=this._extensionEnablementService.getEnablementState(t);s===ga.DisabledByVirtualWorkspace?this._notificationService.notify({severity:nt.Error,message:g(Uw,2,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",i,t.manifest.displayName||t.manifest.name)}):s===ga.DisabledByTrustRequirement?this._notificationService.notify({severity:nt.Error,message:g(Uw,3,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("manageWorkspaceTrust",g(Uw,4,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:nt.Error,message:g(Uw,5,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("enable",g(Uw,6,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],s===ga.DisabledGlobally?ga.EnabledGlobally:ga.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:nt.Error,message:g(Uw,7,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",i,t.manifest.displayName||t.manifest.name)})}}async _handleMissingNotInstalledDependency(e,t){const i=e.displayName||e.name;let s=null;try{s=(await this._extensionsWorkbenchService.getExtensions([{id:t}],qe.None))[0]}catch{}s?this._notificationService.notify({severity:nt.Error,message:g(Uw,8,"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",i,s.displayName,s.publisherDisplayName),actions:{primary:[new xn("install",g(Uw,9,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(s).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(Uw,10,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===Ao.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===Ao.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return lp.uriToBrowserUri(P.revive(e))}async $getAllStaticBrowserUris(){return Array.from(lp.getRegisteredBrowserUris(),e=>[e,lp.uriToBrowserUri(e)])}};_8e=D([en(Ue.MainThreadExtensionService),_(1,ho),_(2,Pi),_(3,pr),_(4,Id),_(5,Kh),_(6,Det),_(7,ji),_(8,ec)],_8e);class jjt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Kjt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&P.revive(i)}startExtensionHost(e){return this._actual.$startExtensionHost(e)}extensionTestsExecute(){return this._actual.$extensionTestsExecute()}activateByEvent(e,t){return this._actual.$activateByEvent(e,t)}activate(e,t){return this._actual.$activate(e,t)}setRemoteEnvironment(e){return this._actual.$setRemoteEnvironment(e)}updateRemoteConnectionData(e){return this._actual.$updateRemoteConnectionData(e)}deltaExtensions(e){return this._actual.$deltaExtensions(e)}test_latency(e){return this._actual.$test_latency(e)}test_up(e){return this._actual.$test_up(e)}test_down(e){return this._actual.$test_down(e)}}function Kjt(n){return n.type==="ok"?{type:"ok",value:{...n.value,authority:Yjt(n.value.authority)}}:n}function Yjt(n){return{...n,connectTo:Jjt(n.connectTo)}}function Jjt(n){return n.type===KV.WebSocket?new Vst(n.host,n.port):new Ust(n.id)}var Z_;let v8e=Z_=class{constructor(e,t){this._fileService=t,this._fileProvider=new Zo,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostFileSystem);const i=e.getProxy(et.ExtHostFileSystemInfo);for(const s of t.listCapabilities())i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,s){this._fileProvider.set(e,new kOe(this._fileService,t,i,s,e,this._proxy))}$unregisterProvider(e){this._fileProvider.deleteAndDispose(e)}$onFileSystemChange(e,t){const i=this._fileProvider.get(e);if(!i)throw new Error("Unknown file provider");i.$onFileSystemChange(t)}$stat(e){return this._fileService.stat(P.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?wm.Readonly:void 0,type:Z_._asFileType(t)})).catch(Z_._handleError)}$readdir(e){return this._fileService.resolve(P.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=rt.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Z_._asFileType(i)]):[]}).catch(Z_._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=an.File:e.isDirectory&&(t+=an.Directory),e.isSymbolicLink&&(t+=an.SymbolicLink),t}$readFile(e){return this._fileService.readFile(P.revive(e)).then(t=>t.value).catch(Z_._handleError)}$writeFile(e,t){return this._fileService.writeFile(P.revive(e),t).then(()=>{}).catch(Z_._handleError)}$rename(e,t,i){return this._fileService.move(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$copy(e,t,i){return this._fileService.copy(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$mkdir(e){return this._fileService.createFolder(P.revive(e)).then(()=>{}).catch(Z_._handleError)}$delete(e,t){return this._fileService.del(P.revive(e),t).catch(Z_._handleError)}static _handleError(e){if(e instanceof Ah)switch(e.fileOperationResult){case Zi.FILE_NOT_FOUND:e.name=rt.FileNotFound;break;case Zi.FILE_IS_DIRECTORY:e.name=rt.FileIsADirectory;break;case Zi.FILE_PERMISSION_DENIED:e.name=rt.NoPermissions;break;case Zi.FILE_MOVE_CONFLICT:e.name=rt.FileExists;break}else if(e instanceof Error){const t=w1(e);t!==rt.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};v8e=Z_=D([en(Ue.MainThreadFileSystem),_(1,ci)],v8e);class kOe{constructor(e,t,i,s,o,r){this.readOnlyMessage=s,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=T.None,this.capabilities=i,this._registration=e.registerProvider(t,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(e,t){const i=Math.random();return this._proxy.$watch(this._handle,i,e,t),Ee(()=>{this._proxy.$unwatch(this._handle,i)})}$onFileSystemChange(e){this._onDidChange.fire(e.map(kOe._createFileChange))}static _createFileChange(e){return{resource:P.revive(e.resource),type:e.type}}stat(e){return this._proxy.$stat(this._handle,e).then(void 0,t=>{throw t})}readFile(e){return this._proxy.$readFile(this._handle,e).then(t=>t.buffer)}writeFile(e,t,i){return this._proxy.$writeFile(this._handle,e,ze.wrap(t),i)}delete(e,t){return this._proxy.$delete(this._handle,e,t)}mkdir(e){return this._proxy.$mkdir(this._handle,e)}readdir(e){return this._proxy.$readdir(this._handle,e)}rename(e,t,i){return this._proxy.$rename(this._handle,e,t,i)}copy(e,t,i){return this._proxy.$copy(this._handle,e,t,i)}open(e,t){return this._proxy.$open(this._handle,e,t)}close(e){return this._proxy.$close(this._handle,e)}read(e,t,i,s,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,s),r.byteLength))}write(e,t,i,s,o){return this._proxy.$write(this._handle,e,t,ze.wrap(i).slice(s,s+o))}}const fW=class fW extends ${constructor(e,t,i,s){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=s,this.watcherDisposables=this._register(new Dn),this.requests=void 0,this.restartsPerRequestError=new Map,this.restartsPerUnknownError=0}init(){const e=new Z;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){if(this.options.restartOnError&&this.requests?.length)if(t){const i=this.restartsPerRequestError.get(t.path)??0;is.path!==t.path)))}else this.restartsPerUnknownError{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,w,b,C,y){if(b?.isUndoing)return;const S=new ai(y),M=setTimeout(()=>S.cancel(),C),k=await o.withProgress({location:ch.Notification,title:this._progressLabel(w),cancellable:!0,delay:Math.min(C/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(w,v,C,S.token);return dw(z,S.token)},()=>{S.cancel()}).finally(()=>{S.dispose(),clearTimeout(M)});if(!k||k.edit.edits.length===0)return;const F=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let N=a.getBoolean(RX.MementoKeyAdditionalEdits,ke.PROFILE);if(l.extensionTestsLocationURI&&(N=!1),N===void 0){let z;if(k.extensionNames.length===1?w===Li.CREATE?z=g(Rd,0,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):w===Li.COPY?z=g(Rd,1,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):w===Li.MOVE?z=g(Rd,2,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(Rd,3,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):w===Li.CREATE?z=g(Rd,4,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):w===Li.COPY?z=g(Rd,5,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):w===Li.MOVE?z=g(Rd,6,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(Rd,7,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),F){const{confirmed:U}=await r.confirm({type:nt.Info,message:z,primaryButton:g(Rd,8,"Show &&Preview"),cancelButton:g(Rd,9,"Skip Changes")});if(N=!0,!U)return}else{let U;(function(re){re[re.OK=0]="OK",re[re.Preview=1]="Preview",re[re.Cancel=2]="Cancel"})(U||(U={}));const{result:J,checkboxChecked:j}=await r.prompt({type:nt.Info,message:z,buttons:[{label:g(Rd,10,"&&OK"),run:()=>U.OK},{label:g(Rd,8,"Show &&Preview"),run:()=>U.Preview}],cancelButton:{label:g(Rd,9,"Skip Changes"),run:()=>U.Cancel},checkbox:{label:g(Rd,11,"Do not ask me again")}});if(J===U.Cancel)return;N=J===U.Preview,j&&a.store(RX.MementoKeyAdditionalEdits,N,ke.PROFILE,ln.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await s.apply(AS(k.edit,d),{undoRedoGroupId:b?.undoRedoGroupId,showPreview:N})}_progressLabel(v){switch(v){case Li.CREATE:return g(Rd,12,"Running 'File Create' participants...");case Li.MOVE:return g(Rd,13,"Running 'File Rename' participants...");case Li.COPY:return g(Rd,14,"Running 'File Copy' participants...");case Li.DELETE:return g(Rd,15,"Running 'File Delete' participants...");case Li.WRITE:return g(Rd,16,"Running 'File Write' participants...")}}};this._listener.add(i.addFileOperationParticipant(m)),this._listener.add(i.onDidRunWorkingCopyFileOperation(v=>this._proxy.$onDidRunFileOperation(v.operation,v.files)))}async $watch(e,t,i,s,o){const r=P.revive(i),a={...s};if(a.recursive)try{(await this._fileService.stat(r)).isDirectory||(a.recursive=!1)}catch{}if(o){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(r,a));c.add(l.onDidChange(d=>{this._proxy.$onFileEvent({session:t,created:d.rawAdded,changed:d.rawUpdated,deleted:d.rawDeleted})})),this._watches.set(t,c)}else{this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(r);if(a.recursive&&a.excludes.length===0){const d=this._configurationService.getValue();if(d.files?.watcherExclude)for(const h in d.files.watcherExclude)h&&d.files.watcherExclude[h]===!0&&a.excludes.push(h)}else if(!a.recursive&&c){const d=this._configurationService.getValue();if(d.files?.watcherExclude){for(const h in d.files.watcherExclude)if(h&&d.files.watcherExclude[h]===!0){a.includes||(a.includes=[]);const u=`${IS(h,"/")}/${mR}`;a.includes.push(Xjt(c.uri.fsPath,u))}}if(!a.includes||a.includes.length===0){this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(r,a);this._watches.set(t,l)}}$unwatch(e){this._watches.has(e)&&(this._logService.trace(`MainThreadFileSystemEventService#$unwatch(): request to stop watching (session: ${e})`),this._watches.deleteAndDispose(e))}dispose(){this._listener.dispose(),this._watches.dispose()}},RX=VP,VP.MementoKeyAdditionalEdits="file.particpants.additionalEdits",VP);Qke=RX=D([en(Ue.MainThreadFileSystemEventService),_(1,ci),_(2,fC),_(3,vO),_(4,Cf),_(5,To),_(6,on),_(7,Ze),_(8,Il),_(9,_o),_(10,Ti),_(11,Ze),_(12,Re)],Qke);At(class extends pi{constructor(){super({id:"files.participants.resetChoice",title:{value:g(Rd,17,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get(on).remove(Qke.MementoKeyAdditionalEdits,ke.PROFILE)}});const Bf=Symbol("unset");class qse{constructor(){this.root=new Xpe,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||fi.empty()}insert(e,t,i){this.opNode(e,s=>s._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===Bf?void 0:i._value))}mutatePath(e,t){this.opNode(e,()=>{},i=>t(i))}delete(e){const t=this.getPathToKey(e);if(!t)return;let i=t.length-1;const s=t[i].node._value;if(s!==Bf){for(this._size--,t[i].node._value=Bf;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==Bf)break;t[i-1].node.children.delete(r)}return s}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let s=t.length-1;s>0;s--){const o=t[s-1];if(o.node.children.delete(t[s].part),o.node.children.size>0||o.node._value!==Bf)break}for(const s of b8e(i))s._value!==Bf&&(this._size--,yield s._value)}find(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return;t=s}return t._value===Bf?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;if(s._value!==Bf)return!0;t=s}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return!0}hasKey(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return t._value!==Bf}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const s of e){const o=t[i].node.children?.get(s);if(!o)return;t.push({part:s,node:o}),i++}return t}opNode(e,t,i){let s=this.root;for(const a of e){if(s.children)if(s.children.has(a))s=s.children.get(a);else{const c=new Xpe;s.children.set(a,c),s=c}else{const c=new Xpe;s.children=new Map([[a,c]]),s=c}i?.(s)}const o=s._value===Bf?0:1;t(s);const r=s._value===Bf?0:1;this._size+=r-o}*values(){for(const{_value:e}of b8e(this.root))e!==Bf&&(yield e)}}function*b8e(n){const e=[n];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Xpe=class{constructor(){this._value=Bf}get value(){return this._value===Bf?void 0:this._value}set value(e){this._value=e===void 0?Bf:e}};var qf;(function(n){n.Delimiter="\0"})(qf||(qf={}));var lb;(function(n){n[n.IsSame=0]="IsSame",n[n.Disconnected=1]="Disconnected",n[n.IsChild=2]="IsChild",n[n.IsParent=3]="IsParent"})(lb||(lb={}));class bn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new bn([t]);const s=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)s.push(o.id);return s.push(t),new bn(s.reverse())}static isRoot(e){return!e.includes(qf.Delimiter)}static root(e){const t=e.indexOf(qf.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new bn(e.split(qf.Delimiter))}static join(e,t){return new bn([...e.path,t])}static joinToString(e,t){return e.toString()+qf.Delimiter+t}static parentId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?e:e.slice(t+qf.Delimiter.length)}static isChild(e,t){return t.startsWith(e)&&t[e.length]===qf.Delimiter}static compare(e,t){return e===t?lb.IsSame:bn.isChild(e,t)?lb.IsChild:bn.isChild(t,e)?lb.IsParent:lb.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new bn(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let e=1;e<=this.viewEnd;e++)yield new bn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new bn(this.path,e)}compare(e){if(typeof e=="string")return bn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?lb.IsChild:e.viewEnd"runId"in n;var A4;(function(n){n.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({range:O.lift(t.range),uri:e.asCanonicalUri(P.revive(t.uri))})})(A4||(A4={}));var dC;(function(n){n[n.Error=0]="Error",n[n.Output=1]="Output"})(dC||(dC={}));var Qse;(function(n){n.serialize=e=>({message:e.message,type:dC.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&A4.deserialize(e,t.location)})})(Qse||(Qse={}));const eKt=(n,e)=>`${e?"s":"e"}${n}`;var jse;(function(n){n.serialize=e=>({message:e.message,type:dC.Output,offset:e.offset,length:e.length,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Output,offset:t.offset,length:t.length,location:t.location&&A4.deserialize(e,t.location)})})(jse||(jse={}));var yG;(function(n){n.serialize=e=>e.type===dC.Error?Qse.serialize(e):jse.serialize(e),n.deserialize=(e,t)=>t.type===dC.Error?Qse.deserialize(e,t):jse.deserialize(e,t)})(yG||(yG={}));var b8;(function(n){n.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),n.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(yG.serialize)}),n.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>yG.deserialize(e,i))})})(b8||(b8={}));const irt="\0",MX=(n,e)=>n+irt+e,nrt=n=>{const e=n.indexOf(irt);return{ctrlId:n.slice(0,e),tagId:n.slice(e+1)}};var SG;(function(n){n.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),n.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(P.revive(t.uri)):void 0,range:t.range?O.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(SG||(SG={}));var Eh;(function(n){n[n.NotExpandable=0]="NotExpandable",n[n.Expandable=1]="Expandable",n[n.BusyExpanding=2]="BusyExpanding",n[n.Expanded=3]="Expanded"})(Eh||(Eh={}));var QI;(function(n){n.serialize=e=>({expand:e.expand,item:SG.serialize(e.item)}),n.deserialize=(e,t)=>({controllerId:bn.root(t.item.extId),expand:t.expand,item:SG.deserialize(e,t.item)})})(QI||(QI={}));var AG;(function(n){n.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},n.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?O.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(AG||(AG={}));const jke=(n,e)=>{e.expand!==void 0&&(n.expand=e.expand),e.item!==void 0&&(n.item=n.item?Object.assign(n.item,e.item):e.item)};var Kse;(function(n){n.serializeWithoutMessages=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serializeWithoutMessages)}),n.serialize=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serialize)}),n.deserialize=(e,t)=>({...QI.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>b8.deserialize(e,i)),retired:!0})})(Kse||(Kse={}));var Kke;(function(n){n.empty=()=>({covered:0,total:0}),n.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(Kke||(Kke={}));var Yse;(function(n){n.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testId:e.testId?.toString(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testId:t.testId?bn.fromString(t.testId):void 0,uri:e.asCanonicalUri(P.revive(t.uri))}),n.empty=(e,t)=>({id:e,uri:t,testId:void 0,statement:Kke.empty()})})(Yse||(Yse={}));function IOe(n){return{...n,location:n.location?.toJSON()}}function LOe(n){return n.location=n.location?oe.isIPosition(n.location)?oe.lift(n.location):O.lift(n.location):void 0,n}var E4;(function(n){n[n.Declaration=0]="Declaration",n[n.Statement=1]="Statement",n[n.Branch=2]="Branch"})(E4||(E4={}));var Yke;(function(n){n.serialize=e=>e.type===E4.Declaration?Xse.serialize(e):Zse.serialize(e),n.deserialize=e=>e.type===E4.Declaration?Xse.deserialize(e):Zse.deserialize(e)})(Yke||(Yke={}));var Jse;(function(n){n.serialize=IOe,n.deserialize=LOe})(Jse||(Jse={}));var Xse;(function(n){n.serialize=IOe,n.deserialize=LOe})(Xse||(Xse={}));var Zse;(function(n){n.serialize=e=>({...IOe(e),branches:e.branches?.map(Jse.serialize)}),n.deserialize=e=>({...LOe(e),branches:e.branches?.map(Jse.deserialize)})})(Zse||(Zse={}));var Ha;(function(n){n[n.Add=0]="Add",n[n.Update=1]="Update",n[n.DocumentSynced=2]="DocumentSynced",n[n.Remove=3]="Remove",n[n.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",n[n.Retire=5]="Retire",n[n.AddTag=6]="AddTag",n[n.RemoveTag=7]="RemoveTag"})(Ha||(Ha={}));var x4;(function(n){n.deserialize=(e,t)=>t.op===Ha.Add?{op:t.op,item:QI.deserialize(e,t.item)}:t.op===Ha.Update?{op:t.op,item:AG.deserialize(t.item)}:t.op===Ha.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(P.revive(t.uri)),docv:t.docv}:t,n.serialize=e=>e.op===Ha.Add?{op:e.op,item:QI.serialize(e.item)}:e.op===Ha.Update?{op:e.op,item:AG.serialize(e.item)}:e})(x4||(x4={}));class tKt{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){const t=this.createChangeCollector();for(const i of e)switch(i.op){case Ha.Add:this.add(QI.deserialize(this.uriIdentity,i.item),t);break;case Ha.Update:this.update(AG.deserialize(i.item),t);break;case Ha.Remove:this.remove(i.itemId,t);break;case Ha.Retire:this.retireTest(i.itemId);break;case Ha.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case Ha.AddTag:this._tags.set(i.tag.id,i.tag);break;case Ha.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=bn.parentId(e.item.extId)?.toString();let s;if(!i)s=this.createItem(e),this.roots.add(s),this.items.set(e.item.extId,s);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),s=this.createItem(e,o),this.items.set(e.item.extId,s)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(s),e.expand===Eh.BusyExpanding&&this.busyControllerCount++,s}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Eh.BusyExpanding&&this.busyControllerCount--,e.expand===Eh.BusyExpanding&&this.busyControllerCount++),jke(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const s=bn.parentId(i.item.extId)?.toString();s?this.items.get(s).children.delete(i.item.extId):this.roots.delete(i);const o=[[e]];for(;o.length;)for(const r of o.pop()){const a=this.items.get(r);a&&(o.push(a.children),this.items.delete(r),t.remove?.(a,a!==i),a.expand===Eh.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Mh;(function(n){n[n.Upsert=0]="Upsert",n[n.SetTags=1]="SetTags",n[n.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",n[n.RemoveChild=3]="RemoveChild",n[n.SetProp=4]="SetProp",n[n.Bulk=5]="Bulk",n[n.DocumentSynced=6]="DocumentSynced"})(Mh||(Mh={}));const W5=(n,e)=>n===e,iKt={range:(n,e)=>n===e?!0:!n||!e?!1:n.equalsRange(e),busy:W5,label:W5,description:W5,error:W5,sortText:W5,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.includes(t)))},nKt=Object.entries(iKt),sKt=(n,e)=>{let t;for(const[i,s]of nKt)s(n[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class oKt extends ${get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new yn(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new I),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(const t of this.tree.values())this.updateExpandability(t)}get resolveHandler(){return this._resolveHandler}collectDiff(){const e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case Ha.DocumentSynced:{for(const t of this.diff)if(t.op===Ha.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case Ha.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===Ha.Update&&t.item.extId===e.item.extId){jke(t.item,e.item);return}if(t.op===Ha.Add&&t.item.item.extId===e.item.extId){jke(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){const i=this.tree.get(e);if(i){if((i.expandLevels===void 0||t>i.expandLevels)&&(i.expandLevels=t),i.expand===Eh.Expandable){const s=this.resolveChildren(i);return s.isOpen()?this.expandChildren(i,t-1):s.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Eh.Expanded)return i.resolveBarrier?.isOpen()===!1?i.resolveBarrier.wait().then(()=>this.expandChildren(i,t-1)):this.expandChildren(i,t-1)}}dispose(){for(const e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case Mh.RemoveChild:this.removeItem(bn.joinToString(e.fullId,t.id));break;case Mh.Upsert:this.upsertItem(t.item,e);break;case Mh.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Mh.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Mh.UpdateCanResolveChildren:this.updateExpandability(e);break;case Mh.SetProp:this.pushDiff({op:Ha.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Mh.DocumentSynced:this.documentSynced(e.actual.uri);break;default:oQ()}}documentSynced(e){e&&this.pushDiff({op:Ha.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=bn.fromExtHostTestItem(e,this.root.id,t?.actual),s=this.options.getApiFor(e);s.parent&&s.parent!==t?.actual&&this.options.getChildren(s.parent).delete(e.id);let o=this.tree.get(i.toString());if(!o){o={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Eh.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:Ha.Add,item:{controllerId:this.options.controllerId,expand:o.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,o,t);return}if(o.actual===e){this.connectItem(e,o,t);return}if(o.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const r=this.options.getChildren(o.actual),a=o.actual,c=sKt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Eh.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Mh.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(bn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Eh.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const s=new Set(t.map(o=>o.id));for(const o of e)s.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:Ha.Update,item:{extId:i,item:{tags:e.map(o=>MX(this.options.controllerId,o.id))}}}),s.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){const t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:Ha.AddTag,tag:{id:MX(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:Ha.RemoveTag,id:MX(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,i){this.setItemParent(e,i);const s=this.options.getApiFor(e);s.parent=i?.actual,s.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[s,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Eh.Expanded:Eh.BusyExpanding:t=e.actual.canResolveChildren?Eh.Expandable:Eh.NotExpandable:t=Eh.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:Ha.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Eh.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[s,o]of this.options.getChildren(e.actual)){const r=this.expand(bn.joinToString(e.fullId,o.id),t);NS(r)&&i.push(r)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const o=new Uh;return o.open(),o}e.expand=Eh.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new Uh,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let s;try{s=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return NS(s)?s.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:Ha.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){const t=this.tree.get(e);if(!t)throw new Error("attempting to remove non-existent child");this.pushDiff({op:Ha.Remove,itemId:e});const i=[t];for(;i.length;){const s=i.pop();if(s){this.options.getApiFor(s.actual).listener=void 0;for(const o of s.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(s.fullId.toString());for(const[o,r]of this.options.getChildren(s.actual))i.push(this.tree.get(bn.joinToString(s.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class rKt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class eoe extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class aKt extends Error{constructor(e,t,i){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${i}".`)}}const cKt=(n,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(s,o){for(const r of i.values())s.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(s){const o=new Map,r=new Set(i.keys()),a={op:Mh.Bulk,ops:[]};for(const c of s){if(!(c instanceof t))throw new eoe(c.id);const l=e(c).controllerId;if(l!==n.controllerId)throw new aKt(c.id,l,n.controllerId);if(o.has(c.id))throw new rKt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Mh.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Mh.RemoveChild,id:c});n.listener?.(a),i=o},add(s){if(!(s instanceof t))throw new eoe(s.id);i.set(s.id,s),n.listener?.({op:Mh.Upsert,item:s})},delete(s){i.delete(s)&&n.listener?.({op:Mh.RemoveChild,id:s})},get(s){return i.get(s)},toJSON(){return Array.from(i.values())}}},srt=new WeakMap,lKt=(n,e)=>{const t={controllerId:e};return srt.set(n,t),t},oue=n=>{const e=srt.get(n);if(!e)throw new eoe(n?.id||"");return e},S2="vs/workbench/contrib/chat/common/languageModels";var sk;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.Assistant=2]="Assistant"})(sk||(sk={}));const y8e={type:"object",properties:{vendor:{type:"string",description:g(S2,0,"A globally unique vendor of language models.")}}},dKt=Ap.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(S2,1,"Contribute language models of a specific vendor."),oneOf:[y8e,{type:"array",items:y8e}]},activationEventsGenerator:(n,e)=>{for(const t of n)e.push(`onLanguageModelChat:${t.vendor}`)}});let S8e=class{constructor(e,t){this._extensionService=e,this._logService=t,this._store=new Z,this._providers=new Map,this._vendors=new Set,this._onDidChangeProviders=this._store.add(new I),this.onDidChangeLanguageModels=this._onDidChangeProviders.event,this._store.add(dKt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!Cd(o.description,"chatProvider")){o.collector.error(g(S2,2,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of fi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(S2,3,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(Xv(r.vendor)){o.collector.error(g(S2,4,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(S2,5,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const s=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),s.push(o));s.length>0&&this._onDidChangeProviders.fire({removed:s})}))}dispose(){this._store.dispose(),this._providers.clear()}getLanguageModelIds(){return Array.from(this._providers.keys())}lookupLanguageModel(e){return this._providers.get(e)?.metadata}async selectLanguageModels(e){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`);else{const i=Array.from(this._vendors).map(s=>this._extensionService.activateByEvent(`onLanguageModelChat:${s}`));await Promise.all(i)}const t=[];for(const[i,s]of this._providers)(e.vendor===void 0||s.metadata.vendor===e.vendor)&&(e.family===void 0||s.metadata.family===e.family)&&(e.version===void 0||s.metadata.version===e.version)&&(e.identifier===void 0||s.metadata.id===e.identifier)&&(!s.metadata.targetExtensions||s.metadata.targetExtensions.some(o=>Cn.equals(o,e.extension)))&&t.push(i);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelChat(e,t){if(this._logService.trace("[LM] registering language model chat",e,t.metadata),!this._vendors.has(t.metadata.vendor))throw new Error(`Chat response provider uses UNKNOWN vendor ${t.metadata.vendor}.`);if(this._providers.has(e))throw new Error(`Chat response provider with identifier ${e} is already registered.`);return this._providers.set(e,t),this._onDidChangeProviders.fire({added:[{identifier:e,metadata:t.metadata}]}),Ee(()=>{this._providers.delete(e)&&(this._onDidChangeProviders.fire({removed:[e]}),this._logService.trace("[LM] UNregistered language model chat",e,t.metadata))})}makeLanguageModelChatRequest(e,t,i,s,o,r){const a=this._providers.get(e);if(!a)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return a.provideChatResponse(i,t,s,o,r)}computeTokenLength(e,t,i){const s=this._providers.get(e);if(!s)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return s.provideTokenCount(t,i)}};S8e=D([_(0,ho),_(1,Ze)],S8e);var ZS;(function(n){function e(i){const{selectionStartLineNumber:s,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new Ps(s-1,o-1),l=new Ps(r-1,a-1);return new XS(c,l)}n.to=e;function t(i){const{anchor:s,active:o}=i;return{selectionStartLineNumber:s.line+1,selectionStartColumn:s.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}n.from=t})(ZS||(ZS={}));var at;(function(n){function e(i){if(!i)return;const{start:s,end:o}=i;return{startLineNumber:s.line+1,startColumn:s.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}n.from=e;function t(i){if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=i;return new rs(s-1,o-1,r-1,a-1)}n.to=t})(at||(at={}));var yx;(function(n){function e(i){return{uri:i.uri,range:at.from(i.range)}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(yx||(yx={}));var Jke;(function(n){function e(t){switch(t){case Ar.Comment:return UE.Comment;case Ar.Other:return UE.Other;case Ar.RegEx:return UE.RegEx;case Ar.String:return UE.String}}n.to=e})(Jke||(Jke={}));var Wr;(function(n){function e(i){return new Ps(i.lineNumber-1,i.column-1)}n.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}n.from=t})(Wr||(Wr={}));var D4;(function(n){function e(s,o,r){return Vi(Kb(s).map(a=>t(a,o,r)))}n.from=e;function t(s,o,r){if(typeof s=="string")return{$serialized:!0,language:s,isBuiltin:r?.isBuiltin};if(s)return{$serialized:!0,language:s.language,scheme:i(s.scheme,o),pattern:Zp.from(s.pattern)??void 0,exclusive:s.exclusive,notebookType:s.notebookType,isBuiltin:r?.isBuiltin}}function i(s,o){return o&&typeof s=="string"?o.transformOutgoingScheme(s):s}})(D4||(D4={}));var toe;(function(n){function e(i){switch(i){case mI.Unnecessary:return Ev.Unnecessary;case mI.Deprecated:return Ev.Deprecated}}n.from=e;function t(i){switch(i){case Ev.Unnecessary:return mI.Unnecessary;case Ev.Deprecated:return mI.Deprecated;default:return}}n.to=t})(toe||(toe={}));var k4;(function(n){function e(i){let s;return i.code&&($t(i.code)||Kc(i.code)?s=String(i.code):s={value:String(i.code.value),target:i.code.target}),{...at.from(i.range),message:i.message,source:i.source,code:s,severity:noe.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(ioe.from),tags:Array.isArray(i.tags)?Vi(i.tags.map(toe.from)):void 0}}n.from=e;function t(i){const s=new R6(at.to(i),i.message,noe.to(i.severity));return s.source=i.source,s.code=$t(i.code)?i.code:i.code?.value,s.relatedInformation=i.relatedInformation&&i.relatedInformation.map(ioe.to),s.tags=i.tags&&Vi(i.tags.map(toe.to)),s}n.to=t})(k4||(k4={}));var ioe;(function(n){function e(i){return{...at.from(i.location.range),message:i.message,resource:i.location.uri}}n.from=e;function t(i){return new e4(new _p(i.resource,at.to(i)),i.message)}n.to=t})(ioe||(ioe={}));var noe;(function(n){function e(i){switch(i){case Th.Error:return Ys.Error;case Th.Warning:return Ys.Warning;case Th.Information:return Ys.Info;case Th.Hint:return Ys.Hint}return Ys.Error}n.from=e;function t(i){switch(i){case Ys.Info:return Th.Information;case Ys.Warning:return Th.Warning;case Ys.Error:return Th.Error;case Ys.Hint:return Th.Hint;default:return Th.Error}}n.to=t})(noe||(noe={}));var yd;(function(n){function e(i){return typeof i=="number"&&i>=c4.One?i-1:i===c4.Beside?Cw:wx}n.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}n.to=t})(yd||(yd={}));function hKt(n){return typeof n.range<"u"}function ort(n){return n.length===0?!0:!!hKt(n[0])}var Qs;(function(n){function e(a){return a.map(n.from)}n.fromMany=e;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function i(a){let c;if(t(a)){const{language:u,value:f}=a;c={value:"```"+u+` -`+f+"\n```\n"}}else vp.isMarkdownString(a)?c={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?c={value:a}:c={value:""};const l=Object.create(null);c.uris=l;const d=u=>{try{let f=P.parse(u,!0);f=f.with({query:s(f.query,l)}),l[u]=f}catch{}return""},h=new Xg.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(eJe(u).href):"",Xg(c.value,{renderer:h}),c}n.from=i;function s(a,c){if(!a)return a;let l;try{l=JU(a)}catch{}if(!l)return a;let d=!1;return l=AU(l,h=>{if(P.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return c[u]=h,d=!0,u}else return}),d?JSON.stringify(l):a}function o(a){const c=new vp(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?P.from(a.baseUri):void 0,c}n.to=o;function r(a){if(a)return typeof a=="string"?a:n.from(a)}n.fromStrict=r})(Qs||(Qs={}));function uKt(n){return ort(n)?n.map(e=>({range:at.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Qs.fromMany(e.hoverMessage):e.hoverMessage?Qs.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:at.from(e)}))}function rue(n){return typeof n>"u"?n:typeof n=="string"?P.file(n):n}var I4;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?rue(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}n.from=e})(I4||(I4={}));var soe;(function(n){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(soe||(soe={}));var Xke;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case _I.OpenOpen:return gi.AlwaysGrowsWhenTypingAtEdges;case _I.ClosedClosed:return gi.NeverGrowsWhenTypingAtEdges;case _I.OpenClosed:return gi.GrowsOnlyWhenTypingBefore;case _I.ClosedOpen:return gi.GrowsOnlyWhenTypingAfter}}n.from=e})(Xke||(Xke={}));var Zke;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?Xke.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?soe.from(t.light):void 0,dark:t.dark?soe.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(Zke||(Zke={}));var nh;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&R4.from(i.newEol),range:at.from(i.range)}}n.from=e;function t(i){const s=new qx(at.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:R4.to(i.eol),s}n.to=t})(nh||(nh={}));var lf;(function(n){function e(i,s){const o={edits:[]};if(i instanceof q1){const r=new o1;for(const a of i._allEntries())a._type===sl.File&&P.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===sl.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:pMe(ze.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),o.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===sl.Text?o.edits.push({resource:a.uri,textEdit:nh.from(a.edit),versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Snippet?o.edits.push({resource:a.uri,textEdit:{range:at.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===sl.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:G1.Replace,index:a.index,count:a.count,cells:a.cells.map(IG.from)}})}return o}n.from=e;function t(i){const s=new q1,o=new wi;for(const r of i.edits)if(r.textEdit){const a=r,c=P.revive(a.resource),l=at.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=zhe.replace(l,new Q1(d)):u=qx.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else s.renameFile(P.revive(r.oldResource),P.revive(r.newResource),r.options);for(const[r,a]of o)s.set(r,a);return s}n.to=t})(lf||(lf={}));var Sw;(function(n){const e=Object.create(null);e[Gr.File]=_t.File,e[Gr.Module]=_t.Module,e[Gr.Namespace]=_t.Namespace,e[Gr.Package]=_t.Package,e[Gr.Class]=_t.Class,e[Gr.Method]=_t.Method,e[Gr.Property]=_t.Property,e[Gr.Field]=_t.Field,e[Gr.Constructor]=_t.Constructor,e[Gr.Enum]=_t.Enum,e[Gr.Interface]=_t.Interface,e[Gr.Function]=_t.Function,e[Gr.Variable]=_t.Variable,e[Gr.Constant]=_t.Constant,e[Gr.String]=_t.String,e[Gr.Number]=_t.Number,e[Gr.Boolean]=_t.Boolean,e[Gr.Array]=_t.Array,e[Gr.Object]=_t.Object,e[Gr.Key]=_t.Key,e[Gr.Null]=_t.Null,e[Gr.EnumMember]=_t.EnumMember,e[Gr.Struct]=_t.Struct,e[Gr.Event]=_t.Event,e[Gr.Operator]=_t.Operator,e[Gr.TypeParameter]=_t.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:_t.Property}n.from=t;function i(s){for(const o in e)if(e[o]===s)return Number(o);return Gr.Property}n.to=i})(Sw||(Sw={}));var Qx;(function(n){function e(i){switch(i){case i4.Deprecated:return k9.Deprecated}}n.from=e;function t(i){switch(i){case k9.Deprecated:return i4.Deprecated}}n.to=t})(Qx||(Qx={}));var EG;(function(n){function e(i){return{name:i.name,kind:Sw.from(i.kind),tags:i.tags&&i.tags.map(Qx.from),containerName:i.containerName,location:P_.from(i.location)}}n.from=e;function t(i){const s=new n4(i.name,Sw.to(i.kind),i.containerName,P_.to(i.location));return s.tags=i.tags&&i.tags.map(Qx.to),s}n.to=t})(EG||(EG={}));var eIe;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:at.from(i.range),selectionRange:at.from(i.selectionRange),kind:Sw.from(i.kind),tags:i.tags?.map(Qx.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new s4(i.name,i.detail,Sw.to(i.kind),at.to(i.range),at.to(i.selectionRange));return mo(i.tags)&&(s.tags=i.tags.map(Qx.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(eIe||(eIe={}));var KF;(function(n){function e(i){const s=new $he(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,name:i.name,detail:i.detail,kind:Sw.from(i.kind),uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})(KF||(KF={}));var tIe;(function(n){function e(t){return new fOe(KF.to(t.from),t.fromRanges.map(i=>at.to(i)))}n.to=e})(tIe||(tIe={}));var iIe;(function(n){function e(t){return new pOe(KF.to(t.to),t.fromRanges.map(i=>at.to(i)))}n.to=e})(iIe||(iIe={}));var P_;(function(n){function e(i){return{range:i.range&&at.from(i.range),uri:i.uri}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(P_||(P_={}));var xG;(function(n){function e(i){const s=i,o=i;return{originSelectionRange:s.originSelectionRange?at.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:o.uri,range:at.from(s.targetRange?s.targetRange:o.range),targetSelectionRange:s.targetSelectionRange?at.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:P.revive(i.uri),targetRange:at.to(i.range),targetSelectionRange:i.targetSelectionRange?at.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?at.to(i.originSelectionRange):void 0}}n.to=t})(xG||(xG={}));var ooe;(function(n){function e(i){return{range:at.from(i.range),contents:Qs.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Qs.to),o=at.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new ise(s,o,r,a)}n.to=t})(ooe||(ooe={}));var nIe;(function(n){function e(i){return{range:at.from(i.range),expression:i.expression}}n.from=e;function t(i){return new J6(at.to(i.range),i.expression)}n.to=t})(nIe||(nIe={}));var roe;(function(n){function e(i){if(i instanceof X6)return{type:"text",range:at.from(i.range),text:i.text};if(i instanceof Z6)return{type:"variable",range:at.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof eG)return{type:"expression",range:at.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}n.from=e;function t(i){switch(i.type){case"text":return{range:at.to(i.range),text:i.text};case"variable":return{range:at.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:at.to(i.range),expression:i.expression}}}n.to=t})(roe||(roe={}));var aoe;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:at.from(i.stoppedLocation)}}n.from=e;function t(i){return new gke(i.frameId,at.to(i.stoppedLocation))}n.to=t})(aoe||(aoe={}));var L4;(function(n){function e(i){return{range:at.from(i.range),kind:i.kind}}n.from=e;function t(i){return new N6(at.to(i.range),i.kind)}n.to=t})(L4||(L4={}));var sIe;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(L4.from)}}n.from=e;function t(i){return new P6(P.revive(i.uri),i.highlights.map(L4.to))}n.to=t})(sIe||(sIe={}));var oIe;(function(n){function e(t){switch(t){case tf.TriggerCharacter:return RM.TriggerCharacter;case tf.TriggerForIncompleteCompletions:return RM.TriggerForIncompleteCompletions;case tf.Invoke:default:return RM.Invoke}}n.to=e})(oIe||(oIe={}));var rIe;(function(n){function e(t){return{triggerKind:oIe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(rIe||(rIe={}));var coe;(function(n){function e(i){switch(i){case a4.Deprecated:return TU.Deprecated}}n.from=e;function t(i){switch(i){case TU.Deprecated:return a4.Deprecated}}n.to=t})(coe||(coe={}));var loe;(function(n){const e=new Map([[nn.Method,Ne.Method],[nn.Function,Ne.Function],[nn.Constructor,Ne.Constructor],[nn.Field,Ne.Field],[nn.Variable,Ne.Variable],[nn.Class,Ne.Class],[nn.Interface,Ne.Interface],[nn.Struct,Ne.Struct],[nn.Module,Ne.Module],[nn.Property,Ne.Property],[nn.Unit,Ne.Unit],[nn.Value,Ne.Value],[nn.Constant,Ne.Constant],[nn.Enum,Ne.Enum],[nn.EnumMember,Ne.EnumMember],[nn.Keyword,Ne.Keyword],[nn.Snippet,Ne.Snippet],[nn.Text,Ne.Text],[nn.Color,Ne.Color],[nn.File,Ne.File],[nn.Reference,Ne.Reference],[nn.Folder,Ne.Folder],[nn.Event,Ne.Event],[nn.Operator,Ne.Operator],[nn.TypeParameter,Ne.TypeParameter],[nn.Issue,Ne.Issue],[nn.User,Ne.User]]);function t(o){return e.get(o)??Ne.Property}n.from=t;const i=new Map([[Ne.Method,nn.Method],[Ne.Function,nn.Function],[Ne.Constructor,nn.Constructor],[Ne.Field,nn.Field],[Ne.Variable,nn.Variable],[Ne.Class,nn.Class],[Ne.Interface,nn.Interface],[Ne.Struct,nn.Struct],[Ne.Module,nn.Module],[Ne.Property,nn.Property],[Ne.Unit,nn.Unit],[Ne.Value,nn.Value],[Ne.Constant,nn.Constant],[Ne.Enum,nn.Enum],[Ne.EnumMember,nn.EnumMember],[Ne.Keyword,nn.Keyword],[Ne.Snippet,nn.Snippet],[Ne.Text,nn.Text],[Ne.Color,nn.Color],[Ne.File,nn.File],[Ne.Reference,nn.Reference],[Ne.Folder,nn.Folder],[Ne.Event,nn.Event],[Ne.Operator,nn.Operator],[Ne.TypeParameter,nn.TypeParameter],[Ne.User,nn.User],[Ne.Issue,nn.Issue]]);function s(o){return i.get(o)??nn.Property}n.to=s})(loe||(loe={}));var aIe;(function(n){function e(t,i){const s=new H6(t.label);return s.insertText=t.insertText,s.kind=loe.to(t.kind),s.tags=t.tags?.map(coe.to),s.detail=t.detail,s.documentation=ah(t.documentation)?Qs.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,O.isIRange(t.range)?s.range=at.to(t.range):typeof t.range=="object"&&(s.range={inserting:at.to(t.range.insert),replacing:at.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&cp.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&cp.InsertAsSnippet?s.insertText=new Q1(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof rs?new qx(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(o=>nh.to(o))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(aIe||(aIe={}));var doe;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Qs.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation}}n.to=t})(doe||(doe={}));var hoe;(function(n){function e(i){return{label:i.label,documentation:Qs.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(doe.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(doe.to):[],activeParameter:i.activeParameter}}n.to=t})(hoe||(hoe={}));var DG;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.to):[]}}n.to=t})(DG||(DG={}));var cIe;(function(n){function e(t,i){const s=new W6(Wr.to(i.position),typeof i.label=="string"?i.label:i.label.map(lIe.to.bind(void 0,t)),i.kind&&uoe.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(nh.to),s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(cIe||(cIe={}));var lIe;(function(n){function e(t,i){const s=new B6(i.label);return s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,uZ.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=P_.to(i.location)),s}n.to=e})(lIe||(lIe={}));var uoe;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(uoe||(uoe={}));var zM;(function(n){function e(i){return{range:at.from(i.range),url:i.target,tooltip:i.tooltip}}n.from=e;function t(i){let s;if(i.url)try{s=typeof i.url=="string"?P.parse(i.url,!0):P.revive(i.url)}catch{}return new V6(at.to(i.range),s)}n.to=t})(zM||(zM={}));var goe;(function(n){function e(i){const s=new $6(i.label);return i.textEdit&&(s.textEdit=nh.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(o=>nh.to(o))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?nh.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>nh.from(s)):void 0}}n.from=t})(goe||(goe={}));var T4;(function(n){function e(i){return new VF(i[0],i[1],i[2],i[3])}n.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}n.from=t})(T4||(T4={}));var dIe;(function(n){function e(i){return{range:at.from(i.range)}}n.from=e;function t(i){return new r4(at.to(i.range))}n.to=t})(dIe||(dIe={}));var foe;(function(n){function e(t){switch(t){case Ln.AUTO:return MM.AfterDelay;case Ln.EXPLICIT:return MM.Manual;case Ln.FOCUS_CHANGE:case Ln.WINDOW_CHANGE:return MM.FocusOut}}n.to=e})(foe||(foe={}));var oH;(function(n){function e(i){switch(i){case wv.Off:return Qr.Off;case wv.Relative:return Qr.Relative;case wv.Interval:return Qr.Interval;case wv.On:default:return Qr.On}}n.from=e;function t(i){switch(i){case Qr.Off:return wv.Off;case Qr.Relative:return wv.Relative;case Qr.Interval:return wv.Interval;case Qr.On:default:return wv.On}}n.to=t})(oH||(oH={}));var R4;(function(n){function e(i){if(i===jv.CRLF)return bu.CRLF;if(i===jv.LF)return bu.LF}n.from=e;function t(i){if(i===bu.CRLF)return jv.CRLF;if(i===bu.LF)return jv.LF}n.to=t})(R4||(R4={}));var hIe;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case VI.SourceControl:return ch.Scm;case VI.Window:return ch.Window;case VI.Notification:return ch.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(hIe||(hIe={}));var poe;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=moe.from(i.kind)),s}n.from=e;function t(i){const s={start:i.start-1,end:i.end-1};return i.kind&&(s.kind=moe.to(i.kind)),s}n.to=t})(poe||(poe={}));var moe;(function(n){function e(i){if(i)switch(i){case vy.Comment:return yv.Comment;case vy.Imports:return yv.Imports;case vy.Region:return yv.Region}}n.from=e;function t(i){if(i)switch(i.value){case yv.Comment.value:return vy.Comment;case yv.Imports.value:return vy.Imports;case yv.Region.value:return vy.Region}}n.to=t})(moe||(moe={}));var C8;(function(n){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,override:typeof t.override=="boolean"?A_.id:void 0}}n.from=e})(C8||(C8={}));var Zp;(function(n){function e(o){return o instanceof FM?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new FM(o.baseUri??o.base,o.pattern).toJSON():o}n.from=e;function t(o){const r=o;return r?P.isUri(r.baseUri)&&typeof r.pattern=="string":!1}function i(o){const r=o;return r?typeof r.base=="string"&&typeof r.pattern=="string":!1}function s(o){return typeof o=="string"?o:new FM(P.revive(o.baseUri),o.pattern)}n.to=s})(Zp||(Zp={}));var uIe;(function(n){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Zp.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(uIe||(uIe={}));var _oe;(function(n){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(s=>Array.isArray(s)&&s.every(o=>o&&typeof o=="object"&&"uri"in o&&P.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof rs)))}n.is=e;function t(i){return{documents:i.documents.map(s=>s.map(o=>({uri:P.from(o.uri),version:o.version,ranges:o.ranges.map(r=>at.from(r))})))}}n.from=t})(_oe||(_oe={}));var ES;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new rS(i.start,i.end)}n.to=t})(ES||(ES={}));var M4;(function(n){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}n.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}n.from=t})(M4||(M4={}));var gIe;(function(n){function e(t){if(t===p8.Unconfirmed)return qF.Pending;if(t===p8.Pending)return;if(t===p8.Executing)return qF.Executing;throw new Error(`Unknown state: ${t}`)}n.to=e})(gIe||(gIe={}));var kG;(function(n){function e(i){switch(i){case bI.Markup:return w2.Markup;case bI.Code:default:return w2.Code}}n.from=e;function t(i){switch(i){case w2.Markup:return bI.Markup;case w2.Code:default:return bI.Code}}n.to=t})(kG||(kG={}));var ok;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)ej.validate(o),s.cells.push(IG.from(o));return s}n.from=e;function t(i){const s=new _Oe(i.cells.map(IG.to));return n1(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(ok||(ok={}));var IG;(function(n){function e(i){return{cellKind:kG.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:M4.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(Y1.from):[]}}n.from=e;function t(i){return new ej(kG.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(Y1.to):void 0,i.metadata,i.internalMetadata?M4.to(i.internalMetadata):void 0)}n.to=t})(IG||(IG={}));var N4;(function(n){function e(i){return{mime:i.mime,valueBytes:ze.wrap(i.data)}}n.from=e;function t(i){return new vOe(i.valueBytes.buffer,i.mime)}n.to=t})(N4||(N4={}));var Y1;(function(n){function e(i){return{outputId:i.id,items:i.items.map(N4.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(N4.to);return new oG(s,i.outputId,i.metadata)}n.to=t})(Y1||(Y1={}));var voe;(function(n){function e(s){return i(s)?{include:Zp.from(s.include)??void 0,exclude:Zp.from(s.exclude)??void 0}:Zp.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:Zp.to(s.include),exclude:Zp.to(s.exclude)}:Zp.to(s)}n.to=t;function i(s){const o=s;return o?!hc(o.include)&&!hc(o.exclude):!1}})(voe||(voe={}));var fIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===rG.Left?ese.Left:ese.Right,command:i.toInternal(o,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(fIe||(fIe={}));var pIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,s),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}n.from=e})(pIe||(pIe={}));var mIe;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(mIe||(mIe={}));var woe;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new wOe(P.revive(i.uri),i.provides)}n.to=t})(woe||(woe={}));var P4;(function(n){function e(i){return{message:Qs.fromStrict(i.message)||"",type:dC.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:at.from(i.location.range),uri:i.location.uri}}}n.from=e;function t(i){const s=new b4(typeof i.message=="string"?i.message:Qs.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?P_.to(i.location):void 0,s}n.to=t})(P4||(P4={}));var hC;(function(n){n.namespace=MX,n.denamespace=nrt})(hC||(hC={}));var J1;(function(n){function e(i){const s=oue(i).controllerId;return{extId:bn.fromExtHostTestItem(i,s).toString(),label:i.label,uri:P.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>hC.namespace(s,o.id)),range:O.lift(at.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Qs.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:bn.fromString(i.extId).localId,label:i.label,uri:P.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:o}=hC.denamespace(s);return new C4(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:at.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(J1||(J1={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new C4(i.id)}n.to=t})(hC||(hC={}));var _Ie;(function(n){const e=(i,s)=>{const o=i.value;if(!o)return;const r={...J1.toPlain(o.item),parent:s,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===dC.Error).map(P4.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,r);c&&r.children.push(c)}return r};function t(i){const s=new qse;for(const a of i.items)s.insert(bn.fromString(a.item.extId).path,a);const o=[s.nodes],r=[];for(;o.length;)for(const a of o.pop())a.value?r.push(a):a.children&&o.push(a.children.values());return{completedAt:i.completedAt,results:r.map(a=>e(a)).filter(yl)}}n.to=t})(_Ie||(_Ie={}));var boe;(function(n){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Wr.from(o):at.from(o)}function i(o){if(typeof o.executed=="number"&&o.executed<0)throw new Error(`Invalid coverage count ${o.executed}`);return"branches"in o?{count:o.executed,location:t(o.location),type:E4.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:E4.Declaration,name:o.name,count:o.executed,location:t(o.location)}}n.fromDetails=i;function s(o,r,a){return IX(a.statementCoverage),IX(a.branchCoverage),IX(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testId:a instanceof uG&&a.testItem?bn.fromExtHostTestItem(a.testItem,o).toString():void 0}}n.fromFile=s})(boe||(boe={}));var vIe;(function(n){function e(t){switch(t){case wu.Invoke:return o4.Invoke;case wu.Auto:return o4.Automatic}}n.to=e})(vIe||(vIe={}));var $M;(function(n){function e(i){const s=new qhe(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,kind:Sw.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})($M||($M={}));var Coe;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(Coe||(Coe={}));var yoe;(function(n){function e(o,r,a){const c=r.fileData;return c?new A7t(new E7t(c.name,P.revive(c.uri),c.id,cw(()=>a(c.id)))):o===Js.uriList&&r.uriListData?new mse(s(r.uriListData)):new mse(r.asString)}n.to=e;async function t(o,r){const a=await r.asString();if(o===Js.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=r.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}n.from=t;function i(o){return R1.split(o).map(r=>{if(r.startsWith("#"))return r;try{return P.parse(r)}catch{}return r})}function s(o){return R1.create(o.map(r=>typeof r=="string"?r:P.revive(r)))}})(yoe||(yoe={}));var rw;(function(n){function e(i,s){const o=i.items.map(([r,a])=>[r,yoe.to(r,a,s)]);return new h4(o)}n.toDataTransfer=e;async function t(i){const s={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{s.items.push([r,await yoe.from(r,a)])})());return await Promise.all(o),s}n.from=t})(rw||(rw={}));var LG;(function(n){function e(i,s){return{kind:"reply",agentId:i.participant??s?.agentId??"",subCommand:i.command??s?.command,message:i.prompt,title:i.label}}n.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}n.to=t})(LG||(LG={}));var y8;(function(n){function e(i){switch(i.role){case sk.System:return new v8(Iv.System,i.content);case sk.User:return new v8(Iv.User,i.content);case sk.Assistant:return new v8(Iv.Assistant,i.content)}}n.to=e;function t(i){switch(i.role){case Iv.System:return{role:sk.System,content:i.content};case Iv.User:return{role:sk.User,content:i.content};case Iv.Assistant:return{role:sk.Assistant,content:i.content}}}n.from=t})(y8||(y8={}));var TG;(function(n){function e(i){return{kind:"markdownContent",content:Qs.from(i.value)}}n.from=e;function t(i){return new Jhe(Qs.to(i.content))}n.to=t})(TG||(TG={}));var Soe;(function(n){function e(i){return{kind:"markdownVuln",content:Qs.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new fG(Qs.to(i.content),i.vulnerabilities)}n.to=t})(Soe||(Soe={}));var Aoe;(function(n){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}n.from=e;function t(i){return new pG(i.agentId,i.command)}n.to=t})(Aoe||(Aoe={}));var wIe;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data}}n.from=e})(wIe||(wIe={}));var RG;(function(n){function e(i){const{value:s,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=P.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:ui(o),uri:o,children:r(s,o)}}}n.from=e;function t(i){const s=Or(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=s.uri,a=s.children?o(s.children):[];return new Xhe(a,r)}n.to=t})(RG||(RG={}));var MG;(function(n){function e(i){const s=o=>P.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:yx.from(i.value)}}n.from=e;function t(i){const s=Or(i);return new Zhe(P.isUri(s.inlineReference)?s.inlineReference:yx.to(s.inlineReference),i.name)}n.to=t})(MG||(MG={}));var F4;(function(n){function e(i){return{kind:"progressMessage",content:Qs.from(i.value)}}n.from=e;function t(i){return new mG(i.content.value)}n.to=t})(F4||(F4={}));var NG;(function(n){function e(i){return{kind:"warning",content:Qs.from(i.value)}}n.from=e;function t(i){return new _G(i.content.value)}n.to=t})(NG||(NG={}));var bIe;(function(n){function e(t){return{kind:"progressTask",content:Qs.from(t.value)}}n.from=e})(bIe||(bIe={}));var CIe;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Qs.from(t):void 0}}n.from=e})(CIe||(CIe={}));var PG;(function(n){function e(i,s,o){return{kind:"command",command:s.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}n.from=e;function t(i,s){return new eue(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(PG||(PG={}));var Eoe;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>nh.from(s))}}n.from=e;function t(i){return new vG(P.revive(i.uri),i.edits.map(s=>nh.to(s)))}n.to=t})(Eoe||(Eoe={}));var Sx;(function(n){function e(i){const s=$e.isThemeIcon(i.iconPath)?i.iconPath:P.isUri(i.iconPath)?{light:P.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&P.isUri(i.iconPath.light)&&P.isUri(i.iconPath.dark)?{light:P.revive(i.iconPath.light),dark:P.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:P.isUri(i.value.value)||!i.value.value?i.value.value:yx.from(i.value.value)},iconPath:s}:{kind:"reference",reference:P.isUri(i.value)?i.value:yx.from(i.value),iconPath:s}}n.from=e;function t(i){const s=Or(i),o=r=>P.isUri(r)?r:yx.to(r);return new GI("variableName"in s.reference?{variableName:s.reference.variableName,value:s.reference.value&&o(s.reference.value)}:o(s.reference))}n.to=t})(Sx||(Sx={}));var xoe;(function(n){function e(s,o,r){return s instanceof Jhe?TG.from(s):s instanceof Zhe?MG.from(s):s instanceof GI?Sx.from(s):s instanceof mG?F4.from(s):s instanceof Xhe?RG.from(s):s instanceof eue?PG.from(s,o,r):s instanceof vG?Eoe.from(s):s instanceof fG?Soe.from(s):s instanceof pG?Aoe.from(s):s instanceof _G?NG.from(s):{kind:"markdownContent",content:Qs.from("")}}n.from=e;function t(s,o){switch(s.kind){case"reference":return Sx.to(s);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(s,o)}}n.to=t;function i(s,o){switch(s.kind){case"markdownContent":return TG.to(s);case"inlineReference":return MG.to(s);case"progressMessage":return;case"treeData":return RG.to(s);case"command":return PG.to(s,o)}}n.toContent=i})(xoe||(xoe={}));var yIe;(function(n){function e(t){return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:t.variables.variables.map(Doe.to),location:O4.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData}}n.to=e})(yIe||(yIe={}));var O4;(function(n){function e(i){switch(i){case lc.Notebook:return cb.Notebook;case lc.Terminal:return cb.Terminal;case lc.Panel:return cb.Panel;case lc.Editor:return cb.Editor}}n.to=e;function t(i){switch(i){case cb.Notebook:return lc.Notebook;case cb.Terminal:return lc.Terminal;case cb.Panel:return lc.Panel;case cb.Editor:return lc.Editor}}n.from=t})(O4||(O4={}));var Doe;(function(n){function e(t){const i=t.value;if(!i)throw new Error("Invalid value reference");return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:lZ(i)?P.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&lZ(i.uri)?yx.to(Or(i)):i,modelDescription:t.modelDescription}}n.to=e})(Doe||(Doe={}));var SIe;(function(n){function e(t,i,s){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,s)}}n.from=e})(SIe||(SIe={}));var rH;(function(n){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}n.to=e})(rH||(rH={}));var AIe;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const o=rH.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:s.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:LG.to(i.action.followup)},result:o}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:o}:{action:i.action,result:o}}n.to=e})(AIe||(AIe={}));var koe;(function(n){function e(t,i,s){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,s)}n.from=e})(koe||(koe={}));var EIe;(function(n){function e(t){return{kind:xIe.to(t.kind)}}n.to=e})(EIe||(EIe={}));var xIe;(function(n){function e(t){switch(t){case DI.Word:return IR.Word;case DI.Line:return IR.Line;case DI.Suggest:return IR.Suggest;default:return IR.Unknown}}n.to=e})(xIe||(xIe={}));var DIe;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||sDe.None,contextValue:t.contextValue}}n.from=e})(DIe||(DIe={}));class TOe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Vi(Array.from(e,([,i])=>i.asFile()))),{id:t,dispose:()=>{this.dataTransferFiles.delete(t)}}}async resolveFileData(e,t){const i=this.dataTransferFiles.get(e);if(!i)throw new Error("No data transfer found");const s=i.find(o=>o.id===t);if(!s)throw new Error("No matching file found in data transfer");return ze.wrap(await s.data())}dispose(){this.dataTransferFiles.clear()}}var A8e;(function(n){n.CallsTo="incomingCalls",n.CallsFrom="outgoingCalls"})(A8e||(A8e={}));const rrt=new Po;class Ioe{static async create(e,t,i){const[s]=rrt.ordered(e);if(!s)return;const o=await s.prepareCallHierarchy(e,t,i);if(o)return new Ioe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new GRe(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Ioe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const S8=new Map;yt.registerCommand("_executePrepareCallHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Ioe.create(o,i,qe.None);return a?(S8.set(a.id,a),S8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),S8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function art(n){return!0}yt.registerCommand("_executeProvideIncomingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,qe.None)});yt.registerCommand("_executeProvideOutgoingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,qe.None)});var kIe;(function(n){const e=[];function t(s){let o=s;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}n.register=t;function i(){return e.slice(0)}n.all=i})(kIe||(kIe={}));var IIe;(function(n){n[n.Idle=0]="Idle",n[n.Searching=1]="Searching",n[n.SlowSearch=2]="SlowSearch"})(IIe||(IIe={}));new Y("searchState",IIe.Idle);var E8e;(function(n){n.Subtypes="subtypes",n.Supertypes="supertypes"})(E8e||(E8e={}));const crt=new Po;class Loe{static async create(e,t,i){const[s]=crt.ordered(e);if(!s)return;const o=await s.prepareTypeHierarchy(e,t,i);if(o)return new Loe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new GRe(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Loe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const A8=new Map;yt.registerCommand("_executePrepareTypeHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Loe.create(o,i,qe.None);return a?(A8.set(a.id,a),A8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),A8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function lrt(n){const e=n;return typeof n=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&P.isUri(e.uri)&&O.isIRange(e.range)&&O.isIRange(e.selectionRange)}yt.registerCommand("_executeProvideSupertypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSupertypes(t,qe.None)});yt.registerCommand("_executeProvideSubtypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSubtypes(t,qe.None)});var $o;let x8e=$o=class extends ${constructor(e,t,i,s,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=s,this._uriIdentService=o,this._registrations=this._register(new Zo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(et.ExtHostLanguageFeatures),this._languageService){const r=()=>{const a=[];for(const c of t.getRegisteredLanguageIds()){const l=this._languageConfigurationService.getLanguageConfiguration(c).getWordDefinition();a.push({languageId:c,regexSource:l.source,regexFlags:l.flags})}this._proxy.$setWordDefinitions(a)};this._register(this._languageConfigurationService.onDidChange(a=>{if(!a.languageId)r();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),r()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationLinkDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach($o._reviveWorkspaceSymbolDto),e):(e.location=$o._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>AS(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=P.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(s,o)=>this._proxy.$provideDocumentSymbols(e,s.uri,o)}))}$registerCodeLensSupport(e,t,i){const s={provideCodeLenses:async(o,r)=>{const a=await this._proxy.$provideCodeLenses(e,o.uri,r);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(o,r,a)=>{const c=await this._proxy.$resolveCodeLens(e,r,a);if(c)return{...c,range:o.validateRange(c.range)}}};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,s))}$emitCodeLensEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.definitionProvider.register(t,{provideDefinition:(i,s,o)=>this._proxy.$provideDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,s,o)=>this._proxy.$provideDeclaration(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,s,o)=>this._proxy.$provideImplementation(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,s,o)=>this._proxy.$provideTypeDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,s,o,r)=>{const a={verbosityRequest:r?.verbosityRequest?{verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:{id:r.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,s,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,s,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,s,o)}))}$registerInlineValuesProvider(e,t,i){const s={provideInlineValues:(o,r,a,c)=>this._proxy.$provideInlineValues(e,o.uri,r,a,c)};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,s))}$emitInlineValuesEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.documentHighlightProvider.register(t,{provideDocumentHighlights:(i,s,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,s,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,s,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,s,o.map(a=>a.uri),r).then(a=>{if(iO(a))return;const c=new wi;return a?.forEach(l=>{const d=P.revive(l.uri);c.has(d)?c.get(d).push(...l.highlights):c.set(d,l.highlights)}),c})}))}$registerLinkedEditingRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.linkedEditingRangeProvider.register(t,{provideLinkedEditingRanges:async(i,s,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,s,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?$o._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,s,o,r)=>this._proxy.$provideReferences(e,i.uri,s,o,r).then($o._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,s,o,r){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:$o._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:s,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=AS(d.edit,this._uriIdentService)),d.command&&(c.command=d.command),c}),this._registrations.set(e,this._languageFeaturesService.codeActionProvider.register(t,a))}$registerPasteEditProvider(e,t,i){const s=new LIe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentPasteEditProvider.register(t,s),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const s=this._pasteEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,s,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentRangeFormattingEdits:(r,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,r.uri,a,c,l),provideDocumentRangesFormattingEdits:o?(r,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,r.uri,a,c,l):void 0}))}$registerOnTypeFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:s,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const s={provideWorkspaceSymbols:async(o,r)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,o,r);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,$o._reviveWorkspaceSymbolDto(a.symbols)}};t&&(s.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&$o._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,kIe.register(s))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(s,o,r,a)=>this._proxy.$provideRenameEdits(e,s.uri,o,r,a).then(c=>AS(c,this._uriIdentService)),resolveRenameLocation:i?(s,o,r)=>this._proxy.$resolveRenameLocation(e,s.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,s,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,s,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,s){let o;if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new gKt(this._proxy,e,i,o)))}$emitDocumentSemanticTokensEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentRangeSemanticTokensProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentRangeSemanticTokensProvider.register(t,new fKt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const s=t[Oi.label],o=t[Oi.commandId],r=t[Oi.commandIdent],a=t[Oi.commitCharacters];return{label:s,extensionId:i,kind:t[Oi.kind]??Ne.Property,tags:t[Oi.kindModifier],detail:t[Oi.detail],documentation:t[Oi.documentation],sortText:t[Oi.sortText],filterText:t[Oi.filterText],preselect:t[Oi.preselect],insertText:t[Oi.insertText]??(typeof s=="string"?s:s.label),range:t[Oi.range]??e,insertTextRules:t[Oi.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Oi.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Oi.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,s,o){const r={triggerCharacters:i,_debugDisplayName:`${o.value}(${i.join("")})`,provideCompletionItems:async(a,c,l,d)=>{const h=await this._proxy.$provideCompletionItems(e,a.uri,c,l,d);return h&&{suggestions:h[aS.completions].map(u=>$o._inflateSuggestDto(h[aS.defaultRanges],u,o)),incomplete:h[aS.isIncomplete]||!1,duration:h[aS.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};s&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=$o._inflateSuggestDto(a.range,l,o);return Sm(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,s,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),handleItemDidShow:async(a,c,l)=>{i&&await this._proxy.$handleInlineCompletionDidShow(e,a.pid,c.idx,l)},handlePartialAccept:async(a,c,l,d)=>{i&&await this._proxy.$handleInlineCompletionPartialAccept(e,a.pid,c.idx,l,d)},freeInlineCompletions:a=>{this._proxy.$freeInlineCompletionsList(e,a.pid)},groupId:s,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${s})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const s={provideInlineEdit:async(o,r,a)=>this._proxy.$provideInlineEdit(e,o.uri,r,a),freeInlineEdit:o=>{this._proxy.$freeInlineEdit(e,o.pid)}};this._registrations.set(e,this._languageFeaturesService.inlineEditProvider.register(t,s))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(s,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,s.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,s,o){const r={displayName:o,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Or(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(r.resolveInlayHint=async(a,c)=>{const l=a;if(!l.cacheId)return a;const d=await this._proxy.$resolveInlayHint(e,l.cacheId,c);if(c.isCancellationRequested)throw new Rc;return d?{...a,tooltip:d.tooltip,label:Or(d.label),textEdits:d.textEdits}:a}),typeof s=="number"){const a=new I;this._registrations.set(s,a),r.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,r))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const s={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map($o._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(s.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&$o._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,s))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(s,o)=>i.$provideDocumentColors(e,s.uri,o).then(r=>r.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(s,o,r)=>i.$provideColorPresentations(e,s.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,s){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o.onDidChange=r.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,o))}$emitFoldingRangeEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerSelectionRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.selectionRangeProvider.register(t,{provideSelectionRanges:(i,s,o)=>this._proxy.$provideSelectionRanges(e,i.uri,s,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,rrt.register(t,{prepareCallHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,s,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map($o._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.to=$o._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.from=$o._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:$o._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:$o._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?$o._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?$o._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:$o._reviveRegExp(e.beforeText),afterText:e.afterText?$o._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?$o._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map($o._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const s={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?$o._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?$o._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?$o._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?s.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(s.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(s.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,s,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,crt.register(t,{prepareTypeHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,s,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map($o._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const s=new TIe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentDropEditProvider.register(t,s),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const s=this._documentOnDropEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t){const i=new pKt(e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,i))}};x8e=$o=D([en(Ue.MainThreadLanguageFeatures),_(1,Di),_(2,lo),_(3,ht),_(4,_o)],x8e);let LIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new TOe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new bs(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await rw.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new fhe;for(const[u,f]of d.items)h.replace(u,HQ(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await rw.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,o.uri,r,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new bs(f.kind.value):new bs(""),yieldTo:f.yieldTo?.map(p=>({kind:new bs(p)})),additionalEdit:f.additionalEdit?AS(f.additionalEdit,this._uriIdentService,p=>this.resolveFileData(d.id,p)):void 0})),dispose:()=>{this._proxy.$releasePasteEdits(this._handle,d.id)}}:void 0}finally{d.dispose()}}),i.supportsResolve&&(this.resolveDocumentPasteEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};LIe=D([_(3,_o)],LIe);let TIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new TOe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,s){const o=this.dataTransfers.add(i);try{const r=await rw.from(i);if(s.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,s);return a?a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new bs(l)})),kind:c.kind?new bs(c.kind):void 0,additionalEdit:AS(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})):void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};TIe=D([_(3,_o)],TIe);class gKt{constructor(e,t,i,s){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=s}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const s=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,s,i);if(!o||i.isCancellationRequested)return null;const r=Iie(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class fKt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const s=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!s||i.isCancellationRequested)return null;const o=Iie(s);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class pKt{constructor(e,t,i){this._handle=e,this._proxy=t,this._uriService=i}async provideMappedEdits(e,t,i,s){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,s);return o?AS(o,this._uriService):null}}let D8e=class{constructor(e,t,i,s,o){this._languageService=t,this._modelService=i,this._resolverService=s,this._languageStatusService=o,this._disposables=new Z,this._status=new Zo,this._proxy=e.getProxy(et.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(r=>{this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds())}))}dispose(){this._disposables.dispose(),this._status.dispose()}async $changeLanguage(e,t){if(!this._languageService.isRegisteredLanguageId(t))return Promise.reject(new Error(`Unknown language id: ${t}`));const i=P.revive(e),s=await this._resolverService.createModelReference(i);try{s.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{s.dispose()}}async $tokensAtPosition(e,t){const i=P.revive(e),s=this._modelService.getModel(i);if(!s)return;s.tokenization.tokenizeIfCheap(t.lineNumber);const o=s.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new O(t.lineNumber,1+o.getStartOffset(r),t.lineNumber,1+o.getEndOffset(r))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};D8e=D([en(Ue.MainThreadLanguages),_(1,Di),_(2,Ai),_(3,Rn),_(4,BPe)],D8e);let k8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(et.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(s=>{kYe(s)?i.$setLogLevel(s):i.$setLogLevel(s[1],s[0])}))}$log(e,t){const i=this.loggerService.getLogger(P.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[s,o]of t)see(i,s,o)}async $createLogger(e,t){this.loggerService.createLogger(P.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:P.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(P.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(P.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(P.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};k8e=D([en(Ue.MainThreadLogger),_(1,wp)],k8e);yt.registerCommand("_extensionTests.setLogLevel",function(n,e){const t=n.get(wp),i=n.get(Il);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const s=TYe(e);s!==void 0&&t.setLogLevel(s)}});yt.registerCommand("_extensionTests.getLogLevel",function(n){const e=n.get(Ze);return c7(e.getLevel())});const oY="vs/workbench/api/browser/mainThreadMessageService";let I8e=class{constructor(e,t,i,s,o){this._notificationService=t,this._commandService=i,this._dialogService=s,this.extensionsListener=o.onDidChangeExtensions(r=>{for(const a of r.removed)this._notificationService.removeFilter(a.identifier.value)})}dispose(){this.extensionsListener.dispose()}$showMessage(e,t,i,s){return i.modal?this._showModalMessage(e,t,i.detail,s,i.useCustom):this._showMessage(e,t,s,i)}_showMessage(e,t,i,s){return new Promise(o=>{const r=i.map(d=>_l({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;s.source&&(a={label:s.source.label,id:s.source.identifier.value}),a||(a=g(oY,0,"Extension"));const c=[];s.source&&c.push(_l({id:s.source.identifier.value,label:g(oY,1,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",s.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});T.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,s,o){const r=[];let a;for(const l of s){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(oY,2,"Cancel"),run:()=>{}}:a={label:g(oY,3,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};I8e=D([en(Ue.MainThreadMessageService),_(1,Pi),_(2,ji),_(3,To),_(4,ho)],I8e);const mKt=(n,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const s=pMe(ze.wrap(i));return[`GET ws://localhost${n}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${s}`].join(`\r +`+g(8931,"Closing will terminate the running processes in the terminals."):g(8932,"Closing will terminate the running processes in this terminal.")});return t?Gh.DONT_SAVE:Gh.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,n,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=n,this._instantiationService=o,this._configurationService=r,this._lifecycleService=a,this._contextKeyService=c,this._dialogService=l,this.closeHandler=this,this._isDetached=!1,this._isShuttingDown=!1,this._isReverted=!1,this._onDidRequestAttach=this._register(new I),this.onDidRequestAttach=this._onDidRequestAttach.event,this._terminalEditorFocusContextKey=DEe.editorFocus.bindTo(c),t&&this._setupInstanceListeners()}_setupInstanceListeners(){const e=this._terminalInstance;if(!e)return;const t=e.onDidFocus(()=>this._terminalEditorFocusContextKey.set(!0)),i=e.onDidBlur(()=>this._terminalEditorFocusContextKey.reset());this._register(Ee(()=>{!this._isDetached&&!this._isShuttingDown&&e.dispose(kT.User),bt([t,i])}));const n=[e.onExit(o=>{e.waitOnExit||this.dispose()}),e.onDisposed(()=>this.dispose()),e.onTitleChanged(()=>this._onDidChangeLabel.fire()),e.onIconChanged(()=>this._onDidChangeLabel.fire()),t,i,e.statusList.onDidChangePrimaryStatus(()=>this._onDidChangeLabel.fire())];this._lifecycleService.onWillShutdown(o=>{this._isShuttingDown=!0,bt(n),this._configurationService.getValue(Ww.EnablePersistentSessions)&&o.reason===lD.RELOAD?e.detachProcessAndDispose(kT.Shutdown):e.dispose(kT.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!We.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=$qt(this._terminalInstance);t&&e.push(t);const i=Gqt(this._terminalInstance,this._themeService.getColorTheme().type);return i&&e.push(...i),e}detachInstance(){this._isShuttingDown||(this._terminalInstance?.detachFromElement(),this._terminalInstance?.setParentContextKeyService(this._contextKeyService),this._isDetached=!0)}getDescription(){return this._terminalInstance?.description}toUntyped(){return{resource:this.resource,options:{override:zze,pinned:!0,forceReload:!0}}}},sj=YR,YR.ID="workbench.editors.terminal",YR);kEe=sj=D([_(2,pn),_(3,zJe),_(4,we),_(5,Te),_(6,ig),_(7,Le),_(8,to)],kEe);let Qze=class{constructor(e,t,i,n,o){this._editorGroupsService=t,this._configurationService=i,this._logService=n,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new mo,this._proxy=e.getProxy(Ye.ExtHostEditorTabs),this._dispoables.add(o.onDidEditorsChange(r=>{try{this._updateTabsModel(r)}catch{this._logService.error("Failed to update model, rebuilding"),this._createTabsModel()}})),this._dispoables.add(this._multiDiffEditorInputListeners),this._dispoables.add(this._editorGroupsService.onDidAddGroup(()=>this._createTabsModel())),this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(()=>this._createTabsModel())),this._editorGroupsService.whenReady.then(()=>this._createTabsModel())}dispose(){this._groupLookup.clear(),this._tabInfoLookup.clear(),this._dispoables.dispose()}_buildTabObject(e,t,i){const n=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:n,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof EEe)return{kind:ha.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof lb)return{kind:ha.TextInput,uri:e.resource};if(e instanceof op&&!(e instanceof qg)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof lb&&e.secondary instanceof lb&&ji(t,i)&&t&&i?{kind:ha.TextInput,uri:t}:{kind:ha.UnknownInput}}if(e instanceof JT)return{kind:ha.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof oB)return{kind:ha.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Ou)return{kind:ha.WebviewEditorInput,viewType:e.viewType};if(e instanceof kEe)return{kind:ha.TerminalEditorInput};if(e instanceof qg){if(e.modified instanceof lb&&e.original instanceof lb)return{kind:ha.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof JT&&e.original instanceof JT)return{kind:ha.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof _Ee)return{kind:ha.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof Yye)return{kind:ha.ChatEditorInput};if(e instanceof rB){const t=[];for(const i of e?.resources.get()??[])i.originalUri&&i.modifiedUri&&t.push({kind:ha.TextDiffInput,original:i.originalUri,modified:i.modifiedUri});return{kind:ha.MultiDiffEditorInput,diffEditors:t}}return{kind:ha.UnknownInput}}_generateTabId(e,t){let i;const n=Na.getCanonicalUri(e,{supportSideBySide:Hs.BOTH});return n instanceof N?i=n.toString():i=`${n?.primary?.toString()}-${n?.secondary?.toString()}`,`${t}~${e.editorId}-${e.typeId}-${i} `}_onDidGroupActivate(){const e=this._editorGroupsService.activeGroup.id,t=this._groupLookup.get(e);t&&(t.isActive=!0,this._proxy.$acceptTabGroupUpdate(t))}_onDidTabLabelChange(e,t,i){const n=this._generateTabId(t,e),o=this._tabInfoLookup.get(n);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:fh.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const n=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!n||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(n,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:n,editorInput:t,tab:a}),t instanceof rB&&this._multiDiffEditorInputListeners.set(t,M.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(n,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:fh.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:fh.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),n=this._groupLookup.get(e)?.tabs;if(!i||!n){this._createTabsModel();return}const o=n.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof rB&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:fh.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const n=i[t];n.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:n,kind:fh.TAB_UPDATE})}_onDidTabDirty(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n);if(!o){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}o.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o.tab,kind:fh.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=r.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:fh.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!r.isPinned(t),this._proxy.$acceptTabOperation({kind:fh.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,n){const o=this._groupLookup.get(e)?.tabs;if(!o){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const r=o.splice(i,1);r.length!==0&&(o.splice(t,0,r[0]),this._proxy.$acceptTabOperation({kind:fh.TAB_MOVE,groupId:e,tabDto:r[0],index:t,oldIndex:i}))}_createTabsModel(){if(this._editorGroupsService.groups.length===0)return;this._tabGroupModel=[],this._groupLookup.clear(),this._tabInfoLookup.clear();let e=[];for(const t of this._editorGroupsService.groups){const i={groupId:t.id,isActive:t.id===this._editorGroupsService.activeGroup.id,viewColumn:rI(this._editorGroupsService,t),tabs:[]};t.editors.forEach((n,o)=>{const r=this._buildTabObject(t,n,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(n,t.id),{group:t,tab:r,editorInput:n})}),i.tabs=e,this._tabGroupModel.push(i),this._groupLookup.set(t.id,i),e=[]}this._proxy.$acceptEditorTabModel(this._tabGroupModel)}_updateTabsModel(e){const t=e.event,i=e.groupId;switch(t.kind){case Do.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case Do.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case Do.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case Do.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case Do.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case Do.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case Do.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_TRANSIENT:break;case Do.EDITOR_MOVE:if(Cqt(t)&&t.editor&&t.editorIndex!==void 0&&t.oldEditorIndex!==void 0){this._onDidTabMove(i,t.editorIndex,t.oldEditorIndex,t.editor);break}default:this._createTabsModel()}}$moveTab(e,t,i,n){const o=RZ(this._editorGroupsService,this._configurationService,i),r=this._tabInfoLookup.get(e);if(!r?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(r.group.id);if(!l)return;if(this._groupLookup.get(o)===void 0){let h=HW.RIGHT;i===ev&&(h=UW(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(o);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=r?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:n})}async $closeTab(e,t){const i=new Map;for(const o of e){const r=this._tabInfoLookup.get(o),a=r?.tab,c=r?.group,l=r?.editorInput;if(!c||!a||!r||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const n=[];for(const[o,r]of i)n.push(await o.closeEditors(r,{preserveFocus:t}));return n.every(o=>o)}async $closeGroup(e,t){const i=[];for(const n of e){const o=this._editorGroupsService.getGroup(n);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(n=>n)}};Qze=D([Gi(Be.MainThreadEditorTabs),_(1,Po),_(2,Te),_(3,Ge),_(4,ei)],Qze);let jze=class{dispose(){}$onUnexpectedError(e){e&&e.$isError&&(e=l8(e)),vt(e)}};jze=D([Gi(Be.MainThreadErrors)],jze);let Yze=class{constructor(e,t,i,n,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=n,this._hostService=o,this._extensionEnablementService=r,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new Yqt(e.getProxy(Ye.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Be).map(h=>Be[h]))}dispose(){}$getExtension(e){return this._extensionService.getExtension(e)}$activateExtension(e,t){return this._internalExtensionService._activateById(e,t)}async $onWillActivateExtension(e){this._internalExtensionService._onWillActivateExtension(e)}$onDidActivateExtension(e,t,i,n,o){this._internalExtensionService._onDidActivateExtension(e,t,i,n,o)}$onExtensionRuntimeError(e,t){const i=l8(t);this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const n=l8(t);if(this._internalExtensionService._onDidActivateExtensionError(e,n),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>Ra(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(r,c.local);return}else{await this._handleMissingNotInstalledDependency(r,i.dependency);return}}}if(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment){this._notificationService.error(n);return}console.error(n.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:Xe.Error,message:g(4830,"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new rn("reload",g(4831,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const n=this._extensionEnablementService.getEnablementState(t);n===Gr.DisabledByVirtualWorkspace?this._notificationService.notify({severity:Xe.Error,message:g(4832,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",i,t.manifest.displayName||t.manifest.name)}):n===Gr.DisabledByTrustRequirement?this._notificationService.notify({severity:Xe.Error,message:g(4833,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new rn("manageWorkspaceTrust",g(4834,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:Xe.Error,message:g(4835,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new rn("enable",g(4836,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],n===Gr.DisabledGlobally?Gr.EnabledGlobally:Gr.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:Xe.Error,message:g(4837,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",i,t.manifest.displayName||t.manifest.name)})}}async _handleMissingNotInstalledDependency(e,t){const i=e.displayName||e.name;let n=null;try{n=(await this._extensionsWorkbenchService.getExtensions([{id:t}],He.None))[0]}catch{}n?this._notificationService.notify({severity:Xe.Error,message:g(4838,"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",i,n.displayName,n.publisherDisplayName),actions:{primary:[new rn("install",g(4839,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(n).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(4840,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===lo.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===lo.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return ef.uriToBrowserUri(N.revive(e))}async $getAllStaticBrowserUris(){return Array.from(ef.getRegisteredBrowserUris(),e=>[e,ef.uriToBrowserUri(e)])}};Yze=D([Gi(Be.MainThreadExtensionService),_(1,fs),_(2,bi),_(3,Xo),_(4,xc),_(5,Nl),_(6,gXe),_(7,vi),_(8,Jr)],Yze);class Yqt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Jqt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&N.revive(i)}startExtensionHost(e){return this._actual.$startExtensionHost(e)}extensionTestsExecute(){return this._actual.$extensionTestsExecute()}activateByEvent(e,t){return this._actual.$activateByEvent(e,t)}activate(e,t){return this._actual.$activate(e,t)}setRemoteEnvironment(e){return this._actual.$setRemoteEnvironment(e)}updateRemoteConnectionData(e){return this._actual.$updateRemoteConnectionData(e)}deltaExtensions(e){return this._actual.$deltaExtensions(e)}test_latency(e){return this._actual.$test_latency(e)}test_up(e){return this._actual.$test_up(e)}test_down(e){return this._actual.$test_down(e)}}function Jqt(s){return s.type==="ok"?{type:"ok",value:{...s.value,authority:Xqt(s.value.authority)}}:s}function Xqt(s){return{...s,connectTo:Zqt(s.connectTo)}}function Zqt(s){return s.type===qW.WebSocket?new Dit(s.host,s.port):new xit(s.id)}var Wm;let Jze=Wm=class{constructor(e,t){this._fileService=t,this._fileProvider=new mo,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostFileSystem);const i=e.getProxy(Ye.ExtHostFileSystemInfo);for(const n of t.listCapabilities())i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,n){this._fileProvider.set(e,new dPe(this._fileService,t,i,n,e,this._proxy))}$unregisterProvider(e){this._fileProvider.deleteAndDispose(e)}$onFileSystemChange(e,t){const i=this._fileProvider.get(e);if(!i)throw new Error("Unknown file provider");i.$onFileSystemChange(t)}$stat(e){return this._fileService.stat(N.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?lp.Readonly:void 0,type:Wm._asFileType(t)})).catch(Wm._handleError)}$readdir(e){return this._fileService.resolve(N.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=ot.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Wm._asFileType(i)]):[]}).catch(Wm._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=sn.File:e.isDirectory&&(t+=sn.Directory),e.isSymbolicLink&&(t+=sn.SymbolicLink),t}$readFile(e){return this._fileService.readFile(N.revive(e)).then(t=>t.value).catch(Wm._handleError)}$writeFile(e,t){return this._fileService.writeFile(N.revive(e),t).then(()=>{}).catch(Wm._handleError)}$rename(e,t,i){return this._fileService.move(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Wm._handleError)}$copy(e,t,i){return this._fileService.copy(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Wm._handleError)}$mkdir(e){return this._fileService.createFolder(N.revive(e)).then(()=>{}).catch(Wm._handleError)}$delete(e,t){return this._fileService.del(N.revive(e),t).catch(Wm._handleError)}static _handleError(e){if(e instanceof Td)switch(e.fileOperationResult){case Qi.FILE_NOT_FOUND:e.name=ot.FileNotFound;break;case Qi.FILE_IS_DIRECTORY:e.name=ot.FileIsADirectory;break;case Qi.FILE_PERMISSION_DENIED:e.name=ot.NoPermissions;break;case Qi.FILE_MOVE_CONFLICT:e.name=ot.FileExists;break}else if(e instanceof Error){const t=Vk(e);t!==ot.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};Jze=Wm=D([Gi(Be.MainThreadFileSystem),_(1,Jt)],Jze);class dPe{constructor(e,t,i,n,o,r){this.readOnlyMessage=n,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=M.None,this.capabilities=i,this._registration=e.registerProvider(t,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(e,t){const i=Math.random();return this._proxy.$watch(this._handle,i,e,t),Ee(()=>{this._proxy.$unwatch(this._handle,i)})}$onFileSystemChange(e){this._onDidChange.fire(e.map(dPe._createFileChange))}static _createFileChange(e){return{resource:N.revive(e.resource),type:e.type}}stat(e){return this._proxy.$stat(this._handle,e).then(void 0,t=>{throw t})}readFile(e){return this._proxy.$readFile(this._handle,e).then(t=>t.buffer)}writeFile(e,t,i){return this._proxy.$writeFile(this._handle,e,$e.wrap(t),i)}delete(e,t){return this._proxy.$delete(this._handle,e,t)}mkdir(e){return this._proxy.$mkdir(this._handle,e)}readdir(e){return this._proxy.$readdir(this._handle,e)}rename(e,t,i){return this._proxy.$rename(this._handle,e,t,i)}copy(e,t,i){return this._proxy.$copy(this._handle,e,t,i)}open(e,t){return this._proxy.$open(this._handle,e,t)}close(e){return this._proxy.$close(this._handle,e)}read(e,t,i,n,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,n),r.byteLength))}write(e,t,i,n,o){return this._proxy.$write(this._handle,e,t,$e.wrap(i).slice(n,n+o))}}const Koe=class Koe extends V{constructor(e,t,i,n){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=n,this.watcherDisposables=this._register(new wn),this.requests=void 0,this.restartCounter=0}init(){const e=new Z;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){this.canRestart(e,t)?this.restartCounter{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,b,w,y,C){if(w?.isUndoing)return;const A=new ci(C),L=setTimeout(()=>A.cancel(),y),k=await o.withProgress({location:ud.Notification,title:this._progressLabel(b),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(b,v,y,A.token);return U_(z,A.token)},()=>{A.cancel()}).finally(()=>{A.dispose(),clearTimeout(L)});if(!k||k.edit.edits.length===0)return;const P=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let R=a.getBoolean(oj.MementoKeyAdditionalEdits,Ie.PROFILE);if(l.extensionTestsLocationURI&&(R=!1),R===void 0){let z;if(k.extensionNames.length===1?b===Ai.CREATE?z=g(4841,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):b===Ai.COPY?z=g(4842,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):b===Ai.MOVE?z=g(4843,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(4844,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):b===Ai.CREATE?z=g(4845,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):b===Ai.COPY?z=g(4846,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):b===Ai.MOVE?z=g(4847,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(4848,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),P){const{confirmed:G}=await r.confirm({type:Xe.Info,message:z,primaryButton:g(4849,"Show &&Preview"),cancelButton:g(4850,"Skip Changes")});if(R=!0,!G)return}else{let G;(function(ne){ne[ne.OK=0]="OK",ne[ne.Preview=1]="Preview",ne[ne.Cancel=2]="Cancel"})(G||(G={}));const{result:Y,checkboxChecked:j}=await r.prompt({type:Xe.Info,message:z,buttons:[{label:g(4851,"&&OK"),run:()=>G.OK},{label:g(4849,"Show &&Preview"),run:()=>G.Preview}],cancelButton:{label:g(4850,"Skip Changes"),run:()=>G.Cancel},checkbox:{label:g(4852,"Do not ask me again")}});if(Y===G.Cancel)return;R=Y===G.Preview,j&&a.store(oj.MementoKeyAdditionalEdits,R,Ie.PROFILE,an.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await n.apply(By(k.edit,d),{undoRedoGroupId:w?.undoRedoGroupId,showPreview:R})}_progressLabel(v){switch(v){case Ai.CREATE:return g(4853,"Running 'File Create' participants...");case Ai.MOVE:return g(4854,"Running 'File Rename' participants...");case Ai.COPY:return g(4855,"Running 'File Copy' participants...");case Ai.DELETE:return g(4856,"Running 'File Delete' participants...");case Ai.WRITE:return g(4857,"Running 'File Write' participants...")}}};this._listener.add(i.addFileOperationParticipant(m)),this._listener.add(i.onDidRunWorkingCopyFileOperation(v=>this._proxy.$onDidRunFileOperation(v.operation,v.files)))}async $watch(e,t,i,n,o){const r=N.revive(i),a={...n};if(a.recursive)try{(await this._fileService.stat(r)).isDirectory||(a.recursive=!1)}catch{}if(o){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(r,a));c.add(l.onDidChange(d=>{this._proxy.$onFileEvent({session:t,created:d.rawAdded,changed:d.rawUpdated,deleted:d.rawDeleted})})),this._watches.set(t,c)}else{this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(r);if(a.recursive&&a.excludes.length===0){const d=this._configurationService.getValue();if(d.files?.watcherExclude)for(const h in d.files.watcherExclude)h&&d.files.watcherExclude[h]===!0&&a.excludes.push(h)}else if(!a.recursive&&c){const d=this._configurationService.getValue();if(d.files?.watcherExclude){for(const h in d.files.watcherExclude)if(h&&d.files.watcherExclude[h]===!0){a.includes||(a.includes=[]);const u=`${zy(h,"/")}/${I1}`;a.includes.push(eQt(c.uri.fsPath,u))}}if(!a.includes||a.includes.length===0){this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(r,a);this._watches.set(t,l)}}$unwatch(e){this._watches.has(e)&&(this._logService.trace(`MainThreadFileSystemEventService#$unwatch(): request to stop watching (session: ${e})`),this._watches.deleteAndDispose(e))}dispose(){this._listener.dispose(),this._watches.dispose()}},oj=JR,JR.MementoKeyAdditionalEdits="file.particpants.additionalEdits",JR);IEe=oj=D([Gi(Be.MainThreadFileSystemEventService),_(1,Jt),_(2,zb),_(3,PN),_(4,cg),_(5,to),_(6,$i),_(7,Ge),_(8,Za),_(9,ks),_(10,yi),_(11,Ge),_(12,Te)],IEe);At(class extends li{constructor(){super({id:"files.participants.resetChoice",title:{value:g(4858,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get($i).remove(IEe.MementoKeyAdditionalEdits,Ie.PROFILE)}});const xg=Symbol("unset");class xte{constructor(){this.root=new Mue,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||hi.empty()}get entries(){return this.root.children?.entries()||hi.empty()}insert(e,t,i){this.opNode(e,n=>n._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===xg?void 0:i._value))}mutatePath(e,t){this.opNode(e,()=>{},i=>t(i))}delete(e){const t=this.getPathToKey(e);if(!t)return;let i=t.length-1;const n=t[i].node._value;if(n!==xg){for(this._size--,t[i].node._value=xg;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==xg)break;t[i-1].node.children.delete(r)}return n}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let n=t.length-1;n>0;n--){const o=t[n-1];if(o.node.children.delete(t[n].part),o.node.children.size>0||o.node._value!==xg)break}for(const n of Zze(i))n._value!==xg&&(this._size--,yield n._value)}find(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return;t=n}return t._value===xg?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;if(n._value!==xg)return!0;t=n}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return!0}hasKey(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return t._value!==xg}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const n of e){const o=t[i].node.children?.get(n);if(!o)return;t.push({part:n,node:o}),i++}return t}opNode(e,t,i){let n=this.root;for(const a of e){if(n.children)if(n.children.has(a))n=n.children.get(a);else{const c=new Mue;n.children.set(a,c),n=c}else{const c=new Mue;n.children=new Map([[a,c]]),n=c}i?.(n)}const o=n._value===xg?0:1;t(n);const r=n._value===xg?0:1;this._size+=r-o}*values(){for(const{_value:e}of Zze(this.root))e!==xg&&(yield e)}}function*Zze(s){const e=[s];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Mue=class{constructor(){this._value=xg}get value(){return this._value===xg?void 0:this._value}set value(e){this._value=e===void 0?xg:e}};var t_;(function(s){s.Delimiter="\0"})(t_||(t_={}));var Ov;(function(s){s[s.IsSame=0]="IsSame",s[s.Disconnected=1]="Disconnected",s[s.IsChild=2]="IsChild",s[s.IsParent=3]="IsParent"})(Ov||(Ov={}));class vn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new vn([t]);const n=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)n.push(o.id);return n.push(t),new vn(n.reverse())}static isRoot(e){return!e.includes(t_.Delimiter)}static root(e){const t=e.indexOf(t_.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new vn(e.split(t_.Delimiter))}static join(e,t){return new vn([...e.path,t])}static joinToString(e,t){return e.toString()+t_.Delimiter+t}static parentId(e){const t=e.lastIndexOf(t_.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(t_.Delimiter);return t===-1?e:e.slice(t+t_.Delimiter.length)}static isChild(e,t){return t[e.length]===t_.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Ov.IsSame:vn.isChild(e,t)?Ov.IsChild:vn.isChild(t,e)?Ov.IsParent:Ov.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new vn(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let e=1;e<=this.viewEnd;e++)yield new vn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new vn(this.path,e)}compare(e){if(typeof e=="string")return vn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?Ov.IsChild:e.viewEnd"runId"in s;var LH;(function(s){s.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({range:F.lift(t.range),uri:e.asCanonicalUri(N.revive(t.uri))})})(LH||(LH={}));var O_;(function(s){s[s.Error=0]="Error",s[s.Output=1]="Output"})(O_||(O_={}));var Dte;(function(s){s.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),s.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,position:t.position?oe.lift(t.position):void 0})})(Dte||(Dte={}));var kte;(function(s){s.serialize=e=>({message:e.message,type:O_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&LH.serialize(e.location),stackTrace:e.stackTrace?.map(Dte.serialize)}),s.deserialize=(e,t)=>({message:t.message,type:O_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&LH.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>Dte.deserialize(e,i))})})(kte||(kte={}));const iQt=(s,e)=>`${e?"s":"e"}${s}`;var Ite;(function(s){s.serialize=e=>({message:e.message,type:O_.Output,offset:e.offset,length:e.length,location:e.location&&LH.serialize(e.location)}),s.deserialize=(e,t)=>({message:t.message,type:O_.Output,offset:t.offset,length:t.length,location:t.location&&LH.deserialize(e,t.location)})})(Ite||(Ite={}));var p$;(function(s){s.serialize=e=>e.type===O_.Error?kte.serialize(e):Ite.serialize(e),s.deserialize=(e,t)=>t.type===O_.Error?kte.deserialize(e,t):Ite.deserialize(e,t),s.isDiffable=e=>e.type===O_.Error&&e.actual!==void 0&&e.expected!==void 0})(p$||(p$={}));var lz;(function(s){s.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),s.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(p$.serialize)}),s.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>p$.deserialize(e,i))})})(lz||(lz={}));const Bnt="\0",rj=(s,e)=>s+Bnt+e,Wnt=s=>{const e=s.indexOf(Bnt);return{ctrlId:s.slice(0,e),tagId:s.slice(e+1)}};var m$;(function(s){s.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),s.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,range:t.range?F.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(m$||(m$={}));var Ld;(function(s){s[s.NotExpandable=0]="NotExpandable",s[s.Expandable=1]="Expandable",s[s.BusyExpanding=2]="BusyExpanding",s[s.Expanded=3]="Expanded"})(Ld||(Ld={}));var yD;(function(s){s.serialize=e=>({expand:e.expand,item:m$.serialize(e.item)}),s.deserialize=(e,t)=>({controllerId:vn.root(t.item.extId),expand:t.expand,item:m$.deserialize(e,t.item)})})(yD||(yD={}));var _$;(function(s){s.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},s.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?F.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(_$||(_$={}));const TEe=(s,e)=>{e.expand!==void 0&&(s.expand=e.expand),e.item!==void 0&&(s.item=s.item?Object.assign(s.item,e.item):e.item)};var Tte;(function(s){s.serializeWithoutMessages=e=>({...yD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(lz.serializeWithoutMessages)}),s.serialize=e=>({...yD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(lz.serialize)}),s.deserialize=(e,t)=>({...yD.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>lz.deserialize(e,i)),retired:!0})})(Tte||(Tte={}));var LEe;(function(s){s.empty=()=>({covered:0,total:0}),s.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(LEe||(LEe={}));var REe;(function(s){s.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(N.revive(t.uri))}),s.empty=(e,t)=>({id:e,uri:t,statement:LEe.empty()})})(REe||(REe={}));function hPe(s){return{...s,location:s.location?.toJSON()}}function uPe(s){return s.location=s.location?oe.isIPosition(s.location)?oe.lift(s.location):F.lift(s.location):void 0,s}var RH;(function(s){s[s.Declaration=0]="Declaration",s[s.Statement=1]="Statement",s[s.Branch=2]="Branch"})(RH||(RH={}));var MEe;(function(s){s.serialize=e=>e.type===RH.Declaration?Rte.serialize(e):Mte.serialize(e),s.deserialize=e=>e.type===RH.Declaration?Rte.deserialize(e):Mte.deserialize(e)})(MEe||(MEe={}));var Lte;(function(s){s.serialize=hPe,s.deserialize=uPe})(Lte||(Lte={}));var Rte;(function(s){s.serialize=hPe,s.deserialize=uPe})(Rte||(Rte={}));var Mte;(function(s){s.serialize=e=>({...hPe(e),branches:e.branches?.map(Lte.serialize)}),s.deserialize=e=>({...uPe(e),branches:e.branches?.map(Lte.deserialize)})})(Mte||(Mte={}));var fa;(function(s){s[s.Add=0]="Add",s[s.Update=1]="Update",s[s.DocumentSynced=2]="DocumentSynced",s[s.Remove=3]="Remove",s[s.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",s[s.Retire=5]="Retire",s[s.AddTag=6]="AddTag",s[s.RemoveTag=7]="RemoveTag"})(fa||(fa={}));var MH;(function(s){s.deserialize=(e,t)=>t.op===fa.Add?{op:t.op,item:yD.deserialize(e,t.item)}:t.op===fa.Update?{op:t.op,item:_$.deserialize(t.item)}:t.op===fa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,s.serialize=e=>e.op===fa.Add?{op:e.op,item:yD.serialize(e.item)}:e.op===fa.Update?{op:e.op,item:_$.serialize(e.item)}:e})(MH||(MH={}));class nQt{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){const t=this.createChangeCollector();for(const i of e)switch(i.op){case fa.Add:this.add(yD.deserialize(this.uriIdentity,i.item),t);break;case fa.Update:this.update(_$.deserialize(i.item),t);break;case fa.Remove:this.remove(i.itemId,t);break;case fa.Retire:this.retireTest(i.itemId);break;case fa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case fa.AddTag:this._tags.set(i.tag.id,i.tag);break;case fa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=vn.parentId(e.item.extId)?.toString();let n;if(!i)n=this.createItem(e),this.roots.add(n),this.items.set(e.item.extId,n);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),n=this.createItem(e,o),this.items.set(e.item.extId,n)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(n),e.expand===Ld.BusyExpanding&&this.busyControllerCount++,n}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Ld.BusyExpanding&&this.busyControllerCount--,e.expand===Ld.BusyExpanding&&this.busyControllerCount++),TEe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const n=vn.parentId(i.item.extId)?.toString();n?this.items.get(n).children.delete(i.item.extId):this.roots.delete(i);const o=[[e]];for(;o.length;)for(const r of o.pop()){const a=this.items.get(r);a&&(o.push(a.children),this.items.delete(r),t.remove?.(a,a!==i),a.expand===Ld.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Hd;(function(s){s[s.Upsert=0]="Upsert",s[s.SetTags=1]="SetTags",s[s.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",s[s.RemoveChild=3]="RemoveChild",s[s.SetProp=4]="SetProp",s[s.Bulk=5]="Bulk",s[s.DocumentSynced=6]="DocumentSynced"})(Hd||(Hd={}));const I4=(s,e)=>s===e,sQt={range:(s,e)=>s===e?!0:!s||!e?!1:s.equalsRange(e),busy:I4,label:I4,description:I4,error:I4,sortText:I4,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.includes(t)))},oQt=Object.entries(sQt),rQt=(s,e)=>{let t;for(const[i,n]of oQt)n(s[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class aQt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new cn(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new I),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(const t of this.tree.values())this.updateExpandability(t)}get resolveHandler(){return this._resolveHandler}collectDiff(){const e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case fa.DocumentSynced:{for(const t of this.diff)if(t.op===fa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case fa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===fa.Update&&t.item.extId===e.item.extId){TEe(t.item,e.item);return}if(t.op===fa.Add&&t.item.item.extId===e.item.extId){TEe(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){const i=this.tree.get(e);if(i){if((i.expandLevels===void 0||t>i.expandLevels)&&(i.expandLevels=t),i.expand===Ld.Expandable){const n=this.resolveChildren(i);return n.isOpen()?this.expandChildren(i,t-1):n.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Ld.Expanded)return i.resolveBarrier?.isOpen()===!1?i.resolveBarrier.wait().then(()=>this.expandChildren(i,t-1)):this.expandChildren(i,t-1)}}dispose(){for(const e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case Hd.RemoveChild:this.removeItem(vn.joinToString(e.fullId,t.id));break;case Hd.Upsert:this.upsertItem(t.item,e);break;case Hd.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Hd.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Hd.UpdateCanResolveChildren:this.updateExpandability(e);break;case Hd.SetProp:this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Hd.DocumentSynced:this.documentSynced(e.actual.uri);break;default:Z7()}}documentSynced(e){e&&this.pushDiff({op:fa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=vn.fromExtHostTestItem(e,this.root.id,t?.actual),n=this.options.getApiFor(e);n.parent&&n.parent!==t?.actual&&this.options.getChildren(n.parent).delete(e.id);let o=this.tree.get(i.toString());if(!o){o={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Ld.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:fa.Add,item:{controllerId:this.options.controllerId,expand:o.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,o,t);return}if(o.actual===e){this.connectItem(e,o,t);return}if(o.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const r=this.options.getChildren(o.actual),a=o.actual,c=rQt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Ld.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Hd.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(vn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Ld.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const n=new Set(t.map(o=>o.id));for(const o of e)n.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:fa.Update,item:{extId:i,item:{tags:e.map(o=>rj(this.options.controllerId,o.id))}}}),n.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){const t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:fa.AddTag,tag:{id:rj(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:fa.RemoveTag,id:rj(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,i){this.setItemParent(e,i);const n=this.options.getApiFor(e);n.parent=i?.actual,n.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[n,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Ld.Expanded:Ld.BusyExpanding:t=e.actual.canResolveChildren?Ld.Expandable:Ld.NotExpandable:t=Ld.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Ld.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[n,o]of this.options.getChildren(e.actual)){const r=this.expand(vn.joinToString(e.fullId,o.id),t);Qy(r)&&i.push(r)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const o=new qd;return o.open(),o}e.expand=Ld.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new qd,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let n;try{n=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return Qy(n)?n.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){const t=this.tree.get(e);if(!t)throw new Error("attempting to remove non-existent child");this.pushDiff({op:fa.Remove,itemId:e});const i=[t];for(;i.length;){const n=i.pop();if(n){this.options.getApiFor(n.actual).listener=void 0;for(const o of n.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(n.fullId.toString());for(const[o,r]of this.options.getChildren(n.actual))i.push(this.tree.get(vn.joinToString(n.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class cQt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class Nte extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class lQt extends Error{constructor(e,t,i){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${i}".`)}}const dQt=(s,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(n,o){for(const r of i.values())n.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(n){const o=new Map,r=new Set(i.keys()),a={op:Hd.Bulk,ops:[]};for(const c of n){if(!(c instanceof t))throw new Nte(c.id);const l=e(c).controllerId;if(l!==s.controllerId)throw new lQt(c.id,l,s.controllerId);if(o.has(c.id))throw new cQt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Hd.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Hd.RemoveChild,id:c});s.listener?.(a),i=o},add(n){if(!(n instanceof t))throw new Nte(n.id);i.set(n.id,n),s.listener?.({op:Hd.Upsert,item:n})},delete(n){i.delete(n)&&s.listener?.({op:Hd.RemoveChild,id:n})},get(n){return i.get(n)},toJSON(){return Array.from(i.values())}}},Hnt=new WeakMap,hQt=(s,e)=>{const t={controllerId:e};return Hnt.set(s,t),t},qce=s=>{const e=Hnt.get(s);if(!e)throw new Nte(s?.id||"");return e};var MC;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.Assistant=2]="Assistant"})(MC||(MC={}));const t8e={type:"object",properties:{vendor:{type:"string",description:g(3049,"A globally unique vendor of language models.")}}},uQt=eh.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(3050,"Contribute language models of a specific vendor."),oneOf:[t8e,{type:"array",items:t8e}]},activationEventsGenerator:(s,e)=>{for(const t of s)e.push(`onLanguageModelChat:${t.vendor}`)}});let i8e=class{constructor(e,t){this._extensionService=e,this._logService=t,this._store=new Z,this._providers=new Map,this._vendors=new Set,this._onDidChangeProviders=this._store.add(new I),this.onDidChangeLanguageModels=this._onDidChangeProviders.event,this._store.add(uQt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!dl(o.description,"chatProvider")){o.collector.error(g(3051,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of hi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(3052,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(Gu(r.vendor)){o.collector.error(g(3053,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(3054,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const n=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),n.push(o));n.length>0&&this._onDidChangeProviders.fire({removed:n})}))}dispose(){this._store.dispose(),this._providers.clear()}getLanguageModelIds(){return Array.from(this._providers.keys())}lookupLanguageModel(e){return this._providers.get(e)?.metadata}async selectLanguageModels(e){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`);else{const i=Array.from(this._vendors).map(n=>this._extensionService.activateByEvent(`onLanguageModelChat:${n}`));await Promise.all(i)}const t=[];for(const[i,n]of this._providers)(e.vendor===void 0||n.metadata.vendor===e.vendor)&&(e.family===void 0||n.metadata.family===e.family)&&(e.version===void 0||n.metadata.version===e.version)&&(e.identifier===void 0||n.metadata.id===e.identifier)&&(!n.metadata.targetExtensions||n.metadata.targetExtensions.some(o=>Sn.equals(o,e.extension)))&&t.push(i);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelChat(e,t){if(this._logService.trace("[LM] registering language model chat",e,t.metadata),!this._vendors.has(t.metadata.vendor))throw new Error(`Chat response provider uses UNKNOWN vendor ${t.metadata.vendor}.`);if(this._providers.has(e))throw new Error(`Chat response provider with identifier ${e} is already registered.`);return this._providers.set(e,t),this._onDidChangeProviders.fire({added:[{identifier:e,metadata:t.metadata}]}),Ee(()=>{this._providers.delete(e)&&(this._onDidChangeProviders.fire({removed:[e]}),this._logService.trace("[LM] UNregistered language model chat",e,t.metadata))})}async sendChatRequest(e,t,i,n,o){const r=this._providers.get(e);if(!r)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return r.sendChatRequest(i,t,n,o)}computeTokenLength(e,t,i){const n=this._providers.get(e);if(!n)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return n.provideTokenCount(t,i)}};i8e=D([_(0,fs),_(1,Ge)],i8e);var Wb;(function(s){function e(i){const{selectionStartLineNumber:n,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new bs(n-1,o-1),l=new bs(r-1,a-1);return new cC(c,l)}s.to=e;function t(i){const{anchor:n,active:o}=i;return{selectionStartLineNumber:n.line+1,selectionStartColumn:n.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}s.from=t})(Wb||(Wb={}));var et;(function(s){function e(i){if(!i)return;const{start:n,end:o}=i;return{startLineNumber:n.line+1,startColumn:n.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}s.from=e;function t(i){if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=i;return new Jn(n-1,o-1,r-1,a-1)}s.to=t})(et||(et={}));var CD;(function(s){function e(i){return{uri:i.uri,range:et.from(i.range)}}s.from=e;function t(i){return new yp(N.revive(i.uri),et.to(i.range))}s.to=t})(CD||(CD={}));var NEe;(function(s){function e(t){switch(t){case nr.Comment:return LS.Comment;case nr.Other:return LS.Other;case nr.RegEx:return LS.RegEx;case nr.String:return LS.String}}s.to=e})(NEe||(NEe={}));var Yo;(function(s){function e(i){return new bs(i.lineNumber-1,i.column-1)}s.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}s.from=t})(Yo||(Yo={}));var NH;(function(s){function e(n,o,r){return Fi(H_(n).map(a=>t(a,o,r)))}s.from=e;function t(n,o,r){if(typeof n=="string")return{$serialized:!0,language:n,isBuiltin:r?.isBuiltin};if(n)return{$serialized:!0,language:n.language,scheme:i(n.scheme,o),pattern:Gf.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType,isBuiltin:r?.isBuiltin}}function i(n,o){return o&&typeof n=="string"?o.transformOutgoingScheme(n):n}})(NH||(NH={}));var Pte;(function(s){function e(i){switch(i){case Bx.Unnecessary:return u_.Unnecessary;case Bx.Deprecated:return u_.Deprecated}}s.from=e;function t(i){switch(i){case u_.Unnecessary:return Bx.Unnecessary;case u_.Deprecated:return Bx.Deprecated;default:return}}s.to=t})(Pte||(Pte={}));var PH;(function(s){function e(i){let n;return i.code&&(Lt(i.code)||lc(i.code)?n=String(i.code):n={value:String(i.code.value),target:i.code.target}),{...et.from(i.range),message:i.message,source:i.source,code:n,severity:Ote.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(Fte.from),tags:Array.isArray(i.tags)?Fi(i.tags.map(Pte.from)):void 0}}s.from=e;function t(i){const n=new I9(et.to(i),i.message,Ote.to(i.severity));return n.source=i.source,n.code=Lt(i.code)?i.code:i.code?.value,n.relatedInformation=i.relatedInformation&&i.relatedInformation.map(Fte.to),n.tags=i.tags&&Fi(i.tags.map(Pte.to)),n}s.to=t})(PH||(PH={}));var Fte;(function(s){function e(i){return{...et.from(i.location.range),message:i.message,resource:i.location.uri}}s.from=e;function t(i){return new XW(new yp(i.resource,et.to(i)),i.message)}s.to=t})(Fte||(Fte={}));var Ote;(function(s){function e(i){switch(i){case Bd.Error:return Ws.Error;case Bd.Warning:return Ws.Warning;case Bd.Information:return Ws.Info;case Bd.Hint:return Ws.Hint}return Ws.Error}s.from=e;function t(i){switch(i){case Ws.Info:return Bd.Information;case Ws.Warning:return Bd.Warning;case Ws.Error:return Bd.Error;case Ws.Hint:return Bd.Hint;default:return Bd.Error}}s.to=t})(Ote||(Ote={}));var xl;(function(s){function e(i){return typeof i=="number"&&i>=rH.One?i-1:i===rH.Beside?ev:hA}s.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}s.to=t})(xl||(xl={}));function gQt(s){return typeof s.range<"u"}function Unt(s){return s.length===0?!0:!!gQt(s[0])}var Ps;(function(s){function e(a){return a.map(s.from)}s.fromMany=e;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function i(a){let c;if(t(a)){const{language:u,value:f}=a;c={value:"```"+u+` +`+f+"\n```\n"}}else df.isMarkdownString(a)?c={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?c={value:a}:c={value:""};const l=Object.create(null);c.uris=l;const d=u=>{try{let f=N.parse(u,!0);f=f.with({query:n(f.query,l)}),l[u]=f}catch{}return""},h=new zu.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(VQe(u).href):"",zu(c.value,{renderer:h}),c}s.from=i;function n(a,c){if(!a)return a;let l;try{l=j2(a)}catch{}if(!l)return a;let d=!1;return l=S2(l,h=>{if(N.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return c[u]=h,d=!0,u}else return}),d?JSON.stringify(l):a}function o(a){const c=new df(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?N.from(a.baseUri):void 0,c}s.to=o;function r(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=r})(Ps||(Ps={}));function fQt(s){return Unt(s)?s.map(e=>({range:et.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Ps.fromMany(e.hoverMessage):e.hoverMessage?Ps.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):s.map(e=>({range:et.from(e)}))}function Qce(s){return typeof s>"u"?s:typeof s=="string"?N.file(s):s}var FH;(function(s){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?Qce(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}s.from=e})(FH||(FH={}));var Bte;(function(s){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Qce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?FH.from(t.before):void 0,after:t.after?FH.from(t.after):void 0}}s.from=e})(Bte||(Bte={}));var PEe;(function(s){function e(t){if(typeof t>"u")return t;switch(t){case Hx.OpenOpen:return ni.AlwaysGrowsWhenTypingAtEdges;case Hx.ClosedClosed:return ni.NeverGrowsWhenTypingAtEdges;case Hx.OpenClosed:return ni.GrowsOnlyWhenTypingBefore;case Hx.ClosedOpen:return ni.GrowsOnlyWhenTypingAfter}}s.from=e})(PEe||(PEe={}));var FEe;(function(s){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?PEe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?Bte.from(t.light):void 0,dark:t.dark?Bte.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?Qce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?FH.from(t.before):void 0,after:t.after?FH.from(t.after):void 0}}s.from=e})(FEe||(FEe={}));var od;(function(s){function e(i){return{text:i.newText,eol:i.newEol&&WH.from(i.newEol),range:et.from(i.range)}}s.from=e;function t(i){const n=new VA(et.to(i.range),i.text);return n.newEol=typeof i.eol>"u"?void 0:WH.to(i.eol),n}s.to=t})(od||(od={}));var Yu;(function(s){function e(i,n){const o={edits:[]};if(i instanceof hI){const r=new Dk;for(const a of i._allEntries())a._type===vc.File&&N.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===vc.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:mTe($e.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),o.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===vc.Text?o.edits.push({resource:a.uri,textEdit:od.from(a.edit),versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Snippet?o.edits.push({resource:a.uri,textEdit:{range:et.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:n?.getNotebookDocumentVersion(a.uri)}):a._type===vc.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:n?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:dI.Replace,index:a.index,count:a.count,cells:a.cells.map(S$.from)}})}return o}s.from=e;function t(i){const n=new hI,o=new ui;for(const r of i.edits)if(r.textEdit){const a=r,c=N.revive(a.resource),l=et.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=Nce.replace(l,new uI(d)):u=VA.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else n.renameFile(N.revive(r.oldResource),N.revive(r.newResource),r.options);for(const[r,a]of o)n.set(r,a);return n}s.to=t})(Yu||(Yu={}));var iv;(function(s){const e=Object.create(null);e[_r.File]=pt.File,e[_r.Module]=pt.Module,e[_r.Namespace]=pt.Namespace,e[_r.Package]=pt.Package,e[_r.Class]=pt.Class,e[_r.Method]=pt.Method,e[_r.Property]=pt.Property,e[_r.Field]=pt.Field,e[_r.Constructor]=pt.Constructor,e[_r.Enum]=pt.Enum,e[_r.Interface]=pt.Interface,e[_r.Function]=pt.Function,e[_r.Variable]=pt.Variable,e[_r.Constant]=pt.Constant,e[_r.String]=pt.String,e[_r.Number]=pt.Number,e[_r.Boolean]=pt.Boolean,e[_r.Array]=pt.Array,e[_r.Object]=pt.Object,e[_r.Key]=pt.Key,e[_r.Null]=pt.Null,e[_r.EnumMember]=pt.EnumMember,e[_r.Struct]=pt.Struct,e[_r.Event]=pt.Event,e[_r.Operator]=pt.Operator,e[_r.TypeParameter]=pt.TypeParameter;function t(n){return typeof e[n]=="number"?e[n]:pt.Property}s.from=t;function i(n){for(const o in e)if(e[o]===n)return Number(o);return _r.Property}s.to=i})(iv||(iv={}));var zA;(function(s){function e(i){switch(i){case eH.Deprecated:return y8.Deprecated}}s.from=e;function t(i){switch(i){case y8.Deprecated:return eH.Deprecated}}s.to=t})(zA||(zA={}));var v$;(function(s){function e(i){return{name:i.name,kind:iv.from(i.kind),tags:i.tags&&i.tags.map(zA.from),containerName:i.containerName,location:hf.from(i.location)}}s.from=e;function t(i){const n=new tH(i.name,iv.to(i.kind),i.containerName,hf.to(i.location));return n.tags=i.tags&&i.tags.map(zA.to),n}s.to=t})(v$||(v$={}));var OEe;(function(s){function e(i){const n={name:i.name||"!!MISSING: name!!",detail:i.detail,range:et.from(i.range),selectionRange:et.from(i.selectionRange),kind:iv.from(i.kind),tags:i.tags?.map(zA.from)??[]};return i.children&&(n.children=i.children.map(e)),n}s.from=e;function t(i){const n=new iH(i.name,i.detail,iv.to(i.kind),et.to(i.range),et.to(i.selectionRange));return eo(i.tags)&&(n.tags=i.tags.map(zA.to)),i.children&&(n.children=i.children.map(t)),n}s.to=t})(OEe||(OEe={}));var gN;(function(s){function e(i){const n=new Pce(iv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,name:i.name,detail:i.detail,kind:iv.from(i.kind),uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(zA.from)}}s.from=t})(gN||(gN={}));var BEe;(function(s){function e(t){return new UNe(gN.to(t.from),t.fromRanges.map(i=>et.to(i)))}s.to=e})(BEe||(BEe={}));var WEe;(function(s){function e(t){return new VNe(gN.to(t.to),t.fromRanges.map(i=>et.to(i)))}s.to=e})(WEe||(WEe={}));var hf;(function(s){function e(i){return{range:i.range&&et.from(i.range),uri:i.uri}}s.from=e;function t(i){return new yp(N.revive(i.uri),et.to(i.range))}s.to=t})(hf||(hf={}));var b$;(function(s){function e(i){const n=i,o=i;return{originSelectionRange:n.originSelectionRange?et.from(n.originSelectionRange):void 0,uri:n.targetUri?n.targetUri:o.uri,range:et.from(n.targetRange?n.targetRange:o.range),targetSelectionRange:n.targetSelectionRange?et.from(n.targetSelectionRange):void 0}}s.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:et.to(i.range),targetSelectionRange:i.targetSelectionRange?et.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?et.to(i.originSelectionRange):void 0}}s.to=t})(b$||(b$={}));var w$;(function(s){function e(i){return{range:et.from(i.range),contents:Ps.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}s.from=e;function t(i){const n=i.contents.map(Ps.to),o=et.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new L9(n,o,r,a)}s.to=t})(w$||(w$={}));var HEe;(function(s){function e(i){return{range:et.from(i.range),expression:i.expression}}s.from=e;function t(i){return new Y9(et.to(i.range),i.expression)}s.to=t})(HEe||(HEe={}));var Wte;(function(s){function e(i){if(i instanceof J9)return{type:"text",range:et.from(i.range),text:i.text};if(i instanceof X9)return{type:"variable",range:et.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof Z9)return{type:"expression",range:et.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}s.from=e;function t(i){switch(i.type){case"text":return{range:et.to(i.range),text:i.text};case"variable":return{range:et.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:et.to(i.range),expression:i.expression}}}s.to=t})(Wte||(Wte={}));var Hte;(function(s){function e(i){return{frameId:i.frameId,stoppedLocation:et.from(i.stoppedLocation)}}s.from=e;function t(i){return new jAe(i.frameId,et.to(i.stoppedLocation))}s.to=t})(Hte||(Hte={}));var OH;(function(s){function e(i){return{range:et.from(i.range),kind:i.kind}}s.from=e;function t(i){return new R9(et.to(i.range),i.kind)}s.to=t})(OH||(OH={}));var UEe;(function(s){function e(i){return{uri:i.uri,highlights:i.highlights.map(OH.from)}}s.from=e;function t(i){return new M9(N.revive(i.uri),i.highlights.map(OH.to))}s.to=t})(UEe||(UEe={}));var VEe;(function(s){function e(t){switch(t){case Ku.TriggerCharacter:return VT.TriggerCharacter;case Ku.TriggerForIncompleteCompletions:return VT.TriggerForIncompleteCompletions;case Ku.Invoke:default:return VT.Invoke}}s.to=e})(VEe||(VEe={}));var zEe;(function(s){function e(t){return{triggerKind:VEe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}s.to=e})(zEe||(zEe={}));var Ute;(function(s){function e(i){switch(i){case oH.Deprecated:return I2.Deprecated}}s.from=e;function t(i){switch(i){case I2.Deprecated:return oH.Deprecated}}s.to=t})(Ute||(Ute={}));var Vte;(function(s){const e=new Map([[Zi.Method,Me.Method],[Zi.Function,Me.Function],[Zi.Constructor,Me.Constructor],[Zi.Field,Me.Field],[Zi.Variable,Me.Variable],[Zi.Class,Me.Class],[Zi.Interface,Me.Interface],[Zi.Struct,Me.Struct],[Zi.Module,Me.Module],[Zi.Property,Me.Property],[Zi.Unit,Me.Unit],[Zi.Value,Me.Value],[Zi.Constant,Me.Constant],[Zi.Enum,Me.Enum],[Zi.EnumMember,Me.EnumMember],[Zi.Keyword,Me.Keyword],[Zi.Snippet,Me.Snippet],[Zi.Text,Me.Text],[Zi.Color,Me.Color],[Zi.File,Me.File],[Zi.Reference,Me.Reference],[Zi.Folder,Me.Folder],[Zi.Event,Me.Event],[Zi.Operator,Me.Operator],[Zi.TypeParameter,Me.TypeParameter],[Zi.Issue,Me.Issue],[Zi.User,Me.User]]);function t(o){return e.get(o)??Me.Property}s.from=t;const i=new Map([[Me.Method,Zi.Method],[Me.Function,Zi.Function],[Me.Constructor,Zi.Constructor],[Me.Field,Zi.Field],[Me.Variable,Zi.Variable],[Me.Class,Zi.Class],[Me.Interface,Zi.Interface],[Me.Struct,Zi.Struct],[Me.Module,Zi.Module],[Me.Property,Zi.Property],[Me.Unit,Zi.Unit],[Me.Value,Zi.Value],[Me.Constant,Zi.Constant],[Me.Enum,Zi.Enum],[Me.EnumMember,Zi.EnumMember],[Me.Keyword,Zi.Keyword],[Me.Snippet,Zi.Snippet],[Me.Text,Zi.Text],[Me.Color,Zi.Color],[Me.File,Zi.File],[Me.Reference,Zi.Reference],[Me.Folder,Zi.Folder],[Me.Event,Zi.Event],[Me.Operator,Zi.Operator],[Me.TypeParameter,Zi.TypeParameter],[Me.User,Zi.User],[Me.Issue,Zi.Issue]]);function n(o){return i.get(o)??Zi.Property}s.to=n})(Vte||(Vte={}));var $Ee;(function(s){function e(t,i){const n=new B9(t.label);return n.insertText=t.insertText,n.kind=Vte.to(t.kind),n.tags=t.tags?.map(Ute.to),n.detail=t.detail,n.documentation=dd(t.documentation)?Ps.to(t.documentation):t.documentation,n.sortText=t.sortText,n.filterText=t.filterText,n.preselect=t.preselect,n.commitCharacters=t.commitCharacters,F.isIRange(t.range)?n.range=et.to(t.range):typeof t.range=="object"&&(n.range={inserting:et.to(t.range.insert),replacing:et.to(t.range.replace)}),n.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Yg.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Yg.InsertAsSnippet?n.insertText=new uI(t.insertText):(n.insertText=t.insertText,n.textEdit=n.range instanceof Jn?new VA(n.range,n.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(n.additionalTextEdits=t.additionalTextEdits.map(o=>od.to(o))),n.command=i&&t.command?i.fromInternal(t.command):void 0,n}s.to=e})($Ee||($Ee={}));var zte;(function(s){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Ps.fromStrict(i.documentation)}}s.from=e;function t(i){return{label:i.label,documentation:dd(i.documentation)?Ps.to(i.documentation):i.documentation}}s.to=t})(zte||(zte={}));var $te;(function(s){function e(i){return{label:i.label,documentation:Ps.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(zte.from):[],activeParameter:i.activeParameter}}s.from=e;function t(i){return{label:i.label,documentation:dd(i.documentation)?Ps.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(zte.to):[],activeParameter:i.activeParameter}}s.to=t})($te||($te={}));var y$;(function(s){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map($te.from):[]}}s.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map($te.to):[]}}s.to=t})(y$||(y$={}));var GEe;(function(s){function e(t,i){const n=new O9(Yo.to(i.position),typeof i.label=="string"?i.label:i.label.map(KEe.to.bind(void 0,t)),i.kind&&Gte.to(i.kind));return n.textEdits=i.textEdits&&i.textEdits.map(od.to),n.tooltip=dd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,n.paddingLeft=i.paddingLeft,n.paddingRight=i.paddingRight,n}s.to=e})(GEe||(GEe={}));var KEe;(function(s){function e(t,i){const n=new F9(i.label);return n.tooltip=dd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,Fj.is(i.command)&&(n.command=t.fromInternal(i.command)),i.location&&(n.location=hf.to(i.location)),n}s.to=e})(KEe||(KEe={}));var Gte;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(Gte||(Gte={}));var XT;(function(s){function e(i){return{range:et.from(i.range),url:i.target,tooltip:i.tooltip}}s.from=e;function t(i){let n;if(i.url)try{n=typeof i.url=="string"?N.parse(i.url,!0):N.revive(i.url)}catch{}const o=new H9(et.to(i.range),n);return o.tooltip=i.tooltip,o}s.to=t})(XT||(XT={}));var Kte;(function(s){function e(i){const n=new V9(i.label);return i.textEdit&&(n.textEdit=od.to(i.textEdit)),i.additionalTextEdits&&(n.additionalTextEdits=i.additionalTextEdits.map(o=>od.to(o))),n}s.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?od.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(n=>od.from(n)):void 0}}s.from=t})(Kte||(Kte={}));var BH;(function(s){function e(i){return new sN(i[0],i[1],i[2],i[3])}s.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}s.from=t})(BH||(BH={}));var qEe;(function(s){function e(i){return{range:et.from(i.range)}}s.from=e;function t(i){return new sH(et.to(i.range))}s.to=t})(qEe||(qEe={}));var qte;(function(s){function e(t){switch(t){case Cn.AUTO:return zT.AfterDelay;case Cn.EXPLICIT:return zT.Manual;case Cn.FOCUS_CHANGE:case Cn.WINDOW_CHANGE:return zT.FocusOut}}s.to=e})(qte||(qte={}));var aB;(function(s){function e(i){switch(i){case o_.Off:return wr.Off;case o_.Relative:return wr.Relative;case o_.Interval:return wr.Interval;case o_.On:default:return wr.On}}s.from=e;function t(i){switch(i){case wr.Off:return o_.Off;case wr.Relative:return o_.Relative;case wr.Interval:return o_.Interval;case wr.On:default:return o_.On}}s.to=t})(aB||(aB={}));var WH;(function(s){function e(i){if(i===D_.CRLF)return Sh.CRLF;if(i===D_.LF)return Sh.LF}s.from=e;function t(i){if(i===Sh.CRLF)return D_.CRLF;if(i===Sh.LF)return D_.LF}s.to=t})(WH||(WH={}));var QEe;(function(s){function e(t){if(typeof t=="object")return t.viewId;switch(t){case _D.SourceControl:return ud.Scm;case _D.Window:return ud.Window;case _D.Notification:return ud.Notification}throw new Error("Unknown 'ProgressLocation'")}s.from=e})(QEe||(QEe={}));var Qte;(function(s){function e(i){const n={start:i.start+1,end:i.end+1};return i.kind&&(n.kind=jte.from(i.kind)),n}s.from=e;function t(i){const n={start:i.start-1,end:i.end-1};return i.kind&&(n.kind=jte.to(i.kind)),n}s.to=t})(Qte||(Qte={}));var jte;(function(s){function e(i){if(i)switch(i){case Uw.Comment:return l_.Comment;case Uw.Imports:return l_.Imports;case Uw.Region:return l_.Region}}s.from=e;function t(i){if(i)switch(i.value){case l_.Comment.value:return Uw.Comment;case l_.Imports.value:return Uw.Imports;case l_.Region.value:return Uw.Region}}s.to=t})(jte||(jte={}));var dz;(function(s){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?et.from(t.selection):void 0,override:typeof t.override=="boolean"?rm.id:void 0}}s.from=e})(dz||(dz={}));var Gf;(function(s){function e(o){return o instanceof GT?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new GT(o.baseUri??o.base,o.pattern).toJSON():o}s.from=e;function t(o){const r=o;return r?N.isUri(r.baseUri)&&typeof r.pattern=="string":!1}function i(o){const r=o;return r?typeof r.base=="string"&&typeof r.pattern=="string":!1}function n(o){return typeof o=="string"?o:new GT(N.revive(o.baseUri),o.pattern)}s.to=n})(Gf||(Gf={}));var jEe;(function(s){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Gf.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}s.from=e})(jEe||(jEe={}));var Yte;(function(s){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(n=>Array.isArray(n)&&n.every(o=>o&&typeof o=="object"&&"uri"in o&&N.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof Jn)))}s.is=e;function t(i){return{documents:i.documents.map(n=>n.map(o=>({uri:N.from(o.uri),version:o.version,ranges:o.ranges.map(r=>et.from(r))})))}}s.from=t})(Yte||(Yte={}));var Wy;(function(s){function e(i){return{start:i.start,end:i.end}}s.from=e;function t(i){return new Sy(i.start,i.end)}s.to=t})(Wy||(Wy={}));var HH;(function(s){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}s.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}s.from=t})(HH||(HH={}));var YEe;(function(s){function e(t){if(t===nz.Unconfirmed)return cN.Pending;if(t===nz.Pending)return;if(t===nz.Executing)return cN.Executing;throw new Error(`Unknown state: ${t}`)}s.to=e})(YEe||(YEe={}));var C$;(function(s){function e(i){switch(i){case zx.Markup:return EF.Markup;case zx.Code:default:return EF.Code}}s.from=e;function t(i){switch(i){case EF.Markup:return zx.Markup;case EF.Code:default:return zx.Code}}s.to=t})(C$||(C$={}));var OE;(function(s){function e(i){const n={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)rG.validate(o),n.cells.push(S$.from(o));return n}s.from=e;function t(i){const n=new KNe(i.cells.map(S$.to));return CA(i.metadata)||(n.metadata=i.metadata),n}s.to=t})(OE||(OE={}));var S$;(function(s){function e(i){return{cellKind:C$.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:HH.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(pI.from):[]}}s.from=e;function t(i){return new rG(C$.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(pI.to):void 0,i.metadata,i.internalMetadata?HH.to(i.internalMetadata):void 0)}s.to=t})(S$||(S$={}));var UH;(function(s){function e(i){return{mime:i.mime,valueBytes:$e.wrap(i.data)}}s.from=e;function t(i){return new qNe(i.valueBytes.buffer,i.mime)}s.to=t})(UH||(UH={}));var pI;(function(s){function e(i){return{outputId:i.id,items:i.items.map(UH.from),metadata:i.metadata}}s.from=e;function t(i){const n=i.items.map(UH.to);return new i$(n,i.outputId,i.metadata)}s.to=t})(pI||(pI={}));var Jte;(function(s){function e(n){return i(n)?{include:Gf.from(n.include)??void 0,exclude:Gf.from(n.exclude)??void 0}:Gf.from(n)??void 0}s.from=e;function t(n){return i(n)?{include:Gf.to(n.include),exclude:Gf.to(n.exclude)}:Gf.to(n)}s.to=t;function i(n){const o=n;return o?!ra(o.include)&&!ra(o.exclude):!1}})(Jte||(Jte={}));var JEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===n$.Left?Mee.Left:Mee.Right,command:i.toInternal(o,n),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}s.from=e})(JEe||(JEe={}));var XEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,n),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}s.from=e})(XEe||(XEe={}));var ZEe;(function(s){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}s.from=e})(ZEe||(ZEe={}));var Xte;(function(s){function e(i){return{uri:i.uri,provides:i.provides}}s.from=e;function t(i){return new QNe(N.revive(i.uri),i.provides)}s.to=t})(Xte||(Xte={}));var VH;(function(s){function e(i){return{message:Ps.fromStrict(i.message)||"",type:O_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:et.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(n=>({label:n.label,position:n.position&&Yo.from(n.position),uri:n.file&&N.revive(n.file).toJSON()}))}}s.from=e;function t(i){const n=new lN(typeof i.message=="string"?i.message:Ps.to(i.message));return n.actualOutput=i.actual,n.expectedOutput=i.expected,n.contextValue=i.contextValue,n.location=i.location?hf.to(i.location):void 0,n}s.to=t})(VH||(VH={}));var Hb;(function(s){s.namespace=rj,s.denamespace=Wnt})(Hb||(Hb={}));var mI;(function(s){function e(i){const n=qce(i).controllerId;return{extId:vn.fromExtHostTestItem(i,n).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>Hb.namespace(n,o.id)),range:F.lift(et.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Ps.fromStrict(i.error)||null}}s.from=e;function t(i){return{parent:void 0,error:void 0,id:vn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(n=>{const{tagId:o}=Hb.denamespace(n);return new yH(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:et.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}s.toPlain=t})(mI||(mI={}));(function(s){function e(i){return{id:i.id}}s.from=e;function t(i){return new yH(i.id)}s.to=t})(Hb||(Hb={}));var exe;(function(s){const e=(i,n)=>{const o=i.value;if(!o)return;const r={...mI.toPlain(o.item),parent:n,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===O_.Error).map(VH.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,r);c&&r.children.push(c)}return r};function t(i){const n=new xte;for(const a of i.items)n.insert(vn.fromString(a.item.extId).path,a);const o=[n.nodes],r=[];for(;o.length;)for(const a of o.pop())a.value?r.push(a):a.children&&o.push(a.children.values());return{completedAt:i.completedAt,results:r.map(a=>e(a)).filter(Fc)}}s.to=t})(exe||(exe={}));var Zte;(function(s){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Yo.from(o):et.from(o)}function i(o){if(typeof o.executed=="number"&&o.executed<0)throw new Error(`Invalid coverage count ${o.executed}`);return"branches"in o?{count:o.executed,location:t(o.location),type:RH.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:RH.Declaration,name:o.name,count:o.executed,location:t(o.location)}}s.fromDetails=i;function n(o,r,a){return ij(a.statementCoverage),ij(a.branchCoverage),ij(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testIds:a instanceof dN&&a.fromTests.length?a.fromTests.map(c=>vn.fromExtHostTestItem(c,o).toString()):void 0}}s.fromFile=n})(Zte||(Zte={}));var txe;(function(s){function e(t){switch(t){case Ch.Invoke:return nH.Invoke;case Ch.Auto:return nH.Automatic}}s.to=e})(txe||(txe={}));var ZT;(function(s){function e(i){const n=new Oce(iv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,kind:iv.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(zA.from)}}s.from=t})(ZT||(ZT={}));var eie;(function(s){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}s.from=e})(eie||(eie={}));var tie;(function(s){function e(o,r,a){const c=r.fileData;return c?new G9t(new K9t(c.name,N.revive(c.uri),c.id,hm(()=>a(c.id)))):o===Us.uriList&&r.uriListData?new jee(n(r.uriListData)):new jee(r.asString)}s.to=e;async function t(o,r){const a=await r.asString();if(o===Us.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=r.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}s.from=t;function i(o){return Zk.split(o).map(r=>{if(r.startsWith("#"))return r;try{return N.parse(r)}catch{}return r})}function n(o){return Zk.create(o.map(r=>typeof r=="string"?r:N.revive(r)))}})(tie||(tie={}));var B_;(function(s){function e(i,n){const o=i.items.map(([r,a])=>[r,tie.to(r,a,n)]);return new lH(o)}s.toDataTransfer=e;async function t(i){const n={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{n.items.push([r,await tie.from(r,a)])})());return await Promise.all(o),n}s.from=t})(B_||(B_={}));var A$;(function(s){function e(i,n){return{kind:"reply",agentId:i.participant??n?.agentId??"",subCommand:i.command??n?.command,message:i.prompt,title:i.label}}s.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}s.to=t})(A$||(A$={}));var iie;(function(s){function e(i){switch(i){case MC.System:return Kp.System;case MC.User:return Kp.User;case MC.Assistant:return Kp.Assistant}}s.to=e;function t(i){switch(i){case Kp.System:return MC.System;case Kp.User:return MC.User;case Kp.Assistant:return MC.Assistant}return MC.User}s.from=t})(iie||(iie={}));var IF;(function(s){function e(i){let n="",o;i.content.type==="text"?n=i.content.value:o=new h$(i.content.name,i.content.value,i.content.isError);const r=iie.to(i.role),a=new rPe(r,n,i.name);return o!==void 0&&(a.content2=o),a}s.to=e;function t(i){const n=iie.from(i.role),o=i.name;let r;return i.content2 instanceof h$?r={type:"function_result",name:i.content2.name,value:i.content2.content,isError:i.content2.isError}:r={type:"text",value:i.content},{role:n,name:o,content:r}}s.from=t})(IF||(IF={}));var E$;(function(s){function e(i){return{kind:"markdownContent",content:Ps.from(i.value)}}s.from=e;function t(i){return new aG(Ps.to(i.content))}s.to=t})(E$||(E$={}));var nie;(function(s){function e(i){return{kind:"markdownVuln",content:Ps.from(i.value),vulnerabilities:i.vulnerabilities}}s.from=e;function t(i){return new SH(Ps.to(i.content),i.vulnerabilities)}s.to=t})(nie||(nie={}));var sie;(function(s){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}s.from=e;function t(i){return new AH(i.agentId,i.command)}s.to=t})(sie||(sie={}));var oie;(function(s){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}s.from=e})(oie||(oie={}));var x$;(function(s){function e(i){const{value:n,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=N.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:_i(o),uri:o,children:r(n,o)}}}s.from=e;function t(i){const n=Mo(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=n.uri,a=n.children?o(n.children):[];return new cG(a,r)}s.to=t})(x$||(x$={}));var D$;(function(s){function e(i){const n=o=>N.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:n(i.value)?i.value:CD.from(i.value)}}s.from=e;function t(i){const n=Mo(i);return new lG(N.isUri(n.inlineReference)?n.inlineReference:CD.to(n.inlineReference),i.name)}s.to=t})(D$||(D$={}));var zH;(function(s){function e(i){return{kind:"progressMessage",content:Ps.from(i.value)}}s.from=e;function t(i){return new EH(i.content.value)}s.to=t})(zH||(zH={}));var k$;(function(s){function e(i){return{kind:"warning",content:Ps.from(i.value)}}s.from=e;function t(i){return new xH(i.content.value)}s.to=t})(k$||(k$={}));var ixe;(function(s){function e(t){return{kind:"progressTask",content:Ps.from(t.value)}}s.from=e})(ixe||(ixe={}));var nxe;(function(s){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Ps.from(t):void 0}}s.from=e})(nxe||(nxe={}));var I$;(function(s){function e(i,n,o){return{kind:"command",command:n.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}s.from=e;function t(i,n){return new dG(n.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}s.to=t})(I$||(I$={}));var rie;(function(s){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(n=>od.from(n))}}s.from=e;function t(i){return new DH(N.revive(i.uri),i.edits.map(n=>od.to(n)))}s.to=t})(rie||(rie={}));var fA;(function(s){function e(i){const n=We.isThemeIcon(i.iconPath)?i.iconPath:N.isUri(i.iconPath)?{light:N.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&N.isUri(i.iconPath.light)&&N.isUri(i.iconPath.dark)?{light:N.revive(i.iconPath.light),dark:N.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:N.isUri(i.value.value)||!i.value.value?i.value.value:CD.from(i.value.value)},iconPath:n,options:i.options}:{kind:"reference",reference:N.isUri(i.value)?i.value:CD.from(i.value),iconPath:n,options:i.options}}s.from=e;function t(i){const n=Mo(i),o=r=>N.isUri(r)?r:CD.to(r);return new kb("variableName"in n.reference?{variableName:n.reference.variableName,value:n.reference.value&&o(n.reference.value)}:o(n.reference))}s.to=t})(fA||(fA={}));var aie;(function(s){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}s.from=e})(aie||(aie={}));var cie;(function(s){function e(n,o,r){return n instanceof aG?E$.from(n):n instanceof lG?D$.from(n):n instanceof kb?fA.from(n):n instanceof EH?zH.from(n):n instanceof cG?x$.from(n):n instanceof dG?I$.from(n,o,r):n instanceof DH?rie.from(n):n instanceof SH?nie.from(n):n instanceof AH?sie.from(n):n instanceof xH?k$.from(n):n instanceof l$?oie.from(n):n instanceof d$?aie.from(n):{kind:"markdownContent",content:Ps.from("")}}s.from=e;function t(n,o){switch(n.kind){case"reference":return fA.to(n);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(n,o)}}s.to=t;function i(n,o){switch(n.kind){case"markdownContent":return E$.to(n);case"inlineReference":return D$.to(n);case"progressMessage":return;case"treeData":return x$.to(n);case"command":return I$.to(n,o)}}s.toContent=i})(cie||(cie={}));var sxe;(function(s){function e(t,i){const n=t.variables.variables.filter(r=>r.isTool).map(r=>r.id),o=t.variables.variables.filter(r=>!r.isTool);return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:o.map(lie.to),location:T$.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,requestedTools:n}}s.to=e})(sxe||(sxe={}));var T$;(function(s){function e(i){switch(i){case Ir.Notebook:return r_.Notebook;case Ir.Terminal:return r_.Terminal;case Ir.Panel:return r_.Panel;case Ir.Editor:return r_.Editor}}s.to=e;function t(i){switch(i){case r_.Notebook:return Ir.Notebook;case r_.Terminal:return Ir.Terminal;case r_.Panel:return Ir.Panel;case r_.Editor:return Ir.Editor}}s.from=t})(T$||(T$={}));var lie;(function(s){function e(t){const i=t.value;if(!i)throw new Error("Invalid value reference");return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:lfe(i)?N.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&lfe(i.uri)?CD.to(Mo(i)):i,modelDescription:t.modelDescription}}s.to=e})(lie||(lie={}));var oxe;(function(s){function e(t,i,n){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,n)}}s.from=e})(oxe||(oxe={}));var cB;(function(s){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}s.to=e})(cB||(cB={}));var rxe;(function(s){function e(t,i,n){if(i.action.kind==="vote")return;const o=cB.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:n.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:A$.to(i.action.followup)},result:o}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:o}:{action:i.action,result:o}}s.to=e})(rxe||(rxe={}));var die;(function(s){function e(t,i,n){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,n)}s.from=e})(die||(die={}));var axe;(function(s){function e(t){return{kind:cxe.to(t.kind)}}s.to=e})(axe||(axe={}));var cxe;(function(s){function e(t){switch(t){case Jx.Word:return Wx.Word;case Jx.Line:return Wx.Line;case Jx.Suggest:return Wx.Suggest;default:return Wx.Unknown}}s.to=e})(cxe||(cxe={}));var lxe;(function(s){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||KSe.None,contextValue:t.contextValue}}s.from=e})(lxe||(lxe={}));var dxe;(function(s){function e(t){return{name:t.name,description:t.description,parametersSchema:t.parametersSchema}}s.to=e})(dxe||(dxe={}));class gPe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Fi(Array.from(e,([,i])=>i.asFile()))),{id:t,dispose:()=>{this.dataTransferFiles.delete(t)}}}async resolveFileData(e,t){const i=this.dataTransferFiles.get(e);if(!i)throw new Error("No data transfer found");const n=i.find(o=>o.id===t);if(!n)throw new Error("No matching file found in data transfer");return $e.wrap(await n.data())}dispose(){this.dataTransferFiles.clear()}}var n8e;(function(s){s.CallsTo="incomingCalls",s.CallsFrom="outgoingCalls"})(n8e||(n8e={}));const Vnt=new oo;class hie{static async create(e,t,i){const[n]=Vnt.ordered(e);if(!n)return;const o=await n.prepareCallHierarchy(e,t,i);if(o)return new hie(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new K1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends hie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const hz=new Map;_t.registerCommand("_executePrepareCallHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await hie.create(o,i,He.None);return a?(hz.set(a.id,a),hz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),hz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function znt(s){return!0}_t.registerCommand("_executeProvideIncomingCalls",async(s,...e)=>{const[t]=e;Tt(znt());const i=hz.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,He.None)});_t.registerCommand("_executeProvideOutgoingCalls",async(s,...e)=>{const[t]=e;Tt(znt());const i=hz.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,He.None)});var hxe;(function(s){const e=[];function t(n){let o=n;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}s.register=t;function i(){return e.slice(0)}s.all=i})(hxe||(hxe={}));var uxe;(function(s){s[s.Idle=0]="Idle",s[s.Searching=1]="Searching",s[s.SlowSearch=2]="SlowSearch"})(uxe||(uxe={}));new Q("searchState",uxe.Idle);var s8e;(function(s){s.Subtypes="subtypes",s.Supertypes="supertypes"})(s8e||(s8e={}));const $nt=new oo;class uie{static async create(e,t,i){const[n]=$nt.ordered(e);if(!n)return;const o=await n.prepareTypeHierarchy(e,t,i);if(o)return new uie(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new K1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends uie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const uz=new Map;_t.registerCommand("_executePrepareTypeHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await uie.create(o,i,He.None);return a?(uz.set(a.id,a),uz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),uz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function Gnt(s){const e=s;return typeof s=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&N.isUri(e.uri)&&F.isIRange(e.range)&&F.isIRange(e.selectionRange)}_t.registerCommand("_executeProvideSupertypes",async(s,...e)=>{const[t]=e;Tt(Gnt(t));const i=uz.get(t._sessionId);if(i)return i.provideSupertypes(t,He.None)});_t.registerCommand("_executeProvideSubtypes",async(s,...e)=>{const[t]=e;Tt(Gnt(t));const i=uz.get(t._sessionId);if(i)return i.provideSubtypes(t,He.None)});var Eo;let o8e=Eo=class extends V{constructor(e,t,i,n,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=n,this._uriIdentService=o,this._registrations=this._register(new mo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(Ye.ExtHostLanguageFeatures),this._languageService){const r=()=>{const a=[];for(const c of t.getRegisteredLanguageIds()){const l=this._languageConfigurationService.getLanguageConfiguration(c).getWordDefinition();a.push({languageId:c,regexSource:l.source,regexFlags:l.flags})}this._proxy.$setWordDefinitions(a)};this._register(this._languageConfigurationService.onDidChange(a=>{if(!a.languageId)r();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),r()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Eo._reviveLocationDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Eo._reviveLocationLinkDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach(Eo._reviveWorkspaceSymbolDto),e):(e.location=Eo._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>By(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=N.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(n,o)=>this._proxy.$provideDocumentSymbols(e,n.uri,o)}))}$registerCodeLensSupport(e,t,i){const n={provideCodeLenses:async(o,r)=>{const a=await this._proxy.$provideCodeLenses(e,o.uri,r);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(o,r,a)=>{const c=await this._proxy.$resolveCodeLens(e,r,a);if(c)return{...c,range:o.validateRange(c.range)}}};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),n.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,n))}$emitCodeLensEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.definitionProvider.register(t,{provideDefinition:(i,n,o)=>this._proxy.$provideDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,n,o)=>this._proxy.$provideDeclaration(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,n,o)=>this._proxy.$provideImplementation(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,n,o)=>this._proxy.$provideTypeDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,n,o,r)=>{const a={verbosityRequest:r?.verbosityRequest?{verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:{id:r.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,n,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,n,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,n,o)}))}$registerInlineValuesProvider(e,t,i){const n={provideInlineValues:(o,r,a,c)=>this._proxy.$provideInlineValues(e,o.uri,r,a,c)};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),n.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,n))}$emitInlineValuesEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.documentHighlightProvider.register(t,{provideDocumentHighlights:(i,n,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,n,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,n,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,n,o.map(a=>a.uri),r).then(a=>{if(uU(a))return;const c=new ui;return a?.forEach(l=>{const d=N.revive(l.uri);c.has(d)?c.get(d).push(...l.highlights):c.set(d,l.highlights)}),c})}))}$registerLinkedEditingRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.linkedEditingRangeProvider.register(t,{provideLinkedEditingRanges:async(i,n,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,n,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Eo._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,n,o,r)=>this._proxy.$provideReferences(e,i.uri,n,o,r).then(Eo._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,n,o,r){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:Eo._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:n,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=By(d.edit,this._uriIdentService)),d.command&&(c.command=d.command),c}),this._registrations.set(e,this._languageFeaturesService.codeActionProvider.register(t,a))}$registerPasteEditProvider(e,t,i){const n=new gxe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentPasteEditProvider.register(t,n),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const n=this._pasteEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,n){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,n,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentRangeFormattingEdits:(r,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,r.uri,a,c,l),provideDocumentRangesFormattingEdits:o?(r,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,r.uri,a,c,l):void 0}))}$registerOnTypeFormattingSupport(e,t,i,n){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:n,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const n={provideWorkspaceSymbols:async(o,r)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,o,r);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,Eo._reviveWorkspaceSymbolDto(a.symbols)}};t&&(n.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&Eo._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,hxe.register(n))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(n,o,r,a)=>this._proxy.$provideRenameEdits(e,n.uri,o,r,a).then(c=>By(c,this._uriIdentService)),resolveRenameLocation:i?(n,o,r)=>this._proxy.$resolveRenameLocation(e,n.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,n,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,n,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,n){let o;if(typeof n=="number"){const r=new I;this._registrations.set(n,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new pQt(this._proxy,e,i,o)))}$emitDocumentSemanticTokensEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentRangeSemanticTokensProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentRangeSemanticTokensProvider.register(t,new mQt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const n=t[Li.label],o=t[Li.commandId],r=t[Li.commandIdent],a=t[Li.commitCharacters];return{label:n,extensionId:i,kind:t[Li.kind]??Me.Property,tags:t[Li.kindModifier],detail:t[Li.detail],documentation:t[Li.documentation],sortText:t[Li.sortText],filterText:t[Li.filterText],preselect:t[Li.preselect],insertText:t[Li.insertText]??(typeof n=="string"?n:n.label),range:t[Li.range]??e,insertTextRules:t[Li.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Li.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Li.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,n,o){const r={triggerCharacters:i,_debugDisplayName:`${o.value}(${i.join("")})`,provideCompletionItems:async(a,c,l,d)=>{const h=await this._proxy.$provideCompletionItems(e,a.uri,c,l,d);return h&&{suggestions:h[Ay.completions].map(u=>Eo._inflateSuggestDto(h[Ay.defaultRanges],u,o)),incomplete:h[Ay.isIncomplete]||!1,duration:h[Ay.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};n&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=Eo._inflateSuggestDto(a.range,l,o);return gp(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,n,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),provideInlineEdits:async(a,c,l,d)=>this._proxy.$provideInlineEdits(e,a.uri,c,l,d),handleItemDidShow:async(a,c,l)=>{i&&await this._proxy.$handleInlineCompletionDidShow(e,a.pid,c.idx,l)},handlePartialAccept:async(a,c,l,d)=>{i&&await this._proxy.$handleInlineCompletionPartialAccept(e,a.pid,c.idx,l,d)},freeInlineCompletions:a=>{this._proxy.$freeInlineCompletionsList(e,a.pid)},groupId:n,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${n})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const n={provideInlineEdit:async(o,r,a)=>this._proxy.$provideInlineEdit(e,o.uri,r,a),freeInlineEdit:o=>{this._proxy.$freeInlineEdit(e,o.pid)}};this._registrations.set(e,this._languageFeaturesService.inlineEditProvider.register(t,n))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(n,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,n.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,n,o){const r={displayName:o,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Mo(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(r.resolveInlayHint=async(a,c)=>{const l=a;if(!l.cacheId)return a;const d=await this._proxy.$resolveInlayHint(e,l.cacheId,c);if(c.isCancellationRequested)throw new Ma;return d?{...a,tooltip:d.tooltip,label:Mo(d.label),textEdits:d.textEdits}:a}),typeof n=="number"){const a=new I;this._registrations.set(n,a),r.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,r))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const n={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map(Eo._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(n.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&Eo._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,n))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(n,o)=>i.$provideDocumentColors(e,n.uri,o).then(r=>r.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(n,o,r)=>i.$provideColorPresentations(e,n.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,n){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof n=="number"){const r=new I;this._registrations.set(n,r),o.onDidChange=r.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,o))}$emitFoldingRangeEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerSelectionRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.selectionRangeProvider.register(t,{provideSelectionRanges:(i,n,o)=>this._proxy.$provideSelectionRanges(e,i.uri,n,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,Vnt.register(t,{prepareCallHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,n,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.to=Eo._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.from=Eo._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:Eo._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:Eo._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Eo._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Eo._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:Eo._reviveRegExp(e.beforeText),afterText:e.afterText?Eo._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Eo._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map(Eo._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const n={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Eo._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Eo._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Eo._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?n.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(n.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(n.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,n,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,$nt.register(t,{prepareTypeHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,n,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const n=new fxe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentDropEditProvider.register(t,n),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const n=this._documentOnDropEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t,i){const n=new _Qt(i,e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,n))}};o8e=Eo=D([Gi(Be.MainThreadLanguageFeatures),_(1,xi),_(2,Vs),_(3,it),_(4,ks)],o8e);let gxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new gPe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new Yn(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await B_.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new lce;for(const[u,f]of d.items)h.replace(u,q6(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await B_.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,o.uri,r,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new Yn(f.kind.value):new Yn(""),yieldTo:f.yieldTo?.map(p=>({kind:new Yn(p)})),additionalEdit:f.additionalEdit?By(f.additionalEdit,this._uriIdentService,p=>this.resolveFileData(d.id,p)):void 0})),dispose:()=>{this._proxy.$releasePasteEdits(this._handle,d.id)}}:void 0}finally{d.dispose()}}),i.supportsResolve&&(this.resolveDocumentPasteEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=By(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};gxe=D([_(3,ks)],gxe);let fxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new gPe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=By(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,n){const o=this.dataTransfers.add(i);try{const r=await B_.from(i);if(n.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,n);return a?{edits:a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new Yn(l)})),kind:c.kind?new Yn(c.kind):void 0,additionalEdit:By(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})),dispose:()=>{this._proxy.$releaseDocumentOnDropEdits(this._handle,o.id)}}:void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};fxe=D([_(3,ks)],fxe);class pQt{constructor(e,t,i,n){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=n}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const n=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,n,i);if(!o||i.isCancellationRequested)return null;const r=iZ(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class mQt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const n=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!n||i.isCancellationRequested)return null;const o=iZ(n);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class _Qt{constructor(e,t,i,n){this.displayName=e,this._handle=t,this._proxy=i,this._uriService=n}async provideMappedEdits(e,t,i,n){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,n);return o?By(o,this._uriService):null}}let r8e=class{constructor(e,t,i,n,o){this._languageService=t,this._modelService=i,this._resolverService=n,this._languageStatusService=o,this._disposables=new Z,this._status=new mo,this._proxy=e.getProxy(Ye.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(r=>{this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds())}))}dispose(){this._disposables.dispose(),this._status.dispose()}async $changeLanguage(e,t){if(!this._languageService.isRegisteredLanguageId(t))return Promise.reject(new Error(`Unknown language id: ${t}`));const i=N.revive(e),n=await this._resolverService.createModelReference(i);try{n.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{n.dispose()}}async $tokensAtPosition(e,t){const i=N.revive(e),n=this._modelService.getModel(i);if(!n)return;n.tokenization.tokenizeIfCheap(t.lineNumber);const o=n.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new F(t.lineNumber,1+o.getStartOffset(r),t.lineNumber,1+o.getEndOffset(r))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};r8e=D([Gi(Be.MainThreadLanguages),_(1,xi),_(2,gi),_(3,fn),_(4,Yae)],r8e);let a8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(Ye.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(n=>{mQe(n)?i.$setLogLevel(n):i.$setLogLevel(n[1],n[0])}))}$log(e,t){const i=this.loggerService.getLogger(N.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[n,o]of t)LY(i,n,o)}async $createLogger(e,t){this.loggerService.createLogger(N.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:N.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(N.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(N.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(N.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};a8e=D([Gi(Be.MainThreadLogger),_(1,uf)],a8e);_t.registerCommand("_extensionTests.setLogLevel",function(s,e){const t=s.get(uf),i=s.get(Za);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const n=bQe(e);n!==void 0&&t.setLogLevel(n)}});_t.registerCommand("_extensionTests.getLogLevel",function(s){const e=s.get(Ge);return r3(e.getLevel())});let c8e=class{constructor(e,t,i,n,o){this._notificationService=t,this._commandService=i,this._dialogService=n,this.extensionsListener=o.onDidChangeExtensions(r=>{for(const a of r.removed)this._notificationService.removeFilter(a.identifier.value)})}dispose(){this.extensionsListener.dispose()}$showMessage(e,t,i,n){return i.modal?this._showModalMessage(e,t,i.detail,n,i.useCustom):this._showMessage(e,t,n,i)}_showMessage(e,t,i,n){return new Promise(o=>{const r=i.map(d=>rl({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;n.source&&(a={label:n.source.label,id:n.source.identifier.value}),a||(a=g(4859,"Extension"));const c=[];n.source&&c.push(rl({id:n.source.identifier.value,label:g(4860,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",n.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});M.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,n,o){const r=[];let a;for(const l of n){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(4861,"Cancel"),run:()=>{}}:a={label:g(4862,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};c8e=D([Gi(Be.MainThreadMessageService),_(1,bi),_(2,vi),_(3,to),_(4,fs)],c8e);const vQt=(s,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const n=mTe($e.wrap(i));return[`GET ws://localhost${s}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${n}`].join(`\r `)+`\r \r -`},L8e=ze.fromString(`\r +`},l8e=$e.fromString(`\r \r -`);async function _Kt(n,e,t,i,s){n.write(ze.fromString(mKt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(n.onData(l=>{c?c=ze.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(L8e);if(d===-1)return;r(n),n.pauseData();const h=c.slice(d+L8e.byteLength);h.byteLength&&s.onData.fire(h)})),o.add(n.onClose(l=>a(l??new Error("socket closed")))),o.add(n.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw n.dispose(),r}finally{o.dispose()}}let vKt=class extends ${constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new r1),this.onData=(...i)=>(this.pausableDataEmitter.isPaused&&queueMicrotask(()=>this.pausableDataEmitter.resume()),this.pausableDataEmitter.event(...i)),this.didDisposeEmitter=this._register(new I),this.onDidDispose=this.didDisposeEmitter.event,this.ended=!1,this._register(t.onData),this._register(t.onData.event(i=>this.pausableDataEmitter.fire(i))),this.onClose=this._register(t.onClose).event,this.onEnd=this._register(t.onEnd).event}pauseData(){this.pausableDataEmitter.pause()}drain(){return Promise.resolve()}end(){this.ended=!0,this.closeRemote()}traceSocketEvent(e,t){WDe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},T8e=class extends ${constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(et.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(s){return s.id===e}connect(s,o,r,a){return new Promise((c,l)=>{if(s.id!==e)return l(new Error("Invalid connectTo"));const d=s.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),ROe.connect(h,t._proxy,o,r,a,u).then(f=>{f.onDidDispose(()=>t._remoteSockets.delete(h)),c(f)},f=>{t._remoteSockets.delete(h),l(f)})}).catch(l)})}};this._registrations.set(e,this._remoteSocketFactoryService.register(KV.Managed,i))}async $unregisterSocketFactory(e){this._registrations.get(e)?.dispose()}$onDidManagedSocketHaveData(e,t){this._remoteSockets.get(e)?.onData.fire(t)}$onDidManagedSocketClose(e,t){this._remoteSockets.get(e)?.onClose.fire({type:qne.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};T8e=D([en(Ue.MainThreadManagedSockets),_(1,yPe)],T8e);class ROe extends vKt{static connect(e,t,i,s,o,r){const a=new ROe(e,t,o,r);return _Kt(a,i,s,o,r)}constructor(e,t,i,s){super(i,s),this.socketId=e,this.proxy=t}write(e){this.proxy.$remoteSocketWrite(this.socketId,e)}closeRemote(){this.proxy.$remoteSocketEnd(this.socketId)}drain(){return this.proxy.$remoteSocketDrain(this.socketId)}}const rY="workbench.panel.output";new Y("inOutput",!1);new Y("activeLogOutput",!1);new Y("activeLogOutput.levelSettable",!1);new Y("activeLogOutput.level","");new Y("activeLogOutput.levelIsDefault",!1);new Y("outputView.scrollLock",!1);var aH;(function(n){n[n.Append=1]="Append",n[n.Replace=2]="Replace",n[n.Clear=3]="Clear"})(aH||(aH={}));const drt={OutputChannels:"workbench.contributions.outputChannels"};class wKt{constructor(){this.channels=new Map,this._onDidRegisterChannel=new I,this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=new I,this.onDidRemoveChannel=this._onDidRemoveChannel.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){const e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}removeChannel(e){this.channels.delete(e),this._onDidRemoveChannel.fire(e)}}it.add(drt.OutputChannels,new wKt);new Y("activeOutputChannel","");var NX,zP;let R8e=(zP=class extends ${constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(et.ExtHostOutputService);const s=()=>{const o=this._viewsService.isViewVisible(rY)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(T.any(this._outputService.onActiveOutputChannel,T.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===rY))(()=>s())),s()}async $register(e,t,i,s){const o=(NX._extensionIdPool.get(s)||0)+1;NX._extensionIdPool.set(s,o);const r=`extension-output-${s}-#${o}-${e}`,a=P.revive(t);return it.as(drt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:s}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const s=this._getChannel(e);s&&(t===aH.Append?s.update(t):Kc(i)&&s.update(t,i))}async $reveal(e,t){const i=this._getChannel(e);i&&this._outputService.showChannel(i.id,t)}async $close(e){if(this._viewsService.isViewVisible(rY)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(rY)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},NX=zP,zP._extensionIdPool=new Map,zP);R8e=NX=D([en(Ue.MainThreadOutputService),_(1,nhe),_(2,q_)],R8e);const bKt="vs/workbench/api/browser/mainThreadProgress";class CKt extends xn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let M8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(et.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const s=this._createTask(e);t.location===ch.Notification&&i&&(t={...t,location:ch.Notification,secondaryActions:[new CKt(i,g(bKt,0,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,s,()=>this._proxy.$acceptProgressCanceled(e))}$progressReport(e,t){this._progress.get(e)?.progress.report(t)}$progressEnd(e){const t=this._progress.get(e);t&&(t.resolve(),this._progress.delete(e))}_createTask(e){return t=>new Promise(i=>{this._progress.set(e,{resolve:i,progress:t})})}};M8e=D([en(Ue.MainThreadProgress),_(1,Cf),_(2,ji)],M8e);let N8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new Zo,this.proxy=e.getProxy(et.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,s){const o={label:i,rootUri:P.revive(s),selector:t,isSCM:!1,getOriginalResource:async a=>P.revive(await this.proxy.$provideOriginalResource(e,a,qe.None))},r=this.quickDiffService.addQuickDiffProvider(o);this.providerDisposables.set(e,r)}async $unregisterQuickDiffProvider(e){this.providerDisposables.has(e)&&this.providerDisposables.deleteAndDispose(e)}dispose(){this.providerDisposables.dispose()}};N8e=D([en(Ue.MainThreadQuickDiff),_(1,DQ)],N8e);function P8e(n){n.dark=P.revive(n.dark),n.light&&(n.light=P.revive(n.light))}let F8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(et.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const s=new Promise((o,r)=>{this._items[e]={resolve:o,reject:r}});return t={...t,onDidFocus:o=>{o&&this._proxy.$onItemSelected(o.handle)}},t.canPickMany?this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.handle})}$setItems(e,t){return this._items[e]&&(this._items[e].resolve(t),delete this._items[e]),Promise.resolve()}$setError(e,t){return this._items[e]&&(this._items[e].reject(t),delete this._items[e]),Promise.resolve()}$input(e,t,i){const s=Object.create(null);return e&&(s.title=e.title,s.password=e.password,s.placeHolder=e.placeHolder,s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.value=e.value,s.ignoreFocusLost=e.ignoreFocusOut),t&&(s.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(s,i)}$createOrUpdate(e){const t=e.id;let i=this.sessions.get(t);if(!i){const r=e.type==="quickPick"?this._quickInputService.createQuickPick():this._quickInputService.createInputBox();if(r.onDidAccept(()=>{this._proxy.$onDidAccept(t)}),r.onDidTriggerButton(a=>{this._proxy.$onDidTriggerButton(t,a.handle)}),r.onDidChangeValue(a=>{this._proxy.$onDidChangeValue(t,a)}),r.onDidHide(()=>{this._proxy.$onDidHide(t)}),e.type==="quickPick"){const a=r;a.onDidChangeActive(c=>{this._proxy.$onDidChangeActive(t,c.map(l=>l.handle))}),a.onDidChangeSelection(c=>{this._proxy.$onDidChangeSelection(t,c.map(l=>l.handle))}),a.onDidTriggerItemButton(c=>{this._proxy.$onDidTriggerItemButton(t,c.item.handle,c.button.handle)})}i={input:r,handlesToItems:new Map},this.sessions.set(t,i)}const{input:s,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?s.show():s.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&P8e(c.iconPath),c))),o.set(a.handle,a))}),s[r]=e[r]):r==="activeItems"||r==="selectedItems"?s[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?s[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&P8e(a.iconPath),a)):s[r]=e[r]);return Promise.resolve(void 0)}$dispose(e){const t=this.sessions.get(e);return t&&(t.input.dispose(),this.sessions.delete(e)),Promise.resolve(void 0)}};F8e=D([en(Ue.MainThreadQuickOpen),_(1,On)],F8e);let O8e=class extends ${constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(et.ExtHostExtensionService);const s=this._environmentService.remoteAuthority;s&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(s);o&&this._proxy.$updateRemoteConnectionData(o)}))}};O8e=D([TO,_(1,ec),_(2,rA)],O8e);const yKt="vs/workbench/api/browser/mainThreadSaveParticipant";class SKt{constructor(e){this._proxy=e.getProxy(et.ExtHostDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.textEditorModel||!gS(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(yKt,0,"Aborted onWillSaveTextDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason).then(c=>{if(!c.every(l=>l))return Promise.reject(new Error("listener failed"))}).then(r,a)});return qle(o,s)}}let B8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(SKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};B8e=D([TO,_(1,be),_(2,tr)],B8e);let W8e=class{constructor(e,t,i){this.speechService=t,this.logService=i,this.providerRegistrations=new Map,this.speechToTextSessions=new Map,this.textToSpeechSessions=new Map,this.keywordRecognitionSessions=new Map,this.proxy=e.getProxy(et.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const s=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None};const a=new Z,c=Math.random();this.proxy.$createSpeechToTextSession(e,c,r?.language);const l=a.add(new I);return this.speechToTextSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelSpeechToTextSession(c),this.speechToTextSessions.delete(c),a.dispose()})),{onDidChange:l.event}},createTextToSpeechSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None,synthesize:async()=>{}};const a=new Z,c=Math.random();this.proxy.$createTextToSpeechSession(e,c,r?.language);const l=a.add(new I);return this.textToSpeechSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelTextToSpeechSession(c),this.textToSpeechSessions.delete(c),a.dispose()})),{onDidChange:l.event,synthesize:async d=>{await this.proxy.$synthesizeSpeech(c,d),await dw(T.toPromise(T.filter(l.event,h=>h.status===lye.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:T.None};const r=new Z,a=Math.random();this.proxy.$createKeywordRecognitionSession(e,a);const c=r.add(new I);return this.keywordRecognitionSessions.set(a,{onDidChange:c}),r.add(o.onCancellationRequested(()=>{this.proxy.$cancelKeywordRecognitionSession(a),this.keywordRecognitionSessions.delete(a),r.dispose()})),{onDidChange:c.event}}});this.providerRegistrations.set(e,{dispose:()=>{s.dispose()}})}$unregisterProvider(e){const t=this.providerRegistrations.get(e);t&&(t.dispose(),this.providerRegistrations.delete(e))}$emitSpeechToTextEvent(e,t){this.speechToTextSessions.get(e)?.onDidChange.fire(t)}$emitTextToSpeechEvent(e,t){this.textToSpeechSessions.get(e)?.onDidChange.fire(t)}$emitKeywordRecognitionEvent(e,t){this.keywordRecognitionSessions.get(e)?.onDidChange.fire(t)}dispose(){this.providerRegistrations.forEach(e=>e.dispose()),this.providerRegistrations.clear(),this.speechToTextSessions.forEach(e=>e.onDidChange.dispose()),this.speechToTextSessions.clear(),this.textToSpeechSessions.forEach(e=>e.onDidChange.dispose()),this.textToSpeechSessions.clear(),this.keywordRecognitionSessions.forEach(e=>e.onDidChange.dispose()),this.keywordRecognitionSessions.clear()}};W8e=D([en(Ue.MainThreadSpeech),_(1,Xde),_(2,Ze)],W8e);const AKt="vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant";class EKt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(et.ExtHostWorkspace)}async participate(e,t){const i=new Promise((s,o)=>{setTimeout(()=>o(new Error(g(AKt,0,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(s,o)});return qle(i,t)}}let H8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(EKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};H8e=D([TO,_(1,be),_(2,EPe)],H8e);let E8=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return Qi.basename(this.relativePath)}constructor(e,t,i,s=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=s,this.parent=o,this._children=new Map}get(e){return this._children.get(e)}set(e,t){this._children.set(e,t)}delete(e){this._children.delete(e)}clear(){this._children.clear()}};E8.__decorator=D([ii],E8.prototype,"name",null);function hrt(n,e){typeof n.element<"u"&&e.push(n.element);for(const t of n.children)hrt(t,e);return e}class xKt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return hrt(e,[])}static isResourceNode(e){return e instanceof E8}constructor(e,t=P.file("/"),i=Fn){this.extUri=i,this.root=new E8(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,s=new N$(!1).reset(i);let o=this.root,r="";for(;;){const a=s.value();r=r+"/"+a;let c=o.get(a);if(c?s.hasNext()||(c.element=t):(c=new E8(this.extUri.joinPath(this.root.uri,r),r,this.root.context,s.hasNext()?void 0:t,o),o.set(a,c)),o=c,!s.hasNext())return;s.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),s=e.get(i);if(s){if(t.hasNext()){const o=this._delete(s,t.next());return typeof o<"u"&&s.childrenCount===0&&e.delete(i),o}return e.delete(i),s.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);let s=this.root;for(;;){const o=i.value(),r=s.get(o);if(!r||!i.hasNext())return r;s=r,i.next()}}}function U8e(n){if(n!==void 0){if(P.isUri(n))return P.revive(n);if($e.isThemeIcon(n))return n;{const e=n;return{light:P.revive(e.light),dark:P.revive(e.dark)}}}}class DKt extends ${constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(_e.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class kKt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??P.file("/");this._resourceTree=new xKt(this,e,this._uriIdentService.extUri);for(const t of this.resources)this._resourceTree.add(t.sourceUri,t)}return this._resourceTree}get hideWhenEmpty(){return!!this.features.hideWhenEmpty}constructor(e,t,i,s,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=s,this.label=o,this.id=r,this.multiDiffEditorEnableViewChanges=a,this._uriIdentService=c,this.resources=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event}toJSON(){return{$mid:Fs.ScmResourceGroup,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(e,t,i){this.resources.splice(e,t,...i),this._resourceTree=void 0,this._onDidChangeResources.fire()}$updateGroup(e){this.features={...this.features,...e},this._onDidChange.fire()}$updateGroupLabel(e){this.label=e,this._onDidChange.fire()}}class IKt{constructor(e,t,i,s,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=s,this.sourceUri=o,this.resourceGroup=r,this.decorations=a,this.contextValue=c,this.command=l,this.multiDiffEditorOriginalUri=d,this.multiDiffEditorModifiedUri=h}open(e){return this.proxy.$executeResourceCommand(this.sourceControlHandle,this.groupHandle,this.handle,e)}toJSON(){return{$mid:Fs.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class LKt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}set currentHistoryItemGroup(e){this._currentHistoryItemGroup=e,this._onDidChangeCurrentHistoryItemGroup.fire()}constructor(e,t){this.proxy=e,this.handle=t,this._onDidChangeCurrentHistoryItemGroup=new I,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,qe.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,qe.None))?.map(s=>({...s,icon:U8e(s.icon)}))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,qe.None);return i?{...i,icon:U8e(i.icon)}:void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,qe.None))?.map(s=>({uri:P.revive(s.uri),originalUri:s.originalUri&&P.revive(s.originalUri),modifiedUri:s.modifiedUri&&P.revive(s.modifiedUri),renameUri:s.renameUri&&P.revive(s.renameUri)}))}}const ole=class ole{get id(){return this._id}get handle(){return this._handle}get label(){return this._label}get rootUri(){return this._rootUri}get inputBoxTextModel(){return this._inputBoxTextModel}get contextValue(){return this._providerId}get commitTemplate(){return this.features.commitTemplate||""}get historyProvider(){return this._historyProvider}get acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get statusBarCommands(){return this.features.statusBarCommands}get count(){return this.features.count}get name(){return this._name??this._label}get onDidChangeStatusBarCommands(){return this._onDidChangeStatusBarCommands.event}constructor(e,t,i,s,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=s,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${ole.ID_HANDLE++}`,this.groups=[],this._onDidChangeResourceGroups=new I,this.onDidChangeResourceGroups=this._onDidChangeResourceGroups.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event,this._groupsByHandle=Object.create(null),this.features={},this._onDidChangeCommitTemplate=new I,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new I,this._onDidChangeHistoryProvider=new I,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=ui(o))}}$updateSourceControl(e){this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._onDidChangeCommitTemplate.fire(this.commitTemplate),typeof e.statusBarCommands<"u"&&this._onDidChangeStatusBarCommands.fire(this.statusBarCommands),e.hasQuickDiffProvider&&!this._quickDiff?this._quickDiff=this._quickDiffService.addQuickDiffProvider({label:e.quickDiffLabel??this.label,rootUri:this.rootUri,isSCM:this.isSCM,getOriginalResource:t=>this.getOriginalResource(t)}):e.hasQuickDiffProvider===!1&&this._quickDiff&&(this._quickDiff.dispose(),this._quickDiff=void 0),e.hasHistoryProvider&&!this._historyProvider?(this._historyProvider=new LKt(this.proxy,this.handle),this._onDidChangeHistoryProvider.fire()):e.hasHistoryProvider===!1&&this._historyProvider&&(this._historyProvider=void 0,this._onDidChangeHistoryProvider.fire())}$registerGroups(e){const t=e.map(([i,s,o,r,a])=>{const c=new kKt(this.handle,i,this,r,o,s,a,this._uriIdentService);return this._groupsByHandle[i]=c,c});this.groups.splice(this.groups.length,0,...t),this._onDidChangeResourceGroups.fire()}$updateGroup(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroup(t)}$updateGroupLabel(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroupLabel(t)}$spliceGroupResourceStates(e){for(const[t,i]of e){const s=this._groupsByHandle[t];if(!s){console.warn(`SCM group ${t} not found in provider ${this.label}`);continue}i.reverse();for(const[o,r,a]of i){const c=a.map(l=>{const[d,h,u,f,p,m,v,w,b,C]=l,[y,S]=u,M=$e.isThemeIcon(y)?y:P.revive(y),k=($e.isThemeIcon(S)?S:P.revive(S))||M,F={icon:M,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new IKt(this.proxy,this.handle,t,d,P.revive(h),s,F,v||void 0,w,P.revive(b),P.revive(C))});s.splice(o,r,c)}}this._onDidChangeResources.fire()}$unregisterGroup(e){const t=this._groupsByHandle[e];t&&(delete this._groupsByHandle[e],this.groups.splice(this.groups.indexOf(t),1),this._onDidChangeResourceGroups.fire())}async getOriginalResource(e){if(!this.features.hasQuickDiffProvider)return null;const t=await this.proxy.$provideOriginalResource(this.handle,e,qe.None);return t&&P.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this._historyProvider&&(this._historyProvider.currentHistoryItemGroup=e??void 0)}toJSON(){return{$mid:Fs.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};ole.ID_HANDLE=0;let RIe=ole,V8e=class{constructor(e,t,i,s,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=s,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostSCM),this._disposables.add(new DKt(this.textModelService,this.modelService,this.languageService))}dispose(){St(this._repositories.values()),this._repositories.clear(),St(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,s,o){const r=await this.textModelService.createModelReference(P.revive(o)),a=new RIe(this._proxy,e,t,i,s?P.revive(s):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=pa(r,T.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryDisposables.set(e,l)}$updateSourceControl(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}$unregisterSourceControl(e){const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}$registerGroups(e,t,i){const s=this._repositories.get(e);if(!s)return;const o=s.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}$updateGroup(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroup(t,i)}$updateGroupLabel(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroupLabel(t,i)}$spliceResourceStates(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}$unregisterGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}$setInputBoxValue(e,t){const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}$setInputBoxPlaceholder(e,t){const i=this._repositories.get(e);i&&(i.input.placeholder=t)}$setInputBoxEnablement(e,t){const i=this._repositories.get(e);i&&(i.input.enabled=t)}$setInputBoxVisibility(e,t){const i=this._repositories.get(e);i&&(i.input.visible=t)}$showValidationMessage(e,t,i){const s=this._repositories.get(e);s&&s.input.showValidationMessage(t,i)}$setValidationProviderIsEnabled(e,t){const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(s,o)=>{const r=await this._proxy.$validateInput(e,s,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};V8e=D([en(Ue.MainThreadSCM),_(1,MPe),_(2,YZe),_(3,Di),_(4,Ai),_(5,Rn),_(6,DQ),_(7,_o),_(8,Ti)],V8e);var z8e;(function(n){n.FindInFilesActionId="workbench.action.findInFiles",n.FocusActiveEditorCommandId="search.action.focusActiveEditor",n.FocusSearchFromResults="search.action.focusSearchFromResults",n.OpenMatch="search.action.openResult",n.OpenMatchToSide="search.action.openResultToSide",n.RemoveActionId="search.action.remove",n.CopyPathCommandId="search.action.copyPath",n.CopyMatchCommandId="search.action.copyMatch",n.CopyAllCommandId="search.action.copyAll",n.OpenInEditorCommandId="search.action.openInEditor",n.ClearSearchHistoryCommandId="search.action.clearHistory",n.FocusSearchListCommandID="search.action.focusSearchList",n.ReplaceActionId="search.action.replace",n.ReplaceAllInFileActionId="search.action.replaceAllInFile",n.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",n.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",n.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",n.ToggleWholeWordCommandId="toggleSearchWholeWord",n.ToggleRegexCommandId="toggleSearchRegex",n.TogglePreserveCaseId="toggleSearchPreserveCase",n.AddCursorsAtSearchResults="addCursorsAtSearchResults",n.RevealInSideBarForSearchResults="search.action.revealInSideBar",n.ReplaceInFilesActionId="workbench.action.replaceInFiles",n.ShowAllSymbolsActionId="workbench.action.showAllSymbols",n.QuickTextSearchActionId="workbench.action.quickTextSearch",n.CancelSearchActionId="search.action.cancel",n.RefreshSearchResultsActionId="search.action.refreshSearchResults",n.FocusNextSearchResultActionId="search.action.focusNextSearchResult",n.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",n.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",n.CollapseSearchResultsActionId="search.action.collapseSearchResults",n.ExpandSearchResultsActionId="search.action.expandSearchResults",n.ExpandRecursivelyCommandId="search.action.expandRecursively",n.ClearSearchResultsActionId="search.action.clearSearchResults",n.ViewAsTreeActionId="search.action.viewAsTree",n.ViewAsListActionId="search.action.viewAsList",n.ShowAIResultsActionId="search.action.showAIResults",n.HideAIResultsActionId="search.action.hideAIResults",n.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",n.ExcludeFolderFromSearchId="search.action.excludeFromSearch",n.FocusNextInputActionId="search.focus.nextInputBox",n.FocusPreviousInputActionId="search.focus.previousInputBox",n.RestrictSearchToFolderId="search.action.restrictSearchToFolder",n.FindInFolderId="filesExplorer.findInFolder",n.FindInWorkspaceId="filesExplorer.findInWorkspace"})(z8e||(z8e={}));const TKt={SearchViewVisibleKey:new Y("searchViewletVisible",!0),SearchViewFocusedKey:new Y("searchViewletFocus",!1),InputBoxFocusedKey:new Y("inputBoxFocus",!1),SearchInputBoxFocusedKey:new Y("searchInputBoxFocus",!1),ReplaceInputBoxFocusedKey:new Y("replaceInputBoxFocus",!1),PatternIncludesFocusedKey:new Y("patternIncludesInputBoxFocus",!1),PatternExcludesFocusedKey:new Y("patternExcludesInputBoxFocus",!1),ReplaceActiveKey:new Y("replaceActive",!1),HasSearchResults:new Y("hasSearchResult",!1),FirstMatchFocusKey:new Y("firstMatchFocus",!1),FileMatchOrMatchFocusKey:new Y("fileMatchOrMatchFocus",!1),FileMatchOrFolderMatchFocusKey:new Y("fileMatchOrFolderMatchFocus",!1),FileMatchOrFolderMatchWithResourceFocusKey:new Y("fileMatchOrFolderMatchWithResourceFocus",!1),FileFocusKey:new Y("fileMatchFocus",!1),FolderFocusKey:new Y("folderMatchFocus",!1),ResourceFolderFocusKey:new Y("folderMatchWithResourceFocus",!1),IsEditableItemKey:new Y("isEditableItem",!0),MatchFocusKey:new Y("matchFocus",!1),ViewHasSearchPatternKey:new Y("viewHasSearchPattern",!1),ViewHasReplacePatternKey:new Y("viewHasReplacePattern",!1),ViewHasFilePatternKey:new Y("viewHasFilePattern",!1),ViewHasSomeCollapsibleKey:new Y("viewHasSomeCollapsibleResult",!1),InTreeViewKey:new Y("inTreeView",!1),AIResultsVisibleKey:new Y("AIResultsVisibleKey",!1),hasAIResultProvider:new Y("hasAIResultProviderKey",!1)};let $8e=class{constructor(e,t,i,s,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(et.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new Zpe(this._searchService,h8.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){TKt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new Zpe(this._searchService,h8.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new Zpe(this._searchService,h8.file,t,e,this._proxy))}$unregisterProvider(e){St(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};$8e=D([en(Ue.MainThreadSearch),_(1,ohe),_(2,rn),_(3,Re),_(4,Pe)],$8e);const rle=class rle{constructor(e,t=++rle._idPool,i=new Map){this.progress=e,this.id=t,this.matches=i}addMatch(e){const t=this.matches.get(e.resource.toString());t?t.results&&e.results&&t.results.push(...e.results):this.matches.set(e.resource.toString(),e),this.progress?.(e)}};rle._idPool=0;let MIe=rle;class Zpe{constructor(e,t,i,s,o){this._scheme=i,this._handle=s,this._proxy=o,this._registrations=new Z,this._searches=new Map,this._registrations.add(e.registerSearchResultProvider(this._scheme,t,this))}dispose(){this._registrations.dispose()}fileSearch(e,t=qe.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=qe.None){return this.doSearch(e,t,i)}doSearch(e,t,i=qe.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const s=new MIe(t);this._searches.set(s.id,s);const o=this._provideSearchResults(e,s.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(s.id),{results:Array.from(s.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(s.id),Promise.reject(r)))}clearCache(e){return Promise.resolve(this._proxy.$clearCache(e))}handleFindMatch(e,t){const i=this._searches.get(e);i&&t.forEach(s=>{s.results?i.addMatch(Or(s)):i.addMatch({resource:P.revive(s)})})}_provideSearchResults(e,t,i){switch(e.type){case z1.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case z1.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let G8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(et.ExtHostStatusBar),s=[];for(const[r,a]of t.getEntries())s.push(o(r,a));i.$acceptStaticEntries(s),this._store.add(t.onDidChange(r=>{r.added&&i.$acceptStaticEntries([o(r.added[0],r.added[1])])}));function o(r,a){return{entryId:r,name:a.entry.name,text:a.entry.text,tooltip:a.entry.tooltip,command:typeof a.entry.command=="string"?a.entry.command:typeof a.entry.command=="object"?a.entry.command.id:void 0,priority:a.priority,alignLeft:a.alignment===W7.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,s,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u)===H7.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};G8e=D([en(Ue.MainThreadStatusBar),_(1,DPe)],G8e);async function RKt(n,e,t,i){return i.invokeFunction(async s=>{const o=s.get(Il),r=s.get(V_),a=s.get(B7),c=s.get(on),l=s.get(_o),d=s.get(ci),h=s.get(Ti),u=s.get(Ze),f=`extensionStorage.migrate.${n}-${e}`,p=n.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${n.toLowerCase()}`:void 0;if(n===e)return;const m=(w,b)=>b?l.extUri.joinPath(r.defaultProfile.globalStorageHome,w.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,w),v=t?ke.PROFILE:ke.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${n} to ${e}...`);const w=a.getExtensionState(n,t);w&&(a.setExtensionState(e,w,t),a.setExtensionState(n,void 0,t));const b=m(n,t),C=m(e,t);if(!l.extUri.isEqual(b,C))try{await d.move(b,C,!0)}catch(y){y.code!==rt.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${n}' to '${e}'`,lg(y))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${n} to ${e}`),c.store(f,!0,v,ln.MACHINE)}})}let q8e=class{constructor(e,t,i,s,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=s,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(et.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(ke.PROFILE,void 0,this._storageListener)(r=>{if(this._sharedStorageKeysToWatch.has(r.key)){const a=this._extensionStorageService.getExtensionStateRaw(r.key,!0);typeof a=="string"&&this._proxy.$acceptValue(!0,r.key,a)}}))}dispose(){this._storageListener.dispose()}async $initializeExtensionStorage(e,t){return await this.checkAndMigrateExtensionStorage(t,e),e&&this._sharedStorageKeysToWatch.set(t,!0),this._extensionStorageService.getExtensionStateRaw(t,e)}async $setValue(e,t,i){this._extensionStorageService.setExtensionState(t,i,e)}$registerExtensionStorageKeysToSync(e,t){this._extensionStorageService.setKeysForSync(e,t)}async checkAndMigrateExtensionStorage(e,t){try{let i=this._extensionStorageService.getSourceExtensionToMigrate(e);!i&&Jn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Jn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await RKt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};q8e=D([en(Ue.MainThreadStorage),_(1,B7),_(2,on),_(3,be),_(4,Ze)],q8e);var NIe,$P;let Q8e=($P=class extends ${constructor(e,t,i,s,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=s,this._productService=o,this._proxy=e.getProxy(et.ExtHostTelemetry),EJ(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(xJe)||r.affectsConfiguration(DJe))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,EJ(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return EJ(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:sp.NONE}$publicLog(e,t=Object.create(null)){t[NIe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},NIe=$P,$P._name="pluginHostTelemetry",$P);Q8e=NIe=D([en(Ue.MainThreadTelemetry),_(1,rn),_(2,Re),_(3,Il),_(4,Xa)],Q8e);class urt{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(const e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,i=5){const s=t(o=>{const r=typeof o=="string"?o:o.data;let a=this._terminalBufferMap.get(e);if(a){a.data.push(r);return}const c=setTimeout(()=>this.flushBuffer(e),i);a={data:[r],timeoutId:c,dispose:()=>{clearTimeout(c),this.flushBuffer(e),s.dispose()}},this._terminalBufferMap.set(e,a)});return s}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){const t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}}let PIe=class extends ${get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,s){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=s,this.id=0,this.shouldPersist=!1,this._onProcessData=this._register(new I),this.onProcessData=this._onProcessData.event,this._onProcessReady=this._register(new I),this._onStart=this._register(new I),this.onStart=this._onStart.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onAcknowledgeDataEvent=this._register(new I),this.onAcknowledgeDataEvent=this._onAcknowledgeDataEvent.event,this._onShutdown=this._register(new I),this.onShutdown=this._onShutdown.event,this._onRequestInitialCwd=this._register(new I),this.onRequestInitialCwd=this._onRequestInitialCwd.event,this._onRequestCwd=this._register(new I),this.onRequestCwd=this._onRequestCwd.event,this._onDidChangeProperty=this._register(new I),this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=this._register(new I),this.onProcessExit=this._onProcessExit.event,this._pendingInitialCwdRequests=[],this._pendingCwdRequests=[]}emitData(e){this._onProcessData.fire(e)}emitTitle(e){this._onDidChangeProperty.fire({type:jf.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case jf.Cwd:this.emitCwd(t);break;case jf.InitialCwd:this.emitInitialCwd(t);break;case jf.Title:this.emitTitle(t);break;case jf.OverrideDimensions:this.emitOverrideDimensions(t);break;case jf.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:jf.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:jf.ResolvedShellLaunchConfig,value:e})}emitInitialCwd(e){for(;this._pendingInitialCwdRequests.length>0;)this._pendingInitialCwdRequests.pop()(e)}emitCwd(e){for(;this._pendingCwdRequests.length>0;)this._pendingCwdRequests.pop()(e)}async start(){return this._terminalService.requestStartExtensionTerminal(this,this._cols,this._rows)}shutdown(e){this._onShutdown.fire(e)}input(e){this._onInput.fire(e)}resize(e,t){this._onResize.fire({cols:e,rows:t})}clearBuffer(){}acknowledgeDataEvent(){}async setUnicodeVersion(e){}async processBinary(e){this._onBinary.fire(e)}getInitialCwd(){return new Promise(e=>{this._onRequestInitialCwd.fire(),this._pendingInitialCwdRequests.push(e)})}getCwd(){return new Promise(e=>{this._onRequestCwd.fire(),this._pendingCwdRequests.push(e)})}async refreshProperty(e){}async updateProperty(e,t){}};PIe=D([_(3,Nz)],PIe);function grt(n){return[...n.entries()]}function MKt(n){return n?[...n.entries()]:[]}function NKt(n){return new Map(n)}function PKt(n){return new Map(n??[])}var x8;(function(n){n[n.TerminalCommand=0]="TerminalCommand",n[n.Opener=1]="Opener",n[n.Port=2]="Port",n[n.VscodeCommand=3]="VscodeCommand"})(x8||(x8={}));var TR;(function(n){n[n.CwdDetection=0]="CwdDetection",n[n.NaiveCwdDetection=1]="NaiveCwdDetection",n[n.CommandDetection=2]="CommandDetection",n[n.PartialCommandDetection=3]="PartialCommandDetection",n[n.BufferMarkDetection=4]="BufferMarkDetection"})(TR||(TR={}));var j8e;(function(n){n.Windows="windows",n.NoProblemsReported="noProblemsReported"})(j8e||(j8e={}));let K8e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=s,this._instantiationService=o,this._environmentVariableService=r,this._logService=a,this._terminalProfileResolverService=c,this._terminalGroupService=d,this._terminalEditorService=h,this._terminalProfileService=u,this._store=new Z,this._extHostTerminals=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._dataEventTracker=new Dn,this._sendCommandEventListener=new Dn,this._linkProvider=this._store.add(new Dn),this._os=$c,this._proxy=e.getProxy(et.ExtHostTerminalService),this._store.add(t.onDidCreateInstance(p=>{this._onTerminalOpened(p),this._onInstanceDimensionsChanged(p)})),this._store.add(t.onDidDisposeInstance(p=>this._onTerminalDisposed(p))),this._store.add(t.onAnyInstanceProcessIdReady(p=>this._onTerminalProcessIdReady(p))),this._store.add(t.onDidChangeInstanceDimensions(p=>this._onInstanceDimensionsChanged(p))),this._store.add(t.onAnyInstanceMaximumDimensionsChange(p=>this._onInstanceMaximumDimensionsChanged(p))),this._store.add(t.onDidRequestStartExtensionTerminal(p=>this._onRequestStartExtensionTerminal(p))),this._store.add(t.onDidChangeActiveInstance(p=>this._onActiveTerminalChanged(p?p.instanceId:null))),this._store.add(t.onAnyInstanceTitleChange(p=>p&&this._onTitleChanged(p.instanceId,p.title))),this._store.add(t.onAnyInstanceDataInput(p=>this._proxy.$acceptTerminalInteraction(p.instanceId))),this._store.add(t.onAnyInstanceSelectionChange(p=>this._proxy.$acceptTerminalSelection(p.instanceId,p.selection)));for(const p of this._terminalService.instances)this._onTerminalOpened(p),p.processReady.then(()=>this._onTerminalProcessIdReady(p));const f=this._terminalService.activeInstance;if(f&&this._proxy.$acceptActiveTerminalChanged(f.instanceId),this._environmentVariableService.collections.size>0){const m=[...this._environmentVariableService.collections.entries()].map(v=>[v[0],grt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||$c,this._updateDefaultProfile()}),this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(()=>this._updateDefaultProfile()))}dispose(){this._store.dispose();for(const e of this._profileProviders.values())e.dispose();for(const e of this._quickFixProviders.values())e.dispose()}async _updateDefaultProfile(){const e=this._extHostContext.remoteAuthority??void 0,t=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os}),i=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os,allowAutomationShell:!0});this._proxy.$acceptDefaultProfile(...await Promise.all([t,i]))}async _getTerminalInstance(e){return typeof e=="string"?this._extHostTerminals.get(e):this._terminalService.getInstanceFromId(e)}async $createTerminal(e,t){const i={name:t.name,executable:t.shellPath,args:t.shellArgs,cwd:typeof t.cwd=="string"?t.cwd:P.revive(t.cwd),icon:t.icon,color:t.color,initialText:t.initialText,waitOnExit:t.waitOnExit,ignoreConfigurationCwd:!0,env:t.env,strictEnv:t.strictEnv,hideFromUser:t.hideFromUser,customPtyImplementation:t.isExtensionCustomPtyTerminal?(r,a,c)=>new PIe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},s=ko.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,s);const o=await s;this._store.add(o.onDisposed(()=>{this._extHostTerminals.delete(e)}))}async _deserializeParentTerminal(e){if(typeof e=="object"&&"parentTerminal"in e){const t=await this._extHostTerminals.get(e.parentTerminal.toString());return t?{parentTerminal:t}:void 0}return e}async $show(e,t){const i=await this._getTerminalInstance(e);i&&(this._terminalService.setActiveInstance(i),i.target===fV.Editor?await this._terminalEditorService.revealActiveEditor(t):await this._terminalGroupService.showPanel(!t))}async $hide(e){const t=await this._getTerminalInstance(e),i=this._terminalService.activeInstance;i&&i.instanceId===t?.instanceId&&i.target!==fV.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(vM.Extension)}async $sendText(e,t,i){await(await this._getTerminalInstance(e))?.sendText(t,i)}$sendProcessExit(e,t){this._terminalProcessProxies.get(e)?.emitExit(t)}$startSendingDataEvents(){if(!this._dataEventTracker.value){this._dataEventTracker.value=this._instantiationService.createInstance(FIe,(e,t)=>{this._onTerminalData(e,t)});for(const e of this._terminalService.instances)for(const t of e.initialDataEvents||[])this._onTerminalData(e.instanceId,t)}}$stopSendingDataEvents(){this._dataEventTracker.clear()}$startSendingCommandEvents(){if(this._sendCommandEventListener.value)return;const e=this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,i=>i.onCommandFinished),t=e.event(i=>{this._onDidExecuteCommand(i.instance.instanceId,{commandLine:i.data.command,cwd:i.data.cwd,exitCode:i.data.exitCode,output:i.data.getOutput()})});this._sendCommandEventListener.value=pa(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new FKt(this._proxy))}$stopLinkProvider(){this._linkProvider.clear()}$registerProcessSupport(e){this._terminalService.registerProcessSupport(e)}$registerProfileProvider(e,t){this._profileProviders.set(e,this._terminalProfileService.registerTerminalProfileProvider(t,e,{createContributedTerminalProfile:async i=>this._proxy.$createContributedProfileTerminal(e,i)}))}$unregisterProfileProvider(e){this._profileProviders.get(e)?.dispose(),this._profileProviders.delete(e)}async $registerQuickFixProvider(e,t){this._quickFixProviders.set(e,this._terminalQuickFixService.registerQuickFixProvider(e,{provideTerminalQuickFixes:async(i,s,o,r)=>{if(r.isCancellationRequested)return;o.outputMatcher?.length&&o.outputMatcher.length>40&&(o.outputMatcher.length=40,this._logService.warn("Cannot exceed output matcher length of 40"));const a=i.command.match(o.commandLineMatcher);if(!a||!s)return;const c=o.outputMatcher;let l;if(c&&(l=OKt(s,c)),!l)return;const d={commandLineMatch:a,outputMatch:l,commandLine:i.command};if(d){const h=await this._proxy.$provideTerminalQuickFixes(e,d,r);if(h&&Array.isArray(h))return h.map(u=>Y8e(e,t,u));if(h)return Y8e(e,t,h)}}}))}$unregisterQuickFixProvider(e){this._quickFixProviders.get(e)?.dispose(),this._quickFixProviders.delete(e)}_onActiveTerminalChanged(e){this._proxy.$acceptActiveTerminalChanged(e)}_onTerminalData(e,t){this._proxy.$acceptTerminalProcessData(e,t)}_onDidExecuteCommand(e,t){this._proxy.$acceptDidExecuteCommand(e,t)}_onTitleChanged(e,t){this._proxy.$acceptTerminalTitleChange(e,t)}_onTerminalDisposed(e){this._proxy.$acceptTerminalClosed(e.instanceId,e.exitCode,e.exitReason??vM.Unknown)}_onTerminalOpened(e){const t=e.shellLaunchConfig.extHostTerminalId,i={name:e.shellLaunchConfig.name,executable:e.shellLaunchConfig.executable,args:e.shellLaunchConfig.args,cwd:e.shellLaunchConfig.cwd,env:e.shellLaunchConfig.env,hideFromUser:e.shellLaunchConfig.hideFromUser};this._proxy.$acceptTerminalOpened(e.instanceId,t,e.title,i)}_onTerminalProcessIdReady(e){e.processId!==void 0&&this._proxy.$acceptTerminalProcessId(e.instanceId,e.processId)}_onInstanceDimensionsChanged(e){this._proxy.$acceptTerminalDimensions(e.instanceId,e.cols,e.rows)}_onInstanceMaximumDimensionsChanged(e){this._proxy.$acceptTerminalMaximumDimensions(e.instanceId,e.maxCols,e.maxRows)}_onRequestStartExtensionTerminal(e){const t=e.proxy;this._terminalProcessProxies.set(t.instanceId,t);const i=e.cols&&e.rows?{columns:e.cols,rows:e.rows}:void 0;this._proxy.$startExtensionTerminal(t.instanceId,i).then(e.callback),t.onInput(s=>this._proxy.$acceptProcessInput(t.instanceId,s)),t.onShutdown(s=>this._proxy.$acceptProcessShutdown(t.instanceId,s)),t.onRequestCwd(()=>this._proxy.$acceptProcessRequestCwd(t.instanceId)),t.onRequestInitialCwd(()=>this._proxy.$acceptProcessRequestInitialCwd(t.instanceId))}$sendProcessData(e,t){this._terminalProcessProxies.get(e)?.emitData(t)}$sendProcessReady(e,t,i,s){this._terminalProcessProxies.get(e)?.emitReady(t,i,s)}$sendProcessProperty(e,t){t.type===jf.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,s){if(i){const o={persistent:t,map:NKt(i),descriptionMap:PKt(s)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};K8e=D([en(Ue.MainThreadTerminalService),_(1,Nz),_(2,set),_(3,oet),_(4,be),_(5,tet),_(6,Ze),_(7,iet),_(8,Sf),_(9,NPe),_(10,ZZe),_(11,net)],K8e);let FIe=class extends ${constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new urt(this._callback));for(const i of this._terminalService.instances)this._registerInstance(i);this._register(this._terminalService.onDidCreateInstance(i=>this._registerInstance(i))),this._register(this._terminalService.onDidDisposeInstance(i=>this._bufferer.stopBuffering(i.instanceId)))}_registerInstance(e){this._register(this._bufferer.startBuffering(e.instanceId,e.onData))}};FIe=D([_(1,Nz)],FIe);class FKt{constructor(e){this._proxy=e}async provideLinks(e,t){const i=this._proxy;return(await i.$provideLinks(e.instanceId,t)).map(o=>({id:o.id,startIndex:o.startIndex,length:o.length,label:o.label,activate:()=>i.$activateLink(e.instanceId,o.id)}))}}function OKt(n,e){const t=n.join(` -`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:n}:void 0}function Y8e(n,e,t){let i=x8.TerminalCommand;return"uri"in t?(t.uri=P.revive(t.uri),i=x8.Opener):"id"in t&&(i=x8.VscodeCommand),{id:n,type:i,source:e,...t}}let J8e=class extends ${constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(et.ExtHostTerminalShellIntegration);const s=new Map;this._register(Ee(()=>{for(const d of s.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>T.map(T.filter(d.capabilities.onDidAddCapabilityType,h=>h===TR.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandExecuted));let a;this._store.add(r.event(d=>{if(d.data===a)return;a=d.data;const h=d.instance.instanceId;this._proxy.$shellExecutionStart(h,d.data.command,X8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),s.get(h)?.dispose(),s.set(h,T.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;s.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,X8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CwdDetection,d=>d.onDidChangeCwd));this._store.add(l.event(d=>{this._proxy.$cwdChange(d.instance.instanceId,this._convertCwdToUri(d.data))})),this._store.add(this._terminalService.onDidDisposeInstance(d=>this._proxy.$closeTerminal(d.instanceId)))}$executeCommand(e,t){this._terminalService.getInstanceFromId(e)?.runCommand(t,!0)}_convertCwdToUri(e){return e?P.file(e):void 0}};J8e=D([en(Ue.MainThreadTerminalShellIntegration),_(1,Nz),_(2,ec)],J8e);function X8e(n){switch(n.commandLineConfidence){case"high":return NM.High;case"medium":return NM.Medium;case"low":default:return NM.Low}}let Z8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(et.ExtHostTheming),this._themeChangeListener=this._themeService.onDidColorThemeChange(i=>{this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}),this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}dispose(){this._themeChangeListener.dispose()}};Z8e=D([en(Ue.MainThreadTheming),_(1,pn)],Z8e);let e9e=class extends ${constructor(e,t,i,s,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=s,this.logService=o,this._dataProviders=this._register(new Zo),this._dndControllers=new Map,this._proxy=e.getProxy(et.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new WKt(e,this._proxy,this.notificationService),s=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>s.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new BKt(e,t.dropMimeTypes,t.dragMimeTypes,t.hasHandleDrag,this._proxy):void 0,r=this.getTreeView(e);r?(r.showCollapseAllAction=t.showCollapseAll,r.canSelectMany=t.canSelectMany,r.manuallyManageCheckboxes=t.manuallyManageCheckboxes,r.dragAndDropController=o,o&&this._dndControllers.set(e,o),r.dataProvider=i,this.registerListeners(e,r,s),this._proxy.$setVisible(e,r.visible)):this.notificationService.error("No view is registered with id: "+e)})}$reveal(e,t,i){return this.logService.trace("MainThreadTreeViews#$reveal",e,t?.item,t?.parentChain,i),this.viewsService.openView(e,i.focus).then(()=>{const s=this.getTreeView(e);if(s&&t)return this.reveal(s,this._dataProviders.get(e).dataProvider,t.item,t.parentChain,i)})}$refresh(e,t){this.logService.trace("MainThreadTreeViews#$refresh",e,t);const i=this.getTreeView(e),s=this._dataProviders.get(e);if(i&&s){const o=s.dataProvider.getItemsToRefresh(t);return i.refresh(o.length?o:void 0)}return Promise.resolve()}$setMessage(e,t){this.logService.trace("MainThreadTreeViews#$setMessage",e,t.toString());const i=this.getTreeView(e);i&&(i.message=t)}$setTitle(e,t,i){this.logService.trace("MainThreadTreeViews#$setTitle",e,t,i);const s=this.getTreeView(e);s&&(s.title=t,s.description=i)}$setBadge(e,t){this.logService.trace("MainThreadTreeViews#$setBadge",e,t?.value,t?.tooltip);const i=this.getTreeView(e);i&&(i.badge=t)}$resolveDropFileData(e,t,i){const s=this._dndControllers.get(e);if(!s)throw new Error("Unknown tree");return s.resolveDropFileData(t,i)}async $disposeTree(e){const t=this.getTreeView(e);t&&(t.dataProvider=void 0),this._dataProviders.deleteAndDispose(e)}async reveal(e,t,i,s,o){o=o||{select:!1,focus:!1};const r=hc(o.select)?!1:o.select,a=hc(o.focus)?!1:o.focus;let c=Math.min(Kc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of s){const h=t.getItem(d.handle);h&&await e.expand(h)}const l=t.getItem(i.handle);if(l){await e.reveal(l),r&&e.setSelection([l]),a===!1?e.setFocus():a&&e.setFocus(l);let d=[l];for(;d.length>0&&c>0;c--)await e.expand(d),d=d.reduce((h,u)=>{const f=t.getItem(u.handle);return f&&f.children&&f.children.length&&h.push(...f.children),h},[])}}registerListeners(e,t,i){i.add(t.onDidExpandItem(s=>this._proxy.$setExpanded(e,s.handle,!0))),i.add(t.onDidCollapseItem(s=>this._proxy.$setExpanded(e,s.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(s=>this._proxy.$setSelectionAndFocus(e,s.selection.map(({handle:o})=>o),s.focus.handle))),i.add(t.onDidChangeVisibility(s=>this._proxy.$setVisible(e,s))),i.add(t.onDidChangeCheckboxState(s=>{this._proxy.$changeCheckboxState(e,s.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=it.as(M1.ViewsRegistry).getView(e);return t?t.treeView:null}dispose(){for(const e of this._dataProviders){const t=this.getTreeView(e[0]);t&&(t.dataProvider=void 0)}this._dataProviders.dispose(),this._dndControllers.clear(),super.dispose()}};e9e=D([en(Ue.MainThreadTreeViews),_(1,q_),_(2,Pi),_(3,ho),_(4,Ze)],e9e);class BKt{constructor(e,t,i,s,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=s,this._proxy=o,this.dataTransfersCache=new TOe}async handleDrop(e,t,i,s,o,r){const a=this.dataTransfersCache.add(e);try{const c=await rw.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,s,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const s=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!s)return;const o=new fhe;return s.items.forEach(([r,a])=>{o.replace(r,HQ(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class WKt{constructor(e,t,i){this.treeViewId=e,this._proxy=t,this.notificationService=i,this.itemsMap=new Map,this.hasResolve=this._proxy.$hasResolve(this.treeViewId)}getChildren(e){return e||this.itemsMap.clear(),this._proxy.$getChildren(this.treeViewId,e?e.handle:void 0).then(t=>this.postGetChildren(t),t=>(kC.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const s=this.getItem(i);if(s){const o=e[i];if(this.updateTreeItem(s,o),i===o.handle)t.push(s);else{this.itemsMap.delete(i),this.itemsMap.set(s.handle,s);const r=o.parentHandle?this.itemsMap.get(o.parentHandle):null;r&&t.push(r)}}}return t}getItem(e){return this.itemsMap.get(e)}isEmpty(){return this.itemsMap.size===0}async postGetChildren(e){if(e===void 0)return;const t=[],i=await this.hasResolve;if(e)for(const s of e){const o=new ppe(s,i?r=>this._proxy.$resolve(this.treeViewId,s.handle,r):void 0);this.itemsMap.set(s.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=Tc([...Object.keys(e instanceof ppe?e.asTreeItem():e),...Object.keys(t)]);for(const s of i)e[s]=t[s];e instanceof ppe&&e.resetResolve()}}}let t9e=class extends ${constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(P.revive(e),P.revive(t))}};t9e=D([en(Ue.MainThreadDownloadService),_(1,bPe)],t9e);class HKt{constructor(e,t,i,s){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=s}handleURL(e,t){return Cn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let i9e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(et.ExtHostUrls)}$registerUriHandler(e,t,i){const s=new HKt(this.proxy,e,t,i),o=this.urlService.registerHandler(s);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,s),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:s}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),s.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};i9e=D([en(Ue.MainThreadUrls),_(1,jde),_(2,Cet)],i9e);const aY="vs/workbench/contrib/externalUriOpener/common/configuration",frt="default",UKt="workbench.externalUriOpeners",OIe={type:"string",enum:[]},n9e="\n- `https://microsoft.com`: Matches this specific domain using https\n- `https://microsoft.com:8080`: Matches this specific domain on this port using https\n- `https://microsoft.com:*`: Matches this specific domain on any port using https\n- `https://microsoft.com/foo`: Matches `https://microsoft.com/foo` and `https://microsoft.com/foo/bar`, but not `https://microsoft.com/foobar` or `https://microsoft.com/bar`\n- `https://*.microsoft.com`: Match all domains ending in `microsoft.com` using https\n- `microsoft.com`: Match this specific domain using either http or https\n- `*.microsoft.com`: Match all domains ending in `microsoft.com` using either http or https\n- `http://192.168.0.1`: Matches this specific IP using http\n- `http://192.168.0.*`: Matches all IP's with this prefix using http\n- `*`: Match all domains using either http or https",VKt={...PQ,properties:{[UKt]:{type:"object",markdownDescription:g(aY,0,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(aY,1,`Map URI pattern to an opener id. +`);async function bQt(s,e,t,i,n){s.write($e.fromString(vQt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(s.onData(l=>{c?c=$e.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(l8e);if(d===-1)return;r(s),s.pauseData();const h=c.slice(d+l8e.byteLength);h.byteLength&&n.onData.fire(h)})),o.add(s.onClose(l=>a(l??new Error("socket closed")))),o.add(s.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw s.dispose(),r}finally{o.dispose()}}let wQt=class extends V{constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new kk),this.onData=(...i)=>(this.pausableDataEmitter.isPaused&&queueMicrotask(()=>this.pausableDataEmitter.resume()),this.pausableDataEmitter.event(...i)),this.didDisposeEmitter=this._register(new I),this.onDidDispose=this.didDisposeEmitter.event,this.ended=!1,this._register(t.onData),this._register(t.onData.event(i=>this.pausableDataEmitter.fire(i))),this.onClose=this._register(t.onClose).event,this.onEnd=this._register(t.onEnd).event}pauseData(){this.pausableDataEmitter.pause()}drain(){return Promise.resolve()}end(){this.ended=!0,this.closeRemote()}traceSocketEvent(e,t){AAe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},d8e=class extends V{constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(Ye.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(n){return n.id===e}connect(n,o,r,a){return new Promise((c,l)=>{if(n.id!==e)return l(new Error("Invalid connectTo"));const d=n.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),fPe.connect(h,t._proxy,o,r,a,u).then(f=>{f.onDidDispose(()=>t._remoteSockets.delete(h)),c(f)},f=>{t._remoteSockets.delete(h),l(f)})}).catch(l)})}};this._registrations.set(e,this._remoteSocketFactoryService.register(qW.Managed,i))}async $unregisterSocketFactory(e){this._registrations.get(e)?.dispose()}$onDidManagedSocketHaveData(e,t){this._remoteSockets.get(e)?.onData.fire(t)}$onDidManagedSocketClose(e,t){this._remoteSockets.get(e)?.onClose.fire({type:Aee.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};d8e=D([Gi(Be.MainThreadManagedSockets),_(1,URe)],d8e);class fPe extends wQt{static connect(e,t,i,n,o,r){const a=new fPe(e,t,o,r);return bQt(a,i,n,o,r)}constructor(e,t,i,n){super(i,n),this.socketId=e,this.proxy=t}write(e){this.proxy.$remoteSocketWrite(this.socketId,e)}closeRemote(){this.proxy.$remoteSocketEnd(this.socketId)}drain(){return this.proxy.$remoteSocketDrain(this.socketId)}}const FK="workbench.panel.output";new Q("inOutput",!1);new Q("activeLogOutput",!1);new Q("activeLogOutput.levelSettable",!1);new Q("activeLogOutput.level","");new Q("activeLogOutput.levelIsDefault",!1);new Q("outputView.scrollLock",!1);var lB;(function(s){s[s.Append=1]="Append",s[s.Replace=2]="Replace",s[s.Clear=3]="Clear"})(lB||(lB={}));const Knt={OutputChannels:"workbench.contributions.outputChannels"};class yQt{constructor(){this.channels=new Map,this._onDidRegisterChannel=new I,this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=new I,this.onDidRemoveChannel=this._onDidRemoveChannel.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){const e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}removeChannel(e){this.channels.delete(e),this._onDidRemoveChannel.fire(e)}}Qe.add(Knt.OutputChannels,new yQt);new Q("activeOutputChannel","");var aj,XR;let h8e=(XR=class extends V{constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(Ye.ExtHostOutputService);const n=()=>{const o=this._viewsService.isViewVisible(FK)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(M.any(this._outputService.onActiveOutputChannel,M.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===FK))(()=>n())),n()}async $register(e,t,i,n){const o=(aj._extensionIdPool.get(n)||0)+1;aj._extensionIdPool.set(n,o);const r=`extension-output-${n}-#${o}-${e}`,a=N.revive(t);return Qe.as(Knt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:n}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const n=this._getChannel(e);n&&(t===lB.Append?n.update(t):lc(i)&&n.update(t,i))}async $reveal(e,t){const i=this._getChannel(e);i&&this._outputService.showChannel(i.id,t)}async $close(e){if(this._viewsService.isViewVisible(FK)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(FK)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},aj=XR,XR._extensionIdPool=new Map,XR);h8e=aj=D([Gi(Be.MainThreadOutputService),_(1,Jae),_(2,Lm)],h8e);class CQt extends rn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let u8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(Ye.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const n=this._createTask(e);t.location===ud.Notification&&i&&(t={...t,location:ud.Notification,secondaryActions:[new CQt(i,g(4863,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,n,()=>this._proxy.$acceptProgressCanceled(e))}$progressReport(e,t){this._progress.get(e)?.progress.report(t)}$progressEnd(e){const t=this._progress.get(e);t&&(t.resolve(),this._progress.delete(e))}_createTask(e){return t=>new Promise(i=>{this._progress.set(e,{resolve:i,progress:t})})}};u8e=D([Gi(Be.MainThreadProgress),_(1,cg),_(2,vi)],u8e);let g8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new mo,this.proxy=e.getProxy(Ye.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,n){const o={label:i,rootUri:N.revive(n),selector:t,isSCM:!1,getOriginalResource:async a=>N.revive(await this.proxy.$provideOriginalResource(e,a,He.None))},r=this.quickDiffService.addQuickDiffProvider(o);this.providerDisposables.set(e,r)}async $unregisterQuickDiffProvider(e){this.providerDisposables.has(e)&&this.providerDisposables.deleteAndDispose(e)}dispose(){this.providerDisposables.dispose()}};g8e=D([Gi(Be.MainThreadQuickDiff),_(1,M6)],g8e);function f8e(s){s.dark=N.revive(s.dark),s.light&&(s.light=N.revive(s.light))}let p8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(Ye.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const n=new Promise((o,r)=>{this._items[e]={resolve:o,reject:r}});return t={...t,onDidFocus:o=>{o&&this._proxy.$onItemSelected(o.handle)}},t.canPickMany?this._quickInputService.pick(n,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(n,t,i).then(o=>{if(o)return o.handle})}$setItems(e,t){return this._items[e]&&(this._items[e].resolve(t),delete this._items[e]),Promise.resolve()}$setError(e,t){return this._items[e]&&(this._items[e].reject(t),delete this._items[e]),Promise.resolve()}$input(e,t,i){const n=Object.create(null);return e&&(n.title=e.title,n.password=e.password,n.placeHolder=e.placeHolder,n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.value=e.value,n.ignoreFocusLost=e.ignoreFocusOut),t&&(n.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(n,i)}$createOrUpdate(e){const t=e.id;let i=this.sessions.get(t);if(!i){const r=e.type==="quickPick"?this._quickInputService.createQuickPick():this._quickInputService.createInputBox();if(r.onDidAccept(()=>{this._proxy.$onDidAccept(t)}),r.onDidTriggerButton(a=>{this._proxy.$onDidTriggerButton(t,a.handle)}),r.onDidChangeValue(a=>{this._proxy.$onDidChangeValue(t,a)}),r.onDidHide(()=>{this._proxy.$onDidHide(t)}),e.type==="quickPick"){const a=r;a.onDidChangeActive(c=>{this._proxy.$onDidChangeActive(t,c.map(l=>l.handle))}),a.onDidChangeSelection(c=>{this._proxy.$onDidChangeSelection(t,c.map(l=>l.handle))}),a.onDidTriggerItemButton(c=>{this._proxy.$onDidTriggerItemButton(t,c.item.handle,c.button.handle)})}i={input:r,handlesToItems:new Map},this.sessions.set(t,i)}const{input:n,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?n.show():n.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&f8e(c.iconPath),c))),o.set(a.handle,a))}),n[r]=e[r]):r==="activeItems"||r==="selectedItems"?n[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?n[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&f8e(a.iconPath),a)):n[r]=e[r]);return Promise.resolve(void 0)}$dispose(e){const t=this.sessions.get(e);return t&&(t.input.dispose(),this.sessions.delete(e)),Promise.resolve(void 0)}};p8e=D([Gi(Be.MainThreadQuickOpen),_(1,In)],p8e);let m8e=class extends V{constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(Ye.ExtHostExtensionService);const n=this._environmentService.remoteAuthority;n&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(n);o&&this._proxy.$updateRemoteConnectionData(o)}))}};m8e=D([QN,_(1,Jr),_(2,pC)],m8e);class SQt{constructor(e){this._proxy=e.getProxy(Ye.ExtHostDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.textEditorModel||!Ly(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(4864,"Aborted onWillSaveTextDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason).then(c=>{if(!c.every(l=>l))return Promise.reject(new Error("listener failed"))}).then(r,a)});return Mre(o,n)}}let _8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(SQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};_8e=D([QN,_(1,we),_(2,Fo)],_8e);let v8e=class{constructor(e,t,i){this.speechService=t,this.logService=i,this.providerRegistrations=new Map,this.speechToTextSessions=new Map,this.textToSpeechSessions=new Map,this.keywordRecognitionSessions=new Map,this.proxy=e.getProxy(Ye.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const n=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:M.None};const a=new Z,c=Math.random();this.proxy.$createSpeechToTextSession(e,c,r?.language);const l=a.add(new I);return this.speechToTextSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelSpeechToTextSession(c),this.speechToTextSessions.delete(c),a.dispose()})),{onDidChange:l.event}},createTextToSpeechSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:M.None,synthesize:async()=>{}};const a=new Z,c=Math.random();this.proxy.$createTextToSpeechSession(e,c,r?.language);const l=a.add(new I);return this.textToSpeechSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelTextToSpeechSession(c),this.textToSpeechSessions.delete(c),a.dispose()})),{onDidChange:l.event,synthesize:async d=>{await this.proxy.$synthesizeSpeech(c,d),await U_(M.toPromise(M.filter(l.event,h=>h.status===Yve.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:M.None};const r=new Z,a=Math.random();this.proxy.$createKeywordRecognitionSession(e,a);const c=r.add(new I);return this.keywordRecognitionSessions.set(a,{onDidChange:c}),r.add(o.onCancellationRequested(()=>{this.proxy.$cancelKeywordRecognitionSession(a),this.keywordRecognitionSessions.delete(a),r.dispose()})),{onDidChange:c.event}}});this.providerRegistrations.set(e,{dispose:()=>{n.dispose()}})}$unregisterProvider(e){const t=this.providerRegistrations.get(e);t&&(t.dispose(),this.providerRegistrations.delete(e))}$emitSpeechToTextEvent(e,t){this.speechToTextSessions.get(e)?.onDidChange.fire(t)}$emitTextToSpeechEvent(e,t){this.textToSpeechSessions.get(e)?.onDidChange.fire(t)}$emitKeywordRecognitionEvent(e,t){this.keywordRecognitionSessions.get(e)?.onDidChange.fire(t)}dispose(){this.providerRegistrations.forEach(e=>e.dispose()),this.providerRegistrations.clear(),this.speechToTextSessions.forEach(e=>e.onDidChange.dispose()),this.speechToTextSessions.clear(),this.textToSpeechSessions.forEach(e=>e.onDidChange.dispose()),this.textToSpeechSessions.clear(),this.keywordRecognitionSessions.forEach(e=>e.onDidChange.dispose()),this.keywordRecognitionSessions.clear()}};v8e=D([Gi(Be.MainThreadSpeech),_(1,Kae),_(2,Ge)],v8e);class AQt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(Ye.ExtHostWorkspace)}async participate(e,t){const i=new Promise((n,o)=>{setTimeout(()=>o(new Error(g(4865,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(n,o)});return Mre(i,t)}}let b8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(AQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};b8e=D([QN,_(1,we),_(2,$Re)],b8e);let gz=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return Vi.basename(this.relativePath)}constructor(e,t,i,n=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=n,this.parent=o,this._children=new Map}get(e){return this._children.get(e)}set(e,t){this._children.set(e,t)}delete(e){this._children.delete(e)}clear(){this._children.clear()}};gz.__decorator=D([Zt],gz.prototype,"name",null);function qnt(s,e){typeof s.element<"u"&&e.push(s.element);for(const t of s.children)qnt(t,e);return e}class EQt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return qnt(e,[])}static isResourceNode(e){return e instanceof gz}constructor(e,t=N.file("/"),i=xn){this.extUri=i,this.root=new gz(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,n=new y5(!1).reset(i);let o=this.root,r="";for(;;){const a=n.value();r=r+"/"+a;let c=o.get(a);if(c?n.hasNext()||(c.element=t):(c=new gz(this.extUri.joinPath(this.root.uri,r),r,this.root.context,n.hasNext()?void 0:t,o),o.set(a,c)),o=c,!n.hasNext())return;n.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new y5(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),n=e.get(i);if(n){if(t.hasNext()){const o=this._delete(n,t.next());return typeof o<"u"&&n.childrenCount===0&&e.delete(i),o}return e.delete(i),n.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new y5(!1).reset(t);let n=this.root;for(;;){const o=i.value(),r=n.get(o);if(!r||!i.hasNext())return r;n=r,i.next()}}}function w8e(s){if(s!==void 0){if(N.isUri(s))return N.revive(s);if(We.isThemeIcon(s))return s;{const e=s;return{light:N.revive(e.light),dark:N.revive(e.dark)}}}}function Nue(s){const e=w8e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:w8e(i.icon)}));return{...s,icon:e,labels:t}}class xQt extends V{constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(pe.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class DQt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??N.file("/");this._resourceTree=new EQt(this,e,this._uriIdentService.extUri);for(const t of this.resources)this._resourceTree.add(t.sourceUri,t)}return this._resourceTree}get hideWhenEmpty(){return!!this.features.hideWhenEmpty}constructor(e,t,i,n,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=n,this.label=o,this.id=r,this.multiDiffEditorEnableViewChanges=a,this._uriIdentService=c,this.resources=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event}toJSON(){return{$mid:ws.ScmResourceGroup,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(e,t,i){this.resources.splice(e,t,...i),this._resourceTree=void 0,this._onDidChangeResources.fire()}$updateGroup(e){this.features={...this.features,...e},this._onDidChange.fire()}$updateGroupLabel(e){this.label=e,this._onDidChange.fire()}}class kQt{constructor(e,t,i,n,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=n,this.sourceUri=o,this.resourceGroup=r,this.decorations=a,this.contextValue=c,this.command=l,this.multiDiffEditorOriginalUri=d,this.multiDiffEditorModifiedUri=h}open(e){return this.proxy.$executeResourceCommand(this.sourceControlHandle,this.groupHandle,this.handle,e)}toJSON(){return{$mid:ws.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class IQt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}constructor(e,t){this.proxy=e,this.handle=t,this.currentHistoryItemGroupId=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.id),this.currentHistoryItemGroupName=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.name),this._currentHistoryItemGroup=fJ({owner:this,equalsFn:()=>!1},void 0)}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,He.None)}async resolveHistoryItemGroupCommonAncestor2(e){return this.proxy.$resolveHistoryItemGroupCommonAncestor2(this.handle,e,He.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,He.None))?.map(n=>Nue(n))}async provideHistoryItems2(e){return(await this.proxy.$provideHistoryItems2(this.handle,e,He.None))?.map(i=>Nue(i))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,He.None);return i?Nue(i):void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,He.None))?.map(n=>({uri:N.revive(n.uri),originalUri:n.originalUri&&N.revive(n.originalUri),modifiedUri:n.modifiedUri&&N.revive(n.modifiedUri),renameUri:n.renameUri&&N.revive(n.renameUri)}))}$onDidChangeCurrentHistoryItemGroup(e){this._currentHistoryItemGroup.set(e,void 0)}}const qoe=class qoe{get id(){return this._id}get handle(){return this._handle}get label(){return this._label}get rootUri(){return this._rootUri}get inputBoxTextModel(){return this._inputBoxTextModel}get contextValue(){return this._providerId}get acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get count(){return this._count}get statusBarCommands(){return this._statusBarCommands}get name(){return this._name??this._label}get commitTemplate(){return this._commitTemplate}get historyProvider(){return this._historyProvider}constructor(e,t,i,n,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=n,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${qoe.ID_HANDLE++}`,this.groups=[],this._onDidChangeResourceGroups=new I,this.onDidChangeResourceGroups=this._onDidChangeResourceGroups.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event,this._groupsByHandle=Object.create(null),this.features={},this._count=jt(this,void 0),this._statusBarCommands=jt(this,void 0),this._commitTemplate=jt(this,""),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,this._historyProvider=jt(this,void 0),o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=_i(o))}}$updateSourceControl(e){if(this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._commitTemplate.set(e.commitTemplate,void 0),typeof e.count<"u"&&this._count.set(e.count,void 0),typeof e.statusBarCommands<"u"&&this._statusBarCommands.set(e.statusBarCommands,void 0),e.hasQuickDiffProvider&&!this._quickDiff?this._quickDiff=this._quickDiffService.addQuickDiffProvider({label:e.quickDiffLabel??this.label,rootUri:this.rootUri,isSCM:this.isSCM,getOriginalResource:t=>this.getOriginalResource(t)}):e.hasQuickDiffProvider===!1&&this._quickDiff&&(this._quickDiff.dispose(),this._quickDiff=void 0),e.hasHistoryProvider&&!this.historyProvider.get()){const t=new IQt(this.proxy,this.handle);this._historyProvider.set(t,void 0)}else e.hasHistoryProvider===!1&&this.historyProvider.get()&&this._historyProvider.set(void 0,void 0)}$registerGroups(e){const t=e.map(([i,n,o,r,a])=>{const c=new DQt(this.handle,i,this,r,o,n,a,this._uriIdentService);return this._groupsByHandle[i]=c,c});this.groups.splice(this.groups.length,0,...t),this._onDidChangeResourceGroups.fire()}$updateGroup(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroup(t)}$updateGroupLabel(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroupLabel(t)}$spliceGroupResourceStates(e){for(const[t,i]of e){const n=this._groupsByHandle[t];if(!n){console.warn(`SCM group ${t} not found in provider ${this.label}`);continue}i.reverse();for(const[o,r,a]of i){const c=a.map(l=>{const[d,h,u,f,p,m,v,b,w,y]=l,[C,A]=u,L=We.isThemeIcon(C)?C:N.revive(C),k=(We.isThemeIcon(A)?A:N.revive(A))||L,P={icon:L,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new kQt(this.proxy,this.handle,t,d,N.revive(h),n,P,v||void 0,b,N.revive(w),N.revive(y))});n.splice(o,r,c)}}this._onDidChangeResources.fire()}$unregisterGroup(e){const t=this._groupsByHandle[e];t&&(delete this._groupsByHandle[e],this.groups.splice(this.groups.indexOf(t),1),this._onDidChangeResourceGroups.fire())}async getOriginalResource(e){if(!this.features.hasQuickDiffProvider)return null;const t=await this.proxy.$provideOriginalResource(this.handle,e,He.None);return t&&N.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this.historyProvider.get()&&this._historyProvider.get()?.$onDidChangeCurrentHistoryItemGroup(e)}toJSON(){return{$mid:ws.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};qoe.ID_HANDLE=0;let pxe=qoe,y8e=class{constructor(e,t,i,n,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=n,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryBarriers=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostSCM),this._disposables.add(new xQt(this.textModelService,this.modelService,this.languageService))}dispose(){bt(this._repositories.values()),this._repositories.clear(),bt(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,n,o){this._repositoryBarriers.set(e,new qd);const r=await this.textModelService.createModelReference(N.revive(o)),a=new pxe(this._proxy,e,t,i,n?N.revive(n):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=jr(r,M.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this._repositoryDisposables.set(e,l),this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryBarriers.get(e)?.open()}async $updateSourceControl(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}async $unregisterSourceControl(e){await this._repositoryBarriers.get(e)?.wait();const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}async $registerGroups(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;const o=n.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}async $updateGroup(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroup(t,i)}async $updateGroupLabel(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroupLabel(t,i)}async $spliceResourceStates(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}async $unregisterGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}async $setInputBoxValue(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}async $setInputBoxPlaceholder(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.placeholder=t)}async $setInputBoxEnablement(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.enabled=t)}async $setInputBoxVisibility(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.visible=t)}async $showValidationMessage(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);n&&n.input.showValidationMessage(t,i)}async $setValidationProviderIsEnabled(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(n,o)=>{const r=await this._proxy.$validateInput(e,n,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}async $onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};y8e=D([Gi(Be.MainThreadSCM),_(1,tMe),_(2,WJe),_(3,xi),_(4,gi),_(5,fn),_(6,M6),_(7,ks),_(8,yi)],y8e);var C8e;(function(s){s.FindInFilesActionId="workbench.action.findInFiles",s.FocusActiveEditorCommandId="search.action.focusActiveEditor",s.FocusSearchFromResults="search.action.focusSearchFromResults",s.OpenMatch="search.action.openResult",s.OpenMatchToSide="search.action.openResultToSide",s.RemoveActionId="search.action.remove",s.CopyPathCommandId="search.action.copyPath",s.CopyMatchCommandId="search.action.copyMatch",s.CopyAllCommandId="search.action.copyAll",s.OpenInEditorCommandId="search.action.openInEditor",s.ClearSearchHistoryCommandId="search.action.clearHistory",s.FocusSearchListCommandID="search.action.focusSearchList",s.ReplaceActionId="search.action.replace",s.ReplaceAllInFileActionId="search.action.replaceAllInFile",s.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",s.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",s.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",s.ToggleWholeWordCommandId="toggleSearchWholeWord",s.ToggleRegexCommandId="toggleSearchRegex",s.TogglePreserveCaseId="toggleSearchPreserveCase",s.AddCursorsAtSearchResults="addCursorsAtSearchResults",s.RevealInSideBarForSearchResults="search.action.revealInSideBar",s.ReplaceInFilesActionId="workbench.action.replaceInFiles",s.ShowAllSymbolsActionId="workbench.action.showAllSymbols",s.QuickTextSearchActionId="workbench.action.quickTextSearch",s.CancelSearchActionId="search.action.cancel",s.RefreshSearchResultsActionId="search.action.refreshSearchResults",s.FocusNextSearchResultActionId="search.action.focusNextSearchResult",s.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",s.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",s.CollapseSearchResultsActionId="search.action.collapseSearchResults",s.ExpandSearchResultsActionId="search.action.expandSearchResults",s.ExpandRecursivelyCommandId="search.action.expandRecursively",s.ClearSearchResultsActionId="search.action.clearSearchResults",s.ViewAsTreeActionId="search.action.viewAsTree",s.ViewAsListActionId="search.action.viewAsList",s.ShowAIResultsActionId="search.action.showAIResults",s.HideAIResultsActionId="search.action.hideAIResults",s.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",s.ExcludeFolderFromSearchId="search.action.excludeFromSearch",s.FocusNextInputActionId="search.focus.nextInputBox",s.FocusPreviousInputActionId="search.focus.previousInputBox",s.RestrictSearchToFolderId="search.action.restrictSearchToFolder",s.FindInFolderId="filesExplorer.findInFolder",s.FindInWorkspaceId="filesExplorer.findInWorkspace"})(C8e||(C8e={}));const TQt={SearchViewVisibleKey:new Q("searchViewletVisible",!0),SearchViewFocusedKey:new Q("searchViewletFocus",!1),InputBoxFocusedKey:new Q("inputBoxFocus",!1),SearchInputBoxFocusedKey:new Q("searchInputBoxFocus",!1),ReplaceInputBoxFocusedKey:new Q("replaceInputBoxFocus",!1),PatternIncludesFocusedKey:new Q("patternIncludesInputBoxFocus",!1),PatternExcludesFocusedKey:new Q("patternExcludesInputBoxFocus",!1),ReplaceActiveKey:new Q("replaceActive",!1),HasSearchResults:new Q("hasSearchResult",!1),FirstMatchFocusKey:new Q("firstMatchFocus",!1),FileMatchOrMatchFocusKey:new Q("fileMatchOrMatchFocus",!1),FileMatchOrFolderMatchFocusKey:new Q("fileMatchOrFolderMatchFocus",!1),FileMatchOrFolderMatchWithResourceFocusKey:new Q("fileMatchOrFolderMatchWithResourceFocus",!1),FileFocusKey:new Q("fileMatchFocus",!1),FolderFocusKey:new Q("folderMatchFocus",!1),ResourceFolderFocusKey:new Q("folderMatchWithResourceFocus",!1),IsEditableItemKey:new Q("isEditableItem",!0),MatchFocusKey:new Q("matchFocus",!1),ViewHasSearchPatternKey:new Q("viewHasSearchPattern",!1),ViewHasReplacePatternKey:new Q("viewHasReplacePattern",!1),ViewHasFilePatternKey:new Q("viewHasFilePattern",!1),ViewHasSomeCollapsibleKey:new Q("viewHasSomeCollapsibleResult",!1),InTreeViewKey:new Q("inTreeView",!1),AIResultsVisibleKey:new Q("AIResultsVisibleKey",!1),hasAIResultProvider:new Q("hasAIResultProviderKey",!1)};let S8e=class{constructor(e,t,i,n,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(Ye.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new Pue(this._searchService,Z5.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){TQt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new Pue(this._searchService,Z5.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new Pue(this._searchService,Z5.file,t,e,this._proxy))}$unregisterProvider(e){bt(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};S8e=D([Gi(Be.MainThreadSearch),_(1,Zae),_(2,Yi),_(3,Te),_(4,Le)],S8e);const Qoe=class Qoe{constructor(e,t=++Qoe._idPool,i=new Map){this.progress=e,this.id=t,this.matches=i}addMatch(e){const t=this.matches.get(e.resource.toString());t?t.results&&e.results&&t.results.push(...e.results):this.matches.set(e.resource.toString(),e),this.progress?.(e)}};Qoe._idPool=0;let mxe=Qoe;class Pue{constructor(e,t,i,n,o){this._scheme=i,this._handle=n,this._proxy=o,this._registrations=new Z,this._searches=new Map,this._registrations.add(e.registerSearchResultProvider(this._scheme,t,this))}dispose(){this._registrations.dispose()}fileSearch(e,t=He.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=He.None){return this.doSearch(e,t,i)}doSearch(e,t,i=He.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const n=new mxe(t);this._searches.set(n.id,n);const o=this._provideSearchResults(e,n.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(n.id),{results:Array.from(n.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(n.id),Promise.reject(r)))}clearCache(e){return Promise.resolve(this._proxy.$clearCache(e))}handleFindMatch(e,t){const i=this._searches.get(e);i&&t.forEach(n=>{n.results?i.addMatch(Mo(n)):i.addMatch({resource:N.revive(n)})})}_provideSearchResults(e,t,i){switch(e.type){case cI.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case cI.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let A8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(Ye.ExtHostStatusBar),n=[];for(const[r,a]of t.getEntries())n.push(o(r,a));i.$acceptStaticEntries(n),this._store.add(t.onDidChange(r=>{r.added&&i.$acceptStaticEntries([o(r.added[0],r.added[1])])}));function o(r,a){return{entryId:r,name:a.entry.name,text:a.entry.text,tooltip:a.entry.tooltip,command:typeof a.entry.command=="string"?a.entry.command:typeof a.entry.command=="object"?a.entry.command.id:void 0,priority:a.priority,alignLeft:a.alignment===O3.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,n,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,n,o,r,a,c,l,d,h,u)===B3.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};A8e=D([Gi(Be.MainThreadStatusBar),_(1,jRe)],A8e);async function LQt(s,e,t,i){return i.invokeFunction(async n=>{const o=n.get(Za),r=n.get(Em),a=n.get(N3),c=n.get($i),l=n.get(ks),d=n.get(Jt),h=n.get(yi),u=n.get(Ge),f=`extensionStorage.migrate.${s}-${e}`,p=s.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${s.toLowerCase()}`:void 0;if(s===e)return;const m=(b,w)=>w?l.extUri.joinPath(r.defaultProfile.globalStorageHome,b.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,b),v=t?Ie.PROFILE:Ie.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${s} to ${e}...`);const b=a.getExtensionState(s,t);b&&(a.setExtensionState(e,b,t),a.setExtensionState(s,void 0,t));const w=m(s,t),y=m(e,t);if(!l.extUri.isEqual(w,y))try{await d.move(w,y,!0)}catch(C){C.code!==ot.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${s}' to '${e}'`,su(C))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${s} to ${e}`),c.store(f,!0,v,an.MACHINE)}})}let E8e=class{constructor(e,t,i,n,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=n,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(Ye.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(Ie.PROFILE,void 0,this._storageListener)(r=>{if(this._sharedStorageKeysToWatch.has(r.key)){const a=this._extensionStorageService.getExtensionStateRaw(r.key,!0);typeof a=="string"&&this._proxy.$acceptValue(!0,r.key,a)}}))}dispose(){this._storageListener.dispose()}async $initializeExtensionStorage(e,t){return await this.checkAndMigrateExtensionStorage(t,e),e&&this._sharedStorageKeysToWatch.set(t,!0),this._extensionStorageService.getExtensionStateRaw(t,e)}async $setValue(e,t,i){this._extensionStorageService.setExtensionState(t,i,e)}$registerExtensionStorageKeysToSync(e,t){this._extensionStorageService.setKeysForSync(e,t)}async checkAndMigrateExtensionStorage(e,t){try{let i=this._extensionStorageService.getSourceExtensionToMigrate(e);!i&&Wn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Wn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await LQt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};E8e=D([Gi(Be.MainThreadStorage),_(1,N3),_(2,$i),_(3,we),_(4,Ge)],E8e);var _xe,ZR;let x8e=(ZR=class extends V{constructor(e,t,i,n,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=n,this._productService=o,this._proxy=e.getProxy(Ye.ExtHostTelemetry),Yq(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(uje)||r.affectsConfiguration(gje))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,Yq(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return Yq(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:Kg.NONE}$publicLog(e,t=Object.create(null)){t[_xe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},_xe=ZR,ZR._name="pluginHostTelemetry",ZR);x8e=_xe=D([Gi(Be.MainThreadTelemetry),_(1,Yi),_(2,Te),_(3,Za),_(4,Er)],x8e);class Qnt{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(const e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,i=5){const n=t(o=>{const r=typeof o=="string"?o:o.data;let a=this._terminalBufferMap.get(e);if(a){a.data.push(r);return}const c=setTimeout(()=>this.flushBuffer(e),i);a={data:[r],timeoutId:c,dispose:()=>{clearTimeout(c),this.flushBuffer(e),n.dispose()}},this._terminalBufferMap.set(e,a)});return n}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){const t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}}let vxe=class extends V{get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,n){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=n,this.id=0,this.shouldPersist=!1,this._onProcessData=this._register(new I),this.onProcessData=this._onProcessData.event,this._onProcessReady=this._register(new I),this._onStart=this._register(new I),this.onStart=this._onStart.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onAcknowledgeDataEvent=this._register(new I),this.onAcknowledgeDataEvent=this._onAcknowledgeDataEvent.event,this._onShutdown=this._register(new I),this.onShutdown=this._onShutdown.event,this._onRequestInitialCwd=this._register(new I),this.onRequestInitialCwd=this._onRequestInitialCwd.event,this._onRequestCwd=this._register(new I),this.onRequestCwd=this._onRequestCwd.event,this._onDidChangeProperty=this._register(new I),this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=this._register(new I),this.onProcessExit=this._onProcessExit.event,this._pendingInitialCwdRequests=[],this._pendingCwdRequests=[]}emitData(e){this._onProcessData.fire(e)}emitTitle(e){this._onDidChangeProperty.fire({type:Og.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case Og.Cwd:this.emitCwd(t);break;case Og.InitialCwd:this.emitInitialCwd(t);break;case Og.Title:this.emitTitle(t);break;case Og.OverrideDimensions:this.emitOverrideDimensions(t);break;case Og.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:Og.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:Og.ResolvedShellLaunchConfig,value:e})}emitInitialCwd(e){for(;this._pendingInitialCwdRequests.length>0;)this._pendingInitialCwdRequests.pop()(e)}emitCwd(e){for(;this._pendingCwdRequests.length>0;)this._pendingCwdRequests.pop()(e)}async start(){return this._terminalService.requestStartExtensionTerminal(this,this._cols,this._rows)}shutdown(e){this._onShutdown.fire(e)}input(e){this._onInput.fire(e)}resize(e,t){this._onResize.fire({cols:e,rows:t})}clearBuffer(){}acknowledgeDataEvent(){}async setUnicodeVersion(e){}async processBinary(e){this._onBinary.fire(e)}getInitialCwd(){return new Promise(e=>{this._onRequestInitialCwd.fire(),this._pendingInitialCwdRequests.push(e)})}getCwd(){return new Promise(e=>{this._onRequestCwd.fire(),this._pendingCwdRequests.push(e)})}async refreshProperty(e){}async updateProperty(e,t){}};vxe=D([_(3,OU)],vxe);function jnt(s){return[...s.entries()]}function RQt(s){return s?[...s.entries()]:[]}function MQt(s){return new Map(s)}function NQt(s){return new Map(s??[])}var fz;(function(s){s[s.TerminalCommand=0]="TerminalCommand",s[s.Opener=1]="Opener",s[s.Port=2]="Port",s[s.VscodeCommand=3]="VscodeCommand"})(fz||(fz={}));var H1;(function(s){s[s.CwdDetection=0]="CwdDetection",s[s.NaiveCwdDetection=1]="NaiveCwdDetection",s[s.CommandDetection=2]="CommandDetection",s[s.PartialCommandDetection=3]="PartialCommandDetection",s[s.BufferMarkDetection=4]="BufferMarkDetection"})(H1||(H1={}));var D8e;(function(s){s.Windows="windows",s.NoProblemsReported="noProblemsReported"})(D8e||(D8e={}));let k8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=n,this._instantiationService=o,this._environmentVariableService=r,this._logService=a,this._terminalProfileResolverService=c,this._terminalGroupService=d,this._terminalEditorService=h,this._terminalProfileService=u,this._store=new Z,this._extHostTerminals=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._dataEventTracker=new wn,this._sendCommandEventListener=new wn,this._linkProvider=this._store.add(new wn),this._os=po,this._proxy=e.getProxy(Ye.ExtHostTerminalService),this._store.add(t.onDidCreateInstance(p=>{this._onTerminalOpened(p),this._onInstanceDimensionsChanged(p)})),this._store.add(t.onDidDisposeInstance(p=>this._onTerminalDisposed(p))),this._store.add(t.onAnyInstanceProcessIdReady(p=>this._onTerminalProcessIdReady(p))),this._store.add(t.onDidChangeInstanceDimensions(p=>this._onInstanceDimensionsChanged(p))),this._store.add(t.onAnyInstanceMaximumDimensionsChange(p=>this._onInstanceMaximumDimensionsChanged(p))),this._store.add(t.onDidRequestStartExtensionTerminal(p=>this._onRequestStartExtensionTerminal(p))),this._store.add(t.onDidChangeActiveInstance(p=>this._onActiveTerminalChanged(p?p.instanceId:null))),this._store.add(t.onAnyInstanceTitleChange(p=>p&&this._onTitleChanged(p.instanceId,p.title))),this._store.add(t.onAnyInstanceDataInput(p=>this._proxy.$acceptTerminalInteraction(p.instanceId))),this._store.add(t.onAnyInstanceSelectionChange(p=>this._proxy.$acceptTerminalSelection(p.instanceId,p.selection)));for(const p of this._terminalService.instances)this._onTerminalOpened(p),p.processReady.then(()=>this._onTerminalProcessIdReady(p));const f=this._terminalService.activeInstance;if(f&&this._proxy.$acceptActiveTerminalChanged(f.instanceId),this._environmentVariableService.collections.size>0){const m=[...this._environmentVariableService.collections.entries()].map(v=>[v[0],jnt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||po,this._updateDefaultProfile()}),this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(()=>this._updateDefaultProfile()))}dispose(){this._store.dispose();for(const e of this._profileProviders.values())e.dispose();for(const e of this._quickFixProviders.values())e.dispose()}async _updateDefaultProfile(){const e=this._extHostContext.remoteAuthority??void 0,t=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os}),i=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os,allowAutomationShell:!0});this._proxy.$acceptDefaultProfile(...await Promise.all([t,i]))}async _getTerminalInstance(e){return typeof e=="string"?this._extHostTerminals.get(e):this._terminalService.getInstanceFromId(e)}async $createTerminal(e,t){const i={name:t.name,executable:t.shellPath,args:t.shellArgs,cwd:typeof t.cwd=="string"?t.cwd:N.revive(t.cwd),icon:t.icon,color:t.color,initialText:t.initialText,waitOnExit:t.waitOnExit,ignoreConfigurationCwd:!0,env:t.env,strictEnv:t.strictEnv,hideFromUser:t.hideFromUser,customPtyImplementation:t.isExtensionCustomPtyTerminal?(r,a,c)=>new vxe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},n=Zs.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,n);const o=await n;this._store.add(o.onDisposed(()=>{this._extHostTerminals.delete(e)}))}async _deserializeParentTerminal(e){if(typeof e=="object"&&"parentTerminal"in e){const t=await this._extHostTerminals.get(e.parentTerminal.toString());return t?{parentTerminal:t}:void 0}return e}async $show(e,t){const i=await this._getTerminalInstance(e);i&&(this._terminalService.setActiveInstance(i),i.target===fW.Editor?await this._terminalEditorService.revealActiveEditor(t):await this._terminalGroupService.showPanel(!t))}async $hide(e){const t=await this._getTerminalInstance(e),i=this._terminalService.activeInstance;i&&i.instanceId===t?.instanceId&&i.target!==fW.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(kT.Extension)}async $sendText(e,t,i){await(await this._getTerminalInstance(e))?.sendText(t,i)}$sendProcessExit(e,t){this._terminalProcessProxies.get(e)?.emitExit(t)}$startSendingDataEvents(){if(!this._dataEventTracker.value){this._dataEventTracker.value=this._instantiationService.createInstance(bxe,(e,t)=>{this._onTerminalData(e,t)});for(const e of this._terminalService.instances)for(const t of e.initialDataEvents||[])this._onTerminalData(e.instanceId,t)}}$stopSendingDataEvents(){this._dataEventTracker.clear()}$startSendingCommandEvents(){if(this._sendCommandEventListener.value)return;const e=this._terminalService.createOnInstanceCapabilityEvent(H1.CommandDetection,i=>i.onCommandFinished),t=e.event(i=>{this._onDidExecuteCommand(i.instance.instanceId,{commandLine:i.data.command,cwd:i.data.cwd,exitCode:i.data.exitCode,output:i.data.getOutput()})});this._sendCommandEventListener.value=jr(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new PQt(this._proxy))}$stopLinkProvider(){this._linkProvider.clear()}$registerProcessSupport(e){this._terminalService.registerProcessSupport(e)}$registerProfileProvider(e,t){this._profileProviders.set(e,this._terminalProfileService.registerTerminalProfileProvider(t,e,{createContributedTerminalProfile:async i=>this._proxy.$createContributedProfileTerminal(e,i)}))}$unregisterProfileProvider(e){this._profileProviders.get(e)?.dispose(),this._profileProviders.delete(e)}async $registerQuickFixProvider(e,t){this._quickFixProviders.set(e,this._terminalQuickFixService.registerQuickFixProvider(e,{provideTerminalQuickFixes:async(i,n,o,r)=>{if(r.isCancellationRequested)return;o.outputMatcher?.length&&o.outputMatcher.length>40&&(o.outputMatcher.length=40,this._logService.warn("Cannot exceed output matcher length of 40"));const a=i.command.match(o.commandLineMatcher);if(!a||!n)return;const c=o.outputMatcher;let l;if(c&&(l=FQt(n,c)),!l)return;const d={commandLineMatch:a,outputMatch:l,commandLine:i.command};if(d){const h=await this._proxy.$provideTerminalQuickFixes(e,d,r);if(h&&Array.isArray(h))return h.map(u=>I8e(e,t,u));if(h)return I8e(e,t,h)}}}))}$unregisterQuickFixProvider(e){this._quickFixProviders.get(e)?.dispose(),this._quickFixProviders.delete(e)}_onActiveTerminalChanged(e){this._proxy.$acceptActiveTerminalChanged(e)}_onTerminalData(e,t){this._proxy.$acceptTerminalProcessData(e,t)}_onDidExecuteCommand(e,t){this._proxy.$acceptDidExecuteCommand(e,t)}_onTitleChanged(e,t){this._proxy.$acceptTerminalTitleChange(e,t)}_onTerminalDisposed(e){this._proxy.$acceptTerminalClosed(e.instanceId,e.exitCode,e.exitReason??kT.Unknown)}_onTerminalOpened(e){const t=e.shellLaunchConfig.extHostTerminalId,i={name:e.shellLaunchConfig.name,executable:e.shellLaunchConfig.executable,args:e.shellLaunchConfig.args,cwd:e.shellLaunchConfig.cwd,env:e.shellLaunchConfig.env,hideFromUser:e.shellLaunchConfig.hideFromUser};this._proxy.$acceptTerminalOpened(e.instanceId,t,e.title,i)}_onTerminalProcessIdReady(e){e.processId!==void 0&&this._proxy.$acceptTerminalProcessId(e.instanceId,e.processId)}_onInstanceDimensionsChanged(e){this._proxy.$acceptTerminalDimensions(e.instanceId,e.cols,e.rows)}_onInstanceMaximumDimensionsChanged(e){this._proxy.$acceptTerminalMaximumDimensions(e.instanceId,e.maxCols,e.maxRows)}_onRequestStartExtensionTerminal(e){const t=e.proxy;this._terminalProcessProxies.set(t.instanceId,t);const i=e.cols&&e.rows?{columns:e.cols,rows:e.rows}:void 0;this._proxy.$startExtensionTerminal(t.instanceId,i).then(e.callback),t.onInput(n=>this._proxy.$acceptProcessInput(t.instanceId,n)),t.onShutdown(n=>this._proxy.$acceptProcessShutdown(t.instanceId,n)),t.onRequestCwd(()=>this._proxy.$acceptProcessRequestCwd(t.instanceId)),t.onRequestInitialCwd(()=>this._proxy.$acceptProcessRequestInitialCwd(t.instanceId))}$sendProcessData(e,t){this._terminalProcessProxies.get(e)?.emitData(t)}$sendProcessReady(e,t,i,n){this._terminalProcessProxies.get(e)?.emitReady(t,i,n)}$sendProcessProperty(e,t){t.type===Og.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,n){if(i){const o={persistent:t,map:MQt(i),descriptionMap:NQt(n)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};k8e=D([Gi(Be.MainThreadTerminalService),_(1,OU),_(2,qJe),_(3,QJe),_(4,we),_(5,$Je),_(6,Ge),_(7,GJe),_(8,hg),_(9,iMe),_(10,VJe),_(11,KJe)],k8e);let bxe=class extends V{constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new Qnt(this._callback));for(const i of this._terminalService.instances)this._registerInstance(i);this._register(this._terminalService.onDidCreateInstance(i=>this._registerInstance(i))),this._register(this._terminalService.onDidDisposeInstance(i=>this._bufferer.stopBuffering(i.instanceId)))}_registerInstance(e){this._register(this._bufferer.startBuffering(e.instanceId,e.onData))}};bxe=D([_(1,OU)],bxe);class PQt{constructor(e){this._proxy=e}async provideLinks(e,t){const i=this._proxy;return(await i.$provideLinks(e.instanceId,t)).map(o=>({id:o.id,startIndex:o.startIndex,length:o.length,label:o.label,activate:()=>i.$activateLink(e.instanceId,o.id)}))}}function FQt(s,e){const t=s.join(` +`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:s}:void 0}function I8e(s,e,t){let i=fz.TerminalCommand;return"uri"in t?(t.uri=N.revive(t.uri),i=fz.Opener):"id"in t&&(i=fz.VscodeCommand),{id:s,type:i,source:e,...t}}let T8e=class extends V{constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(Ye.ExtHostTerminalShellIntegration);const n=new Map;this._register(Ee(()=>{for(const d of n.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>M.map(M.filter(d.capabilities.onDidAddCapabilityType,h=>h===H1.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.CommandDetection,d=>d.onCommandExecuted));let a;this._store.add(r.event(d=>{if(d.data===a)return;a=d.data;const h=d.instance.instanceId;this._proxy.$shellExecutionStart(h,d.data.command,L8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),n.get(h)?.dispose(),n.set(h,M.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;n.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,L8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.CwdDetection,d=>d.onDidChangeCwd));this._store.add(l.event(d=>{this._proxy.$cwdChange(d.instance.instanceId,this._convertCwdToUri(d.data))})),this._store.add(this._terminalService.onDidDisposeInstance(d=>this._proxy.$closeTerminal(d.instanceId)))}$executeCommand(e,t){this._terminalService.getInstanceFromId(e)?.runCommand(t,!0)}_convertCwdToUri(e){return e?N.file(e):void 0}};T8e=D([Gi(Be.MainThreadTerminalShellIntegration),_(1,OU),_(2,Jr)],T8e);function L8e(s){switch(s.commandLineConfidence){case"high":return mD.High;case"medium":return mD.Medium;case"low":default:return mD.Low}}let R8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(Ye.ExtHostTheming),this._themeChangeListener=this._themeService.onDidColorThemeChange(i=>{this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}),this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}dispose(){this._themeChangeListener.dispose()}};R8e=D([Gi(Be.MainThreadTheming),_(1,pn)],R8e);let M8e=class extends V{constructor(e,t,i,n,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=n,this.logService=o,this._dataProviders=this._register(new mo),this._dndControllers=new Map,this._proxy=e.getProxy(Ye.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new BQt(e,this._proxy,this.notificationService),n=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>n.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new OQt(e,t.dropMimeTypes,t.dragMimeTypes,t.hasHandleDrag,this._proxy):void 0,r=this.getTreeView(e);r?(r.showCollapseAllAction=t.showCollapseAll,r.canSelectMany=t.canSelectMany,r.manuallyManageCheckboxes=t.manuallyManageCheckboxes,r.dragAndDropController=o,o&&this._dndControllers.set(e,o),r.dataProvider=i,this.registerListeners(e,r,n),this._proxy.$setVisible(e,r.visible)):this.notificationService.error("No view is registered with id: "+e)})}$reveal(e,t,i){return this.logService.trace("MainThreadTreeViews#$reveal",e,t?.item,t?.parentChain,i),this.viewsService.openView(e,i.focus).then(()=>{const n=this.getTreeView(e);if(n&&t)return this.reveal(n,this._dataProviders.get(e).dataProvider,t.item,t.parentChain,i)})}$refresh(e,t){this.logService.trace("MainThreadTreeViews#$refresh",e,t);const i=this.getTreeView(e),n=this._dataProviders.get(e);if(i&&n){const o=n.dataProvider.getItemsToRefresh(t);return i.refresh(o.length?o:void 0)}return Promise.resolve()}$setMessage(e,t){this.logService.trace("MainThreadTreeViews#$setMessage",e,t.toString());const i=this.getTreeView(e);i&&(i.message=t)}$setTitle(e,t,i){this.logService.trace("MainThreadTreeViews#$setTitle",e,t,i);const n=this.getTreeView(e);n&&(n.title=t,n.description=i)}$setBadge(e,t){this.logService.trace("MainThreadTreeViews#$setBadge",e,t?.value,t?.tooltip);const i=this.getTreeView(e);i&&(i.badge=t)}$resolveDropFileData(e,t,i){const n=this._dndControllers.get(e);if(!n)throw new Error("Unknown tree");return n.resolveDropFileData(t,i)}async $disposeTree(e){const t=this.getTreeView(e);t&&(t.dataProvider=void 0),this._dataProviders.deleteAndDispose(e)}async reveal(e,t,i,n,o){o=o||{select:!1,focus:!1};const r=ra(o.select)?!1:o.select,a=ra(o.focus)?!1:o.focus;let c=Math.min(lc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of n){const h=t.getItem(d.handle);h&&await e.expand(h)}const l=t.getItem(i.handle);if(l){await e.reveal(l),r&&e.setSelection([l]),a===!1?e.setFocus():a&&e.setFocus(l);let d=[l];for(;d.length>0&&c>0;c--)await e.expand(d),d=d.reduce((h,u)=>{const f=t.getItem(u.handle);return f&&f.children&&f.children.length&&h.push(...f.children),h},[])}}registerListeners(e,t,i){i.add(t.onDidExpandItem(n=>this._proxy.$setExpanded(e,n.handle,!0))),i.add(t.onDidCollapseItem(n=>this._proxy.$setExpanded(e,n.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(n=>this._proxy.$setSelectionAndFocus(e,n.selection.map(({handle:o})=>o),n.focus.handle))),i.add(t.onDidChangeVisibility(n=>this._proxy.$setVisible(e,n))),i.add(t.onDidChangeCheckboxState(n=>{this._proxy.$changeCheckboxState(e,n.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=Qe.as(eI.ViewsRegistry).getView(e);return t?t.treeView:null}dispose(){for(const e of this._dataProviders){const t=this.getTreeView(e[0]);t&&(t.dataProvider=void 0)}this._dataProviders.dispose(),this._dndControllers.clear(),super.dispose()}};M8e=D([Gi(Be.MainThreadTreeViews),_(1,Lm),_(2,bi),_(3,fs),_(4,Ge)],M8e);class OQt{constructor(e,t,i,n,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=n,this._proxy=o,this.dataTransfersCache=new gPe}async handleDrop(e,t,i,n,o,r){const a=this.dataTransfersCache.add(e);try{const c=await B_.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,n,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const n=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!n)return;const o=new lce;return n.items.forEach(([r,a])=>{o.replace(r,q6(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class BQt{constructor(e,t,i){this.treeViewId=e,this._proxy=t,this.notificationService=i,this.itemsMap=new Map,this.hasResolve=this._proxy.$hasResolve(this.treeViewId)}getChildren(e){return e||this.itemsMap.clear(),this._proxy.$getChildren(this.treeViewId,e?e.handle:void 0).then(t=>this.postGetChildren(t),t=>(tw.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const n=this.getItem(i);if(n){const o=e[i];if(this.updateTreeItem(n,o),i===o.handle)t.push(n);else{this.itemsMap.delete(i),this.itemsMap.set(n.handle,n);const r=o.parentHandle?this.itemsMap.get(o.parentHandle):null;r&&t.push(r)}}}return t}getItem(e){return this.itemsMap.get(e)}isEmpty(){return this.itemsMap.size===0}async postGetChildren(e){if(e===void 0)return;const t=[],i=await this.hasResolve;if(e)for(const n of e){const o=new Xhe(n,i?r=>this._proxy.$resolve(this.treeViewId,n.handle,r):void 0);this.itemsMap.set(n.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=ja([...Object.keys(e instanceof Xhe?e.asTreeItem():e),...Object.keys(t)]);for(const n of i)e[n]=t[n];e instanceof Xhe&&e.resetResolve()}}}let N8e=class extends V{constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(N.revive(e),N.revive(t))}};N8e=D([Gi(Be.MainThreadDownloadService),_(1,HRe)],N8e);class WQt{constructor(e,t,i,n){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=n}handleURL(e,t){return Sn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let P8e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(Ye.ExtHostUrls)}$registerUriHandler(e,t,i){const n=new WQt(this.proxy,e,t,i),o=this.urlService.registerHandler(n);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,n),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:n}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),n.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};P8e=D([Gi(Be.MainThreadUrls),_(1,Uae),_(2,cXe)],P8e);const Ynt="default",HQt="workbench.externalUriOpeners",wxe={type:"string",enum:[]},F8e="\n- `https://microsoft.com`: Matches this specific domain using https\n- `https://microsoft.com:8080`: Matches this specific domain on this port using https\n- `https://microsoft.com:*`: Matches this specific domain on any port using https\n- `https://microsoft.com/foo`: Matches `https://microsoft.com/foo` and `https://microsoft.com/foo/bar`, but not `https://microsoft.com/foobar` or `https://microsoft.com/bar`\n- `https://*.microsoft.com`: Match all domains ending in `microsoft.com` using https\n- `microsoft.com`: Match this specific domain using either http or https\n- `*.microsoft.com`: Match all domains ending in `microsoft.com` using either http or https\n- `http://192.168.0.1`: Matches this specific IP using http\n- `http://192.168.0.*`: Matches all IP's with this prefix using http\n- `*`: Match all domains using either http or https",UQt={...V6,properties:{[HQt]:{type:"object",markdownDescription:g(8681,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. Example patterns: -{0}`,n9e)},{type:"string",markdownDescription:g(aY,1,`Map URI pattern to an opener id. +{0}`,F8e)},{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. Example patterns: -{0}`,n9e),enum:[frt],enumDescriptions:[g(aY,2,"Open using VS Code's standard opener.")]},OIe]}}}};function zKt(n,e){OIe.enum=n,OIe.enumDescriptions=e,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(VKt)}var BIe,GP;let WIe=(GP=class extends ${constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new W1(BIe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(ke.PROFILE,ln.MACHINE);for(const[i,s]of Object.entries(this._mementoObject||{}))this.add(i,s.extensionId,{isCurrentlyRegistered:!1});this.invalidateOpenersOnExtensionsChanged(),this._register(this._extensionService.onDidChangeExtensions(()=>this.invalidateOpenersOnExtensionsChanged())),this._register(this._extensionService.onDidChangeExtensionsStatus(()=>this.invalidateOpenersOnExtensionsChanged()))}didRegisterOpener(e,t){this.add(e,t,{isCurrentlyRegistered:!0})}add(e,t,i){const s=this._openers.get(e);if(s){s.isCurrentlyRegistered=s.isCurrentlyRegistered||i.isCurrentlyRegistered;return}const o={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,o),this._mementoObject[e]=o,this._memento.saveMemento(),this.updateSchema()}delete(e){this._openers.delete(e),delete this._mementoObject[e],this._memento.saveMemento(),this.updateSchema()}async invalidateOpenersOnExtensionsChanged(){await this._extensionService.whenInstalledExtensionsRegistered();const e=this._extensionService.extensions;for(const[t,i]of this._openers){const s=e.find(o=>o.identifier.value===i.extensionId);s?this._extensionService.canRemoveExtension(s)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,s]of this._openers)e.push(i),t.push(s.extensionId);zKt(e,t)}},BIe=GP,GP.STORAGE_ID="externalUriOpeners",GP);WIe=BIe=D([_(0,on),_(1,ho)],WIe);const s9e="vs/workbench/api/browser/mainThreadUriOpeners";let o9e=class extends ${constructor(e,t,i,s,o,r){super(),this.extensionService=s,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(et.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new WIe(t,s))}async*getOpeners(e){if(!(e.scheme!==_e.http&&e.scheme!==_e.https)){await this.extensionService.activateByEvent(`onOpenExternalUri:${e.scheme}`);for(const[t,i]of this._registeredOpeners)i.schemes.has(e.scheme)&&(yield this.createOpener(t,i))}}createOpener(e,t){return{id:e,label:t.label,canOpen:(i,s)=>this.proxy.$canOpenUri(e,i,s),openExternalUri:async(i,s,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:s.sourceUri},o)}catch(r){if(!Na(r)){const a=new xn("default",g(s9e,0,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:frt})});a.tooltip=i.toString(),this.notificationService.notify({severity:nt.Error,message:g(s9e,1,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,s){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:s,extensionId:i}),this._contributedExternalUriOpenersStore.didRegisterOpener(e,i.value)}async $unregisterUriOpener(e){this._registeredOpeners.delete(e),this._contributedExternalUriOpenersStore.delete(e)}dispose(){super.dispose(),this._registeredOpeners.clear()}};o9e=D([en(Ue.MainThreadUriOpeners),_(1,on),_(2,VZe),_(3,ho),_(4,fr),_(5,Pi)],o9e);let r9e=class{constructor(e,t,i,s){this.hostService=t,this.openerService=i,this.userActivityService=s,this.disposables=new Z,this.proxy=e.getProxy(et.ExtHostWindow),T.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),s.onDidChangeIsActive(this.proxy.$onDidChangeWindowActive,this.proxy,this.disposables)}dispose(){this.disposables.dispose()}$getInitialState(){return Promise.resolve({isFocused:this.hostService.hasFocus,isActive:this.userActivityService.isActive})}async $openUri(e,t,i){const s=P.from(e);let o;return t&&P.parse(t).toString()===s.toString()?o=t:o=s,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(P.revive(e),t)).resolved}};r9e=D([en(Ue.MainThreadWindow),_(1,Id),_(2,fr),_(3,WPe)],r9e);var HIe;let UIe=HIe=class extends ${static async create(e,t,i){return e.invokeFunction(async s=>{const r=await s.get(Rn).createModelReference(i);return e.createInstance(HIe,t,i,r)})}constructor(e,t,i,s){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=s,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._register(i),this._textFileModel=this.textFileService.files.get(t),this._textFileModel&&(this._register(this._textFileModel.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._register(this._textFileModel.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._register(this.textFileService.files.onDidChangeDirty(o=>{_n(this.resource,o.resource)&&(this._onDidChangeDirty.fire(),this._onDidChangeContent.fire())}))}get resource(){return this._resource}isReadonly(){return this._model.object.isReadonly()}get backupId(){}get canHotExit(){return!0}isDirty(){return this.textFileService.isDirty(this.resource)}isOrphaned(){return!!this._textFileModel?.hasState(uu.ORPHAN)}async revert(e){return this.textFileService.revert(this.resource,e)}saveCustomEditor(e){return this.textFileService.save(this.resource,e)}async saveCustomEditorAs(e,t,i){return!!await this.textFileService.saveAs(e,t,i)}};UIe=HIe=D([_(3,tr)],UIe);new Y("webviewFindWidgetVisible",!1);new Y("webviewFindWidgetFocused",!1);new Y("webviewFindWidgetEnabled",!1);var a9e;(function(n){n.NotebookRenderer="notebookRenderer",n.CustomEditor="customEditor",n.WebviewView="webviewView"})(a9e||(a9e={}));let VIe=class{constructor(e,t){this._memento=new W1(e,t),this._state=this._memento.getMemento(ke.APPLICATION,ln.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),s=this._state[i];if(s&&typeof s=="string")return s;const o=Dr();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};VIe=D([_(1,on)],VIe);let Toe=class{constructor(e,t){this._store=new VIe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};Toe=D([_(1,on)],Toe);let Roe=class extends ${constructor(e,t){super(),this.resource=e,this.fileService=t,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.orphaned=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._register(this.fileService.onDidFilesChange(i=>this.onDidFilesChange(i)))}isOrphaned(){return this.orphaned}async onDidFilesChange(e){let t=!1,i;if(this.orphaned?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.orphaned!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.orphaned!==e&&(this.orphaned=e,this._onDidChangeOrphaned.fire())}isDisposed(){return this._store.isDisposed}dispose(){this.orphaned=!1,this._onWillDispose.fire(),super.dispose()}isModified(){return this.isDirty()}};Roe=D([_(1,ci)],Roe);var PX;const c9e="vs/workbench/api/browser/mainThreadCustomEditors";var A2;(function(n){n[n.Custom=0]="Custom",n[n.Text=1]="Text"})(A2||(A2={}));let zIe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.mainThreadWebview=t,this.mainThreadWebviewPanels=i,this._customEditorService=c,this._editorGroupService=l,this._editorService=d,this._instantiationService=h,this._webviewWorkbenchService=u,this._editorProviders=this._register(new Zo),this._editorRenameBackups=new Map,this._webviewOriginStore=new Toe("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(et.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof E2&&MS(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof nH&&s.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Text,Wse(e),t,i,s,!0,o)}$registerCustomEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Custom,Wse(e),t,i,{},s,o)}registerEditorProvider(e,t,i,s,o,r,a){if(this._editorProviders.has(i))throw new Error(`Provider for ${i} already registered`);const c=new Z;c.add(this._customEditorService.registerCustomEditorCapabilities(i,{supportsMultipleEditorsPerDocument:r})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof nH&&l.viewType===i,resolveWebview:async(l,d)=>{const h=Dr(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=s,l.webview.extension=t;let f=l.backupId;l.oldResource&&!l.backupId&&(f=this._editorRenameBackups.get(l.oldResource.toString())?.backupId,this._editorRenameBackups.delete(l.oldResource.toString()));let p;try{p=await this.getOrCreateCustomEditorModel(e,u,i,{backupId:f},d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i));return}if(d.isCancellationRequested){p.dispose();return}l.webview.onDidDispose(()=>{if(p.object.isDirty()){const m=p.object.onDidChangeDirty(()=>{p.object.isDirty()||(m.dispose(),p.dispose())});return}p.dispose()}),o.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},qe.None),this._proxyCustomEditors.$onMoveCustomEditor(h,m,i),v.dispose()});try{await this._proxyCustomEditors.$resolveCustomEditor(u,h,i,{title:l.getTitle(),contentOptions:l.webview.contentOptions,options:l.webview.options,active:l===this._editorService.activeEditor},U1(this._editorGroupService,l.group||0),d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i)),p.dispose();return}}})),this._editorProviders.set(i,c)}$unregisterEditorProvider(e){if(!this._editorProviders.has(e))throw new Error(`No provider for ${e} registered`);this._editorProviders.deleteAndDispose(e),this._customEditorService.models.disposeAllModelsForView(e)}async getOrCreateCustomEditorModel(e,t,i,s,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case A2.Text:{const a=UIe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case A2.Custom:{const a=E2.create(this._instantiationService,this._proxyCustomEditors,i,t,s,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof nH&&_n(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,s){(await this.getCustomEditorModel(e,t)).pushEdit(i,s)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=P.revive(e),s=await this._customEditorService.models.get(i,t);if(!s||!(s instanceof E2))throw new Error("Could not find model for webview editor");return s}async onWillRunWorkingCopyFileOperation(e){e.operation===Li.MOVE&&e.waitUntil((async()=>{const t=[];for(const i of e.files)i.source&&t.push(...await this._customEditorService.models.getAllModels(i.source));for(const i of t)if(i instanceof E2&&i.isDirty()){const s=await i.backup(qe.None);s.meta&&this._editorRenameBackups.set(i.editorResource.toString(),s.meta)}})())}};zIe=D([_(3,ho),_(4,on),_(5,Pw),_(6,fC),_(7,IPe),_(8,ur),_(9,_i),_(10,be),_(11,kQ)],zIe);var IA;(function(n){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Allowed=Object.freeze({type:e.Allowed}),n.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(s){this.operation=s,this.type=e.Pending}}n.Pending=t})(IA||(IA={}));let E2=PX=class extends Roe{static async create(e,t,i,s,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(s,i,o.backupId,l,a);return e.createInstance(PX,t,i,s,!!o.backupId,d,!!l,r)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(PX.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=o,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=IA.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=rOe,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this.onDidChangeReadonly=T.None,this._fromBackup=s,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(c9e,0,"Custom editor '{0}' could not be saved.",this.name))}))),r&&(this._isDirtyFromContentChange=!0)}get editorResource(){return this._editorResource}dispose(){this._editable&&this._undoService.removeElements(this._editorResource),this._proxy.$disposeCustomDocument(this._editorResource,this._viewType),super.dispose()}static toWorkingCopyResource(e,t){const i=e.replace(/[^a-z0-9\-_]/gi,"-"),s=`/${O9(t.with({query:null,fragment:null}).toString(!0))}`;return P.from({scheme:_e.vscodeCustomEditor,authority:i,path:s,query:JSON.stringify(t.toJSON())})}get name(){return yr(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?JS.Untitled:JS.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===_e.untitled}isReadonly(){return!this._editable}get viewType(){return this._viewType}get backupId(){return this._backupId}pushEdit(e,t){if(!this._editable)throw new Error("Document is not editable");this.change(()=>{this.spliceEdits(e),this._currentEditIndex=this._edits.length-1}),this._undoService.pushElement({type:wd.Resource,resource:this._editorResource,label:t??g(c9e,1,"Edit"),code:"undoredo.customEditorEdit",undo:()=>this.undo(),redo:()=>this.redo()})}changeContent(){this.change(()=>{this._isDirtyFromContentChange=!0})}async undo(){if(!this._editable||this._currentEditIndex<0)return;const e=this._edits[this._currentEditIndex];this.change(()=>{--this._currentEditIndex}),await this._proxy.$undo(this._editorResource,this.viewType,e,this.isDirty())}async redo(){if(!this._editable||this._currentEditIndex>=this._edits.length-1)return;const e=this._edits[this._currentEditIndex+1];this.change(()=>{++this._currentEditIndex}),await this._proxy.$redo(this._editorResource,this.viewType,e,this.isDirty())}spliceEdits(e){const t=this._currentEditIndex+1,i=this._edits.length-this._currentEditIndex,s=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);s.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,s)}change(e){const t=this.isDirty();e(),this._onDidChangeContent.fire(),this.isDirty()!==t&&this._onDidChangeDirty.fire()}async revert(e){this._editable&&(this._currentEditIndex===this._savePoint&&!this._isDirtyFromContentChange&&!this._fromBackup||(e?.soft||this._proxy.$revert(this._editorResource,this.viewType,qe.None),this.change(()=>{this._isDirtyFromContentChange=!1,this._fromBackup=!1,this._currentEditIndex=this._savePoint,this.spliceEdits()})))}async save(e){const t=!!await this.saveCustomEditor(e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),t}async saveCustomEditor(e){if(!this._editable)return;if(this.isUntitled()){const i=await this.suggestUntitledSavePath(e);return i?(await this.saveCustomEditorAs(this._editorResource,i,e),i):void 0}const t=na(i=>this._proxy.$onSave(this._editorResource,this.viewType,i));this._ongoingSave?.cancel(),this._ongoingSave=t;try{await t,this._ongoingSave===t&&this.change(()=>{this._isDirtyFromContentChange=!1,this._savePoint=this._currentEditIndex,this._fromBackup=!1})}finally{this._ongoingSave===t&&(this._ongoingSave=void 0)}return this._editorResource}suggestUntitledSavePath(e){if(!this.isUntitled())throw new Error("Resource is not untitled");const t=this._environmentService.remoteAuthority,i=R9(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await na(s=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,s)),this.change(()=>{this._savePoint=this._currentEditIndex}),!0):(await this.fileService.copy(e,t,!1),!0)}get canHotExit(){return typeof this._backupId=="string"&&this._hotExitState.type===IA.Type.Allowed}async backup(e){const t=this._getEditors();if(!t.length)throw new Error("No editors found for resource, cannot back up");const i=t[0],o={meta:{viewType:this.viewType,editorResource:this._editorResource,backupId:"",extension:i.extension?{id:i.extension.id.value,location:i.extension.location}:void 0,webview:{origin:i.webview.origin,options:i.webview.options,state:i.webview.state}}};if(!this._editable)return o;this._hotExitState.type===IA.Type.Pending&&this._hotExitState.operation.cancel();const r=new IA.Pending(na(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=r,e.onCancellationRequested(()=>{r.operation.cancel()});let a="";try{const c=await r.operation;this._hotExitState===r&&(this._hotExitState=IA.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Na(c))throw c;this._hotExitState===r&&(this._hotExitState=IA.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===IA.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};E2=PX=D([_(7,bf),_(8,ci),_(9,eo),_(10,pO),_(11,ec),_(12,Pw),_(13,Tm),_(14,ho)],E2);class $Kt{constructor(){this._handlesToInputs=new Map,this._inputsToHandles=new Map}add(e,t){this._handlesToInputs.set(e,t),this._inputsToHandles.set(t,e)}getHandleForInput(e){return this._inputsToHandles.get(e)}getInputForHandle(e){return this._handlesToInputs.get(e)}delete(e){const t=this.getInputForHandle(e);this._handlesToInputs.delete(e),t&&this._inputsToHandles.delete(t)}get size(){return this._handlesToInputs.size}[Symbol.iterator](){return this._handlesToInputs.values()}}class GKt{constructor(e){this.prefix=e}fromExternal(e){return this.prefix+e}toExternal(e){return e.startsWith(this.prefix)?e.substr(this.prefix.length):void 0}}let $Ie=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=s,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new GKt("mainThreadWebview-"),this._webviewInputs=new $Kt,this._revivers=this._register(new Zo),this.webviewOriginStore=new Toe("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(et.ExtHostWebviewPanels),this._register(T.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,s.onDidAddGroup,s.onDidRemoveGroup,s.onDidMoveGroup)(()=>{this.updateWebviewViewStates(this._editorService.activeEditor)})),this._register(l.onDidChangeActiveWebviewEditor(d=>{this.updateWebviewViewStates(d)})),this._register(l.registerResolver({canResolve:d=>{const h=this.webviewPanelViewType.toExternal(d.viewType);return typeof h=="string"&&r.activateByEvent(`onWebviewPanel:${h}`),!1},resolveWebview:()=>{throw new Error("not implemented")}}))}get webviewInputs(){return this._webviewInputs}addWebviewInput(e,t,i){this._webviewInputs.add(e,t),this._mainThreadWebviews.addWebview(e,t.webview,i),t.webview.onDidDispose(()=>{this._proxy.$onDidDisposeWebviewPanel(e).finally(()=>{this._webviewInputs.delete(e)})})}$createWebviewPanel(e,t,i,s,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=Wse(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:s.title,options:QKt(s.panelOptions),contentOptions:Hse(s.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),s.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:s.serializeBuffersForPostMessage});const h={extensionId:c.id.value,viewType:i};this._telemetryService.publicLog2("webviews:createWebviewPanel",h)}$disposeWebview(e){const t=this.tryGetWebviewInput(e);t&&t.dispose()}$setTitle(e,t){this.tryGetWebviewInput(e)?.setName(t)}$setIconPath(e,t){const i=this.tryGetWebviewInput(e);i&&(i.iconPath=qKt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const s=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,s,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===wx||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return wx;if(e.viewColumn===Cw)return Cw;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(gg.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:vEe.LAST});if(i){const s=w6(this._configurationService);return this._editorGroupService.addGroup(i,s)}}return wx}$registerSerializer(e,t){if(this._revivers.has(e))throw new Error(`Reviver for ${e} already registered`);this._revivers.set(e,this._webviewWorkbenchService.registerResolver({canResolve:i=>i.viewType===this.webviewPanelViewType.fromExternal(e),resolveWebview:async i=>{const s=this.webviewPanelViewType.toExternal(i.viewType);if(!s){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=Dr();this.addWebviewInput(o,i,t);let r;if(i.webview.state)try{r=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(o,s,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},U1(this._editorGroupService,i.group||0))}catch(a){bt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(s))}}}))}$unregisterSerializer(e){if(!this._revivers.has(e))throw new Error(`No reviver for ${e} registered`);this._revivers.deleteAndDispose(e)}updateWebviewViewStates(e){if(!this._webviewInputs.size)return;const t={},i=(s,o,r)=>{if(!(r instanceof Qg))return;r.updateGroup(s.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===s.activeEditor,active:r===e,position:U1(this._editorGroupService,s.id)})};for(const s of this._editorGroupService.groups)for(const o of s.editors)o instanceof op?(i(s,o,o.primary),i(s,o,o.secondary)):i(s,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};$Ie=D([_(2,Re),_(3,ur),_(4,_i),_(5,ho),_(6,on),_(7,rn),_(8,kQ)],$Ie);function qKt(n){if(n)return{light:P.revive(n.light),dark:P.revive(n.dark)}}function QKt(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}let GIe=class extends ${constructor(e,t,i,s){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=s,this._webviewViews=this._register(new Zo),this._webviewViewProviders=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostWebviewViews)}$setWebviewViewTitle(e,t){const i=this.getWebviewView(e);i.title=t}$setWebviewViewDescription(e,t){const i=this.getWebviewView(e);i.description=t}$setWebviewViewBadge(e,t){const i=this.getWebviewView(e);i.badge=t}$show(e,t){this.getWebviewView(e).show(t)}$registerWebviewViewProvider(e,t,i){if(this._webviewViewProviders.has(t))throw new Error(`View provider for ${t} already registered`);const s=Wse(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=Dr();this._webviewViews.set(c,r),this.mainThreadWebviews.addWebview(c,r.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(r.webview.state)try{l=JSON.parse(r.webview.state)}catch(d){console.error("Could not load webview state",d,r.webview.state)}r.webview.extension=s,i&&(r.webview.options=i),r.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),r.onDispose(()=>{this._proxy.$disposeWebviewView(c),this._webviewViews.deleteAndDispose(c)}),this._telemetryService.publicLog2("webviews:createWebviewView",{extensionId:s.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){bt(d),r.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,o)}$unregisterWebviewViewProvider(e){if(!this._webviewViewProviders.has(e))throw new Error(`No view provider for ${e} registered`);this._webviewViewProviders.deleteAndDispose(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("unknown webview view");return t}};GIe=D([_(2,rn),_(3,het)],GIe);let l9e=class extends ${constructor(e,t){super();const i=this._register(t.createInstance(Eke,e));e.set(Ue.MainThreadWebviews,i);const s=this._register(t.createInstance($Ie,e,i));e.set(Ue.MainThreadWebviewPanels,s);const o=this._register(t.createInstance(zIe,e,i,s));e.set(Ue.MainThreadCustomEditors,o);const r=this._register(t.createInstance(GIe,e,i));e.set(Ue.MainThreadWebviewViews,r)}};l9e=D([TO,_(1,be)],l9e);const H5="vs/workbench/api/browser/mainThreadWorkspace";let d9e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=s,this._canonicalUriService=o,this._editorService=r,this._workspaceEditingService=a,this._notificationService=c,this._requestService=l,this._instantiationService=d,this._labelService=h,this._environmentService=u,this._workspaceTrustManagementService=p,this._workspaceTrustRequestService=m,this._toDispose=new Z,this._activeCancelTokens=Object.create(null),this._queryBuilder=this._instantiationService.createInstance(Gne),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(et.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!rf&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(w=>this._proxy.$initializeWorkspace(this.getWorkspaceData(w),this.isWorkspaceTrusted())),this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace,this,this._toDispose),this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace,this,this._toDispose),this._workspaceTrustManagementService.onDidChangeTrust(this._onDidGrantWorkspaceTrust,this,this._toDispose)}dispose(){this._toDispose.dispose();for(const e in this._activeCancelTokens)this._activeCancelTokens[e].cancel()}$updateWorkspaceFolders(e,t,i,s){const o=s.map(r=>({uri:P.revive(r.uri),name:r.name}));return this._notificationService.status(this.getStatusMessage(e,o.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,o,!0)}getStatusMessage(e,t,i){let s;const o=t>0,r=i>0;return o&&!r?t===1?s=g(H5,0,"Extension '{0}' added 1 folder to the workspace",e):s=g(H5,1,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?s=g(H5,2,"Extension '{0}' removed 1 folder from the workspace",e):s=g(H5,3,"Extension '{0}' removed {1} folders from the workspace",e,i):s=g(H5,4,"Extension '{0}' changed folders of the workspace",e),s}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?p7(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const s=P.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(s?[s]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Na(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,s,o){const r=P.revive(t),a=this._contextService.getWorkspace(),c=r?[r]:a.folders.map(u=>u.uri),l=this._queryBuilder.text(e,c,i);l._reason="startTextSearch";const d=u=>{u.results&&this._proxy.$handleTextSearchResult(u,s)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Na(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(s=>eot(s,e,t,i))}async $save(e,t){const i=P.revive(e),s=[...this._editorService.findEditors(i,{supportSideBySide:go.PRIMARY})],o=await this._editorService.save(s,{reason:Ln.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return k_(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Vi(e.editors.map(t=>jc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$loadCertificates(){return this._requestService.loadCertificates()}$requestWorkspaceTrust(e){return this._workspaceTrustRequestService.requestWorkspaceTrust(e)}isWorkspaceTrusted(){return this._workspaceTrustManagementService.isWorkspaceTrusted()}_onDidGrantWorkspaceTrust(){this._proxy.$onDidGrantWorkspaceTrust()}$registerEditSessionIdentityProvider(e,t){const i=this._editSessionIdentityService.registerEditSessionIdentityProvider({scheme:t,getEditSessionIdentifier:async(s,o)=>this._proxy.$getEditSessionIdentifier(s.uri,o),provideEditSessionIdentityMatch:async(s,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(s.uri,o,r,a)});this.registeredEditSessionProviders.set(e,i),this._toDispose.add(i)}$unregisterEditSessionIdentityProvider(e){this.registeredEditSessionProviders.get(e)?.dispose(),this.registeredEditSessionProviders.delete(e)}$registerCanonicalUriProvider(e,t){const i=this._canonicalUriService.registerCanonicalUriProvider({scheme:t,provideCanonicalUri:async(s,o,r)=>{const a=await this._proxy.$provideCanonicalUri(s,o,r);return a&&P.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};d9e=D([en(Ue.MainThreadWorkspace),_(1,ohe),_(2,Ti),_(3,EPe),_(4,APe),_(5,_i),_(6,$S),_(7,Pi),_(8,EQ),_(9,be),_(10,eo),_(11,Il),_(12,ci),_(13,oA),_(14,Ade)],d9e);var jKt=".comments-panel .comments-panel-container{height:100%}.comments-panel .comments-panel-container .hidden{display:none}.comments-panel .comments-panel-container .tree-container{height:100%}.comments-panel .comments-panel-container .tree-container.hidden{display:none;visibility:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container{display:block}.comments-panel .comments-panel-container .tree-container .comment-thread-container div{overflow:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container,.comments-panel .comments-panel-container .tree-container .resource-container{display:flex;overflow:hidden;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata{display:flex;flex:1}.comments-panel .count,.comments-panel .user{padding-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .icon{min-width:fit-content;padding-right:5px;padding-top:4px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .user,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .count{min-width:fit-content}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance{background-color:var(--vscode-badge-background);border-radius:2px;color:var(--vscode-badge-foreground);font-size:.9em;line-height:14px;margin-bottom:3px;margin-right:4px;margin-top:4px;padding:0 4px 1px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text{display:flex;flex:1;min-width:0}.comments-panel .comments-panel-container .tree-container .comment-thread-container .reply-detail,.comments-panel .comments-panel-container .tree-container .comment-thread-container .timestamp,.comments-panel .comments-panel-container .tree-container .resource-container .owner{display:block;font-size:.9em;opacity:.8;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .text *{margin:0;max-width:500px;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .range{opacity:.8}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text code{font-family:var(--monaco-monospace-font)}.comments-panel .comments-panel-container .tree-container .monaco-icon-label{padding-right:5px}.comments-panel .comments-panel-container .tree-container .separator{opacity:.8;padding-right:5px}.comments-panel .comments-panel-container .message-box-container{height:inherit;line-height:22px;padding-left:20px}.comments-panel .comments-panel-container .tree-container .count-badge-wrapper{margin-left:10px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{line-height:22px;margin-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{padding-left:16px}.comments-panel .hide{display:none}.comments-panel .comments-panel-container .text a{color:var(--vscode-textLink-foreground)}.comments-panel .comments-panel-container .text a:hover,.comments-panel .comments-panel-container a:active{color:var(--vscode-textLink-activeForeground)}.comments-panel .comments-panel-container .text a:focus{outline-color:var(--vscode-focusBorder)}.comments-panel .comments-panel-container .text code{color:var(--vscode-textPreformat-foreground)}.comments-panel .comments-panel-container .actions{display:none}.comments-panel .comments-panel-container .actions .action-label{padding:2px}.comments-panel .monaco-list .monaco-list-row.focused .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row.selected .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row:hover .comment-metadata-container .actions{display:block}";Ct(jKt,{});let Ly=class{constructor(e,t,i,s,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=s,this.thread=o,this.isRoot=!1,this.replies=[],this.threadId=o.threadId,this.range=o.range,this.threadState=o.state,this.threadRelevance=o.applicability,this.contextValue=o.contextValue,this.controllerHandle=o.controllerHandle,this.threadHandle=o.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class dm{constructor(e,t,i,s){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=s.filter(o=>o.comments&&o.comments.length).map(o=>dm.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,s){const{comments:o}=s,r=o.map(a=>new Ly(e,t,i,a,s));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const aue="comments";class qIe extends ${constructor(e,t,i,s){super(),this.configurationService=e,this._date=he(i,we("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupUpdatableHover(va("mouse"),this._date,"")),this.setTimestamp(s)}get useRelativeTimeSetting(){return this.configurationService.getValue(aue).useRelativeTime}async setTimestamp(e){(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime)&&this.updateDate(e),this._timestamp=e,this._useRelativeTime=this.useRelativeTimeSetting}updateDate(e){if(!e)this._date.textContent="",this._date.style.display="none";else if(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime){this._date.style.display="";let t,i;this.useRelativeTimeSetting?(t=this.getRelative(e),i=this.getDateString(e)):t=this.getDateString(e),this._date.textContent=t,this.hover.update(i??"")}}getRelative(e){return HFe(e,!0,!0)}getDateString(e){return e.toLocaleString(Gd)}}const RO="vs/workbench/contrib/comments/browser/commentColors",QIe=B("commentsView.resolvedIcon",{dark:aWe,light:aWe,hcDark:ft,hcLight:ft},g(RO,0,"Icon color for resolved comments.")),jIe=B("commentsView.unresolvedIcon",{dark:swe,light:swe,hcDark:ft,hcLight:ft},g(RO,1,"Icon color for unresolved comments."));B("editorCommentsWidget.replyInputBackground",{dark:SR,light:SR,hcDark:SR,hcLight:SR},g(RO,2,"Background color for comment reply input box."));const KKt=B("editorCommentsWidget.resolvedBorder",{dark:QIe,light:QIe,hcDark:ft,hcLight:ft},g(RO,3,"Color of borders and arrow for resolved comments.")),VE=B("editorCommentsWidget.unresolvedBorder",{dark:jIe,light:jIe,hcDark:ft,hcLight:ft},g(RO,4,"Color of borders and arrow for unresolved comments."));B("editorCommentsWidget.rangeBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,5,"Color of background for comment ranges."));B("editorCommentsWidget.rangeActiveBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,6,"Color of background for currently selected or hovered comment range."));const YKt=new Map([[hg.Unresolved,VE],[hg.Resolved,KKt]]),JKt=new Map([[hg.Unresolved,jIe],[hg.Resolved,QIe]]),prt="--comment-thread-state-color",h9e="--comment-view-thread-state-color",mrt="--comment-thread-state-background-color";function _rt(n,e,t){const i=n!==void 0?t.get(n):void 0;return i!==void 0?e.getColor(i):void 0}function XKt(n,e){return _rt(n,e,YKt)}function ZKt(n,e){return _rt(n,e,JKt)}const ale=class ale{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const s=e.startsWith("!");this.textFilter={text:(s?lz(e,"!"):e).trim(),negate:s}}};ale._filter=KYe,ale._messageFilter=dee;let gE=ale;const eYt="vs/workbench/contrib/comments/browser/commentsModel";class cue extends ${get resourceCommentThreads(){return this._resourceCommentThreads}constructor(){super(),this._resourceCommentThreads=[],this.commentThreadsMap=new Map}updateResourceCommentThreads(){const e=this.commentThreadsMap.size>1;this._resourceCommentThreads=[...this.commentThreadsMap.values()].map(t=>t.resourceWithCommentThreads.map(i=>(i.ownerLabel=e?t.ownerLabel:void 0,i)).flat()).flat(),this._resourceCommentThreads.sort((t,i)=>t.resource.toString()>i.resource.toString()?1:-1)}setCommentThreads(e,t,i,s){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,s)}),this.updateResourceCommentThreads()}deleteCommentsByOwner(e){if(e){const t=this.commentThreadsMap.get(e);this.commentThreadsMap.set(e,{ownerLabel:t?.ownerLabel,resourceWithCommentThreads:[]})}else this.commentThreadsMap.clear();this.updateResourceCommentThreads()}updateCommentThreads(e){const{uniqueOwner:t,owner:i,ownerLabel:s,removed:o,changed:r,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return o.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0,u=h?.commentThreads.findIndex(f=>f.threadId===l.threadId)??0;u>=0&&h?.commentThreads.splice(u,1),h?.commentThreads.length===0&&c.splice(d,1)}),r.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0;if(!h)return;const u=h.commentThreads.findIndex(f=>f.threadId===l.threadId);u>=0?h.commentThreads[u]=dm.createCommentNode(t,i,P.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(dm.createCommentNode(t,i,P.parse(h.id),l))}),a.forEach(l=>{const d=c.filter(h=>h.resource.toString()===l.resource);if(d.length){const h=d[0];l.comments&&l.comments.length&&h.commentThreads.push(dm.createCommentNode(t,i,h.resource,l))}else c.push(new dm(t,i,P.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:s,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(eYt,0,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const s=[],o=new Map;for(const r of yU(i,cue._compareURIs))o.set(r[0].resource,new dm(e,t,P.parse(r[0].resource),r));return o.forEach((r,a,c)=>{s.push(r)}),s}static _compareURIs(e,t){const i=e.resource.toString(),s=t.resource.toString();return is?1:0}}const MC="vs/workbench/contrib/comments/browser/commentsTreeViewer",Qd="workbench.panel.comments",tYt="Comments",KIe=Be(MC,0,"Comments"),pW=class pW{getHeight(e){return e instanceof Ly&&e.hasReply()?44:22}getTemplateId(e){return e instanceof dm?pW.RESOURCE_ID:e instanceof Ly?pW.COMMENT_ID:""}};pW.RESOURCE_ID="resource-with-comments",pW.COMMENT_ID="comment-node";let YIe=pW;class iYt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=he(e,we(".resource-container")),i=this.labels.create(t),s=he(t,we(".separator")),o=t.appendChild(we(".owner"));return{resourceLabel:i,owner:o,separator:s}}renderElement(e,t,i,s){i.resourceLabel.setFile(e.element.resource),i.separator.innerText="·",e.element.ownerLabel?(i.owner.innerText=e.element.ownerLabel,i.separator.style.display="inline"):(i.owner.innerText="",i.separator.style.display="none")}disposeTemplate(e){e.resourceLabel.dispose()}}let JIe=class{constructor(e){this.menuService=e}getResourceActions(e){const t=this.getActions(Te.CommentsViewThreadActions,e);return{menu:t.menu,actions:t.primary}}getResourceContextActions(e){return this.getActions(Te.CommentsViewThreadActions,e).secondary}setContextKeyService(e){this.contextKeyService=e}getActions(e,t){if(!this.contextKeyService)return{primary:[],secondary:[]};const i=[["commentController",t.owner],["resourceScheme",t.resource.scheme],["commentThread",t.contextValue],["canReply",t.thread.canReply]],s=this.contextKeyService.createOverlay(i),o=this.menuService.createMenu(e,s),c={primary:[],secondary:[],menu:o};return nXe(o,{shouldForwardArgs:!0},c,"inline"),o.dispose(),c}dispose(){this.contextKeyService=void 0}};JIe=D([_(0,_c)],JIe);let XIe=class{constructor(e,t,i,s,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=s,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=he(e,we(".comment-thread-container")),i=he(t,we(".comment-metadata-container")),s=he(i,we(".comment-metadata")),o={icon:he(s,we(".icon")),userNames:he(s,we(".user")),timestamp:new qIe(this.configurationService,this.hoverService,he(s,we(".timestamp-container"))),relevance:he(s,we(".relevance")),separator:he(s,we(".separator")),commentPreview:he(s,we(".text")),range:he(s,we(".range"))};o.separator.innerText="·";const r=he(i,we(".actions")),a=new Qh(r,{actionViewItemProvider:this.actionViewItemProvider}),c=he(t,we(".comment-snippet-container")),l={container:c,icon:he(c,we(".icon")),count:he(c,we(".count")),lastReplyDetail:he(c,we(".reply-detail")),separator:he(c,we(".separator")),timestamp:new qIe(this.configurationService,this.hoverService,he(c,we(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...$e.asClassNameArray(Ce.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(MC,1,"{0} replies",e-1):e===2?g(MC,2,"1 reply"):g(MC,3,"1 comment")}getRenderedComment(e,t){const i=mQ(e,{inline:!0,actionHandler:{callback:o=>vde(this.openerService,o,e.isTrusted),disposables:t}}),s=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...$e.asClassNameArray(this.getIcon(e.element.threadState))),e.element.threadState!==void 0){const l=this.getCommentThreadWidgetStateColor(e.element.threadState,this.themeService.getColorTheme());i.threadMetadata.icon.style.setProperty(h9e,`${l}`),i.threadMetadata.icon.style.color=`var(${h9e})`}i.threadMetadata.userNames.textContent=e.element.comment.userName,i.threadMetadata.timestamp.setTimestamp(e.element.comment.timestamp?new Date(e.element.comment.timestamp):void 0);const r=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof r.comment.body=="string")i.threadMetadata.commentPreview.innerText=r.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(r.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupUpdatableHover(va("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(MC,7,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(MC,8,"[Ln {0}-{1}]",e.element.range.startLineNumber,e.element.range.endLineNumber));const a=this.menus.getResourceActions(e.element);if(i.actionBar.push(a.actions,{icon:!0,label:!1}),i.actionBar.context={commentControlHandle:e.element.controllerHandle,commentThreadHandle:e.element.threadHandle,$mid:Fs.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(o);const c=e.element.replies[e.element.replies.length-1].comment;i.repliesMetadata.lastReplyDetail.textContent=g(MC,9,"Last reply from {0}",c.userName),i.repliesMetadata.timestamp.setTimestamp(c.timestamp?new Date(c.timestamp):void 0)}getCommentThreadWidgetStateColor(e,t){return e!==void 0?ZKt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};XIe=D([_(2,fr),_(3,Re),_(4,el),_(5,pn)],XIe);var Moe;(function(n){n[n.Resource=0]="Resource",n[n.Comment=1]="Comment"})(Moe||(Moe={}));class nYt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?so.Visible:e instanceof dm?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=gE._filter(this.options.textFilter.text,ui(e.resource));if(t)return{visibility:!0,data:{type:Moe.Resource,uriMatches:t||[]}}}return so.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&hg.Resolved===e.threadState||this.options.showUnresolved&&hg.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const s=gE._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||gE._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>gE._messageFilter(this.options.textFilter.text,o.comment.userName)||gE._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return s.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:Moe.Comment,textMatches:s}}:s.length&&this.options.textFilter.negate&&t===so.Recurse?!1:s.length===0&&this.options.textFilter.negate&&t===so.Recurse?!0:t}}let ZIe=class extends L7{constructor(e,t,i,s,o,r,a,c,l){const d=new YIe,h=yO.bind(void 0,r),u=r.createInstance(JIe);u.setContextKeyService(s);const f=[r.createInstance(iYt,e),r.createInstance(XIe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof cue?"root":p instanceof dm?`${p.uniqueOwner}-${p.id}`:p instanceof Ly?`${p.uniqueOwner}-${p.resource.toString()}-${p.threadId}-${p.comment.uniqueIdInThread}`+(p.isRoot?"-root":""):""},expandOnlyOnTwistieClick:!0,collapseByDefault:!1,overrideStyles:i.overrideStyles,filter:i.filter,findWidgetEnabled:!1,multipleSelectionSupport:!1},r,s,o,a),this.contextMenuService=c,this.keybindingService=l,this.menus=u,this.disposables.add(this.onContextMenu(p=>this.commentsOnContextMenu(p)))}commentsOnContextMenu(e){const t=e.element;if(!(t instanceof Ly))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const s=this.menus.getResourceContextActions(t);s.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>s,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new WS(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:Fs.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const s of i.children)s.visible&&i.visible&&e++;return e}};ZIe=D([_(3,Pe),_(4,yf),_(5,be),_(6,Re),_(7,Vr),_(8,ti)],ZIe);const MOe=new Y("commentsFilterFocus",!1),Ax="vs/workbench/contrib/comments/browser/commentsViewActions",vrt=new Y("commentsView.showResolvedFilter",!0),wrt=new Y("commentsView.showUnResolvedFilter",!0);class sYt extends ${constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=wrt.bindTo(this.contextKeyService),this._showResolved=vrt.bindTo(this.contextKeyService),this._showResolved.set(e.showResolved),this._showUnresolved.set(e.showUnresolved)}get showUnresolved(){return!!this._showUnresolved.get()}set showUnresolved(e){this._showUnresolved.get()!==e&&(this._showUnresolved.set(e),this._onDidChange.fire({showUnresolved:!0}))}get showResolved(){return!!this._showResolved.get()}set showResolved(e){this._showResolved.get()!==e&&(this._showResolved.set(e),this._onDidChange.fire({showResolved:!0}))}}At(class extends XQ{constructor(){super({id:"commentsFocusViewFromFilter",title:g(Ax,0,"Focus Comments view"),keybinding:{when:MOe,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.DownArrow},viewId:Qd})}async runInView(n,e){e.focus()}});At(class extends XQ{constructor(){super({id:"commentsClearFilterText",title:g(Ax,1,"Clear filter text"),keybinding:{when:MOe,weight:ye.WorkbenchContrib,primary:E.Escape},viewId:Qd})}async runInView(n,e){e.clearFilterText()}});At(class extends XQ{constructor(){super({id:"commentsFocusFilter",title:g(Ax,2,"Focus comments filter"),keybinding:{when:Tz.isEqualTo(Qd),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyF},viewId:Qd})}async runInView(n,e){e.focusFilter()}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleUnResolvedComments`,title:g(Ax,3,"Show Unresolved"),category:g(Ax,4,"Comments"),toggled:{condition:wrt,title:g(Ax,5,"Show Unresolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleResolvedComments`,title:g(Ax,6,"Show Resolved"),category:g(Ax,4,"Comments"),toggled:{condition:vrt,title:g(Ax,7,"Show Resolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showResolved=!e.filters.showResolved}});var oYt=".review-widget{position:absolute;width:100%}.monaco-editor .review-widget{background-color:var(--vscode-peekViewResult-background)}.review-widget .hidden{display:none!important}.review-widget .body{overflow:hidden}.review-widget .body .review-comment{display:flex;padding:8px 16px 8px 20px}@keyframes monaco-review-widget-focus{0%{background:var(--vscode-peekViewResult-selectionBackground)}to{background:transparent}}.review-widget .body .review-comment.focus{animation:monaco-review-widget-focus 3s ease 0s}.review-widget .body .review-comment .comment-actions{margin-left:auto}.review-widget .body .review-comment .comment-actions .monaco-toolbar{height:22px}.review-widget .body .review-comment .comment-title .comment-header-info{overflow:hidden;text-overflow:ellipsis}.review-widget .body .review-comment .comment-title{display:flex;width:100%}.review-widget .body .review-comment .comment-title .action-label.codicon{line-height:18px}.review-widget .body .review-comment .comment-title .monaco-dropdown .toolbar-toggle-more{height:18px;line-height:18px;vertical-align:middle;width:16px}.review-widget .body .comment-body blockquote{border-left-style:solid;border-left-width:5px;margin:0 7px 0 5px;padding:0 16px 0 10px}.review-widget .body .review-comment .avatar-container{margin-top:4px!important}.review-widget .body .review-comment .avatar-container img.avatar{border-radius:3px;border-style:none;display:inline-block;height:28px;line-height:1;overflow:hidden;vertical-align:middle;width:28px}.review-widget .body .comment-reactions .monaco-text-button{background-color:transparent;border:1px solid grey;border-radius:3px;margin:0 7px 0 0;width:30px}.review-widget .body .review-comment .review-comment-contents{overflow:hidden;padding-left:20px;user-select:text;-webkit-user-select:text;width:100%}.review-widget .body pre{word-wrap:normal;overflow:auto;white-space:pre}.review-widget .body .review-comment .review-comment-contents .author{line-height:22px}.review-widget .body .review-comment .review-comment-contents .isPending{font-style:italic;line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .timestamp{line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .comment-body .comment-body-plainstring{white-space:pre-wrap}.review-widget .body .review-comment .review-comment-contents .comment-body{padding-top:4px}.review-widget .body .review-comment .review-comment-contents .comment-body-max-height{max-height:20em}.review-widget .body .review-comment .review-comment-contents .comment-reactions{margin-top:8px;min-height:25px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label{display:flex;font-size:12px;padding:1px 4px;text-align:center;white-space:pre}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-icon{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:14px;display:inline-block;margin-right:4px;width:14px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-label{line-height:20px;margin-right:4px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions{background-position:50%;background-repeat:no-repeat;background-size:16px;border:none;display:none;font-size:16px;height:16px;margin-top:3px;width:26px}.review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions{background-size:16px;display:inline-block}.review-widget .body .review-comment .comment-title .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block;height:16px;line-height:16px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label{border:1px solid}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.disabled{opacity:.6}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.active:hover{background-color:var(--vscode-statusBarItem-hoverBackground)}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active{background-color:var(--vscode-statusBarItem-activeBackground);border:1px solid transparent}.review-widget .body .review-comment .review-comment-contents a{cursor:pointer}.review-widget .body .comment-body p,.review-widget .body .comment-body ul{margin:8px 0}.review-widget .body .comment-body p:first-child,.review-widget .body .comment-body ul:first-child{margin-top:0}.review-widget .body .comment-body p:last-child,.review-widget .body.comment-body ul:last-child{margin-bottom:0}.review-widget .body .comment-body ul{padding-left:20px}.review-widget .body .comment-body li>p{margin-bottom:0}.review-widget .body .comment-body li>ul{margin-top:0}.review-widget .body .comment-body code{border-radius:3px;padding:0 .4em}.review-widget .body .comment-body span{white-space:pre}.review-widget .body .comment-body img{max-width:100%}.review-widget .body .comment-form{margin:8px 20px}.review-widget .validation-error{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-left:-1px;margin-top:-1px;min-height:34px;overflow:hidden;padding:.4em;text-align:left;width:100%}.review-widget .body .comment-additional-actions{margin:10px 20px}.review-widget .body .comment-additional-actions .section-separator{border-top:1px solid var(--vscode-menu-separatorBackground);margin:10px 0 14px}.review-widget .body .comment-additional-actions .button-bar{display:flex;white-space:nowrap}.review-widget .body .comment-additional-actions .monaco-button,.review-widget .body .comment-additional-actions .monaco-button-dropdown,.review-widget .body .comment-additional-actions .monaco-text-button{display:flex;width:auto}.review-widget .body .comment-additional-actions .button-bar>.monaco-button-dropdown,.review-widget .body .comment-additional-actions .button-bar>.monaco-text-button{margin:0 10px 0 0}.review-widget .body .comment-additional-actions .button-bar .monaco-text-button{padding:4px 10px}.review-widget .body .comment-additional-actions .codicon-drop-down-button{align-items:center}.review-widget .body .monaco-editor{color:var(--vscode-editor-foreground)}.review-widget .body .comment-form.expand .review-thread-reply-button{display:none}.review-widget .body .comment-form.expand .form-actions,.review-widget .body .comment-form.expand .monaco-editor{box-sizing:content-box;display:block}.review-widget .body .comment-form .review-thread-reply-button{background-color:var(--vscode-editorCommentsWidget-replyInputBackground);border:0;border-radius:0;box-sizing:border-box;color:var(--vscode-editor-foreground);display:block;font-family:var(--monaco-monospace-font);font-size:inherit;font-weight:600;line-height:20px;outline:1px solid transparent;padding:6px 12px;resize:vertical;text-align:left;white-space:nowrap;width:100%}.review-widget .body .comment-form .review-thread-reply-button:focus{outline-style:solid;outline-width:1px}.review-widget .body .comment-form .monaco-editor,.review-widget .body .comment-form .monaco-editor .monaco-editor-background,.review-widget .body .edit-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-editorCommentsWidget-replyInputBackground)}.review-widget .body .comment-form .monaco-editor,.review-widget .body .edit-container .monaco-editor{border:0;border-radius:3px;box-sizing:content-box;max-height:500px;min-height:90px;padding:6px 0 6px 12px;width:100%}.review-widget .body .comment-form .form-actions,.review-widget .body .comment-form .monaco-editor{display:none}.review-widget .body .comment-form .form-actions,.review-widget .body .edit-container .form-actions{margin:10px 0;overflow:auto}.review-widget .body .edit-container .form-actions{padding-top:10px}.review-widget .body .edit-textarea{margin:5px 12px 10px 0}.review-widget .body .comment-form .form-actions .monaco-text-button,.review-widget .body .edit-container .monaco-text-button{margin-left:5px;padding:4px 10px;width:auto}.review-widget .body .form-actions .monaco-text-button{float:right}.review-widget .head{box-sizing:border-box;display:flex;height:100%}.review-widget .head .review-title{cursor:default;display:inline-block;font-size:13px;margin-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-widget .head .review-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.review-widget .head .review-actions{flex:1;padding-right:2px;text-align:right}.review-widget .head .review-actions>.monaco-action-bar{display:inline-block}.review-widget .head .review-actions>.monaco-action-bar,.review-widget .head .review-actions>.monaco-action-bar>.actions-container{height:100%}.review-widget .action-item{margin-left:4px;min-height:20px;min-width:18px}.review-widget .head .review-actions>.monaco-action-bar .action-label{background-position:50%;background-repeat:no-repeat;line-height:inherit;margin:0}.review-widget .head .review-actions>.monaco-action-bar .action-label.codicon{margin:0}.review-widget>.body{border-top:1px solid;position:relative}.monaco-editor .comment-range-glyph{cursor:pointer;margin-left:10px;width:4px!important;z-index:10}div.preview.inline .monaco-editor .comment-range-glyph{display:none!important}.monaco-editor .comment-diff-added{border-left-style:solid;border-left-width:3px}.monaco-editor .comment-diff-added,.monaco-editor .comment-range-glyph.multiline-add{border-left-color:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-diff-added:before,.monaco-editor .comment-range-glyph.line-hover:before,.monaco-editor .comment-thread-unresolved:before,.monaco-editor .comment-thread:before{background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-thread-range{background-color:var(--vscode-editorCommentsWidget-rangeBackground)}.monaco-editor .comment-thread-range-current{background-color:var(--vscode-editorCommentsWidget-rangeActiveBackground)}.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread,.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread-unresolved,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover{margin-left:13px}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{align-items:center;color:var(--vscode-editorGutter-commentGlyphForeground);display:flex;flex-direction:row;height:100%;justify-content:center;left:-6px;position:absolute;text-align:center;width:9px;z-index:10}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{color:var(--vscode-editorGutter-commentUnresolvedGlyphForeground)}.monaco-editor .margin-view-overlays .comment-range-glyph.multiline-add{border-left-style:dotted;border-left-width:3px;height:16px;margin-top:2px}.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{border-radius:3px;content:var(--vscode-icon-plus-content);font-family:var(--vscode-icon-plus-font-family);font-family:codicon;margin-left:-5px;padding-left:1px;width:18px!important}.monaco-editor .comment-range-glyph.comment-thread,.monaco-editor .comment-range-glyph.comment-thread-unresolved{z-index:20}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before{border-radius:3px;font-family:codicon;font-size:13px;line-height:100%;margin-left:-5px;padding-left:1px;padding-top:1px;width:18px!important;z-index:20}.monaco-editor .comment-range-glyph.comment-thread:before{content:var(--vscode-icon-comment-add-content);font-family:var(--vscode-icon-comment-add-font-family)}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{content:var(--vscode-icon-comment-unresolved-content);font-family:var(--vscode-icon-comment-unresolved-font-family)}.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-collapsed,.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded{margin-left:11px}.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph{margin-left:25px}";Ct(oYt,{});const nj="vs/workbench/contrib/comments/browser/commentGlyphWidget",cY=B("editorGutter.commentRangeForeground",{dark:sWe(owe,us),light:Em(sWe(owe,us),.05),hcDark:fe.white,hcLight:fe.black},g(nj,0,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),G3=B("editorOverviewRuler.commentForeground",{dark:cY,light:cY,hcDark:cY,hcLight:cY},g(nj,1,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),rYt=B("editorOverviewRuler.commentUnresolvedForeground",{dark:G3,light:G3,hcDark:G3,hcLight:G3},g(nj,2,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),lY=B("editorGutter.commentGlyphForeground",{dark:Nc,light:Nc,hcDark:fe.black,hcLight:fe.white},g(nj,3,"Editor gutter decoration color for commenting glyphs."));B("editorGutter.commentUnresolvedGlyphForeground",{dark:lY,light:lY,hcDark:lY,hcLight:lY},g(nj,4,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const cle=class cle{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===hg.Unresolved,t={description:cle.description,isWholeLine:!0,overviewRuler:{color:Nr(e?rYt:G3),position:oh.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return Kt.createDynamic(t)}setThreadState(e){this._threadState!==e&&(this._threadState=e,this._commentsOptions=this.createDecorationOptions(),this._updateDecorations())}_updateDecorations(){const e=[{range:{startLineNumber:this._lineNumber,startColumn:1,endLineNumber:this._lineNumber,endColumn:1},options:this._commentsOptions}];this._commentsDecorations.set(e)}setLineNumber(e){this._lineNumber=e,this._updateDecorations()}getPosition(){const e=this._commentsDecorations.length>0?this._commentsDecorations.getRange(0):null;return{position:{lineNumber:e?e.endLineNumber:this._lineNumber,column:1},preference:[hs.EXACT]}}dispose(){this._commentsDecorations.clear()}};cle.description="comment-glyph-widget";let FG=cle;class OG{constructor(e,t,i,s,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=s,this.maxActions=o,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(o=>o.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let s=!t;for(const o of i){const[,r]=o;this._actions=r;for(const a of r){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&s&&(c=this.keybindingService.lookupKeybinding($A.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Tu(this.container,{secondary:!s,title:l,...yQ});if(s=!1,this._buttonElements.push(d.element),this._toDispose.add(d),this._toDispose.add(d.onDidClick(()=>this.actionHandler(a))),d.enabled=a.enabled,d.label=a.label,this.maxActions!==void 0&&this._buttonElements.length>=this.maxActions){console.warn("An extension has contributed more than the allowable number of actions to a comments menu.");return}}}}triggerDefaultAction(){if(this._actions.length){const e=this._actions[0];if(e.enabled)return this.actionHandler(e)}}dispose(){this._toDispose.dispose()}}const dY="vs/workbench/contrib/comments/browser/commentReply";let aYt=0;const brt="commenteditordecoration";let e0e=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=s,this._scopedInstatiationService=o,this._contextKeyService=r,this._commentMenus=a,this._commentOptions=c,this._pendingComment=l,this._parentThread=d,this._actionRunDelegate=u,this.commentService=f,this.themeService=p,this.keybindingService=v,this.hoverService=w,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=J$,this.form=he(t,we(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(EV,this.form,EV.getEditorOptions(m),r,this._parentThread)),this.commentEditorIsEmpty=Qv.commentIsEmpty.bindTo(this._contextKeyService),this.commentEditorIsEmpty.set(!this._pendingComment),this.initialize(h)}async initialize(e){const t=this._commentThread.comments&&this._commentThread.comments.length>0,i=Dr()+"-"+(t?this._commentThread.threadId:++aYt),s=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=P.from({scheme:_e.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${s}`});const r=this.commentService.getCommentController(this.owner);r&&(o=o.with({authority:r.id}));const a=await this.textModelService.createModelReference(o);a.object.textEditorModel.setValue(this._pendingComment||""),this._register(a),this.commentEditor.setModel(a.object.textEditorModel),this.calculateEditorHeight(),this._register(a.object.textEditorModel.onDidChangeContent(()=>{this.setCommentEditorDecorations(),this.commentEditorIsEmpty?.set(!this.commentEditor.getValue()),this.calculateEditorHeight()&&(this.commentEditor.layout({height:this._editorHeight,width:this.commentEditor.getLayoutInfo().width}),this.commentEditor.render(!0))})),this.createTextModelListener(this.commentEditor,this.form),this.setCommentEditorDecorations(),this._pendingComment?this.expandReplyArea():t?this.createReplyButton(this.commentEditor,this.form):e&&this._commentThread.comments&&this._commentThread.comments.length===0&&this.expandReplyArea(),this._error=he(this.form,we(".validation-error.hidden"));const c=he(this.form,we(".form-actions"));this._formActions=he(c,we(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=he(c,we(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=oit(this._parentEditor,this.commentEditor,this._editorHeight);return e!==this._editorHeight?(this._editorHeight=e,!0):!1}updateCommentThread(e){const t=this.commentEditor.hasTextFocus(),i=!this._commentThread.comments?.length&&!e.comments?.length;this._reviewThreadReplyButton||this.createReplyButton(this.commentEditor,this.form),this._commentThread.comments&&this._commentThread.comments.length===0&&!i&&this.expandReplyArea(),t&&this.commentEditor.focus()}getPendingComment(){const e=this.commentEditor.getModel();if(e&&e.getValueLength()>0)return e.getValue()}setPendingComment(e){this._pendingComment=e,this.expandReplyArea(),this.commentEditor.setValue(e)}layout(e){this.commentEditor.layout({height:this._editorHeight,width:e-54})}focusIfNeeded(){!this._commentThread.comments||!this._commentThread.comments.length?this.commentEditor.focus():(this.commentEditor.getModel()?.getValueLength()??0)>0&&this.expandReplyArea()}focusCommentEditor(){this.commentEditor.focus()}expandReplyAreaAndFocusCommentEditor(){this.expandReplyArea(),this.commentEditor.focus()}isCommentEditorFocused(){return this.commentEditor.hasWidgetFocus()}updateCanReply(){this._commentThread.canReply?this.form.style.display="block":this.form.style.display="none"}async submitComment(){await this._commentFormActions?.triggerDefaultAction(),this._pendingComment=void 0}setCommentEditorDecorations(){const e=this.commentEditor.getModel();if(e){const t=e.getValueLength(),i=this._commentThread.comments&&this._commentThread.comments.length>0,s=t>0?"":i?this._commentOptions?.placeHolder||g(dY,0,"Reply..."):this._commentOptions?.placeHolder||g(dY,1,"Type a new comment"),o=[{range:{startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:1},renderOptions:{after:{contentText:s,color:`${iv(Nc,this.themeService.getColorTheme())?.transparent(.4)}`}}}];this.commentEditor.setDecorationsByType("review-zone-widget",brt,o)}}createTextModelListener(e,t){this._commentThreadDisposables.push(e.onDidFocusEditorWidget(()=>{this._commentThread.input={uri:e.getModel().uri,value:e.getValue()},this.commentService.setActiveEditingCommentThread(this._commentThread),this.commentService.setActiveCommentAndThread(this.owner,{thread:this._commentThread})})),this._commentThreadDisposables.push(e.getModel().onDidChangeContent(()=>{const i=e.getValue();if(this._commentThread.input&&this._commentThread.input.uri===e.getModel().uri&&this._commentThread.input.value!==i){const s=this._commentThread.input;s.value=i,this._commentThread.input=s}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const s=this._commentThread,o=e.getModel();s.input&&o&&s.input.uri!==o.uri||i&&e.getValue()!==i.value&&(e.setValue(i.value),i.value===""&&(this._pendingComment="",t.classList.remove("expand"),e.getDomNode().style.outline="",this._error.textContent="",this._error.classList.add("hidden")))}))}createCommentWidgetFormActions(e,t){const i=this._commentMenus.getCommentThreadActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{await this._actionRunDelegate?.(),await s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.hideReplyArea()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e,t){const i=this._commentMenus.getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{this._actionRunDelegate?.(),s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.focusCommentEditor()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}get isReplyExpanded(){return this.form.classList.contains("expand")}expandReplyArea(){this.isReplyExpanded||(this.form.classList.add("expand"),this.commentEditor.focus(),this.commentEditor.layout())}clearAndExpandReplyArea(){this.isReplyExpanded||(this.commentEditor.setValue(""),this.expandReplyArea())}hideReplyArea(){const e=this.commentEditor.getDomNode();e&&(e.style.outline=""),this.commentEditor.setValue(""),this._pendingComment="",this.form.classList.remove("expand"),this._error.textContent="",this._error.classList.add("hidden")}createReplyButton(e,t){this._reviewThreadReplyButton=he(t,we(`button.review-thread-reply-button.${lx}`)),this._register(this.hoverService.setupUpdatableHover(va("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(dY,0,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(dY,0,"Reply..."),this._register(pe(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(pe(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),St(this._commentThreadDisposables)}};e0e=D([_(12,sD),_(13,pn),_(14,Re),_(15,ti),_(16,el),_(17,Rn)],e0e);const hT="vs/workbench/contrib/comments/browser/reactionsAction",lle=class lle extends xn{constructor(e,t){super(lle.ID,t||g(hT,0,"Pick Reactions..."),"toggle-reactions",!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return this.toggleDropdownMenu(),Promise.resolve(!0)}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};lle.ID="toolbar.toggle.pickReactions";let WT=lle;class cYt extends WS{constructor(e){super(null,e,{})}updateLabel(){if(!this.label)return;const e=this.action;if(e.class&&this.label.classList.add(e.class),e.icon){const t=he(this.label,we(".reaction-icon")),i=P.revive(e.icon);t.style.backgroundImage=uf(i)}else{const t=he(this.label,we("span.reaction-label"));t.innerText=e.label}if(e.count){const t=he(this.label,we("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(hT,1,"Toggle reaction, "):"";if(e.count===void 0)return g(hT,2,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(hT,3,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(hT,4,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(hT,5,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(hT,6,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const dle=class dle extends xn{constructor(e,t="",i="",s=!0,o,r,a,c){super(dle.ID,t,i,s,o),this.reactors=r,this.icon=a,this.count=c}};dle.ID="toolbar.toggle.reaction";let t0e=dle;const eme="vs/workbench/contrib/comments/browser/commentNode";class u9e extends gw{async runAction(e,t){await e.run(...t)}}let i0e=class extends ${get domNode(){return this._domNode}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=s,this.owner=o,this.resource=r,this.parentThread=a,this.markdownRenderer=c,this.instantiationService=l,this.commentService=d,this.notificationService=h,this.contextMenuService=u,this.configurationService=p,this.hoverService=m,this.accessibilityService=v,this.keybindingService=w,this.textModelService=b,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=J$,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=we("div.review-comment"),this._contextKeyService=f.createScoped(this._domNode),this._commentContextValue=Qv.commentContext.bindTo(this._contextKeyService),this.comment.contextValue&&this._commentContextValue.set(this.comment.contextValue),this._commentMenus=this.commentService.getCommentMenus(this.owner),this._domNode.tabIndex=-1,this._avatar=he(this._domNode,we("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=he(this._domNode,we(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",lx),p.getValue(aue)?.maxHeight!==!1&&this._body.classList.add("comment-body-max-height"),this.createScroll(this._commentDetailsContainer,this._body),this.updateCommentBody(this.comment.body),this.comment.commentReactions&&this.comment.commentReactions.length&&this.comment.commentReactions.filter(C=>!!C.count).length&&this.createReactionsContainer(this._commentDetailsContainer),this._domNode.setAttribute("aria-label",`${i.userName}, ${this.commentBodyValue}`),this._domNode.setAttribute("role","treeitem"),this._clearTimeout=null,this._register(pe(this._domNode,xe.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(pe(this._domNode,xe.CONTEXT_MENU,C=>this.onContextMenu(C))),s&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(pe(this._domNode,xe.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)}),this._scrollableElement=this._register(new hQ(t,{horizontal:zo.Visible,vertical:zo.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(s=>{s.scrollLeftChanged&&(t.scrollLeft=s.scrollLeft),s.scrollTopChanged&&(t.scrollTop=s.scrollTop)}));const i=this._register(new oi(t,"scroll")).event;this._register(i(s=>{const o=this._scrollableElement.getScrollPosition(),r=Math.abs(t.scrollLeft-o.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-o.scrollTop)<=1?void 0:t.scrollTop;(r!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),e.appendChild(this._scrollableElement.getDomNode())}updateCommentBody(e){this._body.innerText="",this._md=void 0,this._plainText=void 0,typeof e=="string"?(this._plainText=he(this._body,we(".comment-body-plainstring")),this._plainText.innerText=e):(this._md=this.markdownRenderer.render(e).element,this._body.appendChild(this._md))}updateCommentUserIcon(e){if(this._avatar.textContent="",e){const t=he(this._avatar,we("img.avatar"));t.src=lp.uriToBrowserUri(P.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=he(e,we("span.timestamp-container")),this.updateTimestamp(this.comment.timestamp)}updateTimestamp(e){if(!this._timestamp)return;const t=e!==void 0?new Date(e):void 0;t?this._timestampWidget?this._timestampWidget.setTimestamp(t):(this._timestampWidget=new qIe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=he(e,we(`div.comment-title.${lx}`)),i=he(t,we("comment-header-info")),s=he(i,we("strong.author"));s.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=he(i,we("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=he(t,we(".comment-actions")),this.toggleToolbarHidden(!0),this.createActionsToolbar()}toggleToolbarHidden(e){e&&!this.accessibilityService.isScreenReaderOptimized()?this._actionsToolbarContainer.classList.add("hidden"):this._actionsToolbarContainer.classList.remove("hidden")}getToolbarActions(e){const t=e.getActions({shouldForwardArgs:!0}),o={primary:[],secondary:[]};return lYt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:Fs.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:Fs.CommentThread}]}createToolbar(){this.toolbar=new cZe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===WT.ID?new gx(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,s)=>this.actionViewItemProvider(i,s),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(e,t),orientation:Qb.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new u9e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const r=this.createReactionPicker(this.comment.commentReactions||[]);e.push(r)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(r=>{const{primary:a,secondary:c}=this.getToolbarActions(i);!this.toolbar&&(a.length||c.length)&&this.createToolbar(),this.toolbar.setActions(a,c)}));const{primary:s,secondary:o}=this.getToolbarActions(i);e.push(...s),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===WT.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===t0e.ID?new cYt(e):e instanceof id?this.instantiationService.createInstance(eC,e,{hoverDelegate:t.hoverDelegate}):e instanceof uS?this.instantiationService.createInstance(b7,e,t):new WS({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new WT(()=>{s?.show()},g(eme,0,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new xn(`reaction.command.${o.label}`,`${o.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,o)}catch(r){const a=r.message?g(eme,1,"Toggling the comment reaction failed: {0}.",r.message):g(eme,2,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const s=new gx(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===WT.ID?s:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>Ob.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=he(e,we("div.comment-reactions")),this._reactionsActionBar=new Qh(this._reactionActionsContainer,{actionViewItemProvider:(i,s)=>i.id===WT.ID?new gx(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(i,s)}),this._register(this._reactionsActionBar),this.commentService.hasReactionHandler(this.owner)){const i=this.createReactionPicker(this.comment.commentReactions||[]);this._reactionsActionBar.push(i,{label:!1,icon:!0})}}get commentBodyValue(){return typeof this.comment.body=="string"?this.comment.body:this.comment.body.value}async createCommentEditor(e){const t=he(e,we(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(EV,t,EV.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=P.from({scheme:_e.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),s=await this.textModelService.createModelReference(i);this._commentEditorModel=s,this._commentEditor.setModel(this._commentEditorModel.object.textEditorModel),this._commentEditor.setValue(this.pendingEdit??this.commentBodyValue),this.pendingEdit=void 0,this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus(),xd(gt(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const o=this._commentEditorModel.object.textEditorModel.getLineCount(),r=this._commentEditorModel.object.textEditorModel.getLineLength(o)+1;this._commentEditor.setSelection(new mt(o,r,o,r));const a=this.commentThread;a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment}),this._commentEditorDisposables.push(this._commentEditor.onDidFocusEditorWidget(()=>{a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})})),this._commentEditorDisposables.push(this._commentEditor.onDidChangeModelContent(c=>{if(a.input&&this._commentEditor&&this._commentEditor.getModel().uri===a.input.uri){const l=this._commentEditor.getValue();if(l!==a.input.value){const d=a.input;d.value=l,a.input=d,this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})}}})),this.calculateEditorHeight(),this._register(this._commentEditorModel.object.textEditorModel.onDidChangeContent(()=>{this._commentEditor&&this.calculateEditorHeight()&&(this._commentEditor.layout({height:this._editorHeight,width:this._commentEditor.getLayoutInfo().width}),this._commentEditor.render(!0))})),this._register(this._commentEditor),this._register(this._commentEditorModel)}calculateEditorHeight(){if(this._commentEditor){const e=oit(this.parentEditor,this._commentEditor,this._editorHeight);if(e!==this._editorHeight)return this._editorHeight=e,!0}return!1}getPendingEdit(){const e=this._commentEditor?.getModel();if(e&&e.getValueLength()>0)return e.getValue()}removeCommentEditor(){this.isEditing=!1,this._editAction&&(this._editAction.enabled=!0),this._body.classList.remove("hidden"),this._commentEditorModel?.dispose(),St(this._commentEditorDisposables),this._commentEditorDisposables=[],this._commentEditor?.dispose(),this._commentEditor=null,this._commentEditContainer.remove()}layout(e){const t=e!==void 0?e-72:this._commentEditor?.getLayoutInfo().width??0;this._commentEditor?.layout({width:t,height:this._editorHeight});const i=this._body.scrollWidth,s=h$(this._body),o=this._body.scrollHeight,r=cMe(this._body)+4;this._scrollableElement.setScrollDimensions({width:s,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=he(this._commentDetailsContainer,we(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=he(this._commentEditContainer,we(".form-actions")),t=he(e,we(".other-actions"));this.createCommentWidgetFormActions(t);const i=he(e,we(".editor-actions"));this.createCommentWidgetEditorActions(i)}createCommentWidgetFormActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions?.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this.removeCommentEditor()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions?.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this._commentEditor?.focus()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}setFocus(e,t=!1){e?(this._domNode.focus(),this.toggleToolbarHidden(!1),this._actionsToolbarContainer.classList.add("tabfocused"),this._domNode.tabIndex=0,this.comment.mode===RU.Editing&&this._commentEditor?.focus()):(this._actionsToolbarContainer.classList.contains("tabfocused")&&!this._actionsToolbarContainer.classList.contains("mouseover")&&(this.toggleToolbarHidden(!0),this._domNode.tabIndex=-1),this._actionsToolbarContainer.classList.remove("tabfocused"))}registerActionBarListeners(e){this._register(pe(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(pe(this._domNode,"mouseleave",()=>{e.classList.contains("mouseover")&&!e.classList.contains("tabfocused")&&this.toggleToolbarHidden(!0),e.classList.remove("mouseover")}))}async update(e){e.body!==this.comment.body&&this.updateCommentBody(e.body),this.comment.userIconPath&&e.userIconPath&&P.from(this.comment.userIconPath).toString()!==P.from(e.userIconPath).toString()&&this.updateCommentUserIcon(e.userIconPath);const t=e.mode!==void 0&&e.mode!==this.comment.mode;this.comment=e,t&&(e.mode===RU.Editing?await this.switchToEditMode():this.removeCommentEditor()),e.label?this._isPendingLabel.innerText=e.label:this._isPendingLabel.innerText="",this._reactionActionsContainer?.remove(),this._reactionsActionBar?.clear(),this.comment.commentReactions&&this.comment.commentReactions.some(i=>!!i.count)&&this.createReactionsContainer(this._commentDetailsContainer),this.comment.contextValue?this._commentContextValue.set(this.comment.contextValue):this._commentContextValue.reset(),this.comment.timestamp&&this.updateTimestamp(this.comment.timestamp)}onContextMenu(e){const t=new yu(gt(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:Te.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new u9e,getActionsContext:()=>this.commentNodeContext})}focus(){this.domNode.focus(),this._clearTimeout||(this.domNode.classList.add("focus"),this._clearTimeout=setTimeout(()=>{this.domNode.classList.remove("focus")},3e3))}dispose(){super.dispose(),St(this._commentEditorDisposables)}};i0e=D([_(8,be),_(9,sD),_(10,Pi),_(11,Vr),_(12,Pe),_(13,Re),_(14,el),_(15,Ur),_(16,ti),_(17,Rn)],i0e);function lYt(n,e,t,i=s=>s==="navigation"){for(const s of n){let[o,r]=s;if(i(o))(Array.isArray(e)?e:e.primary).unshift(...r);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Kr),a.push(...r)}}}const tme="vs/workbench/contrib/comments/browser/commentThreadBody";let n0e=class extends ${get length(){return this._commentThread.comments?this._commentThread.comments.length:0}get activeComment(){return this._commentElements.filter(e=>e.isEditing)[0]}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=s,this._options=o,this._commentThread=r,this._pendingEdits=a,this._scopedInstatiationService=c,this._parentCommentThreadWidget=l,this.commentService=d,this.openerService=h,this.languageService=u,this._commentElements=[],this._focusedComment=void 0,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._commentDisposable=new Map,this._register(pe(s,xe.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new vw(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}async display(){if(this._commentsElement=he(this.container,we("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(pe(this._commentsElement,xe.KEY_DOWN,e=>{const t=new os(e);if((t.equals(E.UpArrow)||t.equals(E.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=s=>{if(this._focusedComment===void 0&&s>=0)return 0;if(this._focusedComment===void 0&&s<0)return this._commentElements.length-1;const o=this._focusedComment+s;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(E.UpArrow)?i(-1):i(1))}})),this._commentElements=[],this._commentThread.comments)for(const e of this._commentThread.comments){const t=this.createNewCommentNode(e);this._commentElements.push(t),this._commentsElement.appendChild(t.domNode),e.mode===RU.Editing&&await t.switchToEditMode()}this._resizeObserver=new MutationObserver(this._refresh.bind(this)),this._resizeObserver.observe(this.container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}_refresh(){const e=uw(this.container);this._onDidResize.fire(e)}getDimensions(){return uw(this.container)}layout(e){this._commentElements.forEach(t=>{t.layout(e)})}getPendingEdits(){const e={};return this._commentElements.forEach(t=>{if(t.isEditing){const i=t.getPendingEdit();i&&(e[t.comment.uniqueIdInThread]=i)}}),e}getCommentCoords(e){const t=this._commentElements.filter(i=>i.comment.uniqueIdInThread===e);if(t&&t.length){const i=ia(this._commentElements[0].domNode),s=ia(t[0].domNode);return{thread:i,comment:s}}}async updateCommentThread(e,t){const i=this._commentElements.length,s=e.comments?e.comments.length:0,o=[],r=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(r.push(d),o.push(this._commentElements[d]))}for(let d=o.length-1;d>=0;d--){const h=o[d];this._commentDisposable.get(h)?.dispose(),this._commentDisposable.delete(h),this._commentElements.splice(r[d],1),this._commentsElement.removeChild(h.domNode)}let a=null;const c=[],l=[];for(let d=s-1;d>=0;d--){const h=e.comments[d],u=this._commentElements.filter(f=>f.comment.uniqueIdInThread===h.uniqueIdInThread);if(u.length)a=u[0].domNode,c.unshift(u[0]);else{const f=this.createNewCommentNode(h);c.unshift(f),a?(this._commentsElement.insertBefore(f.domNode,a),a=f.domNode):(this._commentsElement.appendChild(f.domNode),a=f.domNode),h.mode===RU.Editing&&(await f.switchToEditMode(),l.push(f))}}if(this._commentThread=e,this._commentElements=c,l.length){const d=this._commentElements.indexOf(l[l.length-1]);this._focusedComment=d}this._updateAriaLabel(),t||this._setFocusedComment(this._focusedComment)}_updateAriaLabel(){this._commentThread.isDocumentCommentThread()?this._commentThread.range?this._commentsElement.ariaLabel=g(tme,0,"Comment thread with {0} comments on lines {1} through {2}. {3}.",this._commentThread.comments?.length,this._commentThread.range.startLineNumber,this._commentThread.range.endLineNumber,this._commentThread.label):this._commentsElement.ariaLabel=g(tme,1,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(tme,2,"Comment thread with {0} comments. {1}.",this._commentThread.comments?.length,this._commentThread.label)}_setFocusedComment(e){this._focusedComment!==void 0&&this._commentElements[this._focusedComment]?.setFocus(!1),this._commentElements.length===0||e===void 0?this._focusedComment=void 0:(this._focusedComment=Math.min(e,this._commentElements.length-1),this._commentElements[this._focusedComment].setFocus(!0))}createNewCommentNode(e){const t=this._scopedInstatiationService.createInstance(i0e,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer);return this._register(t),this._commentDisposable.set(t,t.onDidClick(i=>this._setFocusedComment(this._commentElements.findIndex(s=>s.comment.uniqueIdInThread===i.comment.uniqueIdInThread)))),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.forEach(e=>e.dispose())}};n0e=D([_(9,sD),_(10,fr),_(11,Di)],n0e);const s0e="vs/workbench/contrib/comments/browser/commentThreadHeader",dYt=Ki("review-comment-collapse",Ce.chevronUp,g(s0e,0,"Icon to collapse a review comment.")),hYt="expand-review-action "+$e.asClassName(dYt);class uYt extends ${constructor(e,t,i,s,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=s,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=we(".head"),e.appendChild(this._headElement),this._fillHead()}_fillHead(){const e=he(this._headElement,we(".review-title"));this._headingLabel=he(e,we("span.filename")),this.createThreadLabel();const t=he(this._headElement,we(".review-actions"));this._actionbarWidget=new Qh(t,{actionViewItemProvider:yO.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new xn("review.expand",g(s0e,1,"Collapse"),hYt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(s=>{this.setActionBarActions(i)})),this._register(pe(this._headElement,xe.CONTEXT_MENU,s=>this.onContextMenu(s))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,s])=>[...i,...s],[]);this._actionbarWidget.clear(),this._actionbarWidget.push([...t,this._collapseAction],{label:!1,icon:!0})}updateCommentThread(e){this._commentThread=e,this._actionbarWidget.context=this._commentThread,this.createThreadLabel()}createThreadLabel(){let e;e=this._commentThread.label,e===void 0&&(this._commentThread.comments&&this._commentThread.comments.length||(e=g(s0e,2,"Start discussion"))),e&&(this._headingLabel.textContent=rM(e),this._headingLabel.setAttribute("aria-label",e))}updateHeight(e){this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height}onContextMenu(e){const t=this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({shouldForwardArgs:!0}).map(s=>s[1]).flat();if(!t.length)return;const i=new yu(gt(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new gw,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:Fs.CommentThread})})}}let o0e=class extends ${constructor(e,t,i,s,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=s,this._actionRunDelegate=o,this._keybindingService=r,this._container=he(e,we(".comment-additional-actions")),he(this._container,we(".section-separator")),this._buttonBar=he(this._container,we(".button-bar")),this._createAdditionalActions(this._buttonBar)}_showMenu(){this._container?.classList.remove("hidden")}_hideMenu(){this._container?.classList.add("hidden")}_enableDisableMenu(e){const t=e.getActions({shouldForwardArgs:!0});for(const i of t){const[,s]=i;for(const o of s){if(o.enabled){this._showMenu();return}for(const r of o.actions??[])if(r.enabled){this._showMenu();return}}}this._hideMenu()}_createAdditionalActions(e){const t=this._commentMenus.getCommentThreadAdditionalActions(this._contextKeyService);this._register(t),this._register(t.onDidChange(()=>{this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)})),this._commentFormActions=new OG(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:Fs.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};o0e=D([_(5,ti)],o0e);var FX;function gYt(n,e,t){const i=new Set;return pa(...n.map((s,o)=>pa(s.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),s.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const NOe=new Y("navigableContainerFocused",!1);var qP;let YF=(qP=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=NOe.bindTo(e),FX.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),FX.INSTANCE=void 0}get debugEnabled(){return this.configurationService.getValue("workbench.navigibleContainer.enableDebug")}log(e,...t){this.debugEnabled&&this.logService.debug(e,...t)}static register(e){const t=this.INSTANCE;return t?(t.containers.add(e),t.log("NavigableContainerManager.register",e.name),pa(gYt(e.focusNotifiers,i=>{i?(t.log("NavigableContainerManager.focus",e.name),t.focused.set(!0),t.lastContainer=e):(t.log("NavigableContainerManager.blur",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0))},(i,s)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,s)}),Ee(()=>{t.containers.delete(e),t.log("NavigableContainerManager.unregister",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0)}))):$.None}static getActive(){return this.INSTANCE?.lastContainer}},FX=qP,qP.ID="workbench.contrib.navigableContainerManager",qP);YF=FX=D([_(0,Pe),_(1,Ze),_(2,Re)],YF);function Crt(n){return YF.register(n)}gp(YF.ID,YF,Sl.BlockStartup);xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:ye.WorkbenchContrib,when:ge.and(NOe,ge.or(Rde?.negate(),LIt)),primary:V.CtrlCmd|E.UpArrow,handler:()=>{YF.getActive()?.focusPreviousWidget()}});xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:ye.WorkbenchContrib,when:ge.and(NOe,ge.or(Rde?.negate(),TIt)),primary:V.CtrlCmd|E.DownArrow,handler:()=>{YF.getActive()?.focusNextWidget()}});const ime="vs/workbench/contrib/comments/browser/commentThreadWidget";let r0e=class extends ${get commentThread(){return this._commentThread}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=s,this._contextKeyService=o,this._scopedInstantiationService=r,this._commentThread=a,this._pendingComment=c,this._pendingEdits=l,this._markdownOptions=d,this._commentOptions=h,this._containerDelegate=u,this.commentService=f,this.configurationService=m,this._keybindingService=v,this._commentThreadDisposables=[],this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._threadIsEmpty=Qv.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=Qv.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new uYt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const w=we(".body");e.appendChild(w);const b=this._register(Dd(w));this._register(Crt({name:"commentThreadWidget",focusNotifiers:[b],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(b.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(b.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(n0e,this._parentEditor,this._owner,this._parentResourceUri,w,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=od(this.container),this._commentThreadContextValue=Qv.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const C=Qv.commentControllerContext.bindTo(this._contextKeyService),y=this.commentService.getCommentController(this._owner);y?.contextValue&&C.set(y.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(ime,0,"Comment"),t;this.configurationService.getValue(ua.Comments)&&(t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(ime,1,"{0}, use ({1}) for accessibility help",e,t):e=g(ime,2,"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",e),this._body.container.ariaLabel=e}updateCurrentThread(e,t){e||t?this.commentService.setCurrentCommentThread(this.commentThread):this.commentService.setCurrentCommentThread(void 0)}currentThreadListeners(){let e=!1,t=!1;this._register(pe(this.container,xe.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(pe(this.container,xe.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===zl.Expanded&&this._commentThreadState===hg.Unresolved&&e.state===hg.Resolved;this._commentThreadState=e.state,this._commentThread=e,St(this._commentThreadDisposables),this._commentThreadDisposables=[],this._bindCommentThreadListeners(),await this._body.updateCommentThread(e,this._commentReply?.isCommentEditorFocused()??!1),this._threadIsEmpty.set(!this._body.length),this._header.updateCommentThread(e),this._commentReply?.updateCommentThread(e),this._commentThread.contextValue?this._commentThreadContextValue.set(this._commentThread.contextValue):this._commentThreadContextValue.reset(),t&&this.configurationService.getValue(aue).collapseOnResolve&&this.collapse()}async display(e,t){const i=Math.max(23,Math.ceil(e*1.2));this._header.updateHeight(i),await this._body.display(),this._commentThread.canReply&&this._createCommentForm(t),this._createAdditionalActions(),this._register(this._body.onDidResize(s=>{this._refresh(s)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),St(this._commentThreadDisposables),this.updateCurrentThread(!1,!1)}_bindCommentThreadListeners(){this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(()=>{this._commentReply?this._commentReply.updateCanReply():this._commentThread.canReply&&this._createCommentForm(!1)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.updateCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(e=>{this._header.createThreadLabel()}))}_createCommentForm(e){this._commentReply=this._scopedInstantiationService.createInstance(e0e,this._owner,this._body.container,this._parentEditor,this._commentThread,this._scopedInstantiationService,this._contextKeyService,this._commentMenus,this._commentOptions,this._pendingComment,this,e,this._containerDelegate.actionRunner),this._register(this._commentReply)}_createAdditionalActions(){this._additionalActions=this._scopedInstantiationService.createInstance(o0e,this._body.container,this._commentThread,this._contextKeyService,this._commentMenus,this._containerDelegate.actionRunner),this._register(this._additionalActions)}getCommentCoords(e){return this._body.getCommentCoords(e)}getPendingEdits(){return this._body.getPendingEdits()}getPendingComment(){if(this._commentReply)return this._commentReply.getPendingComment()}setPendingComment(e){this._pendingComment=e,this._commentReply?.setPendingComment(e)}getDimensions(){return this._body.getDimensions()}layout(e){this._body.layout(e),e!==void 0&&this._commentReply?.layout(e)}focusCommentEditor(){this._commentReply?.expandReplyAreaAndFocusCommentEditor()}focus(){this._body.focus()}async submitComment(){const e=this._body.activeComment;if(e)return e.submitComment();if((this._commentReply?.getPendingComment()?.length??0)>0)return this._commentReply?.submitComment()}collapse(){this._containerDelegate.collapse()}applyTheme(e,t){const i=[];i.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${prt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${mrt}) }`);const s=e.getColor(GB);s&&i.push(`.review-widget .body .comment-body a { color: ${s} }`);const o=e.getColor(_mt);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(Zd);r&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${r}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${r}; }`));const a=e.getColor(vmt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(wmt);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(TE);l&&i.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${l}; }`);const d=e.getColor(ft);d&&(i.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${d}; }`),i.push(`.review-widget .body .monaco-editor { outline: 1px solid ${d}; }`));const h=e.getColor(yKe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(bKe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(CKe);f&&i.push(`.review-widget .body .comment-form .validation-error { color: ${f}; }`);const p="--comment-thread-editor-font-family",m="--comment-thread-editor-font-size",v="--comment-thread-editor-font-weight";this.container?.style.setProperty(p,t.fontFamily),this.container?.style.setProperty(m,`${t.fontSize}px`),this.container?.style.setProperty(v,t.fontWeight),i.push(`.review-widget .body code { +{0}`,F8e),enum:[Ynt],enumDescriptions:[g(8683,"Open using VS Code's standard opener.")]},wxe]}}}};function VQt(s,e){wxe.enum=s,wxe.enumDescriptions=e,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(UQt)}var yxe,eM;let Cxe=(eM=class extends V{constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new sI(yxe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(Ie.PROFILE,an.MACHINE);for(const[i,n]of Object.entries(this._mementoObject||{}))this.add(i,n.extensionId,{isCurrentlyRegistered:!1});this.invalidateOpenersOnExtensionsChanged(),this._register(this._extensionService.onDidChangeExtensions(()=>this.invalidateOpenersOnExtensionsChanged())),this._register(this._extensionService.onDidChangeExtensionsStatus(()=>this.invalidateOpenersOnExtensionsChanged()))}didRegisterOpener(e,t){this.add(e,t,{isCurrentlyRegistered:!0})}add(e,t,i){const n=this._openers.get(e);if(n){n.isCurrentlyRegistered=n.isCurrentlyRegistered||i.isCurrentlyRegistered;return}const o={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,o),this._mementoObject[e]=o,this._memento.saveMemento(),this.updateSchema()}delete(e){this._openers.delete(e),delete this._mementoObject[e],this._memento.saveMemento(),this.updateSchema()}async invalidateOpenersOnExtensionsChanged(){await this._extensionService.whenInstalledExtensionsRegistered();const e=this._extensionService.extensions;for(const[t,i]of this._openers){const n=e.find(o=>o.identifier.value===i.extensionId);n?this._extensionService.canRemoveExtension(n)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,n]of this._openers)e.push(i),t.push(n.extensionId);VQt(e,t)}},yxe=eM,eM.STORAGE_ID="externalUriOpeners",eM);Cxe=yxe=D([_(0,$i),_(1,fs)],Cxe);let O8e=class extends V{constructor(e,t,i,n,o,r){super(),this.extensionService=n,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(Ye.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new Cxe(t,n))}async*getOpeners(e){if(!(e.scheme!==pe.http&&e.scheme!==pe.https)){await this.extensionService.activateByEvent(`onOpenExternalUri:${e.scheme}`);for(const[t,i]of this._registeredOpeners)i.schemes.has(e.scheme)&&(yield this.createOpener(t,i))}}createOpener(e,t){return{id:e,label:t.label,canOpen:(i,n)=>this.proxy.$canOpenUri(e,i,n),openExternalUri:async(i,n,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:n.sourceUri},o)}catch(r){if(!Fr(r)){const a=new rn("default",g(4866,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:Ynt})});a.tooltip=i.toString(),this.notificationService.notify({severity:Xe.Error,message:g(4867,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,n){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:n,extensionId:i}),this._contributedExternalUriOpenersStore.didRegisterOpener(e,i.value)}async $unregisterUriOpener(e){this._registeredOpeners.delete(e),this._contributedExternalUriOpenersStore.delete(e)}dispose(){super.dispose(),this._registeredOpeners.clear()}};O8e=D([Gi(Be.MainThreadUriOpeners),_(1,$i),_(2,LJe),_(3,fs),_(4,Ao),_(5,bi)],O8e);let B8e=class{constructor(e,t,i,n){this.hostService=t,this.openerService=i,this.userActivityService=n,this.disposables=new Z,this.proxy=e.getProxy(Ye.ExtHostWindow),M.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),n.onDidChangeIsActive(this.proxy.$onDidChangeWindowActive,this.proxy,this.disposables)}dispose(){this.disposables.dispose()}$getInitialState(){return Promise.resolve({isFocused:this.hostService.hasFocus,isActive:this.userActivityService.isActive})}async $openUri(e,t,i){const n=N.from(e);let o;return t&&N.parse(t).toString()===n.toString()?o=t:o=n,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(N.revive(e),t)).resolved}};B8e=D([Gi(Be.MainThreadWindow),_(1,xc),_(2,Ao),_(3,aMe)],B8e);var Sxe;let Axe=Sxe=class extends V{static async create(e,t,i){return e.invokeFunction(async n=>{const r=await n.get(fn).createModelReference(i);return e.createInstance(Sxe,t,i,r)})}constructor(e,t,i,n){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=n,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._register(i),this._textFileModel=this.textFileService.files.get(t),this._textFileModel&&(this._register(this._textFileModel.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._register(this._textFileModel.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._register(this.textFileService.files.onDidChangeDirty(o=>{ji(this.resource,o.resource)&&(this._onDidChangeDirty.fire(),this._onDidChangeContent.fire())}))}get resource(){return this._resource}isReadonly(){return this._model.object.isReadonly()}get backupId(){}get canHotExit(){return!0}isDirty(){return this.textFileService.isDirty(this.resource)}isOrphaned(){return!!this._textFileModel?.hasState(gh.ORPHAN)}async revert(e){return this.textFileService.revert(this.resource,e)}saveCustomEditor(e){return this.textFileService.save(this.resource,e)}async saveCustomEditorAs(e,t,i){return!!await this.textFileService.saveAs(e,t,i)}};Axe=Sxe=D([_(3,Fo)],Axe);new Q("webviewFindWidgetVisible",!1);new Q("webviewFindWidgetFocused",!1);new Q("webviewFindWidgetEnabled",!1);var W8e;(function(s){s.NotebookRenderer="notebookRenderer",s.CustomEditor="customEditor",s.WebviewView="webviewView"})(W8e||(W8e={}));let Exe=class{constructor(e,t){this._memento=new sI(e,t),this._state=this._memento.getMemento(Ie.APPLICATION,an.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),n=this._state[i];if(n&&typeof n=="string")return n;const o=ar();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};Exe=D([_(1,$i)],Exe);let gie=class{constructor(e,t){this._store=new Exe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};gie=D([_(1,$i)],gie);let fie=class extends V{constructor(e,t){super(),this.resource=e,this.fileService=t,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.orphaned=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._register(this.fileService.onDidFilesChange(i=>this.onDidFilesChange(i)))}isOrphaned(){return this.orphaned}async onDidFilesChange(e){let t=!1,i;if(this.orphaned?e.contains(this.resource,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.orphaned!==n&&!this.isDisposed()&&this.setOrphaned(n)}}setOrphaned(e){this.orphaned!==e&&(this.orphaned=e,this._onDidChangeOrphaned.fire())}isDisposed(){return this._store.isDisposed}dispose(){this.orphaned=!1,this._onWillDispose.fire(),super.dispose()}isModified(){return this.isDirty()}};fie=D([_(1,Jt)],fie);var cj,TF;(function(s){s[s.Custom=0]="Custom",s[s.Text=1]="Text"})(TF||(TF={}));let xxe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.mainThreadWebview=t,this.mainThreadWebviewPanels=i,this._customEditorService=c,this._editorGroupService=l,this._editorService=d,this._instantiationService=h,this._webviewWorkbenchService=u,this._editorProviders=this._register(new mo),this._editorRenameBackups=new Map,this._webviewOriginStore=new gie("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(Ye.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof LF&&qy(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof oB&&n.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,n,o){this.registerEditorProvider(TF.Text,wte(e),t,i,n,!0,o)}$registerCustomEditorProvider(e,t,i,n,o){this.registerEditorProvider(TF.Custom,wte(e),t,i,{},n,o)}registerEditorProvider(e,t,i,n,o,r,a){if(this._editorProviders.has(i))throw new Error(`Provider for ${i} already registered`);const c=new Z;c.add(this._customEditorService.registerCustomEditorCapabilities(i,{supportsMultipleEditorsPerDocument:r})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof oB&&l.viewType===i,resolveWebview:async(l,d)=>{const h=ar(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=n,l.webview.extension=t;let f=l.backupId;l.oldResource&&!l.backupId&&(f=this._editorRenameBackups.get(l.oldResource.toString())?.backupId,this._editorRenameBackups.delete(l.oldResource.toString()));let p;try{p=await this.getOrCreateCustomEditorModel(e,u,i,{backupId:f},d)}catch(m){vt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i));return}if(d.isCancellationRequested){p.dispose();return}l.webview.onDidDispose(()=>{if(p.object.isDirty()){const m=p.object.onDidChangeDirty(()=>{p.object.isDirty()||(m.dispose(),p.dispose())});return}p.dispose()}),o.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},He.None),this._proxyCustomEditors.$onMoveCustomEditor(h,m,i),v.dispose()});try{await this._proxyCustomEditors.$resolveCustomEditor(u,h,i,{title:l.getTitle(),contentOptions:l.webview.contentOptions,options:l.webview.options,active:l===this._editorService.activeEditor},rI(this._editorGroupService,l.group||0),d)}catch(m){vt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i)),p.dispose();return}}})),this._editorProviders.set(i,c)}$unregisterEditorProvider(e){if(!this._editorProviders.has(e))throw new Error(`No provider for ${e} registered`);this._editorProviders.deleteAndDispose(e),this._customEditorService.models.disposeAllModelsForView(e)}async getOrCreateCustomEditorModel(e,t,i,n,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case TF.Text:{const a=Axe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case TF.Custom:{const a=LF.create(this._instantiationService,this._proxyCustomEditors,i,t,n,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof oB&&ji(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,n){(await this.getCustomEditorModel(e,t)).pushEdit(i,n)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=N.revive(e),n=await this._customEditorService.models.get(i,t);if(!n||!(n instanceof LF))throw new Error("Could not find model for webview editor");return n}async onWillRunWorkingCopyFileOperation(e){e.operation===Ai.MOVE&&e.waitUntil((async()=>{const t=[];for(const i of e.files)i.source&&t.push(...await this._customEditorService.models.getAllModels(i.source));for(const i of t)if(i instanceof LF&&i.isDirty()){const n=await i.backup(He.None);n.meta&&this._editorRenameBackups.set(i.editorResource.toString(),n.meta)}})())}};xxe=D([_(3,fs),_(4,$i),_(5,Rm),_(6,zb),_(7,JRe),_(8,Po),_(9,ei),_(10,we),_(11,N6)],xxe);var NC;(function(s){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Allowed=Object.freeze({type:e.Allowed}),s.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(n){this.operation=n,this.type=e.Pending}}s.Pending=t})(NC||(NC={}));let LF=cj=class extends fie{static async create(e,t,i,n,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(n,i,o.backupId,l,a);return e.createInstance(cj,t,i,n,!!o.backupId,d,!!l,r)}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(cj.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=o,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=NC.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=RNe,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this.onDidChangeReadonly=M.None,this._fromBackup=n,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(9831,"Custom editor '{0}' could not be saved.",this.name))}))),r&&(this._isDirtyFromContentChange=!0)}get editorResource(){return this._editorResource}dispose(){this._editable&&this._undoService.removeElements(this._editorResource),this._proxy.$disposeCustomDocument(this._editorResource,this._viewType),super.dispose()}static toWorkingCopyResource(e,t){const i=e.replace(/[^a-z0-9\-_]/gi,"-"),n=`/${T8(t.with({query:null,fragment:null}).toString(!0))}`;return N.from({scheme:pe.vscodeCustomEditor,authority:i,path:n,query:JSON.stringify(t.toJSON())})}get name(){return Ko(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?aC.Untitled:aC.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===pe.untitled}isReadonly(){return!this._editable}get viewType(){return this._viewType}get backupId(){return this._backupId}pushEdit(e,t){if(!this._editable)throw new Error("Document is not editable");this.change(()=>{this.spliceEdits(e),this._currentEditIndex=this._edits.length-1}),this._undoService.pushElement({type:Al.Resource,resource:this._editorResource,label:t??g(9832,"Edit"),code:"undoredo.customEditorEdit",undo:()=>this.undo(),redo:()=>this.redo()})}changeContent(){this.change(()=>{this._isDirtyFromContentChange=!0})}async undo(){if(!this._editable||this._currentEditIndex<0)return;const e=this._edits[this._currentEditIndex];this.change(()=>{--this._currentEditIndex}),await this._proxy.$undo(this._editorResource,this.viewType,e,this.isDirty())}async redo(){if(!this._editable||this._currentEditIndex>=this._edits.length-1)return;const e=this._edits[this._currentEditIndex+1];this.change(()=>{++this._currentEditIndex}),await this._proxy.$redo(this._editorResource,this.viewType,e,this.isDirty())}spliceEdits(e){const t=this._currentEditIndex+1,i=this._edits.length-this._currentEditIndex,n=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);n.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,n)}change(e){const t=this.isDirty();e(),this._onDidChangeContent.fire(),this.isDirty()!==t&&this._onDidChangeDirty.fire()}async revert(e){this._editable&&(this._currentEditIndex===this._savePoint&&!this._isDirtyFromContentChange&&!this._fromBackup||(e?.soft||this._proxy.$revert(this._editorResource,this.viewType,He.None),this.change(()=>{this._isDirtyFromContentChange=!1,this._fromBackup=!1,this._currentEditIndex=this._savePoint,this.spliceEdits()})))}async save(e){const t=!!await this.saveCustomEditor(e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),t}async saveCustomEditor(e){if(!this._editable)return;if(this.isUntitled()){const i=await this.suggestUntitledSavePath(e);return i?(await this.saveCustomEditorAs(this._editorResource,i,e),i):void 0}const t=Rr(i=>this._proxy.$onSave(this._editorResource,this.viewType,i));this._ongoingSave?.cancel(),this._ongoingSave=t;try{await t,this._ongoingSave===t&&this.change(()=>{this._isDirtyFromContentChange=!1,this._savePoint=this._currentEditIndex,this._fromBackup=!1})}finally{this._ongoingSave===t&&(this._ongoingSave=void 0)}return this._editorResource}suggestUntitledSavePath(e){if(!this.isUntitled())throw new Error("Resource is not untitled");const t=this._environmentService.remoteAuthority,i=x8(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await Rr(n=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,n)),this.change(()=>{this._savePoint=this._currentEditIndex}),!0):(await this.fileService.copy(e,t,!1),!0)}get canHotExit(){return typeof this._backupId=="string"&&this._hotExitState.type===NC.Type.Allowed}async backup(e){const t=this._getEditors();if(!t.length)throw new Error("No editors found for resource, cannot back up");const i=t[0],o={meta:{viewType:this.viewType,editorResource:this._editorResource,backupId:"",extension:i.extension?{id:i.extension.id.value,location:i.extension.location}:void 0,webview:{origin:i.webview.origin,options:i.webview.options,state:i.webview.state}}};if(!this._editable)return o;this._hotExitState.type===NC.Type.Pending&&this._hotExitState.operation.cancel();const r=new NC.Pending(Rr(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=r,e.onCancellationRequested(()=>{r.operation.cancel()});let a="";try{const c=await r.operation;this._hotExitState===r&&(this._hotExitState=NC.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Fr(c))throw c;this._hotExitState===r&&(this._hotExitState=NC.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===NC.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};LF=cj=D([_(7,ag),_(8,Jt),_(9,Fs),_(10,JA),_(11,Jr),_(12,Rm),_(13,bf),_(14,fs)],LF);class zQt{constructor(){this._handlesToInputs=new Map,this._inputsToHandles=new Map}add(e,t){this._handlesToInputs.set(e,t),this._inputsToHandles.set(t,e)}getHandleForInput(e){return this._inputsToHandles.get(e)}getInputForHandle(e){return this._handlesToInputs.get(e)}delete(e){const t=this.getInputForHandle(e);this._handlesToInputs.delete(e),t&&this._inputsToHandles.delete(t)}get size(){return this._handlesToInputs.size}[Symbol.iterator](){return this._handlesToInputs.values()}}class $Qt{constructor(e){this.prefix=e}fromExternal(e){return this.prefix+e}toExternal(e){return e.startsWith(this.prefix)?e.substr(this.prefix.length):void 0}}let Dxe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=n,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new $Qt("mainThreadWebview-"),this._webviewInputs=new zQt,this._revivers=this._register(new mo),this.webviewOriginStore=new gie("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(Ye.ExtHostWebviewPanels),this._register(M.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,n.onDidAddGroup,n.onDidRemoveGroup,n.onDidMoveGroup)(()=>{this.updateWebviewViewStates(this._editorService.activeEditor)})),this._register(l.onDidChangeActiveWebviewEditor(d=>{this.updateWebviewViewStates(d)})),this._register(l.registerResolver({canResolve:d=>{const h=this.webviewPanelViewType.toExternal(d.viewType);return typeof h=="string"&&r.activateByEvent(`onWebviewPanel:${h}`),!1},resolveWebview:()=>{throw new Error("not implemented")}}))}get webviewInputs(){return this._webviewInputs}addWebviewInput(e,t,i){this._webviewInputs.add(e,t),this._mainThreadWebviews.addWebview(e,t.webview,i),t.webview.onDidDispose(()=>{this._proxy.$onDidDisposeWebviewPanel(e).finally(()=>{this._webviewInputs.delete(e)})})}$createWebviewPanel(e,t,i,n,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=wte(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:n.title,options:KQt(n.panelOptions),contentOptions:yte(n.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),n.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:n.serializeBuffersForPostMessage});const h={extensionId:c.id.value,viewType:i};this._telemetryService.publicLog2("webviews:createWebviewPanel",h)}$disposeWebview(e){const t=this.tryGetWebviewInput(e);t&&t.dispose()}$setTitle(e,t){this.tryGetWebviewInput(e)?.setName(t)}$setIconPath(e,t){const i=this.tryGetWebviewInput(e);i&&(i.iconPath=GQt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const n=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,n,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===hA||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return hA;if(e.viewColumn===ev)return ev;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(hu.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:tCe.LAST});if(i){const n=UW(this._configurationService);return this._editorGroupService.addGroup(i,n)}}return hA}$registerSerializer(e,t){if(this._revivers.has(e))throw new Error(`Reviver for ${e} already registered`);this._revivers.set(e,this._webviewWorkbenchService.registerResolver({canResolve:i=>i.viewType===this.webviewPanelViewType.fromExternal(e),resolveWebview:async i=>{const n=this.webviewPanelViewType.toExternal(i.viewType);if(!n){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=ar();this.addWebviewInput(o,i,t);let r;if(i.webview.state)try{r=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(o,n,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},rI(this._editorGroupService,i.group||0))}catch(a){vt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(n))}}}))}$unregisterSerializer(e){if(!this._revivers.has(e))throw new Error(`No reviver for ${e} registered`);this._revivers.deleteAndDispose(e)}updateWebviewViewStates(e){if(!this._webviewInputs.size)return;const t={},i=(n,o,r)=>{if(!(r instanceof Ou))return;r.updateGroup(n.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===n.activeEditor,active:r===e,position:rI(this._editorGroupService,n.id)})};for(const n of this._editorGroupService.groups)for(const o of n.editors)o instanceof qg?(i(n,o,o.primary),i(n,o,o.secondary)):i(n,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};Dxe=D([_(2,Te),_(3,Po),_(4,ei),_(5,fs),_(6,$i),_(7,Yi),_(8,N6)],Dxe);function GQt(s){if(s)return{light:N.revive(s.light),dark:N.revive(s.dark)}}function KQt(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}let kxe=class extends V{constructor(e,t,i,n){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=n,this._webviewViews=this._register(new mo),this._webviewViewProviders=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostWebviewViews)}$setWebviewViewTitle(e,t){const i=this.getWebviewView(e);i.title=t}$setWebviewViewDescription(e,t){const i=this.getWebviewView(e);i.description=t}$setWebviewViewBadge(e,t){const i=this.getWebviewView(e);i.badge=t}$show(e,t){this.getWebviewView(e).show(t)}$registerWebviewViewProvider(e,t,i){if(this._webviewViewProviders.has(t))throw new Error(`View provider for ${t} already registered`);const n=wte(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=ar();this._webviewViews.set(c,r),this.mainThreadWebviews.addWebview(c,r.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(r.webview.state)try{l=JSON.parse(r.webview.state)}catch(d){console.error("Could not load webview state",d,r.webview.state)}r.webview.extension=n,i&&(r.webview.options=i),r.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),r.onDispose(()=>{this._proxy.$disposeWebviewView(c),this._webviewViews.deleteAndDispose(c)}),this._telemetryService.publicLog2("webviews:createWebviewView",{extensionId:n.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){vt(d),r.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,o)}$unregisterWebviewViewProvider(e){if(!this._webviewViewProviders.has(e))throw new Error(`No view provider for ${e} registered`);this._webviewViewProviders.deleteAndDispose(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("unknown webview view");return t}};kxe=D([_(2,Yi),_(3,ZJe)],kxe);let H8e=class extends V{constructor(e,t){super();const i=this._register(t.createInstance(aEe,e));e.set(Be.MainThreadWebviews,i);const n=this._register(t.createInstance(Dxe,e,i));e.set(Be.MainThreadWebviewPanels,n);const o=this._register(t.createInstance(xxe,e,i,n));e.set(Be.MainThreadCustomEditors,o);const r=this._register(t.createInstance(kxe,e,i));e.set(Be.MainThreadWebviewViews,r)}};H8e=D([QN,_(1,we)],H8e);let U8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=n,this._canonicalUriService=o,this._editorService=r,this._workspaceEditingService=a,this._notificationService=c,this._requestService=l,this._instantiationService=d,this._labelService=h,this._environmentService=u,this._workspaceTrustManagementService=p,this._workspaceTrustRequestService=m,this._toDispose=new Z,this._activeCancelTokens=Object.create(null),this._queryBuilder=this._instantiationService.createInstance(See),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(Ye.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!ad&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(b=>this._proxy.$initializeWorkspace(this.getWorkspaceData(b),this.isWorkspaceTrusted())),this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace,this,this._toDispose),this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace,this,this._toDispose),this._workspaceTrustManagementService.onDidChangeTrust(this._onDidGrantWorkspaceTrust,this,this._toDispose)}dispose(){this._toDispose.dispose();for(const e in this._activeCancelTokens)this._activeCancelTokens[e].cancel()}$updateWorkspaceFolders(e,t,i,n){const o=n.map(r=>({uri:N.revive(r.uri),name:r.name}));return this._notificationService.status(this.getStatusMessage(e,o.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,o,!0)}getStatusMessage(e,t,i){let n;const o=t>0,r=i>0;return o&&!r?t===1?n=g(4868,"Extension '{0}' added 1 folder to the workspace",e):n=g(4869,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?n=g(4870,"Extension '{0}' removed 1 folder from the workspace",e):n=g(4871,"Extension '{0}' removed {1} folders from the workspace",e,i):n=g(4872,"Extension '{0}' changed folders of the workspace",e),n}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===qi.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?g3(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const n=N.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(n?[n]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Fr(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,n,o){const r=N.revive(t),a=this._contextService.getWorkspace(),c=r?[r]:a.folders.map(u=>u.uri),l=this._queryBuilder.text(e,c,i);l._reason="startTextSearch";const d=u=>{u.results&&this._proxy.$handleTextSearchResult(u,n)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Fr(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(n=>Wit(n,e,t,i))}async $save(e,t){const i=N.revive(e),n=[...this._editorService.findEditors(i,{supportSideBySide:Hs.PRIMARY})],o=await this._editorService.save(n,{reason:Cn.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return lm(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Fi(e.editors.map(t=>Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$lookupAuthorization(e){return this._requestService.lookupAuthorization(e)}$lookupKerberosAuthorization(e){return this._requestService.lookupKerberosAuthorization(e)}$loadCertificates(){return this._requestService.loadCertificates()}$requestWorkspaceTrust(e){return this._workspaceTrustRequestService.requestWorkspaceTrust(e)}isWorkspaceTrusted(){return this._workspaceTrustManagementService.isWorkspaceTrusted()}_onDidGrantWorkspaceTrust(){this._proxy.$onDidGrantWorkspaceTrust()}$registerEditSessionIdentityProvider(e,t){const i=this._editSessionIdentityService.registerEditSessionIdentityProvider({scheme:t,getEditSessionIdentifier:async(n,o)=>this._proxy.$getEditSessionIdentifier(n.uri,o),provideEditSessionIdentityMatch:async(n,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(n.uri,o,r,a)});this.registeredEditSessionProviders.set(e,i),this._toDispose.add(i)}$unregisterEditSessionIdentityProvider(e){this.registeredEditSessionProviders.get(e)?.dispose(),this.registeredEditSessionProviders.delete(e)}$registerCanonicalUriProvider(e,t){const i=this._canonicalUriService.registerCanonicalUriProvider({scheme:t,provideCanonicalUri:async(n,o,r)=>{const a=await this._proxy.$provideCanonicalUri(n,o,r);return a&&N.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};U8e=D([Gi(Be.MainThreadWorkspace),_(1,Zae),_(2,yi),_(3,$Re),_(4,zRe),_(5,ei),_(6,iC),_(7,bi),_(8,I6),_(9,we),_(10,Fs),_(11,Za),_(12,Jt),_(13,uC),_(14,vae)],U8e);var qQt=".comments-panel .comments-panel-container{height:100%}.comments-panel .comments-panel-container .hidden{display:none}.comments-panel .comments-panel-container .tree-container{height:100%}.comments-panel .comments-panel-container .tree-container.hidden{display:none;visibility:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container{display:block}.comments-panel .comments-panel-container .tree-container .comment-thread-container div{overflow:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container,.comments-panel .comments-panel-container .tree-container .resource-container{display:flex;overflow:hidden;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata{display:flex;flex:1}.comments-panel .count,.comments-panel .user{padding-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .icon{min-width:fit-content;padding-right:5px;padding-top:4px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .user,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .count{min-width:fit-content}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance{background-color:var(--vscode-badge-background);border-radius:2px;color:var(--vscode-badge-foreground);font-size:.9em;line-height:14px;margin-bottom:3px;margin-right:4px;margin-top:4px;padding:0 4px 1px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text{display:flex;flex:1;min-width:0}.comments-panel .comments-panel-container .tree-container .comment-thread-container .reply-detail,.comments-panel .comments-panel-container .tree-container .comment-thread-container .timestamp,.comments-panel .comments-panel-container .tree-container .resource-container .owner{display:block;font-size:.9em;opacity:.8;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .text *{margin:0;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata .text *{max-width:700px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .range{opacity:.8}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text code{font-family:var(--monaco-monospace-font)}.comments-panel .comments-panel-container .tree-container .monaco-icon-label{padding-right:5px}.comments-panel .comments-panel-container .tree-container .separator{opacity:.8;padding-right:5px}.comments-panel .comments-panel-container .message-box-container{height:inherit;line-height:22px;padding-left:20px}.comments-panel .comments-panel-container .tree-container .count-badge-wrapper{margin-left:10px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{line-height:22px;margin-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{padding-left:16px}.comments-panel .hide{display:none}.comments-panel .comments-panel-container .text a{color:var(--vscode-textLink-foreground)}.comments-panel .comments-panel-container .text a:hover,.comments-panel .comments-panel-container a:active{color:var(--vscode-textLink-activeForeground)}.comments-panel .comments-panel-container .text a:focus{outline-color:var(--vscode-focusBorder)}.comments-panel .comments-panel-container .text code{color:var(--vscode-textPreformat-foreground)}.comments-panel .comments-panel-container .actions{display:none}.comments-panel .comments-panel-container .actions .action-label{padding:2px}.comments-panel .monaco-list .monaco-list-row.focused .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row.selected .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row:hover .comment-metadata-container .actions{display:block}";ut(qQt,{});let Jw=class{constructor(e,t,i,n,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=n,this.thread=o,this.isRoot=!1,this.replies=[],this.threadId=o.threadId,this.range=o.range,this.threadState=o.state,this.threadRelevance=o.applicability,this.contextValue=o.contextValue,this.controllerHandle=o.controllerHandle,this.threadHandle=o.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class tp{constructor(e,t,i,n){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=n.filter(o=>o.comments&&o.comments.length).map(o=>tp.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,n){const{comments:o}=n,r=o.map(a=>new Jw(e,t,i,a,n));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const jce="comments";class Ixe extends V{constructor(e,t,i,n){super(),this.configurationService=e,this._date=re(i,fe("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupManagedHover(Pr("mouse"),this._date,"")),this.setTimestamp(n)}get useRelativeTimeSetting(){return this.configurationService.getValue(jce).useRelativeTime}async setTimestamp(e){(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime)&&this.updateDate(e),this._timestamp=e,this._useRelativeTime=this.useRelativeTimeSetting}updateDate(e){if(!e)this._date.textContent="",this._date.style.display="none";else if(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime){this._date.style.display="";let t,i;this.useRelativeTimeSetting?(t=this.getRelative(e),i=this.getDateString(e)):t=this.getDateString(e),this._date.textContent=t,this.hover.update(i??"")}}getRelative(e){return uNe(e,!0,!0)}getDateString(e){return e.toLocaleString(ql)}}const Txe=W("commentsView.resolvedIcon",{dark:UOe,light:UOe,hcDark:wt,hcLight:wt},g(9987,"Icon color for resolved comments.")),Lxe=W("commentsView.unresolvedIcon",{dark:$pe,light:$pe,hcDark:wt,hcLight:wt},g(9988,"Icon color for unresolved comments."));W("editorCommentsWidget.replyInputBackground",sce,g(9989,"Background color for comment reply input box."));const QQt=W("editorCommentsWidget.resolvedBorder",{dark:Txe,light:Txe,hcDark:wt,hcLight:wt},g(9990,"Color of borders and arrow for resolved comments.")),pPe=W("editorCommentsWidget.unresolvedBorder",{dark:Lxe,light:Lxe,hcDark:wt,hcLight:wt},g(9991,"Color of borders and arrow for unresolved comments."));W("editorCommentsWidget.rangeBackground",st(pPe,.1),g(9992,"Color of background for comment ranges."));W("editorCommentsWidget.rangeActiveBackground",st(pPe,.1),g(9993,"Color of background for currently selected or hovered comment range."));const jQt=new Map([[ru.Unresolved,pPe],[ru.Resolved,QQt]]),YQt=new Map([[ru.Unresolved,Lxe],[ru.Resolved,Txe]]),Jnt="--comment-thread-state-color",V8e="--comment-view-thread-state-color",Xnt="--comment-thread-state-background-color";function Znt(s,e,t){const i=s!==void 0?t.get(s):void 0;return i!==void 0?e.getColor(i):void 0}function JQt(s,e){return Znt(s,e,jQt)}function XQt(s,e){return Znt(s,e,YQt)}const joe=class joe{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const n=e.startsWith("!");this.textFilter={text:(n?pU(e,"!"):e).trim(),negate:n}}};joe._filter=OQe,joe._messageFilter=OY;let _S=joe;class Yce extends V{get resourceCommentThreads(){return this._resourceCommentThreads}constructor(){super(),this._resourceCommentThreads=[],this.commentThreadsMap=new Map}updateResourceCommentThreads(){const e=this.commentThreadsMap.size>1;this._resourceCommentThreads=[...this.commentThreadsMap.values()].map(t=>t.resourceWithCommentThreads.map(i=>(i.ownerLabel=e?t.ownerLabel:void 0,i)).flat()).flat(),this._resourceCommentThreads.sort((t,i)=>t.resource.toString()>i.resource.toString()?1:-1)}setCommentThreads(e,t,i,n){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,n)}),this.updateResourceCommentThreads()}deleteCommentsByOwner(e){if(e){const t=this.commentThreadsMap.get(e);this.commentThreadsMap.set(e,{ownerLabel:t?.ownerLabel,resourceWithCommentThreads:[]})}else this.commentThreadsMap.clear();this.updateResourceCommentThreads()}updateCommentThreads(e){const{uniqueOwner:t,owner:i,ownerLabel:n,removed:o,changed:r,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return o.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0,u=h?.commentThreads.findIndex(f=>f.threadId===l.threadId)??0;u>=0&&h?.commentThreads.splice(u,1),h?.commentThreads.length===0&&c.splice(d,1)}),r.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0;if(!h)return;const u=h.commentThreads.findIndex(f=>f.threadId===l.threadId);u>=0?h.commentThreads[u]=tp.createCommentNode(t,i,N.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(tp.createCommentNode(t,i,N.parse(h.id),l))}),a.forEach(l=>{const d=c.filter(h=>h.resource.toString()===l.resource);if(d.length){const h=d[0];l.comments&&l.comments.length&&h.commentThreads.push(tp.createCommentNode(t,i,h.resource,l))}else c.push(new tp(t,i,N.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:n,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(5310,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const n=[],o=new Map;for(const r of i8(i,Yce._compareURIs))o.set(r[0].resource,new tp(e,t,N.parse(r[0].resource),r));return o.forEach((r,a,c)=>{n.push(r)}),n}static _compareURIs(e,t){const i=e.resource.toString(),n=t.resource.toString();return in?1:0}}const jl="workbench.panel.comments",ZQt="Comments",Rxe=Pe(5319,"Comments"),bO=class bO{getHeight(e){return e instanceof Jw&&e.hasReply()?44:22}getTemplateId(e){return e instanceof tp?bO.RESOURCE_ID:e instanceof Jw?bO.COMMENT_ID:""}};bO.RESOURCE_ID="resource-with-comments",bO.COMMENT_ID="comment-node";let Mxe=bO;class ejt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=re(e,fe(".resource-container")),i=this.labels.create(t),n=re(t,fe(".separator")),o=t.appendChild(fe(".owner"));return{resourceLabel:i,owner:o,separator:n}}renderElement(e,t,i,n){i.resourceLabel.setFile(e.element.resource),i.separator.innerText="·",e.element.ownerLabel?(i.owner.innerText=e.element.ownerLabel,i.separator.style.display="inline"):(i.owner.innerText="",i.separator.style.display="none")}disposeTemplate(e){e.resourceLabel.dispose()}}let Nxe=class{constructor(e){this.menuService=e}getResourceActions(e){return{actions:this.getActions(_e.CommentsViewThreadActions,e).primary}}getResourceContextActions(e){return this.getActions(_e.CommentsViewThreadActions,e).secondary}setContextKeyService(e){this.contextKeyService=e}getActions(e,t){if(!this.contextKeyService)return{primary:[],secondary:[]};const i=[["commentController",t.owner],["resourceScheme",t.resource.scheme],["commentThread",t.contextValue],["canReply",t.thread.canReply]],n=this.contextKeyService.createOverlay(i),o=this.menuService.getMenuActions(e,n,{shouldForwardArgs:!0}),c={primary:[],secondary:[],menu:o};return zje(o,c,"inline"),c}dispose(){this.contextKeyService=void 0}};Nxe=D([_(0,Oa)],Nxe);let Pxe=class{constructor(e,t,i,n,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=n,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=re(e,fe(".comment-thread-container")),i=re(t,fe(".comment-metadata-container")),n=re(i,fe(".comment-metadata")),o={icon:re(n,fe(".icon")),userNames:re(n,fe(".user")),timestamp:new Ixe(this.configurationService,this.hoverService,re(n,fe(".timestamp-container"))),relevance:re(n,fe(".relevance")),separator:re(n,fe(".separator")),commentPreview:re(n,fe(".text")),range:re(n,fe(".range"))};o.separator.innerText="·";const r=re(i,fe(".actions")),a=new hd(r,{actionViewItemProvider:this.actionViewItemProvider}),c=re(t,fe(".comment-snippet-container")),l={container:c,icon:re(c,fe(".icon")),count:re(c,fe(".count")),lastReplyDetail:re(c,fe(".reply-detail")),separator:re(c,fe(".separator")),timestamp:new Ixe(this.configurationService,this.hoverService,re(c,fe(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...We.asClassNameArray(ve.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(5320,"{0} replies",e-1):e===2?g(5321,"1 reply"):g(5322,"1 comment")}getRenderedComment(e,t){const i=f6(e,{inline:!0,actionHandler:{callback:o=>uae(this.openerService,o,e.isTrusted),disposables:t}}),n=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...We.asClassNameArray(this.getIcon(e.element.threadState))),e.element.threadState!==void 0){const l=this.getCommentThreadWidgetStateColor(e.element.threadState,this.themeService.getColorTheme());i.threadMetadata.icon.style.setProperty(V8e,`${l}`),i.threadMetadata.icon.style.color=`var(${V8e})`}i.threadMetadata.userNames.textContent=e.element.comment.userName,i.threadMetadata.timestamp.setTimestamp(e.element.comment.timestamp?new Date(e.element.comment.timestamp):void 0);const r=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof r.comment.body=="string")i.threadMetadata.commentPreview.innerText=r.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(r.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupManagedHover(Pr("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(5326,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(5327,"[Ln {0}-{1}]",e.element.range.startLineNumber,e.element.range.endLineNumber));const a=this.menus.getResourceActions(e.element);if(i.actionBar.push(a.actions,{icon:!0,label:!1}),i.actionBar.context={commentControlHandle:e.element.controllerHandle,commentThreadHandle:e.element.threadHandle,$mid:ws.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(o);const c=e.element.replies[e.element.replies.length-1].comment;i.repliesMetadata.lastReplyDetail.textContent=g(5328,"Last reply from {0}",c.userName),i.repliesMetadata.timestamp.setTimestamp(c.timestamp?new Date(c.timestamp):void 0)}getCommentThreadWidgetStateColor(e,t){return e!==void 0?XQt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};Pxe=D([_(2,Ao),_(3,Te),_(4,ec),_(5,pn)],Pxe);var pie;(function(s){s[s.Resource=0]="Resource",s[s.Comment=1]="Comment"})(pie||(pie={}));class tjt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?qs.Visible:e instanceof tp?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=_S._filter(this.options.textFilter.text,_i(e.resource));if(t)return{visibility:!0,data:{type:pie.Resource,uriMatches:t||[]}}}return qs.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&ru.Resolved===e.threadState||this.options.showUnresolved&&ru.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const n=_S._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||_S._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>_S._messageFilter(this.options.textFilter.text,o.comment.userName)||_S._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return n.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:pie.Comment,textMatches:n}}:n.length&&this.options.textFilter.negate&&t===qs.Recurse?!1:n.length===0&&this.options.textFilter.negate&&t===qs.Recurse?!0:t}}let Fxe=class extends x3{constructor(e,t,i,n,o,r,a,c,l){const d=new Mxe,h=WN.bind(void 0,r),u=r.createInstance(Nxe);u.setContextKeyService(n);const f=[r.createInstance(ejt,e),r.createInstance(Pxe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof Yce?"root":p instanceof tp?`${p.uniqueOwner}-${p.id}`:p instanceof Jw?`${p.uniqueOwner}-${p.resource.toString()}-${p.threadId}-${p.comment.uniqueIdInThread}`+(p.isRoot?"-root":""):""},expandOnlyOnTwistieClick:!0,collapseByDefault:!1,overrideStyles:i.overrideStyles,filter:i.filter,findWidgetEnabled:!1,multipleSelectionSupport:!1},r,n,o,a),this.contextMenuService=c,this.keybindingService=l,this.menus=u,this.disposables.add(this.onContextMenu(p=>this.commentsOnContextMenu(p)))}commentsOnContextMenu(e){const t=e.element;if(!(t instanceof Jw))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const n=this.menus.getResourceContextActions(t);n.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>n,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new Jy(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:ws.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const n of i.children)n.visible&&i.visible&&e++;return e}};Fxe=D([_(3,Le),_(4,lg),_(5,we),_(6,Te),_(7,lr),_(8,Ut)],Fxe);const mPe=new Q("commentsFilterFocus",!1),est=new Q("commentsView.showResolvedFilter",!0),tst=new Q("commentsView.showUnResolvedFilter",!0);class ijt extends V{constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=tst.bindTo(this.contextKeyService),this._showResolved=est.bindTo(this.contextKeyService),this._showResolved.set(e.showResolved),this._showUnresolved.set(e.showUnresolved)}get showUnresolved(){return!!this._showUnresolved.get()}set showUnresolved(e){this._showUnresolved.get()!==e&&(this._showUnresolved.set(e),this._onDidChange.fire({showUnresolved:!0}))}get showResolved(){return!!this._showResolved.get()}set showResolved(e){this._showResolved.get()!==e&&(this._showResolved.set(e),this._onDidChange.fire({showResolved:!0}))}}At(class extends oG{constructor(){super({id:"commentsFocusViewFromFilter",title:g(9994,"Focus Comments view"),keybinding:{when:mPe,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.DownArrow},viewId:jl})}async runInView(s,e){e.focus()}});At(class extends oG{constructor(){super({id:"commentsClearFilterText",title:g(9995,"Clear filter text"),keybinding:{when:mPe,weight:Ae.WorkbenchContrib,primary:S.Escape},viewId:jl})}async runInView(s,e){e.clearFilterText()}});At(class extends oG{constructor(){super({id:"commentsFocusFilter",title:g(9996,"Focus comments filter"),keybinding:{when:FU.isEqualTo(jl),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyF},viewId:jl})}async runInView(s,e){e.focusFilter()}});At(class extends oG{constructor(){super({id:`workbench.actions.${jl}.toggleUnResolvedComments`,title:g(9997,"Show Unresolved"),category:g(9998,"Comments"),toggled:{condition:tst,title:g(9999,"Show Unresolved")},menu:{id:Ice,group:"1_filter",when:he.equals("view",jl),order:1},viewId:jl})}async runInView(s,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends oG{constructor(){super({id:`workbench.actions.${jl}.toggleResolvedComments`,title:g(1e4,"Show Resolved"),category:g(9998,"Comments"),toggled:{condition:est,title:g(10001,"Show Resolved")},menu:{id:Ice,group:"1_filter",when:he.equals("view",jl),order:1},viewId:jl})}async runInView(s,e){e.filters.showResolved=!e.filters.showResolved}});var njt=".review-widget{position:absolute;width:100%}.monaco-editor .review-widget{background-color:var(--vscode-peekViewResult-background)}.review-widget .hidden{display:none!important}.review-widget .body{overflow:hidden}.review-widget .body .review-comment{display:flex;padding:8px 16px 8px 20px}@keyframes monaco-review-widget-focus{0%{background:var(--vscode-peekViewResult-selectionBackground)}to{background:transparent}}.review-widget .body .review-comment.focus{animation:monaco-review-widget-focus 3s ease 0s}.review-widget .body .review-comment .comment-actions{margin-left:auto}.review-widget .body .review-comment .comment-actions .monaco-toolbar{height:22px}.review-widget .body .review-comment .comment-title .comment-header-info{overflow:hidden;text-overflow:ellipsis}.review-widget .body .review-comment .comment-title{display:flex;width:100%}.review-widget .body .review-comment .comment-title .action-label.codicon{line-height:18px}.review-widget .body .review-comment .comment-title .monaco-dropdown .toolbar-toggle-more{height:18px;line-height:18px;vertical-align:middle;width:16px}.review-widget .body .comment-body blockquote{border-left-style:solid;border-left-width:5px;margin:0 7px 0 5px;padding:0 16px 0 10px}.review-widget .body .review-comment .avatar-container{margin-top:4px!important}.review-widget .body .review-comment .avatar-container img.avatar{border-radius:3px;border-style:none;display:inline-block;height:28px;line-height:1;overflow:hidden;vertical-align:middle;width:28px}.review-widget .body .comment-reactions .monaco-text-button{background-color:transparent;border:1px solid grey;border-radius:3px;margin:0 7px 0 0;width:30px}.review-widget .body .review-comment .review-comment-contents{overflow:hidden;padding-left:20px;user-select:text;-webkit-user-select:text;width:100%}.review-widget .body pre{word-wrap:normal;overflow:auto;white-space:pre}.review-widget .body .review-comment .review-comment-contents .author{line-height:22px}.review-widget .body .review-comment .review-comment-contents .isPending{font-style:italic;line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .timestamp{line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .comment-body .comment-body-plainstring{white-space:pre-wrap}.review-widget .body .review-comment .review-comment-contents .comment-body{padding-top:4px}.review-widget .body .review-comment .review-comment-contents .comment-body-max-height{max-height:20em}.review-widget .body .review-comment .review-comment-contents .comment-reactions{margin-top:8px;min-height:25px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label{display:flex;font-size:12px;padding:1px 4px;text-align:center;white-space:pre}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-icon{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:14px;display:inline-block;margin-right:4px;width:14px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-label{line-height:20px;margin-right:4px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions{background-position:50%;background-repeat:no-repeat;background-size:16px;border:none;display:none;font-size:16px;height:16px;margin-top:3px;width:26px}.review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions{background-size:16px;display:inline-block}.review-widget .body .review-comment .comment-title .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block;height:16px;line-height:16px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label{border:1px solid}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.disabled{opacity:.6}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.active:hover{background-color:var(--vscode-statusBarItem-hoverBackground)}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active{background-color:var(--vscode-statusBarItem-activeBackground);border:1px solid transparent}.review-widget .body .review-comment .review-comment-contents a{cursor:pointer}.review-widget .body .comment-body p,.review-widget .body .comment-body ul{margin:8px 0}.review-widget .body .comment-body p:first-child,.review-widget .body .comment-body ul:first-child{margin-top:0}.review-widget .body .comment-body p:last-child,.review-widget .body.comment-body ul:last-child{margin-bottom:0}.review-widget .body .comment-body ul{padding-left:20px}.review-widget .body .comment-body li>p{margin-bottom:0}.review-widget .body .comment-body li>ul{margin-top:0}.review-widget .body .comment-body span{white-space:pre}.review-widget .body .comment-body img{max-width:100%}.review-widget .body .comment-form{margin:8px 20px}.review-widget .validation-error{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-left:-1px;margin-top:-1px;min-height:34px;overflow:hidden;padding:.4em;text-align:left;width:100%}.review-widget .body .comment-additional-actions{margin:10px 20px}.review-widget .body .comment-additional-actions .section-separator{border-top:1px solid var(--vscode-menu-separatorBackground);margin:10px 0 14px}.review-widget .body .comment-additional-actions .button-bar{display:flex;white-space:nowrap}.review-widget .body .comment-additional-actions .monaco-button,.review-widget .body .comment-additional-actions .monaco-button-dropdown,.review-widget .body .comment-additional-actions .monaco-text-button{display:flex;width:auto}.review-widget .body .comment-additional-actions .button-bar>.monaco-button-dropdown,.review-widget .body .comment-additional-actions .button-bar>.monaco-text-button{margin:0 10px 0 0}.review-widget .body .comment-additional-actions .button-bar .monaco-text-button{padding:4px 10px}.review-widget .body .comment-additional-actions .codicon-drop-down-button{align-items:center}.review-widget .body .monaco-editor{color:var(--vscode-editor-foreground)}.review-widget .body .comment-form.expand .review-thread-reply-button{display:none}.review-widget .body .comment-form.expand .form-actions,.review-widget .body .comment-form.expand .monaco-editor{box-sizing:content-box;display:block}.review-widget .body .comment-form .review-thread-reply-button{background-color:var(--vscode-editorCommentsWidget-replyInputBackground);border:0;border-radius:0;box-sizing:border-box;color:var(--vscode-editor-foreground);display:block;font-family:var(--monaco-monospace-font);font-size:inherit;font-weight:600;line-height:20px;outline:1px solid transparent;padding:6px 12px;resize:vertical;text-align:left;white-space:nowrap;width:100%}.review-widget .body .comment-form .review-thread-reply-button:focus{outline-style:solid;outline-width:1px}.review-widget .body .comment-form .monaco-editor,.review-widget .body .comment-form .monaco-editor .monaco-editor-background,.review-widget .body .edit-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-editorCommentsWidget-replyInputBackground)}.review-widget .body .comment-form .monaco-editor,.review-widget .body .edit-container .monaco-editor{border:0;border-radius:3px;box-sizing:content-box;max-height:500px;min-height:90px;padding:6px 0 6px 12px;width:100%}.review-widget .body .comment-form .form-actions,.review-widget .body .comment-form .monaco-editor{display:none}.review-widget .body .comment-form .form-actions,.review-widget .body .edit-container .form-actions{margin:10px 0;overflow:auto}.review-widget .body .edit-container .form-actions{padding-top:10px}.review-widget .body .edit-textarea{margin:5px 12px 10px 0}.review-widget .body .comment-form .form-actions .monaco-text-button,.review-widget .body .edit-container .monaco-text-button{margin-left:5px;padding:4px 10px;width:auto}.review-widget .body .form-actions .monaco-text-button{float:right}.review-widget .head{box-sizing:border-box;display:flex;height:100%}.review-widget .head .review-title{cursor:default;display:inline-block;font-size:13px;margin-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-widget .head .review-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.review-widget .head .review-actions{flex:1;padding-right:2px;text-align:right}.review-widget .head .review-actions>.monaco-action-bar{display:inline-block}.review-widget .head .review-actions>.monaco-action-bar,.review-widget .head .review-actions>.monaco-action-bar>.actions-container{height:100%}.review-widget .action-item{margin-left:4px;min-height:20px;min-width:18px}.review-widget .head .review-actions>.monaco-action-bar .action-label{background-position:50%;background-repeat:no-repeat;line-height:inherit;margin:0}.review-widget .head .review-actions>.monaco-action-bar .action-label.codicon{margin:0}.review-widget>.body{border-top:1px solid;position:relative}.monaco-editor .comment-range-glyph{cursor:pointer;margin-left:10px;width:4px!important;z-index:10}div.preview.inline .monaco-editor .comment-range-glyph{display:none!important}.monaco-editor .comment-diff-added{border-left-style:solid;border-left-width:3px}.monaco-editor .comment-diff-added,.monaco-editor .comment-range-glyph.multiline-add{border-left-color:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-diff-added:before,.monaco-editor .comment-range-glyph.line-hover:before,.monaco-editor .comment-thread-unresolved:before,.monaco-editor .comment-thread:before{background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-thread-range{background-color:var(--vscode-editorCommentsWidget-rangeBackground)}.monaco-editor .comment-thread-range-current{background-color:var(--vscode-editorCommentsWidget-rangeActiveBackground)}.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread,.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread-unresolved,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover{margin-left:13px}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{align-items:center;color:var(--vscode-editorGutter-commentGlyphForeground);display:flex;flex-direction:row;height:100%;justify-content:center;left:-6px;position:absolute;text-align:center;width:9px;z-index:10}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{color:var(--vscode-editorGutter-commentUnresolvedGlyphForeground)}.monaco-editor .margin-view-overlays .comment-range-glyph.multiline-add{border-left-style:dotted;border-left-width:3px;height:16px;margin-top:2px}.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{border-radius:3px;content:var(--vscode-icon-plus-content);font-family:var(--vscode-icon-plus-font-family);font-family:codicon;margin-left:-5px;padding-left:1px;width:18px!important}.monaco-editor .comment-range-glyph.comment-thread,.monaco-editor .comment-range-glyph.comment-thread-unresolved{z-index:20}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before{border-radius:3px;font-family:codicon;font-size:13px;line-height:100%;margin-left:-5px;padding-left:1px;padding-top:1px;width:18px!important;z-index:20}.monaco-editor .comment-range-glyph.comment-thread:before{content:var(--vscode-icon-comment-add-content);font-family:var(--vscode-icon-comment-add-font-family)}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{content:var(--vscode-icon-comment-unresolved-content);font-family:var(--vscode-icon-comment-unresolved-font-family)}.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-collapsed,.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded{margin-left:11px}.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph{margin-left:25px}";ut(njt,{});const sjt=W("editorGutter.commentRangeForeground",{dark:BOe(Gpe,Hc),light:pp(BOe(Gpe,Hc),.05),hcDark:me.white,hcLight:me.black},g(10014,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),ist=W("editorOverviewRuler.commentForeground",sjt,g(10015,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),ojt=W("editorOverviewRuler.commentUnresolvedForeground",ist,g(10016,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),rjt=W("editorGutter.commentGlyphForeground",{dark:Rl,light:Rl,hcDark:me.black,hcLight:me.white},g(10017,"Editor gutter decoration color for commenting glyphs."));W("editorGutter.commentUnresolvedGlyphForeground",rjt,g(10018,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const Yoe=class Yoe{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===ru.Unresolved,t={description:Yoe.description,isWholeLine:!0,overviewRuler:{color:$o(e?ojt:ist),position:kl.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return Gt.createDynamic(t)}setThreadState(e){this._threadState!==e&&(this._threadState=e,this._commentsOptions=this.createDecorationOptions(),this._updateDecorations())}_updateDecorations(){const e=[{range:{startLineNumber:this._lineNumber,startColumn:1,endLineNumber:this._lineNumber,endColumn:1},options:this._commentsOptions}];this._commentsDecorations.set(e)}setLineNumber(e){this._lineNumber=e,this._updateDecorations()}getPosition(){const e=this._commentsDecorations.length>0?this._commentsDecorations.getRange(0):null;return{position:{lineNumber:e?e.endLineNumber:this._lineNumber,column:1},preference:[es.EXACT]}}dispose(){this._commentsDecorations.clear()}};Yoe.description="comment-glyph-widget";let L$=Yoe;class R${constructor(e,t,i,n,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=n,this.maxActions=o,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(o=>o.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let n=!t;for(const o of i){const[,r]=o;this._actions=r;for(const a of r){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&n&&(c=this.keybindingService.lookupKeybinding(QC.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Jd(this.container,{secondary:!n,title:l,...y6});if(n=!1,this._buttonElements.push(d.element),this._toDispose.add(d),this._toDispose.add(d.onDidClick(()=>this.actionHandler(a))),d.enabled=a.enabled,d.label=a.label,this.maxActions!==void 0&&this._buttonElements.length>=this.maxActions){console.warn("An extension has contributed more than the allowable number of actions to a comments menu.");return}}}}triggerDefaultAction(){if(this._actions.length){const e=this._actions[0];if(e.enabled)return this.actionHandler(e)}}dispose(){this._toDispose.dispose()}}let ajt=0;const cjt="commenteditordecoration";let Oxe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=n,this._scopedInstatiationService=o,this._contextKeyService=r,this._commentMenus=a,this._commentOptions=c,this._pendingComment=l,this._parentThread=d,this._actionRunDelegate=u,this.commentService=f,this.keybindingService=m,this.hoverService=v,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=W5,this.form=re(t,fe(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(AW,this.form,AW.getEditorOptions(p),r,this._parentThread)),this.commentEditorIsEmpty=x_.commentIsEmpty.bindTo(this._contextKeyService),this.commentEditorIsEmpty.set(!this._pendingComment),this.initialize(h)}async initialize(e){const t=this._commentThread.comments&&this._commentThread.comments.length>0,i=ar()+"-"+(t?this._commentThread.threadId:++ajt),n=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=N.from({scheme:pe.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${n}`});const r=this.commentService.getCommentController(this.owner);r&&(o=o.with({authority:r.id}));const a=await this.textModelService.createModelReference(o);a.object.textEditorModel.setValue(this._pendingComment||""),this._register(a),this.commentEditor.setModel(a.object.textEditorModel),this.calculateEditorHeight(),this._register(a.object.textEditorModel.onDidChangeContent(()=>{this.setCommentEditorDecorations(),this.commentEditorIsEmpty?.set(!this.commentEditor.getValue()),this.calculateEditorHeight()&&(this.commentEditor.layout({height:this._editorHeight,width:this.commentEditor.getLayoutInfo().width}),this.commentEditor.render(!0))})),this.createTextModelListener(this.commentEditor,this.form),this.setCommentEditorDecorations(),this._pendingComment?this.expandReplyArea():t?this.createReplyButton(this.commentEditor,this.form):e&&this._commentThread.comments&&this._commentThread.comments.length===0&&this.expandReplyArea(),this._error=re(this.form,fe(".validation-error.hidden"));const c=re(this.form,fe(".form-actions"));this._formActions=re(c,fe(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=re(c,fe(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=YZe(this._parentEditor,this.commentEditor,this._editorHeight);return e!==this._editorHeight?(this._editorHeight=e,!0):!1}updateCommentThread(e){const t=this.commentEditor.hasTextFocus(),i=!this._commentThread.comments?.length&&!e.comments?.length;this._reviewThreadReplyButton||this.createReplyButton(this.commentEditor,this.form),this._commentThread.comments&&this._commentThread.comments.length===0&&!i&&this.expandReplyArea(),t&&this.commentEditor.focus()}getPendingComment(){const e=this.commentEditor.getModel();if(e&&e.getValueLength()>0)return e.getValue()}setPendingComment(e){this._pendingComment=e,this.expandReplyArea(),this.commentEditor.setValue(e)}layout(e){this.commentEditor.layout({height:this._editorHeight,width:e-54})}focusIfNeeded(){!this._commentThread.comments||!this._commentThread.comments.length?this.commentEditor.focus():(this.commentEditor.getModel()?.getValueLength()??0)>0&&this.expandReplyArea()}focusCommentEditor(){this.commentEditor.focus()}expandReplyAreaAndFocusCommentEditor(){this.expandReplyArea(),this.commentEditor.focus()}isCommentEditorFocused(){return this.commentEditor.hasWidgetFocus()}updateCanReply(){this._commentThread.canReply?this.form.style.display="block":this.form.style.display="none"}async submitComment(){await this._commentFormActions?.triggerDefaultAction(),this._pendingComment=void 0}setCommentEditorDecorations(){const t=this._commentThread.comments&&this._commentThread.comments.length>0?this._commentOptions?.placeHolder||g(8268,"Reply..."):this._commentOptions?.placeHolder||g(8269,"Type a new comment");this.commentEditor.updateOptions({placeholder:t})}createTextModelListener(e,t){this._commentThreadDisposables.push(e.onDidFocusEditorWidget(()=>{this._commentThread.input={uri:e.getModel().uri,value:e.getValue()},this.commentService.setActiveEditingCommentThread(this._commentThread),this.commentService.setActiveCommentAndThread(this.owner,{thread:this._commentThread})})),this._commentThreadDisposables.push(e.getModel().onDidChangeContent(()=>{const i=e.getValue();if(this._commentThread.input&&this._commentThread.input.uri===e.getModel().uri&&this._commentThread.input.value!==i){const n=this._commentThread.input;n.value=i,this._commentThread.input=n}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const n=this._commentThread,o=e.getModel();n.input&&o&&n.input.uri!==o.uri||i&&e.getValue()!==i.value&&(e.setValue(i.value),i.value===""&&(this._pendingComment="",t.classList.remove("expand"),e.getDomNode().style.outline="",this._error.textContent="",this._error.classList.add("hidden")))}))}createCommentWidgetFormActions(e,t){const i=this._commentMenus.getCommentThreadActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions.setActions(i)})),this._commentFormActions=new R$(this.keybindingService,this._contextKeyService,e,async n=>{await this._actionRunDelegate?.(),await n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.CommentThreadReply}),this.hideReplyArea()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e,t){const i=this._commentMenus.getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions.setActions(i)})),this._commentEditorActions=new R$(this.keybindingService,this._contextKeyService,e,async n=>{this._actionRunDelegate?.(),n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.CommentThreadReply}),this.focusCommentEditor()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}get isReplyExpanded(){return this.form.classList.contains("expand")}expandReplyArea(){this.isReplyExpanded||(this.form.classList.add("expand"),this.commentEditor.focus(),this.commentEditor.layout())}clearAndExpandReplyArea(){this.isReplyExpanded||(this.commentEditor.setValue(""),this.expandReplyArea())}hideReplyArea(){const e=this.commentEditor.getDomNode();e&&(e.style.outline=""),this.commentEditor.setValue(""),this._pendingComment="",this.form.classList.remove("expand"),this._error.textContent="",this._error.classList.add("hidden")}createReplyButton(e,t){this._reviewThreadReplyButton=re(t,fe(`button.review-thread-reply-button.${ZS}`)),this._register(this.hoverService.setupManagedHover(Pr("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(8268,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(8268,"Reply..."),this._register(ue(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(ue(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),bt(this._commentThreadDisposables)}};Oxe=D([_(12,eE),_(13,Te),_(14,Ut),_(15,ec),_(16,fn)],Oxe);const Joe=class Joe extends rn{constructor(e,t){super(Joe.ID,t||g(11548,"Pick Reactions..."),"toggle-reactions",!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return this.toggleDropdownMenu(),Promise.resolve(!0)}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};Joe.ID="toolbar.toggle.pickReactions";let n1=Joe;class ljt extends Jy{constructor(e){super(null,e,{})}updateLabel(){if(!this.label)return;const e=this.action;if(e.class&&this.label.classList.add(e.class),e.icon){const t=re(this.label,fe(".reaction-icon")),i=N.revive(e.icon);t.style.backgroundImage=Zu(i)}else{const t=re(this.label,fe("span.reaction-label"));t.innerText=e.label}if(e.count){const t=re(this.label,fe("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(11549,"Toggle reaction, "):"";if(e.count===void 0)return g(11550,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(11551,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(11552,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(11553,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(11554,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const Xoe=class Xoe extends rn{constructor(e,t="",i="",n=!0,o,r,a,c){super(Xoe.ID,t,i,n,o),this.reactors=r,this.icon=a,this.count=c}};Xoe.ID="toolbar.toggle.reaction";let Bxe=Xoe;class z8e extends $_{async runAction(e,t){await e.run(...t)}}let Wxe=class extends V{get domNode(){return this._domNode}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=n,this.owner=o,this.resource=r,this.parentThread=a,this.markdownRenderer=c,this.instantiationService=l,this.commentService=d,this.notificationService=h,this.contextMenuService=u,this.configurationService=p,this.hoverService=m,this.accessibilityService=v,this.keybindingService=b,this.textModelService=w,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=W5,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=fe("div.review-comment"),this._contextKeyService=this._register(f.createScoped(this._domNode)),this._commentContextValue=x_.commentContext.bindTo(this._contextKeyService),this.comment.contextValue&&this._commentContextValue.set(this.comment.contextValue),this._commentMenus=this.commentService.getCommentMenus(this.owner),this._domNode.tabIndex=-1,this._avatar=re(this._domNode,fe("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=re(this._domNode,fe(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",ZS),p.getValue(jce)?.maxHeight!==!1&&this._body.classList.add("comment-body-max-height"),this.createScroll(this._commentDetailsContainer,this._body),this.updateCommentBody(this.comment.body),this.comment.commentReactions&&this.comment.commentReactions.length&&this.comment.commentReactions.filter(y=>!!y.count).length&&this.createReactionsContainer(this._commentDetailsContainer),this._domNode.setAttribute("aria-label",`${i.userName}, ${this.commentBodyValue}`),this._domNode.setAttribute("role","treeitem"),this._clearTimeout=null,this._register(ue(this._domNode,ke.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(ue(this._domNode,ke.CONTEXT_MENU,y=>this.onContextMenu(y))),n&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(ue(this._domNode,ke.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new yN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)}),this._scrollableElement=this._register(new l6(t,{horizontal:Co.Visible,vertical:Co.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(n=>{n.scrollLeftChanged&&(t.scrollLeft=n.scrollLeft),n.scrollTopChanged&&(t.scrollTop=n.scrollTop)}));const i=this._register(new ii(t,"scroll")).event;this._register(i(n=>{const o=this._scrollableElement.getScrollPosition(),r=Math.abs(t.scrollLeft-o.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-o.scrollTop)<=1?void 0:t.scrollTop;(r!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),e.appendChild(this._scrollableElement.getDomNode())}updateCommentBody(e){this._body.innerText="",this._md=void 0,this._plainText=void 0,typeof e=="string"?(this._plainText=re(this._body,fe(".comment-body-plainstring")),this._plainText.innerText=e):(this._md=this.markdownRenderer.render(e).element,this._body.appendChild(this._md))}updateCommentUserIcon(e){if(this._avatar.textContent="",e){const t=re(this._avatar,fe("img.avatar"));t.src=ef.uriToBrowserUri(N.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=re(e,fe("span.timestamp-container")),this.updateTimestamp(this.comment.timestamp)}updateTimestamp(e){if(!this._timestamp)return;const t=e!==void 0?new Date(e):void 0;t?this._timestampWidget?this._timestampWidget.setTimestamp(t):(this._timestampWidget=new Ixe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=re(e,fe(`div.comment-title.${ZS}`)),i=re(t,fe("comment-header-info")),n=re(i,fe("strong.author"));n.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=re(i,fe("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=re(t,fe(".comment-actions")),this.toggleToolbarHidden(!0),this.createActionsToolbar()}toggleToolbarHidden(e){e&&!this.accessibilityService.isScreenReaderOptimized()?this._actionsToolbarContainer.classList.add("hidden"):this._actionsToolbarContainer.classList.remove("hidden")}getToolbarActions(e){const t=e.getActions({shouldForwardArgs:!0}),o={primary:[],secondary:[]};return djt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:ws.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:ws.CommentThread}]}createToolbar(){this.toolbar=new VYe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===n1.ID?new sA(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,n)=>this.actionViewItemProvider(i,n),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>vb.RIGHT}):this.actionViewItemProvider(e,t),orientation:F_.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new z8e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const r=this.createReactionPicker(this.comment.commentReactions||[]);e.push(r)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(r=>{const{primary:a,secondary:c}=this.getToolbarActions(i);!this.toolbar&&(a.length||c.length)&&this.createToolbar(),this.toolbar.setActions(a,c)}));const{primary:n,secondary:o}=this.getToolbarActions(i);e.push(...n),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===n1.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===Bxe.ID?new ljt(e):e instanceof Sc?this.instantiationService.createInstance(Lb,e,{hoverDelegate:t.hoverDelegate}):e instanceof Ty?this.instantiationService.createInstance(_3,e,t):new Jy({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new n1(()=>{n?.show()},g(11540,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new rn(`reaction.command.${o.label}`,`${o.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,o)}catch(r){const a=r.message?g(11541,"Toggling the comment reaction failed: {0}.",r.message):g(11542,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const n=new sA(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===n1.ID?n:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>vb.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=re(e,fe("div.comment-reactions")),this._reactionsActionBar=new hd(this._reactionActionsContainer,{actionViewItemProvider:(i,n)=>i.id===n1.ID?new sA(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>vb.RIGHT}):this.actionViewItemProvider(i,n)}),this._register(this._reactionsActionBar),this.commentService.hasReactionHandler(this.owner)){const i=this.createReactionPicker(this.comment.commentReactions||[]);this._reactionsActionBar.push(i,{label:!1,icon:!0})}}get commentBodyValue(){return typeof this.comment.body=="string"?this.comment.body:this.comment.body.value}async createCommentEditor(e){const t=re(e,fe(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(AW,t,AW.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=N.from({scheme:pe.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),n=await this.textModelService.createModelReference(i);this._commentEditorModel=n,this._commentEditor.setModel(this._commentEditorModel.object.textEditorModel),this._commentEditor.setValue(this.pendingEdit??this.commentBodyValue),this.pendingEdit=void 0,this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus(),Ll(ct(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const o=this._commentEditorModel.object.textEditorModel.getLineCount(),r=this._commentEditorModel.object.textEditorModel.getLineLength(o)+1;this._commentEditor.setSelection(new dt(o,r,o,r));const a=this.commentThread;a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment}),this._commentEditorDisposables.push(this._commentEditor.onDidFocusEditorWidget(()=>{a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})})),this._commentEditorDisposables.push(this._commentEditor.onDidChangeModelContent(c=>{if(a.input&&this._commentEditor&&this._commentEditor.getModel().uri===a.input.uri){const l=this._commentEditor.getValue();if(l!==a.input.value){const d=a.input;d.value=l,a.input=d,this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})}}})),this.calculateEditorHeight(),this._register(this._commentEditorModel.object.textEditorModel.onDidChangeContent(()=>{this._commentEditor&&this.calculateEditorHeight()&&(this._commentEditor.layout({height:this._editorHeight,width:this._commentEditor.getLayoutInfo().width}),this._commentEditor.render(!0))})),this._register(this._commentEditor),this._register(this._commentEditorModel)}calculateEditorHeight(){if(this._commentEditor){const e=YZe(this.parentEditor,this._commentEditor,this._editorHeight);if(e!==this._editorHeight)return this._editorHeight=e,!0}return!1}getPendingEdit(){const e=this._commentEditor?.getModel();if(e&&e.getValueLength()>0)return e.getValue()}removeCommentEditor(){this.isEditing=!1,this._editAction&&(this._editAction.enabled=!0),this._body.classList.remove("hidden"),this._commentEditorModel?.dispose(),bt(this._commentEditorDisposables),this._commentEditorDisposables=[],this._commentEditor?.dispose(),this._commentEditor=null,this._commentEditContainer.remove()}layout(e){const t=e!==void 0?e-72:this._commentEditor?.getLayoutInfo().width??0;this._commentEditor?.layout({width:t,height:this._editorHeight});const i=this._body.scrollWidth,n=ZV(this._body),o=this._body.scrollHeight,r=cTe(this._body)+4;this._scrollableElement.setScrollDimensions({width:n,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=re(this._commentDetailsContainer,fe(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=re(this._commentEditContainer,fe(".form-actions")),t=re(e,fe(".other-actions"));this.createCommentWidgetFormActions(t);const i=re(e,fe(".editor-actions"));this.createCommentWidgetEditorActions(i)}createCommentWidgetFormActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions?.setActions(i)})),this._commentFormActions=new R$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.CommentThreadNode}),this.removeCommentEditor()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions?.setActions(i)})),this._commentEditorActions=new R$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.CommentThreadNode}),this._commentEditor?.focus()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}setFocus(e,t=!1){e?(this._domNode.focus(),this.toggleToolbarHidden(!1),this._actionsToolbarContainer.classList.add("tabfocused"),this._domNode.tabIndex=0,this.comment.mode===T2.Editing&&this._commentEditor?.focus()):(this._actionsToolbarContainer.classList.contains("tabfocused")&&!this._actionsToolbarContainer.classList.contains("mouseover")&&(this.toggleToolbarHidden(!0),this._domNode.tabIndex=-1),this._actionsToolbarContainer.classList.remove("tabfocused"))}registerActionBarListeners(e){this._register(ue(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(ue(this._domNode,"mouseleave",()=>{e.classList.contains("mouseover")&&!e.classList.contains("tabfocused")&&this.toggleToolbarHidden(!0),e.classList.remove("mouseover")}))}async update(e){e.body!==this.comment.body&&this.updateCommentBody(e.body),this.comment.userIconPath&&e.userIconPath&&N.from(this.comment.userIconPath).toString()!==N.from(e.userIconPath).toString()&&this.updateCommentUserIcon(e.userIconPath);const t=e.mode!==void 0&&e.mode!==this.comment.mode;this.comment=e,t&&(e.mode===T2.Editing?await this.switchToEditMode():this.removeCommentEditor()),e.label?this._isPendingLabel.innerText=e.label:this._isPendingLabel.innerText="",this._reactionActionsContainer?.remove(),this._reactionsActionBar?.clear(),this.comment.commentReactions&&this.comment.commentReactions.some(i=>!!i.count)&&this.createReactionsContainer(this._commentDetailsContainer),this.comment.contextValue?this._commentContextValue.set(this.comment.contextValue):this._commentContextValue.reset(),this.comment.timestamp&&this.updateTimestamp(this.comment.timestamp)}onContextMenu(e){const t=new Eh(ct(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:_e.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new z8e,getActionsContext:()=>this.commentNodeContext})}focus(){this.domNode.focus(),this._clearTimeout||(this.domNode.classList.add("focus"),this._clearTimeout=setTimeout(()=>{this.domNode.classList.remove("focus")},3e3))}dispose(){super.dispose(),bt(this._commentEditorDisposables)}};Wxe=D([_(8,we),_(9,eE),_(10,bi),_(11,lr),_(12,Le),_(13,Te),_(14,ec),_(15,mr),_(16,Ut),_(17,fn)],Wxe);function djt(s,e,t,i=n=>n==="navigation"){for(const n of s){let[o,r]=n;if(i(o))(Array.isArray(e)?e:e.primary).unshift(...r);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Ar),a.push(...r)}}}let Hxe=class extends V{get length(){return this._commentThread.comments?this._commentThread.comments.length:0}get activeComment(){return this._commentElements.filter(e=>e.isEditing)[0]}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=n,this._options=o,this._commentThread=r,this._pendingEdits=a,this._scopedInstatiationService=c,this._parentCommentThreadWidget=l,this.commentService=d,this.openerService=h,this.languageService=u,this._commentElements=[],this._focusedComment=void 0,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._commentDisposable=new mo,this._register(ue(n,ke.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new Y_(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}ensureFocusIntoNewEditingComment(){this._commentElements.length===1&&this._commentElements[0].isEditing&&this._commentElements[0].setFocus(!0)}async display(){if(this._commentsElement=re(this.container,fe("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(ue(this._commentsElement,ke.KEY_DOWN,e=>{const t=new En(e);if((t.equals(S.UpArrow)||t.equals(S.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=n=>{if(this._focusedComment===void 0&&n>=0)return 0;if(this._focusedComment===void 0&&n<0)return this._commentElements.length-1;const o=this._focusedComment+n;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(S.UpArrow)?i(-1):i(1))}})),this._commentDisposable.clearAndDisposeAll(),this._commentElements=[],this._commentThread.comments)for(const e of this._commentThread.comments){const t=this.createNewCommentNode(e);this._commentElements.push(t),this._commentsElement.appendChild(t.domNode),e.mode===T2.Editing&&await t.switchToEditMode()}this._resizeObserver=new MutationObserver(this._refresh.bind(this)),this._resizeObserver.observe(this.container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}_refresh(){const e=z_(this.container);this._onDidResize.fire(e)}getDimensions(){return z_(this.container)}layout(e){this._commentElements.forEach(t=>{t.layout(e)})}getPendingEdits(){const e={};return this._commentElements.forEach(t=>{if(t.isEditing){const i=t.getPendingEdit();i&&(e[t.comment.uniqueIdInThread]=i)}}),e}getCommentCoords(e){const t=this._commentElements.filter(i=>i.comment.uniqueIdInThread===e);if(t&&t.length){const i=Cr(this._commentElements[0].domNode),n=Cr(t[0].domNode);return{thread:i,comment:n}}}async updateCommentThread(e,t){const i=this._commentElements.length,n=e.comments?e.comments.length:0,o=[],r=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(r.push(d),o.push(this._commentElements[d]))}for(let d=o.length-1;d>=0;d--){const h=o[d];this._commentDisposable.deleteAndDispose(h),this._commentElements.splice(r[d],1),h.domNode.remove()}let a=null;const c=[],l=[];for(let d=n-1;d>=0;d--){const h=e.comments[d],u=this._commentElements.filter(f=>f.comment.uniqueIdInThread===h.uniqueIdInThread);if(u.length)a=u[0].domNode,c.unshift(u[0]);else{const f=this.createNewCommentNode(h);c.unshift(f),a?(this._commentsElement.insertBefore(f.domNode,a),a=f.domNode):(this._commentsElement.appendChild(f.domNode),a=f.domNode),h.mode===T2.Editing&&(await f.switchToEditMode(),l.push(f))}}if(this._commentThread=e,this._commentElements=c,l.length){const d=this._commentElements.indexOf(l[l.length-1]);this._focusedComment=d}this._updateAriaLabel(),t||this._setFocusedComment(this._focusedComment)}_updateAriaLabel(){this._commentThread.isDocumentCommentThread()?this._commentThread.range?this._commentsElement.ariaLabel=g(11501,"Comment thread with {0} comments on lines {1} through {2}. {3}.",this._commentThread.comments?.length,this._commentThread.range.startLineNumber,this._commentThread.range.endLineNumber,this._commentThread.label):this._commentsElement.ariaLabel=g(11502,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(11503,"Comment thread with {0} comments. {1}.",this._commentThread.comments?.length,this._commentThread.label)}_setFocusedComment(e){this._focusedComment!==void 0&&this._commentElements[this._focusedComment]?.setFocus(!1),this._commentElements.length===0||e===void 0?this._focusedComment=void 0:(this._focusedComment=Math.min(e,this._commentElements.length-1),this._commentElements[this._focusedComment].setFocus(!0))}createNewCommentNode(e){const t=this._scopedInstatiationService.createInstance(Wxe,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer),i=new Z;return i.add(t.onDidClick(n=>this._setFocusedComment(this._commentElements.findIndex(o=>o.comment.uniqueIdInThread===n.comment.uniqueIdInThread)))),i.add(t),this._commentDisposable.set(t,i),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.dispose()}};Hxe=D([_(9,eE),_(10,Ao),_(11,xi)],Hxe);const hjt=oi("review-comment-collapse",ve.chevronUp,g(11504,"Icon to collapse a review comment.")),ujt="expand-review-action "+We.asClassName(hjt);class gjt extends V{constructor(e,t,i,n,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=n,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=fe(".head"),e.appendChild(this._headElement),this._register(Ee(()=>this._headElement.remove())),this._fillHead()}_fillHead(){const e=re(this._headElement,fe(".review-title"));this._headingLabel=re(e,fe("span.filename")),this.createThreadLabel();const t=re(this._headElement,fe(".review-actions"));this._actionbarWidget=new hd(t,{actionViewItemProvider:WN.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new rn("review.expand",g(11505,"Collapse"),ujt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(n=>{this.setActionBarActions(i)})),this._register(ue(this._headElement,ke.CONTEXT_MENU,n=>this.onContextMenu(n))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,n])=>[...i,...n],[]);this._actionbarWidget.clear(),this._actionbarWidget.push([...t,this._collapseAction],{label:!1,icon:!0})}updateCommentThread(e){this._commentThread=e,this._actionbarWidget.context=this._commentThread,this.createThreadLabel()}createThreadLabel(){let e;e=this._commentThread.label,e===void 0&&(this._commentThread.comments&&this._commentThread.comments.length||(e=g(11506,"Start discussion"))),e&&(this._headingLabel.textContent=fT(e),this._headingLabel.setAttribute("aria-label",e))}updateHeight(e){this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height}onContextMenu(e){const t=this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({shouldForwardArgs:!0}).map(n=>n[1]).flat();if(!t.length)return;const i=new Eh(ct(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new $_,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:ws.CommentThread})})}}let Uxe=class extends V{constructor(e,t,i,n,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=n,this._actionRunDelegate=o,this._keybindingService=r,this._container=re(e,fe(".comment-additional-actions")),re(this._container,fe(".section-separator")),this._buttonBar=re(this._container,fe(".button-bar")),this._createAdditionalActions(this._buttonBar)}_showMenu(){this._container?.classList.remove("hidden")}_hideMenu(){this._container?.classList.add("hidden")}_enableDisableMenu(e){const t=e.getActions({shouldForwardArgs:!0});for(const i of t){const[,n]=i;for(const o of n){if(o.enabled){this._showMenu();return}for(const r of o.actions??[])if(r.enabled){this._showMenu();return}}}this._hideMenu()}_createAdditionalActions(e){const t=this._commentMenus.getCommentThreadAdditionalActions(this._contextKeyService);this._register(t),this._register(t.onDidChange(()=>{this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)})),this._commentFormActions=new R$(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:ws.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};Uxe=D([_(5,Ut)],Uxe);var lj;function fjt(s,e,t){const i=new Set;return jr(...s.map((n,o)=>jr(n.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),n.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const _Pe=new Q("navigableContainerFocused",!1);var tM;let fN=(tM=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=_Pe.bindTo(e),lj.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),lj.INSTANCE=void 0}get debugEnabled(){return this.configurationService.getValue("workbench.navigibleContainer.enableDebug")}log(e,...t){this.debugEnabled&&this.logService.debug(e,...t)}static register(e){const t=this.INSTANCE;return t?(t.containers.add(e),t.log("NavigableContainerManager.register",e.name),jr(fjt(e.focusNotifiers,i=>{i?(t.log("NavigableContainerManager.focus",e.name),t.focused.set(!0),t.lastContainer=e):(t.log("NavigableContainerManager.blur",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0))},(i,n)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,n)}),Ee(()=>{t.containers.delete(e),t.log("NavigableContainerManager.unregister",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0)}))):V.None}static getActive(){return this.INSTANCE?.lastContainer}},lj=tM,tM.ID="workbench.contrib.navigableContainerManager",tM);fN=lj=D([_(0,Le),_(1,Ge),_(2,Te)],fN);function nst(s){return fN.register(s)}Qu(fN.ID,fN,yc.BlockStartup);So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:Ae.WorkbenchContrib,when:he.and(_Pe,he.or(Sae?.negate(),kDt)),primary:U.CtrlCmd|S.UpArrow,handler:()=>{fN.getActive()?.focusPreviousWidget()}});So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:Ae.WorkbenchContrib,when:he.and(_Pe,he.or(Sae?.negate(),IDt)),primary:U.CtrlCmd|S.DownArrow,handler:()=>{fN.getActive()?.focusNextWidget()}});let Vxe=class extends V{get commentThread(){return this._commentThread}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=n,this._contextKeyService=o,this._scopedInstantiationService=r,this._commentThread=a,this._pendingComment=c,this._pendingEdits=l,this._markdownOptions=d,this._commentOptions=h,this._containerDelegate=u,this.commentService=f,this.configurationService=m,this._keybindingService=v,this._commentThreadDisposables=[],this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._threadIsEmpty=x_.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=x_.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new gjt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const b=fe(".body");e.appendChild(b),this._register(Ee(()=>b.remove()));const w=this._register(Ac(b));this._register(nst({name:"commentThreadWidget",focusNotifiers:[w],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(w.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(w.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(A=>{A.affectsConfiguration(vr.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(Hxe,this._parentEditor,this._owner,this._parentResourceUri,b,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=gl(this.container),this._commentThreadContextValue=x_.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const y=x_.commentControllerContext.bindTo(this._contextKeyService),C=this.commentService.getCommentController(this._owner);C?.contextValue&&y.set(C.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(11238,"Comment"),t;this.configurationService.getValue(vr.Comments)&&(t=this._keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(11239,"{0}, use ({1}) for accessibility help",e,t):e=g(11240,"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",e),this._body.container.ariaLabel=e}updateCurrentThread(e,t){e||t?this.commentService.setCurrentCommentThread(this.commentThread):this.commentService.setCurrentCommentThread(void 0)}currentThreadListeners(){let e=!1,t=!1;this._register(ue(this.container,ke.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(ue(this.container,ke.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===Lc.Expanded&&this._commentThreadState===ru.Unresolved&&e.state===ru.Resolved;this._commentThreadState=e.state,this._commentThread=e,bt(this._commentThreadDisposables),this._commentThreadDisposables=[],this._bindCommentThreadListeners(),await this._body.updateCommentThread(e,this._commentReply?.isCommentEditorFocused()??!1),this._threadIsEmpty.set(!this._body.length),this._header.updateCommentThread(e),this._commentReply?.updateCommentThread(e),this._commentThread.contextValue?this._commentThreadContextValue.set(this._commentThread.contextValue):this._commentThreadContextValue.reset(),t&&this.configurationService.getValue(jce).collapseOnResolve&&this.collapse()}async display(e,t){const i=Math.max(23,Math.ceil(e*1.2));this._header.updateHeight(i),await this._body.display(),this._commentThread.canReply&&this._createCommentForm(t),this._createAdditionalActions(),this._register(this._body.onDidResize(n=>{this._refresh(n)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),bt(this._commentThreadDisposables),this.updateCurrentThread(!1,!1)}_bindCommentThreadListeners(){this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(()=>{this._commentReply?this._commentReply.updateCanReply():this._commentThread.canReply&&this._createCommentForm(!1)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.updateCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(e=>{this._header.createThreadLabel()}))}_createCommentForm(e){this._commentReply=this._scopedInstantiationService.createInstance(Oxe,this._owner,this._body.container,this._parentEditor,this._commentThread,this._scopedInstantiationService,this._contextKeyService,this._commentMenus,this._commentOptions,this._pendingComment,this,e,this._containerDelegate.actionRunner),this._register(this._commentReply)}_createAdditionalActions(){this._additionalActions=this._scopedInstantiationService.createInstance(Uxe,this._body.container,this._commentThread,this._contextKeyService,this._commentMenus,this._containerDelegate.actionRunner),this._register(this._additionalActions)}getCommentCoords(e){return this._body.getCommentCoords(e)}getPendingEdits(){return this._body.getPendingEdits()}getPendingComment(){if(this._commentReply)return this._commentReply.getPendingComment()}setPendingComment(e){this._pendingComment=e,this._commentReply?.setPendingComment(e)}getDimensions(){return this._body.getDimensions()}layout(e){this._body.layout(e),e!==void 0&&this._commentReply?.layout(e)}ensureFocusIntoNewEditingComment(){this._body.ensureFocusIntoNewEditingComment()}focusCommentEditor(){this._commentReply?.expandReplyAreaAndFocusCommentEditor()}focus(){this._body.focus()}async submitComment(){const e=this._body.activeComment;if(e)return e.submitComment();if((this._commentReply?.getPendingComment()?.length??0)>0)return this._commentReply?.submitComment()}collapse(){this._containerDelegate.collapse()}applyTheme(e,t){const i=[];i.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${Jnt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${Xnt}) }`);const n=e.getColor(ITe);n&&i.push(`.review-widget .body .comment-body a { color: ${n} }`);const o=e.getColor(tft);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(mp);r&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${r}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${r}; }`));const a=e.getColor(ift);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(nft);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(KRe);l&&i.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${l}; }`);const d=e.getColor(wt);d&&(i.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${d}; }`),i.push(`.review-widget .body .monaco-editor { outline: 1px solid ${d}; }`));const h=e.getColor(oqe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(nqe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(sqe);f&&i.push(`.review-widget .body .comment-form .validation-error { color: ${f}; }`);const p="--comment-thread-editor-font-family",m="--comment-thread-editor-font-size",v="--comment-thread-editor-font-weight";this.container?.style.setProperty(p,t.fontFamily),this.container?.style.setProperty(m,`${t.fontSize}px`),this.container?.style.setProperty(v,t.fontWeight),i.push(`.review-widget .body code { font-family: var(${p}); font-weight: var(${v}); }`),this._styleElement.textContent=i.join(` -`),this._commentReply?.setCommentEditorDecorations()}};r0e=D([_(12,sD),_(13,Vr),_(14,Re),_(15,ti)],r0e);function g9e(n,e){return XKt(n,e)??e.getColor(GPe)}var Ty;(function(n){n[n.None=0]="None",n[n.Widget=1]="Widget",n[n.Editor=2]="Editor"})(Ty||(Ty={}));function fYt(n){const e=n.target.range;if(!e||!n.event.leftButton||n.target.type!==Mt.GUTTER_LINE_DECORATIONS)return null;const t=n.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function pYt(n,e){if(!n)return null;const{lineNumber:t}=n;return e.target.range?t:null}let a0e=class extends VPe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,s,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=s,this._pendingEdits=o,this.themeService=a,this.commentService=c,this.configurationService=d,this._onDidClose=new I,this._onDidCreateThread=new I,this._globalToDispose=new Z,this._commentThreadDisposables=[],this._contextKeyService=l.createScoped(this.domNode),this._scopedInstantiationService=r.createChild(new Dl([Pe,this._contextKeyService]));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=s?zl.Expanded:i.initialCollapsibleState,i.initialCollapsibleState=this._initialCollapsibleState,this._commentThreadDisposables=[],this.create(),this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme,this)),this._globalToDispose.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.fontInfo)&&this._applyTheme(this.themeService.getColorTheme())})),this._applyTheme(this.themeService.getColorTheme())}get onDidClose(){return this._onDidClose.event}get onDidCreateThread(){return this._onDidCreateThread.event}getPosition(){if(this.position)return this.position;if(this._commentGlyph)return this._commentGlyph.getPosition().position??void 0}revealRange(){}reveal(e,t=Ty.None){if(this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2),e!==void 0){const s=this.editor.getLayoutInfo().height,o=this._commentThreadWidget.getCommentCoords(e);if(o){let r=1;if(this._commentThread.range){const a=o.thread,c=o.comment;r=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-s/2+c.top-a.top}this.editor.setScrollTop(r),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor();return}}const i=this._commentThread.range?new O(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new O(1,1,1,1);this.editor.revealRangeInCenter(i),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor()}getPendingComments(){return{newComment:this._commentThreadWidget.getPendingComment(),edits:this._commentThreadWidget.getPendingEdits()}}setPendingComment(e){this._pendingComment=e,this.expand(),this._commentThreadWidget.setPendingComment(e)}_fillContainer(e){this.setCssClass("review-widget"),this._commentThreadWidget=this._scopedInstantiationService.createInstance(r0e,e,this.editor,this._uniqueOwner,this.editor.getModel().uri,this._contextKeyService,this._scopedInstantiationService,this._commentThread,this._pendingComment,this._pendingEdits,{editor:this.editor,codeBlockFontSize:"",codeBlockFontFamily:this.configurationService.getValue("editor").fontFamily||Gh.fontFamily},this._commentOptions,{actionRunner:async()=>{if(!this._commentThread.comments||!this._commentThread.comments.length){const t=this.getPosition();if(t){const i=this._commentThread.range;if(!i)return;let s;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;s=new O(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else s=new O(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,s)}}},collapse:()=>{this.collapse()}}),this._disposables.add(this._commentThreadWidget)}arrowPosition(e){if(e)return{lineNumber:e.endLineNumber,column:e.endLineNumber===e.startLineNumber?(e.startColumn+e.endColumn+1)/2:1}}deleteCommentThread(){this.dispose(),this.commentService.disposeCommentThread(this.uniqueOwner,this._commentThread.threadId)}collapse(){this._commentThread.collapsibleState=zl.Collapsed}expand(){this._commentThread.collapsibleState=zl.Expanded}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=zl.Collapsed:this._commentThread.collapsibleState=zl.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(s=>s.dispose()),this._commentThread=e,this._commentThreadDisposables=[],this.bindCommentThreadListeners()),await this._commentThreadWidget.updateCommentThread(e);const t=this._commentThread.range?.endLineNumber??1;let i=!1;this._commentGlyph&&(this._commentGlyph.setThreadState(e.state),this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t))),i&&this._isExpanded||this._commentThread.collapsibleState===zl.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==zl.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new FG(this.editor,e?.endLineNumber??-1),this._commentGlyph.setThreadState(this._commentThread.state)),await this._commentThreadWidget.display(this.editor.getOption(x.lineHeight),t),this._disposables.add(this._commentThreadWidget.onDidResize(i=>{this._refresh(i)})),(this._commentThread.collapsibleState===zl.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.reveal(),this.bindCommentThreadListeners()}bindCommentThreadListeners(){if(this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.update(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(e=>{const t=this._commentThread.range?.startLineNumber??1;let i=!1;this._commentGlyph&&this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t)),i&&this._isExpanded&&this.show(this.arrowPosition(this._commentThread.range),2)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(e=>{if(e===zl.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2);return}if(e===zl.Collapsed&&this._isExpanded){this.hide();return}})),this._initialCollapsibleState===void 0){const e=this._commentThread.onDidChangeInitialCollapsibleState(t=>{this._initialCollapsibleState=t,this._commentThread.collapsibleState=this._initialCollapsibleState,e.dispose()});this._commentThreadDisposables.push(e)}this._commentThreadDisposables.push(this._commentThread.onDidChangeState(()=>{const e=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(prt,`${e}`),this.container?.style.setProperty(mrt,`${e.transparent(.1)}`)}))}async submitComment(){return this._commentThreadWidget.submitComment()}_refresh(e){if(this._isExpanded===void 0&&e.height===0&&e.width===0){this.commentThread.collapsibleState=zl.Collapsed;return}if(this._isExpanded){this._commentThreadWidget.layout();const t=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),i=this.editor.getOption(x.lineHeight),s=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+s+o+8)/i);if(this._viewZone?.heightInLines===r)return;const a=this.getPosition();this._viewZone&&a&&a.lineNumber!==this._viewZone.afterLineNumber&&this._viewZone.afterLineNumber!==0&&(this._viewZone.afterLineNumber=a.lineNumber);const c=M_.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({arrowColor:t,frameColor:t});const i=this.editor.getOption(x.fontInfo);this._commentThreadWidget.applyTheme(e,i)}show(e,t){const i=this._commentGlyph?.getPosition();let s=O.isIRange(e)?e:e?O.fromPositions(e):void 0;if(i?.position&&s&&i.position.lineNumber!==s.endLineNumber){const o=i.position.lineNumber-s.endLineNumber;s=new O(s.startLineNumber+o,s.startColumn,s.endLineNumber+o,s.endColumn)}this._isExpanded=!0,super.show(s??new O(0,0,0,0),t),this._commentThread.collapsibleState=zl.Expanded,this._refresh(this._commentThreadWidget.getDimensions())}hide(){this._isExpanded&&(this._isExpanded=!1,this.editor.hasWidgetFocus()&&this.editor.focus(),(!this._commentThread.comments||!this._commentThread.comments.length)&&this.deleteCommentThread()),super.hide()}dispose(){super.dispose(),this._commentGlyph&&(this._commentGlyph.dispose(),this._commentGlyph=void 0),this._globalToDispose.dispose(),this._commentThreadDisposables.forEach(e=>e.dispose()),this._onDidClose.fire(void 0)}};a0e=D([_(5,be),_(6,pn),_(7,sD),_(8,Pe),_(9,Re)],a0e);class f9e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const c9=class c9 extends ${constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=Kt.createDynamic(t);const i={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=Kt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(s=>{this.updateCurrent(s)})),this._register(e.onDidUpdateCommentThreads(()=>{this.updateCurrent(void 0)}))}updateCurrent(e){if(!this.editor||e?.resource&&e.resource?.toString()!==this.editor.getModel()?.uri.toString())return;this.currentThreadCollapseStateListener?.dispose();const t=[];if(e){const i=e.range;i&&!(i.startLineNumber===i.endLineNumber&&i.startColumn===i.endColumn)&&e.collapsibleState===zl.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(s=>{s===zl.Collapsed&&this.updateCurrent(void 0)}),t.push(new f9e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((s,o)=>s.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;St(this.threadCollapseStateListeners),this.editor=e;const s=[];for(const o of t)o.threads.forEach(r=>{if(r.isDisposed)return;const a=r.range;!a||a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn||(this.threadCollapseStateListeners.push(r.onDidChangeCollapsibleState(()=>{this.update(e,t)})),r.collapsibleState!==zl.Collapsed&&s.push(new f9e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,s),s.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){St(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};c9.description="comment-thread-range-decorator";let c0e=c9;const rB="vs/workbench/contrib/comments/browser/commentsController",mYt="editor.contrib.review";class CD{get id(){return this._decorationId}set id(e){this._decorationId=e}get range(){return{startLineNumber:this._startLineNumber,startColumn:1,endLineNumber:this._endLineNumber,endColumn:1}}constructor(e,t,i,s,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=s,this._range=o,this.options=r,this.commentingRangesInfo=a,this.isHover=c,this._startLineNumber=o.startLineNumber,this._endLineNumber=o.endLineNumber}getCommentAction(){return{extensionId:this._extensionId,label:this._label,ownerId:this._ownerId,commentingRangesInfo:this.commentingRangesInfo}}getOriginalRange(){return this._range}getActiveRange(){return this.id?this._editor.getModel().getDecorationRange(this.id):void 0}}const mW=class mW{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=Kt.createDynamic(e);const t={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=Kt.createDynamic(t);const i={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=Kt.createDynamic(i)}updateHover(e){this._editor&&this._infos&&e!==this._lastHover&&this._doUpdate(this._editor,this._infos,e),this._lastHover=e??-1}updateSelection(e,t=new O(0,0,0,0)){this._lastSelection=t.isEmpty()?void 0:t,this._lastSelectionCursor=t.isEmpty()?void 0:e,this._editor&&this._infos&&this._doUpdate(this._editor,this._infos,e,t)}update(e,t,i,s){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,s))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===FG.description)}_doUpdate(e,t,i=-1,s=this._lastSelection){if(!e.getModel())return;i=this._lastSelectionCursor??i;const r=[];for(const c of t)c.commentingRanges.ranges.forEach(l=>{const d=new O(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=s?d.intersectRanges(s):void 0;if(s&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new O(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new O(h.endLineNumber,1,h.endLineNumber,1),h=new O(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,u,this.hoverDecorationOptions,c.commentingRanges,!0));const f=Math.min(u.startLineNumber,h.startLineNumber)-1,p=d.startLineNumber<=f,m=Math.max(u.endLineNumber,h.endLineNumber)+1,v=d.endLineNumber>=m;if(p){const w=new O(l.startLineNumber,1,f,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}if(v){const w=new O(m,1,l.endLineNumber,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}}else if(d.startLineNumber<=i&&i<=d.endLineNumber){if(d.startLineNumber{this.decorationIds=c.deltaDecorations(this.decorationIds,r),r.forEach((l,d)=>l.id=this.decorationIds[d])});const a=this.commentingRangeDecorations.length-r.length;this.commentingRangeDecorations=r,a&&this._onDidChangeDecorationsCount.fire(this.commentingRangeDecorations.length)}areRangesIntersectingOrTouchingByLine(e,t){return!(e.endLineNumbero.commentingRanges.fileComments);return s?s.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const s of this.commentingRangeDecorations){const o=s.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=s.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new O(o.startLineNumbera.range.endLineNumber?o.endLineNumber:a.range.endLineNumber,o.endColumn>a.range.endColumn?o.endColumn:a.range.endColumn);t.set(r.ownerId,{range:c,action:r})}else t.set(r.ownerId,{range:o,action:r})}}const i=new Set;return Array.from(t.values()).filter(s=>i.has(s.action.ownerId)?!1:(i.add(s.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,s;if(t){s=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)s.push(this.commentingRangeDecorations[o])}else s=this.commentingRangeDecorations;for(const o of s){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=O.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new O(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return s.length>0?s[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};mW.description="commenting-range-decorator";let Noe=mW;function _Yt(n,e,t,i,s,o,r,a,c){if(!i.resource)return;n.isCommentingEnabled||n.enableCommenting(!0);const l=i.range,d=a?Ty.None:Ty.Widget,h=e.activeTextEditorControl,u=ew(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=s?.uniqueIdInThread,m=P.parse(i.resource);for(const v of u){const w=v.getModel();if(w instanceof QU&&t.extUri.isEqual(m,w.uri)){f&&Ka(v)&&Poe.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new O(1,1,1,1)}},c?Cw:wx).then(v=>{if(v){const w=v.getControl();f&&Ka(w)&&Poe.get(w)?.revealCommentThread(f,p,!0,d)}})}let Poe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=s,this.contextMenuService=o,this.quickInputService=r,this.viewsService=a,this.configurationService=c,this.editorService=d,this.keybindingService=h,this.accessibilityService=u,this.globalToDispose=new Z,this.localToDispose=new Z,this.mouseDownInfo=null,this._commentingRangeSpaceReserved=!1,this._commentingRangeAmountReserved=0,this._emptyThreadsToAddQueue=[],this._inProcessContinueOnComments=new Map,this._editorDisposables=[],this._hasRespondedToEditorChange=!1,this._commentInfos=[],this._commentWidgets=[],this._pendingNewCommentCache={},this._pendingEditsCache={},this._computePromise=null,this._activeCursorHasCommentingRange=Qv.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=Qv.activeEditorHasCommentingRange.bindTo(l),!(e instanceof oC)&&(this.editor=e,this._commentingRangeDecorator=new Noe,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new c0e(this.commentService)),this.globalToDispose.add(this.commentService.onDidDeleteDataProvider(f=>{f?(delete this._pendingNewCommentCache[f],delete this._pendingEditsCache[f]):(this._pendingNewCommentCache={},this._pendingEditsCache={}),this.beginCompute()})),this.globalToDispose.add(this.commentService.onDidSetDataProvider(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidUpdateCommentingRanges(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidSetResourceCommentInfos(async f=>{const p=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;p&&p.toString()===f.resource.toString()&&await this.setComments(f.commentInfos.filter(m=>m!==null))})),this.globalToDispose.add(this.commentService.onDidChangeCommentingEnabled(f=>{f?(this.registerEditorListeners(),this.beginCompute()):(this.tryUpdateReservedSpace(),this.clearEditorListeners(),this._commentingRangeDecorator.update(this.editor,[]),this._commentThreadRangeDecorator.update(this.editor,[]),St(this._commentWidgets),this._commentWidgets=[])})),this.globalToDispose.add(this.editor.onWillChangeModel(f=>this.onWillChangeModel(f))),this.globalToDispose.add(this.editor.onDidChangeModel(f=>this.onModelChanged())),this.globalToDispose.add(this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("diffEditor.renderSideBySide")&&this.beginCompute()})),this.onModelChanged(),this.codeEditorService.registerDecorationType("comment-controller",brt,{}),this.globalToDispose.add(this.commentService.registerContinueOnCommentProvider({provideContinueOnComments:()=>{const f=[];if(this._commentWidgets)for(const p of this._commentWidgets){const v=p.getPendingComments().newComment;if(!v)continue;let w;if(p.commentThread.comments&&p.commentThread.comments.length){const b=p.commentThread.comments[p.commentThread.comments.length-1];typeof b.body=="string"?w=b.body:w=b.body.value}v!==w&&f.push({uniqueOwner:p.uniqueOwner,uri:p.editor.getModel().uri,range:p.commentThread.range,body:v,isReply:p.commentThread.comments!==void 0&&p.commentThread.comments.length>0})}return f}})))}registerEditorListeners(){this._editorDisposables=[],this.editor&&(this._editorDisposables.push(this.editor.onMouseMove(e=>this.onEditorMouseMove(e))),this._editorDisposables.push(this.editor.onMouseLeave(()=>this.onEditorMouseLeave())),this._editorDisposables.push(this.editor.onDidChangeCursorPosition(e=>this.onEditorChangeCursorPosition(e.position))),this._editorDisposables.push(this.editor.onDidFocusEditorWidget(()=>this.onEditorChangeCursorPosition(this.editor?.getPosition()??null))),this._editorDisposables.push(this.editor.onDidChangeCursorSelection(e=>this.onEditorChangeCursorSelection(e))),this._editorDisposables.push(this.editor.onDidBlurEditorWidget(()=>this.onEditorChangeCursorSelection())))}clearEditorListeners(){St(this._editorDisposables),this._editorDisposables=[]}onEditorMouseLeave(){this._commentingRangeDecorator.updateHover()}onEditorMouseMove(e){const t=e.target.position?.lineNumber;e.event.leftButton.valueOf()&&t&&this.mouseDownInfo?this._commentingRangeDecorator.updateSelection(t,new O(this.mouseDownInfo.lineNumber,1,t,1)):this._commentingRangeDecorator.updateHover(t)}onEditorChangeCursorSelection(e){const t=this.editor?.getPosition()?.lineNumber;t&&this._commentingRangeDecorator.updateSelection(t,e?.selection)}onEditorChangeCursorPosition(e){const t=e?this.editor?.getDecorationsInRange(O.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const s of t)if(s.options.description===FG.description){i=!1;break}else s.options.description===Noe.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===mz.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=na(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computePromise.then(async e=>{await this.setComments(Vi(e)),this._computePromise=null},e=>console.log(e))}beginComputeCommentingRanges(){this._computeCommentingRangeScheduler&&(this._computeCommentingRangePromise&&(this._computeCommentingRangePromise.cancel(),this._computeCommentingRangePromise=null),this._computeCommentingRangeScheduler.trigger(()=>{const e=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return e?this.commentService.getDocumentComments(e):Promise.resolve([])}).then(e=>{if(this.commentService.isCommentingEnabled){const t=Vi(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(bt(e),null)))}static get(e){return e.getContribution(mYt)}revealCommentThread(e,t,i,s){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,s):i&&(this._computePromise?this._computePromise.then(r=>{this.revealCommentThread(e,t,!1,s)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,s)}))}collapseAll(){for(const e of this._commentWidgets)e.collapse()}expandAll(){for(const e of this._commentWidgets)e.expand()}expandUnresolved(){for(const e of this._commentWidgets)e.commentThread.state===hg.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentWidgets.sort((r,a)=>{if(e){const c=r;r=a,a=c}return r.commentThread.range===void 0?-1:a.commentThread.range===void 0?1:r.commentThread.range.startLineNumbera.commentThread.range.startLineNumber?1:r.commentThread.range.startColumna.commentThread.range.startColumn?1:0}),s=bU(i,r=>{const a=e?t.lineNumber:r.commentThread.range?.startLineNumber??0,c=e?r.commentThread.range?.startLineNumber??0:t.lineNumber,l=e?t.column:r.commentThread.range?.startColumn??0,d=e?r.commentThread.range?.startColumn??0:t.column;return a>c?!0:ad});let o;s===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[s],this.editor.setSelection(o.commentThread.range??new O(1,1,1,1)),o.reveal(void 0,Ty.Widget)}previousCommentThread(){this._findNearestCommentThread(!0)}_findNearestCommentingRange(e){if(!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentingRangeDecorator.getNearestCommentingRange(t,e);if(i){const s=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(s),this.editor.revealLineInCenterIfOutsideViewport(s.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const s=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;s&&o&&Cu(s===o?g(rB,0,"Line {0}",s):g(rB,1,"Lines {0} to {1}",s,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),St(this._editorDisposables),St(this._commentWidgets),this.editor=null}onWillChangeModel(e){e.newModelUrl&&this.tryUpdateReservedSpace(e.newModelUrl)}async handleCommentAdded(e,t,i){if(this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.threadId===i.threadId).length)return;const o=this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.commentThreadHandle===-1&&O.equalsRange(h.commentThread.range,i.range));if(o.length){o[0].update(i);return}const r=this._inProcessContinueOnComments.get(t)?.findIndex(h=>h.range===void 0?i.range===void 0:O.lift(h.range).equalsRange(i.range));let a;r!==void 0&&r>=0&&(a=this._inProcessContinueOnComments.get(t)?.splice(r,1)[0].body);const c=(this._pendingNewCommentCache[t]&&this._pendingNewCommentCache[t][i.threadId])??a,l=this._pendingEditsCache[t]&&this._pendingEditsCache[t][i.threadId],d=i.canReply&&i.isTemplate&&(!i.comments||i.comments.length===0)&&(!i.editorId||i.editorId===e);await this.displayCommentThread(t,i,d,c,l),this._commentInfos.filter(h=>h.uniqueOwner===t)[0].threads.push(i),this.tryUpdateReservedSpace()}onModelChanged(){this.localToDispose.clear(),this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache(),this.editor&&(this._hasRespondedToEditorChange=!1,this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this._editorDisposables.length&&(this.clearEditorListeners(),this.registerEditorListeners()),this._computeCommentingRangeScheduler=new Lu(200),this.localToDispose.add({dispose:()=>{this._computeCommentingRangeScheduler?.cancel(),this._computeCommentingRangeScheduler=null}}),this.localToDispose.add(this.editor.onDidChangeModelContent(async()=>{this.beginComputeCommentingRanges()})),this.localToDispose.add(this.commentService.onDidUpdateCommentThreads(async e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;if(!t||!this.commentService.isCommentingEnabled)return;this._computePromise&&await this._computePromise;const i=this._commentInfos.filter(l=>l.uniqueOwner===e.uniqueOwner);if(!i||!i.length)return;const s=e.added.filter(l=>l.resource&&l.resource===t.toString()),o=e.removed.filter(l=>l.resource&&l.resource===t.toString()),r=e.changed.filter(l=>l.resource&&l.resource===t.toString()),a=e.pending.filter(l=>l.uri.toString()===t.toString());o.forEach(l=>{const d=this._commentWidgets.filter(u=>u.uniqueOwner===e.uniqueOwner&&u.commentThread.threadId===l.threadId&&u.commentThread.threadId!=="");if(d.length){const u=d[0],f=this._commentWidgets.indexOf(u);this._commentWidgets.splice(f,1),u.dispose()}const h=this._commentInfos.filter(u=>u.uniqueOwner===e.uniqueOwner)[0].threads;for(let u=0;uh.uniqueOwner===e.uniqueOwner&&h.commentThread.threadId===l.threadId);d.length&&(d[0].update(l),this.openCommentsView(l))}const c=this.editor?.getId();for(const l of s)await this.handleCommentAdded(c,e.uniqueOwner,l);for(const l of a)await this.resumePendingComment(t,l);this._commentThreadRangeDecorator.update(this.editor,i)})),this.beginComputeAndHandleEditorChange())}async resumePendingComment(e,t){const i=this._commentWidgets.filter(s=>s.uniqueOwner===t.uniqueOwner&&O.lift(s.commentThread.range)?.equalsRange(t.range));if(t.isReply&&i.length)this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!0}),i[0].setPendingComment(t.body);else if(i.length){this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1});const s=i[0].getPendingComments().newComment;let o;!s||t.body.includes(s)?o=t.body:s.includes(t.body)?o=s:o=`${s} -${t.body}`,i[0].setPendingComment(o)}else if(!t.isReply){if(!this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1}))return;this._inProcessContinueOnComments.has(t.uniqueOwner)||this._inProcessContinueOnComments.set(t.uniqueOwner,[]),this._inProcessContinueOnComments.get(t.uniqueOwner)?.push(t),await this.commentService.createCommentThreadTemplate(t.uniqueOwner,t.uri,t.range?O.lift(t.range):void 0)}}beginComputeAndHandleEditorChange(){this.beginCompute().then(()=>{if(!this._hasRespondedToEditorChange&&this._commentInfos.some(e=>e.commentingRanges.ranges.length>0||e.commentingRanges.fileComments))if(this._hasRespondedToEditorChange=!0,this.configurationService.getValue(ua.Comments)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getAriaLabel();Cu(t?g(rB,2,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(rB,3,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Cu(g(rB,4,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(aue).openView;if(t==="file")return this.viewsService.openView(Qd);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===hg.Unresolved)&&!this.viewsService.getViewWithId(Qd)?.hasRendered)return this.viewsService.openView(Qd)}}async displayCommentThread(e,t,i,s,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!s&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(a0e,this.editor,e,t,s??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=fYt(e)}onEditorMouseUp(e){const t=pYt(this.mouseDownInfo,e);if(this.mouseDownInfo=null,!this.editor||t===null||!e.target.element)return;const i=e.target.element.className.indexOf("comment-range-glyph")>=0,s=e.target.position.lineNumber;let o,r;t!==s?t>s?r=new O(t,this.editor.getModel().getLineLength(t)+1,s,1):r=new O(t,1,s,this.editor.getModel().getLineLength(s)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=s&&s<=r.endLineNumber?(o=r,this.editor.setSelection(new O(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new O(s,1,s,1)),o&&this.addOrToggleCommentAtLine(o,e)}async addOrToggleCommentAtLine(e,t){if(this._addInProgress)this._emptyThreadsToAddQueue.push([e,t]);else{this._addInProgress=!0;const i=this._commentWidgets.filter(s=>s.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const s=i.every(o=>o.expanded);i.forEach(s?o=>o.collapse():o=>o.expand()),this.processNextThreadToAdd();return}else this.addCommentAtLine(e,t)}}processNextThreadToAdd(){this._addInProgress=!1;const e=this._emptyThreadsToAddQueue.shift();e&&this.addOrToggleCommentAtLine(e[0],e[1])}clipUserRangeToCommentRange(e,t){return e.startLineNumbert.endLineNumber&&(e=new O(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)),e}addCommentAtLine(e,t){const i=this._commentingRangeDecorator.getMatchedCommentAction(e);if(!i.length||!this.editor?.hasModel()){if(this._addInProgress=!1,!i.length)throw new Error(`There are no commenting ranges at the current position (${e?"with range":"without range"}).`);return Promise.resolve()}if(i.length>1){if(t&&e)return this.contextMenuService.showContextMenu({getAnchor:()=>t.event,getActions:()=>this.getContextMenuActions(i,e),getActionsContext:()=>i.length?i[0]:void 0,onHide:()=>{this._addInProgress=!1}}),Promise.resolve();{const s=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(s,{placeHolder:g(rB,5,"Select Comment Provider"),matchOnDescription:!0}).then(o=>{if(!o)return;const r=i.filter(a=>a.action.ownerId===o.id);if(r.length){const{ownerId:a}=r[0].action,c=e&&r[0].range?this.clipUserRangeToCommentRange(e,r[0].range):e;this.addCommentAtLine2(c,a)}}).then(()=>{this._addInProgress=!1})}}else{const{ownerId:s}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,s)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:s,extensionId:o,label:r}=i.action;return{label:r??o??s,id:s}})}getContextMenuActions(e,t){const i=[];return e.forEach(s=>{const{ownerId:o,extensionId:r,label:a}=s.action;i.push(new xn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=s.range?this.clipUserRangeToCommentRange(t,s.range):t;return this.addCommentAtLine2(c,o),Promise.resolve()}))}),i}addCommentAtLine2(e,t){this.editor&&(this.commentService.createCommentThreadTemplate(t,this.editor.getModel().uri,e,this.editor.getId()),this.processNextThreadToAdd())}getExistingCommentEditorOptions(e){const t=e.getOption(x.lineDecorationsWidth);let i=[];const s=e.getRawOptions().extraEditorClassName;return s&&(i=s.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let s=i;const o=t.findIndex(a=>a==="inline-comment");o>=0&&t.splice(o,1);const r=e.getOptions();return r.get(x.folding)&&r.get(x.showFoldingControls)!=="never"&&(s+=11),s-=24,{extraEditorClassName:t,lineDecorationsWidth:s}}getWithCommentsLineDecorationWidth(e,t){let i=t;const s=e.getOptions();return s.get(x.folding)&&s.get(x.showFoldingControls)!=="never"&&(i-=11),i+=24,this._commentingRangeAmountReserved=i,this._commentingRangeAmountReserved}getWithCommentsEditorOptions(e,t,i){return t.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,i),extraEditorClassName:t}}updateEditorLayoutOptions(e,t,i){e.updateOptions({extraEditorClassName:t.join(" "),lineDecorationsWidth:i})}ensureCommentingRangeReservedAmount(e){const t=this.getExistingCommentEditorOptions(e);t.lineDecorationsWidth!==this._commentingRangeAmountReserved&&e.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,t.lineDecorationsWidth)})}tryUpdateReservedSpace(e){if(!this.editor)return;const t=this._commentInfos.some(o=>!!(o.commentingRanges&&(Array.isArray(o.commentingRanges)?o.commentingRanges:o.commentingRanges.ranges).length)||o.threads.length>0);e=e??this.editor.getModel()?.uri;const i=e?this.commentService.resourceHasCommentingRanges(e):!1,s=t||i;if(s&&this.commentService.isCommentingEnabled)if(this._commentingRangeSpaceReserved)this.ensureCommentingRangeReservedAmount(this.editor);else{this._commentingRangeSpaceReserved=!0;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}else if((!s||!this.commentService.isCommentingEnabled)&&this._commentingRangeSpaceReserved){this._commentingRangeSpaceReserved=!1;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithoutCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}}async setComments(e){if(!this.editor||!this.commentService.isCommentingEnabled)return;this._commentInfos=e,this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache();let t=!1;for(const i of this._commentInfos){!t&&(i.commentingRanges.ranges.length>0||i.commentingRanges.fileComments)&&(t=!0);const s=this._pendingNewCommentCache[i.uniqueOwner],o=this._pendingEditsCache[i.uniqueOwner];i.threads=i.threads.filter(r=>!r.isDisposed);for(const r of i.threads){let a;s&&(a=s[r.threadId]);let c;o&&(c=o[r.threadId]),await this.displayCommentThread(i.uniqueOwner,r,!1,a,c)}for(const r of i.pendingCommentThreads??[])this.resumePendingComment(this.editor.getModel().uri,r)}this._commentingRangeDecorator.update(this.editor,this._commentInfos),this._commentThreadRangeDecorator.update(this.editor,this._commentInfos),t?this._activeEditorHasCommentingRange.set(!0):this._activeEditorHasCommentingRange.set(!1)}closeWidget(){this._commentWidgets?.forEach(e=>e.hide()),this.editor&&(this.editor.focus(),this.editor.revealRangeInCenter(this.editor.getSelection()))}removeCommentWidgetsAndStoreCache(){this._commentWidgets&&this._commentWidgets.forEach(e=>{const t=e.getPendingComments(),i=t.newComment,s=this._pendingNewCommentCache[e.uniqueOwner];let o;if(e.commentThread.comments&&e.commentThread.comments.length){const c=e.commentThread.comments[e.commentThread.comments.length-1];typeof c.body=="string"?o=c.body:o=c.body.value}i&&i!==o?(s||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):s&&delete s[e.commentThread.threadId];const r=t.edits,a=this._pendingEditsCache[e.uniqueOwner];Object.keys(r).length>0?(a||(this._pendingEditsCache[e.uniqueOwner]={}),this._pendingEditsCache[e.uniqueOwner][e.commentThread.threadId]=r):a&&delete a[e.commentThread.threadId],e.dispose()}),this._commentWidgets=[]}};Poe=D([_(1,sD),_(2,be),_(3,jt),_(4,Vr),_(5,On),_(6,q_),_(7,Re),_(8,Pe),_(9,_i),_(10,ti),_(11,Ur)],Poe);const Wm="vs/workbench/contrib/comments/browser/commentsView",vYt=new Y("commentsView.hasComments",!1),wYt=new Y("commentsView.someCommentsExpanded",!1),bYt="commentsViewState";function p9e(n){return fi.map(n.resourceCommentThreads,e=>{const t=fi.from(e.commentThreads),i=fi.map(t,s=>({element:s}));return{element:e,children:i}})}let l0e=class extends uEe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Ly)return e[0]}get focusedCommentInfo(){if(this.focusedCommentNode)return this.getScreenReaderInfoForNode(this.focusedCommentNode)}focusNextNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).next();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).next();t&&this.tree.setFocus([t])}focusPreviousNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).previous();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){const v=new W1(bYt,m),w=v.getMemento(ke.WORKSPACE,ln.MACHINE);super({...e,filterOptions:{placeholder:g(Wm,0,"Filter (e.g. text, author)"),ariaLabel:g(Wm,1,"Filter comments"),history:w.filterHistory||[],text:w.filter||"",focusContextKey:MOe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=s,this.commentService=h,this.uriIdentityService=p,this.totalComments=0,this.currentHeight=0,this.currentWidth=0,this.cachedFilterStats=void 0,this.onDidChangeVisibility=this.onDidChangeBodyVisibility,this.hasCommentsContextKey=vYt.bindTo(r),this.someCommentsExpandedContextKey=wYt.bindTo(r),this.stateMemento=v,this.viewState=w,this.filters=this._register(new sYt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new nYt(new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(b=>{(b.showResolved||b.showUnresolved)&&this.updateFilter()})),this._register(this.filterWidget.onDidChangeFilterText(()=>this.updateFilter()))}saveState(){this.viewState.filter=this.filterWidget.getFilterText(),this.viewState.filterHistory=this.filterWidget.getHistory(),this.viewState.showResolved=this.filters.showResolved,this.viewState.showUnresolved=this.filters.showUnresolved,this.stateMemento.saveMemento(),super.saveState()}render(){super.render(),this._register(Crt({name:"commentsView",focusNotifiers:[this,this.filterWidget],focusNextWidget:()=>{this.filterWidget.hasFocus()&&this.focus()},focusPreviousWidget:()=>{this.filterWidget.hasFocus()||this.focusFilter()}}))}focusFilter(){this.filterWidget.focus()}clearFilterText(){this.filterWidget.setFilterText("")}getFilterStats(){return this.cachedFilterStats||(this.cachedFilterStats={total:this.totalComments,filtered:this.tree?.getVisibleItemCount()??0}),this.cachedFilterStats}updateFilter(){this.filter.options=new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved),this.tree?.filterComments(),this.cachedFilterStats=void 0;const{total:e,filtered:t}=this.getFilterStats();this.filterWidget.updateBadge(e===t||e===0?void 0:g(Wm,2,"Showing {0} of {1}",t,e)),this.filterWidget.checkMoreFilters(!this.filters.showResolved||!this.filters.showUnresolved)}renderBody(e){super.renderBody(e),e.classList.add("comments-panel");const t=he(e,we(".comments-panel-container"));this.treeContainer=he(t,we(".tree-container")),this.treeContainer.classList.add("file-icon-themable-tree","show-file-icons"),this.cachedFilterStats=void 0,this.createTree(),this.createMessageBox(t),this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged,this)),this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated,this)),this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted,this)),this._register(this.onDidChangeBodyVisibility(i=>{i&&this.refresh()})),this.renderComments()}focus(){super.focus();const e=this.tree?.getHTMLElement();e&&kw(e)||(!this.commentService.commentsModel.hasCommentThreads()&&this.messageBoxContainer?this.messageBoxContainer.focus():this.tree&&this.tree.domFocus())}async renderComments(){this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.renderMessage(),await this.tree?.setChildren(null,p9e(this.commentService.commentsModel))}collapseAll(){this.tree&&(this.tree.collapseAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}expandAll(){this.tree&&(this.tree.expandAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}get hasRendered(){return!!this.tree}layoutBodyContent(e=this.currentHeight,t=this.currentWidth){this.messageBoxContainer&&(this.messageBoxContainer.style.height=`${e}px`),this.tree?.layout(e,t),this.currentHeight=e,this.currentWidth=t}createMessageBox(e){this.messageBoxContainer=he(e,we(".message-box-container")),this.messageBoxContainer.setAttribute("tabIndex","0")}renderMessage(){this.messageBoxContainer.textContent=this.commentService.commentsModel.getMessage(),this.messageBoxContainer.classList.toggle("hidden",this.commentService.commentsModel.hasCommentThreads())}getScreenReaderInfoForNode(e,t){let i="";if(t&&this.configurationService.getValue(ua.Comments)){const r=this.keybindingService.lookupKeybinding(HPt.id)?.getAriaLabel();i=r?g(Wm,3,`Inspect this in the accessible view ({0}). -`,r):g(Wm,4,`Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding. -`)}const s=this.getReplyCountAsString(e,t),o=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===kI.Outdated?i+g(Wm,5,"Outdated from {0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(Wm,6,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:e.threadRelevance===kI.Outdated?i+g(Wm,7,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(Wm,8,"{0} in {1},{2} comment: {3}",e.comment.userName,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o}getRepliesAsString(e,t){return!e.replies.length||t?"":` -`+e.replies.map(i=>g(Wm,9,"{0} {1}",i.comment.userName,typeof i.comment.body=="string"?i.comment.body:i.comment.body.value)).join(` -`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(Wm,10," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(B1,this)),this.tree=this._register(this.instantiationService.createInstance(ZIe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof cue?g(Wm,11,"Comments for current workspace"):e instanceof dm?g(Wm,12,"Comments in {0}, full path {1}",ui(e.resource),e.resource.fsPath):e instanceof Ly?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return KIe.value}}})),this._register(this.tree.onDidOpen(e=>{this.openFile(e.element,e.editorOptions.pinned,e.editorOptions.preserveFocus,e.sideBySide)})),this._register(this.tree.onDidChangeModel(()=>{this.updateSomeCommentsExpanded()})),this._register(this.tree.onDidChangeCollapseState(()=>{this.updateSomeCommentsExpanded()}))}openFile(e,t,i,s){if(!e||!(e instanceof dm||e instanceof Ly))return;const o=e instanceof dm?e.commentThreads[0].thread:e.thread,r=e instanceof dm?e.commentThreads[0].comment:void 0;return _Yt(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,s)}async refresh(){if(this.tree&&this.isVisible()&&(this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads()),this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.cachedFilterStats=void 0,this.renderMessage(),this.tree?.setChildren(null,p9e(this.commentService.commentsModel)),this.tree.getSelection().length===0&&this.commentService.commentsModel.hasCommentThreads())){const e=this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];e&&(this.tree.setFocus([e]),this.tree.setSelection([e]))}}onAllCommentsChanged(e){this.cachedFilterStats=void 0,this.totalComments+=e.commentThreads.length;for(const t of e.commentThreads);this.refresh()}onCommentsUpdated(e){this.cachedFilterStats=void 0,this.totalComments+=e.added.length,this.totalComments-=e.removed.length;for(const t of this.commentService.commentsModel.resourceCommentThreads)for(const i of t.commentThreads);this.refresh()}onDataProviderDeleted(e){this.cachedFilterStats=void 0,this.totalComments=0,this.refresh()}updateSomeCommentsExpanded(){this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded())}areAllCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(this.tree.isCollapsed(e.current()))return!1;return!0}isSomeCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(!this.tree.isCollapsed(e.current()))return!0;return!1}};l0e=D([_(1,be),_(2,z_),_(3,_i),_(4,Re),_(5,Pe),_(6,Vr),_(7,ti),_(8,fr),_(9,pn),_(10,sD),_(11,rn),_(12,el),_(13,_o),_(14,on)],l0e);const jz="vs/workbench/browser/parts/views/viewPaneContainer",CYt=new Te("Views");Xs.appendMenuItem(Te.ViewContainerTitle,{submenu:CYt,title:g(jz,0,"Views"),order:1});var cu;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(cu||(cu={}));const hle=class hle extends zMe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,s,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=s,this.cleanupOverlayScheduler=this._register(new yn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=hle.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.paneElement.removeChild(this.container),this.paneElement.classList.remove("dragged-over")})),this.overlay=document.createElement("div"),this.overlay.classList.add("pane-overlay-indicator"),this.container.appendChild(this.overlay),this.registerListeners(),this.updateStyles()}updateStyles(){this.overlay.style.backgroundColor=this.getColor(this.location===Sr.Panel?FZe:OZe)||"";const e=this.getColor(co);this.overlay.style.outlineColor=e||"",this.overlay.style.outlineOffset=e?"-2px":"",this.overlay.style.outlineStyle=e?"dashed":"",this.overlay.style.outlineWidth=e?"2px":"",this.overlay.style.borderColor=e||"",this.overlay.style.borderStyle="solid",this.overlay.style.borderWidth="0px"}registerListeners(){this._register(new yZ(this.container,{onDragOver:e=>{this.positionOverlay(e.offsetX,e.offsetY),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:e=>this.dispose(),onDragEnd:e=>this.dispose(),onDrop:e=>{this.dispose()}})),this._register(pe(this.container,xe.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,s=this.paneElement.clientHeight,o=i/2,r=s/2;let a;switch(this.orientation===vi.VERTICAL?t=r&&(a=cu.DOWN):this.orientation===vi.HORIZONTAL&&(e=o&&(a=cu.RIGHT)),a){case cu.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case cu.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case cu.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case cu.RIGHT:this.doPositionOverlay({top:"0",right:"0",width:"50%",height:"100%"});break;default:{let c="0",l="0",d="100%",h="100%";if(this.bounds){const u=this.container.getBoundingClientRect();c=`${this.bounds.top-u.top}px`,l=`${this.bounds.left-u.left}px`,h=`${this.bounds.bottom-this.bounds.top}px`,d=`${this.bounds.right-this.bounds.left}px`}this.doPositionOverlay({top:c,left:l,width:d,height:h})}}this.orientation===vi.VERTICAL&&s<=25||this.orientation===vi.HORIZONTAL&&i<=25?this.doUpdateOverlayBorder(a):this.doUpdateOverlayBorder(void 0),this.overlay.style.opacity="1",setTimeout(()=>this.overlay.classList.add("overlay-move-transition"),0),this._currentDropOperation=a}doUpdateOverlayBorder(e){this.overlay.style.borderTopWidth=e===cu.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===cu.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===cu.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===cu.RIGHT?"2px":"0px"}doPositionOverlay(e){this.container.style.height="100%",this.overlay.style.top=e.top||"",this.overlay.style.left=e.left||"",this.overlay.style.bottom=e.bottom||"",this.overlay.style.right=e.right||"",this.overlay.style.width=e.width,this.overlay.style.height=e.height}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}};hle.OVERLAY_ID="monaco-pane-drop-overlay";let x2=hle,d0e=class extends Oie{constructor(e,t,i,s,o){const r=s.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",aie(i.getViewContainerLocation(t)));super(Te.ViewContainerTitle,Te.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(T.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(aie(i.getViewContainerLocation(t)))))}};d0e=D([_(2,z_),_(3,Pe),_(4,_c)],d0e);let h0e=class extends wst{get onDidSashChange(){return ws(this.paneview).onDidSashChange}get panes(){return this.paneItems.map(e=>e.pane)}get views(){return this.panes}get length(){return this.paneItems.length}get menuActions(){return this._menuActions}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=s,this.layoutService=o,this.contextMenuService=r,this.telemetryService=a,this.extensionService=c,this.storageService=d,this.contextService=h,this.viewDescriptorService=u,this.paneItems=[],this.visible=!1,this.areExtensionsReady=!1,this.didLayout=!1,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidAddViews=this._register(new I),this.onDidAddViews=this._onDidAddViews.event,this._onDidRemoveViews=this._register(new I),this.onDidRemoveViews=this._onDidRemoveViews.event,this._onDidChangeViewVisibility=this._register(new I),this.onDidChangeViewVisibility=this._onDidChangeViewVisibility.event,this._onDidFocusView=this._register(new I),this.onDidFocusView=this._onDidFocusView.event,this._onDidBlurView=this._register(new I),this.onDidBlurView=this._onDidBlurView.event;const f=this.viewDescriptorService.getViewContainerById(e);if(!f)throw new Error("Could not find container");this.viewContainer=f,this.visibleViewsStorageId=`${e}.numberOfVisibleViews`,this.visibleViewsCountFromCache=this.storageService.getNumber(this.visibleViewsStorageId,ke.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new j4t(e,this.options)),this._boundarySashes&&this.paneview.setBoundarySashes(this._boundarySashes),this._register(this.paneview.onDidDrop(({from:c,to:l})=>this.movePane(c,l))),this._register(this.paneview.onDidScroll(c=>this.onDidScrollPane())),this._register(this.paneview.onDidSashReset(c=>this.onDidSashReset(c))),this._register(pe(e,xe.CONTEXT_MENU,c=>this.showContextMenu(new yu(gt(e),c)))),this._register(dh.addTarget(e)),this._register(pe(e,Eo.Contextmenu,c=>this.showContextMenu(new yu(gt(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(d0e,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const s=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===vi.VERTICAL?l.bottom:c.top,h=this.orientation===vi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},o=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let r;this._register(lE.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=s(),i&&i.disposed&&(i=void 0),!i&&o(r,c.eventData)){const l=c.dragAndDropData.getData();if(l.type==="view"){const d=this.viewDescriptorService.getViewContainerByViewId(l.id),h=this.viewDescriptorService.getViewDescriptorById(l.id);if(d!==this.viewContainer&&(!h||!h.canMoveView||this.viewContainer.rejectAddedViews))return;i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(l.type==="composite"&&l.id!==this.viewContainer.id){const d=this.viewDescriptorService.getViewContainerById(l.id),h=this.viewDescriptorService.getViewContainerModel(d).allViewDescriptors;!h.some(u=>!u.canMoveView)&&h.length>0&&(i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!o(r,c.eventData)&&(i.dispose(),i=void 0),o(r,c.eventData)&&r3e(c.eventData.dataTransfer,"move",i!==void 0)},onDragLeave:c=>{i?.dispose(),i=void 0},onDrop:c=>{if(i){const l=c.dragAndDropData.getData(),d=[];if(l.type==="composite"&&l.id!==this.viewContainer.id){const u=this.viewDescriptorService.getViewContainerById(l.id),f=this.viewDescriptorService.getViewContainerModel(u).allViewDescriptors;f.some(p=>!p.canMoveView)||d.push(...f)}else if(l.type==="view"){const u=this.viewDescriptorService.getViewContainerByViewId(l.id),f=this.viewDescriptorService.getViewDescriptorById(l.id);u!==this.viewContainer&&f&&f.canMoveView&&this.viewDescriptorService.moveViewsToContainer([f],this.viewContainer,void 0,"dnd")}const h=this.panes.length;if(d.length>0&&this.viewDescriptorService.moveViewsToContainer(d,this.viewContainer,void 0,"dnd"),h>0)for(const u of d){const f=this.panes.find(p=>p.id===u.id);f&&this.movePane(f,this.panes[this.panes.length-1])}}i?.dispose(),i=void 0}})),this._register(this.onDidSashChange(()=>this.saveViewSizes())),this._register(this.viewContainerModel.onDidAddVisibleViewDescriptors(c=>this.onDidAddViewDescriptors(c))),this._register(this.viewContainerModel.onDidRemoveVisibleViewDescriptors(c=>this.onDidRemoveViewDescriptors(c)));const a=this.viewContainerModel.visibleViewDescriptors.map((c,l)=>{const d=this.viewContainerModel.getSize(c.id),h=this.viewContainerModel.isCollapsed(c.id);return{viewDescriptor:c,index:l,size:d,collapsed:h}});a.length&&this.onDidAddViewDescriptors(a),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.areExtensionsReady=!0,this.panes.length&&(this.updateTitleArea(),this.updateViewHeaders()),this._register(this.configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(g_.ACTIVITY_BAR_LOCATION)&&this.updateViewHeaders()}))}),this._register(this.viewContainerModel.onDidChangeActiveViewDescriptors(()=>this._onTitleAreaUpdate.fire()))}getTitle(){const e=this.viewContainerModel.title;if(this.isViewMergedWithContainer()){const t=this.paneItems[0].pane.singleViewPaneContainerTitle;if(t)return t;const i=this.paneItems[0].pane.title;return e===i?i:i?`${e}: ${i}`:e}return e}showContextMenu(e){for(const t of this.paneItems)if(al(e.target,t.pane.element))return;e.stopPropagation(),e.preventDefault(),this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>this.menuActions?.getContextMenuActions()??[]})}getActionsContext(){}getActionViewItem(e,t){return this.isViewMergedWithContainer()?this.paneItems[0].pane.getActionViewItem(e,t):yO(this.instantiationService,e,t)}focus(){let e;if(this.lastFocusedPane)e=this.lastFocusedPane;else if(this.paneItems.length>0){for(const{pane:t}of this.paneItems)if(t.isExpanded()){e=t;break}}e&&e.focus()}get orientation(){switch(this.viewDescriptorService.getViewContainerLocation(this.viewContainer)){case Sr.Sidebar:case Sr.AuxiliaryBar:return vi.VERTICAL;case Sr.Panel:return this.layoutService.getPanelPosition()===kv.BOTTOM?vi.HORIZONTAL:vi.VERTICAL}return vi.VERTICAL}layout(e){this.paneview&&(this.paneview.orientation!==this.orientation&&this.paneview.flipOrientation(e.height,e.width),this.paneview.layout(e.height,e.width)),this.dimension=e,this.didLayout?this.saveViewSizes():(this.didLayout=!0,this.restoreViewSizes())}setBoundarySashes(e){this._boundarySashes=e,this.paneview?.setBoundarySashes(e)}getOptimalWidth(){return Math.max(...this.panes.map(i=>i.getOptimalWidth()||0))+16}addPanes(e){const t=this.isViewMergedWithContainer();for(const{pane:i,size:s,index:o,disposable:r}of e)this.addPane(i,s,r,o);this.updateViewHeaders(),this.isViewMergedWithContainer()!==t&&this.updateTitleArea(),this._onDidAddViews.fire(e.map(({pane:i})=>i))}setVisible(e){this.visible!==!!e&&(this.visible=e,this._onDidChangeVisibility.fire(e)),this.panes.filter(t=>t.isVisible()!==e).forEach(t=>t.setVisible(e))}isVisible(){return this.visible}updateTitleArea(){this._onTitleAreaUpdate.fire()}createView(e,t){return this.instantiationService.createInstance(e.ctorDescriptor.ctor,...e.ctorDescriptor.staticArguments||[],t)}getView(e){return this.panes.filter(t=>t.id===e)[0]}saveViewSizes(){this.didLayout&&this.viewContainerModel.setSizes(this.panes.map(e=>({id:e.id,size:this.getPaneSize(e)})))}restoreViewSizes(){if(this.didLayout){let e;for(let t=0;ti+(s||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===vi.VERTICAL?e.set(i.id,this.dimension.height*(i.weight||20)/t):e.set(i.id,this.dimension.width*(i.weight||20)/t)}return e}saveState(){this.panes.forEach(e=>e.saveState()),this.storageService.store(this.visibleViewsStorageId,this.length,ke.WORKSPACE,ln.MACHINE)}onContextMenu(e,t){e.stopPropagation(),e.preventDefault();const i=t.menuActions.getContextMenuActions();this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i})}openView(e,t){let i=this.getView(e);return i||this.toggleViewVisibility(e),i=this.getView(e),i&&(i.setExpanded(!0),t&&i.focus()),i}onDidAddViewDescriptors(e){const t=[];for(const{viewDescriptor:s,collapsed:o,index:r,size:a}of e){const c=this.createView(s,{id:s.id,title:s.name.value,fromExtensionId:s.extensionId,expanded:!o,singleViewPaneContainerTitle:s.singleViewPaneContainerTitle});c.render();const l=pe(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new yu(gt(c.draggableElement),h),c)}),d=T.latch(T.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(s.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:pa(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:s}of t)s.setVisible(this.isVisible()),i.push(s);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,s)=>s.index-i.index);const t=[];for(const{index:i}of e)this.paneItems[i]&&t.push(this.paneItems[i].pane);if(t.length){this.removePanes(t);for(const i of t)i.setVisible(!1)}}toggleViewVisibility(e){if(this.viewContainerModel.activeViewDescriptors.some(t=>t.id===e)){const t=!this.viewContainerModel.isVisible(e);this.viewContainerModel.setVisible(e,t)}}addPane(e,t,i,s=this.paneItems.length-1){const o=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),r=e.onDidBlur(()=>this._onDidBlurView.fire(e)),a=e.onDidChangeTitleArea(()=>{this.isViewMergedWithContainer()&&this.updateTitleArea()}),c=e.onDidChangeBodyVisibility(()=>this._onDidChangeViewVisibility.fire(e)),l=e.onDidChange(()=>{e===this.lastFocusedPane&&!e.isExpanded()&&(this.lastFocusedPane=void 0)}),d=this.viewDescriptorService.getViewContainerLocation(this.viewContainer)===Sr.Panel;e.style({headerForeground:Ye(d?VTt:YTt),headerBackground:Ye(d?UTt:KTt),headerBorder:Ye(d?zTt:x3),dropBackground:Ye(d?FZe:OZe),leftBorder:d?Ye($Tt):void 0});const h=new Z;h.add(i),h.add(pa(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(s,0,u),ws(this.paneview).addPane(e,t,s);let f;h.add(lE.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(lE.INSTANCE.registerTarget(e.dropTargetElement,{onDragEnter:p=>{if(!f){const m=p.dragAndDropData.getData();if(m.type==="view"&&m.id!==e.id){const v=this.viewDescriptorService.getViewContainerByViewId(m.id),w=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!w||!w.canMoveView||this.viewContainer.rejectAddedViews))return;f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const v=this.viewDescriptorService.getViewContainerById(m.id),w=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!w.some(b=>!b.canMoveView)&&w.length>0&&(f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{r3e(p.eventData.dataTransfer,"move",f!==void 0)},onDragLeave:p=>{f?.dispose(),f=void 0},onDrop:p=>{if(f){const m=p.dragAndDropData.getData(),v=[];let w;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const b=this.viewDescriptorService.getViewContainerById(m.id),C=this.viewDescriptorService.getViewContainerModel(b).allViewDescriptors;C.length>0&&!C.some(y=>!y.canMoveView)&&(v.push(...C),w=C[0])}else if(m.type==="view"){const b=this.viewDescriptorService.getViewContainerByViewId(m.id),C=this.viewDescriptorService.getViewDescriptorById(m.id);b!==this.viewContainer&&C&&C.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(C),C&&(w=C)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),w){if(f.currentDropOperation===cu.DOWN||f.currentDropOperation===cu.RIGHT){const b=this.panes.findIndex(y=>y.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b>C&&C++,Cy.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b=0&&C!==b&&this.movePane(this.panes[b],this.panes[C]))}v.length>1&&v.slice(1).forEach(b=>{let C=this.panes.findIndex(S=>S.id===w.id);const y=this.panes.findIndex(S=>S.id===b.id);y>=0&&C>=0&&(y>C&&C++,Cthis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),ws(this.paneview).removePane(e);const[i]=this.paneItems.splice(t,1);i.disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(c=>c.pane===e),s=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[s];if(i<0||i>=this.paneItems.length||s<0||s>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,a),ws(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){ws(this.paneview).resizePane(e,t)}getPaneSize(e){return ws(this.paneview).getPaneSize(e)}updateViewHeaders(){this.isViewMergedWithContainer()?(this.paneItems[0].pane.isExpanded()?this.lastMergedCollapsedPane=void 0:(this.lastMergedCollapsedPane=this.paneItems[0].pane,this.paneItems[0].pane.setExpanded(!0)),this.paneItems[0].pane.headerVisible=!1,this.paneItems[0].pane.collapsible=!0):(this.paneItems.length===1?(this.paneItems[0].pane.headerVisible=!0,this.paneItems[0].pane===this.lastMergedCollapsedPane&&this.paneItems[0].pane.setExpanded(!1),this.paneItems[0].pane.collapsible=!1):this.paneItems.forEach(e=>{e.pane.headerVisible=!0,e.pane.collapsible=!0,e.pane===this.lastMergedCollapsedPane&&e.pane.setExpanded(!1)}),this.lastMergedCollapsedPane=void 0)}isViewMergedWithContainer(){return this.options.mergeViewWithContainerWhenSingleView&&this.paneItems.length===1?this.areExtensionsReady?!0:this.visibleViewsCountFromCache===void 0?this.paneItems[0].pane.isExpanded():this.visibleViewsCountFromCache===1:!1}onDidScrollPane(){for(const e of this.panes)e.onDidScrollRoot()}onDidSashReset(e){let t,i;for(let s=e;s>=0;s--)if(this.paneItems[s].pane?.isVisible()&&this.paneItems[s]?.pane.isExpanded()){t=this.paneItems[s].pane;break}for(let s=e+1;so?(this.resizePane(t,r),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,r))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};h0e=D([_(2,be),_(3,Re),_(4,kO),_(5,Vr),_(6,rn),_(7,ho),_(8,pn),_(9,on),_(10,Ti),_(11,z_)],h0e);class lue extends pi{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(z_),i=e.get(Pe),s=Tz.getValue(i);if(s===void 0)return;const o=t.getViewContainerByViewId(s),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===s),c=r.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=r.visibleViewDescriptors.length)return;const l=r.visibleViewDescriptors[c+this.offset];r.move(a.id,l.id)}}At(class extends lue{constructor(){super({id:"views.moveViewUp",title:g(jz,1,"Move View Up"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.UpArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewLeft",title:g(jz,2,"Move View Left"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.LeftArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewDown",title:g(jz,3,"Move View Down"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.DownArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends lue{constructor(){super({id:"views.moveViewRight",title:g(jz,4,"Move View Right"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.RightArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends pi{constructor(){super({id:"vscode.moveViews",title:g(jz,5,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(z_),s=i.getViewContainerById(t.destinationId);if(s){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],s,xSe.Default,this.desc.id)}await e.get(q_).openViewContainer(s.id,!0)}}});const yYt="vs/workbench/api/browser/mainThreadComments";class SYt{get input(){return this._input}set input(e){this._input=e,this._onDidChangeInput.fire(e)}get onDidChangeInput(){return this._onDidChangeInput.event}get label(){return this._label}set label(e){this._label=e,this._onDidChangeLabel.fire(this._label)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e}get comments(){return this._comments}set comments(e){this._comments=e,this._onDidChangeComments.fire(this._comments)}get onDidChangeComments(){return this._onDidChangeComments.event}set range(e){this._range=e,this._onDidChangeRange.fire(this._range)}get range(){return this._range}get onDidChangeCanReply(){return this._onDidChangeCanReply.event}set canReply(e){this._canReply=e,this._onDidChangeCanReply.fire(this._canReply)}get canReply(){return this._canReply}get collapsibleState(){return this._collapsibleState}set collapsibleState(e){e!==this._collapsibleState&&(this._collapsibleState=e,this._onDidChangeCollapsibleState.fire(this._collapsibleState))}get initialCollapsibleState(){return this._initialCollapsibleState}set initialCollapsibleState(e){this._initialCollapsibleState=e,this.collapsibleState===void 0&&(this.collapsibleState=this.initialCollapsibleState),this._onDidChangeInitialCollapsibleState.fire(e)}get isDisposed(){return this._isDisposed}isDocumentCommentThread(){return this._range===void 0||O.isIRange(this._range)}get state(){return this._state}set state(e){this._state=e,this._onDidChangeState.fire(this._state)}get applicability(){return this._applicability}set applicability(e){this._applicability=e,this._onDidChangeApplicability.fire(e)}get isTemplate(){return this._isTemplate}constructor(e,t,i,s,o,r,a,c,l){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=s,this.resource=o,this._range=r,this._canReply=a,this._isTemplate=c,this.editorId=l,this._onDidChangeInput=new I,this._onDidChangeLabel=new I,this.onDidChangeLabel=this._onDidChangeLabel.event,this._onDidChangeComments=new I,this._onDidChangeCanReply=new I,this._onDidChangeRange=new I,this.onDidChangeRange=this._onDidChangeRange.event,this._onDidChangeCollapsibleState=new I,this.onDidChangeCollapsibleState=this._onDidChangeCollapsibleState.event,this._onDidChangeInitialCollapsibleState=new I,this.onDidChangeInitialCollapsibleState=this._onDidChangeInitialCollapsibleState.event,this._onDidChangeApplicability=new I,this.onDidChangeApplicability=this._onDidChangeApplicability.event,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._isDisposed=!1,c&&(this.comments=[])}batchUpdate(e){const t=i=>Object.prototype.hasOwnProperty.call(e,i);t("range")&&(this._range=e.range),t("label")&&(this._label=e.label),t("contextValue")&&(this._contextValue=e.contextValue===null?void 0:e.contextValue),t("comments")&&(this._comments=e.comments),t("collapseState")&&(this.initialCollapsibleState=e.collapseState),t("canReply")&&(this.canReply=e.canReply),t("state")&&(this.state=e.state),t("applicability")&&(this.applicability=e.applicability),t("isTemplate")&&(this._isTemplate=e.isTemplate)}dispose(){this._isDisposed=!0,this._onDidChangeCollapsibleState.dispose(),this._onDidChangeComments.dispose(),this._onDidChangeInput.dispose(),this._onDidChangeLabel.dispose(),this._onDidChangeRange.dispose(),this._onDidChangeState.dispose()}toJSON(){return{$mid:Fs.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class AYt{get handle(){return this._handle}get id(){return this._id}get contextValue(){return this._id}get proxy(){return this._proxy}get label(){return this._label}get reactions(){return this._reactions}set reactions(e){this._reactions=e}get options(){return this._features.options}get features(){return this._features}get owner(){return this._id}constructor(e,t,i,s,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=s,this._id=o,this._label=r,this._features=a,this._threads=new Map}async setActiveCommentAndThread(e){return this._proxy.$setActiveComment(this._handle,e?{commentThreadHandle:e.thread.commentThreadHandle,uniqueIdInThread:e.comment?.uniqueIdInThread}:void 0)}updateFeatures(e){this._features=e}createCommentThread(e,t,i,s,o,r,a){const c=new SYt(t,this.handle,e,i,P.revive(s).toString(),o,!0,r,a);return this._threads.set(t,c),c.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}),c}updateCommentThread(e,t,i,s){const o=this.getKnownThread(e);o.batchUpdate(s),o.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]})}deleteCommentThread(e){const t=this.getKnownThread(e);this._threads.delete(e),t.dispose(),t.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]})}deleteCommentThreadMain(e){this._threads.forEach(t=>{t.threadId===e&&this._proxy.$deleteCommentThread(this._handle,t.commentThreadHandle)})}updateInput(e){const t=this.activeEditingCommentThread;if(t&&t.input){const i=t.input;i.value=e,t.input=i}}updateCommentingRanges(e){this._commentService.updateCommentingRanges(this._uniqueId,e)}getKnownThread(e){const t=this._threads.get(e);if(!t)throw new Error("unknown thread");return t}async getDocumentComments(e,t){if(e.scheme===_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[],commentingRanges:{resource:e,ranges:[],fileComments:!1}};const i=[];for(const o of[...this._threads.keys()]){const r=this._threads.get(o);r.resource===e.toString()&&r.isDocumentCommentThread()&&i.push(r)}const s=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:s?.ranges||[],fileComments:!!s?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const s of[...this._threads.keys()]){const o=this._threads.get(s);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,s,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,s)}getAllComments(){const e=[];for(const t of[...this._threads.keys()])e.push(this._threads.get(t));return e}createCommentThreadTemplate(e,t,i){return this._proxy.$createCommentThreadTemplate(this.handle,e,t,i)}async updateCommentThreadTemplate(e,t){await this._proxy.$updateCommentThreadTemplate(this.handle,e,t)}toJSON(){return{$mid:Fs.CommentController,handle:this.handle}}}const m9e=Ki("comments-view-icon",Ce.commentDiscussion,g(yYt,0,"View icon of the comments view."));let _9e=class extends ${constructor(e,t,i,s){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=s,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(et.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async o=>{const r=o.controllerHandle,a=this._commentControllers.get(r);a&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=o,a.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,s){const o=`${t}-${s}`;this._handlers.set(e,o);const r=new AYt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(Qd);a||this.registerView(a),this.registerViewListeners(a),this._commentService.setWorkspaceComments(String(e),[])}$unregisterCommentController(e){const t=this._handlers.get(e);this._handlers.delete(e),this._commentControllers.delete(e),typeof t=="string"&&this._commentService.unregisterCommentController(t)}$updateCommentControllerFeatures(e,t){const i=this._commentControllers.get(e);i&&i.updateFeatures(t)}$createCommentThread(e,t,i,s,o,r,a,c){const l=this._commentControllers.get(e);if(l)return l.createCommentThread(r.value,t,i,s,o,a,c)}$updateCommentThread(e,t,i,s,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,s,o)}$deleteCommentThread(e,t){const i=this._commentControllers.get(e);if(i)return i.deleteCommentThread(t)}$updateCommentingRanges(e,t){const i=this._commentControllers.get(e);i&&i.updateCommentingRanges(t)}registerView(e){if(!e){const t=it.as(M1.ViewContainersRegistry).registerViewContainer({id:Qd,title:KIe,ctorDescriptor:new Gi(h0e,[Qd,{mergeViewWithContainerWhenSingleView:!0}]),storageId:tYt,hideIfEmpty:!0,icon:m9e,order:10},Sr.Panel);it.as(M1.ViewsRegistry).registerViews([{id:Qd,name:KIe,canToggleVisibility:!1,ctorDescriptor:new Gi(l0e),canMoveView:!0,containerIcon:m9e,focusCommand:{id:"workbench.action.focusCommentsPanel"}}],t)}}setComments(){[...this._commentControllers.keys()].forEach(e=>{const t=this._commentControllers.get(e).getAllComments();if(t.length){const i=this.getHandler(e);this._commentService.setWorkspaceComments(i,t)}})}registerViewOpenedListener(){this._openViewListener||(this._openViewListener=this._viewsService.onDidChangeViewVisibility(e=>{e.id===Qd&&e.visible&&(this.setComments(),this._openViewListener&&(this._openViewListener.dispose(),this._openViewListener=null))}))}registerViewListeners(e){e||this.registerViewOpenedListener(),this._register(this._viewDescriptorService.onDidChangeContainer(t=>{t.views.find(i=>i.id===Qd)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(Qd);t.viewContainer.id===i?.id&&(this.setComments(),this.registerViewOpenedListener())}))}getHandler(e){if(!this._handlers.has(e))throw new Error("Unknown handler");return this._handlers.get(e)}};_9e=D([en(Ue.MainThreadComments),_(1,sD),_(2,q_),_(3,z_)],_9e);var CI;(function(n){n[n.Output=1]="Output",n[n.OutputItems=2]="OutputItems",n[n.ExecutionState=3]="ExecutionState"})(CI||(CI={}));var vm;(function(n){function e(f){return{mime:f.mime,valueBytes:f.data}}n.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}n.toNotebookOutputDto=t;function i(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,internalMetadata:f.internalMetadata,metadata:f.metadata,outputs:f.outputs.map(t)}}n.toNotebookCellDataDto=i;function s(f){return{metadata:f.metadata,cells:f.cells.map(i)}}n.toNotebookDataDto=s;function o(f){return{mime:f.mime,data:f.valueBytes}}n.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}n.fromNotebookOutputDto=r;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(r),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}n.fromNotebookDataDto=c;function l(f){return{handle:f.handle,uri:f.uri,source:f.textBuffer.getLinesContent(),eol:f.textBuffer.getEOL(),language:f.language,cellKind:f.cellKind,outputs:f.outputs.map(t),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.toNotebookCellDto=l;function d(f){return f.editType===CI.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===CI.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}n.fromCellExecuteUpdateDto=d;function h(f){return f}n.fromCellExecuteCompleteDto=h;function u(f){return f.editType===G1.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}n.fromCellEditOperationDto=u})(vm||(vm={}));let v9e=class{constructor(e,t,i,s){this._notebookService=t,this._cellStatusBarService=i,this._logService=s,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(et.ExtHostNotebook)}dispose(){this._disposables.dispose(),St(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,s,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:s,dataToNotebook:async a=>{const c=new ao;let l;if(a.byteLength===0&&i==="interactive")l=vm.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,qe.None);l=vm.fromNotebookDataDto(d.value)}return this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${c.elapsed()}ms`,{viewType:i,extensionId:t.id.value}),l},notebookToData:a=>{const c=new ao,l=this._proxy.$notebookToData(e,new $h(vm.toNotebookDataDto(a)),qe.None);return this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${c.elapsed()}`,{viewType:i,extensionId:t.id.value}),l},save:async(a,c,l,d)=>({...await this._proxy.$saveNotebook(e,a,c,l,d),children:void 0,resource:a}),searchInNotebooks:async(a,c,l)=>{const d=this._notebookService.getContributedNotebookType(i);if(!d)return{results:[],limitHit:!1};const u=d.selectors.map(w=>(w.include||w).toString());if(!u.length)return{results:[],limitHit:!1};const f=Vi([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(w=>w!==i?l.get(w)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(w=>({resource:P.revive(w.resource),cellResults:w.cellResults.map(C=>Or(C))})),limitHit:m.limitHit}}})),o&&r.add(this._notebookService.registerContributedNotebookType(i,o)),this._notebookSerializer.set(e,r),this._logService.trace("[NotebookSerializer] registered notebook serializer",{viewType:i,extensionId:t.id.value})}$unregisterNotebookSerializer(e){this._notebookSerializer.get(e)?.dispose(),this._notebookSerializer.delete(e)}$emitCellStatusBarEvent(e){const t=this._notebookCellStatusBarRegistrations.get(e);t instanceof I&&t.fire(void 0)}async $registerNotebookCellStatusBarItemProvider(e,t,i){const s=this,o={async provideCellStatusBarItems(a,c,l){const d=await s._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&s._proxy.$releaseNotebookCellStatusBarItems(d.cacheId)}}},viewType:i};if(typeof t=="number"){const a=new I;this._notebookCellStatusBarRegistrations.set(t,a),o.onDidChangeStatusBarItems=a.event}const r=this._cellStatusBarService.registerCellStatusBarItemProvider(o);this._notebookCellStatusBarRegistrations.set(e,r)}async $unregisterNotebookCellStatusBarItemProvider(e,t){const i=s=>{this._notebookCellStatusBarRegistrations.get(s)&&(this._notebookCellStatusBarRegistrations.get(s)?.dispose(),this._notebookCellStatusBarRegistrations.delete(s))};i(e),typeof t=="number"&&i(t)}};v9e=D([en(Ue.MainThreadNotebook),_(1,oD),_(2,qZe),_(3,Ze)],v9e);yt.registerCommand("_executeDataToNotebook",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(i instanceof ze,"VSBuffer");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=await o.serializer.dataToNotebook(i);return new $h(vm.toNotebookDataDto(r))});yt.registerCommand("_executeNotebookToData",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(typeof i=="object");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=vm.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var u0e;(function(n){n[n.cell=0]="cell",n[n.notebook=1]="notebook"})(u0e||(u0e={}));class EYt{get preloadUris(){return this.preloads.map(e=>e.uri)}get preloadProvides(){return this.preloads.flatMap(e=>e.provides)}constructor(e,t){this._languageService=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.id=e.id,this.viewType=e.notebookType,this.extension=e.extensionId,this.implementsInterrupt=e.supportsInterrupt??!1,this.label=e.label,this.description=e.description,this.detail=e.detail,this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=P.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:P.revive(i.uri),provides:i.provides}))??[]}update(e){const t=Object.create(null);e.label!==void 0&&(this.label=e.label,t.label=!0),e.description!==void 0&&(this.description=e.description,t.description=!0),e.detail!==void 0&&(this.detail=e.detail,t.detail=!0),e.supportedLanguages!==void 0&&(this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:this._languageService.getRegisteredLanguageIds(),t.supportedLanguages=!0),e.supportsExecutionOrder!==void 0&&(this.implementsExecutionOrder=e.supportsExecutionOrder,t.hasExecutionOrder=!0),e.supportsInterrupt!==void 0&&(this.implementsInterrupt=e.supportsInterrupt,t.hasInterruptHandler=!0),e.hasVariableProvider!==void 0&&(this.hasVariableProvider=e.hasVariableProvider,t.hasVariableProvider=!0),this._onDidChange.fire(t)}}class xYt{constructor(e){this.notebookType=e}}let w9e=class{constructor(e,t,i,s,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=s,this._notebookService=o,this._editors=new Zo,this._disposables=new Z,this._kernels=new Map,this._kernelDetectionTasks=new Map,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProvidersEventRegistrations=new Map,this._executions=new Map,this._notebookExecutions=new Map,this.variableRequestIndex=0,this.variableRequestMap=new Map,this._proxy=e.getProxy(et.ExtHostNotebookKernels),r.listNotebookEditors().forEach(this._onEditorAdd,this),r.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),r.onDidRemoveNotebookEditor(this._onEditorRemove,this,this._disposables),this._disposables.add(Ee(()=>{this._executions.forEach(a=>{a.complete({})}),this._notebookExecutions.forEach(a=>a.complete())})),this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(a=>{a.type===u0e.cell&&this._proxy.$cellExecutionChanged(a.notebook,a.cellHandle,a.changed?.state)}))}dispose(){this._disposables.dispose();for(const[,e]of this._kernels.values())e.dispose();for(const[,e]of this._kernelDetectionTasks.values())e.dispose();for(const[,e]of this._kernelSourceActionProviders.values())e.dispose();this._editors.dispose()}_onEditorAdd(e){const t=e.onDidReceiveMessage(i=>{if(!e.hasModel())return;const{selected:s}=this._notebookKernelService.getMatchingKernel(e.textModel);if(s){for(const[o,r]of this._kernels)if(r[0]===s){this._proxy.$acceptKernelMessageFromRenderer(o,e.getId(),i.message);break}}});this._editors.set(e,t)}_onEditorRemove(e){this._editors.deleteAndDispose(e)}async $postMessage(e,t,i){const s=this._kernels.get(e);if(!s)throw new Error("kernel already disposed");const[o]=s;let r=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===o){if(t===void 0)a.postMessage(i),r=!0;else if(a.getId()===t){a.postMessage(i),r=!0;break}}return r}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,s=new class extends EYt{async executeNotebookCellsRequest(a,c){await i._proxy.$executeCells(e,a,c)}async cancelNotebookCellExecution(a,c){await i._proxy.$cancelCells(e,a,c)}provideVariables(a,c,l,d,h){const u=`${e}variables${i.variableRequestIndex++}`;if(i.variableRequestMap.has(u))return i.variableRequestMap.get(u).asyncIterable;const f=new M9;return i.variableRequestMap.set(u,f),i._proxy.$provideVariables(e,u,a,c,l,d,h).then(()=>{f.resolve(),i.variableRequestMap.delete(u)}).catch(p=>{f.reject(p),i.variableRequestMap.delete(u)}),f.asyncIterable}}(t,this._languageService),o=this._notebookKernelService.onDidChangeSelectedNotebooks(a=>{a.oldKernel===s.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===s.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(s);this._kernels.set(e,[s,pa(o,r)])}$updateKernel(e,t){const i=this._kernels.get(e);i&&i[0].update(t)}$removeKernel(e){const t=this._kernels.get(e);t&&(t[1].dispose(),this._kernels.delete(e))}$updateNotebookPriority(e,t,i){const s=this._kernels.get(e);s&&this._notebookKernelService.updateKernelNotebookAffinity(s[0],P.revive(t),i)}$createExecution(e,t,i,s){const o=P.revive(i),r=this._notebookService.getNotebookTextModel(o);if(!r)throw new Error(`Notebook not found: ${o.toString()}`);const a=this._notebookKernelService.getMatchingKernel(r);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(o,s);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(vm.fromCellExecuteUpdateDto))}catch(s){bt(s)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(vm.fromCellExecuteCompleteDto(t.value))}catch(i){bt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const s=P.revive(i),o=this._notebookService.getNotebookTextModel(s);if(!o)throw new Error(`Notebook not found: ${s.toString()}`);const r=this._notebookKernelService.getMatchingKernel(o);if(!r.selected||r.selected.id!==t)throw new Error(`Kernel is not selected: ${r.selected?.id} !== ${t}`);const a=this._notebookExecutionStateService.createExecution(s);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){bt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){bt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new xYt(t),s=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,s])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const s={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,qe.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=P.revive(a.documentation)),{label:a.label,command:a.command,description:a.description,detail:a.detail,documentation:c}})};if(typeof t=="number"){const r=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,r),s.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,s);this._kernelSourceActionProviders.set(e,[s,o])}$removeKernelSourceActionProvider(e,t){const i=this._kernelSourceActionProviders.get(e);i&&(i[1].dispose(),this._kernelSourceActionProviders.delete(e)),typeof t=="number"&&this._kernelSourceActionProvidersEventRegistrations.delete(t)}$emitNotebookKernelSourceActionsChangeEvent(e){const t=this._kernelSourceActionProvidersEventRegistrations.get(e);t instanceof I&&t.fire(void 0)}$variablesUpdated(e){this._notebookKernelService.notifyVariablesChange(P.revive(e))}};w9e=D([en(Ue.MainThreadNotebookKernels),_(1,Di),_(2,jZe),_(3,QZe),_(4,oD),_(5,xQ)],w9e);let g0e=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new wi,this._proxy=e.getProxy(et.ExtHostNotebookDocuments),this._modelReferenceCollection=new Zot(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(s=>this._proxy.$acceptDirtyStateChanged(s.resource,s.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(s=>this._proxy.$acceptModelSaved(s))),this._disposables.add(t.onWillFailWithConflict(s=>{this._modelReferenceCollection.remove(s.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),St(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(s=>{const o={versionId:s.versionId,rawEvents:[]};for(const a of s.rawEvents)switch(a.kind){case vd.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>vm.toNotebookCellDto(l))])});break;case vd.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case vd.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(vm.toNotebookOutputDto)});break;case vd.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(vm.toNotebookOutputItemDto),append:a.append});break;case vd.ChangeCellLanguage:case vd.ChangeCellContent:case vd.ChangeCellMetadata:case vd.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=s.rawEvents.find(a=>a.kind===vd.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new $h(o),this._notebookEditorModelResolverService.isDirty(t.uri),r?t.metadata:void 0)})),this._documentEventListenersMapping.set(t.uri,i)}}handleNotebooksRemoved(e){for(const t of e)this._documentEventListenersMapping.get(t)?.dispose(),this._documentEventListenersMapping.delete(t)}async $tryCreateNotebook(e){const t=await this._notebookEditorModelResolverService.resolve({untitledResource:void 0},e.viewType);if(t.object.notebook.onWillDispose(()=>{t.dispose()}),this._proxy.$acceptDirtyStateChanged(t.object.resource,!0),e.content){const i=vm.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),s=await i.object.save();return i.dispose(),s}};g0e=D([_(1,Jde),_(2,_o)],g0e);class DYt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let f0e=class{constructor(e,t,i,s,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=s,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(et.ExtHostNotebookEditors),this._editorService.onDidActiveEditorChange(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidRemoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidMoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables)}dispose(){this._disposables.dispose(),St(this._mainThreadEditors.values())}handleEditorsAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeVisibleRanges(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{visibleRanges:{ranges:t.visibleRanges}})})),i.add(t.onDidChangeSelection(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{selections:{selections:t.getSelections()}})}));const s=new DYt(t,i);this._mainThreadEditors.set(t.getId(),s)}}handleEditorsRemoved(e){for(const t of e)this._mainThreadEditors.get(t)?.dispose(),this._mainThreadEditors.delete(t)}_updateEditorViewColumns(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=tH(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=U1(this._editorGroupService,t.group))}Io(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const s={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?y1.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:P.revive(e),options:s},ane(this._editorGroupService,this._configurationService,i.position)),r=tH(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const s=this._notebookEditorService.getNotebookEditor(e);if(!s)return;const o=s;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case C2.Default:return o.revealCellRangeInView(t);case C2.InCenter:return o.revealInCenter(r);case C2.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case C2.AtTop:return o.revealInViewAtTop(r)}}$trySetSelections(e,t){const i=this._notebookEditorService.getNotebookEditor(e);i&&(i.setSelections(t),t.length&&i.setFocus({start:t[0].start,end:t[0].start+1}))}};f0e=D([_(1,_i),_(2,xQ),_(3,ur),_(4,Re)],f0e);var OX;class b9e{static delta(e,t){if(!e)return{addedDocuments:[...t.documents],removedDocuments:[],addedEditors:[...t.textEditors.values()],removedEditors:[],visibleEditors:[...t.visibleEditors].map(a=>a[0])};const i=Ple(e.documents,t.documents),s=m_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=m_e(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:s.added,removedEditors:s.removed.map(a=>a.getId()),newActiveEditor:o,visibleEditors:r.added.length===0&&r.removed.length===0?void 0:[...t.visibleEditors].map(a=>a[0])}}constructor(e,t,i,s){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=s}}let C9e=OX=class{constructor(e,t,i,s,o,r,a){this._notebookService=i,this._notebookEditorService=s,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new Zo,this._proxy=e.getProxy(et.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(g0e,e),this._mainThreadEditors=t.createInstance(f0e,e),e.set(Ue.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Ue.MainThreadNotebookEditors,this._mainThreadEditors),this._notebookService.onWillAddNotebookDocument(()=>this._updateState(),this,this._disposables),this._notebookService.onDidRemoveNotebookDocument(()=>this._updateState(),this,this._disposables),this._editorService.onDidActiveEditorChange(()=>this._updateState(),this,this._disposables),this._editorService.onDidVisibleEditorsChange(()=>this._updateState(),this,this._disposables),this._notebookEditorService.onDidAddNotebookEditor(this._handleEditorAdd,this,this._disposables),this._notebookEditorService.onDidRemoveNotebookEditor(this._handleEditorRemove,this,this._disposables),this._updateState()}dispose(){this._mainThreadNotebooks.dispose(),this._mainThreadEditors.dispose(),this._disposables.dispose(),this._editorListeners.dispose()}_handleEditorAdd(e){this._editorListeners.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusWidget(()=>this._updateState(e)))),this._updateState()}_handleEditorRemove(e){this._editorListeners.deleteAndDispose(e.getId()),this._updateState()}_updateState(e){const t=new Map,i=new Map;for(const a of this._notebookEditorService.listNotebookEditors())a.hasModel()&&t.set(a.getId(),a);const s=tH(this._editorService.activeEditorPane);let o=null;s?o=s.getId():e?.textModel&&(o=e.getId()),o&&!t.has(o)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",o,t.keys()),o=null);for(const a of this._editorService.visibleEditorPanes){const c=tH(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new b9e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(b9e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(OX._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(OX._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new $h(t)),this._mainThreadEditors.handleEditorsRemoved(e.removedEditors),this._mainThreadNotebooks.handleNotebooksRemoved(e.removedDocuments),this._mainThreadNotebooks.handleNotebooksAdded(e.addedDocuments),this._mainThreadEditors.handleEditorsAdded(e.addedEditors)}static _isDeltaEmpty(e){return!(e.addedDocuments!==void 0&&e.addedDocuments.length>0||e.removedDocuments!==void 0&&e.removedDocuments.length>0||e.addedEditors!==void 0&&e.addedEditors.length>0||e.removedEditors!==void 0&&e.removedEditors.length>0||e.visibleEditors!==void 0&&e.visibleEditors.length>0||e.newActiveEditor!==void 0)}static _asModelAddData(e){return{viewType:e.viewType,uri:e.uri,metadata:e.metadata,versionId:e.versionId,cells:e.cells.map(vm.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>tH(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&U1(this._editorGroupService,t.group)}}};C9e=OX=D([TO,_(1,be),_(2,oD),_(3,xQ),_(4,_i),_(5,ur),_(6,Ze)],C9e);let y9e=class extends ${constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(et.ExtHostNotebookRenderers),this._register(t.onShouldPostMessage(i=>{this.proxy.$postRendererMessage(i.editorId,i.rendererId,i.message)}))}$postMessage(e,t,i){return this.messaging.receiveMessage(e,t,i)}};y9e=D([en(Ue.MainThreadNotebookRenderers),_(1,KZe)],y9e);var BG;(function(n){n[n.Save=1]="Save",n[n.Backup=2]="Backup"})(BG||(BG={}));var BX;const Wu="vs/workbench/services/workingCopy/common/storedFileWorkingCopy";var Zm;(function(n){n[n.SAVED=0]="SAVED",n[n.DIRTY=1]="DIRTY",n[n.PENDING_SAVE=2]="PENDING_SAVE",n[n.CONFLICT=3]="CONFLICT",n[n.ORPHAN=4]="ORPHAN",n[n.ERROR=5]="ERROR"})(Zm||(Zm={}));var QP;let S9e=(QP=class extends Roe{get model(){return this._model}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(t,r),this.typeId=e,this.name=i,this.modelFactory=s,this.externalResolver=o,this.logService=a,this.workingCopyFileService=c,this.filesConfigurationService=l,this.workingCopyBackupService=d,this.notificationService=u,this.workingCopyEditorService=f,this.editorService=p,this.elevatedFileService=m,this.capabilities=JS.None,this._model=void 0,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.dirty=!1,this.ignoreDirtyOnModelContentChange=!1,this.versionId=0,this.lastContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.ignoreSaveFromSaveParticipants=!1,this.inConflictMode=!1,this.inErrorMode=!1,this._register(h.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}isDirty(){return this.dirty}markModified(){this.setDirty(!0)}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.savedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.isResolved()&&(this.savedVersionId=this.model.versionId)),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.savedVersionId=o}}isResolved(){return!!this.model}async resolve(e){if(this.trace("resolve() - enter"),this.isDisposed()){this.trace("resolve() - exit - without resolving because file working copy is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because file working copy is dirty or being saved");return}return this.doResolve(e)}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents);if(!(!this.isResolved()&&await this.resolveFromBackup()))return this.resolveFromFile(e)}async resolveFromBuffer(e){this.trace("resolveFromBuffer()");let t,i,s,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,s=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),s=0,o=zv,this.setOrphaned(r.fileOperationResult===Zi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:s,etag:o,value:e,readonly:!1,locked:!1},!0)}async resolveFromBackup(){const e=await this.workingCopyBackupService.resolve(this);return this.isResolved()?(this.trace("resolveFromBackup() - exit - withoutresolving because previously new file working copy got created meanwhile"),!0):e?(await this.doResolveFromBackup(e),!0):!1}async doResolveFromBackup(e){this.trace("doResolveFromBackup()"),await this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:e.value,readonly:!1,locked:!1},!0),e.meta&&e.meta.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile;let i;t?i=zv:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const s=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),s!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because file working copy content changed");return}await this.resolveFromContent(o,!1)}catch(o){const r=o.fileOperationResult;if(this.setOrphaned(r===Zi.FILE_NOT_FOUND),this.isResolved()&&r===Zi.FILE_NOT_MODIFIED_SINCE){o instanceof P$&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Zi.FILE_NOT_FOUND&&!t)return;throw o}}async resolveFromContent(e,t){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because working copy is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0}),this.isResolved()?await this.doUpdateModel(e.value):await this.doCreateModel(e.value),this.setDirty(!!t),this._onDidResolve.fire()}async doCreateModel(e){this.trace("doCreateModel()"),this._model=this._register(await this.modelFactory.createModel(this.resource,e,qe.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,qe.None)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onWillDispose(()=>this.dispose()))}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.versionId===this.savedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire()}async forceResolveFromFile(){this.isDisposed()||await this.externalResolver({forceReadFromFile:!0})}get backupDelay(){return this.model?.configuration?.backupDelay}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.isOrphaned()});let i;return this.isResolved()&&(i=await dw(this.model.snapshot(BG.Backup,e),e)),{meta:t,content:i}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(Zm.CONFLICT)||this.hasState(Zm.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for file working copy that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(Zm.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.model.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastContentChangeFromUndoRedo;r{try{const r={mtime:s.mtime,etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource)?zv:s.etag,unlock:e.writeUnlock};let a;if(typeof o.model.save=="function")try{a=await o.model.save(r,i.token)}catch(c){if(i.token.isCancellationRequested)return;throw c}else{const c=await dw(o.model.snapshot(BG.Save,i.token),i.token);if(i.token.isCancellationRequested)return;i.dispose(),e?.writeElevated&&this.elevatedFileService.isSupported(s.resource)?a=await this.elevatedFileService.writeFileElevated(s.resource,ws(c),r):a=await this.fileService.writeFile(s.resource,ws(c),r)}this.handleSaveSuccess(a,t,e)}catch(r){this.handleSaveError(r,t,e)}})(),()=>i.cancel())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[stored file working copy] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString(),this.typeId]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Zi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,s=[];let o;if(i.fileOperationResult===Zi.FILE_MODIFIED_SINCE)o=g(Wu,0,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),s.push(_l({id:"fileWorkingCopy.overwrite",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Zi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Zi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);fSt(e)&&s.push(...e.actions),h&&(d||l)?s.push(_l({id:"fileWorkingCopy.saveElevated",label:l?Is?g(Wu,3,"Overwrite as Admin..."):g(Wu,4,"Overwrite as Sudo..."):Is?g(Wu,5,"Retry as Admin..."):g(Wu,6,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Ln.EXPLICIT})}})):c?s.push(_l({id:"fileWorkingCopy.unlock",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Ln.EXPLICIT})})):s.push(_l({id:"fileWorkingCopy.retry",label:g(Wu,7,"Retry"),run:()=>this.save({...t,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.saveAs",label:g(Wu,8,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Ln.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()})),c?l&&h?o=Is?g(Wu,9,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(Wu,10,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(Wu,11,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Is?g(Wu,12,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(Wu,13,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(Wu,14,"Failed to save '{0}': {1}",this.name,Ma(e,!1))}const r=this.notificationService.notify({id:`${Ed(this.resource.toString())}`,severity:nt.Error,message:o,actions:{primary:s}}),a=this._register(T.once(T.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(T.once(r.onDidClose)(()=>a.dispose()))}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}async revert(e){if(!this.isResolved()||!this.dirty&&!e?.force)return;this.trace("revert()");const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Zi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Zm.CONFLICT:return this.inConflictMode;case Zm.DIRTY:return this.dirty;case Zm.ERROR:return this.inErrorMode;case Zm.ORPHAN:return this.isOrphaned();case Zm.PENDING_SAVE:return this.saveSequentializer.isRunning();case Zm.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}trace(e){this.logService.trace(`[stored file working copy] ${e}`,this.resource.toString(),this.typeId)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inErrorMode=!1,this._model=void 0,super.dispose()}},BX=QP,QP.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,QP);S9e=BX=D([_(5,ci),_(6,Ze),_(7,fC),_(8,hh),_(9,MQ),_(10,Pw),_(11,Pi),_(12,Iet),_(13,_i),_(14,IQ)],S9e);var FB;let A9e=FB=class extends pL{constructor(e,t,i,s,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=s,this._filesConfigurationService=r,this._onDidChangeDirty=this._register(new I),this._onDidSave=this._register(new I),this._onDidChangeOrphaned=this._register(new I),this._onDidChangeReadonly=this._register(new I),this._onDidRevertUntitled=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidSave=this._onDidSave.event,this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.onDidRevertUntitled=this._onDidRevertUntitled.event,this._workingCopyListeners=this._register(new Z),this.scratchPad=o}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return FB._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Zm.ORPHAN)}hasAssociatedFilePath(){return!FB._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Zm.ERROR):!1}revert(e){return Bt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Bt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===_e.untitled?(this._hasAssociatedFilePath?this._workingCopy=await this._workingCopyManager.resolve({associatedResource:this.resource}):this._workingCopy=await this._workingCopyManager.resolve({untitledResource:this.resource,isScratchpad:this.scratchPad}),this._workingCopy.onDidRevert(()=>this._onDidRevertUntitled.fire())):(this._workingCopy=await this._workingCopyManager.resolve(this.resource,{limits:e?.limits,reload:e?.forceReadFromFile?{async:!1,force:!0}:void 0}),this._workingCopyListeners.add(this._workingCopy.onDidSave(t=>this._onDidSave.fire(t))),this._workingCopyListeners.add(this._workingCopy.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._workingCopyListeners.add(this._workingCopy.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(()=>this._onDidChangeDirty.fire(),void 0)),this._workingCopyListeners.add(this._workingCopy.onWillDispose(()=>{this._workingCopyListeners.clear(),this._workingCopy?.model?.dispose()}))):await this._workingCopyManager.resolve(this.resource,{reload:{async:!e?.forceReadFromFile,force:e?.forceReadFromFile},limits:e?.limits}),Bt(this.isResolved()),this}async saveAs(e){const t=await this._workingCopyManager.saveAs(this.resource,e);if(t)return{resource:t.resource}}static _isStoredFileWorkingCopy(e){return!(e&&e.capabilities&JS.Untitled)}};A9e=FB=D([_(5,hh)],A9e);class yrt extends ${constructor(e,t,i,s){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.configuration=void 0,this.onWillDispose=e.onWillDispose.bind(e),this._register(e.onDidChangeContent(r=>{for(const a of r.rawEvents)if(a.kind!==vd.Initialize&&!a.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const o=this._configurationService.getValue(ike.remoteSaving);(o||e.uri.scheme===_e.vscodeRemote)&&(this.configuration={backupDelay:1e4}),o&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){const e=await this.getNotebookSerializer();this.save=async(t,i)=>{if(i.isCancellationRequested)throw new Rc;try{return await e.save(this._notebookModel.uri,this._notebookModel.versionId,t,i)}catch(s){throw i.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===_e.vscodeRemote,error:s}),s}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),s={metadata:YX(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let o=0;for(const a of this._notebookModel.cells){const c={cellKind:a.cellKind,language:a.language,mime:a.mime,source:a.getValue(),outputs:[],internalMetadata:a.internalMetadata},l=this._configurationService.getValue(ike.outputBackupSizeLimit)*1024;if(e===BG.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{o+=h.data.byteLength})}),o>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=YX(a.metadata,d=>!i.options.transientCellMetadata[d]),s.cells.push(c)}const r=await i.notebookToData(s);if(t.isCancellationRequested)throw new Rc;return aQ(r)}async update(e,t){const i=await this.getNotebookSerializer(),s=await II(e),o=await i.dataToNotebook(s);if(t.isCancellationRequested)throw new Rc;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof tj))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let E9e=class{constructor(e,t,i,s){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s}async createModel(e,t,i){const s=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(s instanceof tj))throw new Error("CANNOT open file notebook with this provider");const o=await II(t),r=await s.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Rc;const a=this._notebookService.createNotebookTextModel(s.viewType,e,r,s.serializer.options);return new yrt(a,this._notebookService,this._configurationService,this._telemetryService)}};E9e=D([_(1,oD),_(2,Re),_(3,rn)],E9e);const kYt="vs/workbench/api/browser/mainThreadNotebookSaveParticipant";let IYt=class{constructor(e){this._proxy=e.getProxy(et.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.model||!(e.model instanceof yrt))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(kYt,0,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,s).then(l=>{clearTimeout(o)}).then(a,c)});return qle(r,s)}},x9e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(IYt,e))}dispose(){this._saveParticipantDisposable.dispose()}};x9e=D([TO,_(1,be),_(2,fC)],x9e);let D9e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` -`,Yc,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};D9e=D([en(Ue.MainThreadInteractive),_(1,RPe)],D9e);const D8="vs/workbench/contrib/tasks/common/taskDefinitionRegistry",LYt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(D8,0,"The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:g(D8,1,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(D8,2,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:""}}};var p0e;(function(n){function e(t,i,s){if(!t)return;const o=$t(t.type)?t.type:void 0;if(!o||o.length===0){s.error(g(D8,3,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)$t(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?Vs(t.properties):{},when:t.when?ge.deserialize(t.when):void 0}}n.from=e})(p0e||(p0e={}));const TYt=Ap.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(n,e)=>{for(const t of n)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(D8,4,"Contributes task kinds"),type:"array",items:LYt}});class RYt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{TYt.setHandler((i,s)=>{this._schema=void 0;try{for(const o of s.removed){const r=o.value;for(const a of r)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const o of s.added){const r=o.value;for(const a of r){const c=p0e.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(s.removed.length>0||s.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){const e=[];for(const t of this.all()){const i={type:"object",additionalProperties:!1};t.required.length>0&&(i.required=t.required.slice(0)),t.properties!==void 0?i.properties=Vs(t.properties):i.properties=Object.create(null),i.properties.type={type:"string",enum:[t.taskType]},e.push(i)}this._schema={oneOf:e}}return this._schema}}const MYt=new RYt,POe="vs/workbench/contrib/tasks/common/tasks",Srt="settings";new Y("taskRunning",!1,g(POe,0,"Whether a task is currently running."));Be(POe,1,"Tasks");var Foe;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(Foe||(Foe={}));const Art="$customized";(function(n){function e(t){if(!t)return n.Strong;switch(t.toLowerCase()){case"escape":return n.Escape;case"strong":return n.Strong;case"weak":return n.Weak;default:return n.Strong}}n.from=e})(Foe||(Foe={}));var WG;(function(n){n.defaults={cwd:"${workspaceFolder}"}})(WG||(WG={}));var HG;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(HG||(HG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"silent":return n.Silent;case"never":return n.Never;default:return n.Always}}n.fromString=e})(HG||(HG={}));var UG;(function(n){n[n.Never=1]="Never",n[n.OnProblem=2]="OnProblem",n[n.Always=3]="Always"})(UG||(UG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"never":return n.Never;case"onproblem":return n.OnProblem;default:return n.OnProblem}}n.fromString=e})(UG||(UG={}));var VG;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(VG||(VG={}));(function(n){function e(t){switch(t.toLowerCase()){case"shared":return n.Shared;case"dedicated":return n.Dedicated;case"new":return n.New;default:return n.Shared}}n.fromString=e})(VG||(VG={}));var Ooe;(function(n){n.defaults={echo:!0,reveal:HG.Always,revealProblems:UG.Never,focus:!1,panel:VG.Shared,showReuseMessage:!0,clear:!1}})(Ooe||(Ooe={}));var x_;(function(n){n[n.Shell=1]="Shell",n[n.Process=2]="Process",n[n.CustomExecution=3]="CustomExecution"})(x_||(x_={}));(function(n){function e(i){switch(i.toLowerCase()){case"shell":return n.Shell;case"process":return n.Process;case"customExecution":return n.CustomExecution;default:return n.Process}}n.fromString=e;function t(i){switch(i){case n.Shell:return"shell";case n.Process:return"process";case n.CustomExecution:return"customExecution";default:return"process"}}n.toString=t})(x_||(x_={}));var k9e;(function(n){function e(t){return $t(t)?t:t.value}n.value=e})(k9e||(k9e={}));var I9e;(function(n){n.Clean={_id:"clean",isDefault:!1},n.Build={_id:"build",isDefault:!1},n.Rebuild={_id:"rebuild",isDefault:!1},n.Test={_id:"test",isDefault:!1};function e(i){return i===n.Clean._id||i===n.Build._id||i===n.Rebuild._id||i===n.Test._id}n.is=e;function t(i){if(i!==void 0)return $t(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}n.from=t})(I9e||(I9e={}));var Ek;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.Folder=3]="Folder"})(Ek||(Ek={}));var Ex;(function(n){n.Workspace="workspace",n.Extension="extension",n.InMemory="inMemory",n.WorkspaceFile="workspaceFile",n.User="user";function e(t){switch(t){case n.User:return Ot.USER;case n.WorkspaceFile:return Ot.WORKSPACE;default:return Ot.WORKSPACE_FOLDER}}n.toConfigurationTarget=e})(Ex||(Ex={}));var L9e;(function(n){n.parallel="parallel",n.sequence="sequence"})(L9e||(L9e={}));var m0e;(function(n){n[n.default=1]="default",n[n.folderOpen=2]="folderOpen"})(m0e||(m0e={}));var Boe;(function(n){n.defaults={reevaluateOnRerun:!0,runOn:m0e.default,instanceLimit:1}})(Boe||(Boe={}));class FOe{constructor(e,t,i,s,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=s,this.configurationProperties=o,this._source=r}getDefinition(e){}getMapKey(){return this._id}getKey(){}getCommonTaskId(){const e={folder:this.getFolderId(),id:this._id};return JSON.stringify(e)}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(e,t=!1){if(e===void 0)return!1;if($t(e))return e===this._label||e===this.configurationProperties.identifier||t&&e===this._id;const i=this.getDefinition(!0);return i!==void 0&&i._key===e._key}getQualifiedLabel(){const e=this.getWorkspaceFolder();return e?`${this._label} (${e.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(e){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),e&&(this._taskLoadMessages=this._taskLoadMessages.concat(e))}get taskLoadMessages(){return this._taskLoadMessages}}class k8 extends FOe{constructor(e,t,i,s,o,r,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=r,o&&(this.command=o)}clone(){return new k8(this._id,this._source,this._label,this.type,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(e=!1){if(e&&this._source.customizes!==void 0)return this._source.customizes;{let t;switch(this.command?this.command.runtime:void 0){case x_.Shell:t="shell";break;case x_.Process:t="process";break;case x_.CustomExecution:t="customExecution";break;case void 0:t="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:t,_key:this._id,id:this._id}}}static is(e){return e instanceof k8}getMapKey(){const e=this._source.config.workspaceFolder;return e?`${e.uri.toString()}|${this._id}|${this.instance}`:`${this._id}|${this.instance}`}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getCommonTaskId(){return this._source.customizes?super.getCommonTaskId():this.getKey()??super.getCommonTaskId()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new k8(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class I8 extends FOe{constructor(e,t,i,s,o,r,a){super(e,i,s,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof I8}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}}class GM extends FOe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,s,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new GM(this._id,this._source,this._label,this.type,this.defines,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}getDefinition(){return this.defines}static is(e){return e instanceof GM}getMapKey(){const e=this._source.workspaceFolder;return e?`${this._source.scope.toString()}|${e.uri.toString()}|${this._id}|${this.instance}`:`${this._source.scope.toString()}|${this._id}|${this.instance}`}getFolderId(){if(this._source.scope===Ek.Folder&&this._source.workspaceFolder)return this._source.workspaceFolder.uri.toString()}getKey(){const e={type:"contributed",scope:this._source.scope,id:this._id};return e.folder=this.getFolderId(),JSON.stringify(e)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(e){return new GM(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var Woe;(function(n){n[n.Process=1]="Process",n[n.Terminal=2]="Terminal"})(Woe||(Woe={}));(function(n){n._default=n.Terminal})(Woe||(Woe={}));var T9e;(function(n){n[n.V0_1_0=1]="V0_1_0",n[n.V2_0_0=2]="V2_0_0"})(T9e||(T9e={}));var Nv;(function(n){n.DependsOnStarted="dependsOnStarted",n.AcquiredInput="acquiredInput",n.Start="start",n.ProcessStarted="processStarted",n.Active="active",n.Inactive="inactive",n.Changed="changed",n.Terminated="terminated",n.ProcessEnded="processEnded",n.End="end"})(Nv||(Nv={}));var Hoe;(function(n){n.SingleRun="singleRun",n.Background="background"})(Hoe||(Hoe={}));var R9e;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.FolderOpen=2]="FolderOpen",n[n.ConfigurationChange=3]="ConfigurationChange",n[n.Reconnect=4]="Reconnect"})(R9e||(R9e={}));var M9e;(function(n){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Hoe.Background:Hoe.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:Nv.Start,terminalId:l,resolvedVariables:d}}n.start=t;function i(c,l,d){return{...e(c),kind:Nv.ProcessStarted,terminalId:l,processId:d}}n.processStarted=i;function s(c,l,d){return{...e(c),kind:Nv.ProcessEnded,terminalId:l,exitCode:d}}n.processEnded=s;function o(c,l,d){return{...e(c),kind:Nv.Terminated,exitReason:d,terminalId:l}}n.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}n.general=r;function a(){return{kind:Nv.Changed}}n.changed=a})(M9e||(M9e={}));var Uoe;(function(n){function e(i){const s=Object.keys(i).sort();let o="";for(const r of s){let a=i[r];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),o+=r+","+a+","}return o}function t(i){const o={_key:e(i),type:i.taskType};return Object.assign(o,i),o}n.create=t})(Uoe||(Uoe={}));var N9e;(function(n){n.AutoDetect="task.autoDetect",n.SaveBeforeRun="task.saveBeforeRun",n.ShowDecorations="task.showDecorations",n.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",n.SlowProviderWarning="task.slowProviderWarning",n.QuickOpenHistory="task.quickOpen.history",n.QuickOpenDetail="task.quickOpen.detail",n.QuickOpenSkip="task.quickOpen.skip",n.QuickOpenShowAll="task.quickOpen.showAll",n.AllowAutomaticTasks="task.allowAutomaticTasks",n.Reconnection="task.reconnection",n.VerboseLogging="task.verboseLogging"})(N9e||(N9e={}));var P9e;(function(n){n.Tasks="tasks",n.SuppressTaskName="tasks.suppressTaskName",n.Windows="tasks.windows",n.Osx="tasks.osx",n.Linux="tasks.linux",n.ShowOutput="tasks.showOutput",n.IsShellCommand="tasks.isShellCommand",n.ServiceTestSetting="tasks.service.testSetting"})(P9e||(P9e={}));var _0e;(function(n){function e(t,i){const s=MYt.get(t.type);if(s===void 0){const c=Vs(t);return delete c._key,Uoe.create(c)}const o=Object.create(null);o.type=s.taskType;const r=new Set;s.required.forEach(c=>r.add(c));const a=s.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)o[c]=l;else if(r.has(c)){const d=a[c];if(d.default!==void 0)o[c]=Vs(d.default);else switch(d.type){case"boolean":o[c]=!1;break;case"number":case"integer":o[c]=0;break;case"string":o[c]="";break;default:i.error(g(POe,2,"Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.",JSON.stringify(t,void 0,0),c));return}}}return Uoe.create(o)}n.createTaskIdentifier=e})(_0e||(_0e={}));const NYt="vs/workbench/api/browser/mainThreadTask";var Voe;(function(n){function e(t){return{id:t.id,task:Pp.from(t.task)}}n.from=e})(Voe||(Voe={}));var v0e;(function(n){function e(t,i){return{id:t.id,processId:i}}n.from=e})(v0e||(v0e={}));var w0e;(function(n){function e(t,i){return{id:t.id,exitCode:i}}n.from=e})(w0e||(w0e={}));var zoe;(function(n){function e(i){const s=Object.assign(Object.create(null),i);return delete s._key,s}n.from=e;function t(i,s){let o=_0e.createTaskIdentifier(i,console);return o===void 0&&s&&(o={_key:Dr(),type:"$executeOnly"}),o}n.to=t})(zoe||(zoe={}));var $oe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Ooe.defaults:Object.assign(Object.create(null),Ooe.defaults,i)}n.to=t})($oe||($oe={}));var Goe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Boe.defaults:Object.assign(Object.create(null),Boe.defaults,i)}n.to=t})(Goe||(Goe={}));var qoe;(function(n){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}n.from=e;function t(i){return i==null?WG.defaults:{cwd:i.cwd||WG.defaults.cwd,env:i.env}}n.to=t})(qoe||(qoe={}));var L8;(function(n){function e(s){const o=s;return o&&!!o.process}n.is=e;function t(s){const o=$t(s.name)?s.name:s.name.value,r=s.args?s.args.map(c=>$t(c)?c:c.value):[],a={process:o,args:r};return s.options&&(a.options=qoe.from(s.options)),a}n.from=t;function i(s){const o={runtime:x_.Process,name:s.process,args:s.args,presentation:void 0};return o.options=qoe.to(s.options),o}n.to=i})(L8||(L8={}));var Qoe;(function(n){function e(i){if(i==null)return;const s={cwd:i.cwd||WG.defaults.cwd,env:i.env};return i.shell&&(s.executable=i.shell.executable,s.shellArgs=i.shell.args,s.shellQuoting=i.shell.quoting),s}n.from=e;function t(i){if(i==null)return;const s={cwd:i.cwd,env:i.env};return i.executable&&(s.shell={executable:i.executable},i.shellArgs&&(s.shell.args=i.shellArgs),i.shellQuoting&&(s.shell.quoting=i.shellQuoting)),s}n.to=t})(Qoe||(Qoe={}));var T8;(function(n){function e(s){const o=s;return o&&(!!o.commandLine||!!o.command)}n.is=e;function t(s){const o={};return s.name&&$t(s.name)&&(s.args===void 0||s.args===null||s.args.length===0)?o.commandLine=s.name:(o.command=s.name,o.args=s.args),s.options&&(o.options=Qoe.from(s.options)),o}n.from=t;function i(s){const o={runtime:x_.Shell,name:s.commandLine?s.commandLine:s.command,args:s.args,presentation:void 0};return s.options&&(o.options=Qoe.to(s.options)),o}n.to=i})(T8||(T8={}));var RR;(function(n){function e(s){const o=s;return o&&o.customExecution==="customExecution"}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s){return{runtime:x_.CustomExecution,presentation:void 0}}n.to=i})(RR||(RR={}));var joe;(function(n){function e(i){const s={label:i.label};return i.kind===Ex.Extension?(s.extensionId=i.extension,i.workspaceFolder?s.scope=i.workspaceFolder.uri:s.scope=i.scope):i.kind===Ex.Workspace&&(s.extensionId="$core",s.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:Ek.Global),s}n.from=e;function t(i,s){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==Ek.Global?s.getWorkspace().folders.length===0?(o=Ek.Global,r=void 0):(o=Ek.Folder,r=s.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=Ek.Folder,r=s.getWorkspaceFolder(P.revive(i.scope))??void 0),{kind:Ex.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}n.to=t})(joe||(joe={}));var Koe;(function(n){function e(t){const i=t;return i&&$t(i.id)&&!!i.workspaceFolder}n.is=e})(Koe||(Koe={}));var Pp;(function(n){function e(i){if(i==null||!k8.is(i)&&!GM.is(i)&&!I8.is(i))return;const s={_id:i._id,name:i.configurationProperties.name,definition:zoe.from(i.getDefinition(!0)),source:joe.from(i._source),execution:void 0,presentationOptions:!I8.is(i)&&i.command?$oe.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:GM.is(i)?i.hasDefinedMatchers:!1,runOptions:Goe.from(i.runOptions)};if(s.group=b0e.from(i.configurationProperties.group),i.configurationProperties.detail&&(s.detail=i.configurationProperties.detail),!I8.is(i)&&i.command)switch(i.command.runtime){case x_.Process:s.execution=L8.from(i.command);break;case x_.Shell:s.execution=T8.from(i.command);break;case x_.CustomExecution:s.execution=RR.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)$t(o)&&s.problemMatchers.push(o);return s}n.from=e;function t(i,s,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(T8.is(i.execution)?c=T8.to(i.execution):L8.is(i.execution)?c=L8.to(i.execution):RR.is(i.execution)&&(c=RR.to(i.execution))),!c)return;c.presentation=$oe.to(i.presentationOptions);const l=joe.to(i.source,s),d=g(NYt,0,"{0}: {1}",l.label,i.name),h=zoe.to(i.definition,o),u=RR.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new GM(u,l,d,h.type,h,c,i.hasDefinedMatchers,Goe.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:r,hide:a})}n.to=t})(Pp||(Pp={}));var b0e;(function(n){function e(t){if(t!==void 0)return{_id:typeof t=="string"?t:t._id,isDefault:typeof t=="string"||typeof t.isDefault=="string"?!1:t.isDefault}}n.from=e})(b0e||(b0e={}));var C0e;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(C0e||(C0e={}));let F9e=class extends ${constructor(e,t,i,s){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=s,this._proxy=e.getProxy(et.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===Nv.Changed)return;const r=o.__task;if(o.kind===Nv.Start){const a=Voe.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&RR.is(a.task.execution)&&o.resolvedVariables){const l={};for(const[d,h]of o.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(r.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,o.terminalId,c)}else o.kind===Nv.ProcessStarted?this._proxy.$onDidStartTaskProcess(v0e.from(r.getTaskExecution(),o.processId)):o.kind===Nv.ProcessEnded?this._proxy.$onDidEndTaskProcess(w0e.from(r.getTaskExecution(),o.exitCode)):o.kind===Nv.End&&this._proxy.$OnDidEndTask(Voe.from(r.getTaskExecution()))}))}dispose(){for(const e of this._providers.values())e.disposable.dispose();this._providers.clear(),super.dispose()}$createTaskId(e){return new Promise((t,i)=>{const s=Pp.to(e,this._workspaceContextServer,!0);s?t(s._id):i(new Error("Task could not be created from DTO"))})}$registerTaskProvider(e,t){const i={provideTasks:o=>Promise.resolve(this._proxy.$provideTasks(e,o)).then(r=>{const a=[];for(const c of r.tasks){const l=Pp.to(c,this._workspaceContextServer,!0);l?a.push(l):console.error(`Task System: can not convert task: ${JSON.stringify(c.definition,void 0,0)}. Task will be dropped`)}return{tasks:a,extension:r.extension}}),resolveTask:o=>{const r=Pp.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Pp.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},s=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:s,provider:i}),Promise.resolve(void 0)}$unregisterTaskProvider(e){const t=this._providers.get(e);return t&&(t.disposable.dispose(),this._providers.delete(e)),Promise.resolve(void 0)}$fetchTasks(e){return this._taskService.tasks(C0e.to(e)).then(t=>{const i=[];for(const s of t){const o=Pp.from(s);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),s=P.revive(e);i.configuration?.toString()===s.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(s)}return t}async $getTaskExecution(e){if(Koe.is(e)){const t=this.getWorkspace(e.workspaceFolder);if(t){const i=await this._taskService.getTask(t,e.id,!0);if(i)return{id:i._id,task:Pp.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Pp.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Pp.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Koe.is(e)){const s=this.getWorkspace(e.workspaceFolder);s?this._taskService.getTask(s,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Pp.from(o)};this._taskService.run(o).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(r)},a=>{}),t(r)}},o=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const s=Pp.to(e,this._workspaceContextServer,!0);this._taskService.run(s).then(void 0,r=>{});const o={id:s._id,task:Pp.from(s)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,s)=>{this._taskService.getActiveTasks().then(o=>{for(const r of o)if(e===r._id){this._taskService.extensionCallbackTaskComplete(r,t).then(a=>{i(void 0)},a=>{s(a)});return}s(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(s=>{for(const o of s)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new uc("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Hh.Web;break;case"win32":i=Hh.Windows;break;case"darwin":i=Hh.Mac;break;case"linux":i=Hh.Linux;break;default:i=oQe}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:s=>P.from({scheme:t.scheme,authority:t.authority,path:s}),context:this._extHostContext,resolveVariables:(s,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(s.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(s,l,"tasks",void 0,r).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(s,o,r)=>this._proxy.$findExecutable(s,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};F9e=D([en(Ue.MainThreadTask),_(1,XZe),_(2,Ti),_(3,_et)],F9e);let O9e=class extends ${constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new Zo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};O9e=D([en(Ue.MainThreadLabelService),_(1,eo)],O9e);var Km;(function(n){n.Http="http",n.Https="https"})(Km||(Km={}));var zE;(function(n){n.ConstantPrivate="constantPrivate",n.Private="private",n.Public="public"})(zE||(zE={}));var rk;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(rk||(rk={}));function PYt(n){if(n.scheme!=="http"&&n.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(n.authority);if(e)return{address:e[1],port:+e[2]}}const zG=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function $G(n){return zG.indexOf(n)>=0}const Yoe=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function GG(n){return Yoe.indexOf(n)>=0}class FYt{constructor(e,t,i){this.remoteAddress=e,this.localAddress=t,this._dispose=i,this._onDispose=new I,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}let B9e=class{constructor(e,t){this.logService=e,this.configurationService=t,this._onTunnelOpened=new I,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new I,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new I,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],t=Array.from(this._tunnels.values());for(const i of t){const s=Array.from(i.values());for(const o of s){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){for(const e of this._tunnels.values()){for(const{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,s,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:s,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(GG(e)||$G(e))&&(e=zG[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,s,o,r=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${o}.`);const l=this._tunnelProvider??e;if(!l)return;if(t||(t="localhost"),s||(s=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const d=this.retainOrCreateTunnel(l,t,i,s,o,r,a,c);return d?d.then(h=>{if(h){if(typeof h=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),h}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const u=this.makeTunnel(h);return(h.tunnelRemoteHost!==t||h.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&h.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(u),u}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),d)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const t=this._tunnels.get(e.tunnelRemoteHost);if(t){const i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);const s=i.value.then(async o=>{o&&typeof o!="string"&&(await o.dispose(!0),this._onTunnelClosed.fire({host:o.tunnelRemoteHost,port:o.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),s}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);const i=this._tunnels.get(e);if(i&&i.has(t)){const s=i.get(t);s.refcount=0,await this.tryDisposeTunnel(e,t,s)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){const i=this._tunnels.get(e);if(i){const s=i.get(t),o=s?await s.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];$G(e)?(i.push(...zG),i.push(...Yoe)):GG(e)&&i.push(...Yoe);const s=i.map(o=>this._tunnels.get(o));for(const o of s){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!PYt(e)}createWithProvider(e,t,i,s,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${s}.`);const c=i;this._factoryInProgress.add(c);const l=s===void 0?i:s,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:s,privacy:r,public:r?r!==zE.Private:void 0,protocol:a},u=e.forwardPort(h,d);return u?(this.addTunnelToMap(t,i,u),u.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),u}};B9e=D([_(0,Ze),_(1,Re)],B9e);const Sg=ae("IExtHostInitDataService"),gr=ae("IExtHostRpcService");class OYt{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}const W9e="vs/workbench/api/common/extHostTunnelService";class BYt extends FYt{}var Joe;(function(n){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?zE.Public:zE.Private),protocol:i.protocol}}n.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==zE.ConstantPrivate&&i.privacy!==zE.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}n.fromServiceTunnel=t})(Joe||(Joe={}));const OOe=ae("IExtHostTunnelService");let y0e=class extends ${constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new I,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);const i=await this._proxy.$openTunnel(t,e.displayName);if(i){const s=new BYt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(s),s}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");const i=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(i,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,i),new oo(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,s,o){const r=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];r.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:s},o)}catch{h=await l.provider.providePortAttributes(d,i,s,o)}return{providedAttributes:h,port:d}})))}const a=r.filter(c=>!!c.providedAttributes);return a.length>0?a.map(c=>({autoForwardAction:c.providedAttributes.autoForwardAction,port:c.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(s,o)=>await e.provideTunnel(s,o,qe.None)??void 0;const i=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(i),Promise.resolve(Ee(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0)}))}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());const i=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(i){this._forwardPortProvider=i;let s=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&s.length===0&&(s=[{id:"private",label:g(W9e,0,"Private"),themeIcon:"lock"},{id:"public",label:g(W9e,1,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:s,protocol:!0}:void 0;this._proxy.$setTunnelProvider(o)}}else this._forwardPortProvider=void 0;return Ee(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){const i=this._extensionTunnels.get(e.host);i.has(e.port)&&(t&&i.get(e.port).disposeListener.dispose(),await i.get(e.port).tunnel.dispose(),i.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");const i=this._forwardPortProvider(e,t);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),i!==void 0){const s=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),s===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);const o=this._register(s.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(s.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:s,disposeListener:o}),Joe.fromApiTunnel(s)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(i){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),i instanceof Error)return i.message}}async $applyCandidateFilter(e){const t=await Promise.all(e.map(s=>this._showCandidatePort(s.host,s.port,s.detail??""))),i=e.filter((s,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(s=>s.port).join(", ")} to ${i.map(s=>s.port).join(", ")}`),i}};y0e=D([_(0,gr),_(1,Sg),_(2,Ze)],y0e);const qG="vs/workbench/services/remote/common/tunnelModel",WYt=10*1e3,hY="remote.tunnels.toRestore",nme="remote.tunnels.toRestoreExpiration",HYt=1e3*60*60*24*14,H9e="onTunnel",Ert=new Y("forwardedPortsViewEnabled",!1,g(qG,0,"Whether the Ports view is enabled."));function UYt(n){const e=n.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);if(e)return{host:e[1]?.substring(0,e[1].length-1)||"localhost",port:Number(e[2])}}var qM;(function(n){n.Other="Other",n.User="User",n.AutoForwardEnd="AutoForwardEnd"})(qM||(qM={}));var Tb;(function(n){n[n.User=0]="User",n[n.Auto=1]="Auto",n[n.Extension=2]="Extension"})(Tb||(Tb={}));const sme={source:Tb.User,description:g(qG,1,"User Forwarded")};Tb.Auto,g(qG,2,"Auto Forwarded");function U9e(n,e,t){const i=n.get(Hf(e,t));if(i)return i;if($G(e))for(const s of zG){const o=Hf(s,t);if(n.has(o))return n.get(o)}else if(GG(e))for(const s of Yoe){const o=Hf(s,t);if(n.has(o))return n.get(o)}}function kf(n,e,t){const i=U9e(n,e,t);if(i)return i;const s=GG(e)?"localhost":$G(e)?"0.0.0.0":void 0;if(s)return U9e(n,s,t)}function Hf(n,e){return n+":"+e}var ak;(function(n){n.Notify="notify",n.OpenBrowser="openBrowser",n.OpenBrowserOnce="openBrowserOnce",n.OpenPreview="openPreview",n.Silent="silent",n.Ignore="ignore"})(ak||(ak={}));function VYt(n){return n&&"host"in n&&typeof n.host=="string"&&"port"in n&&typeof n.port=="number"&&(!("detail"in n)||typeof n.detail=="string")&&(!("pid"in n)||typeof n.pid=="string")}const Ig=class Ig extends ${constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(Ig.SETTING)||t.affectsConfiguration(Ig.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let s=this.findNextIndex(e,t,i,this.portsAttributes,0);const o={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;s>=0;){const r=this.portsAttributes[s];r.key===e?(o.onAutoForward=r.onAutoForward??o.onAutoForward,o.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,o.label=r.label??o.label,o.requireLocalPort=r.requireLocalPort,o.protocol=r.protocol):(o.onAutoForward=o.onAutoForward??r.onAutoForward,o.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,o.label=o.label??r.label,o.requireLocalPort=o.requireLocalPort!==void 0?o.requireLocalPort:void 0,o.protocol=o.protocol??r.protocol),s=this.findNextIndex(e,t,i,this.portsAttributes,s+1)}return o.onAutoForward!==void 0||o.elevateIfNeeded!==void 0||o.label!==void 0||o.requireLocalPort!==void 0||o.protocol!==void 0?o:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&$t(e.host)&&Kc(e.port)}findNextIndex(e,t,i,s,o){if(o>=s.length)return-1;const r=!$G(t)&&!GG(t),c=s.slice(o).findIndex(l=>Kc(l.key)?r?!1:l.key===e:this.hasStartEnd(l.key)?r?!1:e>=l.key.start&&e<=l.key.end:this.hasHostAndPort(l.key)?e===l.key.port&&t===l.key.host:i?l.key.test(i):!1);return c>=0?c+o:-1}readSetting(){const e=this.configurationService.getValue(Ig.SETTING);if(!e||!fo(e))return[];const t=[];for(const s in e){if(s===void 0)continue;const o=e[s];let r;if(Number(s))r=Number(s);else if($t(s))if(Ig.RANGE.test(s)){const a=s.match(Ig.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(Ig.HOST_AND_PORT.test(s)){const a=s.match(Ig.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(s)}catch{}a&&(r=a)}r&&t.push({key:r,elevateIfNeeded:o.elevateIfNeeded,onAutoForward:o.onAutoForward,label:o.label,requireLocalPort:o.requireLocalPort,protocol:o.protocol})}const i=this.configurationService.getValue(Ig.DEFAULTS);return i&&(this.defaultPortAttributes={elevateIfNeeded:i.elevateIfNeeded,label:i.label,onAutoForward:i.onAutoForward,requireLocalPort:i.requireLocalPort,protocol:i.protocol}),this.sortAttributes(t)}sortAttributes(e){function t(i,s){return Kc(i.key)?i.key:s.hasStartEnd(i.key)?i.key.start:s.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,s)=>t(i,this)-t(s,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case rk.Notify:return ak.Notify;case rk.OpenBrowser:return ak.OpenBrowser;case rk.OpenBrowserOnce:return ak.OpenBrowserOnce;case rk.OpenPreview:return ak.OpenPreview;case rk.Silent:return ak.Silent;case rk.Ignore:return ak.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(Ig.SETTING).userRemoteValue;let r;!o||!fo(o)?r={}:r=Vs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(Ig.SETTING,r,i)}};Ig.SETTING="remote.portsAttributes",Ig.DEFAULTS="remote.otherPortsAttributes",Ig.RANGE=/^(\d+)\-(\d+)$/,Ig.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Xoe=Ig,QG=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=s,this.remoteAuthorityResolverService=o,this.workspaceContextService=r,this.logService=a,this.dialogService=c,this.extensionService=l,this.contextKeyService=d,this.inProgress=new Map,this._onForwardPort=new I,this.onForwardPort=this._onForwardPort.event,this._onClosePort=new I,this.onClosePort=this._onClosePort.event,this._onPortName=new I,this.onPortName=this._onPortName.event,this._onCandidatesChanged=new I,this.onCandidatesChanged=this._onCandidatesChanged.event,this._onEnvironmentTunnelsSet=new I,this.onEnvironmentTunnelsSet=this._onEnvironmentTunnelsSet.event,this._environmentTunnelsSet=!1,this.restoreListener=void 0,this.restoreComplete=!1,this.onRestoreComplete=new I,this.unrestoredExtensionTunnels=new Map,this.sessionCachedProperties=new Map,this.portAttributesProviders=[],this.mismatchCooldown=new Date,this.configPortsAttributes=new Xoe(i),this.tunnelRestoreValue=this.getTunnelRestoreValue(),this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes,this)),this.forwarded=new Map,this.remoteTunnels=new Map,this.tunnelService.tunnels.then(async h=>{const u=await this.getAttributes(h.map(f=>({port:f.tunnelRemotePort,host:f.tunnelRemoteHost})));for(const f of h)if(f.localAddress){const p=Hf(f.tunnelRemoteHost,f.tunnelRemotePort),m=kf(this._candidates??new Map,f.tunnelRemoteHost,f.tunnelRemotePort);this.forwarded.set(p,{remotePort:f.tunnelRemotePort,remoteHost:f.tunnelRemoteHost,localAddress:f.localAddress,protocol:u?.get(f.tunnelRemotePort)?.protocol??Km.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:sme}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Hf(h.tunnelRemoteHost,h.tunnelRemotePort);if(!kf(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=kf(this._candidates??new Map,h.tunnelRemoteHost,h.tunnelRemotePort),p=(await this.getAttributes([{port:h.tunnelRemotePort,host:h.tunnelRemoteHost}]))?.get(h.tunnelRemotePort);this.forwarded.set(u,{remoteHost:h.tunnelRemoteHost,remotePort:h.tunnelRemotePort,localAddress:h.localAddress,protocol:p?.protocol??Km.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:sme})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,qM.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(H9e))?(this.contextKeyService.createKey(Ert.key,!0),!0):!1}checkExtensionActivationEvents(){if(this.extensionHasActivationEvent())return;const e=this._register(this.extensionService.onDidRegisterExtensions(()=>{this.extensionHasActivationEvent()&&e.dispose()}))}async onTunnelClosed(e,t){const i=Hf(e.host,e.port);this.forwarded.has(i)&&(this.forwarded.delete(i),await this.storeForwarded(),this._onClosePort.fire(e))}makeLocalUri(e,t){if(e.startsWith("http"))return P.parse(e);const i=t?.protocol??"http";return P.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Ed(t.configuration.path):t.folders.length>0?Ed(t.folders[0].uri.path):void 0;if(i===void 0){this.logService.debug("Could not get workspace hash for forwarded ports storage key.");return}return`${e}.${this.environmentService.remoteAuthority}.${i}`}async getTunnelRestoreStorageKey(){return this.addStorageKeyPostfix(hY)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(nme)}async getTunnelRestoreValue(){const e=this.storageService.get(hY,ke.WORKSPACE);if(e)return this.storageService.remove(hY,ke.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,ke.PROFILE)}async restoreForwarded(){if(this.cleanupExpiredTunnelsForRestore(),this.configurationService.getValue("remote.restoreForwardedPorts")){const e=await this.tunnelRestoreValue;if(e&&e!==this.knownPortsRestoreValue){const t=JSON.parse(e)??[];this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${t.map(i=>i.remotePort).join(", ")}`);for(const i of t){const s=kf(this.detected,i.remoteHost,i.remotePort);i.source.source!==Tb.Extension&&!s||i.source.source===Tb.Extension&&s?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===Tb.Extension&&!s&&this.unrestoredExtensionTunnels.set(Hf(i.remoteHost,i.remotePort),i)}}}if(this.restoreComplete=!0,this.onRestoreComplete.fire(),!this.restoreListener){const e=await this.getTunnelRestoreStorageKey();this.restoreListener=this._register(new Z),this.restoreListener.add(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,ke.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(ke.PROFILE,ln.USER).filter(t=>t.startsWith(nme));for(const t of e){const i=this.storageService.getNumber(t,ke.PROFILE);if(i&&i({remoteHost:r.remoteHost,remotePort:r.remotePort,localPort:r.localPort,name:r.name,localAddress:r.localAddress,localUri:r.localUri,protocol:r.protocol,source:r.source}));let i;e.length>0&&(i=JSON.stringify(t));const s=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&s&&o?(this.storageService.remove(s,ke.PROFILE),this.storageService.remove(o,ke.PROFILE)):i!==this.knownPortsRestoreValue&&s&&o&&(this.storageService.store(s,i,ke.PROFILE,ln.USER),this.storageService.store(o,Date.now()+HYt,ke.PROFILE,ln.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const s=new Date;if(this.mismatchCooldown.getTime()+WYt>s.getTime())return;this.mismatchCooldown=s;const o=g(qG,3,`Local port {0} could not be used for forwarding to remote port {1}. +`),this._commentReply?.setCommentEditorDecorations()}};Vxe=D([_(12,eE),_(13,lr),_(14,Te),_(15,Ut)],Vxe);function $8e(s,e){return JQt(s,e)??e.getColor(uMe)}var Ey;(function(s){s[s.None=0]="None",s[s.Widget=1]="Widget",s[s.Editor=2]="Editor"})(Ey||(Ey={}));function pjt(s){const e=s.target.range;if(!e||!s.event.leftButton||s.target.type!==Rt.GUTTER_LINE_DECORATIONS)return null;const t=s.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function mjt(s,e){if(!s)return null;const{lineNumber:t}=s;return e.target.range?t:null}let zxe=class extends lMe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,n,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=n,this._pendingEdits=o,this.themeService=a,this.commentService=c,this.configurationService=d,this._onDidClose=new I,this._onDidCreateThread=new I,this._globalToDispose=new Z,this._commentThreadDisposables=[],this._contextKeyService=l.createScoped(this.domNode),this._scopedInstantiationService=this._globalToDispose.add(r.createChild(new Uc([Le,this._contextKeyService])));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=n?Lc.Expanded:i.initialCollapsibleState,i.initialCollapsibleState=this._initialCollapsibleState,this._commentThreadDisposables=[],this.create(),this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme,this)),this._globalToDispose.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.fontInfo)&&this._applyTheme(this.themeService.getColorTheme())})),this._applyTheme(this.themeService.getColorTheme())}get onDidClose(){return this._onDidClose.event}get onDidCreateThread(){return this._onDidCreateThread.event}getPosition(){if(this.position)return this.position;if(this._commentGlyph)return this._commentGlyph.getPosition().position??void 0}revealRange(){}reveal(e,t=Ey.None){this.makeVisible(e,t);const i=this._commentThread.comments?.find(n=>n.uniqueIdInThread===e);this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread,comment:i})}_expandAndShowZoneWidget(){this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2)}_setFocus(e){e===Ey.Widget?this._commentThreadWidget.focus():e===Ey.Editor&&this._commentThreadWidget.focusCommentEditor()}_goToComment(e,t){const i=this.editor.getLayoutInfo().height,n=this._commentThreadWidget.getCommentCoords(e);if(n){let o=1;if(this._commentThread.range){const r=n.thread,a=n.comment;o=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-i/2+a.top-r.top}this.editor.setScrollTop(o),this._setFocus(t)}else this._goToThread(t)}_goToThread(e){const t=this._commentThread.range?new F(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new F(1,1,1,1);this.editor.revealRangeInCenter(t),this._setFocus(e)}makeVisible(e,t=Ey.None){this._expandAndShowZoneWidget(),e!==void 0&&this._goToComment(e,t),this._goToThread(t)}getPendingComments(){return{newComment:this._commentThreadWidget.getPendingComment(),edits:this._commentThreadWidget.getPendingEdits()}}setPendingComment(e){this._pendingComment=e,this.expand(),this._commentThreadWidget.setPendingComment(e)}_fillContainer(e){this.setCssClass("review-widget"),this._commentThreadWidget=this._scopedInstantiationService.createInstance(Vxe,e,this.editor,this._uniqueOwner,this.editor.getModel().uri,this._contextKeyService,this._scopedInstantiationService,this._commentThread,this._pendingComment,this._pendingEdits,{editor:this.editor,codeBlockFontSize:"",codeBlockFontFamily:this.configurationService.getValue("editor").fontFamily||cd.fontFamily},this._commentOptions,{actionRunner:async()=>{if(!this._commentThread.comments||!this._commentThread.comments.length){const t=this.getPosition();if(t){const i=this._commentThread.range;if(!i)return;let n;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;n=new F(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else n=new F(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,n)}}},collapse:()=>{this.collapse()}}),this._disposables.add(this._commentThreadWidget)}arrowPosition(e){if(e)return{lineNumber:e.endLineNumber,column:e.endLineNumber===e.startLineNumber?(e.startColumn+e.endColumn+1)/2:1}}deleteCommentThread(){this.dispose(),this.commentService.disposeCommentThread(this.uniqueOwner,this._commentThread.threadId)}collapse(){this._commentThread.collapsibleState=Lc.Collapsed}expand(e){this._commentThread.collapsibleState=Lc.Expanded,e&&this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread})}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=Lc.Collapsed:this._commentThread.collapsibleState=Lc.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(n=>n.dispose()),this._commentThread=e,this._commentThreadDisposables=[],this.bindCommentThreadListeners()),await this._commentThreadWidget.updateCommentThread(e);const t=this._commentThread.range?.endLineNumber??1;let i=!1;this._commentGlyph&&(this._commentGlyph.setThreadState(e.state),this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t))),i&&this._isExpanded||this._commentThread.collapsibleState===Lc.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==Lc.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new L$(this.editor,e?.endLineNumber??-1),this._commentGlyph.setThreadState(this._commentThread.state)),await this._commentThreadWidget.display(this.editor.getOption(x.lineHeight),t),this._disposables.add(this._commentThreadWidget.onDidResize(i=>{this._refresh(i)})),(this._commentThread.collapsibleState===Lc.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.makeVisible(),this.bindCommentThreadListeners()}bindCommentThreadListeners(){if(this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.update(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(e=>{const t=this._commentThread.range?.startLineNumber??1;let i=!1;this._commentGlyph&&this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t)),i&&this._isExpanded&&this.show(this.arrowPosition(this._commentThread.range),2)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(e=>{if(e===Lc.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2),this._commentThreadWidget.ensureFocusIntoNewEditingComment();return}if(e===Lc.Collapsed&&this._isExpanded){this.hide();return}})),this._initialCollapsibleState===void 0){const e=this._commentThread.onDidChangeInitialCollapsibleState(t=>{this._initialCollapsibleState=t,this._commentThread.collapsibleState=this._initialCollapsibleState,e.dispose()});this._commentThreadDisposables.push(e)}this._commentThreadDisposables.push(this._commentThread.onDidChangeState(()=>{const e=$8e(this._commentThread.state,this.themeService.getColorTheme())||me.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(Jnt,`${e}`),this.container?.style.setProperty(Xnt,`${e.transparent(.1)}`)}))}async submitComment(){return this._commentThreadWidget.submitComment()}_refresh(e){if(this._isExpanded===void 0&&e.height===0&&e.width===0){this.commentThread.collapsibleState=Lc.Collapsed;return}if(this._isExpanded){this._commentThreadWidget.layout();const t=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),i=this.editor.getOption(x.lineHeight),n=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+n+o+8)/i);if(this._viewZone?.heightInLines===r)return;const a=this.getPosition();this._viewZone&&a&&a.lineNumber!==this._viewZone.afterLineNumber&&this._viewZone.afterLineNumber!==0&&(this._viewZone.afterLineNumber=a.lineNumber);const c=vm.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=$8e(this._commentThread.state,this.themeService.getColorTheme())||me.transparent;this.style({arrowColor:t,frameColor:t});const i=this.editor.getOption(x.fontInfo);this._commentThreadWidget.applyTheme(e,i)}show(e,t){const i=this._commentGlyph?.getPosition();let n=F.isIRange(e)?e:e?F.fromPositions(e):void 0;if(i?.position&&n&&i.position.lineNumber!==n.endLineNumber){const o=i.position.lineNumber-n.endLineNumber;n=new F(n.startLineNumber+o,n.startColumn,n.endLineNumber+o,n.endColumn)}this._isExpanded=!0,super.show(n??new F(0,0,0,0),t),this._commentThread.collapsibleState=Lc.Expanded,this._refresh(this._commentThreadWidget.getDimensions())}hide(){this._isExpanded&&(this._isExpanded=!1,this.editor.hasWidgetFocus()&&this.editor.focus(),(!this._commentThread.comments||!this._commentThread.comments.length)&&this.deleteCommentThread()),super.hide()}dispose(){super.dispose(),this._commentGlyph&&(this._commentGlyph.dispose(),this._commentGlyph=void 0),this._globalToDispose.dispose(),this._commentThreadDisposables.forEach(e=>e.dispose()),this._onDidClose.fire(void 0)}};zxe=D([_(5,we),_(6,pn),_(7,eE),_(8,Le),_(9,Te)],zxe);class G8e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const Zz=class Zz extends V{constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:Zz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=Gt.createDynamic(t);const i={description:Zz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=Gt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(n=>{this.updateCurrent(n)})),this._register(e.onDidUpdateCommentThreads(()=>{this.updateCurrent(void 0)}))}updateCurrent(e){if(!this.editor||e?.resource&&e.resource?.toString()!==this.editor.getModel()?.uri.toString())return;this.currentThreadCollapseStateListener?.dispose();const t=[];if(e){const i=e.range;i&&!(i.startLineNumber===i.endLineNumber&&i.startColumn===i.endColumn)&&e.collapsibleState===Lc.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(n=>{n===Lc.Collapsed&&this.updateCurrent(void 0)}),t.push(new G8e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((n,o)=>n.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;bt(this.threadCollapseStateListeners),this.editor=e;const n=[];for(const o of t)o.threads.forEach(r=>{if(r.isDisposed)return;const a=r.range;!a||a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn||(this.threadCollapseStateListeners.push(r.onDidChangeCollapsibleState(()=>{this.update(e,t)})),r.collapsibleState!==Lc.Collapsed&&n.push(new G8e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,n),n.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){bt(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};Zz.description="comment-thread-range-decorator";let $xe=Zz;const _jt="editor.contrib.review";class fE{get id(){return this._decorationId}set id(e){this._decorationId=e}get range(){return{startLineNumber:this._startLineNumber,startColumn:1,endLineNumber:this._endLineNumber,endColumn:1}}constructor(e,t,i,n,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=n,this._range=o,this.options=r,this.commentingRangesInfo=a,this.isHover=c,this._startLineNumber=o.startLineNumber,this._endLineNumber=o.endLineNumber}getCommentAction(){return{extensionId:this._extensionId,label:this._label,ownerId:this._ownerId,commentingRangesInfo:this.commentingRangesInfo}}getOriginalRange(){return this._range}getActiveRange(){return this.id?this._editor.getModel().getDecorationRange(this.id):void 0}}const wO=class wO{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=Gt.createDynamic(e);const t={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=Gt.createDynamic(t);const i={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=Gt.createDynamic(i)}updateHover(e){this._editor&&this._infos&&e!==this._lastHover&&this._doUpdate(this._editor,this._infos,e),this._lastHover=e??-1}updateSelection(e,t=new F(0,0,0,0)){this._lastSelection=t.isEmpty()?void 0:t,this._lastSelectionCursor=t.isEmpty()?void 0:e,this._editor&&this._infos&&this._doUpdate(this._editor,this._infos,e,t)}update(e,t,i,n){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,n))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===L$.description)}_doUpdate(e,t,i=-1,n=this._lastSelection){if(!e.getModel())return;i=this._lastSelectionCursor??i;const r=[];for(const c of t)c.commentingRanges.ranges.forEach(l=>{const d=new F(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=n?d.intersectRanges(n):void 0;if(n&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new F(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new F(h.endLineNumber,1,h.endLineNumber,1),h=new F(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,u,this.hoverDecorationOptions,c.commentingRanges,!0));const f=Math.min(u.startLineNumber,h.startLineNumber)-1,p=d.startLineNumber<=f,m=Math.max(u.endLineNumber,h.endLineNumber)+1,v=d.endLineNumber>=m;if(p){const b=new F(l.startLineNumber,1,f,1);r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,b,this.decorationOptions,c.commentingRanges,!0))}if(v){const b=new F(m,1,l.endLineNumber,1);r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,b,this.decorationOptions,c.commentingRanges,!0))}}else if(d.startLineNumber<=i&&i<=d.endLineNumber){if(d.startLineNumber{this.decorationIds=c.deltaDecorations(this.decorationIds,r),r.forEach((l,d)=>l.id=this.decorationIds[d])});const a=this.commentingRangeDecorations.length-r.length;this.commentingRangeDecorations=r,a&&this._onDidChangeDecorationsCount.fire(this.commentingRangeDecorations.length)}areRangesIntersectingOrTouchingByLine(e,t){return!(e.endLineNumbero.commentingRanges.fileComments);return n?n.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const n of this.commentingRangeDecorations){const o=n.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=n.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new F(o.startLineNumbera.range.endLineNumber?o.endLineNumber:a.range.endLineNumber,o.endColumn>a.range.endColumn?o.endColumn:a.range.endColumn);t.set(r.ownerId,{range:c,action:r})}else t.set(r.ownerId,{range:o,action:r})}}const i=new Set;return Array.from(t.values()).filter(n=>i.has(n.action.ownerId)?!1:(i.add(n.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,n;if(t){n=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)n.push(this.commentingRangeDecorations[o])}else n=this.commentingRangeDecorations;for(const o of n){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=F.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new F(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return n.length>0?n[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};wO.description="commenting-range-decorator";let mie=wO;function sst(s,e,t,i,n,o,r,a,c){if(!i.resource)return;s.isCommentingEnabled||s.enableCommenting(!0);const l=i.range,d=o?Ey.Editor:a?Ey.None:Ey.Widget,h=e.activeTextEditorControl,u=im(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=n?.uniqueIdInThread,m=N.parse(i.resource);for(const v of u){const b=v.getModel();if(b instanceof C_&&t.extUri.isEqual(m,b.uri)){f&&Qr(v)&&_ie.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new F(1,1,1,1)}},c?ev:hA).then(v=>{if(v){const b=v.getControl();f&&Qr(b)&&_ie.get(b)?.revealCommentThread(f,p,!0,d)}})}let _ie=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=n,this.contextMenuService=o,this.quickInputService=r,this.viewsService=a,this.configurationService=c,this.editorService=d,this.keybindingService=h,this.accessibilityService=u,this.globalToDispose=new Z,this.localToDispose=new Z,this.mouseDownInfo=null,this._commentingRangeSpaceReserved=!1,this._commentingRangeAmountReserved=0,this._emptyThreadsToAddQueue=[],this._inProcessContinueOnComments=new Map,this._editorDisposables=[],this._hasRespondedToEditorChange=!1,this._commentInfos=[],this._commentWidgets=[],this._pendingNewCommentCache={},this._pendingEditsCache={},this._computePromise=null,this._activeCursorHasCommentingRange=x_.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=x_.activeEditorHasCommentingRange.bindTo(l),!(e instanceof lf)&&(this.editor=e,this._commentingRangeDecorator=new mie,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new $xe(this.commentService)),this.globalToDispose.add(this.commentService.onDidDeleteDataProvider(f=>{f?(delete this._pendingNewCommentCache[f],delete this._pendingEditsCache[f]):(this._pendingNewCommentCache={},this._pendingEditsCache={}),this.beginCompute()})),this.globalToDispose.add(this.commentService.onDidSetDataProvider(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidUpdateCommentingRanges(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidSetResourceCommentInfos(async f=>{const p=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;p&&p.toString()===f.resource.toString()&&await this.setComments(f.commentInfos.filter(m=>m!==null))})),this.globalToDispose.add(this.commentService.onDidChangeCommentingEnabled(f=>{f?(this.registerEditorListeners(),this.beginCompute()):(this.tryUpdateReservedSpace(),this.clearEditorListeners(),this._commentingRangeDecorator.update(this.editor,[]),this._commentThreadRangeDecorator.update(this.editor,[]),bt(this._commentWidgets),this._commentWidgets=[])})),this.globalToDispose.add(this.editor.onWillChangeModel(f=>this.onWillChangeModel(f))),this.globalToDispose.add(this.editor.onDidChangeModel(f=>this.onModelChanged())),this.globalToDispose.add(this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("diffEditor.renderSideBySide")&&this.beginCompute()})),this.onModelChanged(),this.codeEditorService.registerDecorationType("comment-controller",cjt,{}),this.globalToDispose.add(this.commentService.registerContinueOnCommentProvider({provideContinueOnComments:()=>{const f=[];if(this._commentWidgets)for(const p of this._commentWidgets){const v=p.getPendingComments().newComment;if(!v)continue;let b;if(p.commentThread.comments&&p.commentThread.comments.length){const w=p.commentThread.comments[p.commentThread.comments.length-1];typeof w.body=="string"?b=w.body:b=w.body.value}v!==b&&f.push({uniqueOwner:p.uniqueOwner,uri:p.editor.getModel().uri,range:p.commentThread.range,body:v,isReply:p.commentThread.comments!==void 0&&p.commentThread.comments.length>0})}return f}})))}registerEditorListeners(){this._editorDisposables=[],this.editor&&(this._editorDisposables.push(this.editor.onMouseMove(e=>this.onEditorMouseMove(e))),this._editorDisposables.push(this.editor.onMouseLeave(()=>this.onEditorMouseLeave())),this._editorDisposables.push(this.editor.onDidChangeCursorPosition(e=>this.onEditorChangeCursorPosition(e.position))),this._editorDisposables.push(this.editor.onDidFocusEditorWidget(()=>this.onEditorChangeCursorPosition(this.editor?.getPosition()??null))),this._editorDisposables.push(this.editor.onDidChangeCursorSelection(e=>this.onEditorChangeCursorSelection(e))),this._editorDisposables.push(this.editor.onDidBlurEditorWidget(()=>this.onEditorChangeCursorSelection())))}clearEditorListeners(){bt(this._editorDisposables),this._editorDisposables=[]}onEditorMouseLeave(){this._commentingRangeDecorator.updateHover()}onEditorMouseMove(e){const t=e.target.position?.lineNumber;e.event.leftButton.valueOf()&&t&&this.mouseDownInfo?this._commentingRangeDecorator.updateSelection(t,new F(this.mouseDownInfo.lineNumber,1,t,1)):this._commentingRangeDecorator.updateHover(t)}onEditorChangeCursorSelection(e){const t=this.editor?.getPosition()?.lineNumber;t&&this._commentingRangeDecorator.updateSelection(t,e?.selection)}onEditorChangeCursorPosition(e){const t=e?this.editor?.getDecorationsInRange(F.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const n of t)if(n.options.description===L$.description){i=!1;break}else n.options.description===mie.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===CU.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=Rr(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computeAndSetPromise=this._computePromise.then(async e=>{await this.setComments(Fi(e)),this._computePromise=null},e=>console.log(e)),this._computePromise.then(()=>this._computeAndSetPromise=void 0),this._computeAndSetPromise}beginComputeCommentingRanges(){this._computeCommentingRangeScheduler&&(this._computeCommentingRangePromise&&(this._computeCommentingRangePromise.cancel(),this._computeCommentingRangePromise=null),this._computeCommentingRangeScheduler.trigger(()=>{const e=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return e?this.commentService.getDocumentComments(e):Promise.resolve([])}).then(e=>{if(this.commentService.isCommentingEnabled){const t=Fi(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(vt(e),null)))}static get(e){return e.getContribution(_jt)}revealCommentThread(e,t,i,n){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,n):i&&(this._computeAndSetPromise?this._computeAndSetPromise.then(r=>{this.revealCommentThread(e,t,!1,n)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,n)}))}collapseAll(){for(const e of this._commentWidgets)e.collapse()}expandAll(){for(const e of this._commentWidgets)e.expand()}expandUnresolved(){for(const e of this._commentWidgets)e.commentThread.state===ru.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=e?this.editor.getSelection().getStartPosition():this.editor.getSelection().getEndPosition(),i=this._commentWidgets.sort((r,a)=>{if(e){const c=r;r=a,a=c}return r.commentThread.range===void 0?-1:a.commentThread.range===void 0?1:r.commentThread.range.startLineNumbera.commentThread.range.startLineNumber?1:r.commentThread.range.startColumna.commentThread.range.startColumn?1:0}),n=w2(i,r=>{const a=e?t.lineNumber:r.commentThread.range?.startLineNumber??0,c=e?r.commentThread.range?.startLineNumber??0:t.lineNumber,l=e?t.column:r.commentThread.range?.startColumn??0,d=e?r.commentThread.range?.startColumn??0:t.column;return a>c?!0:ad});let o;n===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[n],this.editor.setSelection(o.commentThread.range??new F(1,1,1,1)),o.reveal(void 0,Ey.Widget)}previousCommentThread(){this._findNearestCommentThread(!0)}_findNearestCommentingRange(e){if(!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentingRangeDecorator.getNearestCommentingRange(t,e);if(i){const n=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(n),this.editor.revealLineInCenterIfOutsideViewport(n.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const n=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;n&&o&&Ah(n===o?g(5346,"Line {0}",n):g(5347,"Lines {0} to {1}",n,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),bt(this._editorDisposables),bt(this._commentWidgets),this.editor=null}onWillChangeModel(e){e.newModelUrl&&this.tryUpdateReservedSpace(e.newModelUrl)}async handleCommentAdded(e,t,i){if(this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.threadId===i.threadId).length)return;const o=this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.commentThreadHandle===-1&&F.equalsRange(h.commentThread.range,i.range));if(o.length){o[0].update(i);return}const r=this._inProcessContinueOnComments.get(t)?.findIndex(h=>h.range===void 0?i.range===void 0:F.lift(h.range).equalsRange(i.range));let a;r!==void 0&&r>=0&&(a=this._inProcessContinueOnComments.get(t)?.splice(r,1)[0].body);const c=(this._pendingNewCommentCache[t]&&this._pendingNewCommentCache[t][i.threadId])??a,l=this._pendingEditsCache[t]&&this._pendingEditsCache[t][i.threadId],d=i.canReply&&i.isTemplate&&(!i.comments||i.comments.length===0)&&(!i.editorId||i.editorId===e);await this.displayCommentThread(t,i,d,c,l),this._commentInfos.filter(h=>h.uniqueOwner===t)[0].threads.push(i),this.tryUpdateReservedSpace()}onModelChanged(){this.localToDispose.clear(),this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache(),this.editor&&(this._hasRespondedToEditorChange=!1,this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this._editorDisposables.length&&(this.clearEditorListeners(),this.registerEditorListeners()),this._computeCommentingRangeScheduler=new Mh(200),this.localToDispose.add({dispose:()=>{this._computeCommentingRangeScheduler?.cancel(),this._computeCommentingRangeScheduler=null}}),this.localToDispose.add(this.editor.onDidChangeModelContent(async()=>{this.beginComputeCommentingRanges()})),this.localToDispose.add(this.commentService.onDidUpdateCommentThreads(async e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;if(!t||!this.commentService.isCommentingEnabled)return;this._computePromise&&await this._computePromise;const i=this._commentInfos.filter(l=>l.uniqueOwner===e.uniqueOwner);if(!i||!i.length)return;const n=e.added.filter(l=>l.resource&&l.resource===t.toString()),o=e.removed.filter(l=>l.resource&&l.resource===t.toString()),r=e.changed.filter(l=>l.resource&&l.resource===t.toString()),a=e.pending.filter(l=>l.uri.toString()===t.toString());o.forEach(l=>{const d=this._commentWidgets.filter(u=>u.uniqueOwner===e.uniqueOwner&&u.commentThread.threadId===l.threadId&&u.commentThread.threadId!=="");if(d.length){const u=d[0],f=this._commentWidgets.indexOf(u);this._commentWidgets.splice(f,1),u.dispose()}const h=this._commentInfos.filter(u=>u.uniqueOwner===e.uniqueOwner)[0].threads;for(let u=0;uh.uniqueOwner===e.uniqueOwner&&h.commentThread.threadId===l.threadId);d.length&&(d[0].update(l),this.openCommentsView(l))}const c=this.editor?.getId();for(const l of n)await this.handleCommentAdded(c,e.uniqueOwner,l);for(const l of a)await this.resumePendingComment(t,l);this._commentThreadRangeDecorator.update(this.editor,i)})),this.beginComputeAndHandleEditorChange())}async resumePendingComment(e,t){const i=this._commentWidgets.filter(n=>n.uniqueOwner===t.uniqueOwner&&F.lift(n.commentThread.range)?.equalsRange(t.range));if(t.isReply&&i.length)this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!0}),i[0].setPendingComment(t.body);else if(i.length){this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1});const n=i[0].getPendingComments().newComment;let o;!n||t.body.includes(n)?o=t.body:n.includes(t.body)?o=n:o=`${n} +${t.body}`,i[0].setPendingComment(o)}else if(!t.isReply){if(!this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1}))return;this._inProcessContinueOnComments.has(t.uniqueOwner)||this._inProcessContinueOnComments.set(t.uniqueOwner,[]),this._inProcessContinueOnComments.get(t.uniqueOwner)?.push(t),await this.commentService.createCommentThreadTemplate(t.uniqueOwner,t.uri,t.range?F.lift(t.range):void 0)}}beginComputeAndHandleEditorChange(){this.beginCompute().then(()=>{if(!this._hasRespondedToEditorChange&&this._commentInfos.some(e=>e.commentingRanges.ranges.length>0||e.commentingRanges.fileComments))if(this._hasRespondedToEditorChange=!0,this.configurationService.getValue(vr.Comments)){const t=this.keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getAriaLabel();Ah(t?g(5348,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(5349,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Ah(g(5350,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(jce).openView;if(t==="file")return this.viewsService.openView(jl);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===ru.Unresolved)&&!this.viewsService.getViewWithId(jl)?.hasRendered)return this.viewsService.openView(jl)}}async displayCommentThread(e,t,i,n,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!n&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(zxe,this.editor,e,t,n??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=pjt(e)}onEditorMouseUp(e){const t=mjt(this.mouseDownInfo,e);if(this.mouseDownInfo=null,!this.editor||t===null||!e.target.element)return;const i=e.target.element.className.indexOf("comment-range-glyph")>=0,n=e.target.position.lineNumber;let o,r;t!==n?t>n?r=new F(t,this.editor.getModel().getLineLength(t)+1,n,1):r=new F(t,1,n,this.editor.getModel().getLineLength(n)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=n&&n<=r.endLineNumber?(o=r,this.editor.setSelection(new F(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new F(n,1,n,1)),o&&this.addOrToggleCommentAtLine(o,e)}async addOrToggleCommentAtLine(e,t){if(this._addInProgress)this._emptyThreadsToAddQueue.push([e,t]);else{this._addInProgress=!0;const i=this._commentWidgets.filter(n=>n.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const n=i.every(o=>o.expanded);i.forEach(n?o=>o.collapse():o=>o.expand(!0)),this.processNextThreadToAdd();return}else this.addCommentAtLine(e,t)}}processNextThreadToAdd(){this._addInProgress=!1;const e=this._emptyThreadsToAddQueue.shift();e&&this.addOrToggleCommentAtLine(e[0],e[1])}clipUserRangeToCommentRange(e,t){return e.startLineNumbert.endLineNumber&&(e=new F(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)),e}addCommentAtLine(e,t){const i=this._commentingRangeDecorator.getMatchedCommentAction(e);if(!i.length||!this.editor?.hasModel()){if(this._addInProgress=!1,!i.length)throw new Error(`There are no commenting ranges at the current position (${e?"with range":"without range"}).`);return Promise.resolve()}if(i.length>1){if(t&&e)return this.contextMenuService.showContextMenu({getAnchor:()=>t.event,getActions:()=>this.getContextMenuActions(i,e),getActionsContext:()=>i.length?i[0]:void 0,onHide:()=>{this._addInProgress=!1}}),Promise.resolve();{const n=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(n,{placeHolder:g(5351,"Select Comment Provider"),matchOnDescription:!0}).then(o=>{if(!o)return;const r=i.filter(a=>a.action.ownerId===o.id);if(r.length){const{ownerId:a}=r[0].action,c=e&&r[0].range?this.clipUserRangeToCommentRange(e,r[0].range):e;this.addCommentAtLine2(c,a)}}).then(()=>{this._addInProgress=!1})}}else{const{ownerId:n}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,n)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:n,extensionId:o,label:r}=i.action;return{label:r??o??n,id:n}})}getContextMenuActions(e,t){const i=[];return e.forEach(n=>{const{ownerId:o,extensionId:r,label:a}=n.action;i.push(new rn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=n.range?this.clipUserRangeToCommentRange(t,n.range):t;return this.addCommentAtLine2(c,o),Promise.resolve()}))}),i}addCommentAtLine2(e,t){this.editor&&(this.commentService.createCommentThreadTemplate(t,this.editor.getModel().uri,e,this.editor.getId()),this.processNextThreadToAdd())}getExistingCommentEditorOptions(e){const t=e.getOption(x.lineDecorationsWidth);let i=[];const n=e.getRawOptions().extraEditorClassName;return n&&(i=n.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let n=i;const o=t.findIndex(a=>a==="inline-comment");o>=0&&t.splice(o,1);const r=e.getOptions();return r.get(x.folding)&&r.get(x.showFoldingControls)!=="never"&&(n+=11),n-=24,{extraEditorClassName:t,lineDecorationsWidth:n}}getWithCommentsLineDecorationWidth(e,t){let i=t;const n=e.getOptions();return n.get(x.folding)&&n.get(x.showFoldingControls)!=="never"&&(i-=11),i+=24,this._commentingRangeAmountReserved=i,this._commentingRangeAmountReserved}getWithCommentsEditorOptions(e,t,i){return t.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,i),extraEditorClassName:t}}updateEditorLayoutOptions(e,t,i){e.updateOptions({extraEditorClassName:t.join(" "),lineDecorationsWidth:i})}ensureCommentingRangeReservedAmount(e){const t=this.getExistingCommentEditorOptions(e);t.lineDecorationsWidth!==this._commentingRangeAmountReserved&&e.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,t.lineDecorationsWidth)})}tryUpdateReservedSpace(e){if(!this.editor)return;const t=this._commentInfos.some(o=>!!(o.commentingRanges&&(Array.isArray(o.commentingRanges)?o.commentingRanges:o.commentingRanges.ranges).length)||o.threads.length>0);e=e??this.editor.getModel()?.uri;const i=e?this.commentService.resourceHasCommentingRanges(e):!1,n=t||i;if(n&&this.commentService.isCommentingEnabled)if(this._commentingRangeSpaceReserved)this.ensureCommentingRangeReservedAmount(this.editor);else{this._commentingRangeSpaceReserved=!0;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}else if((!n||!this.commentService.isCommentingEnabled)&&this._commentingRangeSpaceReserved){this._commentingRangeSpaceReserved=!1;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithoutCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}}async setComments(e){if(!this.editor||!this.commentService.isCommentingEnabled)return;this._commentInfos=e,this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache();let t=!1;for(const i of this._commentInfos){!t&&(i.commentingRanges.ranges.length>0||i.commentingRanges.fileComments)&&(t=!0);const n=this._pendingNewCommentCache[i.uniqueOwner],o=this._pendingEditsCache[i.uniqueOwner];i.threads=i.threads.filter(r=>!r.isDisposed);for(const r of i.threads){let a;n&&(a=n[r.threadId]);let c;o&&(c=o[r.threadId]),await this.displayCommentThread(i.uniqueOwner,r,!1,a,c)}for(const r of i.pendingCommentThreads??[])this.resumePendingComment(this.editor.getModel().uri,r)}this._commentingRangeDecorator.update(this.editor,this._commentInfos),this._commentThreadRangeDecorator.update(this.editor,this._commentInfos),t?this._activeEditorHasCommentingRange.set(!0):this._activeEditorHasCommentingRange.set(!1)}closeWidget(){this._commentWidgets?.forEach(e=>e.hide()),this.editor&&(this.editor.focus(),this.editor.revealRangeInCenter(this.editor.getSelection()))}removeCommentWidgetsAndStoreCache(){this._commentWidgets&&this._commentWidgets.forEach(e=>{const t=e.getPendingComments(),i=t.newComment,n=this._pendingNewCommentCache[e.uniqueOwner];let o;if(e.commentThread.comments&&e.commentThread.comments.length){const c=e.commentThread.comments[e.commentThread.comments.length-1];typeof c.body=="string"?o=c.body:o=c.body.value}i&&i!==o?(n||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):n&&delete n[e.commentThread.threadId];const r=t.edits,a=this._pendingEditsCache[e.uniqueOwner];Object.keys(r).length>0?(a||(this._pendingEditsCache[e.uniqueOwner]={}),this._pendingEditsCache[e.uniqueOwner][e.commentThread.threadId]=r):a&&delete a[e.commentThread.threadId],e.dispose()}),this._commentWidgets=[]}};_ie=D([_(1,eE),_(2,we),_(3,Kt),_(4,lr),_(5,In),_(6,Lm),_(7,Te),_(8,Le),_(9,ei),_(10,Ut),_(11,mr)],_ie);const vjt=new Q("commentsView.hasComments",!1),bjt=new Q("commentsView.someCommentsExpanded",!1),wjt=new Q("commentsView.commentFocused",!1),yjt="commentsViewState";function K8e(s){return hi.map(s.resourceCommentThreads,e=>{const t=hi.from(e.commentThreads),i=hi.map(t,n=>({element:n}));return{element:e,children:i}})}let Gxe=class extends ASe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Jw)return e[0]}get focusedCommentInfo(){if(this.focusedCommentNode)return this.getScreenReaderInfoForNode(this.focusedCommentNode)}focusNextNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).next();for(;t&&!(t instanceof Jw);)t=this.tree.navigate(t).next();t&&this.tree.setFocus([t])}focusPreviousNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).previous();for(;t&&!(t instanceof Jw);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){const v=new sI(yjt,m),b=v.getMemento(Ie.WORKSPACE,an.MACHINE);super({...e,filterOptions:{placeholder:g(5329,"Filter (e.g. text, author)"),ariaLabel:g(5330,"Filter comments"),history:b.filterHistory||[],text:b.filter||"",focusContextKey:mPe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=n,this.commentService=h,this.uriIdentityService=p,this.totalComments=0,this.currentHeight=0,this.currentWidth=0,this.cachedFilterStats=void 0,this.onDidChangeVisibility=this.onDidChangeBodyVisibility,this.hasCommentsContextKey=vjt.bindTo(r),this.someCommentsExpandedContextKey=bjt.bindTo(r),this.commentsFocusedContextKey=wjt.bindTo(r),this.stateMemento=v,this.viewState=b,this.filters=this._register(new ijt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new tjt(new _S(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(w=>{(w.showResolved||w.showUnresolved)&&this.updateFilter()})),this._register(this.filterWidget.onDidChangeFilterText(()=>this.updateFilter()))}saveState(){this.viewState.filter=this.filterWidget.getFilterText(),this.viewState.filterHistory=this.filterWidget.getHistory(),this.viewState.showResolved=this.filters.showResolved,this.viewState.showUnresolved=this.filters.showUnresolved,this.stateMemento.saveMemento(),super.saveState()}render(){super.render(),this._register(nst({name:"commentsView",focusNotifiers:[this,this.filterWidget],focusNextWidget:()=>{this.filterWidget.hasFocus()&&this.focus()},focusPreviousWidget:()=>{this.filterWidget.hasFocus()||this.focusFilter()}}))}focusFilter(){this.filterWidget.focus()}clearFilterText(){this.filterWidget.setFilterText("")}getFilterStats(){return this.cachedFilterStats||(this.cachedFilterStats={total:this.totalComments,filtered:this.tree?.getVisibleItemCount()??0}),this.cachedFilterStats}updateFilter(){this.filter.options=new _S(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved),this.tree?.filterComments(),this.cachedFilterStats=void 0;const{total:e,filtered:t}=this.getFilterStats();this.filterWidget.updateBadge(e===t||e===0?void 0:g(5331,"Showing {0} of {1}",t,e)),this.filterWidget.checkMoreFilters(!this.filters.showResolved||!this.filters.showUnresolved)}renderBody(e){super.renderBody(e),e.classList.add("comments-panel");const t=re(e,fe(".comments-panel-container"));this.treeContainer=re(t,fe(".tree-container")),this.treeContainer.classList.add("file-icon-themable-tree","show-file-icons"),this.cachedFilterStats=void 0,this.createTree(),this.createMessageBox(t),this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged,this)),this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated,this)),this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted,this)),this._register(this.onDidChangeBodyVisibility(i=>{i&&this.refresh()})),this.renderComments()}focus(){super.focus();const e=this.tree?.getHTMLElement();e&&av(e)||(!this.commentService.commentsModel.hasCommentThreads()&&this.messageBoxContainer?this.messageBoxContainer.focus():this.tree&&this.tree.domFocus())}async renderComments(){this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.renderMessage(),await this.tree?.setChildren(null,K8e(this.commentService.commentsModel))}collapseAll(){this.tree&&(this.tree.collapseAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}expandAll(){this.tree&&(this.tree.expandAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}get hasRendered(){return!!this.tree}layoutBodyContent(e=this.currentHeight,t=this.currentWidth){this.messageBoxContainer&&(this.messageBoxContainer.style.height=`${e}px`),this.tree?.layout(e,t),this.currentHeight=e,this.currentWidth=t}createMessageBox(e){this.messageBoxContainer=re(e,fe(".message-box-container")),this.messageBoxContainer.setAttribute("tabIndex","0")}renderMessage(){this.messageBoxContainer.textContent=this.commentService.commentsModel.getMessage(),this.messageBoxContainer.classList.toggle("hidden",this.commentService.commentsModel.hasCommentThreads())}getScreenReaderInfoForNode(e,t){let i="";if(t&&this.configurationService.getValue(vr.Comments)){const r=this.keybindingService.lookupKeybinding(uNt.id)?.getAriaLabel();i=r?g(5332,`Inspect this in the accessible view ({0}). +`,r):g(5333,`Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding. +`)}const n=this.getReplyCountAsString(e,t),o=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===Xx.Outdated?i+g(5334,"Outdated from {0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5335,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:e.threadRelevance===Xx.Outdated?i+g(5336,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5337,"{0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o}getRepliesAsString(e,t){return!e.replies.length||t?"":` +`+e.replies.map(i=>g(5338,"{0} {1}",i.comment.userName,typeof i.comment.body=="string"?i.comment.body:i.comment.body.value)).join(` +`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(5339," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(UA,this)),this.tree=this._register(this.instantiationService.createInstance(Fxe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof Yce?g(5340,"Comments for current workspace"):e instanceof tp?g(5341,"Comments in {0}, full path {1}",_i(e.resource),e.resource.fsPath):e instanceof Jw?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return Rxe.value}}})),this._register(this.tree.onDidOpen(e=>{this.openFile(e.element,e.editorOptions.pinned,e.editorOptions.preserveFocus,e.sideBySide)})),this._register(this.tree.onDidChangeModel(()=>{this.updateSomeCommentsExpanded()})),this._register(this.tree.onDidChangeCollapseState(()=>{this.updateSomeCommentsExpanded()})),this._register(this.tree.onDidFocus(()=>this.commentsFocusedContextKey.set(!0))),this._register(this.tree.onDidBlur(()=>this.commentsFocusedContextKey.set(!1)))}openFile(e,t,i,n){if(!e||!(e instanceof tp||e instanceof Jw))return;const o=e instanceof tp?e.commentThreads[0].thread:e.thread,r=e instanceof tp?e.commentThreads[0].comment:void 0;return sst(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,n)}async refresh(){if(this.tree&&this.isVisible()&&(this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads()),this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.cachedFilterStats=void 0,this.renderMessage(),this.tree?.setChildren(null,K8e(this.commentService.commentsModel)),this.tree.getSelection().length===0&&this.commentService.commentsModel.hasCommentThreads())){const e=this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];e&&(this.tree.setFocus([e]),this.tree.setSelection([e]))}}onAllCommentsChanged(e){this.cachedFilterStats=void 0,this.totalComments+=e.commentThreads.length;for(const t of e.commentThreads);this.refresh()}onCommentsUpdated(e){this.cachedFilterStats=void 0,this.totalComments+=e.added.length,this.totalComments-=e.removed.length;for(const t of this.commentService.commentsModel.resourceCommentThreads)for(const i of t.commentThreads);this.refresh()}onDataProviderDeleted(e){this.cachedFilterStats=void 0,this.totalComments=0,this.refresh()}updateSomeCommentsExpanded(){this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded())}areAllCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(this.tree.isCollapsed(e.current()))return!1;return!0}isSomeCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(!this.tree.isCollapsed(e.current()))return!0;return!1}};Gxe=D([_(1,we),_(2,xm),_(3,ei),_(4,Te),_(5,Le),_(6,lr),_(7,Ut),_(8,Ao),_(9,pn),_(10,eE),_(11,Yi),_(12,ec),_(13,ks),_(14,$i)],Gxe);const Cjt=new _e("Views");jn.appendMenuItem(_e.ViewContainerTitle,{submenu:Cjt,title:g(5295,"Views"),order:1});var hh;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(hh||(hh={}));const Zoe=class Zoe extends jTe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,n,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=n,this.cleanupOverlayScheduler=this._register(new cn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=Zoe.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.container.remove(),this.paneElement.classList.remove("dragged-over")})),this.overlay=document.createElement("div"),this.overlay.classList.add("pane-overlay-indicator"),this.container.appendChild(this.overlay),this.registerListeners(),this.updateStyles()}updateStyles(){this.overlay.style.backgroundColor=this.getColor(this.location===ir.Panel?wJe:AJe)||"";const e=this.getColor(Js);this.overlay.style.outlineColor=e||"",this.overlay.style.outlineOffset=e?"-2px":"",this.overlay.style.outlineStyle=e?"dashed":"",this.overlay.style.outlineWidth=e?"2px":"",this.overlay.style.borderColor=e||"",this.overlay.style.borderStyle="solid",this.overlay.style.borderWidth="0px"}registerListeners(){this._register(new $j(this.container,{onDragOver:e=>{this.positionOverlay(e.offsetX,e.offsetY),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:e=>this.dispose(),onDragEnd:e=>this.dispose(),onDrop:e=>{this.dispose()}})),this._register(ue(this.container,ke.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,n=this.paneElement.clientHeight,o=i/2,r=n/2;let a;switch(this.orientation===fi.VERTICAL?t=r&&(a=hh.DOWN):this.orientation===fi.HORIZONTAL&&(e=o&&(a=hh.RIGHT)),a){case hh.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case hh.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case hh.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case hh.RIGHT:this.doPositionOverlay({top:"0",right:"0",width:"50%",height:"100%"});break;default:{let c="0",l="0",d="100%",h="100%";if(this.bounds){const u=this.container.getBoundingClientRect();c=`${this.bounds.top-u.top}px`,l=`${this.bounds.left-u.left}px`,h=`${this.bounds.bottom-this.bounds.top}px`,d=`${this.bounds.right-this.bounds.left}px`}this.doPositionOverlay({top:c,left:l,width:d,height:h})}}this.orientation===fi.VERTICAL&&n<=25||this.orientation===fi.HORIZONTAL&&i<=25?this.doUpdateOverlayBorder(a):this.doUpdateOverlayBorder(void 0),this.overlay.style.opacity="1",setTimeout(()=>this.overlay.classList.add("overlay-move-transition"),0),this._currentDropOperation=a}doUpdateOverlayBorder(e){this.overlay.style.borderTopWidth=e===hh.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===hh.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===hh.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===hh.RIGHT?"2px":"0px"}doPositionOverlay(e){this.container.style.height="100%",this.overlay.style.top=e.top||"",this.overlay.style.left=e.left||"",this.overlay.style.bottom=e.bottom||"",this.overlay.style.right=e.right||"",this.overlay.style.width=e.width,this.overlay.style.height=e.height}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}};Zoe.OVERLAY_ID="monaco-pane-drop-overlay";let RF=Zoe,Kxe=class extends WZ{constructor(e,t,i,n,o){const r=n.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",PX(i.getViewContainerLocation(t)));super(_e.ViewContainerTitle,_e.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(M.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(PX(i.getViewContainerLocation(t)))))}};Kxe=D([_(2,xm),_(3,Le),_(4,Oa)],Kxe);let qxe=class extends Ytt{get onDidSashChange(){return qn(this.paneview).onDidSashChange}get panes(){return this.paneItems.map(e=>e.pane)}get views(){return this.panes}get length(){return this.paneItems.length}get menuActions(){return this._menuActions}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=n,this.layoutService=o,this.contextMenuService=r,this.telemetryService=a,this.extensionService=c,this.storageService=d,this.contextService=h,this.viewDescriptorService=u,this.paneItems=[],this.visible=!1,this.areExtensionsReady=!1,this.didLayout=!1,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidAddViews=this._register(new I),this.onDidAddViews=this._onDidAddViews.event,this._onDidRemoveViews=this._register(new I),this.onDidRemoveViews=this._onDidRemoveViews.event,this._onDidChangeViewVisibility=this._register(new I),this.onDidChangeViewVisibility=this._onDidChangeViewVisibility.event,this._onDidFocusView=this._register(new I),this.onDidFocusView=this._onDidFocusView.event,this._onDidBlurView=this._register(new I),this.onDidBlurView=this._onDidBlurView.event;const f=this.viewDescriptorService.getViewContainerById(e);if(!f)throw new Error("Could not find container");this.viewContainer=f,this.visibleViewsStorageId=`${e}.numberOfVisibleViews`,this.visibleViewsCountFromCache=this.storageService.getNumber(this.visibleViewsStorageId,Ie.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new Q5t(e,this.options)),this._boundarySashes&&this.paneview.setBoundarySashes(this._boundarySashes),this._register(this.paneview.onDidDrop(({from:c,to:l})=>this.movePane(c,l))),this._register(this.paneview.onDidScroll(c=>this.onDidScrollPane())),this._register(this.paneview.onDidSashReset(c=>this.onDidSashReset(c))),this._register(ue(e,ke.CONTEXT_MENU,c=>this.showContextMenu(new Eh(ct(e),c)))),this._register(fd.addTarget(e)),this._register(ue(e,uo.Contextmenu,c=>this.showContextMenu(new Eh(ct(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(Kxe,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const n=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===fi.VERTICAL?l.bottom:c.top,h=this.orientation===fi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},o=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let r;this._register(gS.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=n(),i&&i.disposed&&(i=void 0),!i&&o(r,c.eventData)){const l=c.dragAndDropData.getData();if(l.type==="view"){const d=this.viewDescriptorService.getViewContainerByViewId(l.id),h=this.viewDescriptorService.getViewDescriptorById(l.id);if(d!==this.viewContainer&&(!h||!h.canMoveView||this.viewContainer.rejectAddedViews))return;i=new RF(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(l.type==="composite"&&l.id!==this.viewContainer.id){const d=this.viewDescriptorService.getViewContainerById(l.id),h=this.viewDescriptorService.getViewContainerModel(d).allViewDescriptors;!h.some(u=>!u.canMoveView)&&h.length>0&&(i=new RF(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!o(r,c.eventData)&&(i.dispose(),i=void 0),o(r,c.eventData)&&FVe(c.eventData.dataTransfer,"move",i!==void 0)},onDragLeave:c=>{i?.dispose(),i=void 0},onDrop:c=>{if(i){const l=c.dragAndDropData.getData(),d=[];if(l.type==="composite"&&l.id!==this.viewContainer.id){const u=this.viewDescriptorService.getViewContainerById(l.id),f=this.viewDescriptorService.getViewContainerModel(u).allViewDescriptors;f.some(p=>!p.canMoveView)||d.push(...f)}else if(l.type==="view"){const u=this.viewDescriptorService.getViewContainerByViewId(l.id),f=this.viewDescriptorService.getViewDescriptorById(l.id);u!==this.viewContainer&&f&&f.canMoveView&&this.viewDescriptorService.moveViewsToContainer([f],this.viewContainer,void 0,"dnd")}const h=this.panes.length;if(d.length>0&&this.viewDescriptorService.moveViewsToContainer(d,this.viewContainer,void 0,"dnd"),h>0)for(const u of d){const f=this.panes.find(p=>p.id===u.id);f&&this.movePane(f,this.panes[this.panes.length-1])}}i?.dispose(),i=void 0}})),this._register(this.onDidSashChange(()=>this.saveViewSizes())),this._register(this.viewContainerModel.onDidAddVisibleViewDescriptors(c=>this.onDidAddViewDescriptors(c))),this._register(this.viewContainerModel.onDidRemoveVisibleViewDescriptors(c=>this.onDidRemoveViewDescriptors(c)));const a=this.viewContainerModel.visibleViewDescriptors.map((c,l)=>{const d=this.viewContainerModel.getSize(c.id),h=this.viewContainerModel.isCollapsed(c.id);return{viewDescriptor:c,index:l,size:d,collapsed:h}});a.length&&this.onDidAddViewDescriptors(a),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.areExtensionsReady=!0,this.panes.length&&(this.updateTitleArea(),this.updateViewHeaders()),this._register(this.configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(Jp.ACTIVITY_BAR_LOCATION)&&this.updateViewHeaders()}))}),this._register(this.viewContainerModel.onDidChangeActiveViewDescriptors(()=>this._onTitleAreaUpdate.fire()))}getTitle(){const e=this.viewContainerModel.title;if(this.isViewMergedWithContainer()){const t=this.paneItems[0].pane.singleViewPaneContainerTitle;if(t)return t;const i=this.paneItems[0].pane.title;return e===i?i:i?`${e}: ${i}`:e}return e}showContextMenu(e){for(const t of this.paneItems)if(wc(e.target,t.pane.element))return;e.stopPropagation(),e.preventDefault(),this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>this.menuActions?.getContextMenuActions()??[]})}getActionsContext(){}getActionViewItem(e,t){return this.isViewMergedWithContainer()?this.paneItems[0].pane.getActionViewItem(e,t):WN(this.instantiationService,e,t)}focus(){let e;if(this.lastFocusedPane)e=this.lastFocusedPane;else if(this.paneItems.length>0){for(const{pane:t}of this.paneItems)if(t.isExpanded()){e=t;break}}e&&e.focus()}get orientation(){switch(this.viewDescriptorService.getViewContainerLocation(this.viewContainer)){case ir.Sidebar:case ir.AuxiliaryBar:return fi.VERTICAL;case ir.Panel:return jzt(this.layoutService.getPanelPosition())?fi.HORIZONTAL:fi.VERTICAL}return fi.VERTICAL}layout(e){this.paneview&&(this.paneview.orientation!==this.orientation&&this.paneview.flipOrientation(e.height,e.width),this.paneview.layout(e.height,e.width)),this.dimension=e,this.didLayout?this.saveViewSizes():(this.didLayout=!0,this.restoreViewSizes())}setBoundarySashes(e){this._boundarySashes=e,this.paneview?.setBoundarySashes(e)}getOptimalWidth(){return Math.max(...this.panes.map(i=>i.getOptimalWidth()||0))+16}addPanes(e){const t=this.isViewMergedWithContainer();for(const{pane:i,size:n,index:o,disposable:r}of e)this.addPane(i,n,r,o);this.updateViewHeaders(),this.isViewMergedWithContainer()!==t&&this.updateTitleArea(),this._onDidAddViews.fire(e.map(({pane:i})=>i))}setVisible(e){this.visible!==!!e&&(this.visible=e,this._onDidChangeVisibility.fire(e)),this.panes.filter(t=>t.isVisible()!==e).forEach(t=>t.setVisible(e))}isVisible(){return this.visible}updateTitleArea(){this._onTitleAreaUpdate.fire()}createView(e,t){return this.instantiationService.createInstance(e.ctorDescriptor.ctor,...e.ctorDescriptor.staticArguments||[],t)}getView(e){return this.panes.filter(t=>t.id===e)[0]}saveViewSizes(){this.didLayout&&this.viewContainerModel.setSizes(this.panes.map(e=>({id:e.id,size:this.getPaneSize(e)})))}restoreViewSizes(){if(this.didLayout){let e;for(let t=0;ti+(n||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===fi.VERTICAL?e.set(i.id,this.dimension.height*(i.weight||20)/t):e.set(i.id,this.dimension.width*(i.weight||20)/t)}return e}saveState(){this.panes.forEach(e=>e.saveState()),this.storageService.store(this.visibleViewsStorageId,this.length,Ie.WORKSPACE,an.MACHINE)}onContextMenu(e,t){e.stopPropagation(),e.preventDefault();const i=t.menuActions.getContextMenuActions();this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i})}openView(e,t){let i=this.getView(e);return i||this.toggleViewVisibility(e),i=this.getView(e),i&&(i.setExpanded(!0),t&&i.focus()),i}onDidAddViewDescriptors(e){const t=[];for(const{viewDescriptor:n,collapsed:o,index:r,size:a}of e){const c=this.createView(n,{id:n.id,title:n.name.value,fromExtensionId:n.extensionId,expanded:!o,singleViewPaneContainerTitle:n.singleViewPaneContainerTitle});c.render();const l=ue(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new Eh(ct(c.draggableElement),h),c)}),d=M.latch(M.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(n.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:jr(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:n}of t)n.setVisible(this.isVisible()),i.push(n);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,n)=>n.index-i.index);const t=[];for(const{index:i}of e)this.paneItems[i]&&t.push(this.paneItems[i].pane);if(t.length){this.removePanes(t);for(const i of t)i.setVisible(!1)}}toggleViewVisibility(e){if(this.viewContainerModel.activeViewDescriptors.some(t=>t.id===e)){const t=!this.viewContainerModel.isVisible(e);this.viewContainerModel.setVisible(e,t)}}addPane(e,t,i,n=this.paneItems.length-1){const o=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),r=e.onDidBlur(()=>this._onDidBlurView.fire(e)),a=e.onDidChangeTitleArea(()=>{this.isViewMergedWithContainer()&&this.updateTitleArea()}),c=e.onDidChangeBodyVisibility(()=>this._onDidChangeViewVisibility.fire(e)),l=e.onDidChange(()=>{e===this.lastFocusedPane&&!e.isExpanded()&&(this.lastFocusedPane=void 0)}),d=this.viewDescriptorService.getViewContainerLocation(this.viewContainer)===ir.Panel;e.style({headerForeground:ze(d?hTt:CTt),headerBackground:ze(d?dTt:yTt),headerBorder:ze(d?uTt:EJe),dropBackground:ze(d?wJe:AJe),leftBorder:d?ze(gTt):void 0});const h=new Z;h.add(i),h.add(jr(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(n,0,u),qn(this.paneview).addPane(e,t,n);let f;h.add(gS.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(gS.INSTANCE.registerTarget(e.dropTargetElement,{onDragEnter:p=>{if(!f){const m=p.dragAndDropData.getData();if(m.type==="view"&&m.id!==e.id){const v=this.viewDescriptorService.getViewContainerByViewId(m.id),b=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!b||!b.canMoveView||this.viewContainer.rejectAddedViews))return;f=new RF(e.dropTargetElement,this.orientation??fi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const v=this.viewDescriptorService.getViewContainerById(m.id),b=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!b.some(w=>!w.canMoveView)&&b.length>0&&(f=new RF(e.dropTargetElement,this.orientation??fi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{FVe(p.eventData.dataTransfer,"move",f!==void 0)},onDragLeave:p=>{f?.dispose(),f=void 0},onDrop:p=>{if(f){const m=p.dragAndDropData.getData(),v=[];let b;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const w=this.viewDescriptorService.getViewContainerById(m.id),y=this.viewDescriptorService.getViewContainerModel(w).allViewDescriptors;y.length>0&&!y.some(C=>!C.canMoveView)&&(v.push(...y),b=y[0])}else if(m.type==="view"){const w=this.viewDescriptorService.getViewContainerByViewId(m.id),y=this.viewDescriptorService.getViewDescriptorById(m.id);w!==this.viewContainer&&y&&y.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(y),y&&(b=y)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),b){if(f.currentDropOperation===hh.DOWN||f.currentDropOperation===hh.RIGHT){const w=this.panes.findIndex(C=>C.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w>y&&y++,yC.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w=0&&y!==w&&this.movePane(this.panes[w],this.panes[y]))}v.length>1&&v.slice(1).forEach(w=>{let y=this.panes.findIndex(A=>A.id===b.id);const C=this.panes.findIndex(A=>A.id===w.id);C>=0&&y>=0&&(C>y&&y++,ythis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),qn(this.paneview).removePane(e);const[i]=this.paneItems.splice(t,1);i.disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(c=>c.pane===e),n=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[n];if(i<0||i>=this.paneItems.length||n<0||n>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,a),qn(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){qn(this.paneview).resizePane(e,t)}getPaneSize(e){return qn(this.paneview).getPaneSize(e)}updateViewHeaders(){this.isViewMergedWithContainer()?(this.paneItems[0].pane.isExpanded()?this.lastMergedCollapsedPane=void 0:(this.lastMergedCollapsedPane=this.paneItems[0].pane,this.paneItems[0].pane.setExpanded(!0)),this.paneItems[0].pane.headerVisible=!1,this.paneItems[0].pane.collapsible=!0):(this.paneItems.length===1?(this.paneItems[0].pane.headerVisible=!0,this.paneItems[0].pane===this.lastMergedCollapsedPane&&this.paneItems[0].pane.setExpanded(!1),this.paneItems[0].pane.collapsible=!1):this.paneItems.forEach(e=>{e.pane.headerVisible=!0,e.pane.collapsible=!0,e.pane===this.lastMergedCollapsedPane&&e.pane.setExpanded(!1)}),this.lastMergedCollapsedPane=void 0)}isViewMergedWithContainer(){return this.options.mergeViewWithContainerWhenSingleView&&this.paneItems.length===1?this.areExtensionsReady?!0:this.visibleViewsCountFromCache===void 0?this.paneItems[0].pane.isExpanded():this.visibleViewsCountFromCache===1:!1}onDidScrollPane(){for(const e of this.panes)e.onDidScrollRoot()}onDidSashReset(e){let t,i;for(let n=e;n>=0;n--)if(this.paneItems[n].pane?.isVisible()&&this.paneItems[n]?.pane.isExpanded()){t=this.paneItems[n].pane;break}for(let n=e+1;no?(this.resizePane(t,r),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,r))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};qxe=D([_(2,we),_(3,Te),_(4,kI),_(5,lr),_(6,Yi),_(7,fs),_(8,pn),_(9,$i),_(10,yi),_(11,xm)],qxe);class Jce extends li{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(xm),i=e.get(Le),n=FU.getValue(i);if(n===void 0)return;const o=t.getViewContainerByViewId(n),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===n),c=r.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=r.visibleViewDescriptors.length)return;const l=r.visibleViewDescriptors[c+this.offset];r.move(a.id,l.id)}}At(class extends Jce{constructor(){super({id:"views.moveViewUp",title:g(5296,"Move View Up"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.UpArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},-1)}});At(class extends Jce{constructor(){super({id:"views.moveViewLeft",title:g(5297,"Move View Left"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.LeftArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},-1)}});At(class extends Jce{constructor(){super({id:"views.moveViewDown",title:g(5298,"Move View Down"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.DownArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},1)}});At(class extends Jce{constructor(){super({id:"views.moveViewRight",title:g(5299,"Move View Right"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.RightArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},1)}});At(class extends li{constructor(){super({id:"vscode.moveViews",title:g(5300,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(xm),n=i.getViewContainerById(t.destinationId);if(n){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],n,hwe.Default,this.desc.id)}await e.get(Lm).openViewContainer(n.id,!0)}}});class Sjt{get input(){return this._input}set input(e){this._input=e,this._onDidChangeInput.fire(e)}get onDidChangeInput(){return this._onDidChangeInput.event}get label(){return this._label}set label(e){this._label=e,this._onDidChangeLabel.fire(this._label)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e}get comments(){return this._comments}set comments(e){this._comments=e,this._onDidChangeComments.fire(this._comments)}get onDidChangeComments(){return this._onDidChangeComments.event}set range(e){this._range=e,this._onDidChangeRange.fire(this._range)}get range(){return this._range}get onDidChangeCanReply(){return this._onDidChangeCanReply.event}set canReply(e){this._canReply=e,this._onDidChangeCanReply.fire(this._canReply)}get canReply(){return this._canReply}get collapsibleState(){return this._collapsibleState}set collapsibleState(e){e!==this._collapsibleState&&(this._collapsibleState=e,this._onDidChangeCollapsibleState.fire(this._collapsibleState))}get initialCollapsibleState(){return this._initialCollapsibleState}set initialCollapsibleState(e){this._initialCollapsibleState=e,this.collapsibleState===void 0&&(this.collapsibleState=this.initialCollapsibleState),this._onDidChangeInitialCollapsibleState.fire(e)}get isDisposed(){return this._isDisposed}isDocumentCommentThread(){return this._range===void 0||F.isIRange(this._range)}get state(){return this._state}set state(e){this._state=e,this._onDidChangeState.fire(this._state)}get applicability(){return this._applicability}set applicability(e){this._applicability=e,this._onDidChangeApplicability.fire(e)}get isTemplate(){return this._isTemplate}constructor(e,t,i,n,o,r,a,c,l,d){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=n,this.resource=o,this._range=r,this._canReply=c,this._isTemplate=l,this.editorId=d,this._onDidChangeInput=new I,this._onDidChangeLabel=new I,this.onDidChangeLabel=this._onDidChangeLabel.event,this._onDidChangeComments=new I,this._onDidChangeCanReply=new I,this._onDidChangeRange=new I,this.onDidChangeRange=this._onDidChangeRange.event,this._onDidChangeCollapsibleState=new I,this.onDidChangeCollapsibleState=this._onDidChangeCollapsibleState.event,this._onDidChangeInitialCollapsibleState=new I,this.onDidChangeInitialCollapsibleState=this._onDidChangeInitialCollapsibleState.event,this._onDidChangeApplicability=new I,this.onDidChangeApplicability=this._onDidChangeApplicability.event,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._isDisposed=!1,l?this.comments=[]:a&&(this._comments=a)}batchUpdate(e){const t=i=>Object.prototype.hasOwnProperty.call(e,i);t("range")&&(this._range=e.range),t("label")&&(this._label=e.label),t("contextValue")&&(this._contextValue=e.contextValue===null?void 0:e.contextValue),t("comments")&&(this._comments=e.comments),t("collapseState")&&(this.initialCollapsibleState=e.collapseState),t("canReply")&&(this.canReply=e.canReply),t("state")&&(this.state=e.state),t("applicability")&&(this.applicability=e.applicability),t("isTemplate")&&(this._isTemplate=e.isTemplate)}dispose(){this._isDisposed=!0,this._onDidChangeCollapsibleState.dispose(),this._onDidChangeComments.dispose(),this._onDidChangeInput.dispose(),this._onDidChangeLabel.dispose(),this._onDidChangeRange.dispose(),this._onDidChangeState.dispose()}toJSON(){return{$mid:ws.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class Ajt{get handle(){return this._handle}get id(){return this._id}get contextValue(){return this._id}get proxy(){return this._proxy}get label(){return this._label}get reactions(){return this._reactions}set reactions(e){this._reactions=e}get options(){return this._features.options}get features(){return this._features}get owner(){return this._id}constructor(e,t,i,n,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=n,this._id=o,this._label=r,this._features=a,this._threads=new Map}async setActiveCommentAndThread(e){return this._proxy.$setActiveComment(this._handle,e?{commentThreadHandle:e.thread.commentThreadHandle,uniqueIdInThread:e.comment?.uniqueIdInThread}:void 0)}updateFeatures(e){this._features=e}createCommentThread(e,t,i,n,o,r,a,c){const l=new Sjt(t,this.handle,e,i,N.revive(n).toString(),o,r,!0,a,c);return this._threads.set(t,l),l.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}),l}updateCommentThread(e,t,i,n){const o=this.getKnownThread(e);o.batchUpdate(n),o.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]})}deleteCommentThread(e){const t=this.getKnownThread(e);this._threads.delete(e),t.dispose(),t.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]})}deleteCommentThreadMain(e){this._threads.forEach(t=>{t.threadId===e&&this._proxy.$deleteCommentThread(this._handle,t.commentThreadHandle)})}updateInput(e){const t=this.activeEditingCommentThread;if(t&&t.input){const i=t.input;i.value=e,t.input=i}}updateCommentingRanges(e){this._commentService.updateCommentingRanges(this._uniqueId,e)}getKnownThread(e){const t=this._threads.get(e);if(!t)throw new Error("unknown thread");return t}async getDocumentComments(e,t){if(e.scheme===pe.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[],commentingRanges:{resource:e,ranges:[],fileComments:!1}};const i=[];for(const o of[...this._threads.keys()]){const r=this._threads.get(o);r.resource===e.toString()&&r.isDocumentCommentThread()&&i.push(r)}const n=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:n?.ranges||[],fileComments:!!n?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==pe.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const n of[...this._threads.keys()]){const o=this._threads.get(n);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,n,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,n)}getAllComments(){const e=[];for(const t of[...this._threads.keys()])e.push(this._threads.get(t));return e}createCommentThreadTemplate(e,t,i){return this._proxy.$createCommentThreadTemplate(this.handle,e,t,i)}async updateCommentThreadTemplate(e,t){await this._proxy.$updateCommentThreadTemplate(this.handle,e,t)}toJSON(){return{$mid:ws.CommentController,handle:this.handle}}}const q8e=oi("comments-view-icon",ve.commentDiscussion,g(4873,"View icon of the comments view."));let Q8e=class extends V{constructor(e,t,i,n,o,r){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=n,this._uriIdentityService=o,this._editorService=r,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(Ye.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async a=>{const c=a.controllerHandle,l=this._commentControllers.get(c);l&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=a,l.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,n){const o=`${t}-${n}`;this._handlers.set(e,o);const r=new Ajt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(jl);a||this.registerView(a),this.registerViewListeners(a),this._commentService.setWorkspaceComments(String(e),[])}$unregisterCommentController(e){const t=this._handlers.get(e);this._handlers.delete(e),this._commentControllers.delete(e),typeof t=="string"&&this._commentService.unregisterCommentController(t)}$updateCommentControllerFeatures(e,t){const i=this._commentControllers.get(e);i&&i.updateFeatures(t)}$createCommentThread(e,t,i,n,o,r,a,c,l){const d=this._commentControllers.get(e);if(d)return d.createCommentThread(a.value,t,i,n,o,r,c,l)}$updateCommentThread(e,t,i,n,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,n,o)}$deleteCommentThread(e,t){const i=this._commentControllers.get(e);if(i)return i.deleteCommentThread(t)}$updateCommentingRanges(e,t){const i=this._commentControllers.get(e);i&&i.updateCommentingRanges(t)}async $revealCommentThread(e,t,i,n){const o=this._commentControllers.get(e);if(!o)return Promise.resolve();const r=o.getAllComments().find(c=>c.commentThreadHandle===t);if(!r||!r.isDocumentCommentThread())return Promise.resolve();const a=r.comments?.find(c=>c.uniqueIdInThread===i);sst(this._commentService,this._editorService,this._uriIdentityService,r,a,n.focusReply,void 0,n.preserveFocus)}async $hideCommentThread(e,t){const i=this._commentControllers.get(e);if(!i)return Promise.resolve();const n=i.getAllComments().find(o=>o.commentThreadHandle===t);if(!n||!n.isDocumentCommentThread())return Promise.resolve();n.collapsibleState=Lc.Collapsed}registerView(e){if(!e){const t=Qe.as(eI.ViewContainersRegistry).registerViewContainer({id:jl,title:Rxe,ctorDescriptor:new wi(qxe,[jl,{mergeViewWithContainerWhenSingleView:!0}]),storageId:ZQt,hideIfEmpty:!0,icon:q8e,order:10},ir.Panel);Qe.as(eI.ViewsRegistry).registerViews([{id:jl,name:Rxe,canToggleVisibility:!1,ctorDescriptor:new wi(Gxe),canMoveView:!0,containerIcon:q8e,focusCommand:{id:"workbench.action.focusCommentsPanel"}}],t)}}setComments(){[...this._commentControllers.keys()].forEach(e=>{const t=this._commentControllers.get(e).getAllComments();if(t.length){const i=this.getHandler(e);this._commentService.setWorkspaceComments(i,t)}})}registerViewOpenedListener(){this._openViewListener||(this._openViewListener=this._viewsService.onDidChangeViewVisibility(e=>{e.id===jl&&e.visible&&(this.setComments(),this._openViewListener&&(this._openViewListener.dispose(),this._openViewListener=null))}))}registerViewListeners(e){e||this.registerViewOpenedListener(),this._register(this._viewDescriptorService.onDidChangeContainer(t=>{t.views.find(i=>i.id===jl)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(jl);t.viewContainer.id===i?.id&&(this.setComments(),this.registerViewOpenedListener())}))}getHandler(e){if(!this._handlers.has(e))throw new Error("Unknown handler");return this._handlers.get(e)}};Q8e=D([Gi(Be.MainThreadComments),_(1,eE),_(2,Lm),_(3,xm),_(4,ks),_(5,ei)],Q8e);var $x;(function(s){s[s.Output=1]="Output",s[s.OutputItems=2]="OutputItems",s[s.ExecutionState=3]="ExecutionState"})($x||($x={}));var rp;(function(s){function e(f){return{mime:f.mime,valueBytes:f.data}}s.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}s.toNotebookOutputDto=t;function i(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,internalMetadata:f.internalMetadata,metadata:f.metadata,outputs:f.outputs.map(t)}}s.toNotebookCellDataDto=i;function n(f){return{metadata:f.metadata,cells:f.cells.map(i)}}s.toNotebookDataDto=n;function o(f){return{mime:f.mime,data:f.valueBytes}}s.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}s.fromNotebookOutputDto=r;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(r),metadata:f.metadata,internalMetadata:f.internalMetadata}}s.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}s.fromNotebookDataDto=c;function l(f){return{handle:f.handle,uri:f.uri,source:f.textBuffer.getLinesContent(),eol:f.textBuffer.getEOL(),language:f.language,cellKind:f.cellKind,outputs:f.outputs.map(t),metadata:f.metadata,internalMetadata:f.internalMetadata}}s.toNotebookCellDto=l;function d(f){return f.editType===$x.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===$x.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}s.fromCellExecuteUpdateDto=d;function h(f){return f}s.fromCellExecuteCompleteDto=h;function u(f){return f.editType===dI.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}s.fromCellEditOperationDto=u})(rp||(rp={}));let j8e=class{constructor(e,t,i,n){this._notebookService=t,this._cellStatusBarService=i,this._logService=n,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(Ye.ExtHostNotebook)}dispose(){this._disposables.dispose(),bt(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,n,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:n,dataToNotebook:async a=>{const c=new js;let l;if(a.byteLength===0&&i==="interactive")l=rp.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,He.None);l=rp.fromNotebookDataDto(d.value)}return this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${c.elapsed()}ms`,{viewType:i,extensionId:t.id.value}),l},notebookToData:a=>{const c=new js,l=this._proxy.$notebookToData(e,new jd(rp.toNotebookDataDto(a)),He.None);return this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${c.elapsed()}`,{viewType:i,extensionId:t.id.value}),l},save:async(a,c,l,d)=>({...await this._proxy.$saveNotebook(e,a,c,l,d),children:void 0,resource:a}),searchInNotebooks:async(a,c,l)=>{const d=this._notebookService.getContributedNotebookType(i);if(!d)return{results:[],limitHit:!1};const u=d.selectors.map(b=>(b.include||b).toString());if(!u.length)return{results:[],limitHit:!1};const f=Fi([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(b=>b!==i?l.get(b)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(b=>({resource:N.revive(b.resource),cellResults:b.cellResults.map(y=>Mo(y))})),limitHit:m.limitHit}}})),o&&r.add(this._notebookService.registerContributedNotebookType(i,o)),this._notebookSerializer.set(e,r),this._logService.trace("[NotebookSerializer] registered notebook serializer",{viewType:i,extensionId:t.id.value})}$unregisterNotebookSerializer(e){this._notebookSerializer.get(e)?.dispose(),this._notebookSerializer.delete(e)}$emitCellStatusBarEvent(e){const t=this._notebookCellStatusBarRegistrations.get(e);t instanceof I&&t.fire(void 0)}async $registerNotebookCellStatusBarItemProvider(e,t,i){const n=this,o={async provideCellStatusBarItems(a,c,l){const d=await n._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&n._proxy.$releaseNotebookCellStatusBarItems(d.cacheId)}}},viewType:i};if(typeof t=="number"){const a=new I;this._notebookCellStatusBarRegistrations.set(t,a),o.onDidChangeStatusBarItems=a.event}const r=this._cellStatusBarService.registerCellStatusBarItemProvider(o);this._notebookCellStatusBarRegistrations.set(e,r)}async $unregisterNotebookCellStatusBarItemProvider(e,t){const i=n=>{this._notebookCellStatusBarRegistrations.get(n)&&(this._notebookCellStatusBarRegistrations.get(n)?.dispose(),this._notebookCellStatusBarRegistrations.delete(n))};i(e),typeof t=="number"&&i(t)}};j8e=D([Gi(Be.MainThreadNotebook),_(1,tE),_(2,PJe),_(3,Ge)],j8e);_t.registerCommand("_executeDataToNotebook",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(i instanceof $e,"VSBuffer");const o=await s.get(tE).withNotebookDataProvider(t);if(!(o instanceof hG))return;const r=await o.serializer.dataToNotebook(i);return new jd(rp.toNotebookDataDto(r))});_t.registerCommand("_executeNotebookToData",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(typeof i=="object");const o=await s.get(tE).withNotebookDataProvider(t);if(!(o instanceof hG))return;const r=rp.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var Qxe;(function(s){s[s.cell=0]="cell",s[s.notebook=1]="notebook"})(Qxe||(Qxe={}));class Ejt{get preloadUris(){return this.preloads.map(e=>e.uri)}get preloadProvides(){return this.preloads.flatMap(e=>e.provides)}constructor(e,t){this._languageService=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.id=e.id,this.viewType=e.notebookType,this.extension=e.extensionId,this.implementsInterrupt=e.supportsInterrupt??!1,this.label=e.label,this.description=e.description,this.detail=e.detail,this.supportedLanguages=eo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=N.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:N.revive(i.uri),provides:i.provides}))??[]}update(e){const t=Object.create(null);e.label!==void 0&&(this.label=e.label,t.label=!0),e.description!==void 0&&(this.description=e.description,t.description=!0),e.detail!==void 0&&(this.detail=e.detail,t.detail=!0),e.supportedLanguages!==void 0&&(this.supportedLanguages=eo(e.supportedLanguages)?e.supportedLanguages:this._languageService.getRegisteredLanguageIds(),t.supportedLanguages=!0),e.supportsExecutionOrder!==void 0&&(this.implementsExecutionOrder=e.supportsExecutionOrder,t.hasExecutionOrder=!0),e.supportsInterrupt!==void 0&&(this.implementsInterrupt=e.supportsInterrupt,t.hasInterruptHandler=!0),e.hasVariableProvider!==void 0&&(this.hasVariableProvider=e.hasVariableProvider,t.hasVariableProvider=!0),this._onDidChange.fire(t)}}class xjt{constructor(e){this.notebookType=e}}let Y8e=class{constructor(e,t,i,n,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=n,this._notebookService=o,this._editors=new mo,this._disposables=new Z,this._kernels=new Map,this._kernelDetectionTasks=new Map,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProvidersEventRegistrations=new Map,this._executions=new Map,this._notebookExecutions=new Map,this.variableRequestIndex=0,this.variableRequestMap=new Map,this._proxy=e.getProxy(Ye.ExtHostNotebookKernels),r.listNotebookEditors().forEach(this._onEditorAdd,this),r.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),r.onDidRemoveNotebookEditor(this._onEditorRemove,this,this._disposables),this._disposables.add(Ee(()=>{this._executions.forEach(a=>{a.complete({})}),this._notebookExecutions.forEach(a=>a.complete())})),this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(a=>{a.type===Qxe.cell&&this._proxy.$cellExecutionChanged(a.notebook,a.cellHandle,a.changed?.state)}))}dispose(){this._disposables.dispose();for(const[,e]of this._kernels.values())e.dispose();for(const[,e]of this._kernelDetectionTasks.values())e.dispose();for(const[,e]of this._kernelSourceActionProviders.values())e.dispose();this._editors.dispose()}_onEditorAdd(e){const t=e.onDidReceiveMessage(i=>{if(!e.hasModel())return;const{selected:n}=this._notebookKernelService.getMatchingKernel(e.textModel);if(n){for(const[o,r]of this._kernels)if(r[0]===n){this._proxy.$acceptKernelMessageFromRenderer(o,e.getId(),i.message);break}}});this._editors.set(e,t)}_onEditorRemove(e){this._editors.deleteAndDispose(e)}async $postMessage(e,t,i){const n=this._kernels.get(e);if(!n)throw new Error("kernel already disposed");const[o]=n;let r=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===o){if(t===void 0)a.postMessage(i),r=!0;else if(a.getId()===t){a.postMessage(i),r=!0;break}}return r}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,n=new class extends Ejt{async executeNotebookCellsRequest(a,c){await i._proxy.$executeCells(e,a,c)}async cancelNotebookCellExecution(a,c){await i._proxy.$cancelCells(e,a,c)}provideVariables(a,c,l,d,h){const u=`${e}variables${i.variableRequestIndex++}`;if(i.variableRequestMap.has(u))return i.variableRequestMap.get(u).asyncIterable;const f=new P2;return i.variableRequestMap.set(u,f),i._proxy.$provideVariables(e,u,a,c,l,d,h).then(()=>{f.resolve(),i.variableRequestMap.delete(u)}).catch(p=>{f.reject(p),i.variableRequestMap.delete(u)}),f.asyncIterable}}(t,this._languageService),o=this._notebookKernelService.onDidChangeSelectedNotebooks(a=>{a.oldKernel===n.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===n.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(n);this._kernels.set(e,[n,jr(o,r)])}$updateKernel(e,t){const i=this._kernels.get(e);i&&i[0].update(t)}$removeKernel(e){const t=this._kernels.get(e);t&&(t[1].dispose(),this._kernels.delete(e))}$updateNotebookPriority(e,t,i){const n=this._kernels.get(e);n&&this._notebookKernelService.updateKernelNotebookAffinity(n[0],N.revive(t),i)}$createExecution(e,t,i,n){const o=N.revive(i),r=this._notebookService.getNotebookTextModel(o);if(!r)throw new Error(`Notebook not found: ${o.toString()}`);const a=this._notebookKernelService.getMatchingKernel(r);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(o,n);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(rp.fromCellExecuteUpdateDto))}catch(n){vt(n)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(rp.fromCellExecuteCompleteDto(t.value))}catch(i){vt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const n=N.revive(i),o=this._notebookService.getNotebookTextModel(n);if(!o)throw new Error(`Notebook not found: ${n.toString()}`);const r=this._notebookKernelService.getMatchingKernel(o);if(!r.selected||r.selected.id!==t)throw new Error(`Kernel is not selected: ${r.selected?.id} !== ${t}`);const a=this._notebookExecutionStateService.createExecution(n);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){vt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){vt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new xjt(t),n=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,n])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const n={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,He.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=N.revive(a.documentation)),{label:a.label,command:a.command,description:a.description,detail:a.detail,documentation:c}})};if(typeof t=="number"){const r=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,r),n.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,n);this._kernelSourceActionProviders.set(e,[n,o])}$removeKernelSourceActionProvider(e,t){const i=this._kernelSourceActionProviders.get(e);i&&(i[1].dispose(),this._kernelSourceActionProviders.delete(e)),typeof t=="number"&&this._kernelSourceActionProvidersEventRegistrations.delete(t)}$emitNotebookKernelSourceActionsChangeEvent(e){const t=this._kernelSourceActionProvidersEventRegistrations.get(e);t instanceof I&&t.fire(void 0)}$variablesUpdated(e){this._notebookKernelService.notifyVariablesChange(N.revive(e))}};Y8e=D([Gi(Be.MainThreadNotebookKernels),_(1,xi),_(2,OJe),_(3,FJe),_(4,tE),_(5,R6)],Y8e);let jxe=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new ui,this._proxy=e.getProxy(Ye.ExtHostNotebookDocuments),this._modelReferenceCollection=new Fnt(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(n=>this._proxy.$acceptDirtyStateChanged(n.resource,n.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(n=>this._proxy.$acceptModelSaved(n))),this._disposables.add(t.onWillFailWithConflict(n=>{this._modelReferenceCollection.remove(n.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),bt(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(n=>{const o={versionId:n.versionId,rawEvents:[]};for(const a of n.rawEvents)switch(a.kind){case Sl.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>rp.toNotebookCellDto(l))])});break;case Sl.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case Sl.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(rp.toNotebookOutputDto)});break;case Sl.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(rp.toNotebookOutputItemDto),append:a.append});break;case Sl.ChangeCellLanguage:case Sl.ChangeCellContent:case Sl.ChangeCellMetadata:case Sl.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=n.rawEvents.find(a=>a.kind===Sl.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new jd(o),this._notebookEditorModelResolverService.isDirty(t.uri),r?t.metadata:void 0)})),this._documentEventListenersMapping.set(t.uri,i)}}handleNotebooksRemoved(e){for(const t of e)this._documentEventListenersMapping.get(t)?.dispose(),this._documentEventListenersMapping.delete(t)}async $tryCreateNotebook(e){const t=await this._notebookEditorModelResolverService.resolve({untitledResource:void 0},e.viewType);if(t.object.notebook.onWillDispose(()=>{t.dispose()}),this._proxy.$acceptDirtyStateChanged(t.object.resource,!0),e.content){const i=rp.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),n=await i.object.save();return i.dispose(),n}};jxe=D([_(1,$ae),_(2,ks)],jxe);class Djt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let Yxe=class{constructor(e,t,i,n,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=n,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(Ye.ExtHostNotebookEditors),this._editorService.onDidActiveEditorChange(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidRemoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidMoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables)}dispose(){this._disposables.dispose(),bt(this._mainThreadEditors.values())}handleEditorsAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeVisibleRanges(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{visibleRanges:{ranges:t.visibleRanges}})})),i.add(t.onDidChangeSelection(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{selections:{selections:t.getSelections()}})}));const n=new Djt(t,i);this._mainThreadEditors.set(t.getId(),n)}}handleEditorsRemoved(e){for(const t of e)this._mainThreadEditors.get(t)?.dispose(),this._mainThreadEditors.delete(t)}_updateEditorViewColumns(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=nB(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=rI(this._editorGroupService,t.group))}Ys(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const n={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?Gk.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:N.revive(e),options:n},RZ(this._editorGroupService,this._configurationService,i.position)),r=nB(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const n=this._notebookEditorService.getNotebookEditor(e);if(!n)return;const o=n;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case DF.Default:return o.revealCellRangeInView(t);case DF.InCenter:return o.revealInCenter(r);case DF.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case DF.AtTop:return o.revealInViewAtTop(r)}}$trySetSelections(e,t){const i=this._notebookEditorService.getNotebookEditor(e);i&&(i.setSelections(t),t.length&&i.setFocus({start:t[0].start,end:t[0].start+1}))}};Yxe=D([_(1,ei),_(2,R6),_(3,Po),_(4,Te)],Yxe);var dj;class J8e{static delta(e,t){if(!e)return{addedDocuments:[...t.documents],removedDocuments:[],addedEditors:[...t.textEditors.values()],removedEditors:[],visibleEditors:[...t.visibleEditors].map(a=>a[0])};const i=Sre(e.documents,t.documents),n=Qge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=Qge(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:n.added,removedEditors:n.removed.map(a=>a.getId()),newActiveEditor:o,visibleEditors:r.added.length===0&&r.removed.length===0?void 0:[...t.visibleEditors].map(a=>a[0])}}constructor(e,t,i,n){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=n}}let X8e=dj=class{constructor(e,t,i,n,o,r,a){this._notebookService=i,this._notebookEditorService=n,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new mo,this._proxy=e.getProxy(Ye.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(jxe,e),this._mainThreadEditors=t.createInstance(Yxe,e),e.set(Be.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Be.MainThreadNotebookEditors,this._mainThreadEditors),this._notebookService.onWillAddNotebookDocument(()=>this._updateState(),this,this._disposables),this._notebookService.onDidRemoveNotebookDocument(()=>this._updateState(),this,this._disposables),this._editorService.onDidActiveEditorChange(()=>this._updateState(),this,this._disposables),this._editorService.onDidVisibleEditorsChange(()=>this._updateState(),this,this._disposables),this._notebookEditorService.onDidAddNotebookEditor(this._handleEditorAdd,this,this._disposables),this._notebookEditorService.onDidRemoveNotebookEditor(this._handleEditorRemove,this,this._disposables),this._updateState()}dispose(){this._mainThreadNotebooks.dispose(),this._mainThreadEditors.dispose(),this._disposables.dispose(),this._editorListeners.dispose()}_handleEditorAdd(e){this._editorListeners.set(e.getId(),jr(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusWidget(()=>this._updateState(e)))),this._updateState()}_handleEditorRemove(e){this._editorListeners.deleteAndDispose(e.getId()),this._updateState()}_updateState(e){const t=new Map,i=new Map;for(const a of this._notebookEditorService.listNotebookEditors())a.hasModel()&&t.set(a.getId(),a);const n=nB(this._editorService.activeEditorPane);let o=null;n?o=n.getId():e?.textModel&&(o=e.getId()),o&&!t.has(o)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",o,t.keys()),o=null);for(const a of this._editorService.visibleEditorPanes){const c=nB(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new J8e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(J8e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(dj._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(dj._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new jd(t)),this._mainThreadEditors.handleEditorsRemoved(e.removedEditors),this._mainThreadNotebooks.handleNotebooksRemoved(e.removedDocuments),this._mainThreadNotebooks.handleNotebooksAdded(e.addedDocuments),this._mainThreadEditors.handleEditorsAdded(e.addedEditors)}static _isDeltaEmpty(e){return!(e.addedDocuments!==void 0&&e.addedDocuments.length>0||e.removedDocuments!==void 0&&e.removedDocuments.length>0||e.addedEditors!==void 0&&e.addedEditors.length>0||e.removedEditors!==void 0&&e.removedEditors.length>0||e.visibleEditors!==void 0&&e.visibleEditors.length>0||e.newActiveEditor!==void 0)}static _asModelAddData(e){return{viewType:e.viewType,uri:e.uri,metadata:e.metadata,versionId:e.versionId,cells:e.cells.map(rp.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>nB(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&rI(this._editorGroupService,t.group)}}};X8e=dj=D([QN,_(1,we),_(2,tE),_(3,R6),_(4,ei),_(5,Po),_(6,Ge)],X8e);let Z8e=class extends V{constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(Ye.ExtHostNotebookRenderers),this._register(t.onShouldPostMessage(i=>{this.proxy.$postRendererMessage(i.editorId,i.rendererId,i.message)}))}$postMessage(e,t,i){return this.messaging.receiveMessage(e,t,i)}};Z8e=D([Gi(Be.MainThreadNotebookRenderers),_(1,BJe)],Z8e);var M$;(function(s){s[s.Save=1]="Save",s[s.Backup=2]="Backup"})(M$||(M$={}));var hj,Fp;(function(s){s[s.SAVED=0]="SAVED",s[s.DIRTY=1]="DIRTY",s[s.PENDING_SAVE=2]="PENDING_SAVE",s[s.CONFLICT=3]="CONFLICT",s[s.ORPHAN=4]="ORPHAN",s[s.ERROR=5]="ERROR"})(Fp||(Fp={}));var iM;let e3e=(iM=class extends fie{get model(){return this._model}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(t,r),this.typeId=e,this.name=i,this.modelFactory=n,this.externalResolver=o,this.logService=a,this.workingCopyFileService=c,this.filesConfigurationService=l,this.workingCopyBackupService=d,this.notificationService=u,this.workingCopyEditorService=f,this.editorService=p,this.elevatedFileService=m,this.progressService=v,this.capabilities=aC.None,this._model=void 0,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.dirty=!1,this.ignoreDirtyOnModelContentChange=!1,this.versionId=0,this.lastContentChangeFromUndoRedo=void 0,this.saveSequentializer=new RGe,this.ignoreSaveFromSaveParticipants=!1,this.inConflictMode=!1,this.inErrorMode=!1,this._register(h.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}isDirty(){return this.dirty}markModified(){this.setDirty(!0)}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,n=this.inErrorMode,o=this.savedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.isResolved()&&(this.savedVersionId=this.model.versionId)),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=n,this.savedVersionId=o}}isResolved(){return!!this.model}async resolve(e){if(this.trace("resolve() - enter"),this.isDisposed()){this.trace("resolve() - exit - without resolving because file working copy is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because file working copy is dirty or being saved");return}return this.doResolve(e)}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents);if(!(!this.isResolved()&&await this.resolveFromBackup()))return this.resolveFromFile(e)}async resolveFromBuffer(e){this.trace("resolveFromBuffer()");let t,i,n,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,n=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),n=0,o=S_,this.setOrphaned(r.fileOperationResult===Qi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:n,etag:o,value:e,readonly:!1,locked:!1},!0)}async resolveFromBackup(){const e=await this.workingCopyBackupService.resolve(this);return this.isResolved()?(this.trace("resolveFromBackup() - exit - withoutresolving because previously new file working copy got created meanwhile"),!0):e?(await this.doResolveFromBackup(e),!0):!1}async doResolveFromBackup(e){this.trace("doResolveFromBackup()"),await this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:S_,value:e.value,readonly:!1,locked:!1},!0),e.meta&&e.meta.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile;let i;t?i=S_:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const n=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),n!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because file working copy content changed");return}await this.resolveFromContent(o,!1)}catch(o){const r=o.fileOperationResult;if(this.setOrphaned(r===Qi.FILE_NOT_FOUND),this.isResolved()&&r===Qi.FILE_NOT_MODIFIED_SINCE){o instanceof C5&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Qi.FILE_NOT_FOUND&&!t)return;throw o}}async resolveFromContent(e,t){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because working copy is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0}),this.isResolved()?await this.doUpdateModel(e.value):await this.doCreateModel(e.value),this.setDirty(!!t),this._onDidResolve.fire()}async doCreateModel(e){this.trace("doCreateModel()"),this._model=this._register(await this.modelFactory.createModel(this.resource,e,He.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,He.None)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onWillDispose(()=>this.dispose()))}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.versionId===this.savedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire()}async forceResolveFromFile(){this.isDisposed()||await this.externalResolver({forceReadFromFile:!0})}get backupDelay(){return this.model?.configuration?.backupDelay}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.isOrphaned()});let i;return this.isResolved()&&(i=await U_(this.model.snapshot(M$.Backup,e),e)),{meta:t,content:i}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(Fp.CONFLICT)||this.hasState(Fp.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for file working copy that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(Fp.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.model.pushStackElement();const i=new ci;return this.progressService.withProgress({title:g(10700,"Saving '{0}'",this.name),location:ud.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastContentChangeFromUndoRedo;a{try{const a={mtime:o.mtime,etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource)?S_:o.etag,unlock:t.writeUnlock};let c;if(typeof r.model.save=="function")try{c=await r.model.save(a,n.token)}catch(l){if(n.token.isCancellationRequested)return;throw l}else{const l=await U_(r.model.snapshot(M$.Save,n.token),n.token);if(n.token.isCancellationRequested)return;n.dispose(),t?.writeElevated&&this.elevatedFileService.isSupported(o.resource)?c=await this.elevatedFileService.writeFileElevated(o.resource,qn(l),a):c=await this.fileService.writeFile(o.resource,qn(l),a)}this.handleSaveSuccess(c,e,t)}catch(a){this.handleSaveError(a,e,t)}})(),()=>n.cancel())})(),()=>n.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[stored file working copy] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString(),this.typeId]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Qi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,n=[];let o;if(i.fileOperationResult===Qi.FILE_MODIFIED_SINCE)o=g(10702,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),n.push(rl({id:"fileWorkingCopy.overwrite",label:g(10703,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Cn.EXPLICIT})})),n.push(rl({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Qi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Qi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);byt(e)&&n.push(...e.actions),h&&(d||l)?n.push(rl({id:"fileWorkingCopy.saveElevated",label:l?Qn?g(10705,"Overwrite as Admin..."):g(10706,"Overwrite as Sudo..."):Qn?g(10707,"Retry as Admin..."):g(10708,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Cn.EXPLICIT})}})):c?n.push(rl({id:"fileWorkingCopy.unlock",label:g(10703,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Cn.EXPLICIT})})):n.push(rl({id:"fileWorkingCopy.retry",label:g(10709,"Retry"),run:()=>this.save({...t,reason:Cn.EXPLICIT})})),n.push(rl({id:"fileWorkingCopy.saveAs",label:g(10710,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Cn.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),n.push(rl({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()})),c?l&&h?o=Qn?g(10711,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(10712,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(10713,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Qn?g(10714,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(10715,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(10716,"Failed to save '{0}': {1}",this.name,Nr(e,!1))}const r=this.notificationService.notify({id:`${Wc(this.resource.toString())}`,severity:Xe.Error,message:o,actions:{primary:n}}),a=this._register(M.once(M.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(M.once(r.onDidClose)(()=>a.dispose()))}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}async revert(e){if(!this.isResolved()||!this.dirty&&!e?.force)return;this.trace("revert()");const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Fp.CONFLICT:return this.inConflictMode;case Fp.DIRTY:return this.dirty;case Fp.ERROR:return this.inErrorMode;case Fp.ORPHAN:return this.isOrphaned();case Fp.PENDING_SAVE:return this.saveSequentializer.isRunning();case Fp.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}trace(e){this.logService.trace(`[stored file working copy] ${e}`,this.resource.toString(),this.typeId)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inErrorMode=!1,this._model=void 0,super.dispose()}},hj=iM,iM.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,iM);e3e=hj=D([_(5,Jt),_(6,Ge),_(7,zb),_(8,_d),_(9,H6),_(10,Rm),_(11,bi),_(12,pXe),_(13,ei),_(14,F6),_(15,cg)],e3e);var KP;let t3e=KP=class extends RI{constructor(e,t,i,n,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=n,this._filesConfigurationService=r,this._onDidChangeDirty=this._register(new I),this._onDidSave=this._register(new I),this._onDidChangeOrphaned=this._register(new I),this._onDidChangeReadonly=this._register(new I),this._onDidRevertUntitled=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidSave=this._onDidSave.event,this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.onDidRevertUntitled=this._onDidRevertUntitled.event,this._workingCopyListeners=this._register(new Z),this.scratchPad=o}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&KP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return KP._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Fp.ORPHAN)}hasAssociatedFilePath(){return!KP._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return KP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Fp.ERROR):!1}revert(e){return Tt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Tt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===pe.untitled?(this._hasAssociatedFilePath?this._workingCopy=await this._workingCopyManager.resolve({associatedResource:this.resource}):this._workingCopy=await this._workingCopyManager.resolve({untitledResource:this.resource,isScratchpad:this.scratchPad}),this._workingCopy.onDidRevert(()=>this._onDidRevertUntitled.fire())):(this._workingCopy=await this._workingCopyManager.resolve(this.resource,{limits:e?.limits,reload:e?.forceReadFromFile?{async:!1,force:!0}:void 0}),this._workingCopyListeners.add(this._workingCopy.onDidSave(t=>this._onDidSave.fire(t))),this._workingCopyListeners.add(this._workingCopy.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._workingCopyListeners.add(this._workingCopy.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(()=>this._onDidChangeDirty.fire(),void 0)),this._workingCopyListeners.add(this._workingCopy.onWillDispose(()=>{this._workingCopyListeners.clear(),this._workingCopy?.model?.dispose()}))):await this._workingCopyManager.resolve(this.resource,{reload:{async:!e?.forceReadFromFile,force:e?.forceReadFromFile},limits:e?.limits}),Tt(this.isResolved()),this}async saveAs(e){const t=await this._workingCopyManager.saveAs(this.resource,e);if(t)return{resource:t.resource}}static _isStoredFileWorkingCopy(e){return!(e&&e.capabilities&aC.Untitled)}};t3e=KP=D([_(5,_d)],t3e);class ost extends V{constructor(e,t,i,n,o){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.configuration=void 0,this.onWillDispose=e.onWillDispose.bind(e),this._register(e.onDidChangeContent(a=>{for(const c of a.rawEvents)if(c.kind!==Sl.Initialize&&!c.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const r=this._configurationService.getValue(HAe.remoteSaving);(r||e.uri.scheme===pe.vscodeRemote)&&(this.configuration={backupDelay:1e4}),r&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){await this.getNotebookSerializer(),this.save=async(e,t)=>{try{let i=this._notebookService.tryGetDataProviderSync(this.notebookModel.viewType)?.serializer;if(i||(this._logService.warn("No serializer found for notebook model, checking if provider still needs to be resolved"),i=await this.getNotebookSerializer()),t.isCancellationRequested)throw new Ma;return await i.save(this._notebookModel.uri,this._notebookModel.versionId,e,t)}catch(i){throw t.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===pe.vscodeRemote,error:i}),i}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),n={metadata:wj(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let o=0;for(const a of this._notebookModel.cells){const c={cellKind:a.cellKind,language:a.language,mime:a.mime,source:a.getValue(),outputs:[],internalMetadata:a.internalMetadata},l=this._configurationService.getValue(HAe.outputBackupSizeLimit)*1024;if(e===M$.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{o+=h.data.byteLength})}),o>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=wj(a.metadata,d=>!i.options.transientCellMetadata[d]),n.cells.push(c)}const r=await i.notebookToData(n);if(t.isCancellationRequested)throw new Ma;return t6(r)}async update(e,t){const i=await this.getNotebookSerializer(),n=await eD(e),o=await i.dataToNotebook(n);if(t.isCancellationRequested)throw new Ma;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof hG))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let i3e=class{constructor(e,t,i,n,o){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o}async createModel(e,t,i){const n=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(n instanceof hG))throw new Error("CANNOT open file notebook with this provider");const o=await eD(t),r=await n.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Ma;const a=this._notebookService.createNotebookTextModel(n.viewType,e,r,n.serializer.options);return new ost(a,this._notebookService,this._configurationService,this._telemetryService,this._logService)}};i3e=D([_(1,tE),_(2,Te),_(3,Yi),_(4,Ge)],i3e);let kjt=class{constructor(e){this._proxy=e.getProxy(Ye.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.model||!(e.model instanceof ost))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(4874,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,n).then(l=>{clearTimeout(o)}).then(a,c)});return Mre(r,n)}},n3e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(kjt,e))}dispose(){this._saveParticipantDisposable.dispose()}};n3e=D([QN,_(1,we),_(2,zb)],n3e);let s3e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` +`,Ca,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};s3e=D([Gi(Be.MainThreadInteractive),_(1,eMe)],s3e);const Ijt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(6664,"The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:g(6665,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(6666,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:""}}};var Jxe;(function(s){function e(t,i,n){if(!t)return;const o=Lt(t.type)?t.type:void 0;if(!o||o.length===0){n.error(g(6667,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)Lt(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?xs(t.properties):{},when:t.when?he.deserialize(t.when):void 0}}s.from=e})(Jxe||(Jxe={}));const Tjt=eh.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(s,e)=>{for(const t of s)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(6668,"Contributes task kinds"),type:"array",items:Ijt}});class Ljt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{Tjt.setHandler((i,n)=>{this._schema=void 0;try{for(const o of n.removed){const r=o.value;for(const a of r)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const o of n.added){const r=o.value;for(const a of r){const c=Jxe.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(n.removed.length>0||n.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){const e=[];for(const t of this.all()){const i={type:"object",additionalProperties:!1};t.required.length>0&&(i.required=t.required.slice(0)),t.properties!==void 0?i.properties=xs(t.properties):i.properties=Object.create(null),i.properties.type={type:"string",enum:[t.taskType]},e.push(i)}this._schema={oneOf:e}}return this._schema}}const Rjt=new Ljt,rst="settings";new Q("taskRunning",!1,g(3790,"Whether a task is currently running."));Pe(3791,"Tasks");var vie;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(vie||(vie={}));const ast="$customized";(function(s){function e(t){if(!t)return s.Strong;switch(t.toLowerCase()){case"escape":return s.Escape;case"strong":return s.Strong;case"weak":return s.Weak;default:return s.Strong}}s.from=e})(vie||(vie={}));var N$;(function(s){s.defaults={cwd:"${workspaceFolder}"}})(N$||(N$={}));var P$;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(P$||(P$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"silent":return s.Silent;case"never":return s.Never;default:return s.Always}}s.fromString=e})(P$||(P$={}));var F$;(function(s){s[s.Never=1]="Never",s[s.OnProblem=2]="OnProblem",s[s.Always=3]="Always"})(F$||(F$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"never":return s.Never;case"onproblem":return s.OnProblem;default:return s.OnProblem}}s.fromString=e})(F$||(F$={}));var O$;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(O$||(O$={}));(function(s){function e(t){switch(t.toLowerCase()){case"shared":return s.Shared;case"dedicated":return s.Dedicated;case"new":return s.New;default:return s.Shared}}s.fromString=e})(O$||(O$={}));var bie;(function(s){s.defaults={echo:!0,reveal:P$.Always,revealProblems:F$.Never,focus:!1,panel:O$.Shared,showReuseMessage:!0,clear:!1}})(bie||(bie={}));var am;(function(s){s[s.Shell=1]="Shell",s[s.Process=2]="Process",s[s.CustomExecution=3]="CustomExecution"})(am||(am={}));(function(s){function e(i){switch(i.toLowerCase()){case"shell":return s.Shell;case"process":return s.Process;case"customExecution":return s.CustomExecution;default:return s.Process}}s.fromString=e;function t(i){switch(i){case s.Shell:return"shell";case s.Process:return"process";case s.CustomExecution:return"customExecution";default:return"process"}}s.toString=t})(am||(am={}));var o3e;(function(s){function e(t){return Lt(t)?t:t.value}s.value=e})(o3e||(o3e={}));var r3e;(function(s){s.Clean={_id:"clean",isDefault:!1},s.Build={_id:"build",isDefault:!1},s.Rebuild={_id:"rebuild",isDefault:!1},s.Test={_id:"test",isDefault:!1};function e(i){return i===s.Clean._id||i===s.Build._id||i===s.Rebuild._id||i===s.Test._id}s.is=e;function t(i){if(i!==void 0)return Lt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}s.from=t})(r3e||(r3e={}));var ox;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.Folder=3]="Folder"})(ox||(ox={}));var pA;(function(s){s.Workspace="workspace",s.Extension="extension",s.InMemory="inMemory",s.WorkspaceFile="workspaceFile",s.User="user";function e(t){switch(t){case s.User:return St.USER;case s.WorkspaceFile:return St.WORKSPACE;default:return St.WORKSPACE_FOLDER}}s.toConfigurationTarget=e})(pA||(pA={}));var a3e;(function(s){s.parallel="parallel",s.sequence="sequence"})(a3e||(a3e={}));var Xxe;(function(s){s[s.default=1]="default",s[s.folderOpen=2]="folderOpen"})(Xxe||(Xxe={}));var wie;(function(s){s.defaults={reevaluateOnRerun:!0,runOn:Xxe.default,instanceLimit:1}})(wie||(wie={}));class vPe{constructor(e,t,i,n,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=n,this.configurationProperties=o,this._source=r}getDefinition(e){}getMapKey(){return this._id}getKey(){}getCommonTaskId(){const e={folder:this.getFolderId(),id:this._id};return JSON.stringify(e)}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(e,t=!1){if(e===void 0)return!1;if(Lt(e))return e===this._label||e===this.configurationProperties.identifier||t&&e===this._id;const i=this.getDefinition(!0);return i!==void 0&&i._key===e._key}getQualifiedLabel(){const e=this.getWorkspaceFolder();return e?`${this._label} (${e.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(e){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),e&&(this._taskLoadMessages=this._taskLoadMessages.concat(e))}get taskLoadMessages(){return this._taskLoadMessages}}class pz extends vPe{constructor(e,t,i,n,o,r,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=r,o&&(this.command=o)}clone(){return new pz(this._id,this._source,this._label,this.type,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(e=!1){if(e&&this._source.customizes!==void 0)return this._source.customizes;{let t;switch(this.command?this.command.runtime:void 0){case am.Shell:t="shell";break;case am.Process:t="process";break;case am.CustomExecution:t="customExecution";break;case void 0:t="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:t,_key:this._id,id:this._id}}}static is(e){return e instanceof pz}getMapKey(){const e=this._source.config.workspaceFolder;return e?`${e.uri.toString()}|${this._id}|${this.instance}`:`${this._id}|${this.instance}`}getFolderId(){return this._source.kind===pA.User?rst:this._source.config.workspaceFolder?.uri.toString()}getCommonTaskId(){return this._source.customizes?super.getCommonTaskId():this.getKey()??super.getCommonTaskId()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==pA.Workspace&&(t+=this._source.kind),JSON.stringify({type:ast,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new pz(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class mz extends vPe{constructor(e,t,i,n,o,r,a){super(e,i,n,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof mz}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===pA.User?rst:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==pA.Workspace&&(t+=this._source.kind),JSON.stringify({type:ast,folder:e,id:t})}}class eL extends vPe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,n,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new eL(this._id,this._source,this._label,this.type,this.defines,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}getDefinition(){return this.defines}static is(e){return e instanceof eL}getMapKey(){const e=this._source.workspaceFolder;return e?`${this._source.scope.toString()}|${e.uri.toString()}|${this._id}|${this.instance}`:`${this._source.scope.toString()}|${this._id}|${this.instance}`}getFolderId(){if(this._source.scope===ox.Folder&&this._source.workspaceFolder)return this._source.workspaceFolder.uri.toString()}getKey(){const e={type:"contributed",scope:this._source.scope,id:this._id};return e.folder=this.getFolderId(),JSON.stringify(e)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(e){return new eL(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var yie;(function(s){s[s.Process=1]="Process",s[s.Terminal=2]="Terminal"})(yie||(yie={}));(function(s){s._default=s.Terminal})(yie||(yie={}));var c3e;(function(s){s[s.V0_1_0=1]="V0_1_0",s[s.V2_0_0=2]="V2_0_0"})(c3e||(c3e={}));var __;(function(s){s.DependsOnStarted="dependsOnStarted",s.AcquiredInput="acquiredInput",s.Start="start",s.ProcessStarted="processStarted",s.Active="active",s.Inactive="inactive",s.Changed="changed",s.Terminated="terminated",s.ProcessEnded="processEnded",s.End="end"})(__||(__={}));var Cie;(function(s){s.SingleRun="singleRun",s.Background="background"})(Cie||(Cie={}));var l3e;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.FolderOpen=2]="FolderOpen",s[s.ConfigurationChange=3]="ConfigurationChange",s[s.Reconnect=4]="Reconnect"})(l3e||(l3e={}));var d3e;(function(s){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Cie.Background:Cie.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:__.Start,terminalId:l,resolvedVariables:d}}s.start=t;function i(c,l,d){return{...e(c),kind:__.ProcessStarted,terminalId:l,processId:d}}s.processStarted=i;function n(c,l,d){return{...e(c),kind:__.ProcessEnded,terminalId:l,exitCode:d}}s.processEnded=n;function o(c,l,d){return{...e(c),kind:__.Terminated,exitReason:d,terminalId:l}}s.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}s.general=r;function a(){return{kind:__.Changed}}s.changed=a})(d3e||(d3e={}));var Sie;(function(s){function e(i){const n=Object.keys(i).sort();let o="";for(const r of n){let a=i[r];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),o+=r+","+a+","}return o}function t(i){const o={_key:e(i),type:i.taskType};return Object.assign(o,i),o}s.create=t})(Sie||(Sie={}));var h3e;(function(s){s.AutoDetect="task.autoDetect",s.SaveBeforeRun="task.saveBeforeRun",s.ShowDecorations="task.showDecorations",s.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",s.SlowProviderWarning="task.slowProviderWarning",s.QuickOpenHistory="task.quickOpen.history",s.QuickOpenDetail="task.quickOpen.detail",s.QuickOpenSkip="task.quickOpen.skip",s.QuickOpenShowAll="task.quickOpen.showAll",s.AllowAutomaticTasks="task.allowAutomaticTasks",s.Reconnection="task.reconnection",s.VerboseLogging="task.verboseLogging"})(h3e||(h3e={}));var u3e;(function(s){s.Tasks="tasks",s.SuppressTaskName="tasks.suppressTaskName",s.Windows="tasks.windows",s.Osx="tasks.osx",s.Linux="tasks.linux",s.ShowOutput="tasks.showOutput",s.IsShellCommand="tasks.isShellCommand",s.ServiceTestSetting="tasks.service.testSetting"})(u3e||(u3e={}));var Zxe;(function(s){function e(t,i){const n=Rjt.get(t.type);if(n===void 0){const c=xs(t);return delete c._key,Sie.create(c)}const o=Object.create(null);o.type=n.taskType;const r=new Set;n.required.forEach(c=>r.add(c));const a=n.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)o[c]=l;else if(r.has(c)){const d=a[c];if(d.default!==void 0)o[c]=xs(d.default);else switch(d.type){case"boolean":o[c]=!1;break;case"number":case"integer":o[c]=0;break;case"string":o[c]="";break;default:i.error(g(3792,"Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.",JSON.stringify(t,void 0,0),c));return}}}return Sie.create(o)}s.createTaskIdentifier=e})(Zxe||(Zxe={}));var Aie;(function(s){function e(t){return{id:t.id,task:Tf.from(t.task)}}s.from=e})(Aie||(Aie={}));var eDe;(function(s){function e(t,i){return{id:t.id,processId:i}}s.from=e})(eDe||(eDe={}));var tDe;(function(s){function e(t,i){return{id:t.id,exitCode:i}}s.from=e})(tDe||(tDe={}));var Eie;(function(s){function e(i){const n=Object.assign(Object.create(null),i);return delete n._key,n}s.from=e;function t(i,n){let o=Zxe.createTaskIdentifier(i,console);return o===void 0&&n&&(o={_key:ar(),type:"$executeOnly"}),o}s.to=t})(Eie||(Eie={}));var xie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?bie.defaults:Object.assign(Object.create(null),bie.defaults,i)}s.to=t})(xie||(xie={}));var Die;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?wie.defaults:Object.assign(Object.create(null),wie.defaults,i)}s.to=t})(Die||(Die={}));var kie;(function(s){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}s.from=e;function t(i){return i==null?N$.defaults:{cwd:i.cwd||N$.defaults.cwd,env:i.env}}s.to=t})(kie||(kie={}));var _z;(function(s){function e(n){const o=n;return o&&!!o.process}s.is=e;function t(n){const o=Lt(n.name)?n.name:n.name.value,r=n.args?n.args.map(c=>Lt(c)?c:c.value):[],a={process:o,args:r};return n.options&&(a.options=kie.from(n.options)),a}s.from=t;function i(n){const o={runtime:am.Process,name:n.process,args:n.args,presentation:void 0};return o.options=kie.to(n.options),o}s.to=i})(_z||(_z={}));var Iie;(function(s){function e(i){if(i==null)return;const n={cwd:i.cwd||N$.defaults.cwd,env:i.env};return i.shell&&(n.executable=i.shell.executable,n.shellArgs=i.shell.args,n.shellQuoting=i.shell.quoting),n}s.from=e;function t(i){if(i==null)return;const n={cwd:i.cwd,env:i.env};return i.executable&&(n.shell={executable:i.executable},i.shellArgs&&(n.shell.args=i.shellArgs),i.shellQuoting&&(n.shell.quoting=i.shellQuoting)),n}s.to=t})(Iie||(Iie={}));var vz;(function(s){function e(n){const o=n;return o&&(!!o.commandLine||!!o.command)}s.is=e;function t(n){const o={};return n.name&&Lt(n.name)&&(n.args===void 0||n.args===null||n.args.length===0)?o.commandLine=n.name:(o.command=n.name,o.args=n.args),n.options&&(o.options=Iie.from(n.options)),o}s.from=t;function i(n){const o={runtime:am.Shell,name:n.commandLine?n.commandLine:n.command,args:n.args,presentation:void 0};return n.options&&(o.options=Iie.to(n.options)),o}s.to=i})(vz||(vz={}));var U1;(function(s){function e(n){const o=n;return o&&o.customExecution==="customExecution"}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n){return{runtime:am.CustomExecution,presentation:void 0}}s.to=i})(U1||(U1={}));var Tie;(function(s){function e(i){const n={label:i.label};return i.kind===pA.Extension?(n.extensionId=i.extension,i.workspaceFolder?n.scope=i.workspaceFolder.uri:n.scope=i.scope):i.kind===pA.Workspace&&(n.extensionId="$core",n.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:ox.Global),n}s.from=e;function t(i,n){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==ox.Global?n.getWorkspace().folders.length===0?(o=ox.Global,r=void 0):(o=ox.Folder,r=n.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=ox.Folder,r=n.getWorkspaceFolder(N.revive(i.scope))??void 0),{kind:pA.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}s.to=t})(Tie||(Tie={}));var Lie;(function(s){function e(t){const i=t;return i&&Lt(i.id)&&!!i.workspaceFolder}s.is=e})(Lie||(Lie={}));var Tf;(function(s){function e(i){if(i==null||!pz.is(i)&&!eL.is(i)&&!mz.is(i))return;const n={_id:i._id,name:i.configurationProperties.name,definition:Eie.from(i.getDefinition(!0)),source:Tie.from(i._source),execution:void 0,presentationOptions:!mz.is(i)&&i.command?xie.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:eL.is(i)?i.hasDefinedMatchers:!1,runOptions:Die.from(i.runOptions)};if(n.group=iDe.from(i.configurationProperties.group),i.configurationProperties.detail&&(n.detail=i.configurationProperties.detail),!mz.is(i)&&i.command)switch(i.command.runtime){case am.Process:n.execution=_z.from(i.command);break;case am.Shell:n.execution=vz.from(i.command);break;case am.CustomExecution:n.execution=U1.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)Lt(o)&&n.problemMatchers.push(o);return n}s.from=e;function t(i,n,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(vz.is(i.execution)?c=vz.to(i.execution):_z.is(i.execution)?c=_z.to(i.execution):U1.is(i.execution)&&(c=U1.to(i.execution))),!c)return;c.presentation=xie.to(i.presentationOptions);const l=Tie.to(i.source,n),d=g(4875,"{0}: {1}",l.label,i.name),h=Eie.to(i.definition,o),u=U1.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new eL(u,l,d,h.type,h,c,i.hasDefinedMatchers,Die.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:r,hide:a})}s.to=t})(Tf||(Tf={}));var iDe;(function(s){function e(t){if(t!==void 0)return{_id:typeof t=="string"?t:t._id,isDefault:typeof t=="string"||typeof t.isDefault=="string"?!1:t.isDefault}}s.from=e})(iDe||(iDe={}));var nDe;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(nDe||(nDe={}));let g3e=class extends V{constructor(e,t,i,n){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=n,this._proxy=e.getProxy(Ye.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===__.Changed)return;const r=o.__task;if(o.kind===__.Start){const a=Aie.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&U1.is(a.task.execution)&&o.resolvedVariables){const l={};for(const[d,h]of o.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(r.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,o.terminalId,c)}else o.kind===__.ProcessStarted?this._proxy.$onDidStartTaskProcess(eDe.from(r.getTaskExecution(),o.processId)):o.kind===__.ProcessEnded?this._proxy.$onDidEndTaskProcess(tDe.from(r.getTaskExecution(),o.exitCode)):o.kind===__.End&&this._proxy.$OnDidEndTask(Aie.from(r.getTaskExecution()))}))}dispose(){for(const e of this._providers.values())e.disposable.dispose();this._providers.clear(),super.dispose()}$createTaskId(e){return new Promise((t,i)=>{const n=Tf.to(e,this._workspaceContextServer,!0);n?t(n._id):i(new Error("Task could not be created from DTO"))})}$registerTaskProvider(e,t){const i={provideTasks:o=>Promise.resolve(this._proxy.$provideTasks(e,o)).then(r=>{const a=[];for(const c of r.tasks){const l=Tf.to(c,this._workspaceContextServer,!0);l?a.push(l):console.error(`Task System: can not convert task: ${JSON.stringify(c.definition,void 0,0)}. Task will be dropped`)}return{tasks:a,extension:r.extension}}),resolveTask:o=>{const r=Tf.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Tf.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},n=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:n,provider:i}),Promise.resolve(void 0)}$unregisterTaskProvider(e){const t=this._providers.get(e);return t&&(t.disposable.dispose(),this._providers.delete(e)),Promise.resolve(void 0)}$fetchTasks(e){return this._taskService.tasks(nDe.to(e)).then(t=>{const i=[];for(const n of t){const o=Tf.from(n);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),n=N.revive(e);i.configuration?.toString()===n.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(n)}return t}async $getTaskExecution(e){if(Lie.is(e)){const t=this.getWorkspace(e.workspaceFolder);if(t){const i=await this._taskService.getTask(t,e.id,!0);if(i)return{id:i._id,task:Tf.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Tf.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Tf.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Lie.is(e)){const n=this.getWorkspace(e.workspaceFolder);n?this._taskService.getTask(n,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Tf.from(o)};this._taskService.run(o).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(r)},a=>{}),t(r)}},o=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const n=Tf.to(e,this._workspaceContextServer,!0);this._taskService.run(n).then(void 0,r=>{});const o={id:n._id,task:Tf.from(n)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,n)=>{this._taskService.getActiveTasks().then(o=>{for(const r of o)if(e===r._id){this._taskService.extensionCallbackTaskComplete(r,t).then(a=>{i(void 0)},a=>{n(a)});return}n(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(n=>{for(const o of n)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new La("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Kd.Web;break;case"win32":i=Kd.Windows;break;case"darwin":i=Kd.Mac;break;case"linux":i=Kd.Linux;break;default:i=R6e}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:n=>N.from({scheme:t.scheme,authority:t.authority,path:n}),context:this._extHostContext,resolveVariables:(n,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(n.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(n,l,"tasks",void 0,r).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(n,o,r)=>this._proxy.$findExecutable(n,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};g3e=D([Gi(Be.MainThreadTask),_(1,UJe),_(2,yi),_(3,oMe)],g3e);let f3e=class extends V{constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new mo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};f3e=D([Gi(Be.MainThreadLabelService),_(1,Fs)],f3e);var Mp;(function(s){s.Http="http",s.Https="https"})(Mp||(Mp={}));var RS;(function(s){s.ConstantPrivate="constantPrivate",s.Private="private",s.Public="public"})(RS||(RS={}));var BE;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(BE||(BE={}));function Mjt(s){if(s.scheme!=="http"&&s.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(s.authority);if(e)return{address:e[1],port:+e[2]}}const B$=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function W$(s){return B$.indexOf(s)>=0}const Rie=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function H$(s){return Rie.indexOf(s)>=0}class Njt{constructor(e,t,i){this.remoteAddress=e,this.localAddress=t,this._dispose=i,this._onDispose=new I,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}let p3e=class extends V{constructor(e,t){super(),this.logService=e,this.configurationService=t,this._onTunnelOpened=new I,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new I,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new I,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],t=Array.from(this._tunnels.values());for(const i of t){const n=Array.from(i.values());for(const o of n){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){super.dispose();for(const e of this._tunnels.values()){for(const{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,n,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:n,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(H$(e)||W$(e))&&(e=B$[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,n,o,r=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${o}.`);const l=this._tunnelProvider??e;if(!l)return;if(t||(t="localhost"),n||(n=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const d=this.retainOrCreateTunnel(l,t,i,n,o,r,a,c);return d?d.then(h=>{if(h){if(typeof h=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),h}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const u=this.makeTunnel(h);return(h.tunnelRemoteHost!==t||h.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&h.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(u),u}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),d)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const t=this._tunnels.get(e.tunnelRemoteHost);if(t){const i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);const n=i.value.then(async o=>{o&&typeof o!="string"&&(await o.dispose(!0),this._onTunnelClosed.fire({host:o.tunnelRemoteHost,port:o.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),n}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);const i=this._tunnels.get(e);if(i&&i.has(t)){const n=i.get(t);n.refcount=0,await this.tryDisposeTunnel(e,t,n)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){const i=this._tunnels.get(e);if(i){const n=i.get(t),o=n?await n.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];W$(e)?(i.push(...B$),i.push(...Rie)):H$(e)&&i.push(...Rie);const n=i.map(o=>this._tunnels.get(o));for(const o of n){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!Mjt(e)}createWithProvider(e,t,i,n,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${n}.`);const c=i;this._factoryInProgress.add(c);const l=n===void 0?i:n,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:n,privacy:r,public:r?r!==RS.Private:void 0,protocol:a},u=e.forwardPort(h,d);return u?(this.addTunnelToMap(t,i,u),u.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),u}};p3e=D([_(0,Ge),_(1,Te)],p3e);const _u=ae("IExtHostInitDataService"),Jo=ae("IExtHostRpcService");class Pjt{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}class Fjt extends Njt{}var Mie;(function(s){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?RS.Public:RS.Private),protocol:i.protocol}}s.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==RS.ConstantPrivate&&i.privacy!==RS.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}s.fromServiceTunnel=t})(Mie||(Mie={}));const bPe=ae("IExtHostTunnelService");let sDe=class extends V{constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new I,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(Be.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);const i=await this._proxy.$openTunnel(t,e.displayName);if(i){const n=new Fjt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(n),n}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");const i=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(i,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,i),new Qs(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,n,o){const r=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];r.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:n},o)}catch{h=await l.provider.providePortAttributes(d,i,n,o)}return{providedAttributes:h,port:d}})))}const a=r.filter(c=>!!c.providedAttributes);return a.length>0?a.map(c=>({autoForwardAction:c.providedAttributes.autoForwardAction,port:c.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(n,o)=>await e.provideTunnel(n,o,He.None)??void 0;const i=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(i),Promise.resolve(Ee(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0)}))}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());const i=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(i){this._forwardPortProvider=i;let n=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&n.length===0&&(n=[{id:"private",label:g(574,"Private"),themeIcon:"lock"},{id:"public",label:g(575,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:n,protocol:!0}:void 0;this._proxy.$setTunnelProvider(o)}}else this._forwardPortProvider=void 0;return Ee(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){const i=this._extensionTunnels.get(e.host);i.has(e.port)&&(t&&i.get(e.port).disposeListener.dispose(),await i.get(e.port).tunnel.dispose(),i.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");const i=this._forwardPortProvider(e,t);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),i!==void 0){const n=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),n===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);const o=this._register(n.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(n.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:n,disposeListener:o}),Mie.fromApiTunnel(n)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(i){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),i instanceof Error)return i.message}}async $applyCandidateFilter(e){const t=await Promise.all(e.map(n=>this._showCandidatePort(n.host,n.port,n.detail??""))),i=e.filter((n,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(n=>n.port).join(", ")} to ${i.map(n=>n.port).join(", ")}`),i}};sDe=D([_(0,Jo),_(1,_u),_(2,Ge)],sDe);const Ojt=10*1e3,OK="remote.tunnels.toRestore",Fue="remote.tunnels.toRestoreExpiration",Bjt=1e3*60*60*24*14,m3e="onTunnel",cst=new Q("forwardedPortsViewEnabled",!1,g(8676,"Whether the Ports view is enabled."));function Wjt(s){const e=s.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);if(e)return{host:e[1]?.substring(0,e[1].length-1)||"localhost",port:Number(e[2])}}var tL;(function(s){s.Other="Other",s.User="User",s.AutoForwardEnd="AutoForwardEnd"})(tL||(tL={}));var hb;(function(s){s[s.User=0]="User",s[s.Auto=1]="Auto",s[s.Extension=2]="Extension"})(hb||(hb={}));const Oue={source:hb.User,description:g(8677,"User Forwarded")};hb.Auto,g(8678,"Auto Forwarded");function _3e(s,e,t){const i=s.get(Ig(e,t));if(i)return i;if(W$(e))for(const n of B$){const o=Ig(n,t);if(s.has(o))return s.get(o)}else if(H$(e))for(const n of Rie){const o=Ig(n,t);if(s.has(o))return s.get(o)}}function vg(s,e,t){const i=_3e(s,e,t);if(i)return i;const n=H$(e)?"localhost":W$(e)?"0.0.0.0":void 0;if(n)return _3e(s,n,t)}function Ig(s,e){return s+":"+e}var WE;(function(s){s.Notify="notify",s.OpenBrowser="openBrowser",s.OpenBrowserOnce="openBrowserOnce",s.OpenPreview="openPreview",s.Silent="silent",s.Ignore="ignore"})(WE||(WE={}));function Hjt(s){return s&&"host"in s&&typeof s.host=="string"&&"port"in s&&typeof s.port=="number"&&(!("detail"in s)||typeof s.detail=="string")&&(!("pid"in s)||typeof s.pid=="string")}const yu=class yu extends V{constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(yu.SETTING)||t.affectsConfiguration(yu.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let n=this.findNextIndex(e,t,i,this.portsAttributes,0);const o={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;n>=0;){const r=this.portsAttributes[n];r.key===e?(o.onAutoForward=r.onAutoForward??o.onAutoForward,o.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,o.label=r.label??o.label,o.requireLocalPort=r.requireLocalPort,o.protocol=r.protocol):(o.onAutoForward=o.onAutoForward??r.onAutoForward,o.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,o.label=o.label??r.label,o.requireLocalPort=o.requireLocalPort!==void 0?o.requireLocalPort:void 0,o.protocol=o.protocol??r.protocol),n=this.findNextIndex(e,t,i,this.portsAttributes,n+1)}return o.onAutoForward!==void 0||o.elevateIfNeeded!==void 0||o.label!==void 0||o.requireLocalPort!==void 0||o.protocol!==void 0?o:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&Lt(e.host)&&lc(e.port)}findNextIndex(e,t,i,n,o){if(o>=n.length)return-1;const r=!W$(t)&&!H$(t),c=n.slice(o).findIndex(l=>lc(l.key)?r?!1:l.key===e:this.hasStartEnd(l.key)?r?!1:e>=l.key.start&&e<=l.key.end:this.hasHostAndPort(l.key)?e===l.key.port&&t===l.key.host:i?l.key.test(i):!1);return c>=0?c+o:-1}readSetting(){const e=this.configurationService.getValue(yu.SETTING);if(!e||!kn(e))return[];const t=[];for(const n in e){if(n===void 0)continue;const o=e[n];let r;if(Number(n))r=Number(n);else if(Lt(n))if(yu.RANGE.test(n)){const a=n.match(yu.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(yu.HOST_AND_PORT.test(n)){const a=n.match(yu.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(n)}catch{}a&&(r=a)}r&&t.push({key:r,elevateIfNeeded:o.elevateIfNeeded,onAutoForward:o.onAutoForward,label:o.label,requireLocalPort:o.requireLocalPort,protocol:o.protocol})}const i=this.configurationService.getValue(yu.DEFAULTS);return i&&(this.defaultPortAttributes={elevateIfNeeded:i.elevateIfNeeded,label:i.label,onAutoForward:i.onAutoForward,requireLocalPort:i.requireLocalPort,protocol:i.protocol}),this.sortAttributes(t)}sortAttributes(e){function t(i,n){return lc(i.key)?i.key:n.hasStartEnd(i.key)?i.key.start:n.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,n)=>t(i,this)-t(n,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case BE.Notify:return WE.Notify;case BE.OpenBrowser:return WE.OpenBrowser;case BE.OpenBrowserOnce:return WE.OpenBrowserOnce;case BE.OpenPreview:return WE.OpenPreview;case BE.Silent:return WE.Silent;case BE.Ignore:return WE.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(yu.SETTING).userRemoteValue;let r;!o||!kn(o)?r={}:r=xs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(yu.SETTING,r,i)}};yu.SETTING="remote.portsAttributes",yu.DEFAULTS="remote.otherPortsAttributes",yu.RANGE=/^(\d+)\-(\d+)$/,yu.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Nie=yu,U$=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=n,this.remoteAuthorityResolverService=o,this.workspaceContextService=r,this.logService=a,this.dialogService=c,this.extensionService=l,this.contextKeyService=d,this.inProgress=new Map,this._onForwardPort=new I,this.onForwardPort=this._onForwardPort.event,this._onClosePort=new I,this.onClosePort=this._onClosePort.event,this._onPortName=new I,this.onPortName=this._onPortName.event,this._onCandidatesChanged=new I,this.onCandidatesChanged=this._onCandidatesChanged.event,this._onEnvironmentTunnelsSet=new I,this.onEnvironmentTunnelsSet=this._onEnvironmentTunnelsSet.event,this._environmentTunnelsSet=!1,this.restoreListener=void 0,this.restoreComplete=!1,this.onRestoreComplete=new I,this.unrestoredExtensionTunnels=new Map,this.sessionCachedProperties=new Map,this.portAttributesProviders=[],this.mismatchCooldown=new Date,this.configPortsAttributes=new Nie(i),this.tunnelRestoreValue=this.getTunnelRestoreValue(),this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes,this)),this.forwarded=new Map,this.remoteTunnels=new Map,this.tunnelService.tunnels.then(async h=>{const u=await this.getAttributes(h.map(f=>({port:f.tunnelRemotePort,host:f.tunnelRemoteHost})));for(const f of h)if(f.localAddress){const p=Ig(f.tunnelRemoteHost,f.tunnelRemotePort),m=vg(this._candidates??new Map,f.tunnelRemoteHost,f.tunnelRemotePort);this.forwarded.set(p,{remotePort:f.tunnelRemotePort,remoteHost:f.tunnelRemoteHost,localAddress:f.localAddress,protocol:u?.get(f.tunnelRemotePort)?.protocol??Mp.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,name:u?.get(f.tunnelRemotePort)?.label,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:Oue}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Ig(h.tunnelRemoteHost,h.tunnelRemotePort);if(!vg(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!vg(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!vg(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=vg(this._candidates??new Map,h.tunnelRemoteHost,h.tunnelRemotePort),p=(await this.getAttributes([{port:h.tunnelRemotePort,host:h.tunnelRemoteHost}]))?.get(h.tunnelRemotePort);this.forwarded.set(u,{remoteHost:h.tunnelRemoteHost,remotePort:h.tunnelRemotePort,localAddress:h.localAddress,protocol:p?.protocol??Mp.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,name:p?.label,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:Oue})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,tL.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(m3e))?(this.contextKeyService.createKey(cst.key,!0),!0):!1}checkExtensionActivationEvents(){if(this.extensionHasActivationEvent())return;const e=this._register(this.extensionService.onDidRegisterExtensions(()=>{this.extensionHasActivationEvent()&&e.dispose()}))}async onTunnelClosed(e,t){const i=Ig(e.host,e.port);this.forwarded.has(i)&&(this.forwarded.delete(i),await this.storeForwarded(),this._onClosePort.fire(e))}makeLocalUri(e,t){if(e.startsWith("http"))return N.parse(e);const i=t?.protocol??"http";return N.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Wc(t.configuration.path):t.folders.length>0?Wc(t.folders[0].uri.path):void 0;if(i===void 0){this.logService.debug("Could not get workspace hash for forwarded ports storage key.");return}return`${e}.${this.environmentService.remoteAuthority}.${i}`}async getTunnelRestoreStorageKey(){return this.addStorageKeyPostfix(OK)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(Fue)}async getTunnelRestoreValue(){const e=this.storageService.get(OK,Ie.WORKSPACE);if(e)return this.storageService.remove(OK,Ie.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,Ie.PROFILE)}async restoreForwarded(){if(this.cleanupExpiredTunnelsForRestore(),this.configurationService.getValue("remote.restoreForwardedPorts")){const e=await this.tunnelRestoreValue;if(e&&e!==this.knownPortsRestoreValue){const t=JSON.parse(e)??[];this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${t.map(i=>i.remotePort).join(", ")}`);for(const i of t){const n=vg(this.detected,i.remoteHost,i.remotePort);i.source.source!==hb.Extension&&!n||i.source.source===hb.Extension&&n?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===hb.Extension&&!n&&this.unrestoredExtensionTunnels.set(Ig(i.remoteHost,i.remotePort),i)}}}if(this.restoreComplete=!0,this.onRestoreComplete.fire(),!this.restoreListener){const e=await this.getTunnelRestoreStorageKey();this.restoreListener=this._register(new Z),this.restoreListener.add(this.storageService.onDidChangeValue(Ie.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,Ie.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(Ie.PROFILE,an.USER).filter(t=>t.startsWith(Fue));for(const t of e){const i=this.storageService.getNumber(t,Ie.PROFILE);if(i&&i({remoteHost:r.remoteHost,remotePort:r.remotePort,localPort:r.localPort,name:r.name,localAddress:r.localAddress,localUri:r.localUri,protocol:r.protocol,source:r.source}));let i;e.length>0&&(i=JSON.stringify(t));const n=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&n&&o?(this.storageService.remove(n,Ie.PROFILE),this.storageService.remove(o,Ie.PROFILE)):i!==this.knownPortsRestoreValue&&n&&o&&(this.storageService.store(n,i,Ie.PROFILE,an.USER),this.storageService.store(o,Date.now()+Bjt,Ie.PROFILE,an.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const n=new Date;if(this.mismatchCooldown.getTime()+Ojt>n.getTime())return;this.mismatchCooldown=n;const o=g(8679,`Local port {0} could not be used for forwarding to remote port {1}. This usually happens when there is already another process using local port {0}. -Port number {2} has been used instead.`,t,e.tunnelRemotePort,e.tunnelLocalPort);return this.dialogService.info(o)}async forward(e,t){return!this.restoreComplete&&this.environmentService.remoteAuthority&&await T.toPromise(this.onRestoreComplete.event),this.doForward(e,t)}async doForward(e,t){await this.extensionService.activateByEvent(H9e);const i=kf(this.forwarded,e.remote.host,e.remote.port);t=t??(t!==null?(await this.getAttributes([e.remote]))?.get(e.remote.port):void 0);const s=e.local!==void 0?e.local:e.remote.port;let o;if(i)return this.mergeAttributesIntoExistingTunnel(i,e,t);{const r=this.environmentService.remoteAuthority,a=r?{getAddress:async()=>(await this.remoteAuthorityResolverService.resolveAuthority(r)).authority}:void 0,c=Hf(e.remote.host,e.remote.port);this.inProgress.set(c,!0),e=this.mergeCachedAndUnrestoredProperties(c,e);const l=await this.tunnelService.openTunnel(a,e.remote.host,e.remote.port,void 0,s,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=kf(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Km.Https?Km.Https:Km.Http:t?.protocol??Km.Http,u={remoteHost:l.tunnelRemoteHost,remotePort:l.tunnelRemotePort,localPort:l.tunnelLocalPort,name:t?.label??e.name,closeable:!0,localAddress:l.localAddress,protocol:h,localUri:await this.makeLocalUri(l.localAddress,t),runningProcess:d?.detail,hasRunningProcess:!!d,pid:d?.pid,source:e.source??sme,privacy:l.privacy};return this.forwarded.set(c,u),this.remoteTunnels.set(c,l),this.inProgress.delete(c),await this.storeForwarded(),await this.showPortMismatchModalIfNeeded(l,s,t),this._onForwardPort.fire(u),l}this.inProgress.delete(c)}return o}mergeCachedAndUnrestoredProperties(e,t){const i=this.unrestoredExtensionTunnels.has(e)?this.unrestoredExtensionTunnels:this.sessionCachedProperties.has(e)?this.sessionCachedProperties:void 0;if(i){const s=i.get(e);i.delete(e),s&&(t.name=s.name??t.name,t.local=("local"in s?s.local:"localPort"in s?s.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const s=i?.label??t.name;let o;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(o||(o={}));let r=o.None;switch(s!==e.name&&(e.name=s,r=o.Fire),(i?.protocol||e.protocol!==Km.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,r=o.Reopen),t.privacy&&e.privacy!==t.privacy&&(r=o.Reopen),r){case o.Fire:{this._onForwardPort.fire();break}case o.Reopen:await this.close(e.remoteHost,e.remotePort,qM.User),await this.doForward(t,i)}return kf(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const s=kf(this.forwarded,e,t),o=Hf(e,t);if(s){s.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(o)&&(this.detected.get(o).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const s=Hf(e,t),o=this.forwarded.get(s);return i===qM.AutoForwardEnd&&o&&o.source.source===Tb.Auto&&this.sessionCachedProperties.set(s,{local:o.localPort,name:o.name,privacy:o.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Hf(e,t);return(this.forwarded.get(i)||this.detected.get(i))?.localAddress}get environmentTunnelsSet(){return this._environmentTunnelsSet}addEnvironmentTunnels(e){if(e)for(const t of e){const i=kf(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),s=typeof t.localAddress=="string"?t.localAddress:Hf(t.localAddress.host,t.localAddress.port);this.detected.set(Hf(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:s,protocol:Km.Http,localUri:this.makeLocalUri(s),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:zE.ConstantPrivate,source:{source:Tb.Extension,description:g(qG,4,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,s,zE.ConstantPrivate,Km.Http)}this._environmentTunnelsSet=!0,this._onEnvironmentTunnelsSet.fire(),this._onForwardPort.fire()}setCandidateFilter(e){this._candidateFilter=e}async setCandidates(e){let t=e;this._candidateFilter&&(t=await this._candidateFilter(e));const i=this.updateInResponseToCandidates(t);this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${Array.from(i.values()).map(s=>s.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(s=>{const o=Hf(s.host,s.port);i.set(o,{host:s.host,port:s.port,detail:s.detail,pid:s.pid}),t.has(o)&&t.delete(o);const r=kf(this.forwarded,s.host,s.port);r&&(r.runningProcess=s.detail,r.hasRunningProcess=!0,r.pid=s.pid)}),t.forEach((s,o)=>{const r=UYt(o);if(!r)return;const a=kf(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=kf(this.detected,r.host,r.port);c&&(c.runningProcess=void 0,c.hasRunningProcess=!1,c.pid=void 0)}),t}get candidates(){return this._candidates?Array.from(this._candidates.values()):[]}get candidatesOrUndefined(){return this._candidates?this.candidates:void 0}async updateAttributes(){const e=Array.from(this.forwarded.values()),t=await this.getAttributes(e.map(i=>({port:i.remotePort,host:i.remoteHost})),!1);if(t)for(const i of e){const s=t.get(i.remotePort);(s?.protocol||i.protocol!==Km.Http)&&s?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},s),s&&s.label&&s.label!==i.name&&await this.name(i.remoteHost,i.remotePort,s.label)}}async getAttributes(e,t=!0){const i=new Map,s=new Map;e.forEach(l=>{const d=kf(this._candidates??new Map,zG[0],l.port)??l;if(d){i.set(l.port,d);const h=VYt(d)?d.pid:void 0;s.has(h)||s.set(h,[]),s.get(h)?.push(l.port)}});const o=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&o.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return o.size>0?o:void 0;const r=await Promise.all(this.portAttributesProviders.flatMap(l=>Array.from(s.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,qe.None)}))),a=new Map;if(r.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!o&&!a)return;const c=new Map;return e.forEach(l=>{const d=o.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??Xoe.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};QG.__decorator=D([INe(1e3)],QG.prototype,"storeForwarded",null);QG=D([_(0,Qde),_(1,on),_(2,Re),_(3,ec),_(4,rA),_(5,Ti),_(6,Ze),_(7,To),_(8,ho),_(9,Pe)],QG);const QD="vs/workbench/services/remote/common/remoteExplorerService",V9e="remote.explorerType",z9e="remote.autoForwardPorts",$9e="remote.autoForwardPortsSource",G9e="output",zYt="hybrid";var q9e;(function(n){n.Candidate="Candidate",n.Detected="Detected",n.Forwarded="Forwarded",n.Add="Add"})(q9e||(q9e={}));var Q9e;(function(n){n[n.None=0]="None",n[n.New=1]="New",n[n.Label=2]="Label",n[n.LocalPort=3]="LocalPort"})(Q9e||(Q9e={}));const $Yt={type:"object",required:["id"],properties:{id:{description:g(QD,0,"The ID of a Get Started walkthrough to open."),type:"string"}}},GYt=Ap.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(QD,1,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(QD,2,"The url, or a command that returns the url, to your project's Getting Started page, or a walkthrough ID contributed by your project's extension"),oneOf:[{type:"string"},$Yt]},documentation:{description:g(QD,3,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(QD,4,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(QD,5,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(QD,6,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(QD,7,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let j9e=class{constructor(e,t,i){this.storageService=e,this.tunnelService=t,this._targetType=[],this._onDidChangeTargetType=new I,this.onDidChangeTargetType=this._onDidChangeTargetType.event,this._onDidChangeHelpInformation=new I,this.onDidChangeHelpInformation=this._onDidChangeHelpInformation.event,this._helpInformation=[],this._onDidChangeEditable=new I,this.onDidChangeEditable=this._onDidChangeEditable.event,this._onEnabledPortsFeatures=new I,this.onEnabledPortsFeatures=this._onEnabledPortsFeatures.event,this._portsFeaturesEnabled=!1,this.namedProcesses=new Map,this._tunnelModel=i.createInstance(QG),GYt.setHandler(s=>{this._helpInformation.push(...s),this._onDidChangeHelpInformation.fire(s)})}get helpInformation(){return this._helpInformation}set targetType(e){const t=this._targetType.length>0?this._targetType[0]:"",i=e.length>0?e[0]:"";t!==i&&(this._targetType=e,this.storageService.store(V9e,this._targetType.toString(),ke.WORKSPACE,ln.MACHINE),this.storageService.store(V9e,this._targetType.toString(),ke.PROFILE,ln.USER),this._onDidChangeTargetType.fire(this._targetType))}get targetType(){return this._targetType}get tunnelModel(){return this._tunnelModel}forward(e,t){return this.tunnelModel.forward(e,t)}close(e,t){return this.tunnelModel.close(e.host,e.port,t)}setTunnelInformation(e){e?.features&&this.tunnelService.setTunnelFeatures(e.features),this.tunnelModel.addEnvironmentTunnels(e?.environmentTunnels)}setEditable(e,t,i){i?this._editable={tunnelItem:e,data:i,editId:t}:this._editable=void 0,this._onDidChangeEditable.fire(e?{tunnel:e,editId:t}:void 0)}getEditableData(e,t){return this._editable&&(!e&&e===this._editable.tunnelItem||e&&this._editable.tunnelItem?.remotePort===e.remotePort&&this._editable.tunnelItem.remoteHost===e.remoteHost&&this._editable.editId===t)?this._editable.data:void 0}setCandidateFilter(e){return e?(this.tunnelModel.setCandidateFilter(e),{dispose:()=>{this.tunnelModel.setCandidateFilter(void 0)}}):{dispose:()=>{}}}onFoundNewCandidates(e){this.tunnelModel.setCandidates(e)}restore(){return this.tunnelModel.restoreForwarded()}enablePortsFeatures(){this._portsFeaturesEnabled=!0,this._onEnabledPortsFeatures.fire()}get portsFeaturesEnabled(){return this._portsFeaturesEnabled}};j9e=D([_(0,on),_(1,Qde),_(2,be)],j9e);const K9e="vs/workbench/api/browser/mainThreadTunnelService";let Y9e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=s,this.configurationService=o,this.logService=r,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(et.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(z9e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue($9e)!==G9e}async $setRemoteTunnelService(e){this.remoteExplorerService.namedProcesses.set(e,"Code Extension Host"),this.remoteExplorerService.portsFeaturesEnabled?this._proxy.$registerCandidateFinder(this.processFindingEnabled()):this._register(this.remoteExplorerService.onEnabledPortsFeatures(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled()))),this._register(this.configurationService.onDidChangeConfiguration(async t=>{if(t.affectsConfiguration(z9e)||t.affectsConfiguration($9e))return this._proxy.$registerCandidateFinder(this.processFindingEnabled())})),this._register(this.tunnelService.onAddedTunnelProvider(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled())))}async $registerPortsAttributesProvider(e,t){this.portsAttributesProviders.set(t,e),this._alreadyRegistered||(this.remoteExplorerService.tunnelModel.addAttributesProvider(this),this._alreadyRegistered=!0)}async $unregisterPortsAttributesProvider(e){this.portsAttributesProviders.delete(e)}async providePortAttributes(e,t,i,s){if(this.portsAttributesProviders.size===0)return[];const o=Array.from(this.portsAttributesProviders.entries()).filter(r=>{const a=r[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&hr[0]);return o.length===0?[]:this._proxy.$providePortAttributes(o,e,t,i,s)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:t},elevateIfNeeded:!1});if(!(!i||typeof i=="string"))return!this.elevateionRetry&&e.localAddressPort!==void 0&&i.tunnelLocalPort!==void 0&&this.tunnelService.isPortPrivileged(e.localAddressPort)&&i.tunnelLocalPort!==e.localAddressPort&&this.tunnelService.canElevate&&this.elevationPrompt(e,i,t),Joe.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(nt.Info,g(K9e,0,"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",i,e.remoteAddress.port,e.localAddressPort),[{label:g(K9e,1,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},qM.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,qM.Other)}async $getTunnels(){return(await this.tunnelService.tunnels).map(e=>({remoteAddress:{port:e.tunnelRemotePort,host:e.tunnelRemoteHost},localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol}))}async $onFoundNewCandidates(e){this.remoteExplorerService.onFoundNewCandidates(e)}async $setTunnelProvider(e){const t={forwardPort:(i,s)=>this._proxy.$forwardPort(i,s).then(r=>{if(r){if(typeof r=="string")return r}else return;const a=r;return this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) New tunnel established by tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),{tunnelRemotePort:a.remoteAddress.port,tunnelRemoteHost:a.remoteAddress.host,localAddress:typeof a.localAddress=="string"?a.localAddress:Hf(a.localAddress.host,a.localAddress.port),tunnelLocalPort:typeof a.localAddress!="string"?a.localAddress.port:void 0,public:a.public,privacy:a.privacy,protocol:a.protocol??Km.Http,dispose:async c=>(this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) Closing tunnel from tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),this._proxy.$closeTunnel({host:a.remoteAddress.host,port:a.remoteAddress.port},c))}})};e&&this.tunnelService.setTunnelFeatures(e),this.tunnelService.setTunnelProvider(t),this.contextKeyService.createKey(Ert.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case UM.None:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case UM.Output:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":G9e}}]);break}case UM.Hybrid:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":zYt}}]);break}}}).catch(()=>{})}};Y9e=D([en(Ue.MainThreadTunnelService),_(1,she),_(2,Qde),_(3,Pi),_(4,Re),_(5,Ze),_(6,Sf),_(7,Pe)],Y9e);const ome="vs/workbench/services/authentication/browser/authenticationService";function xrt(n){return`onAuthenticationRequest:${n}`}let J9e=class extends ${constructor(e,t,i){super(),this._extensionService=e,this._environmentService=i,this._onDidRegisterAuthenticationProvider=this._register(new I),this.onDidRegisterAuthenticationProvider=this._onDidRegisterAuthenticationProvider.event,this._onDidUnregisterAuthenticationProvider=this._register(new I),this.onDidUnregisterAuthenticationProvider=this._onDidUnregisterAuthenticationProvider.event,this._onDidChangeSessions=this._register(new I),this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeDeclaredProviders=this._register(new I),this.onDidChangeDeclaredProviders=this._onDidChangeDeclaredProviders.event,this._authenticationProviders=new Map,this._authenticationProviderDisposables=this._register(new Zo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(s=>{this._onDidChangeSessions.fire({providerId:s.providerId,label:s.accountName,event:{added:[],changed:[],removed:[]}})})),this._registerEnvContributedAuthenticationProviders()}get declaredProviders(){return this._declaredProviders}_registerEnvContributedAuthenticationProviders(){if(this._environmentService.options?.authenticationProviders?.length)for(const e of this._environmentService.options.authenticationProviders)this.registerAuthenticationProvider(e.id,e)}registerDeclaredAuthenticationProvider(e){if(Xv(e.id))throw new Error(g(ome,0,"An authentication contribution must specify an id."));if(Xv(e.label))throw new Error(g(ome,1,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(ome,2,"This authentication id '{0}' has already been registered",e.id));this._declaredProviders.push(e),this._onDidChangeDeclaredProviders.fire()}unregisterDeclaredAuthenticationProvider(e){const t=this.declaredProviders.findIndex(i=>i.id===e);t>-1&&this.declaredProviders.splice(t,1),this._onDidChangeDeclaredProviders.fire()}isAuthenticationProviderRegistered(e){return this._authenticationProviders.has(e)}registerAuthenticationProvider(e,t){this._authenticationProviders.set(e,t);const i=new Z;i.add(t.onDidChangeSessions(s=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:s}))),cz(t)&&i.add(t),this._authenticationProviderDisposables.set(e,i),this._onDidRegisterAuthenticationProvider.fire({id:e,label:t.label})}unregisterAuthenticationProvider(e){const t=this._authenticationProviders.get(e);t&&(this._authenticationProviders.delete(e),this._onDidUnregisterAuthenticationProvider.fire({id:e,label:t.label})),this._authenticationProviderDisposables.deleteAndDispose(e)}getProviderIds(){const e=[];return this._authenticationProviders.forEach(t=>{e.push(t.id)}),e}getProvider(e){if(this._authenticationProviders.has(e))return this._authenticationProviders.get(e);throw new Error(`No authentication provider '${e}' is currently registered.`)}async getSessions(e,t,i=!1){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,i);if(s)return await s.getSessions(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(s)return await s.createSession(t,{sessionToRecreate:i?.sessionToRecreate});throw new Error(`No authentication provider '${e}' is currently registered.`)}async removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return i.removeSession(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async tryActivateProvider(e,t){await this._extensionService.activateByEvent(xrt(e),t?sC.Immediate:sC.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const s=new Z,o=new Promise((a,c)=>{s.add(T.once(this.onDidRegisterAuthenticationProvider)(l=>{if(l.id===e)if(i=this._authenticationProviders.get(e),i)a(i);else throw new Error(`No authentication provider '${e}' is currently registered.`)}))}),r=new Promise((a,c)=>{const l=setTimeout(()=>{c("Timed out waiting for authentication provider to register")},5e3);s.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>s.dispose())}};J9e=D([_(0,ho),_(1,ehe),_(2,Ow)],J9e);const OB="vs/workbench/api/browser/mainThreadAuthentication";class qYt extends ${constructor(e,t,i,s,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=s,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e){return this._proxy.$getSessions(this.id,e)}createSession(e,t){return this._proxy.$createSession(this.id,e,t)}async removeSession(e){await this._proxy.$removeSession(this.id,e),this.notificationService.info(g(OB,0,"Successfully signed out."))}}let X9e=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=s,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const s=new I;this._registrations.set(e,s);const o=new qYt(this._proxy,e,t,i,this.notificationService,s);this.authenticationService.registerAuthenticationProvider(e,o)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(xrt(e),sC.Immediate)}$sendDidChangeSessions(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$removeSession(e,t){return this.authenticationService.removeSession(e,t)}async loginPrompt(e,t,i,s){let o;e.id.startsWith(tue)?o=g(OB,1,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(OB,2,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(OB,3,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(OB,4,"&&Allow"),run(){return!0}}];s?.learnMore&&r.push({label:g(OB,5,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,s);return await this.openerService.open(P.revive(s.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:nt.Info,message:o,buttons:r,detail:s?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,s,o){const r=await this.authenticationService.getSessions(e,t,!0),a=this.authenticationService.getProvider(e);if(o.forceNewSession&&o.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(o.forceNewSession&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(o.createIfNone&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts)if(o.clearSessionPreference)this.authenticationExtensionsService.removeSessionPreference(e,i,t);else{const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=r.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,r[0].account.label,i))return r[0]}if(o.createIfNone||o.forceNewSession){let l;typeof o.forceNewSession=="object"&&(l=o.forceNewSession);const d=!!(o.forceNewSession&&r.length);if(!await this.loginPrompt(a,s,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts?await this.authenticationExtensionsService.selectSession(e,i,s,t,r):r[0];else{let f;if(typeof o.forceNewSession=="object"&&o.forceNewSession.sessionToRecreate)f=o.forceNewSession.sessionToRecreate;else{const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p):void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,sessionToRecreate:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:s,allowed:!0}]),this.authenticationExtensionsService.updateSessionPreference(e,i,u),u}const c=r.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;o.silent||(r.length?this.authenticationExtensionsService.requestSessionAccess(e,i,s,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,s))}async $getSession(e,t,i,s,o){const r=await this.doGetSession(e,t,i,s,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,s)),r}async $getSessions(e,t,i,s){const r=(await this.authenticationService.getSessions(e,[...t],!0)).filter(a=>this.authenticationAccessService.isAccessAllowed(e,a.account.label,i));if(r.length){this.sendProviderUsageTelemetry(i,e);for(const a of r)this.authenticationUsageService.addAccountUsage(e,a.account.label,i,s)}return r}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};X9e=D([en(Ue.MainThreadAuthentication),_(1,FPe),_(2,pet),_(3,ehe),_(4,fet),_(5,To),_(6,Pi),_(7,ho),_(8,rn),_(9,fr)],X9e);let Z9e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(et.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let s=i.get(e.id);s===void 0&&(s=new I,i.set(e.id,s)),this._timelineService.registerTimelineProvider({...e,onDidChange:s.event,async provideTimeline(o,r,a){return Or(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),s?.dispose()}})}$unregisterTimelineProvider(e){this.logService.trace(`MainThreadTimeline#unregisterTimelineProvider: id=${e}`),this._timelineService.unregisterTimelineProvider(e)}$emitTimelineChangeEvent(e){this.logService.trace(`MainThreadTimeline#emitChangeEvent: id=${e.id}, uri=${e.uri?.toString(!0)}`),this._providerEmitters.get(e.id)?.fire(e)}dispose(){}};Z9e=D([en(Ue.MainThreadTimeline),_(1,Ze),_(2,det)],Z9e);class Zoe extends ${get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this.changeEmitter.fire(e))}static stored(e,t){const i=new Zoe(e.get(t));return i._register(e),i._register(i.onDidChange(s=>e.store(s))),i}constructor(e){super(),this._value=e,this.changeEmitter=this._register(new I),this.onDidChange=this.changeEmitter.event}}let S0e=0;class QYt{constructor(e,t,i,s){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=s,this.fileCoverage=new wi,this.didAddCoverage=oL(this),this.tree=new qse,this.associatedData=new Map,this.perTestCoverageIDs=new Set}append(e,t){const i=this.getComputedForUri(e.uri),s=this.result,o=(l,d)=>{d[l]?(d[l].covered+=(e[l]?.covered||0)-(i?.[l]?.covered||0),d[l].total+=(e[l]?.total||0)-(i?.[l]?.total||0)):e[l]&&(d[l]={...e[l]})},r=[...this.treePathForUri(e.uri,!0)],a=[],c=!!e.testId;e.testId&&this.perTestCoverageIDs.add(e.testId.toString()),this.tree.mutatePath(this.treePathForUri(e.uri,!1),l=>{if(a.push(l),a.length===r.length)if(c){const d=l.value??=new U5(Yse.empty(String(S0e++),e.uri),s,this.accessor);Agt(d instanceof U5,"coverage is unexpectedly computed"),d.perTestData??=new Map;const h=new U5(e,s,this.accessor);h.isForTest={id:e.testId,parent:d},d.perTestData.set(e.testId.toString(),h),this.fileCoverage.set(e.uri,d)}else if(l.value){const d=l.value;d.id=e.id,d.statement=e.statement,d.branch=e.branch,d.declaration=e.declaration}else{const d=l.value=new U5(e,s,this.accessor);this.fileCoverage.set(e.uri,d)}else if(!c)if(l.value)o("statement",l.value),o("branch",l.value),o("declaration",l.value),l.value.didChange.trigger(t);else{const d=Vs(e);d.id=String(S0e++),d.uri=this.treePathToUri(r.slice(0,a.length)),l.value=new krt(d,s)}}),a&&!c&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new qse;for(const i of this.tree.values())if(i instanceof U5){const s=i.perTestData?.get(e.toString());if(!s)continue;const o=[...this.treePathForUri(s.uri,!0)],r=[];t.mutatePath(this.treePathForUri(s.uri,!1),a=>{r.push(a),r.length===o.length?a.value=s:a.value??=new KYt(this.treePathToUri(o.slice(0,r.length)),s.fromResult)})}return t}getAllFiles(){return this.fileCoverage}getUri(e){return this.fileCoverage.get(e)}getComputedForUri(e){return this.tree.find(this.treePathForUri(e,!1))}*treePathForUri(e,t){yield e.scheme,yield e.authority,yield*(!t&&this.uriIdentityService.extUri.ignorePathCasing(e)?e.path.toLowerCase():e.path).split("/")}treePathToUri(e){return P.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const jYt=(n,e,t)=>{let i=n.covered,s=n.total;return e&&(i+=e.covered,s+=e.total),t&&(i+=t.covered,s+=t.total),s===0?1:i/s};class Drt{get tpc(){return jYt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=oL(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class krt extends Drt{}class KYt extends krt{constructor(e,t){super({id:String(S0e++),uri:e,statement:{covered:0,total:0}},t)}}class U5 extends Drt{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async details(e=qe.None){this._details??=this.accessor.getCoverageDetails(this.id,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const Kv={[Xn.Running]:6,[Xn.Errored]:5,[Xn.Failed]:4,[Xn.Queued]:3,[Xn.Passed]:2,[Xn.Unset]:0,[Xn.Skipped]:1};Gct(Kv,(n,e)=>({statusNode:!0,state:Number(e),priority:n}));const YYt=(n,e)=>Kv[e]-Kv[n],Irt=(...n)=>{switch(n.length){case 0:return Xn.Unset;case 1:return n[0];case 2:return Kv[n[0]]>Kv[n[1]]?n[0]:n[1];default:{let e=n[0];for(let t=1;tNumber(n)).sort(YYt),e7e={[Xn.Passed]:0,[Xn.Skipped]:1,[Xn.Failed]:2,[Xn.Errored]:3},Lrt=()=>new Uint32Array(JYt.length),XYt=n=>"getOwnDuration"in n,A0e=(n,e,t=!1)=>{let i=n.getCurrentComputedState(e);if(i===void 0||t){i=n.getOwnState(e)??Xn.Unset;let s=0;const o=Lrt();for(const r of n.getChildren(e)){const a=A0e(n,r);s++,o[a]++,i=a===Xn.Skipped&&i===Xn.Unset?Xn.Skipped:Irt(i,a)}s>ZYt&&Rrt.set(e,o),n.setComputedState(e,i)}return i},Trt=(n,e,t=!1)=>{let i=n.getCurrentComputedDuration(e);if(i===void 0||t){const s=n.getOwnDuration(e);if(s!==void 0)i=s;else{i=void 0;for(const o of n.getChildren(e)){const r=Trt(n,o);r!==void 0&&(i=(i||0)+r)}}n.setComputedDuration(e,i)}return i},ZYt=64,Rrt=new WeakMap,eJt=(n,e,t,i=!0)=>{const s=n.getCurrentComputedState(e),o=Kv[s],r=A0e(n,e,!0),a=Kv[r],c=new Set;if(a!==o){n.setComputedState(e,r),c.add(e);let l=s,d=r;for(const h of n.getParents(e)){const u=Rrt.get(h);u&&(u[l]--,u[d]++);const f=n.getCurrentComputedState(h);if(a>o){if(f!==void 0&&Kv[f]>=a||u&&u[d]>1)break;n.setComputedState(h,r),c.add(h)}else{if(f===void 0||Kv[f]>o||u&&u[l]>0)break;d=A0e(n,h,!0),n.setComputedState(h,d),c.add(h)}l=f}}if(XYt(n)&&i)for(const l of fi.concat(fi.single(e),n.getParents(e))){const d=n.getCurrentComputedDuration(l),h=Trt(n,l,!0);if(d===h)break;n.setComputedDuration(l,h),c.add(l)}return c},tJt="vs/workbench/contrib/testing/common/testResult";T.None,Promise.resolve();class iJt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new sd,this.offset=0,this.onDidWriteData=this.writeDataEmitter.event,this.endPromise=this.endDeferred.p,this.buffers=[]}get length(){return this.offset}getRange(e,t){const i=ze.alloc(t);let s=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,s),s+=o.byteLength;return s0;c--){const l=e.buffer[c-1];if(l!==o.CR&&l!==o.LF)break}return this.push(e.slice(0,c)),this.push(a),this.push(e.slice(c)),{offset:i,length:s}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const t7e=(n,e)=>`\x1B]633;SetMark;Id=${eKt(n,e)};Hidden\x07`,nJt=(n,e,t)=>({controllerId:n,expand:Eh.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Xn.Unset,computedState:Xn.Unset});var HT;(function(n){n[n.ComputedStateChange=0]="ComputedStateChange",n[n.OwnStateChange=1]="OwnStateChange",n[n.NewMessage=2]="NewMessage"})(HT||(HT={}));let D2=class extends ${get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,s){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=s,this.completeEmitter=this._register(new I),this.newTaskEmitter=this._register(new I),this.endTaskEmitter=this._register(new I),this.changeEmitter=this._register(new I),this.testById=new Map,this.testMarkerCounter=0,this.startedAt=Date.now(),this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.onNewTask=this.newTaskEmitter.event,this.onEndTask=this.endTaskEmitter.event,this.tasks=[],this.name=g(tJt,0,"Test run at {0}",new Date().toLocaleString(Gd)),this.counts=Lrt(),this.computedStateAccessor={getOwnState:o=>o.ownComputedState,getCurrentComputedState:o=>o.computedState,setComputedState:(o,r)=>o.computedState=r,getChildren:o=>o.children,getParents:o=>{const{testById:r}=this;return function*(){const a=bn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new Ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serializeWithoutMessages)})),this.doSerializeWithMessages=new Ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,s){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(s||i)&&(r=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,r),h={location:i,message:o,offset:l,length:d,marker:r,type:dC.Output},u=s&&this.testById.get(s);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:HT.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:xi(this,void 0),otherMessages:[],output:new iJt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Xn.Unset});this.newTaskEmitter.fire(this.tasks.length-1)}addTestChainToRun(e,t){let i=this.testById.get(t[0].extId);i||(i=this.addTestToRun(e,t[0],null));for(let s=1;ss.state===Xn.Queued||s.state===Xn.Running),this.endTaskEmitter.fire(t)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const e of this.tasks)e.running&&this.markTaskComplete(e.id);this._completedAt=Date.now(),this.completeEmitter.fire(),this.telemetry.publicLog2("test.outcomes",{failures:this.counts[Xn.Errored]+this.counts[Xn.Failed],passes:this.counts[Xn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(bn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:HT.ComputedStateChange,item:i,result:this}))}toJSON(){return this.completedAt&&this.persist?this.doSerialize.value:void 0}toJSONWithMessages(){return this.completedAt&&this.persist?this.doSerializeWithMessages.value:void 0}setAllToState(e,t,i){const s=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[s],o)&&this.fireUpdateAndRefresh(o,s,e)}fireUpdateAndRefresh(e,t,i,s){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:HT.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,s!==void 0&&(e.tasks[t].duration=s,e.ownDuration=Math.max(e.ownDuration||0,s));const c=Irt(...e.tasks.map(l=>l.state));if(c===o){s!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,eJt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:HT.ComputedStateChange}))}addTestToRun(e,t,i){const s=nJt(e,t);if(this.testById.set(t.extId,s),this.counts[Xn.Unset]++,i&&this.testById.get(i)?.children.push(s),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};D2=D([_(3,rn)],D2);let i7e=class extends ${constructor(e,t,i,s,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=s,this.resultService=o,this.diffListener=this._register(new Dn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(et.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(r,a)=>this.proxy.$provideTestFollowups(r,a),executeTestFollowup:r=>this.proxy.$executeTestFollowup(r),disposeTestFollowups:r=>this.proxy.$disposeTestFollowups(r)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(T.debounce(s.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Yu.Run,Yu.Debug,Yu.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))r[c.controllerId]??=[],r[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(r)})),this._register(o.onResultsChanged(r=>{if("completed"in r){const a=r.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in r&&r.removed.forEach(a=>{a instanceof D2&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new qse;for(const i of e)t.insert(bn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof D2&&i.markRetired(t)}$publishTestRunProfile(e){const t=this.testProviderRegistrations.get(e.controllerId);t&&this.testProfiles.addProfile(t.instance,e)}$updateTestRunConfig(e,t,i){this.testProfiles.updateProfile(e,t,i)}$removeTestProfile(e,t){this.testProfiles.removeProfile(e,t)}$addTestsToRun(e,t,i){this.withLiveRun(t,s=>s.addTestChainToRun(e,i.map(o=>SG.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,s=>{const o=s.tasks.find(a=>a.id===t);if(!o)return;const r=Yse.deserialize(this.uriIdentityService,i);En(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new QYt(s,t,this.uriIdentityService,{getCoverageDetails:(l,d)=>this.proxy.$getCoverageDetails(l,d).then(h=>h.map(Yke.deserialize))}),c.append(r,a),o.coverage.set(c,a))})})}$startedExtensionTestRun(e){this.resultService.createLiveResult(e)}$startedTestRunTask(e,t){this.withLiveRun(e,i=>i.addTask(t))}$finishedTestRunTask(e,t){this.withLiveRun(e,i=>i.markTaskComplete(t))}$finishedExtensionTestRun(e){this.withLiveRun(e,t=>t.markComplete())}$updateTestStateInRun(e,t,i,s,o){this.withLiveRun(e,r=>r.updateState(i,t,s,o))}$appendOutputToRun(e,t,i,s,o){const r=s&&{uri:P.revive(s.uri),range:O.lift(s.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,s){const o=this.resultService.getResult(e);if(o&&o instanceof D2)for(const r of s)o.appendMessage(i,t,yG.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const s=new Z,o=s.add(new Zoe(t)),r=s.add(new Zoe(i)),a={id:e,label:o,canRefresh:r,syncTests:()=>this.proxy.$syncTests(),refreshTests:c=>this.proxy.$refreshTests(e,c),configureRunProfile:c=>this.proxy.$configureRunProfile(e,c),runTests:(c,l)=>this.proxy.$runControllerTests(c,l),startContinuousRun:(c,l)=>this.proxy.$startContinuousRun(c,l),expandTest:(c,l)=>this.proxy.$expandTest(c,isFinite(l)?l:-1)};s.add(Ee(()=>this.testProfiles.removeProfile(e))),s.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,canRefresh:r,disposable:s})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&(t.label!==void 0&&(i.label.value=t.label),t.canRefresh!==void 0&&(i.canRefresh.value=t.canRefresh))}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(x4.serialize)),this.diffListener.value=this.testService.onDidProcessDiff(this.proxy.$acceptDiff,this.proxy)}$unsubscribeFromDiffs(){this.diffListener.clear()}$publishDiff(e,t){this.testService.publishDiff(e,t.map(i=>x4.deserialize(this.uriIdentityService,i)))}async $runTests(e,t){return(await this.testService.runResolvedTests(e,t)).id}dispose(){super.dispose();for(const e of this.testProviderRegistrations.values())e.disposable.dispose();this.testProviderRegistrations.clear()}withLiveRun(e,t){const i=this.resultService.getResult(e);return i&&i instanceof D2?t(i):void 0}};i7e=D([en(Ue.MainThreadTesting),_(1,_o),_(2,cet),_(3,ret),_(4,aet)],i7e);let n7e=class extends ${constructor(e,t,i,s){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Jht,this._proxy=e.getProxy(et.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(o=>{try{const{extensionId:r,key:a}=this.parseKey(o);r&&a&&this._proxy.$onDidChangePassword({extensionId:r,key:a})}catch{}}))}$getPassword(e,t){return this.logService.trace(`[mainThreadSecretState] Getting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doGetPassword(e,t))}async doGetPassword(e,t){const i=this.getKey(e,t),s=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${s?"P":"No p"}assword found for: `,e,t),s}$setPassword(e,t,i){return this.logService.trace(`[mainThreadSecretState] Setting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doSetPassword(e,t,i))}async doSetPassword(e,t,i){const s=this.getKey(e,t);await this.secretStorageService.set(s,i),this.logService.trace("[mainThreadSecretState] Password set for: ",e,t)}$deletePassword(e,t){return this.logService.trace(`[mainThreadSecretState] Deleting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doDeletePassword(e,t))}async doDeletePassword(e,t){const i=this.getKey(e,t);await this.secretStorageService.delete(i),this.logService.trace("[mainThreadSecretState] Password deleted for: ",e,t)}getKey(e,t){return JSON.stringify({extensionId:e,key:t})}parseKey(e){return JSON.parse(e)}};n7e=D([en(Ue.MainThreadSecretState),_(1,RZe),_(2,Ze),_(3,Ow)],n7e);let s7e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(et.ExtHostShare)}$registerShareProvider(e,t,i,s,o){const r={id:i,label:s,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,qe.None);return typeof l=="string"?l:P.revive(l)}};this.providers.set(e,r);const a=this.shareService.registerShareProvider(r);this.providerDisposables.set(e,a)}$unregisterShareProvider(e){this.providers.has(e)&&this.providers.delete(e),this.providerDisposables.has(e)&&this.providerDisposables.delete(e)}dispose(){this.providers.clear(),St(this.providerDisposables.values()),this.providerDisposables.clear()}};s7e=D([en(Ue.MainThreadShare),_(1,JZe)],s7e);let o7e=class extends ${constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new Zo),this.proxy=e.getProxy(et.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,s){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:s,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Or(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};o7e=D([en(Ue.MainThreadProfileContentHandlers),_(1,ket)],o7e);let r7e=class extends ${constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,qe.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(s,o)=>this._proxy.$provideAiRelatedInformation(e,s,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};r7e=D([en(Ue.MainThreadAiRelatedInformation),_(1,PPe)],r7e);let a7e=class extends ${constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(s,o)=>this._proxy.$provideAiEmbeddingVector(t,s,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};a7e=D([en(Ue.MainThreadAiEmbeddingVector),_(1,uet)],a7e);let E0e=class extends Kne{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(t,i,s,o,r,a,c,l,d,h,u,f,p),this.workerConfig=e}async _getWebWorkerExtensionHostIframeSrc(){const e=new URL(await super._getWebWorkerExtensionHostIframeSrc(),window.location.href);return e.searchParams.set("vscodeExtHostWorkerSrc",this.workerConfig.url),this.workerConfig.options!=null&&e.searchParams.set("vscodeExtHostWorkerOptions",JSON.stringify(this.workerConfig.options)),e.searchParams.set("parentOrigin",window.origin),e.toString()}};E0e=D([_(4,rn),_(5,Ti),_(6,eo),_(7,Ze),_(8,wp),_(9,Ow),_(10,V_),_(11,Xa),_(12,bg),_(13,on)],E0e);let x0e;function sJt(n){x0e=n}let D0e=class extends qDe{constructor(e,t,i,s,o,r,a,c,l){super(t,i,s,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return x0e==null?null:this._instantiationService.createInstance(x0e,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const s=i?2:1;return this._instantiationService.createInstance(E0e,this.workerConfig,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};D0e=D([_(4,be),_(5,Sf),_(6,rA),_(7,Kh),_(8,Ze)],D0e);let k0e=class extends QDe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,s,o){const r=PQt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,s,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};k0e=D([_(1,Ze)],k0e);let I0e=class extends GDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k){const F=t.createInstance(FDe),N=new D0e(e,F,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,b,r,p);super(F,N,new k0e(e!=null?[2,1,3]:[1,3],p),t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new rT(e,t))}async _scanSingleExtension(e){return e.location.scheme===k6.extensionFile?ME(e):super._scanSingleExtension(e)}};I0e=D([_(1,be),_(2,Pi),_(3,Ow),_(4,rn),_(5,Kh),_(6,ci),_(7,Xa),_(8,the),_(9,Ti),_(10,Re),_(11,G_),_(12,OPe),_(13,Ze),_(14,Sf),_(15,Gde),_(16,mg),_(17,rA),_(18,ahe),_(19,Rm),_(20,oA),_(21,she),_(22,To)],I0e);class oJt extends jDe{async readExtensionResource(e){return e.scheme===k6.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}Z9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>X9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function rJt(n,e){return{[ho.toString()]:new Gi(I0e,[void 0],!1),[G_.toString()]:new Gi(PDe,[],!0),[CPe.toString()]:new Gi(oJt,[],!0),[Fz.toString()]:new Gi(YDe,[],!0)}}const c7e=/^([^.]+\..+)[:=](.+)$/;class Jt{get remoteAuthority(){return this.options.remoteAuthority}get expectsResolverExtension(){return!!this.options.remoteAuthority?.includes("+")&&!this.options.webSocketFactory}get isBuilt(){return!!this.productService.commit}get logLevel(){const e=this.payload?.get("logLevel");return e?e.split(",").find(t=>!c7e.test(t)):this.options.developmentOptions?.logLevel!==void 0?c7(this.options.developmentOptions?.logLevel):void 0}get extensionLogLevel(){const e=this.payload?.get("logLevel");if(e){const t=[];for(const i of e.split(",")){const s=c7e.exec(i);s&&s[1]&&s[2]&&t.push([s[1],s[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,c7(i)]):void 0}get profDurationMarkers(){const e=this.payload?.get("profDurationMarkers");if(e){const t=[];for(const i of e.split(","))t.push(i);return t.length===2?t:void 0}}get windowLogsPath(){return this.logsHome}get logFile(){return Qt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return P.file("/User").with({scheme:_e.vscodeUserData})}get argvResource(){return Qt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Qt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Qt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Qt(this.userRoamingDataHome,"History")}get stateResource(){return Qt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Qt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Qt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Qt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Qt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Qt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Qt(this.extHostLogsPath,"extensionTelemetry.log")}get debugExtensionHost(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.params}get isExtensionDevelopment(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.isExtensionDevelopment}get extensionDevelopmentLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentLocationURI}get extensionDevelopmentLocationKind(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentKind}get extensionTestsLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionTestsLocationURI}get extensionEnabledProposedApi(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionEnabledProposedApi}get debugRenderer(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.debugRenderer}get enableSmokeTestDriver(){return this.options.developmentOptions?.enableSmokeTestDriver}get disableExtensions(){return this.payload?.get("disableExtensions")==="true"}get enableExtensions(){return this.options.enabledExtensions}get webviewExternalEndpoint(){const e=this.options.webviewEndpoint||this.productService.webviewContentExternalBaseUrlTemplate||"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/",t=this.payload?.get("webviewExternalEndpointCommit");return e.replace("{{commit}}",t??this.productService.commit??"ef65ac1ba57f57f2a3961bfe94aa20481caca4c6").replace("{{quality}}",(t?"insider":this.productService.quality)??"insider")}get extensionTelemetryLogResource(){return Qt(this.logsHome,"extensionTelemetry.log")}get disableTelemetry(){return!1}get verbose(){return this.payload?.get("verbose")==="true"}get logExtensionHostCommunication(){return this.payload?.get("logExtensionHostCommunication")==="true"}get skipReleaseNotes(){return this.payload?.get("skipReleaseNotes")==="true"}get skipWelcome(){return this.payload?.get("skipWelcome")==="true"}get disableWorkspaceTrust(){return!this.options.enableWorkspaceTrust}get lastActiveProfile(){return this.payload?.get("lastActiveProfile")}constructor(e,t,i,s){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=s,this.extensionHostDebugEnvironment=void 0,this.editSessionId=this.options.editSessionId,i.workspaceProvider&&Array.isArray(i.workspaceProvider.payload))try{this.payload=new Map(i.workspaceProvider.payload)}catch(o){bt(o)}}resolveExtensionHostDebugEnvironment(){const e={params:{port:null,break:!1},debugRenderer:!1,isExtensionDevelopment:!1,extensionDevelopmentLocationURI:void 0,extensionDevelopmentKind:void 0};if(this.payload)for(const[i,s]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(P.parse(s)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[s];break;case"extensionTestsPath":e.extensionTestsLocationURI=P.parse(s);break;case"debugRenderer":e.debugRenderer=s==="true";break;case"debugId":e.params.debugId=s;break;case"inspect-brk-extensions":e.params.port=parseInt(s),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(s);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>P.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=P.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=P.parse(e);if(this.payload.has("gotoLineMode")){const i=qQe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:ll(i.line)?void 0:{startLineNumber:i.line,startColumn:i.column||1}}}]}return[{fileUri:t}]}}}get filesToDiff(){if(this.payload){const e=this.payload.get("diffFilePrimary"),t=this.payload.get("diffFileSecondary");if(e&&t)return[{fileUri:P.parse(t)},{fileUri:P.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),s=this.payload.get("mergeFileResult");if(e&&t&&i&&s)return[{fileUri:P.parse(e)},{fileUri:P.parse(t)},{fileUri:P.parse(i)},{fileUri:P.parse(s)}]}}}Jt.__decorator=D([ii],Jt.prototype,"remoteAuthority",null);Jt.__decorator=D([ii],Jt.prototype,"expectsResolverExtension",null);Jt.__decorator=D([ii],Jt.prototype,"isBuilt",null);Jt.__decorator=D([ii],Jt.prototype,"logLevel",null);Jt.__decorator=D([ii],Jt.prototype,"windowLogsPath",null);Jt.__decorator=D([ii],Jt.prototype,"logFile",null);Jt.__decorator=D([ii],Jt.prototype,"userRoamingDataHome",null);Jt.__decorator=D([ii],Jt.prototype,"argvResource",null);Jt.__decorator=D([ii],Jt.prototype,"cacheHome",null);Jt.__decorator=D([ii],Jt.prototype,"workspaceStorageHome",null);Jt.__decorator=D([ii],Jt.prototype,"localHistoryHome",null);Jt.__decorator=D([ii],Jt.prototype,"stateResource",null);Jt.__decorator=D([ii],Jt.prototype,"userDataSyncHome",null);Jt.__decorator=D([ii],Jt.prototype,"sync",null);Jt.__decorator=D([ii],Jt.prototype,"keyboardLayoutResource",null);Jt.__decorator=D([ii],Jt.prototype,"untitledWorkspacesHome",null);Jt.__decorator=D([ii],Jt.prototype,"serviceMachineIdResource",null);Jt.__decorator=D([ii],Jt.prototype,"extHostLogsPath",null);Jt.__decorator=D([ii],Jt.prototype,"extHostTelemetryLogFile",null);Jt.__decorator=D([ii],Jt.prototype,"debugExtensionHost",null);Jt.__decorator=D([ii],Jt.prototype,"isExtensionDevelopment",null);Jt.__decorator=D([ii],Jt.prototype,"extensionDevelopmentLocationURI",null);Jt.__decorator=D([ii],Jt.prototype,"extensionDevelopmentLocationKind",null);Jt.__decorator=D([ii],Jt.prototype,"extensionTestsLocationURI",null);Jt.__decorator=D([ii],Jt.prototype,"extensionEnabledProposedApi",null);Jt.__decorator=D([ii],Jt.prototype,"debugRenderer",null);Jt.__decorator=D([ii],Jt.prototype,"enableSmokeTestDriver",null);Jt.__decorator=D([ii],Jt.prototype,"disableExtensions",null);Jt.__decorator=D([ii],Jt.prototype,"enableExtensions",null);Jt.__decorator=D([ii],Jt.prototype,"webviewExternalEndpoint",null);Jt.__decorator=D([ii],Jt.prototype,"extensionTelemetryLogResource",null);Jt.__decorator=D([ii],Jt.prototype,"disableTelemetry",null);Jt.__decorator=D([ii],Jt.prototype,"verbose",null);Jt.__decorator=D([ii],Jt.prototype,"logExtensionHostCommunication",null);Jt.__decorator=D([ii],Jt.prototype,"skipReleaseNotes",null);Jt.__decorator=D([ii],Jt.prototype,"skipWelcome",null);Jt.__decorator=D([ii],Jt.prototype,"disableWorkspaceTrust",null);Jt.__decorator=D([ii],Jt.prototype,"lastActiveProfile",null);Jt.__decorator=D([ii],Jt.prototype,"filesToOpenOrCreate",null);Jt.__decorator=D([ii],Jt.prototype,"filesToDiff",null);Jt.__decorator=D([ii],Jt.prototype,"filesToMerge",null);let L0e=class extends Jt{constructor(e=UFe().id,t=L4t(),i){super(e,Pnt,t,i)}};L0e=D([_(2,Xa)],L0e);function aJt(n){return{[Il.toString()]:new Gi(L0e,[void 0,n],!0)}}class Mrt extends ${constructor(e=I4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=T.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidRemoveContainer=this._register(new I),this.onDidRemoveContainer=this._onDidRemoveContainer.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0},this.onDidChangeFullscreen=T.None,this.onDidChangeZenMode=T.None,this.onDidChangeWindowMaximized=T.None,this.onDidChangeCenteredLayout=T.None,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangeSideBarPosition=this._register(new I),this.onDidChangeSideBarPosition=this._onDidChangeSideBarPosition.event,this.onDidChangePanelAlignment=T.None,this.onDidChangeNotificationsVisibility=T.None,this.openedDefaultEditors=!1,this.whenRestored=Promise.resolve(),this.parts=new Map,this.hiddenParts=new Set,this._onDidChangePartVisibility=new I,this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this.offset={top:0,quickPickTop:0},this._onDidLayout=new I,this.onDidLayout=this._onDidLayout.event,window.addEventListener("resize",()=>this.layout()),this.layout();const t=Is?"windows":jr?"linux":"mac",i=Vi(["monaco-workbench",t,"web",zRe?"chromium":rQe?"firefox":aQe?"safari":void 0]);e.classList.add(...i),document.body.classList.add(t),document.body.classList.add("web")}whenContainerStylesLoaded(){}hasMainWindowBorder(){return!1}getMainWindowBorderRadius(){}isMainEditorLayoutCentered(){return!1}centerMainEditorLayout(){}get activeContainer(){return this.getContainerFromDocument(Kg())}get containers(){const e=[];for(const{window:t}of N9())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}init(e){this.editorGroupService=e.get(ur),this.paneCompositeService=e.get(Nw),this.statusBarService=e.get(xPe),this.viewDescriptorService=e.get(z_),this.configurationService=e.get(Re),this.auxiliaryWindowService=e.get(met),this.hostService=e.get(Id),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("workbench.activityBar.location")&&this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),t.affectsConfiguration("workbench.statusBar.visible")&&this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),t.affectsConfiguration("workbench.sideBar.location")&&this.setSideBarPosition(ZK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"))})),this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),this.sideBarPosition=ZK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:t,disposables:i})=>{this._onDidAddContainer.fire({container:t.container,disposables:new Z}),i.add(t.onDidLayout(s=>this.handleContainerDidLayout(t.container,s))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),jut(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return gt(e).vscodeWindowId}onActiveWindowChanged(){const e=this.getActiveContainerId();this.activeContainerId!==e&&(this.activeContainerId=e,this._onDidChangeActiveContainer.fire())}isActivityBarHidden(){const e=this.configurationService.getValue("workbench.activityBar.visible");return e!==void 0?!e:this.configurationService.getValue("workbench.activityBar.location")!=="default"}focusPart(e){switch(e){case"workbench.parts.editor":this.editorGroupService.activeGroup.focus();break;case"workbench.parts.panel":{this.paneCompositeService.getActivePaneComposite(1)?.focus();break}case"workbench.parts.sidebar":{this.paneCompositeService.getActivePaneComposite(0)?.focus();break}case"workbench.parts.activitybar":this.getPart("workbench.parts.activitybar").focus();break;case"workbench.parts.statusbar":this.statusBarService.focus();break;default:this.getContainer(e)?.focus()}}getDimension(e){return this.getPart(e)?.dimension}toggleMaximizedPanel(){}toggleMenuBar(){let e=x4t(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=knt(this.configurationService)==="native"?"toggle":"compact":t="classic",this.configurationService.updateValue("window.menuBarVisibility",t)}setPanelPosition(e){this.panelPosition=e,this.getPart("workbench.parts.panel")?.updateStyles(),this._onDidChangePanelPosition.fire(l8(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new Tn(1/0,1/0)}isPanelMaximized(){return!1}getPanelPosition(){return this.panelPosition}hasFocus(e){const t=document.activeElement;if(t==null)return!1;const i=this.getContainer(e);return i!=null&&qut(t,i)}getContainer(e){return typeof e=="string"?this.parts.get(e)==null?void 0:this.getPart(e)?.getContainer():e.document===this.mainContainer.ownerDocument?this.mainContainer:e.document.body.getElementsByClassName("monaco-workbench")[0]}getPart(e){return this.parts.get(e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(t==null)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i==null?!1:i.activeViewDescriptors.length>=1}setPartHidden(e,t){e?this.hiddenParts.add(t):this.hiddenParts.delete(t),this._onDidChangePartVisibility.fire();const i={"workbench.parts.sidebar":0,"workbench.parts.auxiliarybar":2,"workbench.parts.panel":1}[t];if(i!=null){const s=this.paneCompositeService.getActivePaneComposite(i);if(s!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(s==null&&!e){let o=this.paneCompositeService.getLastActivePaneCompositeId(i);(o==null||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(i).find(r=>this.hasViews(r.id))?.id),o!=null&&this.paneCompositeService.openPaneComposite(o,i,!0)}}this.getPart(t)?.setVisible(!e)}isVisible(e){return!this.hiddenParts.has(e)}getSideBarPosition(){return this.sideBarPosition}setSideBarPosition(e){this.sideBarPosition=e;const t=this.getPart("workbench.parts.activitybar"),i=this.getPart("workbench.parts.sidebar"),s=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),s?.updateStyles(),this._onDidChangeSideBarPosition.fire(l8(e))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ee(()=>this.parts.delete(t))}isRestored(){return!0}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){const e=this.activeContainer;return e===this.mainContainer?this.mainContainerDimension:uw(e)}layout(){this._mainContainerDimension=uw(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Lt.get(jt).getFocusedCodeEditor();t instanceof k1?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}N4t(n=>{const e=n.get(bg);e instanceof Mrt&&e.init(n)});function cJt(n){return{[bg.toString()]:new Gi(Mrt,[n],!0)}}const l7e="vs/workbench/services/host/browser/browserHostService";var av;(function(n){n[n.Unknown=1]="Unknown",n[n.Keyboard=2]="Keyboard",n[n.Api=3]="Api"})(av||(av={}));let jx=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=s,this.environmentService=o,this.instantiationService=r,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=av.Unknown,o.options?.workspaceProvider?this.workspaceProvider=o.options.workspaceProvider:this.workspaceProvider=new class{constructor(){this.workspace=void 0,this.trusted=void 0}async open(){return!0}},this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>this.onBeforeShutdown(e))),this._register(Nb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case av.Unknown:case av.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===av.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=av.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==av.Api&&(Nb.getInstance().isModifierPressed?this.shutdownReason=av.Keyboard:this.shutdownReason=av.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=i.add(Dd(t)),o=i.add(new oi(t.document,"visibilitychange"));T.any(T.map(s.onDidFocus,()=>this.hasFocus,i),T.map(s.onDidBlur,()=>this.hasFocus,i),T.map(o.event,()=>this.hasFocus,i),T.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get hasFocus(){return Kg().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=i.add(Dd(t));i.add(o.onDidFocus(()=>e.fire(s))),Eht(t)&&i.add(Put(t,()=>{const r=t.document.hasFocus();return r&&e.fire(s),r},100,20))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=I_&&t.visualViewport?t.visualViewport:t,r=()=>{const a=lgt(t);return a!==null&&!a.guess};for(const a of[xe.FULLSCREEN_CHANGE,xe.WK_FULLSCREEN_CHANGE])i.add(pe(t.document,a,()=>e.fire({windowId:s,fullscreen:r()})));i.add(Wut(o,xe.RESIZE,()=>e.fire({windowId:s,fullscreen:r()}),void 0,ei?2e3:800))},{window:yi,disposables:this._store})),e.event}openWindow(e,t){return Array.isArray(e)?this.doOpenWindow(e,t):this.doOpenEmptyWindow(e)}async doOpenWindow(e,t){const i=this.preservePayload(!1),s=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),GJ(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):iEe(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):E4t(r)&&s.push(r);o.length>0&&this.withServices(r=>{r.get($S).addFolders(o)}),s.length>0&&this.withServices(async r=>{const a=r.get(_i);if(t?.mergeMode&&s.length===4){const l=Vi(await epe(s,this.fileService,this.logService));if(l.length!==4||!wb(l[0])||!wb(l[1])||!wb(l[2])||!wb(l[3]))return;if(this.shouldReuse(t,!0))a.openEditor({input1:{resource:l[0].resource},input2:{resource:l[1].resource},base:{resource:l[2].resource},result:{resource:l[3].resource},options:{pinned:!0}});else{const d=new Map;d.set("mergeFile1",l[0].resource.toString()),d.set("mergeFile2",l[1].resource.toString()),d.set("mergeFileBase",l[2].resource.toString()),d.set("mergeFileResult",l[3].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else if(t?.diffMode&&s.length===2){const l=Vi(await epe(s,this.fileService,this.logService));if(l.length!==2||!wb(l[0])||!wb(l[1]))return;if(this.shouldReuse(t,!0))a.openEditor({original:{resource:l[0].resource},modified:{resource:l[1].resource},options:{pinned:!0}});else{const d=new Map;d.set("diffFileSecondary",l[0].resource.toString()),d.set("diffFilePrimary",l[1].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else for(const l of s)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=qQe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:ll(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Vi(await epe(d,this.fileService,this.logService)),void 0,{validateTrust:!0})}else{const d=new Map;d.set("openFile",l.fileUri.toString()),t?.gotoLineMode&&d.set("gotoLineMode","true"),this.doOpen(void 0,{payload:Array.from(d.entries())})}const c=t?.waitMarkerFileURI;c&&(async()=>(await this.instantiationService.invokeFunction(l=>t3t(l,s.map(d=>d.fileUri))),await this.fileService.del(c)))()})}withServices(e){this.instantiationService.invokeFunction(t=>e(t))}preservePayload(e){const t=new Array;!e&&this.environmentService.extensionDevelopmentLocationURI&&(t.push(["extensionDevelopmentPath",this.environmentService.extensionDevelopmentLocationURI.toString()]),this.environmentService.debugExtensionHost.debugId&&t.push(["debugId",this.environmentService.debugExtensionHost.debugId]),this.environmentService.debugExtensionHost.port&&t.push(["inspect-brk-extensions",String(this.environmentService.debugExtensionHost.port)]));const i=this.configurationService.getValue("window"),s=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return s.isDefault||t.push(["lastActiveProfile",s.id]),t.length?t:void 0}getRecentLabel(e){return GJ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:t_.LONG}):iEe(e)?this.labelService.getWorkspaceLabel(WFe(e.workspaceUri),{verbose:t_.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),s=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(s==="on"||s==="off")&&(o=s==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&GJ(e)&&e.folderUri.scheme===_e.file&&hx(this.contextService.getWorkspace())){this.withServices(async s=>{await s.get($S).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(PI.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:s}=await this.dialogService.confirm({type:nt.Warning,message:g(l7e,0,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(l7e,1,"&&Open")});s&&await this.workspaceProvider.open(e,t)}}async toggleFullScreen(e){const t=this.layoutService.getContainer(e);if(e.document.fullscreen!==void 0)if(e.document.fullscreen)try{return await e.document.exitFullscreen()}catch{this.logService.warn("toggleFullScreen(): exitFullscreen failed")}else try{return await t.requestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen failed")}if(e.document.webkitIsFullScreen!==void 0)try{e.document.webkitIsFullScreen?e.document.webkitExitFullscreen():t.webkitRequestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen/exitFullscreen failed")}}async moveTop(e){}async getCursorScreenPoint(){}async restart(){this.reload()}async reload(){await this.handleExpectedShutdown(PI.RELOAD),yi.location.reload()}async close(){await this.handleExpectedShutdown(PI.CLOSE),yi.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=av.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=av.Api,this.lifecycleService.withExpectedShutdown(e)}};jx.__decorator=D([ii],jx.prototype,"onDidChangeFocus",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeActiveWindow",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeFullScreen",null);jx=D([_(0,bg),_(1,Re),_(2,ci),_(3,eo),_(4,Ow),_(5,be),_(6,mg),_(7,Ze),_(8,To),_(9,Ti),_(10,Rm),_(11,V_)],jx);class lJt extends ${constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){pZ(yi,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),pZ(yi,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return yi.matchMedia("(prefers-color-scheme: light)").matches?!1:!!yi.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!yi.matchMedia("(forced-colors: active)").matches}}function dJt(){return{[Id.toString()]:new Gi(jx,[],!0),[xet.toString()]:new Gi(lJt,[],!0)}}function hJt(n,e,t){let i,s,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!ere(n,o-1);)o--;let C=a;for(;Cr&&n.substring(y,S)!==C&&v.push({offset:y,length:S-y,content:C})}let b=m();if(b!==xt.EOF){const C=u.getTokenOffset()+o,y=rme(h,i);w(y,o,C)}for(;b!==xt.EOF;){let C=u.getTokenOffset()+u.getTokenLength()+o,y=m(),S="";for(;!l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia);){const k=u.getTokenOffset()+o;w(" ",C,k),C=u.getTokenOffset()+u.getTokenLength()+o,S=y===xt.LineCommentTrivia?p():"",y=m()}if(y===xt.CloseBraceToken)b!==xt.OpenBraceToken&&(d--,S=p());else if(y===xt.CloseBracketToken)b!==xt.OpenBracketToken&&(d--,S=p());else{switch(b){case xt.OpenBracketToken:case xt.OpenBraceToken:d++,S=p();break;case xt.CommaToken:case xt.LineCommentTrivia:S=p();break;case xt.BlockCommentTrivia:l?S=p():S=" ";break;case xt.ColonToken:S=" ";break;case xt.StringLiteral:if(y===xt.ColonToken){S="";break}case xt.NullKeyword:case xt.TrueKeyword:case xt.FalseKeyword:case xt.NumericLiteral:case xt.CloseBraceToken:case xt.CloseBracketToken:y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia?S=" ":y!==xt.CommaToken&&y!==xt.EOF&&(f=!0);break;case xt.Unknown:f=!0;break}l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia)&&(S=p())}const M=u.getTokenOffset()+o;w(S,C,M),b=y}return v}function rme(n,e){let t="";for(let i=0;i(await this.remoteAuthorityResolverService.resolveAuthority(r)).authority}:void 0,c=Ig(e.remote.host,e.remote.port);this.inProgress.set(c,!0),e=this.mergeCachedAndUnrestoredProperties(c,e);const l=await this.tunnelService.openTunnel(a,e.remote.host,e.remote.port,void 0,n,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=vg(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Mp.Https?Mp.Https:Mp.Http:t?.protocol??Mp.Http,u={remoteHost:l.tunnelRemoteHost,remotePort:l.tunnelRemotePort,localPort:l.tunnelLocalPort,name:t?.label??e.name,closeable:!0,localAddress:l.localAddress,protocol:h,localUri:await this.makeLocalUri(l.localAddress,t),runningProcess:d?.detail,hasRunningProcess:!!d,pid:d?.pid,source:e.source??Oue,privacy:l.privacy};return this.forwarded.set(c,u),this.remoteTunnels.set(c,l),this.inProgress.delete(c),await this.storeForwarded(),await this.showPortMismatchModalIfNeeded(l,n,t),this._onForwardPort.fire(u),l}this.inProgress.delete(c)}return o}mergeCachedAndUnrestoredProperties(e,t){const i=this.unrestoredExtensionTunnels.has(e)?this.unrestoredExtensionTunnels:this.sessionCachedProperties.has(e)?this.sessionCachedProperties:void 0;if(i){const n=i.get(e);i.delete(e),n&&(t.name=n.name??t.name,t.local=("local"in n?n.local:"localPort"in n?n.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const n=i?.label??t.name;let o;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(o||(o={}));let r=o.None;switch(n!==e.name&&(e.name=n,r=o.Fire),(i?.protocol||e.protocol!==Mp.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,r=o.Reopen),t.privacy&&e.privacy!==t.privacy&&(r=o.Reopen),r){case o.Fire:{this._onForwardPort.fire();break}case o.Reopen:await this.close(e.remoteHost,e.remotePort,tL.User),await this.doForward(t,i)}return vg(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const n=vg(this.forwarded,e,t),o=Ig(e,t);if(n){n.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(o)&&(this.detected.get(o).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const n=Ig(e,t),o=this.forwarded.get(n);return i===tL.AutoForwardEnd&&o&&o.source.source===hb.Auto&&this.sessionCachedProperties.set(n,{local:o.localPort,name:o.name,privacy:o.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Ig(e,t);return(this.forwarded.get(i)||this.detected.get(i))?.localAddress}get environmentTunnelsSet(){return this._environmentTunnelsSet}addEnvironmentTunnels(e){if(e)for(const t of e){const i=vg(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),n=typeof t.localAddress=="string"?t.localAddress:Ig(t.localAddress.host,t.localAddress.port);this.detected.set(Ig(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:n,protocol:Mp.Http,localUri:this.makeLocalUri(n),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:RS.ConstantPrivate,source:{source:hb.Extension,description:g(8680,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,n,RS.ConstantPrivate,Mp.Http)}this._environmentTunnelsSet=!0,this._onEnvironmentTunnelsSet.fire(),this._onForwardPort.fire()}setCandidateFilter(e){this._candidateFilter=e}async setCandidates(e){let t=e;this._candidateFilter&&(t=await this._candidateFilter(e));const i=this.updateInResponseToCandidates(t);this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${Array.from(i.values()).map(n=>n.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(n=>{const o=Ig(n.host,n.port);i.set(o,{host:n.host,port:n.port,detail:n.detail,pid:n.pid}),t.has(o)&&t.delete(o);const r=vg(this.forwarded,n.host,n.port);r&&(r.runningProcess=n.detail,r.hasRunningProcess=!0,r.pid=n.pid)}),t.forEach((n,o)=>{const r=Wjt(o);if(!r)return;const a=vg(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=vg(this.detected,r.host,r.port);c&&(c.runningProcess=void 0,c.hasRunningProcess=!1,c.pid=void 0)}),t}get candidates(){return this._candidates?Array.from(this._candidates.values()):[]}get candidatesOrUndefined(){return this._candidates?this.candidates:void 0}async updateAttributes(){const e=Array.from(this.forwarded.values()),t=await this.getAttributes(e.map(i=>({port:i.remotePort,host:i.remoteHost})),!1);if(t)for(const i of e){const n=t.get(i.remotePort);(n?.protocol||i.protocol!==Mp.Http)&&n?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},n),n&&n.label&&n.label!==i.name&&await this.name(i.remoteHost,i.remotePort,n.label)}}async getAttributes(e,t=!0){const i=new Map,n=new Map;e.forEach(l=>{const d=vg(this._candidates??new Map,B$[0],l.port)??l;if(d){i.set(l.port,d);const h=Hjt(d)?d.pid:void 0;n.has(h)||n.set(h,[]),n.get(h)?.push(l.port)}});const o=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&o.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return o.size>0?o:void 0;const r=await Promise.all(this.portAttributesProviders.flatMap(l=>Array.from(n.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,He.None)}))),a=new Map;if(r.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!o&&!a)return;const c=new Map;return e.forEach(l=>{const d=o.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??Nie.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};U$.__decorator=D([ULe(1e3)],U$.prototype,"storeForwarded",null);U$=D([_(0,Hae),_(1,$i),_(2,Te),_(3,Jr),_(4,pC),_(5,yi),_(6,Ge),_(7,to),_(8,fs),_(9,Le)],U$);const v3e="remote.explorerType",b3e="remote.autoForwardPorts",w3e="remote.autoForwardPortsSource",y3e="output",Ujt="hybrid";var C3e;(function(s){s.Candidate="Candidate",s.Detected="Detected",s.Forwarded="Forwarded",s.Add="Add"})(C3e||(C3e={}));var S3e;(function(s){s[s.None=0]="None",s[s.New=1]="New",s[s.Label=2]="Label",s[s.LocalPort=3]="LocalPort"})(S3e||(S3e={}));const Vjt={type:"object",required:["id"],properties:{id:{description:g(3557,"The ID of a Get Started walkthrough to open."),type:"string"}}},zjt=eh.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(3558,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(3559,"The url, or a command that returns the url, to your project's Getting Started page, or a walkthrough ID contributed by your project's extension"),oneOf:[{type:"string"},Vjt]},documentation:{description:g(3560,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(3561,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(3562,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(3563,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(3564,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let A3e=class{constructor(e,t,i){this.storageService=e,this.tunnelService=t,this._targetType=[],this._onDidChangeTargetType=new I,this.onDidChangeTargetType=this._onDidChangeTargetType.event,this._onDidChangeHelpInformation=new I,this.onDidChangeHelpInformation=this._onDidChangeHelpInformation.event,this._helpInformation=[],this._onDidChangeEditable=new I,this.onDidChangeEditable=this._onDidChangeEditable.event,this._onEnabledPortsFeatures=new I,this.onEnabledPortsFeatures=this._onEnabledPortsFeatures.event,this._portsFeaturesEnabled=!1,this.namedProcesses=new Map,this._tunnelModel=i.createInstance(U$),zjt.setHandler(n=>{this._helpInformation.push(...n),this._onDidChangeHelpInformation.fire(n)})}get helpInformation(){return this._helpInformation}set targetType(e){const t=this._targetType.length>0?this._targetType[0]:"",i=e.length>0?e[0]:"";t!==i&&(this._targetType=e,this.storageService.store(v3e,this._targetType.toString(),Ie.WORKSPACE,an.MACHINE),this.storageService.store(v3e,this._targetType.toString(),Ie.PROFILE,an.USER),this._onDidChangeTargetType.fire(this._targetType))}get targetType(){return this._targetType}get tunnelModel(){return this._tunnelModel}forward(e,t){return this.tunnelModel.forward(e,t)}close(e,t){return this.tunnelModel.close(e.host,e.port,t)}setTunnelInformation(e){e?.features&&this.tunnelService.setTunnelFeatures(e.features),this.tunnelModel.addEnvironmentTunnels(e?.environmentTunnels)}setEditable(e,t,i){i?this._editable={tunnelItem:e,data:i,editId:t}:this._editable=void 0,this._onDidChangeEditable.fire(e?{tunnel:e,editId:t}:void 0)}getEditableData(e,t){return this._editable&&(!e&&e===this._editable.tunnelItem||e&&this._editable.tunnelItem?.remotePort===e.remotePort&&this._editable.tunnelItem.remoteHost===e.remoteHost&&this._editable.editId===t)?this._editable.data:void 0}setCandidateFilter(e){return e?(this.tunnelModel.setCandidateFilter(e),{dispose:()=>{this.tunnelModel.setCandidateFilter(void 0)}}):{dispose:()=>{}}}onFoundNewCandidates(e){this.tunnelModel.setCandidates(e)}restore(){return this.tunnelModel.restoreForwarded()}enablePortsFeatures(){this._portsFeaturesEnabled=!0,this._onEnabledPortsFeatures.fire()}get portsFeaturesEnabled(){return this._portsFeaturesEnabled}};A3e=D([_(0,$i),_(1,Hae),_(2,we)],A3e);let E3e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=n,this.configurationService=o,this.logService=r,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(Ye.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(b3e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue(w3e)!==y3e}async $setRemoteTunnelService(e){this.remoteExplorerService.namedProcesses.set(e,"Code Extension Host"),this.remoteExplorerService.portsFeaturesEnabled?this._proxy.$registerCandidateFinder(this.processFindingEnabled()):this._register(this.remoteExplorerService.onEnabledPortsFeatures(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled()))),this._register(this.configurationService.onDidChangeConfiguration(async t=>{if(t.affectsConfiguration(b3e)||t.affectsConfiguration(w3e))return this._proxy.$registerCandidateFinder(this.processFindingEnabled())})),this._register(this.tunnelService.onAddedTunnelProvider(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled())))}async $registerPortsAttributesProvider(e,t){this.portsAttributesProviders.set(t,e),this._alreadyRegistered||(this.remoteExplorerService.tunnelModel.addAttributesProvider(this),this._alreadyRegistered=!0)}async $unregisterPortsAttributesProvider(e){this.portsAttributesProviders.delete(e)}async providePortAttributes(e,t,i,n){if(this.portsAttributesProviders.size===0)return[];const o=Array.from(this.portsAttributesProviders.entries()).filter(r=>{const a=r[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&hr[0]);return o.length===0?[]:this._proxy.$providePortAttributes(o,e,t,i,n)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:hb.Extension,description:t},elevateIfNeeded:!1});if(!(!i||typeof i=="string"))return!this.elevateionRetry&&e.localAddressPort!==void 0&&i.tunnelLocalPort!==void 0&&this.tunnelService.isPortPrivileged(e.localAddressPort)&&i.tunnelLocalPort!==e.localAddressPort&&this.tunnelService.canElevate&&this.elevationPrompt(e,i,t),Mie.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(Xe.Info,g(4876,"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",i,e.remoteAddress.port,e.localAddressPort),[{label:g(4877,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},tL.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:hb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,tL.Other)}async $getTunnels(){return(await this.tunnelService.tunnels).map(e=>({remoteAddress:{port:e.tunnelRemotePort,host:e.tunnelRemoteHost},localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol}))}async $onFoundNewCandidates(e){this.remoteExplorerService.onFoundNewCandidates(e)}async $setTunnelProvider(e){const t={forwardPort:(i,n)=>this._proxy.$forwardPort(i,n).then(r=>{if(r){if(typeof r=="string")return r}else return;const a=r;return this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) New tunnel established by tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),{tunnelRemotePort:a.remoteAddress.port,tunnelRemoteHost:a.remoteAddress.host,localAddress:typeof a.localAddress=="string"?a.localAddress:Ig(a.localAddress.host,a.localAddress.port),tunnelLocalPort:typeof a.localAddress!="string"?a.localAddress.port:void 0,public:a.public,privacy:a.privacy,protocol:a.protocol??Mp.Http,dispose:async c=>(this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) Closing tunnel from tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),this._proxy.$closeTunnel({host:a.remoteAddress.host,port:a.remoteAddress.port},c))}})};e&&this.tunnelService.setTunnelFeatures(e),this.tunnelService.setTunnelProvider(t),this.contextKeyService.createKey(cst.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case YT.None:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case YT.Output:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":y3e}}]);break}case YT.Hybrid:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":Ujt}}]);break}}}).catch(()=>{})}};E3e=D([Gi(Be.MainThreadTunnelService),_(1,Xae),_(2,Hae),_(3,bi),_(4,Te),_(5,Ge),_(6,hg),_(7,Le)],E3e);function lst(s){return`onAuthenticationRequest:${s}`}let x3e=class extends V{constructor(e,t,i){super(),this._extensionService=e,this._environmentService=i,this._onDidRegisterAuthenticationProvider=this._register(new I),this.onDidRegisterAuthenticationProvider=this._onDidRegisterAuthenticationProvider.event,this._onDidUnregisterAuthenticationProvider=this._register(new I),this.onDidUnregisterAuthenticationProvider=this._onDidUnregisterAuthenticationProvider.event,this._onDidChangeSessions=this._register(new I),this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeDeclaredProviders=this._register(new I),this.onDidChangeDeclaredProviders=this._onDidChangeDeclaredProviders.event,this._authenticationProviders=new Map,this._authenticationProviderDisposables=this._register(new mo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(n=>{this._onDidChangeSessions.fire({providerId:n.providerId,label:n.accountName,event:{added:[],changed:[],removed:[]}})})),this._registerEnvContributedAuthenticationProviders()}get declaredProviders(){return this._declaredProviders}_registerEnvContributedAuthenticationProviders(){if(this._environmentService.options?.authenticationProviders?.length)for(const e of this._environmentService.options.authenticationProviders)this.registerAuthenticationProvider(e.id,e)}registerDeclaredAuthenticationProvider(e){if(Gu(e.id))throw new Error(g(2138,"An authentication contribution must specify an id."));if(Gu(e.label))throw new Error(g(2139,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(2140,"This authentication id '{0}' has already been registered",e.id));this._declaredProviders.push(e),this._onDidChangeDeclaredProviders.fire()}unregisterDeclaredAuthenticationProvider(e){const t=this.declaredProviders.findIndex(i=>i.id===e);t>-1&&this.declaredProviders.splice(t,1),this._onDidChangeDeclaredProviders.fire()}isAuthenticationProviderRegistered(e){return this._authenticationProviders.has(e)}registerAuthenticationProvider(e,t){this._authenticationProviders.set(e,t);const i=new Z;i.add(t.onDidChangeSessions(n=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:n}))),wN(t)&&i.add(t),this._authenticationProviderDisposables.set(e,i),this._onDidRegisterAuthenticationProvider.fire({id:e,label:t.label})}unregisterAuthenticationProvider(e){const t=this._authenticationProviders.get(e);t&&(this._authenticationProviders.delete(e),this._onDidUnregisterAuthenticationProvider.fire({id:e,label:t.label})),this._authenticationProviderDisposables.deleteAndDispose(e)}getProviderIds(){const e=[];return this._authenticationProviders.forEach(t=>{e.push(t.id)}),e}getProvider(e){if(this._authenticationProviders.has(e))return this._authenticationProviders.get(e);throw new Error(`No authentication provider '${e}' is currently registered.`)}async getAccounts(e){const t=await this.getSessions(e),i=new Array,n=new Set;for(const o of t)n.has(o.account.label)||(n.add(o.account.label),i.push(o.account));return i}async getSessions(e,t,i,n=!1){const o=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,n);if(o)return await o.getSessions(t,{account:i});throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const n=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(n)return await n.createSession(t,{account:i?.account});throw new Error(`No authentication provider '${e}' is currently registered.`)}async removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return i.removeSession(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async tryActivateProvider(e,t){await this._extensionService.activateByEvent(lst(e),t?Nb.Immediate:Nb.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const n=new Z,o=new Promise((a,c)=>{n.add(M.once(this.onDidRegisterAuthenticationProvider)(l=>{if(l.id===e)if(i=this._authenticationProviders.get(e),i)a(i);else throw new Error(`No authentication provider '${e}' is currently registered.`)}))}),r=new Promise((a,c)=>{const l=setTimeout(()=>{c("Timed out waiting for authentication provider to register")},5e3);n.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>n.dispose())}};x3e=D([_(0,fs),_(1,Qae),_(2,hv)],x3e);class $jt extends V{constructor(e,t,i,n,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=n,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e,t){return this._proxy.$getSessions(this.id,e,t)}createSession(e,t){return this._proxy.$createSession(this.id,e,t)}async removeSession(e){await this._proxy.$removeSession(this.id,e),this.notificationService.info(g(4878,"Successfully signed out."))}}let D3e=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=n,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const n=new I;this._registrations.set(e,n);const o=new $jt(this._proxy,e,t,i,this.notificationService,n);this.authenticationService.registerAuthenticationProvider(e,o)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(lst(e),Nb.Immediate)}$sendDidChangeSessions(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$removeSession(e,t){return this.authenticationService.removeSession(e,t)}async loginPrompt(e,t,i,n){let o;e.id.startsWith(zce)?o=g(4879,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(4880,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(4881,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(4882,"&&Allow"),run(){return!0}}];n?.learnMore&&r.push({label:g(4883,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,n);return await this.openerService.open(N.revive(n.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:Xe.Info,message:o,buttons:r,detail:n?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,n,o){const r=await this.authenticationService.getSessions(e,t,o.account,!0),a=this.authenticationService.getProvider(e);if(o.forceNewSession&&o.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(o.forceNewSession&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(o.createIfNone&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(o.clearSessionPreference&&this.authenticationExtensionsService.removeSessionPreference(e,i,t),!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts){const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=r.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,r[0].account.label,i))return r[0]}if(o.createIfNone||o.forceNewSession){let l;typeof o.forceNewSession=="object"&&(l=o.forceNewSession);const d=!!(o.forceNewSession&&r.length);if(!await this.loginPrompt(a,n,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts&&!o.account?await this.authenticationExtensionsService.selectSession(e,i,n,t,r):r[0];else{let f=o.account;if(!f){const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p)?.account:void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,account:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:n,allowed:!0}]),this.authenticationExtensionsService.updateSessionPreference(e,i,u),u}const c=r.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;o.silent||(r.length?this.authenticationExtensionsService.requestSessionAccess(e,i,n,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,n))}async $getSession(e,t,i,n,o){const r=await this.doGetSession(e,t,i,n,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,n)),r}async $getAccounts(e){return await this.authenticationService.getAccounts(e)}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};D3e=D([Gi(Be.MainThreadAuthentication),_(1,sMe),_(2,nXe),_(3,Qae),_(4,iXe),_(5,to),_(6,bi),_(7,fs),_(8,Yi),_(9,Ao)],D3e);let k3e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(Ye.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let n=i.get(e.id);n===void 0&&(n=new I,i.set(e.id,n)),this._timelineService.registerTimelineProvider({...e,onDidChange:n.event,async provideTimeline(o,r,a){return Mo(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),n?.dispose()}})}$unregisterTimelineProvider(e){this.logService.trace(`MainThreadTimeline#unregisterTimelineProvider: id=${e}`),this._timelineService.unregisterTimelineProvider(e)}$emitTimelineChangeEvent(e){this.logService.trace(`MainThreadTimeline#emitChangeEvent: id=${e.id}, uri=${e.uri?.toString(!0)}`),this._providerEmitters.get(e.id)?.fire(e)}dispose(){}};k3e=D([Gi(Be.MainThreadTimeline),_(1,Ge),_(2,XJe)],k3e);let dst=0;class Gjt{constructor(e,t,i,n){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=n,this.fileCoverage=new ui,this.didAddCoverage=gC(this),this.tree=new xte,this.associatedData=new Map}*allPerTestIDs(){const e=new Set;for(const t of this.tree.nodes)if(t.value&&t.value.perTestData)for(const i of t.value.perTestData)e.has(i)||(e.add(i),yield i)}append(e,t){const i=this.getComputedForUri(e.uri),n=this.result,o=(c,l)=>{l[c]?(l[c].covered+=(e[c]?.covered||0)-(i?.[c]?.covered||0),l[c].total+=(e[c]?.total||0)-(i?.[c]?.total||0)):e[c]&&(l[c]={...e[c]})},r=[...this.treePathForUri(e.uri,!0)],a=[];this.tree.mutatePath(this.treePathForUri(e.uri,!1),c=>{if(a.push(c),a.length===r.length)if(c.value){const l=c.value;l.id=e.id,l.statement=e.statement,l.branch=e.branch,l.declaration=e.declaration}else{const l=c.value=new I3e(e,n,this.accessor);this.fileCoverage.set(e.uri,l)}else if(c.value)o("statement",c.value),o("branch",c.value),o("declaration",c.value),c.value.didChange.trigger(t);else{const l=xs(e);l.id=String(dst++),l.uri=this.treePathToUri(r.slice(0,a.length)),c.value=new ust(l,n)}if(e.testIds){c.value.perTestData??=new Set;for(const l of e.testIds)c.value.perTestData.add(l)}}),a&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new xte;for(const i of this.tree.values())if(i instanceof I3e){if(!i.perTestData?.has(e.toString()))continue;const n=[...this.treePathForUri(i.uri,!0)],o=[];t.mutatePath(this.treePathForUri(i.uri,!1),r=>{o.push(r),r.value??=new qjt(this.treePathToUri(n.slice(0,o.length)),i.fromResult)})}return t}getAllFiles(){return this.fileCoverage}getUri(e){return this.fileCoverage.get(e)}getComputedForUri(e){return this.tree.find(this.treePathForUri(e,!1))}*treePathForUri(e,t){yield e.scheme,yield e.authority,yield*(!t&&this.uriIdentityService.extUri.ignorePathCasing(e)?e.path.toLowerCase():e.path).split("/")}treePathToUri(e){return N.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const Kjt=(s,e,t)=>{let i=s.covered,n=s.total;return e&&(i+=e.covered,n+=e.total),t&&(i+=t.covered,n+=t.total),n===0?1:i/n};class hst{get tpc(){return Kjt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=gC(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class ust extends hst{}class qjt extends ust{constructor(e,t){super({id:String(dst++),uri:e,statement:{covered:0,total:0}},t)}}class I3e extends hst{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async detailsForTest(e,t=He.None){this._detailsForTest??=new Map;const i=e.toString(),n=this._detailsForTest.get(i);if(n)return n;const o=(async()=>{try{return await this.accessor.getCoverageDetails(this.id,i,t)}catch(r){throw this._detailsForTest?.delete(i),r}})();return this._detailsForTest.set(i,o),o}async details(e=He.None){this._details??=this.accessor.getCoverageDetails(this.id,void 0,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const k_={[Hn.Running]:6,[Hn.Errored]:5,[Hn.Failed]:4,[Hn.Queued]:3,[Hn.Passed]:2,[Hn.Unset]:0,[Hn.Skipped]:1};brt(k_,(s,e)=>({statusNode:!0,state:Number(e),priority:s}));const Qjt=(s,e)=>k_[e]-k_[s],gst=(...s)=>{switch(s.length){case 0:return Hn.Unset;case 1:return s[0];case 2:return k_[s[0]]>k_[s[1]]?s[0]:s[1];default:{let e=s[0];for(let t=1;tNumber(s)).sort(Qjt),T3e={[Hn.Passed]:0,[Hn.Skipped]:1,[Hn.Failed]:2,[Hn.Errored]:3},fst=()=>new Uint32Array(jjt.length),Yjt=s=>"getOwnDuration"in s,oDe=(s,e,t=!1)=>{let i=s.getCurrentComputedState(e);if(i===void 0||t){i=s.getOwnState(e)??Hn.Unset;let n=0;const o=fst();for(const r of s.getChildren(e)){const a=oDe(s,r);n++,o[a]++,i=a===Hn.Skipped&&i===Hn.Unset?Hn.Skipped:gst(i,a)}n>Jjt&&mst.set(e,o),s.setComputedState(e,i)}return i},pst=(s,e,t=!1)=>{let i=s.getCurrentComputedDuration(e);if(i===void 0||t){const n=s.getOwnDuration(e);if(n!==void 0)i=n;else{i=void 0;for(const o of s.getChildren(e)){const r=pst(s,o);r!==void 0&&(i=(i||0)+r)}}s.setComputedDuration(e,i)}return i},Jjt=64,mst=new WeakMap,Xjt=(s,e,t,i=!0)=>{const n=s.getCurrentComputedState(e),o=k_[n],r=oDe(s,e,!0),a=k_[r],c=new Set;if(a!==o){s.setComputedState(e,r),c.add(e);let l=n,d=r;for(const h of s.getParents(e)){const u=mst.get(h);u&&(u[l]--,u[d]++);const f=s.getCurrentComputedState(h);if(a>o){if(f!==void 0&&k_[f]>=a||u&&u[d]>1)break;s.setComputedState(h,r),c.add(h)}else{if(f===void 0||k_[f]>o||u&&u[l]>0)break;d=oDe(s,h,!0),s.setComputedState(h,d),c.add(h)}l=f}}if(Yjt(s)&&i)for(const l of hi.concat(hi.single(e),s.getParents(e))){const d=s.getCurrentComputedDuration(l),h=pst(s,l,!0);if(d===h)break;s.setComputedDuration(l,h),c.add(l)}return c};M.None,Promise.resolve();class Zjt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new dc,this.offset=0,this.onDidWriteData=this.writeDataEmitter.event,this.endPromise=this.endDeferred.p,this.buffers=[]}get length(){return this.offset}getRange(e,t){const i=$e.alloc(t);let n=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,n),n+=o.byteLength;return n0;c--){const l=e.buffer[c-1];if(l!==o.CR&&l!==o.LF)break}return this.push(e.slice(0,c)),this.push(a),this.push(e.slice(c)),{offset:i,length:n}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const L3e=(s,e)=>`\x1B]633;SetMark;Id=${iQt(s,e)};Hidden\x07`,eYt=(s,e,t)=>({controllerId:s,expand:Ld.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Hn.Unset,computedState:Hn.Unset});var s1;(function(s){s[s.ComputedStateChange=0]="ComputedStateChange",s[s.OwnStateChange=1]="OwnStateChange",s[s.NewMessage=2]="NewMessage"})(s1||(s1={}));let MF=class extends V{get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,n){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=n,this.completeEmitter=this._register(new I),this.newTaskEmitter=this._register(new I),this.endTaskEmitter=this._register(new I),this.changeEmitter=this._register(new I),this.testById=new Map,this.testMarkerCounter=0,this.startedAt=Date.now(),this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.onNewTask=this.newTaskEmitter.event,this.onEndTask=this.endTaskEmitter.event,this.tasks=[],this.name=g(7626,"Test run at {0}",new Date().toLocaleString(ql)),this.counts=fst(),this.computedStateAccessor={getOwnState:o=>o.ownComputedState,getCurrentComputedState:o=>o.computedState,setComputedState:(o,r)=>o.computedState=r,getChildren:o=>o.children,getParents:o=>{const{testById:r}=this;return function*(){const a=vn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(Tte.serializeWithoutMessages)})),this.doSerializeWithMessages=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(Tte.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,n){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(n||i)&&(r=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,r),h={location:i,message:o,offset:l,length:d,marker:r,type:O_.Output},u=n&&this.testById.get(n);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:s1.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:jt(this,void 0),otherMessages:[],output:new Zjt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Hn.Unset});this.newTaskEmitter.fire(this.tasks.length-1)}addTestChainToRun(e,t){let i=this.testById.get(t[0].extId);i||(i=this.addTestToRun(e,t[0],null));for(let n=1;nn.state===Hn.Queued||n.state===Hn.Running),this.endTaskEmitter.fire(t)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const e of this.tasks)e.running&&this.markTaskComplete(e.id);this._completedAt=Date.now(),this.completeEmitter.fire(),this.telemetry.publicLog2("test.outcomes",{failures:this.counts[Hn.Errored]+this.counts[Hn.Failed],passes:this.counts[Hn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(vn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:s1.ComputedStateChange,item:i,result:this}))}toJSON(){return this.completedAt&&this.persist?this.doSerialize.value:void 0}toJSONWithMessages(){return this.completedAt&&this.persist?this.doSerializeWithMessages.value:void 0}setAllToState(e,t,i){const n=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[n],o)&&this.fireUpdateAndRefresh(o,n,e)}fireUpdateAndRefresh(e,t,i,n){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:s1.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,n!==void 0&&(e.tasks[t].duration=n,e.ownDuration=Math.max(e.ownDuration||0,n));const c=gst(...e.tasks.map(l=>l.state));if(c===o){n!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,Xjt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:s1.ComputedStateChange}))}addTestToRun(e,t,i){const n=eYt(e,t);if(this.testById.set(t.extId,n),this.counts[Hn.Unset]++,i&&this.testById.get(i)?.children.push(n),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};MF=D([_(3,Yi)],MF);let R3e=class extends V{constructor(e,t,i,n,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=n,this.resultService=o,this.diffListener=this._register(new wn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(Ye.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(r,a)=>this.proxy.$provideTestFollowups(r,a),executeTestFollowup:r=>this.proxy.$executeTestFollowup(r),disposeTestFollowups:r=>this.proxy.$disposeTestFollowups(r),getTestsRelatedToCode:(r,a,c)=>this.proxy.$getTestsRelatedToCode(r,a,c)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(M.debounce(n.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Kh.Run,Kh.Debug,Kh.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))r[c.controllerId]??=[],r[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(r)})),this._register(o.onResultsChanged(r=>{if("completed"in r){const a=r.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in r&&r.removed.forEach(a=>{a instanceof MF&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new xte;for(const i of e)t.insert(vn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof MF&&i.markRetired(t)}$publishTestRunProfile(e){const t=this.testProviderRegistrations.get(e.controllerId);t&&this.testProfiles.addProfile(t.instance,e)}$updateTestRunConfig(e,t,i){this.testProfiles.updateProfile(e,t,i)}$removeTestProfile(e,t){this.testProfiles.removeProfile(e,t)}$addTestsToRun(e,t,i){this.withLiveRun(t,n=>n.addTestChainToRun(e,i.map(o=>m$.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,n=>{const o=n.tasks.find(a=>a.id===t);if(!o)return;const r=REe.deserialize(this.uriIdentityService,i);ts(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new Gjt(n,t,this.uriIdentityService,{getCoverageDetails:(l,d,h)=>this.proxy.$getCoverageDetails(l,d,h).then(u=>u.map(MEe.deserialize))}),c.append(r,a),o.coverage.set(c,a))})})}$startedExtensionTestRun(e){this.resultService.createLiveResult(e)}$startedTestRunTask(e,t){this.withLiveRun(e,i=>i.addTask(t))}$finishedTestRunTask(e,t){this.withLiveRun(e,i=>i.markTaskComplete(t))}$finishedExtensionTestRun(e){this.withLiveRun(e,t=>t.markComplete())}$updateTestStateInRun(e,t,i,n,o){this.withLiveRun(e,r=>r.updateState(i,t,n,o))}$appendOutputToRun(e,t,i,n,o){const r=n&&{uri:N.revive(n.uri),range:F.lift(n.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,n){const o=this.resultService.getResult(e);if(o&&o instanceof MF)for(const r of n)o.appendMessage(i,t,p$.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const n=new Z,o=jt(`${e}.label`,t),r=jt(`${e}.cap`,i),a={id:e,label:o,capabilities:r,syncTests:()=>this.proxy.$syncTests(),refreshTests:c=>this.proxy.$refreshTests(e,c),configureRunProfile:c=>this.proxy.$configureRunProfile(e,c),runTests:(c,l)=>this.proxy.$runControllerTests(c,l),startContinuousRun:(c,l)=>this.proxy.$startContinuousRun(c,l),expandTest:(c,l)=>this.proxy.$expandTest(c,isFinite(l)?l:-1),getRelatedCode:(c,l)=>this.proxy.$getCodeRelatedToTest(c,l).then(d=>d.map(h=>({uri:N.revive(h.uri),range:F.lift(h.range)})))};n.add(Ee(()=>this.testProfiles.removeProfile(e))),n.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,capabilities:r,disposable:n})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&ts(n=>{t.label!==void 0&&i.label.set(t.label,n),t.capabilities!==void 0&&i.capabilities.set(t.capabilities,n)})}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(MH.serialize)),this.diffListener.value=this.testService.onDidProcessDiff(this.proxy.$acceptDiff,this.proxy)}$unsubscribeFromDiffs(){this.diffListener.clear()}$publishDiff(e,t){this.testService.publishDiff(e,t.map(i=>MH.deserialize(this.uriIdentityService,i)))}async $runTests(e,t){return(await this.testService.runResolvedTests(e,t)).id}dispose(){super.dispose();for(const e of this.testProviderRegistrations.values())e.disposable.dispose();this.testProviderRegistrations.clear()}withLiveRun(e,t){const i=this.resultService.getResult(e);return i&&i instanceof MF?t(i):void 0}};R3e=D([Gi(Be.MainThreadTesting),_(1,ks),_(2,JJe),_(3,jJe),_(4,YJe)],R3e);let M3e=class extends V{constructor(e,t,i,n){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Tlt,this._proxy=e.getProxy(Ye.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(o=>{try{const{extensionId:r,key:a}=this.parseKey(o);r&&a&&this._proxy.$onDidChangePassword({extensionId:r,key:a})}catch{}}))}$getPassword(e,t){return this.logService.trace(`[mainThreadSecretState] Getting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doGetPassword(e,t))}async doGetPassword(e,t){const i=this.getKey(e,t),n=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${n?"P":"No p"}assword found for: `,e,t),n}$setPassword(e,t,i){return this.logService.trace(`[mainThreadSecretState] Setting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doSetPassword(e,t,i))}async doSetPassword(e,t,i){const n=this.getKey(e,t);await this.secretStorageService.set(n,i),this.logService.trace("[mainThreadSecretState] Password set for: ",e,t)}$deletePassword(e,t){return this.logService.trace(`[mainThreadSecretState] Deleting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doDeletePassword(e,t))}async doDeletePassword(e,t){const i=this.getKey(e,t);await this.secretStorageService.delete(i),this.logService.trace("[mainThreadSecretState] Password deleted for: ",e,t)}getKey(e,t){return JSON.stringify({extensionId:e,key:t})}parseKey(e){return JSON.parse(e)}};M3e=D([Gi(Be.MainThreadSecretState),_(1,gJe),_(2,Ge),_(3,hv)],M3e);let N3e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(Ye.ExtHostShare)}$registerShareProvider(e,t,i,n,o){const r={id:i,label:n,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,He.None);return typeof l=="string"?l:N.revive(l)}};this.providers.set(e,r);const a=this.shareService.registerShareProvider(r);this.providerDisposables.set(e,a)}$unregisterShareProvider(e){this.providers.has(e)&&this.providers.delete(e),this.providerDisposables.has(e)&&this.providerDisposables.delete(e)}dispose(){this.providers.clear(),bt(this.providerDisposables.values()),this.providerDisposables.clear()}};N3e=D([Gi(Be.MainThreadShare),_(1,HJe)],N3e);let P3e=class extends V{constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new mo),this.proxy=e.getProxy(Ye.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,n){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:n,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Mo(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};P3e=D([Gi(Be.MainThreadProfileContentHandlers),_(1,fXe)],P3e);let F3e=class extends V{constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,He.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(n,o)=>this._proxy.$provideAiRelatedInformation(e,n,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};F3e=D([Gi(Be.MainThreadAiRelatedInformation),_(1,nMe)],F3e);let O3e=class extends V{constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(n,o)=>this._proxy.$provideAiEmbeddingVector(t,n,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};O3e=D([Gi(Be.MainThreadAiEmbeddingVector),_(1,eXe)],O3e);let rDe=class extends Dee{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(t,i,n,o,r,a,c,l,d,h,u,f,p),this.workerConfig=e}async _getWebWorkerExtensionHostIframeSrc(){const e=new URL(await super._getWebWorkerExtensionHostIframeSrc(),window.location.href);return e.searchParams.set("vscodeExtHostWorkerSrc",this.workerConfig.url),this.workerConfig.options!=null&&e.searchParams.set("vscodeExtHostWorkerOptions",JSON.stringify(this.workerConfig.options)),e.searchParams.set("parentOrigin",window.origin),e.toString()}};rDe=D([_(4,Yi),_(5,yi),_(6,Fs),_(7,Ge),_(8,uf),_(9,hv),_(10,Em),_(11,Er),_(12,pu),_(13,$i)],rDe);let aDe;function tYt(s){aDe=s}let cDe=class extends LAe{constructor(e,t,i,n,o,r,a,c,l){super(t,i,n,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return aDe==null?null:this._instantiationService.createInstance(aDe,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const n=i?2:1;return this._instantiationService.createInstance(rDe,this.workerConfig,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};cDe=D([_(4,we),_(5,hg),_(6,pC),_(7,Nl),_(8,Ge)],cDe);let lDe=class extends RAe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,n,o){const r=qKt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,n,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};lDe=D([_(1,Ge)],lDe);let dDe=class extends TAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k){const P=t.createInstance(yAe),R=new cDe(e,P,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,w,r,p);super(P,R,new lDe(e!=null?[2,1,3]:[1,3],p),t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new S0(e,t))}};dDe=D([_(1,we),_(2,bi),_(3,hv),_(4,Yi),_(5,Nl),_(6,Jt),_(7,Er),_(8,P6),_(9,yi),_(10,Te),_(11,Im),_(12,rMe),_(13,Ge),_(14,hg),_(15,Bae),_(16,ig),_(17,pC),_(18,tce),_(19,ug),_(20,uC),_(21,Xae),_(22,to)],dDe);class iYt extends MAe{async readExtensionResource(e){return e.scheme===hee.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}v9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>_9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function nYt(s,e){return{[fs.toString()]:new wi(dDe,[void 0],!1),[Im.toString()]:new wi(wAe,[],!0),[Fae.toString()]:new wi(iYt,[],!0),[WU.toString()]:new wi(PAe,[],!0)}}const B3e=/^([^.]+\..+)[:=](.+)$/;class Yt{get remoteAuthority(){return this.options.remoteAuthority}get expectsResolverExtension(){return!!this.options.remoteAuthority?.includes("+")&&!this.options.webSocketFactory}get isBuilt(){return!!this.productService.commit}get logLevel(){const e=this.payload?.get("logLevel");return e?e.split(",").find(t=>!B3e.test(t)):this.options.developmentOptions?.logLevel!==void 0?r3(this.options.developmentOptions?.logLevel):void 0}get extensionLogLevel(){const e=this.payload?.get("logLevel");if(e){const t=[];for(const i of e.split(",")){const n=B3e.exec(i);n&&n[1]&&n[2]&&t.push([n[1],n[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,r3(i)]):void 0}get profDurationMarkers(){const e=this.payload?.get("profDurationMarkers");if(e){const t=[];for(const i of e.split(","))t.push(i);return t.length===2?t:void 0}}get windowLogsPath(){return this.logsHome}get logFile(){return Pt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return N.file("/User").with({scheme:pe.vscodeUserData})}get argvResource(){return Pt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Pt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Pt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Pt(this.userRoamingDataHome,"History")}get stateResource(){return Pt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Pt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Pt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Pt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Pt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Pt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Pt(this.extHostLogsPath,"extensionTelemetry.log")}get debugExtensionHost(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.params}get isExtensionDevelopment(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.isExtensionDevelopment}get extensionDevelopmentLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentLocationURI}get extensionDevelopmentLocationKind(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentKind}get extensionTestsLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionTestsLocationURI}get extensionEnabledProposedApi(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionEnabledProposedApi}get debugRenderer(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.debugRenderer}get enableSmokeTestDriver(){return this.options.developmentOptions?.enableSmokeTestDriver}get disableExtensions(){return this.payload?.get("disableExtensions")==="true"}get enableExtensions(){return this.options.enabledExtensions}get webviewExternalEndpoint(){const e=this.options.webviewEndpoint||this.productService.webviewContentExternalBaseUrlTemplate||"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/",t=this.payload?.get("webviewExternalEndpointCommit");return e.replace("{{commit}}",t??this.productService.commit??"ef65ac1ba57f57f2a3961bfe94aa20481caca4c6").replace("{{quality}}",(t?"insider":this.productService.quality)??"insider")}get extensionTelemetryLogResource(){return Pt(this.logsHome,"extensionTelemetry.log")}get disableTelemetry(){return!1}get verbose(){return this.payload?.get("verbose")==="true"}get logExtensionHostCommunication(){return this.payload?.get("logExtensionHostCommunication")==="true"}get skipReleaseNotes(){return this.payload?.get("skipReleaseNotes")==="true"}get skipWelcome(){return this.payload?.get("skipWelcome")==="true"}get disableWorkspaceTrust(){return!this.options.enableWorkspaceTrust}get lastActiveProfile(){return this.payload?.get("lastActiveProfile")}constructor(e,t,i,n){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=n,this.extensionHostDebugEnvironment=void 0,this.editSessionId=this.options.editSessionId,i.workspaceProvider&&Array.isArray(i.workspaceProvider.payload))try{this.payload=new Map(i.workspaceProvider.payload)}catch(o){vt(o)}}resolveExtensionHostDebugEnvironment(){const e={params:{port:null,break:!1},debugRenderer:!1,isExtensionDevelopment:!1,extensionDevelopmentLocationURI:void 0,extensionDevelopmentKind:void 0};if(this.payload)for(const[i,n]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(N.parse(n)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[n];break;case"extensionTestsPath":e.extensionTestsLocationURI=N.parse(n);break;case"debugRenderer":e.debugRenderer=n==="true";break;case"debugId":e.params.debugId=n;break;case"inspect-brk-extensions":e.params.port=parseInt(n),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(n);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>N.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=N.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=N.parse(e);if(this.payload.has("gotoLineMode")){const i=AGe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:Ya(i.line)?void 0:{startLineNumber:i.line,startColumn:i.column||1}}}]}return[{fileUri:t}]}}}get filesToDiff(){if(this.payload){const e=this.payload.get("diffFilePrimary"),t=this.payload.get("diffFileSecondary");if(e&&t)return[{fileUri:N.parse(t)},{fileUri:N.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),n=this.payload.get("mergeFileResult");if(e&&t&&i&&n)return[{fileUri:N.parse(e)},{fileUri:N.parse(t)},{fileUri:N.parse(i)},{fileUri:N.parse(n)}]}}}Yt.__decorator=D([Zt],Yt.prototype,"remoteAuthority",null);Yt.__decorator=D([Zt],Yt.prototype,"expectsResolverExtension",null);Yt.__decorator=D([Zt],Yt.prototype,"isBuilt",null);Yt.__decorator=D([Zt],Yt.prototype,"logLevel",null);Yt.__decorator=D([Zt],Yt.prototype,"windowLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"logFile",null);Yt.__decorator=D([Zt],Yt.prototype,"userRoamingDataHome",null);Yt.__decorator=D([Zt],Yt.prototype,"argvResource",null);Yt.__decorator=D([Zt],Yt.prototype,"cacheHome",null);Yt.__decorator=D([Zt],Yt.prototype,"workspaceStorageHome",null);Yt.__decorator=D([Zt],Yt.prototype,"localHistoryHome",null);Yt.__decorator=D([Zt],Yt.prototype,"stateResource",null);Yt.__decorator=D([Zt],Yt.prototype,"userDataSyncHome",null);Yt.__decorator=D([Zt],Yt.prototype,"sync",null);Yt.__decorator=D([Zt],Yt.prototype,"keyboardLayoutResource",null);Yt.__decorator=D([Zt],Yt.prototype,"untitledWorkspacesHome",null);Yt.__decorator=D([Zt],Yt.prototype,"serviceMachineIdResource",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostTelemetryLogFile",null);Yt.__decorator=D([Zt],Yt.prototype,"debugExtensionHost",null);Yt.__decorator=D([Zt],Yt.prototype,"isExtensionDevelopment",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationKind",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTestsLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionEnabledProposedApi",null);Yt.__decorator=D([Zt],Yt.prototype,"debugRenderer",null);Yt.__decorator=D([Zt],Yt.prototype,"enableSmokeTestDriver",null);Yt.__decorator=D([Zt],Yt.prototype,"disableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"enableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"webviewExternalEndpoint",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTelemetryLogResource",null);Yt.__decorator=D([Zt],Yt.prototype,"disableTelemetry",null);Yt.__decorator=D([Zt],Yt.prototype,"verbose",null);Yt.__decorator=D([Zt],Yt.prototype,"logExtensionHostCommunication",null);Yt.__decorator=D([Zt],Yt.prototype,"skipReleaseNotes",null);Yt.__decorator=D([Zt],Yt.prototype,"skipWelcome",null);Yt.__decorator=D([Zt],Yt.prototype,"disableWorkspaceTrust",null);Yt.__decorator=D([Zt],Yt.prototype,"lastActiveProfile",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToOpenOrCreate",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToDiff",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToMerge",null);let hDe=class extends Yt{constructor(e=gNe().id,t=u4t(),i){super(e,ltt,t,i)}};hDe=D([_(2,Er)],hDe);function sYt(s){return{[Za.toString()]:new wi(hDe,[void 0,s],!0)}}class _st extends V{constructor(e=h4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=M.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidRemoveContainer=this._register(new I),this.onDidRemoveContainer=this._onDidRemoveContainer.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0},this.onDidChangeFullscreen=M.None,this.onDidChangeZenMode=M.None,this.onDidChangeWindowMaximized=M.None,this.onDidChangeCenteredLayout=M.None,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangeSideBarPosition=this._register(new I),this.onDidChangeSideBarPosition=this._onDidChangeSideBarPosition.event,this.onDidChangePanelAlignment=M.None,this.onDidChangeNotificationsVisibility=M.None,this.openedDefaultEditors=!1,this.whenRestored=Promise.resolve(),this.parts=new Map,this.hiddenParts=new Set,this._onDidChangePartVisibility=new I,this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this.offset={top:0,quickPickTop:0},this._onDidLayout=new I,this.onDidLayout=this._onDidLayout.event,window.addEventListener("resize",()=>this.layout()),this.layout();const t=Qn?"windows":pr?"linux":"mac",i=Fi(["monaco-workbench",t,"web",$1e?"chromium":M6e?"firefox":N6e?"safari":void 0]);e.classList.add(...i),document.body.classList.add(t),document.body.classList.add("web")}whenContainerStylesLoaded(){}hasMainWindowBorder(){return!1}getMainWindowBorderRadius(){}isMainEditorLayoutCentered(){return!1}centerMainEditorLayout(){}get activeContainer(){return this.getContainerFromDocument(Hu())}get containers(){const e=[];for(const{window:t}of D8())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}init(e){this.editorGroupService=e.get(Po),this.paneCompositeService=e.get(Tm),this.statusBarService=e.get(QRe),this.viewDescriptorService=e.get(xm),this.configurationService=e.get(Te),this.auxiliaryWindowService=e.get(sXe),this.hostService=e.get(xc),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("workbench.activityBar.location")&&this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),t.affectsConfiguration("workbench.statusBar.visible")&&this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),t.affectsConfiguration("workbench.sideBar.location")&&this.setSideBarPosition(RK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(RK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"))})),this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),this.sideBarPosition=RK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=RK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:t,disposables:i})=>{this._onDidAddContainer.fire({container:t.container,disposables:new Z}),i.add(t.onDidLayout(n=>this.handleContainerDidLayout(t.container,n))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),kdt(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return ct(e).vscodeWindowId}onActiveWindowChanged(){const e=this.getActiveContainerId();this.activeContainerId!==e&&(this.activeContainerId=e,this._onDidChangeActiveContainer.fire())}isActivityBarHidden(){const e=this.configurationService.getValue("workbench.activityBar.visible");return e!==void 0?!e:this.configurationService.getValue("workbench.activityBar.location")!=="default"}focusPart(e){switch(e){case"workbench.parts.editor":this.editorGroupService.activeGroup.focus();break;case"workbench.parts.panel":{this.paneCompositeService.getActivePaneComposite(1)?.focus();break}case"workbench.parts.sidebar":{this.paneCompositeService.getActivePaneComposite(0)?.focus();break}case"workbench.parts.activitybar":this.getPart("workbench.parts.activitybar").focus();break;case"workbench.parts.statusbar":this.statusBarService.focus();break;default:this.getContainer(e)?.focus()}}getDimension(e){return this.getPart(e)?.dimension}toggleMaximizedPanel(){}toggleMenuBar(){let e=c4t(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=dNe(this.configurationService)==="native"?"toggle":"compact":t="classic",this.configurationService.updateValue("window.menuBarVisibility",t)}setPanelPosition(e){this.panelPosition=e,this.getPart("workbench.parts.panel")?.updateStyles(),this._onDidChangePanelPosition.fire(B1(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new bn(1/0,1/0)}isPanelMaximized(){return!1}getPanelPosition(){return this.panelPosition}hasFocus(e){const t=document.activeElement;if(t==null)return!1;const i=this.getContainer(e);return i!=null&&xdt(t,i)}getContainer(e){return typeof e=="string"?this.parts.get(e)==null?void 0:this.getPart(e)?.getContainer():e.document===this.mainContainer.ownerDocument?this.mainContainer:e.document.body.getElementsByClassName("monaco-workbench")[0]}getPart(e){return this.parts.get(e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(t==null)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i==null?!1:i.activeViewDescriptors.length>=1}setPartHidden(e,t){e?this.hiddenParts.add(t):this.hiddenParts.delete(t),this._onDidChangePartVisibility.fire();const i={"workbench.parts.sidebar":0,"workbench.parts.auxiliarybar":2,"workbench.parts.panel":1}[t];if(i!=null){const n=this.paneCompositeService.getActivePaneComposite(i);if(n!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(n==null&&!e){let o=this.paneCompositeService.getLastActivePaneCompositeId(i);(o==null||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(i).find(r=>this.hasViews(r.id))?.id),o!=null&&this.paneCompositeService.openPaneComposite(o,i,!0)}}this.getPart(t)?.setVisible(!e)}isVisible(e){return!this.hiddenParts.has(e)}getSideBarPosition(){return this.sideBarPosition}setSideBarPosition(e){this.sideBarPosition=e;const t=this.getPart("workbench.parts.activitybar"),i=this.getPart("workbench.parts.sidebar"),n=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),n?.updateStyles(),this._onDidChangeSideBarPosition.fire(B1(e))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ee(()=>this.parts.delete(t))}isRestored(){return!0}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){const e=this.activeContainer;return e===this.mainContainer?this.mainContainerDimension:z_(e)}layout(){this._mainContainerDimension=z_(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Dt.get(Kt).getFocusedCodeEditor();t instanceof Yk?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}utt(s=>{const e=s.get(pu);e instanceof _st&&e.init(s)});function oYt(s){return{[pu.toString()]:new wi(_st,[s],!0)}}var Km;(function(s){s[s.Unknown=1]="Unknown",s[s.Keyboard=2]="Keyboard",s[s.Api=3]="Api"})(Km||(Km={}));let $A=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=n,this.environmentService=o,this.instantiationService=r,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=Km.Unknown,o.options?.workspaceProvider?this.workspaceProvider=o.options.workspaceProvider:this.workspaceProvider=new class{constructor(){this.workspace=void 0,this.trusted=void 0}async open(){return!0}},this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>this.onBeforeShutdown(e))),this._register(pb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case Km.Unknown:case Km.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===Km.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=Km.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==Km.Api&&(pb.getInstance().isModifierPressed?this.shutdownReason=Km.Keyboard:this.shutdownReason=Km.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=i.add(Ac(t)),o=i.add(new ii(t.document,"visibilitychange"));M.any(M.map(n.onDidFocus,()=>this.hasFocus,i),M.map(n.onDidBlur,()=>this.hasFocus,i),M.map(o.event,()=>this.hasFocus,i),M.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get hasFocus(){return Hu().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=F2(t),o=i.add(Ac(t));i.add(o.onDidFocus(()=>e.fire(n))),ilt(t)&&i.add(mdt(t,()=>{const r=t.document.hasFocus();return r&&e.fire(n),r},100,20))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=F2(t),o=dm&&t.visualViewport?t.visualViewport:t,r=()=>{const a=$dt(t);return a!==null&&!a.guess};for(const a of[ke.FULLSCREEN_CHANGE,ke.WK_FULLSCREEN_CHANGE])i.add(ue(t.document,a,()=>e.fire({windowId:n,fullscreen:r()})));i.add(wdt(o,ke.RESIZE,()=>e.fire({windowId:n,fullscreen:r()}),void 0,Qt?2e3:800))},{window:si,disposables:this._store})),e.event}openWindow(e,t){return Array.isArray(e)?this.doOpenWindow(e,t):this.doOpenEmptyWindow(e)}async doOpenWindow(e,t){const i=this.preservePayload(!1),n=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),_Q(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):Gye(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):a4t(r)&&n.push(r);o.length>0&&this.withServices(r=>{r.get(iC).addFolders(o)}),n.length>0&&this.withServices(async r=>{const a=r.get(ei);if(t?.mergeMode&&n.length===4){const l=Fi(await Uhe(n,this.fileService,this.logService));if(l.length!==4||!Qv(l[0])||!Qv(l[1])||!Qv(l[2])||!Qv(l[3]))return;if(this.shouldReuse(t,!0))a.openEditor({input1:{resource:l[0].resource},input2:{resource:l[1].resource},base:{resource:l[2].resource},result:{resource:l[3].resource},options:{pinned:!0}});else{const d=new Map;d.set("mergeFile1",l[0].resource.toString()),d.set("mergeFile2",l[1].resource.toString()),d.set("mergeFileBase",l[2].resource.toString()),d.set("mergeFileResult",l[3].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else if(t?.diffMode&&n.length===2){const l=Fi(await Uhe(n,this.fileService,this.logService));if(l.length!==2||!Qv(l[0])||!Qv(l[1]))return;if(this.shouldReuse(t,!0))a.openEditor({original:{resource:l[0].resource},modified:{resource:l[1].resource},options:{pinned:!0}});else{const d=new Map;d.set("diffFileSecondary",l[0].resource.toString()),d.set("diffFilePrimary",l[1].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else for(const l of n)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=AGe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:Ya(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Fi(await Uhe(d,this.fileService,this.logService)),void 0,{validateTrust:!0})}else{const d=new Map;d.set("openFile",l.fileUri.toString()),t?.gotoLineMode&&d.set("gotoLineMode","true"),this.doOpen(void 0,{payload:Array.from(d.entries())})}const c=t?.waitMarkerFileURI;c&&(async()=>(await this.instantiationService.invokeFunction(l=>p5t(l,n.map(d=>d.fileUri))),await this.fileService.del(c)))()})}withServices(e){this.instantiationService.invokeFunction(t=>e(t))}preservePayload(e){const t=new Array;!e&&this.environmentService.extensionDevelopmentLocationURI&&(t.push(["extensionDevelopmentPath",this.environmentService.extensionDevelopmentLocationURI.toString()]),this.environmentService.debugExtensionHost.debugId&&t.push(["debugId",this.environmentService.debugExtensionHost.debugId]),this.environmentService.debugExtensionHost.port&&t.push(["inspect-brk-extensions",String(this.environmentService.debugExtensionHost.port)]));const i=this.configurationService.getValue("window"),n=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return n.isDefault||t.push(["lastActiveProfile",n.id]),t.length?t:void 0}getRecentLabel(e){return _Q(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:Op.LONG}):Gye(e)?this.labelService.getWorkspaceLabel(hNe(e.workspaceUri),{verbose:Op.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),n=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(n==="on"||n==="off")&&(o=n==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&_Q(e)&&e.folderUri.scheme===pe.file&&Py(this.contextService.getWorkspace())){this.withServices(async n=>{await n.get(iC).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(lD.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:n}=await this.dialogService.confirm({type:Xe.Warning,message:g(790,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(791,"&&Open")});n&&await this.workspaceProvider.open(e,t)}}async toggleFullScreen(e){const t=this.layoutService.getContainer(e);if(e.document.fullscreen!==void 0)if(e.document.fullscreen)try{return await e.document.exitFullscreen()}catch{this.logService.warn("toggleFullScreen(): exitFullscreen failed")}else try{return await t.requestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen failed")}if(e.document.webkitIsFullScreen!==void 0)try{e.document.webkitIsFullScreen?e.document.webkitExitFullscreen():t.webkitRequestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen/exitFullscreen failed")}}async moveTop(e){}async getCursorScreenPoint(){}async restart(){this.reload()}async reload(){await this.handleExpectedShutdown(lD.RELOAD),si.location.reload()}async close(){await this.handleExpectedShutdown(lD.CLOSE),si.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=Km.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=Km.Api,this.lifecycleService.withExpectedShutdown(e)}getPathForFile(){}};$A.__decorator=D([Zt],$A.prototype,"onDidChangeFocus",null);$A.__decorator=D([Zt],$A.prototype,"onDidChangeActiveWindow",null);$A.__decorator=D([Zt],$A.prototype,"onDidChangeFullScreen",null);$A=D([_(0,pu),_(1,Te),_(2,Jt),_(3,Fs),_(4,hv),_(5,we),_(6,ig),_(7,Ge),_(8,to),_(9,yi),_(10,ug),_(11,Em)],$A);class rYt extends V{constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){Bj(si,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),Bj(si,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return si.matchMedia("(prefers-color-scheme: light)").matches?!1:!!si.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!si.matchMedia("(forced-colors: active)").matches}}function aYt(){return{[xc.toString()]:new wi($A,[],!0),[uXe.toString()]:new wi(rYt,[],!0)}}function cYt(s,e,t){let i,n,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!Pie(s,o-1);)o--;let y=a;for(;yr&&s.substring(C,A)!==y&&v.push({offset:C,length:A-C,content:y})}let w=m();if(w!==ft.EOF){const y=u.getTokenOffset()+o,C=Bue(h,i);b(C,o,y)}for(;w!==ft.EOF;){let y=u.getTokenOffset()+u.getTokenLength()+o,C=m(),A="";for(;!l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia);){const k=u.getTokenOffset()+o;b(" ",y,k),y=u.getTokenOffset()+u.getTokenLength()+o,A=C===ft.LineCommentTrivia?p():"",C=m()}if(C===ft.CloseBraceToken)w!==ft.OpenBraceToken&&(d--,A=p());else if(C===ft.CloseBracketToken)w!==ft.OpenBracketToken&&(d--,A=p());else{switch(w){case ft.OpenBracketToken:case ft.OpenBraceToken:d++,A=p();break;case ft.CommaToken:case ft.LineCommentTrivia:A=p();break;case ft.BlockCommentTrivia:l?A=p():A=" ";break;case ft.ColonToken:A=" ";break;case ft.StringLiteral:if(C===ft.ColonToken){A="";break}case ft.NullKeyword:case ft.TrueKeyword:case ft.FalseKeyword:case ft.NumericLiteral:case ft.CloseBraceToken:case ft.CloseBracketToken:C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia?A=" ":C!==ft.CommaToken&&C!==ft.EOF&&(f=!0);break;case ft.Unknown:f=!0;break}l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia)&&(A=p())}const L=u.getTokenOffset()+o;b(A,y,L),w=C}return v}function Bue(s,e){let t="";for(let i=0;i0&&(l=o.pop(),c=abe(a,o),c===void 0&&t!==void 0);)typeof l=="string"?t={[l]:t}:t=[t];if(c)if(c.type==="object"&&typeof l=="string"&&Array.isArray(c.children)){const d=abe(c,[l]);if(d!==void 0)if(t===void 0){if(!d.parent)throw new Error("Malformed AST");const h=c.children.indexOf(d.parent);let u,f=d.parent.offset+d.parent.length;if(h>0){const p=c.children[h-1];u=p.offset+p.length}else u=c.offset+1,c.children.length>1&&(f=c.children[1].offset);return aB(n,{offset:u,length:f-u,content:""},i)}else return aB(n,{offset:d.offset,length:d.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];const h=`${JSON.stringify(l)}: ${JSON.stringify(t)}`,u=c.children.length;let f;if(u>0){const p=c.children[u-1];f={offset:p.offset+p.length,length:0,content:","+h}}else c.children.length===0?f={offset:c.offset+1,length:0,content:h}:f={offset:c.offset+1,length:0,content:h+","};return aB(n,f,i)}}else if(c.type==="array"&&typeof l=="number"&&Array.isArray(c.children))if(t!==void 0){const d=`${JSON.stringify(t)}`;let h;if(c.children.length===0||l===0)h={offset:c.offset+1,length:0,content:c.children.length===0?d:d+","};else{const u=l===-1||l>c.children.length?c.children.length:l,f=c.children[u-1];h={offset:f.offset+f.length,length:0,content:","+d}}return aB(n,h,i)}else{const d=l,h=c.children[d];let u;if(c.children.length===1)u={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===d){const f=c.children[d-1],p=f.offset+f.length,m=c.offset+c.length;u={offset:p,length:m-2-p,content:""}}else u={offset:h.offset,length:c.children[d+1].offset-h.offset,content:""};return aB(n,u,i)}else throw new Error(`Can not add ${typeof l!="number"?"index":"property"} to parent of type ${c.type}`);else return t===void 0?[]:aB(n,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}function aB(n,e,t){let i=T0e(n,e),s=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;s>0&&!ere(i,s-1);)s--;for(;o=0;c--){const l=r[c];i=T0e(i,l),s=Math.min(s,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}const a=n.length-(i.length-o)-s;return[{offset:s,length:a,content:i.substring(s,o)}]}function T0e(n,e){return n.substring(0,e.offset)+e.content+n.substring(e.offset+e.length)}function d7e(n,e){const t=e.slice(0).sort((s,o)=>{const r=s.offset-o.offset;return r===0?s.length-o.length:r});let i=n.length;for(let s=t.length-1;s>=0;s--){const o=t[s];if(o.offset+o.length<=i)n=T0e(n,o);else throw new Error("Overlapping edit");i=o.offset}return n}var jG;(function(n){n[n.ERROR_INVALID_FILE=0]="ERROR_INVALID_FILE"})(jG||(jG={}));class pJt extends Error{constructor(e,t){super(e),this.code=t}}const mJt="vs/workbench/services/configuration/common/jsonEditingService";let R0e=class{constructor(e,t,i){this.fileService=e,this.textModelResolverService=t,this.textFileService=i,this.queue=new dO}write(e,t){return Promise.resolve(this.queue.queue(()=>this.doWriteConfiguration(e,t)))}async doWriteConfiguration(e,t){const i=await this.resolveAndValidate(e,!0);try{await this.writeToBuffer(i.object.textEditorModel,t)}finally{i.dispose()}}async writeToBuffer(e,t){let i=!1;for(const s of t){const o=this.getEdits(e,s)[0];i=!!o&&this.applyEditsToBuffer(o,e)}if(i)return this.textFileService.save(e.uri)}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),s=t.getPositionAt(e.offset+e.length),o=new O(i.lineNumber,i.column,s.lineNumber,s.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?ds.replace(o,e.content):ds.insert(i,e.content);return t.pushEditOperations([new mt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits(e,t){const{tabSize:i,insertSpaces:s}=e.getOptions(),o=e.getEOL(),{path:r,value:a}=t;if(!r.length){const c=JSON.stringify(a,null,s?" ".repeat(i):" ");return[{content:c,length:c.length,offset:0}]}return due(e.getValue(),r,a,{tabSize:i,insertSpaces:s,eol:o})}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,"{}",{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e){const t=[];return ow(e.getValue(),t,{allowTrailingComma:!0,allowEmptyContent:!0}),t.length>0}async resolveAndValidate(e,t){const i=await this.resolveModelReference(e),s=i.object.textEditorModel;return this.hasParseErrors(s)?(i.dispose(),this.reject(jG.ERROR_INVALID_FILE)):i}reject(e){const t=this.toErrorMessage(e);return Promise.reject(new pJt(t,e))}toErrorMessage(e){switch(e){case jG.ERROR_INVALID_FILE:return g(mJt,0,"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again.")}}};R0e=D([_(0,ci),_(1,Rn),_(2,tr)],R0e);const _Jt="vs/workbench/services/decorations/browser/decorationsService",_k=class _k{static keyOf(e){if(Array.isArray(e))return e.map(_k.keyOf).join(",");{const{color:t,letter:i}=e;return $e.isThemeIcon(i)?`${t}+${i.id}`:`${t}/${i}`}}constructor(e,t,i){this.themeService=e,this._refCounter=0,this.data=t;const s=Ed(i).toString(36);this.itemColorClassName=`${_k._classNamesPrefix}-itemColor-${s}`,this.itemBadgeClassName=`${_k._classNamesPrefix}-itemBadge-${s}`,this.bubbleBadgeClassName=`${_k._classNamesPrefix}-bubbleBadge-${s}`,this.iconBadgeClassName=`${_k._classNamesPrefix}-iconBadge-${s}`}acquire(){this._refCounter+=1}release(){return--this._refCounter===0}appendCSSRules(e){Array.isArray(this.data)?this._appendForMany(this.data,e):this._appendForOne(this.data,e)}_appendForOne(e,t){const{color:i,letter:s}=e;Kp(`.${this.itemColorClassName}`,`color: ${NL(i)};`,t),$e.isThemeIcon(s)?this._createIconCSSRule(s,i,t):s&&Kp(`.${this.itemBadgeClassName}::after`,`content: "${s}"; color: ${NL(i)};`,t)}_appendForMany(e,t){const{color:i}=e.find(r=>!!r.color)??e[0];Kp(`.${this.itemColorClassName}`,`color: ${NL(i)};`,t);const s=[];let o;for(const r of e)if($e.isThemeIcon(r.letter)){o=r.letter;break}else r.letter&&s.push(r.letter);o?this._createIconCSSRule(o,i,t):(s.length&&Kp(`.${this.itemBadgeClassName}::after`,`content: "${s.join(", ")}"; color: ${NL(i)};`,t),Kp(`.${this.bubbleBadgeClassName}::after`,`content: ""; color: ${NL(i)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`,t))}_createIconCSSRule(e,t,i){const s=$e.getModifier(e);s&&(e=$e.modify(e,void 0));const o=iPe().getIcon(e.id);if(!o)return;const r=this.themeService.getProductIconTheme().getIcon(o);r&&Kp(`.${this.iconBadgeClassName}::after`,`content: '${r.fontCharacter}'; - color: ${e.color?NL(e.color.id):NL(t)}; - font-family: ${qY(r.font?.id??"codicon")}; +`}return s&&s.eol||` +`}function Pie(s,e){return`\r +`.indexOf(s.charAt(e))!==-1}function hYt(s,e,t){return Xce(s,e,void 0,t)}function Xce(s,e,t,i,n){const o=e.slice(),a=RLe(s,[]);let c,l;for(;o.length>0&&(l=o.pop(),c=jme(a,o),c===void 0&&t!==void 0);)typeof l=="string"?t={[l]:t}:t=[t];if(c)if(c.type==="object"&&typeof l=="string"&&Array.isArray(c.children)){const d=jme(c,[l]);if(d!==void 0)if(t===void 0){if(!d.parent)throw new Error("Malformed AST");const h=c.children.indexOf(d.parent);let u,f=d.parent.offset+d.parent.length;if(h>0){const p=c.children[h-1];u=p.offset+p.length}else u=c.offset+1,c.children.length>1&&(f=c.children[1].offset);return yP(s,{offset:u,length:f-u,content:""},i)}else return yP(s,{offset:d.offset,length:d.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];const h=`${JSON.stringify(l)}: ${JSON.stringify(t)}`,u=c.children.length;let f;if(u>0){const p=c.children[u-1];f={offset:p.offset+p.length,length:0,content:","+h}}else c.children.length===0?f={offset:c.offset+1,length:0,content:h}:f={offset:c.offset+1,length:0,content:h+","};return yP(s,f,i)}}else if(c.type==="array"&&typeof l=="number"&&Array.isArray(c.children))if(t!==void 0){const d=`${JSON.stringify(t)}`;let h;if(c.children.length===0||l===0)h={offset:c.offset+1,length:0,content:c.children.length===0?d:d+","};else{const u=l===-1||l>c.children.length?c.children.length:l,f=c.children[u-1];h={offset:f.offset+f.length,length:0,content:","+d}}return yP(s,h,i)}else{const d=l,h=c.children[d];let u;if(c.children.length===1)u={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===d){const f=c.children[d-1],p=f.offset+f.length,m=c.offset+c.length;u={offset:p,length:m-2-p,content:""}}else u={offset:h.offset,length:c.children[d+1].offset-h.offset,content:""};return yP(s,u,i)}else throw new Error(`Can not add ${typeof l!="number"?"index":"property"} to parent of type ${c.type}`);else return t===void 0?[]:yP(s,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}function yP(s,e,t){let i=uDe(s,e),n=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;n>0&&!Pie(i,n-1);)n--;for(;o=0;c--){const l=r[c];i=uDe(i,l),n=Math.min(n,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}const a=s.length-(i.length-o)-n;return[{offset:n,length:a,content:i.substring(n,o)}]}function uDe(s,e){return s.substring(0,e.offset)+e.content+s.substring(e.offset+e.length)}function W3e(s,e){const t=e.slice(0).sort((n,o)=>{const r=n.offset-o.offset;return r===0?n.length-o.length:r});let i=s.length;for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.offset+o.length<=i)s=uDe(s,o);else throw new Error("Overlapping edit");i=o.offset}return s}var V$;(function(s){s[s.ERROR_INVALID_FILE=0]="ERROR_INVALID_FILE"})(V$||(V$={}));class uYt extends Error{constructor(e,t){super(e),this.code=t}}let gDe=class{constructor(e,t,i){this.fileService=e,this.textModelResolverService=t,this.textFileService=i,this.queue=new bI}write(e,t){return Promise.resolve(this.queue.queue(()=>this.doWriteConfiguration(e,t)))}async doWriteConfiguration(e,t){const i=await this.resolveAndValidate(e,!0);try{await this.writeToBuffer(i.object.textEditorModel,t)}finally{i.dispose()}}async writeToBuffer(e,t){let i=!1;for(const n of t){const o=this.getEdits(e,n)[0];i=!!o&&this.applyEditsToBuffer(o,e)}if(i)return this.textFileService.save(e.uri)}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits(e,t){const{tabSize:i,insertSpaces:n}=e.getOptions(),o=e.getEOL(),{path:r,value:a}=t;if(!r.length){const c=JSON.stringify(a,null,n?" ".repeat(i):" ");return[{content:c,length:c.length,offset:0}]}return Xce(e.getValue(),r,a,{tabSize:i,insertSpaces:n,eol:o})}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,"{}",{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e){const t=[];return sf(e.getValue(),t,{allowTrailingComma:!0,allowEmptyContent:!0}),t.length>0}async resolveAndValidate(e,t){const i=await this.resolveModelReference(e),n=i.object.textEditorModel;return this.hasParseErrors(n)?(i.dispose(),this.reject(V$.ERROR_INVALID_FILE)):i}reject(e){const t=this.toErrorMessage(e);return Promise.reject(new uYt(t,e))}toErrorMessage(e){switch(e){case V$.ERROR_INVALID_FILE:return g(856,"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again.")}}};gDe=D([_(0,Jt),_(1,fn),_(2,Fo)],gDe);const jE=class jE{static keyOf(e){if(Array.isArray(e))return e.map(jE.keyOf).join(",");{const{color:t,letter:i}=e;return We.isThemeIcon(i)?`${t}+${i.id}`:`${t}/${i}`}}constructor(e,t,i){this.themeService=e,this._refCounter=0,this.data=t;const n=Wc(i).toString(36);this.itemColorClassName=`${jE._classNamesPrefix}-itemColor-${n}`,this.itemBadgeClassName=`${jE._classNamesPrefix}-itemBadge-${n}`,this.bubbleBadgeClassName=`${jE._classNamesPrefix}-bubbleBadge-${n}`,this.iconBadgeClassName=`${jE._classNamesPrefix}-iconBadge-${n}`}acquire(){this._refCounter+=1}release(){return--this._refCounter===0}appendCSSRules(e){Array.isArray(this.data)?this._appendForMany(this.data,e):this._appendForOne(this.data,e)}_appendForOne(e,t){const{color:i,letter:n}=e;Uf(`.${this.itemColorClassName}`,`color: ${KI(i)};`,t),We.isThemeIcon(n)?this._createIconCSSRule(n,i,t):n&&Uf(`.${this.itemBadgeClassName}::after`,`content: "${n}"; color: ${KI(i)};`,t)}_appendForMany(e,t){const{color:i}=e.find(r=>!!r.color)??e[0];Uf(`.${this.itemColorClassName}`,`color: ${KI(i)};`,t);const n=[];let o;for(const r of e)if(We.isThemeIcon(r.letter)){o=r.letter;break}else r.letter&&n.push(r.letter);o?this._createIconCSSRule(o,i,t):(n.length&&Uf(`.${this.itemBadgeClassName}::after`,`content: "${n.join(", ")}"; color: ${KI(i)};`,t),Uf(`.${this.bubbleBadgeClassName}::after`,`content: ""; color: ${KI(i)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`,t))}_createIconCSSRule(e,t,i){const n=We.getModifier(e);n&&(e=We.modify(e,void 0));const o=mRe().getIcon(e.id);if(!o)return;const r=this.themeService.getProductIconTheme().getIcon(o);r&&Uf(`.${this.iconBadgeClassName}::after`,`content: '${r.fontCharacter}'; + color: ${e.color?KI(e.color.id):KI(t)}; + font-family: ${mq(r.font?.id??"codicon")}; font-size: 16px; margin-right: 14px; font-weight: normal; - ${s==="spin"?"animation: codicon-spin 1.5s steps(30) infinite":""}; - `,i)}removeCSSRules(e){vE(this.itemColorClassName,e),vE(this.itemBadgeClassName,e),vE(this.bubbleBadgeClassName,e),vE(this.iconBadgeClassName,e)}};_k._classNamesPrefix="monaco-decoration";let tre=_k;class vJt{constructor(e){this._themeService=e,this._dispoables=new Z,this._styleElement=od(void 0,void 0,this._dispoables),this._decorationRules=new Map}dispose(){this._dispoables.dispose()}asDecoration(e,t){e.sort((d,h)=>(h.weight||0)-(d.weight||0));const i=tre.keyOf(e);let s=this._decorationRules.get(i);s||(s=new tre(this._themeService,e,i),this._decorationRules.set(i,s),s.appendCSSRules(this._styleElement)),s.acquire();const o=s.itemColorClassName;let r=s.itemBadgeClassName;const a=s.iconBadgeClassName;let c=Tc(e.filter(d=>!Xv(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(r=s.bubbleBadgeClassName,c=g(_Jt,0,"Contains emphasized items")),{labelClassName:o,badgeClassName:r,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{s?.release()&&(this._decorationRules.delete(i),s.removeCSSRules(this._styleElement),s=void 0)}}}}class wJt{constructor(e){this._data=Su.forUris(t=>!0),this._data.fill(!0,Kb(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class uY{constructor(e,t){this.source=e,this.thenable=t}}function NL(n){return n?Ye(n):"inherit"}let M0e=class{constructor(e,t){this._onDidChangeDecorationsDelayed=new Fle({merge:i=>i.flat()}),this._onDidChangeDecorations=new I,this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new td,this._decorationStyles=new vJt(t),this._data=Su.forUris(i=>e.extUri.ignorePathCasing(i)),this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new wJt(i))})}dispose(){this._onDidChangeDecorations.dispose(),this._onDidChangeDecorationsDelayed.dispose(),this._data.clear()}registerDecorationsProvider(e){const t=this._provider.unshift(e);this._onDidChangeDecorations.fire({affectsResource(){return!0}});const i=()=>{const o=[];for(const[r,a]of this._data)a.delete(e)&&o.push(r);o.length>0&&this._onDidChangeDecorationsDelayed.fire(o)},s=e.onDidChange(o=>{if(!o)i();else for(const r of o){const a=this._ensureEntry(r);this._fetchData(a,r,e)}});return Ee(()=>{t(),s.dispose(),i()})}_ensureEntry(e){let t=this._data.get(e);return t||(t=new Map,this._data.set(e,t)),t}getDecoration(e,t){const i=[];let s=!1;const o=this._ensureEntry(e);for(const r of this._provider){let a=o.get(r);a===void 0&&(a=this._fetchData(o,e,r)),a&&!(a instanceof uY)&&i.push(a)}if(t){const r=this._data.findSuperstr(e);if(r)for(const a of r)for(const c of a[1].values())c&&!(c instanceof uY)&&c.bubble&&(i.push(c),s=!0)}return i.length===0?void 0:this._decorationStyles.asDecoration(i,s)}_fetchData(e,t,i){const s=e.get(i);s instanceof uY&&(s.source.cancel(),e.delete(i));const o=new ai,r=i.provideDecorations(t,o.token);if(NS(r)){const a=new uY(o,Promise.resolve(r).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Na(c)&&e.get(i)===a&&e.delete(i)}).finally(()=>{o.dispose()}));return e.set(i,a),null}else return o.dispose(),this._keepItem(e,i,t,r)}_keepItem(e,t,i,s){const o=s||null,r=e.get(t);return e.set(t,o),(o||r)&&this._onDidChangeDecorationsDelayed.fire(i),o}};M0e=D([_(0,_o),_(1,pn)],M0e);class bJt{constructor(e){this.channel=e}async request(e,t){const[i,s]=await this.channel.call("request",[e],t);return{res:i,stream:aQ(s)}}async resolveProxy(e){return this.channel.call("resolveProxy",[e])}async loadCertificates(){return this.channel.call("loadCertificates")}}const CJt="Offline";class yJt extends Error{constructor(){super(CJt),this.name=this.message}}function SJt(n,e){n.proxyAuthorization&&(n.headers={...n.headers||{},"Proxy-Authorization":n.proxyAuthorization});const t=new XMLHttpRequest;return new Promise((i,s)=>{t.open(n.type||"GET",n.url||"",!0,n.user,n.password),AJt(t,n),t.responseType="arraybuffer",t.onerror=o=>s(navigator.onLine?new Error(t.statusText&&"XHR failed: "+t.statusText||"XHR failed"):new yJt),t.onload=o=>{i({res:{statusCode:t.status,headers:EJt(t)},stream:aQ(ze.wrap(new Uint8Array(t.response)))})},t.ontimeout=o=>s(new Error(`XHR timeout: ${n.timeout}ms`)),n.timeout&&(t.timeout=n.timeout),t.send(n.data),e.onCancellationRequested(()=>{t.abort(),s(rx())})})}function AJt(n,e){if(e.headers)e:for(const t in e.headers){switch(t){case"User-Agent":case"Accept-Encoding":case"Content-Length":continue e}n.setRequestHeader(t,e.headers[t])}}function EJt(n){const e=Object.create(null);for(const t of n.getAllResponseHeaders().split(/\r\n|\n|\r/g))if(t){const i=t.indexOf(":");e[t.substr(0,i).trim().toLowerCase()]=t.substr(i+1).trim()}return e}let N0e=class extends lzt{constructor(e,t){super(t),this.configurationService=e}async request(e,t){return e.proxyAuthorization||(e.proxyAuthorization=this.configurationService.getValue("http.proxyAuthorization")),this.logAndRequest("browser",e,()=>SJt(e,t))}async resolveProxy(e){}async loadCertificates(){return[]}};N0e=D([_(0,Re),_(1,wp)],N0e);let P0e=class extends N0e{constructor(e,t,i){super(t,i),this.remoteAgentService=e}async request(e,t){try{const i=await super.request(e,t),s=this.remoteAgentService.getConnection();return s&&i.res.statusCode===405?this._makeRemoteRequest(s,e,t):i}catch(i){const s=this.remoteAgentService.getConnection();if(s)return this._makeRemoteRequest(s,e,t);throw i}}_makeRemoteRequest(e,t,i){return e.withChannel("request",s=>new bJt(s).request(t,i))}};P0e=D([_(0,Sf),_(1,Re),_(2,wp)],P0e);yt.registerCommand("_workbench.fetchJSON",async function(n,e,t){const i=await fetch(e,{method:t,headers:{Accept:"application/json"}});if(i.ok)return i.json();throw new Error(i.statusText)});class xJt extends ${constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return Qle(i.map(s=>()=>s.handleURL(e,t)),void 0,!1).then(s=>s||!1)}registerHandler(e){return this.handlers.add(e),Ee(()=>this.handlers.delete(e))}}class DJt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!Rx(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=P.parse(e)),this.urlService.open(e,{trusted:!0}))}}let F0e=class extends xJt{constructor(e,t,i){super(),this.provider=e.options?.urlCallbackProvider,this.provider&&this._register(this.provider.onCallback(s=>this.open(s,{trusted:!0}))),this._register(t.registerOpener(new DJt(this,i)))}create(e){return this.provider?this.provider.create(e):P.parse("unsupported://")}};F0e=D([_(0,Ow),_(1,fr),_(2,Xa)],F0e);class kJt{constructor(){this._providers=new Map}registerCanonicalUriProvider(e){return this._providers.set(e.scheme,e),{dispose:()=>this._providers.delete(e.scheme)}}async provideCanonicalUri(e,t,i){const s=this._providers.get(e.scheme);if(s)return s.provideCanonicalUri(e,t,i)}}let O0e=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=qe.None){if(e.scheme===_e.file||e.scheme===_e.vscodeRemote){await this.fileService.copy(e,t);return}const s={type:"GET",url:e.toString(!0)},o=await this.requestService.request(s,i);if(o.res.statusCode===200)await this.fileService.writeFile(t,o.stream);else{const r=await hzt(o);throw new Error(`Expected 200, got back ${o.res.statusCode} instead. + ${n==="spin"?"animation: codicon-spin 1.5s steps(30) infinite":""}; + `,i)}removeCSSRules(e){CS(this.itemColorClassName,e),CS(this.itemBadgeClassName,e),CS(this.bubbleBadgeClassName,e),CS(this.iconBadgeClassName,e)}};jE._classNamesPrefix="monaco-decoration";let Fie=jE;class gYt{constructor(e){this._themeService=e,this._dispoables=new Z,this._styleElement=gl(void 0,void 0,this._dispoables),this._decorationRules=new Map}dispose(){this._dispoables.dispose()}asDecoration(e,t){e.sort((d,h)=>(h.weight||0)-(d.weight||0));const i=Fie.keyOf(e);let n=this._decorationRules.get(i);n||(n=new Fie(this._themeService,e,i),this._decorationRules.set(i,n),n.appendCSSRules(this._styleElement)),n.acquire();const o=n.itemColorClassName;let r=n.itemBadgeClassName;const a=n.iconBadgeClassName;let c=ja(e.filter(d=>!Gu(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(r=n.bubbleBadgeClassName,c=g(857,"Contains emphasized items")),{labelClassName:o,badgeClassName:r,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{n?.release()&&(this._decorationRules.delete(i),n.removeCSSRules(this._styleElement),n=void 0)}}}}class fYt{constructor(e){this._data=Dh.forUris(t=>!0),this._data.fill(!0,H_(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class BK{constructor(e,t){this.source=e,this.thenable=t}}function KI(s){return s?ze(s):"inherit"}let fDe=class{constructor(e,t){this._store=new Z,this._onDidChangeDecorationsDelayed=this._store.add(new Are({merge:i=>i.flat()})),this._onDidChangeDecorations=this._store.add(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new hl,this._decorationStyles=new gYt(t),this._data=Dh.forUris(i=>e.extUri.ignorePathCasing(i)),this._store.add(this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new fYt(i))}))}dispose(){this._store.dispose(),this._data.clear()}registerDecorationsProvider(e){const t=this._provider.unshift(e);this._onDidChangeDecorations.fire({affectsResource(){return!0}});const i=()=>{const o=[];for(const[r,a]of this._data)a.delete(e)&&o.push(r);o.length>0&&this._onDidChangeDecorationsDelayed.fire(o)},n=e.onDidChange(o=>{if(!o)i();else for(const r of o){const a=this._ensureEntry(r);this._fetchData(a,r,e)}});return Ee(()=>{t(),n.dispose(),i()})}_ensureEntry(e){let t=this._data.get(e);return t||(t=new Map,this._data.set(e,t)),t}getDecoration(e,t){const i=[];let n=!1;const o=this._ensureEntry(e);for(const r of this._provider){let a=o.get(r);a===void 0&&(a=this._fetchData(o,e,r)),a&&!(a instanceof BK)&&i.push(a)}if(t){const r=this._data.findSuperstr(e);if(r)for(const a of r)for(const c of a[1].values())c&&!(c instanceof BK)&&c.bubble&&(i.push(c),n=!0)}return i.length===0?void 0:this._decorationStyles.asDecoration(i,n)}_fetchData(e,t,i){const n=e.get(i);n instanceof BK&&(n.source.cancel(),e.delete(i));const o=new ci,r=i.provideDecorations(t,o.token);if(Qy(r)){const a=new BK(o,Promise.resolve(r).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Fr(c)&&e.get(i)===a&&e.delete(i)}).finally(()=>{o.dispose()}));return e.set(i,a),null}else return o.dispose(),this._keepItem(e,i,t,r)}_keepItem(e,t,i,n){const o=n||null,r=e.get(t);return e.set(t,o),(o||r)&&this._onDidChangeDecorationsDelayed.fire(i),o}};fDe=D([_(0,ks),_(1,pn)],fDe);class pYt{constructor(e){this.channel=e}async request(e,t){const[i,n]=await this.channel.call("request",[e],t);return{res:i,stream:t6(n)}}async resolveProxy(e){return this.channel.call("resolveProxy",[e])}async lookupAuthorization(e){return this.channel.call("lookupAuthorization",[e])}async lookupKerberosAuthorization(e){return this.channel.call("lookupKerberosAuthorization",[e])}async loadCertificates(){return this.channel.call("loadCertificates")}}const mYt="Offline";class _Yt extends Error{constructor(){super(mYt),this.name=this.message}}async function vYt(s,e){if(e.isCancellationRequested)throw xy();const t=new AbortController,i=e.onCancellationRequested(()=>t.abort()),n=s.timeout?AbortSignal.any([t.signal,AbortSignal.timeout(s.timeout)]):t.signal;try{const o=await fetch(s.url||"",{method:s.type||"GET",headers:bYt(s),body:s.data,signal:n});return{res:{statusCode:o.status,headers:wYt(o)},stream:t6($e.wrap(new Uint8Array(await o.arrayBuffer())))}}catch(o){throw navigator.onLine?o?.name==="AbortError"?xy():o?.name==="TimeoutError"?new Error(`Fetch timeout: ${s.timeout}ms`):o:new _Yt}finally{i.dispose()}}function bYt(s){if(s.headers||s.user||s.password||s.proxyAuthorization){const e=new Headers;e:for(const t in s.headers){switch(t.toLowerCase()){case"user-agent":case"accept-encoding":case"content-length":continue e}const i=s.headers[t];if(typeof i=="string")e.set(t,i);else if(Array.isArray(i))for(const n of i)e.append(t,n)}return(s.user||s.password)&&e.set("Authorization","Basic "+btoa(`${s.user||""}:${s.password||""}`)),s.proxyAuthorization&&e.set("Proxy-Authorization",s.proxyAuthorization),e}}function wYt(s){const e=Object.create(null);return s.headers.forEach((t,i)=>{e[i]?Array.isArray(e[i])?e[i].push(t):e[i]=[e[i],t]:e[i]=t}),e}let pDe=class extends E4t{constructor(e,t){super(t),this.configurationService=e}async request(e,t){return e.proxyAuthorization||(e.proxyAuthorization=this.configurationService.getValue("http.proxyAuthorization")),this.logAndRequest("browser",e,()=>vYt(e,t))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){}async loadCertificates(){return[]}};pDe=D([_(0,Te),_(1,uf)],pDe);let mDe=class extends pDe{constructor(e,t,i){super(t,i),this.remoteAgentService=e}async request(e,t){try{const i=await super.request(e,t),n=this.remoteAgentService.getConnection();return n&&i.res.statusCode===405?this._makeRemoteRequest(n,e,t):i}catch(i){const n=this.remoteAgentService.getConnection();if(n)return this._makeRemoteRequest(n,e,t);throw i}}_makeRemoteRequest(e,t,i){return e.withChannel("request",n=>new pYt(n).request(t,i))}};mDe=D([_(0,hg),_(1,Te),_(2,uf)],mDe);_t.registerCommand("_workbench.fetchJSON",async function(s,e,t){const i=await fetch(e,{method:t,headers:{Accept:"application/json"}});if(i.ok)return i.json();throw new Error(i.statusText)});class yYt extends V{constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return Nre(i.map(n=>()=>n.handleURL(e,t)),void 0,!1).then(n=>n||!1)}registerHandler(e){return this.handlers.add(e),Ee(()=>this.handlers.delete(e))}}class CYt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!AA(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=N.parse(e)),this.urlService.open(e,{trusted:!0}))}}let _De=class extends yYt{constructor(e,t,i){super(),this.provider=e.options?.urlCallbackProvider,this.provider&&this._register(this.provider.onCallback(n=>this.open(n,{trusted:!0}))),this._register(t.registerOpener(new CYt(this,i)))}create(e){return this.provider?this.provider.create(e):N.parse("unsupported://")}};_De=D([_(0,hv),_(1,Ao),_(2,Er)],_De);class SYt{constructor(){this._providers=new Map}registerCanonicalUriProvider(e){return this._providers.set(e.scheme,e),{dispose:()=>this._providers.delete(e.scheme)}}async provideCanonicalUri(e,t,i){const n=this._providers.get(e.scheme);if(n)return n.provideCanonicalUri(e,t,i)}}let vDe=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=He.None){if(e.scheme===pe.file||e.scheme===pe.vscodeRemote){await this.fileService.copy(e,t);return}const n={type:"GET",url:e.toString(!0)},o=await this.requestService.request(n,i);if(o.res.statusCode===200)await this.fileService.writeFile(t,o.stream);else{const r=await D4t(o);throw new Error(`Expected 200, got back ${o.res.statusCode} instead. -${r}`)}}};O0e=D([_(0,EQ),_(1,ci)],O0e);var B0e;let ire=B0e=class{constructor(e,t,i,s){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=s,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||$c)(),this.resolveUserHome=(async()=>{const o=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=o?.userHome??e})()}hasValidBasename(e,t,i){return typeof t=="string"||typeof t>"u"?this.resolveOS.then(s=>this.doHasValidBasename(e,s,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===_e.file||e.scheme===_e.vscodeRemote?VQe(i??ui(e),t===Pr.Windows):!0}get defaultUriScheme(){return B0e.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return _e.vscodeRemote;const i=v5t(t.getWorkspace());if(i)return i;const s=t.getWorkspace().folders[0];if(s)return s.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:_e.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Pr.Windows?Gc:Qi)}async fileURI(e){let t="";if(await this.resolveOS===Pr.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const s=e.indexOf("/",2);s===-1?(t=e.substring(2),e="/"):(t=e.substring(2,s),e=e.substring(s)||"/")}return P.from({scheme:_e.file,authority:t,path:e,query:"",fragment:""})}};ire=B0e=D([_(1,Sf),_(2,ec),_(3,Ti)],ire);function IJt(n,e){const t=e.getWorkspace(),i=k_(t.folders);return i?i.uri:t.configuration?ma(t.configuration):P.from({scheme:ire.findDefaultUriScheme(n,e),authority:n.remoteAuthority,path:"/"})}class LJt{constructor(){this.todo=[],this.add=e=>{this.todo.push(e)}}take(e,t){this.add=i=>t.createInstance(i,e),this.todo.forEach(this.add),this.todo=[]}}const TJt=new LJt;let W0e=class extends ${constructor(e){super(),this.markInactive=this._register(new yn(()=>{this.isActive=!1,this.changeEmitter.fire(!1)},1e4)),this.changeEmitter=this._register(new I),this.active=0,this.isActive=!0,this.onDidChangeIsActive=this.changeEmitter.event,this._register(PU(()=>TJt.take(this,e)))}markActive(){return++this.active===1&&(this.isActive=!0,this.changeEmitter.fire(!0),this.markInactive.cancel()),Ee(()=>{--this.active===0&&this.markInactive.schedule()})}};W0e=D([_(0,be)],W0e);let H0e=class extends ${constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new td}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,s){const o=this.configurationService.getValue("files.participants.timeout");if(!(typeof o!="number"||o<=0))for(const r of this.participants)try{await r.participate(e,t,i,o,s)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};H0e=D([_(0,Ze),_(1,Re)],H0e);const RJt="vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant";let U0e=class extends ${get length(){return this.saveParticipants.length}constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=ORe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(RJt,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.model?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||e.isDisposed())break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.warn(a)}}e.model?.pushStackElement(),s.dispose()},()=>{s.dispose(!0)})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};U0e=D([_(0,Cf),_(1,Ze)],U0e);let V0e=class extends ${constructor(e,t,i,s){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=s,this._onWillRunWorkingCopyFileOperation=this._register(new EI),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new EI),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new EI),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(H0e)),this.saveParticipants=this._register(this.instantiationService.createInstance(U0e)),this.workingCopyProviders=[],this._register(this.registerWorkingCopyProvider(o=>this.workingCopyService.workingCopies.filter(r=>this.fileService.hasProvider(o)?this.uriIdentityService.extUri.isEqualOrParent(r.resource,o):this.uriIdentityService.extUri.isEqual(r.resource,o))))}create(e,t,i){return this.doCreateFileOrFolder(e,!0,t,i)}createFolder(e,t,i){return this.doCreateFileOrFolder(e,!1,t,i)}async doCreateFileOrFolder(e,t,i,s){if(e.length===0)return[];if(t){const l=(await ko.settled(e.map(d=>this.fileService.canCreateFile(d.resource,{overwrite:d.overwrite})))).find(d=>d instanceof Error);if(l instanceof Error)throw l}const o=e.map(c=>({target:c.resource}));await this.runFileOperationParticipants(o,Li.CREATE,s,i);const r={correlationId:this.correlationIds++,operation:Li.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,qe.None);let a;try{t?a=await ko.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await ko.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,qe.None),a}async move(e,t,i){return this.doMoveOrCopy(e,!0,t,i)}async copy(e,t,i){return this.doMoveOrCopy(e,!1,t,i)}async doMoveOrCopy(e,t,i,s){const o=[];for(const{file:{source:c,target:l},overwrite:d}of e){const h=await(t?this.fileService.canMove(c,l,d):this.fileService.canCopy(c,l,d));if(h instanceof Error)throw h}const r=e.map(c=>c.file);await this.runFileOperationParticipants(r,t?Li.MOVE:Li.COPY,s,i);const a={correlationId:this.correlationIds++,operation:t?Li.MOVE:Li.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,qe.None);try{for(const{file:{source:c,target:l},overwrite:d}of e){if(!this.uriIdentityService.extUri.isEqual(c,l)){const h=t?[...this.getDirty(c),...this.getDirty(l)]:this.getDirty(l);await ko.settled(h.map(u=>u.revert({soft:!0})))}t?o.push(await this.fileService.move(c,l,d)):o.push(await this.fileService.copy(c,l,d))}}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(a,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,qe.None),o}async delete(e,t,i){for(const r of e){const a=await this.fileService.canDelete(r.resource,{recursive:r.recursive,useTrash:r.useTrash});if(a instanceof Error)throw a}const s=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(s,Li.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Li.DELETE,files:s};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,qe.None);for(const r of e){const a=this.getDirty(r.resource);await ko.settled(a.map(c=>c.revert({soft:!0})))}try{for(const r of e)await this.fileService.del(r.resource,{recursive:r.recursive,useTrash:r.useTrash})}catch(r){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(o,qe.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,qe.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,s){return this.fileOperationParticipants.participate(e,t,i,s)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}registerWorkingCopyProvider(e){const t=ORe(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const s of i(e))s.isDirty()&&t.add(s);return Array.from(t)}};V0e=D([_(0,ci),_(1,Pw),_(2,be),_(3,_o)],V0e);let z0e=class extends ire{constructor(e,t,i){super(T4t().userHome??IJt(t,i),e,t,i)}};z0e=D([_(0,Sf),_(1,ec),_(2,Ti)],z0e);function MJt(){return{[EQ.toString()]:new Gi(P0e,[],!0),[bPe.toString()]:new Gi(O0e,[],!0),[rD.toString()]:new Gi(M0e,[],!0),[dL.toString()]:new Gi(R0e,[],!0),[zde.toString()]:new Gi(wPe,[],!0),[jde.toString()]:new Gi(F0e,[],!0),[APe.toString()]:new Gi(kJt,[],!1),[WPe.toString()]:new Gi(W0e,[],!0),[fC.toString()]:new Gi(V0e,[],!1),[Tm.toString()]:new Gi(z0e,[],!0),[lhe.toString()]:new Gi(lDe,[],!0)}}var h7e;(function(n){n[n.NONE=0]="NONE",n[n.EDITS=1]="EDITS",n[n.NAVIGATION=2]="NAVIGATION"})(h7e||(h7e={}));var u7e;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.EDITOR_GROUP=1]="EDITOR_GROUP",n[n.EDITOR=2]="EDITOR"})(u7e||(u7e={}));async function NJt(n,e=document.body,t={},i){B4t(),M4t(e,t,i);const s=Lt.initialize({[Xa.toString()]:Sm({version:"1.90.2",quality:"stable",commit:"5437499feb04f7a586f677b155b039bc2b3669eb",nameShort:"Code - OSS",nameLong:"Code - OSS",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverApplicationName:"code-server-oss"},t.productConfiguration??{}),...cJt(),...aJt(),...rJt(),...dOe(),...P$t(),...dJt(),...MJt(),...n});await O4t(s)}async function Nrt(n){return await znt(),Lt.get(n)}function Prt(n){if(VFe.isOpen())return Lt.get(be).invokeFunction(n);const e=new Z,t=e.add(Bnt.event(()=>{t.dispose(),e.add(Lt.get(be).invokeFunction(n))}));return e}function $0e(n,e){const t=fo(n.editor)?Vs(n.editor):Object.create(null);return Object.assign(t,Vs(e)),t}function g7e(n,e){const t=$0e(n);if(fo(n.diffEditor)){const i=Vs(n.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=n.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,Vs(e)),t}function Frt(n){let e=class extends n{constructor(i,s={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=s,w=$0e(r.getValue(s.model?.uri),v);super(o,i,{...w,overflowWidgetsDomNode:p,dimension:m,theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f}),this.textResourceConfigurationService=r,this.optionsOverrides={},this.lastAppliedEditorOptions=w,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(y=>{const S=this.getModel()?.uri;S!=null&&y.affectsConfiguration(S,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const b=o.createChild(new Dl([Pe,this._contextKeyService])),C=this._register(b.createInstance(O7));this.onDidChangeModel(y=>{C.set(y.newModelUrl)}),C.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,s=this.textResourceConfigurationService.getValue(i);if(s==null)return;const o=$0e(s,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=f9(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),oE.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,be),_(3,dl)],e),e}const PJt=Frt(vPe(k1)),FJt=Frt(vPe(mF));let G0e=class extends vPe(Zee){constructor(e,t={},i,s){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=g7e(s.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=s,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(s.onDidChangeConfiguration(f=>{const p=this._targetEditor.getModel()?.uri;p!=null&&(f.affectsConfiguration(p,"editor")||f.affectsConfiguration(p,"diffEditor")||f.affectsConfiguration(p,"accessibility.verbosity.diffEditor"))&&this.updateEditorConfiguration()})),this._register(this._targetEditor.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration()}updateEditorConfiguration(){if(this.getModel()==null||this.textResourceConfigurationService==null)return;const e=this._targetEditor.getModel()?.uri,t=this.textResourceConfigurationService.getValue(e);if(t==null)return;const i=g7e(t,this.optionsOverrides);let s=i;this.lastAppliedEditorOptions!=null&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(s))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(PJt,t,i)}};G0e=D([_(2,be),_(3,dl)],G0e);async function Ort(n,e){await(await Nrt(ci)).writeFile(n,ze.fromString(e))}async function OJt(n,e){return e!=null&&await Ort(n,e),await(await Nrt(Rn)).createModelReference(n)}function BJt(n){return n.registerKeybindingProvider!=null}let q0e=class extends x1{constructor(e,t,i,s,o,r,a){super(t,i,s,o,r,a),this.delegate=e,this._register(e.registerKeybindingProvider({provideKeybindings:()=>this.getUserKeybindingItems(),onDidChangeKeybindings:this.onDidUpdateKeybindings}))}_getResolver(){return this.delegate._getResolver()}resolveKeyboardEvent(e){return this.delegate.resolveKeyboardEvent(e)}resolveKeybinding(e){return this.delegate.resolveKeybinding(e)}resolveUserBinding(e){return this.delegate.resolveUserBinding(e)}_dumpDebugInfo(){return this.delegate._dumpDebugInfo()}_dumpDebugInfoJSON(){return this.delegate._dumpDebugInfoJSON()}registerSchemaContribution(e){return this.delegate.registerSchemaContribution(e)}enableKeybindingHoldMode(e){return this.delegate.enableKeybindingHoldMode(e)}};q0e=D([_(1,Pe),_(2,ji),_(3,rn),_(4,Pi),_(5,Ze),_(6,jt)],q0e);let ame=null;function Brt(n){if(ame==null){const e=new Dl;e.set(On,new Gi(R7,void 0,!0));const t=n.get(ti);!(t instanceof x1)&&BJt(t)&&e.set(ti,new Gi(q0e,[t],!0)),ame=n.get(be).createChild(e)}return ame}const Wrt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance(FJt,n,e),WJt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance(G0e,n,e);var HJt='.monaco-editor.standalone{--monaco-monospace-font:"SF Mono",Monaco,Menlo,Consolas,"Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;top:0;width:1px}.monaco-diff-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone [tabindex="-1"]:focus,.monaco-diff-editor.standalone [tabindex="0"]:focus,.monaco-diff-editor.standalone button:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone select:focus,.monaco-diff-editor.standalone textarea:focus,.monaco-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex="-1"]:focus,.monaco-editor.standalone [tabindex="0"]:focus,.monaco-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-editor.standalone textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}';Ct(HJt,{});var B4;(function(n){n[n.None=0]="None",n[n.Open=1]="Open",n[n.Close=-1]="Close"})(B4||(B4={}));function UJt(n){return Array.isArray(n)}function VJt(n){return!UJt(n)}function Hrt(n){return typeof n=="string"}function f7e(n){return!Hrt(n)}function UT(n){return!n}function xx(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function p7e(n){return n.replace(/[&<>'"_]/g,"-")}function zJt(n,e){console.log(`${n.languageId}: ${e}`)}function wr(n,e){return new Error(`${n.languageId}: ${e}`)}function xk(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,c,l,d,h,u,f,p,m){return UT(l)?UT(d)?!UT(h)&&h0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function GJt(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var Q0e;const Urt=5,ule=class ule{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new cH(e,t);let i=cH.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new cH(e,t),this._entries[i]=s,s)}};ule._INSTANCE=new ule(Urt);let KG=ule;class cH{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return cH._equals(this,e)}push(e){return KG.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return KG.create(this.parent,e)}}class k2{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new k2(this.languageId,this.state)}}const gle=class gle{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new R8(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new R8(e,t);const i=cH.getStackElementId(e);let s=this._entries[i];return s||(s=new R8(e,null),this._entries[i]=s,s)}};gle._INSTANCE=new gle(Urt);let Dk=gle;class R8{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Dk.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof R8)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class qJt{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new A9(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=dc.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const c=a.tokenize(e,t,r);if(s!==0)for(const l of c.tokens)this._tokens.push(new A9(l.offset+s,l.type,l.language));else this._tokens=this._tokens.concat(c.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new iMe(this._tokens,e)}}class nre{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=lM.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|$i.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let c=0;c{if(r)return;let c=!1;for(let l=0,d=a.changedLanguages.length;l{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=dc.get(t);if(i){if(i instanceof Q0e){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}dc.isResolved(t)||e.push(dc.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=KG.create(null,this._lexer.start);return Dk.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return aKe(this._languageId,i);const s=new qJt,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return SMe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new nre(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=gY(this._lexer,t.stack.state),!i))throw wr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!f7e(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const c=a.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(c.substr(4,c.length-5),d)}const l=e.search(a);l===-1||l!==0&&r.matchOnlyAtLineStart||(s===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const c=e.substring(r);return this._myTokenize(c,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` -`:e,c=a.length;let l=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h=c)break;f=!1;let N=this._lexer.tokenizer[w];if(!N&&(N=gY(this._lexer,w),!N))throw wr(this._lexer,"tokenizer state is not defined: "+w);const z=a.substr(h);for(const U of N)if((h===0||!U.matchOnlyAtLineStart)&&(b=z.match(U.resolveRegex(w)),b)){C=b[0],y=U.action;break}}if(b||(b=[""],C=""),y||(h=this._lexer.maxStack)throw wr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(w)}else if(y.next==="@pop"){if(d.depth<=1)throw wr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(y.next==="@popall")d=d.popall();else{let N=xk(this._lexer,y.next,C,b,w);if(N[0]==="@"&&(N=N.substr(1)),gY(this._lexer,N))d=d.push(N);else throw wr(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}y.log&&typeof y.log=="string"&&zJt(this._lexer,this._lexer.languageId+": "+xk(this._lexer,y.log,C,b,w))}if(k===null)throw wr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const F=N=>{const z=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,U=this._getNestedEmbeddedLanguageData(z);if(h0)throw wr(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==k.length+1)throw wr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let z=1;zn});class BOe{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const l=d=>{const h=jJt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,s).then(l,d=>console.error(d))}static async colorize(e,t,i,s){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),ZRe(t)&&(t=t.substr(1));const a=xw(t);if(!e.isRegisteredLanguageId(i))return m7e(a,r,o);const c=await dc.getOrCreate(i);return c?KJt(a,r,c,o):m7e(a,r,o)}static colorizeLine(e,t,i,s,o=4){const r=Am.isBasicASCII(e,t),a=Am.containsRTL(e,r,i);return ede(new tL(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function KJt(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=YJt(n,e,t,i);if(t instanceof YG){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}s(a)};r()})}function m7e(n,e,t){let i=[];const s=(ar.None<<$i.FONT_STYLE_OFFSET|Ad.DefaultForeground<<$i.FOREGROUND_OFFSET|Ad.DefaultBackground<<$i.BACKGROUND_OFFSET)>>>0,o=new Uint32Array(2);o[0]=0,o[1]=s;for(let r=0,a=n.length;r")}return i.join("")}function YJt(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=l.endState}return s.join("")}function JJt(n,e,t){return Lt.initialize(t||{}).createInstance(mF,n,e)}function XJt(n){return Lt.get(jt).onCodeEditorAdd(t=>{n(t)})}function ZJt(n){return Lt.get(jt).onDiffEditorAdd(t=>{n(t)})}function eXt(){return Lt.get(jt).listCodeEditors()}function tXt(){return Lt.get(jt).listDiffEditors()}function iXt(n,e,t){return Lt.initialize(t||{}).createInstance(Zee,n,e)}function nXt(n,e){const t=Lt.initialize(e||{});return new OCe(n,{},t)}function sXt(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return yt.registerCommand(n.id,n.run)}function oXt(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=ge.deserialize(n.precondition),t=(s,...o)=>Jc.runEditorCommand(s,o,e,(r,a,c)=>Promise.resolve(n.run(a,...c))),i=new Z;if(i.add(yt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Xs.appendMenuItem(Te.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Lt.get(ti);if(!(s instanceof x1))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ge.and(e,ge.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function rXt(n){return Vrt([n])}function Vrt(n){const e=Lt.get(ti);return e instanceof x1?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ge.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None)}function aXt(n,e,t){const i=Lt.get(Di),s=i.getLanguageIdByMimeType(e)||e;return lZe(Lt.get(Ai),i,n,s,t)}function cXt(n,e){const t=Lt.get(Di),i=t.getLanguageIdByMimeType(e)||e||Yc;n.setLanguage(t.createById(i))}function lXt(n,e,t){n&&Lt.get(U_).changeOne(e,n.uri,t)}function dXt(n){Lt.get(U_).changeAll(n,[])}function hXt(n){return Lt.get(U_).read(n)}function uXt(n){return Lt.get(U_).onMarkerChanged(n)}function gXt(n){return Lt.get(Ai).getModel(n)}function fXt(){return Lt.get(Ai).getModels()}function pXt(n){return Lt.get(Ai).onModelAdded(n)}function mXt(n){return Lt.get(Ai).onModelRemoved(n)}function _Xt(n){return Lt.get(Ai).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function vXt(n){return Wpt(Lt.get(Ai),Lt.get(lo),n)}function wXt(n,e){const t=Lt.get(Di),i=Lt.get(Iw);return BOe.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function bXt(n,e,t){const i=Lt.get(Di);return Lt.get(Iw).registerEditorContainer(yi.document.body),BOe.colorize(i,n,e,t)}function CXt(n,e,t=4){return Lt.get(Iw).registerEditorContainer(yi.document.body),BOe.colorizeModelLine(n,e,t)}function yXt(n){const e=dc.get(n);return e||{getInitialState:()=>G9,tokenize:(t,i,s)=>aKe(n,s)}}function SXt(n,e){dc.getOrCreate(e);const t=yXt(e),i=xw(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const o=t.options?.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await n.openCodeEditor(i,t.resource,r)?i:null})}function LXt(){return{create:JJt,getEditors:eXt,getDiffEditors:tXt,onDidCreateEditor:XJt,onDidCreateDiffEditor:ZJt,createDiffEditor:iXt,addCommand:sXt,addEditorAction:oXt,addKeybindingRule:rXt,addKeybindingRules:Vrt,createModel:aXt,setModelLanguage:cXt,setModelMarkers:lXt,getModelMarkers:hXt,removeAllMarkers:dXt,onDidChangeMarkers:uXt,getModels:fXt,getModel:gXt,onDidCreateModel:pXt,onWillDisposeModel:mXt,onDidChangeModelLanguage:_Xt,createWebWorker:vXt,colorizeElement:wXt,colorize:bXt,colorizeModelLine:CXt,tokenize:SXt,defineTheme:AXt,setTheme:EXt,remeasureFonts:xXt,registerCommand:DXt,registerLinkOpener:kXt,registerEditorOpener:IXt,AccessibilitySupport:R_e,ContentWidgetPositionPreference:B_e,CursorChangeReason:W_e,DefaultEndOfLine:H_e,EditorAutoIndentStrategy:V_e,EditorOption:z_e,EndOfLinePreference:$_e,EndOfLineSequence:G_e,MinimapPosition:ive,MinimapSectionHeaderStyle:nve,MouseTargetType:sve,OverlayWidgetPositionPreference:ave,OverviewRulerLane:cve,GlyphMarginLane:q_e,RenderLineNumbersType:hve,RenderMinimap:uve,ScrollbarVisibility:fve,ScrollType:gve,TextEditorCursorBlinkingStyle:bve,TextEditorCursorStyle:Cve,TrackedRangeStickiness:yve,WrappingIndent:Sve,InjectedTextCursorStops:K_e,PositionAffinity:dve,ShowLightbulbIconMode:mve,ConfigurationChangedEvent:kQe,BareFontInfo:Wk,FontInfo:QY,TextModelResolvedOptions:YY,FindMatch:z9,ApplyUpdateResult:a$,EditorZoom:d_,createMultiFileDiffEditor:nXt,EditorType:mz,EditorOptions:_u}}function TXt(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function fY(n,e){return typeof n=="boolean"?n:e}function _7e(n,e){return typeof n=="string"?n:e}function RXt(n){const e={};for(const t of n)e[t]=!0;return e}function v7e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=RXt(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function j0e(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(r,a){s=!0;let c="";if(typeof n[a]=="string")c=n[a];else if(n[a]&&n[a]instanceof RegExp)c=n[a].source;else throw n[a]===void 0?wr(n,"language definition does not contain attribute '"+a+"', used at: "+e):wr(n,"attribute reference '"+a+"' must be a string, used at: "+e);return UT(c)?"":"(?:"+c+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const o=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,c=null;return l=>(c&&a===l||(a=l,c=new RegExp($Jt(n,e,l),o)),c)}return new RegExp(e,o)}function MXt(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=B4.Open;else if(t.bracket==="@close")i.bracket=B4.Close;else throw wr(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw wr(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!GJt(n,xk(n,s,"",[],""))))throw wr(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=j0e(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=K0e(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function zrt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=fY(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=fY(e.ignoreCase,!1),t.unicode=fY(e.unicode,!1),t.tokenPostfix=_7e(e.tokenPostfix,"."+t.languageId),t.defaultToken=_7e(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw wr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw wr(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const h=new PXt(r);if(Array.isArray(l)&&l.length>=1&&l.length<=3)if(h.setRegex(i,l[0]),l.length>=3)if(typeof l[1]=="string")h.setAction(i,{token:l[1],next:l[2]});else if(typeof l[1]=="object"){const u=l[1];u.next=l[2],h.setAction(i,u)}else throw wr(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,l[1]);else{if(!l.regex)throw wr(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=fY(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw wr(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw wr(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw wr(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:xx(t,a.open),close:xx(t,a.close)});else throw wr(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function FXt(n){hM.registerLanguage(n)}function OXt(){let n=[];return n=n.concat(hM.getLanguages()),n}function BXt(n){return Lt.get(Di).languageIdCodec.encodeLanguageId(n)}function WXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function HXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function UXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Lt.get(lo).register(n,e,100)}class VXt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return JG.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new $le(s.tokens,s.endState)}}class JG{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;l===0?f=0:f{const i=await Promise.resolve(e.create());return i?zXt(i)?Grt(n,i):new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re)):null});return dc.registerFactory(n,t)}function qXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return $rt(e)?WOe(n,{create:()=>e}):dc.register(n,Grt(n,e))}function QXt(n,e){const t=i=>new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re));return $rt(e)?WOe(n,{create:()=>e}):dc.register(n,t(e))}function jXt(n,e){return Lt.get(ht).referenceProvider.register(n,e)}function KXt(n,e){return Lt.get(ht).renameProvider.register(n,e)}function YXt(n,e){return Lt.get(ht).newSymbolNamesProvider.register(n,e)}function JXt(n,e){return Lt.get(ht).signatureHelpProvider.register(n,e)}function XXt(n,e){return Lt.get(ht).hoverProvider.register(n,{provideHover:async(i,s,o,r)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new O(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),c.range||(c.range=new O(s.lineNumber,s.column,s.lineNumber,s.column)),c})}})}function ZXt(n,e){return Lt.get(ht).documentSymbolProvider.register(n,e)}function eZt(n,e){return Lt.get(ht).documentHighlightProvider.register(n,e)}function tZt(n,e){return Lt.get(ht).linkedEditingRangeProvider.register(n,e)}function iZt(n,e){return Lt.get(ht).definitionProvider.register(n,e)}function nZt(n,e){return Lt.get(ht).implementationProvider.register(n,e)}function sZt(n,e){return Lt.get(ht).typeDefinitionProvider.register(n,e)}function oZt(n,e){return Lt.get(ht).codeLensProvider.register(n,e)}function rZt(n,e,t){return Lt.get(ht).codeActionProvider.register(n,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(s,o,r,a)=>{const l=Lt.get(U_).read({resource:s.uri}).filter(d=>O.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function aZt(n,e){return Lt.get(ht).documentFormattingEditProvider.register(n,e)}function cZt(n,e){return Lt.get(ht).documentRangeFormattingEditProvider.register(n,e)}function lZt(n,e){return Lt.get(ht).onTypeFormattingEditProvider.register(n,e)}function dZt(n,e){return Lt.get(ht).linkProvider.register(n,e)}function hZt(n,e){return Lt.get(ht).completionProvider.register(n,e)}function uZt(n,e){return Lt.get(ht).colorProvider.register(n,e)}function gZt(n,e){return Lt.get(ht).foldingRangeProvider.register(n,e)}function fZt(n,e){return Lt.get(ht).declarationProvider.register(n,e)}function pZt(n,e){return Lt.get(ht).selectionRangeProvider.register(n,e)}function mZt(n,e){return Lt.get(ht).documentSemanticTokensProvider.register(n,e)}function _Zt(n,e){return Lt.get(ht).documentRangeSemanticTokensProvider.register(n,e)}function vZt(n,e){return Lt.get(ht).inlineCompletionsProvider.register(n,e)}function wZt(n,e){return Lt.get(ht).inlineEditProvider.register(n,e)}function bZt(n,e){return Lt.get(ht).inlayHintsProvider.register(n,e)}function CZt(){return{register:FXt,getLanguages:OXt,onLanguage:WXt,onLanguageEncountered:HXt,getEncodedLanguageId:BXt,setLanguageConfiguration:UXt,setColorMap:GXt,registerTokensProviderFactory:WOe,setTokensProvider:qXt,setMonarchTokensProvider:QXt,registerReferenceProvider:jXt,registerRenameProvider:KXt,registerNewSymbolNameProvider:YXt,registerCompletionItemProvider:hZt,registerSignatureHelpProvider:JXt,registerHoverProvider:XXt,registerDocumentSymbolProvider:ZXt,registerDocumentHighlightProvider:eZt,registerLinkedEditingRangeProvider:tZt,registerDefinitionProvider:iZt,registerImplementationProvider:nZt,registerTypeDefinitionProvider:sZt,registerCodeLensProvider:oZt,registerCodeActionProvider:rZt,registerDocumentFormattingEditProvider:aZt,registerDocumentRangeFormattingEditProvider:cZt,registerOnTypeFormattingEditProvider:lZt,registerLinkProvider:dZt,registerColorProvider:uZt,registerFoldingRangeProvider:gZt,registerDeclarationProvider:fZt,registerSelectionRangeProvider:pZt,registerDocumentSemanticTokensProvider:mZt,registerDocumentRangeSemanticTokensProvider:_Zt,registerInlineCompletionsProvider:vZt,registerInlineEditProvider:wZt,registerInlayHintsProvider:bZt,DocumentHighlightKind:U_e,CompletionItemKind:P_e,CompletionItemTag:F_e,CompletionItemInsertTextRule:N_e,SymbolKind:vve,SymbolTag:wve,IndentAction:j_e,CompletionTriggerKind:O_e,SignatureHelpTriggerKind:_ve,InlayHintKind:Y_e,InlineCompletionTriggerKind:J_e,InlineEditTriggerKind:X_e,CodeActionTriggerType:M_e,NewSymbolNameTag:ove,NewSymbolNameTriggerKind:rve,PartialAcceptTriggerKind:lve,HoverVerbosityAction:Q_e,FoldingRangeKind:yv,SelectedSuggestionInfo:OQe}}_u.wrappingIndent.defaultValue=Vg.None;_u.glyphMargin.defaultValue=!1;_u.autoIndent.defaultValue=ed.Advanced;_u.overviewRulerLanes.defaultValue=2;gV.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Ag=WQe();Ag.editor=LXt();Ag.languages=CZt();Ag.CancellationTokenSource;Ag.Emitter;Ag.KeyCode;Ag.KeyMod;const qrt=Ag.Position;Ag.Range;Ag.Selection;Ag.SelectionDirection;Ag.MarkerSeverity;Ag.MarkerTag;const Pv=Ag.Uri;Ag.Token;const pd=Ag.editor,QM=Ag.languages,yZt=globalThis.MonacoEnvironment;(yZt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ag);const SZt=QM.onLanguage;QM.onLanguage=(n,e)=>Prt(()=>SZt(n,e));const AZt=QM.onLanguage;QM.onLanguageEncountered=(n,e)=>Prt(()=>AZt(n,e));pd.create=Wrt;pd.createDiffEditor=WJt;pd.createModelReference=OJt;pd.writeFile=Ort;const EZt={defaultToken:"invalid",root_keywords:["import","from","export","global","component","struct","inherits"],inner_keywords:["property","callback","animate","states","transitions","if","for","in","out","in-out","private","function","pure","public"],lang_keywords:["root","parent","this","if"],type_keywords:["int","string","float","length","physical_length","duration","color","brush"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,symbols:/[#!%&*+\-./:;<=>@^|_?,()]+/,tokenizer:{root:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@root_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@inner"],[/@symbols/,""]],inner:[[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:=/,"variable.parameter"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:\s*\{/,"variable.parameter","@binding_1"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:/,"variable.parameter","@binding_0"],[/[a-zA-Z_][a-zA-Z0-9_-]*/,{cases:{"@inner_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/:=/,""],[/<=>/,"","@binding_0"],[/=>\s*{/,"","@binding_1"],[//,"","@pop"],[/@symbols/,""]],binding_0:[{include:"@whitespace"},[/\{/,"","@binding_1"],[/;/,"","@pop"],[/\}/,"","@pop"],[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@numbers"},[/"/,"string","@string"],[/@symbols/,""]],binding_1:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/\[/,"","@push"],[/\]/,"","@pop"],[/@symbols/,""]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],numbers:[[/\d+(\.\d+)?\w*/,{token:"number"}],[/#[0-9a-fA-F]+/,{token:"number"}]]}};var Y0e;(function(n){function e(t){return typeof t=="string"}n.is=e})(Y0e||(Y0e={}));var sre;(function(n){function e(t){return typeof t=="string"}n.is=e})(sre||(sre={}));var J0e;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(J0e||(J0e={}));var XG;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(XG||(XG={}));var Lv;(function(n){function e(i,s){return i===Number.MAX_VALUE&&(i=XG.MAX_VALUE),s===Number.MAX_VALUE&&(s=XG.MAX_VALUE),{line:i,character:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&We.uinteger(s.line)&&We.uinteger(s.character)}n.is=t})(Lv||(Lv={}));var nd;(function(n){function e(i,s,o,r){if(We.uinteger(i)&&We.uinteger(s)&&We.uinteger(o)&&We.uinteger(r))return{start:Lv.create(i,s),end:Lv.create(o,r)};if(Lv.is(i)&&Lv.is(s))return{start:i,end:s};throw new Error(`Range#create called with invalid arguments[${i}, ${s}, ${o}, ${r}]`)}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&Lv.is(s.start)&&Lv.is(s.end)}n.is=t})(nd||(nd={}));var ZG;(function(n){function e(i,s){return{uri:i,range:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(We.string(s.uri)||We.undefined(s.uri))}n.is=t})(ZG||(ZG={}));var X0e;(function(n){function e(i,s,o,r){return{targetUri:i,targetRange:s,targetSelectionRange:o,originSelectionRange:r}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.targetRange)&&We.string(s.targetUri)&&nd.is(s.targetSelectionRange)&&(nd.is(s.originSelectionRange)||We.undefined(s.originSelectionRange))}n.is=t})(X0e||(X0e={}));var ore;(function(n){function e(i,s,o,r){return{red:i,green:s,blue:o,alpha:r}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.numberRange(s.red,0,1)&&We.numberRange(s.green,0,1)&&We.numberRange(s.blue,0,1)&&We.numberRange(s.alpha,0,1)}n.is=t})(ore||(ore={}));var Z0e;(function(n){function e(i,s){return{range:i,color:s}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&nd.is(s.range)&&ore.is(s.color)}n.is=t})(Z0e||(Z0e={}));var e1e;(function(n){function e(i,s,o){return{label:i,textEdit:s,additionalTextEdits:o}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.undefined(s.textEdit)||xS.is(s))&&(We.undefined(s.additionalTextEdits)||We.typedArray(s.additionalTextEdits,xS.is))}n.is=t})(e1e||(e1e={}));var t1e;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(t1e||(t1e={}));var i1e;(function(n){function e(i,s,o,r,a,c){const l={startLine:i,endLine:s};return We.defined(o)&&(l.startCharacter=o),We.defined(r)&&(l.endCharacter=r),We.defined(a)&&(l.kind=a),We.defined(c)&&(l.collapsedText=c),l}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.uinteger(s.startLine)&&We.uinteger(s.startLine)&&(We.undefined(s.startCharacter)||We.uinteger(s.startCharacter))&&(We.undefined(s.endCharacter)||We.uinteger(s.endCharacter))&&(We.undefined(s.kind)||We.string(s.kind))}n.is=t})(i1e||(i1e={}));var rre;(function(n){function e(i,s){return{location:i,message:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&ZG.is(s.location)&&We.string(s.message)}n.is=t})(rre||(rre={}));var n1e;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(n1e||(n1e={}));var s1e;(function(n){n.Unnecessary=1,n.Deprecated=2})(s1e||(s1e={}));var o1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&We.string(i.href)}n.is=e})(o1e||(o1e={}));var eq;(function(n){function e(i,s,o,r,a,c){let l={range:i,message:s};return We.defined(o)&&(l.severity=o),We.defined(r)&&(l.code=r),We.defined(a)&&(l.source=a),We.defined(c)&&(l.relatedInformation=c),l}n.create=e;function t(i){var s;let o=i;return We.defined(o)&&nd.is(o.range)&&We.string(o.message)&&(We.number(o.severity)||We.undefined(o.severity))&&(We.integer(o.code)||We.string(o.code)||We.undefined(o.code))&&(We.undefined(o.codeDescription)||We.string((s=o.codeDescription)===null||s===void 0?void 0:s.href))&&(We.string(o.source)||We.undefined(o.source))&&(We.undefined(o.relatedInformation)||We.typedArray(o.relatedInformation,rre.is))}n.is=t})(eq||(eq={}));var JF;(function(n){function e(i,s,...o){let r={title:i,command:s};return We.defined(o)&&o.length>0&&(r.arguments=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.title)&&We.string(s.command)}n.is=t})(JF||(JF={}));var xS;(function(n){function e(o,r){return{range:o,newText:r}}n.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}n.insert=t;function i(o){return{range:o,newText:""}}n.del=i;function s(o){const r=o;return We.objectLiteral(r)&&We.string(r.newText)&&nd.is(r.range)}n.is=s})(xS||(xS={}));var jM;(function(n){function e(i,s,o){const r={label:i};return s!==void 0&&(r.needsConfirmation=s),o!==void 0&&(r.description=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(We.string(s.description)||s.description===void 0)}n.is=t})(jM||(jM={}));var Ju;(function(n){function e(t){const i=t;return We.string(i)}n.is=e})(Ju||(Ju={}));var qA;(function(n){function e(o,r,a){return{range:o,newText:r,annotationId:a}}n.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}n.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}n.del=i;function s(o){const r=o;return xS.is(r)&&(jM.is(r.annotationId)||Ju.is(r.annotationId))}n.is=s})(qA||(qA={}));var tq;(function(n){function e(i,s){return{textDocument:i,edits:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&iq.is(s.textDocument)&&Array.isArray(s.edits)}n.is=t})(tq||(tq={}));var W4;(function(n){function e(i,s,o){let r={kind:"create",uri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="create"&&We.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(W4||(W4={}));var H4;(function(n){function e(i,s,o,r){let a={kind:"rename",oldUri:i,newUri:s};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}n.create=e;function t(i){let s=i;return s&&s.kind==="rename"&&We.string(s.oldUri)&&We.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(H4||(H4={}));var U4;(function(n){function e(i,s,o){let r={kind:"delete",uri:i};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="delete"&&We.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||We.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||We.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(U4||(U4={}));var are;(function(n){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(s=>We.string(s.kind)?W4.is(s)||H4.is(s)||U4.is(s):tq.is(s)))}n.is=e})(are||(are={}));class pY{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let s,o;if(i===void 0?s=xS.insert(e,t):Ju.is(i)?(o=i,s=qA.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.insert(e,t,o)),this.edits.push(s),o!==void 0)return o}replace(e,t,i){let s,o;if(i===void 0?s=xS.replace(e,t):Ju.is(i)?(o=i,s=qA.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.replace(e,t,o)),this.edits.push(s),o!==void 0)return o}delete(e,t){let i,s;if(t===void 0?i=xS.del(e):Ju.is(t)?(s=t,i=qA.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(t),i=qA.del(e,s)),this.edits.push(i),s!==void 0)return s}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class w7e{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let i;if(Ju.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error(`Id ${i} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${i}`);return this._annotations[i]=t,this._size++,i}nextId(){return this._counter++,this._counter.toString()}}class xZt{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new w7e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(tq.is(t)){const i=new pY(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new pY(e.changes[t]);this._textEditChanges[t]=i})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(iq.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let i=this._textEditChanges[t.uri];if(!i){const s=[],o={textDocument:t,edits:s};this._workspaceEdit.documentChanges.push(o),i=new pY(s,this._changeAnnotations),this._textEditChanges[t.uri]=i}return i}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let i=[];this._workspaceEdit.changes[e]=i,t=new pY(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new w7e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=W4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=W4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;jM.is(i)||Ju.is(i)?o=i:s=i;let r,a;if(o===void 0?r=H4.create(e,t,s):(a=Ju.is(o)?o:this._changeAnnotations.manage(o),r=H4.create(e,t,s,a)),this._workspaceEdit.documentChanges.push(r),a!==void 0)return a}deleteFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=U4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=U4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var r1e;(function(n){function e(i){return{uri:i}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)}n.is=t})(r1e||(r1e={}));var a1e;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.integer(s.version)}n.is=t})(a1e||(a1e={}));var iq;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&(s.version===null||We.integer(s.version))}n.is=t})(iq||(iq={}));var c1e;(function(n){function e(i,s,o,r){return{uri:i,languageId:s,version:o,text:r}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.string(s.languageId)&&We.integer(s.version)&&We.string(s.text)}n.is=t})(c1e||(c1e={}));var cre;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const i=t;return i===n.PlainText||i===n.Markdown}n.is=e})(cre||(cre={}));var V4;(function(n){function e(t){const i=t;return We.objectLiteral(t)&&cre.is(i.kind)&&We.string(i.value)}n.is=e})(V4||(V4={}));var l1e;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(l1e||(l1e={}));var d1e;(function(n){n.PlainText=1,n.Snippet=2})(d1e||(d1e={}));var h1e;(function(n){n.Deprecated=1})(h1e||(h1e={}));var u1e;(function(n){function e(i,s,o){return{newText:i,insert:s,replace:o}}n.create=e;function t(i){const s=i;return s&&We.string(s.newText)&&nd.is(s.insert)&&nd.is(s.replace)}n.is=t})(u1e||(u1e={}));var g1e;(function(n){n.asIs=1,n.adjustIndentation=2})(g1e||(g1e={}));var f1e;(function(n){function e(t){const i=t;return i&&(We.string(i.detail)||i.detail===void 0)&&(We.string(i.description)||i.description===void 0)}n.is=e})(f1e||(f1e={}));var p1e;(function(n){function e(t){return{label:t}}n.create=e})(p1e||(p1e={}));var m1e;(function(n){function e(t,i){return{items:t||[],isIncomplete:!!i}}n.create=e})(m1e||(m1e={}));var nq;(function(n){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(i){const s=i;return We.string(s)||We.objectLiteral(s)&&We.string(s.language)&&We.string(s.value)}n.is=t})(nq||(nq={}));var _1e;(function(n){function e(t){let i=t;return!!i&&We.objectLiteral(i)&&(V4.is(i.contents)||nq.is(i.contents)||We.typedArray(i.contents,nq.is))&&(t.range===void 0||nd.is(t.range))}n.is=e})(_1e||(_1e={}));var v1e;(function(n){function e(t,i){return i?{label:t,documentation:i}:{label:t}}n.create=e})(v1e||(v1e={}));var w1e;(function(n){function e(t,i,...s){let o={label:t};return We.defined(i)&&(o.documentation=i),We.defined(s)?o.parameters=s:o.parameters=[],o}n.create=e})(w1e||(w1e={}));var b1e;(function(n){n.Text=1,n.Read=2,n.Write=3})(b1e||(b1e={}));var C1e;(function(n){function e(t,i){let s={range:t};return We.number(i)&&(s.kind=i),s}n.create=e})(C1e||(C1e={}));var y1e;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(y1e||(y1e={}));var S1e;(function(n){n.Deprecated=1})(S1e||(S1e={}));var A1e;(function(n){function e(t,i,s,o,r){let a={name:t,kind:i,location:{uri:o,range:s}};return r&&(a.containerName=r),a}n.create=e})(A1e||(A1e={}));var E1e;(function(n){function e(t,i,s,o){return o!==void 0?{name:t,kind:i,location:{uri:s,range:o}}:{name:t,kind:i,location:{uri:s}}}n.create=e})(E1e||(E1e={}));var x1e;(function(n){function e(i,s,o,r,a,c){let l={name:i,detail:s,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}n.create=e;function t(i){let s=i;return s&&We.string(s.name)&&We.number(s.kind)&&nd.is(s.range)&&nd.is(s.selectionRange)&&(s.detail===void 0||We.string(s.detail))&&(s.deprecated===void 0||We.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}n.is=t})(x1e||(x1e={}));var D1e;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(D1e||(D1e={}));var sq;(function(n){n.Invoked=1,n.Automatic=2})(sq||(sq={}));var k1e;(function(n){function e(i,s,o){let r={diagnostics:i};return s!=null&&(r.only=s),o!=null&&(r.triggerKind=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.typedArray(s.diagnostics,eq.is)&&(s.only===void 0||We.typedArray(s.only,We.string))&&(s.triggerKind===void 0||s.triggerKind===sq.Invoked||s.triggerKind===sq.Automatic)}n.is=t})(k1e||(k1e={}));var I1e;(function(n){function e(i,s,o){let r={title:i},a=!0;return typeof s=="string"?(a=!1,r.kind=s):JF.is(s)?r.command=s:r.edit=s,a&&o!==void 0&&(r.kind=o),r}n.create=e;function t(i){let s=i;return s&&We.string(s.title)&&(s.diagnostics===void 0||We.typedArray(s.diagnostics,eq.is))&&(s.kind===void 0||We.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||JF.is(s.command))&&(s.isPreferred===void 0||We.boolean(s.isPreferred))&&(s.edit===void 0||are.is(s.edit))}n.is=t})(I1e||(I1e={}));var L1e;(function(n){function e(i,s){let o={range:i};return We.defined(s)&&(o.data=s),o}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.command)||JF.is(s.command))}n.is=t})(L1e||(L1e={}));var T1e;(function(n){function e(i,s){return{tabSize:i,insertSpaces:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.uinteger(s.tabSize)&&We.boolean(s.insertSpaces)}n.is=t})(T1e||(T1e={}));var R1e;(function(n){function e(i,s,o){return{range:i,target:s,data:o}}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.target)||We.string(s.target))}n.is=t})(R1e||(R1e={}));var M1e;(function(n){function e(i,s){return{range:i,parent:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(s.parent===void 0||n.is(s.parent))}n.is=t})(M1e||(M1e={}));var N1e;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(N1e||(N1e={}));var P1e;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(P1e||(P1e={}));var F1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}n.is=e})(F1e||(F1e={}));var O1e;(function(n){function e(i,s){return{range:i,text:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.string(s.text)}n.is=t})(O1e||(O1e={}));var B1e;(function(n){function e(i,s,o){return{range:i,variableName:s,caseSensitiveLookup:o}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.boolean(s.caseSensitiveLookup)&&(We.string(s.variableName)||s.variableName===void 0)}n.is=t})(B1e||(B1e={}));var W1e;(function(n){function e(i,s){return{range:i,expression:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&(We.string(s.expression)||s.expression===void 0)}n.is=t})(W1e||(W1e={}));var H1e;(function(n){function e(i,s){return{frameId:i,stoppedLocation:s}}n.create=e;function t(i){const s=i;return We.defined(s)&&nd.is(i.stoppedLocation)}n.is=t})(H1e||(H1e={}));var lre;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(lre||(lre={}));var dre;(function(n){function e(i){return{value:i}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.location===void 0||ZG.is(s.location))&&(s.command===void 0||JF.is(s.command))}n.is=t})(dre||(dre={}));var U1e;(function(n){function e(i,s,o){const r={position:i,label:s};return o!==void 0&&(r.kind=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&Lv.is(s.position)&&(We.string(s.label)||We.typedArray(s.label,dre.is))&&(s.kind===void 0||lre.is(s.kind))&&s.textEdits===void 0||We.typedArray(s.textEdits,xS.is)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.paddingLeft===void 0||We.boolean(s.paddingLeft))&&(s.paddingRight===void 0||We.boolean(s.paddingRight))}n.is=t})(U1e||(U1e={}));var V1e;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(V1e||(V1e={}));var z1e;(function(n){function e(t,i,s,o){return{insertText:t,filterText:i,range:s,command:o}}n.create=e})(z1e||(z1e={}));var $1e;(function(n){function e(t){return{items:t}}n.create=e})($1e||($1e={}));var G1e;(function(n){n.Invoked=0,n.Automatic=1})(G1e||(G1e={}));var q1e;(function(n){function e(t,i){return{range:t,text:i}}n.create=e})(q1e||(q1e={}));var Q1e;(function(n){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}n.create=e})(Q1e||(Q1e={}));var j1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&sre.is(i.uri)&&We.string(i.name)}n.is=e})(j1e||(j1e={}));const DZt=[` -`,`\r -`,"\r"];var K1e;(function(n){function e(o,r,a,c){return new kZt(o,r,a,c)}n.create=e;function t(o){let r=o;return!!(We.defined(r)&&We.string(r.uri)&&(We.undefined(r.languageId)||We.string(r.languageId))&&We.uinteger(r.lineCount)&&We.func(r.getText)&&We.func(r.positionAt)&&We.func(r.offsetAt))}n.is=t;function i(o,r){let a=o.getText(),c=s(r,(d,h)=>{let u=d.range.start.line-h.range.start.line;return u===0?d.range.start.character-h.range.start.character:u}),l=a.length;for(let d=c.length-1;d>=0;d--){let h=c[d],u=o.offsetAt(h.range.start),f=o.offsetAt(h.range.end);if(f<=l)a=a.substring(0,u)+h.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=u}return a}n.applyEdits=i;function s(o,r){if(o.length<=1)return o;const a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);s(c,r),s(l,r);let d=0,h=0,u=0;for(;d0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,s=t.length;if(s===0)return Lv.create(0,e);for(;ie?s=r:i=r+1}let o=i-1;return Lv.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],s=e.line+1"u"}n.undefined=i;function s(f){return f===!0||f===!1}n.boolean=s;function o(f){return e.call(f)==="[object String]"}n.string=o;function r(f){return e.call(f)==="[object Number]"}n.number=r;function a(f,p,m){return e.call(f)==="[object Number]"&&p<=f&&f<=m}n.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}n.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}n.uinteger=l;function d(f){return e.call(f)==="[object Function]"}n.func=d;function h(f){return f!==null&&typeof f=="object"}n.objectLiteral=h;function u(f,p){return Array.isArray(f)&&f.every(p)}n.typedArray=u})(We||(We={}));const IZt=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return qA},get ChangeAnnotation(){return jM},get ChangeAnnotationIdentifier(){return Ju},get CodeAction(){return I1e},get CodeActionContext(){return k1e},get CodeActionKind(){return D1e},get CodeActionTriggerKind(){return sq},get CodeDescription(){return o1e},get CodeLens(){return L1e},get Color(){return ore},get ColorInformation(){return Z0e},get ColorPresentation(){return e1e},get Command(){return JF},get CompletionItem(){return p1e},get CompletionItemKind(){return l1e},get CompletionItemLabelDetails(){return f1e},get CompletionItemTag(){return h1e},get CompletionList(){return m1e},get CreateFile(){return W4},get DeleteFile(){return U4},get Diagnostic(){return eq},get DiagnosticRelatedInformation(){return rre},get DiagnosticSeverity(){return n1e},get DiagnosticTag(){return s1e},get DocumentHighlight(){return C1e},get DocumentHighlightKind(){return b1e},get DocumentLink(){return R1e},get DocumentSymbol(){return x1e},get DocumentUri(){return Y0e},EOL:DZt,get FoldingRange(){return i1e},get FoldingRangeKind(){return t1e},get FormattingOptions(){return T1e},get Hover(){return _1e},get InlayHint(){return U1e},get InlayHintKind(){return lre},get InlayHintLabelPart(){return dre},get InlineCompletionContext(){return Q1e},get InlineCompletionItem(){return z1e},get InlineCompletionList(){return $1e},get InlineCompletionTriggerKind(){return G1e},get InlineValueContext(){return H1e},get InlineValueEvaluatableExpression(){return W1e},get InlineValueText(){return O1e},get InlineValueVariableLookup(){return B1e},get InsertReplaceEdit(){return u1e},get InsertTextFormat(){return d1e},get InsertTextMode(){return g1e},get Location(){return ZG},get LocationLink(){return X0e},get MarkedString(){return nq},get MarkupContent(){return V4},get MarkupKind(){return cre},get OptionalVersionedTextDocumentIdentifier(){return iq},get ParameterInformation(){return v1e},get Position(){return Lv},get Range(){return nd},get RenameFile(){return H4},get SelectedCompletionInfo(){return q1e},get SelectionRange(){return M1e},get SemanticTokenModifiers(){return P1e},get SemanticTokenTypes(){return N1e},get SemanticTokens(){return F1e},get SignatureInformation(){return w1e},get StringValue(){return V1e},get SymbolInformation(){return A1e},get SymbolKind(){return y1e},get SymbolTag(){return S1e},get TextDocument(){return K1e},get TextDocumentEdit(){return tq},get TextDocumentIdentifier(){return r1e},get TextDocumentItem(){return c1e},get TextEdit(){return xS},get URI(){return sre},get VersionedTextDocumentIdentifier(){return a1e},WorkspaceChange:xZt,get WorkspaceEdit(){return are},get WorkspaceFolder(){return j1e},get WorkspaceSymbol(){return E1e},get integer(){return J0e},get uinteger(){return XG}},Symbol.toStringTag,{value:"Module"}));function Qrt(n){return typeof n=="string"?pd.getModel(Pv.parse(n)):n??null}function LZt(n,e){const t=Qrt(n);if(t==null||e==null)return null;const i=e.lineNumber-1,s=t.getLineContent(e.lineNumber),r=new TextEncoder().encode(s.slice(0,e.column)).length;return{line:i,character:r}}function b7e(n,e){const t=Qrt(n);if(t==null||e==null)return null;const i=e.line+1,s=t.getLineContent(i),r=new TextEncoder().encode(s).slice(0,e.character),a=new TextDecoder().decode(r);return new qrt(i,a.length+1)}function TZt(n,e){const t=b7e(n,e?.start),i=b7e(n,e?.end);return t==null||i==null?null:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}}function hue(n,e,t="OK",i=()=>{},s=()=>{}){const o=document.createElement("dialog");o.classList.add("dialog"),o.classList.add("modal"),o.classList.add(n);const r=document.createElement("div");r.classList.add("titlebar");const a=document.createElement("i");a.classList.add("close_button"),a.classList.add("fa"),a.classList.add("fa-times"),a.onclick=()=>o.close(),r.appendChild(a);const c=document.createElement("div");c.classList.add("dialog_content");const l=document.createElement("button");let d=[];typeof e=="function"?d=e(u=>{l.disabled=!u}):d=e;for(const u of d)c.appendChild(u);const h=document.createElement("div");h.classList.add("button_row"),l.innerText=t,l.onclick=()=>{i(),o.close()},h.appendChild(l),o.appendChild(r),o.appendChild(c),o.appendChild(h),document.body.appendChild(o),o.onclose=s,o.showModal()}function RZt(n){alert(n)}function C7e(...n){const e=document.createElement("p");e.innerText="Share this URL:";const t=[e];for(const i of n){const s=document.createElement("div");s.classList.add("url");const o=document.createElement("p");o.className="url_text",o.innerHTML=''+i+"";const r=document.createElement("button");r.classList.add("button"),r.classList.add("copy_url"),r.onclick=()=>navigator.clipboard.writeText(i);const a=document.createElement("i");a.classList.add("fa"),a.classList.add("fa-copy"),r.appendChild(a),s.appendChild(o),s.appendChild(r),t.push(s)}hue("report_export_url",t)}async function MZt(n){const e=document.createElement("textarea");e.cols=80,e.rows=5,e.autofocus=!0,e.placeholder="Description";const t=document.createElement("div"),i=document.createElement("input");i.type="checkbox",i.id="is_public",i.checked=!0;const s=document.createElement("label");s.innerText="Create public Gist",s.htmlFor="is_public",t.appendChild(i),t.appendChild(s),hue("gist_export_dialog",[e,t],"Export",()=>n(e.value,i.checked))}function NZt(){const n=document.createElement("div");n.innerHTML=` +${r}`)}}};vDe=D([_(0,I6),_(1,Jt)],vDe);var bDe;let Oie=bDe=class{constructor(e,t,i,n){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=n,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||po)(),this.resolveUserHome=(async()=>{const o=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=o?.userHome??e})()}hasValidBasename(e,t,i){return typeof t=="string"||typeof t>"u"?this.resolveOS.then(n=>this.doHasValidBasename(e,n,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===pe.file||e.scheme===pe.vscodeRemote?Clt(i??_i(e),t===Ds.Windows):!0}get defaultUriScheme(){return bDe.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return pe.vscodeRemote;const i=Ptt(t.getWorkspace());if(i)return i;const n=t.getWorkspace().folders[0];if(n)return n.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:pe.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Ds.Windows?cc:Vi)}async fileURI(e){let t="";if(await this.resolveOS===Ds.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const n=e.indexOf("/",2);n===-1?(t=e.substring(2),e="/"):(t=e.substring(2,n),e=e.substring(n)||"/")}return N.from({scheme:pe.file,authority:t,path:e,query:"",fragment:""})}};Oie=bDe=D([_(1,hg),_(2,Jr),_(3,yi)],Oie);function AYt(s,e){const t=e.getWorkspace(),i=lm(t.folders);return i?i.uri:t.configuration?Lr(t.configuration):N.from({scheme:Oie.findDefaultUriScheme(s,e),authority:s.remoteAuthority,path:"/"})}class EYt{constructor(){this.todo=[],this.add=e=>{this.todo.push(e)}}take(e,t){this.add=i=>t.createInstance(i,e),this.todo.forEach(this.add),this.todo=[]}}const xYt=new EYt;let wDe=class extends V{constructor(e){super(),this.markInactive=this._register(new cn(()=>{this.isActive=!1,this.changeEmitter.fire(!1)},1e4)),this.changeEmitter=this._register(new I),this.active=0,this.isActive=!0,this.onDidChangeIsActive=this.changeEmitter.event,this._register(N2(()=>xYt.take(this,e)))}markActive(){return++this.active===1&&(this.isActive=!0,this.changeEmitter.fire(!0),this.markInactive.cancel()),Ee(()=>{--this.active===0&&this.markInactive.schedule()})}};wDe=D([_(0,we)],wDe);let yDe=class extends V{constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new hl}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,n){const o=this.configurationService.getValue("files.participants.timeout");if(!(typeof o!="number"||o<=0))for(const r of this.participants)try{await r.participate(e,t,i,o,n)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};yDe=D([_(0,Ge),_(1,Te)],yDe);let CDe=class extends V{get length(){return this.saveParticipants.length}constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=B1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.model?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||e.isDisposed())break;try{const r=o.participate(e,t,i,n);await U_(r,n)}catch(r){this.logService.warn(r)}}e.model?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};CDe=D([_(0,Ge)],CDe);let SDe=class extends V{constructor(e,t,i,n){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=n,this._onWillRunWorkingCopyFileOperation=this._register(new jx),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new jx),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new jx),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(yDe)),this.saveParticipants=this._register(this.instantiationService.createInstance(CDe)),this.workingCopyProviders=[],this._register(this.registerWorkingCopyProvider(o=>this.workingCopyService.workingCopies.filter(r=>this.fileService.hasProvider(o)?this.uriIdentityService.extUri.isEqualOrParent(r.resource,o):this.uriIdentityService.extUri.isEqual(r.resource,o))))}create(e,t,i){return this.doCreateFileOrFolder(e,!0,t,i)}createFolder(e,t,i){return this.doCreateFileOrFolder(e,!1,t,i)}async doCreateFileOrFolder(e,t,i,n){if(e.length===0)return[];if(t){const l=(await Zs.settled(e.map(d=>this.fileService.canCreateFile(d.resource,{overwrite:d.overwrite})))).find(d=>d instanceof Error);if(l instanceof Error)throw l}const o=e.map(c=>({target:c.resource}));await this.runFileOperationParticipants(o,Ai.CREATE,n,i);const r={correlationId:this.correlationIds++,operation:Ai.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,He.None);let a;try{t?a=await Zs.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await Zs.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,He.None),a}async move(e,t,i){return this.doMoveOrCopy(e,!0,t,i)}async copy(e,t,i){return this.doMoveOrCopy(e,!1,t,i)}async doMoveOrCopy(e,t,i,n){const o=[];for(const{file:{source:c,target:l},overwrite:d}of e){const h=await(t?this.fileService.canMove(c,l,d):this.fileService.canCopy(c,l,d));if(h instanceof Error)throw h}const r=e.map(c=>c.file);await this.runFileOperationParticipants(r,t?Ai.MOVE:Ai.COPY,n,i);const a={correlationId:this.correlationIds++,operation:t?Ai.MOVE:Ai.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,He.None);try{for(const{file:{source:c,target:l},overwrite:d}of e){if(!this.uriIdentityService.extUri.isEqual(c,l)){const h=t?[...this.getDirty(c),...this.getDirty(l)]:this.getDirty(l);await Zs.settled(h.map(u=>u.revert({soft:!0})))}t?o.push(await this.fileService.move(c,l,d)):o.push(await this.fileService.copy(c,l,d))}}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(a,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,He.None),o}async delete(e,t,i){for(const r of e){const a=await this.fileService.canDelete(r.resource,{recursive:r.recursive,useTrash:r.useTrash});if(a instanceof Error)throw a}const n=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(n,Ai.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Ai.DELETE,files:n};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,He.None);for(const r of e){const a=this.getDirty(r.resource);await Zs.settled(a.map(c=>c.revert({soft:!0})))}try{for(const r of e)await this.fileService.del(r.resource,{recursive:r.recursive,useTrash:r.useTrash})}catch(r){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(o,He.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,He.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,n){return this.fileOperationParticipants.participate(e,t,i,n)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}registerWorkingCopyProvider(e){const t=B1e(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const n of i(e))n.isDirty()&&t.add(n);return Array.from(t)}};SDe=D([_(0,Jt),_(1,Rm),_(2,we),_(3,ks)],SDe);const DYt=eh.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(858,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(859,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(860,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(861,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(862,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(863,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(864,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(865,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(866,"Suffix appended to the workspace label.")}}}}}}}),H3e=/\//g,kYt=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function IYt(s){return!!(s&&s[2]===":")}let ADe=class{constructor(e){this.formattersDisposables=new Map,DYt.setHandler((t,i)=>{for(const n of i.added)for(const o of n.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=ou),!dl(n.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const n of i.removed)for(const o of n.value)bt(this.formattersDisposables.get(o))})}};ADe=D([_(0,Fs)],ADe);Qe.as(cf.Workbench).registerWorkbenchContribution(ADe,Rs.Restored);const U3e=50;let EDe=class extends V{constructor(e,t,i,n,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=n,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=po,this.userHome=i.defaultUriScheme===pe.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new sI("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(Ie.PROFILE,an.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??po,this.userHome=await this.pathService.userHome()}findFormatting(e){let t;for(const i of this.formatters)if(i.scheme===e.scheme){if(!i.authority&&(!t||i.priority)){t=i;continue}if(!i.authority)continue;zO(i.authority.toLowerCase(),e.authority.toLowerCase())&&(!t||!t.authority||i.authority.length>t.authority.length||i.authority.length===t.authority.length&&i.priority)&&(t=i)}return t?t.formatting:void 0}getUriLabel(e,t={}){let i=this.findFormatting(e);i&&t.separator&&(i={...i,separator:t.separator});const n=this.doGetUriLabel(e,i,t);return!i&&t.separator?n.replace(H3e,t.separator):n}doGetUriLabel(e,t,i={}){if(!t)return LMt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:n=>this.contextService.getWorkspaceFolder(n)}:void 0});if(i.relative&&this.contextService){let n=this.contextService.getWorkspaceFolder(e);if(!n){const o=this.contextService.getWorkspace(),r=lm(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(Vi.sep)&&(n=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(n){const o=this.formatUri(n.uri,t,i.noPrefix);let r=this.formatUri(e,t,i.noPrefix),a=0;for(;r[a]&&r[a]===o[a];)a++;if(!r[a]||r[a]===t.separator?r=r.substring(1+a):a===o.length&&n.uri.path===Vi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=n?.name??EA(n.uri);r=r?`${l} • ${r}`:l}return r}}return this.formatUri(e,t,i.noPrefix)}getUriBasenameLabel(e){const t=this.findFormatting(e),i=this.doGetUriLabel(e,t);let n;return t?.separator===cc.sep?n=cc:t?.separator===Vi.sep?n=Vi:n=this.os===Ds.Windows?cc:Vi,n.basename(i)}getWorkspaceLabel(e,t){if(Yme(e)){const i=GO(e);return P_(i)||iA(i)?this.getWorkspaceLabel(i,t):""}return N.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):P_(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):iA(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(g3(e,this.environmentService))return g(867,"Untitled (Workspace)");if(Py(e))return g(868,"Workspace");let i=_i(e);i.endsWith(xb)&&(i=i.substr(0,i.length-xb.length-1));let n;switch(t?.verbose){case Op.SHORT:n=i;break;case Op.LONG:n=g(869,"{0} (Workspace)",this.getUriLabel(Pt(Lr(e),i)));break;case Op.MEDIUM:default:n=g(870,"{0} (Workspace)",i);break}return t?.verbose===Op.SHORT?n:this.appendWorkspaceSuffix(n,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case Op.LONG:i=this.getUriLabel(e);break;case Op.SHORT:case Op.MEDIUM:default:i=_i(e)||Vi.sep;break}return t?.verbose===Op.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.separator||Vi.sep}getHostLabel(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(n=>n.scheme===e.scheme&&n.authority===e.authority);if(i===-1&&t.length>=U3e&&(i=U3e-1),i===-1)t.unshift(e);else{for(let n=i;n>0;n--)t[n]=t[n-1];t[0]=e}return this.storedFormattersMemento.saveMemento(),this.registerFormatter(e)}registerFormatter(e){return this.formatters.push(e),this._onDidChangeFormatters.fire({scheme:e.scheme}),{dispose:()=>{this.formatters=this.formatters.filter(t=>t!==e),this._onDidChangeFormatters.fire({scheme:e.scheme})}}}formatUri(e,t,i){let n=t.label.replace(kYt,(o,r,a,c)=>{switch(r){case"scheme":return e.scheme;case"authority":return e.authority;case"authoritySuffix":{const l=e.authority.indexOf("+");return l===-1?e.authority:e.authority.slice(l+1)}case"path":return t.stripPathStartingSeparator?e.path.slice(e.path[0]===t.separator?1:0):e.path;default:{if(a==="query"){const{query:l}=e;if(l&&l[0]==="{"&&l[l.length-1]==="}")try{return JSON.parse(l)[c]||""}catch{}}return""}}});return t.normalizeDriveLetter&&IYt(n)&&(n=n.charAt(1).toUpperCase()+n.substr(2)),t.tildify&&!i&&this.userHome&&(n=KXe(n,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(n=t.authorityPrefix+n),n.replace(H3e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),n=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return n?`${e} [${n}]`:e}};EDe=D([_(0,Jr),_(1,yi),_(2,bf),_(3,hg),_(4,$i),_(5,ig)],EDe);let xDe=class extends Oie{constructor(e,t,i){super(g4t().userHome??AYt(t,i),e,t,i)}};xDe=D([_(0,hg),_(1,Jr),_(2,yi)],xDe);function TYt(){return{[I6.toString()]:new wi(mDe,[],!0),[HRe.toString()]:new wi(vDe,[],!0),[iE.toString()]:new wi(fDe,[],!0),[DI.toString()]:new wi(gDe,[],!0),[Nae.toString()]:new wi(WRe,[],!0),[Uae.toString()]:new wi(_De,[],!0),[zRe.toString()]:new wi(SYt,[],!1),[aMe.toString()]:new wi(wDe,[],!0),[zb.toString()]:new wi(SDe,[],!1),[bf.toString()]:new wi(xDe,[],!0),[nce.toString()]:new wi(JSe,[],!0),[Fs.toString()]:new wi(EDe,[],!0)}}var V3e;(function(s){s[s.NONE=0]="NONE",s[s.EDITS=1]="EDITS",s[s.NAVIGATION=2]="NAVIGATION"})(V3e||(V3e={}));var z3e;(function(s){s[s.DEFAULT=0]="DEFAULT",s[s.EDITOR_GROUP=1]="EDITOR_GROUP",s[s.EDITOR=2]="EDITOR"})(z3e||(z3e={}));async function LYt(s,e=document.body,t={},i){btt(),p4t(e,t,i);const n=Dt.initialize({[Er.toString()]:gp({version:"1.92.2",quality:"stable",commit:"fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",nameShort:"Code - OSS",nameLong:"Code - OSS",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverApplicationName:"code-server-oss"},t.productConfiguration??{}),...oYt(),...sYt(),...nYt(),...Rce(),...Xzt(),...aYt(),...TYt(),...s});await v4t(n)}async function vst(s){return await vtt(),Dt.get(s)}function bst(s){if(fNe.isOpen())return Dt.get(we).invokeFunction(s);const e=new Z,t=e.add(gtt.event(()=>{t.dispose(),e.add(Dt.get(we).invokeFunction(s))}));return e}function DDe(s,e){const t=kn(s.editor)?xs(s.editor):Object.create(null);return Object.assign(t,xs(e)),t}function $3e(s,e){const t=DDe(s);if(kn(s.diffEditor)){const i=xs(s.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=s.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,xs(e)),t}function wst(s){let e=class extends s{constructor(i,n={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=n,b=DDe(r.getValue(n.model?.uri),v);super(o,i,{...b,overflowWidgetsDomNode:p,dimension:m,theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f}),this.textResourceConfigurationService=r,this.optionsOverrides={},this.lastAppliedEditorOptions=b,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(C=>{const A=this.getModel()?.uri;A!=null&&C.affectsConfiguration(A,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const w=o.createChild(new Uc([Le,this._contextKeyService])),y=this._register(w.createInstance(M3));this.onDidChangeModel(C=>{y.set(C.newModelUrl)}),y.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,n=this.textResourceConfigurationService.getValue(i);if(n==null)return;const o=DDe(n,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=o8(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),lS.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,we),_(3,Ec)],e),e}const RYt=wst(BRe(Yk)),MYt=wst(BRe(IM));let kDe=class extends BRe(TJ){constructor(e,t={},i,n){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=$3e(n.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=n,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(n.onDidChangeConfiguration(f=>{const p=this._targetEditor.getModel()?.uri;p!=null&&(f.affectsConfiguration(p,"editor")||f.affectsConfiguration(p,"diffEditor")||f.affectsConfiguration(p,"accessibility.verbosity.diffEditor"))&&this.updateEditorConfiguration()})),this._register(this._targetEditor.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration()}updateEditorConfiguration(){if(this.getModel()==null||this.textResourceConfigurationService==null)return;const e=this._targetEditor.getModel()?.uri,t=this.textResourceConfigurationService.getValue(e);if(t==null)return;const i=$3e(t,this.optionsOverrides);let n=i;this.lastAppliedEditorOptions!=null&&(n=o8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(n))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(RYt,t,i)}};kDe=D([_(2,we),_(3,Ec)],kDe);async function yst(s,e){await(await vst(Jt)).writeFile(s,$e.fromString(e))}async function NYt(s,e){return e!=null&&await yst(s,e),await(await vst(fn)).createModelReference(s)}function PYt(s){return s.registerKeybindingProvider!=null}let IDe=class extends jk{constructor(e,t,i,n,o,r,a){super(t,i,n,o,r,a),this.delegate=e,this._register(e.registerKeybindingProvider({provideKeybindings:()=>this.getUserKeybindingItems(),onDidChangeKeybindings:this.onDidUpdateKeybindings}))}_getResolver(){return this.delegate._getResolver()}resolveKeyboardEvent(e){return this.delegate.resolveKeyboardEvent(e)}resolveKeybinding(e){return this.delegate.resolveKeybinding(e)}resolveUserBinding(e){return this.delegate.resolveUserBinding(e)}_dumpDebugInfo(){return this.delegate._dumpDebugInfo()}_dumpDebugInfoJSON(){return this.delegate._dumpDebugInfoJSON()}registerSchemaContribution(e){return this.delegate.registerSchemaContribution(e)}enableKeybindingHoldMode(e){return this.delegate.enableKeybindingHoldMode(e)}};IDe=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,Ge),_(6,Kt)],IDe);let Wue=null;function Cst(s){if(Wue==null){const e=new Uc;e.set(In,new wi(k3,[],!0));const t=s.get(Ut);!(t instanceof jk)&&PYt(t)&&e.set(Ut,new wi(IDe,[t],!0)),Wue=s.get(we).createChild(e)}return Wue}const FYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(Cst).createInstance(MYt,s,e),OYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(Cst).createInstance(kDe,s,e);var BYt='.monaco-editor.standalone{--monaco-monospace-font:"SF Mono",Monaco,Menlo,Consolas,"Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;top:0;width:1px}.monaco-diff-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone [tabindex="-1"]:focus,.monaco-diff-editor.standalone [tabindex="0"]:focus,.monaco-diff-editor.standalone button:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone select:focus,.monaco-diff-editor.standalone textarea:focus,.monaco-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex="-1"]:focus,.monaco-editor.standalone [tabindex="0"]:focus,.monaco-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-editor.standalone textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}';ut(BYt,{});var $H;(function(s){s[s.None=0]="None",s[s.Open=1]="Open",s[s.Close=-1]="Close"})($H||($H={}));function WYt(s){return Array.isArray(s)}function HYt(s){return!WYt(s)}function Sst(s){return typeof s=="string"}function G3e(s){return!Sst(s)}function o1(s){return!s}function mA(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function K3e(s){return s.replace(/[&<>'"_]/g,"-")}function UYt(s,e){console.log(`${s.languageId}: ${e}`)}function tr(s,e){return new Error(`${s.languageId}: ${e}`)}function rx(s,e,t,i,n){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,c,l,d,h,u,f,p,m){return o1(l)?o1(d)?!o1(h)&&h0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function zYt(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var TDe;const Ast=5,ere=class ere{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new dB(e,t);let i=dB.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new dB(e,t),this._entries[i]=n,n)}};ere._INSTANCE=new ere(Ast);let z$=ere;class dB{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return dB._equals(this,e)}push(e){return z$.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return z$.create(this.parent,e)}}class NF{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new NF(this.languageId,this.state)}}const tre=class tre{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new bz(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new bz(e,t);const i=dB.getStackElementId(e);let n=this._entries[i];return n||(n=new bz(e,null),this._entries[i]=n,n)}};tre._INSTANCE=new tre(Ast);let ax=tre;class bz{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:ax.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof bz)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class $Yt{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new _8(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=Ta.get(o);if(!a)return this.enterLanguage(o),this.emit(n,""),r;const c=a.tokenize(e,t,r);if(n!==0)for(const l of c.tokens)this._tokens.push(new _8(l.offset+n,l.type,l.language));else this._tokens=this._tokens.concat(c.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new iTe(this._tokens,e)}}class Bie{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=_T.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|Hi.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(n+o+r);e!==null&&a.set(e);for(let c=0;c{if(r)return;let c=!1;for(let l=0,d=a.changedLanguages.length;l{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=Ta.get(t);if(i){if(i instanceof TDe){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}Ta.isResolved(t)||e.push(Ta.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=z$.create(null,this._lexer.start);return ax.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return UKe(this._languageId,i);const n=new $Yt,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return ATe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Bie(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=WK(this._lexer,t.stack.state),!i))throw tr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!G3e(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const c=a.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(c.substr(4,c.length-5),d)}const l=e.search(a);l===-1||l!==0&&r.matchOnlyAtLineStart||(n===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const c=e.substring(r);return this._myTokenize(c,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,c=a.length;let l=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h=c)break;f=!1;let R=this._lexer.tokenizer[b];if(!R&&(R=WK(this._lexer,b),!R))throw tr(this._lexer,"tokenizer state is not defined: "+b);const z=a.substr(h);for(const G of R)if((h===0||!G.matchOnlyAtLineStart)&&(w=z.match(G.resolveRegex(b)),w)){y=w[0],C=G.action;break}}if(w||(w=[""],y=""),C||(h=this._lexer.maxStack)throw tr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(C.next==="@pop"){if(d.depth<=1)throw tr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(A));d=d.pop()}else if(C.next==="@popall")d=d.popall();else{let R=rx(this._lexer,C.next,y,w,b);if(R[0]==="@"&&(R=R.substr(1)),WK(this._lexer,R))d=d.push(R);else throw tr(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(A))}}C.log&&typeof C.log=="string"&&UYt(this._lexer,this._lexer.languageId+": "+rx(this._lexer,C.log,y,w,b))}if(k===null)throw tr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(A));const P=R=>{const z=this._languageService.getLanguageIdByLanguageName(R)||this._languageService.getLanguageIdByMimeType(R)||R,G=this._getNestedEmbeddedLanguageData(z);if(h0)throw tr(this._lexer,"groups cannot be nested: "+this._safeRuleName(A));if(w.length!==k.length+1)throw tr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(A));let R=0;for(let z=1;zs});class wPe{static colorizeElement(e,t,i,n){n=n||{};const o=n.theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const l=d=>{const h=KYt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,n).then(l,d=>console.error(d))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),eTe(t)&&(t=t.substr(1));const a=ov(t);if(!e.isRegisteredLanguageId(i))return q3e(a,r,o);const c=await Ta.getOrCreate(i);return c?qYt(a,r,c,o):q3e(a,r,o)}static colorizeLine(e,t,i,n,o=4){const r=fp.isBasicASCII(e,t),a=fp.containsRTL(e,r,i);return Ure(new yI(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function qYt(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=QYt(s,e,t,i);if(t instanceof $$){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}n(a)};r()})}function q3e(s,e,t){let i=[];const n=(Vo.None<>>0,o=new Uint32Array(2);o[0]=0,o[1]=n;for(let r=0,a=s.length;r")}return i.join("")}function QYt(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r"),o=l.endState}return n.join("")}function jYt(s,e,t){return Dt.initialize(t||{}).createInstance(IM,s,e)}function YYt(s){return Dt.get(Kt).onCodeEditorAdd(t=>{s(t)})}function JYt(s){return Dt.get(Kt).onDiffEditorAdd(t=>{s(t)})}function XYt(){return Dt.get(Kt).listCodeEditors()}function ZYt(){return Dt.get(Kt).listDiffEditors()}function eJt(s,e,t){return Dt.initialize(t||{}).createInstance(TJ,s,e)}function tJt(s,e){const t=Dt.initialize(e||{});return new Cve(s,{},t)}function iJt(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return _t.registerCommand(s.id,s.run)}function nJt(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=he.deserialize(s.precondition),t=(n,...o)=>hc.runEditorCommand(n,o,e,(r,a,c)=>Promise.resolve(s.run(a,...c))),i=new Z;if(i.add(_t.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(jn.appendMenuItem(_e.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Dt.get(Ut);if(!(n instanceof jk))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=he.and(e,he.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function sJt(s){return Est([s])}function Est(s){const e=Dt.get(Ut);return e instanceof jk?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:he.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),V.None)}function oJt(s,e,t){const i=Dt.get(xi),n=i.getLanguageIdByMimeType(e)||e;return zYe(Dt.get(gi),i,s,n,t)}function rJt(s,e){const t=Dt.get(xi),i=t.getLanguageIdByMimeType(e)||e||Ca;s.setLanguage(t.createById(i))}function aJt(s,e,t){s&&Dt.get(Am).changeOne(e,s.uri,t)}function cJt(s){Dt.get(Am).changeAll(s,[])}function lJt(s){return Dt.get(Am).read(s)}function dJt(s){return Dt.get(Am).onMarkerChanged(s)}function hJt(s){return Dt.get(gi).getModel(s)}function uJt(){return Dt.get(gi).getModels()}function gJt(s){return Dt.get(gi).onModelAdded(s)}function fJt(s){return Dt.get(gi).onModelRemoved(s)}function pJt(s){return Dt.get(gi).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function mJt(s){return ygt(Dt.get(gi),Dt.get(Vs),s)}function _Jt(s,e){const t=Dt.get(xi),i=Dt.get(cv);return wPe.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function vJt(s,e,t){const i=Dt.get(xi);return Dt.get(cv).registerEditorContainer(si.document.body),wPe.colorize(i,s,e,t)}function bJt(s,e,t=4){return Dt.get(cv).registerEditorContainer(si.document.body),wPe.colorizeModelLine(s,e,t)}function wJt(s){const e=Ta.get(s);return e||{getInitialState:()=>B8,tokenize:(t,i,n)=>UKe(s,n)}}function yJt(s,e){Ta.getOrCreate(e);const t=wJt(e),i=ov(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const o=t.options?.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await s.openCodeEditor(i,t.resource,r)?i:null})}function kJt(){return{create:jYt,getEditors:XYt,getDiffEditors:ZYt,onDidCreateEditor:YYt,onDidCreateDiffEditor:JYt,createDiffEditor:eJt,addCommand:iJt,addEditorAction:nJt,addKeybindingRule:sJt,addKeybindingRules:Est,createModel:oJt,setModelLanguage:rJt,setModelMarkers:aJt,getModelMarkers:lJt,removeAllMarkers:cJt,onDidChangeMarkers:dJt,getModels:uJt,getModel:hJt,onDidCreateModel:gJt,onWillDisposeModel:fJt,onDidChangeModelLanguage:pJt,createWebWorker:mJt,colorizeElement:_Jt,colorize:vJt,colorizeModelLine:bJt,tokenize:yJt,defineTheme:CJt,setTheme:SJt,remeasureFonts:AJt,registerCommand:EJt,registerLinkOpener:xJt,registerEditorOpener:DJt,AccessibilitySupport:gfe,ContentWidgetPositionPreference:bfe,CursorChangeReason:wfe,DefaultEndOfLine:yfe,EditorAutoIndentStrategy:Sfe,EditorOption:Afe,EndOfLinePreference:Efe,EndOfLineSequence:xfe,MinimapPosition:Ofe,MinimapSectionHeaderStyle:Bfe,MouseTargetType:Wfe,OverlayWidgetPositionPreference:Vfe,OverviewRulerLane:zfe,GlyphMarginLane:Dfe,RenderLineNumbersType:Kfe,RenderMinimap:qfe,ScrollbarVisibility:jfe,ScrollType:Qfe,TextEditorCursorBlinkingStyle:tpe,TextEditorCursorStyle:ipe,TrackedRangeStickiness:npe,WrappingIndent:spe,InjectedTextCursorStops:Tfe,PositionAffinity:Gfe,ShowLightbulbIconMode:Jfe,ConfigurationChangedEvent:iGe,BareFontInfo:wx,FontInfo:_q,TextModelResolvedOptions:wq,FindMatch:F8,ApplyUpdateResult:JV,EditorZoom:Qp,createMultiFileDiffEditor:tJt,EditorType:CU,EditorOptions:wh}}function IJt(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function HK(s,e){return typeof s=="boolean"?s:e}function Q3e(s,e){return typeof s=="string"?s:e}function TJt(s){const e={};for(const t of s)e[t]=!0;return e}function j3e(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=TJt(s);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function LDe(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let c="";if(typeof s[a]=="string")c=s[a];else if(s[a]&&s[a]instanceof RegExp)c=s[a].source;else throw s[a]===void 0?tr(s,"language definition does not contain attribute '"+a+"', used at: "+e):tr(s,"attribute reference '"+a+"' must be a string, used at: "+e);return o1(c)?"":"(?:"+c+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,c=null;return l=>(c&&a===l||(a=l,c=new RegExp(VYt(s,e,l),o)),c)}return new RegExp(e,o)}function LJt(s,e,t,i){if(i<0)return s;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=$H.Open;else if(t.bracket==="@close")i.bracket=$H.Close;else throw tr(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw tr(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!zYt(s,rx(s,n,"",[],""))))throw tr(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=LDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=RDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function xst(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:HK(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:HK(e.ignoreCase,!1),unicode:HK(e.unicode,!1),tokenPostfix:Q3e(e.tokenPostfix,"."+s),defaultToken:Q3e(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=s,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw tr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw tr(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new MJt(r);if(Array.isArray(l)&&l.length>=1&&l.length<=3)if(h.setRegex(i,l[0]),l.length>=3)if(typeof l[1]=="string")h.setAction(i,{token:l[1],next:l[2]});else if(typeof l[1]=="object"){const u=l[1];u.next=l[2],h.setAction(i,u)}else throw tr(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,l[1]);else{if(!l.regex)throw tr(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=HK(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw tr(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw tr(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw tr(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:mA(t,a.open),close:mA(t,a.close)});else throw tr(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function NJt(s){wT.registerLanguage(s)}function PJt(){let s=[];return s=s.concat(wT.getLanguages()),s}function FJt(s){return Dt.get(xi).languageIdCodec.encodeLanguageId(s)}function OJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function BJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function WJt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Dt.get(Vs).register(s,e,100)}class HJt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return G$.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Lre(n.tokens,n.endState)}}class G${constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;l===0?f=0:f{const i=await Promise.resolve(e.create());return i?UJt(i)?kst(s,i):new $$(Dt.get(xi),Dt.get(cv),s,xst(s,i),Dt.get(Te)):null});return Ta.registerFactory(s,t)}function $Jt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return Dst(e)?yPe(s,{create:()=>e}):Ta.register(s,kst(s,e))}function GJt(s,e){const t=i=>new $$(Dt.get(xi),Dt.get(cv),s,xst(s,i),Dt.get(Te));return Dst(e)?yPe(s,{create:()=>e}):Ta.register(s,t(e))}function KJt(s,e){return Dt.get(it).referenceProvider.register(s,e)}function qJt(s,e){return Dt.get(it).renameProvider.register(s,e)}function QJt(s,e){return Dt.get(it).newSymbolNamesProvider.register(s,e)}function jJt(s,e){return Dt.get(it).signatureHelpProvider.register(s,e)}function YJt(s,e){return Dt.get(it).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new F(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),c.range||(c.range=new F(n.lineNumber,n.column,n.lineNumber,n.column)),c})}})}function JJt(s,e){return Dt.get(it).documentSymbolProvider.register(s,e)}function XJt(s,e){return Dt.get(it).documentHighlightProvider.register(s,e)}function ZJt(s,e){return Dt.get(it).linkedEditingRangeProvider.register(s,e)}function eXt(s,e){return Dt.get(it).definitionProvider.register(s,e)}function tXt(s,e){return Dt.get(it).implementationProvider.register(s,e)}function iXt(s,e){return Dt.get(it).typeDefinitionProvider.register(s,e)}function nXt(s,e){return Dt.get(it).codeLensProvider.register(s,e)}function sXt(s,e,t){return Dt.get(it).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const l=Dt.get(Am).read({resource:n.uri}).filter(d=>F.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function oXt(s,e){return Dt.get(it).documentFormattingEditProvider.register(s,e)}function rXt(s,e){return Dt.get(it).documentRangeFormattingEditProvider.register(s,e)}function aXt(s,e){return Dt.get(it).onTypeFormattingEditProvider.register(s,e)}function cXt(s,e){return Dt.get(it).linkProvider.register(s,e)}function lXt(s,e){return Dt.get(it).completionProvider.register(s,e)}function dXt(s,e){return Dt.get(it).colorProvider.register(s,e)}function hXt(s,e){return Dt.get(it).foldingRangeProvider.register(s,e)}function uXt(s,e){return Dt.get(it).declarationProvider.register(s,e)}function gXt(s,e){return Dt.get(it).selectionRangeProvider.register(s,e)}function fXt(s,e){return Dt.get(it).documentSemanticTokensProvider.register(s,e)}function pXt(s,e){return Dt.get(it).documentRangeSemanticTokensProvider.register(s,e)}function mXt(s,e){return Dt.get(it).inlineCompletionsProvider.register(s,e)}function _Xt(s,e){return Dt.get(it).inlineEditProvider.register(s,e)}function vXt(s,e){return Dt.get(it).inlayHintsProvider.register(s,e)}function bXt(){return{register:NJt,getLanguages:PJt,onLanguage:OJt,onLanguageEncountered:BJt,getEncodedLanguageId:FJt,setLanguageConfiguration:WJt,setColorMap:zJt,registerTokensProviderFactory:yPe,setTokensProvider:$Jt,setMonarchTokensProvider:GJt,registerReferenceProvider:KJt,registerRenameProvider:qJt,registerNewSymbolNameProvider:QJt,registerCompletionItemProvider:lXt,registerSignatureHelpProvider:jJt,registerHoverProvider:YJt,registerDocumentSymbolProvider:JJt,registerDocumentHighlightProvider:XJt,registerLinkedEditingRangeProvider:ZJt,registerDefinitionProvider:eXt,registerImplementationProvider:tXt,registerTypeDefinitionProvider:iXt,registerCodeLensProvider:nXt,registerCodeActionProvider:sXt,registerDocumentFormattingEditProvider:oXt,registerDocumentRangeFormattingEditProvider:rXt,registerOnTypeFormattingEditProvider:aXt,registerLinkProvider:cXt,registerColorProvider:dXt,registerFoldingRangeProvider:hXt,registerDeclarationProvider:uXt,registerSelectionRangeProvider:gXt,registerDocumentSemanticTokensProvider:fXt,registerDocumentRangeSemanticTokensProvider:pXt,registerInlineCompletionsProvider:mXt,registerInlineEditProvider:_Xt,registerInlayHintsProvider:vXt,DocumentHighlightKind:Cfe,CompletionItemKind:mfe,CompletionItemTag:_fe,CompletionItemInsertTextRule:pfe,SymbolKind:Zfe,SymbolTag:epe,IndentAction:Ife,CompletionTriggerKind:vfe,SignatureHelpTriggerKind:Xfe,InlayHintKind:Lfe,InlineCompletionTriggerKind:Rfe,InlineEditTriggerKind:Mfe,CodeActionTriggerType:ffe,NewSymbolNameTag:Hfe,NewSymbolNameTriggerKind:Ufe,PartialAcceptTriggerKind:$fe,HoverVerbosityAction:kfe,FoldingRangeKind:l_,SelectedSuggestionInfo:pGe}}wh.wrappingIndent.defaultValue=Nu.None;wh.glyphMargin.defaultValue=!1;wh.autoIndent.defaultValue=ll.Advanced;wh.overviewRulerLanes.defaultValue=2;gW.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const vu=_Ge();vu.editor=kJt();vu.languages=bXt();vu.CancellationTokenSource;vu.Emitter;vu.KeyCode;vu.KeyMod;vu.Position;vu.Range;vu.Selection;vu.SelectionDirection;vu.MarkerSeverity;vu.MarkerTag;const Yv=vu.Uri;vu.Token;const pN=vu.editor,Gx=vu.languages,wXt=globalThis.MonacoEnvironment;(wXt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=vu);const yXt=Gx.onLanguage;Gx.onLanguage=(s,e)=>bst(()=>yXt(s,e));const CXt=Gx.onLanguage;Gx.onLanguageEncountered=(s,e)=>bst(()=>CXt(s,e));pN.create=FYt;pN.createDiffEditor=OYt;pN.createModelReference=NYt;pN.writeFile=yst;const SXt={defaultToken:"invalid",root_keywords:["import","from","export","global","component","struct","inherits"],inner_keywords:["property","callback","animate","states","transitions","if","for","in","out","in-out","private","function","pure","public"],lang_keywords:["root","parent","this","if"],type_keywords:["int","string","float","length","physical_length","duration","color","brush"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,symbols:/[#!%&*+\-./:;<=>@^|_?,()]+/,tokenizer:{root:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@root_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@inner"],[/@symbols/,""]],inner:[[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:=/,"variable.parameter"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:\s*\{/,"variable.parameter","@binding_1"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:/,"variable.parameter","@binding_0"],[/[a-zA-Z_][a-zA-Z0-9_-]*/,{cases:{"@inner_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/:=/,""],[/<=>/,"","@binding_0"],[/=>\s*{/,"","@binding_1"],[//,"","@pop"],[/@symbols/,""]],binding_0:[{include:"@whitespace"},[/\{/,"","@binding_1"],[/;/,"","@pop"],[/\}/,"","@pop"],[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@numbers"},[/"/,"string","@string"],[/@symbols/,""]],binding_1:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/\[/,"","@push"],[/\]/,"","@pop"],[/@symbols/,""]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],numbers:[[/\d+(\.\d+)?\w*/,{token:"number"}],[/#[0-9a-fA-F]+/,{token:"number"}]]}};function Zce(s,e,t="OK",i=()=>{},n=()=>{}){const o=document.createElement("dialog");o.classList.add("dialog"),o.classList.add("modal"),o.classList.add(s);const r=document.createElement("div");r.classList.add("titlebar");const a=document.createElement("i");a.classList.add("close_button"),a.classList.add("fa"),a.classList.add("fa-times"),a.onclick=()=>o.close(),r.appendChild(a);const c=document.createElement("div");c.classList.add("dialog_content");const l=document.createElement("button");let d=[];typeof e=="function"?d=e(u=>{l.disabled=!u}):d=e;for(const u of d)c.appendChild(u);const h=document.createElement("div");h.classList.add("button_row"),l.innerText=t,l.onclick=()=>{i(),o.close()},h.appendChild(l),o.appendChild(r),o.appendChild(c),o.appendChild(h),document.body.appendChild(o),o.onclose=n,o.showModal()}function AXt(s){alert(s)}function Y3e(...s){const e=document.createElement("p");e.innerText="Share this URL:";const t=[e];for(const i of s){const n=document.createElement("div");n.classList.add("url");const o=document.createElement("p");o.className="url_text",o.innerHTML=''+i+"";const r=document.createElement("button");r.classList.add("button"),r.classList.add("copy_url"),r.onclick=()=>navigator.clipboard.writeText(i);const a=document.createElement("i");a.classList.add("fa"),a.classList.add("fa-copy"),r.appendChild(a),n.appendChild(r),n.appendChild(o),t.push(n)}Zce("report_export_url",t)}async function EXt(s){const e=document.createElement("textarea");e.cols=80,e.rows=5,e.autofocus=!0,e.placeholder="Description";const t=document.createElement("div"),i=document.createElement("input");i.type="checkbox",i.id="is_public",i.checked=!0;const n=document.createElement("label");n.innerText="Create public Gist",n.htmlFor="is_public",t.appendChild(i),t.appendChild(n),Zce("gist_export_dialog",[e,t],"Export",()=>s(e.value,i.checked))}function xXt(){const s=document.createElement("div");s.innerHTML=`

      Welcome to SlintPad

      @@ -957,38 +985,59 @@ ${r}`)}}};O0e=D([_(0,EQ),_(1,ci)],O0e);var B0e;let ire=B0e=class{constructor(e,t which runs in your local VS code installation as well as in the Visual Studio Code for the Web.

      SlintPad is licensed under the GNU GPLv3. The source code is located in our GitHub repository. -

      `,hue("about_dialog",[n])}const PZt="1.9.0",HOe="github_token_v1";function Y1e(){const n=localStorage.getItem(HOe);return n!=null&&n!==""}async function jrt(){return new Promise((n,e)=>{let t=null,i="";const s=o=>o.match(/^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$/);hue("manage_github_dialog",o=>{o(!0);const r=document.createElement("div");r.classList.add("description_area");const a=document.createElement("p");r.appendChild(a);const c=document.createElement("div");c.classList.add("current_state");const l=document.createElement("input");l.classList.add("token_input"),l.type="text",l.pattern="^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$",l.oninput=()=>{const u=l.reportValidity();o(u),u?i=l.value:i=""};const d=document.createElement("button");d.classList.add("forget"),d.classList.add("button"),d.innerText="forget token";function h(u){i=u,i!==""?(l.style.display="none",l.value="",l.readOnly=!0,d.style.display="block",a.innerText="You have a github access token set up."):(a.innerHTML="You have no github access token set up.
      Visit your github account, go to your settings, then developer settings and create a personal access token there with the permission to read and write Gists. Then paste it into the text field below.",l.placeholder="Github personal access token",l.value="",l.style.display="block",l.readOnly=!1,d.style.display="none"),l.value=""}return h(UOe()??""),d.onclick=()=>{h("")},c.appendChild(l),c.appendChild(d),[r,c]},"OK",()=>{(s(i)||i==="")&&localStorage.setItem(HOe,i),t=Y1e()},()=>{n(t)})})}function UOe(){return localStorage.getItem(HOe)}function FZt(n){if(n.length===1)return n[0].lastIndexOf("/")+1;let e=0,t=0;for(;n[0][e]&&n.every(i=>i[e]===n[0][e]);)n[0][e]==="/"&&(t=e),e++;return t}async function OZt(n,e,t){const i=UOe();console.assert(i!=null);const s={},o=n.open_document_urls;if(o.length===0)return Promise.reject("Nothing to export");const r=FZt(o),a=o[0];o.sort((u,f)=>u.split("/").length-f.split("/").length);for(const u of o){const f=u.slice(r);if(f.indexOf("/")>=0)return Promise.reject("Gists do not allow to create folders via the API");s[f]={content:n.document_contents(u)??""}}const c={};Object.entries(n.extra_files).forEach(async([u,f])=>{c[u.slice(1)]=f});const l={main:a.slice(r),mappings:c,slint_version:PZt};s["slint.json"]={content:JSON.stringify(l)};const d=JSON.stringify({description:e,public:t,files:s}),h=await fetch("https://api.github.com/gists",{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:"Bearer "+i},redirect:"follow",referrerPolicy:"no-referrer",body:d});if(h.ok){const u=await h.json();if(u.errors){for(const f of u.errors)console.error(JSON.stringify(f));return Promise.reject(`Failed to publish to Github: + `,Zce("about_dialog",[s])}const DXt="1.9.0",CPe="github_token_v1";function MDe(){const s=localStorage.getItem(CPe);return s!=null&&s!==""}async function Ist(){return new Promise((s,e)=>{let t=null,i="";const n=o=>o.match(/^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$/);Zce("manage_github_dialog",o=>{o(!0);const r=document.createElement("div");r.classList.add("description_area");const a=document.createElement("p");r.appendChild(a);const c=document.createElement("div");c.classList.add("current_state");const l=document.createElement("input");l.classList.add("token_input"),l.type="text",l.pattern="^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$",l.oninput=()=>{const u=l.reportValidity();o(u),u?i=l.value:i=""};const d=document.createElement("button");d.classList.add("forget"),d.classList.add("button"),d.innerText="forget token";function h(u){i=u,i!==""?(l.style.display="none",l.value="",l.readOnly=!0,d.style.display="block",a.innerText="You have a github access token set up."):(a.innerHTML="You have no github access token set up.
      Visit your github account, go to your settings, then developer settings and create a personal access token there with the permission to read and write Gists. Then paste it into the text field below.",l.placeholder="Github personal access token",l.value="",l.style.display="block",l.readOnly=!1,d.style.display="none"),l.value=""}return h(SPe()??""),d.onclick=()=>{h("")},c.appendChild(l),c.appendChild(d),[r,c]},"OK",()=>{(n(i)||i==="")&&localStorage.setItem(CPe,i),t=MDe()},()=>{s(t)})})}function SPe(){return localStorage.getItem(CPe)}function kXt(s){if(s.length===1)return s[0].lastIndexOf("/")+1;let e=0,t=0;for(;s[0][e]&&s.every(i=>i[e]===s[0][e]);)s[0][e]==="/"&&(t=e),e++;return t}async function IXt(s,e,t){const i=SPe();console.assert(i!=null);const n={},o=s.open_document_urls;if(o.length===0)return Promise.reject("Nothing to export");const r=kXt(o),a=o[0];o.sort((u,f)=>u.split("/").length-f.split("/").length);for(const u of o){const f=u.slice(r);if(f.indexOf("/")>=0)return Promise.reject("Gists do not allow to create folders via the API");n[f]={content:s.document_contents(u)??""}}const c={};Object.entries(s.extra_files).forEach(async([u,f])=>{c[u.slice(1)]=f});const l={main:a.slice(r),mappings:c,slint_version:DXt};n["slint.json"]={content:JSON.stringify(l)};const d=JSON.stringify({description:e,public:t,files:n}),h=await fetch("https://api.github.com/gists",{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:"Bearer "+i},redirect:"follow",referrerPolicy:"no-referrer",body:d});if(h.ok){const u=await h.json();if(u.errors){for(const f of u.errors)console.error(JSON.stringify(f));return Promise.reject(`Failed to publish to Github: `+u.message)}else return u.html_url==null?Promise.reject("Failed to retrieve URL after publishing to Github"):Promise.resolve(u.html_url)}else{let u="";return h.status===422&&(d.length>5e4?u=` Your project too big to create a Gist from.`:u=` Is your project too big for a Gist?`),Promise.reject("Failed to publish a Gist to Github with status code:"+h.status+` -`+h.statusText+u)}}async function BZt(n,e){const t=e.pathname.split("/");if(t.length===3||t.length===2){const i=t[t.length-1];try{const s={Accept:"application/vnd.github+json"},o=UOe();o!=null&&(s.Authorization="Bearer "+o);const a=await(await fetch("https://api.github.com/gists/"+i,{method:"GET",headers:s})).json(),c={};let l,d,h;for(const[v,w]of Object.entries(a.files))if(v==="slint.json"){const b=JSON.parse(w.content);l=b.main;const C=b.mappings;Object.entries(C).forEach(([y,S])=>{c["/"+y]=S})}else{const b=w.raw_url;d==null&&(d=v,h=b),c["/"+v]=b}const u=new $ni(n,c);if(a.errors)return Promise.reject(`Failed to read gist: -`+a.errors.join(` -`));const f=a.description.match(/main file is: "(.+)"/i)?.[1];let p=l??f??"main.slint",m=c["/"+p];return m==null&&(p=d,m=h),Promise.resolve([m,"/"+p,u])}catch(s){return Promise.reject(`Failed to retrieve information on Gist: -`+s)}}return Promise.resolve([e.toString(),null,null])}async function WZt(n,e){const t=e.pathname.split("/");return t[3]==="blob"?(t.splice(3,1),Promise.resolve([e.protocol+"//raw.githubusercontent.com"+t.join("/"),null,null])):Promise.resolve([e.toString(),null,null])}async function HZt(n,e){try{const t=new URL(e);if(t.hostname==="gist.github.com")return BZt(n,t);if(t.hostname==="github.com")return WZt(n,t)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Wt;(function(n){function e(k,F,N=0,z=-1){let U=k.length;if(U===0)return-1;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;z0;){let me=re>>1,De=j+me;N(k[De],F)<0?(j=De+1,re-=me+1):re=me}return j}n.lowerBound=a;function c(k,F,N,z=0,U=-1){let J=k.length;if(J===0)return 0;z<0?z=Math.max(0,z+J):z=Math.min(z,J-1),U<0?U=Math.max(0,U+J):U=Math.min(U,J-1);let j=z,re=U-z+1;for(;re>0;){let me=re>>1,De=j+me;N(k[De],F)>0?re=me:(j=De+1,re-=me+1)}return j}n.upperBound=c;function l(k,F,N){if(k===F)return!0;if(k.length!==F.length)return!1;for(let z=0,U=k.length;z=J&&(N=U<0?J-1:J),z===void 0?z=U<0?-1:J:z<0?z=Math.max(z+J,U<0?-1:0):z>=J&&(z=U<0?J-1:J);let j;U<0&&z>=N||U>0&&N>=z?j=0:U<0?j=Math.floor((z-N+1)/U+1):j=Math.floor((z-N-1)/U+1);let re=[];for(let me=0;me=z))return;let J=z-N+1;if(F>0?F=F%J:F<0&&(F=(F%J+J)%J),F===0)return;let j=N+F;u(k,N,j-1),u(k,j,z),u(k,N,z)}n.rotate=f;function p(k,F,N=0,z=-1){let U=k.length;if(U===0)return;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;zF;--U)k[U]=k[U-1];k[F]=N}n.insert=m;function v(k,F){let N=k.length;if(F<0&&(F+=N),F<0||F>=N)return;let z=k[F];for(let U=F+1;U=N&&j<=z&&k[j]===F||z=N)&&k[j]===F?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllOf=C;function y(k,F,N=0,z=-1){let U,J=i(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeFirstWhere=y;function S(k,F,N=-1,z=0){let U,J=s(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeLastWhere=S;function M(k,F,N=0,z=-1){let U=k.length;if(U===0)return 0;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J=0;for(let j=0;j=N&&j<=z&&F(k[j],j)||z=N)&&F(k[j],j)?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllWhere=M})(Wt||(Wt={}));function*V5(){}function J1e(n,e){let t=0;for(const i of n)if(e(i,t++))return i}function UZt(n,e){let t=0;for(const i of n)if(e(i,t++)===!1)return!1;return!0}function VZt(n,e){let t=0;for(const i of n)if(e(i,t++))return!0;return!1}var y7e;(function(n){function e(t,i,s){return s===0?1/0:t>i&&s>0||t-1;e--)yield n[e]}function $Zt(n){let e=[],t=new Set,i=new Map;for(const r of n)s(r);for(const[r]of i)o(r);return e;function s(r){let[a,c]=r,l=i.get(c);l?l.push(a):i.set(c,[a])}function o(r){if(t.has(r))return;t.add(r);let a=i.get(r);if(a)for(const c of a)o(c);e.push(r)}}var oq;(function(n){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}n.cmp=o})(oq||(oq={}));var Hl;(function(n){n.emptyObject=Object.freeze({}),n.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}n.isPrimitive=e;function t(d){return Array.isArray(d)}n.isArray=t;function i(d){return!e(d)&&!t(d)}n.isObject=i;function s(d,h){if(d===h)return!0;if(e(d)||e(h))return!1;let u=t(d),f=t(h);return u!==f?!1:u&&f?r(d,h):a(d,h)}n.deepEqual=s;function o(d){return e(d)?d:t(d)?c(d):l(d)}n.deepCopy=o;function r(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===r.provides)return!0;const f=c.get(u);if(!f)return!1;const p=a.get(f),m=[...p.requires,...p.optional];return m.length===0?!1:(h.push(f),m.some(d)?!0:(h.pop(),!1))};if(!r.provides||l.length===0)return;const h=[r.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}n.ensureNoCycle=i;function s(r,a,c){const l=new Array,d=m=>{const v=a.get(m),w=[...v.requires,...v.optional];l.push(...w.reduce((b,C)=>{const y=c.get(C);return y&&b.push([m,y]),b},[]))};for(const m of a.keys())d(m);const h=l.filter(m=>m[1]===r);let u=0;for(;h.length>u;){const m=h.length,v=new Set(h.map(w=>w[0]));for(const w of v)l.filter(b=>b[1]===w).forEach(b=>{h.includes(b)||h.push(b)});u=m}const f=$Zt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}n.findDependents=s;function o(r,a){const c=new Set;for(const l of r.keys())r.get(l).autoStart===!0&&c.add(l);if(a.startPlugins)for(const l of a.startPlugins)c.add(l);if(a.ignorePlugins)for(const l of a.ignorePlugins)c.delete(l);return Array.from(c)}n.collectStartupPlugins=o})(S7e||(S7e={}));function qZt(n){let e=0;for(let t=0,i=n.length;t>>0),n[t]=e&255,e>>>=8}var X1e;(function(n){n.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:qZt})()})(X1e||(X1e={}));function QZt(n){const e=new Uint8Array(16),t=new Array(256);for(let i=0;i<16;++i)t[i]="0"+i.toString(16);for(let i=16;i<256;++i)t[i]=i.toString(16);return function(){return n(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+"-"+t[e[4]]+t[e[5]]+"-"+t[e[6]]+t[e[7]]+"-"+t[e[8]]+t[e[9]]+"-"+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}}var Z1e;(function(n){n.uuid4=QZt(X1e.getRandomValues)})(Z1e||(Z1e={}));var A7e;(function(n){function e(t){const i=document.body,s=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",s,!0)};i.addEventListener("copy",s,!0),document.execCommand("copy")}n.copyText=e})(A7e||(A7e={}));var pc;(function(n){function e(o){let r=window.getComputedStyle(o),a=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderLeftWidth)||0,l=parseFloat(r.borderRightWidth)||0,d=parseFloat(r.borderBottomWidth)||0,h=parseFloat(r.paddingTop)||0,u=parseFloat(r.paddingLeft)||0,f=parseFloat(r.paddingRight)||0,p=parseFloat(r.paddingBottom)||0,m=c+u+f+l,v=a+h+p+d;return{borderTop:a,borderLeft:c,borderRight:l,borderBottom:d,paddingTop:h,paddingLeft:u,paddingRight:f,paddingBottom:p,horizontalSum:m,verticalSum:v}}n.boxSizing=e;function t(o){let r=window.getComputedStyle(o),a=parseFloat(r.minWidth)||0,c=parseFloat(r.minHeight)||0,l=parseFloat(r.maxWidth)||1/0,d=parseFloat(r.maxHeight)||1/0;return l=Math.max(a,l),d=Math.max(c,d),{minWidth:a,minHeight:c,maxWidth:l,maxHeight:d}}n.sizeLimits=t;function i(o,r,a){let c=o.getBoundingClientRect();return r>=c.left&&r=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){o.scrollTop-=a.top-c.top;return}if(c.topa.height){o.scrollTop-=a.bottom-c.bottom;return}if(c.bottom>a.bottom&&c.height{let d=Element.prototype;return d.matches||d.matchesSelector||d.mozMatchesSelector||d.msMatchesSelector||d.oMatchesSelector||d.webkitMatchesSelector||function(h){let u=this,f=u.ownerDocument?u.ownerDocument.querySelectorAll(h):[];return Array.prototype.indexOf.call(f,u)!==-1}})();function e(d){d=d.split(",",1)[0];let h=0,u=0,f=0;function p(m){let v=d.match(m);return v===null?!1:(d=d.slice(v[0].length),!0)}for(d=d.replace(l," $1 ");d.length>0;){if(p(t)){h++;continue}if(p(i)){u++;continue}if(p(s)){u++;continue}if(p(r)){f++;continue}if(p(a)){u++;continue}if(p(o)){f++;continue}if(!p(c))return 0}return h=Math.min(h,255),u=Math.min(u,255),f=Math.min(f,255),h<<16|u<<8|f}n.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,s=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(ob||(ob={}));class eLe{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new LA.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new LA.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.prev;return i.next=s,i.prev=o,s.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.next;return i.next=o,i.prev=s,s.next=i,o.prev=i,this._size++,i}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof LA.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}(function(n){function e(t){let i=new n;return i.assign(t),i}n.from=e})(eLe||(eLe={}));var LA;(function(n){class e{constructor(i,s){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=s}}n.LinkedListNode=e})(LA||(LA={}));let ev=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class q3 extends ev{get isConflatable(){return!0}conflate(e){return!0}}var qt;(function(n){let e=null;const t=(F=>N=>{let z=!1;return F.then(()=>!z&&N()),()=>{z=!0}})(Promise.resolve());function i(F,N){let z=u.get(F);if(!z||z.length===0){w(F,N);return}UZt(zZt(z),J=>J?v(J,F,N):!0)&&w(F,N)}n.sendMessage=i;function s(F,N){if(!N.isConflatable){b(F,N);return}VZt(h,U=>U.handler!==F||!U.msg||U.msg.type!==N.type||!U.msg.isConflatable?!1:U.msg.conflate(N))||b(F,N)}n.postMessage=s;function o(F,N){let z=u.get(F);z&&z.indexOf(N)!==-1||(z?z.push(N):u.set(F,[N]))}n.installMessageHook=o;function r(F,N){let z=u.get(F);if(!z)return;let U=z.indexOf(N);U!==-1&&(z[U]=null,y(z))}n.removeMessageHook=r;function a(F){let N=u.get(F);N&&N.length>0&&(Wt.fill(N,null),y(N));for(const z of h)z.handler===F&&(z.handler=null,z.msg=null)}n.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,C(),m=!1)}n.flush=c;function l(){return p}n.getExceptionHandler=l;function d(F){let N=p;return p=F,N}n.setExceptionHandler=d;const h=new eLe,u=new WeakMap,f=new Set;let p=F=>{console.error(F)},m=!1;function v(F,N,z){let U=!0;try{typeof F=="function"?U=F(N,z):U=F.messageHook(N,z)}catch(J){p(J)}return U}function w(F,N){try{F.processMessage(N)}catch(z){p(z)}}function b(F,N){h.addLast({handler:F,msg:N}),e===null&&(e=t(C))}function C(){if(e=null,h.isEmpty)return;let F={handler:null,msg:null};for(h.addLast(F);;){let N=h.removeFirst();if(N===F)return;N.handler&&N.msg&&i(N.handler,N.msg)}}function y(F){f.size===0&&t(S),f.add(F)}function S(){f.forEach(M),f.clear()}function M(F){Wt.removeAllWhere(F,k)}function k(F){return F===null}})(qt||(qt={}));class Aw{constructor(e){this._pid=MR.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,i=MR.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,s=MR.ensureMap(e);this._pid in s?i=s[this._pid]:i=s[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,s[this._pid]=o)}coerce(e){let t,i=MR.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=s)}_createValue(e){let t=this._create;return t(e)}_coerceValue(e,t){let i=this._coerce;return i?i(e,t):t}_compareValue(e,t){let i=this._compare;return i?i(e,t):e===t}_maybeNotify(e,t,i){let s=this._changed;s&&!this._compareValue(t,i)&&s(e,t,i)}}(function(n){function e(t){MR.ownerData.delete(t)}n.clearData=e})(Aw||(Aw={}));var MR;(function(n){n.ownerData=new WeakMap,n.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=n.ownerData.get(t);return i||(i=Object.create(null),n.ownerData.set(t,i),i)}n.ensureMap=e})(MR||(MR={}));class rl{constructor(e){this.sender=e}connect(e,t){return n_.connect(this,e,t)}disconnect(e,t){return n_.disconnect(this,e,t)}emit(e){n_.emit(this,e)}}(function(n){function e(c,l){n_.disconnectBetween(c,l)}n.disconnectBetween=e;function t(c){n_.disconnectSender(c)}n.disconnectSender=t;function i(c){n_.disconnectReceiver(c)}n.disconnectReceiver=i;function s(c){n_.disconnectAll(c)}n.disconnectAll=s;function o(c){n_.disconnectAll(c)}n.clearData=o;function r(){return n_.exceptionHandler}n.getExceptionHandler=r;function a(c){let l=n_.exceptionHandler;return n_.exceptionHandler=c,l}n.setExceptionHandler=a})(rl||(rl={}));var n_;(function(n){n.exceptionHandler=b=>{console.error(b)};function e(b,C,y){y=y||void 0;let S=c.get(b.sender);if(S||(S=[],c.set(b.sender,S)),u(S,b,C,y))return!1;let M=y||C,k=l.get(M);k||(k=[],l.set(M,k));let F={signal:b,slot:C,thisArg:y};return S.push(F),k.push(F),!0}n.connect=e;function t(b,C,y){y=y||void 0;let S=c.get(b.sender);if(!S||S.length===0)return!1;let M=u(S,b,C,y);if(!M)return!1;let k=y||C,F=l.get(k);return M.signal=null,p(S),p(F),!0}n.disconnect=t;function i(b,C){let y=c.get(b);if(!y||y.length===0)return;let S=l.get(C);if(!(!S||S.length===0)){for(const M of S)M.signal&&M.signal.sender===b&&(M.signal=null);p(y),p(S)}}n.disconnectBetween=i;function s(b){let C=c.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.thisArg||y.slot;y.signal=null,p(l.get(S))}p(C)}}n.disconnectSender=s;function o(b){let C=l.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.signal.sender;y.signal=null,p(c.get(S))}p(C)}}n.disconnectReceiver=o;function r(b){s(b),o(b)}n.disconnectAll=r;function a(b,C){let y=c.get(b.sender);if(!(!y||y.length===0))for(let S=0,M=y.length;SM.signal===C&&M.slot===y&&M.thisArg===S)}function f(b,C){let{signal:y,slot:S,thisArg:M}=b;try{S.call(M,y.sender,C)}catch(k){n.exceptionHandler(k)}}function p(b){d.size===0&&h(m),d.add(b)}function m(){d.forEach(v),d.clear()}function v(b){Wt.removeAllWhere(b,w)}function w(b){return b.signal===null}})(n_||(n_={}));class tLe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class iLe{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(iLe||(iLe={}));class E7e extends iLe{constructor(){super(...arguments),this._disposed=new rl(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),rl.clearData(this))}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(E7e||(E7e={}));class Xu{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:s}=this._scrollTarget,o=Rg.SCROLL_EDGE_SIZE-s,r=Math.pow(o/Rg.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Rg.SCROLL_EDGE_SIZE));switch(i){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});Rg.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(s=>{this._resolve=s});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(i),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage)return;let i=this.dragImage.style;i.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),e.button!==0)return;if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Rg.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Rg.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=Rg.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,s=this._currentElement,o=Rg.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==s&&o!==i&&Rg.dispatchDragExit(this,i,o,e),o!==s&&o!==i&&(i=Rg.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Rg.dispatchDragLeave(this,t,i,e));let r=Rg.dispatchDragOver(this,i,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=Rg.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=Xu.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=Xu.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=Xu.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=Xu.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}(function(n){class e extends DragEvent{constructor(s,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:s.altKey,button:s.button,clientX:s.clientX,clientY:s.clientY,ctrlKey:s.ctrlKey,detail:0,metaKey:s.metaKey,relatedTarget:o.related,screenX:s.screenX,screenY:s.screenY,shiftKey:s.shiftKey,view:window});const{drag:r}=o;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}n.Event=e;function t(i,s=document){return Rg.overrideCursor(i,s)}n.overrideCursor=t})(Xu||(Xu={}));var Rg;(function(n){n.SCROLL_EDGE_SIZE=20;function e(y,S){return h[y]&u[S]?y:"none"}n.validateAction=e;function t(y,S=document){if(y){if(i&&y==i.event)return i.element;n.cursorBackdrop.style.zIndex="-1000";const M=S.elementFromPoint(y.clientX,y.clientY);return n.cursorBackdrop.style.zIndex="",i={event:y,element:M},M}else{const M=n.cursorBackdrop.style.transform;if(s&&M===s.transform)return s.element;const k=n.cursorBackdrop.getBoundingClientRect();n.cursorBackdrop.style.zIndex="-1000";const F=S.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return n.cursorBackdrop.style.zIndex="",s={transform:M,element:F},F}}n.findElementBehindBackdrop=t;let i=null,s=null;function o(y){let S=y.clientX,M=y.clientY,k=t(y);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let F=0,N=0;k===document.body&&(F=window.pageXOffset,N=window.pageYOffset);let z=k.getBoundingClientRect(),U=z.top+N,J=z.left+F,j=J+z.width,re=U+z.height;if(S=j||M=re)continue;let me=S-J+1,De=M-U+1,Qe=j-S,Tt=re-M,Oe=Math.min(me,De,Qe,Tt);if(Oe>n.SCROLL_EDGE_SIZE)continue;let wt;switch(Oe){case Tt:wt="bottom";break;case De:wt="top";break;case Qe:wt="right";break;case me:wt="left";break;default:throw"unreachable"}let Nt=k.scrollWidth-k.clientWidth,Ji=k.scrollHeight-k.clientHeight,zi;switch(wt){case"top":zi=Ji>0&&k.scrollTop>0;break;case"left":zi=Nt>0&&k.scrollLeft>0;break;case"right":zi=Nt>0&&k.scrollLeft0&&k.scrollTop{M===C&&n.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),n.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(n.cursorBackdrop))})}n.overrideCursor=f;function p(y){n.cursorBackdrop&&(n.cursorBackdrop.style.transform=`translate(${y.clientX}px, ${y.clientY}px)`)}function m(y){if(!n.cursorBackdrop)return;let S=t();if(!S)return;const M=S.closest("[data-lm-dragscroll]");M&&(M.scrollTop+=n.cursorBackdrop.scrollTop-w,M.scrollLeft+=n.cursorBackdrop.scrollLeft-w,v())}function v(){n.cursorBackdrop.scrollTop=w,n.cursorBackdrop.scrollLeft=w}const w=500;function b(){const y=document.createElement("div");return y.classList.add("lm-cursor-backdrop"),y}let C=0;n.cursorBackdrop=b()})(Rg||(Rg={}));function hre(){return nLe.keyboardLayout}class z4{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=z4.extractKeys(t),this._modifierKeys=z4.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}(function(n){function e(i){let s=Object.create(null);for(let o in i)s[i[o]]=!0;return s}n.extractKeys=e;function t(i){let s=Object(null);for(let o=0,r=i.length;o{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(e!==void 0&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return Promise.resolve((i=s?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return(i=s?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Hl.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Hl.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let s;try{s=i.execute.call(void 0,t)}catch(r){s=Promise.reject(r)}let o=Promise.resolve(s);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=db.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new tLe(()=>{Wt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=eA.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(eA.isModifierKeyPressed(e)){let{exact:r}=db.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:s}=db.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=s.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||s.some(r=>r.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!o){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},db.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},db.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(db.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const o=[...this._keydownEvents],r=(await Promise.race([Promise.all(o.map(async a=>{var c;return(c=this._holdKeyBindingPromises.get(a))!==null&&c!==void 0?c:Promise.resolve(!0)})),new Promise(a=>{setTimeout(()=>a([!1]),db.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,s={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,s)){let o=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${o}.`;console.warn(`${a} ${c}`);return}await this.execute(t,s)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}(function(n){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?jp.IS_MAC?d=!0:h=!0:f==="Alt"?l=!0:f==="Cmd"?d=!0:f==="Ctrl"?h=!0:f==="Shift"?u=!0:f.length>0&&(c=f);return{cmd:d,ctrl:h,alt:l,shift:u,key:c}}n.parseKeystroke=e;function t(a){let c="",l=e(a);return l.ctrl&&(c+="Ctrl "),l.alt&&(c+="Alt "),l.shift&&(c+="Shift "),l.cmd&&jp.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}n.normalizeKeystroke=t;function i(a){let c;return jp.IS_WIN?c=a.winKeys||a.keys:jp.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}n.normalizeKeys=i;function s(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=jp.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),jp.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(db.formatKey).join(h)}}n.formatKeystroke=s;function o(a){let c=hre(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}n.isModifierKeyPressed=o;function r(a){let c=hre(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&jp.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}n.keystrokeForKeydownEvent=r})(eA||(eA={}));var db;(function(n){n.CHORD_TIMEOUT=1e3,n.KEYBINDING_HOLD_TIMEOUT=1e3,n.modifierkeyTimeOut=500;function e(C){return{execute:C.execute,describedBy:p(typeof C.describedBy=="function"?C.describedBy:{args:null,...C.describedBy},()=>({args:null})),label:p(C.label,c),mnemonic:p(C.mnemonic,l),icon:p(C.icon,f),iconClass:p(C.iconClass,c),iconLabel:p(C.iconLabel,c),caption:p(C.caption,c),usage:p(C.usage,c),className:p(C.className,c),dataset:p(C.dataset,u),isEnabled:C.isEnabled||d,isToggled:C.isToggled||h,isToggleable:C.isToggleable||!!C.isToggled,isVisible:C.isVisible||d}}n.createCommand=e;function t(C){var y;return{keys:eA.normalizeKeys(C),selector:m(C),command:C.command,args:C.args||Hl.emptyObject,preventDefault:(y=C.preventDefault)!==null&&y!==void 0?y:!0}}n.createKeyBinding=t;function i(C,y,S){let M=null,k=[],F=1/0,N=0;for(let z=0,U=C.length;zF)continue;let me=$E.calculateSpecificity(J.selector);(!M||re=N)&&(M=J,F=re,N=me)}return{exact:M,partial:k}}n.matchKeyBinding=i;function s(C){C.target.dispatchEvent(b(C))}n.replayKeyEvent=s;function o(C){return jp.IS_MAC?r.hasOwnProperty(C)?r[C]:C:a.hasOwnProperty(C)?a[C]:C}n.formatKey=o;const r={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},a={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},c=()=>"",l=()=>-1,d=()=>!0,h=()=>!1,u=()=>({}),f=()=>{};function p(C,y){return C===void 0?y:typeof C=="function"?C:()=>C}function m(C){if(C.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${C.selector}`);if(!$E.isValid(C.selector))throw new Error(`Invalid selector: ${C.selector}`);return C.selector}function v(C,y){if(C.lengthy.length?2:1}function w(C,y){let S=y.target,M=y.currentTarget;for(let k=0;S!==null;S=S.parentElement,++k){if(S.hasAttribute("data-lm-suppress-shortcuts"))return-1;if($E.matches(S,C))return k;if(S===M)return-1}return-1}function b(C){let y=document.createEvent("Event"),S=C.bubbles||!0,M=C.cancelable||!0;return y.initEvent(C.type||"keydown",S,M),y.key=C.key||"",y.keyCode=C.keyCode||0,y.which=C.keyCode||0,y.ctrlKey=C.ctrlKey||!1,y.altKey=C.altKey||!1,y.shiftKey=C.shiftKey||!1,y.metaKey=C.metaKey||!1,y.view=C.view||window,y}})(db||(db={}));class mY{constructor(e){this.type="text",this.content=e}}class cme{constructor(e,t,i,s){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=s}}function $a(n){let e={},t,i=[];for(let o=1,r=arguments.length;o=w.length){t(m[y],f);continue}let S=w[y],M=m[y];if(S===M){b=b.nextSibling;continue}if(S.type==="text"&&M.type==="text"){b.textContent!==M.content&&(b.textContent=M.content),b=b.nextSibling;continue}if(S.type==="text"||M.type==="text"){Wt.insert(w,y,M),t(M,f,b);continue}if(!S.renderer!=!M.renderer){Wt.insert(w,y,M),t(M,f,b);continue}let k=M.attrs.key;if(k&&k in v){let N=v[k];N.vNode!==S&&(Wt.move(w,w.indexOf(N.vNode,y+1),y),f.insertBefore(N.element,b),S=N.vNode,b=N.element)}if(S===M){b=b.nextSibling;continue}let F=S.attrs.key;if(F&&F!==k){Wt.insert(w,y,M),t(M,f,b);continue}if(S.tag!==M.tag){Wt.insert(w,y,M),t(M,f,b);continue}a(b,S.attrs,M.attrs),M.renderer?M.renderer.render(b,{attrs:M.attrs,children:M.children}):i(b,S.children,M.children),b=b.nextSibling}s(f,w,C,!0)}n.updateContent=i;function s(f,p,m,v){for(let w=p.length-1;w>=m;--w){const b=p[w],C=v?f.lastChild:f.childNodes[w];b.type==="text"||(b.renderer&&b.renderer.unrender?b.renderer.unrender(C,{attrs:b.attrs,children:b.children}):s(C,b.children,0,!1)),v&&f.removeChild(C)}}const o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(f,p){for(let m in p)m in o||(m.substr(0,2)==="on"?f[m]=p[m]:f.setAttribute(m,p[m]));p.className!==void 0&&f.setAttribute("class",p.className),p.htmlFor!==void 0&&f.setAttribute("for",p.htmlFor),p.dataset&&c(f,p.dataset),p.style&&d(f,p.style)}function a(f,p,m){if(p===m)return;let v;for(v in p)v in o||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in o||p[v]===m[v]||(v.substr(0,2)==="on"?f[v]=m[v]:f.setAttribute(v,m[v]));p.className!==m.className&&(m.className!==void 0?f.setAttribute("class",m.className):f.removeAttribute("class")),p.htmlFor!==m.htmlFor&&(m.htmlFor!==void 0?f.setAttribute("for",m.htmlFor):f.removeAttribute("for")),p.dataset!==m.dataset&&l(f,p.dataset||{},m.dataset||{}),p.style!==m.style&&h(f,p.style||{},m.style||{})}function c(f,p){for(let m in p)f.setAttribute(`data-${m}`,p[m])}function l(f,p,m){for(let v in p)v in m||f.removeAttribute(`data-${v}`);for(let v in m)p[v]!==m[v]&&f.setAttribute(`data-${v}`,m[v])}function d(f,p){let m=f.style,v;for(v in p)m[v]=p[v]}function h(f,p,m){let v=f.style,w;for(w in p)w in m||(v[w]="");for(w in m)p[w]!==m[w]&&(v[w]=m[w])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let w of p)w.type==="element"&&w.attrs.key&&(v[w.attrs.key]={vNode:w,element:m}),m=m.nextSibling;return v}})(VT||(VT={}));class KI{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var w_;(function(n){function e(o,r){let a=o.length;if(a===0)return r;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(r===d)return 0;if(r<=c){for(let m=0;m=l){for(let m=0;m0&&m>f;){let v=m,w=h;for(let b=0;b0&&m>f;){let v=m/p;for(let w=0;w0&&m>f;){let v=m,w=h;for(let b=0;b=C.maxSize?(m-=C.maxSize-C.size,h-=C.stretch,C.size=C.maxSize,C.done=!0,p--,u--):(m-=y,C.size+=y)}}for(;p>0&&m>f;){let v=m/p;for(let w=0;w=b.maxSize?(m-=b.maxSize-b.size,b.size=b.maxSize,b.done=!0,p--):(m-=v,b.size+=v))}}}return 0}n.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):s(o,r,-a))}n.adjust=t;function i(o,r,a){let c=0;for(let u=0;u<=r;++u){let f=o[u];c+=f.maxSize-f.size}let l=0;for(let u=r+1,f=o.length;u=0&&d>0;--u){let f=o[u],p=f.maxSize-f.size;p>=d?(f.sizeHint=f.size+d,d=0):(f.sizeHint=f.size+p,d-=p)}let h=a;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function s(o,r,a){let c=0;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.maxSize-p.size;m>=d?(p.sizeHint=p.size+d,d=0):(p.sizeHint=p.size+m,d-=m)}let h=a;for(let u=r;u>=0&&h>0;--u){let f=o[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(w_||(w_={}));class sLe{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new rl(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0&&(this._icon=e.icon),e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,rl.clearData(this))}}class ot{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new rl(this),this._hiddenMode=ot.HiddenMode.Display,this.node=ure.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(ot.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&ot.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),rl.clearData(this),qt.clearData(this),Aw.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(ot.Flag.IsDisposed)}get isAttached(){return this.testFlag(ot.Flag.IsAttached)}get isHidden(){return this.testFlag(ot.Flag.IsHidden)}get isVisible(){return this.testFlag(ot.Flag.IsVisible)}get title(){return ure.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==ot.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-removed",this);qt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-added",this);qt.sendMessage(this._parent,t)}this.isDisposed||qt.sendMessage(this,ot.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(ot.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return t===!0?(this.node.classList.add(e),!0):t===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){qt.postMessage(this,ot.Msg.UpdateRequest)}fit(){qt.postMessage(this,ot.Msg.FitRequest)}activate(){qt.postMessage(this,ot.Msg.ActivateRequest)}close(){qt.sendMessage(this,ot.Msg.CloseRequest)}show(){if(this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&qt.sendMessage(this,ot.Msg.BeforeShow),this.clearFlag(ot.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&qt.sendMessage(this,ot.Msg.AfterShow),this.parent)){let e=new ot.ChildMessage("child-shown",this);qt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&qt.sendMessage(this,ot.Msg.BeforeHide),this.setFlag(ot.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&qt.sendMessage(this,ot.Msg.AfterHide),this.parent)){let e=new ot.ChildMessage("child-hidden",this);qt.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(ot.Flag.IsVisible),this.setFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(ot.Flag.IsVisible),this.clearFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&ot.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case ot.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case ot.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(n){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(n.HiddenMode||(n.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(n.Flag||(n.Flag={})),function(o){o.BeforeShow=new ev("before-show"),o.AfterShow=new ev("after-show"),o.BeforeHide=new ev("before-hide"),o.AfterHide=new ev("after-hide"),o.BeforeAttach=new ev("before-attach"),o.AfterAttach=new ev("after-attach"),o.BeforeDetach=new ev("before-detach"),o.AfterDetach=new ev("after-detach"),o.ParentChanged=new ev("parent-changed"),o.UpdateRequest=new q3("update-request"),o.FitRequest=new q3("fit-request"),o.ActivateRequest=new q3("activate-request"),o.CloseRequest=new q3("close-request")}(n.Msg||(n.Msg={}));class e extends ev{constructor(r,a){super(r),this.child=a}}n.ChildMessage=e;class t extends ev{constructor(r,a){super("resize"),this.width=r,this.height=a}}n.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=n.ResizeMessage||(n.ResizeMessage={}));function i(o,r,a=null){if(o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");qt.sendMessage(o,n.Msg.BeforeAttach),r.insertBefore(o.node,a),qt.sendMessage(o,n.Msg.AfterAttach)}n.attach=i;function s(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");qt.sendMessage(o,n.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),qt.sendMessage(o,n.Msg.AfterDetach)}n.detach=s})(ot||(ot={}));var ure;(function(n){n.titleProperty=new Aw({name:"title",create:t=>new sLe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}n.createNode=e})(ure||(ure={}));class XF{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,rl.clearData(this),Aw.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const t of this)qt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)qt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)qt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)qt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)qt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)qt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||qt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||qt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||qt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||qt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(n){function e(o){return I2.horizontalAlignmentProperty.get(o)}n.getHorizontalAlignment=e;function t(o,r){I2.horizontalAlignmentProperty.set(o,r)}n.setHorizontalAlignment=t;function i(o){return I2.verticalAlignmentProperty.get(o)}n.getVerticalAlignment=i;function s(o,r){I2.verticalAlignmentProperty.set(o,r)}n.setVerticalAlignment=s})(XF||(XF={}));class sj{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=pc.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,s){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(s,this._maxHeight));if(o"center",changed:e}),n.verticalAlignmentProperty=new Aw({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(I2||(I2={}));class uue extends XF{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let i=this._widgets.indexOf(t),s=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Wt.insert(this._widgets,s,t),this.parent&&this.attachWidget(s,t);return}s===this._widgets.length&&s--,i!==s&&(Wt.move(this._widgets,i,s),this.parent&&this.moveWidget(i,s,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Wt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let i=this.parent.node.children[e];this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&qt.sendMessage(i,ot.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&qt.sendMessage(i,ot.Msg.AfterDetach);let s=this.parent.node.children[t];this.parent.isAttached&&qt.sendMessage(i,ot.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,s),this.parent.isAttached&&qt.sendMessage(i,ot.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterDetach)}}var rq;(function(n){function e(t){return Math.max(0,Math.floor(t))}n.clampDimension=e})(rq||(rq={}));var aq=rq;class Kx extends uue{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,e.orientation!==void 0&&(this._orientation=e.orientation),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=rq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=rq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return fE.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,s=e.slice(0,i);for(;s.length0&&(o.sizeHint=o.size);w_.adjust(this._sizers,e,s),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let i=new sj(t),s=fE.createHandle(this.renderer),o=fE.averageSize(this._sizers),r=fE.createSizer(o);Wt.insert(this._items,e,i),Wt.insert(this._sizers,e,r),Wt.insert(this._handles,e,s),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(s),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),Wt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Wt.removeAt(this._items,e),s=Wt.removeAt(this._handles,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(s),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,i,s,o,r,a){const c=this._items[e];if(c.isHidden)return;let l=this._handles[e].style;t?(i+=this.widgetOffset,c.update(i,s,a,o),i+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(s+=this.widgetOffset,c.update(i,s,r,a),s+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let c=0,l=this._items.length;c0&&(h.sizeHint=h.size),d.isHidden){h.minSize=0,h.maxSize=0;continue}d.fit(),h.stretch=Kx.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,s+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,s=Math.max(s,d.minWidth))}let r=this._box=pc.boxSizing(this.parent.node);s+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${s}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&qt.sendMessage(this.parent.parent,ot.Msg.FitRequest),this._dirty&&qt.sendMessage(this.parent,ot.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,u=this._items.length;h0){let h;if(d?h=Math.max(0,r-this._fixed):h=Math.max(0,a-this._fixed),this._hasNormedSizes){for(let f of this._sizers)f.sizeHint*=h;this._hasNormedSizes=!1}let u=w_.calc(this._sizers,h);if(u>0)switch(this._alignment){case"start":break;case"center":c=0,l=u/2;break;case"end":c=0,l=u;break;case"justify":c=u/i,l=0;break;default:throw"unreachable"}}for(let h=0,u=this._items.length;h0,coerce:(r,a)=>Math.max(0,Math.floor(a)),changed:o});function e(r){let a=new KI;return a.sizeHint=Math.floor(r),a}n.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}n.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}n.averageSize=i;function s(r){let a=r.length;if(a===0)return[];let c=r.reduce((l,d)=>l+Math.abs(d),0);return c===0?r.map(l=>1/a):r.map(l=>l/c)}n.normalize=s;function o(r){r.parent&&r.parent.layout instanceof Kx&&r.parent.fit()}})(fE||(fE={}));class KZt extends Kx{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=aq.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const i=this._titles[e],s=i.classList.contains("lm-mod-expanded"),o=gre.createTitle(this.renderer,t.title,s);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${Z1e.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=gre.createTitle(this.renderer,t.title);Wt.insert(this._titles,e,i),this.parent.node.appendChild(i),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",i.id),super.attachWidget(e,t)}moveWidget(e,t,i){Wt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Wt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,s,o,r,a){const c=this._titles[e].style;c.top=`${s}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,s,o,r,a)}}var gre;(function(n){function e(t,i,s=!0){const o=t.createSectionTitle(i);return o.style.position="absolute",o.style.contain="strict",o.setAttribute("aria-label",`${i.label} Section`),o.setAttribute("aria-expanded",s?"true":"false"),o.setAttribute("aria-controls",i.owner.id),s&&o.classList.add("lm-mod-expanded"),o}n.createTitle=e})(gre||(gre={}));class Krt extends ot{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=oLe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var oLe;(function(n){function e(t){return t.layout||new uue}n.createLayout=e})(oLe||(oLe={}));class $4 extends Krt{constructor(e={}){super({layout:rLe.createLayout(e)}),this._handleMoved=new rl(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=Wt.findFirstIndex(t.handles,l=>l.contains(e.target));if(i===-1)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?s=e.clientX-r.left:s=e.clientY-r.top;let a=window.getComputedStyle(o),c=Xu.overrideCursor(a.cursor);this._pressData={index:i,delta:s,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,s=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-s.left-this._pressData.delta:t=e.clientY-s.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}(function(n){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}n.Renderer=e,n.defaultRenderer=new e;function t(s){return Kx.getStretch(s)}n.getStretch=t;function i(s,o){Kx.setStretch(s,o)}n.setStretch=i})($4||($4={}));var rLe;(function(n){function e(t){return t.layout||new Kx({renderer:t.renderer||$4.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}n.createLayout=e})(rLe||(rLe={}));class aLe extends $4{constructor(e={}){super({...e,layout:cLe.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new rl(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=Wt.findFirstIndex(this.widgets,i=>i.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,i=t.widgets[e];if(!i)return;const s=i.isHidden,o=t.absoluteSizes(),r=(s?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(s){const l=this._widgetSizesCache.get(i);if(!l)return;c[e]+=l;const d=c.map(h=>h-l>0).lastIndexOf(!0);d===-1?c.forEach((h,u)=>{u!==e&&(c[u]-=o[u]/a*(l-r))}):c[d]-=l-r}else{const l=o[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=o[d]+l+r}return c.map(l=>l/(a+r))}_evtClick(e){const t=e.target;if(t){const i=Wt.findFirstIndex(this.titles,s=>s.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let i=!1;if(t){const s=Wt.findFirstIndex(this.titles,o=>o.contains(t));if(s>=0){const o=e.keyCode.toString();if(e.key.match(/Space|Enter/)||o.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||o.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||o.match(/38|40/)){const r=e.key.match(/ArrowLeft|ArrowUp/)||o.match(/37|38/)?-1:1,a=this.titles.length,c=(s+a+r)%a;this.titles[c].focus(),i=!0}else e.key==="End"||o==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||o==="36")&&(this.titles[0].focus(),i=!0)}i&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],i=this.layout.widgets[e],s=this._computeWidgetSize(e);s&&this.setRelativeSizes(s,!1),i.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),i.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),i.hide()),this._expansionToggled.emit(e)}}(function(n){class e extends $4.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(i){return document.createElement("span")}createSectionTitle(i){const s=document.createElement("h3");s.setAttribute("tabindex","0"),s.id=this.createTitleKey(i),s.className=this.titleClassName;for(const a in i.dataset)s.dataset[a]=i.dataset[a];const o=s.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=s.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,s}createTitleKey(i){let s=this._titleKeys.get(i);return s===void 0&&(s=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,s)),s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e})(aLe||(aLe={}));var cLe;(function(n){function e(t){return t.layout||new KZt({renderer:t.renderer||aLe.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}n.createLayout=e})(cLe||(cLe={}));class Yv extends uue{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",e.direction!==void 0&&(this._direction=e.direction),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){Wt.insert(this._items,e,new sj(t)),Wt.insert(this._sizers,e,new KI),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let a=0,c=this._items.length;a0)switch(this._alignment){case"start":break;case"center":l=0,d=c/2;break;case"end":l=0,d=c;break;case"justify":l=c/i,d=0;break;default:throw"unreachable"}for(let h=0,u=this._items.length;h0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i}),n.sizeBasisProperty=new Aw({name:"sizeBasis",create:()=>0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i});function e(s){return s==="left-to-right"||s==="right-to-left"}n.isHorizontal=e;function t(s){return Math.max(0,Math.floor(s))}n.clampSpacing=t;function i(s){s.parent&&s.parent.layout instanceof Yv&&s.parent.fit()}})(NR||(NR={}));class x7e extends Krt{constructor(e={}){super({layout:lLe.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}(function(n){function e(o){return Yv.getStretch(o)}n.getStretch=e;function t(o,r){Yv.setStretch(o,r)}n.setStretch=t;function i(o){return Yv.getSizeBasis(o)}n.getSizeBasis=i;function s(o,r){Yv.setSizeBasis(o,r)}n.setSizeBasis=s})(x7e||(x7e={}));var lLe;(function(n){function e(t){return t.layout||new Yv(t)}n.createLayout=e})(lLe||(lLe={}));class fre extends ot{constructor(e){super({node:TA.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||fre.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=TA.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>TA.createItem(this.commands,i));return t.forEach(i=>this._items.push(i)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){Wt.removeAt(this._items,e)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,i=this.contentNode,s=this._results;if(s||(s=this._results=TA.search(this._items,t),this._activeIndex=t?Wt.findFirstIndex(s,TA.canActivate):-1),!t&&s.length===0){jI.render(null,i);return}if(t&&s.length===0){let c=this.renderer.renderEmptyMessage({query:t});jI.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(s.length);for(let c=0,l=s.length;c=s.length)i.scrollTop=0;else{let c=i.children[r];pc.scrollIntoViewIfNeeded(i,c)}}_evtClick(e){if(e.button!==0)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=Wt.findFirstIndex(this.contentNode.children,i=>i.contains(e.target));t!==-1&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,i=eF-N),M=b.slice(0,S),k=b.slice(S);for(let F=0,N=k.length;Fm.command===f&&Hl.deepEqual(m.args,p))||null}}})(TA||(TA={}));class aw extends ot{constructor(e){super({node:Nf.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new rl(this),this._menuRequested=new rl(this),this.addClass("lm-Menu"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||aw.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),e!==-1&&!Nf.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,i=t{this.activeIndex=a}})}jI.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(t===38){this.activatePreviousItem();return}if(t===39){let r=this.activeItem;r&&r.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=hre().keyForKeydownEvent(e);if(!i)return;let s=this._activeIndex+1,o=Nf.findMnemonic(this._items,i,s);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.triggerActiveItem()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>pc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;!i||i.type!=="submenu"||!i.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:i}=e;if(pc.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Nf.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let i=t.submenu;if(i===this._childMenu)return;aw.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,qt.sendMessage(this,ot.Msg.UpdateRequest);let s=this.contentNode.children[this._activeIndex];Nf.openSubmenu(i,s),e&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},Nf.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Nf.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Nf.saveWindowData()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return $a.li({className:s,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let s=this.createIconClass(i);return $a.div({className:s},i.item.icon,i.item.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return $a.div({className:"lm-Menu-itemLabel"},s)}renderShortcut(i){let s=this.formatShortcut(i);return $a.div({className:"lm-Menu-itemShortcut"},s)}renderSubmenu(i){return $a.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let s="lm-Menu-item";i.item.isEnabled||(s+=" lm-mod-disabled"),i.item.isToggled&&(s+=" lm-mod-toggled"),i.item.isVisible||(s+=" lm-mod-hidden"),i.active&&(s+=" lm-mod-active"),i.collapsed&&(s+=" lm-mod-collapsed");let o=i.item.className;return o&&(s+=` ${o}`),s}createItemDataset(i){let s,{type:o,command:r,dataset:a}=i.item;return o==="command"?s={...a,type:o,command:r}:s={...a,type:o},s}createIconClass(i){let s="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${s} ${o}`:s}createItemARIA(i){let s={};switch(i.item.type){case"separator":s.role="presentation";break;case"submenu":s["aria-haspopup"]="true",i.item.isEnabled||(s["aria-disabled"]="true");break;default:i.item.isEnabled||(s["aria-disabled"]="true"),s.role="menuitem"}return s}formatLabel(i){let{label:s,mnemonic:o}=i.item;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=$a.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let s=i.item.keyBinding;return s?eA.formatKeystroke(s.keys):null}}n.Renderer=e,n.defaultRenderer=new e})(aw||(aw={}));var Nf;(function(n){n.TIMER_DELAY=300,n.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function s(){e=d(),t++}n.saveWindowData=s;function o(){let m=document.createElement("div"),v=document.createElement("ul");return v.className="lm-Menu-content",m.appendChild(v),v.setAttribute("role","menu"),m.tabIndex=0,m}n.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}n.canActivate=r;function a(m,v){return new p(m.commands,v)}n.createItem=a;function c(m,v,w){for(let b=m;b;b=b.childMenu)if(pc.hitTest(b.node,v,w))return!0;return!1}n.hitTestMenus=c;function l(m){let v=new Array(m.length);Wt.fill(v,!1);let w=0,b=m.length;for(;w=0;--C){let S=m[C];if(S.isVisible){if(S.type!=="separator")break;v[C]=!0}}let y=!1;for(;++wk+N&&(v=k+N-re),!C&&w+me>F+z&&(w>F+z?w=F+z-me:w=w-me),j.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,w)}px`,j.opacity="1"}n.openRootMenu=h;function u(m,v){const w=i();let b=w.pageXOffset,C=w.pageYOffset,y=w.clientWidth,S=w.clientHeight;qt.sendMessage(m,ot.Msg.UpdateRequest);let M=S,k=m.node,F=k.style;F.opacity="0",F.maxHeight=`${M}px`,ot.attach(m,document.body);let{width:N,height:z}=k.getBoundingClientRect(),U=pc.boxSizing(m.node),J=v.getBoundingClientRect(),j=J.right-n.SUBMENU_OVERLAP;j+N>b+y&&(j=J.left+n.SUBMENU_OVERLAP-N);let re=J.top-U.borderTop-U.paddingTop;re+z>C+S&&(re=J.bottom+U.borderBottom+U.paddingBottom-z),F.transform=`translate(${Math.max(0,j)}px, ${Math.max(0,re)}px`,F.opacity="1"}n.openSubmenu=u;function f(m,v,w){let b=-1,C=-1,y=!1,S=v.toUpperCase();for(let M=0,k=m.length;M=0&&Ub.command===v&&Hl.deepEqual(b.args,w))||null}return null}}})(Nf||(Nf={}));var D7e;(function(n){function e(r,a){let c=i(r.selector),l=r.rank!==void 0?r.rank:1/0;return{...r,selector:c,rank:l,id:a}}n.createItem=e;function t(r,a,c,l){let d=a.target;if(!d)return null;let h=a.currentTarget;if(!h||!h.contains(d)&&(d=document.elementFromPoint(a.clientX,a.clientY),!d||!h.contains(d)))return null;let u=[],f=r.slice();for(;d!==null;){let p=[];for(let m=0,v=f.length;m=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,i=this._titles[t]||null,s=e,o=this._titles[s]||null;this._currentIndex=s,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:s,currentTitle:o})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let i=cv.asTitle(t),s=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return s===-1?(Wt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,s===o||(Wt.move(this._titles,s,o),this.update(),this._adjustCurrentForMove(s,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Wt.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let i of this._titles)i.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),e!==-1&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let i=this._titles,s=this.renderer,o=this.currentTitle,r=new Array(i.length);const a=(t=this._getCurrentTabindex())!==null&&t!==void 0?t:this._currentIndex>-1?this._currentIndex:0;for(let c=0,l=i.length;cpc.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let s=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=s.label||"",a=o.innerHTML;o.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=r,o.appendChild(c);let l=()=>{c.removeEventListener("blur",l),o.innerHTML=a,this.node.addEventListener("keydown",this)};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(s.label=s.caption=c.value),l()):d.key==="Escape"&&l()}),this.node.removeEventListener("keydown",this),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),e.key==="Escape"&&this._releaseMouse())}_evtKeyDown(e){var t,i,s;if(!(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE)){if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){const o=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(o))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const r=Wt.findFirstIndex(this.contentNode.children,a=>a.contains(o));r>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=r)}}else if(YZt.includes(e.key)){const o=[...this.contentNode.children];if(this.addButtonEnabled&&o.push(this.addButtonNode),o.length<=1)return;e.preventDefault(),e.stopPropagation();let r=o.indexOf(document.activeElement);r===-1&&(r=this._currentIndex);let a;e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"?a=(t=o[r+1])!==null&&t!==void 0?t:o[0]:e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"?a=(i=o[r-1])!==null&&i!==void 0?i:o[o.length-1]:e.key==="Home"?a=o[0]:e.key==="End"&&(a=o[o.length-1]),a&&((s=o[r])===null||s===void 0||s.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,s=Wt.findFirstIndex(i,r=>pc.hitTest(r,e.clientX,e.clientY));if(s===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[s],index:s,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),e.button===1||t))return;let o=i[s].querySelector(this.renderer.closeIconSelector);o&&o.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===s?this.currentIndex=-1:this.currentIndex=s,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let i=this.contentNode.children;if(!(!t.dragActive&&!cv.dragExceeded(t,e))){if(!t.dragActive){let s=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=s.width,t.tabPressPos=t.pressX-s.left):(t.tabPos=t.tab.offsetTop,t.tabSize=s.height,t.tabPressPos=t.pressY-s.top),t.tabPressOffset={x:t.pressX-s.left,y:t.pressY-s.top},t.tabLayout=cv.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=Xu.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&cv.detachExceeded(t,e)){t.detachRequested=!0;let s=t.index,o=e.clientX,r=e.clientY,a=i[s],c=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:c,tab:a,clientX:o,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}cv.layoutTabs(i,t,e,this._orientation)}}_evtPointerUp(e){if(e.button!==0&&e.button!==1)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}let o=this.contentNode.children,r=Wt.findFirstIndex(o,l=>pc.hitTest(l,e.clientX,e.clientY));if(r!==t.index)return;let a=this._titles[r];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:r,title:a});return}let c=o[r].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:r,title:a});return}return}if(e.button!==0)return;cv.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=cv.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,cv.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let s=t.index,o=t.targetIndex;o===-1||s===o||(Wt.move(this._titles,s,o),this._adjustCurrentForMove(s,o),this._tabMoved.emit({fromIndex:s,toIndex:o,title:this._titles[o]}),qt.sendMessage(this,ot.Msg.UpdateRequest))},i)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(cv.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let i=this.currentTitle,s=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&s===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:s,previousTitle:i,currentIndex:e,currentTitle:t});return}s>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let i=this._currentIndex,s=this.removeBehavior;if(i!==e){i>e&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(s==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-tab-before"){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}}(function(n){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let s=i.title.caption,o=this.createTabKey(i),r=o,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?$a.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):$a.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:s}=i;let o=this.createIconClass(i);return $a.div({className:o},s.icon,s.iconLabel)}renderLabel(i){return $a.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return $a.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let s=this._tabKeys.get(i.title);return s===void 0&&(s=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,s)),s}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let s="lm-TabBar-tab";return i.title.className&&(s+=` ${i.title.className}`),i.title.closable&&(s+=" lm-mod-closable"),i.current&&(s+=" lm-mod-current"),s}createTabDataset(i){return i.title.dataset}createTabARIA(i){var s;return{role:"tab","aria-selected":i.current.toString(),tabindex:`${(s=i.tabIndex)!==null&&s!==void 0?s:"-1"}`}}createIconClass(i){let s="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e,n.addButtonSelector=".lm-TabBar-addButton"})(ZF||(ZF={}));var cv;(function(n){n.DRAG_THRESHOLD=5,n.DETACH_THRESHOLD=20;function e(){let d=document.createElement("div"),h=document.createElement("ul");h.setAttribute("role","tablist"),h.className="lm-TabBar-content",d.appendChild(h);let u=document.createElement("div");return u.className="lm-TabBar-addButton lm-mod-hidden",u.setAttribute("tabindex","-1"),u.setAttribute("role","button"),d.appendChild(u),d}n.createNode=e;function t(d){return d instanceof sLe?d:new sLe(d)}n.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}n.parseTransitionDuration=i;function s(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=n.DRAG_THRESHOLD||f>=n.DRAG_THRESHOLD}n.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+n.DETACH_THRESHOLD||h.clientY=u.bottom+n.DETACH_THRESHOLD}n.detachExceeded=r;function a(d,h,u,f){let p,m,v,w;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,w=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,w=h.contentRect.height);let b=h.index,C=m-h.tabPressPos,y=C+h.tabSize;for(let S=0,M=d.length;S>1);if(Sh.index&&y>N)k=`${-h.tabSize-F.margin}px`,b=Math.max(b,S);else if(S===h.index){let z=v-p,U=w-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,U))}px`}else k="";f==="horizontal"?d[S].style.left=k:d[S].style.top=k}h.targetIndex=b}n.layoutTabs=a;function c(d,h){let u;h==="horizontal"?u=d.contentRect.width:u=d.contentRect.height;let f;if(d.targetIndex===d.index)f=0;else if(d.targetIndex>d.index){let v=d.tabLayout[d.targetIndex];f=v.pos+v.size-d.tabSize-d.tabPos}else f=d.tabLayout[d.targetIndex].pos-d.tabPos;let p=u-(d.tabPos+d.tabSize),m=Math.max(-d.tabPos,Math.min(f,p));h==="horizontal"?d.tab.style.left=`${m}px`:d.tab.style.top=`${m}px`}n.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}n.resetTabPositions=l})(cv||(cv={}));class JZt extends XF{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:ot.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const t of this.tabBars())if(t.titles.length>1)for(const i of t.titles)i.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():V5()}widgets(){return this._root?this._root.iterUserWidgets():V5()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():V5()}tabBars(){return this._root?this._root.iterTabBars():V5()}handles(){return this._root?this._root.iterHandles():V5()}moveHandle(e,t,i){let s=e.classList.contains("lm-mod-hidden");if(!this._root||s)return;let o=this._root.findSplitNode(e);if(!o)return;let r;o.node.orientation==="horizontal"?r=t-e.offsetLeft:r=i-e.offsetTop,r!==0&&(o.node.holdSizes(),w_.adjust(o.node.sizers,o.index,r),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,i;e.main?i=hd.normalizeAreaConfig(e.main,t):i=null;let s=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of s)t.has(a)||(a.parent=null);for(const a of o)a.dispose();for(const a of r)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=hd.realizeAreaConfig(i,{createTabBar:a=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(a=>{this.attachWidget(a)}),this.parent.fit())}addWidget(e,t={}){let i=t.ref||null,s=t.mode||"tab-after",o=null;if(this._root&&i&&(o=this._root.findTabNode(i)),i&&!o)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,s){case"tab-after":this._insertTab(e,i,o,!0);break;case"tab-before":this._insertTab(e,i,o,!1);break;case"split-top":this._insertSplit(e,i,o,"vertical",!1);break;case"split-left":this._insertSplit(e,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,o,"vertical",!0);break;case"merge-top":this._insertSplit(e,i,o,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,i,o,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,i,o,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,i,o,"vertical",!0,!0);break}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=pc.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),s=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(s,o);if(!r)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=r,u=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=i.width-u-(l+d),m=i.height-f-(c+h);return{tabBar:a,x:s,y:o,top:c,left:l,right:p,bottom:m,width:d,height:h}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new sj(e)),this.parent.isAttached&&qt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.sendMessage(e,ot.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&qt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.sendMessage(e,ot.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(hd.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===ot.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=ot.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let i=t.parent;t.parent=null;let s=Wt.removeFirstOf(i.children,t),o=Wt.removeAt(i.handles,s);if(Wt.removeAt(i.sizers,s),o.parentNode&&o.parentNode.removeChild(o),i.children.length>1){i.syncHandles();return}let r=i.parent;i.parent=null;let a=i.children[0],c=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,c.parentNode&&c.parentNode.removeChild(c),this._root===i){a.parent=null,this._root=a;return}let l=r,d=l.children.indexOf(i);if(a instanceof hd.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Wt.removeAt(l.handles,d);Wt.removeAt(l.children,d),Wt.removeAt(l.sizers,d),h.parentNode&&h.parentNode.removeChild(h);for(let u=0,f=a.children.length;u=this._left+this._width||p=this._top+this._height?null:this}createConfig(){let f=this.tabBar.titles.map(m=>m.owner),p=this.tabBar.currentIndex;return{type:"tab-area",widgets:f,currentIndex:p}}holdAllSizes(){}fit(f,p){let m=0,v=0,w=1/0,b=1/0,C=p.get(this.tabBar),y=this.tabBar.currentTitle,S=y?p.get(y.owner):void 0,[M,k]=this.sizers;return C&&C.fit(),S&&S.fit(),C&&!C.isHidden?(m=Math.max(m,C.minWidth),v+=C.minHeight,M.minSize=C.minHeight,M.maxSize=C.maxHeight):(M.minSize=0,M.maxSize=0),S&&!S.isHidden?(m=Math.max(m,S.minWidth),v+=S.minHeight,k.minSize=S.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b}}update(f,p,m,v,w,b){this._top=p,this._left=f,this._width=m,this._height=v;let C=b.get(this.tabBar),y=this.tabBar.currentTitle,S=y?b.get(y.owner):void 0;if(w_.calc(this.sizers,v),C&&!C.isHidden){let M=this.sizers[0].size;C.update(f,p,m,M),p+=M}if(S&&!S.isHidden){let M=this.sizers[1].size;S.update(f,p,m,M)}}}n.TabLayoutNode=s;class o{constructor(f){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=f}*iterAllWidgets(){for(const f of this.children)yield*f.iterAllWidgets()}*iterUserWidgets(){for(const f of this.children)yield*f.iterUserWidgets()}*iterSelectedWidgets(){for(const f of this.children)yield*f.iterSelectedWidgets()}*iterTabBars(){for(const f of this.children)yield*f.iterTabBars()}*iterHandles(){yield*this.handles;for(const f of this.children)yield*f.iterHandles()}findTabNode(f){for(let p=0,m=this.children.length;pv.createConfig());return{type:"split-area",orientation:f,children:m,sizes:p}}syncHandles(){this.handles.forEach((f,p)=>{f.setAttribute("data-orientation",this.orientation),p===this.handles.length-1?f.classList.add("lm-mod-hidden"):f.classList.remove("lm-mod-hidden")})}holdSizes(){for(const f of this.sizers)f.sizeHint=f.size}holdAllSizes(){for(const f of this.children)f.holdAllSizes();this.holdSizes()}normalizeSizes(){let f=this.sizers.length;if(f===0)return;this.holdSizes();let p=this.sizers.reduce((m,v)=>m+v.sizeHint,0);if(p===0)for(const m of this.sizers)m.size=m.sizeHint=1/f;else for(const m of this.sizers)m.size=m.sizeHint/=p;this.normalized=!0}createNormalizedSizes(){let f=this.sizers.length;if(f===0)return[];let p=this.sizers.map(v=>v.size),m=p.reduce((v,w)=>v+w,0);if(m===0)for(let v=p.length-1;v>-1;v--)p[v]=1/f;else for(let v=p.length-1;v>-1;v--)p[v]/=m;return p}fit(f,p){let m=this.orientation==="horizontal",v=Math.max(0,this.children.length-1)*f,w=m?v:0,b=m?0:v,C=1/0,y=1/0;for(let S=0,M=this.children.length;S=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let w=0,b=u.children.length;w{let b=i(v,f,p),C=e(u.sizes[w]),y=f.createHandle();m.children.push(b),m.handles.push(y),m.sizers.push(C),b.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(hd||(hd={}));class cq extends ot{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new rl(this),this._addRequested=new rl(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||cq.defaultRenderer,this._edges=e.edges||Fl.DEFAULT_EDGES,e.tabsMovable!==void 0&&(this._tabsMovable=e.tabsMovable),e.tabsConstrained!==void 0&&(this._tabsConstrained=e.tabsConstrained),e.addButtonEnabled!==void 0&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new JZt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new cq.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const i of t.tabBars())i.show();break;case"single-document":t.restoreLayout(Fl.createSingleDocumentConfig(this));break;default:throw"unreachable"}qt.postMessage(this,Fl.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=J1e(this.tabBars(),i=>i.titles.indexOf(e.title)!==-1);if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(jp.IS_EDGE||jp.IS_IE)&&qt.flush(),qt.postMessage(this,Fl.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),qt.postMessage(this,Fl.LayoutModified)}processMessage(e){e.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){Fl.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Fl.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),qt.postMessage(this,Fl.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),!(this._tabsConstrained&&e.source!==this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:i}=e,{zone:s,target:o}=Fl.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||s==="invalid"){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof a!="function"){e.dropAction="none";return}let c=a();if(!(c instanceof ot)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?Fl.getDropRef(o.tabBar):null;switch(s){case"root-all":this.addWidget(c);break;case"root-top":this.addWidget(c,{mode:"split-top"});break;case"root-left":this.addWidget(c,{mode:"split-left"});break;case"root-right":this.addWidget(c,{mode:"split-right"});break;case"root-bottom":this.addWidget(c,{mode:"split-bottom"});break;case"widget-all":this.addWidget(c,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(c,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(c,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(c,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(c,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(c,{mode:"tab-after",ref:l});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(c)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&(this._releaseMouse(),qt.postMessage(this,Fl.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,s=J1e(t.handles(),d=>d.contains(i));if(!s)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let o=s.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(s),l=Xu.overrideCursor(c.cursor,this._document);this._pressData={handle:s,deltaX:r,deltaY:a,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,s=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,s)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),qt.postMessage(this,Fl.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:i,target:s}=Fl.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=pc.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=d.height*Fl.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*Fl.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*Fl.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*Fl.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=s.top,r=s.left,a=s.right,c=s.bottom;break;case"widget-top":o=s.top,r=s.left,a=s.right,c=s.bottom+s.height/2;break;case"widget-left":o=s.top,r=s.left,a=s.right+s.width/2,c=s.bottom;break;case"widget-right":o=s.top,r=s.left+s.width/2,a=s.right,c=s.bottom;break;case"widget-bottom":o=s.top+s.height/2,r=s.left,a=s.right,c=s.bottom;break;case"widget-tab":{const h=s.tabBar.node.getBoundingClientRect().height;o=s.top,r=s.left,a=s.right,c=s.bottom+s.height-h;break}default:throw"unreachable"}return this.overlay.show({top:o,left:r,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return Fl.isGeneratedTabBarProperty.set(e,!0),this._mode==="single-document"&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){qt.postMessage(this,Fl.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:s}=t;i&&i.owner.hide(),s&&s.owner.show(),(jp.IS_EDGE||jp.IS_IE)&&qt.flush(),qt.postMessage(this,Fl.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:i,tab:s,clientX:o,clientY:r,offset:a}=t,c=new GZt,l=()=>i.owner;c.setData("application/vnd.lumino.widget-factory",l);let d=s.cloneNode(!0);a&&(d.style.top=`-${a.y}px`,d.style.left=`-${a.x}px`),this._drag=new Xu({document:this._document,mimeData:c,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden");let h=()=>{this._drag=null,s.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(h)}}(function(n){class e{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(s){let o=this.node.style;o.top=`${s.top}px`,o.left=`${s.left}px`,o.right=`${s.right}px`,o.bottom=`${s.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(s){if(!this._hidden){if(s<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},s))}}}n.Overlay=e;class t{createTabBar(s){let o=new ZF({document:s});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let s=document.createElement("div");return s.className="lm-DockPanel-handle",s}}n.Renderer=t,n.defaultRenderer=new t})(cq||(cq={}));var Fl;(function(n){n.GOLDEN_RATIO=.618,n.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},n.LayoutModified=new q3("layout-modified"),n.isGeneratedTabBarProperty=new Aw({name:"isGeneratedTabBar",create:()=>!1});function e(s){if(s.isEmpty)return{main:null};let o=Array.from(s.widgets()),r=s.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}n.createSingleDocumentConfig=e;function t(s,o,r,a){if(!pc.hitTest(s.node,o,r))return{zone:"invalid",target:null};let c=s.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(s.mode==="multiple-document"){let C=s.node.getBoundingClientRect(),y=o-C.left+1,S=r-C.top+1,M=C.right-o,k=C.bottom-r;switch(Math.min(S,M,k,y)){case S:if(Sm&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let w=Math.min(d,h,u,f),b;switch(w){case d:b="widget-left";break;case h:b="widget-top";break;case u:b="widget-right";break;case f:b="widget-bottom";break;default:throw"unreachable"}return{zone:b,target:l}}n.findDropTarget=t;function i(s){return s.titles.length===0?null:s.currentTitle?s.currentTitle.owner:s.titles[s.titles.length-1].owner}n.getDropRef=i})(Fl||(Fl={}));class KM extends XF{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new KI],this._columnSizers=[new KI],this._box=null,e.rowCount!==void 0&&yh.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&yh.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=yh.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=yh.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(yh.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(yh.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=yh.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=yh.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let i=this._rowSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let i=this._columnSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){Wt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new sj(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Wt.findFirstIndex(this._items,s=>s.widget===e);if(t===-1)return;let i=Wt.removeAt(this._items,t);this.parent&&this.detachWidget(e),i.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&qt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.sendMessage(e,ot.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&qt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.sendMessage(e,ot.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let c=0,l=this.rowCount;c!c.isHidden);for(let c=0,l=e.length;c({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function e(c){let l=Math.max(0,Math.floor(c.row||0)),d=Math.max(0,Math.floor(c.column||0)),h=Math.max(1,Math.floor(c.rowSpan||0)),u=Math.max(1,Math.floor(c.columnSpan||0));return{row:l,column:d,rowSpan:h,columnSpan:u}}n.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}n.clampValue=t;function i(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}n.rowSpanCmp=i;function s(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}n.columnSpanCmp=s;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}n.reallocSizers=o;function r(c,l,d,h){if(d=h)return;let f=(h-u)/(d-l+1);for(let p=l;p<=d;++p)c[p].minSize+=f}n.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof KM&&c.parent.fit()}})(yh||(yh={}));class lq extends ot{constructor(e={}){super({node:pre.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(ot.Flag.DisallowLayout),this.renderer=e.renderer||lq.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&this._menus[e].items.length===0&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,i=!0){this._closeChildMenu();let s=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(s===-1){Wt.insert(this._menus,o,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),i&&this.update();return}o===this._menus.length&&o--,s!==o&&(Wt.move(this._menus,s,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Wt.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,s=this.renderer,o=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:i.length,c=0,l=!1;a=this._overflowMenu!==null?a-1:a;let d=new Array(a);for(let h=0;h{this._tabFocusIndex=h,this.activeIndex=h}}),c+=this._menuItemSizes[h],i[h].title.label===this._overflowMenuOptions.title&&(l=!0,a--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(this._overflowMenu===null){const h=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new aw({commands:new eA}),this._overflowMenu.title.label=h,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let h=i.length-2;h>=a;h--){const u=this.menus[h];u.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:u}),this.removeMenu(u,!1)}d[a]=s.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}else if(this._overflowMenu!==null){let h=this._overflowMenu.items,u=this.node.offsetWidth,f=this._overflowMenu.items.length;for(let p=0;pthis._menuItemSizes[m]){let v=h[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,v,!1),d[a]=s.renderItem({title:v.title,active:!1,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}jI.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,s=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&s===-1&&(s=r)}else for(let r=0;rt){s=r;break}this._overflowIndex=s}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),t===13||t===32||t===38||t===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(t===37||t===39){let r=t===37?-1:1,a=this._tabFocusIndex+r,c=this._menus.length;for(let l=0;lpc.hitTest(i,e.clientX,e.clientY));if(t===-1){this._closeChildMenu();return}if(e.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const i=this._positionForMenu(t);aw.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>pc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;aw.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:s}=t.getBoundingClientRect();return{top:s,left:i}}_evtFocusOut(e){!this._childMenu&&!this.node.contains(e.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let i=this._childMenu;if(i===t)return;this._childMenu=t,i?i.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,qt.sendMessage(this,ot.Msg.UpdateRequest);let{left:s,top:o}=e;(typeof s>"u"||typeof o>"u")&&({left:s,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(s,o,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let i=this._activeIndex,s=this._menus.length;switch(t){case"next":this.activeIndex=i===s-1?0:i+1;break;case"previous":this.activeIndex=i===0?s-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return $a.li({className:s,dataset:o,...i.disabled?{}:{tabindex:i.tabbable?"0":"-1"},onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let s=this.createIconClass(i);return $a.div({className:s},i.title.icon,i.title.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return $a.div({className:"lm-MenuBar-itemLabel"},s)}createItemClass(i){let s="lm-MenuBar-item";return i.title.className&&(s+=` ${i.title.className}`),i.active&&!i.disabled&&(s+=" lm-mod-active"),s}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true","aria-disabled":i.disabled?"true":"false"}}createIconClass(i){let s="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}formatLabel(i){let{label:s,mnemonic:o}=i.title;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=$a.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}n.Renderer=e,n.defaultRenderer=new e})(lq||(lq={}));var pre;(function(n){function e(){let i=document.createElement("div"),s=document.createElement("ul");return s.className="lm-MenuBar-content",i.appendChild(s),s.setAttribute("role","menubar"),i}n.createNode=e;function t(i,s,o){let r=-1,a=-1,c=!1,l=s.toUpperCase();for(let d=0,h=i.length;d=0&&p1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===ot.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=ot.HiddenMode.Scale),t.hiddenMode=ot.HiddenMode.Scale):t.hiddenMode=ot.HiddenMode.Display,Wt.insert(this._items,e,new sj(t)),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);this.parent.isAttached&&qt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.sendMessage(t,ot.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===ot.HiddenMode.Scale&&(t.hiddenMode=ot.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=ot.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let o=0,r=this._items.length;othis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(s))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,oe.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,s){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});s===void 0&&(s=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},s)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return Ot.MEMORY;if(e.workspaceFolder?.override!==void 0)return Ot.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return Ot.WORKSPACE;if(e.userRemote?.override!==void 0)return Ot.USER_REMOTE;if(e.userLocal?.override!==void 0)return Ot.USER_LOCAL}return e.memory?.value!==void 0?Ot.MEMORY:e.workspaceFolder?.value!==void 0?Ot.WORKSPACE_FOLDER:e.workspace?.value!==void 0?Ot.WORKSPACE:e.userRemote?.value!==void 0?Ot.USER_REMOTE:Ot.USER_LOCAL}_getValue(e,t,i){const s=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:s})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}toResourceConfigurationChangeEvent(e){return{affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>{const s=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:s})}}}};dLe=D([_(0,Re),_(1,Ai),_(2,Di)],dLe);const gue=".vscode",mre="settings",ZZt=`${gue}/${mre}.json`,eei="vscode://schemas/settings/default",tei="vscode://schemas/settings/user",iei="vscode://schemas/settings/profile",nei="vscode://schemas/settings/machine",Yrt="vscode://schemas/settings/workspace",sei="vscode://schemas/settings/folder",oei="vscode://schemas/launch",rei="vscode://schemas/tasks";ut.APPLICATION;const aei=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Jrt=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],cei=[ut.APPLICATION,...Jrt],lme=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],WX=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Xrt=[ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],$p="tasks",kk="launch",VOe=Object.create(null);VOe[$p]=`${gue}/${$p}.json`;VOe[kk]=`${gue}/${kk}.json`;const Zrt=Object.create(null);Zrt[$p]=`${$p}.json`;const lei=`{ +`+h.statusText+u)}}async function TXt(s){const e=s.pathname.split("/");if(e.length===3||e.length===2){const t=e[e.length-1];try{const i={Accept:"application/vnd.github+json"},n=SPe();n!=null&&(i.Authorization="Bearer "+n);const r=await(await fetch("https://api.github.com/gists/"+t,{method:"GET",headers:i})).json(),a={};let c,l,d;for(const[m,v]of Object.entries(r.files))if(m==="slint.json"){const b=JSON.parse(v.content);c=b.main;const w=b.mappings;Object.entries(w).forEach(([y,C])=>{a["/"+y]=C})}else{const b=v.raw_url;l==null&&(l=m,d=b),a["/"+m]=b}const h=new jii(a);if(r.errors)return Promise.reject(`Failed to read gist: +`+r.errors.join(` +`));const u=r.description.match(/main file is: "(.+)"/i)?.[1];let f=c??u??"main.slint",p=a["/"+f];return p==null&&(f=l,p=d),Promise.resolve([p,"/"+f,h])}catch(i){return Promise.reject(`Failed to retrieve information on Gist: +`+i)}}return Promise.resolve([s.toString(),null,null])}async function LXt(s){const e=s.pathname.split("/");return e[3]==="blob"?(e.splice(3,1),Promise.resolve([s.protocol+"//raw.githubusercontent.com"+e.join("/"),null,null])):Promise.resolve([s.toString(),null,null])}async function RXt(s){try{const e=new URL(s);if(e.hostname==="gist.github.com")return TXt(e);if(e.hostname==="github.com")return LXt(e)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Nt;(function(s){function e(k,P,R=0,z=-1){let G=k.length;if(G===0)return-1;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y;z0;){let ge=ne>>1,De=j+ge;R(k[De],P)<0?(j=De+1,ne-=ge+1):ne=ge}return j}s.lowerBound=a;function c(k,P,R,z=0,G=-1){let Y=k.length;if(Y===0)return 0;z<0?z=Math.max(0,z+Y):z=Math.min(z,Y-1),G<0?G=Math.max(0,G+Y):G=Math.min(G,Y-1);let j=z,ne=G-z+1;for(;ne>0;){let ge=ne>>1,De=j+ge;R(k[De],P)>0?ne=ge:(j=De+1,ne-=ge+1)}return j}s.upperBound=c;function l(k,P,R){if(k===P)return!0;if(k.length!==P.length)return!1;for(let z=0,G=k.length;z=Y&&(R=G<0?Y-1:Y),z===void 0?z=G<0?-1:Y:z<0?z=Math.max(z+Y,G<0?-1:0):z>=Y&&(z=G<0?Y-1:Y);let j;G<0&&z>=R||G>0&&R>=z?j=0:G<0?j=Math.floor((z-R+1)/G+1):j=Math.floor((z-R-1)/G+1);let ne=[];for(let ge=0;ge=z))return;let Y=z-R+1;if(P>0?P=P%Y:P<0&&(P=(P%Y+Y)%Y),P===0)return;let j=R+P;u(k,R,j-1),u(k,j,z),u(k,R,z)}s.rotate=f;function p(k,P,R=0,z=-1){let G=k.length;if(G===0)return;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y;zP;--G)k[G]=k[G-1];k[P]=R}s.insert=m;function v(k,P){let R=k.length;if(P<0&&(P+=R),P<0||P>=R)return;let z=k[P];for(let G=P+1;G=R&&j<=z&&k[j]===P||z=R)&&k[j]===P?Y++:Y>0&&(k[j-Y]=k[j]);return Y>0&&(k.length=G-Y),Y}s.removeAllOf=y;function C(k,P,R=0,z=-1){let G,Y=i(k,P,R,z);return Y!==-1&&(G=v(k,Y)),{index:Y,value:G}}s.removeFirstWhere=C;function A(k,P,R=-1,z=0){let G,Y=n(k,P,R,z);return Y!==-1&&(G=v(k,Y)),{index:Y,value:G}}s.removeLastWhere=A;function L(k,P,R=0,z=-1){let G=k.length;if(G===0)return 0;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y=0;for(let j=0;j=R&&j<=z&&P(k[j],j)||z=R)&&P(k[j],j)?Y++:Y>0&&(k[j-Y]=k[j]);return Y>0&&(k.length=G-Y),Y}s.removeAllWhere=L})(Nt||(Nt={}));function*T4(){}function NDe(s,e){let t=0;for(const i of s)if(e(i,t++))return i}function MXt(s,e){let t=0;for(const i of s)if(e(i,t++)===!1)return!1;return!0}function NXt(s,e){let t=0;for(const i of s)if(e(i,t++))return!0;return!1}var J3e;(function(s){function e(t,i,n){return n===0?1/0:t>i&&n>0||t-1;e--)yield s[e]}function FXt(s){let e=[],t=new Set,i=new Map;for(const r of s)n(r);for(const[r]of i)o(r);return e;function n(r){let[a,c]=r,l=i.get(c);l?l.push(a):i.set(c,[a])}function o(r){if(t.has(r))return;t.add(r);let a=i.get(r);if(a)for(const c of a)o(c);e.push(r)}}var K$;(function(s){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}s.cmp=o})(K$||(K$={}));var Xc;(function(s){s.emptyObject=Object.freeze({}),s.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}s.isPrimitive=e;function t(d){return Array.isArray(d)}s.isArray=t;function i(d){return!e(d)&&!t(d)}s.isObject=i;function n(d,h){if(d===h)return!0;if(e(d)||e(h))return!1;let u=t(d),f=t(h);return u!==f?!1:u&&f?r(d,h):a(d,h)}s.deepEqual=n;function o(d){return e(d)?d:t(d)?c(d):l(d)}s.deepCopy=o;function r(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===r.provides)return!0;const f=c.get(u);if(!f)return!1;const p=a.get(f),m=[...p.requires,...p.optional];return m.length===0?!1:(h.push(f),m.some(d)?!0:(h.pop(),!1))};if(!r.provides||l.length===0)return;const h=[r.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}s.ensureNoCycle=i;function n(r,a,c){const l=new Array,d=m=>{const v=a.get(m),b=[...v.requires,...v.optional];l.push(...b.reduce((w,y)=>{const C=c.get(y);return C&&w.push([m,C]),w},[]))};for(const m of a.keys())d(m);const h=l.filter(m=>m[1]===r);let u=0;for(;h.length>u;){const m=h.length,v=new Set(h.map(b=>b[0]));for(const b of v)l.filter(w=>w[1]===b).forEach(w=>{h.includes(w)||h.push(w)});u=m}const f=FXt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}s.findDependents=n;function o(r,a){const c=new Set;for(const l of r.keys())r.get(l).autoStart===!0&&c.add(l);if(a.startPlugins)for(const l of a.startPlugins)c.add(l);if(a.ignorePlugins)for(const l of a.ignorePlugins)c.delete(l);return Array.from(c)}s.collectStartupPlugins=o})(X3e||(X3e={}));function BXt(s){let e=0;for(let t=0,i=s.length;t>>0),s[t]=e&255,e>>>=8}var PDe;(function(s){s.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:BXt})()})(PDe||(PDe={}));function WXt(s){const e=new Uint8Array(16),t=new Array(256);for(let i=0;i<16;++i)t[i]="0"+i.toString(16);for(let i=16;i<256;++i)t[i]=i.toString(16);return function(){return s(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+"-"+t[e[4]]+t[e[5]]+"-"+t[e[6]]+t[e[7]]+"-"+t[e[8]]+t[e[9]]+"-"+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}}var FDe;(function(s){s.uuid4=WXt(PDe.getRandomValues)})(FDe||(FDe={}));var Z3e;(function(s){function e(t){const i=document.body,n=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}s.copyText=e})(Z3e||(Z3e={}));var Fa;(function(s){function e(o){let r=window.getComputedStyle(o),a=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderLeftWidth)||0,l=parseFloat(r.borderRightWidth)||0,d=parseFloat(r.borderBottomWidth)||0,h=parseFloat(r.paddingTop)||0,u=parseFloat(r.paddingLeft)||0,f=parseFloat(r.paddingRight)||0,p=parseFloat(r.paddingBottom)||0,m=c+u+f+l,v=a+h+p+d;return{borderTop:a,borderLeft:c,borderRight:l,borderBottom:d,paddingTop:h,paddingLeft:u,paddingRight:f,paddingBottom:p,horizontalSum:m,verticalSum:v}}s.boxSizing=e;function t(o){let r=window.getComputedStyle(o),a=parseFloat(r.minWidth)||0,c=parseFloat(r.minHeight)||0,l=parseFloat(r.maxWidth)||1/0,d=parseFloat(r.maxHeight)||1/0;return l=Math.max(a,l),d=Math.max(c,d),{minWidth:a,minHeight:c,maxWidth:l,maxHeight:d}}s.sizeLimits=t;function i(o,r,a){let c=o.getBoundingClientRect();return r>=c.left&&r=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){o.scrollTop-=a.top-c.top;return}if(c.topa.height){o.scrollTop-=a.bottom-c.bottom;return}if(c.bottom>a.bottom&&c.height{let d=Element.prototype;return d.matches||d.matchesSelector||d.mozMatchesSelector||d.msMatchesSelector||d.oMatchesSelector||d.webkitMatchesSelector||function(h){let u=this,f=u.ownerDocument?u.ownerDocument.querySelectorAll(h):[];return Array.prototype.indexOf.call(f,u)!==-1}})();function e(d){d=d.split(",",1)[0];let h=0,u=0,f=0;function p(m){let v=d.match(m);return v===null?!1:(d=d.slice(v[0].length),!0)}for(d=d.replace(l," $1 ");d.length>0;){if(p(t)){h++;continue}if(p(i)){u++;continue}if(p(n)){u++;continue}if(p(r)){f++;continue}if(p(a)){u++;continue}if(p(o)){f++;continue}if(!p(c))return 0}return h=Math.min(h,255),u=Math.min(u,255),f=Math.min(f,255),h<<16|u<<8|f}s.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(Mv||(Mv={}));class ODe{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new PC.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new PC.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof PC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new PC.LinkedListNode(this,e),n=t,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof PC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new PC.LinkedListNode(this,e),n=t,o=n.next;return i.next=o,i.prev=n,n.next=i,o.prev=i,this._size++,i}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof PC.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}(function(s){function e(t){let i=new s;return i.assign(t),i}s.from=e})(ODe||(ODe={}));var PC;(function(s){class e{constructor(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}}s.LinkedListNode=e})(PC||(PC={}));let Hm=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class FV extends Hm{get isConflatable(){return!0}conflate(e){return!0}}var zt;(function(s){let e=null;const t=(P=>R=>{let z=!1;return P.then(()=>!z&&R()),()=>{z=!0}})(Promise.resolve());function i(P,R){let z=u.get(P);if(!z||z.length===0){b(P,R);return}MXt(PXt(z),Y=>Y?v(Y,P,R):!0)&&b(P,R)}s.sendMessage=i;function n(P,R){if(!R.isConflatable){w(P,R);return}NXt(h,G=>G.handler!==P||!G.msg||G.msg.type!==R.type||!G.msg.isConflatable?!1:G.msg.conflate(R))||w(P,R)}s.postMessage=n;function o(P,R){let z=u.get(P);z&&z.indexOf(R)!==-1||(z?z.push(R):u.set(P,[R]))}s.installMessageHook=o;function r(P,R){let z=u.get(P);if(!z)return;let G=z.indexOf(R);G!==-1&&(z[G]=null,C(z))}s.removeMessageHook=r;function a(P){let R=u.get(P);R&&R.length>0&&(Nt.fill(R,null),C(R));for(const z of h)z.handler===P&&(z.handler=null,z.msg=null)}s.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,y(),m=!1)}s.flush=c;function l(){return p}s.getExceptionHandler=l;function d(P){let R=p;return p=P,R}s.setExceptionHandler=d;const h=new ODe,u=new WeakMap,f=new Set;let p=P=>{console.error(P)},m=!1;function v(P,R,z){let G=!0;try{typeof P=="function"?G=P(R,z):G=P.messageHook(R,z)}catch(Y){p(Y)}return G}function b(P,R){try{P.processMessage(R)}catch(z){p(z)}}function w(P,R){h.addLast({handler:P,msg:R}),e===null&&(e=t(y))}function y(){if(e=null,h.isEmpty)return;let P={handler:null,msg:null};for(h.addLast(P);;){let R=h.removeFirst();if(R===P)return;R.handler&&R.msg&&i(R.handler,R.msg)}}function C(P){f.size===0&&t(A),f.add(P)}function A(){f.forEach(L),f.clear()}function L(P){Nt.removeAllWhere(P,k)}function k(P){return P===null}})(zt||(zt={}));class nv{constructor(e){this._pid=V1.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,i=V1.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,n=V1.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=o)}coerce(e){let t,i=V1.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=n)}_createValue(e){let t=this._create;return t(e)}_coerceValue(e,t){let i=this._coerce;return i?i(e,t):t}_compareValue(e,t){let i=this._compare;return i?i(e,t):e===t}_maybeNotify(e,t,i){let n=this._changed;n&&!this._compareValue(t,i)&&n(e,t,i)}}(function(s){function e(t){V1.ownerData.delete(t)}s.clearData=e})(nv||(nv={}));var V1;(function(s){s.ownerData=new WeakMap,s.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=s.ownerData.get(t);return i||(i=Object.create(null),s.ownerData.set(t,i),i)}s.ensureMap=e})(V1||(V1={}));class Qa{constructor(e){this.sender=e}connect(e,t){return Wp.connect(this,e,t)}disconnect(e,t){return Wp.disconnect(this,e,t)}emit(e){Wp.emit(this,e)}}(function(s){function e(c,l){Wp.disconnectBetween(c,l)}s.disconnectBetween=e;function t(c){Wp.disconnectSender(c)}s.disconnectSender=t;function i(c){Wp.disconnectReceiver(c)}s.disconnectReceiver=i;function n(c){Wp.disconnectAll(c)}s.disconnectAll=n;function o(c){Wp.disconnectAll(c)}s.clearData=o;function r(){return Wp.exceptionHandler}s.getExceptionHandler=r;function a(c){let l=Wp.exceptionHandler;return Wp.exceptionHandler=c,l}s.setExceptionHandler=a})(Qa||(Qa={}));var Wp;(function(s){s.exceptionHandler=w=>{console.error(w)};function e(w,y,C){C=C||void 0;let A=c.get(w.sender);if(A||(A=[],c.set(w.sender,A)),u(A,w,y,C))return!1;let L=C||y,k=l.get(L);k||(k=[],l.set(L,k));let P={signal:w,slot:y,thisArg:C};return A.push(P),k.push(P),!0}s.connect=e;function t(w,y,C){C=C||void 0;let A=c.get(w.sender);if(!A||A.length===0)return!1;let L=u(A,w,y,C);if(!L)return!1;let k=C||y,P=l.get(k);return L.signal=null,p(A),p(P),!0}s.disconnect=t;function i(w,y){let C=c.get(w);if(!C||C.length===0)return;let A=l.get(y);if(!(!A||A.length===0)){for(const L of A)L.signal&&L.signal.sender===w&&(L.signal=null);p(C),p(A)}}s.disconnectBetween=i;function n(w){let y=c.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.thisArg||C.slot;C.signal=null,p(l.get(A))}p(y)}}s.disconnectSender=n;function o(w){let y=l.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.signal.sender;C.signal=null,p(c.get(A))}p(y)}}s.disconnectReceiver=o;function r(w){n(w),o(w)}s.disconnectAll=r;function a(w,y){let C=c.get(w.sender);if(!(!C||C.length===0))for(let A=0,L=C.length;AL.signal===y&&L.slot===C&&L.thisArg===A)}function f(w,y){let{signal:C,slot:A,thisArg:L}=w;try{A.call(L,C.sender,y)}catch(k){s.exceptionHandler(k)}}function p(w){d.size===0&&h(m),d.add(w)}function m(){d.forEach(v),d.clear()}function v(w){Nt.removeAllWhere(w,b)}function b(w){return w.signal===null}})(Wp||(Wp={}));class BDe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class WDe{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(WDe||(WDe={}));class e9e extends WDe{constructor(){super(...arguments),this._disposed=new Qa(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Qa.clearData(this))}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(e9e||(e9e={}));class qh{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:n}=this._scrollTarget,o=Su.SCROLL_EDGE_SIZE-n,r=Math.pow(o/Su.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Su.SCROLL_EDGE_SIZE));switch(i){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});Su.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(n=>{this._resolve=n});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(i),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage)return;let i=this.dragImage.style;i.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),e.button!==0)return;if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Su.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Su.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=Su.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=Su.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==n&&o!==i&&Su.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=Su.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Su.dispatchDragLeave(this,t,i,e));let r=Su.dispatchDragOver(this,i,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=Su.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=qh.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=qh.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=qh.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=qh.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}(function(s){class e extends DragEvent{constructor(n,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:n.altKey,button:n.button,clientX:n.clientX,clientY:n.clientY,ctrlKey:n.ctrlKey,detail:0,metaKey:n.metaKey,relatedTarget:o.related,screenX:n.screenX,screenY:n.screenY,shiftKey:n.shiftKey,view:window});const{drag:r}=o;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}s.Event=e;function t(i,n=document){return Su.overrideCursor(i,n)}s.overrideCursor=t})(qh||(qh={}));var Su;(function(s){s.SCROLL_EDGE_SIZE=20;function e(C,A){return h[C]&u[A]?C:"none"}s.validateAction=e;function t(C,A=document){if(C){if(i&&C==i.event)return i.element;s.cursorBackdrop.style.zIndex="-1000";const L=A.elementFromPoint(C.clientX,C.clientY);return s.cursorBackdrop.style.zIndex="",i={event:C,element:L},L}else{const L=s.cursorBackdrop.style.transform;if(n&&L===n.transform)return n.element;const k=s.cursorBackdrop.getBoundingClientRect();s.cursorBackdrop.style.zIndex="-1000";const P=A.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return s.cursorBackdrop.style.zIndex="",n={transform:L,element:P},P}}s.findElementBehindBackdrop=t;let i=null,n=null;function o(C){let A=C.clientX,L=C.clientY,k=t(C);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let P=0,R=0;k===document.body&&(P=window.pageXOffset,R=window.pageYOffset);let z=k.getBoundingClientRect(),G=z.top+R,Y=z.left+P,j=Y+z.width,ne=G+z.height;if(A=j||L=ne)continue;let ge=A-Y+1,De=L-G+1,Oe=j-A,yt=ne-L,Ne=Math.min(ge,De,Oe,yt);if(Ne>s.SCROLL_EDGE_SIZE)continue;let lt;switch(Ne){case yt:lt="bottom";break;case De:lt="top";break;case Oe:lt="right";break;case ge:lt="left";break;default:throw"unreachable"}let xt=k.scrollWidth-k.clientWidth,Ji=k.scrollHeight-k.clientHeight,Ii;switch(lt){case"top":Ii=Ji>0&&k.scrollTop>0;break;case"left":Ii=xt>0&&k.scrollLeft>0;break;case"right":Ii=xt>0&&k.scrollLeft0&&k.scrollTop{L===y&&s.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),s.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(s.cursorBackdrop))})}s.overrideCursor=f;function p(C){s.cursorBackdrop&&(s.cursorBackdrop.style.transform=`translate(${C.clientX}px, ${C.clientY}px)`)}function m(C){if(!s.cursorBackdrop)return;let A=t();if(!A)return;const L=A.closest("[data-lm-dragscroll]");L&&(L.scrollTop+=s.cursorBackdrop.scrollTop-b,L.scrollLeft+=s.cursorBackdrop.scrollLeft-b,v())}function v(){s.cursorBackdrop.scrollTop=b,s.cursorBackdrop.scrollLeft=b}const b=500;function w(){const C=document.createElement("div");return C.classList.add("lm-cursor-backdrop"),C}let y=0;s.cursorBackdrop=w()})(Su||(Su={}));function Wie(){return HDe.keyboardLayout}class GH{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=GH.extractKeys(t),this._modifierKeys=GH.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}(function(s){function e(i){let n=Object.create(null);for(let o in i)n[i[o]]=!0;return n}s.extractKeys=e;function t(i){let n=Object(null);for(let o=0,r=i.length;o{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(e!==void 0&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=Xc.emptyObject){var i;let n=this._commands.get(e);return Promise.resolve((i=n?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Xc.emptyObject){var i;let n=this._commands.get(e);return(i=n?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Xc.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Xc.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let n;try{n=i.execute.call(void 0,t)}catch(r){n=Promise.reject(r)}let o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=Bv.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new BDe(()=>{Nt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=lC.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(lC.isModifierKeyPressed(e)){let{exact:r}=Bv.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:n}=Bv.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=n.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.some(r=>r.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!o){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},Bv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},Bv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Bv.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const o=[...this._keydownEvents],r=(await Promise.race([Promise.all(o.map(async a=>{var c;return(c=this._holdKeyBindingPromises.get(a))!==null&&c!==void 0?c:Promise.resolve(!0)})),new Promise(a=>{setTimeout(()=>a([!1]),Bv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){let o=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${o}.`;console.warn(`${a} ${c}`);return}await this.execute(t,n)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}(function(s){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?Bu.IS_MAC?d=!0:h=!0:f==="Alt"?l=!0:f==="Cmd"?d=!0:f==="Ctrl"?h=!0:f==="Shift"?u=!0:f.length>0&&(c=f);return{cmd:d,ctrl:h,alt:l,shift:u,key:c}}s.parseKeystroke=e;function t(a){let c="",l=e(a);return l.ctrl&&(c+="Ctrl "),l.alt&&(c+="Alt "),l.shift&&(c+="Shift "),l.cmd&&Bu.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}s.normalizeKeystroke=t;function i(a){let c;return Bu.IS_WIN?c=a.winKeys||a.keys:Bu.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}s.normalizeKeys=i;function n(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=Bu.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),Bu.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(Bv.formatKey).join(h)}}s.formatKeystroke=n;function o(a){let c=Wie(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}s.isModifierKeyPressed=o;function r(a){let c=Wie(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&Bu.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}s.keystrokeForKeydownEvent=r})(lC||(lC={}));var Bv;(function(s){s.CHORD_TIMEOUT=1e3,s.KEYBINDING_HOLD_TIMEOUT=1e3,s.modifierkeyTimeOut=500;function e(y){return{execute:y.execute,describedBy:p(typeof y.describedBy=="function"?y.describedBy:{args:null,...y.describedBy},()=>({args:null})),label:p(y.label,c),mnemonic:p(y.mnemonic,l),icon:p(y.icon,f),iconClass:p(y.iconClass,c),iconLabel:p(y.iconLabel,c),caption:p(y.caption,c),usage:p(y.usage,c),className:p(y.className,c),dataset:p(y.dataset,u),isEnabled:y.isEnabled||d,isToggled:y.isToggled||h,isToggleable:y.isToggleable||!!y.isToggled,isVisible:y.isVisible||d}}s.createCommand=e;function t(y){var C;return{keys:lC.normalizeKeys(y),selector:m(y),command:y.command,args:y.args||Xc.emptyObject,preventDefault:(C=y.preventDefault)!==null&&C!==void 0?C:!0}}s.createKeyBinding=t;function i(y,C,A){let L=null,k=[],P=1/0,R=0;for(let z=0,G=y.length;zP)continue;let ge=MS.calculateSpecificity(Y.selector);(!L||ne=R)&&(L=Y,P=ne,R=ge)}return{exact:L,partial:k}}s.matchKeyBinding=i;function n(y){y.target.dispatchEvent(w(y))}s.replayKeyEvent=n;function o(y){return Bu.IS_MAC?r.hasOwnProperty(y)?r[y]:y:a.hasOwnProperty(y)?a[y]:y}s.formatKey=o;const r={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},a={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},c=()=>"",l=()=>-1,d=()=>!0,h=()=>!1,u=()=>({}),f=()=>{};function p(y,C){return y===void 0?C:typeof y=="function"?y:()=>y}function m(y){if(y.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${y.selector}`);if(!MS.isValid(y.selector))throw new Error(`Invalid selector: ${y.selector}`);return y.selector}function v(y,C){if(y.lengthC.length?2:1}function b(y,C){let A=C.target,L=C.currentTarget;for(let k=0;A!==null;A=A.parentElement,++k){if(A.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(MS.matches(A,y))return k;if(A===L)return-1}return-1}function w(y){let C=document.createEvent("Event"),A=y.bubbles||!0,L=y.cancelable||!0;return C.initEvent(y.type||"keydown",A,L),C.key=y.key||"",C.keyCode=y.keyCode||0,C.which=y.keyCode||0,C.ctrlKey=y.ctrlKey||!1,C.altKey=y.altKey||!1,C.shiftKey=y.shiftKey||!1,C.metaKey=y.metaKey||!1,C.view=y.view||window,C}})(Bv||(Bv={}));class UK{constructor(e){this.type="text",this.content=e}}class Hue{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}}function _a(s){let e={},t,i=[];for(let o=1,r=arguments.length;o=b.length){t(m[C],f);continue}let A=b[C],L=m[C];if(A===L){w=w.nextSibling;continue}if(A.type==="text"&&L.type==="text"){w.textContent!==L.content&&(w.textContent=L.content),w=w.nextSibling;continue}if(A.type==="text"||L.type==="text"){Nt.insert(b,C,L),t(L,f,w);continue}if(!A.renderer!=!L.renderer){Nt.insert(b,C,L),t(L,f,w);continue}let k=L.attrs.key;if(k&&k in v){let R=v[k];R.vNode!==A&&(Nt.move(b,b.indexOf(R.vNode,C+1),C),f.insertBefore(R.element,w),A=R.vNode,w=R.element)}if(A===L){w=w.nextSibling;continue}let P=A.attrs.key;if(P&&P!==k){Nt.insert(b,C,L),t(L,f,w);continue}if(A.tag!==L.tag){Nt.insert(b,C,L),t(L,f,w);continue}a(w,A.attrs,L.attrs),L.renderer?L.renderer.render(w,{attrs:L.attrs,children:L.children}):i(w,A.children,L.children),w=w.nextSibling}n(f,b,y,!0)}s.updateContent=i;function n(f,p,m,v){for(let b=p.length-1;b>=m;--b){const w=p[b],y=v?f.lastChild:f.childNodes[b];w.type==="text"||(w.renderer&&w.renderer.unrender?w.renderer.unrender(y,{attrs:w.attrs,children:w.children}):n(y,w.children,0,!1)),v&&f.removeChild(y)}}const o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(f,p){for(let m in p)m in o||(m.substr(0,2)==="on"?f[m]=p[m]:f.setAttribute(m,p[m]));p.className!==void 0&&f.setAttribute("class",p.className),p.htmlFor!==void 0&&f.setAttribute("for",p.htmlFor),p.dataset&&c(f,p.dataset),p.style&&d(f,p.style)}function a(f,p,m){if(p===m)return;let v;for(v in p)v in o||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in o||p[v]===m[v]||(v.substr(0,2)==="on"?f[v]=m[v]:f.setAttribute(v,m[v]));p.className!==m.className&&(m.className!==void 0?f.setAttribute("class",m.className):f.removeAttribute("class")),p.htmlFor!==m.htmlFor&&(m.htmlFor!==void 0?f.setAttribute("for",m.htmlFor):f.removeAttribute("for")),p.dataset!==m.dataset&&l(f,p.dataset||{},m.dataset||{}),p.style!==m.style&&h(f,p.style||{},m.style||{})}function c(f,p){for(let m in p)f.setAttribute(`data-${m}`,p[m])}function l(f,p,m){for(let v in p)v in m||f.removeAttribute(`data-${v}`);for(let v in m)p[v]!==m[v]&&f.setAttribute(`data-${v}`,m[v])}function d(f,p){let m=f.style,v;for(v in p)m[v]=p[v]}function h(f,p,m){let v=f.style,b;for(b in p)b in m||(v[b]="");for(b in m)p[b]!==m[b]&&(v[b]=m[b])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let b of p)b.type==="element"&&b.attrs.key&&(v[b.attrs.key]={vNode:b,element:m}),m=m.nextSibling;return v}})(r1||(r1={}));class AD{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var Zp;(function(s){function e(o,r){let a=o.length;if(a===0)return r;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(r===d)return 0;if(r<=c){for(let m=0;m=l){for(let m=0;m0&&m>f;){let v=m,b=h;for(let w=0;w0&&m>f;){let v=m/p;for(let b=0;b0&&m>f;){let v=m,b=h;for(let w=0;w=y.maxSize?(m-=y.maxSize-y.size,h-=y.stretch,y.size=y.maxSize,y.done=!0,p--,u--):(m-=C,y.size+=C)}}for(;p>0&&m>f;){let v=m/p;for(let b=0;b=w.maxSize?(m-=w.maxSize-w.size,w.size=w.maxSize,w.done=!0,p--):(m-=v,w.size+=v))}}}return 0}s.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):n(o,r,-a))}s.adjust=t;function i(o,r,a){let c=0;for(let u=0;u<=r;++u){let f=o[u];c+=f.maxSize-f.size}let l=0;for(let u=r+1,f=o.length;u=0&&d>0;--u){let f=o[u],p=f.maxSize-f.size;p>=d?(f.sizeHint=f.size+d,d=0):(f.sizeHint=f.size+p,d-=p)}let h=a;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function n(o,r,a){let c=0;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.maxSize-p.size;m>=d?(p.sizeHint=p.size+d,d=0):(p.sizeHint=p.size+m,d-=m)}let h=a;for(let u=r;u>=0&&h>0;--u){let f=o[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(Zp||(Zp={}));class UDe{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Qa(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0&&(this._icon=e.icon),e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,Qa.clearData(this))}}class nt{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Qa(this),this._hiddenMode=nt.HiddenMode.Display,this.node=Hie.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(nt.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&nt.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Qa.clearData(this),zt.clearData(this),nv.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(nt.Flag.IsDisposed)}get isAttached(){return this.testFlag(nt.Flag.IsAttached)}get isHidden(){return this.testFlag(nt.Flag.IsHidden)}get isVisible(){return this.testFlag(nt.Flag.IsVisible)}get title(){return Hie.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==nt.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new nt.ChildMessage("child-removed",this);zt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new nt.ChildMessage("child-added",this);zt.sendMessage(this._parent,t)}this.isDisposed||zt.sendMessage(this,nt.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(nt.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return t===!0?(this.node.classList.add(e),!0):t===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){zt.postMessage(this,nt.Msg.UpdateRequest)}fit(){zt.postMessage(this,nt.Msg.FitRequest)}activate(){zt.postMessage(this,nt.Msg.ActivateRequest)}close(){zt.sendMessage(this,nt.Msg.CloseRequest)}show(){if(this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeShow),this.clearFlag(nt.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterShow),this.parent)){let e=new nt.ChildMessage("child-shown",this);zt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeHide),this.setFlag(nt.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterHide),this.parent)){let e=new nt.ChildMessage("child-hidden",this);zt.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(nt.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(nt.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(nt.Flag.IsVisible),this.setFlag(nt.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(nt.Flag.IsVisible),this.clearFlag(nt.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&nt.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case nt.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case nt.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(s){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(s.HiddenMode||(s.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(s.Flag||(s.Flag={})),function(o){o.BeforeShow=new Hm("before-show"),o.AfterShow=new Hm("after-show"),o.BeforeHide=new Hm("before-hide"),o.AfterHide=new Hm("after-hide"),o.BeforeAttach=new Hm("before-attach"),o.AfterAttach=new Hm("after-attach"),o.BeforeDetach=new Hm("before-detach"),o.AfterDetach=new Hm("after-detach"),o.ParentChanged=new Hm("parent-changed"),o.UpdateRequest=new FV("update-request"),o.FitRequest=new FV("fit-request"),o.ActivateRequest=new FV("activate-request"),o.CloseRequest=new FV("close-request")}(s.Msg||(s.Msg={}));class e extends Hm{constructor(r,a){super(r),this.child=a}}s.ChildMessage=e;class t extends Hm{constructor(r,a){super("resize"),this.width=r,this.height=a}}s.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=s.ResizeMessage||(s.ResizeMessage={}));function i(o,r,a=null){if(o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");zt.sendMessage(o,s.Msg.BeforeAttach),r.insertBefore(o.node,a),zt.sendMessage(o,s.Msg.AfterAttach)}s.attach=i;function n(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");zt.sendMessage(o,s.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),zt.sendMessage(o,s.Msg.AfterDetach)}s.detach=n})(nt||(nt={}));var Hie;(function(s){s.titleProperty=new nv({name:"title",create:t=>new UDe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}s.createNode=e})(Hie||(Hie={}));class mN{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Qa.clearData(this),nv.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const t of this)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)zt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)zt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(s){function e(o){return PF.horizontalAlignmentProperty.get(o)}s.getHorizontalAlignment=e;function t(o,r){PF.horizontalAlignmentProperty.set(o,r)}s.setHorizontalAlignment=t;function i(o){return PF.verticalAlignmentProperty.get(o)}s.getVerticalAlignment=i;function n(o,r){PF.verticalAlignmentProperty.set(o,r)}s.setVerticalAlignment=n})(mN||(mN={}));class gG{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=Fa.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,n){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o"center",changed:e}),s.verticalAlignmentProperty=new nv({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(PF||(PF={}));class ele extends mN{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let i=this._widgets.indexOf(t),n=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Nt.insert(this._widgets,n,t),this.parent&&this.attachWidget(n,t);return}n===this._widgets.length&&n--,i!==n&&(Nt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Nt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let i=this.parent.node.children[e];this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach)}}var q$;(function(s){function e(t){return Math.max(0,Math.floor(t))}s.clampDimension=e})(q$||(q$={}));var Q$=q$;class GA extends ele{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,e.orientation!==void 0&&(this._orientation=e.orientation),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=q$.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=q$.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return vS.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length0&&(o.sizeHint=o.size);Zp.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let i=new gG(t),n=vS.createHandle(this.renderer),o=vS.averageSize(this._sizers),r=vS.createSizer(o);Nt.insert(this._items,e,i),Nt.insert(this._sizers,e,r),Nt.insert(this._handles,e,n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),Nt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Nt.removeAt(this._items,e),n=Nt.removeAt(this._handles,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,i,n,o,r,a){const c=this._items[e];if(c.isHidden)return;let l=this._handles[e].style;t?(i+=this.widgetOffset,c.update(i,n,a,o),i+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(n+=this.widgetOffset,c.update(i,n,r,a),n+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let c=0,l=this._items.length;c0&&(h.sizeHint=h.size),d.isHidden){h.minSize=0,h.maxSize=0;continue}d.fit(),h.stretch=GA.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,n+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,n=Math.max(n,d.minWidth))}let r=this._box=Fa.boxSizing(this.parent.node);n+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${n}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&zt.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&zt.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,u=this._items.length;h0){let h;if(d?h=Math.max(0,r-this._fixed):h=Math.max(0,a-this._fixed),this._hasNormedSizes){for(let f of this._sizers)f.sizeHint*=h;this._hasNormedSizes=!1}let u=Zp.calc(this._sizers,h);if(u>0)switch(this._alignment){case"start":break;case"center":c=0,l=u/2;break;case"end":c=0,l=u;break;case"justify":c=u/i,l=0;break;default:throw"unreachable"}}for(let h=0,u=this._items.length;h0,coerce:(r,a)=>Math.max(0,Math.floor(a)),changed:o});function e(r){let a=new AD;return a.sizeHint=Math.floor(r),a}s.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}s.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}s.averageSize=i;function n(r){let a=r.length;if(a===0)return[];let c=r.reduce((l,d)=>l+Math.abs(d),0);return c===0?r.map(l=>1/a):r.map(l=>l/c)}s.normalize=n;function o(r){r.parent&&r.parent.layout instanceof GA&&r.parent.fit()}})(vS||(vS={}));class UXt extends GA{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=Q$.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const i=this._titles[e],n=i.classList.contains("lm-mod-expanded"),o=Uie.createTitle(this.renderer,t.title,n);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${FDe.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=Uie.createTitle(this.renderer,t.title);Nt.insert(this._titles,e,i),this.parent.node.appendChild(i),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",i.id),super.attachWidget(e,t)}moveWidget(e,t,i){Nt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Nt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,o,r,a){const c=this._titles[e].style;c.top=`${n}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,n,o,r,a)}}var Uie;(function(s){function e(t,i,n=!0){const o=t.createSectionTitle(i);return o.style.position="absolute",o.style.contain="strict",o.setAttribute("aria-label",`${i.label} Section`),o.setAttribute("aria-expanded",n?"true":"false"),o.setAttribute("aria-controls",i.owner.id),n&&o.classList.add("lm-mod-expanded"),o}s.createTitle=e})(Uie||(Uie={}));class APe extends nt{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=VDe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var VDe;(function(s){function e(t){return t.layout||new ele}s.createLayout=e})(VDe||(VDe={}));class KH extends APe{constructor(e={}){super({layout:zDe.createLayout(e)}),this._handleMoved=new Qa(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=Nt.findFirstIndex(t.handles,l=>l.contains(e.target));if(i===-1)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let n,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?n=e.clientX-r.left:n=e.clientY-r.top;let a=window.getComputedStyle(o),c=qh.overrideCursor(a.cursor);this._pressData={index:i,delta:n,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,n=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-n.left-this._pressData.delta:t=e.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}(function(s){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}s.Renderer=e,s.defaultRenderer=new e;function t(n){return GA.getStretch(n)}s.getStretch=t;function i(n,o){GA.setStretch(n,o)}s.setStretch=i})(KH||(KH={}));var zDe;(function(s){function e(t){return t.layout||new GA({renderer:t.renderer||KH.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}s.createLayout=e})(zDe||(zDe={}));class $De extends KH{constructor(e={}){super({...e,layout:GDe.createLayout(e)}),this._widgetSizesCache=new WeakMap,this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=Nt.findFirstIndex(this.widgets,i=>i.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,i=t.widgets[e];if(!i)return;const n=i.isHidden,o=t.absoluteSizes(),r=(n?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(n){const l=this._widgetSizesCache.get(i);if(!l)return;c[e]+=l;const d=c.map(h=>h-l>0).lastIndexOf(!0);d===-1?c.forEach((h,u)=>{u!==e&&(c[u]-=o[u]/a*(l-r))}):c[d]-=l-r}else{const l=o[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=o[d]+l+r}return c.map(l=>l/(a+r))}_evtClick(e){const t=e.target;if(t){const i=Nt.findFirstIndex(this.titles,n=>n.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let i=!1;if(t){const n=Nt.findFirstIndex(this.titles,o=>o.contains(t));if(n>=0){const o=e.keyCode.toString();if(e.key.match(/Space|Enter/)||o.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||o.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||o.match(/38|40/)){const r=e.key.match(/ArrowLeft|ArrowUp/)||o.match(/37|38/)?-1:1,a=this.titles.length,c=(n+a+r)%a;this.titles[c].focus(),i=!0}else e.key==="End"||o==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||o==="36")&&(this.titles[0].focus(),i=!0)}i&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],i=this.layout.widgets[e],n=this._computeWidgetSize(e);n&&this.setRelativeSizes(n,!1),i.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),i.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),i.hide())}}(function(s){class e extends KH.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(i){return document.createElement("span")}createSectionTitle(i){const n=document.createElement("h3");n.setAttribute("tabindex","0"),n.id=this.createTitleKey(i),n.className=this.titleClassName;for(const a in i.dataset)n.dataset[a]=i.dataset[a];const o=n.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=n.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,n}createTitleKey(i){let n=this._titleKeys.get(i);return n===void 0&&(n=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,n)),n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e})($De||($De={}));var GDe;(function(s){function e(t){return t.layout||new UXt({renderer:t.renderer||$De.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}s.createLayout=e})(GDe||(GDe={}));class Zg extends ele{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",e.direction!==void 0&&(this._direction=e.direction),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=Q$.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=Q$.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){Nt.insert(this._items,e,new gG(t)),Nt.insert(this._sizers,e,new AD),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let a=0,c=this._items.length;a0)switch(this._alignment){case"start":break;case"center":l=0,d=c/2;break;case"end":l=0,d=c;break;case"justify":l=c/i,d=0;break;default:throw"unreachable"}for(let h=0,u=this._items.length;h0,coerce:(n,o)=>Math.max(0,Math.floor(o)),changed:i}),s.sizeBasisProperty=new nv({name:"sizeBasis",create:()=>0,coerce:(n,o)=>Math.max(0,Math.floor(o)),changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}s.isHorizontal=e;function t(n){return Math.max(0,Math.floor(n))}s.clampSpacing=t;function i(n){n.parent&&n.parent.layout instanceof Zg&&n.parent.fit()}})(z1||(z1={}));class t9e extends APe{constructor(e={}){super({layout:KDe.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}(function(s){function e(o){return Zg.getStretch(o)}s.getStretch=e;function t(o,r){Zg.setStretch(o,r)}s.setStretch=t;function i(o){return Zg.getSizeBasis(o)}s.getSizeBasis=i;function n(o,r){Zg.setSizeBasis(o,r)}s.setSizeBasis=n})(t9e||(t9e={}));var KDe;(function(s){function e(t){return t.layout||new Zg(t)}s.createLayout=e})(KDe||(KDe={}));class Vie extends nt{constructor(e){super({node:FC.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Vie.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=FC.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>FC.createItem(this.commands,i));return t.forEach(i=>this._items.push(i)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){Nt.removeAt(this._items,e)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,i=this.contentNode,n=this._results;if(n||(n=this._results=FC.search(this._items,t),this._activeIndex=t?Nt.findFirstIndex(n,FC.canActivate):-1),!t&&n.length===0){SD.render(null,i);return}if(t&&n.length===0){let c=this.renderer.renderEmptyMessage({query:t});SD.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(n.length);for(let c=0,l=n.length;c=n.length)i.scrollTop=0;else{let c=i.children[r];Fa.scrollIntoViewIfNeeded(i,c)}}_evtClick(e){if(e.button!==0)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=Nt.findFirstIndex(this.contentNode.children,i=>i.contains(e.target));t!==-1&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,i=eP-R),L=w.slice(0,A),k=w.slice(A);for(let P=0,R=k.length;Pm.command===f&&Xc.deepEqual(m.args,p))||null}}})(FC||(FC={}));class W_ extends nt{constructor(e){super({node:Sg.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Qa(this),this._menuRequested=new Qa(this),this.addClass("lm-Menu"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||W_.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),e!==-1&&!Sg.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,i=t{this.activeIndex=a}})}SD.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(t===38){this.activatePreviousItem();return}if(t===39){let r=this.activeItem;r&&r.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=Wie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=Sg.findMnemonic(this._items,i,n);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.triggerActiveItem()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;!i||i.type!=="submenu"||!i.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:i}=e;if(Fa.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Sg.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let i=t.submenu;if(i===this._childMenu)return;W_.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,zt.sendMessage(this,nt.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];Sg.openSubmenu(i,n),e&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},Sg.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Sg.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Sg.saveWindowData()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.item.icon,i.item.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-Menu-itemLabel"},n)}renderShortcut(i){let n=this.formatShortcut(i);return _a.div({className:"lm-Menu-itemShortcut"},n)}renderSubmenu(i){return _a.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let n="lm-Menu-item";i.item.isEnabled||(n+=" lm-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden"),i.active&&(n+=" lm-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed");let o=i.item.className;return o&&(n+=` ${o}`),n}createItemDataset(i){let n,{type:o,command:r,dataset:a}=i.item;return o==="command"?n={...a,type:o,command:r}:n={...a,type:o},n}createIconClass(i){let n="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${n} ${o}`:n}createItemARIA(i){let n={};switch(i.item.type){case"separator":n.role="presentation";break;case"submenu":n["aria-haspopup"]="true",i.item.isEnabled||(n["aria-disabled"]="true");break;default:i.item.isEnabled||(n["aria-disabled"]="true"),n.role="menuitem"}return n}formatLabel(i){let{label:n,mnemonic:o}=i.item;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let n=i.item.keyBinding;return n?lC.formatKeystroke(n.keys):null}}s.Renderer=e,s.defaultRenderer=new e})(W_||(W_={}));var Sg;(function(s){s.TIMER_DELAY=300,s.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function n(){e=d(),t++}s.saveWindowData=n;function o(){let m=document.createElement("div"),v=document.createElement("ul");return v.className="lm-Menu-content",m.appendChild(v),v.setAttribute("role","menu"),m.tabIndex=0,m}s.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}s.canActivate=r;function a(m,v){return new p(m.commands,v)}s.createItem=a;function c(m,v,b){for(let w=m;w;w=w.childMenu)if(Fa.hitTest(w.node,v,b))return!0;return!1}s.hitTestMenus=c;function l(m){let v=new Array(m.length);Nt.fill(v,!1);let b=0,w=m.length;for(;b=0;--y){let A=m[y];if(A.isVisible){if(A.type!=="separator")break;v[y]=!0}}let C=!1;for(;++bA+k&&(v=A+k-Y),!y&&b+j>L+P&&(b>L+P?b=L+P-j:b=b-j),G.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,b)}px`,G.opacity="1"}s.openRootMenu=h;function u(m,v){const b=i();let w=b.pageXOffset,y=b.pageYOffset,C=b.clientWidth,A=b.clientHeight;zt.sendMessage(m,nt.Msg.UpdateRequest);let L=A,k=m.node,P=k.style;P.opacity="0",P.maxHeight=`${L}px`,nt.attach(m,document.body);let{width:R,height:z}=k.getBoundingClientRect(),G=Fa.boxSizing(m.node),Y=v.getBoundingClientRect(),j=Y.right-s.SUBMENU_OVERLAP;j+R>w+C&&(j=Y.left+s.SUBMENU_OVERLAP-R);let ne=Y.top-G.borderTop-G.paddingTop;ne+z>y+A&&(ne=Y.bottom+G.borderBottom+G.paddingBottom-z),P.transform=`translate(${Math.max(0,j)}px, ${Math.max(0,ne)}px`,P.opacity="1"}s.openSubmenu=u;function f(m,v,b){let w=-1,y=-1,C=!1,A=v.toUpperCase();for(let L=0,k=m.length;L=0&&Gw.command===v&&Xc.deepEqual(w.args,b))||null}return null}}})(Sg||(Sg={}));var i9e;(function(s){function e(r,a){let c=i(r.selector),l=r.rank!==void 0?r.rank:1/0;return{...r,selector:c,rank:l,id:a}}s.createItem=e;function t(r,a,c,l){let d=a.target;if(!d)return null;let h=a.currentTarget;if(!h||!h.contains(d)&&(d=document.elementFromPoint(a.clientX,a.clientY),!d||!h.contains(d)))return null;let u=[],f=r.slice();for(;d!==null;){let p=[];for(let m=0,v=f.length;m=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,i=this._titles[t]||null,n=e,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,currentTitle:o})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let i=qm.asTitle(t),n=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return n===-1?(Nt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,n===o||(Nt.move(this._titles,n,o),this.update(),this._adjustCurrentForMove(n,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Nt.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let i of this._titles)i.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),e!==-1&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()}onUpdateRequest(e){let t=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(t.length);for(let r=0,a=t.length;rFa.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let n=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=n.label||"",a=o.innerHTML;o.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=r,o.appendChild(c);let l=()=>{c.removeEventListener("blur",l),o.innerHTML=a};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(n.label=n.caption=c.value),l()):d.key==="Escape"&&l()}),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData)return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,n=Nt.findFirstIndex(i,r=>Fa.hitTest(r,e.clientX,e.clientY));if(n===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[n],index:n,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),e.button===1||t))return;let o=i[n].querySelector(this.renderer.closeIconSelector);o&&o.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let i=this.contentNode.children;if(!(!t.dragActive&&!qm.dragExceeded(t,e))){if(!t.dragActive){let n=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=n.width,t.tabPressPos=t.pressX-n.left):(t.tabPos=t.tab.offsetTop,t.tabSize=n.height,t.tabPressPos=t.pressY-n.top),t.tabLayout=qm.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=qh.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&qm.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,o=e.clientX,r=e.clientY,a=i[n],c=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:c,tab:a,clientX:o,clientY:r}),t.dragAborted)return}qm.layoutTabs(i,t,e,this._orientation)}}_evtPointerUp(e){if(e.button!==0&&e.button!==1)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}let o=this.contentNode.children,r=Nt.findFirstIndex(o,l=>Fa.hitTest(l,e.clientX,e.clientY));if(r!==t.index)return;let a=this._titles[r];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:r,title:a});return}let c=o[r].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:r,title:a});return}return}if(e.button!==0)return;qm.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=qm.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,qm.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let n=t.index,o=t.targetIndex;o===-1||n===o||(Nt.move(this._titles,n,o),this._adjustCurrentForMove(n,o),this._tabMoved.emit({fromIndex:n,toIndex:o,title:this._titles[o]}),zt.sendMessage(this,nt.Msg.UpdateRequest))},i)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(qm.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let i=this.currentTitle,n=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&n===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:e,currentTitle:t});return}n>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let i=this._currentIndex,n=this.removeBehavior;if(i!==e){i>e&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(n==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(n==="select-tab-before"){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(n==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}}(function(s){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let n=i.title.caption,o=this.createTabKey(i),r=o,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:n}=i;let o=this.createIconClass(i);return _a.div({className:o},n.icon,n.iconLabel)}renderLabel(i){return _a.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return _a.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let n=this._tabKeys.get(i.title);return n===void 0&&(n=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,n)),n}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let n="lm-TabBar-tab";return i.title.className&&(n+=` ${i.title.className}`),i.title.closable&&(n+=" lm-mod-closable"),i.current&&(n+=" lm-mod-current"),n}createTabDataset(i){return i.title.dataset}createTabARIA(i){return{role:"tab","aria-selected":i.current.toString()}}createIconClass(i){let n="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e,s.addButtonSelector=".lm-TabBar-addButton"})(_I||(_I={}));var qm;(function(s){s.DRAG_THRESHOLD=5,s.DETACH_THRESHOLD=20;function e(){let d=document.createElement("div"),h=document.createElement("ul");h.setAttribute("role","tablist"),h.className="lm-TabBar-content",d.appendChild(h);let u=document.createElement("div");return u.className="lm-TabBar-addButton lm-mod-hidden",d.appendChild(u),d}s.createNode=e;function t(d){return d instanceof UDe?d:new UDe(d)}s.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}s.parseTransitionDuration=i;function n(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=s.DRAG_THRESHOLD||f>=s.DRAG_THRESHOLD}s.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+s.DETACH_THRESHOLD||h.clientY=u.bottom+s.DETACH_THRESHOLD}s.detachExceeded=r;function a(d,h,u,f){let p,m,v,b;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,b=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,b=h.contentRect.height);let w=h.index,y=m-h.tabPressPos,C=y+h.tabSize;for(let A=0,L=d.length;A>1);if(Ah.index&&C>R)k=`${-h.tabSize-P.margin}px`,w=Math.max(w,A);else if(A===h.index){let z=v-p,G=b-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,G))}px`}else k="";f==="horizontal"?d[A].style.left=k:d[A].style.top=k}h.targetIndex=w}s.layoutTabs=a;function c(d,h){let u;h==="horizontal"?u=d.contentRect.width:u=d.contentRect.height;let f;if(d.targetIndex===d.index)f=0;else if(d.targetIndex>d.index){let v=d.tabLayout[d.targetIndex];f=v.pos+v.size-d.tabSize-d.tabPos}else f=d.tabLayout[d.targetIndex].pos-d.tabPos;let p=u-(d.tabPos+d.tabSize),m=Math.max(-d.tabPos,Math.min(f,p));h==="horizontal"?d.tab.style.left=`${m}px`:d.tab.style.top=`${m}px`}s.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}s.resetTabPositions=l})(qm||(qm={}));class VXt extends mN{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,e.spacing!==void 0&&(this._spacing=Q$.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:nt.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const t of this.tabBars())if(t.titles.length>1)for(const i of t.titles)i.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=Q$.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():T4()}widgets(){return this._root?this._root.iterUserWidgets():T4()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():T4()}tabBars(){return this._root?this._root.iterTabBars():T4()}handles(){return this._root?this._root.iterHandles():T4()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let o=this._root.findSplitNode(e);if(!o)return;let r;o.node.orientation==="horizontal"?r=t-e.offsetLeft:r=i-e.offsetTop,r!==0&&(o.node.holdSizes(),Zp.adjust(o.node.sizers,o.index,r),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,i;e.main?i=Vl.normalizeAreaConfig(e.main,t):i=null;let n=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of n)t.has(a)||(a.parent=null);for(const a of o)a.dispose();for(const a of r)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=Vl.realizeAreaConfig(i,{createTabBar:a=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(a=>{this.attachWidget(a)}),this.parent.fit())}addWidget(e,t={}){let i=t.ref||null,n=t.mode||"tab-after",o=null;if(this._root&&i&&(o=this._root.findTabNode(i)),i&&!o)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,i,o,!0);break;case"tab-before":this._insertTab(e,i,o,!1);break;case"split-top":this._insertSplit(e,i,o,"vertical",!1);break;case"split-left":this._insertSplit(e,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,o,"vertical",!0);break}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Fa.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,o);if(!r)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=r,u=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=i.width-u-(l+d),m=i.height-f-(c+h);return{tabBar:a,x:n,y:o,top:c,left:l,right:p,bottom:m,width:d,height:h}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new gG(e)),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(Vl.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===nt.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=nt.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let i=t.parent;t.parent=null;let n=Nt.removeFirstOf(i.children,t),o=Nt.removeAt(i.handles,n);if(Nt.removeAt(i.sizers,n),o.parentNode&&o.parentNode.removeChild(o),i.children.length>1){i.syncHandles();return}let r=i.parent;i.parent=null;let a=i.children[0],c=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,c.parentNode&&c.parentNode.removeChild(c),this._root===i){a.parent=null,this._root=a;return}let l=r,d=l.children.indexOf(i);if(a instanceof Vl.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Nt.removeAt(l.handles,d);Nt.removeAt(l.children,d),Nt.removeAt(l.sizers,d),h.parentNode&&h.parentNode.removeChild(h);for(let u=0,f=a.children.length;u=this._left+this._width||p=this._top+this._height?null:this}createConfig(){let f=this.tabBar.titles.map(m=>m.owner),p=this.tabBar.currentIndex;return{type:"tab-area",widgets:f,currentIndex:p}}holdAllSizes(){}fit(f,p){let m=0,v=0,b=1/0,w=1/0,y=p.get(this.tabBar),C=this.tabBar.currentTitle,A=C?p.get(C.owner):void 0,[L,k]=this.sizers;return y&&y.fit(),A&&A.fit(),y&&!y.isHidden?(m=Math.max(m,y.minWidth),v+=y.minHeight,L.minSize=y.minHeight,L.maxSize=y.maxHeight):(L.minSize=0,L.maxSize=0),A&&!A.isHidden?(m=Math.max(m,A.minWidth),v+=A.minHeight,k.minSize=A.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:b,maxHeight:w}}update(f,p,m,v,b,w){this._top=p,this._left=f,this._width=m,this._height=v;let y=w.get(this.tabBar),C=this.tabBar.currentTitle,A=C?w.get(C.owner):void 0;if(Zp.calc(this.sizers,v),y&&!y.isHidden){let L=this.sizers[0].size;y.update(f,p,m,L),p+=L}if(A&&!A.isHidden){let L=this.sizers[1].size;A.update(f,p,m,L)}}}s.TabLayoutNode=n;class o{constructor(f){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=f}*iterAllWidgets(){for(const f of this.children)yield*f.iterAllWidgets()}*iterUserWidgets(){for(const f of this.children)yield*f.iterUserWidgets()}*iterSelectedWidgets(){for(const f of this.children)yield*f.iterSelectedWidgets()}*iterTabBars(){for(const f of this.children)yield*f.iterTabBars()}*iterHandles(){yield*this.handles;for(const f of this.children)yield*f.iterHandles()}findTabNode(f){for(let p=0,m=this.children.length;pv.createConfig());return{type:"split-area",orientation:f,children:m,sizes:p}}syncHandles(){this.handles.forEach((f,p)=>{f.setAttribute("data-orientation",this.orientation),p===this.handles.length-1?f.classList.add("lm-mod-hidden"):f.classList.remove("lm-mod-hidden")})}holdSizes(){for(const f of this.sizers)f.sizeHint=f.size}holdAllSizes(){for(const f of this.children)f.holdAllSizes();this.holdSizes()}normalizeSizes(){let f=this.sizers.length;if(f===0)return;this.holdSizes();let p=this.sizers.reduce((m,v)=>m+v.sizeHint,0);if(p===0)for(const m of this.sizers)m.size=m.sizeHint=1/f;else for(const m of this.sizers)m.size=m.sizeHint/=p;this.normalized=!0}createNormalizedSizes(){let f=this.sizers.length;if(f===0)return[];let p=this.sizers.map(v=>v.size),m=p.reduce((v,b)=>v+b,0);if(m===0)for(let v=p.length-1;v>-1;v--)p[v]=1/f;else for(let v=p.length-1;v>-1;v--)p[v]/=m;return p}fit(f,p){let m=this.orientation==="horizontal",v=Math.max(0,this.children.length-1)*f,b=m?v:0,w=m?0:v,y=1/0,C=1/0;for(let A=0,L=this.children.length;A=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let b=0,w=u.children.length;b{let w=i(v,f,p),y=e(u.sizes[b]),C=f.createHandle();m.children.push(w),m.handles.push(C),m.sizers.push(y),w.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(Vl||(Vl={}));class j$ extends nt{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Qa(this),this._addRequested=new Qa(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||j$.defaultRenderer,this._edges=e.edges||Qc.DEFAULT_EDGES,e.tabsMovable!==void 0&&(this._tabsMovable=e.tabsMovable),e.tabsConstrained!==void 0&&(this._tabsConstrained=e.tabsConstrained),e.addButtonEnabled!==void 0&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new VXt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new j$.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const i of t.tabBars())i.show();break;case"single-document":t.restoreLayout(Qc.createSingleDocumentConfig(this));break;default:throw"unreachable"}zt.postMessage(this,Qc.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=NDe(this.tabBars(),i=>i.titles.indexOf(e.title)!==-1);if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(Bu.IS_EDGE||Bu.IS_IE)&&zt.flush(),zt.postMessage(this,Qc.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),zt.postMessage(this,Qc.LayoutModified)}processMessage(e){e.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){Qc.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Qc.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),zt.postMessage(this,Qc.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),!(this._tabsConstrained&&e.source!==this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:i}=e,{zone:n,target:o}=Qc.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||n==="invalid"){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof a!="function"){e.dropAction="none";return}let c=a();if(!(c instanceof nt)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?Qc.getDropRef(o.tabBar):null;switch(n){case"root-all":this.addWidget(c);break;case"root-top":this.addWidget(c,{mode:"split-top"});break;case"root-left":this.addWidget(c,{mode:"split-left"});break;case"root-right":this.addWidget(c,{mode:"split-right"});break;case"root-bottom":this.addWidget(c,{mode:"split-bottom"});break;case"widget-all":this.addWidget(c,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(c,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(c,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(c,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(c,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(c,{mode:"tab-after",ref:l});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(c)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&(this._releaseMouse(),zt.postMessage(this,Qc.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,n=NDe(t.handles(),d=>d.contains(i));if(!n)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let o=n.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(n),l=qh.overrideCursor(c.cursor,this._document);this._pressData={handle:n,deltaX:r,deltaY:a,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),zt.postMessage(this,Qc.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:i,target:n}=Qc.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=Fa.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=d.height*Qc.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*Qc.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*Qc.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*Qc.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=n.top,r=n.left,a=n.right,c=n.bottom;break;case"widget-top":o=n.top,r=n.left,a=n.right,c=n.bottom+n.height/2;break;case"widget-left":o=n.top,r=n.left,a=n.right+n.width/2,c=n.bottom;break;case"widget-right":o=n.top,r=n.left+n.width/2,a=n.right,c=n.bottom;break;case"widget-bottom":o=n.top+n.height/2,r=n.left,a=n.right,c=n.bottom;break;case"widget-tab":{const h=n.tabBar.node.getBoundingClientRect().height;o=n.top,r=n.left,a=n.right,c=n.bottom+n.height-h;break}default:throw"unreachable"}return this.overlay.show({top:o,left:r,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return Qc.isGeneratedTabBarProperty.set(e,!0),this._mode==="single-document"&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){zt.postMessage(this,Qc.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(Bu.IS_EDGE||Bu.IS_IE)&&zt.flush(),zt.postMessage(this,Qc.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:i,tab:n,clientX:o,clientY:r}=t,a=new OXt,c=()=>i.owner;a.setData("application/vnd.lumino.widget-factory",c);let l=n.cloneNode(!0);this._drag=new qh({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let d=()=>{this._drag=null,n.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(d)}}(function(s){class e{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(n){let o=this.node.style;o.top=`${n.top}px`,o.left=`${n.left}px`,o.right=`${n.right}px`,o.bottom=`${n.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(n){if(!this._hidden){if(n<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},n))}}}s.Overlay=e;class t{createTabBar(n){let o=new _I({document:n});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let n=document.createElement("div");return n.className="lm-DockPanel-handle",n}}s.Renderer=t,s.defaultRenderer=new t})(j$||(j$={}));var Qc;(function(s){s.GOLDEN_RATIO=.618,s.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},s.LayoutModified=new FV("layout-modified"),s.isGeneratedTabBarProperty=new nv({name:"isGeneratedTabBar",create:()=>!1});function e(n){if(n.isEmpty)return{main:null};let o=Array.from(n.widgets()),r=n.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}s.createSingleDocumentConfig=e;function t(n,o,r,a){if(!Fa.hitTest(n.node,o,r))return{zone:"invalid",target:null};let c=n.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){let y=n.node.getBoundingClientRect(),C=o-y.left+1,A=r-y.top+1,L=y.right-o,k=y.bottom-r;switch(Math.min(A,L,k,C)){case A:if(Am&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let b=Math.min(d,h,u,f),w;switch(b){case d:w="widget-left";break;case h:w="widget-top";break;case u:w="widget-right";break;case f:w="widget-bottom";break;default:throw"unreachable"}return{zone:w,target:l}}s.findDropTarget=t;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}s.getDropRef=i})(Qc||(Qc={}));class iL extends mN{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new AD],this._columnSizers=[new AD],this._box=null,e.rowCount!==void 0&&kd.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&kd.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=kd.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=kd.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(kd.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(kd.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=kd.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=kd.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let i=this._rowSizers[e];i&&(t=kd.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let i=this._columnSizers[e];i&&(t=kd.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){Nt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new gG(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Nt.findFirstIndex(this._items,n=>n.widget===e);if(t===-1)return;let i=Nt.removeAt(this._items,t);this.parent&&this.detachWidget(e),i.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let c=0,l=this.rowCount;c!c.isHidden);for(let c=0,l=e.length;c({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function e(c){let l=Math.max(0,Math.floor(c.row||0)),d=Math.max(0,Math.floor(c.column||0)),h=Math.max(1,Math.floor(c.rowSpan||0)),u=Math.max(1,Math.floor(c.columnSpan||0));return{row:l,column:d,rowSpan:h,columnSpan:u}}s.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}s.clampValue=t;function i(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}s.rowSpanCmp=i;function n(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}s.columnSpanCmp=n;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}s.reallocSizers=o;function r(c,l,d,h){if(d=h)return;let f=(h-u)/(d-l+1);for(let p=l;p<=d;++p)c[p].minSize+=f}s.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof iL&&c.parent.fit()}})(kd||(kd={}));class Y$ extends nt{constructor(e={}){super({node:zie.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(nt.Flag.DisallowLayout),this.renderer=e.renderer||Y$.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,e!==-1&&(this._tabFocusIndex=e),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,i=!0){this._closeChildMenu();let n=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(n===-1){Nt.insert(this._menus,o,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),i&&this.update();return}o===this._menus.length&&o--,n!==o&&(Nt.move(this._menus,n,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Nt.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&(this.activeIndex=0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,n=this.renderer,o=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:i.length,c=0,l=!1;a=this._overflowMenu!==null?a-1:a;let d=new Array(a);for(let h=0;h{this.activeIndex=h}}),c+=this._menuItemSizes[h],i[h].title.label===this._overflowMenuOptions.title&&(l=!0,a--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(this._overflowMenu===null){const h=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new W_({commands:new lC}),this._overflowMenu.title.label=h,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let h=i.length-2;h>=a;h--){const u=this.menus[h];u.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:u}),this.removeMenu(u,!1)}d[a]=n.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,onfocus:()=>{this.activeIndex=a}}),a++}else if(this._overflowMenu!==null){let h=this._overflowMenu.items,u=this.node.offsetWidth,f=this._overflowMenu.items.length;for(let p=0;pthis._menuItemSizes[m]){let v=h[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,v,!1),d[a]=n.renderItem({title:v.title,active:!1,tabbable:a===r,onfocus:()=>{this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}SD.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,n=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&n===-1&&(n=r)}else for(let r=0;rt){n=r;break}this._overflowIndex=n}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),t===13||t===32||t===38||t===40){this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(t===37){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===0?a-1:r-1;return}if(t===39){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===a-1?0:r+1;return}let i=Wie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=zie.findMnemonic(this._menus,i,n);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.openActiveMenu()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseDown(e){if(!Fa.hitTest(this.node,e.clientX,e.clientY))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=Nt.findFirstIndex(this.contentNode.children,i=>Fa.hitTest(i,e.clientX,e.clientY));if(t===-1){this._closeChildMenu();return}if(e.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{const i=this._positionForMenu(t);W_.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;W_.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:n}=t.getBoundingClientRect();return{top:n,left:i}}_evtMouseLeave(e){this._childMenu||(this.activeIndex=-1)}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let i=this._childMenu;if(i===t)return;this._childMenu=t,i?i.close():document.addEventListener("mousedown",this,!0),zt.sendMessage(this,nt.Msg.UpdateRequest);let{left:n,top:o}=e;(typeof n>"u"||typeof o>"u")&&({left:n,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,o,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let i=this._activeIndex,n=this._menus.length;switch(t){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.title.icon,i.title.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-MenuBar-itemLabel"},n)}createItemClass(i){let n="lm-MenuBar-item";return i.title.className&&(n+=` ${i.title.className}`),i.active&&(n+=" lm-mod-active"),n}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true"}}createIconClass(i){let n="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}formatLabel(i){let{label:n,mnemonic:o}=i.title;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}s.Renderer=e,s.defaultRenderer=new e})(Y$||(Y$={}));var zie;(function(s){function e(){let i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",i.appendChild(n),n.setAttribute("role","menubar"),i}s.createNode=e;function t(i,n,o){let r=-1,a=-1,c=!1,l=n.toUpperCase();for(let d=0,h=i.length;d=0&&p1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===nt.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=nt.HiddenMode.Scale),t.hiddenMode=nt.HiddenMode.Scale):t.hiddenMode=nt.HiddenMode.Display,Nt.insert(this._items,e,new gG(t)),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===nt.HiddenMode.Scale&&(t.hiddenMode=nt.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=nt.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let o=0,r=this._items.length;othis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(n))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,oe.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,n){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});n===void 0&&(n=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},n)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return St.MEMORY;if(e.workspaceFolder?.override!==void 0)return St.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return St.WORKSPACE;if(e.userRemote?.override!==void 0)return St.USER_REMOTE;if(e.userLocal?.override!==void 0)return St.USER_LOCAL}return e.memory?.value!==void 0?St.MEMORY:e.workspaceFolder?.value!==void 0?St.WORKSPACE_FOLDER:e.workspace?.value!==void 0?St.WORKSPACE:e.userRemote?.value!==void 0?St.USER_REMOTE:St.USER_LOCAL}_getValue(e,t,i){const n=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:n}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:n})}inspect(e,t,i){const n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}toResourceConfigurationChangeEvent(e){return{affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>{const n=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:n})}}}};QDe=D([_(0,Te),_(1,gi),_(2,xi)],QDe);const tle=".vscode",$ie="settings",KXt=`${tle}/${$ie}.json`,qXt="vscode://schemas/settings/default",QXt="vscode://schemas/settings/user",jXt="vscode://schemas/settings/profile",YXt="vscode://schemas/settings/machine",Tst="vscode://schemas/settings/workspace",JXt="vscode://schemas/settings/folder",XXt="vscode://schemas/launch",ZXt="vscode://schemas/tasks";at.APPLICATION;const eZt=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Lst=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],tZt=[at.APPLICATION,...Lst],Uue=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],uj=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Rst=[at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Of="tasks",cx="launch",EPe=Object.create(null);EPe[Of]=`${tle}/${Of}.json`;EPe[cx]=`${tle}/${cx}.json`;const Mst=Object.create(null);Mst[Of]=`${Of}.json`;const iZt=`{ "version": "2.0.0", "tasks": [] -}`,RA="workbench.settings.applyToAllProfiles",ms="vs/workbench/api/common/configurationExtensionPoint",dei=it.as(eL.JSONContribution),HX=it.as(Cs.Configuration),T7e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(ms,0,"A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading."),type:"string"},order:{description:g(ms,1,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(ms,2,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(ms,3,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(ms,4,"Schema of the configuration property."),$ref:"http://json-schema.org/draft-07/schema#"},{type:"object",properties:{scope:{type:"string",enum:["application","machine","window","resource","language-overridable","machine-overridable"],default:"window",enumDescriptions:[g(ms,5,"Configuration that can be configured only in the user settings."),g(ms,6,"Configuration that can be configured only in the user settings or only in the remote settings."),g(ms,7,"Configuration that can be configured in the user, remote or workspace settings."),g(ms,8,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(ms,9,"Resource configuration that can be configured in language specific settings."),g(ms,10,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(ms,11,"Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`.")},enumDescriptions:{type:"array",items:{type:"string"},description:g(ms,12,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(ms,13,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(ms,14,"Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.","`enum`")},markdownDescription:{type:"string",description:g(ms,15,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(ms,16,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(ms,17,"If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.")},editPresentation:{type:"string",enum:["singlelineText","multilineText"],enumDescriptions:[g(ms,18,"The value will be shown in an inputbox."),g(ms,19,"The value will be shown in a textarea.")],default:"singlelineText",description:g(ms,20,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(ms,21,"When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.")},ignoreSync:{type:"boolean",description:g(ms,22,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let s_;const eat=Ap.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:Hje}});eat.setHandler((n,{added:e,removed:t})=>{s_&&HX.deltaConfiguration(s_);const i=s_={};if(queueMicrotask(()=>{s_===i&&(HX.deltaConfiguration(s_),s_=void 0)}),t.length){const s=t.map(o=>({overrides:Vs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));s_.removedDefaults=s}if(e.length){const s=HX.getConfigurationProperties(),o=[ut.MACHINE_OVERRIDABLE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=Vs(a.value);for(const l of Object.keys(c))if(!dp.test(l)){const d=s[l];d?.scope&&!o.includes(d.scope)&&(a.collector.warn(g(ms,23,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l])}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});s_.addedDefaults=r}});const hei=Ap.registerExtensionPoint({extensionPoint:"configuration",deps:[eat],jsonSchema:{description:g(ms,24,"Contributes configuration settings."),oneOf:[T7e,{type:"array",items:T7e}]}}),dme=new Ga;hei.setHandler((n,{added:e,removed:t})=>{if(s_??={},t.length){const r=[];for(const a of t)r.push(...dme.get(a.description.identifier)||[]),dme.delete(a.description.identifier);s_.removedConfigurations=r}const i=new Set;function s(r,a){const c=[],l=Vs(r);return l.title&&typeof l.title!="string"&&a.collector.error(g(ms,25,"'configuration.title' must be a string")),o(l,a),l.id=r.id||a.description.identifier.value,l.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},l.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,l.title=l.title||a.description.displayName||a.description.identifier.value,c.push(l),c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(ms,26,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=$je(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(ms,27,"Cannot register '{0}'. This property is already registered.",d));continue}if(!fo(h)){delete c[d],a.collector.error(g(ms,28,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope?h.scope.toString()==="application"?h.scope=ut.APPLICATION:h.scope.toString()==="machine"?h.scope=ut.MACHINE:h.scope.toString()==="resource"?h.scope=ut.RESOURCE:h.scope.toString()==="machine-overridable"?h.scope=ut.MACHINE_OVERRIDABLE:h.scope.toString()==="language-overridable"?h.scope=ut.LANGUAGE_OVERRIDABLE:h.scope=ut.WINDOW:h.scope=ut.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(ms,29,"'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."));for(const d of l)o(d,a)}}if(e.length){const r=[];for(const a of e){const c=[],l=a.value;Array.isArray(l)?l.forEach(d=>c.push(...s(d,a))):c.push(...s(l,a)),dme.set(a.description.identifier,c),r.push(...c)}s_.addedConfigurations=r}HX.deltaConfiguration(s_),s_=void 0});dei.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(ms,30,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(ms,31,"A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file.")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(ms,33,"URI of the folder")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(ms,34,"Workspace settings"),$ref:Yrt},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(ms,35,"Workspace launch configurations"),$ref:oei},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(ms,36,"Workspace task configurations"),$ref:rei},extensions:{type:"object",default:{},description:g(ms,37,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(ms,38,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(ms,39,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(ms,40,"Unknown workspace configuration property")});class uei extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration;let i={};Array.isArray(t)?t.forEach(a=>{i={...i,...a.properties}}):t&&(i=t.properties);const s=i?Object.keys(i):[],o=[g(ms,41,"ID"),g(ms,42,"Description"),g(ms,43,"Default")],r=s.sort((a,c)=>a.localeCompare(c)).map(a=>[new Xt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Xt(i[a].markdownDescription,!1):i[a].description??"",new Xt().appendCodeblock("json",JSON.stringify(ll(i[a].default)?zje(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(ms,44,"Settings"),access:{canToggle:!1},renderer:new Gi(uei)});const zT="vs/workbench/contrib/workspaces/browser/workspaces.contribution";let hLe=class extends ${constructor(e,t,i,s,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=s,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==Nn.FOLDER||ost(this.contextService.getWorkspace()))return;const t=(await this.fileService.resolve(e.uri)).children?.map(i=>i.name);if(Array.isArray(t)){const i=t.filter(yde);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:Bwe.WORKSPACE,isSecondary:!0};if(t.length===1){const s=t[0];this.notificationService.prompt(nt.Info,g(zT,0,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",s,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,1,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:Qt(e,s)}])}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}else t.length>1&&this.notificationService.prompt(nt.Info,g(zT,2,"This folder contains multiple workspace files. Do you want to open one? [Learn more]({0}) about workspace files.","https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,3,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(s=>({label:s})),{placeHolder:g(zT,4,"Select a workspace to open")}).then(s=>{s&&this.hostService.openWindow([{workspaceUri:Qt(e,s.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}};hLe=D([_(0,Ti),_(1,Pi),_(2,ci),_(3,On),_(4,Id),_(5,on)],hLe);it.as(pf.Workbench).registerWorkbenchContribution(hLe,Us.Eventually);At(class extends pi{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Be(zT,1,"Open Workspace"),f1:!1,menu:{id:Te.EditorContent,when:ge.and(O7.Extension.isEqualTo(IJe),DZe.isEqualTo(ust),nTt.toNegated())}})}async run(n,e){const t=n.get(Id),i=n.get(Ti),s=n.get(Pi);if(i.getWorkbenchState()===Nn.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&_n(o,e)){s.info(g(zT,5,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class _re extends Px{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new Px(e,t),this._launchModel=_s.createEmptyModel(t),this._tasksModel=_s.createEmptyModel(t)}get folders(){return this._folders}get transient(){return this._transient}get settingsModel(){return this._settingsModelParser.configurationModel}get launchModel(){return this._launchModel}get tasksModel(){return this._tasksModel}reparseWorkspaceSettings(e){this._settingsModelParser.reparse(e)}getRestrictedWorkspaceSettings(){return this._settingsModelParser.restrictedConfigurations}doParseRaw(e,t){return this._folders=e.folders||[],this._transient=g9(e.transient)&&e.transient,this._settingsModelParser.parseRaw(e.settings,t),this._launchModel=this.createConfigurationModelFrom(e,"launch"),this._tasksModel=this.createConfigurationModelFrom(e,"tasks"),super.doParseRaw(e,t)}createConfigurationModelFrom(e,t){const i=e[t];if(i){const s=W9(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=s;const r=Object.keys(i).map(a=>`${t}.${a}`);return new _s(o,r,[],void 0,this.logService)}return _s.createEmptyModel(this.logService)}}class tat extends Px{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=W9(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),s=Object.create(null);s[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:s,keys:o,overrides:[]}}}class R7e extends f7{constructor(e,t,i,s,o,r,a,c,l,d,h){super(e,t,i,s,o,r,a,c,l,h),this._workspace=d}getValue(e,t={}){return super.getValue(e,t,this._workspace)}inspect(e,t={}){return super.inspect(e,t,this._workspace)}keys(){return super.keys(this._workspace)}compareAndDeleteFolderConfiguration(e){return this._workspace&&this._workspace.folders.length>0&&this._workspace.folders[0].uri.toString()===e.toString()?{keys:[],overrides:[]}:super.compareAndDeleteFolderConfiguration(e)}compare(e){const t=(r,a,c)=>{const l=[];return l.push(...a.filter(d=>r.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1?!1:Io(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Io(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),s=[],o=Tc([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&s.push([r,a])}return{keys:i,overrides:s}}}function gei(n){return n.hasOwnProperty("workspace")}function UX(n){return n.hasOwnProperty("folderUri")}function fei(n){return n.hasOwnProperty("fileUri")}function iat(n){return vre(n)||nat(n)}function vre(n){const e=n;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function nat(n){const e=n;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function zOe(n,e,t,i,s){if(n.scheme!==i.scheme)return{name:t,uri:n.toString(!0)};let o=e?void 0:s.relativePath(i,n);if(o!==void 0)o.length===0?o=".":Is&&(o=M7e(o));else if(n.scheme===_e.file)o=n.fsPath,Is&&(o=M7e(o));else if(s.isEqualAuthority(n.authority,i.authority))o=n.path;else return{name:t,uri:n.toString(!0)};return{name:t,path:o}}function M7e(n){return n=Ay(n),Wht(n)||(n=I9(n)),n}function hme(n,e,t){const i=[],s=new Set,o=t.dirname(e);for(const r of n){let a;if(vre(r))r.path&&(a=t.resolvePath(o,r.path));else if(nat(r))try{a=P.parse(r.uri),a.path[0]!==Qi.sep&&(a=a.with({path:Qi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!s.has(c)){s.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new Cde({uri:a,name:l,index:i.length},r))}}}return i}function N7e(n,e,t,i,s){const o=pei(e,n),r=s.dirname(e),a=s.dirname(i),c=[];for(const u of o.folders){const f=vre(u)?s.resolvePath(r,u.path):P.parse(u.uri);let p;t?p=!1:p=!vre(u)||oF(u.path),c.push(zOe(f,p,u.name,a,s))}const l={insertSpaces:!1,tabSize:4,eol:jr||ei?` +}`,OC="workbench.settings.applyToAllProfiles",nZt=Qe.as(YA.JSONContribution),gj=Qe.as(Nn.Configuration),s9e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(3603,"A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading."),type:"string"},order:{description:g(3604,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(3605,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(3606,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(3607,"Schema of the configuration property."),$ref:"http://json-schema.org/draft-07/schema#"},{type:"object",properties:{scope:{type:"string",enum:["application","machine","window","resource","language-overridable","machine-overridable"],default:"window",enumDescriptions:[g(3608,"Configuration that can be configured only in the user settings."),g(3609,"Configuration that can be configured only in the user settings or only in the remote settings."),g(3610,"Configuration that can be configured in the user, remote or workspace settings."),g(3611,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(3612,"Resource configuration that can be configured in language specific settings."),g(3613,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(3614,"Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`.")},enumDescriptions:{type:"array",items:{type:"string"},description:g(3615,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(3616,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(3617,"Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.","`enum`")},markdownDescription:{type:"string",description:g(3618,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(3619,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(3620,"If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.")},editPresentation:{type:"string",enum:["singlelineText","multilineText"],enumDescriptions:[g(3621,"The value will be shown in an inputbox."),g(3622,"The value will be shown in a textarea.")],default:"singlelineText",description:g(3623,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(3624,"When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.")},ignoreSync:{type:"boolean",description:g(3625,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let Hp;const Nst=eh.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:bKe}});Nst.setHandler((s,{added:e,removed:t})=>{Hp&&gj.deltaConfiguration(Hp);const i=Hp={};if(queueMicrotask(()=>{Hp===i&&(gj.deltaConfiguration(Hp),Hp=void 0)}),t.length){const n=t.map(o=>({overrides:xs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));Hp.removedDefaults=n}if(e.length){const n=gj.getConfigurationProperties(),o=[at.MACHINE_OVERRIDABLE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=xs(a.value);for(const l of Object.keys(c)){const d=n[l];if(d?.disallowConfigurationDefault){a.collector.warn(g(3626,"Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.",l)),delete c[l];continue}if(!tf.test(l)&&d?.scope&&!o.includes(d.scope)){a.collector.warn(g(3627,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l];continue}}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});Hp.addedDefaults=r}});const sZt=eh.registerExtensionPoint({extensionPoint:"configuration",deps:[Nst],jsonSchema:{description:g(3628,"Contributes configuration settings."),oneOf:[s9e,{type:"array",items:s9e}]}}),Vue=new va;sZt.setHandler((s,{added:e,removed:t})=>{if(Hp??={},t.length){const r=[];for(const a of t)r.push(...Vue.get(a.description.identifier)||[]),Vue.delete(a.description.identifier);Hp.removedConfigurations=r}const i=new Set;function n(r,a){const c=xs(r);return c.title&&typeof c.title!="string"&&a.collector.error(g(3629,"'configuration.title' must be a string")),o(c,a),c.id=r.id||a.description.identifier.value,c.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},c.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,c.title=c.title||a.description.displayName||a.description.identifier.value,c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(3630,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=SKe(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(3631,"Cannot register '{0}'. This property is already registered.",d));continue}if(!kn(h)){delete c[d],a.collector.error(g(3632,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope=h.scope?gut(h.scope.toString()):at.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(3633,"'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."));for(const d of l)o(d,a)}}if(e.length){const r=[];for(const a of e){const c=[],l=a.value;Array.isArray(l)?l.forEach(d=>c.push(n(d,a))):c.push(n(l,a)),Vue.set(a.description.identifier,c),r.push(...c)}Hp.addedConfigurations=r}gj.deltaConfiguration(Hp),Hp=void 0});nZt.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(3634,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(3635,"A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file.")},name:{type:"string",description:g(3636,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(3637,"URI of the folder")},name:{type:"string",description:g(3636,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(3638,"Workspace settings"),$ref:Tst},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(3639,"Workspace launch configurations"),$ref:XXt},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(3640,"Workspace task configurations"),$ref:ZXt},extensions:{type:"object",default:{},description:g(3641,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(3642,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(3643,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(3644,"Unknown workspace configuration property")});class oZt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration?Array.isArray(e.contributes.configuration)?e.contributes.configuration:[e.contributes.configuration]:[],i=AKe(t),n=i?Object.keys(i):[],o=[g(3645,"ID"),g(3646,"Description"),g(3647,"Default")],r=n.sort((a,c)=>a.localeCompare(c)).map(a=>[new Mt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Mt(i[a].markdownDescription,!1):i[a].description??"",new Mt().appendCodeblock("json",JSON.stringify(Ya(i[a].default)?CKe(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(3648,"Settings"),access:{canToggle:!1},renderer:new wi(oZt)});let jDe=class extends V{constructor(e,t,i,n,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=n,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==qi.FOLDER||Ftt(this.contextService.getWorkspace()))return;const t=(await this.fileService.resolve(e.uri)).children?.map(i=>i.name);if(Array.isArray(t)){const i=t.filter(mae);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:xme.WORKSPACE,isSecondary:!0};if(t.length===1){const n=t[0];this.notificationService.prompt(Xe.Info,g(3649,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",n,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(3650,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:Pt(e,n)}])}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:K2.SILENT})}else t.length>1&&this.notificationService.prompt(Xe.Info,g(3651,"This folder contains multiple workspace files. Do you want to open one? [Learn more]({0}) about workspace files.","https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(3652,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(n=>({label:n})),{placeHolder:g(3653,"Select a workspace to open")}).then(n=>{n&&this.hostService.openWindow([{workspaceUri:Pt(e,n.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:K2.SILENT})}};jDe=D([_(0,yi),_(1,bi),_(2,Jt),_(3,In),_(4,xc),_(5,$i)],jDe);Qe.as(cf.Workbench).registerWorkbenchContribution(jDe,Rs.Eventually);At(class extends li{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Pe(3650,"Open Workspace"),f1:!1,menu:{id:_e.EditorContent,when:he.and(M3.Extension.isEqualTo(mje),cJe.isEqualTo(ztt),aJe.toNegated())}})}async run(s,e){const t=s.get(xc),i=s.get(yi),n=s.get(bi);if(i.getWorkbenchState()===qi.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&ji(o,e)){n.info(g(3654,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class Gie extends DA{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new DA(e,t),this._launchModel=as.createEmptyModel(t),this._tasksModel=as.createEmptyModel(t)}get folders(){return this._folders}get transient(){return this._transient}get settingsModel(){return this._settingsModelParser.configurationModel}get launchModel(){return this._launchModel}get tasksModel(){return this._tasksModel}reparseWorkspaceSettings(e){this._settingsModelParser.reparse(e)}getRestrictedWorkspaceSettings(){return this._settingsModelParser.restrictedConfigurations}doParseRaw(e,t){return this._folders=e.folders||[],this._transient=s8(e.transient)&&e.transient,this._settingsModelParser.parseRaw(e.settings,t),this._launchModel=this.createConfigurationModelFrom(e,"launch"),this._tasksModel=this.createConfigurationModelFrom(e,"tasks"),super.doParseRaw(e,t)}createConfigurationModelFrom(e,t){const i=e[t];if(i){const n=R8(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=n;const r=Object.keys(i).map(a=>`${t}.${a}`);return new as(o,r,[],void 0,this.logService)}return as.createEmptyModel(this.logService)}}class Pst extends DA{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=R8(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),n=Object.create(null);n[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:n,keys:o,overrides:[]}}}class o9e extends u3{constructor(e,t,i,n,o,r,a,c,l,d,h){super(e,t,i,n,o,r,a,c,l,h),this._workspace=d}getValue(e,t={}){return super.getValue(e,t,this._workspace)}inspect(e,t={}){return super.inspect(e,t,this._workspace)}keys(){return super.keys(this._workspace)}compareAndDeleteFolderConfiguration(e){return this._workspace&&this._workspace.folders.length>0&&this._workspace.folders[0].uri.toString()===e.toString()?{keys:[],overrides:[]}:super.compareAndDeleteFolderConfiguration(e)}compare(e){const t=(r,a,c)=>{const l=[];return l.push(...a.filter(d=>r.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1?!1:Ys(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Ys(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),n=[],o=ja([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&n.push([r,a])}return{keys:i,overrides:n}}}function rZt(s){return s.hasOwnProperty("workspace")}function fj(s){return s.hasOwnProperty("folderUri")}function aZt(s){return s.hasOwnProperty("fileUri")}function Fst(s){return Kie(s)||Ost(s)}function Kie(s){const e=s;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function Ost(s){const e=s;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function xPe(s,e,t,i,n){if(s.scheme!==i.scheme)return{name:t,uri:s.toString(!0)};let o=e?void 0:n.relativePath(i,s);if(o!==void 0)o.length===0?o=".":Qn&&(o=r9e(o));else if(s.scheme===pe.file)o=s.fsPath,Qn&&(o=r9e(o));else if(n.isEqualAuthority(s.authority,i.authority))o=s.path;else return{name:t,uri:s.toString(!0)};return{name:t,path:o}}function r9e(s){return s=Kw(s),vlt(s)||(s=S8(s)),s}function zue(s,e,t){const i=[],n=new Set,o=t.dirname(e);for(const r of s){let a;if(Kie(r))r.path&&(a=t.resolvePath(o,r.path));else if(Ost(r))try{a=N.parse(r.uri),a.path[0]!==Vi.sep&&(a=a.with({path:Vi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!n.has(c)){n.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new pae({uri:a,name:l,index:i.length},r))}}}return i}function a9e(s,e,t,i,n){const o=cZt(e,s),r=n.dirname(e),a=n.dirname(i),c=[];for(const u of o.folders){const f=Kie(u)?n.resolvePath(r,u.path):N.parse(u.uri);let p;t?p=!1:p=!Kie(u)||pM(u.path),c.push(xPe(f,p,u.name,a,n))}const l={insertSpaces:!1,tabSize:4,eol:pr||Qt?` `:`\r -`},d=due(n,["folders"],c,l);let h=d7e(n,d);return _Z(o.remoteAuthority,uZe(i))&&(h=d7e(h,fJt(h,["remoteAuthority"],l))),h}function pei(n,e){const t=ow(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>iat(i));else throw new Error(`${n} looks like an invalid workspace file.`);return t}function mei(n){return n.workspace&&typeof n.workspace=="object"&&typeof n.workspace.id=="string"&&typeof n.workspace.configPath=="string"}function _ei(n){return typeof n.folderUri=="string"}function vei(n){return typeof n.fileUri=="string"}function wei(n,e){const t={workspaces:[],files:[]};if(n){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;mei(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:P.parse(o.workspace.configPath)}}):_ei(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:P.parse(o.folderUri)}):vei(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:P.parse(o.fileUri)})})}return t}function bei(n){const e={entries:[]};for(const t of n.workspaces)UX(t)?e.entries.push({folderUri:t.folderUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority}):e.entries.push({workspace:{id:t.workspace.id,configPath:t.workspace.configPath.toString()},label:t.label,remoteAuthority:t.remoteAuthority});for(const t of n.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const sat=Re,zs="vs/workbench/services/configuration/common/configurationEditing";var Tr;(function(n){n[n.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",n[n.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",n[n.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",n[n.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",n[n.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",n[n.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",n[n.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",n[n.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",n[n.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",n[n.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",n[n.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",n[n.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(Tr||(Tr={}));class P7e extends uc{constructor(e,t){super(e),this.code=t}}var Mn;(function(n){n[n.USER_LOCAL=1]="USER_LOCAL",n[n.USER_REMOTE=2]="USER_REMOTE",n[n.WORKSPACE=3]="WORKSPACE",n[n.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(Mn||(Mn={}));let uLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new dO}async writeConfiguration(e,t,i={}){const s=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(s,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,s,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,s=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(s.object.textEditorModel);await this.updateConfiguration(e,s.object.textEditorModel,o,t)}finally{s.dispose()}}async updateConfiguration(e,t,i,s){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&s.handleDirtyFile)switch(s.handleDirtyFile){case"save":await this.save(t,e);break;case"revert":await this.textFileService.revert(t.uri);break}const o=this.getEdits(e,t.getValue(),i)[0];o&&this.applyEditsToBuffer(o,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===Zi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new P7e(g(zs,0,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),Tr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),s=t.getPositionAt(e.offset+e.length),o=new O(i.lineNumber,i.column,s.lineNumber,s.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?ds.replace(o,e.content):ds.insert(i,e.content);return t.pushEditOperations([new mt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,s){return t.length?due(i,t,e,s):[{content:JSON.stringify(e,null,s.insertSpaces&&s.tabSize?" ".repeat(s.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),s=e.getEOL();return{insertSpaces:t,tabSize:i,eol:s}}async onError(e,t,i){switch(e.code){case Tr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case Tr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:return this.doWriteConfiguration(t,{scopes:i,handleDirtyFile:"revert"});default:this.notificationService.error(e.message)}}onInvalidConfigurationError(e,t){const i=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;i?this.notificationService.prompt(nt.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const s=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;s?this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>{const o=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:o,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:s,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case Mn.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case Mn.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case Mn.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case Mn.WORKSPACE_FOLDER:if(e.resource){const i=this.contextService.getWorkspaceFolder(e.resource);i&&this.preferencesService.openFolderSettings({folderUri:i.uri,jsonEditor:!0})}break}}openFile(e){this.editorService.openEditor({resource:e,options:{pinned:!0}})}toConfigurationEditingError(e,t,i){const s=this.toErrorMessage(e,t,i);return new P7e(s,e)}toErrorMessage(e,t,i){switch(e){case Tr.ERROR_POLICY_CONFIGURATION:return g(zs,5,"Unable to write {0} because it is configured in system policy.",i.key);case Tr.ERROR_UNKNOWN_KEY:return g(zs,6,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(zs,7,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(zs,8,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(zs,9,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case Tr.ERROR_INVALID_USER_TARGET:return g(zs,10,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case Tr.ERROR_INVALID_WORKSPACE_TARGET:return g(zs,11,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case Tr.ERROR_INVALID_FOLDER_TARGET:return g(zs,12,"Unable to write to Folder Settings because no resource is provided.");case Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(zs,13,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case Tr.ERROR_NO_WORKSPACE_OPENED:return g(zs,14,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case Tr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,15,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,16,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case Mn.USER_LOCAL:return g(zs,17,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case Mn.USER_REMOTE:return g(zs,18,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case Mn.WORKSPACE:return g(zs,19,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,20,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,21,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,22,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case Mn.USER_LOCAL:return g(zs,23,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case Mn.USER_REMOTE:return g(zs,24,"Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again.");case Mn.WORKSPACE:return g(zs,25,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,26,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,27,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,28,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case Mn.USER_LOCAL:return g(zs,29,"Unable to write into user settings because the content of the file is newer.");case Mn.USER_REMOTE:return g(zs,30,"Unable to write into remote user settings because the content of the file is newer.");case Mn.WORKSPACE:return g(zs,31,"Unable to write into workspace settings because the content of the file is newer.");case Mn.WORKSPACE_FOLDER:return g(zs,32,"Unable to write into folder settings because the content of the file is newer.")}case Tr.ERROR_INTERNAL:return g(zs,33,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case Mn.USER_LOCAL:return g(zs,34,"User Settings");case Mn.USER_REMOTE:return g(zs,35,"Remote User Settings");case Mn.WORKSPACE:return g(zs,36,"Workspace Settings");case Mn.WORKSPACE_FOLDER:return g(zs,37,"Folder Settings");default:return""}}defaultResourceValue(e){const t=this.uriIdentityService.extUri.basename(e);switch(t.substr(0,t.length-this.uriIdentityService.extUri.extname(e).length)){case $p:return lei;default:return"{}"}}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,this.defaultResourceValue(e),{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e,t){if(t.workspaceStandAloneConfigurationKey&&!t.key)return!1;const i=[];return ow(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,s){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_POLICY_CONFIGURATION,e,t);const r=it.as(Cs.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!dp.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==$p&&(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_USER_TARGET,e,t);if((e===Mn.WORKSPACE||e===Mn.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===Nn.EMPTY)throw this.toConfigurationEditingError(Tr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===Mn.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)){if(r===ut.APPLICATION)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===ut.MACHINE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===Mn.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)&&r!==void 0&&!Xrt.includes(r))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(s.overrideIdentifiers?.length&&r!==ut.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===Mn.USER_LOCAL?Zrt:VOe,d=Object.keys(l);for(const h of d){const u=this.getConfigurationFileResource(e,h,l[h],i.resource,void 0);if(t.key===h){const p=this.isWorkspaceConfigurationResource(u)?[h]:[];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}const f=`${h}.`;if(t.key.indexOf(f)===0){const p=this.isWorkspaceConfigurationResource(u)?[h,t.key.substr(f.length)]:[t.key.substr(f.length)];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}}}const s=t.key,r=it.as(Cs.Configuration).getConfigurationProperties()[s]?.scope;let a=i.overrideIdentifiers?.length?[Vje(i.overrideIdentifiers),s]:[s];if(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE)return{key:s,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,s,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,s,ZZt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:s,jsonPath:a,value:t.value,resource:c??void 0,target:e}}isWorkspaceConfigurationResource(e){const t=this.contextService.getWorkspace();return!!(t.configuration&&e&&t.configuration.fsPath===e.fsPath)}getConfigurationFileResource(e,t,i,s,o){if(e===Mn.USER_LOCAL)return t===$p?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===Mn.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==Nn.EMPTY){const a=this.contextService.getWorkspace();if(e===Mn.WORKSPACE){if(r===Nn.WORKSPACE)return a.configuration??null;if(r===Nn.FOLDER)return a.folders[0].toResource(i)}if(e===Mn.WORKSPACE_FOLDER&&s){const c=this.contextService.getWorkspaceFolder(s);if(c)return c.toResource(i)}}return null}};uLe=D([_(1,sat),_(2,Ti),_(3,Rm),_(4,V_),_(5,ci),_(6,Rn),_(7,tr),_(8,Pi),_(9,TQ),_(10,_i),_(11,_o)],uLe);const _W=class _W extends KXe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=it.as(Cs.Configuration),this.cachedConfigurationDefaultsOverrides={},this.cacheKey={type:"defaults",key:"configurationDefaultsOverrides"},this.updateCache=!1,t.options?.configurationDefaults&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t.options.configurationDefaults}])}getConfigurationDefaultOverrides(){return this.cachedConfigurationDefaultsOverrides}async initialize(){return await this.initializeCachedConfigurationDefaultsOverrides(),super.initialize()}reload(){return this.updateCache=!0,this.cachedConfigurationDefaultsOverrides={},this.updateCachedConfigurationDefaultsOverrides(),super.reload()}hasCachedConfigurationDefaultsOverrides(){return!n1(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=fo(this.cachedConfigurationDefaultsOverrides)?this.cachedConfigurationDefaultsOverrides:{}})()),this.initiaizeCachedConfigurationDefaultsOverridesPromise}onDidUpdateConfiguration(e,t){super.onDidUpdateConfiguration(e,t),t&&this.updateCachedConfigurationDefaultsOverrides()}async updateCachedConfigurationDefaultsOverrides(){if(!this.updateCache)return;const e={},t=this.configurationRegistry.getConfigurationDefaultsOverrides();for(const[i,s]of t)!dp.test(i)&&s.value!==void 0&&(e[i]=s.value);try{Object.keys(e).length?(localStorage.setItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let gLe=_W;class Cei extends yJe{constructor(e,t,i,s){super(e.defaultProfile.settingsResource,{scopes:[ut.APPLICATION]},i.extUri,t,s),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(RA),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class yei extends ${get hasTasksLoaded(){return this.userConfiguration.value instanceof wre}constructor(e,t,i,s,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=s,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new Dn),this.userConfigurationChangeDisposable=this._register(new Dn),this.userConfiguration.value=new yJe(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new yn(()=>this.userConfiguration.value.loadConfiguration().then(a=>this._onDidChangeConfiguration.fire(a)),50))}async reset(e,t,i){return this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.doReset()}async doReset(e){const t=this.uriIdentityService.extUri.dirname(this.settingsResource),i=this.tasksResource?[[$p,this.tasksResource]]:[],s=new wre(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await s.loadConfiguration(e);return this.userConfiguration.value=s,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),o}async initialize(){return this.userConfiguration.value.loadConfiguration()}async reload(e){return this.hasTasksLoaded?this.userConfiguration.value.loadConfiguration():this.doReset(e)}reparse(e){return this.configurationParseOptions={...this.configurationParseOptions,...e},this.userConfiguration.value.reparse(this.configurationParseOptions)}getRestrictedSettings(){return this.userConfiguration.value.getRestrictedSettings()}}class wre extends ${constructor(e,t,i,s,o,r,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=o,this.uriIdentityService=r,this.logService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.allResources=[this.settingsResource,...this.standAloneConfigurationResources.map(([,c])=>c)],this._register(pa(...this.allResources.map(c=>pa(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new Px(e,a),this._folderSettingsParseOptions=s,this._standAloneConfigurations=[],this._cache=_s.createEmptyModel(this.logService),this._register(T.debounce(T.any(T.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),T.filter(this.fileService.onDidRunOperation,c=>this.handleFileOperationEvent(c))),()=>{},100)(()=>this._onDidChange.fire()))}async resolveContents(e){const t=async o=>Promise.all(o.map(async r=>{try{return(await this.fileService.readFile(r,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${r.toString()}': ${lg(a)}`),a.fileOperationResult!==Zi.FILE_NOT_FOUND&&a.fileOperationResult!==Zi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],s]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,s.map((o,r)=>[this.standAloneConfigurationResources[r][0],o])]}async loadConfiguration(e){const[t,i]=await this.resolveContents(!!e);this._standAloneConfigurations=[],this._folderSettingsModelParser.parse("",this._folderSettingsParseOptions),t!==void 0&&this._folderSettingsModelParser.parse(t,this._folderSettingsParseOptions);for(let s=0;se.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),Ko.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Li.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class Sei extends ${constructor(e,t,i,s,o,r){super(),this._userConfigurationInitializationPromise=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidInitialize=this._register(new I),this.onDidInitialize=this._onDidInitialize.event,this._fileService=i,this._userConfiguration=this._cachedConfiguration=new Aei(e,t,{scopes:lme},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new ume(a.settingsPath,{scopes:lme},this._fileService,s,r));this._register(c.onDidChangeConfiguration(d=>this.onDidUserConfigurationChange(d))),this._userConfigurationInitializationPromise=c.initialize();const l=await this._userConfigurationInitializationPromise;this._userConfiguration.dispose(),this._userConfiguration=c,this.onDidUserConfigurationChange(l),this._onDidInitialize.fire(l)}})}async initialize(){if(this._userConfiguration instanceof ume)return this._userConfiguration.initialize();let e=await this._userConfiguration.initialize();return this._userConfigurationInitializationPromise&&(e=await this._userConfigurationInitializationPromise,this._userConfigurationInitializationPromise=null),e}reload(){return this._userConfiguration.reload()}reparse(){return this._userConfiguration.reparse({scopes:lme})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof ume){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Zi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class ume extends ${constructor(e,t,i,s,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=s,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new Dn),this.directoryWatcherDisposable=this._register(new Dn),this.parser=new Px(this.configurationResource.toString(),o),this.parseOptions=t,this._register(i.onDidFilesChange(r=>this.handleFileChangesEvent(r))),this._register(i.onDidRunOperation(r=>this.handleFileOperationEvent(r))),this.reloadConfigurationScheduler=this._register(new yn(()=>this.reload().then(r=>this._onDidChangeConfiguration.fire(r)),50)),this._register(Ee(()=>{this.stopWatchingResource(),this.stopWatchingDirectory()}))}watchResource(){this.fileWatcherDisposable.value=this.fileService.watch(this.configurationResource)}stopWatchingResource(){this.fileWatcherDisposable.value=void 0}watchDirectory(){const e=this.uriIdentityService.extUri.dirname(this.configurationResource);this.directoryWatcherDisposable.value=this.fileService.watch(e)}stopWatchingDirectory(){this.directoryWatcherDisposable.value=void 0}async initialize(){const e=await this.fileService.exists(this.configurationResource);return this.onResourceExists(e),this.reload()}async resolveContent(){return(await this.fileService.readFile(this.configurationResource,{atomic:!0})).value.toString()}async reload(){try{const e=await this.resolveContent();return this.parser.parse(e,this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}handleFileChangesEvent(e){let t=e.contains(this.configurationResource,Ko.UPDATED);e.contains(this.configurationResource,Ko.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,Ko.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class Aei extends ${constructor(e,t,i,s){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new Px("CachedRemoteUserConfiguration",s),this.parseOptions=i,this.configurationModel=_s.createEmptyModel(s)}getConfigurationModel(){return this.configurationModel}initialize(){return this.reload()}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.configurationModel=this.parser.configurationModel,this.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}async reload(){try{const e=await this.configurationCache.read(this.key),t=JSON.parse(e);t.content&&(this.parser.parse(t.content,this.parseOptions),this.configurationModel=this.parser.configurationModel)}catch{}return this.configurationModel}async updateConfiguration(e){return e?this.configurationCache.write(this.key,JSON.stringify({content:e})):this.configurationCache.remove(this.key)}}class Eei extends ${get initialized(){return this._initialized}constructor(e,t,i,s){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=s,this._workspaceConfigurationDisposables=this._register(new Z),this._workspaceIdentifier=null,this._isWorkspaceTrusted=!1,this._onDidUpdateConfiguration=this._register(new I),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this._initialized=!1,this.fileService=t,this._workspaceConfiguration=this._cachedConfiguration=new xei(e,s)}async initialize(e,t){this._workspaceIdentifier=e,this._isWorkspaceTrusted=t,this._initialized||(this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)?(this._workspaceConfiguration=this._cachedConfiguration,this.waitAndInitialize(this._workspaceIdentifier)):this.doInitialize(new _Y(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:WX,skipRestricted:this.isUntrusted()})}getFolders(){return this._workspaceConfiguration.getFolders()}setFolders(e,t){return this._workspaceIdentifier?t.write(this._workspaceIdentifier.configPath,[{path:["folders"],value:e}],!0).then(()=>this.reload()):Promise.resolve()}isTransient(){return this._workspaceConfiguration.isTransient()}getConfiguration(){return this._workspaceConfiguration.getWorkspaceSettings()}updateWorkspaceTrust(e){return this._isWorkspaceTrusted=e,this.reparseWorkspaceSettings()}reparseWorkspaceSettings(){return this._workspaceConfiguration.reparseWorkspaceSettings({scopes:WX,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await CJe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof _Y)){const t=this._register(new _Y(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:WX,skipRestricted:this.isUntrusted()}),this.doInitialize(t),this.onDidWorkspaceConfigurationChange(!1,!0)}}doInitialize(e){this._workspaceConfigurationDisposables.clear(),this._workspaceConfiguration=this._workspaceConfigurationDisposables.add(e),this._workspaceConfigurationDisposables.add(this._workspaceConfiguration.onDidChange(t=>this.onDidWorkspaceConfigurationChange(!0,!1))),this._initialized=!0}isUntrusted(){return!this._isWorkspaceTrusted}async onDidWorkspaceConfigurationChange(e,t){e&&await this.reload(),this.updateCache(),this._onDidUpdateConfiguration.fire(t)}async updateCache(){if(this._workspaceIdentifier&&this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)&&this._workspaceConfiguration instanceof _Y){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class _Y extends ${constructor(e,t,i){super(),this.fileService=e,this.logService=i,this._workspaceIdentifier=null,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.workspaceConfigurationModelParser=new _re("",i),this.workspaceSettings=_s.createEmptyModel(i),this._register(T.any(T.filter(this.fileService.onDidFilesChange,s=>!!this._workspaceIdentifier&&s.contains(this._workspaceIdentifier.configPath)),T.filter(this.fileService.onDidRunOperation,s=>!!this._workspaceIdentifier&&(s.isOperation(Li.CREATE)||s.isOperation(Li.COPY)||s.isOperation(Li.DELETE)||s.isOperation(Li.WRITE))&&t.extUri.isEqual(s.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this._onDidChange.fire(),50)),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile())}get workspaceIdentifier(){return this._workspaceIdentifier}async resolveContent(e){return(await this.fileService.readFile(e.configPath,{atomic:!0})).value.toString()}async load(e,t){(!this._workspaceIdentifier||this._workspaceIdentifier.id!==e.id)&&(this._workspaceIdentifier=e,this.workspaceConfigurationModelParser=new _re(this._workspaceIdentifier.id,this.logService),St(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(s){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(s)}this.workspaceConfigurationModelParser.parse(i,t),this.consolidate()}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}watchWorkspaceConfigurationFile(){return this._workspaceIdentifier?this.fileService.watch(this._workspaceIdentifier.configPath):$.None}}class xei{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=T.None,this.workspaceConfigurationModelParser=new _re("",t),this.workspaceSettings=_s.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),s=await this.configurationCache.read(i),o=JSON.parse(s);o.content&&(this.workspaceConfigurationModelParser=new _re(i.key,this.logService),this.workspaceConfigurationModelParser.parse(o.content,t),this.consolidate())}catch{}}get workspaceIdentifier(){return null}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}async updateWorkspace(e,t){try{const i=this.getKey(e);t?await this.configurationCache.write(i,JSON.stringify({content:t})):await this.configurationCache.remove(i)}catch{}}getKey(e){return{type:"workspaces",key:e.id}}}class Dei{constructor(e,t,i,s,o){this.configurationCache=s,this.logService=o,this.onDidChange=T.None,this.key={type:"folder",key:Ed(Qt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new Px("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=_s.createEmptyModel(o)}async loadConfiguration(){try{const e=await this.configurationCache.read(this.key),{content:t}=JSON.parse(e.toString());if(t)for(const i of Object.keys(t))if(i===mre)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const s=new tat(i,i,this.logService);s.parse(t[i]),this._standAloneConfigurations.push(s.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[mre]=e),t.forEach(([s,o])=>{o&&(i[s]=o)}),Object.keys(i).length?await this.configurationCache.write(this.key,JSON.stringify({content:i})):await this.configurationCache.remove(this.key)}getRestrictedSettings(){return this._folderSettingsModelParser.restrictedConfigurations}reparse(e){return this._folderSettingsParseOptions=e,this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions),this.consolidate(),this.configurationModel}consolidate(){this.configurationModel=this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations)}getUnsupportedKeys(){return[]}}class kei extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=s,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=Nn.WORKSPACE===this.workbenchState?Xrt:WX,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new Dei(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,CJe(t.uri,r).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())))}loadConfiguration(){return this.folderConfiguration.loadConfiguration()}updateWorkspaceTrust(e){return this.workspaceTrusted=e,this.reparse()}reparse(){const e=this.folderConfiguration.reparse({scopes:this.scopes,skipRestricted:this.isUntrusted()});return this.updateCache(),e}getRestrictedSettings(){return this.folderConfiguration.getRestrictedSettings()}isUntrusted(){return!this.workspaceTrusted}onDidFolderConfigurationChange(){this.updateCache(),this._onDidChange.fire()}createFileServiceBasedConfiguration(e,t,i){const s=t.extUri.joinPath(this.configurationFolder,`${mre}.json`),o=[$p,kk].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new wre(this.configurationFolder.toString(),s,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof wre){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}const $Oe="vs/workbench/services/configuration/browser/configurationService";function F7e(n,e){return n.isDefault||n.useDefaultFlags?.settings?e?cei:void 0:e?Jrt:aei}class gme extends kJe{constructor(){super(...arguments),this.initialized=!1}}class Iei extends ${get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,s,o,r,a,c,l,d){if(super(),this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.remoteAgentService=a,this.uriIdentityService=c,this.logService=l,this.initialized=!1,this.applicationConfiguration=null,this.remoteUserConfiguration=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeWorkspaceFolders=this._register(new I),this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=this._register(new I),this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkspaceName=this._register(new I),this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onDidChangeWorkbenchState=this._register(new I),this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event,this.isWorkspaceTrusted=!0,this._restrictedSettings={default:[]},this._onDidChangeRestrictedSettings=this._register(new I),this.onDidChangeRestrictedSettings=this._onDidChangeRestrictedSettings.event,this.configurationRegistry=it.as(Cs.Configuration),this.initRemoteUserConfigurationBarrier=new Uh,this.completeWorkspaceBarrier=new Uh,this.defaultConfiguration=this._register(new gLe(t,i,l)),this.policyConfiguration=d instanceof TZe?new G0t:this._register(new dCe(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),new wi,_s.createEmptyModel(l),new wi,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new yei(s.currentProfile.settingsResource,s.currentProfile.tasksResource,{scopes:F7e(s.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new wi,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new Sei(e,t,r,c,a,l));this._register(h.onDidInitialize(u=>{this._register(h.onDidChangeConfiguration(f=>this.onRemoteUserConfigurationChanged(f))),this.onRemoteUserConfigurationChanged(u),this.initRemoteUserConfigurationBarrier.open()}))}else this.initRemoteUserConfigurationBarrier.open();this.workspaceConfiguration=this._register(new Eei(t,r,c,l)),this._register(this.workspaceConfiguration.onDidUpdateConfiguration(h=>{this.onWorkspaceConfigurationChanged(h).then(()=>{this.workspace.initialized=this.workspaceConfiguration.initialized,this.checkAndMarkWorkspaceComplete(h)})})),this._register(this.defaultConfiguration.onDidChangeConfiguration(({properties:h,defaults:u})=>this.onDefaultConfigurationChanged(u,h))),this._register(this.policyConfiguration.onDidChangeConfiguration(h=>this.onPolicyConfigurationChanged(h))),this._register(s.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new dO}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new Cei(this.userDataProfilesService,this.fileService,this.uriIdentityService,this.logService))),this.applicationConfigurationDisposables.add(this.applicationConfiguration.onDidChangeConfiguration(e=>this.onApplicationConfigurationChanged(e))))}async getCompleteWorkspace(){return await this.completeWorkspaceBarrier.wait(),this.getWorkspace()}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace.configuration?Nn.WORKSPACE:this.workspace.folders.length===1?Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return this.workspace.getFolder(e)}addFolders(e,t){return this.updateFolders(e,[],t)}removeFolders(e){return this.updateFolders([],e)}async updateFolders(e,t,i){return this.workspaceEditingQueue.queue(()=>this.doUpdateFolders(e,t,i))}isInsideWorkspace(e){return!!this.getWorkspaceFolder(e)}isCurrentWorkspace(e){switch(this.getWorkbenchState()){case Nn.FOLDER:{let t;return P.isUri(e)?t=e:BS(e)&&(t=e.uri),P.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case Nn.WORKSPACE:return hF(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==Nn.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let s=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>iat(a)?!this.contains(t,o[c].uri):!0);if(s=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=hme(r,a,this.uriIdentityService.extUri);const l=o.map(h=>h.uri),d=[];for(const h of e){const u=h.uri;if(!this.contains(l,u)){try{if(!(await this.fileService.stat(u)).isDirectory)continue}catch{}d.push(zOe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(s=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(dL))),this.onWorkspaceConfigurationChanged(!1)}contains(e,t){return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t))}getConfigurationData(){return this._configuration.toData()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=$ge(e)?e:$ge(t)?t:void 0;return this._configuration.getValue(i,s)}async updateValue(e,t,i,s,o){const r=yft(i)?i:$ge(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?s:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=Tc(r.overrideIdentifiers),r.overrideIdentifiers=r.overrideIdentifiers.length?r.overrideIdentifiers:void 0),!c.length){if(r?.overrideIdentifiers&&r.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:r?.resource,overrideIdentifier:r?.overrideIdentifiers?r.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Io(t,l.defaultValue)&&c.length===1&&(c[0]===Ot.USER||c[0]===Ot.USER_LOCAL)&&(t=void 0)}await ko.settled(c.map(l=>this.writeConfigurationValue(e,t,l,r,o)))}async reloadConfiguration(e){if(e===void 0){this.reloadDefaultConfiguration();const t=await this.reloadApplicationConfiguration(!0),{local:i,remote:s}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,s,!0);return}if(sxt(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case Ot.DEFAULT:this.reloadDefaultConfiguration();return;case Ot.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case Ot.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case Ot.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case Ot.WORKSPACE:case Ot.WORKSPACE_FOLDER:await this.reloadWorkspaceConfiguration();return}}hasCachedConfigurationDefaultsOverrides(){return this.defaultConfiguration.hasCachedConfigurationDefaultsOverrides()}inspect(e,t){return this._configuration.inspect(e,t)}keys(){return this._configuration.keys()}async whenRemoteConfigurationLoaded(){await this.initRemoteUserConfigurationBarrier.wait()}async initialize(e){vs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),vs("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);let a;r&&(a=r.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(o.uri,a)),i.push(a)}this.getWorkbenchState()===Nn.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let s=[];this.restrictedSettings.userLocal&&s.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&s.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&s.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>s.push(...o)),s=Tc(s),s.length&&this.triggerConfigurationChange({keys:s,overrides:[]},{data:t,workspace:this.workspace},Ot.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===ut.APPLICATION)return!0;const t=this.getValue(RA)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return hF(e)?this.createMultiFolderWorkspace(e):BS(e)?this.createSingleFolderWorkspace(e):this.createEmptyWorkspace(e)}async createMultiFolderWorkspace(e){await this.workspaceConfiguration.initialize({id:e.id,configPath:e.configPath},this.isWorkspaceTrusted);const t=e.configPath,i=hme(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),s=e.id,o=new gme(s,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new gme(e.id,[wee(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new gme(e.id,[],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,Promise.resolve(t)}checkAndMarkWorkspaceComplete(e){!this.completeWorkspaceBarrier.isOpen()&&this.workspace.initialized&&(this.completeWorkspaceBarrier.open(),this.validateWorkspaceFoldersAndReload(e))}async updateWorkspaceAndInitializeConfiguration(e,t){const i=!!this.workspace;let s,o,r=[];if(i?(s=this.getWorkbenchState(),o=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,r=this.workspace.folders,this.workspace.update(e)):this.workspace=e,await this.initializeConfiguration(t),i){const a=this.getWorkbenchState();s&&a!==s&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==s)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(r,this.workspace.folders);l&&(l.added.length||l.removed.length||l.changed.length)&&(await this.handleWillChangeWorkspaceFolders(l,!1),this._onDidChangeWorkspaceFolders.fire(l))}this.localUserConfiguration.hasTasksLoaded||this._register(UB(yi,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(s=>!e.some(o=>s.uri.toString()===o.uri.toString()));for(let s=0;s{vs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(_s.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(RA)})}return vs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,s()]);vs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),vs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return _s.createEmptyModel(this.logService);const t=await this.applicationConfiguration.loadConfiguration();return e||this.onApplicationConfigurationChanged(t),t}async reloadUserConfiguration(){const[e,t]=await Promise.all([this.reloadLocalUserConfiguration(!0),this.reloadRemoteUserConfiguration(!0)]);return{local:e,remote:t}}async reloadLocalUserConfiguration(e,t){const i=await this.localUserConfiguration.reload(t);return e||this.onLocalUserConfigurationChanged(i),i}async reloadRemoteUserConfiguration(e){if(this.remoteUserConfiguration){const t=await this.remoteUserConfiguration.reload();return e||this.onRemoteUserConfigurationChanged(t),t}return _s.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===Nn.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===Nn.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,s){this.cachedFolderConfigs=new wi;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new wi;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,_s.createEmptyModel(this.logService),new wi,this.workspace,this.logService),this.initialized=!0,s){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},Ot.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case Nn.FOLDER:return e[0];case Nn.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return _s.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:F7e(e.profile,!!this.remoteUserConfiguration)})),(e.previous.isDefault!==e.profile.isDefault||!!e.previous.useDefaultFlags?.settings!=!!e.profile.useDefaultFlags?.settings)&&(this.createApplicationConfiguration(),this.applicationConfiguration&&t.push(this.reloadApplicationConfiguration(!0)));let[i,s]=await Promise.all(t);s=s??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:s.getValue(RA)})),await this.loadConfiguration(s,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),s=this._configuration.compareAndUpdateDefaultConfiguration(e,t);if(this.applicationConfiguration&&this._configuration.updateApplicationConfiguration(this.applicationConfiguration.reparse()),this.remoteUserConfiguration&&(this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse()),this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse())),this.getWorkbenchState()===Nn.FOLDER){const o=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);o&&(this._configuration.updateWorkspaceConfiguration(o.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,o.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);r&&this._configuration.updateFolderConfiguration(o.uri,r.reparse())}}this.triggerConfigurationChange(s,{data:i,workspace:this.workspace},Ot.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,Ot.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(RA)??[],s=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(RA)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of s.keys)if(r[c]?.scope===ut.APPLICATION){if(a.push(c),c===RA){for(const l of i)o.includes(l)||a.push(l);for(const l of o)i.includes(l)||a.push(l)}}else o.includes(c)&&a.push(c);s.keys=a,s.keys.includes(RA)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(s,t,Ot.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=hme(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:s,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||s.length||o.length?t=await this.toValidWorkspaceFolders(t):t=this.workspace.folders}await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}}updateRestrictedSettings(){const e=[],t=this.configurationRegistry.getConfigurationProperties(),i=Object.keys(t).filter(p=>t[p].restricted).sort((p,m)=>p.localeCompare(m)),s=UL(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...s.added,...s.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=UL(o,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...r.added,...r.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=UL(a,this._restrictedSettings.userLocal||[],(p,m)=>p.localeCompare(m));e.push(...c.added,...c.removed);const l=(this.remoteUserConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),d=UL(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new wi;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((C,y)=>C.localeCompare(y));v.length&&h.set(p.uri,v);const w=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],b=UL(v,w,(C,y)=>C.localeCompare(y));e.push(...b.added,...b.removed)}const u=this.getWorkbenchState()===Nn.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=UL(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:o.length?o:void 0,userLocal:a.length?a:void 0,userRemote:l.length?l:void 0,workspace:u.length?u:void 0,workspaceFolder:h.size?h:void 0},this._onDidChangeRestrictedSettings.fire(this.restrictedSettings))}async updateWorkspaceConfiguration(e,t,i){const s={data:this._configuration.toData(),workspace:this.workspace},o=this._configuration.compareAndUpdateWorkspaceConfiguration(t),r=this.compareFolders(this.workspace.folders,e);if(r.added.length||r.removed.length||r.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(r,i),this.triggerConfigurationChange(a,s,Ot.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,s,Ot.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(s){i.push(s)},changes:e,fromCache:t});try{await ko.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},s=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===Nn.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(YHe(s,o),i,Ot.WORKSPACE)}else this.triggerConfigurationChange(s,i,Ot.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(s=>s.uri.toString()===i.toString())[0]||(this.cachedFolderConfigs.get(i).dispose(),this.cachedFolderConfigs.delete(i),e.push(this._configuration.compareAndDeleteFolderConfiguration(i)));const t=this.workspace.folders.filter(i=>!this.cachedFolderConfigs.has(i.uri));return t.length&&(await this.loadFolderConfigurations(t)).forEach((s,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,s))}),YHe(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new kei(!this.initialized,t,gue,this.getWorkbenchState(),this.isWorkspaceTrusted,this.fileService,this.uriIdentityService,this.logService,this.configurationCache),this._register(i.onDidChange(()=>this.onWorkspaceFolderConfigurationChanged(t))),this.cachedFolderConfigs.set(t.uri,this._register(i))),i.loadConfiguration()})])}async validateWorkspaceFoldersAndReload(e){const t=await this.toValidWorkspaceFolders(this.workspace.folders),{removed:i}=this.compareFolders(this.workspace.folders,t);i.length&&await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}async toValidWorkspaceFolders(e){const t=[];for(const i of e){try{if(!(await this.fileService.stat(i.uri)).isDirectory)continue}catch(s){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Ma(s)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,s,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===Ot.DEFAULT)throw new Error("Invalid configuration target");if(i===Ot.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,s),this.triggerConfigurationChange({keys:s?.overrideIdentifiers?.length?[Vje(s.overrideIdentifiers),e]:[e],overrides:s?.overrideIdentifiers?.length?s.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===Mn.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(s?.overrideIdentifiers?.length&&s.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,s.resource);if(a){const c=s.overrideIdentifiers.sort(),l=a.overrides.find(d=>Ls([...d.identifiers].sort(),c));l&&(s.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:s,...o}),r){case Mn.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case Mn.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case Mn.WORKSPACE:return this.reloadWorkspaceConfiguration();case Mn.WORKSPACE_FOLDER:{const a=s&&s.resource?this.workspace.getFolder(s.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance(uLe,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case Mn.USER_LOCAL:return this._configuration.localUserConfiguration;case Mn.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Mn.WORKSPACE:return this._configuration.workspaceConfiguration;case Mn.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case Ot.USER_LOCAL:return this._configuration.localUserConfiguration;case Ot.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Ot.WORKSPACE:return this._configuration.workspaceConfiguration;case Ot.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Io(t,i.value))return[];const s=[];return i.workspaceFolderValue!==void 0&&s.push(Ot.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&s.push(Ot.WORKSPACE),i.userRemoteValue!==void 0&&s.push(Ot.USER_REMOTE),i.userLocalValue!==void 0&&s.push(Ot.USER_LOCAL),i.applicationValue!==void 0&&s.push(Ot.APPLICATION),t===void 0?s:[s[0]||Ot.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==Ot.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Sft(i)} target`,...e.keys);const s=new ENe(e,t,this._configuration,this.workspace,this.logService);s.source=i,this._onDidChangeConfiguration.fire(s)}}toEditableConfigurationTarget(e,t){if(e===Ot.APPLICATION)return Mn.USER_LOCAL;if(e===Ot.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===ut.MACHINE||i===ut.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return Mn.USER_REMOTE}return Mn.USER_LOCAL}return e===Ot.USER_LOCAL?Mn.USER_LOCAL:e===Ot.USER_REMOTE?Mn.USER_REMOTE:e===Ot.WORKSPACE?Mn.WORKSPACE:e===Ot.WORKSPACE_FOLDER?Mn.WORKSPACE_FOLDER:null}}let fLe=class extends ${constructor(e,t,i,s,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,s.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=it.as(Cs.Configuration),a=this._register(new Lu(50));this._register(T.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Us.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Wf.properties,patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},l3.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},s={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(sE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Wf.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.properties[d]),l),{}),patternProperties:Object.keys(Wf.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=Nn.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g($Oe,0,"Contribute defaults for configurations"),properties:Object.assign({},nE.properties,sE.properties,vb.properties),patternProperties:{[KD]:{type:"object",default:{},$ref:ED}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:s,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=it.as(eL.JSONContribution);t.registerSchema(eei,e.defaultSettingsSchema),t.registerSchema(tei,e.userSettingsSchema),t.registerSchema(iei,e.profileSettingsSchema),t.registerSchema(nei,e.machineSettingsSchema),t.registerSchema(Yrt,e.workspaceSettingsSchema),t.registerSchema(sei,e.folderSettingsSchema),t.registerSchema(Hje,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,s])=>{s.restricted||(t[i]=s)}),t}};fLe=D([_(0,Ti),_(1,ec),_(2,oA),_(3,ho),_(4,mg)],fLe);let pLe=class extends ${constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(Ot.DEFAULT))}};pLe=D([_(0,Re),_(1,ho)],pLe);var QH;let bre=(QH=class extends ${constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=it.as(Cs.Configuration),this.processExperimentalSettings(Object.keys(this.configurationRegistry.getConfigurationProperties())),this._register(this.configurationRegistry.onDidUpdateConfiguration(({properties:t})=>this.processExperimentalSettings(t)))}async processExperimentalSettings(e){const t={},i=this.configurationRegistry.getConfigurationProperties();for(const s of e){const o=i[s];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(s)){this.processedExperimentalSettings.add(s);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${s}`);!ll(r)&&!Io(r,o.default)&&(t[s]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t,source:g($Oe,1,"Experiments")}])}},QH.ID="workbench.contrib.updateExperimentalSettingsDefaults",QH);bre=D([_(0,get)],bre);const oat=it.as(pf.Workbench);oat.registerWorkbenchContribution(fLe,Us.Restored);oat.registerWorkbenchContribution(pLe,Us.Eventually);gp(bre.ID,bre,Sl.BlockRestore);const Lei=it.as(Cs.Configuration);Lei.registerConfiguration({...PQ,properties:{[RA]:{type:"array",description:g($Oe,2,"Configure settings to be applied for all profiles."),default:[],scope:ut.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class Tei{constructor(e,t,i){this.donotCacheResourcesWithSchemes=e,this.fileService=i,this.cachedConfigurations=new Map,this.cacheHome=t.cacheHome}needsCaching(e){return!this.donotCacheResourcesWithSchemes.includes(e.scheme)}read(e){return this.getCachedConfiguration(e).read()}write(e,t){return this.getCachedConfiguration(e).save(t)}remove(e){return this.getCachedConfiguration(e).remove()}getCachedConfiguration({type:e,key:t}){const i=`${e}:${t}`;let s=this.cachedConfigurations.get(i);return s||(s=new Rei({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,s)),s}}class Rei{constructor({type:e,key:t},i,s){this.fileService=s,this.cachedConfigurationFolderResource=Qt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Qt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new dO}async read(){try{return(await this.fileService.readFile(this.cachedConfigurationFileResource)).value.toString()}catch{return""}}async save(e){await this.createCachedFolder()&&await this.queue.queue(async()=>{await this.fileService.writeFile(this.cachedConfigurationFileResource,ze.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Zi.FILE_NOT_FOUND)throw e}}async createCachedFolder(){if(await this.fileService.exists(this.cachedConfigurationFolderResource))return!0;try{return await this.fileService.createFolder(this.cachedConfigurationFolderResource),!0}catch{return!1}}}const e_="vs/workbench/services/label/common/labelService",Mei=Ap.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(e_,0,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(e_,1,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(e_,2,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(e_,3,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(e_,4,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(e_,5,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(e_,6,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(e_,7,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(e_,8,"Suffix appended to the workspace label.")}}}}}}}),O7e=/\//g,Nei=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function Pei(n){return!!(n&&n[2]===":")}let mLe=class{constructor(e){this.formattersDisposables=new Map,Mei.setHandler((t,i)=>{for(const s of i.added)for(const o of s.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=dg),!Cd(s.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const s of i.removed)for(const o of s.value)St(this.formattersDisposables.get(o))})}};mLe=D([_(0,eo)],mLe);it.as(pf.Workbench).registerWorkbenchContribution(mLe,Us.Restored);const B7e=50;let _Le=class extends ${constructor(e,t,i,s,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=s,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=$c,this.userHome=i.defaultUriScheme===_e.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new W1("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(ke.PROFILE,ln.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??$c,this.userHome=await this.pathService.userHome()}findFormatting(e){let t;for(const i of this.formatters)if(i.scheme===e.scheme){if(!i.authority&&(!t||i.priority)){t=i;continue}if(!i.authority)continue;WW(i.authority.toLowerCase(),e.authority.toLowerCase())&&(!t||!t.authority||i.authority.length>t.authority.length||i.authority.length===t.authority.length&&i.priority)&&(t=i)}return t?t.formatting:void 0}getUriLabel(e,t={}){let i=this.findFormatting(e);i&&t.separator&&(i={...i,separator:t.separator});const s=this.doGetUriLabel(e,i,t);return!i&&t.separator?s.replace(O7e,t.separator):s}doGetUriLabel(e,t,i={}){if(!t)return nPt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:s=>this.contextService.getWorkspaceFolder(s)}:void 0});if(i.relative&&this.contextService){let s=this.contextService.getWorkspaceFolder(e);if(!s){const o=this.contextService.getWorkspace(),r=k_(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(Qi.sep)&&(s=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(s){const o=this.formatUri(s.uri,t,i.noPrefix);let r=this.formatUri(e,t,i.noPrefix),a=0;for(;r[a]&&r[a]===o[a];)a++;if(!r[a]||r[a]===t.separator?r=r.substring(1+a):a===o.length&&s.uri.path===Qi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=s?.name??Mx(s.uri);r=r?`${l} • ${r}`:l}return r}}return this.formatUri(e,t,i.noPrefix)}getUriBasenameLabel(e){const t=this.findFormatting(e),i=this.doGetUriLabel(e,t);let s;return t?.separator===Gc.sep?s=Gc:t?.separator===Qi.sep?s=Qi:s=this.os===Pr.Windows?Gc:Qi,s.basename(i)}getWorkspaceLabel(e,t){if(lbe(e)){const i=UW(e);return BS(i)||hF(i)?this.getWorkspaceLabel(i,t):""}return P.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):BS(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):hF(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(p7(e,this.environmentService))return g(e_,9,"Untitled (Workspace)");if(hx(e))return g(e_,10,"Workspace");let i=ui(e);i.endsWith(qb)&&(i=i.substr(0,i.length-qb.length-1));let s;switch(t?.verbose){case t_.SHORT:s=i;break;case t_.LONG:s=g(e_,11,"{0} (Workspace)",this.getUriLabel(Qt(ma(e),i)));break;case t_.MEDIUM:default:s=g(e_,12,"{0} (Workspace)",i);break}return t?.verbose===t_.SHORT?s:this.appendWorkspaceSuffix(s,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case t_.LONG:i=this.getUriLabel(e);break;case t_.SHORT:case t_.MEDIUM:default:i=ui(e)||Qi.sep;break}return t?.verbose===t_.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.separator||Qi.sep}getHostLabel(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(s=>s.scheme===e.scheme&&s.authority===e.authority);if(i===-1&&t.length>=B7e&&(i=B7e-1),i===-1)t.unshift(e);else{for(let s=i;s>0;s--)t[s]=t[s-1];t[0]=e}return this.storedFormattersMemento.saveMemento(),this.registerFormatter(e)}registerFormatter(e){return this.formatters.push(e),this._onDidChangeFormatters.fire({scheme:e.scheme}),{dispose:()=>{this.formatters=this.formatters.filter(t=>t!==e),this._onDidChangeFormatters.fire({scheme:e.scheme})}}}formatUri(e,t,i){let s=t.label.replace(Nei,(o,r,a,c)=>{switch(r){case"scheme":return e.scheme;case"authority":return e.authority;case"authoritySuffix":{const l=e.authority.indexOf("+");return l===-1?e.authority:e.authority.slice(l+1)}case"path":return t.stripPathStartingSeparator?e.path.slice(e.path[0]===t.separator?1:0):e.path;default:{if(a==="query"){const{query:l}=e;if(l&&l[0]==="{"&&l[l.length-1]==="}")try{return JSON.parse(l)[c]||""}catch{}}return""}}});return t.normalizeDriveLetter&&Pei(s)&&(s=s.charAt(1).toUpperCase()+s.substr(2)),t.tildify&&!i&&this.userHome&&(s=rtt(s,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(s=t.authorityPrefix+s),s.replace(O7e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),s=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return s?`${e} [${s}]`:e}};_Le=D([_(0,ec),_(1,Ti),_(2,Tm),_(3,Sf),_(4,on),_(5,mg)],_Le);let vLe=class{constructor(e,t,i,s){this.configurationService=e,this.environmentService=i,this.storageService=s,this.remoteEnvironment=null,t.getEnvironment().then(o=>this.remoteEnvironment=o)}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});if(i&&typeof i=="string"&&i!=="auto")return i;const s=this.getOS(e);return s===Pr.Linux||s===Pr.Macintosh?` +`},d=Xce(s,["folders"],c,l);let h=W3e(s,d);return R2(o.remoteAuthority,KYe(i))&&(h=W3e(h,hYt(h,["remoteAuthority"],l))),h}function cZt(s,e){const t=sf(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>Fst(i));else throw new Error(`${s} looks like an invalid workspace file.`);return t}function lZt(s){return s.workspace&&typeof s.workspace=="object"&&typeof s.workspace.id=="string"&&typeof s.workspace.configPath=="string"}function dZt(s){return typeof s.folderUri=="string"}function hZt(s){return typeof s.fileUri=="string"}function uZt(s,e){const t={workspaces:[],files:[]};if(s){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;lZt(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:N.parse(o.workspace.configPath)}}):dZt(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:N.parse(o.folderUri)}):hZt(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:N.parse(o.fileUri)})})}return t}function gZt(s){const e={entries:[]};for(const t of s.workspaces)fj(t)?e.entries.push({folderUri:t.folderUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority}):e.entries.push({workspace:{id:t.workspace.id,configPath:t.workspace.configPath.toString()},label:t.label,remoteAuthority:t.remoteAuthority});for(const t of s.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const Bst=Te;var fr;(function(s){s[s.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",s[s.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",s[s.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",s[s.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",s[s.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",s[s.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",s[s.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",s[s.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",s[s.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",s[s.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",s[s.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",s[s.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(fr||(fr={}));class c9e extends La{constructor(e,t){super(e),this.code=t}}var An;(function(s){s[s.USER_LOCAL=1]="USER_LOCAL",s[s.USER_REMOTE=2]="USER_REMOTE",s[s.WORKSPACE=3]="WORKSPACE",s[s.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(An||(An={}));let YDe=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=n,this.userDataProfilesService=o,this.fileService=r,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new bI}async writeConfiguration(e,t,i={}){const n=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(n,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,n,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,n=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(n.object.textEditorModel);await this.updateConfiguration(e,n.object.textEditorModel,o,t)}finally{n.dispose()}}async updateConfiguration(e,t,i,n){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(fr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&n.handleDirtyFile)switch(n.handleDirtyFile){case"save":await this.save(t,e);break;case"revert":await this.textFileService.revert(t.uri);break}const o=this.getEdits(e,t.getValue(),i)[0];o&&this.applyEditsToBuffer(o,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===Qi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new c9e(g(8749,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),fr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,n){return t.length?Xce(i,t,e,n):[{content:JSON.stringify(e,null,n.insertSpaces&&n.tabSize?" ".repeat(n.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),n=e.getEOL();return{insertSpaces:t,tabSize:i,eol:n}}async onError(e,t,i){switch(e.code){case fr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case fr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:return this.doWriteConfiguration(t,{scopes:i,handleDirtyFile:"revert"});default:this.notificationService.error(e.message)}}onInvalidConfigurationError(e,t){const i=t.workspaceStandAloneConfigurationKey===Of?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===cx?g(8751,"Open Launch Configuration"):null;i?this.notificationService.prompt(Xe.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const n=t.workspaceStandAloneConfigurationKey===Of?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===cx?g(8751,"Open Launch Configuration"):null;n?this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>{const o=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:o,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:n,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case An.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case An.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case An.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case An.WORKSPACE_FOLDER:if(e.resource){const i=this.contextService.getWorkspaceFolder(e.resource);i&&this.preferencesService.openFolderSettings({folderUri:i.uri,jsonEditor:!0})}break}}openFile(e){this.editorService.openEditor({resource:e,options:{pinned:!0}})}toConfigurationEditingError(e,t,i){const n=this.toErrorMessage(e,t,i);return new c9e(n,e)}toErrorMessage(e,t,i){switch(e){case fr.ERROR_POLICY_CONFIGURATION:return g(8754,"Unable to write {0} because it is configured in system policy.",i.key);case fr.ERROR_UNKNOWN_KEY:return g(8755,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(8756,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(8757,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(8758,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case fr.ERROR_INVALID_USER_TARGET:return g(8759,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case fr.ERROR_INVALID_WORKSPACE_TARGET:return g(8760,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case fr.ERROR_INVALID_FOLDER_TARGET:return g(8761,"Unable to write to Folder Settings because no resource is provided.");case fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(8762,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case fr.ERROR_NO_WORKSPACE_OPENED:return g(8763,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case fr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===Of)return g(8764,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8765,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case An.USER_LOCAL:return g(8766,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case An.USER_REMOTE:return g(8767,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case An.WORKSPACE:return g(8768,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8769,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===Of)return g(8770,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8771,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case An.USER_LOCAL:return g(8772,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case An.USER_REMOTE:return g(8773,"Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again.");case An.WORKSPACE:return g(8774,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8775,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===Of)return g(8776,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8777,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case An.USER_LOCAL:return g(8778,"Unable to write into user settings because the content of the file is newer.");case An.USER_REMOTE:return g(8779,"Unable to write into remote user settings because the content of the file is newer.");case An.WORKSPACE:return g(8780,"Unable to write into workspace settings because the content of the file is newer.");case An.WORKSPACE_FOLDER:return g(8781,"Unable to write into folder settings because the content of the file is newer.")}case fr.ERROR_INTERNAL:return g(8782,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case An.USER_LOCAL:return g(8783,"User Settings");case An.USER_REMOTE:return g(8784,"Remote User Settings");case An.WORKSPACE:return g(8785,"Workspace Settings");case An.WORKSPACE_FOLDER:return g(8786,"Folder Settings");default:return""}}defaultResourceValue(e){const t=this.uriIdentityService.extUri.basename(e);switch(t.substr(0,t.length-this.uriIdentityService.extUri.extname(e).length)){case Of:return iZt;default:return"{}"}}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,this.defaultResourceValue(e),{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e,t){if(t.workspaceStandAloneConfigurationKey&&!t.key)return!1;const i=[];return sf(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,n){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(fr.ERROR_POLICY_CONFIGURATION,e,t);const r=Qe.as(Nn.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!tf.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(fr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==Of&&(e===An.USER_LOCAL||e===An.USER_REMOTE))throw this.toConfigurationEditingError(fr.ERROR_INVALID_USER_TARGET,e,t);if((e===An.WORKSPACE||e===An.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===qi.EMPTY)throw this.toConfigurationEditingError(fr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===An.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!tf.test(t.key)){if(r===at.APPLICATION)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===at.MACHINE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===An.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!tf.test(t.key)&&r!==void 0&&!Rst.includes(r))throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(n.overrideIdentifiers?.length&&r!==at.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===An.USER_LOCAL?Mst:EPe,d=Object.keys(l);for(const h of d){const u=this.getConfigurationFileResource(e,h,l[h],i.resource,void 0);if(t.key===h){const p=this.isWorkspaceConfigurationResource(u)?[h]:[];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}const f=`${h}.`;if(t.key.indexOf(f)===0){const p=this.isWorkspaceConfigurationResource(u)?[h,t.key.substr(f.length)]:[t.key.substr(f.length)];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}}}const n=t.key,r=Qe.as(Nn.Configuration).getConfigurationProperties()[n]?.scope;let a=i.overrideIdentifiers?.length?[yKe(i.overrideIdentifiers),n]:[n];if(e===An.USER_LOCAL||e===An.USER_REMOTE)return{key:n,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,n,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,n,KXt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:n,jsonPath:a,value:t.value,resource:c??void 0,target:e}}isWorkspaceConfigurationResource(e){const t=this.contextService.getWorkspace();return!!(t.configuration&&e&&t.configuration.fsPath===e.fsPath)}getConfigurationFileResource(e,t,i,n,o){if(e===An.USER_LOCAL)return t===Of?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===An.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==qi.EMPTY){const a=this.contextService.getWorkspace();if(e===An.WORKSPACE){if(r===qi.WORKSPACE)return a.configuration??null;if(r===qi.FOLDER)return a.folders[0].toResource(i)}if(e===An.WORKSPACE_FOLDER&&n){const c=this.contextService.getWorkspaceFolder(n);if(c)return c.toResource(i)}}return null}};YDe=D([_(1,Bst),_(2,yi),_(3,ug),_(4,Em),_(5,Jt),_(6,fn),_(7,Fo),_(8,bi),_(9,B6),_(10,ei),_(11,ks)],YDe);const yO=class yO extends RYe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=Qe.as(Nn.Configuration),this.cachedConfigurationDefaultsOverrides={},this.cacheKey={type:"defaults",key:"configurationDefaultsOverrides"},this.updateCache=!1,t.options?.configurationDefaults&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t.options.configurationDefaults}])}getConfigurationDefaultOverrides(){return this.cachedConfigurationDefaultsOverrides}async initialize(){return await this.initializeCachedConfigurationDefaultsOverrides(),super.initialize()}reload(){return this.updateCache=!0,this.cachedConfigurationDefaultsOverrides={},this.updateCachedConfigurationDefaultsOverrides(),super.reload()}hasCachedConfigurationDefaultsOverrides(){return!CA(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=kn(this.cachedConfigurationDefaultsOverrides)?this.cachedConfigurationDefaultsOverrides:{}})()),this.initiaizeCachedConfigurationDefaultsOverridesPromise}onDidUpdateConfiguration(e,t){super.onDidUpdateConfiguration(e,t),t&&this.updateCachedConfigurationDefaultsOverrides()}async updateCachedConfigurationDefaultsOverrides(){if(!this.updateCache)return;const e={},t=this.configurationRegistry.getConfigurationDefaultsOverrides();for(const[i,n]of t)!tf.test(i)&&n.value!==void 0&&(e[i]=n.value);try{Object.keys(e).length?(localStorage.setItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let JDe=yO;class fZt extends cje{constructor(e,t,i,n){super(e.defaultProfile.settingsResource,{scopes:[at.APPLICATION]},i.extUri,t,n),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(OC),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class pZt extends V{get hasTasksLoaded(){return this.userConfiguration.value instanceof qie}constructor(e,t,i,n,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=n,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new wn),this.userConfigurationChangeDisposable=this._register(new wn),this.userConfiguration.value=new cje(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new cn(()=>this.userConfiguration.value.loadConfiguration().then(a=>this._onDidChangeConfiguration.fire(a)),50))}async reset(e,t,i){return this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.doReset()}async doReset(e){const t=this.uriIdentityService.extUri.dirname(this.settingsResource),i=this.tasksResource?[[Of,this.tasksResource]]:[],n=new qie(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await n.loadConfiguration(e);return this.userConfiguration.value=n,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),o}async initialize(){return this.userConfiguration.value.loadConfiguration()}async reload(e){return this.hasTasksLoaded?this.userConfiguration.value.loadConfiguration():this.doReset(e)}reparse(e){return this.configurationParseOptions={...this.configurationParseOptions,...e},this.userConfiguration.value.reparse(this.configurationParseOptions)}getRestrictedSettings(){return this.userConfiguration.value.getRestrictedSettings()}}class qie extends V{constructor(e,t,i,n,o,r,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=o,this.uriIdentityService=r,this.logService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.allResources=[this.settingsResource,...this.standAloneConfigurationResources.map(([,c])=>c)],this._register(jr(...this.allResources.map(c=>jr(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new DA(e,a),this._folderSettingsParseOptions=n,this._standAloneConfigurations=[],this._cache=as.createEmptyModel(this.logService),this._register(M.debounce(M.any(M.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),M.filter(this.fileService.onDidRunOperation,c=>this.handleFileOperationEvent(c))),()=>{},100)(()=>this._onDidChange.fire()))}async resolveContents(e){const t=async o=>Promise.all(o.map(async r=>{try{return(await this.fileService.readFile(r,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${r.toString()}': ${su(a)}`),a.fileOperationResult!==Qi.FILE_NOT_FOUND&&a.fileOperationResult!==Qi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],n]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,n.map((o,r)=>[this.standAloneConfigurationResources[r][0],o])]}async loadConfiguration(e){const[t,i]=await this.resolveContents(!!e);this._standAloneConfigurations=[],this._folderSettingsModelParser.parse("",this._folderSettingsParseOptions),t!==void 0&&this._folderSettingsModelParser.parse(t,this._folderSettingsParseOptions);for(let n=0;ne.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),To.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Ai.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class mZt extends V{constructor(e,t,i,n,o,r){super(),this._userConfigurationInitializationPromise=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidInitialize=this._register(new I),this.onDidInitialize=this._onDidInitialize.event,this._fileService=i,this._userConfiguration=this._cachedConfiguration=new _Zt(e,t,{scopes:Uue},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new $ue(a.settingsPath,{scopes:Uue},this._fileService,n,r));this._register(c.onDidChangeConfiguration(d=>this.onDidUserConfigurationChange(d))),this._userConfigurationInitializationPromise=c.initialize();const l=await this._userConfigurationInitializationPromise;this._userConfiguration.dispose(),this._userConfiguration=c,this.onDidUserConfigurationChange(l),this._onDidInitialize.fire(l)}})}async initialize(){if(this._userConfiguration instanceof $ue)return this._userConfiguration.initialize();let e=await this._userConfiguration.initialize();return this._userConfigurationInitializationPromise&&(e=await this._userConfigurationInitializationPromise,this._userConfigurationInitializationPromise=null),e}reload(){return this._userConfiguration.reload()}reparse(){return this._userConfiguration.reparse({scopes:Uue})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof $ue){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class $ue extends V{constructor(e,t,i,n,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=n,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new wn),this.directoryWatcherDisposable=this._register(new wn),this.parser=new DA(this.configurationResource.toString(),o),this.parseOptions=t,this._register(i.onDidFilesChange(r=>this.handleFileChangesEvent(r))),this._register(i.onDidRunOperation(r=>this.handleFileOperationEvent(r))),this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(r=>this._onDidChangeConfiguration.fire(r)),50)),this._register(Ee(()=>{this.stopWatchingResource(),this.stopWatchingDirectory()}))}watchResource(){this.fileWatcherDisposable.value=this.fileService.watch(this.configurationResource)}stopWatchingResource(){this.fileWatcherDisposable.value=void 0}watchDirectory(){const e=this.uriIdentityService.extUri.dirname(this.configurationResource);this.directoryWatcherDisposable.value=this.fileService.watch(e)}stopWatchingDirectory(){this.directoryWatcherDisposable.value=void 0}async initialize(){const e=await this.fileService.exists(this.configurationResource);return this.onResourceExists(e),this.reload()}async resolveContent(){return(await this.fileService.readFile(this.configurationResource,{atomic:!0})).value.toString()}async reload(){try{const e=await this.resolveContent();return this.parser.parse(e,this.parseOptions),this.parser.configurationModel}catch{return as.createEmptyModel(this.logService)}}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}handleFileChangesEvent(e){let t=e.contains(this.configurationResource,To.UPDATED);e.contains(this.configurationResource,To.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,To.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class _Zt extends V{constructor(e,t,i,n){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new DA("CachedRemoteUserConfiguration",n),this.parseOptions=i,this.configurationModel=as.createEmptyModel(n)}getConfigurationModel(){return this.configurationModel}initialize(){return this.reload()}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.configurationModel=this.parser.configurationModel,this.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}async reload(){try{const e=await this.configurationCache.read(this.key),t=JSON.parse(e);t.content&&(this.parser.parse(t.content,this.parseOptions),this.configurationModel=this.parser.configurationModel)}catch{}return this.configurationModel}async updateConfiguration(e){return e?this.configurationCache.write(this.key,JSON.stringify({content:e})):this.configurationCache.remove(this.key)}}class vZt extends V{get initialized(){return this._initialized}constructor(e,t,i,n){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=n,this._workspaceConfigurationDisposables=this._register(new Z),this._workspaceIdentifier=null,this._isWorkspaceTrusted=!1,this._onDidUpdateConfiguration=this._register(new I),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this._initialized=!1,this.fileService=t,this._workspaceConfiguration=this._cachedConfiguration=new bZt(e,n)}async initialize(e,t){this._workspaceIdentifier=e,this._isWorkspaceTrusted=t,this._initialized||(this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)?(this._workspaceConfiguration=this._cachedConfiguration,this.waitAndInitialize(this._workspaceIdentifier)):this.doInitialize(new VK(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:uj,skipRestricted:this.isUntrusted()})}getFolders(){return this._workspaceConfiguration.getFolders()}setFolders(e,t){return this._workspaceIdentifier?t.write(this._workspaceIdentifier.configPath,[{path:["folders"],value:e}],!0).then(()=>this.reload()):Promise.resolve()}isTransient(){return this._workspaceConfiguration.isTransient()}getConfiguration(){return this._workspaceConfiguration.getWorkspaceSettings()}updateWorkspaceTrust(e){return this._isWorkspaceTrusted=e,this.reparseWorkspaceSettings()}reparseWorkspaceSettings(){return this._workspaceConfiguration.reparseWorkspaceSettings({scopes:uj,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await aje(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof VK)){const t=this._register(new VK(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:uj,skipRestricted:this.isUntrusted()}),this.doInitialize(t),this.onDidWorkspaceConfigurationChange(!1,!0)}}doInitialize(e){this._workspaceConfigurationDisposables.clear(),this._workspaceConfiguration=this._workspaceConfigurationDisposables.add(e),this._workspaceConfigurationDisposables.add(this._workspaceConfiguration.onDidChange(t=>this.onDidWorkspaceConfigurationChange(!0,!1))),this._initialized=!0}isUntrusted(){return!this._isWorkspaceTrusted}async onDidWorkspaceConfigurationChange(e,t){e&&await this.reload(),this.updateCache(),this._onDidUpdateConfiguration.fire(t)}async updateCache(){if(this._workspaceIdentifier&&this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)&&this._workspaceConfiguration instanceof VK){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class VK extends V{constructor(e,t,i){super(),this.fileService=e,this.logService=i,this._workspaceIdentifier=null,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.workspaceConfigurationModelParser=new Gie("",i),this.workspaceSettings=as.createEmptyModel(i),this._register(M.any(M.filter(this.fileService.onDidFilesChange,n=>!!this._workspaceIdentifier&&n.contains(this._workspaceIdentifier.configPath)),M.filter(this.fileService.onDidRunOperation,n=>!!this._workspaceIdentifier&&(n.isOperation(Ai.CREATE)||n.isOperation(Ai.COPY)||n.isOperation(Ai.DELETE)||n.isOperation(Ai.WRITE))&&t.extUri.isEqual(n.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>this._onDidChange.fire(),50)),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile())}get workspaceIdentifier(){return this._workspaceIdentifier}async resolveContent(e){return(await this.fileService.readFile(e.configPath,{atomic:!0})).value.toString()}async load(e,t){(!this._workspaceIdentifier||this._workspaceIdentifier.id!==e.id)&&(this._workspaceIdentifier=e,this.workspaceConfigurationModelParser=new Gie(this._workspaceIdentifier.id,this.logService),bt(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(n){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(n)}this.workspaceConfigurationModelParser.parse(i,t),this.consolidate()}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}watchWorkspaceConfigurationFile(){return this._workspaceIdentifier?this.fileService.watch(this._workspaceIdentifier.configPath):V.None}}class bZt{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=M.None,this.workspaceConfigurationModelParser=new Gie("",t),this.workspaceSettings=as.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),n=await this.configurationCache.read(i),o=JSON.parse(n);o.content&&(this.workspaceConfigurationModelParser=new Gie(i.key,this.logService),this.workspaceConfigurationModelParser.parse(o.content,t),this.consolidate())}catch{}}get workspaceIdentifier(){return null}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}async updateWorkspace(e,t){try{const i=this.getKey(e);t?await this.configurationCache.write(i,JSON.stringify({content:t})):await this.configurationCache.remove(i)}catch{}}getKey(e){return{type:"workspaces",key:e.id}}}class wZt{constructor(e,t,i,n,o){this.configurationCache=n,this.logService=o,this.onDidChange=M.None,this.key={type:"folder",key:Wc(Pt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new DA("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=as.createEmptyModel(o)}async loadConfiguration(){try{const e=await this.configurationCache.read(this.key),{content:t}=JSON.parse(e.toString());if(t)for(const i of Object.keys(t))if(i===$ie)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const n=new Pst(i,i,this.logService);n.parse(t[i]),this._standAloneConfigurations.push(n.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[$ie]=e),t.forEach(([n,o])=>{o&&(i[n]=o)}),Object.keys(i).length?await this.configurationCache.write(this.key,JSON.stringify({content:i})):await this.configurationCache.remove(this.key)}getRestrictedSettings(){return this._folderSettingsModelParser.restrictedConfigurations}reparse(e){return this._folderSettingsParseOptions=e,this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions),this.consolidate(),this.configurationModel}consolidate(){this.configurationModel=this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations)}getUnsupportedKeys(){return[]}}class yZt extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=n,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=qi.WORKSPACE===this.workbenchState?Rst:uj,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new wZt(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,aje(t.uri,r).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())))}loadConfiguration(){return this.folderConfiguration.loadConfiguration()}updateWorkspaceTrust(e){return this.workspaceTrusted=e,this.reparse()}reparse(){const e=this.folderConfiguration.reparse({scopes:this.scopes,skipRestricted:this.isUntrusted()});return this.updateCache(),e}getRestrictedSettings(){return this.folderConfiguration.getRestrictedSettings()}isUntrusted(){return!this.workspaceTrusted}onDidFolderConfigurationChange(){this.updateCache(),this._onDidChange.fire()}createFileServiceBasedConfiguration(e,t,i){const n=t.extUri.joinPath(this.configurationFolder,`${$ie}.json`),o=[Of,cx].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new qie(this.configurationFolder.toString(),n,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof qie){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}function l9e(s,e){return s.isDefault||s.useDefaultFlags?.settings?e?tZt:void 0:e?Lst:eZt}class Gue extends pje{constructor(){super(...arguments),this.initialized=!1}}class CZt extends V{get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,n,o,r,a,c,l,d){if(super(),this.userDataProfileService=n,this.userDataProfilesService=o,this.fileService=r,this.remoteAgentService=a,this.uriIdentityService=c,this.logService=l,this.initialized=!1,this.applicationConfiguration=null,this.remoteUserConfiguration=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeWorkspaceFolders=this._register(new I),this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=this._register(new I),this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkspaceName=this._register(new I),this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onDidChangeWorkbenchState=this._register(new I),this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event,this.isWorkspaceTrusted=!0,this._restrictedSettings={default:[]},this._onDidChangeRestrictedSettings=this._register(new I),this.onDidChangeRestrictedSettings=this._onDidChangeRestrictedSettings.event,this.configurationRegistry=Qe.as(Nn.Configuration),this.initRemoteUserConfigurationBarrier=new qd,this.completeWorkspaceBarrier=new qd,this.defaultConfiguration=this._register(new JDe(t,i,l)),this.policyConfiguration=d instanceof uJe?new Ukt:this._register(new Y_e(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new o9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),new ui,as.createEmptyModel(l),new ui,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new pZt(n.currentProfile.settingsResource,n.currentProfile.tasksResource,{scopes:l9e(n.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new ui,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new mZt(e,t,r,c,a,l));this._register(h.onDidInitialize(u=>{this._register(h.onDidChangeConfiguration(f=>this.onRemoteUserConfigurationChanged(f))),this.onRemoteUserConfigurationChanged(u),this.initRemoteUserConfigurationBarrier.open()}))}else this.initRemoteUserConfigurationBarrier.open();this.workspaceConfiguration=this._register(new vZt(t,r,c,l)),this._register(this.workspaceConfiguration.onDidUpdateConfiguration(h=>{this.onWorkspaceConfigurationChanged(h).then(()=>{this.workspace.initialized=this.workspaceConfiguration.initialized,this.checkAndMarkWorkspaceComplete(h)})})),this._register(this.defaultConfiguration.onDidChangeConfiguration(({properties:h,defaults:u})=>this.onDefaultConfigurationChanged(u,h))),this._register(this.policyConfiguration.onDidChangeConfiguration(h=>this.onPolicyConfigurationChanged(h))),this._register(n.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new bI}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new fZt(this.userDataProfilesService,this.fileService,this.uriIdentityService,this.logService))),this.applicationConfigurationDisposables.add(this.applicationConfiguration.onDidChangeConfiguration(e=>this.onApplicationConfigurationChanged(e))))}async getCompleteWorkspace(){return await this.completeWorkspaceBarrier.wait(),this.getWorkspace()}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace.configuration?qi.WORKSPACE:this.workspace.folders.length===1?qi.FOLDER:qi.EMPTY}getWorkspaceFolder(e){return this.workspace.getFolder(e)}addFolders(e,t){return this.updateFolders(e,[],t)}removeFolders(e){return this.updateFolders([],e)}async updateFolders(e,t,i){return this.workspaceEditingQueue.queue(()=>this.doUpdateFolders(e,t,i))}isInsideWorkspace(e){return!!this.getWorkspaceFolder(e)}isCurrentWorkspace(e){switch(this.getWorkbenchState()){case qi.FOLDER:{let t;return N.isUri(e)?t=e:P_(e)&&(t=e.uri),N.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case qi.WORKSPACE:return iA(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==qi.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let n=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>Fst(a)?!this.contains(t,o[c].uri):!0);if(n=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=zue(r,a,this.uriIdentityService.extUri);const l=o.map(h=>h.uri),d=[];for(const h of e){const u=h.uri;if(!this.contains(l,u)){try{if(!(await this.fileService.stat(u)).isDirectory)continue}catch{}d.push(xPe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(n=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(DI))),this.onWorkspaceConfigurationChanged(!1)}contains(e,t){return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t))}getConfigurationData(){return this._configuration.toData()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=Pde(e)?e:Pde(t)?t:void 0;return this._configuration.getValue(i,n)}async updateValue(e,t,i,n,o){const r=tut(i)?i:Pde(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?n:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=ja(r.overrideIdentifiers),r.overrideIdentifiers=r.overrideIdentifiers.length?r.overrideIdentifiers:void 0),!c.length){if(r?.overrideIdentifiers&&r.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:r?.resource,overrideIdentifier:r?.overrideIdentifiers?r.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Ys(t,l.defaultValue)&&c.length===1&&(c[0]===St.USER||c[0]===St.USER_LOCAL)&&(t=void 0)}await Zs.settled(c.map(l=>this.writeConfigurationValue(e,t,l,r,o)))}async reloadConfiguration(e){if(e===void 0){this.reloadDefaultConfiguration();const t=await this.reloadApplicationConfiguration(!0),{local:i,remote:n}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,n,!0);return}if(fje(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case St.DEFAULT:this.reloadDefaultConfiguration();return;case St.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case St.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case St.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case St.WORKSPACE:case St.WORKSPACE_FOLDER:await this.reloadWorkspaceConfiguration();return}}hasCachedConfigurationDefaultsOverrides(){return this.defaultConfiguration.hasCachedConfigurationDefaultsOverrides()}inspect(e,t){return this._configuration.inspect(e,t)}keys(){return this._configuration.keys()}async whenRemoteConfigurationLoaded(){await this.initRemoteUserConfigurationBarrier.wait()}async initialize(e){cs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),cs("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);let a;r&&(a=r.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(o.uri,a)),i.push(a)}this.getWorkbenchState()===qi.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let n=[];this.restrictedSettings.userLocal&&n.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&n.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&n.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>n.push(...o)),n=ja(n),n.length&&this.triggerConfigurationChange({keys:n,overrides:[]},{data:t,workspace:this.workspace},St.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===at.APPLICATION)return!0;const t=this.getValue(OC)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return iA(e)?this.createMultiFolderWorkspace(e):P_(e)?this.createSingleFolderWorkspace(e):this.createEmptyWorkspace(e)}async createMultiFolderWorkspace(e){await this.workspaceConfiguration.initialize({id:e.id,configPath:e.configPath},this.isWorkspaceTrusted);const t=e.configPath,i=zue(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),n=e.id,o=new Gue(n,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new Gue(e.id,[KY(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new Gue(e.id,[],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,Promise.resolve(t)}checkAndMarkWorkspaceComplete(e){!this.completeWorkspaceBarrier.isOpen()&&this.workspace.initialized&&(this.completeWorkspaceBarrier.open(),this.validateWorkspaceFoldersAndReload(e))}async updateWorkspaceAndInitializeConfiguration(e,t){const i=!!this.workspace;let n,o,r=[];if(i?(n=this.getWorkbenchState(),o=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,r=this.workspace.folders,this.workspace.update(e)):this.workspace=e,await this.initializeConfiguration(t),i){const a=this.getWorkbenchState();n&&a!==n&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==n)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(r,this.workspace.folders);l&&(l.added.length||l.removed.length||l.changed.length)&&(await this.handleWillChangeWorkspaceFolders(l,!1),this._onDidChangeWorkspaceFolders.fire(l))}this.localUserConfiguration.hasTasksLoaded||this._register(XP(si,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(n=>!e.some(o=>n.uri.toString()===o.uri.toString()));for(let n=0;n{cs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(as.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(OC)})}return cs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,n()]);cs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),cs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return as.createEmptyModel(this.logService);const t=await this.applicationConfiguration.loadConfiguration();return e||this.onApplicationConfigurationChanged(t),t}async reloadUserConfiguration(){const[e,t]=await Promise.all([this.reloadLocalUserConfiguration(!0),this.reloadRemoteUserConfiguration(!0)]);return{local:e,remote:t}}async reloadLocalUserConfiguration(e,t){const i=await this.localUserConfiguration.reload(t);return e||this.onLocalUserConfigurationChanged(i),i}async reloadRemoteUserConfiguration(e){if(this.remoteUserConfiguration){const t=await this.remoteUserConfiguration.reload();return e||this.onRemoteUserConfigurationChanged(t),t}return as.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===qi.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===qi.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,n){this.cachedFolderConfigs=new ui;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new ui;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new o9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,as.createEmptyModel(this.logService),new ui,this.workspace,this.logService),this.initialized=!0,n){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},St.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case qi.FOLDER:return e[0];case qi.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return as.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:l9e(e.profile,!!this.remoteUserConfiguration)})),(e.previous.isDefault!==e.profile.isDefault||!!e.previous.useDefaultFlags?.settings!=!!e.profile.useDefaultFlags?.settings)&&(this.createApplicationConfiguration(),this.applicationConfiguration&&t.push(this.reloadApplicationConfiguration(!0)));let[i,n]=await Promise.all(t);n=n??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:n.getValue(OC)})),await this.loadConfiguration(n,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),n=this._configuration.compareAndUpdateDefaultConfiguration(e,t);if(this.applicationConfiguration&&this._configuration.updateApplicationConfiguration(this.applicationConfiguration.reparse()),this.remoteUserConfiguration&&(this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse()),this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse())),this.getWorkbenchState()===qi.FOLDER){const o=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);o&&(this._configuration.updateWorkspaceConfiguration(o.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,o.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);r&&this._configuration.updateFolderConfiguration(o.uri,r.reparse())}}this.triggerConfigurationChange(n,{data:i,workspace:this.workspace},St.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,St.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(OC)??[],n=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(OC)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of n.keys)if(r[c]?.scope===at.APPLICATION){if(a.push(c),c===OC){for(const l of i)o.includes(l)||a.push(l);for(const l of o)i.includes(l)||a.push(l)}}else o.includes(c)&&a.push(c);n.keys=a,n.keys.includes(OC)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(n,t,St.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=zue(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:n,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||n.length||o.length?t=await this.toValidWorkspaceFolders(t):t=this.workspace.folders}await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}}updateRestrictedSettings(){const e=[],t=this.configurationRegistry.getConfigurationProperties(),i=Object.keys(t).filter(p=>t[p].restricted).sort((p,m)=>p.localeCompare(m)),n=XI(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...n.added,...n.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=XI(o,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...r.added,...r.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=XI(a,this._restrictedSettings.userLocal||[],(p,m)=>p.localeCompare(m));e.push(...c.added,...c.removed);const l=(this.remoteUserConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),d=XI(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new ui;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((y,C)=>y.localeCompare(C));v.length&&h.set(p.uri,v);const b=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],w=XI(v,b,(y,C)=>y.localeCompare(C));e.push(...w.added,...w.removed)}const u=this.getWorkbenchState()===qi.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=XI(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:o.length?o:void 0,userLocal:a.length?a:void 0,userRemote:l.length?l:void 0,workspace:u.length?u:void 0,workspaceFolder:h.size?h:void 0},this._onDidChangeRestrictedSettings.fire(this.restrictedSettings))}async updateWorkspaceConfiguration(e,t,i){const n={data:this._configuration.toData(),workspace:this.workspace},o=this._configuration.compareAndUpdateWorkspaceConfiguration(t),r=this.compareFolders(this.workspace.folders,e);if(r.added.length||r.removed.length||r.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(r,i),this.triggerConfigurationChange(a,n,St.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,n,St.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(n){i.push(n)},changes:e,fromCache:t});try{await Zs.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},n=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===qi.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(k2e(n,o),i,St.WORKSPACE)}else this.triggerConfigurationChange(n,i,St.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(n=>n.uri.toString()===i.toString())[0]||(this.cachedFolderConfigs.get(i).dispose(),this.cachedFolderConfigs.delete(i),e.push(this._configuration.compareAndDeleteFolderConfiguration(i)));const t=this.workspace.folders.filter(i=>!this.cachedFolderConfigs.has(i.uri));return t.length&&(await this.loadFolderConfigurations(t)).forEach((n,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,n))}),k2e(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new yZt(!this.initialized,t,tle,this.getWorkbenchState(),this.isWorkspaceTrusted,this.fileService,this.uriIdentityService,this.logService,this.configurationCache),this._register(i.onDidChange(()=>this.onWorkspaceFolderConfigurationChanged(t))),this.cachedFolderConfigs.set(t.uri,this._register(i))),i.loadConfiguration()})])}async validateWorkspaceFoldersAndReload(e){const t=await this.toValidWorkspaceFolders(this.workspace.folders),{removed:i}=this.compareFolders(this.workspace.folders,t);i.length&&await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}async toValidWorkspaceFolders(e){const t=[];for(const i of e){try{if(!(await this.fileService.stat(i.uri)).isDirectory)continue}catch(n){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Nr(n)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,n,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===St.DEFAULT)throw new Error("Invalid configuration target");if(i===St.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,n),this.triggerConfigurationChange({keys:n?.overrideIdentifiers?.length?[yKe(n.overrideIdentifiers),e]:[e],overrides:n?.overrideIdentifiers?.length?n.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===An.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,n.resource);if(a){const c=n.overrideIdentifiers.sort(),l=a.overrides.find(d=>is([...d.identifiers].sort(),c));l&&(n.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:n,...o}),r){case An.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case An.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case An.WORKSPACE:return this.reloadWorkspaceConfiguration();case An.WORKSPACE_FOLDER:{const a=n&&n.resource?this.workspace.getFolder(n.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance(YDe,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case An.USER_LOCAL:return this._configuration.localUserConfiguration;case An.USER_REMOTE:return this._configuration.remoteUserConfiguration;case An.WORKSPACE:return this._configuration.workspaceConfiguration;case An.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case St.USER_LOCAL:return this._configuration.localUserConfiguration;case St.USER_REMOTE:return this._configuration.remoteUserConfiguration;case St.WORKSPACE:return this._configuration.workspaceConfiguration;case St.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Ys(t,i.value))return[];const n=[];return i.workspaceFolderValue!==void 0&&n.push(St.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&n.push(St.WORKSPACE),i.userRemoteValue!==void 0&&n.push(St.USER_REMOTE),i.userLocalValue!==void 0&&n.push(St.USER_LOCAL),i.applicationValue!==void 0&&n.push(St.APPLICATION),t===void 0?n:[n[0]||St.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==St.DEFAULT&&this.logService.debug(`Configuration keys changed in ${iut(i)} target`,...e.keys);const n=new PLe(e,t,this._configuration,this.workspace,this.logService);n.source=i,this._onDidChangeConfiguration.fire(n)}}toEditableConfigurationTarget(e,t){if(e===St.APPLICATION)return An.USER_LOCAL;if(e===St.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===at.MACHINE||i===at.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return An.USER_REMOTE}return An.USER_LOCAL}return e===St.USER_LOCAL?An.USER_LOCAL:e===St.USER_REMOTE?An.USER_REMOTE:e===St.WORKSPACE?An.WORKSPACE:e===St.WORKSPACE_FOLDER?An.WORKSPACE_FOLDER:null}}let XDe=class extends V{constructor(e,t,i,n,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,n.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=Qe.as(Nn.Configuration),a=this._register(new Mh(50));this._register(M.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Rs.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Dg.properties,patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},X4.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},eF.properties,aS.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},n={properties:Object.assign({},eF.properties,aS.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(aS.properties),this.checkAndFilterPropertiesRequiringTrust(cS.properties),this.checkAndFilterPropertiesRequiringTrust(qv.properties)),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Dg.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Dg.properties[d]),l),{}),patternProperties:Object.keys(Dg.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Dg.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=qi.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(aS.properties),this.checkAndFilterPropertiesRequiringTrust(qv.properties)),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g(3655,"Contribute defaults for configurations"),properties:Object.assign({},this.filterDefaultOverridableProperties(aS.properties),this.filterDefaultOverridableProperties(cS.properties),this.filterDefaultOverridableProperties(qv.properties)),patternProperties:{[IE]:{type:"object",default:{},$ref:bE}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:n,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=Qe.as(YA.JSONContribution);t.registerSchema(qXt,e.defaultSettingsSchema),t.registerSchema(QXt,e.userSettingsSchema),t.registerSchema(jXt,e.profileSettingsSchema),t.registerSchema(YXt,e.machineSettingsSchema),t.registerSchema(Tst,e.workspaceSettingsSchema),t.registerSchema(JXt,e.folderSettingsSchema),t.registerSchema(bKe,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,n])=>{n.restricted||(t[i]=n)}),t}filterDefaultOverridableProperties(e){const t={};return Object.entries(e).forEach(([i,n])=>{n.disallowConfigurationDefault||(t[i]=n)}),t}};XDe=D([_(0,yi),_(1,Jr),_(2,uC),_(3,fs),_(4,ig)],XDe);let ZDe=class extends V{constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(St.DEFAULT))}};ZDe=D([_(0,Te),_(1,fs)],ZDe);var jB;let Qie=(jB=class extends V{constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=Qe.as(Nn.Configuration),this.processExperimentalSettings(Object.keys(this.configurationRegistry.getConfigurationProperties())),this._register(this.configurationRegistry.onDidUpdateConfiguration(({properties:t})=>this.processExperimentalSettings(t)))}async processExperimentalSettings(e){const t={},i=this.configurationRegistry.getConfigurationProperties();for(const n of e){const o=i[n];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(n)){this.processedExperimentalSettings.add(n);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${n}`);!Ya(r)&&!Ys(r,o.default)&&(t[n]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t}])}},jB.ID="workbench.contrib.updateExperimentalSettingsDefaults",jB);Qie=D([_(0,tXe)],Qie);const Wst=Qe.as(cf.Workbench);Wst.registerWorkbenchContribution(XDe,Rs.Restored);Wst.registerWorkbenchContribution(ZDe,Rs.Eventually);Qu(Qie.ID,Qie,yc.BlockRestore);const SZt=Qe.as(Nn.Configuration);SZt.registerConfiguration({...V6,properties:{[OC]:{type:"array",description:g(3656,"Configure settings to be applied for all profiles."),default:[],scope:at.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class AZt{constructor(e,t,i){this.donotCacheResourcesWithSchemes=e,this.fileService=i,this.cachedConfigurations=new Map,this.cacheHome=t.cacheHome}needsCaching(e){return!this.donotCacheResourcesWithSchemes.includes(e.scheme)}read(e){return this.getCachedConfiguration(e).read()}write(e,t){return this.getCachedConfiguration(e).save(t)}remove(e){return this.getCachedConfiguration(e).remove()}getCachedConfiguration({type:e,key:t}){const i=`${e}:${t}`;let n=this.cachedConfigurations.get(i);return n||(n=new EZt({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,n)),n}}class EZt{constructor({type:e,key:t},i,n){this.fileService=n,this.cachedConfigurationFolderResource=Pt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Pt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new bI}async read(){try{return(await this.fileService.readFile(this.cachedConfigurationFileResource)).value.toString()}catch{return""}}async save(e){await this.createCachedFolder()&&await this.queue.queue(async()=>{await this.fileService.writeFile(this.cachedConfigurationFileResource,$e.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Qi.FILE_NOT_FOUND)throw e}}async createCachedFolder(){if(await this.fileService.exists(this.cachedConfigurationFolderResource))return!0;try{return await this.fileService.createFolder(this.cachedConfigurationFolderResource),!0}catch{return!1}}}let eke=class{constructor(e,t,i,n){this.configurationService=e,this.environmentService=i,this.storageService=n,this.remoteEnvironment=null,t.getEnvironment().then(o=>this.remoteEnvironment=o)}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});if(i&&typeof i=="string"&&i!=="auto")return i;const n=this.getOS(e);return n===Ds.Linux||n===Ds.Macintosh?` `:`\r -`}getOS(e){let t=$c;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==_e.file){const s=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(s,ke.WORKSPACE,$c),this.storageService.store(s,t,ke.WORKSPACE,ln.MACHINE)}return t}};vLe=D([_(0,Re),_(1,Sf),_(2,ec),_(3,on)],vLe);const vY="vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService";let wLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=s,this.commandService=o,this.fileService=r,this.textFileService=a,this.workspacesService=c,this.environmentService=l,this.fileDialogService=d,this.dialogService=h,this.hostService=u,this.uriIdentityService=f,this.workspaceTrustManagementService=p,this.userDataProfilesService=m,this.userDataProfileService=v}async pickNewWorkspacePath(){const e=[_e.file];this.environmentService.remoteAuthority&&e.unshift(_e.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:JPe(g(vY,0,"Save")),title:g(vY,1,"Save Workspace"),filters:oxt,defaultUri:Qt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return yde(t)||(t=t.with({path:`${t.path}.${qb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&dbe(e,this.environmentService))return ui(e);const t=k_(this.contextService.getWorkspace().folders);return t?`${ui(t.uri)}.${qb}`:`workspace.${qb}`}async updateFolders(e,t,i,s){const o=this.contextService.getWorkspace().folders;let r=[];typeof t=="number"&&(r=o.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:c2e(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,s):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==Nn.WORKSPACE?this.doAddFolders(a,e,s):this.doUpdateFolders(a,r,e,s)}async doUpdateFolders(e,t,i,s=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(s)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(s=>({uri:c2e(s.uri),name:s.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const s=this.contextService.getWorkbenchState();if(s!==Nn.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=Tc(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),s===Nn.EMPTY&&o.length===0||s===Nn.FOLDER&&o.length===1?void 0:this.createAndEnterWorkspace(o)}try{await this.contextService.addFolders(e,t)}catch(o){if(i)throw o;this.handleWorkspaceConfigurationEditingError(o)}}async removeFolders(e,t=!1){if(this.includesSingleFolderWorkspace(e))return this.createAndEnterWorkspace([]);try{await this.contextService.removeFolders(e)}catch(i){if(t)throw i;this.handleWorkspaceConfigurationEditingError(i)}}includesSingleFolderWorkspace(e){if(this.contextService.getWorkbenchState()===Nn.FOLDER){const t=this.contextService.getWorkspace().folders[0];return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t.uri))}return!1}async createAndEnterWorkspace(e,t){if(t&&!await this.isValidTargetWorkspacePath(t))return;const i=this.environmentService.remoteAuthority,s=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(s,t)}finally{await this.workspacesService.deleteUntitledWorkspace(s)}else t=s.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(s,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(_n(t.configPath,e))return this.saveWorkspace(t);if(await this.isValidTargetWorkspacePath(e))return await this.saveWorkspaceAs(t,e),this.enterWorkspace(e)}}async isValidTargetWorkspacePath(e){return!0}async saveWorkspaceAs(e,t){const i=e.configPath;if(!p7(t,this.environmentService)&&!this.userDataProfileService.currentProfile.isDefault){const c=await this.workspacesService.getWorkspaceIdentifier(t);await this.userDataProfilesService.setProfileForWorkspace(c,this.userDataProfileService.currentProfile)}if(this.uriIdentityService.extUri.isEqual(i,t))return;const o=p7(i,this.environmentService),r=await this.fileService.readFile(i),a=N7e(r.value.toString(),i,o,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:a,options:{overwrite:!0}}]),await this.trustWorkspaceConfiguration(t)}async saveWorkspace(e){const t=e.configPath,i=this.textFileService.files.get(t);if(i){await i.save({force:!0,reason:Ln.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=N7e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case jG.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(vY,2,"Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again.");this.askToOpenWorkspaceConfigurationFile(e)}askToOpenWorkspaceConfigurationFile(e){this.notificationService.prompt(nt.Error,e,[{label:g(vY,3,"Open Workspace Configuration"),run:()=>this.commandService.executeCommand("workbench.action.openWorkspaceConfigFile")}])}async doEnterWorkspace(e){if(this.environmentService.extensionTestsLocationURI)throw new Error("Entering a new workspace is not possible in tests.");const t=await this.workspacesService.getWorkspaceIdentifier(e);return this.contextService.getWorkbenchState()===Nn.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===ut.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;s[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:s}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==Nn.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=UW(this.contextService.getWorkspace());if(hF(e))return e}};wLe=D([_(0,dL),_(1,Ti),_(2,sat),_(3,Pi),_(4,ji),_(5,ci),_(6,tr),_(7,cL),_(8,ec),_(9,bf),_(10,To),_(11,Id),_(12,_o),_(13,oA),_(14,V_),_(15,Rm)],wLe);var BB,jP;let bLe=(jP=class extends ${constructor(e,t,i,s,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=s,this.environmentService=o,this.uriIdentityService=r,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(ke.APPLICATION,BB.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(hx(this.contextService.getWorkspace()))for(const t of e.added)this.addRecentlyOpened([{folderUri:t.uri}])}addWorkspaceToRecentlyOpened(){const e=this.contextService.getWorkspace(),t=this.environmentService.remoteAuthority;switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case Nn.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get(BB.RECENTLY_OPENED_KEY,ke.APPLICATION);if(e){const t=wei(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(UX(i)&&i.folderUri.scheme===_e.file&&!hx(this.contextService.getWorkspace())||gei(i)&&hx(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)fei(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):UX(i)?(this.doRemoveRecentlyOpened(t,[i.folderUri]),t.workspaces.unshift(i)):(this.doRemoveRecentlyOpened(t,[i.workspace.configPath]),t.workspaces.unshift(i));return this.saveRecentlyOpened(t)}async removeRecentlyOpened(e){const t=await this.getRecentlyOpened();return this.doRemoveRecentlyOpened(t,e),this.saveRecentlyOpened(t)}doRemoveRecentlyOpened(e,t){e.files=e.files.filter(i=>!t.some(s=>s.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(s=>s.toString()===(UX(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(BB.RECENTLY_OPENED_KEY,JSON.stringify(bei(e)),ke.APPLICATION,ln.USER)}async clearRecentlyOpened(){this.storageService.remove(BB.RECENTLY_OPENED_KEY,ke.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),s=Qt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${qb}`),o=[];if(e)for(const a of e)o.push(zOe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(s,ze.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(s)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Zi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return WFe(e)}async getDirtyWorkspaces(){return[]}},BB=jP,jP.RECENTLY_OPENED_KEY="recently.opened",jP);bLe=BB=D([_(0,on),_(1,Ti),_(2,Ze),_(3,ci),_(4,ec),_(5,_o)],bLe);function Fei(){throw new Error("unsupported")}function Oei(n){let e=null;return(...t)=>(e==null&&(e=n(...t)),e)}function Bei(n){return new Proxy(n,{construct:Oei((e,t)=>Reflect.construct(n,t))})}P.from({scheme:_e.vscodeUserData,path:"/User/settings.json"});it.as(Cs.Configuration);let CLe=class extends Iei{constructor(e,t,i,s,o,r,a,c){const l=new Tei([_e.file,_e.vscodeUserData,_e.tmp],e,s);super({configurationCache:l},e,t,i,s,o,r,a,c)}};CLe=D([_(0,ec),_(1,Rm),_(2,V_),_(3,ci),_(4,Sf),_(5,_o),_(6,Ze),_(7,oPe)],CLe);class Wei extends wLe{constructor(){super(...arguments),this.enterWorkspace=Fei}}let rat;zFe(async n=>{const e=n.get(Ti);e.acquireInstantiationService(n.get(be));const t=rat??UFe();if(P.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const s=n.get(ci);await s.createFolder(t),await s.writeFile(i,ze.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:Dr(),configPath:i})}else await e.initialize(t)});const W7e=Bei(CLe);function Hei(n){return rat=n,{...dOe(),[eo.toString()]:new Gi(_Le,void 0,!0),[Re.toString()]:new Gi(W7e,[],!0),[Ti.toString()]:new Gi(W7e,[],!0),[dl.toString()]:new Gi(dLe,[],!0),[$S.toString()]:new Gi(Wei,[],!0),[cL.toString()]:new Gi(bLe,void 0,!0),[CMe.toString()]:new Gi(vLe,void 0,!0)}}let yLe=class extends ZZ{constructor(e,t,i){super(t),this.editorService=e,this.configurationService=i,this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditor.bind(this))),this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditorFromDiff.bind(this)))}getActiveCodeEditor(){const e=this.editorService.activeTextEditorControl;if(Ka(e))return e;if(ew(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return HU(t)&&Ka(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const s=this.editorService.activeTextEditorControl;if(!i&&ew(s)&&e.options&&e.resource&&t===s.getModifiedEditor()&&s.getModel()&&_n(e.resource,s.getModel()?.modified.uri)){const o=s.getModifiedEditor();return rne(e.options,o,vt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!_n(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(_z(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?Cw:wx);if(o){const r=o.getControl();if(Ka(r))return r;if(HU(r)&&Ka(r.activeCodeEditor))return r.activeCodeEditor}return null}};yLe=D([_(0,_i),_(1,pn),_(2,Re)],yLe);let SLe=class extends ${constructor(e,t,i,s,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=s,this.editorResolverService=o,this.editorInputCache=new wi,this.fileEditorFactory=it.as(zS.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createEditorInput:e=>({editor:this.createTextEditor(e)}),createUntitledEditorInput:e=>({editor:this.createTextEditor(e)}),createDiffEditorInput:e=>({editor:this.createTextEditor(e)})}))}async resolveTextEditor(e){return this.createTextEditor(e)}createTextEditor(e){if(Wb(e))return this.createTextEditor(e.result);if(Gv(e)){const s=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance(op,e.label,e.description,s,o,void 0)}if(LE(e)){const s=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(_m,e.label,e.description,o,s)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===_e.untitled){const s={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===_e.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...s}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...s}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(E6,o))}const i=e;if(i.resource instanceof P){const s=i.label||ui(i.resource),o=i.resource,r=this.uriIdentityService.asCanonicalUri(o);return this.createOrGetCached(r,()=>i.forceFile||this.fileService.hasProvider(r)?this.fileEditorFactory.createFileEditor(r,o,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(AM,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof E6||(a instanceof AM?(s&&a.setName(s),i.description&&a.setDescription(i.description),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)):(a.setPreferredResource(o),i.label&&a.setPreferredName(i.label),i.description&&a.setPreferredDescription(i.description),i.encoding&&a.setPreferredEncoding(i.encoding),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)))})}throw new Error(`ITextEditorService: Unable to create texteditor from ${JSON.stringify(e)}`)}createOrGetCached(e,t,i){let s=this.editorInputCache.get(e);return s?(i?.(s),s):(s=t(),this.editorInputCache.set(e,s),T.once(s.onWillDispose)(()=>this.editorInputCache.delete(e)),s)}};SLe=D([_(0,RQ),_(1,be),_(2,_o),_(3,ci),_(4,Pz)],SLe);var Q3,KP;let ALe=(KP=class extends ${get count(){return this.mostRecentEditorsMap.size}get editors(){return[...this.mostRecentEditorsMap.values()]}hasEditor(e){return this.editorsPerResourceCounter.get(e.resource)?.has(this.toIdentifier(e))??!1}hasEditors(e){return this.editorsPerResourceCounter.has(e)}toIdentifier(e,t){return typeof e!="string"?this.toIdentifier(e.typeId,e.editorId):t?`${e}/${t}`:e}constructor(e,t,i){super(),this.editorGroupService=t,this.storageService=i,this.keyMap=new Map,this.mostRecentEditorsMap=new lQe,this.editorsPerResourceCounter=new wi,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.editorGroupsContainer=e??t,this.isScoped=!!e,this.registerListeners(),this.loadState()}registerListeners(){this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.onGroupAdded(e))),this._register(this.editorGroupService.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.storageService.onWillSaveState(()=>this.saveState()))}onGroupAdded(e){const t=e.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--)this.addMostRecentEditor(e,t[i],!1,!0);this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1),this.registerGroupListeners(e)}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{switch(i.kind){case qo.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case qo.EDITOR_OPEN:{i.editor&&(this.addMostRecentEditor(e,i.editor,!1,!0),this.ensureOpenedEditorsLimit({groupId:e.id,editor:i.editor},e.id));break}}})),t.add(e.onDidCloseEditor(i=>{this.removeMostRecentEditor(e,i.editor)})),t.add(e.onDidActiveEditorChange(i=>{i.editor&&this.addMostRecentEditor(e,i.editor,this.editorGroupsContainer.activeGroup===e,!1)})),T.once(e.onWillDispose)(()=>St(t))}onDidChangeEditorPartOptions(e){if(!Io(e.newPartOptions.limit,e.oldPartOptions.limit)){const t=this.editorGroupsContainer.activeGroup;let i;t.activeEditor&&(i={editor:t.activeEditor,groupId:t.id}),this.ensureOpenedEditorsLimit(i)}}addMostRecentEditor(e,t,i,s){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?Vd.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,Vd.AsOld),this.mostRecentEditorsMap.set(r,r,Vd.AsOld)),s&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,s,o;if(e instanceof _m?(i=e.primary.resource,s=e.primary.typeId,o=e.primary.editorId):(i=e.resource,s=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(s,o);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(r,(a.get(r)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(r)??0;c>1?a.set(r,c-1):(a.delete(r),a.size===0&&this.editorsPerResourceCounter.delete(i))}}}removeMostRecentEditor(e,t){this.updateEditorResourcesMap(t,!1);const i=this.findKey(e,t);if(i){this.mostRecentEditorsMap.delete(i);const s=this.keyMap.get(e.id);s&&s.delete(i.editor)&&s.size===0&&this.keyMap.delete(e.id),this._onDidMostRecentlyActiveEditorsChange.fire()}}findKey(e,t){const i=this.keyMap.get(e.id);if(i)return i.get(t)}ensureKey(e,t){let i=this.keyMap.get(e.id);i||(i=new Map,this.keyMap.set(e.id,i));let s=i.get(t);return s||(s={groupId:e.id,editor:t},i.set(t,s)),s}async ensureOpenedEditorsLimit(e,t){if(!this.editorGroupService.partOptions.limit?.enabled||typeof this.editorGroupService.partOptions.limit.value!="number"||this.editorGroupService.partOptions.limit.value<=0)return;const i=this.editorGroupService.partOptions.limit.value;if(this.editorGroupService.partOptions.limit?.perEditorGroup)if(typeof t=="number"){const s=this.editorGroupsContainer.getGroup(t);s&&await this.doEnsureOpenedEditorsLimit(i,s.getEditors(eg.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const s of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,s.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let s;if(this.editorGroupService.partOptions.limit?.excludeDirty?s=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad))):s=t,e>=s.length)return;const o=s.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=s.length-e;const a=new Map;for(const{groupId:c,editor:l}of o){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),r--,r===0)break}for(const[c,l]of a){const d=this.editorGroupsContainer.getGroup(c);d&&await d.closeEditors(l,{preserveFocus:!0})}}saveState(){this.isScoped||(this.mostRecentEditorsMap.isEmpty()?this.storageService.remove(Q3.STORAGE_KEY,ke.WORKSPACE):this.storageService.store(Q3.STORAGE_KEY,JSON.stringify(this.serialize()),ke.WORKSPACE,ln.MACHINE))}serialize(){const e=it.as(zS.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Vi(t.map(({editor:s,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(eg.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(s);if(c!==-1)return{groupId:o,index:c}}))}}async loadState(){(this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService)&&await this.editorGroupService.whenReady;let e=!1;if(!this.isScoped){const t=this.storageService.get(Q3.STORAGE_KEY,ke.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const s=t[i],o=s.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(s,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:s}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(s);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},Q3=KP,KP.STORAGE_KEY="editors.mru",KP);ALe=Q3=D([_(1,ur),_(2,on)],ALe);function H7e(n,e,t){const i=n.get(ur),s=n.get(Re),o=Uei(e,t,i,s);return o instanceof Promise?o.then(r=>U7e(r,e,t,i)):U7e(o,e,t,i)}function U7e(n,e,t,i){let s;return i.activeGroup!==n&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==Cw&&(s=y1.ACTIVATE),[n,s]}function Uei(n,e,t,i){let s;const o=z$(n)?n.editor:n,r=n.options;if(e&&typeof e!="number")s=e;else if(typeof e=="number"&&e>=0)s=t.getGroup(e);else if(e===Cw){const a=w6(i);let c=t.findGroup({direction:a});(!c||wY(c,o))&&(c=t.addGroup(t.activeGroup,a)),s=c}else if(e===Ezt)s=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(gg.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(Vei(c,o)){s=c;break}}if(!s&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||ja(o)&&o.hasCapability(Mi.Singleton))){let c,l;for(const d of a)if(aat(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;s=c||l}}if(!s){let a=t.activeGroup;if(wY(a,o)){for(const c of t.getGroups(gg.MOST_RECENTLY_ACTIVE))if(!wY(c,o)){a=c;break}wY(a,o)?s=t.addGroup(a,w6(i)):s=a}else s=a}return s}function wY(n,e){return!(!n.isLocked||aat(n,e))}function Vei(n,e){return n.activeEditor?n.activeEditor.matches(e):!1}function aat(n,e){for(const t of n.editors)if(t.matches(e))return!0;return!1}var ELe;let xLe=ELe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=s,this.configurationService=o,this.contextService=r,this.uriIdentityService=a,this.editorResolverService=c,this.workspaceTrustRequestService=l,this.hostService=d,this.textEditorService=h,this._onDidActiveEditorChange=this._register(new I),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidVisibleEditorsChange=this._register(new I),this.onDidVisibleEditorsChange=this._onDidVisibleEditorsChange.event,this._onDidEditorsChange=this._register(new I),this.onDidEditorsChange=this._onDidEditorsChange.event,this._onWillOpenEditor=this._register(new I),this.onWillOpenEditor=this._onWillOpenEditor.event,this._onDidCloseEditor=this._register(new I),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onDidOpenEditorFail=this._register(new I),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.lastActiveEditor=void 0,this.activeOutOfWorkspaceWatchers=new wi,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(ALe,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new ELe(e==="main"?this.editorGroupService.mainPart:e,this.editorGroupService,this.instantiationService,this.fileService,this.configurationService,this.contextService,this.uriIdentityService,this.editorResolverService,this.workspaceTrustRequestService,this.hostService,this.textEditorService))}registerListeners(){this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService?this.editorGroupService.whenReady.then(()=>this.onEditorGroupsReady()):this.onEditorGroupsReady(),this._register(this.editorGroupsContainer.onDidChangeActiveGroup(e=>this.handleActiveEditorChange(e))),this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.registerGroupListeners(e))),this._register(this.editorsObserver.onDidMostRecentlyActiveEditorsChange(()=>this._onDidMostRecentlyActiveEditorsChange.fire())),this._register(this.onDidVisibleEditorsChange(()=>this.handleVisibleEditorsChange())),this._register(this.fileService.onDidRunOperation(e=>this.onDidRunFileOperation(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onEditorGroupsReady(){for(const e of this.editorGroupsContainer.groups)this.registerGroupListeners(e);this.activeEditor&&(this.doHandleActiveEditorChangeEvent(),this._onDidVisibleEditorsChange.fire())}handleActiveEditorChange(e){e===this.editorGroupsContainer.activeGroup&&(!this.lastActiveEditor&&!e.activeEditor||this.doHandleActiveEditorChangeEvent())}doHandleActiveEditorChangeEvent(){const e=this.editorGroupsContainer.activeGroup;this.lastActiveEditor=e.activeEditor??void 0,this._onDidActiveEditorChange.fire()}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{this._onDidEditorsChange.fire({groupId:e.id,event:i})})),t.add(e.onDidActiveEditorChange(()=>{this.handleActiveEditorChange(e),this._onDidVisibleEditorsChange.fire()})),t.add(e.onWillOpenEditor(i=>{this._onWillOpenEditor.fire(i)})),t.add(e.onDidCloseEditor(i=>{this._onDidCloseEditor.fire(i)})),t.add(e.onDidOpenEditorFail(i=>{this._onDidOpenEditorFail.fire({editor:i,groupId:e.id})})),T.once(e.onWillDispose)(()=>{St(t)})}handleVisibleEditorsChange(){const e=new o1;for(const t of this.visibleEditors){const i=Tc(Vi([jc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}),jc.getCanonicalUri(t,{supportSideBySide:go.SECONDARY})]),s=>s.toString());for(const s of i)this.fileService.hasProvider(s)&&!this.contextService.isInsideWorkspace(s)&&e.add(s)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(St(this.activeOutOfWorkspaceWatchers.get(t)),this.activeOutOfWorkspaceWatchers.delete(t));for(const t of e.keys())if(!this.activeOutOfWorkspaceWatchers.get(t)){const i=this.fileService.watch(t);this.activeOutOfWorkspaceWatchers.set(t,i)}}async onDidRunFileOperation(e){e.isOperation(Li.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Li.DELETE)||e.isOperation(Li.MOVE))&&this.handleDeletedFile(e.resource,!1,e.target?e.target.resource:void 0)}onDidFilesChange(e){e.gotDeleted()&&this.handleDeletedFile(e,!0)}async handleMovedFile(e,t){for(const i of this.editorGroupsContainer.groups){const s=[];for(const o of i.editors){const r=o.resource;if(!r||!this.uriIdentityService.extUri.isEqualOrParent(r,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,r))a=t;else{const d=GQe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=Qt(t,r.path.substr(d+e.path.length+1))}const c=await o.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(o),sticky:i.isSticky(o),index:i.getIndexOfEditor(o),inactive:!i.isActive(o)};ja(c.editor)?s.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):s.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}s.length&&this.replaceEditors(s,i)}}onConfigurationUpdated(e){if(e&&!e.affectsConfiguration("workbench.editor.closeOnFileDelete"))return;const t=this.configurationService.getValue();typeof t.workbench?.editor?.closeOnFileDelete=="boolean"?this.closeOnFileDelete=t.workbench.editor.closeOnFileDelete:this.closeOnFileDelete=!1}handleDeletedFile(e,t,i){for(const s of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=s.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof mee?r=e.contains(o,Ko.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Ta(100),a=await this.fileService.exists(o)),!a&&!s.isDisposed()&&s.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(s){s.hasCapability(Mi.Untitled)&&!e.includeUntitled||s.isDirty()||t.push(s)}for(const s of this.editors)e.supportSideBySide&&s instanceof _m?(i(s.primary),i(s.secondary)):i(s);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(Ka(t)||ew(t))return t;if(HU(t)&&Ka(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return ew(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(eg.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case eg.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:s})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(s)):this.editorsObserver.editors;case eg.SEQUENTIAL:{const i=[];for(const s of this.editorGroupsContainer.getGroups(gg.GRID_APPEARANCE))i.push(...s.getEditors(eg.SEQUENTIAL,t).map(o=>({editor:o,groupId:s.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Vi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof gxe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const s of i)(Ka(s)||ew(s))&&e.push(s)}return e}get visibleEditors(){return Vi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let s,o=ja(e)?t:e.options,r;if(est(t)&&(i=t),!ja(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===w8.ABORT)return;Zfe(a)&&(s=a.editor,o=a.options,r=a.group)}if(s||(s=ja(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(H7e,{editor:s,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(s,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const s=new Map;for(const r of e){let a,c;if(!z$(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===w8.ABORT)continue;Zfe(d)&&(a=d,c=d.group)}if(a||(a=z$(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(H7e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=s.get(c);l||(l=[],s.set(c,l)),l.push(a)}const o=[];for(const[r,a]of s)o.push(r.openEditors(a));return Vi(await ko.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:s}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case i_.Open:return!0;case i_.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:s}),!1;case i_.Cancel:return!1}}extractEditorResources(e){const t=new o1;let i=!1,s=!1;for(const o of e)if(z$(o)){const r=jc.getOriginalUri(o.editor,{supportSideBySide:go.BOTH});P.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof op)}else Wb(o)&&(P.isUri(o.input1)&&t.add(o.input1.resource),P.isUri(o.input2)&&t.add(o.input2.resource),P.isUri(o.base)&&t.add(o.base.resource),P.isUri(o.result)&&t.add(o.result.resource),s=!0),Gv(o)?(P.isUri(o.original.resource)&&t.add(o.original.resource),P.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):wb(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:s}}isOpened(e){return this.editorsObserver.hasEditor({resource:this.uriIdentityService.asCanonicalUri(e.resource),typeId:e.typeId,editorId:e.editorId})}isVisible(e){for(const t of this.editorGroupsContainer.groups)if(t.activeEditor?.matches(e))return!0;return!1}async closeEditor({editor:e,groupId:t},i){await this.editorGroupsContainer.getGroup(t)?.closeEditor(e,i)}async closeEditors(e,t){const i=new Map;for(const{editor:s,groupId:o}of e){const r=this.editorGroupsContainer.getGroup(o);if(!r)continue;let a=i.get(r);a||(a=[],i.set(r,a)),a.push(s)}for(const[s,o]of i)await s.closeEditors(o,t)}findEditors(e,t,i){const s=P.isUri(e)?e:e.resource,o=P.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==go.ANY&&t?.supportSideBySide!==go.SECONDARY&&!this.editorsObserver.hasEditors(s))return P.isUri(e)||ll(i)?[]:void 0;if(ll(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE)){const c=[];if(P.isUri(e))c.push(...this.findEditors(e,t,a));else{const l=this.findEditors(e,t,a);l&&c.push(l)}r.push(...c.map(l=>({editor:l,groupId:a.id})))}return r}else{const r=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(P.isUri(e))return r?r.findEditors(s,t):[];{if(!r)return;const a=r.findEditors(s,t);for(const c of a)if(c.typeId===o)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,s=[];for(const o of e){let r;if(!ja(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===w8.ABORT)continue;Zfe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:Vze(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:Vze(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),s.push(r)}return i?.replaceEditors(s)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),s=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Mi.Untitled)?o.push({groupId:a,editor:c}):s.push({groupId:a,editor:c});const r=await ko.settled(s.map(({groupId:a,editor:c})=>(t?.reason===Ln.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of o){if(c.isDisposed())continue;const d={pinned:!0,viewState:(await this.openEditor(c,a))?.getViewState()},h=t?.saveAs?await c.saveAs(a,t):await c.save(a,t);if(r.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(Mi.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof cC?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:r.every(a=>!!a),editors:Vi(r)}}saveAll(e){return this.save(this.getAllModifiedEditors(e),e)}async revert(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e);return await ko.settled(i.map(async({groupId:s,editor:o})=>(this.editorGroupsContainer.getGroup(s)?.pinEditor(o),o.revert(s,t)))),!i.some(({editor:s})=>s.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE))for(const s of i.getEditors(eg.MOST_RECENTLY_ACTIVE))s.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&s.hasCapability(Mi.Scratchpad)||!e?.includeUntitled&&s.hasCapability(Mi.Untitled)||e?.excludeSticky&&i.isSticky(s)||t.push({groupId:i.id,editor:s}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:s}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:s});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>St(e)),this.activeOutOfWorkspaceWatchers.clear()}};xLe=ELe=D([_(1,ur),_(2,be),_(3,ci),_(4,Re),_(5,Ti),_(6,_o),_(7,Pz),_(8,Ade),_(9,Id),_(10,rhe)],xLe);function Rt(){throw new Error("unsupported")}var DLe;class zei{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=Rt,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=Rt,this.notifyIndexChanged=Rt,this.relayout=Rt,this.dispose=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=Rt,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=Rt,this.openEditor=Rt,this.openEditors=Rt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt}get groupsView(){return Rt()}notifyLabelChanged(){}get titleHeight(){return Rt()}get element(){return Rt()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}}const dq=new zei;class $ei{constructor(e){this.editor=e,this.onDidChangeControl=T.None,this.onDidChangeSizeConstraints=T.None,this.onDidFocus=T.None,this.onDidBlur=T.None,this.input=void 0,this.options=void 0,this.group=dq,this.scopedContextKeyService=void 0,this.getViewState=Rt,this.isVisible=Rt,this.hasFocus=Rt,this.getId=Rt,this.getTitle=Rt,this.focus=Rt}get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}getControl(){return this.editor}}function Gei(n,e,t){async function i(s,o,r){const a=ja(s)?o:s.options;est(o)&&(r=o);const c=wb(s)||ja(s)?s.resource:void 0;if(c==null||!n.canHandleResource(c))return e(s,o,r);let l;if(l=Lt.get(jt).listCodeEditors().find(h=>h instanceof mF&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(s,o,r);if(h!=null)return h;const u=await n.createModelReference(c);if(l=await t?.(u,a,r===Cw),l==null){u.dispose();return}}return a!=null&&rne(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new $ei(l)}return i}let kLe=class extends xLe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(void 0,i,s,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=Gei(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Lt.get(jt).getFocusedCodeEditor();return e!=null&&e instanceof k1?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};kLe=D([_(2,ur),_(3,be),_(4,ci),_(5,Re),_(6,Ti),_(7,_o),_(8,Pz),_(9,Ade),_(10,Id),_(11,rhe),_(12,Rn)],kLe);class V7e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=T.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=T.None,this.scopedContextKeyService=void 0,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidBlur=this.editor.onDidBlurEditorWidget}getControl(){return this.editor}getViewState(){}isVisible(){return!0}hasFocus(){return this.editor.hasWidgetFocus()}getId(){return this.editor.getId()}getTitle(){}focus(){this.editor.focus()}}let Cre=DLe=class extends ${constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=Rt,this.relayout=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=this.editor.onDidLayoutChange,this.layout=()=>this.editor.layout(),this._onDidModelChange=new I,this.onDidModelChange=this._onDidModelChange.event,this.onWillDispose=this.editor.onDidDispose,this._onDidActiveEditorChange=new I,this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this.onWillCloseEditor=T.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=T.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--DLe.idCounter,this.index=-1,this.label=`standalone editor ${-this.id}`,this.ariaLabel=`standalone editor ${-this.id}`,this.previewEditor=null,this.isLocked=!0,this.stickyCount=0,this.getEditors=()=>this.editors,this.findEditors=a=>this.pane!=null&&a.toString()===this.pane.input.resource.toString()?[this.pane.input]:[],this.getEditorByIndex=a=>this.pane!=null&&a===0?this.pane.input:void 0,this.getIndexOfEditor=a=>this.pane!=null&&this.pane.input===a?0:-1,this.openEditor=async a=>{if(!a.isDisposed()&&a instanceof AM&&a.resource.toString()===this.pane?.input.resource.toString())return this.focus(),this.pane},this.openEditors=async a=>{if(a.length===1)return this.openEditor(a[0].editor)},this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>this.editor.hasWidgetFocus(),this.contains=a=>this.pane!=null&&this.pane.input===a,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt;const s=a=>{const c=t.createInstance(AM,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new V7e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},o=a=>{if(this.pane!=null&&this.pane.input.resource.toString()===a.toString()){const c=this.pane;this.pane=void 0,this._onDidModelChange.fire({kind:6,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:void 0}),this._onDidCloseEditor.fire({context:mx.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&s(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&o(a.uri)}});const r=e.getModel();if(r!=null){const a=t.createInstance(AM,r.uri,void 0,void 0,void 0,void 0);this.pane=new V7e(e,a,this)}}get groupsView(){return Rt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:T.None}}get titleHeight(){return Rt()}setActive(e){this.active=e}get element(){return this.editor.getContainerDomNode()}get activeEditorPane(){return this.pane}get activeEditor(){return this.pane?.input??null}get count(){return this.pane!=null?1:0}get isEmpty(){return this.pane==null}get editors(){return this.pane!=null?[this.pane.input]:[]}focus(){this.editor.focus(),this.editor.getContainerDomNode().scrollIntoView()}};Cre.idCounter=0;Cre=DLe=D([_(1,be),_(2,Pe)],Cre);let ILe=class extends ${constructor(e,t,i){super(),this.delegate=e,this._serviceBrand=void 0,this.additionalGroups=[],this.activeGroupOverride=void 0,this.onDidCreateAuxiliaryEditorPart=this.delegate.onDidCreateAuxiliaryEditorPart,this.onDidChangeGroupMaximized=this.delegate.onDidChangeGroupMaximized,this._onDidChangeActiveGroup=new I,this.onDidChangeActiveGroup=T.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=T.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=T.any(this._onDidRemoveGroup.event,this.delegate.onDidRemoveGroup),this.onDidMoveGroup=this.delegate.onDidMoveGroup,this.onDidActivateGroup=this.delegate.onDidActivateGroup,this.onDidChangeGroupIndex=this.delegate.onDidChangeGroupIndex,this.onDidChangeGroupLocked=this.delegate.onDidChangeGroupLocked,this.getLayout=()=>this.delegate.getLayout(),this.getGroups=s=>[...this.delegate.getGroups(s),...this.additionalGroups],this.getGroup=s=>this.delegate.getGroup(s)??this.additionalGroups.find(o=>o.id===s),this.activateGroup=(...s)=>this.delegate.activateGroup(...s),this.getSize=(...s)=>this.delegate.getSize(...s),this.setSize=(...s)=>this.delegate.setSize(...s),this.arrangeGroups=(...s)=>this.delegate.arrangeGroups(...s),this.applyLayout=(...s)=>this.delegate.applyLayout(...s),this.setGroupOrientation=(...s)=>this.delegate.setGroupOrientation(...s),this.findGroup=(...s)=>this.delegate.findGroup(...s),this.addGroup=(...s)=>this.delegate.addGroup(...s),this.removeGroup=(...s)=>this.delegate.removeGroup(...s),this.moveGroup=(...s)=>this.delegate.moveGroup(...s),this.mergeGroup=(...s)=>this.delegate.mergeGroup(...s),this.mergeAllGroups=(...s)=>this.delegate.mergeAllGroups(...s),this.copyGroup=(...s)=>this.delegate.copyGroup(...s),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const s=Lt.get(jt),o=a=>{if(a instanceof mF){let c;const l=p=>{const m=p!=null?this.additionalGroups.find(v=>v.editor===p):void 0;this.activeGroupOverride!==m&&(this.activeGroupOverride=m,this._onDidChangeActiveGroup.fire(this.activeGroup))},d=p=>{!t&&this.activeGroupOverride===this.additionalGroups.find(m=>m.editor===p)&&l(void 0)},h=()=>{c!=null&&window.clearTimeout(c),l(a)},u=()=>{c!=null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=void 0,d(a)},100)};a.onDidDispose(()=>{d(a)}),a.onDidFocusEditorText(h),a.onDidFocusEditorWidget(h),a.onDidBlurEditorText(u),a.onDidBlurEditorWidget(u),a.hasWidgetFocus()&&h();const f=i.createInstance(Cre,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof mF){const c=this.additionalGroups.find(l=>l.editor===a);c!=null&&(c.dispose(),this.activeGroupOverride===c&&(this.activeGroupOverride=void 0,this._onDidChangeActiveGroup.fire(this.activeGroup)),this.additionalGroups=this.additionalGroups.filter(l=>l!==c),this._onDidRemoveGroup.fire(c))}};this._register(s.onCodeEditorAdd(o)),this._register(s.onCodeEditorRemove(r)),s.listCodeEditors().forEach(o)})}registerContextKeyProvider(e){return this.delegate.registerContextKeyProvider(e)}saveWorkingSet(e){return this.delegate.saveWorkingSet(e)}getWorkingSets(){return this.delegate.getWorkingSets()}applyWorkingSet(e){return this.delegate.applyWorkingSet(e)}deleteWorkingSet(e){return this.delegate.deleteWorkingSet(e)}get isReady(){return this.delegate.isReady}get whenReady(){return this.delegate.whenReady}get whenRestored(){return this.delegate.whenRestored}get hasRestorableState(){return this.delegate.hasRestorableState}get parts(){return this.delegate.parts}createAuxiliaryEditorPart(e){return this.delegate.createAuxiliaryEditorPart(e)}get mainPart(){return this.delegate.mainPart}getPart(e){return this.delegate.getPart(e)}toggleMaximizeGroup(e){return this.delegate.toggleMaximizeGroup(e)}toggleExpandGroup(e){return this.delegate.toggleExpandGroup(e)}createEditorDropTarget(e,t){return this.delegate.createEditorDropTarget(e,t)}get groups(){return[...this.additionalGroups,...this.delegate.groups]}get activeGroup(){return this.activeGroupOverride??this.delegate.activeGroup}get sideGroup(){return this.delegate.sideGroup}get count(){return this.delegate.count+this.additionalGroups.length}get orientation(){return this.delegate.orientation}get partOptions(){return this.delegate.partOptions}};ILe=D([_(2,be)],ILe);var jH;let yre=(jH=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=s,this.workingCopyService=o,this.logService=r,this.markerService=a,this.uriIdentityService=c,this.scheduledAutoSavesAfterDelay=new Map,this.lastActiveEditor=void 0,this.lastActiveGroupId=void 0,this.lastActiveEditorControlDisposable=this._register(new Z),this.waitingOnConditionAutoSaveWorkingCopies=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l));for(const l of this.workingCopyService.dirtyWorkingCopies)this.onDidRegister(l);this.registerListeners()}registerListeners(){this._register(this.hostService.onDidChangeFocus(e=>this.onWindowFocusChange(e))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChange())),this._register(this.editorService.onDidActiveEditorChange(()=>this.onDidActiveEditorChange())),this._register(this.filesConfigurationService.onDidChangeAutoSaveConfiguration(()=>this.onDidChangeAutoSaveConfiguration())),this._register(this.workingCopyService.onDidRegister(e=>this.onDidRegister(e))),this._register(this.workingCopyService.onDidUnregister(e=>this.onDidUnregister(e))),this._register(this.workingCopyService.onDidChangeDirty(e=>this.onDidChangeDirty(e))),this._register(this.workingCopyService.onDidChangeContent(e=>this.onDidChangeContent(e))),this._register(this.markerService.onMarkerChanged(e=>this.onConditionChanged(e,Kf.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Kf.DISABLED)))}onConditionChanged(e,t){for(const i of e){const s=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(s?.condition===t)s.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(s.workingCopy.resource,s.reason).mode!==Vc.OFF&&(this.discardAutoSave(s.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",s.workingCopy.resource.toString(),s.workingCopy.typeId),s.workingCopy.save({reason:s.reason}));else{const o=this.waitingOnConditionAutoSaveEditors.get(i);o?.condition===t&&!o.editor.editor.isDisposed()&&o.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(o.editor.editor,o.reason).mode!==Vc.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${o.reason}`),this.editorService.save(o.editor,{reason:o.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:this.lastActiveGroupId,editor:this.lastActiveEditor});const e=this.editorGroupService.activeGroup,t=this.lastActiveEditor=e.activeEditor??void 0;this.lastActiveGroupId=e.id,this.lastActiveEditorControlDisposable.clear();const i=this.editorService.activeEditorPane;t&&i&&this.lastActiveEditorControlDisposable.add(i.onDidBlur(()=>{this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Mi.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==Vc.OFF?(e===Ln.WINDOW_CHANGE&&(i.mode===Vc.ON_FOCUS_CHANGE||i.mode===Vc.ON_WINDOW_CHANGE)||e===Ln.FOCUS_CHANGE&&i.mode===Vc.ON_FOCUS_CHANGE)&&(this.logService.trace(`[editor auto save] triggering auto save with reason ${e}`),this.editorService.save(t,{reason:e})):t.editor.resource&&(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveEditors.set(t.editor.resource,{editor:t,reason:e,condition:i.reason})}else this.saveAllDirtyAutoSaveables(e)}onDidChangeAutoSaveConfiguration(){let e;switch(this.filesConfigurationService.getAutoSaveMode(void 0).mode){case Vc.ON_FOCUS_CHANGE:e=Ln.FOCUS_CHANGE;break;case Vc.ON_WINDOW_CHANGE:e=Ln.WINDOW_CHANGE;break;case Vc.AFTER_SHORT_DELAY:case Vc.AFTER_LONG_DELAY:e=Ln.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&JS.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==Vc.OFF?t.save({reason:e}):(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(t.resource,{workingCopy:t,reason:e,condition:i.reason})}}onDidRegister(e){e.isDirty()&&this.scheduleAutoSave(e)}onDidUnregister(e){this.discardAutoSave(e)}onDidChangeDirty(e){e.isDirty()?this.scheduleAutoSave(e):this.discardAutoSave(e)}onDidChangeContent(e){e.isDirty()&&this.scheduleAutoSave(e)}scheduleAutoSave(e){if(e.capabilities&JS.Untitled)return;const t=this.filesConfigurationService.getAutoSaveConfiguration(e.resource).autoSaveDelay;if(typeof t!="number")return;this.discardAutoSave(e),this.logService.trace(`[editor auto save] scheduling auto save after ${t}ms`,e.resource.toString(),e.typeId);const i=setTimeout(()=>{if(this.discardAutoSave(e),e.isDirty()){const s=Ln.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,s);o.mode!==Vc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:s})):(o.reason===Kf.ERRORS||o.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:s,condition:o.reason})}},t);this.scheduledAutoSavesAfterDelay.set(e,Ee(()=>{this.logService.trace("[editor auto save] clearing pending auto save",e.resource.toString(),e.typeId),clearTimeout(i)}))}discardAutoSave(e){St(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},jH.ID="workbench.contrib.editorAutoSave",jH);yre=D([_(0,hh),_(1,Id),_(2,_i),_(3,ur),_(4,Pw),_(5,Ze),_(6,U_),_(7,_o)],yre);gp(yre.ID,yre,Sl.BlockRestore);let LLe=class extends pL{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Js.binary}getName(){return this.name}getSize(){return this.size}getMime(){return this.mime}getETag(){return this.etag}async resolve(){if(this.fileService.hasProvider(this.resource)){const e=await this.fileService.stat(this.resource);this.etag=e.etag,typeof e.size=="number"&&(this.size=e.size)}return super.resolve()}};LLe=D([_(2,ci)],LLe);var TLe,ck;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Binary=2]="Binary"})(ck||(ck={}));let Sre=TLe=class extends Ib{get typeId(){return gst}get editorId(){return A_.id}get capabilities(){let e=Mi.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Mi.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(e,t,p,l,h,u,f,v,w),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=ck.None,this.model=void 0,this.cachedTextFileModelReference=void 0,this.modelListeners=this._register(new Z),this.model=this.textFileService.files.get(e),i&&this.setPreferredName(i),s&&this.setPreferredDescription(s),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(b=>this.onDidCreateTextFileModel(b))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){_n(e.resource,this.resource)&&(this.model=e,this.registerModelListeners(e))}registerModelListeners(e){this.modelListeners.clear(),this.modelListeners.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(e.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this.modelListeners.add(e.onDidSaveError(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(T.once(e.onWillDispose)(()=>{this.modelListeners.clear(),this.model=void 0}))}getName(){return this.preferredName||super.getName()}setPreferredName(e){this.allowLabelOverride()&&this.preferredName!==e&&(this.preferredName=e,this._onDidChangeLabel.fire())}allowLabelOverride(){return this.resource.scheme!==this.pathService.defaultUriScheme&&this.resource.scheme!==_e.vscodeUserData&&this.resource.scheme!==_e.file&&this.resource.scheme!==_e.vscodeRemote}getPreferredName(){return this.preferredName}isReadonly(){return this.model?this.model.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}getDescription(e){return this.preferredDescription||super.getDescription(e)}setPreferredDescription(e){this.allowLabelOverride()&&this.preferredDescription!==e&&(this.preferredDescription=e,this._onDidChangeLabel.fire())}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getEncoding(){return this.model?this.model.getEncoding():this.preferredEncoding}getPreferredEncoding(){return this.preferredEncoding}async setEncoding(e,t){return this.setPreferredEncoding(e),this.model?.setEncoding(e,t)}setPreferredEncoding(e){this.preferredEncoding=e,this.setForceOpenAsText()}getLanguageId(){return this.model?this.model.getLanguageId():this.preferredLanguageId}getPreferredLanguageId(){return this.preferredLanguageId}setLanguageId(e,t){this.setPreferredLanguageId(e),this.model?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e,this.setForceOpenAsText()}setPreferredContents(e){this.preferredContents=e,this.setForceOpenAsText()}setForceOpenAsText(){this.forceOpenAs=ck.Text}setForceOpenAsBinary(){this.forceOpenAs=ck.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(uu.SAVED)||this.model?.hasState(uu.CONFLICT)||this.model?.hasState(uu.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===ck.Binary?e.find(t=>t.typeId===P5t):e.find(t=>t.typeId===ust)}resolve(e){return this.forceOpenAs===ck.Binary?this.doResolveAsBinary():this.doResolveAsText(e)}async doResolveAsText(e){try{const t=this.preferredContents;this.preferredContents=void 0,await this.textFileService.files.resolve(this.resource,{languageId:this.preferredLanguageId,encoding:this.preferredEncoding,contents:typeof t=="string"?hde(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===ck.Text,reason:Zte.EDITOR,limits:this.ensureLimits(e)}),this.cachedTextFileModelReference||(this.cachedTextFileModelReference=await this.textModelService.createModelReference(this.resource));const i=this.cachedTextFileModelReference.object;return this.isDisposed()&&this.disposeModelReference(),i}catch(t){if(t.textFileOperationResult===xV.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(LLe,this.preferredResource,this.getName());return await e.resolve(),e}isResolved(){return!!this.model}async rename(e,t){return{editor:{resource:t,encoding:this.getEncoding(),options:{viewState:qW(this,e,this.editorService)}}}}toUntyped(e){const t={resource:this.preferredResource,forceFile:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=(()=>{const i=this.textFileService.files.get(this.resource);if(i?.isDirty()&&!i.textEditorModel.isTooLargeForHeapOperation())return i.textEditorModel.getValue()})(),t.options={...t.options,viewState:qW(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof TLe?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Sre=TLe=D([_(7,be),_(8,tr),_(9,Rn),_(10,eo),_(11,ci),_(12,hh),_(13,_i),_(14,Tm),_(15,dl),_(16,aD)],Sre);it.as(zS.EditorFactory).registerFileEditorFactory({typeId:gst,createFileEditor:(n,e,t,i,s,o,r,a)=>a.createInstance(Sre,n,e,t,i,s,o,r),isFileEditor:n=>n instanceof Sre});function qei(n,e){const t=n.lastFocusedList,i=t?.getHTMLElement();if(i&&kw(i)&&t instanceof Fc){const s=Vi(t.getSelectedElements().filter(c=>c instanceof tne)),o=t.getFocusedElements(),r=o.length?o[0]:void 0;let a;return r instanceof tne&&(a=r),s.some(c=>c===a)?s:a?[a]:void 0}}const fme="vs/workbench/contrib/files/browser/fileCommands";async function GOe(n,e){const t=n.get(yf),i=n.get(ur),s=n.get(jt),o=n.get(tr);let r=qei(t);if(!r){const c=i.activeGroup;c.activeEditor&&(r=[],c.activeEditor instanceof _m&&!e?.saveAs&&!(c.activeEditor.primary.hasCapability(Mi.Untitled)||c.activeEditor.secondary.hasCapability(Mi.Untitled))&&c.activeEditor.secondary.isModified()?(r.push({groupId:c.id,editor:c.activeEditor.primary}),r.push({groupId:c.id,editor:c.activeEditor.secondary})):r.push({groupId:c.id,editor:c.activeEditor}))}if(!r||r.length===0)return;await qOe(n,r,e);const a=s.getFocusedCodeEditor();if(a instanceof oC&&!a.isSimpleWidget){const c=a.getModel()?.uri;c&&!r.some(({editor:l})=>_n(jc.getCanonicalUri(l,{supportSideBySide:go.PRIMARY}),c))&&(o.files.get(c)?.isReadonly()||await o.save(c,e))}}function cat(n,e,t){const i=[];for(const s of e)for(const o of s.getEditors(eg.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:s.id,editor:o});return qOe(n,i,t)}async function qOe(n,e,t){const i=n.get(_i),s=n.get(Pi),o=n.get(be);try{await i.save(e,t)}catch(r){Na(r)||s.notify({id:e.map(({editor:a})=>Ed(a.resource?.toString())).join(),severity:nt.Error,message:g(fme,3,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Ma(r,!1)),actions:{primary:[_l({id:"workbench.action.files.saveEditors",label:g(fme,4,"Retry"),run:()=>o.invokeFunction(a=>qOe(a,e,t))}),_l({id:"workbench.action.files.revertEditors",label:g(fme,5,"Discard"),run:()=>i.revert(e)})]}})}}xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyS,id:FOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:Br(V.CtrlCmd|E.KeyK,E.KeyS),win:{primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|V.Shift|E.KeyS)},id:OOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0,skipSaveParticipants:!0})});xr.registerCommandAndKeybindingRule({id:POt,weight:ye.WorkbenchContrib,when:void 0,primary:V.CtrlCmd|V.Shift|E.KeyS,handler:n=>GOe(n,{reason:Ln.EXPLICIT,saveAs:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:void 0,mac:{primary:V.CtrlCmd|V.Alt|E.KeyS},win:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyS)},id:BOt,handler:n=>cat(n,n.get(ur).getGroups(gg.MOST_RECENTLY_ACTIVE),{reason:Ln.EXPLICIT})});yt.registerCommand({id:rit,handler:(n,e,t)=>{const i=n.get(ur),s=c3t(t,n.get(yf),n.get(ur));let o;return s.length?o=Vi(s.map(r=>i.getGroup(r.groupId))):o=i.getGroups(gg.MOST_RECENTLY_ACTIVE),cat(n,o,{reason:Ln.EXPLICIT})}});yt.registerCommand({id:WOt,handler:async n=>(await n.get(_i).saveAll({includeUntitled:!1,reason:Ln.EXPLICIT})).success});class Qei{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=Rt,this.isLayoutCentered=Rt,this.enforcePartOptions=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.applyLayout=Rt,this.getLayout=Rt,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}class jei{constructor(){this.registerContextKeyProvider=Rt,this.saveWorkingSet=Rt,this.getWorkingSets=Rt,this.applyWorkingSet=Rt,this.deleteWorkingSet=Rt,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new Qei,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=Rt,this.createAuxiliaryEditorPart=Rt,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.partOptions=Kde,this.createEditorDropTarget=Rt,this._serviceBrand=void 0,this.getLayout=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.applyLayout=Rt,this.centerLayout=Rt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}let RLe=class extends ILe{constructor(e){super(e.createInstance(jei),!0,e)}};RLe=D([_(0,be)],RLe);function Kei(n){return{[jt.toString()]:new Gi(yLe,void 0,!0),[_i.toString()]:new Gi(kLe,[n,()=>!1],!0),[rhe.toString()]:new Gi(SLe,[],!1),[ur.toString()]:new Gi(RLe)}}const Yei="vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions",lat={category:Be(Yei,0,"Snippets")};class dat extends pi{constructor(e){super({...lat,...e})}}class hat extends wf{constructor(e){super({...lat,...e})}}const lu="vs/workbench/contrib/snippets/browser/commands/configureSnippets";var MLe;(function(n){function e(t){return!!t&&P.isUri(t.filepath)}n.is=e})(MLe||(MLe={}));async function Jei(n,e,t,i){const s=[],o=[],r=new Set,a=new Map;for(const l of await n.getSnippetFiles())if(l.source!==Yg.Extension)if(l.isGlobalSnippets){await l.load();const d=new Set;let h;e:for(const m of l.data){h||(h=m.source);for(const v of m.scopes){const w=t.getLanguageName(v);if(w)if(d.size>=4){d.add(`${w}...`);break e}else d.add(w)}}const u={label:ui(l.location),filepath:l.location,description:d.size===0?g(lu,0,"(global)"):g(lu,1,"({0})",[...d].join(", "))};if(s.push(u),!h)continue;const f=g(lu,2,"({0}) {1}",h,i.getUriLabel(l.location,{relative:!0})),p=a.get(ui(l.location));p&&(u.detail=f,p.snippet.detail=p.detail),a.set(ui(l.location),{snippet:u,detail:f})}else{const d=ui(l.location).replace(/\.json$/,"");s.push({label:ui(l.location),description:`(${t.getLanguageName(d)})`,filepath:l.location}),r.add(d)}const c=e.currentProfile.snippetsHome;for(const l of t.getRegisteredLanguageIds()){const d=t.getLanguageName(l);d&&!r.has(l)&&o.push({label:l,description:`(${d})`,filepath:Qt(c,`${l}.json`),hint:!0})}return s.sort((l,d)=>{const h=T_(l.filepath.path),u=T_(d.filepath.path);return h===u?l.label.localeCompare(d.label):h===".code-snippets"?-1:1}),o.sort((l,d)=>l.label.localeCompare(d.label)),{existing:s,future:o}}async function z7e(n,e,t,i,s,o){function r(l){const d=T_(l)!==".code-snippets"?`${l}.code-snippets`:l;return Qt(e,d)}await i.createFolder(e);const a=await t.input({placeHolder:g(lu,3,"Type snippet file name"),async validateInput(l){if(!l)return g(lu,4,"Invalid file name");if(!VQe(l))return g(lu,5,"'{0}' is not a valid file name",l);if(await i.exists(r(l)))return g(lu,6,"'{0}' already exists",l)}});if(!a)return;const c=r(a);await s.write(c,["{"," // Place your "+n+" snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and "," // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope "," // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is "," // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: "," // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. "," // Placeholders with the same ids are connected."," // Example:",' // "Print to console": {',' // "scope": "javascript,typescript",',' // "prefix": "log",',' // "body": [',` // "console.log('$1');",`,' // "$2"'," // ],",' // "description": "Log output to console"'," // }","}"].join(` -`)),await o.open(c)}async function Xei(n,e,t){if(await e.exists(n.filepath))return;const i=["{"," // Place your snippets for "+n.label+" here. Each snippet is defined under a snippet name and has a prefix, body and "," // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:"," // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the "," // same ids are connected."," // Example:",' // "Print to console": {',' // "prefix": "log",',' // "body": [',` // "console.log('$1');",`,' // "$2"'," // ],",' // "description": "Log output to console"'," // }","}"].join(` -`);await t.write(n.filepath,i)}class Zei extends dat{constructor(){super({id:"workbench.action.openSnippets",title:Be(lu,7,"Configure User Snippets"),shortTitle:{...Be(lu,8,"User Snippets"),mnemonicTitle:g(lu,9,"User &&Snippets")},f1:!0,menu:[{id:Te.MenubarPreferencesMenu,group:"2_configuration",order:5},{id:Te.GlobalActivity,group:"2_configuration",order:5}]})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(fr),o=e.get(Di),r=e.get(Rm),a=e.get(Ti),c=e.get(ci),l=e.get(tr),d=e.get(eo),h=await Jei(t,r,o,d),u=h.existing,f=[{scope:g(lu,10,"global"),label:g(lu,11,"New Global Snippets file..."),uri:r.currentProfile.snippetsHome}],p=[];for(const v of a.getWorkspace().folders)p.push({scope:g(lu,12,"{0} workspace",v.name),label:g(lu,13,"New Snippets file for '{0}'...",v.name),uri:v.toResource(".vscode")});u.length>0?(u.unshift({type:"separator",label:g(lu,14,"Existing Snippets")}),u.push({type:"separator",label:g(lu,15,"New Snippets")})):u.push({type:"separator",label:g(lu,15,"New Snippets")});const m=await i.pick([].concat(u,f,p,h.future),{placeHolder:g(lu,16,"Select Snippets File or Create Snippets"),matchOnDescription:!0});if(f.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(p.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(MLe.is(m))return m.hint&&await Xei(m,c,l),s.open(m.filepath)}}const $7e="vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets",l9=class l9 extends dat{constructor(){super({id:l9.Id,title:Be($7e,0,"Fill File with Snippet"),f1:!0})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(_i),o=e.get(Di),r=_z(s.activeTextEditorControl);if(!r||!r.hasModel())return;const a=await t.getSnippets(void 0,{fileTemplateSnippets:!0,noRecencySort:!0,includeNoPrefixSnippets:!0});if(a.length===0)return;const c=await this._pick(i,o,a);c&&r.hasModel()&&(mc.get(r)?.apply([{range:r.getModel().getFullModelRange(),template:c.snippet.body}]),r.getModel().setLanguage(o.createById(c.langId),l9.Id),r.focus())}async _pick(e,t,i){const s=[];for(const c of i)if(iO(c.scopes))s.push({langId:"",snippet:c});else for(const l of c.scopes)s.push({langId:l,snippet:c});const o=[],r=yU(s,(c,l)=>lw(c.langId,l.langId));for(const c of r){let l=!0;for(const d of c)l&&(o.push({type:"separator",label:t.getLanguageName(d.langId)??d.langId}),l=!1),o.push({snippet:d,label:d.snippet.prefix||d.snippet.name,detail:d.snippet.description})}return(await e.pick(o,{placeHolder:g($7e,1,"Select a snippet"),matchOnDetail:!0}))?.snippet}};l9.Id="workbench.action.populateFileFromSnippet";let Are=l9;const PL="vs/workbench/contrib/snippets/browser/snippetPicker";async function uat(n,e){const t=n.get($_),i=n.get(On);let s;Array.isArray(e)?s=e:s=await t.getSnippets(e,{includeDisabledSnippets:!0,includeNoPrefixSnippets:!0}),s.sort((c,l)=>c.snippetSource-l.snippetSource);const o=()=>{const c=[];let l;for(const d of s){const h={label:d.prefix||d.name,detail:d.description||d.body,snippet:d};if(!l||l.snippetSource!==d.snippetSource||l.source!==d.source){let u="";switch(d.snippetSource){case Yg.User:u=g(PL,0,"User Snippets");break;case Yg.Extension:u=d.source;break;case Yg.Workspace:u=g(PL,1,"Workspace Snippets");break}c.push({type:"separator",label:u})}d.snippetSource===Yg.Extension&&(t.isEnabled(d)?h.buttons=[{iconClass:$e.asClassName(Ce.eyeClosed),tooltip:g(PL,2,"Hide from IntelliSense")}]:(h.description=g(PL,3,"(hidden from IntelliSense)"),h.buttons=[{iconClass:$e.asClassName(Ce.eye),tooltip:g(PL,4,"Show in IntelliSense")}])),c.push(h),l=d}return c},r=i.createQuickPick();r.placeholder=g(PL,5,"Select a snippet"),r.matchOnDetail=!0,r.ignoreFocusOut=!1,r.keepScrollPosition=!0,r.onDidTriggerItemButton(c=>{const l=t.isEnabled(c.item.snippet);t.updateEnablement(c.item.snippet,!l),r.items=o()}),r.items=o(),r.items.length||(r.validationMessage=g(PL,6,"No snippet available")),r.show(),await Promise.race([T.toPromise(r.onDidAccept),T.toPromise(r.onDidHide)]);const a=r.selectedItems[0]?.snippet;return r.dispose(),a}const eti="vs/workbench/contrib/snippets/browser/commands/insertSnippet",vW=class vW{static fromUser(e){if(!e||typeof e!="object")return vW._empty;let{snippet:t,name:i,langId:s}=e;return typeof t!="string"&&(t=void 0),typeof i!="string"&&(i=void 0),typeof s!="string"&&(s=void 0),new vW(t,i,s)}constructor(e,t,i){this.snippet=e,this.name=t,this.langId=i}};vW._empty=new vW(void 0,void 0,void 0);let NLe=vW;class tti extends hat{constructor(){super({id:"editor.action.insertSnippet",title:Be(eti,0,"Insert Snippet"),f1:!0,precondition:X.writable,metadata:{description:"Insert Snippet",args:[{name:"args",schema:{type:"object",properties:{snippet:{type:"string"},langId:{type:"string"},name:{type:"string"}}}}]}})}async runEditorCommand(e,t,i){const s=e.get(Di),o=e.get($_);if(!t.hasModel())return;const r=e.get(Mu),a=e.get(be),c=await new Promise((d,h)=>{const{lineNumber:u,column:f}=t.getPosition(),{snippet:p,name:m,langId:v}=NLe.fromUser(i);if(p)return d(new nFe(!1,[],"","","",p,"",Yg.User,`random/${Math.random()}`));let w;if(v){if(!s.isRegisteredLanguageId(v))return d(void 0);w=v}else t.getModel().tokenization.tokenizeIfCheap(u),w=t.getModel().getLanguageIdAtPosition(u,f),s.getLanguageName(w)||(w=t.getModel().getLanguageId());m?o.getSnippets(w,{includeNoPrefixSnippets:!0}).then(b=>b.find(C=>C.name===m)).then(d,h):d(a.invokeFunction(uat,w))});if(!c)return;let l;c.needsClipboard&&(l=await r.readText()),t.focus(),mc.get(t)?.insert(c.codeSnippet,{clipboardText:l}),o.updateUsageTimestamp(c)}}const iti="vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet";async function gat(n,e,t,i){const{lineNumber:s,column:o}=t;e.tokenization.tokenizeIfCheap(s);const r=e.getLanguageIdAtPosition(s,o);return(await n.getSnippets(r,{includeNoPrefixSnippets:!0,includeDisabledSnippets:i})).filter(c=>c.usesSelection)}const fle=class fle extends hat{constructor(){super({...fle.options,precondition:ge.and(X.writable,X.hasNonEmptySelection),f1:!0})}async runEditorCommand(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get($_),o=e.get(Mu),r=await gat(s,t.getModel(),t.getPosition(),!0);if(!r.length)return;const a=await i.invokeFunction(uat,r);if(!a)return;let c;a.needsClipboard&&(c=await o.readText()),t.focus(),mc.get(t)?.insert(a.codeSnippet,{clipboardText:c}),s.updateUsageTimestamp(a)}};fle.options={id:"editor.action.surroundWithSnippet",title:Be(iti,0,"Surround with Snippet...")};let hq=fle;var VX,zX;const Ere="vs/workbench/contrib/snippets/browser/snippetCodeActionProvider";var X0;let PLe=(X0=class{constructor(e){this._snippetService=e}async provideCodeActions(e,t){if(t.isEmpty())return;const i=mt.isISelection(t)?t.getPosition():t.getStartPosition(),s=await gat(this._snippetService,e,i,!1);if(!s.length)return;const o=[];for(const r of s){if(o.length>=VX._MAX_CODE_ACTIONS){o.push(VX._overflowCommandCodeAction);break}o.push({title:g(Ere,1,"{0}",r.name),kind:ls.SurroundWith.value,edit:fat(e,t,r)})}return{actions:o,dispose(){}}}},VX=X0,X0._MAX_CODE_ACTIONS=4,X0._overflowCommandCodeAction={kind:ls.SurroundWith.value,title:g(Ere,0,"More..."),command:{id:hq.options.id,title:hq.options.title.value}},X0);PLe=VX=D([_(0,$_)],PLe);var Z0;let FLe=(Z0=class{constructor(e){this._snippetService=e,this.providedCodeActionKinds=[ls.SurroundWith.value]}async provideCodeActions(e){if(e.getValueLength()!==0)return;const t=await this._snippetService.getSnippets(e.getLanguageId(),{fileTemplateSnippets:!0,includeNoPrefixSnippets:!0}),i=[];for(const s of t){if(i.length>=zX._MAX_CODE_ACTIONS){i.push(zX._overflowCommandCodeAction);break}i.push({title:g(Ere,3,"Start with: {0}",s.name),kind:ls.SurroundWith.value,edit:fat(e,e.getFullModelRange(),s)})}return{actions:i,dispose(){}}}},zX=Z0,Z0._MAX_CODE_ACTIONS=4,Z0._overflowCommandCodeAction={title:g(Ere,2,"Start with Snippet"),kind:ls.SurroundWith.value,command:{id:Are.Id,title:""}},Z0);FLe=zX=D([_(0,$_)],FLe);function fat(n,e,t){return{edits:[{versionId:n.getVersionId(),resource:n.uri,textEdit:{range:e,text:t.body,insertAsSnippet:!0}}]}}let OLe=class{constructor(e,t,i){this._store=new Z;const s="editor.snippets.codeActions.enabled",o=new Z,r=()=>{o.clear(),i.getValue(s)&&(o.add(t.codeActionProvider.register("*",e.createInstance(PLe))),o.add(t.codeActionProvider.register("*",e.createInstance(FLe))))};r(),this._store.add(i.onDidChangeConfiguration(a=>a.affectsConfiguration(s)&&r())),this._store.add(o)}dispose(){this._store.dispose()}};OLe=D([_(0,be),_(1,ht),_(2,Re)],OLe);const cS="vs/workbench/contrib/snippets/browser/snippets.contribution";At(tti);yt.registerCommandAlias("editor.action.showSnippets","editor.action.insertSnippet");At(hq);At(Are);At(Zei);const nti=it.as(pf.Workbench);nti.registerWorkbenchContribution(OLe,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.snippets.codeActions.enabled":{description:g(cS,0,"Controls if surround-with-snippets or file template snippets show as Code Actions."),type:"boolean",default:!0}}});const pat="vscode://schemas/snippets",mat={prefix:{description:g(cS,1,"The prefix to use when selecting the snippet in intellisense"),type:["string","array"]},isFileTemplate:{description:g(cS,2,"The snippet is meant to populate or replace a whole file"),type:"boolean"},body:{markdownDescription:g(cS,3,"The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`."),type:["string","array"],items:{type:"string"}},description:{description:g(cS,4,"The snippet description."),type:["string","array"]}},sti={id:pat,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{prefix:"${2:prefix}",body:"${3:snippet}",description:"${4:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:mat,additionalProperties:!1}},_at="vscode://schemas/global-snippets",oti={id:_at,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{scope:"${2:scope}",prefix:"${3:prefix}",body:"${4:snippet}",description:"${5:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:{...mat,scope:{description:g(cS,7,"A list of language names to which this snippet applies, e.g. 'typescript,javascript'."),type:"string"}},additionalProperties:!1}},vat=it.as(eL.JSONContribution);vat.registerSchema(pat,sti);vat.registerSchema(_at,oti);P4t(async n=>{n.get(mg).when(2).then(()=>{Lt.get($_)})});function rti(){return{...dOe(),[$_.toString()]:new Gi(Bye,[],!0)}}var BLe,YP;let WLe=(YP=class extends ZU{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:BLe.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new sd,this.profileStorageProfile=this.userDataProfileService.currentProfile,this.profileStorageDisposables=this._register(new Z),this.workspaceStorageDisposables=this._register(new Z),this.registerListeners()}registerListeners(){this._register(this.userDataProfileService.onDidChangeCurrentProfile(e=>e.join(this.switchToProfile(e.profile))))}async doInitialize(){await ko.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await M8.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new fx(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.APPLICATION,t))),await this.applicationStorage.init(),this.updateIsNew(this.applicationStorage),this.applicationStoragePromise.complete({indexedDb:e,storage:this.applicationStorage})}async createProfileStorage(e){if(this.profileStorageDisposables.clear(),this.profileStorageProfile=e,Cbe(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(s=>this.emitDidChangeValue(ke.PROFILE,s)))}else{const t=await M8.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new fx(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(ke.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await M8.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new fx(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(pJ);t===void 0?e.set(pJ,!0):t&&e.set(pJ,!1)}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return this.applicationStorageDatabase?.name;case ke.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=ws(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,ws(this.profileStorage),ke.PROFILE)}async switchToWorkspace(e,t){const i=ws(this.workspaceStorage),s=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(s,ws(this.workspaceStorage),ke.WORKSPACE)}shouldFlushWhenIdle(){return ax().document.hasFocus()&&!this.hasPendingUpdate}close(){TS&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE]){for(const t of[ln.USER,ln.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await ko.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return ZJe(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},BLe=YP,YP.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,YP);WLe=BLe=D([_(2,Ze)],WLe);class ati extends fJ{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const jm=class jm extends ${static async createApplicationStorage(e){return jm.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return jm.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return jm.create({id:e},t)}static async create(e,t){try{const i=new jm(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Ma(i,!0)}`),new ati}}get hasPendingUpdate(){return!!this.pendingUpdate}constructor(e,t){super(),this.logService=t,this._onDidChangeItemsExternal=this._register(new I),this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event,this.pendingUpdate=void 0,this.name=`${jm.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new nOe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{ADt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await PT.create(this.name,void 0,[jm.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Ma(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(jm.STORAGE_OBJECT_STORE,t)}async updateItems(e){let t=!1;this.pendingUpdate=this.doUpdateItems(e);try{t=await this.pendingUpdate}finally{this.pendingUpdate=void 0}if(this.broadcastChannel&&t){const i={changed:e.insert,deleted:e.delete};this.broadcastChannel.postData(i)}}async doUpdateItems(e){const t=e.insert,i=e.delete;return!t&&!i||t?.size===0&&i?.size===0?!1:(await(await this.whenConnected).runInTransaction(jm.STORAGE_OBJECT_STORE,"readwrite",o=>{const r=[];if(t)for(const[a,c]of t)r.push(o.put(c,a));if(i)for(const a of i)r.push(o.delete(a));return r}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(jm.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};jm.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",jm.STORAGE_OBJECT_STORE="ItemTable";let M8=jm;var NC;const cti=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var JP;let xre=(JP=class extends ${static toKey(e){return`extensionKeys/${lte(e.id)}@${e.version}`}static fromKey(e){const t=cti.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),s=[];for(const[o,r]of NC.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>gc(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&s.push(NC.toKey({id:o,version:c}))}for(const o of s)t.remove(o,ke.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(ke.PROFILE,ln.MACHINE);for(const s of i){const o=NC.fromKey(s);if(o){let r=t.get(o.id.toLowerCase());r||t.set(o.id.toLowerCase(),r=[]),r.push(o.version)}}return t}constructor(e,t,i){super(),this.storageService=e,this.productService=t,this.logService=i,this._onDidChangeExtensionStorageToSync=this._register(new I),this.onDidChangeExtensionStorageToSync=this._onDidChangeExtensionStorageToSync.event,this.extensionsWithKeysForSync=NC.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this._register(new Z))(s=>this.onDidChangeStorageValue(s)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=NC.fromKey(e.key);if(t){if(this.storageService.get(e.key,ke.PROFILE)===void 0)this.extensionsWithKeysForSync.delete(t.id.toLowerCase());else{let i=this.extensionsWithKeysForSync.get(t.id.toLowerCase());i||this.extensionsWithKeysForSync.set(t.id.toLowerCase(),i=[]),i.push(t.version),this._onDidChangeExtensionStorageToSync.fire()}return}}getExtensionId(e){if($t(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return _F(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),s=this.getExtensionStateRaw(e,t);if(s)try{return JSON.parse(s)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),s=this.storageService.get(i,t?ke.PROFILE:ke.WORKSPACE);return s&&s?.length>NC.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${s.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),s}setExtensionState(e,t,i){const s=this.getExtensionId(e);t===void 0?this.storageService.remove(s,i?ke.PROFILE:ke.WORKSPACE):this.storageService.store(s,JSON.stringify(t),i?ke.PROFILE:ke.WORKSPACE,ln.MACHINE)}setKeysForSync(e,t){this.storageService.store(NC.toKey(e),JSON.stringify(t),ke.PROFILE,ln.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(NC.toKey(e),ke.PROFILE),s=i?JSON.parse(i):void 0;return s&&t?Tc([...s,...t]):s||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(s=>!s.includes(e)&&!s.includes(t));i.push([e,t]),this.migrationList=i}}getSourceExtensionToMigrate(e){const t=this.migrationList.find(([,i])=>e===i);return t?t[0]:void 0}get migrationList(){const e=this.storageService.get("extensionStorage.migrationList",ke.APPLICATION,"[]");try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return[]}set migrationList(e){e.length?this.storageService.store("extensionStorage.migrationList",JSON.stringify(e),ke.APPLICATION,ln.MACHINE):this.storageService.remove("extensionStorage.migrationList",ke.APPLICATION)}},NC=JP,JP.LARGE_STATE_WARNING_THRESHOLD=512*1024,JP);xre=NC=D([_(0,on),_(1,Xa),_(2,Ze)],xre);var N8;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(N8||(N8={}));class pme extends fx{constructor(e,t){const i=t.read(e);if(super(new lti(e,t,i)),i!=null)for(const[s,o]of i)this.items.set(s,o)}}class lti{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??T.None}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t)),await this.provider.write(this.scope,this.items)}async close(){return this.provider.close?.(this.scope)}async optimize(){return this.provider.optimize?.(this.scope)}}class dti extends ZU{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new pme(N8.APPLICATION,this.provider)),this.profileStorage=this._register(new pme(N8.PROFILE,this.provider)),this.workspaceStorage=this._register(new pme(N8.WORKSPACE,this.provider)),this._register(this.workspaceStorage.onDidChangeStorage(i=>this.emitDidChangeValue(1,i))),this._register(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(0,i))),this._register(this.applicationStorage.onDidChangeStorage(i=>this.emitDidChangeValue(-1,i)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case-1:return"External (application)";case 0:return"External (profile)";default:return"External (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(e){return!1}get(e,t,i){return this.getStorage(t).get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t).getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t).getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t).getObject(e,this.fallbackOverride?.[e]??i)}}zFe(async n=>{const e=n.get(on),t=n.get(Id);e instanceof ZU&&(await e.initialize(),t.onDidChangeFocus(i=>{i||e.flush()}))});let HLe=class extends WLe{constructor(e,t,i){super(UFe(),t,i),this.fallbackOverride=e}get(e,t,i){return this.getStorage(t)?.get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,this.fallbackOverride?.[e]??i)}};HLe=D([_(1,Rm),_(2,Ze)],HLe);function hti({customProvider:n,fallbackOverride:e}={}){return n!=null?{[on.toString()]:new Gi(dti,[n,e],!0),[B7.toString()]:new Gi(xre,[],!0)}:{[on.toString()]:new Gi(HLe,[e],!0),[B7.toString()]:new Gi(xre,[],!0)}}class uti{constructor(){this._systemSchemes=new Set(Object.keys(_e)),this._providerInfo=new Map,this.extUri=new cO(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&es.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const Kz=ae("IExtHostFileSystemInfo");var PC;let ULe=PC=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new oMe,this._proxy=e.getProxy(Ue.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(s){try{let o;const r=i._fileSystemProvider.get(s.scheme);return r?(await i._proxy.$ensureActivation(s.scheme),o=await r.impl.stat(s)):o=await i._proxy.$stat(s),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===wm.Readonly?1:void 0}}catch(o){PC._handleError(o)}},async readDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readDirectory(s)).slice()):await i._proxy.$readdir(s)}catch(o){return PC._handleError(o)}},async createDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(o.impl,o.extUri,s)):await i._proxy.$mkdir(s)}catch(o){return PC._handleError(o)}},async readFile(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readFile(s)).slice()):(await i._proxy.$readFile(s)).buffer}catch(o){return PC._handleError(o)}},async writeFile(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(s)),await i._writeQueue.queueFor(s,()=>Promise.resolve(r.impl.writeFile(s,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(s,ze.wrap(o))}catch(r){return PC._handleError(r)}},async delete(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(s.scheme),await r.impl.delete(s,{recursive:!1,...o})):await i._proxy.$delete(s,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return PC._handleError(r)}},async rename(s,o,r){try{return await i._proxy.$rename(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},async copy(s,o,r){try{return await i._proxy.$copy(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},isWritableFileSystem(s){const o=t.getCapabilities(s);if(typeof o=="number")return!(o&es.Readonly)}})}async mkdirp(e,t,i){const s=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&an.Directory))throw Wl.FileExists(`Unable to create folder '${i.scheme===_e.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(w1(o)!==rt.FileNotFound)throw o;s.push(t.basename(i)),i=t.dirname(i)}for(let o=s.length-1;o>=0;o--){i=t.joinPath(i,s[o]);try{await e.createDirectory(i)}catch(r){if(w1(r)!==rt.FileExists)throw r}}}static _handleError(e){if(e instanceof Wl)throw e;if(e instanceof Nx)switch(e.code){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}if(!(e instanceof Error))throw new Wl(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Wl.Unavailable(e.message);switch(e.name){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?Fn:Gle,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Fn}};ULe=PC=D([_(0,gr),_(1,Kz)],ULe);const fue=ae("IExtHostConsumerFileSystem");class wat extends ude{get disposed(){return this._disposed}constructor(e,t,i,s,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=s,this.extension=o,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(r=>this.setLevel(r)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+` -`)}append(e){this.info(e)}clear(){const e=this.offset;this.logger.flush(),this.proxy.$update(this.id,aH.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,aH.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e=="boolean"?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=ze.fromString(t).byteLength,see(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,aH.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class gti extends wat{appendLine(e){this.append(e)}}let VLe=class{constructor(e,t,i,s,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=s,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Ue.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${Lnt(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(const[t,i]of this.channels)i.visible=t===this.visibleChannelId}createOutputChannel(e,t,i){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");const s=typeof t=="object"&&t.log,o=$t(t)?t:void 0;if($t(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Cn.equals(i.identifier,l))?.[1];a&&(r=TYe(a));const c=s?this.doCreateLogOutputChannel(e,r,i):this.doCreateOutputChannel(e,o,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),s?this.createExtHostLogOutputChannel(e,r??this.logService.getLevel(),c):this.createExtHostOutputChannel(e,c)}async doCreateOutputChannel(e,t,i){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));const s=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(s,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),r=this.loggerService.createLogger(o,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,o,t,i.identifier.value);return new wat(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const s=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(s,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new gti(a,e,c,this.proxy,i)}createExtensionLogDirectory(e){let t=this.extensionLogDirectoryPromise.get(e.identifier.value);if(!t){const i=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,e.identifier.value);this.extensionLogDirectoryPromise.set(e.identifier.value,t=(async()=>{try{await this.extHostFileSystem.value.createDirectory(i)}catch(s){if(w1(s)!==rt.FileExists)throw s}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const s=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){s(),t.then(r=>r.append(o))},appendLine(o){s(),t.then(r=>r.appendLine(o))},clear(){s(),t.then(o=>o.clear())},replace(o){s(),t.then(r=>r.replace(o))},show(o,r){s(),t.then(a=>a.show(o,r))},hide(){s(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const s=new Z,o=()=>{if(s.isDisposed)throw new Error("Channel has been closed")},r=s.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{s.add(c),c.logLevel!==t&&a(c.logLevel),s.add(c.onDidChangeLogLevel(l=>a(l)))}),{...this.createExtHostOutputChannel(e,i),get logLevel(){return t},onDidChangeLogLevel:r.event,trace(c,...l){o(),i.then(d=>d.trace(c,...l))},debug(c,...l){o(),i.then(d=>d.debug(c,...l))},info(c,...l){o(),i.then(d=>d.info(c,...l))},warn(c,...l){o(),i.then(d=>d.warn(c,...l))},error(c,...l){o(),i.then(d=>d.error(c,...l))},dispose(){s.dispose()}}}};VLe=D([_(0,gr),_(1,Sg),_(2,fue),_(3,Kz),_(4,wp),_(5,Ze)],VLe);const bat=ae("IExtHostOutputService"),pue=ae("IURITransformerService");class fti{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}const pti="vs/workbench/api/common/extHostWorkspace";function uq(n,e,t){return new cO(i=>QOe(i,t)).isEqual(n,e)}function mti(n,e,t){return uq(n.uri,e.uri,t)?0:lw(n.uri.toString(),e.uri.toString())}function _ti(n,e,t){return n.index!==e.index?n.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return UL(s,o,(r,a)=>t(r,a,i))}function QOe(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&es.PathCaseSensitive)}class lH extends kJe{static toExtHostWorkspace(e,t,i,s){if(!e)return{workspace:null,added:[],removed:[]};const{id:o,name:r,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,w)=>{const b=P.revive(v.uri),C=lH._findFolder(i||t,b,s);C?(C.name=v.name,C.index=v.index,h.push(C)):h.push({uri:b,name:v.name,index:w})}):h.push(...a.map(({uri:v,name:w,index:b})=>({uri:P.revive(v),name:w,index:b}))),h.sort((v,w)=>v.indexQOe(v,s)),{added:p,removed:m}=Cat(u?u.workspaceFolders:[],f.workspaceFolders,mti,s);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let s=0;snew Cde(c)),s,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Su.forUris(a),i.forEach(c=>{this._workspaceFolders.push(c),this._structure.set(c.uri,c)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=ma(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let zLe=class{constructor(e,t,i,s,o){this._onDidChangeWorkspace=new I,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new I,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new EI,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new dSt,this._barrier=new Uh,this._proxy=e.getProxy(Ue.MainThreadWorkspace),this._messageService=e.getProxy(Ue.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new lH(r.id,r.name,[],!!r.transient,r.configuration?P.revive(r.configuration):null,!!r.isUntitled,a=>QOe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?P.from({scheme:_e.untitled,path:ui(ma(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...s){const o=[];if(Array.isArray(s)&&s.forEach(d=>{P.isUri(d.uri)&&!o.some(h=>uq(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||Mx(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&o.length===0)return!1;const r=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>r.length)return!1;const a=r.slice(0);a.splice(t,i,...o.map(d=>({uri:d.uri,name:d.name||Mx(d.uri),index:void 0})));for(let d=0;df!==d&&uq(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=Cat(r,a,_ti,this._extHostFileSystemInfo);if(c.length===0&&l.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,o).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(nt.Error,g(pti,0,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,s="";if(typeof e=="string"?(i=P.file(e),s=e):typeof e<"u"&&(i=e,s=e.fsPath),!i)return s;const o=this.getWorkspaceFolder(i,!0);if(!o)return s;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=lO(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=lH.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:s}=lH.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:s}))}findFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${s.value}, entryPoint: findFiles`);let r="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?r=t:r=t.pattern),this._findFilesImpl(e,void 0,{exclude:r,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},o)}findFiles2(e,t={},i,s=qe.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,s)}async _findFilesImpl(e,t,i,s=qe.None){if(s&&s.isCancellationRequested)return Promise.resolve([]);const o=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,r={ignoreSymlinks:typeof i.followSymlinks=="boolean"?!i.followSymlinks:void 0,disregardIgnoreFiles:typeof i.useIgnoreFiles=="boolean"?!i.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof i.useGlobalIgnoreFiles=="boolean"?!i.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof i.useParentIgnoreFiles=="boolean"?!i.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof i.useDefaultExcludes=="boolean"?!i.useDefaultExcludes:!1,disregardSearchExcludeSettings:typeof i.useDefaultSearchExcludes=="boolean"?!i.useDefaultSearchExcludes:!1,maxResults:i.maxResults,excludePattern:o,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=mme(Zp.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=mme(Zp.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,s).then(c=>Array.isArray(c)?c.map(l=>P.revive(l)):[])}async findTextInFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${s.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=mme(Zp.from(t.include)),d=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,h={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:a,afterContext:t.afterContext,beforeContext:t.beforeContext,includePattern:c,excludePattern:d};if(this._activeSearchCallbacks[r]=u=>{const f=P.revive(u.resource);u.results.forEach(p=>{const m=Or(p);q8t(m)?i({uri:f,preview:{text:m.preview.text,matches:u9(m.preview.matches,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:u9(m.ranges,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},o.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,r,o);return delete this._activeSearchCallbacks[r],u||{}}catch(u){throw delete this._activeSearchCallbacks[r],u}}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return P.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return P.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(s,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(s)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(P.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;const o=await s.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,s){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(P.revive(e));if(!o){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",o);const r=this._editSessionIdentityProviders.get(o.uri.scheme);if(this._logService.info(`Provider for scheme ${o.uri.scheme} is defined: `,!!r),!r)return;const a=await r.provideEditSessionIdentityMatch?.(t,i,s);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,s)}}async $onWillCreateEditSessionIdentity(e,t,i){const s=await this.resolveWorkspaceFolder(P.revive(e));if(s===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:s},t,async(o,r)=>{const a=Date.now();await Promise.resolve(o),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",r.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(s,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(s)})}async provideCanonicalUri(e,t,i){const s=this._canonicalUriProviders.get(e.scheme);if(!s)return;const o=await s.provideCanonicalUri?.(P.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(P.revive(e),{targetScheme:t},i)}};zLe=D([_(0,gr),_(1,Sg),_(2,Kz),_(3,Ze),_(4,pue)],zLe);const dD=ae("IExtHostWorkspace");function mme(n){let e,t;return n&&(typeof n=="string"?e=n:(e=n.pattern,t=P.revive(n.baseUri))),{includePattern:e,folder:t}}var j3,e1;let $Le=(e1=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Ue.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=j3._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const s=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=Kb(o);if(r.length<=j3._maxEventSize){this._proxy.$onDidChange(i,r);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,r.length);const a=r.map(d=>({uri:d,rank:Tlt(d.path,"/")})),c=yU(a,(d,h)=>d.rank-h.rank||lw(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=lS(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=j3._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new oo(()=>{s?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const s=Object.create(null),{provider:o,extensionDescription:r}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(o.provideFileDecoration(P.revive(c),i));if(!d)return;try{sG.validate(d),d.badge&&typeof d.badge!="string"&&Je(r,"codiconDecoration"),s[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${r.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),s}},j3=e1,e1._handlePool=0,e1._maxEventSize=250,e1);$Le=j3=D([_(0,gr),_(1,Ze)],$Le);const yat=ae("IExtHostDecorations");function z5(n,e){if(e){const t=e.split(".");let i=n;for(let s=0;i&&sthis._actual)}$initializeConfiguration(e){this._actual=new yti(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};GLe=D([_(0,gr),_(1,dD),_(2,Ze)],GLe);class yti{constructor(e,t,i,s){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=f7.parse(i,s),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=f7.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=G7e(t)||{},o=this._toReadonlyValue(e?z5(this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,s,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?Ot.USER:Ot.WORKSPACE;switch(c){case PM.Global:return Ot.USER;case PM.Workspace:return Ot.WORKSPACE;case PM.WorkspaceFolder:return Ot.WORKSPACE_FOLDER}}const a={has(c){return typeof z5(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,s,i?.identifier);let d=z5(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(fo(f)){let m;const v=()=>{h=h||Vs(o),m=m||z5(h,p)};return new Proxy(f,{get:(w,b)=>{if(typeof b=="string"&&b.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||z5(h,p),m[b];const C=w[b];return typeof b=="string"?u(C,`${p}.${b}`):C},set:(w,b,C)=>(v(),m&&(m[b]=C),!0),deleteProperty:(w,b)=>(v(),m&&delete m[b],!0),defineProperty:(w,b,C)=>(v(),m&&Object.defineProperty(m,b,C),!0)})}return Array.isArray(f)?Vs(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=r(d);return l!==void 0?this._proxy.$updateConfigurationOption(u,c,l,s,h):this._proxy.$removeConfigurationOption(u,c,s,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,s,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:Vs(l.policy?.value??l.default?.value),globalValue:Vs(l.user?.value??l.application?.value),workspaceValue:Vs(l.workspace?.value),workspaceFolderValue:Vs(l.workspaceFolder?.value),defaultLanguageValue:Vs(l.default?.override),globalLanguageValue:Vs(l.user?.override??l.application?.override),workspaceLanguageValue:Vs(l.workspace?.override),workspaceFolderLanguageValue:Vs(l.workspaceFolder?.override),languageIds:Vs(l.overrideIdentifiers)}}};return typeof o=="object"&&Sm(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>fo(i)?new Proxy(i,{get:(s,o)=>t(s[o]),set:(s,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(s,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(s,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:s=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const s=dp.test(e)?ut.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(ut.RESOURCE===s){typeof t?.resource>"u"&&this._logService.warn(`${o}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(ut.WINDOW===s){t?.resource&&this._logService.warn(`${o}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new ENe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,o)=>i.affectsConfiguration(s,G7e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const hD=ae("IExtHostConfiguration"),FL=(n,e,t,i)=>{let s=e;return{enumerable:!0,configurable:!1,get(){return s},set(o){if(!t(s,o)){const r=s;s=o,n.listener?.(i(o,r))}}}},cB=(n,e)=>n===e,yD={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:cB,description:cB,sortText:cB,busy:cB,error:cB,canResolveChildren:cB,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},lB=n=>e=>({op:Mh.SetProp,update:n(e)}),Sti=(n,e)=>({range:(()=>{let t;const i=lB(s=>({range:O.lift(at.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:Mh.DocumentSynced}),yD.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:FL(n,e,yD.label,lB(t=>({label:t}))),description:FL(n,void 0,yD.description,lB(t=>({description:t}))),sortText:FL(n,void 0,yD.sortText,lB(t=>({sortText:t}))),canResolveChildren:FL(n,!1,yD.canResolveChildren,t=>({op:Mh.UpdateCanResolveChildren,state:t})),busy:FL(n,!1,yD.busy,lB(t=>({busy:t}))),error:FL(n,void 0,yD.error,lB(t=>({error:Qs.fromStrict(t)||null}))),tags:FL(n,[],yD.tags,(t,i)=>({op:Mh.SetTags,new:t.map(hC.from),old:i.map(hC.from)}))}),Ati=n=>{const e=bn.fromString(n.extId),t=new MO(e.controllerId,e.localId,n.label,P.revive(n.uri)||void 0);return t.range=at.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>hC.to({id:nrt(i).tagId})),t},q7e=n=>{let e;for(const t of n.tests){const i=Ati(t.item);oue(i).parent=e,e=i}return e};class MO{constructor(e,t,i,s){if(t.includes(qf.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=lKt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:s,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof jOe?void 0:o.parent}},children:{value:cKt(o,oue,MO),enumerable:!0,writable:!1},...Sti(o,i)})}}class jOe extends MO{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Eti extends oKt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:oue,getChildren:s=>s.children,root:new jOe(e,t),toITestItem:J1.from})}}const xti="vs/workbench/api/common/extHostTelemetry";let qLe=class extends ${constructor(e,t){super(),this.initData=e,this.loggerService=t,this._onDidChangeTelemetryEnabled=this._register(new I),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new I),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=sp.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=P.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:_Tt,name:g(xti,0,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{kYe(i)&&this.updateLoggerVisibility()})),this._outputLogger.info("Below are logs for extension telemetry events sent to the telemetry output channel API once the log level is set to trace."),this._outputLogger.info("===========================================================")}updateLoggerVisibility(){this.loggerService.setVisibility(this.extHostTelemetryLogFile,this._telemetryIsSupported&&this.loggerService.getLogLevel()===Pn.Trace)}getTelemetryConfiguration(){return this._level===sp.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=sp.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=sp.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=sp.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),o=new Sat(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:s.isUsageEnabled,isErrorsEnabled:s.isErrorsEnabled}),r=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...r,o]),o.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._telemetryIsSupported=t,this._productConfig=i??{usage:!0,error:!0},this.updateLoggerVisibility()}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.isnewappinstall"]=Aat(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case yw.Web:t["common.uikind"]="web";break;case yw.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=Wde(bTt(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,s)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(s):this._telemetryLoggers.set(s,o)}),this._telemetryLoggers.forEach(i=>{for(const s of i)s.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails()),this.updateLoggerVisibility()}onExtensionError(e,t){const s=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!s)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of s)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};qLe=D([_(0,Sg),_(1,wp)],qLe);class Sat{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,s,o,r,a){this._extension=i,this._logger=s,this._inLoggingOnlyMode=o,this._commonProperties=r,this._onDidChangeEnableStates=new I,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=mVe(t,[]),this._additionalCommonProperties&&(t=Sm(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=Sm(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},s=mVe(i,[]),o=new Error(s.message,{cause:s.cause});o.stack=s.stack,o.name=s.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(o,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function Aat(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const mue=ae("IExtHostTelemetry");var KA,bq,Cq,zqe;let QLe=(zqe=class{constructor(e,t,i){kt(this,KA);kt(this,bq);kt(this,Cq);this._commands=new Map,this._apiCommands=new Map,st(this,KA,e.getProxy(Ue.MainThreadCommands)),this._logService=t,st(this,Cq,i),st(this,bq,e.getProxy(Ue.MainThreadTelemetry)),this.converter=new Dti(this,s=>{const o=this._apiCommands.get(s);return o?.result===In.Void?o:void 0},t),this._argumentProcessors=[{processArgument(s){return Or(s)}},{processArgument(s){return AU(s,function(o){if(O.isIRange(o))return at.to(o);if(oe.isIPosition(o))return Wr.to(o);if(O.isIRange(o.range)&&P.isUri(o.uri))return P_.to(o);if(o instanceof ze)return o.buffer.buffer;if(!Array.isArray(o))return o})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const s=e.args.map((r,a)=>{if(!r.validate(i[a]))throw new Error(`Invalid argument '${r.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return r.convert(i[a])}),o=await this.executeCommand(e.internalId,...s);return e.result.convert(o,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new oo(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,s,o,r){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:s,metadata:o,extension:r}),e&&se(this,KA).$registerCommand(t),new oo(()=>{this._commands.delete(t)&&e&&se(this,KA).$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return se(this,KA).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let s=!1;const o=AU(t,function(r){if(r instanceof Ps)return Wr.from(r);if(r instanceof rs)return at.from(r);if(r instanceof _p)return P_.from(r);if(rS.isNotebookRange(r))return ES.from(r);if(r instanceof ArrayBuffer)return s=!0,ze.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return s=!0,ze.wrap(r);if(r instanceof ze)return s=!0,r;if(!Array.isArray(r))return r});try{const r=await se(this,KA).$executeCommand(e,s?new $h(o):o,i);return Or(r)}catch(r){if(r instanceof Error&&r.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw r}}}async _executeContributedCommand(e,t,i){const s=this._commands.get(e);if(!s)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=s;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),s)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),se(this,KA).$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:s}=i;s&&(e[t]=s)}return Promise.resolve(e)}},KA=new WeakMap,bq=new WeakMap,Cq=new WeakMap,zqe);QLe=D([_(0,gr),_(1,Ze),_(2,mue)],QLe);const Yz=ae("IExtHostCommands");class Dti{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Dr()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const s=this._lookupApiCommand(e.command);if(s)i.id=s.internalId,i.arguments=s.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(mo(e.arguments)){const o=`${e.command} /${++this._cachIdPool}`;this._cache.set(o,e),t.add(Ee(()=>{this._cache.delete(o),this._logService.trace("CommandsConverter#DISPOSE",o)})),i.$ident=o,i.id=this.delegatingCommandId,i.arguments=[o],this._logService.trace("CommandsConverter#CREATE",e.command,o)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const Dc=class Dc{static Arr(e){return new Dc(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,s){this.name=e,this.description=t,this.validate=i,this.convert=s}optional(){return new Dc(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new Dc(e??this.name,t??this.description,this.validate,this.convert)}};Dc.Uri=new Dc("uri","Uri of a text document",e=>P.isUri(e),e=>e),Dc.Position=new Dc("position","A position in a text document",e=>Ps.isPosition(e),Wr.from),Dc.Range=new Dc("range","A range in a text document",e=>rs.isRange(e),at.from),Dc.Selection=new Dc("selection","A selection in a text document",e=>XS.isSelection(e),ZS.from),Dc.Number=new Dc("number","",e=>typeof e=="number",e=>e),Dc.String=new Dc("string","",e=>typeof e=="string",e=>e),Dc.StringArray=Dc.Arr(Dc.String),Dc.CallHierarchyItem=new Dc("item","A call hierarchy item",e=>e instanceof $he,KF.from),Dc.TypeHierarchyItem=new Dc("item","A type hierarchy item",e=>e instanceof qhe,$M.from),Dc.TestItem=new Dc("testItem","A VS Code TestItem",e=>e instanceof MO,J1.from);let Et=Dc;const ple=class ple{constructor(e,t){this.description=e,this.convert=t}};ple.Void=new ple("no result",e=>e);let In=ple;class Vn{constructor(e,t,i,s,o){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=o}}const jLe=new Map;function kti(n,e){e?jLe.set(n,e):jLe.delete(n)}function Iti(n){return jLe.get(n)}class Lti extends Yje{constructor(e,t,i,s,o,r,a){super(t,i,s,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){sm(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return Ls(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===_e.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===` -`?jv.LF:jv.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,i){return e._getWordRangeAtPosition(t,i)}}}return Object.freeze(this._document)}_acceptLanguageId(e){sm(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){sm(!this._isDisposed),this._isDirty=e}_save(){return this._isDisposed?Promise.reject(new Error("Document has been closed")):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){const t=this._validateRange(e);if(t.isEmpty)return"";if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);const i=this._eol,s=t.start.line,o=t.end.line,r=[];r.push(this._lines[s].substring(t.start.character));for(let a=s+1;a=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new Tti(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return new Ps(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof rs))throw new Error("Invalid argument");const t=this._validatePosition(e.start),i=this._validatePosition(e.end);return t===e.start&&i===e.end?e:new rs(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof Ps))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,s=!1;if(t<0)t=0,i=0,s=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,s=!0;else{const o=this._lines[t].length;i<0?(i=0,s=!0):i>o&&(i=o,s=!0)}return s?new Ps(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=Iti(this._languageId);else if(YRe(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const s=a1(i.character+1,zq(t),this._lines[i.line],0);if(s)return new rs(i.line,s.startColumn-1,i.line,s.endColumn-1)}}class Tti{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return new rs(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new rs(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}}const mle=class mle{constructor(e,t,i){const s=mle._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,s,Zke.from(i)),this.value=Object.freeze({key:s,dispose(){e.$removeTextEditorDecorationType(s)}})}};mle._Keys=new yz("TextEditorDecorationType");let KLe=mle;class Rti{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw new Error("Edit is only valid while callback runs")}replace(e,t){this._throwIfFinalized();let i=null;if(e instanceof Ps)i=new rs(e,e);else if(e instanceof rs)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new rs(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof rs)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const s=this._document.validateRange(e);this._collectedEdits.push({range:s,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==jv.LF&&e!==jv.CRLF)throw Ui("endOfLine");this._setEndOfLine=e}}class Mti{constructor(e,t,i,s){this._proxy=e,this._id=t,this._accept(i),this._logService=s;const o=this;this.value={get tabSize(){return o._tabSize},set tabSize(r){o._setTabSize(r)},get indentSize(){return o._indentSize},set indentSize(r){o._setIndentSize(r)},get insertSpaces(){return o._insertSpaces},set insertSpaces(r){o._setInsertSpaces(r)},get cursorStyle(){return o._cursorStyle},set cursorStyle(r){o._setCursorStyle(r)},get lineNumbers(){return o._lineNumbers},set lineNumbers(r){o._setLineNumbers(r)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=oH.to(e.lineNumbers)}_validateTabSize(e){if(e==="auto")return"auto";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){const t=this._validateTabSize(e);if(t!==null){if(typeof t=="number"){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError("setTabSize",this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e==="tabSize")return"tabSize";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){const t=this._validateIndentSize(e);if(t!==null){if(typeof t=="number"){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError("setIndentSize",this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e==="auto"?"auto":e==="false"?!1:!!e}_setInsertSpaces(e){const t=this._validateInsertSpaces(e);if(typeof t=="boolean"){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError("setInsertSpaces",this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError("setCursorStyle",this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError("setLineNumbers",this._proxy.$trySetOptions(this._id,{lineNumbers:oH.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const s=this._validateTabSize(e.tabSize);s==="auto"?(i=!0,t.tabSize=s):typeof s=="number"&&this._tabSize!==s&&(this._tabSize=s,i=!0,t.tabSize=s)}if(typeof e.indentSize<"u"){const s=this._validateIndentSize(e.indentSize);s==="tabSize"?(i=!0,t.indentSize=s):typeof s=="number"&&this._originalIndentSize!==s&&(this._indentSize=s,this._originalIndentSize=s,i=!0,t.indentSize=s)}if(typeof e.insertSpaces<"u"){const s=this._validateInsertSpaces(e.insertSpaces);s==="auto"?(i=!0,t.insertSpaces=s):this._insertSpaces!==s&&(this._insertSpaces=s,i=!0,t.insertSpaces=s)}typeof e.cursorStyle<"u"&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,i=!0,t.cursorStyle=e.cursorStyle),typeof e.lineNumbers<"u"&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,i=!0,t.lineNumbers=oH.from(e.lineNumbers)),i&&this._warnOnError("setOptions",this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(i=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(i)})}}class Nti{constructor(e,t,i,s,o,r,a,c){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=o,this._options=new Mti(this._proxy,this.id,r,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return s.value},set document(d){throw new cR("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof XS))throw Ui("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof XS)))throw Ui("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new cR("visibleRanges")},get options(){return l._options.value},set options(d){l._disposed||l._options.assign(d)},get viewColumn(){return l._viewColumn},set viewColumn(d){throw new cR("viewColumn")},edit(d,h={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#edit not possible on closed editors"));const u=new Rti(s.value,h);return d(u),l._applyEdit(u)},insertSnippet(d,h,u={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#insertSnippet not possible on closed editors"));let f;if(!h||Array.isArray(h)&&h.length===0)f=l._selections.map(p=>at.from(p));else if(h instanceof Ps){const{lineNumber:p,column:m}=Wr.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof rs)f=[at.from(h)];else{f=[];for(const p of h)if(p instanceof rs)f.push(at.from(p));else{const{lineNumber:m,column:v}=Wr.from(p);f.push({startLineNumber:m,startColumn:v,endLineNumber:m,endColumn:v})}}return t.$tryInsertSnippet(e,s.value.version,d.value,f,u)},setDecorations(d,h){const u=h.length===0;u&&!l._hasDecorationsForKey.has(d.key)||(u?l._hasDecorationsForKey.delete(d.key):l._hasDecorationsForKey.add(d.key),l._runOnProxy(()=>{if(ort(h))return t.$trySetDecorations(e,d.key,uKt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,at.from(d),h||U6.Default))},show(d){t.$tryShowEditor(e,yd.from(d))},hide(){t.$tryHideEditor(e)}})}dispose(){sm(!this._disposed),this._disposed=!0}_acceptOptions(e){sm(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){sm(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){sm(!this._disposed),this._viewColumn=e}_acceptSelections(e){sm(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(ZS.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){const t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);const i=t.edits.map(o=>o.range);i.sort((o,r)=>o.end.line===r.end.line?o.end.character===r.end.character?o.start.line===r.start.line?o.start.character-r.start.character:o.start.line-r.start.line:o.end.character-r.end.character:o.end.line-r.end.line);for(let o=0,r=i.length-1;o({range:at.from(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,s,{setEndOfLine:typeof t.setEndOfLine=="number"?R4.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn("TextEditor is closed/disposed"),Promise.resolve(void 0)):e().then(()=>this,t=>(t instanceof Error&&t.name==="DISPOSED"||this._logService.warn(t),null))}}class Pti{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let YLe=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new wi,this._onDidAddDocuments=new I,this._onDidRemoveDocuments=new I,this._onDidChangeVisibleTextEditors=new I,this._onDidChangeActiveTextEditor=new I,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){const t=[],i=[],s=[];if(e.removedDocuments)for(const o of e.removedDocuments){const r=P.revive(o),a=this._documents.get(r);a?.unref()&&(this._documents.delete(r),t.push(a.value))}if(e.addedDocuments)for(const o of e.addedDocuments){const r=P.revive(o.uri);let a=this._documents.get(r);if(a&&r.scheme!==_e.vscodeNotebookCell&&r.scheme!==_e.vscodeInteractiveInput)throw new Error(`document '${r} already exists!'`);a||(a=new Pti(new Lti(this._extHostRpc.getProxy(Ue.MainThreadDocuments),r,o.lines,o.EOL,o.versionId,o.languageId,o.isDirty)),this._documents.set(r,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const o of e.removedEditors){const r=this._editors.get(o);this._editors.delete(o),r&&s.push(r)}if(e.addedEditors)for(const o of e.addedEditors){const r=P.revive(o.documentUri);sm(this._documents.has(r),`document '${r}' does not exist`),sm(!this._editors.has(o.id),`editor '${o.id}' already exists!`);const a=this._documents.get(r).value,c=new Nti(o.id,this._extHostRpc.getProxy(Ue.MainThreadTextEditors),this._logService,new Ya(()=>a.document),o.selections.map(ZS.to),o.options,o.visibleRanges.map(l=>at.to(l)),typeof o.editorPosition=="number"?yd.to(o.editorPosition):void 0);this._editors.set(o.id,c)}e.newActiveEditor!==void 0&&(sm(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),St(t),St(s),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(o=>o.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return fi.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;const t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};YLe=D([_(0,gr),_(1,Ze)],YLe);const oj=ae("IExtHostDocumentsAndEditors"),Fti="vs/workbench/api/common/extHostTerminalService",Jz=ae("IExtHostTerminalService");class Q7e extends ${constructor(e,t,i,s){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=s,this._disposed=!1,this._state={isInteractedWith:!1},this.isOpen=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(r=>this._pidPromiseComplete=r);const o=this;this.value={get name(){return o._name||""},get processId(){return o._pidPromise},get creationOptions(){return o._creationOptions},get exitStatus(){return o._exitStatus},get state(){return o._state},get selection(){return o._selection},get shellIntegration(){return o.shellIntegration},sendText(r,a=!0){o._checkDisposed(),o._proxy.$sendText(o._id,r,a)},show(r){o._checkDisposed(),o._proxy.$show(o._id,r)},hide(){o._checkDisposed(),o._proxy.$hide(o._id)},dispose(){o._disposed||(o._disposed=!0,o._proxy.$dispose(o._id))},get dimensions(){if(!(o._cols===void 0||o._rows===void 0))return{columns:o._cols,rows:o._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!="string")throw new Error("Terminal has already been created");await this._proxy.$createTerminal(this._id,{name:e.name,shellPath:e.shellPath??void 0,shellArgs:e.shellArgs??void 0,cwd:e.cwd??t?.cwd??void 0,env:e.env??void 0,icon:Eat(e.iconPath)??void 0,color:OU.isThemeColor(e.color)?e.color.id:void 0,initialText:e.message??void 0,strictEnv:e.strictEnv??void 0,hideFromUser:e.hideFromUser??void 0,forceShellIntegration:t?.forceShellIntegration??void 0,isFeatureTerminal:t?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:t?.useShellEnvironment??void 0,location:t?.location||this._serializeParentTerminal(e.location,t?.resolvedExtHostIdentifier),isTransient:e.isTransient??void 0})}async createExtensionTerminal(e,t,i,s,o){if(typeof this._id!="string")throw new Error("Terminal has already been created");if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:s,color:OU.isThemeColor(o)?o.id:void 0,location:t?.location||this._serializeParentTerminal(e,i),isTransient:!0}),typeof this._id=="string")throw new Error("Terminal creation failed");return this._id}_serializeParentTerminal(e,t){return typeof e=="object"?"parentTerminal"in e&&e.parentTerminal&&t?{parentTerminal:t}:"viewColumn"in e?{viewColumn:yd.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw new Error("Terminal has already been disposed")}set name(e){this._name=e}setExitStatus(e,t){this._exitStatus=Object.freeze({code:e,reason:t})}setDimensions(e,t){return e===this._cols&&t===this._rows||e===0||t===0?!1:(this._cols=e,this._rows=t,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={isInteractedWith:!0},!0)}setSelection(e){this._selection=e}_setProcessId(e){this._pidPromiseComplete?(this._pidPromiseComplete(e),this._pidPromiseComplete=void 0):this._pidPromise.then(t=>{t!==e&&(this._pidPromise=Promise.resolve(e))})}}class _me{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new I,this.onProcessData=this._onProcessData.event,this._onProcessReady=new I,this._onDidChangeProperty=new I,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new I,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw new Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw new Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve("")}getCwd(){return Promise.resolve("")}startSendingEvents(e){this._pty.onDidWrite(t=>this._onProcessData.fire(t)),this._pty.onDidClose?.((t=void 0)=>{this._onProcessExit.fire(t===void 0?void 0:t)}),this._pty.onDidOverrideDimensions?.(t=>{t&&this._onDidChangeProperty.fire({type:jf.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:jf.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let Oti=1,JLe=class extends ${get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,i){super(),this._extHostCommands=t,this._terminals=[],this._terminalProcesses=new Map,this._terminalProcessDisposables={},this._extensionTerminalAwaitingStart={},this._getTerminalPromises={},this._environmentVariableCollections=new Map,this._lastQuickFixCommands=this._register(new Dn),this._linkProviders=new Set,this._profileProviders=new Map,this._quickFixProviders=new Map,this._terminalLinkCache=new Map,this._terminalLinkCancellationSource=new Map,this._onDidCloseTerminal=new I,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new I,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new I,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new I,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new I,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new I,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new I({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new I({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=i.getProxy(Ue.MainThreadTerminalService),this._bufferer=new urt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:s=>{const o=r=>{const a=r;return this.getTerminalById(a.instanceId)?.value};switch(s?.$mid){case Fs.TerminalContext:return o(s);default:{if(Array.isArray(s))for(let r=0;r{for(const[s,o]of this._terminalProcesses)o.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||""}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){const i=new Q7e(this._proxy,Dr(),e,e.name),s=new _me(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Eat(e.iconPath),Wti(e.color)).then(o=>{const r=this._setupExtHostProcessListeners(o,s);this._terminalProcessDisposables[o]=r}),this._terminals.push(i),i.value}_serializeParentTerminal(e,t){if(t=t||{},e.location&&typeof e.location=="object"&&"parentTerminal"in e.location){const i=e.location.parentTerminal;if(i){const s=this._terminals.find(o=>o.value===i);s&&(t.resolvedExtHostIdentifier=s._id)}}else e.location&&typeof e.location!="object"?t.location=e.location:t.location&&typeof t.location=="object"&&"splitActiveTerminal"in t.location&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw new Error(`Cannot resolve terminal with id ${e} for virtual process`);const s=new _me(t),o=this._setupExtHostProcessListeners(e,s);this._terminalProcessDisposables[e]=o}async $acceptActiveTerminalChanged(e){const t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}const i=this.getTerminalById(e);i&&(this._activeTerminal=i,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){const i=this.getTerminalById(e);i&&this._onDidWriteTerminalData.fire({terminal:i.value,data:t})}async $acceptTerminalDimensions(e,t,i){const s=this.getTerminalById(e);s&&s.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:s.value,dimensions:s.value.dimensions})}async $acceptDidExecuteCommand(e,t){const i=this.getTerminalById(e);i&&this._onDidExecuteCommand.fire({terminal:i.value,...t})}async $acceptTerminalMaximumDimensions(e,t,i){this._terminalProcesses.get(e)?.resize(t,i)}async $acceptTerminalTitleChange(e,t){const i=this.getTerminalById(e);i&&(i.name=t)}async $acceptTerminalClosed(e,t,i){const s=this._getTerminalObjectIndexById(this._terminals,e);if(s!==null){const o=this._terminals.splice(s,1)[0];o.setExitStatus(t,i),this._onDidCloseTerminal.fire(o.value)}}$acceptTerminalOpened(e,t,i,s){if(t){const a=this._getTerminalObjectIndexById(this._terminals,t);if(a!==null){this._terminals[a]._id=e,this._onDidOpenTerminal.fire(this.terminals[a]),this._terminals[a].isOpen=!0;return}}const o={name:s.name,shellPath:s.executable,shellArgs:s.args,cwd:typeof s.cwd=="string"?s.cwd:P.revive(s.cwd),env:s.env,hideFromUser:s.hideFromUser},r=new Q7e(this._proxy,e,o,i);this._terminals.push(r),this._onDidOpenTerminal.fire(r.value),r.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){const i=this.getTerminalById(e);if(!i)return{message:g(Fti,0,"Could not find the terminal with id {0} on the extension host",e)};i.isOpen||await new Promise(o=>{const r=this.onDidOpenTerminal(async a=>{a===i.value&&(r.dispose(),o())})});const s=this._terminalProcesses.get(e);s?s.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){const i=new Z;i.add(t.onProcessReady(o=>this._proxy.$sendProcessReady(e,o.pid,o.cwd,o.windowsPty))),i.add(t.onDidChangeProperty(o=>this._proxy.$sendProcessProperty(e,o))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(o=>this._onProcessExit(e,o))),this._terminalProcesses.set(e,t);const s=this._extensionTerminalAwaitingStart[e];return s&&t instanceof _me&&(t.startSendingEvents(s.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),i}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){const t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,i){try{this._terminalProcesses.get(e)?.resize(t,i)}catch(s){if(s.code!=="EPIPE"&&s.code!=="ERR_IPC_CHANNEL_CLOSED")throw s}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:jf.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:jf.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new oo(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}registerProfileProvider(e,t,i){if(this._profileProviders.has(t))throw new Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,i),this._proxy.$registerProfileProvider(t,e.identifier.value),new oo(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalQuickFixProvider(e,t,i){if(this._quickFixProviders.has(e))throw new Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,i),this._proxy.$registerQuickFixProvider(e,t),new oo(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ai().token;if(i.isCancellationRequested)return;const s=this._quickFixProviders.get(e);if(!s)return;const o=await s.provideTerminalQuickFixes(t,i);if(o===null||Array.isArray(o)&&o.length===0)return;const r=new Z;if(this._lastQuickFixCommands.value=r,!Array.isArray(o))return o?koe.from(o,this._extHostCommands.converter,r):void 0;const a=[];for(const c of o){const l=koe.from(c,this._extHostCommands.converter,r);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new ai().token;let s=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(s&&!("options"in s)&&(s={options:s}),!s||!("options"in s))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in s.options){this.createExtensionTerminal(s.options,t);return}this.createTerminalFromOptions(s.options,t)}}async $provideLinks(e,t){const i=this.getTerminalById(e);if(!i)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);const o=new ai;this._terminalLinkCancellationSource.set(e,o);const r=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(ko.withAsyncBody(async u=>{o.token.onCancellationRequested(()=>u({provider:h,links:[]}));const f=await h.provideTerminalLinks(a,o.token)||[];o.token.isCancellationRequested||u({provider:h,links:f})}));const l=await Promise.all(c);if(o.token.isCancellationRequested)return[];const d=new Map;for(const h of l)h&&h.links.length>0&&r.push(...h.links.map(u=>{const f={id:Oti++,startIndex:u.startIndex,length:u.length,label:u.tooltip};return d.set(f.id,{provider:h.provider,link:u}),f}));return this._terminalLinkCache.set(e,d),r}$activateLink(e,t){const i=this._terminalLinkCache.get(e)?.get(t);i&&i.provider.handleTerminalLink(i.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];const i=this._terminalProcessDisposables[e];i&&(i.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){const t=this._terminals.findIndex(i=>i.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){const i=this._getTerminalObjectIndexById(e,t);return i!==null?e[i]:null}_getTerminalObjectIndexById(e,t){const i=e.findIndex(s=>s._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=new j7e,this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=grt(t.map),s=MKt(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,s)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],s=new j7e(t[1]);this._setEnvironmentVariableCollection(i,s)})}$acceptDefaultProfile(e,t){const i=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,i?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)})}};JLe=D([_(1,Yz),_(2,gr)],JLe);class j7e{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=new I,this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){const t=this.getScopeKey(e);let i=this.scopedCollections.get(t);return i||(i=new Bti(this,e),this.scopedCollections.set(t,i),i.onDidChangeCollection(()=>this._onDidChangeCollection.fire())),i}replace(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Replace,options:i??{applyAtProcessCreation:!0},scope:s})}append(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Append,options:i??{applyAtProcessCreation:!0},scope:s})}prepend(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Prepend,options:i??{applyAtProcessCreation:!0},scope:s})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw new Error("EnvironmentVariableMutatorOptions must apply at either process creation or shell integration");const i=this.getKey(e,t.scope),s=this.map.get(i),o=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!s||s.value!==t.value||s.type!==t.type||s.options?.applyAtProcessCreation!==o.applyAtProcessCreation||s.options?.applyAtShellIntegration!==o.applyAtShellIntegration||s.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const r=this.getKey(e,t.scope),a={variable:e,...t,options:o};this.map.set(r,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),s=this.map.get(i);return s?K7e(s):void 0}getKey(e,t){const i=this.getScopeKey(t);return i.length?`${e}:::${i}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??""}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){const t=new Map;for(const[i,s]of this.map)this.getScopeKey(s.scope)===this.getScopeKey(e)&&t.set(s.variable,K7e(s));return t}delete(e,t){const i=this.getKey(e,t);this.map.delete(i),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(const[t,i]of this.map)i.scope?.workspaceFolder?.index===e.workspaceFolder.index&&this.map.delete(t);this.clearDescription(e)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(e,t){const i=this.getScopeKey(t),s=this.descriptionMap.get(i);if(!s||s.description!==e){let o;typeof e=="string"?o=e:o=e?.value.split(` - -`)[0];const r={description:o,scope:t};this.descriptionMap.set(i,r),this._onDidChangeCollection.fire()}}getDescription(e){const t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){const t=this.getScopeKey(e);this.descriptionMap.delete(t)}}class Bti{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new I}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,i){this.collection.replace(e,t,i,this.scope)}append(e,t,i){this.collection.append(e,t,i,this.scope)}prepend(e,t,i){this.collection.prepend(e,t,i,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((i,s)=>e.call(t,s,i,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}}let XLe=class extends JLe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new tE}createTerminalFromOptions(e,t){throw new tE}};XLe=D([_(0,Yz),_(1,gr)],XLe);function Eat(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}function Wti(n){return OU.isThemeColor(n)?n:void 0}function K7e(n){const e={...n};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const _ue=ae("IExtHostApiDeprecationService");let ZLe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Ue.MainThreadTelemetry)}report(e,t,i){const s=this.getUsageKey(e,t);this._reportedUsages.has(s)||(this._reportedUsages.add(s),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${i}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};ZLe=D([_(0,gr),_(1,Ze)],ZLe);var Dre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(Dre||(Dre={}));var kre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(kre||(kre={}));var eTe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(eTe||(eTe={}));var P8;(function(n){function e(s){if(s){const o=s;return o&&!!o.process}else return!1}n.is=e;function t(s){if(s==null)return;const o={process:s.process,args:s.args};return s.options&&(o.options=eTe.from(s.options)),o}n.from=t;function i(s){if(s!=null)return new zF(s.process,s.args,s.options)}n.to=i})(P8||(P8={}));var tTe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(tTe||(tTe={}));var F8;(function(n){function e(s){if(s){const o=s;return o&&(!!o.commandLine||!!o.command)}else return!1}n.is=e;function t(s){if(s==null)return;const o={};return s.commandLine!==void 0?o.commandLine=s.commandLine:(o.command=s.command,o.args=s.args),s.options&&(o.options=tTe.from(s.options)),o}n.from=t;function i(s){if(!(s==null||s.command===void 0&&s.commandLine===void 0))return s.commandLine?new j1(s.commandLine,s.options):new j1(s.command,s.args?s.args:[],s.options)}n.to=i})(F8||(F8={}));var Dx;(function(n){function e(s){if(s){const o=s;return o&&o.customExecution==="customExecution"}else return!1}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s,o){return o.get(s)}n.to=i})(Dx||(Dx={}));var iTe;(function(n){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}n.from=e})(iTe||(iTe={}));var yI;(function(n){function e(s,o){if(s==null)return[];const r=[];for(const a of s){const c=t(a,o);c&&r.push(c)}return r}n.fromMany=e;function t(s,o){if(s==null)return;let r;s.execution instanceof zF?r=P8.from(s.execution):s.execution instanceof j1?r=F8.from(s.execution):s.execution&&s.execution instanceof Ghe&&(r=Dx.from(s.execution));const a=Dre.from(s.definition);let c;return s.scope?typeof s.scope=="number"?c=s.scope:c=s.scope.uri:c=K1.Workspace,!a||!c?void 0:{_id:s._id,definition:a,name:s.name,source:{extensionId:o.identifier.value,label:s.source,scope:c},execution:r,isBackground:s.isBackground,group:iTe.from(s.group),presentationOptions:kre.from(s.presentationOptions),problemMatchers:s.problemMatchers,hasDefinedMatchers:s.hasDefinedMatchers,runOptions:s.runOptions?s.runOptions:{reevaluateOnRerun:!0},detail:s.detail}}n.from=t;async function i(s,o,r){if(s==null)return;let a;P8.is(s.execution)?a=P8.to(s.execution):F8.is(s.execution)?a=F8.to(s.execution):Dx.is(s.execution)&&(a=Dx.to(s._id,r));const c=Dre.to(s.definition);let l;if(s.source&&(s.source.scope!==void 0?typeof s.source.scope=="number"?l=s.source.scope:l=await o.resolveWorkspaceFolder(P.revive(s.source.scope)):l=K1.Workspace),!c||!l)return;const d=new G6(c,l,s.name,s.source.label,a,s.problemMatchers);return s.isBackground!==void 0&&(d.isBackground=s.isBackground),s.group!==void 0&&(d.group=d4.from(s.group._id),d.group&&s.group.isDefault&&(d.group=new d4(d.group.id,d.group.label),s.group.isDefault===!0&&(d.group.isDefault=s.group.isDefault))),s.presentationOptions&&(d.presentationOptions=kre.to(s.presentationOptions)),s._id&&(d._id=s._id),s.detail&&(d.detail=s.detail),d}n.to=i})(yI||(yI={}));var nTe;(function(n){function e(i){return i}n.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}n.to=t})(nTe||(nTe={}));var yq;class vme{constructor(e,t,i){kt(this,yq);this._id=t,this._task=i,st(this,yq,e)}get task(){return this._task}terminate(){se(this,yq).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}yq=new WeakMap;let sTe=class{constructor(e,t,i,s,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Ue.MainThreadTask),this._workspaceProvider=i,this._editorService=s,this._configurationService=o,this._terminalService=r,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=c,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,i){if(!i)return new oo(()=>{});const s=this.nextHandle();return this._handlers.set(s,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(s,t),new oo(()=>{this._handlers.delete(s),this._proxy.$unregisterTaskProvider(s)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(nTe.from(e)).then(async t=>{const i=[];for(const s of t){const o=await yI.to(s,this._workspaceProvider,this._providedCustomExecutions2);o&&i.push(o)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof vme))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,i){const s=this._providedCustomExecutions2.get(e.id);s&&(this._activeCustomExecutions2.set(e.id,s),this._terminalService.attachPtyToTerminal(t,await s.callback(i))),this._lastStartedTask=e.id,this._onDidExecuteTask.fire({execution:await this.getTaskExecution(e)})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;const t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}$provideTasks(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));const s=[],o=Zu(()=>i.provider.provideTasks(qe.None)).then(r=>this.provideTasksInternal(t,s,i,r));return new Promise(r=>{o.then(a=>{Promise.all(s).then(()=>{r(a)})})})}async $resolveTask(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));if(t.definition.type!==i.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${i.type}].`);const s=await yI.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!s)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(s,qe.None);if(!o)return;this.checkDeprecation(o,i);const r=yI.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==s.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return Dx.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const s=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(s)&&(this._notProvidedCustomExecutions.add(s),this._activeCustomExecutions2.set(s,t.execution)),this._providedCustomExecutions2.set(s,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new uc("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let s;return t?s=Promise.resolve(new vme(this,e.id,t)):s=yI.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new uc("Unexpected: Task does not exist.");return new vme(this,e.id,o)}),this._taskExecutionPromises.set(e.id,s),s.then(o=>(this._taskExecutions.set(e.id,o),o))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));const i=this._notProvidedCustomExecutions.values();let s=i.next();for(;!s.done;)!this._activeCustomExecutions2.has(s.value)&&this._lastStartedTask!==s.value&&(this._providedCustomExecutions2.delete(s.value),this._notProvidedCustomExecutions.delete(s.value)),s=i.next()}};sTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,_ue)],sTe);let oTe=class extends sTe{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,o,r,a,c),this.registerTaskSystem(_e.vscodeRemote,{scheme:_e.vscodeRemote,authority:"",platform:Kct(Hh.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=yI.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(Dx.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new tE;const s=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),s}provideTasksInternal(e,t,i,s){const o=[];if(s)for(const r of s){if(this.checkDeprecation(r,i),!r.definition||!e[r.definition.type]){const c=r.source?r.source:"No task source";this._logService.warn(`The task [${c}, ${r.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=yI.from(r,i.extension);a&&Dx.is(a.execution)?(o.push(a),t.push(this.addCustomExecution(a,r,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:o,extension:i.extension}}async resolveTaskInternal(e){if(Dx.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,i){}};oTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,_ue)],oTe);const xat=ae("IExtHostTask"),rj=ae("IExtHostEditorTabs");class Y7e{constructor(e,t,i){this._activeTabIdGetter=i,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case Oa.TextInput:return new Qhe(P.revive(this._dto.input.uri));case Oa.TextDiffInput:return new gG(P.revive(this._dto.input.original),P.revive(this._dto.input.modified));case Oa.TextMergeInput:return new bOe(P.revive(this._dto.input.base),P.revive(this._dto.input.input1),P.revive(this._dto.input.input2),P.revive(this._dto.input.result));case Oa.CustomEditorInput:return new jhe(P.revive(this._dto.input.uri),this._dto.input.viewType);case Oa.WebviewEditorInput:return new COe(this._dto.input.viewType);case Oa.NotebookInput:return new Khe(P.revive(this._dto.input.uri),this._dto.input.notebookType);case Oa.NotebookDiffInput:return new Yhe(P.revive(this._dto.input.original),P.revive(this._dto.input.modified),this._dto.input.notebookType);case Oa.TerminalEditorInput:return new yOe;case Oa.InteractiveEditorInput:return new SOe(P.revive(this._dto.input.uri),P.revive(this._dto.input.inputBoxUri));case Oa.ChatEditorInput:return new AOe;case Oa.MultiDiffEditorInput:return new Not(this._dto.input.diffEditors.map(e=>new gG(P.revive(e.original),P.revive(e.modified))));default:return}}}class Hti{constructor(e,t){this._tabs=[],this._activeTabId="",this._dto=e,this._activeGroupIdGetter=t;for(const i of e.tabs)i.isActive&&(this._activeTabId=i.id),this._tabs.push(new Y7e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return yd.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(i=>i.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(i=>i.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===gu.TAB_OPEN){const i=new Y7e(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,i),e.tabDto.isActive&&(this._activeTabId=i.tabId),i}else if(e.kind===gu.TAB_CLOSE){const i=this._tabs.splice(e.index,1)[0];if(!i)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return i.tabId===this._activeTabId&&(this._activeTabId=""),i}else if(e.kind===gu.TAB_MOVE){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");const i=this._tabs.splice(e.oldIndex,1)[0];if(!i)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,i),i}const t=this._tabs.find(i=>i.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}}let rTe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Ue.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){const e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(i=>i.apiObject))},get activeTabGroup(){const i=e._activeGroupId;return ws(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,s)=>{const o=Array.isArray(i)?i:[i];return o.length?Uti(o[0])?this._closeGroups(o,s):this._closeTabs(o,s):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){const t=new Set(this._extHostTabGroups.map(l=>l.groupId)),i=new Set(e.map(l=>l.groupId)),s=Ple(t,i),o=this._extHostTabGroups.filter(l=>s.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new Hti(l,()=>this._activeGroupId);return s.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=ws(e.find(l=>l.isActive===!0)?.groupId);c!==void 0&&this._activeGroupId!==c&&(this._activeGroupId=c),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:o,changed:a}))}$acceptTabGroupUpdate(e){const t=this._extHostTabGroups.find(i=>i.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){const t=this._extHostTabGroups.find(s=>s.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");const i=t.acceptTabOperation(e);switch(e.kind){case gu.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case gu.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case gu.TAB_MOVE:case gu.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[i.apiObject]}));return}}_findExtHostTabFromApi(e){for(const t of this._extHostTabGroups)for(const i of t.tabs)if(i.apiObject===e)return i}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){const i=[];for(const s of e){const o=this._findExtHostTabFromApi(s);if(!o)throw new Error("Tab close: Invalid tab not found!");i.push(o.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const s of e){const o=this._findExtHostTabGroupFromApi(s);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};rTe=D([_(0,gr)],rTe);function Uti(n){return n.tabs!==void 0}const _le=class _le{constructor(e,t,i,s){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=s}};_le.NONE=new _le(!1,-1,-1,-1);let G4=_le;class J7e{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new G4(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}}class vue{constructor(e,t,i,s,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=s,this.exports=o,this.subscriptions=r}}class Vti extends vue{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,[])}}class zti extends vue{constructor(){super(!1,null,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}class Ire extends vue{constructor(e){super(!0,e,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}let aTe=class{constructor(e,t,i,s){this._logService=s,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new Ga,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(const[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){const e=[];for(const[t,i]of this._operations)e.push(i.wait());await Promise.all(e)}isActivated(e){const t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){const t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;const i=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(i.map(s=>({id:s.identifier,reason:{startup:t,extensionId:s.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){const i=this._registry.getExtensionDescription(e);if(!i)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:i.identifier,reason:t}])}async _activateExtensions(e){const t=e.filter(i=>!this.isActivated(i.id)).map(i=>this._handleActivationRequest(i));await Promise.all(t.map(i=>i.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);const t=this._registry.getExtensionDescription(e.id);if(!t){const o=new Error(`Cannot activate unknown extension '${e.id.value}'`),r=this._createAndSaveOperation(e,null,[],new Ire(o));return this._host.onExtensionActivationError(e.id,o,new UVe(e.id.value)),r}const i=[],s=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of s){if(this._isResolvedExtension(o))continue;const r=this._operations.get(o);if(r){i.push(r);continue}if(this._isHostExtension(o)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(o).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(o);if(a){if(!a.main&&!a.browser)continue;i.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}const c=t.displayName||t.identifier.value,l=new Error(`Cannot activate the '${c}' extension because it depends on unknown extension '${o}'`),d=this._createAndSaveOperation(e,t.displayName,[],new Ire(l));return this._host.onExtensionActivationError(t.identifier,l,new UVe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,s){const o=new cTe(e.id,t,e.reason,i,s,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return UI.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};aTe=D([_(3,Ze)],aTe);let cTe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,s,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=s,this._value=o,this._host=r,this._logService=a,this._barrier=new Uh,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){const t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new Ire(t),this._isDisposed&&Na(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};cTe=D([_(6,Ze)],cTe);class Dat{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Ue.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const s=await this._proxy.$initializeExtensionStorage(e,t);let o;return s&&(o=this.safeParseValue(e,t,s)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const s=this.safeParseValue(e,t,i);s&&this._onDidChangeStorage.fire({shared:e,key:t,value:s})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(s){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${s}`)}}}const KOe=ae("IExtHostStorage");class kat{constructor(e,t,i){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=i,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(s=>(this._value=s,this)),this._storageListener=this._storage.onDidChangeStorage(s=>{s.shared===this._shared&&s.key===this._id&&(this._value=s.value)}),this._scheduler=new yn(()=>{const s=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of s.values())o.complete()}catch(o){for(const r of s.values())r.error(o)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let i=this._value[e];return typeof i>"u"&&(i=t),i}update(e,t){this._value[e]=t;const i=this._deferredPromises.get(e);if(i!==void 0)return i.p;const s=new sd;return this._deferredPromises.set(e,s),this._scheduler.isScheduled()||this._scheduler.schedule(),s.p}dispose(){this._storageListener.dispose()}}class $ti extends kat{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}}const YOe=ae("IExtensionStoragePaths");let lTe=class{constructor(e,t,i){this._logService=t,this._extHostFileSystem=i,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(s=>this._value=s)}async _getWorkspaceStorageURI(e){return P.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);const e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(P.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:P.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(i){this._logService.error("[ExtHostStorage]",i);return}}workspaceValue(e){if(this._value)return P.joinPath(this._value,e.identifier.value)}globalValue(e){return P.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};lTe=D([_(0,Sg),_(1,Ze),_(2,fue)],lTe);const JOe=ae("IExtHostAuthentication");let dTe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new X7e,this._getSessionsTaskSingler=new X7e,this._proxy=e.getProxy(Ue.MainThreadAuthentication)}async getSession(e,t,i,s={}){const o=Cn.toKey(e.identifier),r=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${o} ${t} ${r}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,o,a,s)})}async getSessions(e,t,i){const s=Cn.toKey(e.identifier),o=[...i].sort().join(" ");return await this._getSessionsTaskSingler.getOrCreate(`${s} ${o}`,async()=>{await this._proxy.$ensureProvider(t);const r=e.displayName||e.name;return this._proxy.$getSessions(t,i,s,r)})}async removeSession(e,t){const i=this._authenticationProviders.get(e);return i?i.provider.removeSession(t):this._proxy.$removeSession(e,t)}registerAuthenticationProvider(e,t,i,s){if(this._authenticationProviders.get(e))throw new Error(`An authentication provider with id '${e}' is already registered.`);this._authenticationProviders.set(e,{label:t,provider:i,options:s??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,s?.supportsMultipleAccounts??!1),new oo(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const s=this._authenticationProviders.get(e);if(s)return await s.provider.createSession(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $getSessions(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.getSessions(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(tue)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};dTe=D([_(0,gr)],dTe);class X7e{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const s=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,s),s}}var hTe;const Gti="vs/workbench/api/common/extHostLanguageModels",XOe=ae("IExtHostLanguageModels");class Z7e{constructor(e,t){this.option=e,this.stream=new M9,this.stream=t??new M9}}class qti{constructor(){this._responseStreams=new Map,this._defaultStream=new M9,this._isDone=!1,this._isStreaming=!1;const e=this;this.apiObject={text:e._defaultStream.asyncIterable}}*_streams(){if(this._responseStreams.size>0)for(const[,e]of this._responseStreams)yield e.stream;else yield this._defaultStream}handleFragment(e){if(this._isDone)return;this._isStreaming=!0;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new Z7e(e.index,this._defaultStream):t=new Z7e(e.index),this._responseStreams.set(e.index,t)),t.stream.emitOne(e.part)}get isStreaming(){return this._isStreaming}reject(e){this._isDone=!0;for(const t of this._streams())t.reject(e)}resolve(){this._isDone=!0;for(const e of this._streams())e.resolve()}}var XP;let uTe=(XP=class{constructor(e,t,i){this._logService=t,this._extHostAuthentication=i,this._onDidChangeModelAccess=new I,this._onDidChangeProviders=new I,this.onDidChangeProviders=this._onDidChangeProviders.event,this._languageModels=new Map,this._allLanguageModelData=new Map,this._modelAccessList=new Ga,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,s){const o=hTe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;s.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof s.auth=="object"?s.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Cn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:s.vendor??Cn.toKey(e.identifier),name:s.name??"",family:s.family??"",version:s.version,maxInputTokens:s.maxInputTokens,maxOutputTokens:s.maxOutputTokens,auth:r,targetExtensions:s.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Cn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $provideLanguageModelResponse(e,t,i,s,o,r){const a=this._languageModels.get(e);if(!a)return;const c=new cf(async l=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}this._proxy.$handleProgressChunk(t,{index:l.index,part:l.part})});return a.provider.provideLanguageModelResponse(s.map(y8.to),o,Cn.toKey(i),c,r)}$provideTokenLength(e,t,i){const s=this._languageModels.get(e);return s?Promise.resolve(s.provider.provideTokenCount(t,i)):Promise.resolve(0)}$acceptChatModelMetadata(e){if(e.added)for(const{identifier:t,metadata:i}of e.added)this._allLanguageModelData.set(t,{metadata:i,apiObjects:new Ga});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,s]of this._pendingRequest)s.languageModelId===t&&(s.res.reject(new Rc),this._pendingRequest.delete(i))}e.added?.forEach(t=>this._fakeAuthPopulate(t.metadata)),this._onDidChangeProviders.fire(void 0)}async selectLanguageModels(e,t){const i=await this._proxy.$selectChatModels({...t,extension:e.identifier}),s=[],o=this;for(const r of i){const a=this._allLanguageModelData.get(r);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:r,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._computeTokenLength(r,l,d??qe.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??qe.None)}},a.apiObjects.set(e.identifier,c)),s.push(c)}return s}async _sendChatRequest(e,t,i,s,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw qg.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},s.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw qg.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);const l=Math.random()*1e6|0,d=this._proxy.$fetchResponse(a,t,l,r,s.modelOptions??{},o),h=new Uh,u=new qti;this._pendingRequest.set(l,{languageModelId:t,res:u});let f;if(d.catch(p=>{h.isOpen()?u.reject(p):f=p}).finally(()=>{this._pendingRequest.delete(l),u.resolve(),h.open()}),await h.wait(),f)throw f.name===qg.name?f:new qg(`Language model '${t}' errored, check cause for more details`,"Unknown",f);return u.apiObject}_convertMessages(e,t){const i=[];for(const s of t)s.role===Iv.System&&Je(e,"languageModelSystem"),i.push(y8.from(s));return i}async $handleResponseFragment(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async _getAuthAccess(e,t,i,s){const o=tue+t.identifier.value;if(await this._extHostAuthentication.getSession(e,o,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(s)return!1;try{const a=i?g(Gti,0,"Justification: {1}",t.displayName,i):void 0;return await this._extHostAuthentication.getSession(e,o,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Cn.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(const t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(i){this._logService.error("Fake Auth request failed"),this._logService.error(i)}}async _computeTokenLength(e,t,i){if(!this._allLanguageModelData.get(e))throw qg.NotFound(`Language model '${e}' is unknown.`);const o=fi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:y8.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:s,enabled:o}of e){const r=this._modelAccessList.get(i)??new $v;if(r.has(s)!==o){o?r.add(s):r.delete(s),this._modelAccessList.set(i,r);const c={from:i,to:s};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=T.signal(T.filter(this._onDidChangeModelAccess.event,o=>Cn.equals(o.from,e.identifier))),s=T.signal(this._onDidChangeProviders.event);return{get onDidChange(){return T.any(i,s)},canSendRequest(o){let r;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===o){r=l.metadata;break e}if(!r)return;if(!t._isUsingAuth(e.identifier,r))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(r.extension)}}}},hTe=XP,XP._idPool=1,XP);uTe=hTe=D([_(0,gr),_(1,Ze),_(2,JOe)],uTe);class Iat{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Ue.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,i){return this._proxy.$setPassword(e,t,i)}delete(e,t){return this._proxy.$deletePassword(e,t)}}const ZOe=ae("IExtHostSecretState");var Ik;class Qti{constructor(e,t){kt(this,Ik);this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._id=Cn.toKey(e.identifier),st(this,Ik,t),se(this,Ik).onDidChangePassword(i=>{i.extensionId===this._id&&this._onDidChange.fire({key:i.key})})}get(e){return se(this,Ik).get(this._id,e)}store(e,t){return se(this,Ik).store(this._id,e,t)}delete(e){return se(this,Ik).delete(this._id,e)}}Ik=new WeakMap;let gTe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Ue.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===aR}getMessage(e,t){const{message:i,args:s,comment:o}=t;if(this.isDefaultLanguage)return b_e(i,s??{});let r=i;o&&o.length>0&&(r+=`/${Array.isArray(o)?o.join(""):o}`);const a=this.bundleCache.get(e)?.contents[r];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${r}`),b_e(a??i,s??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t;const i=await this.getBundleLocation(e);if(!i){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{const s=await this._proxy.$fetchBundleContents(i),o=JSON.parse(s);t=e.isBuiltin?o.contents?.bundle:o}catch(s){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${s.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:i})}async getBundleLocation(e){if(e.isBuiltin){const t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return P.revive(t)}return e.l10n?P.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};gTe=D([_(0,Sg),_(1,gr),_(2,Ze)],gTe);const eBe=ae("IExtHostLocalizationService"),tBe=ae("IExtHostManagedSockets");let fTe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Ue.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new jti(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw new Error(`No socket factory with id ${e}`);const t=++this._remoteSocketIdCounter,i=await this._factory.makeConnection(),s=new Z;return this._managedRemoteSockets.set(t,new Kti(t,i,s)),s.add(Ee(()=>this._managedRemoteSockets.delete(t))),s.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),s.dispose()})),s.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),s.dispose()})),s.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,ze.wrap(o)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){const t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};fTe=D([_(0,gr)],fTe);class jti{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class Kti extends ${constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var pTe;const e6e="vs/workbench/api/common/extHostExtensionService",Lat=ae("IHostUtils");let mTe=pTe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this._extHostManagedSockets=u,this._extHostLanguageModels=f,this._onDidChangeRemoteConnectionData=this._register(new I),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=i,this._initData=a,this._extHostWorkspace=s,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Ue.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Ue.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Ue.MainThreadExtensionService),this._almostReadyToRunExtensions=new Uh,this._readyToStartExtensionHost=new Uh,this._readyToRunExtensions=new Uh,this._eagerExtensionsActivated=new Uh,this._activationEventsReader=new Jti(this._initData.extensions.activationEvents),this._globalRegistry=new UI(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new $v(this._initData.extensions.myExtensions);this._myRegistry=new UI(this._activationEventsReader,Tat(this._globalRegistry,p)),Vu&&(this._logService.info(`Creating extension host with the following global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${dB(this._myRegistry)}`)),this._storage=new Dat(this._extHostContext,this._logService),this._secretState=new Iat(this._extHostContext),this._storagePath=c,this._instaService=e.createChild(new Dl([KOe,this._storage],[ZOe,this._secretState])),this._activator=this._register(new aTe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,w)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,EU(v),w)},actualActivateExtension:async(m,v)=>{if(UI.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new zti;const w=this._myRegistry.getExtensionDescription(m);return this._activateExtension(w,v)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),vs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){bt(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(o=>o.identifier).filter(o=>this.isActivated(o)).map(o=>this._deactivate(o))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),_9&&p_e(s=>{this._logService.error(s)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Ta(5e3),i]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){const t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new Cn(t.identifier.value),extensionLocation:P.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{const i=this._activator.getActivatedExtension(e);if(i.activationFailed)return Promise.reject(i.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===_e.file&&this._hostUtils.fsRealpath){const t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));const i=await this._realPathCache.get(t);return P.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new Yti(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Su.forUris(i=>QQe.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const s=await this._realPathExtensionUri(i.extensionLocation);t.set(s,i)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;const i=this._activator.getActivatedExtension(e);if(!i)return t;try{typeof i.module.deactivate=="function"&&(t=Promise.resolve(i.module.deactivate()).then(void 0,s=>(this._logService.error(s),Promise.resolve(void 0))))}catch(s){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(s)}try{St(i.subscriptions)}catch(s){this._logService.error(`An error occurred when deactivating the subscriptions for extension '${e.value}':`),this._logService.error(s)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(i=>{const s=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,s.codeLoadingTime,s.activateCallTime,s.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",s),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,s){const o=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...s||{},outcome:i})}_doActivateExtension(e,t){const i=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const s=this._getEntryPoint(e);if(!s)return Promise.resolve(new Vti(G4.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value!==t.extensionId.value?`, root cause: ${t.extensionId.value}`:""}`),this._logService.flush();const o=new J7e(t.startup);return Promise.all([this._loadCommonJSModule(e,Qt(e.extensionLocation,s),o),this._loadExtensionContext(e)]).then(r=>(vs(`code/extHost/willActivateExtension/${e.identifier.value}`),pTe._callActivate(this._logService,e.identifier,r[0],r[1],o))).then(r=>(vs(`code/extHost/didActivateExtension/${e.identifier.value}`),r))}_loadExtensionContext(e){const t=this._extHostLanguageModels.createLanguageModelAccessInformation(e),i=new $ti(e,this._storage),s=new kat(e.identifier.value,!1,this._storage),o=new Qti(e,this._secretState),r=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?WM.Test:WM.Development:WM.Production,a=this._initData.remote.isRemote?$I.Workspace:$I.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([i.whenReady,s.whenReady,this._storagePath.whenReady]).then(()=>{const c=this;let l,d;const h=Cd(e,"ipc")?this._initData.messagePorts?.get(Cn.toKey(e.identifier)):void 0;return Object.freeze({globalState:i,workspaceState:s,secrets:o,subscriptions:[],get languageModelAccessInformation(){return t},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(u){return k_e(e.extensionLocation.fsPath,u)},get storagePath(){return c._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return c._storagePath.globalValue(e).fsPath},get logPath(){return k_e(c._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return P.joinPath(c._initData.logsLocation,e.identifier.value)},get storageUri(){return c._storagePath.workspaceValue(e)},get globalStorageUri(){return c._storagePath.globalValue(e)},get extensionMode(){return r},get extension(){return l===void 0&&(l=new K3(c,e.identifier,e,a,!1)),l},get extensionRuntime(){return Je(e,"extensionRuntime"),c.extensionRuntime},get environmentVariableCollection(){return c._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!d){if(!h)return;const u=T.buffer(T.fromDOMEventEmitter(h,"message",f=>f.data));h.start(),d={onDidReceiveMessage:u,postMessage:h.postMessage.bind(h)}}return d}})})}static _callActivate(e,t,i,s,o){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,s,o).then(r=>new vue(!1,null,o.build(),i,r,s.subscriptions))}static _callActivateOptional(e,t,i,s,o){if(typeof i.activate=="function")try{o.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const r=typeof global=="object"?global:self,a=i.activate.apply(r,[s]);return o.activateCallStop(),o.activateResolveStart(),Promise.resolve(a).then(c=>(o.activateResolveStop(),c))}catch(r){return Promise.reject(r)}else return Promise.resolve(i)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,i=>{this._logService.error(i)})}_activateAllStartupFinishedDeferred(e,t=0){const s=Date.now();URe(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(SDt()),this._extHostConfiguration.getConfigProvider().then(e=>{const t=e.getConfiguration("extensions.experimental").get("deferredStartupFinishedActivation"),i=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(i);else for(const s of i)if(s.activationEvents)for(const o of s.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(s,o)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,r=>{this._logService.error(r)});this._register(this._extHostWorkspace.onDidChangeWorkspace(r=>this._handleWorkspaceContainsEagerExtensions(r.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),s=this._handleRemoteResolverEagerExtensions(),o=Promise.all([s,e,i]).then(()=>{});return Promise.race([o,Ta(1e4)]).then(()=>{this._activateAllStartupFinished()}),o}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;const i=!this._initData.remote.isRemote&&!!this._initData.remote.authority,s={logService:this._logService,folders:e.map(r=>r.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:r=>this._hostUtils.fsExists(r.fsPath),checkExists:(r,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(r,a,c)},o=await Zst(s,t);if(o)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:o.activationEvent}).then(void 0,r=>this._logService.error(r))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){const{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw new Error(g(e6e,0,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new J7e(!1));if(!i||typeof i.run!="function")throw new Error(g(e6e,1,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((s,o)=>{const r=(l,d)=>{l?(Vu&&this._logService.error("Test runner called back with error",l),o(l)):(Vu&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),s(typeof d=="number"&&d>0?1:0))},a=fv(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Vu&&this._logService.info("Test runner finished successfully."),s(0)}).catch(l=>{Vu&&this._logService.error("Test runner finished with error",l),o(l instanceof Error&&l.stack?l.stack:String(l))})})}_startExtensionHost(){if(this._started)throw new Error("Extension host is already started!");return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Ta(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info("Eager extensions activated")})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,Ee(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){const{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){const t=e.indexOf("+");if(t===-1)throw new OT("Not an authority that can be resolved!",Xd.InvalidAuthority);const i=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${i}`,!1),{authorityPrefix:i,resolver:this._resolvers[i]}}async $resolveAuthority(e,t){const i=ao.create(!1),s=()=>`[resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=b=>this._logService.info(`${s()}${b}`),r=b=>this._logService.warn(`${s()}${b}`),a=(b,C=void 0)=>this._logService.error(`${s()}${b}`,C),c=b=>{if(b instanceof OT)return{type:"error",error:{code:b._code,message:b._message,detail:b._detail}};throw b},l=async b=>{o(`activating resolver for ${b}...`);const{resolver:C,authorityPrefix:y}=await this._activateAndGetResolver(b);if(!C)throw a(`no resolver for ${y}`),new OT(`No remote extension installed to resolve ${y}.`,Xd.NoResolverFound);return{resolver:C,authorityPrefix:y,remoteAuthority:b}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async b=>{if(!(b instanceof OT)||b._code!==Xd.InvalidAuthority)throw b;return r(`resolving nested authorities failed: ${b.message}`),[await l(e)]})}catch(b){return c(b)}const u=new nQ;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[b,{authorityPrefix:C,resolver:y,remoteAuthority:S}]of h.entries())try{if(b===h.length-1)o("invoking final resolve()..."),vs(`code/extHost/willResolveAuthority/${C}`),f=await y.resolve(S,{resolveAttempt:t,execServer:p}),vs(`code/extHost/didResolveAuthorityOK/${C}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(y,m8.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${S}`),vs(`code/extHost/willResolveExecServer/${C}`),p=await y.resolveExecServer?.(S,{resolveAttempt:t,execServer:p}),!p)throw new OT(`Exec server was not available for ${S}`,Xd.NoResolverFound);vs(`code/extHost/didResolveExecServerOK/${C}`)}}catch(M){return vs(`code/extHost/didResolveAuthorityError/${C}`),a("returned an error",M),u.dispose(),c(M)}u.dispose();const m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},v={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};o(`returned ${m8.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let w;if(m8.isManagedResolvedAuthority(f)){const b=t;this._extHostManagedSockets.setFactory(b,f.makeConnection),w={authority:e,connectTo:new Ust(b),connectionToken:f.connectionToken}}else w={authority:e,connectTo:new Vst(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:w,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${Pne(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const s=P.revive(t);if(typeof i.getCanonicalURI>"u")return s;const o=await Zu(()=>i.getCanonicalURI(s));return o||s}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$startExtensionHost: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${dB(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===sC.Immediate?this._almostReadyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$deltaExtensions: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${dB(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){const t=ze.alloc(e),i=Math.random()%256;for(let s=0;sa.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=Tat(s,o);return{globalRegistry:s,myExtensions:r}}function i6e(n,e){return{id:n.identifier.value,name:n.name,extensionVersion:n.version,publisherDisplayName:n.publisher,activationEvents:n.activationEvents?n.activationEvents.join(","):null,isBuiltin:n.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function dB(n){return n.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const _L=ae("IExtHostExtensionService");var WR,Sq,HR;class K3{constructor(e,t,i,s,o){kt(this,WR);kt(this,Sq);kt(this,HR);st(this,WR,e),st(this,Sq,t),st(this,HR,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=d1(fv(i.extensionLocation)),this.packageJSON=i,this.extensionKind=s,this.isFromDifferentExtensionHost=o}get isActive(){return se(this,WR).isActivated(se(this,HR))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return se(this,WR).getExtensionExports(se(this,HR))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await se(this,WR).activateByIdWithErrors(se(this,HR),{startup:!1,extensionId:se(this,Sq),activationEvent:"api"}),this.exports}}WR=new WeakMap,Sq=new WeakMap,HR=new WeakMap;function Tat(n,e){return n.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class Yti{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}}class Jti{constructor(e){this._map=new Ga,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(const t of Object.keys(e))this._map.set(t,e[t])}}var ca;(function(n){n.Unknown="unknown",n.Env="env",n.Config="config",n.Command="command",n.Input="input",n.ExtensionInstallFolder="extensionInstallFolder",n.WorkspaceFolder="workspaceFolder",n.Cwd="cwd",n.WorkspaceFolderBasename="workspaceFolderBasename",n.UserHome="userHome",n.LineNumber="lineNumber",n.SelectedText="selectedText",n.File="file",n.FileWorkspaceFolder="fileWorkspaceFolder",n.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",n.RelativeFile="relativeFile",n.RelativeFileDirname="relativeFileDirname",n.FileDirname="fileDirname",n.FileExtname="fileExtname",n.FileBasename="fileBasename",n.FileBasenameNoExtension="fileBasenameNoExtension",n.FileDirnameBasename="fileDirnameBasename",n.ExecPath="execPath",n.ExecInstallFolder="execInstallFolder",n.PathSeparator="pathSeparator",n.PathSeparatorAlias="/"})(ca||(ca={}));class If extends Error{constructor(e,t){super(t),this.variable=e}}const Lf="vs/workbench/services/configurationResolver/common/variableResolver",sR=class sR{constructor(e,t,i,s){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,s&&(this._envVariablesPromise=s.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Is){const t=Object.create(null);return Object.keys(e).forEach(i=>{t[i.toLowerCase()]=e[i]}),t}return e}resolveWithEnvironment(e,t,i){return this.recursiveResolve({env:this.prepareEnv(e),userHome:void 0},t?t.uri:void 0,i)}async resolveAsync(e,t){const i={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(i,e?e.uri:void 0,t)}async resolveAnyBase(e,t,i,s){const o=Vs(t);Is&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):ei&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):jr&&o.linux&&Object.keys(o.linux).forEach(a=>o[a]=o.linux[a]),delete o.windows,delete o.osx,delete o.linux;const r={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(r,e?e.uri:void 0,o,i,s)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const s=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,s),resolvedVariables:s}}resolveWithInteractionReplace(e,t,i,s){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,s){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(e,t){if(this._contributedVariables.has(e))throw new Error("Variable "+e+" is contributed twice.");this._contributedVariables.set(e,t)}async recursiveResolve(e,t,i,s,o){if($t(i))return this.resolveString(e,t,i,s,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,s,o)));if(fo(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,s,o),await this.recursiveResolve(e,t,i[c],s,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,s,o){return Plt(i,sR.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(sR.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,s);return o?.set(a,c),c!==r&&$t(c)&&c.match(sR.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,s,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,s,o){let r;const a=i.split(":");a.length>1&&(i=a[0],r=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Ay(u);throw new If(h,g(Lf,0,"Variable {0} can not be resolved. Please open an editor.",t))},l=h=>{const u=c(h);if(this._context.getWorkspaceFolderPathForFile){const f=this._context.getWorkspaceFolderPathForFile();if(f)return Ay(f)}throw new If(h,g(Lf,1,"Variable {0}: can not find workspace folder of '{1}'.",t,yr(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new If(h,g(Lf,2,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(s)return s;throw this._context.getWorkspaceFolderCount()>1?new If(h,g(Lf,3,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new If(h,g(Lf,4,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Is?r.toLowerCase():r];if($t(h))return h}return""}throw new If(ca.Env,g(Lf,5,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(s,r);if(hc(h))throw new If(ca.Config,g(Lf,6,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(fo(h))throw new If(ca.Config,g(Lf,7,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new If(ca.Config,g(Lf,8,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(ca.Command,t,r,o,"command");case"input":return this.resolveFromMap(ca.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new If(ca.ExtensionInstallFolder,g(Lf,9,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new If(ca.ExtensionInstallFolder,g(Lf,10,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Ay(this.fsPath(d(ca.WorkspaceFolder)));case"cwd":return s||r?Ay(this.fsPath(d(ca.Cwd))):kU();case"workspaceRootFolderName":case"workspaceFolderBasename":return Ay(yr(this.fsPath(d(ca.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new If(ca.UserHome,g(Lf,11,"Variable {0} can not be resolved. UserHome path is not defined",t))}case"lineNumber":{const h=this._context.getLineNumber();if(h)return h;throw new If(ca.LineNumber,g(Lf,12,"Variable {0} can not be resolved. Make sure to have a line selected in the active editor.",t))}case"selectedText":{const h=this._context.getSelectedText();if(h)return h;throw new If(ca.SelectedText,g(Lf,13,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(ca.File);case"fileWorkspaceFolder":return l(ca.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return yr(l(ca.FileWorkspaceFolderBasename));case"relativeFile":return s||r?LU(this.fsPath(d(ca.RelativeFile)),c(ca.RelativeFile)):c(ca.RelativeFile);case"relativeFileDirname":{const h=lS(c(ca.RelativeFileDirname));if(s||r){const u=LU(this.fsPath(d(ca.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return lS(c(ca.FileDirname));case"fileExtname":return T_(c(ca.FileExtname));case"fileBasename":return yr(c(ca.FileBasename));case"fileBasenameNoExtension":{const h=yr(c(ca.FileBasenameNoExtension));return h.slice(0,h.length-T_(h).length)}case"fileDirnameBasename":return yr(lS(c(ca.FileDirnameBasename)));case"execPath":{const h=this._context.getExecPath();return h||t}case"execInstallFolder":{const h=this._context.getAppRoot();return h||t}case"pathSeparator":case"/":return dg;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(ca.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,s,o){if(i&&s){const r=o===void 0?s[i]:s[o+":"+i];if(typeof r=="string")return r;throw new If(e,g(Lf,14,"Variable {0} can not be resolved because the command has no value.",t))}return t}};sR.VARIABLE_LHS="${",sR.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let _Te=sR;const iBe=ae("IExtHostVariableResolverProvider");class Xti extends _Te{constructor(e,t,i,s,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=s.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof gG||d.input instanceof Yhe)return d.input.modified;if(d.input instanceof Qhe||d.input instanceof Khe||d.input instanceof jhe)return d.input.uri}}}super({getFolderUri:l=>{const d=r.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>r.folders.length,getConfigurationValue:(l,d)=>o.getConfiguration(void 0,l).get(d),getAppRoot:()=>kU(),getExecPath:()=>IU.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return d1(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return d1(d.uri.fsPath)}}},getSelectedText:()=>{if(i){const l=i.activeEditor();if(l&&!l.selection.isEmpty)return l.document.getText(l.selection)}},getLineNumber:()=>{if(i){const l=i.activeEditor();if(l)return String(l.selection.end.line+1)}},getExtension:l=>e.getExtension(l)},void 0,a?Promise.resolve(a):void 0,Promise.resolve(IU))}}let vTe=class extends ${constructor(e,t,i,s,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=s,this.editorTabs=o,this._resolver=new Ya(async()=>{const r=await this.configurationService.getConfigProvider(),c={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async l=>{c.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new Xti(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};vTe=D([_(0,_L),_(1,dD),_(2,oj),_(3,hD),_(4,rj)],vTe);const Rat=ae("IExtHostDebugService");let wTe=class{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,i,s,o,r,a){this._workspaceService=t,this._extensionService=i,this._configurationService=s,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=new I,this._onDidTerminateDebugSession=new I,this._onDidChangeActiveDebugSession=new I,this._onDidReceiveDebugSessionCustomEvent=new I,this._debugServiceProxy=e.getProxy(Ue.MainThreadDebugService),this._onDidChangeBreakpoints=new I,this._onDidChangeActiveStackItem=new I,this._activeDebugConsole=new eii(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(c=>{c.onDidChange(l=>{this.registerAllDebugTypes(c)}),this.registerAllDebugTypes(c)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const s=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return s?this.convertVisualizerTreeItem(e,s):void 0}registerDebugVisualizationTree(e,t,i){const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(o,i),this._debugServiceProxy.$registerDebugVisualizerTree(o,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(o),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){const i=this._debugVisualizationElements.get(t)?.item;return i?(await this._debugVisualizationTrees.get(e)?.getChildren?.(i))?.map(o=>this.convertVisualizerTreeItem(e,o))||[]:[]}async $editVisualizerTreeItem(e,t){const i=this._debugVisualizationElements.get(e);if(!i)return;const s=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,s||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const s of i)if(s)for(const o of s)i.push(this._debugVisualizationElements.get(o)?.children),this._debugVisualizationElements.delete(o)}convertVisualizerTreeItem(e,t){let i=this._debugVisualizationTreeItemIds.get(t);return i||(i=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,i),this._debugVisualizationElements.set(i,{provider:e,item:t})),DIe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let s=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(s+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),s+=`${o}ref=${i.sourceReference}`,P.parse(s)}else{if(i.path)return P.file(i.path);throw new Error("cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.")}}registerAllDebugTypes(e){const t=[];for(const i of e.getAllExtensionDescriptions())if(i.contributes){const s=i.contributes.debuggers;if(s&&s.length>0)for(const o of s)ojt(o)&&t.push(o.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){const e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){const i=this._visualizers.get(e);if(!i)throw new Error(`No debug visualizer found with id '${e}'`);let{v:s,provider:o,extensionId:r}=i;if(s.visualization||(s=await o.resolveDebugVisualization?.(s,t)||s,i.v=s),!s.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,s.visualization)}async $executeDebugVisualizerCommand(e){const t=this._visualizers.get(e);if(!t)throw new Error(`No debug visualizer found with id '${e}'`);const i=t.v.visualization;i&&"command"in i&&this._commands.executeCommand(i.command,...i.arguments||[])}hydrateVisualizationContext(e){const t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,i,s){const o=this.hydrateVisualizationContext(i),r=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(r);if(!o||!a)return[];const c=await a.provideDebugVisualization(o,s);return c?c.map(l=>{const d=++this._visualizerIdCounter;this._visualizers.set(d,{v:l,provider:a,extensionId:e});const h=l.iconPath?this.getIconPathOrClass(l.iconPath):void 0;return{id:d,name:l.name,iconClass:h?.iconClass,iconPath:h?.iconPath,visualization:this.serializeVisualization(e,l.visualization)}}):[]}$disposeDebugVisualizers(e){for(const t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,i){if(!e.contributes?.debugVisualizers?.some(r=>r.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(o,i),this._debugServiceProxy.$registerDebugVisualizer(s,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(s,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(o=>{const r=o.id;return this._breakpoints.has(r)?!1:(this._breakpoints.set(r,o),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],s=new Map;for(const o of t)if(o instanceof vI){let r=s.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},s.set(o.location.uri.toString(),r),i.push(r)),r.lines.push({id:o.id,enabled:o.enabled,condition:o.condition,hitCondition:o.hitCondition,logMessage:o.logMessage,line:o.location.range.start.line,character:o.location.range.start.character,mode:o.mode})}else o instanceof wI&&i.push({type:"function",id:o.id,enabled:o.enabled,hitCondition:o.hitCondition,logMessage:o.logMessage,condition:o.condition,functionName:o.functionName,mode:o.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(r=>this._breakpoints.delete(r.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(r=>r instanceof vI).map(r=>r.id),s=t.filter(r=>r instanceof wI).map(r=>r.id),o=t.filter(r=>r instanceof vse).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,s,o)}startDebugging(e,t,i){return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===nG.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,suppressDebugStatusbar:i.suppressDebugStatusbar??i.debugUI?.simple,suppressDebugToolbar:i.suppressDebugToolbar??i.debugUI?.simple,suppressDebugView:i.suppressDebugView??i.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,i){if(!t)return new oo(()=>{});const s=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:s,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,s),new oo(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(s)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new oo(()=>{});if(!this.definesDebugType(e,t))throw new Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw new Error("a DebugAdapterDescriptorFactory can only be registered once per a type.");const s=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:s,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,s),new oo(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(s)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new oo(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new oo(()=>{this._trackerFactories=this._trackerFactories.filter(s=>s.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const s=await this.getFolder(e);return s&&(i={uri:s.uri,name:s.name,index:s.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new iii(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,s=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(s.type),s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,s);if(!a)throw new Error(`Couldn't create a debug adapter for type '${s.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(s).then(l=>(l&&this._debugAdaptersTrackers.set(e,l),c.onMessage(async d=>{if(d.type==="request"&&d.command==="handshake"){const h=d,u={type:"response",seq:0,command:h.command,request_seq:h.seq,success:!0};this._signService||(this._signService=this.createSignService());try{if(this._signService){const f=await this._signService.sign(h.arguments.value);u.body={signature:f},c.sendResponse(u)}else throw new Error("no signer")}catch(f){u.success=!1,u.message=f.message,c.sendResponse(u)}}else l&&l.onDidSendMessage&&l.onDidSendMessage(d),d=Jot(d,!0),i._debugServiceProxy.$acceptDAMessage(e,d)}),c.onError(d=>{l&&l.onError&&l.onError(d),this._debugServiceProxy.$acceptDAError(e,d.name,d.message,d.stack)}),c.onExit(d=>{l&&l.onExit&&l.onExit(d??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,d??void 0,void 0)}),l&&l.onWillStartSession&&l.onWillStartSession(),c.startSession()))})}$sendDAMessage(e,t){t=Yot(t,!1);const i=this._debugAdaptersTrackers.get(e);i&&i.onWillReceiveMessage&&i.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){const t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();const i=this._debugAdapters.get(e);return this._debugAdapters.delete(e),i?i.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){const t=[],i=[],s=[];if(e.added)for(const o of e.added){const r=o.id;if(r&&!this._breakpoints.has(r)){let a;if(o.type==="function")a=new wI(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new vse(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=P.revive(o.uri);a=new vI(new _p(c,new Ps(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}x7t(a,r),this._breakpoints.set(r,a),t.push(a)}}if(e.removed)for(const o of e.removed){const r=this._breakpoints.get(o);r&&(this._breakpoints.delete(o),i.push(r))}if(e.changed){for(const o of e.changed)if(o.id){const r=this._breakpoints.get(o.id);if(r){if(r instanceof wI&&o.type==="function"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.functionName=o.functionName}else if(r instanceof vI&&o.type==="source"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.location=new _p(P.revive(o.uri),new Ps(o.line,o.character))}s.push(r)}}}this.fireBreakpointChanges(t,i,s)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new yot(i.api,e.threadId):t=new Cot(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return Zu(async()=>{const s=this.getConfigProviderByHandle(e);if(!s)throw new Error("no DebugConfigurationProvider found");if(!s.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return s.provideDebugConfigurations(o,i)}).then(s=>{if(!s)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return s})}$resolveDebugConfiguration(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const r=await this.getFolder(t);return o.resolveDebugConfiguration(r,i,s)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const r=await this.getFolder(t);return o.resolveDebugConfigurationWithSubstitutedVariables(r,i,s)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const s=await this.getSession(t);return this.getAdapterDescriptor(i,s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}'`);return this.convertToDto(o)})}async $acceptDebugSessionStarted(e){const t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){const t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){const s={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(s)}convertToDto(e){if(e instanceof j6)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof f4)return{type:"server",port:e.port,host:e.host};if(e instanceof K6)return{type:"pipeServer",path:e.path};if(e instanceof Y6)return{type:"implementation",implementation:e.implementation};throw new Error("convertToDto unexpected type")}getAdapterDescriptorFactoryByType(e){const t=this._adapterFactories.filter(i=>i.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){const t=this._adapterFactories.filter(i=>i.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){const t=this._configProviders.filter(i=>i.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){const i=e.contributes.debuggers;if(i&&i.length>0){for(const s of i)if(s.label&&s.type&&s.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,s=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>Zu(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(s).then(o=>{const r=Vi(o);if(r.length>0)return new tii(r)}),new Promise(o=>setTimeout(()=>o(void 0),1e3))]).catch(o=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new f4(i));if(e){const o=await this._extensionService.getExtensionRegistry();return Zu(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const s=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,s))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,i){(e.length>0||t.length>0||i.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:i}))}async getSession(e){if(e)if(typeof e=="string"){const t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){const i=await this.getFolder(e.folderUri),s=e.parent?this._debugSessions.get(e.parent):void 0;t=new Zti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,s?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw new Error("cannot find session")}getFolder(e){if(e){const t=P.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if("title"in t&&"command"in t)return{type:Ene.Command};if("treeId"in t)return{type:Ene.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,s;return"id"in t?s=$e.asClassName(t):i=t,{iconPath:i,iconClass:s}}getIconUris(e){if(e instanceof fg)return{id:e.id};const t=typeof e=="object"&&"dark"in e?e.dark:e,i=typeof e=="object"&&"light"in e?e.light:e;return{dark:typeof t=="string"?P.file(t):t,light:typeof i=="string"?P.file(i):i}}};wTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],wTe);class Zti{constructor(e,t,i,s,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=s,this._workspaceFolder=o,this._configuration=r,this._parentSession=a}get api(){const e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,i){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,i)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}}class eii{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` -`)}})}}class tii{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(i=>i.onExit?i.onExit(e,t):void 0)}}class iii extends Got{constructor(e){super(),this.implementation=e,e.onDidSendMessage(t=>{this.acceptMessage(t)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}}let bTe=class extends wTe{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r,a)}};bTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],bTe);class nii{constructor(e,t,i){this.config=e,this.provider=t,this.sessionToken=i,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern,this.includePattern=e.includePattern&&_w(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&_w(e.excludePattern)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){const t=this.config.folderQueries||[];return new Promise((i,s)=>{const o=r=>{this.resultCount++,e(r)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(r=>{const a=r.toString(),c=yr(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(o,{base:r,basename:c})}),Promise.all(t.map(r=>this.searchInFolder(r,o))).then(r=>{i({limitHit:this.isLimitHit,stats:r[0]||void 0})},r=>{s(new Error(Ma(r)))})})}async searchInFolder(e,t){const i=new ai,s=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new Jst(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=ao.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},s,i.token),d=c.elapsed(),h=ao.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=Qi.relative(e.folder.path,u.path);if(a){const p=yr(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(o,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(o,r,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=$ne(this.config.includePattern,e.includePattern),i=$ne(this.config.excludePattern,e.excludePattern);return{folder:e.folder,excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,maxResults:this.config.maxResults,session:this.sessionToken}}initDirectoryTree(){const e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,i,s){if(i===this.filePattern){const r=yr(this.filePattern);this.matchFile(s,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=yr(r),c=lS(r);let l=e[c];l||(l=e[c]=[],o(c)),l.push({base:t,relativePath:r,basename:a})}o(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,s){const o=this,r=this.filePattern;function a(c){const l=Z8t(()=>c.map(d=>d.basename));for(let d=0,h=c.length;d=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}}const vle=class vle{constructor(){this.sessions=new Map}fileSearch(e,t,i,s){const o=this.getSessionTokenSource(e.cacheKey),r=new nii(e,t,o&&o.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(r,vle.BATCH_SIZE,c,s).then(l=>({limitHit:l.limitHit,stats:l.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:l.stats}:void 0,messages:[]}))}clearCache(e){this.getSessionTokenSource(e)?.cancel()}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new ai),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Qt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,s){const o=s.onCancellationRequested(()=>{e.cancel()}),r=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(r).then(c=>(a.length&&i(a),o.dispose(),c),c=>(a.length&&i(a),o.dispose(),Promise.reject(c)))}};vle.BATCH_SIZE=512;let CTe=vle;class n6e{constructor(e,t,i){this.queryProviderPair=e,this.fileUtils=t,this.processType=i,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t){const i=this.query.folderQueries||[],s=new ai(t);return new Promise((o,r)=>{this.collector=new oii(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);Y3(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,s.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!Y3(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),s.token))).then(l=>{s.dispose(),this.collector.flush();const d=l.some(h=>!!h&&!!h.limitHit);o({limitHit:this.isLimitHit||d,messages:l.flatMap(h=>h?.message?Array.isArray(h.message)?h.message:[h.message]:[]),stats:{type:this.processType}})},l=>{s.dispose();const d=Ma(l);r(new Error(d))})})}resultSize(e){return Y3(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],s=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:s.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const s=new Jst(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===_e.file?X8t(()=>this.fileUtils.readdir(ma(l.uri))):void 0,h=lO(e.folder,l.uri);if(h){const u=s.includedInQuery(h,yr(h),d);NS(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===z1.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(sii(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(Y3(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}getSearchOptionsForFolder(e){const t=$ne(this.query.includePattern,e.includePattern),i=$ne(this.query.excludePattern,e.excludePattern),s={folder:P.from(e.folder),excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,encoding:e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??Number.MAX_SAFE_INTEGER,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(s.usePCRE2=this.query.usePCRE2),s}}function sii(n){return{isCaseSensitive:n.isCaseSensitive||!1,isRegExp:n.isRegExp||!1,isWordMatch:n.isWordMatch||!1,isMultiline:n.isMultiline||!1,pattern:n.pattern}}class oii{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new yTe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!_n(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(rii(e))}pushToCollector(){const e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}}function rii(n){return Y3(n)?{preview:{matches:u9(n.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:n.preview.text},ranges:u9(n.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:n.text,lineNumber:n.lineNumber}}function Y3(n){return!!n.preview}const wW=class wW{constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},wW.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=0))}};wW.TIMEOUT=4e3,wW.START_BATCH_AFTER_COUNT=50;let yTe=wW;const Mat=ae("IExtHostSearch");let STe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Ue.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new CTe}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,t),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);const i=this._handlePool++;return this._aiTextSearchProvider.set(i,t),this._proxy.$registerAITextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,t),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}$provideFileSearchResults(e,t,i,s){const o=wme(i),r=this._fileSearchProvider.get(e);if(r)return this._fileSearchManager.fileSearch(o,r,a=>{this._proxy.$handleFileMatch(e,t,a.map(c=>c.resource))},s);throw new Error("3 unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,i){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,i,s){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`2 Unknown provider ${e}`);const r=wme(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$provideAITextSearchResults(e,t,i,s){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`1 Unknown provider ${e}`);const r=wme(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};STe=D([_(0,gr),_(1,pue),_(2,Ze)],STe);function wme(n){return{...n,folderQueries:n.folderQueries&&n.folderQueries.map(aii),extraFileResources:n.extraFileResources&&n.extraFileResources.map(e=>P.revive(e))}}function aii(n){return{...n,folder:P.revive(n.folder)}}var ATe,ZP;let ETe=(ZP=class{getState(){const e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e){this._onDidChangeWindowState=new I,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=ATe.InitialState,this._proxy=e.getProxy(Ue.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:t,isActive:i})=>{this.onDidChangeWindowProperty("focused",t),this.onDidChangeWindowProperty("active",i)})}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let i;if(typeof e=="string"){i=e;try{e=P.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Xv(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===_e.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Xv(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return P.from(i)}},ATe=ZP,ZP.InitialState={focused:!0,active:!0},ZP);ETe=ATe=D([_(0,gr)],ETe);const Nat=ae("IExtHostWindow");let Lre=class extends IYe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Or(i))),this._proxy=e.getProxy(Ue.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(P.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new cii(this._proxy,e,t,i)}};Lre=D([_(0,gr),_(1,Sg)],Lre);class cii extends ude{constructor(e,t,i,s){super(s?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,s).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){const i=[[e,t]];this.isLoggerCreated?this.doLog(i):this.buffer.push(...i)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}}const Pat=ae("IExtHostTerminalShellIntegration");let xTe=class extends ${constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=new I,this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=new I,this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=new I,this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(Ue.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,s]of this._activeShellIntegrations)s.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let s=this._activeShellIntegrations.get(e);s||(s=new lii(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,s),s.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),s.store.add(s.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),s.store.add(s.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),s.store.add(s.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=s.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:s.value})}$shellExecutionStart(e,t,i,s,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.startShellExecution(r,o)}$shellExecutionEnd(e,t,i,s,o){const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(lZ(t)?P.revive(t):t)}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};xTe=D([_(0,gr),_(1,Jz)],xTe);class lii extends ${get currentExecution(){return this._currentExecution}constructor(e,t){super(),this._terminal=e,this._onDidStartTerminalShellExecution=t,this._ignoreNextExecution=!1,this.store=this._register(new Z),this._onDidRequestChangeShellIntegration=this._register(new I),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new I),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new I),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event;const i=this;this.value={get cwd(){return i._cwd},executeCommand(s,o){let r=s;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:NM.High,isTrusted:!0},c=i.startShellExecution(a,i._cwd,!0).value;return i._ignoreNextExecution=!0,c}}}startShellExecution(e,t,i){if(this._ignoreNextExecution&&this._currentExecution)this._ignoreNextExecution=!1;else{this._currentExecution&&(this._currentExecution.endExecution(void 0),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0}));const s=this._currentExecution=new dii(e,t);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:s.value})):this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}return this._currentExecution}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){this._currentExecution&&(this._currentExecution.endExecution(e),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:t}),this._currentExecution=void 0)}setCwd(e){let t=!1;P.isUri(this._cwd)?t=!P.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value}))}}class dii{constructor(e,t){this._commandLine=e,this.cwd=t,this._ended=!1;const i=this;this.value={get commandLine(){return i._commandLine},get cwd(){return i.cwd},read(){return i._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._ended)return tg.EMPTY;this._dataStream=new hii}return this._dataStream.createIterable()}emitData(e){this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._dataStream=void 0,this._ended=!0}}class hii extends ${constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new Uh);const e=this._barrier;return new tg(async i=>{this._emitters.push(i),await e.wait()})}emitData(e){for(const t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open(),this._barrier=void 0}}ce(eBe,gTe,Yt.Delayed);ce(wp,Lre,Yt.Delayed);ce(_ue,ZLe,Yt.Delayed);ce(Yz,QLe,Yt.Eager);ce(JOe,dTe,Yt.Eager);ce(XOe,uTe,Yt.Eager);ce(hD,GLe,Yt.Eager);ce(fue,ULe,Yt.Eager);ce(Rat,bTe,Yt.Eager);ce(yat,$Le,Yt.Eager);ce(oj,YLe,Yt.Eager);ce(tBe,fTe,Yt.Eager);ce(Kz,uti,Yt.Eager);ce(bat,VLe,Yt.Delayed);ce(Mat,STe,Yt.Eager);ce(KOe,Dat,Yt.Eager);ce(xat,oTe,Yt.Eager);ce(Jz,XLe,Yt.Eager);ce(Pat,xTe,Yt.Eager);ce(OOe,y0e,Yt.Eager);ce(Nat,ETe,Yt.Eager);ce(dD,zLe,Yt.Eager);ce(ZOe,Iat,Yt.Eager);ce(mue,qLe,Yt.Eager);ce(rj,rTe,Yt.Eager);ce(iBe,vTe,Yt.Eager);const bme="vs/workbench/api/common/extHostLogService";let DTe=class extends YXe{constructor(e,t,i){const s=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(bme,0,"Extension Host (Remote)"):e?g(bme,1,"Extension Host (Worker)"):g(bme,2,"Extension Host");super(t.createLogger(s,{name:o}))}};DTe=D([_(1,wp),_(2,Sg)],DTe);class s6e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ze),s=e.get(gr).getProxy(Ue.MainThreadErrors);p_e(o=>{t.error(o);const r=EU(o);s.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ze),i=e.get(gr),s=e.get(_L),o=e.get(mue),r=i.getProxy(Ue.MainThreadExtensionService),a=i.getProxy(Ue.MainThreadErrors),c=await s.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,w;for(const C of p)m+=` - at ${C.toString()}`,w=C.getFileName(),!v&&w&&(v=c.findSubstr(P.file(w)));const b=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:b}),b}const h=Symbol("prepareStackTrace wrapped");let u=d;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return u},set(f){if(f===d||!f||f[h]){u=f||d;return}u=function(p,m){return d(p,m),f.call(Error,p,m)},Object.assign(u,{[h]:!0})}}),p_e(f=>{t.error(f);const p=EU(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}r.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=o.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class nBe{constructor(e,t,i,s,o){this._hostUtils=i,this._rpcProtocol=new Bne(e,null,s),t=nBe._transform(t,this._rpcProtocol);const r=new Dl(...Uve());r.set(Sg,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(gr,new OYt(this._rpcProtocol)),r.set(pue,new fti(s)),r.set(Lat,i),r.set(Ze,new Gi(DTe,[!0],!0)),r.set(wp,new Gi(Lre,[],!0));const a=new P7(r,!0);_9&&a.invokeFunction(s6e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ze)),vs("code/extHost/didCreateServices"),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info("Extension host started"),this._logService.trace("initData",t),this._extensionService=a.invokeFunction(c=>c.get(_L)),this._extensionService.initialize(),_9&&a.invokeFunction(s6e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Ue.MainThreadExtensionService);return P.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Ue.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[P.revive(t),P.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(s=>{s.extensionLocation=P.revive(t.transformIncomingURIs(s.extensionLocation))}),e.environment.appRoot=P.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(s=>P.revive(t.transformIncomingURIs(s)))),e.environment.extensionTestsLocationURI=P.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=P.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=P.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=P.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=P.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=P.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class uii{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const s=this._relatedInformationProviders.get(e);if(!s)throw new Error("related information provider not found");return await s.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(s,i),this._proxy.$registerAiRelatedInformationProvider(s,t),new oo(()=>{this._proxy.$unregisterAiRelatedInformationProvider(s),this._relatedInformationProviders.delete(s)})}}const gii=[new Vn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of DocumentHighlight-instances.",fA(L4.to))),new Vn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[Et.Uri],new In("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(n,e)=>{if(iO(n))return;class t extends n4{static to(s){const o=new t(s.name,Sw.to(s.kind),s.containerName||"",new _p(e[0],at.to(s.range)));return o.detail=s.detail,o.range=o.location.range,o.selectionRange=at.to(s.selectionRange),o.children=s.children?s.children.map(t.to):[],o}}return n.map(t.to)})),new Vn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[Et.Uri,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[Et.Uri,Et.Range,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[Et.Uri,Et.Position,new Et("ch","Trigger character",n=>typeof n=="string",n=>n),new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location-instances.",fA(P_.to))),new Vn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Hover-instances.",fA(ooe.to))),new Vn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[Et.Uri,new Et("position","A position in a text document",n=>Array.isArray(n)&&n.every(e=>Ps.isPosition(e)),n=>n.map(Wr.from))],new In("A promise that resolves to an array of ranges.",n=>n.map(e=>{let t;for(const i of e.reverse())t=new r4(at.to(i),t);return t}))),new Vn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[Et.String.with("query","Search string")],new In("A promise that resolves to an array of SymbolInformation-instances.",n=>n.map(EG.to))),new Vn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of CallHierarchyItem-instances",n=>n.map(KF.to))),new Vn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyIncomingCall-instances",n=>n.map(tIe.to))),new Vn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",n=>n.map(iIe.to))),new Vn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[Et.Uri,Et.Position],new In("A promise that resolves to a range and placeholder text.",n=>{if(n)return{range:at.to(n.range),placeholder:n.text}})),new Vn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[Et.Uri,Et.Position,Et.String.with("newName","The new symbol name")],new In("A promise that resolves to a WorkspaceEdit.",n=>{if(n){if(n.rejectReason)throw new Error(n.rejectReason);return lf.to(n)}})),new Vn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[Et.Uri,Et.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new In("A promise that resolves to an array of DocumentLink-instances.",n=>n.map(zM.to))),new Vn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[Et.Uri],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[Et.Uri],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[Et.Uri,Et.Range.optional()],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[Et.Uri,Et.Range],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),Et.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new In("A promise that resolves to a CompletionList-instance.",(n,e,t)=>{if(!n)return new WF([]);const i=n.suggestions.map(s=>aIe.to(s,t));return new WF(i,n.incomplete)})),new Vn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new In("A promise that resolves to SignatureHelp.",n=>{if(n)return DG.to(n)})),new Vn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[Et.Uri,Et.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new In("A promise that resolves to an array of CodeLens-instances.",(n,e,t)=>fA(i=>new O6(at.to(i.range),i.command&&t.fromInternal(i.command)))(n))),new Vn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[Et.Uri,new Et("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",n=>rs.isRange(n),n=>XS.isSelection(n)?ZS.from(n):at.from(n)),Et.String.with("kind","Code action kind to return code actions for").optional(),Et.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new In("A promise that resolves to an array of Command-instances.",(n,e,t)=>fA(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const s=new F6(i.title,i.kind?new Ja(i.kind):void 0);return i.edit&&(s.edit=lf.to(i.edit)),i.command&&(s.command=t.fromInternal(i.command)),s.isPreferred=i.isPreferred,s}})(n))),new Vn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[Et.Uri],new In("A promise that resolves to an array of ColorInformation objects.",n=>n?n.map(e=>new z6(at.to(e.range),T4.to(e.color))):[])),new Vn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new Et("color","The color to show and insert",n=>n instanceof VF,T4.from),new Et("context","Context object with uri and range",n=>!0,n=>({uri:n.uri,range:at.from(n.range)}))],new In("A promise that resolves to an array of ColorPresentation objects.",n=>n?n.map(goe.to):[])),new Vn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[Et.Uri,Et.Range],new In("A promise that resolves to an array of Inlay objects",(n,e,t)=>n.map(cIe.to.bind(void 0,t)))),new Vn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[Et.Uri],new In("A promise that resolves to an array of FoldingRange objects",(n,e)=>{if(n)return n.map(poe.to)})),new Vn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new In("A promise that resolves to an array of NotebookContentProvider static info objects.",fA(n=>({viewType:n.viewType,displayName:n.displayName,options:{transientOutputs:n.options.transientOutputs,transientCellMetadata:n.options.transientCellMetadata,transientDocumentMetadata:n.options.transientDocumentMetadata},filenamePattern:n.filenamePattern.map(e=>voe.to(e))})))),new Vn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[Et.Uri,Et.Range,new Et("context","An InlineValueContext",n=>n&&typeof n.frameId=="number"&&n.stoppedLocation instanceof rs,n=>aoe.from(n))],new In("A promise that resolves to an array of InlineValue objects",n=>n.map(roe.to))),new Vn("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new Et("uriOrString","Uri-instance or string (only http/https)",n=>P.isUri(n)||typeof n=="string"&&L9(n,_e.http,_e.https),n=>n),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional(),Et.String.with("label","").optional()],In.Void),new Vn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[Et.Uri.with("resource","Resource to open"),Et.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional()],In.Void),new Vn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[Et.Uri.with("left","Left-hand side resource of the diff editor"),Et.Uri.with("right","Right-hand side resource of the diff editor"),Et.String.with("title","Human readable title for the diff editor").optional(),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="object",n=>n&&[yd.from(n.viewColumn),C8.from(n)]).optional()],In.Void),new Vn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[Et.String.with("title","Human readable title for the changes editor"),new Et("resourceList","List of resources to compare",n=>{for(const e of n){if(e.length!==3)return!1;const[t,i,s]=e;if(!P.isUri(t)||!P.isUri(i)&&i!==void 0&&i!==null||!P.isUri(s)&&s!==void 0&&s!==null)return!1}return!0},n=>n)],In.Void),new Vn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[Et.TestItem],In.Void),new Vn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[Et.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],In.Void),new Vn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[Et.String.with("name","The context key name"),new Et("value","The context key value",()=>!0,n=>n)],In.Void),new Vn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[Et.Uri,Et.StringArray,new Et("MappedEditsContext","Mapped Edits Context",n=>_oe.is(n),n=>_oe.from(n))],new In("A promise that resolves to a workspace edit or null",n=>n?lf.to(n):null)),new Vn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new Et("Run arguments","",n=>!0,n=>{if(n)return{initialRange:n.initialRange?at.from(n.initialRange):void 0,initialSelection:XS.isSelection(n.initialSelection)?ZS.from(n.initialSelection):void 0,message:n.message,autoSend:n.autoSend,position:n.position?Wr.from(n.position):void 0}})],In.Void)];class fii{static register(e){gii.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",ndt)}}function fA(n){return e=>{if(Array.isArray(e))return e.map(n)}}function bY(n){if(!Array.isArray(n))return;const e=[];for(const t of n)BQe(t)?e.push(xG.to(t)):e.push(P_.to(t));return e}let kTe=class{constructor(e,t){this._proxy=e.getProxy(Ue.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const s=new $h(lf.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(s,void 0,i?.isRefactoring??!1)}};kTe=D([_(0,gr)],kTe);class pii{constructor(e,t,i,s,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=s,this._sessionDisposables=o,this._stopWatch=ao.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this;this._stopWatch.reset();const i=(s,o)=>{if(typeof this._firstProgress>"u"&&"content"in s&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,s),a={report:c=>{r?.then(l=>{l&&(vp.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,NG.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,Sx.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,CIe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,s)};this._apiObject={markdown(s){t(this.markdown);const o=new Jhe(s),r=TG.from(o);return i(r),this},markdownWithVulnerabilities(s,o){t(this.markdown),o&&Je(e._extension,"chatParticipantAdditions");const r=new fG(s,o),a=Soe.from(r);return i(a),this},filetree(s,o){t(this.filetree);const r=new Xhe(s,o),a=RG.from(r);return i(a),this},anchor(s,o){t(this.anchor);const r=new Zhe(s,o),a=MG.from(r);return i(a),this},button(s){t(this.anchor);const o=new eue(s),r=PG.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(s,o){t(this.progress);const r=new Fot(s,o),a=o?bIe.from(r):F4.from(r);return i(a,o),this},warning(s){t(this.progress),Je(e._extension,"chatParticipantAdditions");const o=new _G(s),r=NG.from(o);return i(r),this},reference(s,o){if(t(this.reference),"variableName"in s&&Je(e._extension,"chatParticipantAdditions"),"variableName"in s&&!s.value){const r=e._request.variables.variables.find(a=>a.name===s.variableName);if(r){let a;if(r.references?.length)a=r.references.map(c=>({kind:"reference",reference:{variableName:s.variableName,value:c.reference}}));else{const c=new GI(s,o);a=[Sx.from(c)]}return a.forEach(c=>i(c)),this}}else{const r=new GI(s,o),a=Sx.from(r);i(a)}return this},textEdit(s,o){t(this.textEdit),Je(e._extension,"chatParticipantAdditions");const r=new vG(s,o),a=Eoe.from(r);return i(a),this},detectedParticipant(s,o){t(this.detectedParticipant),Je(e._extension,"chatParticipantAdditions");const r=new pG(s,o),a=Aoe.from(r);return i(a),this},confirmation(s,o,r){t(this.confirmation),Je(e._extension,"chatParticipantAdditions");const a=new vke(s,o,r),c=wIe.from(a);return i(c),this},push(s){if(t(this.push),(s instanceof vG||s instanceof fG||s instanceof pG||s instanceof _G||s instanceof vke)&&Je(e._extension,"chatParticipantAdditions"),s instanceof GI)this.reference(s.value,s.iconPath);else{const o=xoe.from(s,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const d9=class d9 extends ${constructor(e,t,i,s){super(),this._logService=t,this.commands=i,this.quality=s,this._agents=new Map,this._sessionDisposables=this._register(new Zo),this._completionDisposables=this._register(new Zo),this._proxy=e.getProxy(Ue.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const s=d9._idPool++,o=new o6e(e,this.quality,t,this._proxy,s,i);return this._agents.set(s,o),o.isAgentEnabled()&&this._proxy.$registerAgent(s,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,s){const o=d9._idPool++,r=new o6e(e,this.quality,t,this._proxy,o,s);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,s){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let r=this._sessionDisposables.get(t.sessionId);r||(r=new Z,this._sessionDisposables.set(t.sessionId,r));const a=new pii(o.extension,t,this._proxy,this.commands.converter,r);try{const c=await this.prepareHistoryTurns(t.agentId,i),l=o.invoke(yIe.to(t),{history:c},a.apiObject,s);return await dw(Promise.resolve(l).then(d=>{if(d?.metadata)try{JSON.stringify(d.metadata)}catch(u){const f=`result.metadata MUST be JSON.stringify-able. Got error: ${u.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${f}`,o.extension),{errorDetails:{message:f},timings:a.timings}}let h;return d?.errorDetails&&(h={...d.errorDetails,responseIsIncomplete:!0}),h?.responseIsRedacted&&Je(o.extension,"chatParticipantPrivate"),{errorDetails:h,timings:a.timings,metadata:d?.metadata}}),s)}catch(c){return this._logService.error(c,o.extension),c instanceof qg&&c.cause&&(c=c.cause),{errorDetails:{message:Ma(c),responseIsIncomplete:!0}}}finally{a.close()}}async prepareHistoryTurns(e,t){const i=[];for(const s of t.history){const o=rH.to(s.result),r=e===s.request.agentId?o:{...o,metadata:void 0};i.push(new Oot(s.request.message,s.request.command,s.request.variables.variables.map(Doe.to),s.request.agentId));const a=Vi(s.response.map(c=>xoe.toContent(c,this.commands.converter)));i.push(new Bot(a,r,s.request.agentId,s.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,s,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=await this.prepareHistoryTurns(r.id,s),c=rH.to(i);return(await r.provideFollowups(c,{history:a},o)).filter(l=>{const d=!l.participant||fi.some(this._agents.values(),h=>h.id===l.participant&&Cn.equals(h.extension.identifier,r.extension.identifier));return d||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${l.participant}`),d}).map(l=>LG.from(l,e))}$acceptFeedback(e,t,i,s){const o=this._agents.get(e);if(!o)return;const r=rH.to(t);let a;switch(i){case zV.Down:a=y4.Unhelpful;break;case zV.Up:a=y4.Helpful;break}o.acceptFeedback(Object.freeze(s?{result:r,kind:a,reportIssue:s}:{result:r,kind:a}))}$acceptAction(e,t,i){const s=this._agents.get(e);if(!s||i.action.kind==="vote")return;const o=AIe.to(t,i,this.commands.converter);o&&s.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const s=this._agents.get(e);if(!s)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await s.invokeCompletionProvider(t,i)).map(a=>SIe.from(a,this.commands.converter,o))}async $provideWelcomeMessage(e,t,i){const s=this._agents.get(e);if(s)return await s.provideWelcomeMessage(O4.to(t),i)}async $provideSampleQuestions(e,t,i){const s=this._agents.get(e);if(s)return(await s.provideSampleQuestions(O4.to(t),i)).map(o=>LG.from(o,void 0))}};d9._idPool=0;let ITe=d9;class o6e{constructor(e,t,i,s,o,r){this.extension=e,this.quality=t,this.id=i,this._proxy=s,this._handle=o,this._requestHandler=r,this._onDidReceiveFeedback=new I,this._onDidPerformAction=new I}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}isAgentEnabled(){return!(this.quality==="stable"&&!Cd(this.extension,"chatParticipantPrivate"))}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const s=await this._followupProvider.provideFollowups(e,t,i);return s?s.filter(o=>!(o&&"commandId"in o)).filter(o=>!(o&&"message"in o)):[]}async provideWelcomeMessage(e,t){if(!this._welcomeMessageProvider)return[];const i=await this._welcomeMessageProvider.provideWelcomeMessage(e,t);return i?i.map(s=>typeof s=="string"?s:Qs.from(s)):[]}async provideSampleQuestions(e,t){if(!this._welcomeMessageProvider||!this._welcomeMessageProvider.provideSampleQuestions)return[];const i=await this._welcomeMessageProvider.provideSampleQuestions(e,t);return i||[]}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{s.isAgentEnabled()&&(this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof P?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof fg?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Qs.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Qs.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Qs.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1)}))},s=this;return{get id(){return s.id},get iconPath(){return s._iconPath},set iconPath(o){s._iconPath=o,i()},get requestHandler(){return s._requestHandler},set requestHandler(o){Bt(typeof o=="function","Invalid request handler"),s._requestHandler=o},get followupProvider(){return s._followupProvider},set followupProvider(o){s._followupProvider=o,i()},get isDefault(){return Je(s.extension,"defaultChatParticipant"),s._isDefault},set isDefault(o){Je(s.extension,"defaultChatParticipant"),s._isDefault=o,i()},get helpTextPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix},set helpTextPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix},set helpTextPostfix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix=o,i()},get isSecondary(){return Je(s.extension,"defaultChatParticipant"),s._isSecondary},set isSecondary(o){Je(s.extension,"defaultChatParticipant"),s._isSecondary=o,i()},get supportIssueReporting(){return Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting},set supportIssueReporting(o){Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return s._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");s._proxy.$registerAgentCompletionsProvider(s._handle,s.id,o.triggerCharacters)}else s._proxy.$unregisterAgentCompletionsProvider(s._handle,s.id)},get participantVariableProvider(){return Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider},set welcomeMessageProvider(o){Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider},onDidPerformAction:Cd(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){s._requester=o,i()},get requester(){return s._requester},set supportsSlowReferences(o){Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences},dispose(){e=!0,s._followupProvider=void 0,s._onDidReceiveFeedback.dispose(),s._proxy.$unregisterAgent(s._handle)}}}invoke(e,t,i,s){return this._requestHandler(e,t,i,s)}}const wle=class wle{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Ue.MainThreadChatVariables)}async $resolveVariable(e,t,i,s){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Je(o.extension,"chatParticipantAdditions");const r=new mii(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,s);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},s);if(r&&r[0])return r[0].value}}catch(r){er(r)}}registerVariableResolver(e,t,i,s,o,r,a,c,l){const d=wle._idPool++,h=l?$e.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:s,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:s,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}attachContext(e,t,i){this._proxy.$attachContext(e,_p.isLocation(t)?yx.from(t):t,O4.from(i))}};wle._idPool=0;let LTe=wle;class mii{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this,i=s=>{this._proxy.$handleProgressChunk(this._requestId,s)};this._apiObject={progress(s){t(this.progress);const o=new mG(s),r=F4.from(o);return i(r),this},reference(s){t(this.reference);const o=new GI(s),r=Sx.from(o);return i(r),this},push(s){return t(this.push),s instanceof GI?i(Sx.from(s)):s instanceof mG&&i(F4.from(s)),this}}}return this._apiObject}}class _ii{constructor(e){const t=e.getProxy(Ue.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const Fat="vscode-cdn.net",vii=`vscode-resource.${Fat}`,TTe=`'self' https://*.${Fat}`;function O8(n,e){return n.scheme===_e.http||n.scheme===_e.https?n:(e&&e.authority&&e.isRemote&&n.scheme===_e.file&&(n=P.from({scheme:_e.vscodeRemote,authority:e.authority,path:n.path})),P.from({scheme:_e.https,authority:`${n.scheme}+${wii(n.authority)}.${vii}`,path:n.path,fragment:n.fragment,query:n.query}))}function wii(n){return n.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=Q.a&&t<=Q.z||t>=Q.A&&t<=Q.Z||t>=Q.Digit0&&t<=Q.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class bii{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new Z,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const s=t.getVisibleTextEditors();for(const o of this._insets.values())s.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,s,o){let r;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){r=f;break}if(!r)throw new Error("not a visible editor");const a=this,c=this._handlePool++,l=new I,d=new I,h=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(f){return O8(f,a._remoteInfo)}get cspSource(){return TTe}set options(f){this._options=f,a._proxy.$setOptions(c,f)}get options(){return this._options}set html(f){this._html=f,a._proxy.$setHtml(c,f)}get html(){return this._html}get onDidReceiveMessage(){return l.event}postMessage(f){return a._proxy.$postMessage(c,f)}},u=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=h,this.onDidDispose=d.event}dispose(){a._insets.has(c)&&(a._insets.delete(c),a._proxy.$disposeEditorInset(c),d.fire(),d.dispose(),l.dispose())}};return this._proxy.$createEditorInset(c,r.id,r.value.document.uri,t+1,i,s||{},o.identifier,o.extensionLocation),this._insets.set(c,{editor:e,inset:u,onDidReceiveMessage:l}),u}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}function Cii(n,e,t){const i=n.getProxy(Ue.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new Ga,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===Fs.CommentController){const w=this._commentControllers.get(v.handle);return w?w.value:v}else if(v&&v.$mid===Fs.CommentThread){const w=v,b=this._commentControllers.get(w.commentControlHandle);if(!b)return w;const C=b.getCommentThread(w.commentThreadHandle);return C?C.value:w}else if(v&&(v.$mid===Fs.CommentThreadReply||v.$mid===Fs.CommentThreadInstance)){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);return b?v.$mid===Fs.CommentThreadInstance?b.value:{thread:b.value,text:v.text}:v}else if(v&&v.$mid===Fs.CommentNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.commentUniqueId,y=b.getCommentByUniqueId(C);return y||v}else if(v&&v.$mid===Fs.CommentThreadNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.text,y=v.commentUniqueId,S=b.getCommentByUniqueId(y);return S?(typeof S.body=="string"?S.body=C:S.body=new vp(C),S):v}return v}})}createCommentController(v,w,b){const C=f.handlePool++,y=new r(v,C,w,b);this._commentControllers.set(y.handle,y);const S=this._commentControllersByExtension.get(v.identifier)||[];return S.push(y),this._commentControllersByExtension.set(v.identifier,S),y.value}async $createCommentThreadTemplate(v,w,b,C){const y=this._commentControllers.get(v);y&&y.$createCommentThreadTemplate(w,b,C)}async $setActiveComment(v,w){const b=this._commentControllers.get(v);b&&b.$setActiveComment(w??void 0)}async $updateCommentThreadTemplate(v,w,b){const C=this._commentControllers.get(v);C&&C.$updateCommentThreadTemplate(w,b)}$deleteCommentThread(v,w){this._commentControllers.get(v)?.$deleteCommentThread(w)}async $provideCommentingRanges(v,w,b){const C=this._commentControllers.get(v);if(!C||!C.commentingRangeProvider)return Promise.resolve(void 0);const y=await t.ensureDocumentData(P.revive(w));return Zu(async()=>{const S=await C.commentingRangeProvider.provideCommentingRanges(y.document,b);let M;return Array.isArray(S)?M={ranges:S,fileComments:!1}:S?M={ranges:S.ranges||[],fileComments:S.fileComments||!1}:M=S??void 0,M}).then(S=>{let M;return S&&(M={ranges:S.ranges.map(k=>at.from(k)),fileComments:S.fileComments}),M})}$toggleReaction(v,w,b,C,y){const S=this._commentControllers.get(v);return!S||!S.reactionHandler?Promise.resolve(void 0):Zu(()=>{const M=S.getCommentThread(w);if(M){const k=M.getCommentByUniqueId(C.uniqueIdInThread);if(S!==void 0&&k&&S.reactionHandler)return S.reactionHandler(k,l(y))}return Promise.resolve(void 0)})}};f.handlePool=0;let s=f;const p=class p{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire()}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?(Je(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,w,b,C,y,S,M,k,F){this._commentControllerHandle=w,this._id=b,this._uri=C,this._range=y,this._comments=S,this.extensionDescription=M,this._isTemplate=k,this.handle=p._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new I,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new Dn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(w,this.handle,this._id,this._uri,at.from(this._range),M.identifier,this._isTemplate,F),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this.comments=S,this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(w,this.handle)}});const N=this;this.value={get uri(){return N.uri},get range(){return N.range},set range(z){N.range=z},get comments(){return N.comments},set comments(z){N.comments=z},get collapsibleState(){return N.collapsibleState},set collapsibleState(z){N.collapsibleState=z},get canReply(){return N.canReply},set canReply(z){N.canReply=z},get contextValue(){return N.contextValue},set contextValue(z){N.contextValue=z},get label(){return N.label},set label(z){N.label=z},get state(){return N.state},set state(z){N.state=z},dispose:()=>{N.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new Z);const v=b=>Object.prototype.hasOwnProperty.call(this.modifications,b),w={};v("range")&&(w.range=at.from(this._range)),v("label")&&(w.label=this.label),v("contextValue")&&(w.contextValue=this.contextValue??null),v("comments")&&(w.comments=this._comments.map(b=>a(this,b,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(w.collapseState=d(this._collapseState)),v("canReply")&&(w.canReply=this.canReply),v("state")&&(w.state=h(this._state)),v("applicability")&&(w.applicability=u(this._state)),v("isTemplate")&&(w.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,w)}getCommentByUniqueId(v){for(const w of this._commentsMap){const b=w[0],C=w[1];if(v===C)return b}}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};p._handlePool=0;let o=p;class r{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&Je(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return Je(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Je(this._extension,"activeComment"),this._activeThread}constructor(v,w,b,C){this._extension=v,this._handle=w,this._id=b,this._label=C,this._threads=new Map,i.$registerCommentController(this.handle,b,C,this._extension.identifier.value);const y=this;this.value=Object.freeze({id:y.id,label:y.label,get options(){return y.options},set options(S){y.options=S},get commentingRangeProvider(){return y.commentingRangeProvider},set commentingRangeProvider(S){y.commentingRangeProvider=S},get reactionHandler(){return y.reactionHandler},set reactionHandler(S){y.reactionHandler=S},get activeCommentThread(){return y.activeCommentThread},createCommentThread(S,M,k){return y.createCommentThread(S,M,k).value},dispose:()=>{y.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,w,b){w===void 0&&Je(this._extension,"fileComments");const C=new o(this.id,this.handle,void 0,v,w,b,this._extension,!1);return this._threads.set(C.handle,C),C}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const w=this._threads.get(v.commentThreadHandle);w&&(this._activeComment=v.uniqueIdInThread?w.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=w)}$createCommentThreadTemplate(v,w,b){const C=new o(this.id,this.handle,void 0,P.revive(v),at.to(w),[],this._extension,!0,b);return C.collapsibleState=zl.Expanded,this._threads.set(C.handle,C),C}$updateCommentThreadTemplate(v,w){const b=this._threads.get(v);b&&(b.range=at.to(w))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(m,v,w,b){let C=w.get(v);return C||(C=++m.commentHandle,w.set(v,C)),v.state!==void 0&&Je(b,"commentsDraftState"),v.reactions?.some(y=>y.reactors!==void 0)&&Je(b,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:C,body:typeof v.body=="string"?v.body:Qs.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(y=>c(y)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?rue(m.iconPath):void 0,count:m.count,hasReacted:m.authorHasReacted,reactors:m.reactors&&m.reactors.length>0&&typeof m.reactors[0]!="string"?m.reactors.map(v=>v.name):m.reactors}}function l(m){return{label:m.label||"",count:m.count||0,iconPath:m.iconPath?P.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case m4.Expanded:return zl.Expanded;case m4.Collapsed:return zl.Collapsed}return zl.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case _4.Unresolved:return hg.Unresolved;case _4.Resolved:return hg.Resolved}return hg.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case iG.Current:return kI.Current;case iG.Outdated:return kI.Outdated}return kI.Current}return new s}var UR,VR,Aq,Eq,xq,dy,zR,$R,GR,qR,Dq,KH,QR;class yii{constructor(e,t,i,s,o,r,a){kt(this,UR);kt(this,VR);kt(this,Aq);kt(this,Eq);kt(this,xq);kt(this,dy);kt(this,zR);kt(this,$R);kt(this,GR);kt(this,qR);kt(this,Dq);kt(this,KH);kt(this,QR);st(this,zR,""),st(this,GR,!1),st(this,qR,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,st(this,QR,new I),this._onDidDispose=se(this,QR).event,st(this,UR,e),st(this,VR,t),st(this,$R,i),st(this,Eq,s),st(this,xq,o),st(this,dy,r),st(this,Dq,q4(r)),st(this,KH,Sii(r)),st(this,Aq,a)}dispose(){st(this,GR,!0),se(this,QR).fire(),se(this,QR).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return st(this,qR,!0),O8(e,se(this,Eq))}get cspSource(){const e=se(this,dy).extensionLocation;if(e.scheme===_e.https||e.scheme===_e.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+TTe}return TTe}get html(){return this.assertNotDisposed(),se(this,zR)}set html(e){this.assertNotDisposed(),se(this,zR)!==e&&(st(this,zR,e),se(this,KH)&&!se(this,qR)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(st(this,qR,!0),se(this,Aq).report("Webview vscode-resource: uris",se(this,dy),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),se(this,VR).$setHtml(se(this,UR),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),se(this,$R)}set options(e){this.assertNotDisposed(),Io(se(this,$R),e)||se(this,VR).$setOptions(se(this,UR),Oat(se(this,dy),se(this,xq),e)),st(this,$R,e)}async postMessage(e){if(se(this,GR))return!1;const t=zot(e,{serializeBuffersForPostMessage:se(this,Dq)});return se(this,VR).$postMessage(se(this,UR),t.message,...t.buffers)}assertNotDisposed(){if(se(this,GR))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!se(this,KH))return e;const t=se(this,dy).extensionLocation?.scheme===_e.vscodeRemote,i=se(this,dy).extensionLocation.scheme===_e.vscodeRemote?se(this,dy).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}UR=new WeakMap,VR=new WeakMap,Aq=new WeakMap,Eq=new WeakMap,xq=new WeakMap,dy=new WeakMap,zR=new WeakMap,$R=new WeakMap,GR=new WeakMap,qR=new WeakMap,Dq=new WeakMap,KH=new WeakMap,QR=new WeakMap;function q4(n){try{const e=L6(I6(n.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function Sii(n){try{const e=L6(I6(n.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class Aii extends ${constructor(e,t,i,s,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=s,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Ue.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const s=this.getWebview(e);if(s){const{message:o}=$ot(t,i.value);s._onMessageEmitter.fire(o)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const s=new yii(e,this._webviewProxy,Eii(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,s);const o=s._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return s}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function Tre(n){return{id:n.identifier,location:n.extensionLocation}}function Oat(n,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||xii(n,e)}}function Eii(n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots?.map(e=>P.from(e))}}function xii(n,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),n.extensionLocation]}const ble=class ble{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){ble.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};ble.enableDebugLogging=!1;let F_=ble;class Dii{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new F_("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=Mii(this.document.uri)+this._backupCounter++;return Qt(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class kii{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const s=this.key(e,t.uri);if(this._documents.has(s))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new Dii(t,i);return this._documents.set(s,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var SI;(function(n){n[n.Text=0]="Text",n[n.Custom=1]="Custom"})(SI||(SI={}));class Iii{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:SI.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:SI.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new oo(()=>this._providers.delete(e))}}class Lii{constructor(e,t,i,s,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=s,this._extHostWebviewPanels=o,this._editorProviders=new Iii,this._documents=new kii,this._proxy=e.getProxy(Ue.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,s){const o=new Z;return Tii(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(Tre(e),t,s.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},q4(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),CY(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(Rii(r)){const c=a.addEdit(r);this._proxy.$onDidEdit(r.document.uri,t,c,r.label)}else this._proxy.$onContentChange(r.document.uri,t)})),this._proxy.$registerCustomEditorProvider(Tre(e),t,s.webviewOptions||{},!!s.supportsMultipleEditorsPerDocument,q4(e))),oo.from(o,new oo(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,s,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==SI.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=P.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:s?.buffer},o);let l;return CY(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:CY(r.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==SI.Custom)throw new Error(`Invalid provider type for '${t}'`);const s=P.revive(e),{document:o}=this.getCustomDocumentEntry(t,s);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,s,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=yd.to(o),l=this._extHostWebview.createNewWebview(t,s.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,s.title,c,s.options,l,s.active),h=P.revive(e);switch(a.type){case SI.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case SI.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,r)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const s=this._editorProviders.get(i);if(!s)throw new Error(`No provider found for '${i}'`);if(!s.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const o=this._extHostWebviewPanels.getWebviewPanel(e);if(!o)throw new Error("No webview found");const r=P.revive(t),a=this._extHostDocuments.getDocument(r);await s.provider.moveCustomTextEditor(a,o,qe.None)}async $undo(e,t,i,s){return this.getCustomDocumentEntry(t,e).undo(i,s)}async $redo(e,t,i,s){return this.getCustomDocumentEntry(t,e).redo(i,s)}async $revert(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(s.document,i),s.disposeBackup()}async $onSave(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(s.document,i),s.disposeBackup()}async $onSaveAs(e,t,i,s){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,P.revive(i),s)}async $backup(e,t,i){const s=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(s.document,{destination:s.getNewBackupUri()},i);return s.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,P.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!CY(i))throw new Error("Custom document is not editable");return i}}function CY(n){return!!n.onDidChangeCustomDocument}function Tii(n){return typeof n.resolveCustomTextEditor=="function"}function Rii(n){return typeof n.undo=="function"&&typeof n.redo=="function"}function Mii(n){const e=n.scheme===_e.file||n.scheme===_e.untitled?n.fsPath:n.toString();return Ed(e)+""}var jD;const Nii="vs/workbench/api/common/extHostDiagnostics";var YA,Lk,bh;const LBe=class LBe{constructor(e,t,i,s,o,r,a,c){kt(this,YA);kt(this,Lk);kt(this,bh);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=s,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(s,i),st(this,bh,new wi(l=>r.getComparisonKey(l))),st(this,YA,a),st(this,Lk,c)}dispose(){this._isDisposed||(se(this,Lk).fire([...se(this,bh).keys()]),se(this,YA)?.$clear(this._owner),se(this,bh).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(P.isUri(e)){if(!t){this.delete(e);return}se(this,bh).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(LBe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&se(this,bh).get(r).length===0&&se(this,bh).delete(r),r=c,i.push(c),se(this,bh).set(c,[])),l)se(this,bh).get(c)?.push(...l);else{const d=se(this,bh).get(c);d&&(d.length=0)}}}if(se(this,Lk).fire(i),!se(this,YA))return;const s=[];let o=0;for(const r of i){let a=[];const c=se(this,bh).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Th.Error,Th.Warning,Th.Information,Th.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...k4.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ys.Info,message:g(Nii,0,"Not showing {0} further errors and warnings.",c.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=c.map(l=>({...k4.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(s.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}se(this,YA).$changeMany(this._owner,s)}delete(e){this._checkDisposed(),se(this,Lk).fire([e]),se(this,bh).delete(e),se(this,YA)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),se(this,Lk).fire([...se(this,bh).keys()]),se(this,bh).clear(),se(this,YA)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,s]of this)e.call(t,i,s,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of se(this,bh).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=se(this,bh).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(se(this,bh).get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()t[0].toString()?1:0}};YA=new WeakMap,Lk=new WeakMap,bh=new WeakMap;let Rre=LBe;var sx;let RTe=(sx=class{static _mapper(e){const t=new wi;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,s){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=s,this._collections=new Map,this._onDidChangeDiagnostics=new Fle({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=T.map(this._onDidChangeDiagnostics.event,jD._mapper),this._proxy=e.getProxy(Ue.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:s,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){s.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){s.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){s.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+jD._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+jD._idPool++;while(i.has(d))}return new class extends Rre{constructor(){super(t,d,jD._maxDiagnosticsTotal,jD._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,o),i.set(d,this)}dispose(){super.dispose(),i.delete(d)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const s of this._collections.values())s.forEach((o,r)=>{let a=t.get(o.toString());typeof a>"u"&&(a=i.length,t.set(o.toString(),a),i.push([o,[]])),i[a][1]=i[a][1].concat(...r)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new Rre(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(P.revive(t),i.map(k4.to))}},jD=sx,sx._idPool=0,sx._maxDiagnosticsPerFile=1e3,sx._maxDiagnosticsTotal=1.1*jD._maxDiagnosticsPerFile,sx);RTe=jD=D([_(1,Ze),_(2,Kz)],RTe);class Pii{constructor(e){this._proxy=e.getProxy(Ue.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Je(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(s=>P.revive(s)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?P.revive(t):void 0)}}const Cle=class Cle{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(_e).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=Cle._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let s;if(typeof t.onDidChange=="function"){let o;s=t.onDidChange(async r=>{if(r.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${r.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(r))return;o&&await o;const a=this.$provideTextDocumentContent(i,r).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(r);if(!l)return;const d=xw(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(bt).finally(()=>{o===a&&(o=void 0)});o=a})}return new oo(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),s&&(s.dispose(),s=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(P.revive(t),qe.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};Cle._handlePool=0;let MTe=Cle;class Fii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._callbacks=new td,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,s)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(s)&&s.push(r),r}}async $participateInSave(e,t){const i=P.revive(e);let s=!1;const o=setTimeout(()=>s=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(s)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:foe.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],s){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,s).then(()=>!0,r=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(r),!(r instanceof Error)||r.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,s){const o=[],r=Date.now(),{document:a,reason:c}=s,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw Nle("waitUntil can not be called async");o.push(Promise.resolve(h))}});try{t.apply(i,[d])}catch(h){return Promise.reject(h)}return new Promise((h,u)=>{const f=setTimeout(()=>u(new Error("timeout")),this._thresholds.timeout);return Promise.all(o).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-r}ms`),clearTimeout(f),h(p)}).catch(p=>{clearTimeout(f),u(p)})}).then(h=>{const u={edits:[]};for(const f of h)if(Array.isArray(f)&&f.every(p=>p instanceof qx))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&at.from(v),text:p,eol:m&&R4.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(u)):Promise.reject(new Error("concurrent_edits"))})}}class Oii{constructor(e,t){this._onDidAddDocument=new I,this._onDidRemoveDocument=new I,this._onDidChangeDocument=new I,this._onDidSaveDocument=new I,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new Z,this._documentLoader=new Map,this._proxy=e.getProxy(Ue.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const s of i)this._onDidRemoveDocument.fire(s.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const s of i)this._onDidAddDocument.fire(s.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e){const t=this._documentsAndEditors.getDocument(e);if(t)return Promise.resolve(t);let i=this._documentLoader.get(e.toString());return i||(i=this._proxy.$tryOpenDocument(e).then(s=>{this._documentLoader.delete(e.toString());const o=P.revive(s);return ws(this._documentsAndEditors.getDocument(o))},s=>(this._documentLoader.delete(e.toString()),Promise.reject(s))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>P.revive(t))}$acceptModelLanguageChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");this._onDidRemoveDocument.fire(s.document),s._acceptLanguageId(t),this._onDidAddDocument.fire(s.document)}$acceptModelSaved(e){const t=P.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptIsDirty(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const s=P.revive(e),o=this._documentsAndEditors.getDocument(s);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=l4.Undo:t.isRedoing&&(r=l4.Redo),this._onDidChangeDocument.fire(Xqe({document:o.document,contentChanges:t.changes.map(a=>({range:at.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){kti(e,t)}}class Bii{constructor(e){this._provider=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const s=this._handlePool++;return this._proxy.$registerEmbeddingProvider(s,t),this._provider.set(s,{id:t,provider:i}),Ee(()=>{this._proxy.$unregisterEmbeddingProvider(s),this._provider.delete(s)})}async computeEmbeddings(e,t,i){i??=qe.None;let s=!1;typeof t=="string"&&(t=[t],s=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(s){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const s=this._provider.get(e);if(!s)return[];const o=await s.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Wii{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const s=this._AiEmbeddingVectorProviders.get(e);if(!s)throw new Error("Embedding vector provider not found");const o=await s.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(s,i),this._proxy.$registerAiEmbeddingVectorProvider(t,s),new oo(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(s),this._AiEmbeddingVectorProviders.delete(s)})}}class Hii{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,s,o=Bi.LastKnownState,r=Bi.LastKnownState;for(const a of e){let c=i?LS(i,a):0;for(c===0?s=Bi.Start:s=r;c{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(l)});const c=i.onDidChangeFile(l=>{const d=[];for(const h of l){const{uri:u,type:f}=h;if(u.scheme!==t)continue;let p;switch(f){case OM.Changed:p=Ko.UPDATED;break;case OM.Created:p=Ko.ADDED;break;case OM.Deleted:p=Ko.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(o,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(o),this._proxy.$unregisterProvider(o)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:s,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:s,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(P.revive(t))).then(i=>Mre._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(P.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(P.revive(t))).then(i=>ze.wrap(i))}$writeFile(e,t,i,s){return Promise.resolve(this._getFsProvider(e).writeFile(P.revive(t),i.buffer,s))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(P.revive(t),i))}$rename(e,t,i,s){return Promise.resolve(this._getFsProvider(e).rename(P.revive(t),P.revive(i),s))}$copy(e,t,i,s){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(P.revive(t),P.revive(i),s))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(P.revive(t)))}$watch(e,t,i,s){const o=this._getFsProvider(e).watch(P.revive(i),s);this._watches.set(t,o)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const s=this._getFsProvider(e);if(!s.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(s.open(P.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,s){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=ze.alloc(s);return Promise.resolve(o.read(t,i,r.buffer,0,s)).then(a=>r.slice(0,a))}$write(e,t,i,s){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,s.buffer,0,s.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}class Uii{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,s,o,r){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,r?.ignoreCreateEvents&&(this._config+=1),r?.ignoreChangeEvents&&(this._config+=2),r?.ignoreDeleteEvents&&(this._config+=4);const a=_w(o),c=typeof o=="string",l=r?.correlate,d=s(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!r?.ignoreCreateEvents)for(const u of h.created){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=oo.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,s,o){const r=oo.from();if(typeof i=="string"||s?.ignoreChangeEvents&&s?.ignoreCreateEvents&&s?.ignoreDeleteEvents)return r;const a=e.getProxy(Ue.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(mR)||i.pattern.includes(qwe))&&(c=!0);let l;return o&&(s?.ignoreChangeEvents||s?.ignoreCreateEvents||s?.ignoreDeleteEvents)&&(l=JD.UPDATED|JD.ADDED|JD.DELETED,s?.ignoreChangeEvents&&(l&=~JD.UPDATED),s?.ignoreCreateEvents&&(l&=~JD.ADDED),s?.ignoreDeleteEvents&&(l&=~JD.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:s?.excludes??[],filter:l},!!o),oo.from({dispose:()=>a.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class Vii{constructor(e){this._events=e,this.session=this._events.session,this._created=new Ya(()=>this._events.created.map(P.revive)),this._changed=new Ya(()=>this._events.changed.map(P.revive)),this._deleted=new Ya(()=>this._events.deleted.map(P.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class zii{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new I,this._onDidRenameFile=new I,this._onDidCreateFile=new I,this._onDidDeleteFile=new I,this._onWillRenameFile=new EI,this._onWillCreateFile=new EI,this._onWillDeleteFile=new EI,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,s){return new Uii(this._mainContext,e,t,this._onFileSystemEvent.event,Zp.from(i),s)}$onFileEvent(e){this._onFileSystemEvent.fire(new Vii(e))}$onDidRunFileOperation(e,t){switch(e){case Li.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:P.revive(i.source),newUri:P.revive(i.target)}))}));break;case Li.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break;case Li.CREATE:case Li.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,s,o)=>{const r=function(c){i.call(s,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,s){switch(e){case Li.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:P.revive(o.source),newUri:P.revive(o.target)}))},i,s);case Li.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>P.revive(o.target))},i,s);case Li.CREATE:case Li.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>P.revive(o.target))},i,s)}}async _fireWillEvent(e,t,i,s){const o=new Set,r=[];if(await e.fireAsync(t,s,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof q1&&(r.push([l.extension,h]),o.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),s.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=lf.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class $ii{constructor(e,t,i,s,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=s;const r=new Vn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new Et("showOptions","Show Options",a=>!0,a=>a),new Et("resource","Interactive resource Uri",a=>!0,a=>a),new Et("controllerId","Notebook controller Id",a=>!0,a=>a),new Et("title","Interactive editor title",a=>!0,a=>a)],new In("Notebook and input URI",a=>{if(o.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return o.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,s){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class Gii{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}const Bat="vs/workbench/api/common/extHostLanguageFeatures";class Nre{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentSymbols(i,t);if(!iO(s))return s[0]instanceof s4?s.map(eIe.from):Nre._asDocumentSymbolTree(s)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((s,o)=>{let r=s.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(s.location.range.end)),r});const t=[],i=[];for(const s of e){const o={name:s.name||"!!MISSING: name!!",kind:Sw.from(s.kind),tags:s.tags?.map(Qx.from)||[],detail:"",containerName:s.containerName,range:at.from(s.location.range),selectionRange:at.from(s.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(O.containsRange(r.range,o.range)&&!O.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class yY{constructor(e,t,i,s,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=s,this._extTelemetry=o,this._logService=r,this._cache=new F_("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideCodeLenses(i,t);if(!s||t.isCancellationRequested)return;const o=this._cache.add(s),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;croe.from(a))}}class u6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideDocumentHighlights(s,o,i);if(Array.isArray(r))return r.map(L4.from)}}class g6e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,s){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Wr.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,s);if(Array.isArray(c))return c.map(sIe.from)}}class f6e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideLinkedEditingRanges(s,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Vi(r.ranges.map(at.from)),wordPattern:r.wordPattern}}}class p6e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideReferences(o,r,i,s);if(Array.isArray(a))return a.map(P_.from)}}const bW=class bW{constructor(e,t,i,s,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=s,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new F_("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,s){const o=this._documents.getDocument(e),r=mt.isISelection(t)?ZS.to(t):at.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>bW._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Ja(i.only):void 0,triggerKind:vIe.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,s);if(!mo(l)||s.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fat.to(l)),a=rw.toDataTransfer(i,()=>{throw new tlt});if(await this._provider.prepareDocumentPaste(o,r,a,s),s.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof mse));return rw.from(c)}async providePasteEdits(e,t,i,s,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>at.to(u)),l=rw.toDataTransfer(s,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new u4(o.only):void 0,triggerKind:o.triggerKind},r);if(!d||r.isCancellationRequested)return[];const h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,0,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class m6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(s,t,i);if(Array.isArray(o))return o.map(nh.from)}}class Cme{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,s){const o=this._documents.getDocument(e),r=at.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}async provideDocumentRangesFormattingEdits(e,t,i,s){Bt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(at.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}}class _6e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,s,o){const r=this._documents.getDocument(e),a=Wr.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,s,o);if(Array.isArray(c))return c.map(nh.from)}}class SY{constructor(e,t){this._provider=e,this._logService=t,this._cache=new F_("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!mo(i))return{symbols:[]};const s=this._cache.add(i),o={cacheId:s,symbols:[]};for(let r=0;ro.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(h9._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};h9.languageTriggerKindToVSCodeTriggerKind={[rF.Invoke]:tG.Invoke,[rF.Automatic]:tG.Automatic};let W8=h9;class yme{constructor(e,t){this.resultId=e,this.tokens=t}}class Op{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=t!==0?this._previousResults.get(t):null;let r=typeof o?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(s,o.resultId,i):await this._provider.provideDocumentSemanticTokens(s,i);return o&&this._previousResults.delete(t),r?(r=Op._fixProvidedSemanticTokens(r),this._send(Op._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Op._isSemanticTokens(e)?Op._isCorrectSemanticTokens(e)?e:new GF(new Uint32Array(e.data),e.resultId):Op._isSemanticTokensEdits(e)?Op._isCorrectSemanticTokensEdits(e)?e:new _8(e.edits.map(t=>new mOe(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!Op._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,s=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(s,r);for(;a({start:s.start,deleteCount:s.deleteCount,data:s.data}))})}return null}}class v6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(s,at.to(t),i);return o?this._send(o):null}_send(e){return d6({id:0,type:"full",data:e.data})}}class $T{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=s,this._extension=o,this._cache=new F_("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=o.getWordRangeAtPosition(r)||new rs(r,r),c=a.with({end:r}),l=new ao,d=await this._provider.provideCompletionItems(o,r,s,rIe.to(i));if(!d||s.isCancellationRequested)return;const h=Array.isArray(d)?new WF(d):d,u=$T.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[aS.completions]:p,[aS.defaultRanges]:{replace:at.from(a),insert:at.from(c)},[aS.isIncomplete]:h.isIncomplete||void 0,[aS.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Qs.fromStrict(e.documentation),[Oi.sortText]:e.sortText!==e.label?e.sortText:void 0,[Oi.filterText]:e.filterText!==e.label?e.filterText:void 0,[Oi.preselect]:e.preselect||void 0,[Oi.insertTextRules]:e.keepWhitespace?cp.KeepWhitespace:cp.None,[Oi.commitCharacters]:e.commitCharacters?.join(""),[Oi.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(nh.from),[Oi.commandIdent]:r?.$ident,[Oi.commandId]:r?.id,[Oi.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Oi.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Oi.insertText]=e.insertText:e.insertText instanceof Q1&&(a[Oi.insertText]=e.insertText.value,a[Oi.insertTextRules]|=cp.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),rs.isRange(c)?a[Oi.range]=at.from(c):c&&(!i?.isEqual(c.inserting)||!s?.isEqual(c.replacing))&&(a[Oi.range]={insert:at.from(c.inserting),replace:at.from(c.replacing)}),a}}class J3{async provideInlineCompletions(e,t,i,s){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,s){}}class qii extends J3{constructor(e,t,i,s){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this._isAdditionsProposedApiEnabled=Cd(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[Ub.Automatic]:p4.Automatic,[Ub.Explicit]:p4.Invoke}}get supportsHandleEvents(){return Cd(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:at.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},s);if(!a||s.isCancellationRequested)return;const c=Array.isArray(a)?a:a.items,l=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],d=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let h;return{pid:this._references.createReferenceId({dispose(){h?.dispose()},items:c}),items:c.map((f,p)=>{let m;f.command&&(h||(h=new Z),m=this._commands.toInternal(f.command,h));const v=f.insertText;return{insertText:typeof v=="string"?v:{snippet:v.value},filterText:f.filterText,range:f.range?at.from(f.range):void 0,command:m,idx:p,completeBracketPairs:this._isAdditionsProposedApiEnabled?f.completeBracketPairs:!1}}),commands:l.map(f=>(h||(h=new Z),this._commands.toInternal(f,h))),suppressSuggestions:!1,enableForwardStability:d}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const s=this._references.get(e)?.items[t];s&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(s,i)}handlePartialAccept(e,t,i,s){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,EIe.to(s)))}}class Sme{async provideInlineEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(s,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!o||i.isCancellationRequested)return;let r;const a=this._references.createReferenceId({dispose(){r?.dispose()},item:o});let c;o.accepted&&(r||(r=new Z),c=this._commands.toInternal(o.accepted,r));let l;return o.rejected&&(r||(r=new Z),l=this._commands.toInternal(o.rejected,r)),{pid:a,text:o.text,range:at.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,s){this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this.languageTriggerKindToVSCodeTriggerKind={[MU.Automatic]:wG.Automatic,[MU.Invoke]:wG.Invoke}}}class Wat{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class Ame{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("SignatureHelp")}async provideSignatureHelp(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,s,a);if(c){const l=this._cache.add([c]);return{...DG.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=DG.to(e.activeSignatureHelp),s=this._cache.get(e.activeSignatureHelp.id,0);s?(t=s,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class AY{constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._logService=s,this._extension=o,this._cache=new F_("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const s=this._documents.getDocument(e),o=at.to(t),r=await this._provider.provideInlayHints(s,o,i);if(!Array.isArray(r)||r.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(r);this._disposables.set(a,new Z);const c={hints:[],cacheId:a};for(let l=0;li.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const s={label:"",cacheId:t,tooltip:Qs.fromStrict(e.tooltip),position:Wr.from(e.position),textEdits:e.textEdits&&e.textEdits.map(nh.from),kind:e.kind&&uoe.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")s.label=e.label;else{const o=[];s.label=o;for(const r of e.label){if(!r.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:r.value,tooltip:Qs.fromStrict(r.tooltip)};_p.isLocation(r.location)&&(a.location=P_.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return s}}class AI{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(s)||s.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:s.filter(AI._validateLink).map(zM.from)};{const o=this._cache.add(s),r={links:[],cacheId:o};for(let a=0;a5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveDocumentLink(i,t);if(!(!s||!AI._validateLink(s)))return zM.from(s)}releaseLinks(e){this._cache.delete(e)}}class Eme{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentColors(i,t);return Array.isArray(s)?s.map(r=>({color:T4.from(r.color),range:at.from(r.range)})):[]}async provideColorPresentations(e,t,i){const s=this._documents.getDocument(e),o=at.to(t.range),r=T4.to(t.color),a=await this._provider.provideColorPresentations(r,{document:s,range:o},i);if(Array.isArray(a))return a.map(goe.from)}}class w6e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(s,t,i);if(Array.isArray(o))return o.map(poe.from)}}class b6e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const s=this._documents.getDocument(e),o=t.map(Wr.to),r=await this._provider.provideSelectionRanges(s,o,i);if(!mo(r))return[];if(r.length!==o.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let c=0;cthis._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideCallsTo(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(s,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>at.from(a))}))}async provideCallsFrom(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(s,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>at.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=KF.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class q5{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new yz(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.prepareTypeHierarchy(s,o,i);if(!r)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(r)?r.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideSupertypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=$M.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class EY{constructor(e,t,i,s,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=o,this._cache=new F_("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,s,o){const r=this._documents.getDocument(t),a=Wr.to(i),c=rw.toDataTransfer(s,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(r,a,c,o);if(!l)return;const d=Kb(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,1,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind?.value,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class C6e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,s){const o=P.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:P.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>at.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,s);return l?lf.from(l):null}}class Q5{constructor(e,t){this.adapter=e,this.extension=t}}const Bl=class Bl{constructor(e,t,i,s,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=s,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Ue.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return D4.from(e,this._uriTransformer,t)}_createDisposable(e){return new oo(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Bl._handlePool++}async _withAdapter(e,t,i,s,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return s;const c=Date.now();r||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const l=i(a.adapter,a.extension);return Promise.resolve(l).catch(d=>{Na(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{r||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),qe.isCancellationToken(o)?qle(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new Q5(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,s){const o=this._addNewAdapter(new Nre(this._documents,i),e),r=s&&s.label||Bl._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,Nre,s=>s.provideDocumentSymbols(P.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new yY(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(s,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=oo.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,yY,s=>s.provideCodeLenses(P.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,yY,s=>s.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,yY,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const s=this._addNewAdapter(new r6e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDefinition(e,t,i,s){return this._withAdapter(e,r6e,o=>o.provideDefinition(P.revive(t),i,s),[],s)}registerDeclarationProvider(e,t,i){const s=this._addNewAdapter(new a6e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDeclaration(e,t,i,s){return this._withAdapter(e,a6e,o=>o.provideDeclaration(P.revive(t),i,s),[],s)}registerImplementationProvider(e,t,i){const s=this._addNewAdapter(new c6e(this._documents,i),e);return this._proxy.$registerImplementationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideImplementation(e,t,i,s){return this._withAdapter(e,c6e,o=>o.provideImplementation(P.revive(t),i,s),[],s)}registerTypeDefinitionProvider(e,t,i){const s=this._addNewAdapter(new l6e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideTypeDefinition(e,t,i,s){return this._withAdapter(e,l6e,o=>o.provideTypeDefinition(P.revive(t),i,s),[],s)}registerHoverProvider(e,t,i,s){const o=this._addNewAdapter(new B8(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,s,o){return this._withAdapter(e,B8,r=>r.provideHover(P.revive(t),i,s,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,B8,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,s){const o=this._addNewAdapter(new d6e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,s){return this._withAdapter(e,d6e,o=>o.provideEvaluatableExpression(P.revive(t),i,s),void 0,s)}registerInlineValuesProvider(e,t,i,s){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new h6e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(r,this._transformDocumentSelector(t,e),o);let a=this._createDisposable(r);if(o!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(o));a=oo.from(a,c)}return a}$provideInlineValues(e,t,i,s,o){return this._withAdapter(e,h6e,r=>r.provideInlineValues(P.revive(t),i,s,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new u6e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}registerMultiDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new g6e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentHighlights(e,t,i,s){return this._withAdapter(e,u6e,o=>o.provideDocumentHighlights(P.revive(t),i,s),void 0,s)}$provideMultiDocumentHighlights(e,t,i,s,o){return this._withAdapter(e,g6e,r=>r.provideMultiDocumentHighlights(P.revive(t),i,s.map(a=>P.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const s=this._addNewAdapter(new f6e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideLinkedEditingRanges(e,t,i,s){return this._withAdapter(e,f6e,async o=>{const r=await o.provideLinkedEditingRanges(P.revive(t),i,s);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Bl._serializeRegExp(r.wordPattern):void 0}},void 0,s)}registerReferenceProvider(e,t,i){const s=this._addNewAdapter(new p6e(this._documents,i),e);return this._proxy.$registerReferenceSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideReferences(e,t,i,s,o){return this._withAdapter(e,p6e,r=>r.provideReferences(P.revive(t),i,s,o),void 0,o)}registerCodeActionProvider(e,t,i,s){const o=new Z,r=this._addNewAdapter(new L2(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:s?.providedCodeActionKinds?.map(a=>a.value),documentation:s?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},Bl._extLabel(e),Bl._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,s,o){return this._withAdapter(e,L2,r=>r.provideCodeActions(P.revive(t),i,s,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,L2,s=>s.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,L2,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const s=this._addNewAdapter(new m6e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(s,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(s)}$provideDocumentFormattingEdits(e,t,i,s){return this._withAdapter(e,m6e,o=>o.provideDocumentFormattingEdits(P.revive(t),i,s),void 0,s)}registerDocumentRangeFormattingEditProvider(e,t,i){const s=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new Cme(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,s),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,s,o){return this._withAdapter(e,Cme,r=>r.provideDocumentRangeFormattingEdits(P.revive(t),i,s,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,s,o){return this._withAdapter(e,Cme,r=>r.provideDocumentRangesFormattingEdits(P.revive(t),i,s,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,s){const o=this._addNewAdapter(new _6e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),s,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,s,o,r){return this._withAdapter(e,_6e,a=>a.provideOnTypeFormattingEdits(P.revive(t),i,s,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new SY(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,SY,s=>s.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,SY,s=>s.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,SY,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const s=this._addNewAdapter(new PR(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(s,this._transformDocumentSelector(t,e),PR.supportsResolving(i)),this._createDisposable(s)}$provideRenameEdits(e,t,i,s,o){return this._withAdapter(e,PR,r=>r.provideRenameEdits(P.revive(t),i,s,o),void 0,o)}$resolveRenameLocation(e,t,i,s){return this._withAdapter(e,PR,o=>o.resolveRenameLocation(P.revive(t),i,s),void 0,s)}registerNewSymbolNamesProvider(e,t,i){const s=this._addNewAdapter(new W8(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,W8,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,s,o){return this._withAdapter(e,W8,r=>r.provideNewSymbolNames(P.revive(t),i,s,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new Op(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=oo.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,s){return this._withAdapter(e,Op,o=>o.provideDocumentSemanticTokens(P.revive(t),i,s),null,s)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Op,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new v6e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,s){return this._withAdapter(e,v6e,o=>o.provideDocumentRangeSemanticTokens(P.revive(t),i,s),null,s)}registerCompletionItemProvider(e,t,i,s){const o=this._addNewAdapter(new $T(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),s,$T.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,s,o){return this._withAdapter(e,$T,r=>r.provideCompletionItems(P.revive(t),i,s,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,$T,s=>s.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,$T,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,s){const o=new qii(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Cn.toKey(e.identifier.value),s?.yieldTo?.map(a=>Cn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,s,o){return this._withAdapter(e,J3,r=>r.provideInlineCompletions(P.revive(t),i,s,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,s){this._withAdapter(e,J3,async o=>{o.handleDidShowCompletionItem(t,i,s)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,s,o){this._withAdapter(e,J3,async r=>{r.handlePartialAccept(t,i,s,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,J3,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const s=new Sme(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(s,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,s){return this._withAdapter(e,Sme,o=>o.provideInlineEdits(P.revive(t),i,s),void 0,s)}$freeInlineEdit(e,t){this._withAdapter(e,Sme,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,s){const o=Array.isArray(s)?{triggerCharacters:s,retriggerCharacters:[]}:s,r=this._addNewAdapter(new Ame(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,s,o){return this._withAdapter(e,Ame,r=>r.provideSignatureHelp(P.revive(t),i,s,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,Ame,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const s=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new AY(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",s,Bl._extLabel(e));let r=this._createDisposable(o);if(s!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(s));r=oo.from(r,a)}return r}$provideInlayHints(e,t,i,s){return this._withAdapter(e,AY,o=>o.provideInlayHints(P.revive(t),i,s),void 0,s)}$resolveInlayHint(e,t,i){return this._withAdapter(e,AY,s=>s.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,AY,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const s=this._addNewAdapter(new AI(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(s,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(s)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,AI,s=>s.provideLinks(P.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,AI,s=>s.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,AI,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const s=this._addNewAdapter(new Eme(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentColors(e,t,i){return this._withAdapter(e,Eme,s=>s.provideColors(P.revive(t),i),[],i)}$provideColorPresentations(e,t,i,s){return this._withAdapter(e,Eme,o=>o.provideColorPresentations(P.revive(t),i,s),void 0,s)}registerFoldingRangeProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new w6e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(s,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=oo.from(r,a)}return r}$provideFoldingRanges(e,t,i,s){return this._withAdapter(e,w6e,o=>o.provideFoldingRanges(P.revive(t),i,s),void 0,s)}registerSelectionRangeProvider(e,t,i){const s=this._addNewAdapter(new b6e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideSelectionRanges(e,t,i,s){return this._withAdapter(e,b6e,o=>o.provideSelectionRanges(P.revive(t),i,s),[],s)}registerCallHierarchyProvider(e,t,i){const s=this._addNewAdapter(new G5(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareCallHierarchy(e,t,i,s){return this._withAdapter(e,G5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideCallHierarchyIncomingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsTo(t,i,s),void 0,s)}$provideCallHierarchyOutgoingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsFrom(t,i,s),void 0,s)}$releaseCallHierarchy(e,t){this._withAdapter(e,G5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const s=this._addNewAdapter(new q5(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareTypeHierarchy(e,t,i,s){return this._withAdapter(e,q5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideTypeHierarchySupertypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSupertypes(t,i,s),void 0,s)}$provideTypeHierarchySubtypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSubtypes(t,i,s),void 0,s)}$releaseTypeHierarchy(e,t){this._withAdapter(e,q5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new EY(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),Cd(e,"documentPaste")&&s?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:s.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,s,o,r){return this._withAdapter(e,EY,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,P.revive(i),s,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,EY,s=>s.resolveDropEdit(t,i),{},void 0)}$releaseDropEdits(e,t){this._withAdapter(e,EY,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const s=this._addNewAdapter(new C6e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideMappedEdits(e,t,i,s,o){return this._withAdapter(e,C6e,r=>Promise.resolve(r.provideMappedEdits(t,i,s,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new $5(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerPasteEditProvider(o,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:s.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:s.copyMimeTypes,pasteMimeTypes:s.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,s,o){return this._withAdapter(e,$5,r=>r.prepareDocumentPaste(P.revive(t),i,s,o),void 0,o)}$providePasteEdits(e,t,i,s,o,r,a){return this._withAdapter(e,$5,c=>c.providePasteEdits(t,P.revive(i),s,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,$5,s=>s.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,$5,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Bl._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Bl._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Bl._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Bl._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Bl._serializeRegExp(e.beforeText),afterText:e.afterText?Bl._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Bl._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Bl._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>UF.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Bl._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:s}=i;if(s&&YRe(s))throw new Error(`Invalid language configuration: wordPattern '${s}' is not allowed to match the empty string.`);s?this._documents.setWordDefinitionFor(t,s):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const o=this._nextHandle(),r={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Bl._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Bl._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Bl._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Bl._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(o,t,r),this._createDisposable(o)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Bl._handlePool=0;let NTe=Bl;class Qii{constructor(e,t,i,s){this._documents=t,this._commands=i,this._uriTransformer=s,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);const i=this._documents.getDocumentData(e);if(!i)throw new Error(`document '${e.toString()}' NOT found`);return i.document}async tokenAtPosition(e,t){const i=e.version,s=Wr.from(t),o=await this._proxy.$tokensAtPosition(e.uri,s),r={type:UE.Other,range:e.getWordRangeAtPosition(t)??new rs(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:at.to(o.range),type:Jke.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const s=this._handlePool++,o=this._proxy,r=this._ids,a=`${e.identifier.value}/${t}`;if(r.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);r.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:TM.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!r.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=PS(()=>{d.clear(),this._proxy.$setLanguageStatus(s,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:D4.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===TM.Error?nt.Error:c.severity===TM.Warning?nt.Warning:nt.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),o.$removeLanguageStatus(s),r.delete(a)},get id(){return c.id},get name(){return c.name},set name(f){c.name=f,h()},get selector(){return c.selector},set selector(f){c.selector=f,h()},get text(){return c.text},set text(f){c.text=f,h()},set text2(f){Je(e,"languageStatusText"),c.text=f,h()},get text2(){return Je(e,"languageStatusText"),c.text},get detail(){return c.detail},set detail(f){c.detail=f,h()},get severity(){return c.severity},set severity(f){c.severity=f,h()},get accessibilityInformation(){return c.accessibilityInformation},set accessibilityInformation(f){c.accessibilityInformation=f,h()},get command(){return c.command},set command(f){c.command=f,h()},get busy(){return c.busy},set busy(f){c.busy=f,h()}};return h(),u}}function jii(n){return n&&n.title}let PTe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Ue.MainThreadMessageService)}showMessage(e,t,i,s,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof s=="string"||jii(s)?a=[s,...o]:(r.modal=s?.modal,r.useCustom=s?.useCustom,r.detail=s?.detail,a=o),r.useCustom&&Je(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};PTe=D([_(1,Ze)],PTe);class xme{constructor(e,t,i,s){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=s}asApiEvent(){return{range:new rS(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class FTe{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1}}constructor(e,t,i){this.notebook=e,this._extHostDocument=t,this._cellData=i,this.handle=i.handle,this.uri=P.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(Y1.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(M4.to(i.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){const e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw new Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);const i={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:kG.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(s){e._mime=s},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(i)}return this._apiCell}setOutputs(e){this._outputs=e.map(Y1.to)}setOutputItems(e,t,i){const s=i.map(N4.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...s),o.items.length>1&&o.items.every(r=>hot(r.mime)))){const r=new Map,a=[];o.items.forEach(c=>{let l;r.has(c.mime)?l=r.get(c.mime):(l=[],r.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),o.items.length=0,a.forEach(c=>{const l=p7t(r.get(c));o.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(M4.to(e))}setMime(e){}}const Sle=class Sle{constructor(e,t,i,s,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=s,this.handle=Sle._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=o.viewType,this._metadata=Object.freeze(o.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,o.cells]],!0,void 0),this._versionId=o.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){const e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===_e.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(i){return i=e._validateIndex(i),e._cells[i].apiCell},getCells(i){return(i?e._getCells(i):e._cells).map(o=>o.apiCell)},save(){return e._save()}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,i){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:i});const s={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===vd.ModelChange?this._spliceNotebookCells(a.changes,!1,s.contentChanges):a.kind===vd.Move?this._moveCells(a.index,a.length,a.newIdx,s.contentChanges):a.kind===vd.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===vd.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===vd.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===vd.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===vd.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),o.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const r=new Map;for(let a=0;a=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,i=e.end|0;return t<0&&(t=0),i>this._cells.length&&(i=this._cells.length),e.with({start:t,end:i})}_getCells(e){e=this._validateRange(e);const t=[];for(let i=e.start;i{const l=a[2].map(u=>{const f=new FTe(this,this._textDocumentsAndEditors,u);return t||o.push(FTe.asModelAddData(u)),f}),d=new xme(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)r.push(u.uri),d.deletedItems.push(u.apiCell);s.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of s)i.push(a.asApiEvent())}_moveCells(e,t,i,s){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new xme(e,t,o.map(a=>a.apiCell),[]),new xme(i,0,[],o)];for(const a of r)s.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,s){this._cells[e].setOutputItems(t,i,s)}_changeCellLanguage(e,t){const i=this._cells[e];i.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(i.uri,t)}_changeCellMime(e,t){const i=this._cells[e];i.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}};Sle._handlePool=0;let OTe=Sle;const Ale=class Ale{constructor(e,t,i,s,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=s,this._viewColumn=r}get apiEditor(){if(!this._editor){const e=this;this._editor={get notebook(){return e.notebookData.apiNotebook},get selection(){return e._selections[0]},set selection(t){this.selections=[t]},get selections(){return e._selections},set selections(t){if(!Array.isArray(t)||!t.every(rS.isNotebookRange))throw Ui("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,ES.from(t),i??aG.Default)},get viewColumn(){return e._viewColumn}},Ale.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(ES.from))}_acceptViewColumn(e){this._viewColumn=e}};Ale.apiEditorsToExtHost=new WeakMap;let gq=Ale;class Kii extends ${constructor(e,t,i){super(),this._source=e,this._inputTextBuffer=t,this._outputs=i,this._outputTextBuffers=void 0}_getFullModelRange(e){const t=e.getLineCount();return new O(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw new Error("Illegal value for lineNumber");return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){const e=new o7;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:s}=t.create(zb.LF);this._inputTextBuffer=i,this._register(s)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new o7;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:s,disposable:o}=i.create(zb.LF);return this._register(o),s})),this._outputTextBuffers}findInInputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();if(!i)return[];const s=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(s,i,!0,5e3)}findInOutputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(s=>{const o=s.findMatchesLineByLine(this._getFullModelRange(s),i,!0,5e3);if(o.length!==0)return{textBuffer:s,matches:o}}).filter(s=>!!s):[]}}function y6e(n,e){let t=-1;const i=[];let s=[];return n.forEach(r=>{r.range.startLineNumber!==t&&s.length>0&&(i.push([...s]),s=[]),s.push(r),t=r.range.endLineNumber}),s.length>0&&i.push([...s]),i.map(r=>{const a=[],c=r[0].range.startLineNumber,l=r[r.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new Q8t(a.join(` +`}getOS(e){let t=po;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==pe.file){const n=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(n,Ie.WORKSPACE,po),this.storageService.store(n,t,Ie.WORKSPACE,an.MACHINE)}return t}};eke=D([_(0,Te),_(1,hg),_(2,Jr),_(3,$i)],eke);let tke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=n,this.commandService=o,this.fileService=r,this.textFileService=a,this.workspacesService=c,this.environmentService=l,this.fileDialogService=d,this.dialogService=h,this.hostService=u,this.uriIdentityService=f,this.workspaceTrustManagementService=p,this.userDataProfilesService=m,this.userDataProfileService=v}async pickNewWorkspacePath(){const e=[pe.file];this.environmentService.remoteAuthority&&e.unshift(pe.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:vMe(g(3657,"Save")),title:g(3658,"Save Workspace"),filters:sAt,defaultUri:Pt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return mae(t)||(t=t.with({path:`${t.path}.${xb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&Jme(e,this.environmentService))return _i(e);const t=lm(this.contextService.getWorkspace().folders);return t?`${_i(t.uri)}.${xb}`:`workspace.${xb}`}async updateFolders(e,t,i,n){const o=this.contextService.getWorkspace().folders;let r=[];typeof t=="number"&&(r=o.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:VFe(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,n):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==qi.WORKSPACE?this.doAddFolders(a,e,n):this.doUpdateFolders(a,r,e,n)}async doUpdateFolders(e,t,i,n=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(n)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(n=>({uri:VFe(n.uri),name:n.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const n=this.contextService.getWorkbenchState();if(n!==qi.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=ja(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),n===qi.EMPTY&&o.length===0||n===qi.FOLDER&&o.length===1?void 0:this.createAndEnterWorkspace(o)}try{await this.contextService.addFolders(e,t)}catch(o){if(i)throw o;this.handleWorkspaceConfigurationEditingError(o)}}async removeFolders(e,t=!1){if(this.includesSingleFolderWorkspace(e))return this.createAndEnterWorkspace([]);try{await this.contextService.removeFolders(e)}catch(i){if(t)throw i;this.handleWorkspaceConfigurationEditingError(i)}}includesSingleFolderWorkspace(e){if(this.contextService.getWorkbenchState()===qi.FOLDER){const t=this.contextService.getWorkspace().folders[0];return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t.uri))}return!1}async createAndEnterWorkspace(e,t){if(t&&!await this.isValidTargetWorkspacePath(t))return;const i=this.environmentService.remoteAuthority,n=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(n,t)}finally{await this.workspacesService.deleteUntitledWorkspace(n)}else t=n.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(n,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(ji(t.configPath,e))return this.saveWorkspace(t);if(await this.isValidTargetWorkspacePath(e))return await this.saveWorkspaceAs(t,e),this.enterWorkspace(e)}}async isValidTargetWorkspacePath(e){return!0}async saveWorkspaceAs(e,t){const i=e.configPath;if(!g3(t,this.environmentService)&&!this.userDataProfileService.currentProfile.isDefault){const c=await this.workspacesService.getWorkspaceIdentifier(t);await this.userDataProfilesService.setProfileForWorkspace(c,this.userDataProfileService.currentProfile)}if(this.uriIdentityService.extUri.isEqual(i,t))return;const o=g3(i,this.environmentService),r=await this.fileService.readFile(i),a=a9e(r.value.toString(),i,o,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:a,options:{overwrite:!0}}]),await this.trustWorkspaceConfiguration(t)}async saveWorkspace(e){const t=e.configPath,i=this.textFileService.files.get(t);if(i){await i.save({force:!0,reason:Cn.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=a9e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case V$.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(3659,"Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again.");this.askToOpenWorkspaceConfigurationFile(e)}askToOpenWorkspaceConfigurationFile(e){this.notificationService.prompt(Xe.Error,e,[{label:g(3660,"Open Workspace Configuration"),run:()=>this.commandService.executeCommand("workbench.action.openWorkspaceConfigFile")}])}async doEnterWorkspace(e){if(this.environmentService.extensionTestsLocationURI)throw new Error("Entering a new workspace is not possible in tests.");const t=await this.workspacesService.getWorkspaceIdentifier(e);return this.contextService.getWorkbenchState()===qi.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===at.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;n[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:n}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==qi.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=GO(this.contextService.getWorkspace());if(iA(e))return e}};tke=D([_(0,DI),_(1,yi),_(2,Bst),_(3,bi),_(4,vi),_(5,Jt),_(6,Fo),_(7,xI),_(8,Jr),_(9,ag),_(10,to),_(11,xc),_(12,ks),_(13,uC),_(14,Em),_(15,ug)],tke);var qP,nM;let ike=(nM=class extends V{constructor(e,t,i,n,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=n,this.environmentService=o,this.uriIdentityService=r,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(Ie.APPLICATION,qP.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(Py(this.contextService.getWorkspace()))for(const t of e.added)this.addRecentlyOpened([{folderUri:t.uri}])}addWorkspaceToRecentlyOpened(){const e=this.contextService.getWorkspace(),t=this.environmentService.remoteAuthority;switch(this.contextService.getWorkbenchState()){case qi.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case qi.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get(qP.RECENTLY_OPENED_KEY,Ie.APPLICATION);if(e){const t=uZt(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(fj(i)&&i.folderUri.scheme===pe.file&&!Py(this.contextService.getWorkspace())||rZt(i)&&Py(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)aZt(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):fj(i)?(this.doRemoveRecentlyOpened(t,[i.folderUri]),t.workspaces.unshift(i)):(this.doRemoveRecentlyOpened(t,[i.workspace.configPath]),t.workspaces.unshift(i));return this.saveRecentlyOpened(t)}async removeRecentlyOpened(e){const t=await this.getRecentlyOpened();return this.doRemoveRecentlyOpened(t,e),this.saveRecentlyOpened(t)}doRemoveRecentlyOpened(e,t){e.files=e.files.filter(i=>!t.some(n=>n.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(n=>n.toString()===(fj(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(qP.RECENTLY_OPENED_KEY,JSON.stringify(gZt(e)),Ie.APPLICATION,an.USER)}async clearRecentlyOpened(){this.storageService.remove(qP.RECENTLY_OPENED_KEY,Ie.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),n=Pt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${xb}`),o=[];if(e)for(const a of e)o.push(xPe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(n,$e.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(n)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return hNe(e)}async getDirtyWorkspaces(){return[]}},qP=nM,nM.RECENTLY_OPENED_KEY="recently.opened",nM);ike=qP=D([_(0,$i),_(1,yi),_(2,Ge),_(3,Jt),_(4,Jr),_(5,ks)],ike);var Ur;(function(s){s.Unknown="unknown",s.Env="env",s.Config="config",s.Command="command",s.Input="input",s.ExtensionInstallFolder="extensionInstallFolder",s.WorkspaceFolder="workspaceFolder",s.Cwd="cwd",s.WorkspaceFolderBasename="workspaceFolderBasename",s.UserHome="userHome",s.LineNumber="lineNumber",s.SelectedText="selectedText",s.File="file",s.FileWorkspaceFolder="fileWorkspaceFolder",s.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",s.RelativeFile="relativeFile",s.RelativeFileDirname="relativeFileDirname",s.FileDirname="fileDirname",s.FileExtname="fileExtname",s.FileBasename="fileBasename",s.FileBasenameNoExtension="fileBasenameNoExtension",s.FileDirnameBasename="fileDirnameBasename",s.ExecPath="execPath",s.ExecInstallFolder="execInstallFolder",s.PathSeparator="pathSeparator",s.PathSeparatorAlias="/"})(Ur||(Ur={}));class bg extends Error{constructor(e,t){super(t),this.variable=e}}const w1=class w1{constructor(e,t,i,n){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,n&&(this._envVariablesPromise=n.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Qn){const t=Object.create(null);return Object.keys(e).forEach(i=>{t[i.toLowerCase()]=e[i]}),t}return e}resolveWithEnvironment(e,t,i){return this.recursiveResolve({env:this.prepareEnv(e),userHome:void 0},t?t.uri:void 0,i)}async resolveAsync(e,t){const i={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(i,e?e.uri:void 0,t)}async resolveAnyBase(e,t,i,n){const o=xs(t);Qn&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):Qt&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):pr&&o.linux&&Object.keys(o.linux).forEach(a=>o[a]=o.linux[a]),delete o.windows,delete o.osx,delete o.linux;const r={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(r,e?e.uri:void 0,o,i,n)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const n=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,n),resolvedVariables:n}}resolveWithInteractionReplace(e,t,i,n){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,n){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(e,t){if(this._contributedVariables.has(e))throw new Error("Variable "+e+" is contributed twice.");this._contributedVariables.set(e,t)}async recursiveResolve(e,t,i,n,o){if(Lt(i))return this.resolveString(e,t,i,n,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,n,o)));if(kn(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,n,o),await this.recursiveResolve(e,t,i[c],n,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,n,o){return uat(i,w1.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(w1.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,n);return o?.set(a,c),c!==r&&Lt(c)&&c.match(w1.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,n,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,n,o){let r;const a=i.split(":");a.length>1&&(i=a[0],r=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Kw(u);throw new bg(h,g(4048,"Variable {0} can not be resolved. Please open an editor.",t))},l=h=>{const u=c(h);if(this._context.getWorkspaceFolderPathForFile){const f=this._context.getWorkspaceFolderPathForFile();if(f)return Kw(f)}throw new bg(h,g(4049,"Variable {0}: can not find workspace folder of '{1}'.",t,Ko(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new bg(h,g(4050,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(n)return n;throw this._context.getWorkspaceFolderCount()>1?new bg(h,g(4051,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new bg(h,g(4052,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Qn?r.toLowerCase():r];if(Lt(h))return h}return""}throw new bg(Ur.Env,g(4053,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(n,r);if(ra(h))throw new bg(Ur.Config,g(4054,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(kn(h))throw new bg(Ur.Config,g(4055,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new bg(Ur.Config,g(4056,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(Ur.Command,t,r,o,"command");case"input":return this.resolveFromMap(Ur.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new bg(Ur.ExtensionInstallFolder,g(4057,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new bg(Ur.ExtensionInstallFolder,g(4058,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Kw(this.fsPath(d(Ur.WorkspaceFolder)));case"cwd":return n||r?Kw(this.fsPath(d(Ur.Cwd))):x2();case"workspaceRootFolderName":case"workspaceFolderBasename":return Kw(Ko(this.fsPath(d(Ur.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new bg(Ur.UserHome,g(4059,"Variable {0} can not be resolved. UserHome path is not defined",t))}case"lineNumber":{const h=this._context.getLineNumber();if(h)return h;throw new bg(Ur.LineNumber,g(4060,"Variable {0} can not be resolved. Make sure to have a line selected in the active editor.",t))}case"selectedText":{const h=this._context.getSelectedText();if(h)return h;throw new bg(Ur.SelectedText,g(4061,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(Ur.File);case"fileWorkspaceFolder":return l(Ur.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return Ko(l(Ur.FileWorkspaceFolderBasename));case"relativeFile":return n||r?k2(this.fsPath(d(Ur.RelativeFile)),c(Ur.RelativeFile)):c(Ur.RelativeFile);case"relativeFileDirname":{const h=Cb(c(Ur.RelativeFileDirname));if(n||r){const u=k2(this.fsPath(d(Ur.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return Cb(c(Ur.FileDirname));case"fileExtname":return Gy(c(Ur.FileExtname));case"fileBasename":return Ko(c(Ur.FileBasename));case"fileBasenameNoExtension":{const h=Ko(c(Ur.FileBasenameNoExtension));return h.slice(0,h.length-Gy(h).length)}case"fileDirnameBasename":return Ko(Cb(c(Ur.FileDirnameBasename)));case"execPath":{const h=this._context.getExecPath();return h||t}case"execInstallFolder":{const h=this._context.getAppRoot();return h||t}case"pathSeparator":case"/":return ou;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(Ur.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,n,o){if(i&&n){const r=o===void 0?n[i]:n[o+":"+i];if(typeof r=="string")return r;throw new bg(e,g(4062,"Variable {0} can not be resolved because the command has no value.",t))}return t}};w1.VARIABLE_LHS="${",w1.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let jie=w1;const ire=class ire extends jie{constructor(e,t,i,n,o,r,a,c,l,d){super({getFolderUri:h=>{const u=r.getWorkspace().folders.filter(f=>f.name===h).pop();return u?u.uri:void 0},getWorkspaceFolderCount:()=>r.getWorkspace().folders.length,getConfigurationValue:(h,u)=>n.getValue(u,h?{resource:h}:{}),getAppRoot:()=>e.getAppRoot(),getExecPath:()=>e.getExecPath(),getFilePath:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(h)return this.labelService.getUriLabel(h,{noPrefix:!0})},getWorkspaceFolderPathForFile:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(!h)return;const u=r.getWorkspaceFolder(h);if(u)return this.labelService.getUriLabel(u.uri,{noPrefix:!0})},getSelectedText:()=>{const h=i.activeTextEditorControl;let u=null;if(Qr(h))u=h;else if(im(h)){const m=h.getOriginalEditor(),v=h.getModifiedEditor();u=m.hasWidgetFocus()?m:v}const f=u?.getModel(),p=u?.getSelection();if(f&&p)return f.getValueInRange(p)},getLineNumber:()=>{const h=i.activeTextEditorControl;if(Qr(h)){const u=h.getSelection();if(u){const f=u.positionLineNumber;return String(f)}}},getExtension:h=>d.getExtension(h)},c,l.userHome().then(h=>h.path),t),this.configurationService=n,this.commandService=o,this.workspaceContextService=r,this.quickInputService=a,this.labelService=c,this.pathService=l,this.userInputAccessQueue=new bI}async resolveWithInteractionReplace(e,t,i,n,o){return t=await this.resolveAnyAsync(e,t),this.resolveWithInteraction(e,t,i,n,o).then(r=>r?r.size>0?this.resolveAnyAsync(e,t,Object.fromEntries(r)):t:null)}async resolveWithInteraction(e,t,i,n,o){const r=await this.resolveAnyMap(e,t);t=r.newConfig;const a=r.resolvedVariables;return this.resolveWithInputAndCommands(e,t,n,i,o).then(c=>{if(this.updateMapping(c,a))return a})}updateMapping(e,t){if(!e)return!1;for(const[i,n]of Object.entries(e))t.set(i,n);return!0}async resolveWithInputAndCommands(e,t,i,n,o){if(!t)return Promise.resolve(void 0);let r=[];if(this.workspaceContextService.getWorkbenchState()!==qi.EMPTY&&n){const l=e?{resource:e.uri}:{},d=this.configurationService.inspect(n,l);if(d&&(d.userValue||d.workspaceValue||d.workspaceFolderValue))switch(o){case St.USER:r=d.userValue?.inputs;break;case St.WORKSPACE:r=d.workspaceValue?.inputs;break;default:r=d.workspaceFolderValue?.inputs}else{const h=this.configurationService.getValue(n,l);h&&(r=h.inputs)}}const a=[];this.findVariables(t,a);const c=Object.create(null);for(const l of a){const[d,h]=l.split(":",2);let u;switch(d){case"input":u=await this.showUserInput(h,r);break;case"command":{const f=(i?i[h]:void 0)||h;if(u=await this.commandService.executeCommand(f,t),typeof u!="string"&&!ra(u))throw new Error(g(8787,"Cannot substitute command variable '{0}' because command did not return a result of type string.",f));break}default:this._contributedVariables.has(l)&&(u=await this._contributedVariables.get(l)())}if(typeof u=="string")c[l]=u;else return}return c}findVariables(e,t){if(typeof e=="string"){let i;for(;(i=ire.INPUT_OR_COMMAND_VARIABLES_PATTERN.exec(e))!==null;)if(i.length===4){const n=i[1];t.indexOf(n)<0&&t.push(n)}for(const n of this._contributedVariables.keys())t.indexOf(n)<0&&e.indexOf("${"+n+"}")>=0&&t.push(n)}else if(Array.isArray(e))for(const i of e)this.findVariables(i,t);else if(e)for(const i of Object.values(e))this.findVariables(i,t)}showUserInput(e,t){if(!t)return Promise.reject(new Error(g(8788,"Variable '{0}' must be defined in an '{1}' section of the debug or task configuration.",e,"inputs")));const i=t.filter(n=>n.id===e).pop();if(i){const n=o=>{throw new Error(g(8789,"Input variable '{0}' is of type '{1}' and must include '{2}'.",e,i.type,o))};switch(i.type){case"promptString":{Lt(i.description)||n("description");const o={prompt:i.description,ignoreFocusLost:!0};return i.default&&(o.value=i.default),i.password&&(o.password=i.password),this.userInputAccessQueue.queue(()=>this.quickInputService.input(o)).then(r=>r)}case"pickString":{if(Lt(i.description)||n("description"),Array.isArray(i.options))for(const a of i.options)!Lt(a)&&!Lt(a.value)&&n("value");else n("options");const o=new Array;for(const a of i.options){const c=Lt(a)?a:a.value,l=Lt(a)?void 0:a.label,d={label:l?`${l}: ${c}`:c,value:c};c===i.default?(d.description=g(8790,"(Default)"),o.unshift(d)):o.push(d)}const r={placeHolder:i.description,matchOnDetail:!0,ignoreFocusLost:!0};return this.userInputAccessQueue.queue(()=>this.quickInputService.pick(o,r,void 0)).then(a=>{if(a)return a.value})}case"command":return Lt(i.command)||n("command"),this.userInputAccessQueue.queue(()=>this.commandService.executeCommand(i.command,i.args)).then(o=>{if(typeof o=="string"||ra(o))return o;throw new Error(g(8791,"Cannot substitute input variable '{0}' because command '{1}' did not return a result of type string.",e,i.command))});default:throw new Error(g(8792,"Input variable '{0}' can only be of type 'promptString', 'pickString', or 'command'.",e))}}return Promise.reject(new Error(g(8793,"Undefined input variable '{0}' encountered. Remove or define '{0}' to continue.",e)))}};ire.INPUT_OR_COMMAND_VARIABLES_PATTERN=/\${((input|command):(.*?))}/g;let nke=ire,ske=class extends nke{constructor(e,t,i,n,o,r,a,c){super({getAppRoot:()=>{},getExecPath:()=>{}},Promise.resolve(Object.create(null)),e,t,i,n,o,r,a,c)}};ske=D([_(0,ei),_(1,Te),_(2,vi),_(3,yi),_(4,In),_(5,Fs),_(6,bf),_(7,fs)],ske);function xZt(){throw new Error("unsupported")}function DZt(s){let e=null;return(...t)=>(e==null&&(e=s(...t)),e)}function kZt(s){return new Proxy(s,{construct:DZt((e,t)=>Reflect.construct(s,t))})}N.from({scheme:pe.vscodeUserData,path:"/User/settings.json"});Qe.as(Nn.Configuration);let oke=class extends CZt{constructor(e,t,i,n,o,r,a,c){const l=new AZt([pe.file,pe.vscodeUserData,pe.tmp],e,n);super({configurationCache:l},e,t,i,n,o,r,a,c)}};oke=D([_(0,Jr),_(1,ug),_(2,Em),_(3,Jt),_(4,hg),_(5,ks),_(6,Ge),_(7,bRe)],oke);class IZt extends tke{constructor(){super(...arguments),this.enterWorkspace=xZt}}let Hst;pNe(async s=>{const e=s.get(yi);e.acquireInstantiationService(s.get(we));const t=Hst??gNe();if(N.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const n=s.get(Jt);await n.createFolder(t),await n.writeFile(i,$e.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:ar(),configPath:i})}else await e.initialize(t)});const d9e=kZt(oke);function TZt(s){return Hst=s,{...Rce(),[Te.toString()]:new wi(d9e,[],!0),[yi.toString()]:new wi(d9e,[],!0),[Ec.toString()]:new wi(QDe,[],!0),[iC.toString()]:new wi(IZt,[],!0),[xI.toString()]:new wi(ike,[],!0),[CTe.toString()]:new wi(eke,[],!0),[oMe.toString()]:new wi(ske,[],!0)}}let rke=class extends xY{constructor(e,t,i){super(t),this.editorService=e,this.configurationService=i,this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditor.bind(this))),this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditorFromDiff.bind(this)))}getActiveCodeEditor(){const e=this.editorService.activeTextEditorControl;if(Qr(e))return e;if(im(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return W2(t)&&Qr(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const n=this.editorService.activeTextEditorControl;if(!i&&im(n)&&e.options&&e.resource&&t===n.getModifiedEditor()&&n.getModel()&&ji(e.resource,n.getModel()?.modified.uri)){const o=n.getModifiedEditor();return LZ(e.options,o,mt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!ji(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(s6(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?ev:hA);if(o){const r=o.getControl();if(Qr(r))return r;if(W2(r)&&Qr(r.activeCodeEditor))return r.activeCodeEditor}return null}};rke=D([_(0,ei),_(1,pn),_(2,Te)],rke);let ake=class extends V{constructor(e,t,i,n,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=n,this.editorResolverService=o,this.editorInputCache=new ui,this.fileEditorFactory=Qe.as(tC.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:rm.id,label:rm.displayName,detail:rm.providerDisplayName,priority:f$.builtin},{},{createEditorInput:e=>({editor:this.createTextEditor(e)}),createUntitledEditorInput:e=>({editor:this.createTextEditor(e)}),createDiffEditorInput:e=>({editor:this.createTextEditor(e)})}))}async resolveTextEditor(e){return this.createTextEditor(e)}createTextEditor(e){if(wb(e))return this.createTextEditor(e.result);if(E_(e)){const n=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance(qg,e.label,e.description,n,o,void 0)}if(kS(e)){const n=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(op,e.label,e.description,o,n)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===pe.untitled){const n={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===pe.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...n}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...n}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(S9,o))}const i=e;if(i.resource instanceof N){const n=i.label||_i(i.resource),o=i.resource,r=this.uriIdentityService.asCanonicalUri(o);return this.createOrGetCached(r,()=>i.forceFile||this.fileService.hasProvider(r)?this.fileEditorFactory.createFileEditor(r,o,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(MT,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof S9||(a instanceof MT?(n&&a.setName(n),i.description&&a.setDescription(i.description),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)):(a.setPreferredResource(o),i.label&&a.setPreferredName(i.label),i.description&&a.setPreferredDescription(i.description),i.encoding&&a.setPreferredEncoding(i.encoding),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)))})}throw new Error(`ITextEditorService: Unable to create texteditor from ${JSON.stringify(e)}`)}createOrGetCached(e,t,i){let n=this.editorInputCache.get(e);return n?(i?.(n),n):(n=t(),this.editorInputCache.set(e,n),M.once(n.onWillDispose)(()=>this.editorInputCache.delete(e)),n)}};ake=D([_(0,W6),_(1,we),_(2,ks),_(3,Jt),_(4,BU)],ake);var OV,sM;let cke=(sM=class extends V{get count(){return this.mostRecentEditorsMap.size}get editors(){return[...this.mostRecentEditorsMap.values()]}hasEditor(e){return this.editorsPerResourceCounter.get(e.resource)?.has(this.toIdentifier(e))??!1}hasEditors(e){return this.editorsPerResourceCounter.has(e)}toIdentifier(e,t){return typeof e!="string"?this.toIdentifier(e.typeId,e.editorId):t?`${e}/${t}`:e}constructor(e,t,i){super(),this.editorGroupService=t,this.storageService=i,this.keyMap=new Map,this.mostRecentEditorsMap=new F6e,this.editorsPerResourceCounter=new ui,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.editorGroupsContainer=e??t,this.isScoped=!!e,this.registerListeners(),this.loadState()}registerListeners(){this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.onGroupAdded(e))),this._register(this.editorGroupService.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.storageService.onWillSaveState(()=>this.saveState()))}onGroupAdded(e){const t=e.getEditors(Zh.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--)this.addMostRecentEditor(e,t[i],!1,!0);this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1),this.registerGroupListeners(e)}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{switch(i.kind){case Do.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case Do.EDITOR_OPEN:{i.editor&&(this.addMostRecentEditor(e,i.editor,!1,!0),this.ensureOpenedEditorsLimit({groupId:e.id,editor:i.editor},e.id));break}}})),t.add(e.onDidCloseEditor(i=>{this.removeMostRecentEditor(e,i.editor)})),t.add(e.onDidActiveEditorChange(i=>{i.editor&&this.addMostRecentEditor(e,i.editor,this.editorGroupsContainer.activeGroup===e,!1)})),M.once(e.onWillDispose)(()=>bt(t))}onDidChangeEditorPartOptions(e){if(!Ys(e.newPartOptions.limit,e.oldPartOptions.limit)){const t=this.editorGroupsContainer.activeGroup;let i;t.activeEditor&&(i={editor:t.activeEditor,groupId:t.id}),this.ensureOpenedEditorsLimit(i)}}addMostRecentEditor(e,t,i,n){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?Gl.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,Gl.AsOld),this.mostRecentEditorsMap.set(r,r,Gl.AsOld)),n&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,n,o;if(e instanceof op?(i=e.primary.resource,n=e.primary.typeId,o=e.primary.editorId):(i=e.resource,n=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(n,o);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(r,(a.get(r)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(r)??0;c>1?a.set(r,c-1):(a.delete(r),a.size===0&&this.editorsPerResourceCounter.delete(i))}}}removeMostRecentEditor(e,t){this.updateEditorResourcesMap(t,!1);const i=this.findKey(e,t);if(i){this.mostRecentEditorsMap.delete(i);const n=this.keyMap.get(e.id);n&&n.delete(i.editor)&&n.size===0&&this.keyMap.delete(e.id),this._onDidMostRecentlyActiveEditorsChange.fire()}}findKey(e,t){const i=this.keyMap.get(e.id);if(i)return i.get(t)}ensureKey(e,t){let i=this.keyMap.get(e.id);i||(i=new Map,this.keyMap.set(e.id,i));let n=i.get(t);return n||(n={groupId:e.id,editor:t},i.set(t,n)),n}async ensureOpenedEditorsLimit(e,t){if(!this.editorGroupService.partOptions.limit?.enabled||typeof this.editorGroupService.partOptions.limit.value!="number"||this.editorGroupService.partOptions.limit.value<=0)return;const i=this.editorGroupService.partOptions.limit.value;if(this.editorGroupService.partOptions.limit?.perEditorGroup)if(typeof t=="number"){const n=this.editorGroupsContainer.getGroup(t);n&&await this.doEnsureOpenedEditorsLimit(i,n.getEditors(Zh.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const n of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,n.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let n;if(this.editorGroupService.partOptions.limit?.excludeDirty?n=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad))):n=t,e>=n.length)return;const o=n.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=n.length-e;const a=new Map;for(const{groupId:c,editor:l}of o){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),r--,r===0)break}for(const[c,l]of a){const d=this.editorGroupsContainer.getGroup(c);d&&await d.closeEditors(l,{preserveFocus:!0})}}saveState(){this.isScoped||(this.mostRecentEditorsMap.isEmpty()?this.storageService.remove(OV.STORAGE_KEY,Ie.WORKSPACE):this.storageService.store(OV.STORAGE_KEY,JSON.stringify(this.serialize()),Ie.WORKSPACE,an.MACHINE))}serialize(){const e=Qe.as(tC.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Fi(t.map(({editor:n,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(Zh.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(n);if(c!==-1)return{groupId:o,index:c}}))}}async loadState(){(this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService)&&await this.editorGroupService.whenReady;let e=!1;if(!this.isScoped){const t=this.storageService.get(OV.STORAGE_KEY,Ie.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const n=t[i],o=n.getEditors(Zh.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(n,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:n}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(n);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},OV=sM,sM.STORAGE_KEY="editors.mru",sM);cke=OV=D([_(1,Po),_(2,$i)],cke);function h9e(s,e,t){const i=s.get(Po),n=s.get(Te),o=LZt(e,t,i,n);return o instanceof Promise?o.then(r=>u9e(r,e,t,i)):u9e(o,e,t,i)}function u9e(s,e,t,i){let n;return i.activeGroup!==s&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==ev&&(n=Gk.ACTIVATE),[s,n]}function LZt(s,e,t,i){let n;const o=R5(s)?s.editor:s,r=s.options;if(e&&typeof e!="number")n=e;else if(typeof e=="number"&&e>=0)n=t.getGroup(e);else if(e===ev){const a=UW(i);let c=t.findGroup({direction:a});(!c||zK(c,o))&&(c=t.addGroup(t.activeGroup,a)),n=c}else if(e===$4t)n=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(hu.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(RZt(c,o)){n=c;break}}if(!n&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||wa(o)&&o.hasCapability(Ei.Singleton))){let c,l;for(const d of a)if(Ust(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;n=c||l}}if(!n){let a=t.activeGroup;if(zK(a,o)){for(const c of t.getGroups(hu.MOST_RECENTLY_ACTIVE))if(!zK(c,o)){a=c;break}zK(a,o)?n=t.addGroup(a,UW(i)):n=a}else n=a}return n}function zK(s,e){return!(!s.isLocked||Ust(s,e))}function RZt(s,e){return s.activeEditor?s.activeEditor.matches(e):!1}function Ust(s,e){for(const t of s.editors)if(t.matches(e))return!0;return!1}var lke;let dke=lke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=n,this.configurationService=o,this.contextService=r,this.uriIdentityService=a,this.editorResolverService=c,this.workspaceTrustRequestService=l,this.hostService=d,this.textEditorService=h,this._onDidActiveEditorChange=this._register(new I),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidVisibleEditorsChange=this._register(new I),this.onDidVisibleEditorsChange=this._onDidVisibleEditorsChange.event,this._onDidEditorsChange=this._register(new I),this.onDidEditorsChange=this._onDidEditorsChange.event,this._onWillOpenEditor=this._register(new I),this.onWillOpenEditor=this._onWillOpenEditor.event,this._onDidCloseEditor=this._register(new I),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onDidOpenEditorFail=this._register(new I),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.lastActiveEditor=void 0,this.activeOutOfWorkspaceWatchers=new ui,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(cke,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new lke(e==="main"?this.editorGroupService.mainPart:e,this.editorGroupService,this.instantiationService,this.fileService,this.configurationService,this.contextService,this.uriIdentityService,this.editorResolverService,this.workspaceTrustRequestService,this.hostService,this.textEditorService))}registerListeners(){this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService?this.editorGroupService.whenReady.then(()=>this.onEditorGroupsReady()):this.onEditorGroupsReady(),this._register(this.editorGroupsContainer.onDidChangeActiveGroup(e=>this.handleActiveEditorChange(e))),this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.registerGroupListeners(e))),this._register(this.editorsObserver.onDidMostRecentlyActiveEditorsChange(()=>this._onDidMostRecentlyActiveEditorsChange.fire())),this._register(this.onDidVisibleEditorsChange(()=>this.handleVisibleEditorsChange())),this._register(this.fileService.onDidRunOperation(e=>this.onDidRunFileOperation(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onEditorGroupsReady(){for(const e of this.editorGroupsContainer.groups)this.registerGroupListeners(e);this.activeEditor&&(this.doHandleActiveEditorChangeEvent(),this._onDidVisibleEditorsChange.fire())}handleActiveEditorChange(e){e===this.editorGroupsContainer.activeGroup&&(!this.lastActiveEditor&&!e.activeEditor||this.doHandleActiveEditorChangeEvent())}doHandleActiveEditorChangeEvent(){const e=this.editorGroupsContainer.activeGroup;this.lastActiveEditor=e.activeEditor??void 0,this._onDidActiveEditorChange.fire()}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{this._onDidEditorsChange.fire({groupId:e.id,event:i})})),t.add(e.onDidActiveEditorChange(()=>{this.handleActiveEditorChange(e),this._onDidVisibleEditorsChange.fire()})),t.add(e.onWillOpenEditor(i=>{this._onWillOpenEditor.fire(i)})),t.add(e.onDidCloseEditor(i=>{this._onDidCloseEditor.fire(i)})),t.add(e.onDidOpenEditorFail(i=>{this._onDidOpenEditorFail.fire({editor:i,groupId:e.id})})),M.once(e.onWillDispose)(()=>{bt(t)})}handleVisibleEditorsChange(){const e=new Dk;for(const t of this.visibleEditors){const i=ja(Fi([Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}),Na.getCanonicalUri(t,{supportSideBySide:Hs.SECONDARY})]),n=>n.toString());for(const n of i)this.fileService.hasProvider(n)&&!this.contextService.isInsideWorkspace(n)&&e.add(n)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(bt(this.activeOutOfWorkspaceWatchers.get(t)),this.activeOutOfWorkspaceWatchers.delete(t));for(const t of e.keys())if(!this.activeOutOfWorkspaceWatchers.get(t)){const i=this.fileService.watch(t);this.activeOutOfWorkspaceWatchers.set(t,i)}}async onDidRunFileOperation(e){e.isOperation(Ai.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Ai.DELETE)||e.isOperation(Ai.MOVE))&&this.handleDeletedFile(e.resource,!1,e.target?e.target.resource:void 0)}onDidFilesChange(e){e.gotDeleted()&&this.handleDeletedFile(e,!0)}async handleMovedFile(e,t){for(const i of this.editorGroupsContainer.groups){const n=[];for(const o of i.editors){const r=o.resource;if(!r||!this.uriIdentityService.extUri.isEqualOrParent(r,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,r))a=t;else{const d=SGe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=Pt(t,r.path.substr(d+e.path.length+1))}const c=await o.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(o),sticky:i.isSticky(o),index:i.getIndexOfEditor(o),inactive:!i.isActive(o)};wa(c.editor)?n.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):n.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}n.length&&this.replaceEditors(n,i)}}onConfigurationUpdated(e){if(e&&!e.affectsConfiguration("workbench.editor.closeOnFileDelete"))return;const t=this.configurationService.getValue();typeof t.workbench?.editor?.closeOnFileDelete=="boolean"?this.closeOnFileDelete=t.workbench.editor.closeOnFileDelete:this.closeOnFileDelete=!1}handleDeletedFile(e,t,i){for(const n of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=n.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof zY?r=e.contains(o,To.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Sr(100),a=await this.fileService.exists(o)),!a&&!n.isDisposed()&&n.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(n){n.hasCapability(Ei.Untitled)&&!e.includeUntitled||n.isDirty()||t.push(n)}for(const n of this.editors)e.supportSideBySide&&n instanceof op?(i(n.primary),i(n.secondary)):i(n);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(Qr(t)||im(t))return t;if(W2(t)&&Qr(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return im(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(Zh.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case Zh.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:n})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(n)):this.editorsObserver.editors;case Zh.SEQUENTIAL:{const i=[];for(const n of this.editorGroupsContainer.getGroups(hu.GRID_APPEARANCE))i.push(...n.getEditors(Zh.SEQUENTIAL,t).map(o=>({editor:o,groupId:n.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof XCe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const n of i)(Qr(n)||im(n))&&e.push(n)}return e}get visibleEditors(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let n,o=wa(e)?t:e.options,r;if(Itt(t)&&(i=t),!wa(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===az.ABORT)return;Hhe(a)&&(n=a.editor,o=a.options,r=a.group)}if(n||(n=wa(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(h9e,{editor:n,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(n,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const n=new Map;for(const r of e){let a,c;if(!R5(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===az.ABORT)continue;Hhe(d)&&(a=d,c=d.group)}if(a||(a=R5(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(h9e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=n.get(c);l||(l=[],n.set(c,l)),l.push(a)}const o=[];for(const[r,a]of n)o.push(r.openEditors(a));return Fi(await Zs.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:n}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case Bp.Open:return!0;case Bp.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:n}),!1;case Bp.Cancel:return!1}}extractEditorResources(e){const t=new Dk;let i=!1,n=!1;for(const o of e)if(R5(o)){const r=Na.getOriginalUri(o.editor,{supportSideBySide:Hs.BOTH});N.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof qg)}else wb(o)&&(N.isUri(o.input1)&&t.add(o.input1.resource),N.isUri(o.input2)&&t.add(o.input2.resource),N.isUri(o.base)&&t.add(o.base.resource),N.isUri(o.result)&&t.add(o.result.resource),n=!0),E_(o)?(N.isUri(o.original.resource)&&t.add(o.original.resource),N.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):Qv(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:n}}isOpened(e){return this.editorsObserver.hasEditor({resource:this.uriIdentityService.asCanonicalUri(e.resource),typeId:e.typeId,editorId:e.editorId})}isVisible(e){for(const t of this.editorGroupsContainer.groups)if(t.activeEditor?.matches(e))return!0;return!1}async closeEditor({editor:e,groupId:t},i){await this.editorGroupsContainer.getGroup(t)?.closeEditor(e,i)}async closeEditors(e,t){const i=new Map;for(const{editor:n,groupId:o}of e){const r=this.editorGroupsContainer.getGroup(o);if(!r)continue;let a=i.get(r);a||(a=[],i.set(r,a)),a.push(n)}for(const[n,o]of i)await n.closeEditors(o,t)}findEditors(e,t,i){const n=N.isUri(e)?e:e.resource,o=N.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==Hs.ANY&&t?.supportSideBySide!==Hs.SECONDARY&&!this.editorsObserver.hasEditors(n))return N.isUri(e)||Ya(i)?[]:void 0;if(Ya(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE)){const c=[];if(N.isUri(e))c.push(...this.findEditors(e,t,a));else{const l=this.findEditors(e,t,a);l&&c.push(l)}r.push(...c.map(l=>({editor:l,groupId:a.id})))}return r}else{const r=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(N.isUri(e))return r?r.findEditors(n,t):[];{if(!r)return;const a=r.findEditors(n,t);for(const c of a)if(c.typeId===o)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,n=[];for(const o of e){let r;if(!wa(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===az.ABORT)continue;Hhe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:v4e(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:v4e(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),n.push(r)}return i?.replaceEditors(n)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),n=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Ei.Untitled)?o.push({groupId:a,editor:c}):n.push({groupId:a,editor:c});const r=await Zs.settled(n.map(({groupId:a,editor:c})=>(t?.reason===Cn.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of o){if(c.isDisposed())continue;const d={pinned:!0,viewState:(await this.openEditor(c,a))?.getViewState()},h=t?.saveAs?await c.saveAs(a,t):await c.save(a,t);if(r.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(Ei.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof Ob?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:r.every(a=>!!a),editors:Fi(r)}}saveAll(e){return this.save(this.getAllModifiedEditors(e),e)}async revert(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e);return await Zs.settled(i.map(async({groupId:n,editor:o})=>(this.editorGroupsContainer.getGroup(n)?.pinEditor(o),o.revert(n,t)))),!i.some(({editor:n})=>n.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE))for(const n of i.getEditors(Zh.MOST_RECENTLY_ACTIVE))n.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&n.hasCapability(Ei.Scratchpad)||!e?.includeUntitled&&n.hasCapability(Ei.Untitled)||e?.excludeSticky&&i.isSticky(n)||t.push({groupId:i.id,editor:n}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:n}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:n});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>bt(e)),this.activeOutOfWorkspaceWatchers.clear()}};dke=lke=D([_(1,Po),_(2,we),_(3,Jt),_(4,Te),_(5,yi),_(6,ks),_(7,BU),_(8,vae),_(9,xc),_(10,ece)],dke);function kt(){throw new Error("unsupported")}var hke;class MZt{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=kt,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=kt,this.notifyIndexChanged=kt,this.relayout=kt,this.dispose=kt,this.toJSON=kt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=kt,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=kt,this.openEditor=kt,this.openEditors=kt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt}get groupsView(){return kt()}notifyLabelChanged(){}get titleHeight(){return kt()}get element(){return kt()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}}const J$=new MZt;class NZt{constructor(e){this.editor=e,this.onDidChangeControl=M.None,this.onDidChangeSizeConstraints=M.None,this.onDidFocus=M.None,this.onDidBlur=M.None,this.input=void 0,this.options=void 0,this.group=J$,this.scopedContextKeyService=void 0,this.getViewState=kt,this.isVisible=kt,this.hasFocus=kt,this.getId=kt,this.getTitle=kt,this.focus=kt}get minimumWidth(){return Rx.width}get maximumWidth(){return BJ.width}get minimumHeight(){return Rx.height}get maximumHeight(){return BJ.height}getControl(){return this.editor}}function PZt(s,e,t){async function i(n,o,r){const a=wa(n)?o:n.options;Itt(o)&&(r=o);const c=Qv(n)||wa(n)?n.resource:void 0;if(c==null||!s.canHandleResource(c))return e(n,o,r);let l;if(l=Dt.get(Kt).listCodeEditors().find(h=>h instanceof IM&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(n,o,r);if(h!=null)return h;const u=await s.createModelReference(c);if(l=await t?.(u,a,r===ev),l==null){u.dispose();return}}return a!=null&&LZ(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new NZt(l)}return i}let uke=class extends dke{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(void 0,i,n,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=PZt(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Dt.get(Kt).getFocusedCodeEditor();return e!=null&&e instanceof Yk?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};uke=D([_(2,Po),_(3,we),_(4,Jt),_(5,Te),_(6,yi),_(7,ks),_(8,BU),_(9,vae),_(10,xc),_(11,ece),_(12,fn)],uke);class g9e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=M.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=M.None,this.scopedContextKeyService=void 0,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidBlur=this.editor.onDidBlurEditorWidget}getControl(){return this.editor}getViewState(){}isVisible(){return!0}hasFocus(){return this.editor.hasWidgetFocus()}getId(){return this.editor.getId()}getTitle(){}focus(){this.editor.focus()}}let Yie=hke=class extends V{constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=kt,this.relayout=kt,this.toJSON=kt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=this.editor.onDidLayoutChange,this.layout=()=>this.editor.layout(),this._onDidModelChange=new I,this.onDidModelChange=this._onDidModelChange.event,this.onWillDispose=this.editor.onDidDispose,this._onDidActiveEditorChange=new I,this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this.onWillCloseEditor=M.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=M.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--hke.idCounter,this.index=-1,this.label=`standalone editor ${-this.id}`,this.ariaLabel=`standalone editor ${-this.id}`,this.previewEditor=null,this.isLocked=!0,this.stickyCount=0,this.getEditors=()=>this.editors,this.findEditors=a=>this.pane!=null&&a.toString()===this.pane.input.resource.toString()?[this.pane.input]:[],this.getEditorByIndex=a=>this.pane!=null&&a===0?this.pane.input:void 0,this.getIndexOfEditor=a=>this.pane!=null&&this.pane.input===a?0:-1,this.openEditor=async a=>{if(!a.isDisposed()&&a instanceof MT&&a.resource.toString()===this.pane?.input.resource.toString())return this.focus(),this.pane},this.openEditors=async a=>{if(a.length===1)return this.openEditor(a[0].editor)},this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>this.editor.hasWidgetFocus(),this.contains=a=>this.pane!=null&&this.pane.input===a,this.moveEditor=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt;const n=a=>{const c=t.createInstance(MT,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new g9e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},o=a=>{if(this.pane!=null&&this.pane.input.resource.toString()===a.toString()){const c=this.pane;this.pane=void 0,this._onDidModelChange.fire({kind:6,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:void 0}),this._onDidCloseEditor.fire({context:cA.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&n(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&o(a.uri)}});const r=e.getModel();if(r!=null){const a=t.createInstance(MT,r.uri,void 0,void 0,void 0,void 0);this.pane=new g9e(e,a,this)}}get groupsView(){return kt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:M.None}}get titleHeight(){return kt()}setActive(e){this.active=e}get element(){return this.editor.getContainerDomNode()}get activeEditorPane(){return this.pane}get activeEditor(){return this.pane?.input??null}get count(){return this.pane!=null?1:0}get isEmpty(){return this.pane==null}get editors(){return this.pane!=null?[this.pane.input]:[]}focus(){this.editor.focus(),this.editor.getContainerDomNode().scrollIntoView()}};Yie.idCounter=0;Yie=hke=D([_(1,we),_(2,Le)],Yie);let gke=class extends V{constructor(e,t,i){super(),this.delegate=e,this._serviceBrand=void 0,this.additionalGroups=[],this.activeGroupOverride=void 0,this.onDidCreateAuxiliaryEditorPart=this.delegate.onDidCreateAuxiliaryEditorPart,this.onDidChangeGroupMaximized=this.delegate.onDidChangeGroupMaximized,this._onDidChangeActiveGroup=new I,this.onDidChangeActiveGroup=M.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=M.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=M.any(this._onDidRemoveGroup.event,this.delegate.onDidRemoveGroup),this.onDidMoveGroup=this.delegate.onDidMoveGroup,this.onDidActivateGroup=this.delegate.onDidActivateGroup,this.onDidChangeGroupIndex=this.delegate.onDidChangeGroupIndex,this.onDidChangeGroupLocked=this.delegate.onDidChangeGroupLocked,this.getLayout=()=>this.delegate.getLayout(),this.getGroups=n=>[...this.delegate.getGroups(n),...this.additionalGroups],this.getGroup=n=>this.delegate.getGroup(n)??this.additionalGroups.find(o=>o.id===n),this.activateGroup=(...n)=>this.delegate.activateGroup(...n),this.getSize=(...n)=>this.delegate.getSize(...n),this.setSize=(...n)=>this.delegate.setSize(...n),this.arrangeGroups=(...n)=>this.delegate.arrangeGroups(...n),this.applyLayout=(...n)=>this.delegate.applyLayout(...n),this.setGroupOrientation=(...n)=>this.delegate.setGroupOrientation(...n),this.findGroup=(...n)=>this.delegate.findGroup(...n),this.addGroup=(...n)=>this.delegate.addGroup(...n),this.removeGroup=(...n)=>this.delegate.removeGroup(...n),this.moveGroup=(...n)=>this.delegate.moveGroup(...n),this.mergeGroup=(...n)=>this.delegate.mergeGroup(...n),this.mergeAllGroups=(...n)=>this.delegate.mergeAllGroups(...n),this.copyGroup=(...n)=>this.delegate.copyGroup(...n),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const n=Dt.get(Kt),o=a=>{if(a instanceof IM){let c;const l=p=>{const m=p!=null?this.additionalGroups.find(v=>v.editor===p):void 0;this.activeGroupOverride!==m&&(this.activeGroupOverride=m,this._onDidChangeActiveGroup.fire(this.activeGroup))},d=p=>{!t&&this.activeGroupOverride===this.additionalGroups.find(m=>m.editor===p)&&l(void 0)},h=()=>{c!=null&&window.clearTimeout(c),l(a)},u=()=>{c!=null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=void 0,d(a)},100)};a.onDidDispose(()=>{d(a)}),a.onDidFocusEditorText(h),a.onDidFocusEditorWidget(h),a.onDidBlurEditorText(u),a.onDidBlurEditorWidget(u),a.hasWidgetFocus()&&h();const f=i.createInstance(Yie,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof IM){const c=this.additionalGroups.find(l=>l.editor===a);c!=null&&(c.dispose(),this.activeGroupOverride===c&&(this.activeGroupOverride=void 0,this._onDidChangeActiveGroup.fire(this.activeGroup)),this.additionalGroups=this.additionalGroups.filter(l=>l!==c),this._onDidRemoveGroup.fire(c))}};this._register(n.onCodeEditorAdd(o)),this._register(n.onCodeEditorRemove(r)),n.listCodeEditors().forEach(o)})}registerContextKeyProvider(e){return this.delegate.registerContextKeyProvider(e)}saveWorkingSet(e){return this.delegate.saveWorkingSet(e)}getWorkingSets(){return this.delegate.getWorkingSets()}applyWorkingSet(e){return this.delegate.applyWorkingSet(e)}deleteWorkingSet(e){return this.delegate.deleteWorkingSet(e)}get isReady(){return this.delegate.isReady}get whenReady(){return this.delegate.whenReady}get whenRestored(){return this.delegate.whenRestored}get hasRestorableState(){return this.delegate.hasRestorableState}get parts(){return this.delegate.parts}createAuxiliaryEditorPart(e){return this.delegate.createAuxiliaryEditorPart(e)}get mainPart(){return this.delegate.mainPart}getPart(e){return this.delegate.getPart(e)}toggleMaximizeGroup(e){return this.delegate.toggleMaximizeGroup(e)}toggleExpandGroup(e){return this.delegate.toggleExpandGroup(e)}createEditorDropTarget(e,t){return this.delegate.createEditorDropTarget(e,t)}get groups(){return[...this.additionalGroups,...this.delegate.groups]}get activeGroup(){return this.activeGroupOverride??this.delegate.activeGroup}get sideGroup(){return this.delegate.sideGroup}get count(){return this.delegate.count+this.additionalGroups.length}get orientation(){return this.delegate.orientation}get partOptions(){return this.delegate.partOptions}};gke=D([_(2,we)],gke);var YB;let Jie=(YB=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=n,this.workingCopyService=o,this.logService=r,this.markerService=a,this.uriIdentityService=c,this.scheduledAutoSavesAfterDelay=new Map,this.lastActiveEditor=void 0,this.lastActiveGroupId=void 0,this.lastActiveEditorControlDisposable=this._register(new Z),this.waitingOnConditionAutoSaveWorkingCopies=new ui(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new ui(l=>this.uriIdentityService.extUri.getComparisonKey(l));for(const l of this.workingCopyService.dirtyWorkingCopies)this.onDidRegister(l);this.registerListeners()}registerListeners(){this._register(this.hostService.onDidChangeFocus(e=>this.onWindowFocusChange(e))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChange())),this._register(this.editorService.onDidActiveEditorChange(()=>this.onDidActiveEditorChange())),this._register(this.filesConfigurationService.onDidChangeAutoSaveConfiguration(()=>this.onDidChangeAutoSaveConfiguration())),this._register(this.workingCopyService.onDidRegister(e=>this.onDidRegister(e))),this._register(this.workingCopyService.onDidUnregister(e=>this.onDidUnregister(e))),this._register(this.workingCopyService.onDidChangeDirty(e=>this.onDidChangeDirty(e))),this._register(this.workingCopyService.onDidChangeContent(e=>this.onDidChangeContent(e))),this._register(this.markerService.onMarkerChanged(e=>this.onConditionChanged(e,Bg.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Bg.DISABLED)))}onConditionChanged(e,t){for(const i of e){const n=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(n?.condition===t)n.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(n.workingCopy.resource,n.reason).mode!==rc.OFF&&(this.discardAutoSave(n.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",n.workingCopy.resource.toString(),n.workingCopy.typeId),n.workingCopy.save({reason:n.reason}));else{const o=this.waitingOnConditionAutoSaveEditors.get(i);o?.condition===t&&!o.editor.editor.isDisposed()&&o.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(o.editor.editor,o.reason).mode!==rc.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${o.reason}`),this.editorService.save(o.editor,{reason:o.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Cn.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Cn.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Cn.FOCUS_CHANGE,{groupId:this.lastActiveGroupId,editor:this.lastActiveEditor});const e=this.editorGroupService.activeGroup,t=this.lastActiveEditor=e.activeEditor??void 0;this.lastActiveGroupId=e.id,this.lastActiveEditorControlDisposable.clear();const i=this.editorService.activeEditorPane;t&&i&&this.lastActiveEditorControlDisposable.add(i.onDidBlur(()=>{this.maybeTriggerAutoSave(Cn.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Ei.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==rc.OFF?(e===Cn.WINDOW_CHANGE&&(i.mode===rc.ON_FOCUS_CHANGE||i.mode===rc.ON_WINDOW_CHANGE)||e===Cn.FOCUS_CHANGE&&i.mode===rc.ON_FOCUS_CHANGE)&&(this.logService.trace(`[editor auto save] triggering auto save with reason ${e}`),this.editorService.save(t,{reason:e})):t.editor.resource&&(i.reason===Bg.ERRORS||i.reason===Bg.DISABLED)&&this.waitingOnConditionAutoSaveEditors.set(t.editor.resource,{editor:t,reason:e,condition:i.reason})}else this.saveAllDirtyAutoSaveables(e)}onDidChangeAutoSaveConfiguration(){let e;switch(this.filesConfigurationService.getAutoSaveMode(void 0).mode){case rc.ON_FOCUS_CHANGE:e=Cn.FOCUS_CHANGE;break;case rc.ON_WINDOW_CHANGE:e=Cn.WINDOW_CHANGE;break;case rc.AFTER_SHORT_DELAY:case rc.AFTER_LONG_DELAY:e=Cn.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&aC.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==rc.OFF?t.save({reason:e}):(i.reason===Bg.ERRORS||i.reason===Bg.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(t.resource,{workingCopy:t,reason:e,condition:i.reason})}}onDidRegister(e){e.isDirty()&&this.scheduleAutoSave(e)}onDidUnregister(e){this.discardAutoSave(e)}onDidChangeDirty(e){e.isDirty()?this.scheduleAutoSave(e):this.discardAutoSave(e)}onDidChangeContent(e){e.isDirty()&&this.scheduleAutoSave(e)}scheduleAutoSave(e){if(e.capabilities&aC.Untitled)return;const t=this.filesConfigurationService.getAutoSaveConfiguration(e.resource).autoSaveDelay;if(typeof t!="number")return;this.discardAutoSave(e),this.logService.trace(`[editor auto save] scheduling auto save after ${t}ms`,e.resource.toString(),e.typeId);const i=setTimeout(()=>{if(this.discardAutoSave(e),e.isDirty()){const n=Cn.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,n);o.mode!==rc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:n})):(o.reason===Bg.ERRORS||o.reason===Bg.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:n,condition:o.reason})}},t);this.scheduledAutoSavesAfterDelay.set(e,Ee(()=>{this.logService.trace("[editor auto save] clearing pending auto save",e.resource.toString(),e.typeId),clearTimeout(i)}))}discardAutoSave(e){bt(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},YB.ID="workbench.contrib.editorAutoSave",YB);Jie=D([_(0,_d),_(1,xc),_(2,ei),_(3,Po),_(4,Rm),_(5,Ge),_(6,Am),_(7,ks)],Jie);Qu(Jie.ID,Jie,yc.BlockRestore);let fke=class extends RI{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Us.binary}getName(){return this.name}getSize(){return this.size}getMime(){return this.mime}getETag(){return this.etag}async resolve(){if(this.fileService.hasProvider(this.resource)){const e=await this.fileService.stat(this.resource);this.etag=e.etag,typeof e.size=="number"&&(this.size=e.size)}return super.resolve()}};fke=D([_(2,Jt)],fke);var pke,HE;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Binary=2]="Binary"})(HE||(HE={}));let Xie=pke=class extends lb{get typeId(){return $tt}get editorId(){return rm.id}get capabilities(){let e=Ei.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Ei.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(e,t,p,l,h,u,f,v,b),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=HE.None,this.model=void 0,this.cachedTextFileModelReference=void 0,this.modelListeners=this._register(new Z),this.model=this.textFileService.files.get(e),i&&this.setPreferredName(i),n&&this.setPreferredDescription(n),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(w=>this.onDidCreateTextFileModel(w))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){ji(e.resource,this.resource)&&(this.model=e,this.registerModelListeners(e))}registerModelListeners(e){this.modelListeners.clear(),this.modelListeners.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(e.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this.modelListeners.add(e.onDidSaveError(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(M.once(e.onWillDispose)(()=>{this.modelListeners.clear(),this.model=void 0}))}getName(){return this.preferredName||super.getName()}setPreferredName(e){this.allowLabelOverride()&&this.preferredName!==e&&(this.preferredName=e,this._onDidChangeLabel.fire())}allowLabelOverride(){return this.resource.scheme!==this.pathService.defaultUriScheme&&this.resource.scheme!==pe.vscodeUserData&&this.resource.scheme!==pe.file&&this.resource.scheme!==pe.vscodeRemote}getPreferredName(){return this.preferredName}isReadonly(){return this.model?this.model.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}getDescription(e){return this.preferredDescription||super.getDescription(e)}setPreferredDescription(e){this.allowLabelOverride()&&this.preferredDescription!==e&&(this.preferredDescription=e,this._onDidChangeLabel.fire())}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getEncoding(){return this.model?this.model.getEncoding():this.preferredEncoding}getPreferredEncoding(){return this.preferredEncoding}async setEncoding(e,t){return this.setPreferredEncoding(e),this.model?.setEncoding(e,t)}setPreferredEncoding(e){this.preferredEncoding=e,this.setForceOpenAsText()}getLanguageId(){return this.model?this.model.getLanguageId():this.preferredLanguageId}getPreferredLanguageId(){return this.preferredLanguageId}setLanguageId(e,t){this.setPreferredLanguageId(e),this.model?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e,this.setForceOpenAsText()}setPreferredContents(e){this.preferredContents=e,this.setForceOpenAsText()}setForceOpenAsText(){this.forceOpenAs=HE.Text}setForceOpenAsBinary(){this.forceOpenAs=HE.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(gh.SAVED)||this.model?.hasState(gh.CONFLICT)||this.model?.hasState(gh.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===HE.Binary?e.find(t=>t.typeId===JVt):e.find(t=>t.typeId===ztt)}resolve(e){return this.forceOpenAs===HE.Binary?this.doResolveAsBinary():this.doResolveAsText(e)}async doResolveAsText(e){try{const t=this.preferredContents;this.preferredContents=void 0,await this.textFileService.files.resolve(this.resource,{languageId:this.preferredLanguageId,encoding:this.preferredEncoding,contents:typeof t=="string"?oae(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===HE.Text,reason:X3.EDITOR,limits:this.ensureLimits(e)}),this.cachedTextFileModelReference||(this.cachedTextFileModelReference=await this.textModelService.createModelReference(this.resource));const i=this.cachedTextFileModelReference.object;return this.isDisposed()&&this.disposeModelReference(),i}catch(t){if(t.textFileOperationResult===EW.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(fke,this.preferredResource,this.getName());return await e.resolve(),e}isResolved(){return!!this.model}async rename(e,t){return{editor:{resource:t,encoding:this.getEncoding(),options:{viewState:YO(this,e,this.editorService)}}}}toUntyped(e){const t={resource:this.preferredResource,forceFile:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=(()=>{const i=this.textFileService.files.get(this.resource);if(i?.isDirty()&&!i.textEditorModel.isTooLargeForHeapOperation())return i.textEditorModel.getValue()})(),t.options={...t.options,viewState:YO(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof pke?ji(e.resource,this.resource):Qv(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Xie=pke=D([_(7,we),_(8,Fo),_(9,fn),_(10,Fs),_(11,Jt),_(12,_d),_(13,ei),_(14,bf),_(15,Ec),_(16,nE)],Xie);Qe.as(tC.EditorFactory).registerFileEditorFactory({typeId:$tt,createFileEditor:(s,e,t,i,n,o,r,a)=>a.createInstance(Xie,s,e,t,i,n,o,r),isFileEditor:s=>s instanceof Xie});function Vst(s){const e=s.get(lg).lastFocusedList,t=e?.getHTMLElement();if(t&&av(t)&&e instanceof Xa){const i=Fi(e.getSelectedElements().filter(a=>a instanceof xZ)),n=e.getFocusedElements(),o=n.length?n[0]:void 0;let r;return o instanceof xZ&&(r=o),i.some(a=>a===r)?i:r?[r]:void 0}}async function DPe(s,e){const t=s.get(Po),i=s.get(Kt),n=s.get(Fo);let o=Vst(s);if(!o){const a=t.activeGroup;a.activeEditor&&(o=[],a.activeEditor instanceof op&&!e?.saveAs&&!(a.activeEditor.primary.hasCapability(Ei.Untitled)||a.activeEditor.secondary.hasCapability(Ei.Untitled))&&a.activeEditor.secondary.isModified()?(o.push({groupId:a.id,editor:a.activeEditor.primary}),o.push({groupId:a.id,editor:a.activeEditor.secondary})):o.push({groupId:a.id,editor:a.activeEditor}))}if(!o||o.length===0)return;await kPe(s,o,e);const r=i.getFocusedCodeEditor();if(r instanceof lf&&!r.isSimpleWidget){const a=r.getModel()?.uri;a&&!o.some(({editor:c})=>ji(Na.getCanonicalUri(c,{supportSideBySide:Hs.PRIMARY}),a))&&(n.files.get(a)?.isReadonly()||await n.save(a,e))}}function zst(s,e,t){const i=[];for(const n of e)for(const o of n.getEditors(Zh.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:n.id,editor:o});return kPe(s,i,t)}async function kPe(s,e,t){const i=s.get(ei),n=s.get(bi),o=s.get(we);try{await i.save(e,t)}catch(r){Fr(r)||n.notify({id:e.map(({editor:a})=>Wc(a.resource?.toString())).join(),severity:Xe.Error,message:g(3756,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Nr(r,!1)),actions:{primary:[rl({id:"workbench.action.files.saveEditors",label:g(3757,"Retry"),run:()=>o.invokeFunction(a=>kPe(a,e,t))}),rl({id:"workbench.action.files.revertEditors",label:g(3758,"Discard"),run:()=>i.revert(e)})]}})}}So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyS,id:CFt,handler:s=>DPe(s,{reason:Cn.EXPLICIT,force:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:rr(U.CtrlCmd|S.KeyK,S.KeyS),win:{primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyS)},id:SFt,handler:s=>DPe(s,{reason:Cn.EXPLICIT,force:!0,skipSaveParticipants:!0})});So.registerCommandAndKeybindingRule({id:yFt,weight:Ae.WorkbenchContrib,when:void 0,primary:U.CtrlCmd|U.Shift|S.KeyS,handler:s=>DPe(s,{reason:Cn.EXPLICIT,saveAs:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:void 0,mac:{primary:U.CtrlCmd|U.Alt|S.KeyS},win:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyS)},id:AFt,handler:s=>zst(s,s.get(Po).getGroups(hu.MOST_RECENTLY_ACTIVE),{reason:Cn.EXPLICIT})});_t.registerCommand({id:JZe,handler:(s,e,t)=>{const i=s.get(Po),n=v5t([t],s.get(ei),i,s.get(lg));let o;return n.groupedEditors.length?o=n.groupedEditors.map(({group:r})=>r):o=i.getGroups(hu.MOST_RECENTLY_ACTIVE),zst(s,o,{reason:Cn.EXPLICIT})}});_t.registerCommand({id:EFt,handler:async s=>(await s.get(ei).saveAll({includeUntitled:!1,reason:Cn.EXPLICIT})).success});_t.registerCommand({id:wFt,handler:async s=>{const e=s.get(Po),t=s.get(ei);let i=Vst(s);if(!i){const n=e.activeGroup;n.activeEditor&&(i=[{groupId:n.id,editor:n.activeEditor}])}if(!(!i||i.length===0))try{await t.revert(i.filter(({editor:n})=>!n.hasCapability(Ei.Untitled)),{force:!0})}catch(n){s.get(bi).error(g(3759,"Failed to revert '{0}': {1}",i.map(({editor:r})=>r.getName()).join(", "),Nr(n,!1)))}}});class FZt{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=si.vscodeWindowId,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=kt,this.isLayoutCentered=kt,this.enforcePartOptions=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=J$,this.groups=[J$],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.applyLayout=kt,this.getLayout=kt,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.partOptions=Vae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}class OZt{constructor(){this.registerContextKeyProvider=kt,this.saveWorkingSet=kt,this.getWorkingSets=kt,this.applyWorkingSet=kt,this.deleteWorkingSet=kt,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new FZt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=kt,this.createAuxiliaryEditorPart=kt,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.partOptions=Vae,this.createEditorDropTarget=kt,this._serviceBrand=void 0,this.getLayout=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=J$,this.groups=[J$],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.applyLayout=kt,this.centerLayout=kt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}let mke=class extends gke{constructor(e){super(e.createInstance(OZt),!0,e)}};mke=D([_(0,we)],mke);function BZt(s){return{[Kt.toString()]:new wi(rke,void 0,!0),[ei.toString()]:new wi(uke,[s,()=>!1],!0),[ece.toString()]:new wi(ake,[],!1),[Po.toString()]:new wi(mke)}}class X${static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,n=!1,o=!1,r;do r=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),r=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),r=!0),/^alt(\+|\-)/.test(e)&&(n=!0,e=e.substr(4),r=!0),/^meta(\+|\-)/.test(e)&&(o=!0,e=e.substr(5),r=!0),/^win(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0),/^cmd(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0);while(r);let a;const c=e.indexOf(" ");return c>0?(a=e.substring(0,c),e=e.substring(c)):(a=e,e=""),{remains:e,ctrl:t,shift:i,alt:n,meta:o,key:a}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const o=i[1],r=Vp.lowerCaseToEnum(o);return[new gy(t.ctrl,t.shift,t.alt,t.meta,r),t.remains]}const n=Ia.fromUserSettings(t.key);return[new Ih(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}static parseKeybinding(e){if(!e)return null;const t=[];let i;for(;e.length>0;)[i,e]=this.parseChord(e),t.push(i);return t.length>0?new IO(t):null}}const $st=[{key:"commandPalette",id:_e.CommandPalette,description:g(8540,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:_e.TouchBarContext,description:g(8541,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:_e.EditorTitle,description:g(8542,"The editor title menu")},{key:"editor/title/run",id:_e.EditorTitleRun,description:g(8543,"Run submenu inside the editor title menu")},{key:"editor/context",id:_e.EditorContext,description:g(8544,"The editor context menu")},{key:"editor/context/copy",id:_e.EditorContextCopy,description:g(8545,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:_e.EditorContextShare,description:g(8546,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:_e.ExplorerContext,description:g(8547,"The file explorer context menu")},{key:"explorer/context/share",id:_e.ExplorerContextShare,description:g(8548,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:_e.EditorTitleContext,description:g(8549,"The editor tabs context menu")},{key:"editor/title/context/share",id:_e.EditorTitleContextShare,description:g(8550,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:_e.DebugCallStackContext,description:g(8551,"The debug callstack view context menu")},{key:"debug/variables/context",id:_e.DebugVariablesContext,description:g(8552,"The debug variables view context menu")},{key:"debug/toolBar",id:_e.DebugToolBar,description:g(8553,"The debug toolbar menu")},{key:"notebook/variables/context",id:_e.NotebookVariablesContext,description:g(8554,"The notebook variables view context menu")},{key:"menuBar/home",id:_e.MenubarHomeMenu,description:g(8555,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:_e.MenubarCopy,description:g(8556,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:_e.SCMTitle,description:g(8557,"The Source Control title menu")},{key:"scm/sourceControl",id:_e.SCMSourceControl,description:g(8558,"The Source Control menu")},{key:"scm/sourceControl/title",id:_e.SCMSourceControlTitle,description:g(8559,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:_e.SCMResourceContext,description:g(8560,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:_e.SCMResourceFolderContext,description:g(8561,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:_e.SCMResourceGroupContext,description:g(8562,"The Source Control resource group context menu")},{key:"scm/change/title",id:_e.SCMChangeContext,description:g(8563,"The Source Control inline change menu")},{key:"scm/inputBox",id:_e.SCMInputBox,description:g(8564,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/historyItemChanges/title",id:_e.SCMChangesSeparator,description:g(8565,"The Source Control incoming/outgoing changes title menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/historyItem/context",id:_e.SCMChangesContext,description:g(8566,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/incomingChanges",id:_e.SCMIncomingChanges,description:g(8567,"The Source Control incoming changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/context",id:_e.SCMIncomingChangesContext,description:g(8568,"The Source Control incoming changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges",id:_e.SCMOutgoingChanges,description:g(8569,"The Source Control outgoing changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges/context",id:_e.SCMOutgoingChangesContext,description:g(8570,"The Source Control outgoing changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/allChanges/context",id:_e.SCMIncomingChangesAllChangesContext,description:g(8571,"The Source Control all incoming changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/incomingChanges/historyItem/context",id:_e.SCMIncomingChangesHistoryItemContext,description:g(8572,"The Source Control incoming changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/allChanges/context",id:_e.SCMOutgoingChangesAllChangesContext,description:g(8573,"The Source Control all outgoing changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/historyItem/context",id:_e.SCMOutgoingChangesHistoryItemContext,description:g(8574,"The Source Control outgoing changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:_e.StatusBarRemoteIndicatorMenu,description:g(8575,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:_e.TerminalInstanceContext,description:g(8576,"The terminal context menu")},{key:"terminal/title/context",id:_e.TerminalTabContext,description:g(8577,"The terminal tabs context menu")},{key:"view/title",id:_e.ViewTitle,description:g(8578,"The contributed view title menu")},{key:"view/item/context",id:_e.ViewItemContext,description:g(8579,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:_e.CommentEditorActions,description:g(8580,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:_e.CommentThreadTitle,description:g(8581,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:_e.CommentThreadActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:_e.CommentThreadAdditionalActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:_e.CommentThreadTitleContext,description:g(8583,"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."),proposed:"contribCommentPeekContext"},{key:"comments/comment/title",id:_e.CommentTitle,description:g(8584,"The contributed comment title menu")},{key:"comments/comment/context",id:_e.CommentActions,description:g(8585,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:_e.CommentThreadCommentContext,description:g(8586,"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."),proposed:"contribCommentPeekContext"},{key:"commentsView/commentThread/context",id:_e.CommentsViewThreadActions,description:g(8587,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:_e.NotebookToolbar,description:g(8588,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:_e.NotebookKernelSource,description:g(8589,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:_e.NotebookCellTitle,description:g(8590,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:_e.NotebookCellExecute,description:g(8591,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:_e.InteractiveToolbar,description:g(8592,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:_e.InteractiveCellTitle,description:g(8593,"The contributed interactive cell title menu")},{key:"issue/reporter",id:_e.IssueReporter,description:g(8594,"The contributed issue reporter menu"),proposed:"contribIssueReporter"},{key:"testing/item/context",id:_e.TestItem,description:g(8595,"The contributed test item menu")},{key:"testing/item/gutter",id:_e.TestItemGutter,description:g(8596,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:_e.TestProfilesContext,description:g(8597,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:_e.TestPeekElement,description:g(8598,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:_e.TestMessageContext,description:g(8599,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:_e.TestMessageContent,description:g(8600,"Context menu for the message in the results tree")},{key:"extension/context",id:_e.ExtensionContext,description:g(8601,"The extension context menu")},{key:"timeline/title",id:_e.TimelineTitle,description:g(8602,"The Timeline view title menu")},{key:"timeline/item/context",id:_e.TimelineItemContext,description:g(8603,"The Timeline view item context menu")},{key:"ports/item/context",id:_e.TunnelContext,description:g(8604,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:_e.TunnelOriginInline,description:g(8605,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:_e.TunnelPortInline,description:g(8606,"The Ports view item port inline menu")},{key:"file/newFile",id:_e.NewFile,description:g(8607,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:_e.WebviewContext,description:g(8608,"The webview context menu")},{key:"file/share",id:_e.MenubarShare,description:g(8609,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:_e.InlineCompletionsActions,description:g(8610,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/inlineEdit/actions",id:_e.InlineEditActions,description:g(8611,"The actions shown when hovering on an inline edit"),supportsSubmenus:!1,proposed:"inlineEdit"},{key:"editor/content",id:_e.EditorContent,description:g(8612,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:_e.EditorLineNumberContext,description:g(8613,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:_e.MergeInputResultToolbar,description:g(8614,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:_e.MultiDiffEditorFileToolbar,description:g(8615,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:_e.DiffEditorHunkToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:_e.DiffEditorSelectionToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"}];var KA;(function(s){function e(f){return typeof f.command=="string"}s.isMenuItem=e;function t(f,p){return typeof f.command!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):f.alt&&typeof f.alt!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","alt")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidMenuItem=t;function i(f,p){return typeof f.submenu!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidSubmenuItem=i;function n(f,p){if(!Array.isArray(f))return p.error(g(8619,"submenu items must be an array")),!1;for(const m of f)if(e(m)){if(!t(m,p))return!1}else if(!i(m,p))return!1;return!0}s.isValidItems=n;function o(f,p){return typeof f!="object"?(p.error(g(8620,"submenu items must be an object")),!1):typeof f.id!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof f.label!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","label")),!1):!0}s.isValidSubmenu=o;const r={type:"object",required:["command"],properties:{command:{description:g(8621,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:g(8622,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},a={type:"object",required:["submenu"],properties:{submenu:{description:g(8625,"Identifier of the submenu to display in this item."),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},c={type:"object",required:["id","label"],properties:{id:{description:g(8626,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:g(8627,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:g(8628,"(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8629,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8630,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.menusContribution={description:g(8631,"Contributes menu items to the editor"),type:"object",properties:O1e($st,f=>f.key,f=>({markdownDescription:f.proposed?g(8632,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',f.proposed,f.description):f.description,type:"array",items:f.supportsSubmenus===!1?r:{oneOf:[r,a]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[r,a]}}},s.submenusContribution={description:g(8633,"Contributes submenu items to the editor"),type:"array",items:c};function l(f,p){return f?Gu(f.command)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):!h(f.title,p,"title")||f.shortTitle&&!h(f.shortTitle,p,"shortTitle")?!1:f.enablement&&typeof f.enablement!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(f.category&&!h(f.category,p,"category")||!d(f.icon,p)):(p.error(g(8634,"expected non-empty value.")),!1)}s.isValidCommand=l;function d(f,p){return typeof f>"u"||typeof f=="string"||typeof f.dark=="string"&&typeof f.light=="string"?!0:(p.error(g(8635,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function h(f,p,m){return typeof f>"u"?(p.error(g(8636,"property `{0}` is mandatory and must be of type `string` or `object`",m)),!1):typeof f=="string"&&Gu(f)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`",m)),!1):typeof f!="string"&&(Gu(f.original)||Gu(f.value))?(p.error(g(8637,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${m}.value`,`${m}.original`)),!1):!0}const u={type:"object",required:["command","title"],properties:{command:{description:g(8638,"Identifier of the command to execute"),type:"string"},title:{description:g(8639,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:g(8640,"(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands."),type:"string"},category:{description:g(8641,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:g(8642,"(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api."),type:"string"},icon:{description:g(8643,"(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8644,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8645,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.commandsContribution={description:g(8646,"Contributes commands to the command palette."),oneOf:[u,{type:"array",items:u}]}})(KA||(KA={}));const f9e=new Z,Gst=eh.registerExtensionPoint({extensionPoint:"commands",jsonSchema:KA.commandsContribution,activationEventsGenerator:(s,e)=>{for(const t of s)t.command&&e.push(`onCommand:${t.command}`)}});Gst.setHandler(s=>{function e(t,i){if(!KA.isValidCommand(t,i.collector))return;const{icon:n,enablement:o,category:r,title:a,shortTitle:c,command:l}=t;let d;n&&(typeof n=="string"?d=We.fromString(n)??{dark:Pt(i.description.extensionLocation,n),light:Pt(i.description.extensionLocation,n)}:d={dark:Pt(i.description.extensionLocation,n.dark),light:Pt(i.description.extensionLocation,n.light)});const h=jn.getCommand(l);h&&(h.source?i.collector.info(g(8647,"Command `{0}` already registered by {1} ({2})",t.command,h.source.title,h.source.id)):i.collector.info(g(8648,"Command `{0}` already registered",t.command))),f9e.add(jn.addCommand({id:l,title:a,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:c,tooltip:a,category:r,precondition:he.deserialize(o),icon:d}))}f9e.clear();for(const t of s){const{value:i}=t;if(Array.isArray(i))for(const n of i)e(n,t);else e(i,t)}});const wz=new Map,Kst=eh.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:KA.submenusContribution});Kst.setHandler(s=>{wz.clear();for(const e of s){const{value:t,collector:i}=e;for(const[,n]of Object.entries(t)){if(!KA.isValidSubmenu(n,i))continue;if(!n.id){i.warn(g(8649,"`{0}` is not a valid submenu identifier",n.id));continue}if(wz.has(n.id)){i.info(g(8650,"The `{0}` submenu was already previously registered.",n.id));continue}if(!n.label){i.warn(g(8651,"`{0}` is not a valid submenu label",n.label));continue}let o;n.icon&&(typeof n.icon=="string"?o=We.fromString(n.icon)||{dark:Pt(e.description.extensionLocation,n.icon)}:o={dark:Pt(e.description.extensionLocation,n.icon.dark),light:Pt(e.description.extensionLocation,n.icon.light)});const r={id:_e.for(`api:${n.id}`),label:n.label,icon:o};wz.set(n.id,r)}}});const WZt=new Map($st.map(s=>[s.key,s])),p9e=new Z,Kue=new Map,HZt=eh.registerExtensionPoint({extensionPoint:"menus",jsonSchema:KA.menusContribution,deps:[Kst]});HZt.setHandler(s=>{p9e.clear(),Kue.clear();for(const e of s){const{value:t,collector:i}=e;for(const n of Object.entries(t)){if(!KA.isValidItems(n[1],i))continue;let o=WZt.get(n[0]);if(!o){const r=wz.get(n[0]);r&&(o={key:n[0],id:r.id,description:""})}if(o){if(o.proposed&&!dl(e.description,o.proposed)){i.error(g(8652,`{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["{1}"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}`,n[0],o.proposed,e.description.identifier.value));continue}for(const r of n[1]){let a;if(KA.isMenuItem(r)){const c=jn.getCommand(r.command),l=r.alt&&jn.getCommand(r.alt)||void 0;if(!c){i.error(g(8653,"Menu item references a command `{0}` which is not defined in the 'commands' section.",r.command));continue}r.alt&&!l&&i.warn(g(8654,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",r.alt)),r.command===r.alt&&i.info(g(8655,"Menu item references the same command as default and alt-command")),a={command:c,alt:l,group:void 0,order:void 0,when:void 0}}else{if(o.supportsSubmenus===!1){i.error(g(8656,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const c=wz.get(r.submenu);if(!c){i.error(g(8657,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",r.submenu));continue}let l=Kue.get(o.id.id);if(l||(l=new Set,Kue.set(o.id.id,l)),l.has(c.id.id)){i.warn(g(8658,"The `{0}` submenu was already contributed to the `{1}` menu.",r.submenu,n[0]));continue}l.add(c.id.id),a={submenu:c.id,icon:c.icon,title:c.label,group:void 0,order:void 0,when:void 0}}if(r.group){const c=r.group.lastIndexOf("@");c>0?(a.group=r.group.substr(0,c),a.order=Number(r.group.substr(c+1))||void 0):a.group=r.group}a.when=he.deserialize(r.when),p9e.add(jn.appendMenuItem(o.id,a))}}}}});let _ke=class extends V{constructor(e){super(),this._keybindingService=e,this.type="table"}shouldRender(e){return!!e.contributes?.commands}render(e){const i=(e.contributes?.commands||[]).map(l=>({id:l.command,title:l.title,keybindings:[],menus:[]})),n=O1e(i,l=>l.id),o=e.contributes?.menus||{};for(const l in o)for(const d of o[l])if(d.command){let h=n[d.command];h?h.menus.push(l):(h={id:d.command,title:"",keybindings:[],menus:[l]},n[h.id]=h,i.push(h))}if((e.contributes?.keybindings?Array.isArray(e.contributes.keybindings)?e.contributes.keybindings:[e.contributes.keybindings]:[]).forEach(l=>{const d=this.resolveKeybinding(l);if(!d)return;let h=n[l.command];h?h.keybindings.push(d):(h={id:l.command,title:"",keybindings:[d],menus:[]},n[h.id]=h,i.push(h))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const a=[g(8659,"ID"),g(8660,"Title"),g(8661,"Keyboard Shortcuts"),g(8662,"Menu Contexts")],c=i.sort((l,d)=>l.id.localeCompare(d.id)).map(l=>[new Mt().appendMarkdown(`\`${l.id}\``),typeof l.title=="string"?l.title:l.title.value,l.keybindings,new Mt().appendMarkdown(`${l.menus.map(d=>`\`${d}\``).join(" ")}`)]);return{data:{headers:a,rows:c},dispose:()=>{}}}resolveKeybinding(e){let t;switch(cGe){case"win32":t=e.win;break;case"linux":t=e.linux;break;case"darwin":t=e.mac;break}return this._keybindingService.resolveUserBinding(t??e.key)[0]}};_ke=D([_(0,Ut)],_ke);Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:g(8663,"Commands"),access:{canToggle:!1},renderer:new wi(_ke)});class qst{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${UZt(i+",",25)} "command": `);const n=t.when?JSON.stringify(t.when.serialize()):"",o=JSON.stringify(t.command);n.length>0?(e.write(`${o},`),e.writeLine(),e.write(` "when": ${n}`)):e.write(`${o}`),t.commandArgs&&(e.write(","),e.writeLine(),e.write(` "args": ${JSON.stringify(t.commandArgs)}`)),e.write(" }")}static readUserKeybindingItem(e){const t="key"in e&&typeof e.key=="string"?X$.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?he.deserialize(e.when):void 0,n="command"in e&&typeof e.command=="string"?e.command:null,o="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:n,commandArgs:o,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function UZt(s,e){return s.length{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new GZt(o,l,c,d)),this.userKeybindings.initialize().then(()=>{this.userKeybindings.keybindings.length&&this.updateResolver()}),this._register(this.userKeybindings.onDidChange(()=>{d.debug("User keybindings changed"),this.updateResolver()})),_9e.setHandler(u=>{const f=[];for(const p of u)this._handleKeybindingsExtensionPointUser(p.description.identifier,p.description.isBuiltin,p.value,p.collector,f);So.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(a.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(M.runAndSubscribe(tm,({window:u,disposables:f})=>f.add(this._registerKeyListeners(u)),{window:si,disposables:this._store})),this._register(vGe(u=>{if(u!==si.vscodeWindowId)return;const f=navigator.keyboard;kO.keyboard!==Zx.None&&(rpe(si)?f?.lock(["Escape"]):f?.unlock(),this._cachedResolver=null,this._onDidUpdateKeybindings.fire())}))}_registerKeyListeners(e){const t=new Z;return t.add(ue(e,ke.KEY_DOWN,i=>{if(this._keybindingHoldMode)return;this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._log(`/ Received keydown event - ${hlt(i)}`),this._log(`| Converted keydown event - ${ult(n)}`),this._dispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t.add(ue(e,ke.KEY_UP,i=>{this._resetKeybindingHoldMode(),this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._singleModifierDispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t}registerSchemaContribution(e){this._contributions.push(e),e.onDidChange&&this._register(e.onDidChange(()=>this.updateKeybindingsJsonSchema())),this.updateKeybindingsJsonSchema()}updateKeybindingsJsonSchema(){this.kbsJsonSchema.updateSchema(this._contributions.flatMap(e=>e.getSchemaAdditions()))}_printKeybinding(e){return FLe.toLabel(po,e.chords,t=>t instanceof Ih?Ia.toString(t.keyCode):Vp.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const o=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${o}${"[NO BINDING]".padStart(35," ")}`);return}for(const r of i)e.push(`${o}${this._printResolvedKeybinding(r).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of So.getDefaultKeybindings()){if(!i.keybinding)continue;const n=this._printKeybinding(i.keybinding);if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}t.push("User Resolved Keybindings (unique only):");for(const i of this.userKeybindings.keybindings){if(!i.keybinding)continue;const n=i._sourceKey??"Impossible: missing source key, but has keybinding";if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}return t.join(` +`)}_dumpDebugInfo(){const e=JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(),null," "),t=this._keyboardMapper.dumpDebugInfo(),i=this._dumpResolveKeybindingDebugInfo(),n=JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(),null," ");return`Layout info: +${e} + +${i} + +${t} + +Raw mapping: +${n}`}_dumpDebugInfoJSON(){const e={layout:this.keyboardLayoutService.getCurrentKeyboardLayout(),rawMapping:this.keyboardLayoutService.getRawKeyboardMapping()};return JSON.stringify(e,null," ")}enableKeybindingHoldMode(e){if(this._currentlyDispatchingCommandId!==e)return;this._keybindingHoldMode=new dc;const t=Ac(ct(void 0)),i=t.onDidBlur(()=>this._resetKeybindingHoldMode());return this._keybindingHoldMode.p.finally(()=>{i.dispose(),t.dispose()}),this._log(`+ Enabled hold-mode for ${e}.`),this._keybindingHoldMode.p}_resetKeybindingHoldMode(){this._keybindingHoldMode&&(this._keybindingHoldMode?.complete(),this._keybindingHoldMode=null)}customKeybindingsCount(){return this.userKeybindings.keybindings.length}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}getUserKeybindingItems(){return this._resolveUserKeybindingItems(this.userKeybindings.keybindings,!1)}_getResolver(){if(!this._cachedResolver){const e=this._resolveKeybindingItems(So.getDefaultKeybindings(),!0),t=this.getUserKeybindingItems();this._cachedResolver=new $O(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return this.hostService.hasFocus}_resolveKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension);else{if(this._assertBrowserConflicts(a))continue;const c=this._keyboardMapper.resolveKeybinding(a);for(let l=c.length-1;l>=0;l--){const d=c[l];i[n++]=new Dx(d,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension)}}}return i}_resolveUserKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0;if(!o.keybinding)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,null,!1);else{const a=this._keyboardMapper.resolveKeybinding(o.keybinding);for(const c of a)i[n++]=new Dx(c,o.command,o.commandArgs,r,t,null,!1)}}return i}_assertBrowserConflicts(e){if(kO.keyboard===Zx.Always||kO.keyboard===Zx.FullScreen&&rpe(si))return!1;for(const t of e.chords){if(!t.metaKey&&!t.altKey&&!t.ctrlKey&&!t.shiftKey)continue;const i=U.CtrlCmd|U.Alt|U.Shift;let n=0;if(t.metaKey&&(n|=U.CtrlCmd),t.shiftKey&&(n|=U.Shift),t.altKey&&(n|=U.Alt),t.ctrlKey&&po===Ds.Macintosh&&(n|=U.WinCtrl),(n&i)===(U.CtrlCmd|U.Alt)&&(t instanceof gy&&(t.scanCode===X.ArrowLeft||t.scanCode===X.ArrowRight)||t instanceof Ih&&(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow))||(n&i)===U.CtrlCmd&&(t instanceof gy&&t.scanCode>=X.Digit1&&t.scanCode<=X.Digit0||t instanceof Ih&&t.keyCode>=S.Digit0&&t.keyCode<=S.Digit9))return!0}return!1}resolveKeybinding(e){return this._keyboardMapper.resolveKeybinding(e)}resolveKeyboardEvent(e){return this.keyboardLayoutService.validateCurrentKeyboardMapping(e),this._keyboardMapper.resolveKeyboardEvent(e)}resolveUserBinding(e){const t=X$.parseKeybinding(e);return t?this._keyboardMapper.resolveKeybinding(t):[]}_handleKeybindingsExtensionPointUser(e,t,i,n,o){if(Array.isArray(i))for(let r=0,a=i.length;r0&&o.error(g(3514,"Invalid `contributes.{0}`: {1}",_9e.name,a.join(` +`)))}static bindToCurrentPlatform(e,t,i,n){if(po===Ds.Windows&&n){if(n)return n}else if(po===Ds.Macintosh){if(t)return t}else if(i)return i;return e}_asCommandRule(e,t,i,n){const{command:o,args:r,when:a,key:c,mac:l,linux:d,win:h}=n,u=BV.bindToCurrentPlatform(c,l,d,h);if(!u)return;let f;t?f=Ae.BuiltinExtension+i:f=Ae.ExternalExtension+i;const p=jn.getCommand(o),m=p&&p.precondition;let v;return a&&m?v=he.and(m,he.deserialize(a)):a?v=he.deserialize(a):m&&(v=m),{id:o,args:r,when:v,weight:f,keybinding:X$.parseKeybinding(u),extensionId:e.value,isBuiltinExtension:t}}getDefaultKeybindingsContent(){const e=this._getResolver(),t=e.getDefaultKeybindings(),i=e.getDefaultBoundCommands();return BV._getDefaultKeybindings(t)+` + +`+BV._getAllCommandsAsComment(i)}static _getDefaultKeybindings(e){const t=new VZt;t.writeLine("[");const i=e.length-1;return e.forEach((n,o)=>{qst.writeKeybindingItem(t,n),o!==i?t.writeLine(","):t.writeLine()}),t.writeLine("]"),t.toString()}static _getAllCommandsAsComment(e){const i=oit(e).sort().join(` +// - `);return"// "+g(3515,"Here are other available commands: ")+` +// - `+i}mightProducePrintableCharacter(e){if(e.ctrlKey||e.metaKey||e.altKey)return!1;const t=Vp.toEnum(e.code);if($Zt.indexOf(t)!==-1)return!!(e.keyCode===Vg[t]||Qt&&e.keyCode===Gb.get(t));if(Vg[t]!==-1)return!1;const n=this.keyboardLayoutService.getRawKeyboardMapping();if(!n)return!1;const o=n[e.code];return!(!o||!o.value||/\s/.test(o.value))}};vke=BV=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,ug),_(5,xc),_(6,fs),_(7,Jt),_(8,ks),_(9,Ge),_(10,Oae)],vke);class GZt extends V{get keybindings(){return this._keybindings}constructor(e,t,i,n){super(),this.userDataProfileService=e,this.uriIdentityService=t,this.fileService=i,this._rawKeybindings=[],this._keybindings=[],this.watchDisposables=this._register(new Z),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.watch(),this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(o=>{o&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,o=>o.contains(this.userDataProfileService.currentProfile.keybindingsResource))(()=>{n.debug("Keybindings file changed"),this.reloadConfigurationScheduler.schedule()})),this._register(this.fileService.onDidRunOperation(o=>{o.operation===Ai.WRITE&&o.resource.toString()===this.userDataProfileService.currentProfile.keybindingsResource.toString()&&(n.debug("Keybindings file written"),this.reloadConfigurationScheduler.schedule())})),this._register(e.onDidChangeCurrentProfile(o=>{this.uriIdentityService.extUri.isEqual(o.previous.keybindingsResource,o.profile.keybindingsResource)||o.join(this.whenCurrentProfileChanged())}))}async whenCurrentProfileChanged(){this.watch(),this.reloadConfigurationScheduler.schedule()}watch(){this.watchDisposables.clear(),this.watchDisposables.add(this.fileService.watch(Lr(this.userDataProfileService.currentProfile.keybindingsResource))),this.watchDisposables.add(this.fileService.watch(this.userDataProfileService.currentProfile.keybindingsResource))}async initialize(){await this.reload()}async reload(){const e=await this.readUserKeybindings();return Ys(this._rawKeybindings,e)?!1:(this._rawKeybindings=e,this._keybindings=this._rawKeybindings.map(t=>qst.readUserKeybindingItem(t)),!0)}async readUserKeybindings(){try{const e=await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource),t=sf(e.value.toString());return Array.isArray(t)?t.filter(i=>i&&typeof i=="object"):[]}catch{return[]}}}const CO=class CO{constructor(){this.commandsSchemas=[],this.commandsEnum=[],this.removalCommandsEnum=[],this.commandsEnumDescriptions=[],this.schema={id:CO.schemaId,type:"array",title:g(3516,"Keybindings configuration"),allowTrailingCommas:!0,allowComments:!0,definitions:{editorGroupsSchema:{type:"array",items:{type:"object",properties:{groups:{$ref:"#/definitions/editorGroupsSchema",default:[{},{}]},size:{type:"number",default:.5}}}},commandNames:{type:"string",enum:this.commandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3517,"Name of the command to execute")},commandType:{anyOf:[{$ref:"#/definitions/commandNames"},{type:"string",enum:this.removalCommandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3518,"Name of the command to remove keyboard shortcut for")},{type:"string"}]},commandsSchemas:{allOf:this.commandsSchemas}},items:{required:["key"],type:"object",defaultSnippets:[{body:{key:"$1",command:"$2",when:"$3"}}],properties:{key:{type:"string",description:g(3519,"Key or key sequence (separated by space)")},command:{anyOf:[{if:{type:"array"},then:{not:{type:"array"},errorMessage:g(3520,`Incorrect type. Expected "{0}". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.`,"string")},else:{$ref:"#/definitions/commandType"}},{$ref:"#/definitions/commandType"}]},when:{type:"string",description:g(3521,"Condition when the key is active.")},args:{description:g(3522,"Arguments to pass to the command to execute.")}},$ref:"#/definitions/commandsSchemas"}},this.schemaRegistry=Qe.as(YA.JSONContribution),this.schemaRegistry.registerSchema(CO.schemaId,this.schema)}updateSchema(e){this.commandsSchemas.length=0,this.commandsEnum.length=0,this.removalCommandsEnum.length=0,this.commandsEnumDescriptions.length=0;const t=new Set,i=(r,a)=>{/^_/.test(r)||t.has(r)||(t.add(r),this.commandsEnum.push(r),this.commandsEnumDescriptions.push(GLe(a)?a.value:a),this.removalCommandsEnum.push(`-${r}`))},n=_t.getCommands();for(const[r,a]of n){const c=a.metadata;if(i(r,c?.description),!c||!c.args||c.args.length!==1||!c.args[0].schema)continue;const l=c.args[0].schema,d=typeof c.args[0].isOptional<"u"?!c.args[0].isOptional:Array.isArray(l.required)&&l.required.length>0,h={if:{required:["command"],properties:{command:{const:r}}},then:{required:[].concat(d?["args"]:[]),properties:{args:l}}};this.commandsSchemas.push(h)}const o=jn.getCommands();for(const r of o.keys())i(r);this.commandsSchemas.push(...e),this.schemaRegistry.notifySchemaChanged(CO.schemaId)}};CO.schemaId="vscode://schemas/keybindings";let bke=CO;function Zie(s){return s.name?s.name:s.id?s.id:s.layout}function KZt(s){const e=s,t={};for(const i in e){const n=e[i];if(n.length){const o=n[0],r=n[1],a=n[2],c=n[3],l=Number(n[4]),d=n.length===6?n[5]:void 0;t[i]={value:o,vkey:d,withShift:r,withAltGr:a,withShiftAltGr:c,valueIsDeadKey:(l&1)>0,withShiftIsDeadKey:(l&2)>0,withAltGrIsDeadKey:(l&4)>0,withShiftAltGrIsDeadKey:(l&8)>0}}else t[i]={value:"",valueIsDeadKey:!1,withShift:"",withShiftIsDeadKey:!1,withAltGr:"",withAltGrIsDeadKey:!1,withShiftAltGr:"",withShiftAltGrIsDeadKey:!1}}return t}class ile{constructor(e,t,i,n){this.layout=e,this.secondaryLayouts=t,this.mapping=KZt(i),this.isUserKeyboardLayout=!!n,this.layout.isUserKeyboardLayout=!!n}static createKeyboardLayoutFromDebugInfo(e,t,i){const n=new ile(e,[],{},!0);return n.mapping=t,n}update(e){this.layout=e.layout,this.secondaryLayouts=e.secondaryLayouts,this.mapping=e.mapping,this.isUserKeyboardLayout=e.isUserKeyboardLayout,this.layout.isUserKeyboardLayout=e.isUserKeyboardLayout}getScore(e){let t=0;for(const i in e){if(Qn&&(i==="Backslash"||i==="KeyQ")||pr&&(i==="Backspace"||i==="Escape"))continue;const n=this.mapping[i];n===void 0&&(t-=1);const o=e[i];n&&o&&n.value!==o.value&&(t-=1)}return t}equal(e){return this.isUserKeyboardLayout!==e.isUserKeyboardLayout||Zie(this.layout)!==Zie(e.layout)?!1:this.fuzzyEqual(e.mapping)}fuzzyEqual(e){for(const t in e){if(Qn&&(t==="Backslash"||t==="KeyQ"))continue;if(this.mapping[t]===void 0)return!1;const i=this.mapping[t],n=e[t];if(i.value!==n.value)return!1}return!0}}var Z$;(function(s){s[s.Code=0]="Code",s[s.KeyCode=1]="KeyCode"})(Z$||(Z$={}));function qZt(s){const e=s.getValue("keyboard"),t=e?.dispatch==="keyCode"?Z$.KeyCode:Z$.Code,i=!!e?.mapAltGrToCtrlAlt;return{dispatch:t,mapAltGrToCtrlAlt:i}}const QZt=Qe.as(Nn.Configuration),jZt={id:"keyboard",order:15,type:"object",title:g(8664,"Keyboard"),properties:{"keyboard.dispatch":{scope:at.APPLICATION,type:"string",enum:["code","keyCode"],default:"code",markdownDescription:g(8665,"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."),included:po===Ds.Macintosh||po===Ds.Linux},"keyboard.mapAltGrToCtrlAlt":{scope:at.APPLICATION,type:"boolean",default:!1,markdownDescription:g(8666,"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."),included:po===Ds.Windows}}};QZt.registerConfiguration(jZt);class YZt{constructor(e){this._actual=e,this._cache=new Map}dumpDebugInfo(){return this._actual.dumpDebugInfo()}resolveKeyboardEvent(e){return this._actual.resolveKeyboardEvent(e)}resolveKeybinding(e){const t=e.getHashCode(),i=this._cache.get(t);if(!i){const n=this._actual.resolveKeybinding(e);return this._cache.set(t,n),n}return i}}class WV extends OLe{constructor(e,t){super(Ds.Windows,t),this._mapper=e}_getLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getUILabelForKeyCode(e.keyCode)}_getUSLabelForKeybinding(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}getUSLabel(){return p6.toLabel(this._os,this._chords,e=>this._getUSLabelForKeybinding(e))}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getAriaLabelForKeyCode(e.keyCode)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorForKeyBinding(e)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=this._mapper.getUserSettingsLabelForKeyCode(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(e){return this.__isWYSIWYG(e.keyCode)}__isWYSIWYG(e){if(e===S.LeftArrow||e===S.UpArrow||e===S.RightArrow||e===S.DownArrow)return!0;const t=this._mapper.getAriaLabelForKeyCode(e),i=this._mapper.getUserSettingsLabelForKeyCode(e);return t===i}_getChordDispatch(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static getProducedCharCode(e,t){return t?e.ctrlKey&&e.shiftKey&&e.altKey?t.withShiftAltGr:e.ctrlKey&&e.altKey?t.withAltGr:e.shiftKey?t.withShift:t.value:null}static getProducedChar(e,t){const i=this.getProducedCharCode(e,t);return i===null||i.length===0?" --- ":" "+i+" "}}class JZt{constructor(e,t,i){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._keyCodeToLabel=[],this._scanCodeToKeyCode=[],this._keyCodeToLabel=[],this._keyCodeExists=[],this._keyCodeToLabel[S.Unknown]=Ia.toString(S.Unknown);for(let a=X.None;a1)this._keyCodeToLabel[m]=h;else{const b=h.charCodeAt(0);if(b>=B.a&&b<=B.z){const w=B.A+(b-B.a);n[w]=!0,o=!0,this._keyCodeToLabel[m]=String.fromCharCode(B.A+(b-B.a))}else b>=B.A&&b<=B.Z?(n[b]=!0,o=!0,this._keyCodeToLabel[m]=h):this._keyCodeToLabel[m]=h}}const r=(a,c)=>{n[a]||(this._keyCodeToLabel[c]=String.fromCharCode(a))};if(r(B.A,S.KeyA),r(B.B,S.KeyB),r(B.C,S.KeyC),r(B.D,S.KeyD),r(B.E,S.KeyE),r(B.F,S.KeyF),r(B.G,S.KeyG),r(B.H,S.KeyH),r(B.I,S.KeyI),r(B.J,S.KeyJ),r(B.K,S.KeyK),r(B.L,S.KeyL),r(B.M,S.KeyM),r(B.N,S.KeyN),r(B.O,S.KeyO),r(B.P,S.KeyP),r(B.Q,S.KeyQ),r(B.R,S.KeyR),r(B.S,S.KeyS),r(B.T,S.KeyT),r(B.U,S.KeyU),r(B.V,S.KeyV),r(B.W,S.KeyW),r(B.X,S.KeyX),r(B.Y,S.KeyY),r(B.Z,S.KeyZ),!o){const a=(c,l)=>{this._keyCodeToLabel[c]=String.fromCharCode(l)};a(S.Semicolon,B.Semicolon),a(S.Equal,B.Equals),a(S.Comma,B.Comma),a(S.Minus,B.Dash),a(S.Period,B.Period),a(S.Slash,B.Slash),a(S.Backquote,B.BackTick),a(S.BracketLeft,B.OpenSquareBracket),a(S.Backslash,B.Backslash),a(S.BracketRight,B.CloseSquareBracket),a(S.Quote,B.SingleQuote)}}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push("-----------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;nthis._resolveChord(i)));return t.length>0?[new WV(this,t)]:[]}}const yz=[];class v9e extends OLe{constructor(e,t,i){super(t,i),this._mapper=e}_getLabel(e){return this._mapper.getUILabelForScanCodeChord(e)}_getAriaLabel(e){return this._mapper.getAriaLabelForScanCodeChord(e)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorLabelForScanCodeChord(e)}_getUserSettingsLabel(e){return this._mapper.getUserSettingsLabelForScanCodeChord(e)}_isWYSIWYG(e){if(!e||Vg[e.scanCode]!==S.DependsOnKbLayout)return!0;const t=this._mapper.getAriaLabelForScanCodeChord(e),i=this._mapper.getUserSettingsLabelForScanCodeChord(e);return!t&&!i?!0:!t||!i?!1:t.toLowerCase()===i.toLowerCase()}_getChordDispatch(e){return this._mapper.getDispatchStrForScanCodeChord(e)}_getSingleModifierChordDispatch(e){return(e.scanCode===X.ControlLeft||e.scanCode===X.ControlRight)&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":(e.scanCode===X.AltLeft||e.scanCode===X.AltRight)&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":(e.scanCode===X.ShiftLeft||e.scanCode===X.ShiftRight)&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":(e.scanCode===X.MetaLeft||e.scanCode===X.MetaRight)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}}class Cz{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.scanCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Vp.toString(this.scanCode)}`}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.scanCode===e.scanCode}getProducedCharCode(e){return e?this.ctrlKey&&this.shiftKey&&this.altKey?e.withShiftAltGr:this.ctrlKey&&this.altKey?e.withAltGr:this.shiftKey?e.withShift:e.value:""}getProducedChar(e){const t=i_.getCharCode(this.getProducedCharCode(e));return t===0?" --- ":t>=B.U_Combining_Grave_Accent&&t<=B.U_Combining_Latin_Small_Letter_X?"U+"+t.toString(16):" "+String.fromCharCode(t)+" "}}class wke{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.keyCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Ia.toString(this.keyCode)}`}}class XZt{constructor(){this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[],this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[]}registrationComplete(){this._moveToEnd(X.IntlHash),this._moveToEnd(X.IntlBackslash)}_moveToEnd(e){for(let t=0;t<8;t++){const i=this._scanCodeToKeyCode[(e<<3)+t];if(i)for(let n=0,o=i.length;n>>3===e){for(let h=a+1;h=S.Digit0&&t.keyCode<=S.Digit9,r=t.keyCode>=S.KeyA&&t.keyCode<=S.KeyZ,a=this._scanCodeToKeyCode[i];if(o||r){if(a){for(let c=0,l=a.length;c>>3;n[o]=new Cz(c,l,d,h)}return n}lookupScanCodeCombo(e){const t=this._encodeScanCodeCombo(e),i=this._scanCodeToKeyCode[t];if(!i||i.length===0)return[];const n=[];for(let o=0,r=i.length;o>>3;n[o]=new wke(c,l,d,h)}return n}guessStableKeyCode(e){if(e>=X.Digit1&&e<=X.Digit0)switch(e){case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0}const t=this.lookupScanCodeCombo(new Cz(!1,!1,!1,e)),i=this.lookupScanCodeCombo(new Cz(!1,!0,!1,e));if(t.length===1&&i.length===1){const n=t[0].shiftKey,o=t[0].keyCode,r=i[0].shiftKey,a=i[0].keyCode;if(o===a&&n!==r)return o}return S.DependsOnKbLayout}_encodeScanCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.scanCode)}_encodeKeyCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.keyCode)}_encode(e,t,i,n){return((e?1:0)<<0|(t?1:0)<<1|(i?1:0)<<2|n<<3)>>>0}}class i_{constructor(e,t,i,n){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._OS=n,this._scanCodeToLabel=[],this._scanCodeToDispatch=[],this._codeInfo=[],this._scanCodeKeyCodeMapper=new XZt,this._scanCodeToLabel=[],this._scanCodeToDispatch=[];const o=(d,h,u,f,p,m,v,b)=>{this._scanCodeKeyCodeMapper.registerIfUnknown(new Cz(!!d,!!h,!!u,f),new wke(!!p,!!m,!!v,b))},r=(d,h,u,f,p)=>{for(let m=d;m<=1;m++)for(let v=h;v<=1;v++)for(let b=u;b<=1;b++)o(m,v,b,f,m,v,b,p)};for(let d=X.None;d=B.a&&m<=B.z){const v=B.A+(m-B.a);d[v]=!0}}const h=(u,f,p,m)=>{d[u]||(a[Vp.toString(f)]={value:p,withShift:m,withAltGr:"",withShiftAltGr:""})};h(B.A,X.KeyA,"a","A"),h(B.B,X.KeyB,"b","B"),h(B.C,X.KeyC,"c","C"),h(B.D,X.KeyD,"d","D"),h(B.E,X.KeyE,"e","E"),h(B.F,X.KeyF,"f","F"),h(B.G,X.KeyG,"g","G"),h(B.H,X.KeyH,"h","H"),h(B.I,X.KeyI,"i","I"),h(B.J,X.KeyJ,"j","J"),h(B.K,X.KeyK,"k","K"),h(B.L,X.KeyL,"l","L"),h(B.M,X.KeyM,"m","M"),h(B.N,X.KeyN,"n","N"),h(B.O,X.KeyO,"o","O"),h(B.P,X.KeyP,"p","P"),h(B.Q,X.KeyQ,"q","Q"),h(B.R,X.KeyR,"r","R"),h(B.S,X.KeyS,"s","S"),h(B.T,X.KeyT,"t","T"),h(B.U,X.KeyU,"u","U"),h(B.V,X.KeyV,"v","V"),h(B.W,X.KeyW,"w","W"),h(B.X,X.KeyX,"x","X"),h(B.Y,X.KeyY,"y","Y"),h(B.Z,X.KeyZ,"z","Z")}const c=[];let l=0;for(const d in t)if(t.hasOwnProperty(d)){const h=Vp.toEnum(d);if(h===X.None||Vg[h]!==S.DependsOnKbLayout)continue;this._codeInfo[h]=t[d];const u=a[d]||t[d],f=i_.getCharCode(u.value),p=i_.getCharCode(u.withShift),m=i_.getCharCode(u.withAltGr),v=i_.getCharCode(u.withShiftAltGr),b={scanCode:h,value:f,withShift:p,withAltGr:m,withShiftAltGr:v};if(c[l++]=b,this._scanCodeToDispatch[h]=`[${Vp.toString(h)}]`,f>=B.a&&f<=B.z){const w=B.A+(f-B.a);this._scanCodeToLabel[h]=String.fromCharCode(w)}else f>=B.A&&f<=B.Z?this._scanCodeToLabel[h]=String.fromCharCode(f):f?this._scanCodeToLabel[h]=String.fromCharCode(f):this._scanCodeToLabel[h]=null}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShiftAltGr;if(f===h.withAltGr||f===h.withShift||f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,1,1,u,0,1,0,v):o(1,1,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withAltGr;if(f===h.withShift||f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,0,1,u,0,1,0,v):o(1,0,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShift;if(f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?(o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,1,1,v)):(o(0,1,0,u,0,0,0,v),o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,0,1,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,0,0,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,0,1,v),o(1,1,1,u,1,1,1,v))}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=i_._charCodeToKb(h.value);if(!f)continue;const p=f.shiftKey,m=f.keyCode;p?(o(0,0,0,u,0,1,0,m),o(0,0,1,u,0,1,1,m),o(1,0,0,u,1,1,0,m),o(1,0,1,u,1,1,1,m)):(o(0,0,0,u,0,0,0,m),o(0,0,1,u,0,0,1,m),o(0,1,0,u,0,1,0,m),o(0,1,1,u,0,1,1,m),o(1,0,0,u,1,0,0,m),o(1,0,1,u,1,0,1,m),o(1,1,0,u,1,1,0,m),o(1,1,1,u,1,1,1,m))}r(0,0,0,X.Digit1,S.Digit1),r(0,0,0,X.Digit2,S.Digit2),r(0,0,0,X.Digit3,S.Digit3),r(0,0,0,X.Digit4,S.Digit4),r(0,0,0,X.Digit5,S.Digit5),r(0,0,0,X.Digit6,S.Digit6),r(0,0,0,X.Digit7,S.Digit7),r(0,0,0,X.Digit8,S.Digit8),r(0,0,0,X.Digit9,S.Digit9),r(0,0,0,X.Digit0,S.Digit0),this._scanCodeKeyCodeMapper.registrationComplete()}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push(`isUSStandard: ${this._isUSStandard}`),e.push("----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;n=0){const a=m8[i];a!==X.DependsOnKbLayout&&(t=a)}const n=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,o=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,r=new gy(n,e.shiftKey,o,e.metaKey,t);return new v9e(this,this._OS,[r])}_resolveChord(e){return e?e instanceof gy?[e]:this.keyCodeChordToScanCodeChord(e):[]}resolveKeybinding(e){const t=e.chords.map(i=>this._resolveChord(i));return this._toResolvedKeybinding(t)}static _redirectCharCode(e){switch(e){case B.U_IDEOGRAPHIC_FULL_STOP:return B.Period;case B.U_LEFT_CORNER_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_CORNER_BRACKET:return B.CloseSquareBracket;case B.U_LEFT_BLACK_LENTICULAR_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_BLACK_LENTICULAR_BRACKET:return B.CloseSquareBracket;case B.U_FULLWIDTH_SEMICOLON:return B.Semicolon;case B.U_FULLWIDTH_COMMA:return B.Comma}return e}static _charCodeToKb(e){return e=this._redirectCharCode(e),eimport("./layout.contribution.darwin-gdaUfoJf.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.linux.js":return FT(()=>import("./layout.contribution.linux-xMjRz7iy.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.win.js":return FT(()=>import("./layout.contribution.win-DZRWibbm.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.default??e);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+s)))})}}class eei extends V{get activeKeymap(){return this._activeKeymapInfo}get keymapInfos(){return this._keymapInfos}get activeKeyboardLayout(){return this._initialized?this._activeKeymapInfo?.layout??null:null}get activeKeyMapping(){return this._initialized?this._activeKeymapInfo?.mapping??null:null}get keyboardLayouts(){return this._keymapInfos.map(e=>e.layout)}constructor(e){super(),this._configurationService=e,this._onDidChangeKeyboardMapper=new I,this.onDidChangeKeyboardMapper=this._onDidChangeKeyboardMapper.event,this.keyboardLayoutMapAllowed=navigator.keyboard!==void 0,this._keyboardMapper=null,this._initialized=!1,this._keymapInfos=[],this._mru=[],this._activeKeymapInfo=null,navigator.keyboard&&navigator.keyboard.addEventListener&&navigator.keyboard.addEventListener("layoutchange",()=>{this._getBrowserKeyMapping().then(t=>{this.isKeyMappingActive(t)||this.setLayoutFromBrowserAPI()})}),this._register(this._configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("keyboard")&&(this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire())}))}registerKeyboardLayout(e){this._keymapInfos.push(e),this._mru=this._keymapInfos}removeKeyboardLayout(e){let t=this._mru.indexOf(e);this._mru.splice(t,1),t=this._keymapInfos.indexOf(e),this._keymapInfos.splice(t,1)}getMatchedKeymapInfo(e){if(!e)return null;const t=this.getUSStandardLayout();if(t){let i=t.getScore(e);if(i===0)return{result:t,score:0};let n=t;for(let o=0;oi){if(r===0)return{result:this._mru[o],score:0};i=r,n=this._mru[o]}}return{result:n,score:i}}for(let i=0;it.layout.isUSStandard);return e.length?e[0]:null}isKeyMappingActive(e){return this._activeKeymapInfo&&e&&this._activeKeymapInfo.fuzzyEqual(e)}setUSKeyboardLayout(){this._activeKeymapInfo=this.getUSStandardLayout()}setActiveKeyMapping(e){let t=!1;const i=this.getMatchedKeymapInfo(e);if(i&&(this._activeKeymapInfo?e&&i.result.getScore(e)>this._activeKeymapInfo.getScore(e)&&(this._activeKeymapInfo=i.result,t=!0):(this._activeKeymapInfo=i.result,t=!0)),this._activeKeymapInfo||(this._activeKeymapInfo=this.getUSStandardLayout(),t=!0),!this._activeKeymapInfo||!t)return;const n=this._mru.indexOf(this._activeKeymapInfo);this._mru.splice(n,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo)}setActiveKeymapInfo(e){this._activeKeymapInfo=e;const t=this._mru.indexOf(this._activeKeymapInfo);t!==0&&(this._mru.splice(t,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo))}setLayoutFromBrowserAPI(){this._updateKeyboardLayoutAsync(this._initialized)}_updateKeyboardLayoutAsync(e,t){e&&this._getBrowserKeyMapping(t).then(i=>{this.isKeyMappingActive(i)||this.setActiveKeyMapping(i)})}getKeyboardMapper(){const e=qZt(this._configurationService);return e.dispatch===Z$.KeyCode||!this._initialized||!this._activeKeymapInfo?new Rve(e.mapAltGrToCtrlAlt,po):(this._keyboardMapper||(this._keyboardMapper=new YZt(Qst._createKeyboardMapper(this._activeKeymapInfo,e.mapAltGrToCtrlAlt))),this._keyboardMapper)}validateCurrentKeyboardMapping(e){!this._initialized||this._validateCurrentKeyboardMapping(e)||this._updateKeyboardLayoutAsync(!0,e)}setKeyboardLayout(e){const t=this.keymapInfos.filter(i=>Zie(i.layout)===e);t.length>0&&this.setActiveKeymapInfo(t[0])}_setKeyboardData(e){this._initialized=!0,this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire()}static _createKeyboardMapper(e,t){const i=e.mapping,n=!!e.layout.isUSStandard;return po===Ds.Windows?new JZt(n,i,t):Object.keys(i).length===0?new Rve(t,po):new i_(n,i,t,po)}_validateCurrentKeyboardMapping(e){if(!this._initialized)return!0;const t=e,i=this._activeKeymapInfo;if(!i||t.browserEvent.key==="Dead"||t.browserEvent.isComposing)return!0;const n=i.mapping[t.code];if(!n)return!1;if(n.value==="")return(e.ctrlKey||e.metaKey)&&setTimeout(()=>{this._getBrowserKeyMapping().then(a=>{this.isKeyMappingActive(a)||this.setLayoutFromBrowserAPI()})},350),!0;const o=t.altKey&&t.shiftKey?n.withShiftAltGr:t.altKey?n.withAltGr:t.shiftKey?n.withShift:n.value,r=t.altKey&&t.shiftKey&&n.withShiftAltGrIsDeadKey||t.altKey&&n.withAltGrIsDeadKey||t.shiftKey&&n.withShiftIsDeadKey||n.valueIsDeadKey;return!(r&&t.browserEvent.key!=="Dead"||!r&&t.browserEvent.key!==o)}async _getBrowserKeyMapping(e){if(this.keyboardLayoutMapAllowed)try{return await navigator.keyboard.getLayoutMap().then(t=>{const i={};for(const n of t)i[n[0]]={value:n[1],withShift:"",withAltGr:"",withShiftAltGr:""};return i})}catch{this.keyboardLayoutMapAllowed=!1}if(e&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.metaKey){const t={},i=e;return t[i.browserEvent.code]={value:i.browserEvent.key,withShift:"",withAltGr:"",withShiftAltGr:""},this.getMatchedKeymapInfo(t)?t:null}return null}}class Qst extends eei{constructor(e,t,i,n){super(e),ZZt("./keyboardLayouts/layout.contribution."+(Qn?"win":Qt?"darwin":"linux")+".js").then(r=>{const a=r.KeyboardLayoutContribution.INSTANCE.layoutInfos;this._keymapInfos.push(...a.map(c=>new ile(c.layout,c.secondaryLayouts,c.mapping,c.isUserKeyboardLayout))),this._mru=this._keymapInfos,this._initialized=!0,this.setLayoutFromBrowserAPI()})}}class tei extends V{get keyboardLayout(){return this._keyboardLayout}constructor(e,t){super(),this.keyboardLayoutResource=e,this.fileService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._keyboardLayout=null,this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(i=>{i&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,i=>i.contains(this.keyboardLayoutResource))(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){await this.reload()}async reload(){const e=this._keyboardLayout;try{const t=await this.fileService.readFile(this.keyboardLayoutResource),i=sf(t.value.toString());if(sD(i)==="object"){const n=i.layout,o=i.rawMapping;this._keyboardLayout=ile.createKeyboardLayoutFromDebugInfo(n,o,!0)}else this._keyboardLayout=null}catch{this._keyboardLayout=null}return e?!Ys(e,this._keyboardLayout):!0}}let yke=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=r,this._onDidChangeKeyboardLayout=new I,this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;const c=r.getValue("keyboard").layout;this._keyboardLayoutMode=c??"autodetect",this._factory=new Qst(r,i,n,o),this._register(this._factory.onDidChangeKeyboardMapper(()=>{this._onDidChangeKeyboardLayout.fire()})),c&&c!=="autodetect"&&this._factory.setKeyboardLayout(c),this._register(r.onDidChangeConfiguration(l=>{if(l.affectsConfiguration("keyboard.layout")){const h=r.getValue("keyboard").layout;this._keyboardLayoutMode=h,h==="autodetect"?this._factory.setLayoutFromBrowserAPI():this._factory.setKeyboardLayout(h)}})),this._userKeyboardLayout=new tei(e.keyboardLayoutResource,t),this._userKeyboardLayout.initialize().then(()=>{this._userKeyboardLayout.keyboardLayout&&(this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched())}),this._register(this._userKeyboardLayout.onDidChange(()=>{const l=this._factory.keymapInfos.filter(d=>d.isUserKeyboardLayout);l.length?this._userKeyboardLayout.keyboardLayout?l[0].update(this._userKeyboardLayout.keyboardLayout):this._factory.removeKeyboardLayout(l[0]):this._userKeyboardLayout.keyboardLayout&&this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched()}))}setUserKeyboardLayoutIfMatched(){const t=this.configurationService.getValue("keyboard").layout;t&&this._userKeyboardLayout.keyboardLayout&&Zie(this._userKeyboardLayout.keyboardLayout.layout)===t&&this._factory.activeKeymap&&(this._userKeyboardLayout.keyboardLayout.equal(this._factory.activeKeymap)||this._factory.setActiveKeymapInfo(this._userKeyboardLayout.keyboardLayout))}getKeyboardMapper(){return this._factory.getKeyboardMapper()}getCurrentKeyboardLayout(){return this._factory.activeKeyboardLayout}getAllKeyboardLayouts(){return this._factory.keyboardLayouts}getRawKeyboardMapping(){return this._factory.activeKeyMapping}validateCurrentKeyboardMapping(e){this._keyboardLayoutMode==="autodetect"&&this._factory.validateCurrentKeyboardMapping(e)}};yke=D([_(0,Za),_(1,Jt),_(2,bi),_(3,$i),_(4,vi),_(5,Te)],yke);const iei=Qe.as(Nn.Configuration),nei={id:"keyboard",order:15,type:"object",title:g(3523,"Keyboard"),properties:{"keyboard.layout":{type:"string",default:"autodetect",description:g(3524,"Control the keyboard layout used in web.")}}};iei.registerConfiguration(nei);let Cke=class extends V{constructor(e,t,i){super(),this._instantiationService=e,this._extensionService=t,this._logService=i,this._extensionHostIsReady=!1,this._onWillExecuteCommand=this._register(new I),this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new I,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._extensionService.whenInstalledExtensionsRegistered().then(n=>this._extensionHostIsReady=n),this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Promise.race([this._extensionService.activateByEvent("*"),Sr(3e4)])),this._starActivation}async executeCommand(e,...t){this._logService.trace("CommandService#executeCommand",e);const i=`onCommand:${e}`;return _t.getCommand(e)?this._extensionService.activationEventIsDone(i)?this._tryExecuteCommand(e,t):this._extensionHostIsReady?(await this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(await Promise.all([this._extensionService.activateByEvent(i),Promise.race([this._activateStar(),M.toPromise(M.filter(_t.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,t))}_tryExecuteCommand(e,t){const i=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction(i.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};Cke=D([_(0,we),_(1,fs),_(2,Ge)],Cke);let Ske=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.contextKeyService=e,this.contextService=t,this.configurationService=i,this.environmentService=n,this.productService=o,this.editorGroupService=r,this.editorService=a,this.layoutService=c,this.paneCompositeService=l,this.workingCopyService=d,yDt.bindTo(this.contextKeyService),CDt.bindTo(this.contextKeyService),S6.bindTo(this.contextKeyService),iRe.bindTo(this.contextKeyService),SDt.bindTo(this.contextKeyService),ADt.bindTo(this.contextKeyService),EDt.bindTo(this.contextKeyService),i1t.bindTo(this.contextKeyService).set(D6(this.environmentService.remoteAuthority)||""),this.virtualWorkspaceContext=n1t.bindTo(this.contextKeyService),this.temporaryWorkspaceContext=aJe.bindTo(this.contextKeyService),this.updateWorkspaceContextKeys(),r1t.bindTo(this.contextKeyService).set(Yp.supported(si));const h=!this.environmentService.isBuilt||this.environmentService.isExtensionDevelopment;iWe.bindTo(this.contextKeyService).set(h),Eat(iWe.key,h),xDt.bindTo(this.contextKeyService).set(this.productService.quality||""),a1t.bindTo(this.contextKeyService).set(o.embedderIdentifier),this.activeEditorGroupEmpty=l1t.bindTo(this.contextKeyService),this.activeEditorGroupIndex=d1t.bindTo(this.contextKeyService),this.activeEditorGroupLast=h1t.bindTo(this.contextKeyService),this.activeEditorGroupLocked=u1t.bindTo(this.contextKeyService),this.multipleEditorGroupsContext=g1t.bindTo(this.contextKeyService),this.editorsVisibleContext=f1t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext=t1t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty),this.inputFocusedContext=nRe.bindTo(this.contextKeyService),this.workbenchStateContext=J0t.bindTo(this.contextKeyService),this.updateWorkbenchStateContextKey(),this.workspaceFolderCountContext=X0t.bindTo(this.contextKeyService),this.updateWorkspaceFolderCountContextKey(),this.openFolderWorkspaceSupportContext=Z0t.bindTo(this.contextKeyService),this.openFolderWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.emptyWorkspaceSupportContext=rJe.bindTo(this.contextKeyService),this.emptyWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.enterMultiRootWorkspaceSupportContext=e1t.bindTo(this.contextKeyService),this.enterMultiRootWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.splitEditorsVerticallyContext=_1t.bindTo(this.contextKeyService),this.updateSplitEditorsVerticallyContext(),this.isMainWindowFullscreenContext=s1t.bindTo(this.contextKeyService),this.isAuxiliaryWindowFocusedContext=o1t.bindTo(this.contextKeyService),this.inZenModeContext=p1t.bindTo(this.contextKeyService),this.isMainEditorCenteredLayoutContext=m1t.bindTo(this.contextKeyService),this.mainEditorAreaVisibleContext=v1t.bindTo(this.contextKeyService),this.editorTabsVisibleContext=b1t.bindTo(this.contextKeyService),this.sideBarVisibleContext=w1t.bindTo(this.contextKeyService),this.titleAreaVisibleContext=C1t.bindTo(this.contextKeyService),this.titleBarStyleContext=y1t.bindTo(this.contextKeyService),this.updateTitleBarContextKeys(),this.panelPositionContext=A1t.bindTo(this.contextKeyService),this.panelPositionContext.set(B1(this.layoutService.getPanelPosition())),this.panelVisibleContext=x1t.bindTo(this.contextKeyService),this.panelVisibleContext.set(this.layoutService.isVisible($v.PANEL_PART)),this.panelMaximizedContext=D1t.bindTo(this.contextKeyService),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.panelAlignmentContext=E1t.bindTo(this.contextKeyService),this.panelAlignmentContext.set(this.layoutService.getPanelAlignment()),this.auxiliaryBarVisibleContext=S1t.bindTo(this.contextKeyService),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible($v.AUXILIARYBAR_PART)),this.registerListeners()}registerListeners(){this.editorGroupService.whenReady.then(()=>{this.updateEditorAreaContextKeys(),this.updateActiveEditorGroupContextKeys(),this.updateVisiblePanesContextKeys()}),this._register(this.editorService.onDidActiveEditorChange(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorService.onDidVisibleEditorsChange(()=>this.updateVisiblePanesContextKeys())),this._register(this.editorGroupService.onDidAddGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidRemoveGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidChangeGroupIndex(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeGroupLocked(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeEditorPartOptions(()=>this.updateEditorAreaContextKeys())),this._register(M.runAndSubscribe(tm,({window:e,disposables:t})=>t.add(ue(e,ke.FOCUS_IN,()=>this.updateInputContextKeys(e.document),!0)),{window:si,disposables:this._store})),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateWorkbenchStateContextKey())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>{this.updateWorkspaceFolderCountContextKey(),this.updateWorkspaceContextKeys()})),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.editor.openSideBySideDirection")&&this.updateSplitEditorsVerticallyContext()})),this._register(this.layoutService.onDidChangeZenMode(e=>this.inZenModeContext.set(e))),this._register(this.layoutService.onDidChangeActiveContainer(()=>this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer!==this.layoutService.mainContainer))),this._register(vGe(e=>{e===si.vscodeWindowId&&this.isMainWindowFullscreenContext.set(rpe(si))})),this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(e=>this.isMainEditorCenteredLayoutContext.set(e))),this._register(this.layoutService.onDidChangePanelPosition(e=>this.panelPositionContext.set(e))),this._register(this.layoutService.onDidChangePanelAlignment(e=>this.panelAlignmentContext.set(e))),this._register(this.paneCompositeService.onDidPaneCompositeClose(()=>this.updateSideBarContextKeys())),this._register(this.paneCompositeService.onDidPaneCompositeOpen(()=>this.updateSideBarContextKeys())),this._register(this.layoutService.onDidChangePartVisibility(()=>{this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible($v.EDITOR_PART,si)),this.panelVisibleContext.set(this.layoutService.isVisible($v.PANEL_PART)),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible($v.AUXILIARYBAR_PART)),this.updateTitleBarContextKeys()})),this._register(this.workingCopyService.onDidChangeDirty(e=>this.dirtyWorkingCopiesContext.set(e.isDirty()||this.workingCopyService.hasDirty)))}updateVisiblePanesContextKeys(){this.editorService.visibleEditorPanes.length>0?this.editorsVisibleContext.set(!0):this.editorsVisibleContext.reset()}updateActiveEditorGroupContextKeys(){this.editorService.activeEditor?this.activeEditorGroupEmpty.reset():this.activeEditorGroupEmpty.set(!0);const e=this.editorGroupService.activeGroup;this.activeEditorGroupIndex.set(e.index+1),this.activeEditorGroupLocked.set(e.isLocked),this.updateEditorGroupsContextKeys()}updateEditorGroupsContextKeys(){const e=this.editorGroupService.count;e>1?this.multipleEditorGroupsContext.set(!0):this.multipleEditorGroupsContext.reset();const t=this.editorGroupService.activeGroup;this.activeEditorGroupLast.set(t.index===e-1)}updateEditorAreaContextKeys(){this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs==="multiple")}updateInputContextKeys(e){function t(){return!!e.activeElement&&(e.activeElement.tagName==="INPUT"||e.activeElement.tagName==="TEXTAREA")}const i=t();if(this.inputFocusedContext.set(i),i){const n=Ac(e.activeElement);M.once(n.onDidBlur)(()=>{ky().document===e&&this.inputFocusedContext.set(t()),n.dispose()})}}updateWorkbenchStateContextKey(){this.workbenchStateContext.set(this.getWorkbenchStateString())}updateWorkspaceFolderCountContextKey(){this.workspaceFolderCountContext.set(this.contextService.getWorkspace().folders.length)}updateSplitEditorsVerticallyContext(){const e=UW(this.configurationService);this.splitEditorsVerticallyContext.set(e===HW.DOWN)}getWorkbenchStateString(){switch(this.contextService.getWorkbenchState()){case qi.EMPTY:return"empty";case qi.FOLDER:return"folder";case qi.WORKSPACE:return"workspace"}}updateSideBarContextKeys(){this.sideBarVisibleContext.set(this.layoutService.isVisible($v.SIDEBAR_PART))}updateTitleBarContextKeys(){this.titleAreaVisibleContext.set(this.layoutService.isVisible($v.TITLEBAR_PART,si)),this.titleBarStyleContext.set(dNe(this.configurationService))}updateWorkspaceContextKeys(){this.virtualWorkspaceContext.set(Ptt(this.contextService.getWorkspace())||""),this.temporaryWorkspaceContext.set(Py(this.contextService.getWorkspace()))}};Ske=D([_(0,Le),_(1,yi),_(2,Te),_(3,Jr),_(4,Er),_(5,Po),_(6,ei),_(7,kI),_(8,Tm),_(9,Rm)],Ske);class sei extends li{constructor(){super({id:"workbench.action.toggleKeybindingsLog",title:Pe(3525,"Toggle Keyboard Shortcuts Troubleshooting"),category:ca.Developer,f1:!0})}run(e){e.get(Ut).toggleLogging()&&e.get(vi).executeCommand(uet)}}At(sei);class oei{static hasOpenBrace(e){for(;e.scan()!==ft.EOF;)if(e.getToken()===ft.OpenBraceToken)return!0;return!1}static offsetToPosition(e,t){let i=0;const n=e.getEOL().length,o=e.getLineCount();for(let r=1;r<=o;r++){const a=e.getLineLength(r)+n,c=i+a;if(c>t)return new oe(r,t-i+1);i=c}return new oe(o,e.getLineMaxColumn(o))}static insertSnippet(e,t){const i=e.getValueLengthInRange(new F(1,1,t.lineNumber,t.column));let n;(function(f){f[f.INVALID=0]="INVALID",f[f.AFTER_OBJECT=1]="AFTER_OBJECT",f[f.BEFORE_OBJECT=2]="BEFORE_OBJECT"})(n||(n={}));let o=n.INVALID,r=-1,a=n.INVALID;const c=LLe(e.getValue());let l=0,d=0;const h=(f,p)=>{p!==n.INVALID&&l===1&&d===0?(o=p,r=f,a=p):o!==n.INVALID&&(o=n.INVALID,r=c.getTokenOffset())};for(;c.scan()!==ft.EOF;){const f=c.getPosition(),p=c.getToken();let m=!1;switch(p){case ft.OpenBracketToken:m=!0,l++,h(f,n.BEFORE_OBJECT);break;case ft.CloseBracketToken:m=!0,l--,h(f,n.INVALID);break;case ft.CommaToken:m=!0,h(f,n.BEFORE_OBJECT);break;case ft.OpenBraceToken:m=!0,d++,h(f,n.INVALID);break;case ft.CloseBraceToken:m=!0,d--,h(f,n.AFTER_OBJECT);break;case ft.Trivia:case ft.LineBreakTrivia:m=!0}if(f>=i&&(o!==n.INVALID||r!==-1)){let v,b;return o!==n.INVALID?(v=m?f:c.getTokenOffset(),b=o):(v=r,b=a),b===n.AFTER_OBJECT?{position:this.offsetToPosition(e,v),prepend:",",append:""}:(c.setPosition(v),{position:this.offsetToPosition(e,v),prepend:"",append:this.hasOpenBrace(c)?",":""})}}const u=e.getLineCount();return{position:new oe(u,e.getLineMaxColumn(u)),prepend:` +[`,append:"]"}}}var rei=".defineKeybindingWidget{padding:10px;position:absolute}.defineKeybindingWidget .message{text-align:center;width:400px}.defineKeybindingWidget .existing,.defineKeybindingWidget .monaco-inputbox,.defineKeybindingWidget .output{display:block;margin-top:10px;text-align:center;width:400px}.defineKeybindingWidget .input{text-align:center}.defineKeybindingWidget .output{display:flex;justify-content:center}.defineKeybindingWidget .existing .existingText{cursor:pointer;text-decoration:underline}.defineKeybindingWidget .output .monaco-keybinding{margin:0 4px}.monaco-editor .keybindingInfo{background-color:rgba(100,100,250,.2);box-shadow:inset 0 0 0 1px #b9b9b9}.monaco-editor .keybindingError{background-color:hsla(0,94%,69%,.2);box-shadow:inset 0 0 0 1px #b9b9b9}";ut(rei,{});const aei=oi("settings-folder-dropdown",ve.triangleDown,g(6300,"Icon for the folder dropdown button in the split JSON Settings editor."));oi("settings-more-action",ve.gear,g(6301,"Icon for the 'more actions' action in the Settings UI."));oi("keybindings-record-keys",ve.recordKeys,g(6302,"Icon for the 'record keys' action in the keybinding UI."));oi("keybindings-sort",ve.sortPrecedence,g(6303,"Icon for the 'sort by precedence' toggle in the keybinding UI."));oi("keybindings-edit",ve.edit,g(6304,"Icon for the edit action in the keybinding UI."));oi("keybindings-add",ve.add,g(6305,"Icon for the add action in the keybinding UI."));oi("settings-edit",ve.edit,g(6306,"Icon for the edit action in the Settings UI."));oi("settings-remove",ve.close,g(6307,"Icon for the remove action in the Settings UI."));oi("settings-discard",ve.discard,g(6308,"Icon for the discard action in the Settings UI."));oi("preferences-clear-input",ve.clearAll,g(6309,"Icon for clear input in the Settings and keybinding UI."));oi("preferences-filter",ve.filter,g(6310,"Icon for the button that suggests filters for the Settings UI."));oi("preferences-open-settings",ve.goToFile,g(6311,"Icon for open settings commands."));let Ake=class extends zf{constructor(e,t,i,n){super(null,e),this.contextService=t,this.contextMenuService=i,this.hoverService=n,this._folderSettingCounts=new Map;const o=this.contextService.getWorkspace();this._folder=o.folders.length===1?o.folders[0]:null,this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.onWorkspaceFoldersChanged()))}get folder(){return this._folder}set folder(e){this._folder=e,this.update()}setCount(e,t){const i=this.contextService.getWorkspaceFolder(e);if(!i)throw new Error("unknown folder");const n=i.uri;this._folderSettingCounts.set(n.toString(),t),this.update()}render(e){this.element=e,this.container=e,this.labelElement=fe(".action-title"),this.detailsElement=fe(".action-details"),this.dropDownElement=fe(".dropdown-icon.hide"+We.asCSSSelector(aei)),this.anchorElement=fe("a.action-label.folder-settings",{role:"button","aria-haspopup":"true",tabindex:"0"},this.labelElement,this.detailsElement,this.dropDownElement),this.anchorElementHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.anchorElement,"")),this._register(ue(this.anchorElement,ke.MOUSE_DOWN,t=>en.stop(t))),this._register(ue(this.anchorElement,ke.CLICK,t=>this.onClick(t))),this._register(ue(this.container,ke.KEY_UP,t=>this.onKeyUp(t))),re(this.container,this.anchorElement),this.update()}onKeyUp(e){switch(new En(e).keyCode){case S.Enter:case S.Space:this.onClick(e);return}}onClick(e){en.stop(e,!0),!this.folder||this._action.checked?this.showMenu():this._action.run(this._folder)}updateEnabled(){this.update()}updateChecked(){this.update()}onWorkspaceFoldersChanged(){const e=this._folder,t=this.contextService.getWorkspace();e&&(this._folder=t.folders.filter(i=>ji(i.uri,e.uri))[0]||t.folders[0]),this._folder=this._folder?this._folder:t.folders.length===1?t.folders[0]:null,this.update(),this._action.checked&&this._action.run(this._folder)}update(){let e=0;this._folderSettingCounts.forEach(i=>e+=i);const t=this.contextService.getWorkspace();if(this._folder){this.labelElement.textContent=this._folder.name,this.anchorElementHover.update(this._folder.name);const i=this.labelWithCount(this._action.label,e);this.detailsElement.textContent=i,this.dropDownElement.classList.toggle("hide",t.folders.length===1||!this._action.checked)}else{const i=this.labelWithCount(this._action.label,e);this.labelElement.textContent=i,this.detailsElement.textContent="",this.anchorElementHover.update(this._action.label),this.dropDownElement.classList.remove("hide")}this.anchorElement.classList.toggle("checked",this._action.checked),this.container.classList.toggle("disabled",!this._action.enabled)}showMenu(){this.contextMenuService.showContextMenu({getAnchor:()=>this.container,getActions:()=>this.getDropdownMenuActions(),getActionViewItem:()=>{},onHide:()=>{this.anchorElement.blur()}})}getDropdownMenuActions(){const e=[],t=this.contextService.getWorkspace().folders;return this.contextService.getWorkbenchState()===qi.WORKSPACE&&t.length>0&&e.push(...t.map((i,n)=>{const o=this._folderSettingCounts.get(i.uri.toString());return{id:"folderSettingsTarget"+n,label:this.labelWithCount(i.name,o),tooltip:this.labelWithCount(i.name,o),checked:!!this.folder&&ji(this.folder.uri,i.uri),enabled:!0,class:void 0,run:()=>this._action.run(i)}})),e}labelWithCount(e,t){return t&&(e+=` (${t})`),e}};Ake=D([_(1,yi),_(2,lr),_(3,ec)],Ake);let b9e=class extends pd{constructor(e,t,i,n,o,r,a){super(),this.contextService=i,this.instantiationService=n,this.environmentService=o,this.labelService=r,this.languageService=a,this._settingsTarget=null,this._onDidTargetChange=this._register(new I),this.onDidTargetChange=this._onDidTargetChange.event,this.options=t??{},this.create(e),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.onWorkbenchStateChanged())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.update()))}resetLabels(){const e=this.environmentService.remoteAuthority,t=e&&this.labelService.getHostLabel(pe.vscodeRemote,e);this.userLocalSettings.label=g(10331,"User"),this.userRemoteSettings.label=g(10332,"Remote")+(t?` [${t}]`:""),this.workspaceSettings.label=g(10333,"Workspace"),this.folderSettingsAction.label=g(10334,"Folder")}create(e){const t=re(e,fe(".settings-tabs-widget"));this.settingsSwitcherBar=this._register(new hd(t,{orientation:F_.HORIZONTAL,focusOnlyEnabledItems:!0,ariaLabel:g(10335,"Settings Switcher"),ariaRole:"tablist",actionViewItemProvider:(o,r)=>o.id==="folderSettings"?this.folderSettings:void 0})),this.userLocalSettings=new rn("userSettings","",".settings-tab",!0,()=>this.updateTarget(St.USER_LOCAL)),this.userLocalSettings.tooltip=g(10331,"User"),this.userRemoteSettings=new rn("userSettingsRemote","",".settings-tab",!0,()=>this.updateTarget(St.USER_REMOTE));const i=this.environmentService.remoteAuthority,n=i&&this.labelService.getHostLabel(pe.vscodeRemote,i);this.userRemoteSettings.tooltip=g(10332,"Remote")+(n?` [${n}]`:""),this.workspaceSettings=new rn("workspaceSettings","",".settings-tab",!1,()=>this.updateTarget(St.WORKSPACE)),this.folderSettingsAction=new rn("folderSettings","",".settings-tab",!1,async o=>{this.updateTarget(fje(o)?o.uri:St.USER_LOCAL)}),this.folderSettings=this.instantiationService.createInstance(Ake,this.folderSettingsAction),this.resetLabels(),this.update(),this.settingsSwitcherBar.push([this.userLocalSettings,this.userRemoteSettings,this.workspaceSettings,this.folderSettingsAction])}get settingsTarget(){return this._settingsTarget}set settingsTarget(e){this._settingsTarget=e,this.userLocalSettings.checked=St.USER_LOCAL===this.settingsTarget,this.userRemoteSettings.checked=St.USER_REMOTE===this.settingsTarget,this.workspaceSettings.checked=St.WORKSPACE===this.settingsTarget,this.settingsTarget instanceof N?(this.folderSettings.action.checked=!0,this.folderSettings.folder=this.contextService.getWorkspaceFolder(this.settingsTarget)):this.folderSettings.action.checked=!1}setResultCount(e,t){if(e===St.WORKSPACE){let i=g(10333,"Workspace");t&&(i+=` (${t})`),this.workspaceSettings.label=i}else if(e===St.USER_LOCAL){let i=g(10331,"User");t&&(i+=` (${t})`),this.userLocalSettings.label=i}else e instanceof N&&this.folderSettings.setCount(e,t)}updateLanguageFilterIndicators(e){if(this.resetLabels(),e){const t=this.languageService.getLanguageName(e);if(t){const i=` [${t}]`;this.userLocalSettings.label+=i,this.userRemoteSettings.label+=i,this.workspaceSettings.label+=i,this.folderSettingsAction.label+=i}}}onWorkbenchStateChanged(){this.folderSettings.folder=null,this.update(),this.settingsTarget===St.WORKSPACE&&this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.updateTarget(St.USER_LOCAL)}updateTarget(e){return this.settingsTarget===e||e instanceof N&&this.settingsTarget instanceof N&&ji(this.settingsTarget,e)||(this.settingsTarget=e,this._onDidTargetChange.fire(this.settingsTarget)),Promise.resolve(void 0)}async update(){this.settingsSwitcherBar.domNode.classList.toggle("empty-workbench",this.contextService.getWorkbenchState()===qi.EMPTY),this.userRemoteSettings.enabled=!!(this.options.enableRemoteSettings&&this.environmentService.remoteAuthority),this.workspaceSettings.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY,this.folderSettings.action.enabled=this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.contextService.getWorkspace().folders.length>0,this.workspaceSettings.tooltip=g(10333,"Workspace")}};b9e=D([_(2,yi),_(3,we),_(4,Jr),_(5,Fs),_(6,xi)],b9e);let Eke=class extends pd{constructor(e,t,i,n,o,r){super(),this.options=t,this.contextViewService=i,this.instantiationService=n,this.contextKeyService=o,this.keybindingService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this.create(e)}create(e){this.domNode=re(e,fe("div.settings-header-widget")),this.createSearchContainer(re(this.domNode,fe("div.settings-search-container"))),this.controlsDiv=re(this.domNode,fe("div.settings-search-controls")),this.options.showResultCount&&(this.countElement=re(this.controlsDiv,fe(".settings-count-widget")),this.countElement.style.backgroundColor=ze(yT),this.countElement.style.color=ze($re),this.countElement.style.border=`1px solid ${ze(wt)}`),this.inputBox.inputElement.setAttribute("aria-live",this.options.ariaLive||"off"),this.options.ariaLabelledBy&&this.inputBox.inputElement.setAttribute("aria-labelledBy",this.options.ariaLabelledBy);const t=this._register(Ac(this.inputBox.inputElement));this._register(t.onDidFocus(()=>this._onFocus.fire()));const i=this.options.focusKey;i&&(this._register(t.onDidFocus(()=>i.set(!0))),this._register(t.onDidBlur(()=>i.set(!1))))}createSearchContainer(e){this.searchContainer=e;const t=re(this.searchContainer,fe("div.settings-search-input"));this.inputBox=this._register(this.createInputBox(t)),this._register(this.inputBox.onDidChange(i=>this._onDidChange.fire(i)))}createInputBox(e){const t=()=>zX(this.keybindingService);return this._register(new iX(e,this.contextViewService,{...this.options,showHistoryHint:t},this.contextKeyService))}showMessage(e){this.countElement&&e!==this.countElement.textContent&&(this.countElement.textContent=e,this.inputBox.inputElement.setAttribute("aria-label",e),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}layout(e){e.width<400?(this.countElement?.classList.add("hide"),this.inputBox.inputElement.style.paddingRight="0px"):(this.countElement?.classList.remove("hide"),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}getControlsWidth(){return(this.countElement?Pd(this.countElement):0)+20}focus(){this.inputBox.focus(),this.getValue()&&this.inputBox.select()}hasFocus(){return this.inputBox.hasFocus()}clear(){this.inputBox.value=""}getValue(){return this.inputBox.value}setValue(e){return this.inputBox.value=e}dispose(){this.options.focusKey?.set(!1),super.dispose()}};Eke=D([_(2,mf),_(3,we),_(4,Le),_(5,Ut)],Eke);var QP,xke;let Dke=class extends Eke{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.recordDisposables=this._register(new Z),this._onKeybinding=this._register(new I),this.onKeybinding=this._onKeybinding.event,this._onEnter=this._register(new I),this.onEnter=this._onEnter.event,this._onEscape=this._register(new I),this.onEscape=this._onEscape.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._register(Ee(()=>this.stopRecordingKeys())),this._chords=null,this._inputValue=""}clear(){this._chords=null,super.clear()}startRecordingKeys(){this.recordDisposables.add(ue(this.inputBox.inputElement,ke.KEY_DOWN,e=>this._onKeyDown(new En(e)))),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.BLUR,()=>this._onBlur.fire())),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.INPUT,()=>{this.setInputValue(this._inputValue)}))}stopRecordingKeys(){this._chords=null,this.recordDisposables.clear()}setInputValue(e){this._inputValue=e,this.inputBox.value=this._inputValue}_onKeyDown(e){if(e.preventDefault(),e.stopPropagation(),!this.options.recordEnter&&e.equals(S.Enter)){this._onEnter.fire();return}if(e.equals(S.Escape)){this._onEscape.fire();return}this.printKeybinding(e)}printKeybinding(e){const t=this.keybindingService.resolveKeyboardEvent(e),i=`code: ${e.browserEvent.code}, keyCode: ${e.browserEvent.keyCode}, key: ${e.browserEvent.key} => UI: ${t.getAriaLabel()}, user settings: ${t.getUserSettingsLabel()}, dispatch: ${t.getDispatchChords()[0]}`,n=this.options;this._chords||(this._chords=[]),this._chords.length>0&&this._chords[this._chords.length-1].getDispatchChords()[0]===null?this._chords[this._chords.length-1]=t:(this._chords.length===2&&(this._chords=[]),this._chords.push(t));const r=this._chords.map(a=>a.getUserSettingsLabel()||"").join(" ");this.setInputValue(n.quoteRecordedKeys?`"${r}"`:r),this.inputBox.inputElement.title=i,this._onKeybinding.fire(this._chords)}};Dke=D([_(2,mf),_(3,we),_(4,Le),_(5,Ut)],Dke);var Ck;let kke=(Ck=class extends pd{constructor(e,t){super(),this.instantiationService=t,this._keybindingDisposables=this._register(new Z),this._chords=null,this._isVisible=!1,this._onHide=this._register(new I),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onShowExistingKeybindings=this._register(new I),this.onShowExistingKeybidings=this._onShowExistingKeybindings.event,this._domNode=ls(document.createElement("div")),this._domNode.setDisplay("none"),this._domNode.setClassName("defineKeybindingWidget"),this._domNode.setWidth(QP.WIDTH),this._domNode.setHeight(QP.HEIGHT);const i=g(8667,"Press desired key combination and then press ENTER.");re(this._domNode.domNode,fe(".message",void 0,i)),this._domNode.domNode.style.backgroundColor=ze(xh),this._domNode.domNode.style.color=ze(IN),this._domNode.domNode.style.boxShadow=`0 2px 8px ${ze(CI)}`,this._keybindingInputWidget=this._register(this.instantiationService.createInstance(Dke,this._domNode.domNode,{ariaLabel:i,history:[],inputBoxStyles:EM})),this._keybindingInputWidget.startRecordingKeys(),this._register(this._keybindingInputWidget.onKeybinding(n=>this.onKeybinding(n))),this._register(this._keybindingInputWidget.onEnter(()=>this.hide())),this._register(this._keybindingInputWidget.onEscape(()=>this.clearOrHide())),this._register(this._keybindingInputWidget.onBlur(()=>this.onCancel())),this._outputNode=re(this._domNode.domNode,fe(".output")),this._showExistingKeybindingsNode=re(this._domNode.domNode,fe(".existing")),e&&re(e,this._domNode.domNode)}get domNode(){return this._domNode.domNode}define(){return this._keybindingInputWidget.clear(),Zs.withAsyncBody(async e=>{this._isVisible||(this._isVisible=!0,this._domNode.setDisplay("block"),this._chords=null,this._keybindingInputWidget.setInputValue(""),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),await Sr(0),this._keybindingInputWidget.focus());const t=this._onHide.event(()=>{e(this.getUserSettingsLabel()),t.dispose()})})}layout(e){const t=Math.round((e.height-QP.HEIGHT)/2);this._domNode.setTop(t);const i=Math.round((e.width-QP.WIDTH)/2);this._domNode.setLeft(i)}printExisting(e){if(e>0){const t=fe("span.existingText"),i=e===1?g(8668,"1 existing command has this keybinding",e):g(8669,"{0} existing commands have this keybinding",e);re(t,document.createTextNode(i)),Mr(i),this._showExistingKeybindingsNode.appendChild(t),t.onmousedown=n=>{n.preventDefault()},t.onmouseup=n=>{n.preventDefault()},t.onclick=()=>{this._onShowExistingKeybindings.fire(this.getUserSettingsLabel())}}}onKeybinding(e){if(this._keybindingDisposables.clear(),this._chords=e,Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),this._keybindingDisposables.add(new qk(this._outputNode,po,l_e)).set(this._chords?.[0]??void 0),this._chords)for(let n=1;nt.getUserSettingsLabel()).join(" ")),e}onCancel(){this._chords=null,this.hide()}clearOrHide(){this._chords===null?this.hide():(this._chords=null,this._keybindingInputWidget.clear(),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode))}hide(){this._domNode.setDisplay("none"),this._isVisible=!1,this._onHide.fire()}},QP=Ck,Ck.WIDTH=400,Ck.HEIGHT=110,Ck);kke=QP=D([_(1,we)],kke);var oM;let Ike=(oM=class extends V{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(kke,null)),this._editor.addOverlayWidget(this)}getId(){return xke.ID}getDomNode(){return this._widget.domNode}getPosition(){return{preference:null}}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}start(){this._editor.hasModel()&&this._editor.revealPositionInCenterIfOutsideViewport(this._editor.getPosition(),mt.Smooth);const e=this._editor.getLayoutInfo();return this._widget.layout(new bn(e.width,e.height)),this._widget.define()}},xke=oM,oM.ID="editor.contrib.defineKeybindingWidget",oM);Ike=xke=D([_(1,we)],Ike);var Tke;const cei=g(3526,"You won't be able to produce this key combination under your current keyboard layout.");let Lke=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._userDataProfileService=i,this._keybindingDecorationRenderer=this._register(new wn),this._defineWidget=this._register(this._instantiationService.createInstance(Ike,this._editor)),this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){this._keybindingDecorationRenderer.value=w9e(this._editor,this._userDataProfileService)?this._instantiationService.createInstance(Rke,this._editor):void 0}showDefineKeybindingWidget(){w9e(this._editor,this._userDataProfileService)&&this._defineWidget.start().then(e=>this._onAccepted(e))}_onAccepted(e){if(this._editor.focus(),e&&this._editor.hasModel()){new RegExp(/\\/g).test(e)&&(e=e.slice(0,-1)+"\\\\");let n=["{",' "key": '+JSON.stringify(e)+",",' "command": "${1:commandId}",',' "when": "${2:editorTextFocus}"',"}$0"].join(` +`);const o=oei.insertSnippet(this._editor.getModel(),this._editor.getPosition());n=o.prepend+n+o.append,this._editor.setPosition(o.position),fc.get(this._editor)?.insert(n,{overwriteBefore:0,overwriteAfter:0})}}};Lke=D([_(1,we),_(2,ug)],Lke);let Rke=Tke=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._dec=this._editor.createDecorationsCollection(),this._updateDecorations=this._register(new cn(()=>this._updateDecorationsNow(),500));const i=qn(this._editor.getModel());this._register(i.onDidChangeContent(()=>this._updateDecorations.schedule())),this._register(this._keybindingService.onDidUpdateKeybindings(()=>this._updateDecorations.schedule())),this._register({dispose:()=>{this._dec.clear(),this._updateDecorations.cancel()}}),this._updateDecorations.schedule()}_updateDecorationsNow(){const e=qn(this._editor.getModel()),t=[],i=RLe(e.getValue());if(i&&Array.isArray(i.children))for(let n=0,o=i.children.length;n{this.updateResolver()})),t.add(Ee(()=>{const i=this.keybindingProviders.indexOf(e);i>=0&&(this.keybindingProviders.splice(i,1),this.updateResolver())})),t}_getResolver(){return super._getResolver()}_dispatch(e,t){return this.shouldUseGlobalKeybindings()?super._dispatch(e,t):!1}getUserKeybindingItems(){return[...super.getUserKeybindingItems(),...this.keybindingProviders.flatMap(e=>e.provideKeybindings())]}};Mke=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,ug),_(6,xc),_(7,fs),_(8,Jt),_(9,ks),_(10,Ge),_(11,Oae)],Mke);utt(s=>{s.get(we).createInstance(Ske)});function dei({shouldUseGlobalKeybindings:s=()=>!1}={}){return{...Rce(),[Ut.toString()]:new wi(Mke,[s],!1),[Oae.toString()]:new wi(yke,[],!0),[vi.toString()]:new wi(Cke,[],!0)}}class hei{constructor(){this._provider=new oo,this.onDidChange=this._provider.onDidChange}addStatus(e){return this._provider.register(e.selector,e)}getLanguageStatus(e){return this._provider.ordered(e).sort((t,i)=>{let n=i.severity-t.severity;return n===0&&(n=gm(t.source,i.source)),n===0&&(n=gm(t.id,i.id)),n})}}var Nke;function jst(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this._loadConfigurationsForMode(o)})})),this._register(this._languageService.onDidChange(()=>{for(const[o]of this._done)this._loadConfigurationsForMode(o)}))}async _loadConfigurationsForMode(e){const t=this._languageService.getConfigurationFiles(e),i=Wc(t.map(o=>o.toString()));if(this._done.get(e)===i)return;this._done.set(e,i);const n=await Promise.all(t.map(o=>this._readConfigFile(o)));for(const o of n)this._handleConfig(e,o)}async _readConfigFile(e){try{const t=await this._extensionResourceLoaderService.readExtensionResource(e),i=[];let n=sf(t,i);return i.length&&console.error(g(2492,"Errors parsing {0}: {1}",e.toString(),i.map(o=>`[${o.offset}, ${o.length}] ${kee(o.error)}`).join(` +`))),sD(n)!=="object"&&(console.error(g(2493,"{0}: Invalid format, JSON object expected.",e.toString())),n={}),n}catch(t){return console.error(t),{}}}static _extractValidCommentRule(e,t){const i=t.comments;if(typeof i>"u")return;if(!kn(i)){console.warn(`[${e}]: language configuration: expected \`comments\` to be an object.`);return}let n;return typeof i.lineComment<"u"&&(typeof i.lineComment!="string"?console.warn(`[${e}]: language configuration: expected \`comments.lineComment\` to be a string.`):(n=n||{},n.lineComment=i.lineComment)),typeof i.blockComment<"u"&&(L4(i.blockComment)?(n=n||{},n.blockComment=i.blockComment):console.warn(`[${e}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),n}static _extractValidBrackets(e,t){const i=t.brackets;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`brackets\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const n=[];for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let n;for(let o=0,r=i.length;o + `,description:g(2505,"Defines what characters must be after the cursor in order for bracket or quote autoclosing to occur when using the 'languageDefined' autoclosing setting. This is typically the set of characters which can not start an expression."),type:"string"},surroundingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:g(2506,"Defines the bracket pairs that can be used to surround a selected string."),type:"array",items:{oneOf:[{$ref:"#/definitions/bracketPair"},{type:"object",properties:{open:{$ref:"#/definitions/openBracket"},close:{$ref:"#/definitions/closeBracket"}}}]}},wordPattern:{default:"",description:g(2507,"Defines what is considered to be a word in the programming language."),type:["string","object"],properties:{pattern:{type:"string",description:g(2508,"The RegExp pattern used to match words."),default:""},flags:{type:"string",description:g(2509,"The RegExp flags used to match words."),default:"g",pattern:"^([gimuy]+)$",patternErrorMessage:g(2510,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentationRules:{default:{increaseIndentPattern:"",decreaseIndentPattern:""},description:g(2511,"The language's indentation settings."),type:"object",properties:{increaseIndentPattern:{type:["string","object"],description:g(2512,"If a line matches this pattern, then all the lines after it should be indented once (until another rule matches)."),properties:{pattern:{type:"string",description:g(2513,"The RegExp pattern for increaseIndentPattern."),default:""},flags:{type:"string",description:g(2514,"The RegExp flags for increaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2515,"Must match the pattern `/^([gimuy]+)$/`.")}}},decreaseIndentPattern:{type:["string","object"],description:g(2516,"If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches)."),properties:{pattern:{type:"string",description:g(2517,"The RegExp pattern for decreaseIndentPattern."),default:""},flags:{type:"string",description:g(2518,"The RegExp flags for decreaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2519,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentNextLinePattern:{type:["string","object"],description:g(2520,"If a line matches this pattern, then **only the next line** after it should be indented once."),properties:{pattern:{type:"string",description:g(2521,"The RegExp pattern for indentNextLinePattern."),default:""},flags:{type:"string",description:g(2522,"The RegExp flags for indentNextLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2523,"Must match the pattern `/^([gimuy]+)$/`.")}}},unIndentedLinePattern:{type:["string","object"],description:g(2524,"If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules."),properties:{pattern:{type:"string",description:g(2525,"The RegExp pattern for unIndentedLinePattern."),default:""},flags:{type:"string",description:g(2526,"The RegExp flags for unIndentedLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2527,"Must match the pattern `/^([gimuy]+)$/`.")}}}}},folding:{type:"object",description:g(2528,"The language's folding settings."),properties:{offSide:{type:"boolean",description:g(2529,"A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.")},markers:{type:"object",description:g(2530,"Language specific folding markers such as '#region' and '#endregion'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently"),properties:{start:{type:"string",description:g(2531,"The RegExp pattern for the start marker. The regexp must start with '^'.")},end:{type:"string",description:g(2532,"The RegExp pattern for the end marker. The regexp must start with '^'.")}}}}},onEnterRules:{type:"array",description:g(2533,"The language's rules to be evaluated when pressing Enter."),items:{type:"object",description:g(2533,"The language's rules to be evaluated when pressing Enter."),required:["beforeText","action"],properties:{beforeText:{type:["string","object"],description:g(2534,"This rule will only execute if the text before the cursor matches this regular expression."),properties:{pattern:{type:"string",description:g(2535,"The RegExp pattern for beforeText."),default:""},flags:{type:"string",description:g(2536,"The RegExp flags for beforeText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2537,"Must match the pattern `/^([gimuy]+)$/`.")}}},afterText:{type:["string","object"],description:g(2538,"This rule will only execute if the text after the cursor matches this regular expression."),properties:{pattern:{type:"string",description:g(2539,"The RegExp pattern for afterText."),default:""},flags:{type:"string",description:g(2540,"The RegExp flags for afterText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2541,"Must match the pattern `/^([gimuy]+)$/`.")}}},previousLineText:{type:["string","object"],description:g(2542,"This rule will only execute if the text above the line matches this regular expression."),properties:{pattern:{type:"string",description:g(2543,"The RegExp pattern for previousLineText."),default:""},flags:{type:"string",description:g(2544,"The RegExp flags for previousLineText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2545,"Must match the pattern `/^([gimuy]+)$/`.")}}},action:{type:["string","object"],description:g(2546,"The action to execute."),required:["indent"],default:{indent:"indent"},properties:{indent:{type:"string",description:g(2547,"Describe what to do with the indentation"),default:"indent",enum:["none","indent","indentOutdent","outdent"],markdownEnumDescriptions:[g(2548,"Insert new line and copy the previous line's indentation."),g(2549,"Insert new line and indent once (relative to the previous line's indentation)."),g(2550,`Insert two new lines: + - the first one indented which will hold the cursor + - the second one at the same indentation level`),g(2551,"Insert new line and outdent once (relative to the previous line's indentation).")]},appendText:{type:"string",description:g(2552,"Describes text to be appended after the new line and after the indentation."),default:""},removeText:{type:"number",description:g(2553,"Describes the number of characters to remove from the new line's indentation."),default:0}}}}}}}},fei=Qe.as(YA.JSONContribution);fei.registerSchema(uei,gei);var JB;let ene=(JB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Pke)}},JB.ID="workbench.contrib.languageConfigurationExtensionPoint",JB);ene=D([_(0,we)],ene);Qu(ene.ID,ene,yc.BlockStartup);function pei(){return{...Rce(),[xi.toString()]:new wi(wbe,[],!1),[Yae.toString()]:new wi(hei,[],!0)}}let Fke=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(n=>{const o=this._undoRedoService.getElements(n.uri);if(!(o.past.length===0&&o.future.length===0)){for(const r of o.past)r instanceof mme&&r.setDelegate(this);for(const r of o.future)r instanceof mme&&r.setDelegate(this)}}))}prepareUndoRedo(e){const t=e.getMissingModels();if(t.length===0)return V.None;const i=t.map(async n=>{try{return await this._textModelService.createModelReference(n)}catch{return V.None}});return Promise.all(i).then(n=>({dispose:()=>bt(n)}))}};Fke=D([_(0,gi),_(1,fn),_(2,JA)],Fke);let Oke=class extends Brt{constructor(e,t,i,n){super(),this.instantiationService=e,this.textFileService=t,this.fileService=i,this.modelService=n,this.providers=new Map,this.modelsToDispose=new Set}createReferencedObject(e){return this.doCreateReferencedObject(e)}async doCreateReferencedObject(e,t){this.modelsToDispose.delete(e);const i=N.parse(e);if(i.scheme===pe.inMemory){if(!this.modelService.getModel(i))throw new Error(`Unable to resolve inMemory resource ${e}`);const o=this.instantiationService.createInstance(C9,i);if(this.ensureResolvedModel(o,e))return o}if(i.scheme===pe.untitled){const n=await this.textFileService.untitled.resolve({untitledResource:i});if(this.ensureResolvedModel(n,e))return n}if(this.fileService.hasProvider(i)){const n=await this.textFileService.files.resolve(i,{reason:X3.REFERENCE});if(this.ensureResolvedModel(n,e))return n}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const n=this.instantiationService.createInstance(C9,i);if(this.ensureResolvedModel(n,e))return n}if(!t)return await this.fileService.activateProvider(i.scheme),this.doCreateReferencedObject(e,!0);throw new Error(`Unable to resolve resource ${e}`)}ensureResolvedModel(e,t){if(nht(e))return!0;throw new Error(`Unable to resolve resource ${t}`)}destroyReferencedObject(e,t){N.parse(e).scheme!==pe.inMemory&&(this.modelsToDispose.add(e),(async()=>{try{const n=await t;if(!this.modelsToDispose.has(e)||(n instanceof dee?await this.textFileService.files.canDispose(n):n instanceof lee&&await this.textFileService.untitled.canDispose(n),!this.modelsToDispose.has(e)))return;n.dispose()}catch{}finally{this.modelsToDispose.delete(e)}})())}registerTextModelContentProvider(e,t){let i=this.providers.get(e);return i||(i=[],this.providers.set(e,i)),i.unshift(t),Ee(()=>{const n=this.providers.get(e);if(!n)return;const o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&this.providers.delete(e))})}hasTextModelContentProvider(e){return this.providers.get(e)!==void 0}async resolveTextModelContent(e){const t=N.parse(e),i=this.providers.get(t.scheme)||[];for(const n of i){const o=await n.provideTextContent(t);if(o)return o}throw new Error(`Unable to resolve text model content for resource ${e}`)}};Oke=D([_(0,we),_(1,Fo),_(2,Jt),_(3,gi)],Oke);let Bke=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(Oke)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new Wrt(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=n,this.uriIdentityService=o,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new Fke(this.modelService,this,this.undoRedoService))}async createModelReference(e){return e=this.uriIdentityService.asCanonicalUri(e),await this.asyncModelCollection.acquire(e.toString())}registerTextModelContentProvider(e,t){return this.resourceModelCollection.registerTextModelContentProvider(e,t)}canHandleResource(e){return this.fileService.hasProvider(e)||e.scheme===pe.untitled||e.scheme===pe.inMemory?!0:this.resourceModelCollection.hasTextModelContentProvider(e.scheme)}};Bke=D([_(0,we),_(1,Jt),_(2,JA),_(3,gi),_(4,ks)],Bke);function mei(){return{[fn.toString()]:new wi(Bke,[],!0)}}var Wke,rM;let Hke=(rM=class extends X2{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:Wke.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new dc,this.profileStorageProfile=this.userDataProfileService.currentProfile,this.profileStorageDisposables=this._register(new Z),this.workspaceStorageDisposables=this._register(new Z),this.registerListeners()}registerListeners(){this._register(this.userDataProfileService.onDidChangeCurrentProfile(e=>e.join(this.switchToProfile(e.profile))))}async doInitialize(){await Zs.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await Sz.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new oA(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.APPLICATION,t))),await this.applicationStorage.init(),this.updateIsNew(this.applicationStorage),this.applicationStoragePromise.complete({indexedDb:e,storage:this.applicationStorage})}async createProfileStorage(e){if(this.profileStorageDisposables.clear(),this.profileStorageProfile=e,c_e(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(n=>this.emitDidChangeValue(Ie.PROFILE,n)))}else{const t=await Sz.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new oA(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(Ie.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await Sz.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new oA(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(Wq);t===void 0?e.set(Wq,!0):t&&e.set(Wq,!1)}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return this.applicationStorageDatabase?.name;case Ie.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=qn(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,qn(this.profileStorage),Ie.PROFILE)}async switchToWorkspace(e,t){const i=qn(this.workspaceStorage),n=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(n,qn(this.workspaceStorage),Ie.WORKSPACE)}shouldFlushWhenIdle(){return ky().document.hasFocus()&&!this.hasPendingUpdate}close(){Ky&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE]){for(const t of[an.USER,an.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await Zs.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return Wje(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},Wke=rM,rM.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,rM);Hke=Wke=D([_(2,Ge)],Hke);class _ei extends Bq{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Rp=class Rp extends V{static async createApplicationStorage(e){return Rp.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Rp.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Rp.create({id:e},t)}static async create(e,t){try{const i=new Rp(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Nr(i,!0)}`),new _ei}}get hasPendingUpdate(){return!!this.pendingUpdate}constructor(e,t){super(),this.logService=t,this._onDidChangeItemsExternal=this._register(new I),this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event,this.pendingUpdate=void 0,this.name=`${Rp.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new INe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{wEt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await Z0.create(this.name,void 0,[Rp.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Nr(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Rp.STORAGE_OBJECT_STORE,t)}async updateItems(e){let t=!1;this.pendingUpdate=this.doUpdateItems(e);try{t=await this.pendingUpdate}finally{this.pendingUpdate=void 0}if(this.broadcastChannel&&t){const i={changed:e.insert,deleted:e.delete};this.broadcastChannel.postData(i)}}async doUpdateItems(e){const t=e.insert,i=e.delete;return!t&&!i||t?.size===0&&i?.size===0?!1:(await(await this.whenConnected).runInTransaction(Rp.STORAGE_OBJECT_STORE,"readwrite",o=>{const r=[];if(t)for(const[a,c]of t)r.push(o.put(c,a));if(i)for(const a of i)r.push(o.delete(a));return r}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(Rp.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Rp.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Rp.STORAGE_OBJECT_STORE="ItemTable";let Sz=Rp;var rw;const vei=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var aM;let tne=(aM=class extends V{static toKey(e){return`extensionKeys/${WJ(e.id)}@${e.version}`}static fromKey(e){const t=vei.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),n=[];for(const[o,r]of rw.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>Ra(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&n.push(rw.toKey({id:o,version:c}))}for(const o of n)t.remove(o,Ie.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(Ie.PROFILE,an.MACHINE);for(const n of i){const o=rw.fromKey(n);if(o){let r=t.get(o.id.toLowerCase());r||t.set(o.id.toLowerCase(),r=[]),r.push(o.version)}}return t}constructor(e,t,i){super(),this.storageService=e,this.productService=t,this.logService=i,this._onDidChangeExtensionStorageToSync=this._register(new I),this.onDidChangeExtensionStorageToSync=this._onDidChangeExtensionStorageToSync.event,this.extensionsWithKeysForSync=rw.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(Ie.PROFILE,void 0,this._register(new Z))(n=>this.onDidChangeStorageValue(n)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=rw.fromKey(e.key);if(t){if(this.storageService.get(e.key,Ie.PROFILE)===void 0)this.extensionsWithKeysForSync.delete(t.id.toLowerCase());else{let i=this.extensionsWithKeysForSync.get(t.id.toLowerCase());i||this.extensionsWithKeysForSync.set(t.id.toLowerCase(),i=[]),i.push(t.version),this._onDidChangeExtensionStorageToSync.fire()}return}}getExtensionId(e){if(Lt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return LM(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),n=this.getExtensionStateRaw(e,t);if(n)try{return JSON.parse(n)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),n=this.storageService.get(i,t?Ie.PROFILE:Ie.WORKSPACE);return n&&n?.length>rw.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${n.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),n}setExtensionState(e,t,i){const n=this.getExtensionId(e);t===void 0?this.storageService.remove(n,i?Ie.PROFILE:Ie.WORKSPACE):this.storageService.store(n,JSON.stringify(t),i?Ie.PROFILE:Ie.WORKSPACE,an.MACHINE)}setKeysForSync(e,t){this.storageService.store(rw.toKey(e),JSON.stringify(t),Ie.PROFILE,an.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(rw.toKey(e),Ie.PROFILE),n=i?JSON.parse(i):void 0;return n&&t?ja([...n,...t]):n||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(n=>!n.includes(e)&&!n.includes(t));i.push([e,t]),this.migrationList=i}}getSourceExtensionToMigrate(e){const t=this.migrationList.find(([,i])=>e===i);return t?t[0]:void 0}get migrationList(){const e=this.storageService.get("extensionStorage.migrationList",Ie.APPLICATION,"[]");try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return[]}set migrationList(e){e.length?this.storageService.store("extensionStorage.migrationList",JSON.stringify(e),Ie.APPLICATION,an.MACHINE):this.storageService.remove("extensionStorage.migrationList",Ie.APPLICATION)}},rw=aM,aM.LARGE_STATE_WARNING_THRESHOLD=512*1024,aM);tne=rw=D([_(0,$i),_(1,Er),_(2,Ge)],tne);var Az;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Az||(Az={}));class que extends oA{constructor(e,t){const i=t.read(e);if(super(new bei(e,t,i)),i!=null)for(const[n,o]of i)this.items.set(n,o)}}class bei{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??M.None}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t)),await this.provider.write(this.scope,this.items)}async close(){return this.provider.close?.(this.scope)}async optimize(){return this.provider.optimize?.(this.scope)}}class wei extends X2{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new que(Az.APPLICATION,this.provider)),this.profileStorage=this._register(new que(Az.PROFILE,this.provider)),this.workspaceStorage=this._register(new que(Az.WORKSPACE,this.provider)),this._register(this.workspaceStorage.onDidChangeStorage(i=>this.emitDidChangeValue(1,i))),this._register(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(0,i))),this._register(this.applicationStorage.onDidChangeStorage(i=>this.emitDidChangeValue(-1,i)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case-1:return"External (application)";case 0:return"External (profile)";default:return"External (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(e){return!1}get(e,t,i){return this.getStorage(t).get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t).getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t).getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t).getObject(e,this.fallbackOverride?.[e]??i)}}pNe(async s=>{const e=s.get($i);e instanceof X2&&await e.initialize()});m4t(async s=>{const e=s.get(xc),t=s.get($i);e.onDidChangeFocus(i=>{i||t.flush()})});let Uke=class extends Hke{constructor(e,t,i){super(gNe(),t,i),this.fallbackOverride=e}get(e,t,i){return this.getStorage(t)?.get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,this.fallbackOverride?.[e]??i)}};Uke=D([_(1,ug),_(2,Ge)],Uke);function yei({customProvider:s,fallbackOverride:e}={}){return s!=null?{[$i.toString()]:new wi(wei,[s,e],!0),[N3.toString()]:new wi(tne,[],!0)}:{[$i.toString()]:new wi(Uke,[e],!0),[N3.toString()]:new wi(tne,[],!0)}}class Cei{constructor(){this._systemSchemes=new Set(Object.keys(pe)),this._providerInfo=new Map,this.extUri=new xN(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&Vn.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const jU=ae("IExtHostFileSystemInfo");var aw;let Vke=aw=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new sTe,this._proxy=e.getProxy(Be.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(n){try{let o;const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),o=await r.impl.stat(n)):o=await i._proxy.$stat(n),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===lp.Readonly?1:void 0}}catch(o){aw._handleError(o)}},async readDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readDirectory(n)).slice()):await i._proxy.$readdir(n)}catch(o){return aw._handleError(o)}},async createDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(o.impl,o.extUri,n)):await i._proxy.$mkdir(n)}catch(o){return aw._handleError(o)}},async readFile(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readFile(n)).slice()):(await i._proxy.$readFile(n)).buffer}catch(o){return aw._handleError(o)}},async writeFile(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(n)),await i._writeQueue.queueFor(n,()=>Promise.resolve(r.impl.writeFile(n,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(n,$e.wrap(o))}catch(r){return aw._handleError(r)}},async delete(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(n.scheme),await r.impl.delete(n,{recursive:!1,...o})):await i._proxy.$delete(n,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return aw._handleError(r)}},async rename(n,o,r){try{return await i._proxy.$rename(n,o,{overwrite:!1,...r})}catch(a){return aw._handleError(a)}},async copy(n,o,r){try{return await i._proxy.$copy(n,o,{overwrite:!1,...r})}catch(a){return aw._handleError(a)}},isWritableFileSystem(n){const o=t.getCapabilities(n);if(typeof o=="number")return!(o&Vn.Readonly)}})}async mkdirp(e,t,i){const n=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&sn.Directory))throw Jc.FileExists(`Unable to create folder '${i.scheme===pe.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(Vk(o)!==ot.FileNotFound)throw o;n.push(t.basename(i)),i=t.dirname(i)}for(let o=n.length-1;o>=0;o--){i=t.joinPath(i,n[o]);try{await e.createDirectory(i)}catch(r){if(Vk(r)!==ot.FileExists)throw r}}}static _handleError(e){if(e instanceof Jc)throw e;if(e instanceof xA)switch(e.code){case ot.FileExists:throw Jc.FileExists(e.message);case ot.FileNotFound:throw Jc.FileNotFound(e.message);case ot.FileNotADirectory:throw Jc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Jc.FileIsADirectory(e.message);case ot.NoPermissions:throw Jc.NoPermissions(e.message);case ot.Unavailable:throw Jc.Unavailable(e.message);default:throw new Jc(e.message,e.name)}if(!(e instanceof Error))throw new Jc(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Jc.Unavailable(e.message);switch(e.name){case ot.FileExists:throw Jc.FileExists(e.message);case ot.FileNotFound:throw Jc.FileNotFound(e.message);case ot.FileNotADirectory:throw Jc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Jc.FileIsADirectory(e.message);case ot.NoPermissions:throw Jc.NoPermissions(e.message);case ot.Unavailable:throw Jc.Unavailable(e.message);default:throw new Jc(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?xn:Rre,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??xn}};Vke=aw=D([_(0,Jo),_(1,jU)],Vke);const nle=ae("IExtHostConsumerFileSystem");class Yst extends rae{get disposed(){return this._disposed}constructor(e,t,i,n,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=n,this.extension=o,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(r=>this.setLevel(r)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+` +`)}append(e){this.info(e)}clear(){const e=this.offset;this.logger.flush(),this.proxy.$update(this.id,lB.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,lB.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e=="boolean"?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=$e.fromString(t).byteLength,LY(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,lB.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class Sei extends Yst{appendLine(e){this.append(e)}}let zke=class{constructor(e,t,i,n,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=n,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Be.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${stt(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(const[t,i]of this.channels)i.visible=t===this.visibleChannelId}createOutputChannel(e,t,i){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");const n=typeof t=="object"&&t.log,o=Lt(t)?t:void 0;if(Lt(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Sn.equals(i.identifier,l))?.[1];a&&(r=bQe(a));const c=n?this.doCreateLogOutputChannel(e,r,i):this.doCreateOutputChannel(e,o,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),n?this.createExtHostLogOutputChannel(e,r??this.logService.getLevel(),c):this.createExtHostOutputChannel(e,c)}async doCreateOutputChannel(e,t,i){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));const n=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(n,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),r=this.loggerService.createLogger(o,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,o,t,i.identifier.value);return new Yst(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const n=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(n,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new Sei(a,e,c,this.proxy,i)}createExtensionLogDirectory(e){let t=this.extensionLogDirectoryPromise.get(e.identifier.value);if(!t){const i=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,e.identifier.value);this.extensionLogDirectoryPromise.set(e.identifier.value,t=(async()=>{try{await this.extHostFileSystem.value.createDirectory(i)}catch(n){if(Vk(n)!==ot.FileExists)throw n}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const n=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){n(),t.then(r=>r.append(o))},appendLine(o){n(),t.then(r=>r.appendLine(o))},clear(){n(),t.then(o=>o.clear())},replace(o){n(),t.then(r=>r.replace(o))},show(o,r){n(),t.then(a=>a.show(o,r))},hide(){n(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const n=new Z,o=()=>{if(n.isDisposed)throw new Error("Channel has been closed")},r=n.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{n.add(c),c.logLevel!==t&&a(c.logLevel),n.add(c.onDidChangeLogLevel(l=>a(l)))}),{...this.createExtHostOutputChannel(e,i),get logLevel(){return t},onDidChangeLogLevel:r.event,trace(c,...l){o(),i.then(d=>d.trace(c,...l))},debug(c,...l){o(),i.then(d=>d.debug(c,...l))},info(c,...l){o(),i.then(d=>d.info(c,...l))},warn(c,...l){o(),i.then(d=>d.warn(c,...l))},error(c,...l){o(),i.then(d=>d.error(c,...l))},dispose(){n.dispose()}}}};zke=D([_(0,Jo),_(1,_u),_(2,nle),_(3,jU),_(4,uf),_(5,Ge)],zke);const Jst=ae("IExtHostOutputService"),sle=ae("IURITransformerService");class Aei{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}function e7(s,e,t){return new xN(i=>IPe(i,t)).isEqual(s,e)}function Eei(s,e,t){return e7(s.uri,e.uri,t)?0:gm(s.uri.toString(),e.uri.toString())}function xei(s,e,t){return s.index!==e.index?s.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return XI(n,o,(r,a)=>t(r,a,i))}function IPe(s,e){const t=e.getCapabilities(s.scheme);return!(t&&t&Vn.PathCaseSensitive)}class hB extends pje{static toExtHostWorkspace(e,t,i,n){if(!e)return{workspace:null,added:[],removed:[]};const{id:o,name:r,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,b)=>{const w=N.revive(v.uri),y=hB._findFolder(i||t,w,n);y?(y.name=v.name,y.index=v.index,h.push(y)):h.push({uri:w,name:v.name,index:b})}):h.push(...a.map(({uri:v,name:b,index:w})=>({uri:N.revive(v),name:b,index:w}))),h.sort((v,b)=>v.indexIPe(v,n)),{added:p,removed:m}=Xst(u?u.workspaceFolders:[],f.workspaceFolders,Eei,n);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let n=0;nnew pae(c)),n,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Dh.forUris(a,()=>!0),i.forEach(c=>{this._workspaceFolders.push(c),this._structure.set(c.uri,c)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=Lr(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let $ke=class{constructor(e,t,i,n,o){this._onDidChangeWorkspace=new I,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new I,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new jx,this._canonicalUriProviders=new Map,this._logService=n,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new adt,this._barrier=new qd,this._proxy=e.getProxy(Be.MainThreadWorkspace),this._messageService=e.getProxy(Be.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new hB(r.id,r.name,[],!!r.transient,r.configuration?N.revive(r.configuration):null,!!r.isUntitled,a=>IPe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?N.from({scheme:pe.untitled,path:_i(Lr(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...n){const o=[];if(Array.isArray(n)&&n.forEach(d=>{N.isUri(d.uri)&&!o.some(h=>e7(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||EA(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&o.length===0)return!1;const r=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>r.length)return!1;const a=r.slice(0);a.splice(t,i,...o.map(d=>({uri:d.uri,name:d.name||EA(d.uri),index:void 0})));for(let d=0;df!==d&&e7(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=Xst(r,a,xei,this._extHostFileSystemInfo);if(c.length===0&&l.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,o).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Xe.Error,g(572,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,n="";if(typeof e=="string"?(i=N.file(e),n=e):typeof e<"u"&&(i=e,n=e.fsPath),!i)return n;const o=this.getWorkspaceFolder(i,!0);if(!o)return n;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=DN(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=hB.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:n}=hB.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:n}))}findFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${n.value}, entryPoint: findFiles`);let r="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?r=t:r=t.pattern),this._findFilesImpl(e,void 0,{exclude:r,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},o)}findFiles2(e,t={},i,n=He.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,n)}async _findFilesImpl(e,t,i,n=He.None){if(n&&n.isCancellationRequested)return Promise.resolve([]);const o=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,r={ignoreSymlinks:typeof i.followSymlinks=="boolean"?!i.followSymlinks:void 0,disregardIgnoreFiles:typeof i.useIgnoreFiles=="boolean"?!i.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof i.useGlobalIgnoreFiles=="boolean"?!i.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof i.useParentIgnoreFiles=="boolean"?!i.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof i.useDefaultExcludes=="boolean"?!i.useDefaultExcludes:!1,disregardSearchExcludeSettings:typeof i.useDefaultSearchExcludes=="boolean"?!i.useDefaultSearchExcludes:!1,maxResults:i.maxResults,excludePattern:o,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=Que(Gf.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=Que(Gf.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,n).then(c=>Array.isArray(c)?c.map(l=>N.revive(l)):[])}async findTextInFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${n.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=Que(Gf.from(t.include)),d=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,h={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:a,afterContext:t.afterContext,beforeContext:t.beforeContext,includePattern:c,excludePattern:d};if(this._activeSearchCallbacks[r]=u=>{const f=N.revive(u.resource);u.results.forEach(p=>{const m=Mo(p);l3t(m)?i({uri:f,preview:{text:m.preview.text,matches:n8(m.preview.matches,v=>new Jn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:n8(m.ranges,v=>new Jn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},o.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,r,o);return delete this._activeSearchCallbacks[r],u||{}}catch(u){throw delete this._activeSearchCallbacks[r],u}}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return N.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return N.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),n=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(n,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(n)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(N.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const n=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!n),!n)return;const o=await n.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,n){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(N.revive(e));if(!o){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",o);const r=this._editSessionIdentityProviders.get(o.uri.scheme);if(this._logService.info(`Provider for scheme ${o.uri.scheme} is defined: `,!!r),!r)return;const a=await r.provideEditSessionIdentityMatch?.(t,i,n);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,n)}}async $onWillCreateEditSessionIdentity(e,t,i){const n=await this.resolveWorkspaceFolder(N.revive(e));if(n===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:n},t,async(o,r)=>{const a=Date.now();await Promise.resolve(o),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",r.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),n=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(n,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(n)})}async provideCanonicalUri(e,t,i){const n=this._canonicalUriProviders.get(e.scheme);if(!n)return;const o=await n.provideCanonicalUri?.(N.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}};$ke=D([_(0,Jo),_(1,_u),_(2,jU),_(3,Ge),_(4,sle)],$ke);const oE=ae("IExtHostWorkspace");function Que(s){let e,t;return s&&(typeof s=="string"?e=s:(e=s.pattern,t=N.revive(s.baseUri))),{includePattern:e,folder:t}}var HV,Sk;let Gke=(Sk=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Be.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=HV._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const n=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=H_(o);if(r.length<=HV._maxEventSize){this._proxy.$onDidChange(i,r);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,r.length);const a=r.map(d=>({uri:d,rank:cat(d.path,"/")})),c=i8(a,(d,h)=>d.rank-h.rank||gm(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=Cb(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=HV._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new Qs(()=>{n?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const n=Object.create(null),{provider:o,extensionDescription:r}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(o.provideFileDecoration(N.revive(c),i));if(!d)return;try{t$.validate(d),d.badge&&typeof d.badge!="string"&&Ve(r,"codiconDecoration"),n[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${r.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),n}},HV=Sk,Sk._handlePool=0,Sk._maxEventSize=250,Sk);Gke=HV=D([_(0,Jo),_(1,Ge)],Gke);const Zst=ae("IExtHostDecorations");function R4(s,e){if(e){const t=e.split(".");let i=s;for(let n=0;i&&nthis._actual)}$initializeConfiguration(e){this._actual=new Lei(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Kke=D([_(0,Jo),_(1,oE),_(2,Ge)],Kke);class Lei{constructor(e,t,i,n){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=n,this._extHostWorkspace=t,this._configuration=u3.parse(i,n),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=u3.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const n=y9e(t)||{},o=this._toReadonlyValue(e?R4(this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,n,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?St.USER:St.WORKSPACE;switch(c){case $T.Global:return St.USER;case $T.Workspace:return St.WORKSPACE;case $T.WorkspaceFolder:return St.WORKSPACE_FOLDER}}const a={has(c){return typeof R4(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,n,i?.identifier);let d=R4(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(kn(f)){let m;const v=()=>{h=h||xs(o),m=m||R4(h,p)};return new Proxy(f,{get:(b,w)=>{if(typeof w=="string"&&w.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||R4(h,p),m[w];const y=b[w];return typeof w=="string"?u(y,`${p}.${w}`):y},set:(b,w,y)=>(v(),m&&(m[w]=y),!0),deleteProperty:(b,w)=>(v(),m&&delete m[w],!0),defineProperty:(b,w,y)=>(v(),m&&Object.defineProperty(m,w,y),!0)})}return Array.isArray(f)?xs(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=r(d);return l!==void 0?this._proxy.$updateConfigurationOption(u,c,l,n,h):this._proxy.$removeConfigurationOption(u,c,n,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,n,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:xs(l.policy?.value??l.default?.value),globalValue:xs(l.user?.value??l.application?.value),workspaceValue:xs(l.workspace?.value),workspaceFolderValue:xs(l.workspaceFolder?.value),defaultLanguageValue:xs(l.default?.override),globalLanguageValue:xs(l.user?.override??l.application?.override),workspaceLanguageValue:xs(l.workspace?.override),workspaceFolderLanguageValue:xs(l.workspaceFolder?.override),languageIds:xs(l.overrideIdentifiers)}}};return typeof o=="object"&&gp(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>kn(i)?new Proxy(i,{get:(n,o)=>t(n[o]),set:(n,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(n,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(n,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:n=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const n=tf.test(e)?at.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(at.RESOURCE===n){typeof t?.resource>"u"&&this._logService.warn(`${o}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(at.WINDOW===n){t?.resource&&this._logService.warn(`${o}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new PLe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(n,o)=>i.affectsConfiguration(n,y9e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const rE=ae("IExtHostConfiguration"),qI=(s,e,t,i)=>{let n=e;return{enumerable:!0,configurable:!1,get(){return n},set(o){if(!t(n,o)){const r=n;n=o,s.listener?.(i(o,r))}}}},CP=(s,e)=>s===e,pE={range:(s,e)=>s===e?!0:!s||!e?!1:s.isEqual(e),label:CP,description:CP,sortText:CP,busy:CP,error:CP,canResolveChildren:CP,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.find(i=>t.id===i.id)))},SP=s=>e=>({op:Hd.SetProp,update:s(e)}),Rei=(s,e)=>({range:(()=>{let t;const i=SP(n=>({range:F.lift(et.from(n))}));return{enumerable:!0,configurable:!1,get(){return t},set(n){s.listener?.({op:Hd.DocumentSynced}),pE.range(t,n)||(t=n,s.listener?.(i(n)))}}})(),label:qI(s,e,pE.label,SP(t=>({label:t}))),description:qI(s,void 0,pE.description,SP(t=>({description:t}))),sortText:qI(s,void 0,pE.sortText,SP(t=>({sortText:t}))),canResolveChildren:qI(s,!1,pE.canResolveChildren,t=>({op:Hd.UpdateCanResolveChildren,state:t})),busy:qI(s,!1,pE.busy,SP(t=>({busy:t}))),error:qI(s,void 0,pE.error,SP(t=>({error:Ps.fromStrict(t)||null}))),tags:qI(s,[],pE.tags,(t,i)=>({op:Hd.SetTags,new:t.map(Hb.from),old:i.map(Hb.from)}))}),Mei=s=>{const e=vn.fromString(s.extId),t=new jN(e.controllerId,e.localId,s.label,N.revive(s.uri)||void 0);return t.range=et.to(s.range||void 0),t.description=s.description||void 0,t.sortText=s.sortText||void 0,t.tags=s.tags.map(i=>Hb.to({id:Wnt(i).tagId})),t},C9e=s=>{let e;for(const t of s.tests){const i=Mei(t.item);qce(i).parent=e,e=i}return e};class jN{constructor(e,t,i,n){if(t.includes(t_.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=hQt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:n,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof TPe?void 0:o.parent}},children:{value:dQt(o,qce,jN),enumerable:!0,writable:!1},...Rei(o,i)})}}class TPe extends jN{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Nei extends aQt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:n=>n&&i.getDocument(n)?.version,getApiFor:qce,getChildren:n=>n.children,root:new TPe(e,t),toITestItem:mI.from})}}let qke=class extends V{constructor(e,t){super(),this.initData=e,this.loggerService=t,this._onDidChangeTelemetryEnabled=this._register(new I),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new I),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=Kg.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=N.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:W1t,name:g(576,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{mQe(i)&&this.updateLoggerVisibility()})),this._outputLogger.info("Below are logs for extension telemetry events sent to the telemetry output channel API once the log level is set to trace."),this._outputLogger.info("===========================================================")}updateLoggerVisibility(){this.loggerService.setVisibility(this.extHostTelemetryLogFile,this._telemetryIsSupported&&this.loggerService.getLogLevel()===Gn.Trace)}getTelemetryConfiguration(){return this._level===Kg.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=Kg.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=Kg.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=Kg.USAGE:!1}}instantiateLogger(e,t,i){const n=this.getTelemetryDetails(),o=new eot(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:n.isUsageEnabled,isErrorsEnabled:n.isErrorsEnabled}),r=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...r,o]),o.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._telemetryIsSupported=t,this._productConfig=i??{usage:!0,error:!0},this.updateLoggerVisibility()}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.isnewappinstall"]=tot(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case tv.Web:t["common.uikind"]="web";break;case tv.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=D6(V1t(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,n)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(n):this._telemetryLoggers.set(n,o)}),this._telemetryLoggers.forEach(i=>{for(const n of i)n.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails()),this.updateLoggerVisibility()}onExtensionError(e,t){const n=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of n)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};qke=D([_(0,_u),_(1,uf)],qke);class eot{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,n,o,r,a){this._extension=i,this._logger=n,this._inLoggingOnlyMode=o,this._commonProperties=r,this._onDidChangeEnableStates=new I,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=qWe(t,[]),this._additionalCommonProperties&&(t=gp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=gp(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},n=qWe(i,[]),o=new Error(n.message,{cause:n.cause});o.stack=n.stack,o.name=n.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(o,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function tot(s){const e=Date.now()-new Date(s).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const ole=ae("IExtHostTelemetry");var eS,p7,m7,_6e;let Qke=(_6e=class{constructor(e,t,i){Wt(this,eS);Wt(this,p7);Wt(this,m7);this._commands=new Map,this._apiCommands=new Map,Ct(this,eS,e.getProxy(Be.MainThreadCommands)),this._logService=t,Ct(this,m7,i),Ct(this,p7,e.getProxy(Be.MainThreadTelemetry)),this.converter=new Pei(this,n=>{const o=this._apiCommands.get(n);return o?.result===nn.Void?o:void 0},t),this._argumentProcessors=[{processArgument(n){return Mo(n)}},{processArgument(n){return S2(n,function(o){if(F.isIRange(o))return et.to(o);if(oe.isIPosition(o))return Yo.to(o);if(F.isIRange(o.range)&&N.isUri(o.uri))return hf.to(o);if(o instanceof $e)return o.buffer.buffer;if(!Array.isArray(o))return o})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const n=e.args.map((r,a)=>{if(!r.validate(i[a]))throw new Error(`Invalid argument '${r.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return r.convert(i[a])}),o=await this.executeCommand(e.internalId,...n);return e.result.convert(o,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new Qs(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,n,o,r){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:n,metadata:o,extension:r}),e&&Ce(this,eS).$registerCommand(t),new Qs(()=>{this._commands.delete(t)&&e&&Ce(this,eS).$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return Ce(this,eS).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let n=!1;const o=S2(t,function(r){if(r instanceof bs)return Yo.from(r);if(r instanceof Jn)return et.from(r);if(r instanceof yp)return hf.from(r);if(Sy.isNotebookRange(r))return Wy.from(r);if(r instanceof ArrayBuffer)return n=!0,$e.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return n=!0,$e.wrap(r);if(r instanceof $e)return n=!0,r;if(!Array.isArray(r))return r});try{const r=await Ce(this,eS).$executeCommand(e,n?new jd(o):o,i);return Mo(r)}catch(r){if(r instanceof Error&&r.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw r}}}async _executeContributedCommand(e,t,i){const n=this._commands.get(e);if(!n)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=n;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),n)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),Ce(this,eS).$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:n}=i;n&&(e[t]=n)}return Promise.resolve(e)}},eS=new WeakMap,p7=new WeakMap,m7=new WeakMap,_6e);Qke=D([_(0,Jo),_(1,Ge),_(2,ole)],Qke);const YN=ae("IExtHostCommands");class Pei{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${ar()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const n=this._lookupApiCommand(e.command);if(n)i.id=n.internalId,i.arguments=n.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(eo(e.arguments)){const o=`${e.command} /${++this._cachIdPool}`;this._cache.set(o,e),t.add(Ee(()=>{this._cache.delete(o),this._logService.trace("CommandsConverter#DISPOSE",o)})),i.$ident=o,i.id=this.delegatingCommandId,i.arguments=[o],this._logService.trace("CommandsConverter#CREATE",e.command,o)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const Ga=class Ga{static Arr(e){return new Ga(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,n){this.name=e,this.description=t,this.validate=i,this.convert=n}optional(){return new Ga(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new Ga(e??this.name,t??this.description,this.validate,this.convert)}};Ga.Uri=new Ga("uri","Uri of a text document",e=>N.isUri(e),e=>e),Ga.Position=new Ga("position","A position in a text document",e=>bs.isPosition(e),Yo.from),Ga.Range=new Ga("range","A range in a text document",e=>Jn.isRange(e),et.from),Ga.Selection=new Ga("selection","A selection in a text document",e=>cC.isSelection(e),Wb.from),Ga.Number=new Ga("number","",e=>typeof e=="number",e=>e),Ga.String=new Ga("string","",e=>typeof e=="string",e=>e),Ga.StringArray=Ga.Arr(Ga.String),Ga.CallHierarchyItem=new Ga("item","A call hierarchy item",e=>e instanceof Pce,gN.from),Ga.TypeHierarchyItem=new Ga("item","A type hierarchy item",e=>e instanceof Oce,ZT.from),Ga.TestItem=new Ga("testItem","A VS Code TestItem",e=>e instanceof jN,mI.from);let ht=Ga;const nre=class nre{constructor(e,t){this.description=e,this.convert=t}};nre.Void=new nre("no result",e=>e);let nn=nre;class gn{constructor(e,t,i,n,o){this.id=e,this.internalId=t,this.description=i,this.args=n,this.result=o}}const jke=new Map;function Fei(s,e){e?jke.set(s,e):jke.delete(s)}function Oei(s){return jke.get(s)}class Bei extends TKe{constructor(e,t,i,n,o,r,a){super(t,i,n,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){Yf(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return is(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===pe.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===` +`?D_.LF:D_.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,i){return e._getWordRangeAtPosition(t,i)},[Symbol.for("debug.description")](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){Yf(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Yf(!this._isDisposed),this._isDirty=e}_save(){return this._isDisposed?Promise.reject(new Error("Document has been closed")):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){const t=this._validateRange(e);if(t.isEmpty)return"";if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);const i=this._eol,n=t.start.line,o=t.end.line,r=[];r.push(this._lines[n].substring(t.start.character));for(let a=n+1;a=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new Wei(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return new bs(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Jn))throw new Error("Invalid argument");const t=this._validatePosition(e.start),i=this._validatePosition(e.end);return t===e.start&&i===e.end?e:new Jn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof bs))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,n=!1;if(t<0)t=0,i=0,n=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,n=!0;else{const o=this._lines[t].length;i<0?(i=0,n=!0):i>o&&(i=o,n=!0)}return n?new bs(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=Oei(this._languageId);else if(J1e(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const n=Ik(i.character+1,O7(t),this._lines[i.line],0);if(n)return new Jn(i.line,n.startColumn-1,i.line,n.endColumn-1)}}class Wei{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return new Jn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Jn(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}}const sre=class sre{constructor(e,t,i){const n=sre._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,n,FEe.from(i)),this.value=Object.freeze({key:n,dispose(){e.$removeTextEditorDecorationType(n)}})}};sre._Keys=new DU("TextEditorDecorationType");let Yke=sre;class Hei{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw new Error("Edit is only valid while callback runs")}replace(e,t){this._throwIfFinalized();let i=null;if(e instanceof bs)i=new Jn(e,e);else if(e instanceof Jn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Jn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Jn)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const n=this._document.validateRange(e);this._collectedEdits.push({range:n,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==D_.LF&&e!==D_.CRLF)throw Pi("endOfLine");this._setEndOfLine=e}}class Uei{constructor(e,t,i,n){this._proxy=e,this._id=t,this._accept(i),this._logService=n;const o=this;this.value={get tabSize(){return o._tabSize},set tabSize(r){o._setTabSize(r)},get indentSize(){return o._indentSize},set indentSize(r){o._setIndentSize(r)},get insertSpaces(){return o._insertSpaces},set insertSpaces(r){o._setInsertSpaces(r)},get cursorStyle(){return o._cursorStyle},set cursorStyle(r){o._setCursorStyle(r)},get lineNumbers(){return o._lineNumbers},set lineNumbers(r){o._setLineNumbers(r)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=aB.to(e.lineNumbers)}_validateTabSize(e){if(e==="auto")return"auto";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){const t=this._validateTabSize(e);if(t!==null){if(typeof t=="number"){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError("setTabSize",this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e==="tabSize")return"tabSize";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){const t=this._validateIndentSize(e);if(t!==null){if(typeof t=="number"){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError("setIndentSize",this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e==="auto"?"auto":e==="false"?!1:!!e}_setInsertSpaces(e){const t=this._validateInsertSpaces(e);if(typeof t=="boolean"){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError("setInsertSpaces",this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError("setCursorStyle",this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError("setLineNumbers",this._proxy.$trySetOptions(this._id,{lineNumbers:aB.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const n=this._validateTabSize(e.tabSize);n==="auto"?(i=!0,t.tabSize=n):typeof n=="number"&&this._tabSize!==n&&(this._tabSize=n,i=!0,t.tabSize=n)}if(typeof e.indentSize<"u"){const n=this._validateIndentSize(e.indentSize);n==="tabSize"?(i=!0,t.indentSize=n):typeof n=="number"&&this._originalIndentSize!==n&&(this._indentSize=n,this._originalIndentSize=n,i=!0,t.indentSize=n)}if(typeof e.insertSpaces<"u"){const n=this._validateInsertSpaces(e.insertSpaces);n==="auto"?(i=!0,t.insertSpaces=n):this._insertSpaces!==n&&(this._insertSpaces=n,i=!0,t.insertSpaces=n)}typeof e.cursorStyle<"u"&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,i=!0,t.cursorStyle=e.cursorStyle),typeof e.lineNumbers<"u"&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,i=!0,t.lineNumbers=aB.from(e.lineNumbers)),i&&this._warnOnError("setOptions",this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(i=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(i)})}}class Vei{constructor(e,t,i,n,o,r,a,c){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=o,this._options=new Uei(this._proxy,this.id,r,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return n.value},set document(d){throw new A1("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof cC))throw Pi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof cC)))throw Pi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new A1("visibleRanges")},get options(){return l._options.value},set options(d){l._disposed||l._options.assign(d)},get viewColumn(){return l._viewColumn},set viewColumn(d){throw new A1("viewColumn")},edit(d,h={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#edit not possible on closed editors"));const u=new Hei(n.value,h);return d(u),l._applyEdit(u)},insertSnippet(d,h,u={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#insertSnippet not possible on closed editors"));let f;if(!h||Array.isArray(h)&&h.length===0)f=l._selections.map(p=>et.from(p));else if(h instanceof bs){const{lineNumber:p,column:m}=Yo.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Jn)f=[et.from(h)];else{f=[];for(const p of h)if(p instanceof Jn)f.push(et.from(p));else{const{lineNumber:m,column:v}=Yo.from(p);f.push({startLineNumber:m,startColumn:v,endLineNumber:m,endColumn:v})}}return t.$tryInsertSnippet(e,n.value.version,d.value,f,u)},setDecorations(d,h){const u=h.length===0;u&&!l._hasDecorationsForKey.has(d.key)||(u?l._hasDecorationsForKey.delete(d.key):l._hasDecorationsForKey.add(d.key),l._runOnProxy(()=>{if(Unt(h))return t.$trySetDecorations(e,d.key,fQt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,et.from(d),h||W9.Default))},show(d){t.$tryShowEditor(e,xl.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Yf(!this._disposed),this._disposed=!0}_acceptOptions(e){Yf(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Yf(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Yf(!this._disposed),this._viewColumn=e}_acceptSelections(e){Yf(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(Wb.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){const t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);const i=t.edits.map(o=>o.range);i.sort((o,r)=>o.end.line===r.end.line?o.end.character===r.end.character?o.start.line===r.start.line?o.start.character-r.start.character:o.start.line-r.start.line:o.end.character-r.end.character:o.end.line-r.end.line);for(let o=0,r=i.length-1;o({range:et.from(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,n,{setEndOfLine:typeof t.setEndOfLine=="number"?WH.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn("TextEditor is closed/disposed"),Promise.resolve(void 0)):e().then(()=>this,t=>(t instanceof Error&&t.name==="DISPOSED"||this._logService.warn(t),null))}}class zei{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let Jke=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new ui,this._onDidAddDocuments=new I,this._onDidRemoveDocuments=new I,this._onDidChangeVisibleTextEditors=new I,this._onDidChangeActiveTextEditor=new I,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){const t=[],i=[],n=[];if(e.removedDocuments)for(const o of e.removedDocuments){const r=N.revive(o),a=this._documents.get(r);a?.unref()&&(this._documents.delete(r),t.push(a.value))}if(e.addedDocuments)for(const o of e.addedDocuments){const r=N.revive(o.uri);let a=this._documents.get(r);if(a&&r.scheme!==pe.vscodeNotebookCell&&r.scheme!==pe.vscodeInteractiveInput)throw new Error(`document '${r} already exists!'`);a||(a=new zei(new Bei(this._extHostRpc.getProxy(Be.MainThreadDocuments),r,o.lines,o.EOL,o.versionId,o.languageId,o.isDirty)),this._documents.set(r,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const o of e.removedEditors){const r=this._editors.get(o);this._editors.delete(o),r&&n.push(r)}if(e.addedEditors)for(const o of e.addedEditors){const r=N.revive(o.documentUri);Yf(this._documents.has(r),`document '${r}' does not exist`),Yf(!this._editors.has(o.id),`editor '${o.id}' already exists!`);const a=this._documents.get(r).value,c=new Vei(o.id,this._extHostRpc.getProxy(Be.MainThreadTextEditors),this._logService,new ya(()=>a.document),o.selections.map(Wb.to),o.options,o.visibleRanges.map(l=>et.to(l)),typeof o.editorPosition=="number"?xl.to(o.editorPosition):void 0);this._editors.set(o.id,c)}e.newActiveEditor!==void 0&&(Yf(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),bt(t),bt(n),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(o=>o.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return hi.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;const t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};Jke=D([_(0,Jo),_(1,Ge)],Jke);const YU=ae("IExtHostDocumentsAndEditors"),JU=ae("IExtHostTerminalService");class S9e extends V{constructor(e,t,i,n){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=n,this._disposed=!1,this._state={isInteractedWith:!1},this.isOpen=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(r=>this._pidPromiseComplete=r);const o=this;this.value={get name(){return o._name||""},get processId(){return o._pidPromise},get creationOptions(){return o._creationOptions},get exitStatus(){return o._exitStatus},get state(){return o._state},get selection(){return o._selection},get shellIntegration(){return o.shellIntegration},sendText(r,a=!0){o._checkDisposed(),o._proxy.$sendText(o._id,r,a)},show(r){o._checkDisposed(),o._proxy.$show(o._id,r)},hide(){o._checkDisposed(),o._proxy.$hide(o._id)},dispose(){o._disposed||(o._disposed=!0,o._proxy.$dispose(o._id))},get dimensions(){if(!(o._cols===void 0||o._rows===void 0))return{columns:o._cols,rows:o._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!="string")throw new Error("Terminal has already been created");await this._proxy.$createTerminal(this._id,{name:e.name,shellPath:e.shellPath??void 0,shellArgs:e.shellArgs??void 0,cwd:e.cwd??t?.cwd??void 0,env:e.env??void 0,icon:iot(e.iconPath)??void 0,color:O2.isThemeColor(e.color)?e.color.id:void 0,initialText:e.message??void 0,strictEnv:e.strictEnv??void 0,hideFromUser:e.hideFromUser??void 0,forceShellIntegration:t?.forceShellIntegration??void 0,isFeatureTerminal:t?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:t?.useShellEnvironment??void 0,location:t?.location||this._serializeParentTerminal(e.location,t?.resolvedExtHostIdentifier),isTransient:e.isTransient??void 0})}async createExtensionTerminal(e,t,i,n,o){if(typeof this._id!="string")throw new Error("Terminal has already been created");if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:n,color:O2.isThemeColor(o)?o.id:void 0,location:t?.location||this._serializeParentTerminal(e,i),isTransient:!0}),typeof this._id=="string")throw new Error("Terminal creation failed");return this._id}_serializeParentTerminal(e,t){return typeof e=="object"?"parentTerminal"in e&&e.parentTerminal&&t?{parentTerminal:t}:"viewColumn"in e?{viewColumn:xl.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw new Error("Terminal has already been disposed")}set name(e){this._name=e}setExitStatus(e,t){this._exitStatus=Object.freeze({code:e,reason:t})}setDimensions(e,t){return e===this._cols&&t===this._rows||e===0||t===0?!1:(this._cols=e,this._rows=t,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={isInteractedWith:!0},!0)}setSelection(e){this._selection=e}_setProcessId(e){this._pidPromiseComplete?(this._pidPromiseComplete(e),this._pidPromiseComplete=void 0):this._pidPromise.then(t=>{t!==e&&(this._pidPromise=Promise.resolve(e))})}}class jue{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new I,this.onProcessData=this._onProcessData.event,this._onProcessReady=new I,this._onDidChangeProperty=new I,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new I,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw new Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw new Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve("")}getCwd(){return Promise.resolve("")}startSendingEvents(e){this._pty.onDidWrite(t=>this._onProcessData.fire(t)),this._pty.onDidClose?.((t=void 0)=>{this._onProcessExit.fire(t===void 0?void 0:t)}),this._pty.onDidOverrideDimensions?.(t=>{t&&this._onDidChangeProperty.fire({type:Og.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Og.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let $ei=1,Xke=class extends V{get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,i){super(),this._extHostCommands=t,this._terminals=[],this._terminalProcesses=new Map,this._terminalProcessDisposables={},this._extensionTerminalAwaitingStart={},this._getTerminalPromises={},this._environmentVariableCollections=new Map,this._lastQuickFixCommands=this._register(new wn),this._linkProviders=new Set,this._profileProviders=new Map,this._quickFixProviders=new Map,this._terminalLinkCache=new Map,this._terminalLinkCancellationSource=new Map,this._onDidCloseTerminal=new I,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new I,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new I,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new I,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new I,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new I,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new I({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new I({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=i.getProxy(Be.MainThreadTerminalService),this._bufferer=new Qnt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:n=>{const o=r=>{const a=r;return this.getTerminalById(a.instanceId)?.value};switch(n?.$mid){case ws.TerminalContext:return o(n);default:{if(Array.isArray(n))for(let r=0;r{for(const[n,o]of this._terminalProcesses)o.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||""}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){const i=new S9e(this._proxy,ar(),e,e.name),n=new jue(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,iot(e.iconPath),Kei(e.color)).then(o=>{const r=this._setupExtHostProcessListeners(o,n);this._terminalProcessDisposables[o]=r}),this._terminals.push(i),i.value}_serializeParentTerminal(e,t){if(t=t||{},e.location&&typeof e.location=="object"&&"parentTerminal"in e.location){const i=e.location.parentTerminal;if(i){const n=this._terminals.find(o=>o.value===i);n&&(t.resolvedExtHostIdentifier=n._id)}}else e.location&&typeof e.location!="object"?t.location=e.location:t.location&&typeof t.location=="object"&&"splitActiveTerminal"in t.location&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw new Error(`Cannot resolve terminal with id ${e} for virtual process`);const n=new jue(t),o=this._setupExtHostProcessListeners(e,n);this._terminalProcessDisposables[e]=o}async $acceptActiveTerminalChanged(e){const t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}const i=this.getTerminalById(e);i&&(this._activeTerminal=i,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){const i=this.getTerminalById(e);i&&this._onDidWriteTerminalData.fire({terminal:i.value,data:t})}async $acceptTerminalDimensions(e,t,i){const n=this.getTerminalById(e);n&&n.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:n.value,dimensions:n.value.dimensions})}async $acceptDidExecuteCommand(e,t){const i=this.getTerminalById(e);i&&this._onDidExecuteCommand.fire({terminal:i.value,...t})}async $acceptTerminalMaximumDimensions(e,t,i){this._terminalProcesses.get(e)?.resize(t,i)}async $acceptTerminalTitleChange(e,t){const i=this.getTerminalById(e);i&&(i.name=t)}async $acceptTerminalClosed(e,t,i){const n=this._getTerminalObjectIndexById(this._terminals,e);if(n!==null){const o=this._terminals.splice(n,1)[0];o.setExitStatus(t,i),this._onDidCloseTerminal.fire(o.value)}}$acceptTerminalOpened(e,t,i,n){if(t){const a=this._getTerminalObjectIndexById(this._terminals,t);if(a!==null){this._terminals[a]._id=e,this._onDidOpenTerminal.fire(this.terminals[a]),this._terminals[a].isOpen=!0;return}}const o={name:n.name,shellPath:n.executable,shellArgs:n.args,cwd:typeof n.cwd=="string"?n.cwd:N.revive(n.cwd),env:n.env,hideFromUser:n.hideFromUser},r=new S9e(this._proxy,e,o,i);this._terminals.push(r),this._onDidOpenTerminal.fire(r.value),r.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){const i=this.getTerminalById(e);if(!i)return{message:g(573,"Could not find the terminal with id {0} on the extension host",e)};i.isOpen||await new Promise(o=>{const r=this.onDidOpenTerminal(async a=>{a===i.value&&(r.dispose(),o())})});const n=this._terminalProcesses.get(e);n?n.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){const i=new Z;i.add(t.onProcessReady(o=>this._proxy.$sendProcessReady(e,o.pid,o.cwd,o.windowsPty))),i.add(t.onDidChangeProperty(o=>this._proxy.$sendProcessProperty(e,o))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(o=>this._onProcessExit(e,o))),this._terminalProcesses.set(e,t);const n=this._extensionTerminalAwaitingStart[e];return n&&t instanceof jue&&(t.startSendingEvents(n.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),i}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){const t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,i){try{this._terminalProcesses.get(e)?.resize(t,i)}catch(n){if(n.code!=="EPIPE"&&n.code!=="ERR_IPC_CHANNEL_CLOSED")throw n}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Og.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Og.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new Qs(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}registerProfileProvider(e,t,i){if(this._profileProviders.has(t))throw new Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,i),this._proxy.$registerProfileProvider(t,e.identifier.value),new Qs(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalQuickFixProvider(e,t,i){if(this._quickFixProviders.has(e))throw new Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,i),this._proxy.$registerQuickFixProvider(e,t),new Qs(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ci().token;if(i.isCancellationRequested)return;const n=this._quickFixProviders.get(e);if(!n)return;const o=await n.provideTerminalQuickFixes(t,i);if(o===null||Array.isArray(o)&&o.length===0)return;const r=new Z;if(this._lastQuickFixCommands.value=r,!Array.isArray(o))return o?die.from(o,this._extHostCommands.converter,r):void 0;const a=[];for(const c of o){const l=die.from(c,this._extHostCommands.converter,r);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new ci().token;let n=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(n&&!("options"in n)&&(n={options:n}),!n||!("options"in n))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in n.options){this.createExtensionTerminal(n.options,t);return}this.createTerminalFromOptions(n.options,t)}}async $provideLinks(e,t){const i=this.getTerminalById(e);if(!i)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);const o=new ci;this._terminalLinkCancellationSource.set(e,o);const r=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(Zs.withAsyncBody(async u=>{o.token.onCancellationRequested(()=>u({provider:h,links:[]}));const f=await h.provideTerminalLinks(a,o.token)||[];o.token.isCancellationRequested||u({provider:h,links:f})}));const l=await Promise.all(c);if(o.token.isCancellationRequested)return[];const d=new Map;for(const h of l)h&&h.links.length>0&&r.push(...h.links.map(u=>{const f={id:$ei++,startIndex:u.startIndex,length:u.length,label:u.tooltip};return d.set(f.id,{provider:h.provider,link:u}),f}));return this._terminalLinkCache.set(e,d),r}$activateLink(e,t){const i=this._terminalLinkCache.get(e)?.get(t);i&&i.provider.handleTerminalLink(i.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];const i=this._terminalProcessDisposables[e];i&&(i.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){const t=this._terminals.findIndex(i=>i.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){const i=this._getTerminalObjectIndexById(e,t);return i!==null?e[i]:null}_getTerminalObjectIndexById(e,t){const i=e.findIndex(n=>n._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new A9e),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=jnt(t.map),n=RQt(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,n)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],n=this._register(new A9e(t[1]));this._setEnvironmentVariableCollection(i,n)})}$acceptDefaultProfile(e,t){const i=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,i?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};Xke=D([_(1,YN),_(2,Jo)],Xke);class A9e extends V{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=new I,this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){const t=this.getScopeKey(e);let i=this.scopedCollections.get(t);return i||(i=new Gei(this,e),this.scopedCollections.set(t,i),this._register(i.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),i}replace(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Replace,options:i??{applyAtProcessCreation:!0},scope:n})}append(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Append,options:i??{applyAtProcessCreation:!0},scope:n})}prepend(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Prepend,options:i??{applyAtProcessCreation:!0},scope:n})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw new Error("EnvironmentVariableMutatorOptions must apply at either process creation or shell integration");const i=this.getKey(e,t.scope),n=this.map.get(i),o=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!n||n.value!==t.value||n.type!==t.type||n.options?.applyAtProcessCreation!==o.applyAtProcessCreation||n.options?.applyAtShellIntegration!==o.applyAtShellIntegration||n.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const r=this.getKey(e,t.scope),a={variable:e,...t,options:o};this.map.set(r,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),n=this.map.get(i);return n?E9e(n):void 0}getKey(e,t){const i=this.getScopeKey(t);return i.length?`${e}:::${i}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??""}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){const t=new Map;for(const[i,n]of this.map)this.getScopeKey(n.scope)===this.getScopeKey(e)&&t.set(n.variable,E9e(n));return t}delete(e,t){const i=this.getKey(e,t);this.map.delete(i),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(const[t,i]of this.map)i.scope?.workspaceFolder?.index===e.workspaceFolder.index&&this.map.delete(t);this.clearDescription(e)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(e,t){const i=this.getScopeKey(t),n=this.descriptionMap.get(i);if(!n||n.description!==e){let o;typeof e=="string"?o=e:o=e?.value.split(` + +`)[0];const r={description:o,scope:t};this.descriptionMap.set(i,r),this._onDidChangeCollection.fire()}}getDescription(e){const t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){const t=this.getScopeKey(e);this.descriptionMap.delete(t)}}class Gei{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new I}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,i){this.collection.replace(e,t,i,this.scope)}append(e,t,i){this.collection.append(e,t,i,this.scope)}prepend(e,t,i){this.collection.prepend(e,t,i,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((i,n)=>e.call(t,n,i,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}}let Zke=class extends Xke{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new rS}createTerminalFromOptions(e,t){throw new rS}};Zke=D([_(0,YN),_(1,Jo)],Zke);function iot(s){if(!(!s||typeof s=="string"))return"id"in s?{id:s.id,color:s.color}:s}function Kei(s){return O2.isThemeColor(s)?s:void 0}function E9e(s){const e={...s};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const rle=ae("IExtHostApiDeprecationService");let eIe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Be.MainThreadTelemetry)}report(e,t,i){const n=this.getUsageKey(e,t);this._reportedUsages.has(n)||(this._reportedUsages.add(n),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${i}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};eIe=D([_(0,Jo),_(1,Ge)],eIe);var ine;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(ine||(ine={}));var nne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(nne||(nne={}));var tIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(tIe||(tIe={}));var Ez;(function(s){function e(n){if(n){const o=n;return o&&!!o.process}else return!1}s.is=e;function t(n){if(n==null)return;const o={process:n.process,args:n.args};return n.options&&(o.options=tIe.from(n.options)),o}s.from=t;function i(n){if(n!=null)return new oN(n.process,n.args,n.options)}s.to=i})(Ez||(Ez={}));var iIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(iIe||(iIe={}));var xz;(function(s){function e(n){if(n){const o=n;return o&&(!!o.commandLine||!!o.command)}else return!1}s.is=e;function t(n){if(n==null)return;const o={};return n.commandLine!==void 0?o.commandLine=n.commandLine:(o.command=n.command,o.args=n.args),n.options&&(o.options=iIe.from(n.options)),o}s.from=t;function i(n){if(!(n==null||n.command===void 0&&n.commandLine===void 0))return n.commandLine?new gI(n.commandLine,n.options):new gI(n.command,n.args?n.args:[],n.options)}s.to=i})(xz||(xz={}));var _A;(function(s){function e(n){if(n){const o=n;return o&&o.customExecution==="customExecution"}else return!1}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n,o){return o.get(n)}s.to=i})(_A||(_A={}));var nIe;(function(s){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}s.from=e})(nIe||(nIe={}));var Kx;(function(s){function e(n,o){if(n==null)return[];const r=[];for(const a of n){const c=t(a,o);c&&r.push(c)}return r}s.fromMany=e;function t(n,o){if(n==null)return;let r;n.execution instanceof oN?r=Ez.from(n.execution):n.execution instanceof gI?r=xz.from(n.execution):n.execution&&n.execution instanceof Fce&&(r=_A.from(n.execution));const a=ine.from(n.definition);let c;return n.scope?typeof n.scope=="number"?c=n.scope:c=n.scope.uri:c=fI.Workspace,!a||!c?void 0:{_id:n._id,definition:a,name:n.name,source:{extensionId:o.identifier.value,label:n.source,scope:c},execution:r,isBackground:n.isBackground,group:nIe.from(n.group),presentationOptions:nne.from(n.presentationOptions),problemMatchers:n.problemMatchers,hasDefinedMatchers:n.hasDefinedMatchers,runOptions:n.runOptions?n.runOptions:{reevaluateOnRerun:!0},detail:n.detail}}s.from=t;async function i(n,o,r){if(n==null)return;let a;Ez.is(n.execution)?a=Ez.to(n.execution):xz.is(n.execution)?a=xz.to(n.execution):_A.is(n.execution)&&(a=_A.to(n._id,r));const c=ine.to(n.definition);let l;if(n.source&&(n.source.scope!==void 0?typeof n.source.scope=="number"?l=n.source.scope:l=await o.resolveWorkspaceFolder(N.revive(n.source.scope)):l=fI.Workspace),!c||!l)return;const d=new z9(c,l,n.name,n.source.label,a,n.problemMatchers);return n.isBackground!==void 0&&(d.isBackground=n.isBackground),n.group!==void 0&&(d.group=cH.from(n.group._id),d.group&&n.group.isDefault&&(d.group=new cH(d.group.id,d.group.label),n.group.isDefault===!0&&(d.group.isDefault=n.group.isDefault))),n.presentationOptions&&(d.presentationOptions=nne.to(n.presentationOptions)),n._id&&(d._id=n._id),n.detail&&(d.detail=n.detail),d}s.to=i})(Kx||(Kx={}));var sIe;(function(s){function e(i){return i}s.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}s.to=t})(sIe||(sIe={}));var _7;class Yue{constructor(e,t,i){Wt(this,_7);this._id=t,this._task=i,Ct(this,_7,e)}get task(){return this._task}terminate(){Ce(this,_7).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}_7=new WeakMap;let oIe=class{constructor(e,t,i,n,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Be.MainThreadTask),this._workspaceProvider=i,this._editorService=n,this._configurationService=o,this._terminalService=r,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=c,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,i){if(!i)return new Qs(()=>{});const n=this.nextHandle();return this._handlers.set(n,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(n,t),new Qs(()=>{this._handlers.delete(n),this._proxy.$unregisterTaskProvider(n)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(sIe.from(e)).then(async t=>{const i=[];for(const n of t){const o=await Kx.to(n,this._workspaceProvider,this._providedCustomExecutions2);o&&i.push(o)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof Yue))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,i){const n=this._providedCustomExecutions2.get(e.id);n&&(this._activeCustomExecutions2.set(e.id,n),this._terminalService.attachPtyToTerminal(t,await n.callback(i))),this._lastStartedTask=e.id,this._onDidExecuteTask.fire({execution:await this.getTaskExecution(e)})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;const t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}$provideTasks(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));const n=[],o=jh(()=>i.provider.provideTasks(He.None)).then(r=>this.provideTasksInternal(t,n,i,r));return new Promise(r=>{o.then(a=>{Promise.all(n).then(()=>{r(a)})})})}async $resolveTask(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));if(t.definition.type!==i.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${i.type}].`);const n=await Kx.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!n)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(n,He.None);if(!o)return;this.checkDeprecation(o,i);const r=Kx.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==n.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return _A.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const n=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(n)&&(this._notProvidedCustomExecutions.add(n),this._activeCustomExecutions2.set(n,t.execution)),this._providedCustomExecutions2.set(n,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new La("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let n;return t?n=Promise.resolve(new Yue(this,e.id,t)):n=Kx.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new La("Unexpected: Task does not exist.");return new Yue(this,e.id,o)}),this._taskExecutionPromises.set(e.id,n),n.then(o=>(this._taskExecutions.set(e.id,o),o))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));const i=this._notProvidedCustomExecutions.values();let n=i.next();for(;!n.done;)!this._activeCustomExecutions2.has(n.value)&&this._lastStartedTask!==n.value&&(this._providedCustomExecutions2.delete(n.value),this._notProvidedCustomExecutions.delete(n.value)),n=i.next()}};oIe=D([_(0,Jo),_(1,_u),_(2,oE),_(3,YU),_(4,rE),_(5,JU),_(6,Ge),_(7,rle)],oIe);let rIe=class extends oIe{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c),this.registerTaskSystem(pe.vscodeRemote,{scheme:pe.vscodeRemote,authority:"",platform:Srt(Kd.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=Kx.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(_A.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new rS;const n=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),n}provideTasksInternal(e,t,i,n){const o=[];if(n)for(const r of n){if(this.checkDeprecation(r,i),!r.definition||!e[r.definition.type]){const c=r.source?r.source:"No task source";this._logService.warn(`The task [${c}, ${r.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=Kx.from(r,i.extension);a&&_A.is(a.execution)?(o.push(a),t.push(this.addCustomExecution(a,r,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:o,extension:i.extension}}async resolveTaskInternal(e){if(_A.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,i){}};rIe=D([_(0,Jo),_(1,_u),_(2,oE),_(3,YU),_(4,rE),_(5,JU),_(6,Ge),_(7,rle)],rIe);const not=ae("IExtHostTask"),fG=ae("IExtHostEditorTabs");class x9e{constructor(e,t,i){this._activeTabIdGetter=i,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case ha.TextInput:return new Bce(N.revive(this._dto.input.uri));case ha.TextDiffInput:return new c$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case ha.TextMergeInput:return new jNe(N.revive(this._dto.input.base),N.revive(this._dto.input.input1),N.revive(this._dto.input.input2),N.revive(this._dto.input.result));case ha.CustomEditorInput:return new Wce(N.revive(this._dto.input.uri),this._dto.input.viewType);case ha.WebviewEditorInput:return new YNe(this._dto.input.viewType);case ha.NotebookInput:return new Hce(N.revive(this._dto.input.uri),this._dto.input.notebookType);case ha.NotebookDiffInput:return new Uce(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case ha.TerminalEditorInput:return new JNe;case ha.InteractiveEditorInput:return new XNe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case ha.ChatEditorInput:return new ZNe;case ha.MultiDiffEditorInput:return new ePe(this._dto.input.diffEditors.map(e=>new c$(N.revive(e.original),N.revive(e.modified))));default:return}}}class qei{constructor(e,t){this._tabs=[],this._activeTabId="",this._dto=e,this._activeGroupIdGetter=t;for(const i of e.tabs)i.isActive&&(this._activeTabId=i.id),this._tabs.push(new x9e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return xl.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(i=>i.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(i=>i.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===fh.TAB_OPEN){const i=new x9e(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,i),e.tabDto.isActive&&(this._activeTabId=i.tabId),i}else if(e.kind===fh.TAB_CLOSE){const i=this._tabs.splice(e.index,1)[0];if(!i)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return i.tabId===this._activeTabId&&(this._activeTabId=""),i}else if(e.kind===fh.TAB_MOVE){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");const i=this._tabs.splice(e.oldIndex,1)[0];if(!i)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,i),i}const t=this._tabs.find(i=>i.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}}let aIe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Be.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){const e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(i=>i.apiObject))},get activeTabGroup(){const i=e._activeGroupId;return qn(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,n)=>{const o=Array.isArray(i)?i:[i];return o.length?Qei(o[0])?this._closeGroups(o,n):this._closeTabs(o,n):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){const t=new Set(this._extHostTabGroups.map(l=>l.groupId)),i=new Set(e.map(l=>l.groupId)),n=Sre(t,i),o=this._extHostTabGroups.filter(l=>n.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new qei(l,()=>this._activeGroupId);return n.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=qn(e.find(l=>l.isActive===!0)?.groupId);c!==void 0&&this._activeGroupId!==c&&(this._activeGroupId=c),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:o,changed:a}))}$acceptTabGroupUpdate(e){const t=this._extHostTabGroups.find(i=>i.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){const t=this._extHostTabGroups.find(n=>n.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");const i=t.acceptTabOperation(e);switch(e.kind){case fh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case fh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case fh.TAB_MOVE:case fh.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[i.apiObject]}));return}}_findExtHostTabFromApi(e){for(const t of this._extHostTabGroups)for(const i of t.tabs)if(i.apiObject===e)return i}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){const i=[];for(const n of e){const o=this._findExtHostTabFromApi(n);if(!o)throw new Error("Tab close: Invalid tab not found!");i.push(o.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const n of e){const o=this._findExtHostTabGroupFromApi(n);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};aIe=D([_(0,Jo)],aIe);function Qei(s){return s.tabs!==void 0}const ore=class ore{constructor(e,t,i,n){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=n}};ore.NONE=new ore(!1,-1,-1,-1);let qH=ore;class D9e{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new qH(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}}class ale{constructor(e,t,i,n,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=n,this.exports=o,this.disposable=r}}class jei extends ale{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class Yei extends ale{constructor(){super(!1,null,qH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class sne extends ale{constructor(e){super(!0,e,qH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let cIe=class{constructor(e,t,i,n){this._logService=n,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new va,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(const[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){const e=[];for(const[t,i]of this._operations)e.push(i.wait());await Promise.all(e)}isActivated(e){const t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){const t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;const i=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(i.map(n=>({id:n.identifier,reason:{startup:t,extensionId:n.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){const i=this._registry.getExtensionDescription(e);if(!i)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:i.identifier,reason:t}])}async _activateExtensions(e){const t=e.filter(i=>!this.isActivated(i.id)).map(i=>this._handleActivationRequest(i));await Promise.all(t.map(i=>i.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);const t=this._registry.getExtensionDescription(e.id);if(!t){const o=new Error(`Cannot activate unknown extension '${e.id.value}'`),r=this._createAndSaveOperation(e,null,[],new sne(o));return this._host.onExtensionActivationError(e.id,o,new vHe(e.id.value)),r}const i=[],n=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of n){if(this._isResolvedExtension(o))continue;const r=this._operations.get(o);if(r){i.push(r);continue}if(this._isHostExtension(o)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(o).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(o);if(a){if(!a.main&&!a.browser)continue;i.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}const c=t.displayName||t.identifier.value,l=new Error(`Cannot activate the '${c}' extension because it depends on unknown extension '${o}'`),d=this._createAndSaveOperation(e,t.displayName,[],new sne(l));return this._host.onExtensionActivationError(t.identifier,l,new vHe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,n){const o=new lIe(e.id,t,e.reason,i,n,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return pD.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};cIe=D([_(3,Ge)],cIe);let lIe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,n,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=n,this._value=o,this._host=r,this._logService=a,this._barrier=new qd,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){const t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new sne(t),this._isDisposed&&Fr(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};lIe=D([_(6,Ge)],lIe);class sot{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Be.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const n=await this._proxy.$initializeExtensionStorage(e,t);let o;return n&&(o=this.safeParseValue(e,t,n)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const n=this.safeParseValue(e,t,i);n&&this._onDidChangeStorage.fire({shared:e,key:t,value:n})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(n){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${n}`)}}}const LPe=ae("IExtHostStorage");class oot{constructor(e,t,i){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=i,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(n=>(this._value=n,this)),this._storageListener=this._storage.onDidChangeStorage(n=>{n.shared===this._shared&&n.key===this._id&&(this._value=n.value)}),this._scheduler=new cn(()=>{const n=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of n.values())o.complete()}catch(o){for(const r of n.values())r.error(o)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let i=this._value[e];return typeof i>"u"&&(i=t),i}update(e,t){this._value[e]=t;const i=this._deferredPromises.get(e);if(i!==void 0)return i.p;const n=new dc;return this._deferredPromises.set(e,n),this._scheduler.isScheduled()||this._scheduler.schedule(),n.p}dispose(){this._storageListener.dispose()}}class Jei extends oot{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}}const RPe=ae("IExtensionStoragePaths");let dIe=class{constructor(e,t,i){this._logService=t,this._extHostFileSystem=i,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(n=>this._value=n)}async _getWorkspaceStorageURI(e){return N.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);const e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(N.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:N.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(i){this._logService.error("[ExtHostStorage]",i);return}}workspaceValue(e){if(this._value)return N.joinPath(this._value,e.identifier.value)}globalValue(e){return N.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};dIe=D([_(0,_u),_(1,Ge),_(2,nle)],dIe);const MPe=ae("IExtHostAuthentication");let hIe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new Xei,this._proxy=e.getProxy(Be.MainThreadAuthentication)}async getSession(e,t,i,n={}){const o=Sn.toKey(e.identifier),r=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${o} ${t} ${r}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,o,a,n)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}async removeSession(e,t){const i=this._authenticationProviders.get(e);return i?i.provider.removeSession(t):this._proxy.$removeSession(e,t)}registerAuthenticationProvider(e,t,i,n){if(this._authenticationProviders.get(e))throw new Error(`An authentication provider with id '${e}' is already registered.`);this._authenticationProviders.set(e,{label:t,provider:i,options:n??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,n?.supportsMultipleAccounts??!1),new Qs(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const n=this._authenticationProviders.get(e);if(n)return await n.provider.createSession(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $getSessions(e,t,i){const n=this._authenticationProviders.get(e);if(n)return await n.provider.getSessions(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(zce)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};hIe=D([_(0,Jo)],hIe);class Xei{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const n=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,n),n}}var uIe;const NPe=ae("IExtHostLanguageModels");class k9e{constructor(e,t){this.option=e,this.stream=new P2,this.stream=t??new P2}}class Zei{constructor(){this._responseStreams=new Map,this._defaultStream=new P2,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return Qd.map(e._defaultStream.asyncIterable,t=>{if(t instanceof kH)return t.value}).coalesce()}}}*_streams(){if(this._responseStreams.size>0)for(const[,e]of this._responseStreams)yield e.stream;else yield this._defaultStream}handleFragment(e){if(this._isDone)return;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new k9e(e.index,this._defaultStream):t=new k9e(e.index),this._responseStreams.set(e.index,t));let i;e.part.type==="text"?i=new kH(e.part.value):i=new Vce(e.part.name,e.part.parameters),t.stream.emitOne(i)}reject(e){this._isDone=!0;for(const t of this._streams())t.reject(e)}resolve(){this._isDone=!0;for(const e of this._streams())e.resolve()}}var cM;let gIe=(cM=class{constructor(e,t,i){this._logService=t,this._extHostAuthentication=i,this._onDidChangeModelAccess=new I,this._onDidChangeProviders=new I,this.onDidChangeProviders=this._onDidChangeProviders.event,this._languageModels=new Map,this._allLanguageModelData=new Map,this._modelAccessList=new va,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Be.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,n){const o=uIe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;n.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof n.auth=="object"?n.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Sn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:n.vendor??Sn.toKey(e.identifier),name:n.name??"",family:n.family??"",version:n.version,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:r,targetExtensions:n.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Sn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $startChatRequest(e,t,i,n,o,r){const a=this._languageModels.get(e);if(!a)throw new Error("Provider not found");const c=new lu(async d=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let h;if(d.part instanceof Vce?h={type:"function_use",name:d.part.name,parameters:d.part.parameters}:d.part instanceof kH&&(h={type:"text",value:d.part.value}),!h){this._logService.warn(`[CHAT](${a.extension.value}) UNKNOWN part ${JSON.stringify(d)}`);return}this._proxy.$reportResponsePart(t,{index:d.index,part:h})});let l;if(a.provider.provideLanguageModelResponse2)l=Promise.resolve(a.provider.provideLanguageModelResponse2(n.map(IF.to),o,Sn.toKey(i),c,r));else{const d=new lu(async h=>{c.report({index:h.index,part:new kH(h.part)})});l=Promise.resolve(a.provider.provideLanguageModelResponse(n.map(IF.to),o?.modelOptions??{},Sn.toKey(i),d,r))}l.then(()=>{this._proxy.$reportResponseDone(t,void 0)},d=>{this._proxy.$reportResponseDone(t,SA(d))})}$provideTokenLength(e,t,i){const n=this._languageModels.get(e);return n?Promise.resolve(n.provider.provideTokenCount(t,i)):Promise.resolve(0)}$acceptChatModelMetadata(e){if(e.added)for(const{identifier:t,metadata:i}of e.added)this._allLanguageModelData.set(t,{metadata:i,apiObjects:new va});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,n]of this._pendingRequest)n.languageModelId===t&&(n.res.reject(new Ma),this._pendingRequest.delete(i))}e.added?.forEach(t=>this._fakeAuthPopulate(t.metadata)),this._onDidChangeProviders.fire(void 0)}async selectLanguageModels(e,t){const i=await this._proxy.$selectChatModels({...t,extension:e.identifier}),n=[],o=this;for(const r of i){const a=this._allLanguageModelData.get(r);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:r,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!o._allLanguageModelData.has(r))throw Mw.NotFound(r);return o._computeTokenLength(r,l,d??He.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw Mw.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??He.None)}},a.apiObjects.set(e.identifier,c)),n.push(c)}return n}async _sendChatRequest(e,t,i,n,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw Mw.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},n.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw Mw.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);try{const l=Math.random()*1e6|0,d=new Zei;this._pendingRequest.set(l,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,l,r,n,o)}catch(h){throw this._pendingRequest.delete(l),h}return d.apiObject}catch(l){throw l.name===Mw.name?l:new Mw(`Language model '${t}' errored: ${Nr(l)}`,"Unknown",l)}}_convertMessages(e,t){const i=[];for(const n of t)n.role===Kp.System&&Ve(e,"languageModelSystem"),n.content2 instanceof h$&&Ve(e,"lmTools"),i.push(IF.from(n));return i}async $acceptResponsePart(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async $acceptResponseDone(e,t){const i=this._pendingRequest.get(e);i&&(this._pendingRequest.delete(e),t?i.res.reject(l8(t)):i.res.resolve())}async _getAuthAccess(e,t,i,n){const o=zce+t.identifier.value;if(await this._extHostAuthentication.getSession(e,o,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(n)return!1;try{const a=i?g(577,"Justification: {1}",t.displayName,i):void 0;return await this._extHostAuthentication.getSession(e,o,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Sn.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(const t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(i){this._logService.error("Fake Auth request failed"),this._logService.error(i)}}async _computeTokenLength(e,t,i){if(!this._allLanguageModelData.get(e))throw Mw.NotFound(`Language model '${e}' is unknown.`);const o=hi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:IF.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:n,enabled:o}of e){const r=this._modelAccessList.get(i)??new A_;if(r.has(n)!==o){o?r.add(n):r.delete(n),this._modelAccessList.set(i,r);const c={from:i,to:n};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=M.signal(M.filter(this._onDidChangeModelAccess.event,o=>Sn.equals(o.from,e.identifier))),n=M.signal(this._onDidChangeProviders.event);return{get onDidChange(){return M.any(i,n)},canSendRequest(o){let r;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===o){r=l.metadata;break e}if(!r)return;if(!t._isUsingAuth(e.identifier,r))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(r.extension)}}}},uIe=cM,cM._idPool=1,cM);gIe=uIe=D([_(0,Jo),_(1,Ge),_(2,MPe)],gIe);class rot{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Be.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,i){return this._proxy.$setPassword(e,t,i)}delete(e,t){return this._proxy.$deletePassword(e,t)}}const PPe=ae("IExtHostSecretState");var lx;class eti{constructor(e,t){Wt(this,lx);this.disposables=new Z,this._id=Sn.toKey(e.identifier),Ct(this,lx,t),this.onDidChange=M.map(M.filter(Ce(this,lx).onDidChangePassword,i=>i.extensionId===this._id),i=>({key:i.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return Ce(this,lx).get(this._id,e)}store(e,t){return Ce(this,lx).store(this._id,e,t)}delete(e){return Ce(this,lx).delete(this._id,e)}}lx=new WeakMap;let fIe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Be.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===S1}getMessage(e,t){const{message:i,args:n,comment:o}=t;if(this.isDefaultLanguage)return efe(i,n??{});let r=i;o&&o.length>0&&(r+=`/${Array.isArray(o)?o.join(""):o}`);const a=this.bundleCache.get(e)?.contents[r];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${r}`),efe(a??i,n??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t;const i=await this.getBundleLocation(e);if(!i){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{const n=await this._proxy.$fetchBundleContents(i),o=JSON.parse(n);t=e.isBuiltin?o.contents?.bundle:o}catch(n){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${n.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:i})}async getBundleLocation(e){if(e.isBuiltin){const t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return N.revive(t)}return e.l10n?N.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};fIe=D([_(0,_u),_(1,Jo),_(2,Ge)],fIe);const FPe=ae("IExtHostLocalizationService"),OPe=ae("IExtHostManagedSockets");let pIe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Be.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new tti(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw new Error(`No socket factory with id ${e}`);const t=++this._remoteSocketIdCounter,i=await this._factory.makeConnection(),n=new Z;return this._managedRemoteSockets.set(t,new iti(t,i,n)),n.add(Ee(()=>this._managedRemoteSockets.delete(t))),n.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),n.dispose()})),n.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),n.dispose()})),n.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,$e.wrap(o)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){const t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};pIe=D([_(0,Jo)],pIe);class tti{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class iti extends V{constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var mIe;const aot=ae("IHostUtils");let _Ie=mIe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this._extHostManagedSockets=u,this._extHostLanguageModels=f,this._onDidChangeRemoteConnectionData=this._register(new I),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=i,this._initData=a,this._extHostWorkspace=n,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Be.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Be.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Be.MainThreadExtensionService),this._almostReadyToRunExtensions=new qd,this._readyToStartExtensionHost=new qd,this._readyToRunExtensions=new qd,this._eagerExtensionsActivated=new qd,this._activationEventsReader=new sti(this._initData.extensions.activationEvents),this._globalRegistry=new pD(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new A_(this._initData.extensions.myExtensions);this._myRegistry=new pD(this._activationEventsReader,cot(this._globalRegistry,p)),Wh&&(this._logService.info(`Creating extension host with the following global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${AP(this._myRegistry)}`)),this._storage=new sot(this._extHostContext,this._logService),this._secretState=new rot(this._extHostContext),this._storagePath=c,this._instaService=this._store.add(e.createChild(new Uc([LPe,this._storage],[PPe,this._secretState]))),this._activator=this._register(new cIe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,b)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,SA(v),b)},actualActivateExtension:async(m,v)=>{if(pD.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new Yei;const b=this._myRegistry.getExtensionDescription(m);return this._activateExtension(b,v)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),cs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){vt(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(o=>o.identifier).filter(o=>this.isActivated(o)).map(o=>this._deactivate(o))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),c8&&qge(n=>{this._logService.error(n)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Sr(5e3),i]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){const t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new Sn(t.identifier.value),extensionLocation:N.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{const i=this._activator.getActivatedExtension(e);if(i.activationFailed)return Promise.reject(i.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===pe.file&&this._hostUtils.fsRealpath){const t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));const i=await this._realPathCache.get(t);return N.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new nti(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Dh.forUris(i=>EGe.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const n=await this._realPathExtensionUri(i.extensionLocation);t.set(n,i)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;const i=this._activator.getActivatedExtension(e);if(!i)return t;try{typeof i.module.deactivate=="function"&&(t=Promise.resolve(i.module.deactivate()).then(void 0,n=>(this._logService.error(n),Promise.resolve(void 0))))}catch(n){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(n)}try{i.disposable.dispose()}catch(n){this._logService.error(`An error occurred when disposing the subscriptions for extension '${e.value}':`),this._logService.error(n)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(i=>{const n=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,n.codeLoadingTime,n.activateCallTime,n.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",n),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,n){const o=T9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...n||{},outcome:i})}_doActivateExtension(e,t){const i=T9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const n=this._getEntryPoint(e);if(!n)return Promise.resolve(new jei(qH.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value!==t.extensionId.value?`, root cause: ${t.extensionId.value}`:""}`),this._logService.flush();const o=new Z,r=new D9e(t.startup);return Promise.all([this._loadCommonJSModule(e,Pt(e.extensionLocation,n),r),this._loadExtensionContext(e,o)]).then(a=>(cs(`code/extHost/willActivateExtension/${e.identifier.value}`),mIe._callActivate(this._logService,e.identifier,a[0],a[1],o,r))).then(a=>(cs(`code/extHost/didActivateExtension/${e.identifier.value}`),a))}_loadExtensionContext(e,t){const i=this._extHostLanguageModels.createLanguageModelAccessInformation(e),n=t.add(new Jei(e,this._storage)),o=t.add(new oot(e.identifier.value,!1,this._storage)),r=t.add(new eti(e,this._secretState)),a=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?QT.Test:QT.Development:QT.Production,c=this._initData.remote.isRemote?bD.Workspace:bD.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([n.whenReady,o.whenReady,this._storagePath.whenReady]).then(()=>{const l=this;let d,h;const u=dl(e,"ipc")?this._initData.messagePorts?.get(Sn.toKey(e.identifier)):void 0;return Object.freeze({globalState:n,workspaceState:o,secrets:r,subscriptions:[],get languageModelAccessInformation(){return i},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(f){return cfe(e.extensionLocation.fsPath,f)},get storagePath(){return l._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return l._storagePath.globalValue(e).fsPath},get logPath(){return cfe(l._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return N.joinPath(l._initData.logsLocation,e.identifier.value)},get storageUri(){return l._storagePath.workspaceValue(e)},get globalStorageUri(){return l._storagePath.globalValue(e)},get extensionMode(){return a},get extension(){return d===void 0&&(d=new UV(l,e.identifier,e,c,!1)),d},get extensionRuntime(){return Ve(e,"extensionRuntime"),l.extensionRuntime},get environmentVariableCollection(){return l._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!h){if(!u)return;const f=M.buffer(M.fromDOMEventEmitter(u,"message",p=>p.data));u.start(),h={onDidReceiveMessage:f,postMessage:u.postMessage.bind(u)}}return h}})})}static _callActivate(e,t,i,n,o,r){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,n,r).then(a=>new ale(!1,null,r.build(),i,a,Ee(()=>{o.dispose(),bt(n.subscriptions)})))}static _callActivateOptional(e,t,i,n,o){if(typeof i.activate=="function")try{o.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const r=typeof global=="object"?global:self,a=i.activate.apply(r,[n]);return o.activateCallStop(),o.activateResolveStart(),Promise.resolve(a).then(c=>(o.activateResolveStop(),c))}catch(r){return Promise.reject(r)}else return Promise.resolve(i)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,i=>{this._logService.error(i)})}_activateAllStartupFinishedDeferred(e,t=0){const n=Date.now();V1e(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(bEt()),this._extHostConfiguration.getConfigProvider().then(e=>{const t=e.getConfiguration("extensions.experimental").get("deferredStartupFinishedActivation"),i=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(i);else for(const n of i)if(n.activationEvents)for(const o of n.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(n,o)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,r=>{this._logService.error(r)});this._register(this._extHostWorkspace.onDidChangeWorkspace(r=>this._handleWorkspaceContainsEagerExtensions(r.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),n=this._handleRemoteResolverEagerExtensions(),o=Promise.all([n,e,i]).then(()=>{});return Promise.race([o,Sr(1e4)]).then(()=>{this._activateAllStartupFinished()}),o}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;const i=!this._initData.remote.isRemote&&!!this._initData.remote.authority,n={logService:this._logService,folders:e.map(r=>r.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:r=>this._hostUtils.fsExists(r.fsPath),checkExists:(r,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(r,a,c)},o=await Bit(n,t);if(o)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:o.activationEvent}).then(void 0,r=>this._logService.error(r))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){const{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw new Error(g(442,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new D9e(!1));if(!i||typeof i.run!="function")throw new Error(g(443,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((n,o)=>{const r=(l,d)=>{l?(Wh&&this._logService.error("Test runner called back with error",l),o(l)):(Wh&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),n(typeof d=="number"&&d>0?1:0))},a=Zm(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Wh&&this._logService.info("Test runner finished successfully."),n(0)}).catch(l=>{Wh&&this._logService.error("Test runner finished with error",l),o(l instanceof Error&&l.stack?l.stack:String(l))})})}_startExtensionHost(){if(this._started)throw new Error("Extension host is already started!");return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Sr(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info("Eager extensions activated")})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,Ee(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){const{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){const t=e.indexOf("+");if(t===-1)throw new t1("Not an authority that can be resolved!",ed.InvalidAuthority);const i=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${i}`,!1),{authorityPrefix:i,resolver:this._resolvers[i]}}async $resolveAuthority(e,t){const i=js.create(!1),n=()=>`[resolveAuthority(${uee(e)},${t})][${i.elapsed()}ms] `,o=w=>this._logService.info(`${n()}${w}`),r=w=>this._logService.warn(`${n()}${w}`),a=(w,y=void 0)=>this._logService.error(`${n()}${w}`,y),c=w=>{if(w instanceof t1)return{type:"error",error:{code:w._code,message:w._message,detail:w._detail}};throw w},l=async w=>{o(`activating resolver for ${w}...`);const{resolver:y,authorityPrefix:C}=await this._activateAndGetResolver(w);if(!y)throw a(`no resolver for ${C}`),new t1(`No remote extension installed to resolve ${C}.`,ed.NoResolverFound);return{resolver:y,authorityPrefix:C,remoteAuthority:w}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async w=>{if(!(w instanceof t1)||w._code!==ed.InvalidAuthority)throw w;return r(`resolving nested authorities failed: ${w.message}`),[await l(e)]})}catch(w){return c(w)}const u=new J7;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[w,{authorityPrefix:y,resolver:C,remoteAuthority:A}]of h.entries())try{if(w===h.length-1)o("invoking final resolve()..."),cs(`code/extHost/willResolveAuthority/${y}`),f=await C.resolve(A,{resolveAttempt:t,execServer:p}),cs(`code/extHost/didResolveAuthorityOK/${y}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(C,sz.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${A}`),cs(`code/extHost/willResolveExecServer/${y}`),p=await C.resolveExecServer?.(A,{resolveAttempt:t,execServer:p}),!p)throw new t1(`Exec server was not available for ${A}`,ed.NoResolverFound);cs(`code/extHost/didResolveExecServerOK/${y}`)}}catch(L){return cs(`code/extHost/didResolveAuthorityError/${y}`),a("returned an error",L),u.dispose(),c(L)}u.dispose();const m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},v={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};o(`returned ${sz.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let b;if(sz.isManagedResolvedAuthority(f)){const w=t;this._extHostManagedSockets.setFactory(w,f.makeConnection),b={authority:e,connectTo:new xit(w),connectionToken:f.connectionToken}}else b={authority:e,connectTo:new Dit(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:b,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${uee(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const n=N.revive(t);if(typeof i.getCanonicalURI>"u")return n;const o=await jh(()=>i.getCanonicalURI(n));return o||n}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=I9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Wh&&(this._logService.info(`$startExtensionHost: global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${AP(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Nb.Immediate?this._almostReadyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(r=>r.extensionLocation=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=I9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Wh&&(this._logService.info(`$deltaExtensions: global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${AP(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){const t=$e.alloc(e),i=Math.random()%256;for(let n=0;na.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=cot(n,o);return{globalRegistry:n,myExtensions:r}}function T9e(s,e){return{id:s.identifier.value,name:s.name,extensionVersion:s.version,publisherDisplayName:s.publisher,activationEvents:s.activationEvents?s.activationEvents.join(","):null,isBuiltin:s.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function AP(s){return s.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const MI=ae("IExtHostExtensionService");var Q1,v7,j1;class UV{constructor(e,t,i,n,o){Wt(this,Q1);Wt(this,v7);Wt(this,j1);Ct(this,Q1,e),Ct(this,v7,t),Ct(this,j1,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=Rk(Zm(i.extensionLocation)),this.packageJSON=i,this.extensionKind=n,this.isFromDifferentExtensionHost=o}get isActive(){return Ce(this,Q1).isActivated(Ce(this,j1))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return Ce(this,Q1).getExtensionExports(Ce(this,j1))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await Ce(this,Q1).activateByIdWithErrors(Ce(this,j1),{startup:!1,extensionId:Ce(this,v7),activationEvent:"api"}),this.exports}}Q1=new WeakMap,v7=new WeakMap,j1=new WeakMap;function cot(s,e){return s.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class nti{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}}class sti{constructor(e){this._map=new va,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(const t of Object.keys(e))this._map.set(t,e[t])}}const BPe=ae("IExtHostVariableResolverProvider");class oti extends jie{constructor(e,t,i,n,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=n.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof c$||d.input instanceof Uce)return d.input.modified;if(d.input instanceof Bce||d.input instanceof Hce||d.input instanceof Wce)return d.input.uri}}}super({getFolderUri:l=>{const d=r.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>r.folders.length,getConfigurationValue:(l,d)=>o.getConfiguration(void 0,l).get(d),getAppRoot:()=>x2(),getExecPath:()=>D2.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return Rk(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return Rk(d.uri.fsPath)}}},getSelectedText:()=>{if(i){const l=i.activeEditor();if(l&&!l.selection.isEmpty)return l.document.getText(l.selection)}},getLineNumber:()=>{if(i){const l=i.activeEditor();if(l)return String(l.selection.end.line+1)}},getExtension:l=>e.getExtension(l)},void 0,a?Promise.resolve(a):void 0,Promise.resolve(D2))}}let vIe=class extends V{constructor(e,t,i,n,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=n,this.editorTabs=o,this._resolver=new ya(async()=>{const r=await this.configurationService.getConfigProvider(),c={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async l=>{c.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new oti(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};vIe=D([_(0,MI),_(1,oE),_(2,YU),_(3,rE),_(4,fG)],vIe);var L9e;(function(s){s.ViewletId="workbench.view.extension.test",s.ExplorerViewId="workbench.view.testing",s.OutputPeekContributionId="editor.contrib.testingOutputPeek",s.DecorationsContributionId="editor.contrib.testingDecorations",s.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",s.CoverageViewId="workbench.view.testCoverage",s.ResultsPanelId="workbench.panel.testResults",s.ResultsViewId="workbench.panel.testResults.view",s.MessageLanguageId="vscodeInternalTestMessage"})(L9e||(L9e={}));var R9e;(function(s){s.List="list",s.Tree="true"})(R9e||(R9e={}));var M9e;(function(s){s.ByLocation="location",s.ByStatus="status",s.ByDuration="duration"})(M9e||(M9e={}));Hn.Errored+"",g(4063,"Errored"),Hn.Failed+"",g(4064,"Failed"),Hn.Passed+"",g(4065,"Passed"),Hn.Queued+"",g(4066,"Queued"),Hn.Running+"",g(4067,"Running"),Hn.Skipped+"",g(4068,"Skipped"),Hn.Unset+"",g(4069,"Not yet run");Kh.Debug+"",g(4071,"Debug"),Kh.Run+"",g(4072,"Run"),Kh.Coverage+"",g(4073,"Coverage");var bIe;(function(s){s.CancelTestRefreshAction="testing.cancelTestRefresh",s.CancelTestRunAction="testing.cancelRun",s.ClearTestResultsAction="testing.clearTestResults",s.CollapseAllAction="testing.collapseAll",s.ConfigureTestProfilesAction="testing.configureProfile",s.ContinousRunUsingForTest="testing.continuousRunUsingForTest",s.CoverageAtCursor="testing.coverageAtCursor",s.CoverageByUri="testing.coverage.uri",s.CoverageClear="testing.coverage.close",s.CoverageCurrentFile="testing.coverageCurrentFile",s.CoverageFilterToTest="testing.coverageFilterToTest",s.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",s.CoverageLastRun="testing.coverageLastRun",s.CoverageSelectedAction="testing.coverageSelected",s.CoverageToggleToolbar="testing.coverageToggleToolbar",s.CoverageViewChangeSorting="testing.coverageViewChangeSorting",s.DebugAction="testing.debug",s.DebugAllAction="testing.debugAll",s.DebugAtCursor="testing.debugAtCursor",s.DebugByUri="testing.debug.uri",s.DebugCurrentFile="testing.debugCurrentFile",s.DebugFailedTests="testing.debugFailTests",s.DebugLastRun="testing.debugLastRun",s.DebugSelectedAction="testing.debugSelected",s.FilterAction="workbench.actions.treeView.testExplorer.filter",s.GetExplorerSelection="_testing.getExplorerSelection",s.GetSelectedProfiles="testing.getSelectedProfiles",s.GoToTest="testing.editFocusedTest",s.GoToRelatedTest="testing.goToRelatedTest",s.PeekRelatedTest="testing.peekRelatedTest",s.GoToRelatedCode="testing.goToRelatedCode",s.PeekRelatedCode="testing.peekRelatedCode",s.HideTestAction="testing.hideTest",s.OpenCoverage="testing.openCoverage",s.OpenOutputPeek="testing.openOutputPeek",s.RefreshTestsAction="testing.refreshTests",s.ReRunFailedTests="testing.reRunFailTests",s.ReRunLastRun="testing.reRunLastRun",s.RunAction="testing.run",s.RunAllAction="testing.runAll",s.RunAllWithCoverageAction="testing.coverageAll",s.RunAtCursor="testing.runAtCursor",s.RunByUri="testing.run.uri",s.RunCurrentFile="testing.runCurrentFile",s.RunSelectedAction="testing.runSelected",s.RunUsingProfileAction="testing.runUsing",s.RunWithCoverageAction="testing.coverage",s.SearchForTestExtension="testing.searchForTestExtension",s.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",s.ShowMostRecentOutputAction="testing.showMostRecentOutput",s.StartContinousRun="testing.startContinuousRun",s.StopContinousRun="testing.stopContinuousRun",s.TestingSortByDurationAction="testing.sortByDuration",s.TestingSortByLocationAction="testing.sortByLocation",s.TestingSortByStatusAction="testing.sortByStatus",s.TestingViewAsListAction="testing.viewAsList",s.TestingViewAsTreeAction="testing.viewAsTree",s.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",s.ToggleInlineTestOutput="testing.toggleInlineTestOutput",s.UnhideAllTestsAction="testing.unhideAllTests",s.UnhideTestAction="testing.unhideTest"})(bIe||(bIe={}));let rti=0;const N9e=new WeakMap,cle=ae("IExtHostTesting");let wIe=class extends V{constructor(e,t,i,n){super(),this.logService=t,this.commands=i,this.editors=n,this.resultsChangedEmitter=this._register(new I),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new I),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(Be.MainThreadTesting),this.observer=new uti(this.proxy),this.runTracker=new lti(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case ws.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(vn.root(a))?.collection.tree.get(a)?.actual??C9e(o)}case ws.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(vn.root(c))?.collection.tree.get(c)?.actual??C9e({$mid:ws.TestItemContext,tests:[r]}),message:VH.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(bIe.GetExplorerSelection),r=a=>{const c=this.controllers.get(vn.root(a));if(c)return vn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(Fc)||[],exclude:o?.exclude.map(r).filter(Fc)||[]}})}createTestController(e,t,i,n){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const o=new Z,r=o.add(new Nei(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d=()=>{let f=0;n&&(f|=cz.Refresh);const p=u.relatedCodeProvider;return p&&(p?.provideRelatedTests&&(f|=cz.TestRelatedToCode),p?.provideRelatedCode&&(f|=cz.CodeRelatedToTest)),f},h={items:r.root.children,get label(){return i},set label(f){i=f,r.root.label=f,l.$updateController(t,{label:i})},get refreshHandler(){return n},set refreshHandler(f){n=f,l.$updateController(t,{capabilities:d()})},get id(){return t},get relatedCodeProvider(){return u.relatedCodeProvider},set relatedCodeProvider(f){Ve(e,"testRelatedCode"),u.relatedCodeProvider=f,l.$updateController(t,{capabilities:d()})},createRunProfile:(f,p,m,v,b,w)=>{let y=Wc(f);for(;a.has(y);)y++;return new dot(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,y,f,p,m,v,b,w)},createTestItem(f,p,m){return new jN(t,f,p,m)},createTestRun:(f,p,m=!0)=>this.runTracker.createTestRun(e,t,r,f,p,m),invalidateTestResults:f=>{if(f===void 0)this.proxy.$markTestRetired(void 0);else{const p=f instanceof Array?f:[f];this.proxy.$markTestRetired(p.map(m=>vn.fromExtHostTestItem(m,t).toString()))}},set resolveHandler(f){r.resolveHandler=f},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}},u={controller:h,collection:r,profiles:a,extension:e,activeProfiles:c};return l.$registerTestController(t,i,d()),o.add(Ee(()=>l.$unregisterTestController(t))),this.controllers.set(t,u),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(f=>l.$publishDiff(t,f.map(MH.serialize)))),h}createTestObserver(){return this.observer.checkout()}async runTests(e,t=He.None){const i=lot(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const n=this.controllers.get(i.controllerId);if(!n)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,group:WPe[i.kind],targets:[{testIds:e.include?.map(o=>vn.fromExtHostTestItem(o,n.collection.root.id).toString())??[n.collection.root.id],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(o=>o.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}async $getTestsRelatedToCode(e,t,i){const n=this.editors.getDocument(N.revive(e));if(!n)return[];const o=Yo.to(t),r=[];return await Promise.all([...this.controllers.values()].map(async a=>{let c;try{c=await a.relatedCodeProvider?.provideRelatedTests?.(n.document,o,i)}catch(l){i.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${a.controller.label}`,l)}if(c){for(const l of c)r.push(vn.fromExtHostTestItem(l,a.controller.id).toString());a.collection.flushDiff()}})),r}async $getCodeRelatedToTest(e,t){const i=this.controllers.get(vn.root(e));if(!i)return[];const n=i.collection.tree.get(e);return n?(await i.relatedCodeProvider?.provideRelatedCode?.(n.actual,t))?.map(hf.from)??[]:[]}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t,i){return(await this.runTracker.getCoverageDetails(e,t,i))?.map(Zte.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){const t=new Map;for(const[i,n]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=n.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!n.includes(l));for(const l of a)r.set(l,!0),o.activeProfiles.add(l);for(const l of c)r.set(l,!1),o.activeProfiles.delete(l);r.size&&t.set(i,r)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(t=>{const i=exe.to(t);return N9e.set(i,t.id),i}).concat(this.results).sort((t,i)=>i.completedAt-t.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){const i=this.controllers.get(vn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>MH.deserialize({asCanonicalUri:i=>i},t)))}async $runControllerTests(e,t){return Promise.all(e.map(i=>this.runControllerTestRequest(i,!1,t)))}async $startContinuousRun(e,t){const i=new ci(t),n=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!n.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),n}async $provideTestFollowups(e,t){const i=this.results.find(r=>N9e.get(r)===e.resultId),n=i&>i(vn.fromString(e.extId),i?.results);if(!n)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,n,e.taskIndex,e.messageIndex,t);a&&(o=o.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:o.map(r=>{const a=rti++;return this.testFollowups.set(a,r),{title:r.title,id:a}})}$disposeTestFollowups(e){for(const t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){const t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}getMetadataForRun(e){for(const t of this.runTracker.trackers){const i=t.getTaskIdForRun(e);if(i)return{taskId:i,runId:t.id}}}async runControllerTestRequest(e,t,i){const n=this.controllers.get(e.controllerId);if(!n)return{};const{collection:o,profiles:r,extension:a}=n,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(Fc),d=e.excludeExtIds.map(f=>n.collection.tree.get(f)).filter(Fc).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===Ov.IsChild));if(!l.length)return{};const h=new a$(l.some(f=>f.actual instanceof TPe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=tQt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,t7.fromInternal(e,n.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await M.toPromise(u.onEnd)}}};wIe=D([_(0,Jo),_(1,Ge),_(2,YN),_(3,YU)],wIe);const ati=1e4;var UE;(function(s){s[s.Running=0]="Running",s[s.Cancelling=1]="Cancelling",s[s.Ended=2]="Ended"})(UE||(UE={}));class cti extends V{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,n,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=n,this.extension=o,this.state=UE.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new I),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new ci(r));const a=this._register(new cn(()=>this.forciblyEndTasks(),ati));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}getTaskIdForRun(e){for(const[t,{run:i}]of this.tasks)if(i===e)return t}cancel(){this.state===UE.Running?(this.cts.cancel(),this.state=UE.Cancelling):this.state===UE.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,i){const[,n]=vn.fromString(e).path,o=this.publishedCoverage.get(e);if(!o)return[];const{report:r,extIds:a}=o,c=this.tasks.get(n);if(!c)throw new Error("unreachable: run task was not found");let l;if(t&&r instanceof dN){const h=a.indexOf(t);if(h===-1)return[];l=r.fromTests[h]}return await(l?this.profile?.loadDetailedCoverageForTest?.(c.run,r,l,i):this.profile?.loadDetailedCoverage?.(c.run,r,i))??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,n=ar(),o=l=>(d,...h)=>{if(a){this.logService.warn(`Setting the state of test "${d.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(d),l(d,...h)},r=(l,d)=>{const h=d instanceof Array?d.map(VH.from):[VH.from(d)];if(l.uri&&l.range){const u={range:et.from(l.range),uri:l.uri};for(const f of h)f.location=f.location||u}this.proxy.$appendTestMessagesInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),h)};let a=!1;const c={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:l=>{if(a)return;const d=l instanceof dN?l.fromTests:[];if(d.length){Ve(this.extension,"attributableCoverage");for(const f of d)this.ensureTestIsKnown(f)}const h=l.uri.toString(),u=new vn([t,n,h]).toString();this.publishedCoverage.set(u,{report:l,extIds:d.map(f=>vn.fromExtHostTestItem(f,i).toString())}),this.proxy.$appendCoverage(t,n,Zte.fromFile(i,u,l))},enqueued:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Queued)}),skipped:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Skipped)}),started:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Running)}),errored:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Errored,h)}),failed:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Failed,h)}),passed:o((l,d)=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,this.dto.controllerId).toString(),Hn.Passed,d)}),appendOutput:(l,d,h)=>{a||(h&&this.ensureTestIsKnown(h),this.proxy.$appendOutputToRun(t,n,$e.fromString(l),d&&hf.from(d),h&&vn.fromExtHostTestItem(h,i).toString()))},end:()=>{a||(a=!0,this.proxy.$finishedTestRunTask(t,n),--this.running||this.markEnded())}};return this.running++,this.tasks.set(n,{run:c}),this.proxy.$startedTestRunTask(t,{id:n,ctrlId:this.dto.controllerId,name:e,running:!0}),c}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==UE.Ended&&(this.state=UE.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof jN))throw new Nte(e.id);if(this.sharedTestIds.has(vn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const n=mI.from(e);if(t.unshift(n),this.sharedTestIds.has(n.extId)||(this.sharedTestIds.add(n.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class lti{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t,i){const n=vn.root(e);return this.trackedById.get(n)?.getCoverageDetails(e,t,i)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(const[t,{id:i}]of this.tracked)i===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,i,n,o){return this.getTracker(t,i,n,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,n,o,r){const a=this.tracked.get(n);if(a)return a.createRun(o);const c=t7.fromPublic(t,i,n,r),l=lot(n);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!n.continuous,profile:l&&{group:WPe[l.kind],id:l.profileId},exclude:n.exclude?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:n.include?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:n.preserveFocus??!0,persist:r});const d=this.getTracker(n,c,n.profile,e);return M.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,n,o){const r=new cti(t,this.proxy,this.logService,i,n,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const lot=s=>{if(s.profile){if(!(s.profile instanceof dot))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return s.profile}};class t7{static fromPublic(e,t,i,n){return new t7(e,ar(),n,t)}static fromInternal(e,t){return new t7(e.controllerId,e.runId,!0,t)}constructor(e,t,i,n){this.controllerId=e,this.id=t,this.isPersisted=i,this.colllection=n}}class dti{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,mI.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.has(e)){this.added.delete(e);return}this.updated.delete(e);const t=vn.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){const{added:e,updated:t,removed:i}=this;return{get added(){return[...e].map(n=>n.revived)},get updated(){return[...t].map(n=>n.revived)},get removed(){return[...i].map(n=>n.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class hti extends nQt{constructor(){super(...arguments),this.changeEmitter=new I,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:mI.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new dti(this.changeEmitter)}}class uti{constructor(e){this.proxy=e}checkout(){this.current||(this.current=this.createObserverData());const e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(t=>t.revived)},dispose:hm(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){const e=new hti({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const M4=(s,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(s.controllerId,s.profileId,i)};var Hv,Y1,b7,Np,XB;class dot{constructor(e,t,i,n,o,r,a,c,l,d=!1,h=void 0,u=!1){Wt(this,Hv);Wt(this,Y1);Wt(this,b7);Wt(this,Np);Wt(this,XB);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,Ct(this,Hv,e),Ct(this,XB,t),Ct(this,Y1,i),Ct(this,b7,n),t.set(r,this);const f=WPe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),Ct(this,Np,{profileId:r,controllerId:o,tag:h?Hb.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{Ce(this,Np)&&(Ce(this,Hv).$publishTestRunProfile(Ce(this,Np)),Ct(this,Np,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,M4(this,Ce(this,Hv),Ce(this,Np),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,M4(this,Ce(this,Hv),Ce(this,Np),{supportsContinuousRun:e}))}get isDefault(){return Ce(this,Y1).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?Ce(this,Y1).add(this.profileId):Ce(this,Y1).delete(this.profileId),M4(this,Ce(this,Hv),Ce(this,Np),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,M4(this,Ce(this,Hv),Ce(this,Np),{tag:e?Hb.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,M4(this,Ce(this,Hv),Ce(this,Np),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return M.chain(Ce(this,b7),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(Fc))}dispose(){Ce(this,XB)?.delete(this.profileId)&&(Ct(this,XB,void 0),Ce(this,Hv).$removeTestProfile(this.controllerId,this.profileId)),Ct(this,Np,void 0)}}Hv=new WeakMap,Y1=new WeakMap,b7=new WeakMap,Np=new WeakMap,XB=new WeakMap;const WPe={[jT.Coverage]:Kh.Coverage,[jT.Debug]:Kh.Debug,[jT.Run]:Kh.Run};function gti(s,e){for(let t=0;tn.id===s.path[t]);if(!i)return;if(t===s.path.length-1)return i;e=i.children}}const hot=ae("IExtHostDebugService");let yIe=class extends V{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,i,n,o,r,a,c){super(),this._workspaceService=t,this._extensionService=i,this._configurationService=n,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._testing=c,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=this._register(new I),this._onDidTerminateDebugSession=this._register(new I),this._onDidChangeActiveDebugSession=this._register(new I),this._onDidReceiveDebugSessionCustomEvent=this._register(new I),this._debugServiceProxy=e.getProxy(Be.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new I),this._onDidChangeActiveStackItem=this._register(new I),this._activeDebugConsole=new pti(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(l=>{this._register(l.onDidChange(d=>{this.registerAllDebugTypes(l)})),this.registerAllDebugTypes(l)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const n=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return n?this.convertVisualizerTreeItem(e,n):void 0}registerDebugVisualizationTree(e,t,i){const n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(o,i),this._debugServiceProxy.$registerDebugVisualizerTree(o,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(o),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){const i=this._debugVisualizationElements.get(t)?.item;return i?(await this._debugVisualizationTrees.get(e)?.getChildren?.(i))?.map(o=>this.convertVisualizerTreeItem(e,o))||[]:[]}async $editVisualizerTreeItem(e,t){const i=this._debugVisualizationElements.get(e);if(!i)return;const n=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,n||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const n of i)if(n)for(const o of n)i.push(this._debugVisualizationElements.get(o)?.children),this._debugVisualizationElements.delete(o)}convertVisualizerTreeItem(e,t){let i=this._debugVisualizationTreeItemIds.get(t);return i||(i=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,i),this._debugVisualizationElements.set(i,{provider:e,item:t})),lxe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let n=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(n+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),n+=`${o}ref=${i.sourceReference}`,N.parse(n)}else{if(i.path)return N.file(i.path);throw new Error("cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.")}}registerAllDebugTypes(e){const t=[];for(const i of e.getAllExtensionDescriptions())if(i.contributes){const n=i.contributes.debuggers;if(n&&n.length>0)for(const o of n)uqt(o)&&t.push(o.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){const e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){const i=this._visualizers.get(e);if(!i)throw new Error(`No debug visualizer found with id '${e}'`);let{v:n,provider:o,extensionId:r}=i;if(n.visualization||(n=await o.resolveDebugVisualization?.(n,t)||n,i.v=n),!n.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,n.visualization)}async $executeDebugVisualizerCommand(e){const t=this._visualizers.get(e);if(!t)throw new Error(`No debug visualizer found with id '${e}'`);const i=t.v.visualization;i&&"command"in i&&this._commands.executeCommand(i.command,...i.arguments||[])}hydrateVisualizationContext(e){const t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,i,n){const o=this.hydrateVisualizationContext(i),r=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(r);if(!o||!a)return[];const c=await a.provideDebugVisualization(o,n);return c?c.map(l=>{const d=++this._visualizerIdCounter;this._visualizers.set(d,{v:l,provider:a,extensionId:e});const h=l.iconPath?this.getIconPathOrClass(l.iconPath):void 0;return{id:d,name:l.name,iconClass:h?.iconClass,iconPath:h?.iconPath,visualization:this.serializeVisualization(e,l.visualization)}}):[]}$disposeDebugVisualizers(e){for(const t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,i){if(!e.contributes?.debugVisualizers?.some(r=>r.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(o,i),this._debugServiceProxy.$registerDebugVisualizer(n,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(n,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(o=>{const r=o.id;return this._breakpoints.has(r)?!1:(this._breakpoints.set(r,o),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],n=new Map;for(const o of t)if(o instanceof Ux){let r=n.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},n.set(o.location.uri.toString(),r),i.push(r)),r.lines.push({id:o.id,enabled:o.enabled,condition:o.condition,hitCondition:o.hitCondition,logMessage:o.logMessage,line:o.location.range.start.line,character:o.location.range.start.character,mode:o.mode})}else o instanceof Vx&&i.push({type:"function",id:o.id,enabled:o.enabled,hitCondition:o.hitCondition,logMessage:o.logMessage,condition:o.condition,functionName:o.functionName,mode:o.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(r=>this._breakpoints.delete(r.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(r=>r instanceof Ux).map(r=>r.id),n=t.filter(r=>r instanceof Vx).map(r=>r.id),o=t.filter(r=>r instanceof Xee).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,n,o)}startDebugging(e,t,i){const n=i.testRun&&this._testing.getMetadataForRun(i.testRun);return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===e$.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,testRun:n&&{runId:n.runId,taskId:n.taskId},suppressDebugStatusbar:i.suppressDebugStatusbar??i.debugUI?.simple,suppressDebugToolbar:i.suppressDebugToolbar??i.debugUI?.simple,suppressDebugView:i.suppressDebugView??i.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,i){if(!t)return new Qs(()=>{});const n=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:n,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,n),new Qs(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(n)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new Qs(()=>{});if(!this.definesDebugType(e,t))throw new Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw new Error("a DebugAdapterDescriptorFactory can only be registered once per a type.");const n=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:n,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,n),new Qs(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(n)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new Qs(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new Qs(()=>{this._trackerFactories=this._trackerFactories.filter(n=>n.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const n=await this.getFolder(e);return n&&(i={uri:n.uri,name:n.name,index:n.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new _ti(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,n=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(n.type),n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,n);if(!a)throw new Error(`Couldn't create a debug adapter for type '${n.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(n).then(l=>(l&&this._debugAdaptersTrackers.set(e,l),c.onMessage(async d=>{if(d.type==="request"&&d.command==="handshake"){const h=d,u={type:"response",seq:0,command:h.command,request_seq:h.seq,success:!0};this._signService||(this._signService=this.createSignService());try{if(this._signService){const f=await this._signService.sign(h.arguments.value);u.body={signature:f},c.sendResponse(u)}else throw new Error("no signer")}catch(f){u.success=!1,u.message=f.message,c.sendResponse(u)}}else l&&l.onDidSendMessage&&l.onDidSendMessage(d),d=Nnt(d,!0),i._debugServiceProxy.$acceptDAMessage(e,d)}),c.onError(d=>{l&&l.onError&&l.onError(d),this._debugServiceProxy.$acceptDAError(e,d.name,d.message,d.stack)}),c.onExit(d=>{l&&l.onExit&&l.onExit(d??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,d??void 0,void 0)}),l&&l.onWillStartSession&&l.onWillStartSession(),c.startSession()))})}$sendDAMessage(e,t){t=Mnt(t,!1);const i=this._debugAdaptersTrackers.get(e);i&&i.onWillReceiveMessage&&i.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){const t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();const i=this._debugAdapters.get(e);return this._debugAdapters.delete(e),i?i.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){const t=[],i=[],n=[];if(e.added)for(const o of e.added){const r=o.id;if(r&&!this._breakpoints.has(r)){let a;if(o.type==="function")a=new Vx(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new Xee(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=N.revive(o.uri);a=new Ux(new yp(c,new bs(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}q9t(a,r),this._breakpoints.set(r,a),t.push(a)}}if(e.removed)for(const o of e.removed){const r=this._breakpoints.get(o);r&&(this._breakpoints.delete(o),i.push(r))}if(e.changed){for(const o of e.changed)if(o.id){const r=this._breakpoints.get(o.id);if(r){if(r instanceof Vx&&o.type==="function"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.functionName=o.functionName}else if(r instanceof Ux&&o.type==="source"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.location=new yp(N.revive(o.uri),new bs(o.line,o.character))}n.push(r)}}}this.fireBreakpointChanges(t,i,n)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new $Ne(i.api,e.threadId):t=new zNe(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return jh(async()=>{const n=this.getConfigProviderByHandle(e);if(!n)throw new Error("no DebugConfigurationProvider found");if(!n.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return n.provideDebugConfigurations(o,i)}).then(n=>{if(!n)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return n})}$resolveDebugConfiguration(e,t,i,n){return jh(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const r=await this.getFolder(t);return o.resolveDebugConfiguration(r,i,n)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,n){return jh(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const r=await this.getFolder(t);return o.resolveDebugConfigurationWithSubstitutedVariables(r,i,n)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const n=await this.getSession(t);return this.getAdapterDescriptor(i,n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}'`);return this.convertToDto(o)})}async $acceptDebugSessionStarted(e){const t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){const t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){const n={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(n)}convertToDto(e){if(e instanceof q9)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof hH)return{type:"server",port:e.port,host:e.host};if(e instanceof Q9)return{type:"pipeServer",path:e.path};if(e instanceof j9)return{type:"implementation",implementation:e.implementation};throw new Error("convertToDto unexpected type")}getAdapterDescriptorFactoryByType(e){const t=this._adapterFactories.filter(i=>i.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){const t=this._adapterFactories.filter(i=>i.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){const t=this._configProviders.filter(i=>i.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){const i=e.contributes.debuggers;if(i&&i.length>0){for(const n of i)if(n.label&&n.type&&n.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,n=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>jh(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(n).then(o=>{const r=Fi(o);if(r.length>0)return new mti(r)}),new Promise(o=>setTimeout(()=>o(void 0),1e3))]).catch(o=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new hH(i));if(e){const o=await this._extensionService.getExtensionRegistry();return jh(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const n=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,n))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,i){(e.length>0||t.length>0||i.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:i}))}async getSession(e){if(e)if(typeof e=="string"){const t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){const i=await this.getFolder(e.folderUri),n=e.parent?this._debugSessions.get(e.parent):void 0;t=new fti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,n?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw new Error("cannot find session")}getFolder(e){if(e){const t=N.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if("title"in t&&"command"in t)return{type:eee.Command};if("treeId"in t)return{type:eee.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,n;return"id"in t?n=We.asClassName(t):i=t,{iconPath:i,iconClass:n}}getIconUris(e){if(e instanceof uu)return{id:e.id};const t=typeof e=="object"&&"dark"in e?e.dark:e,i=typeof e=="object"&&"light"in e?e.light:e;return{dark:typeof t=="string"?N.file(t):t,light:typeof i=="string"?N.file(i):i}}};yIe=D([_(0,Jo),_(1,oE),_(2,MI),_(3,rE),_(4,fG),_(5,BPe),_(6,YN),_(7,cle)],yIe);class fti{constructor(e,t,i,n,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=n,this._workspaceFolder=o,this._configuration=r,this._parentSession=a}get api(){const e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,i){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,i)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}}class pti{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` +`)}})}}class mti{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(i=>i.onExit?i.onExit(e,t):void 0)}}class _ti extends knt{constructor(e){super(),this.implementation=e,e.onDidSendMessage(t=>{this.acceptMessage(t)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}}let CIe=class extends yIe{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c)}};CIe=D([_(0,Jo),_(1,oE),_(2,MI),_(3,rE),_(4,fG),_(5,BPe),_(6,YN),_(7,cle)],CIe);class vti{constructor(e,t,i){this.config=e,this.provider=t,this.sessionToken=i,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern,this.includePattern=e.includePattern&&j_(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&j_(e.excludePattern)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){const t=this.config.folderQueries||[];return new Promise((i,n)=>{const o=r=>{this.resultCount++,e(r)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(r=>{const a=r.toString(),c=Ko(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(o,{base:r,basename:c})}),Promise.all(t.map(r=>this.searchInFolder(r,o))).then(r=>{i({limitHit:this.isLimitHit,stats:r[0]||void 0})},r=>{n(new Error(Nr(r)))})})}async searchInFolder(e,t){const i=new ci,n=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new Fit(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=js.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},n,i.token),d=c.elapsed(),h=js.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=Vi.relative(e.folder.path,u.path);if(a){const p=Ko(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(o,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(o,r,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=Cee(this.config.includePattern,e.includePattern),i=Cee(this.config.excludePattern,e.excludePattern);return{folder:e.folder,excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,maxResults:this.config.maxResults,session:this.sessionToken}}initDirectoryTree(){const e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,i,n){if(i===this.filePattern){const r=Ko(this.filePattern);this.matchFile(n,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=Ko(r),c=Cb(r);let l=e[c];l||(l=e[c]=[],o(c)),l.push({base:t,relativePath:r,basename:a})}o(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,n){const o=this,r=this.filePattern;function a(c){const l=m3t(()=>c.map(d=>d.basename));for(let d=0,h=c.length;d=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}}const rre=class rre{constructor(){this.sessions=new Map}fileSearch(e,t,i,n){const o=this.getSessionTokenSource(e.cacheKey),r=new vti(e,t,o&&o.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(r,rre.BATCH_SIZE,c,n).then(l=>({limitHit:l.limitHit,stats:l.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:l.stats}:void 0,messages:[]}))}clearCache(e){this.getSessionTokenSource(e)?.cancel()}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new ci),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Pt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,n){const o=n.onCancellationRequested(()=>{e.cancel()}),r=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(r).then(c=>(a.length&&i(a),o.dispose(),c),c=>(a.length&&i(a),o.dispose(),Promise.reject(c)))}};rre.BATCH_SIZE=512;let SIe=rre;class P9e{constructor(e,t,i){this.queryProviderPair=e,this.fileUtils=t,this.processType=i,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t){const i=this.query.folderQueries||[],n=new ci(t);return new Promise((o,r)=>{this.collector=new wti(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);VV(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,n.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!VV(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),n.token))).then(l=>{n.dispose(),this.collector.flush();const d=l.some(h=>!!h&&!!h.limitHit);o({limitHit:this.isLimitHit||d,messages:l.flatMap(h=>h?.message?Array.isArray(h.message)?h.message:[h.message]:[]),stats:{type:this.processType}})},l=>{n.dispose();const d=Nr(l);r(new Error(d))})})}resultSize(e){return VV(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],n=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:n.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const n=new Fit(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===pe.file?p3t(()=>this.fileUtils.readdir(Lr(l.uri))):void 0,h=DN(e.folder,l.uri);if(h){const u=n.includedInQuery(h,Ko(h),d);Qy(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===cI.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(bti(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(VV(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}getSearchOptionsForFolder(e){const t=Cee(this.query.includePattern,e.includePattern),i=Cee(this.query.excludePattern,e.excludePattern),n={folder:N.from(e.folder),excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,encoding:e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??a3t,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(n.usePCRE2=this.query.usePCRE2),n}}function bti(s){return{isCaseSensitive:s.isCaseSensitive||!1,isRegExp:s.isRegExp||!1,isWordMatch:s.isWordMatch||!1,isMultiline:s.isMultiline||!1,pattern:s.pattern}}class wti{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new AIe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!ji(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(yti(e))}pushToCollector(){const e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}}function yti(s){return VV(s)?{preview:{matches:n8(s.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:s.preview.text},ranges:n8(s.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:s.text,lineNumber:s.lineNumber}}function VV(s){return!!s.preview}const SO=class SO{constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},SO.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=0))}};SO.TIMEOUT=4e3,SO.START_BATCH_AFTER_COUNT=50;let AIe=SO;const uot=ae("IExtHostSearch");let EIe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Be.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new SIe}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,t),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);const i=this._handlePool++;return this._aiTextSearchProvider.set(i,t),this._proxy.$registerAITextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,t),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}$provideFileSearchResults(e,t,i,n){const o=Jue(i),r=this._fileSearchProvider.get(e);if(r)return this._fileSearchManager.fileSearch(o,r,a=>{this._proxy.$handleFileMatch(e,t,a.map(c=>c.resource))},n);throw new Error("3 unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,i){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,i,n){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const r=Jue(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$provideAITextSearchResults(e,t,i,n){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const r=Jue(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new P9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new P9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};EIe=D([_(0,Jo),_(1,sle),_(2,Ge)],EIe);function Jue(s){return{...s,folderQueries:s.folderQueries&&s.folderQueries.map(Cti),extraFileResources:s.extraFileResources&&s.extraFileResources.map(e=>N.revive(e))}}function Cti(s){return{...s,folder:N.revive(s.folder)}}var xIe,lM;let DIe=(lM=class{getState(){const e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e){this._onDidChangeWindowState=new I,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=xIe.InitialState,this._proxy=e.getProxy(Be.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:t,isActive:i})=>{this.onDidChangeWindowProperty("focused",t),this.onDidChangeWindowProperty("active",i)})}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let i;if(typeof e=="string"){i=e;try{e=N.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Gu(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===pe.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Gu(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},xIe=lM,lM.InitialState={focused:!0,active:!0},lM);DIe=xIe=D([_(0,Jo)],DIe);const got=ae("IExtHostWindow");let one=class extends _Qe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Mo(i))),this._proxy=e.getProxy(Be.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(N.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new Sti(this._proxy,e,t,i)}};one=D([_(0,Jo),_(1,_u)],one);class Sti extends rae{constructor(e,t,i,n){super(n?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,n).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){const i=[[e,t]];this.isLoggerCreated?this.doLog(i):this.buffer.push(...i)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}}const fot=ae("IExtHostTerminalShellIntegration");let kIe=class extends V{constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=new I,this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=new I,this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=new I,this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(Be.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,n]of this._activeShellIntegrations)n.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let n=this._activeShellIntegrations.get(e);n||(n=new Ati(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,n),n.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),n.store.add(n.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),n.store.add(n.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),n.store.add(n.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=n.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:n.value})}$shellExecutionStart(e,t,i,n,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.startShellExecution(r,N.revive(o))}$shellExecutionEnd(e,t,i,n,o){const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(N.revive(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};kIe=D([_(0,Jo),_(1,JU)],kIe);class Ati extends V{get currentExecution(){return this._currentExecution}constructor(e,t){super(),this._terminal=e,this._onDidStartTerminalShellExecution=t,this._ignoreNextExecution=!1,this.store=this._register(new Z),this._onDidRequestChangeShellIntegration=this._register(new I),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new I),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new I),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event;const i=this;this.value={get cwd(){return i._cwd},executeCommand(n,o){let r=n;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:mD.High,isTrusted:!0},c=i.startShellExecution(a,i._cwd,!0).value;return i._ignoreNextExecution=!0,c}}}startShellExecution(e,t,i){if(this._ignoreNextExecution&&this._currentExecution)this._ignoreNextExecution=!1;else{this._currentExecution&&(this._currentExecution.endExecution(void 0),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0}));const n=this._currentExecution=new Eti(e,t??this._cwd);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:n.value})):this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}return this._currentExecution}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){this._currentExecution&&(this._currentExecution.endExecution(e),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:t}),this._currentExecution=void 0)}setCwd(e){let t=!1;N.isUri(this._cwd)?t=!N.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value}))}}class Eti{constructor(e,t){this._commandLine=e,this.cwd=t,this._ended=!1;const i=this;this.value={get commandLine(){return i._commandLine},get cwd(){return i.cwd},read(){return i._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._ended)return Qd.EMPTY;this._dataStream=new xti}return this._dataStream.createIterable()}emitData(e){this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._dataStream=void 0,this._ended=!0}}class xti extends V{constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new qd);const e=this._barrier;return new Qd(async i=>{this._emitters.push(i),await e.wait()})}emitData(e){for(const t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open(),this._barrier=void 0}}ce(FPe,fIe,qt.Delayed);ce(uf,one,qt.Delayed);ce(rle,eIe,qt.Delayed);ce(YN,Qke,qt.Eager);ce(MPe,hIe,qt.Eager);ce(NPe,gIe,qt.Eager);ce(rE,Kke,qt.Eager);ce(nle,Vke,qt.Eager);ce(cle,wIe,qt.Eager);ce(hot,CIe,qt.Eager);ce(Zst,Gke,qt.Eager);ce(YU,Jke,qt.Eager);ce(OPe,pIe,qt.Eager);ce(jU,Cei,qt.Eager);ce(Jst,zke,qt.Delayed);ce(uot,EIe,qt.Eager);ce(LPe,sot,qt.Eager);ce(not,rIe,qt.Eager);ce(JU,Zke,qt.Eager);ce(fot,kIe,qt.Eager);ce(bPe,sDe,qt.Eager);ce(got,DIe,qt.Eager);ce(oE,$ke,qt.Eager);ce(PPe,rot,qt.Eager);ce(ole,qke,qt.Eager);ce(fG,aIe,qt.Eager);ce(BPe,vIe,qt.Eager);let IIe=class extends MYe{constructor(e,t,i){const n=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(578,"Extension Host (Remote)"):e?g(579,"Extension Host (Worker)"):g(580,"Extension Host");super(t.createLogger(n,{name:o}))}};IIe=D([_(1,uf),_(2,_u)],IIe);class F9e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ge),n=e.get(Jo).getProxy(Be.MainThreadErrors);qge(o=>{t.error(o);const r=SA(o);n.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ge),i=e.get(Jo),n=e.get(MI),o=e.get(ole),r=i.getProxy(Be.MainThreadExtensionService),a=i.getProxy(Be.MainThreadErrors),c=await n.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,b;for(const y of p)m+=` + at ${y.toString()}`,b=y.getFileName(),!v&&b&&(v=c.findSubstr(N.file(b)));const w=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:w}),w}const h=Symbol("prepareStackTrace wrapped");let u=d;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return u},set(f){if(f===d||!f||f[h]){u=f||d;return}u=function(p,m){return d(p,m),f.call(Error,p,m)},Object.assign(u,{[h]:!0})}}),qge(f=>{t.error(f);const p=SA(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}r.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=o.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class HPe{constructor(e,t,i,n,o){this._hostUtils=i,this._rpcProtocol=new pee(e,null,n),t=HPe._transform(t,this._rpcProtocol);const r=new Uc(...Spe());r.set(_u,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(Jo,new Pjt(this._rpcProtocol)),r.set(sle,new Aei(n)),r.set(aot,i),r.set(Ge,new wi(IIe,[!0],!0)),r.set(uf,new wi(one,[],!0));const a=new T3(r,!0);c8&&a.invokeFunction(F9e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ge)),cs("code/extHost/didCreateServices"),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info("Extension host started"),this._logService.trace("initData",t),this._extensionService=a.invokeFunction(c=>c.get(MI)),this._extensionService.initialize(),c8&&a.invokeFunction(F9e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Be.MainThreadExtensionService);return N.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Be.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[N.revive(t),N.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(n=>{n.extensionLocation=N.revive(t.transformIncomingURIs(n.extensionLocation))}),e.environment.appRoot=N.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(n=>N.revive(t.transformIncomingURIs(n)))),e.environment.extensionTestsLocationURI=N.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=N.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=N.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=N.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=N.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=N.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class Dti{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const n=this._relatedInformationProviders.get(e);if(!n)throw new Error("related information provider not found");return await n.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(n,i),this._proxy.$registerAiRelatedInformationProvider(n,t),new Qs(()=>{this._proxy.$unregisterAiRelatedInformationProvider(n),this._relatedInformationProviders.delete(n)})}}const kti=[new gn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of DocumentHighlight-instances.",fv(OH.to))),new gn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[ht.Uri],new nn("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(s,e)=>{if(uU(s))return;class t extends tH{static to(n){const o=new t(n.name,iv.to(n.kind),n.containerName||"",new yp(e[0],et.to(n.range)));return o.detail=n.detail,o.range=o.location.range,o.selectionRange=et.to(n.selectionRange),o.children=n.children?n.children.map(t.to):[],o}}return s.map(t.to)})),new gn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[ht.Uri,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[ht.Uri,ht.Range,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[ht.Uri,ht.Position,new ht("ch","Trigger character",s=>typeof s=="string",s=>s),new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",fv(hf.to))),new gn("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",fv(hf.to))),new gn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",fv(w$.to))),new gn("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",fv(w$.to))),new gn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[ht.Uri,new ht("position","A position in a text document",s=>Array.isArray(s)&&s.every(e=>bs.isPosition(e)),s=>s.map(Yo.from))],new nn("A promise that resolves to an array of ranges.",s=>s.map(e=>{let t;for(const i of e.reverse())t=new sH(et.to(i),t);return t}))),new gn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[ht.String.with("query","Search string")],new nn("A promise that resolves to an array of SymbolInformation-instances.",s=>s.map(v$.to))),new gn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of CallHierarchyItem-instances",s=>s.map(gN.to))),new gn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyIncomingCall-instances",s=>s.map(BEe.to))),new gn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",s=>s.map(WEe.to))),new gn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to a range and placeholder text.",s=>{if(s)return{range:et.to(s.range),placeholder:s.text}})),new gn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[ht.Uri,ht.Position,ht.String.with("newName","The new symbol name")],new nn("A promise that resolves to a WorkspaceEdit.",s=>{if(s){if(s.rejectReason)throw new Error(s.rejectReason);return Yu.to(s)}})),new gn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[ht.Uri,ht.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new nn("A promise that resolves to an array of DocumentLink-instances.",s=>s.map(XT.to))),new gn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new nte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=iZ(s);if(e.type==="full")return new aN(e.data,void 0)})),new gn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[ht.Uri,ht.Range.optional()],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new nte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[ht.Uri,ht.Range],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=iZ(s);if(e.type==="full")return new aN(e.data,void 0)})),new gn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),ht.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new nn("A promise that resolves to a CompletionList-instance.",(s,e,t)=>{if(!s)return new tN([]);const i=s.suggestions.map(n=>$Ee.to(n,t));return new tN(i,s.incomplete)})),new gn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new nn("A promise that resolves to SignatureHelp.",s=>{if(s)return y$.to(s)})),new gn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[ht.Uri,ht.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new nn("A promise that resolves to an array of CodeLens-instances.",(s,e,t)=>fv(i=>new P9(et.to(i.range),i.command&&t.fromInternal(i.command)))(s))),new gn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[ht.Uri,new ht("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",s=>Jn.isRange(s),s=>cC.isSelection(s)?Wb.from(s):et.from(s)),ht.String.with("kind","Code action kind to return code actions for").optional(),ht.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new nn("A promise that resolves to an array of Command-instances.",(s,e,t)=>fv(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const n=new N9(i.title,i.kind?new Sa(i.kind):void 0);return i.edit&&(n.edit=Yu.to(i.edit)),i.command&&(n.command=t.fromInternal(i.command)),n.isPreferred=i.isPreferred,n}})(s))),new gn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[ht.Uri],new nn("A promise that resolves to an array of ColorInformation objects.",s=>s?s.map(e=>new U9(et.to(e.range),BH.to(e.color))):[])),new gn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new ht("color","The color to show and insert",s=>s instanceof sN,BH.from),new ht("context","Context object with uri and range",s=>!0,s=>({uri:s.uri,range:et.from(s.range)}))],new nn("A promise that resolves to an array of ColorPresentation objects.",s=>s?s.map(Kte.to):[])),new gn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[ht.Uri,ht.Range],new nn("A promise that resolves to an array of Inlay objects",(s,e,t)=>s.map(GEe.to.bind(void 0,t)))),new gn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[ht.Uri],new nn("A promise that resolves to an array of FoldingRange objects",(s,e)=>{if(s)return s.map(Qte.to)})),new gn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new nn("A promise that resolves to an array of NotebookContentProvider static info objects.",fv(s=>({viewType:s.viewType,displayName:s.displayName,options:{transientOutputs:s.options.transientOutputs,transientCellMetadata:s.options.transientCellMetadata,transientDocumentMetadata:s.options.transientDocumentMetadata},filenamePattern:s.filenamePattern.map(e=>Jte.to(e))})))),new gn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[ht.Uri,ht.Range,new ht("context","An InlineValueContext",s=>s&&typeof s.frameId=="number"&&s.stoppedLocation instanceof Jn,s=>Hte.from(s))],new nn("A promise that resolves to an array of InlineValue objects",s=>s.map(Wte.to))),new gn("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new ht("uriOrString","Uri-instance or string (only http/https)",s=>N.isUri(s)||typeof s=="string"&&A8(s,pe.http,pe.https),s=>s),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[xl.from(s),void 0]:[xl.from(s.viewColumn),dz.from(s)])).optional(),ht.String.with("label","").optional()],nn.Void),new gn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[ht.Uri.with("resource","Resource to open"),ht.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[xl.from(s),void 0]:[xl.from(s.viewColumn),dz.from(s)])).optional()],nn.Void),new gn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[ht.Uri.with("left","Left-hand side resource of the diff editor"),ht.Uri.with("right","Right-hand side resource of the diff editor"),ht.String.with("title","Human readable title for the diff editor").optional(),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="object",s=>s&&[xl.from(s.viewColumn),dz.from(s)]).optional()],nn.Void),new gn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[ht.String.with("title","Human readable title for the changes editor"),new ht("resourceList","List of resources to compare",s=>{for(const e of s){if(e.length!==3)return!1;const[t,i,n]=e;if(!N.isUri(t)||!N.isUri(i)&&i!==void 0&&i!==null||!N.isUri(n)&&n!==void 0&&n!==null)return!1}return!0},s=>s)],nn.Void),new gn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[ht.TestItem],nn.Void),new gn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[ht.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],nn.Void),new gn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[ht.String.with("name","The context key name"),new ht("value","The context key value",()=>!0,s=>s)],nn.Void),new gn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[ht.Uri,ht.StringArray,new ht("MappedEditsContext","Mapped Edits Context",s=>Yte.is(s),s=>Yte.from(s))],new nn("A promise that resolves to a workspace edit or null",s=>s?Yu.to(s):null)),new gn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new ht("Run arguments","",s=>!0,s=>{if(s)return{initialRange:s.initialRange?et.from(s.initialRange):void 0,initialSelection:cC.isSelection(s.initialSelection)?Wb.from(s.initialSelection):void 0,message:s.message,autoSend:s.autoSend,position:s.position?Yo.from(s.position):void 0}})],nn.Void)];class Iti{static register(e){kti.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",Pat)}}function fv(s){return e=>{if(Array.isArray(e))return e.map(s)}}function mE(s){if(!Array.isArray(s))return;const e=[];for(const t of s)mGe(t)?e.push(b$.to(t)):e.push(hf.to(t));return e}let TIe=class{constructor(e,t){this._proxy=e.getProxy(Be.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const n=new jd(Yu.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(n,void 0,i?.isRefactoring??!1)}};TIe=D([_(0,Jo)],TIe);class Tti{constructor(e,t,i,n,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=n,this._sessionDisposables=o,this._stopWatch=js.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let t=function(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this;this._stopWatch.reset();const i=(n,o)=>{if(typeof this._firstProgress>"u"&&"content"in n&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,n),a={report:c=>{r?.then(l=>{l&&(df.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,k$.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,fA.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,nxe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,n)};this._apiObject={markdown(n){t(this.markdown);const o=new aG(n),r=E$.from(o);return i(r),this},markdownWithVulnerabilities(n,o){t(this.markdown),o&&Ve(e._extension,"chatParticipantAdditions");const r=new SH(n,o),a=nie.from(r);return i(a),this},filetree(n,o){t(this.filetree);const r=new cG(n,o),a=x$.from(r);return i(a),this},anchor(n,o){t(this.anchor);const r=new lG(n,o),a=D$.from(r);return i(a),this},button(n){t(this.anchor);const o=new dG(n),r=I$.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(n,o){t(this.progress);const r=new tPe(n,o),a=o?ixe.from(r):zH.from(r);return i(a,o),this},warning(n){t(this.progress),Ve(e._extension,"chatParticipantAdditions");const o=new xH(n),r=k$.from(o);return i(r),this},reference(n,o){return this.reference2(n,o)},reference2(n,o,r){if(t(this.reference),"variableName"in n&&Ve(e._extension,"chatParticipantAdditions"),"variableName"in n&&!n.value){const a=e._request.variables.variables.find(c=>c.name===n.variableName);if(a){let c;if(a.references?.length)c=a.references.map(l=>({kind:"reference",reference:{variableName:n.variableName,value:l.reference}}));else{const l=new kb(n,o,r);c=[fA.from(l)]}return c.forEach(l=>i(l)),this}}else{const a=new kb(n,o,r),c=fA.from(a);i(c)}return this},codeCitation(n,o,r){t(this.codeCitation),Ve(e._extension,"chatParticipantAdditions");const a=new d$(n,o,r),c=aie.from(a);i(c)},textEdit(n,o){t(this.textEdit),Ve(e._extension,"chatParticipantAdditions");const r=new DH(n,o),a=rie.from(r);return i(a),this},detectedParticipant(n,o){t(this.detectedParticipant),Ve(e._extension,"chatParticipantAdditions");const r=new AH(n,o),a=sie.from(r);return i(a),this},confirmation(n,o,r,a){t(this.confirmation),Ve(e._extension,"chatParticipantAdditions");const c=new l$(n,o,r,a),l=oie.from(c);return i(l),this},push(n){if(t(this.push),(n instanceof DH||n instanceof SH||n instanceof AH||n instanceof xH||n instanceof l$||n instanceof d$)&&Ve(e._extension,"chatParticipantAdditions"),n instanceof kb)this.reference2(n.value,n.iconPath,n.options);else{const o=cie.from(n,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const e8=class e8 extends V{constructor(e,t,i,n){super(),this._logService=t,this._commands=i,this._documents=n,this._agents=new Map,this._sessionDisposables=this._register(new mo),this._completionDisposables=this._register(new mo),this._proxy=e.getProxy(Be.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const n=e8._idPool++,o=new O9e(e,t,this._proxy,n,i);return this._agents.set(n,o),this._proxy.$registerAgent(n,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,n){const o=e8._idPool++,r=new O9e(e,t,this._proxy,o,n);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,n){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);const r=Mo(t);let a=this._sessionDisposables.get(r.sessionId);a||(a=new Z,this._sessionDisposables.set(r.sessionId,a));const c=new Tti(o.extension,r,this._proxy,this._commands.converter,a);try{const l=await this.prepareHistoryTurns(r.agentId,i);let d;if(r.locationData?.type===Ir.Editor){const u=this._documents.getDocument(r.locationData.document);d=new sPe(u,Wb.to(r.locationData.selection),et.to(r.locationData.wholeRange))}else if(r.locationData?.type===Ir.Notebook){const u=this._documents.getDocument(r.locationData.sessionInputUri);d=new oPe(u)}else r.locationData?.type,Ir.Terminal;const h=o.invoke(sxe.to(r,d),{history:l},c.apiObject,n);return await U_(Promise.resolve(h).then(u=>{if(u?.metadata)try{JSON.stringify(u.metadata)}catch(p){const m=`result.metadata MUST be JSON.stringify-able. Got error: ${p.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${m}`,o.extension),{errorDetails:{message:m},timings:c.timings}}let f;return u?.errorDetails&&(f={...u.errorDetails,responseIsIncomplete:!0}),f?.responseIsRedacted&&Ve(o.extension,"chatParticipantPrivate"),{errorDetails:f,timings:c.timings,metadata:u?.metadata}}),n)}catch(l){return this._logService.error(l,o.extension),l instanceof Mw&&l.cause&&(l=l.cause),{errorDetails:{message:Nr(l),responseIsIncomplete:!0}}}finally{c.close()}}async prepareHistoryTurns(e,t){const i=[];for(const n of t.history){const o=cB.to(n.result),r=e===n.request.agentId?o:{...o,metadata:void 0},a=n.request.variables.variables.filter(l=>!l.isTool).map(lie.to);i.push(new iPe(n.request.message,n.request.command,a,n.request.agentId));const c=Fi(n.response.map(l=>cie.toContent(l,this._commands.converter)));i.push(new nPe(c,r,n.request.agentId,n.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,n,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=Mo(e),c=await this.prepareHistoryTurns(r.id,n),l=cB.to(i);return(await r.provideFollowups(l,{history:c},o)).filter(d=>{const h=!d.participant||hi.some(this._agents.values(),u=>u.id===d.participant&&Sn.equals(u.extension.identifier,r.extension.identifier));return h||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${d.participant}`),h}).map(d=>A$.from(d,a))}$acceptFeedback(e,t,i,n){const o=this._agents.get(e);if(!o)return;const r=cB.to(t);let a;switch(i){case WW.Down:a=CH.Unhelpful;break;case WW.Up:a=CH.Helpful;break}o.acceptFeedback(Object.freeze(n?{result:r,kind:a,reportIssue:n}:{result:r,kind:a}))}$acceptAction(e,t,i){const n=this._agents.get(e);if(!n||i.action.kind==="vote")return;const o=rxe.to(t,i,this._commands.converter);o&&n.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const n=this._agents.get(e);if(!n)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await n.invokeCompletionProvider(t,i)).map(a=>oxe.from(a,this._commands.converter,o))}async $provideWelcomeMessage(e,t,i){const n=this._agents.get(e);if(n)return await n.provideWelcomeMessage(T$.to(t),i)}async $provideSampleQuestions(e,t,i){const n=this._agents.get(e);if(n)return(await n.provideSampleQuestions(T$.to(t),i)).map(o=>A$.from(o,void 0))}};e8._idPool=0;let LIe=e8;class O9e{constructor(e,t,i,n,o){this.extension=e,this.id=t,this._proxy=i,this._handle=n,this._requestHandler=o,this._onDidReceiveFeedback=new I,this._onDidPerformAction=new I}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const n=await this._followupProvider.provideFollowups(e,t,i);return n?n.filter(o=>!(o&&"commandId"in o)).filter(o=>!(o&&"message"in o)):[]}async provideWelcomeMessage(e,t){if(!this._welcomeMessageProvider)return[];const i=await this._welcomeMessageProvider.provideWelcomeMessage(e,t);return i?i.map(n=>typeof n=="string"?n:Ps.from(n)):[]}async provideSampleQuestions(e,t){if(!this._welcomeMessageProvider||!this._welcomeMessageProvider.provideSampleQuestions)return[];const i=await this._welcomeMessageProvider.provideSampleQuestions(e,t);return i||[]}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof N?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof uu?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Ps.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Ps.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Ps.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1}))},n=this;return{get id(){return n.id},get iconPath(){return n._iconPath},set iconPath(o){n._iconPath=o,i()},get requestHandler(){return n._requestHandler},set requestHandler(o){Tt(typeof o=="function","Invalid request handler"),n._requestHandler=o},get followupProvider(){return n._followupProvider},set followupProvider(o){n._followupProvider=o,i()},get isDefault(){return Ve(n.extension,"defaultChatParticipant"),n._isDefault},set isDefault(o){Ve(n.extension,"defaultChatParticipant"),n._isDefault=o,i()},get helpTextPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix},set helpTextPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix},set helpTextPostfix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix=o,i()},get isSecondary(){return Ve(n.extension,"defaultChatParticipant"),n._isSecondary},set isSecondary(o){Ve(n.extension,"defaultChatParticipant"),n._isSecondary=o,i()},get supportIssueReporting(){return Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting},set supportIssueReporting(o){Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return n._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");n._proxy.$registerAgentCompletionsProvider(n._handle,n.id,o.triggerCharacters)}else n._proxy.$unregisterAgentCompletionsProvider(n._handle,n.id)},get participantVariableProvider(){return Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider},set welcomeMessageProvider(o){Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider},onDidPerformAction:dl(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){n._requester=o,i()},get requester(){return n._requester},set supportsSlowReferences(o){Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences},dispose(){e=!0,n._followupProvider=void 0,n._onDidReceiveFeedback.dispose(),n._proxy.$unregisterAgent(n._handle)}}}invoke(e,t,i,n){return this._requestHandler(e,t,i,n)}}const are=class are{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Be.MainThreadChatVariables)}async $resolveVariable(e,t,i,n){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Ve(o.extension,"chatParticipantAdditions");const r=new Lti(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,n);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},n);if(r&&r[0])return r[0].value}}catch(r){No(r)}}registerVariableResolver(e,t,i,n,o,r,a,c,l){const d=are._idPool++,h=l?We.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:n,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:n,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}};are._idPool=0;let RIe=are;class Lti{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this,i=n=>{this._proxy.$handleProgressChunk(this._requestId,n)};this._apiObject={progress(n){t(this.progress);const o=new EH(n),r=zH.from(o);return i(r),this},reference(n){t(this.reference);const o=new kb(n),r=fA.from(o);return i(r),this},push(n){return t(this.push),n instanceof kb?i(fA.from(n)):n instanceof EH&&i(zH.from(n)),this}}}return this._apiObject}}class Rti{constructor(e){const t=e.getProxy(Be.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const pot="vscode-cdn.net",Mti=`vscode-resource.${pot}`,MIe=`'self' https://*.${pot}`;function Dz(s,e){return s.scheme===pe.http||s.scheme===pe.https?s:(e&&e.authority&&e.isRemote&&s.scheme===pe.file&&(s=N.from({scheme:pe.vscodeRemote,authority:e.authority,path:s.path})),N.from({scheme:pe.https,authority:`${s.scheme}+${Nti(s.authority)}.${Mti}`,path:s.path,fragment:s.fragment,query:s.query}))}function Nti(s){return s.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=B.a&&t<=B.z||t>=B.A&&t<=B.Z||t>=B.Digit0&&t<=B.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class Pti{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new Z,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const n=t.getVisibleTextEditors();for(const o of this._insets.values())n.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,n,o){let r;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){r=f;break}if(!r)throw new Error("not a visible editor");const a=this,c=this._handlePool++,l=new I,d=new I,h=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(f){return Dz(f,a._remoteInfo)}get cspSource(){return MIe}set options(f){this._options=f,a._proxy.$setOptions(c,f)}get options(){return this._options}set html(f){this._html=f,a._proxy.$setHtml(c,f)}get html(){return this._html}get onDidReceiveMessage(){return l.event}postMessage(f){return a._proxy.$postMessage(c,f)}},u=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=h,this.onDidDispose=d.event}dispose(){a._insets.has(c)&&(a._insets.delete(c),a._proxy.$disposeEditorInset(c),d.fire(),d.dispose(),l.dispose())}};return this._proxy.$createEditorInset(c,r.id,r.value.document.uri,t+1,i,n||{},o.identifier,o.extensionLocation),this._insets.set(c,{editor:e,inset:u,onDidReceiveMessage:l}),u}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}function Fti(s,e,t){const i=s.getProxy(Be.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new va,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===ws.CommentController){const b=this._commentControllers.get(v.handle);return b?b.value:v}else if(v&&v.$mid===ws.CommentThread){const b=v,w=this._commentControllers.get(b.commentControlHandle);if(!w)return b;const y=w.getCommentThread(b.commentThreadHandle);return y?y.value:b}else if(v&&(v.$mid===ws.CommentThreadReply||v.$mid===ws.CommentThreadInstance)){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);return w?v.$mid===ws.CommentThreadInstance?w.value:{thread:w.value,text:v.text}:v}else if(v&&v.$mid===ws.CommentNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.commentUniqueId,C=w.getCommentByUniqueId(y);return C||v}else if(v&&v.$mid===ws.CommentThreadNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.text,C=v.commentUniqueId,A=w.getCommentByUniqueId(C);return A?(typeof A.body=="string"?A.body=y:A.body=new df(y),A):v}return v}})}createCommentController(v,b,w){const y=f.handlePool++,C=new r(v,y,b,w);this._commentControllers.set(C.handle,C);const A=this._commentControllersByExtension.get(v.identifier)||[];return A.push(C),this._commentControllersByExtension.set(v.identifier,A),C.value}async $createCommentThreadTemplate(v,b,w,y){const C=this._commentControllers.get(v);C&&C.$createCommentThreadTemplate(b,w,y)}async $setActiveComment(v,b){const w=this._commentControllers.get(v);w&&w.$setActiveComment(b??void 0)}async $updateCommentThreadTemplate(v,b,w){const y=this._commentControllers.get(v);y&&y.$updateCommentThreadTemplate(b,w)}$deleteCommentThread(v,b){this._commentControllers.get(v)?.$deleteCommentThread(b)}async $provideCommentingRanges(v,b,w){const y=this._commentControllers.get(v);if(!y||!y.commentingRangeProvider)return Promise.resolve(void 0);const C=await t.ensureDocumentData(N.revive(b));return jh(async()=>{const A=await y.commentingRangeProvider.provideCommentingRanges(C.document,w);let L;return Array.isArray(A)?L={ranges:A,fileComments:!1}:A?L={ranges:A.ranges||[],fileComments:A.enableFileComments||!1}:L=A??void 0,L}).then(A=>{let L;return A&&(L={ranges:A.ranges.map(k=>et.from(k)),fileComments:A.fileComments}),L})}$toggleReaction(v,b,w,y,C){const A=this._commentControllers.get(v);return!A||!A.reactionHandler?Promise.resolve(void 0):jh(()=>{const L=A.getCommentThread(b);if(L){const k=L.getCommentByUniqueId(y.uniqueIdInThread);if(A!==void 0&&k&&A.reactionHandler)return A.reactionHandler(k,l(C))}return Promise.resolve(void 0)})}};f.handlePool=0;let n=f;const p=class p{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire()}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?(Ve(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,b,w,y,C,A,L,k,P){this._commentControllerHandle=b,this._id=w,this._uri=y,this._range=C,this._comments=A,this.extensionDescription=L,this._isTemplate=k,this.handle=p._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new I,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new wn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(b,this.handle,this._id,this._uri,et.from(this._range),this._comments.map(z=>a(this,z,this._commentsMap,this.extensionDescription)),L.identifier,this._isTemplate,P),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(b,this.handle)}});const R=this;this.value={get uri(){return R.uri},get range(){return R.range},set range(z){R.range=z},get comments(){return R.comments},set comments(z){R.comments=z},get collapsibleState(){return R.collapsibleState},set collapsibleState(z){R.collapsibleState=z},get canReply(){return R.canReply},set canReply(z){R.canReply=z},get contextValue(){return R.contextValue},set contextValue(z){R.contextValue=z},get label(){return R.label},set label(z){R.label=z},get state(){return R.state},set state(z){R.state=z},reveal:(z,G)=>R.reveal(z,G),hide:()=>R.hide(),dispose:()=>{R.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new Z);const v=w=>Object.prototype.hasOwnProperty.call(this.modifications,w),b={};v("range")&&(b.range=et.from(this._range)),v("label")&&(b.label=this.label),v("contextValue")&&(b.contextValue=this.contextValue??null),v("comments")&&(b.comments=this._comments.map(w=>a(this,w,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(b.collapseState=d(this._collapseState)),v("canReply")&&(b.canReply=this.canReply),v("state")&&(b.state=h(this._state)),v("applicability")&&(b.applicability=u(this._state)),v("isTemplate")&&(b.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,b)}getCommentByUniqueId(v){for(const b of this._commentsMap){const w=b[0],y=b[1];if(v===y)return w}}async reveal(v,b){Ve(this.extensionDescription,"commentReveal");let w;v&&v.body!==void 0?w=v:b=b??v;let y=w?this._commentsMap.get(w):void 0;y??=this._commentsMap.get(this._comments[0]);let C=!0,A=!1;return b?.focus===_H.Reply?(A=!0,C=!1):b?.focus===_H.Comment&&(C=!1),i.$revealCommentThread(this._commentControllerHandle,this.handle,y,{preserveFocus:C,focusReply:A})}async hide(){return i.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};p._handlePool=0;let o=p;class r{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&Ve(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return Ve(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Ve(this._extension,"activeComment"),this._activeThread}constructor(v,b,w,y){this._extension=v,this._handle=b,this._id=w,this._label=y,this._threads=new Map,i.$registerCommentController(this.handle,w,y,this._extension.identifier.value);const C=this;this.value=Object.freeze({id:C.id,label:C.label,get options(){return C.options},set options(A){C.options=A},get commentingRangeProvider(){return C.commentingRangeProvider},set commentingRangeProvider(A){C.commentingRangeProvider=A},get reactionHandler(){return C.reactionHandler},set reactionHandler(A){C.reactionHandler=A},get activeCommentThread(){return C.activeCommentThread},createCommentThread(A,L,k){return C.createCommentThread(A,L,k).value},dispose:()=>{C.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,b,w){b===void 0&&Ve(this._extension,"fileComments");const y=new o(this.id,this.handle,void 0,v,b,w,this._extension,!1);return this._threads.set(y.handle,y),y}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const b=this._threads.get(v.commentThreadHandle);b&&(this._activeComment=v.uniqueIdInThread?b.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=b)}$createCommentThreadTemplate(v,b,w){const y=new o(this.id,this.handle,void 0,N.revive(v),et.to(b),[],this._extension,!0,w);return y.collapsibleState=Lc.Expanded,this._threads.set(y.handle,y),y}$updateCommentThreadTemplate(v,b){const w=this._threads.get(v);w&&(w.range=et.to(b))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(m,v,b,w){let y=b.get(v);return y||(y=++m.commentHandle,b.set(v,y)),v.state!==void 0&&Ve(w,"commentsDraftState"),v.reactions?.some(C=>C.reactors!==void 0)&&Ve(w,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:y,body:typeof v.body=="string"?v.body:Ps.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(C=>c(C)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?Qce(m.iconPath):void 0,count:m.count,hasReacted:m.authorHasReacted,reactors:m.reactors&&m.reactors.length>0&&typeof m.reactors[0]!="string"?m.reactors.map(v=>v.name):m.reactors}}function l(m){return{label:m.label||"",count:m.count||0,iconPath:m.iconPath?N.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case fH.Expanded:return Lc.Expanded;case fH.Collapsed:return Lc.Collapsed}return Lc.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case pH.Unresolved:return ru.Unresolved;case pH.Resolved:return ru.Resolved}return ru.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case mH.Current:return Xx.Current;case mH.Outdated:return Xx.Outdated}return Xx.Current}return new n}var J1,X1,w7,y7,C7,Pw,Z1,eT,tT,iT,S7,ZB,nT;class Oti{constructor(e,t,i,n,o,r,a){Wt(this,J1);Wt(this,X1);Wt(this,w7);Wt(this,y7);Wt(this,C7);Wt(this,Pw);Wt(this,Z1);Wt(this,eT);Wt(this,tT);Wt(this,iT);Wt(this,S7);Wt(this,ZB);Wt(this,nT);Ct(this,Z1,""),Ct(this,tT,!1),Ct(this,iT,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,Ct(this,nT,new I),this._onDidDispose=Ce(this,nT).event,Ct(this,J1,e),Ct(this,X1,t),Ct(this,eT,i),Ct(this,y7,n),Ct(this,C7,o),Ct(this,Pw,r),Ct(this,S7,QH(r)),Ct(this,ZB,Bti(r)),Ct(this,w7,a)}dispose(){Ct(this,tT,!0),Ce(this,nT).fire(),Ce(this,nT).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return Ct(this,iT,!0),Dz(e,Ce(this,y7))}get cspSource(){const e=Ce(this,Pw).extensionLocation;if(e.scheme===pe.https||e.scheme===pe.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+MIe}return MIe}get html(){return this.assertNotDisposed(),Ce(this,Z1)}set html(e){this.assertNotDisposed(),Ce(this,Z1)!==e&&(Ct(this,Z1,e),Ce(this,ZB)&&!Ce(this,iT)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(Ct(this,iT,!0),Ce(this,w7).report("Webview vscode-resource: uris",Ce(this,Pw),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),Ce(this,X1).$setHtml(Ce(this,J1),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),Ce(this,eT)}set options(e){this.assertNotDisposed(),Ys(Ce(this,eT),e)||Ce(this,X1).$setOptions(Ce(this,J1),mot(Ce(this,Pw),Ce(this,C7),e)),Ct(this,eT,e)}async postMessage(e){if(Ce(this,tT))return!1;const t=xnt(e,{serializeBuffersForPostMessage:Ce(this,S7)});return Ce(this,X1).$postMessage(Ce(this,J1),t.message,...t.buffers)}assertNotDisposed(){if(Ce(this,tT))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!Ce(this,ZB))return e;const t=Ce(this,Pw).extensionLocation?.scheme===pe.vscodeRemote,i=Ce(this,Pw).extensionLocation.scheme===pe.vscodeRemote?Ce(this,Pw).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Dz(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Dz(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}J1=new WeakMap,X1=new WeakMap,w7=new WeakMap,y7=new WeakMap,C7=new WeakMap,Pw=new WeakMap,Z1=new WeakMap,eT=new WeakMap,tT=new WeakMap,iT=new WeakMap,S7=new WeakMap,ZB=new WeakMap,nT=new WeakMap;function QH(s){try{const e=D9(x9(s.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function Bti(s){try{const e=D9(x9(s.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class Wti extends V{constructor(e,t,i,n,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=n,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Be.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const n=this.getWebview(e);if(n){const{message:o}=Dnt(t,i.value);n._onMessageEmitter.fire(o)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const n=new Oti(e,this._webviewProxy,Hti(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,n);const o=n._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return n}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function rne(s){return{id:s.identifier,location:s.extensionLocation}}function mot(s,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||Uti(s,e)}}function Hti(s){return{enableCommandUris:s.enableCommandUris,enableScripts:s.enableScripts,enableForms:s.enableForms,portMapping:s.portMapping,localResourceRoots:s.localResourceRoots?.map(e=>N.from(e))}}function Uti(s,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),s.extensionLocation]}const cre=class cre{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){cre.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};cre.enableDebugLogging=!1;let ym=cre;class Vti{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new ym("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=Qti(this.document.uri)+this._backupCounter++;return Pt(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class zti{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const n=this.key(e,t.uri);if(this._documents.has(n))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new Vti(t,i);return this._documents.set(n,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var qx;(function(s){s[s.Text=0]="Text",s[s.Custom=1]="Custom"})(qx||(qx={}));class $ti{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:qx.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:qx.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new Qs(()=>this._providers.delete(e))}}class Gti{constructor(e,t,i,n,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=n,this._extHostWebviewPanels=o,this._editorProviders=new $ti,this._documents=new zti,this._proxy=e.getProxy(Be.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,n){const o=new Z;return Kti(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(rne(e),t,n.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},QH(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),$K(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(qti(r)){const c=a.addEdit(r);this._proxy.$onDidEdit(r.document.uri,t,c,r.label)}else this._proxy.$onContentChange(r.document.uri,t)})),this._proxy.$registerCustomEditorProvider(rne(e),t,n.webviewOptions||{},!!n.supportsMultipleEditorsPerDocument,QH(e))),Qs.from(o,new Qs(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,n,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==qx.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=N.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:n?.buffer},o);let l;return $K(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:$K(r.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==qx.Custom)throw new Error(`Invalid provider type for '${t}'`);const n=N.revive(e),{document:o}=this.getCustomDocumentEntry(t,n);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,n,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=xl.to(o),l=this._extHostWebview.createNewWebview(t,n.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,n.title,c,n.options,l,n.active),h=N.revive(e);switch(a.type){case qx.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case qx.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,r)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const n=this._editorProviders.get(i);if(!n)throw new Error(`No provider found for '${i}'`);if(!n.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const o=this._extHostWebviewPanels.getWebviewPanel(e);if(!o)throw new Error("No webview found");const r=N.revive(t),a=this._extHostDocuments.getDocument(r);await n.provider.moveCustomTextEditor(a,o,He.None)}async $undo(e,t,i,n){return this.getCustomDocumentEntry(t,e).undo(i,n)}async $redo(e,t,i,n){return this.getCustomDocumentEntry(t,e).redo(i,n)}async $revert(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(n.document,i),n.disposeBackup()}async $onSave(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(n.document,i),n.disposeBackup()}async $onSaveAs(e,t,i,n){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,N.revive(i),n)}async $backup(e,t,i){const n=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(n.document,{destination:n.getNewBackupUri()},i);return n.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,N.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!$K(i))throw new Error("Custom document is not editable");return i}}function $K(s){return!!s.onDidChangeCustomDocument}function Kti(s){return typeof s.resolveCustomTextEditor=="function"}function qti(s){return typeof s.undo=="function"&&typeof s.redo=="function"}function Qti(s){const e=s.scheme===pe.file||s.scheme===pe.untitled?s.fsPath:s.toString();return Wc(e)+""}var I0,tS,dx,Ed;const hFe=class hFe{constructor(e,t,i,n,o,r,a,c){Wt(this,tS);Wt(this,dx);Wt(this,Ed);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=n,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(n,i),Ct(this,Ed,new ui(l=>r.getComparisonKey(l))),Ct(this,tS,a),Ct(this,dx,c)}dispose(){this._isDisposed||(Ce(this,dx).fire([...Ce(this,Ed).keys()]),Ce(this,tS)?.$clear(this._owner),Ce(this,Ed).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(N.isUri(e)){if(!t){this.delete(e);return}Ce(this,Ed).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(hFe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&Ce(this,Ed).get(r).length===0&&Ce(this,Ed).delete(r),r=c,i.push(c),Ce(this,Ed).set(c,[])),l)Ce(this,Ed).get(c)?.push(...l);else{const d=Ce(this,Ed).get(c);d&&(d.length=0)}}}if(Ce(this,dx).fire(i),!Ce(this,tS))return;const n=[];let o=0;for(const r of i){let a=[];const c=Ce(this,Ed).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Bd.Error,Bd.Warning,Bd.Information,Bd.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...PH.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ws.Info,message:g(4582,"Not showing {0} further errors and warnings.",c.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=c.map(l=>({...PH.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(n.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}Ce(this,tS).$changeMany(this._owner,n)}delete(e){this._checkDisposed(),Ce(this,dx).fire([e]),Ce(this,Ed).delete(e),Ce(this,tS)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),Ce(this,dx).fire([...Ce(this,Ed).keys()]),Ce(this,Ed).clear(),Ce(this,tS)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,n]of this)e.call(t,i,n,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of Ce(this,Ed).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=Ce(this,Ed).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(Ce(this,Ed).get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()t[0].toString()?1:0}};tS=new WeakMap,dx=new WeakMap,Ed=new WeakMap;let ane=hFe;var uy;let NIe=(uy=class{static _mapper(e){const t=new ui;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,n){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=n,this._collections=new Map,this._onDidChangeDiagnostics=new Are({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=M.map(this._onDidChangeDiagnostics.event,I0._mapper),this._proxy=e.getProxy(Be.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:n,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){n.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){n.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){n.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+I0._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+I0._idPool++;while(i.has(d))}return new class extends ane{constructor(){super(t,d,I0._maxDiagnosticsTotal,I0._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,o),i.set(d,this)}dispose(){super.dispose(),i.delete(d)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const n of this._collections.values())n.forEach((o,r)=>{let a=t.get(o.toString());typeof a>"u"&&(a=i.length,t.set(o.toString(),a),i.push([o,[]])),i[a][1]=i[a][1].concat(...r)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new ane(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,n=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(N.revive(t),i.map(PH.to))}},I0=uy,uy._idPool=0,uy._maxDiagnosticsPerFile=1e3,uy._maxDiagnosticsTotal=1.1*uy._maxDiagnosticsPerFile,uy);NIe=I0=D([_(1,Ge),_(2,jU)],NIe);class jti{constructor(e){this._proxy=e.getProxy(Be.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Ve(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(n=>N.revive(n)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?N.revive(t):void 0)}}const lre=class lre{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Be.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(pe).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=lre._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let n;if(typeof t.onDidChange=="function"){let o;n=t.onDidChange(async r=>{if(r.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${r.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(r))return;o&&await o;const a=this.$provideTextDocumentContent(i,r).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(r);if(!l)return;const d=ov(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(vt).finally(()=>{o===a&&(o=void 0)});o=a})}return new Qs(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),n&&(n.dispose(),n=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(N.revive(t),He.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};lre._handlePool=0;let PIe=lre;class Yti{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._callbacks=new hl,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,n)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(n)&&n.push(r),r}}async $participateInSave(e,t){const i=N.revive(e);let n=!1;const o=setTimeout(()=>n=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(n)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:qte.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],n){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,n).then(()=>!0,r=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(r),!(r instanceof Error)||r.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,n){const o=[],r=Date.now(),{document:a,reason:c}=n,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw Cre("waitUntil can not be called async");o.push(Promise.resolve(h))}});try{t.apply(i,[d])}catch(h){return Promise.reject(h)}return new Promise((h,u)=>{const f=setTimeout(()=>u(new Error("timeout")),this._thresholds.timeout);return Promise.all(o).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-r}ms`),clearTimeout(f),h(p)}).catch(p=>{clearTimeout(f),u(p)})}).then(h=>{const u={edits:[]};for(const f of h)if(Array.isArray(f)&&f.every(p=>p instanceof VA))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&et.from(v),text:p,eol:m&&WH.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jd(u)):Promise.reject(new Error("concurrent_edits"))})}}class Jti{constructor(e,t){this._onDidAddDocument=new I,this._onDidRemoveDocument=new I,this._onDidChangeDocument=new I,this._onDidSaveDocument=new I,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new Z,this._documentLoader=new Map,this._proxy=e.getProxy(Be.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const n of i)this._onDidRemoveDocument.fire(n.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const n of i)this._onDidAddDocument.fire(n.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e){const t=this._documentsAndEditors.getDocument(e);if(t)return Promise.resolve(t);let i=this._documentLoader.get(e.toString());return i||(i=this._proxy.$tryOpenDocument(e).then(n=>{this._documentLoader.delete(e.toString());const o=N.revive(n);return qn(this._documentsAndEditors.getDocument(o))},n=>(this._documentLoader.delete(e.toString()),Promise.reject(n))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>N.revive(t))}$acceptModelLanguageChanged(e,t){const i=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");this._onDidRemoveDocument.fire(n.document),n._acceptLanguageId(t),this._onDidAddDocument.fire(n.document)}$acceptModelSaved(e){const t=N.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");n._acceptIsDirty(t),this._onDidChangeDocument.fire({document:n.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const n=N.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=aH.Undo:t.isRedoing&&(r=aH.Redo),this._onDidChangeDocument.fire(x6e({document:o.document,contentChanges:t.changes.map(a=>({range:et.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){Fei(e,t)}}class Xti{constructor(e){this._provider=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(Be.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const n=this._handlePool++;return this._proxy.$registerEmbeddingProvider(n,t),this._provider.set(n,{id:t,provider:i}),Ee(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(n),this._provider.delete(n)})}async computeEmbeddings(e,t,i){i??=He.None;let n=!1;typeof t=="string"&&(t=[t],n=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(n){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const n=this._provider.get(e);if(!n)return[];const o=await n.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Zti{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const n=this._AiEmbeddingVectorProviders.get(e);if(!n)throw new Error("Embedding vector provider not found");const o=await n.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(n,i),this._proxy.$registerAiEmbeddingVectorProvider(t,n),new Qs(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(n),this._AiEmbeddingVectorProviders.delete(n)})}}class eii{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,n,o=Ri.LastKnownState,r=Ri.LastKnownState;for(const a of e){let c=i?$y(i,a):0;for(c===0?n=Ri.Start:n=r;c{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(l)});const c=i.onDidChangeFile(l=>{const d=[];for(const h of l){const{uri:u,type:f}=h;if(u.scheme!==t)continue;let p;switch(f){case KT.Changed:p=To.UPDATED;break;case KT.Created:p=To.ADDED;break;case KT.Deleted:p=To.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(o,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(o),this._proxy.$unregisterProvider(o)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:n,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:n,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(N.revive(t))).then(i=>cne._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(N.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(N.revive(t))).then(i=>$e.wrap(i))}$writeFile(e,t,i,n){return Promise.resolve(this._getFsProvider(e).writeFile(N.revive(t),i.buffer,n))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(N.revive(t),i))}$rename(e,t,i,n){return Promise.resolve(this._getFsProvider(e).rename(N.revive(t),N.revive(i),n))}$copy(e,t,i,n){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(N.revive(t),N.revive(i),n))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(N.revive(t)))}$watch(e,t,i,n){const o=this._getFsProvider(e).watch(N.revive(i),n);this._watches.set(t,o)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const n=this._getFsProvider(e);if(!n.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(n.open(N.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,n){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=$e.alloc(n);return Promise.resolve(o.read(t,i,r.buffer,0,n)).then(a=>r.slice(0,a))}$write(e,t,i,n){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,n.buffer,0,n.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}class tii{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,n,o,r){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,r?.ignoreCreateEvents&&(this._config+=1),r?.ignoreChangeEvents&&(this._config+=2),r?.ignoreDeleteEvents&&(this._config+=4);const a=j_(o),c=typeof o=="string",l=r?.correlate,d=n(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!r?.ignoreCreateEvents)for(const u of h.created){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=Qs.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,n,o){const r=Qs.from();if(typeof i=="string"||n?.ignoreChangeEvents&&n?.ignoreCreateEvents&&n?.ignoreDeleteEvents)return r;const a=e.getProxy(Be.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(I1)||i.pattern.includes(Nme))&&(c=!0);let l;return o&&(n?.ignoreChangeEvents||n?.ignoreCreateEvents||n?.ignoreDeleteEvents)&&(l=LE.UPDATED|LE.ADDED|LE.DELETED,n?.ignoreChangeEvents&&(l&=~LE.UPDATED),n?.ignoreCreateEvents&&(l&=~LE.ADDED),n?.ignoreDeleteEvents&&(l&=~LE.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:n?.excludes??[],filter:l},!!o),Qs.from({dispose:()=>a.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class iii{constructor(e){this._events=e,this.session=this._events.session,this._created=new ya(()=>this._events.created.map(N.revive)),this._changed=new ya(()=>this._events.changed.map(N.revive)),this._deleted=new ya(()=>this._events.deleted.map(N.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class nii{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new I,this._onDidRenameFile=new I,this._onDidCreateFile=new I,this._onDidDeleteFile=new I,this._onWillRenameFile=new jx,this._onWillCreateFile=new jx,this._onWillDeleteFile=new jx,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,n){return new tii(this._mainContext,e,t,this._onFileSystemEvent.event,Gf.from(i),n)}$onFileEvent(e){this._onFileSystemEvent.fire(new iii(e))}$onDidRunFileOperation(e,t){switch(e){case Ai.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:N.revive(i.source),newUri:N.revive(i.target)}))}));break;case Ai.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break;case Ai.CREATE:case Ai.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,n,o)=>{const r=function(c){i.call(n,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,n){switch(e){case Ai.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:N.revive(o.source),newUri:N.revive(o.target)}))},i,n);case Ai.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>N.revive(o.target))},i,n);case Ai.CREATE:case Ai.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>N.revive(o.target))},i,n)}}async _fireWillEvent(e,t,i,n){const o=new Set,r=[];if(await e.fireAsync(t,n,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof hI&&(r.push([l.extension,h]),o.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),n.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=Yu.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class sii{constructor(e,t,i,n,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=n;const r=new gn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new ht("showOptions","Show Options",a=>!0,a=>a),new ht("resource","Interactive resource Uri",a=>!0,a=>a),new ht("controllerId","Notebook controller Id",a=>!0,a=>a),new ht("title","Interactive editor title",a=>!0,a=>a)],new nn("Notebook and input URI",a=>{if(o.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return o.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,n){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class oii{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Be.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}class lne{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentSymbols(i,t);if(!uU(n))return n[0]instanceof iH?n.map(OEe.from):lne._asDocumentSymbolTree(n)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((n,o)=>{let r=n.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(n.location.range.end)),r});const t=[],i=[];for(const n of e){const o={name:n.name||"!!MISSING: name!!",kind:iv.from(n.kind),tags:n.tags?.map(zA.from)||[],detail:"",containerName:n.containerName,range:et.from(n.location.range),selectionRange:et.from(n.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(F.containsRange(r.range,o.range)&&!F.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class GK{constructor(e,t,i,n,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=n,this._extTelemetry=o,this._logService=r,this._cache=new ym("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideCodeLenses(i,t);if(!n||t.isCancellationRequested)return;const o=this._cache.add(n),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;cWte.from(a))}}class $9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideDocumentHighlights(n,o,i);if(Array.isArray(r))return r.map(OH.from)}}class G9e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,n){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Yo.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,n);if(Array.isArray(c))return c.map(UEe.from)}}class K9e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideLinkedEditingRanges(n,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Fi(r.ranges.map(et.from)),wordPattern:r.wordPattern}}}class q9e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideReferences(o,r,i,n);if(Array.isArray(a))return a.map(hf.from)}}const AO=class AO{constructor(e,t,i,n,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=n,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new ym("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,n){const o=this._documents.getDocument(e),r=dt.isISelection(t)?Wb.to(t):et.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>AO._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Sa(i.only):void 0,triggerKind:txe.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,n);if(!eo(l)||n.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fet.to(l)),a=B_.toDataTransfer(i,()=>{throw new Irt});if(await this._provider.prepareDocumentPaste(o,r,a,n),n.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof jee));return B_.from(c)}async providePasteEdits(e,t,i,n,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>et.to(u)),l=B_.toDataTransfer(n,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new K9(o.only):void 0,triggerKind:o.triggerKind},r);if(!d||r.isCancellationRequested)return[];const h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(4583,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?Yu.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Yu.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class Q9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(n,t,i);if(Array.isArray(o))return o.map(od.from)}}class Xue{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,n){const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(od.from)}async provideDocumentRangesFormattingEdits(e,t,i,n){Tt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(et.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(od.from)}}class j9e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,n,o){const r=this._documents.getDocument(e),a=Yo.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,n,o);if(Array.isArray(c))return c.map(od.from)}}class KK{constructor(e,t){this._provider=e,this._logService=t,this._cache=new ym("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!eo(i))return{symbols:[]};const n=this._cache.add(i),o={cacheId:n,symbols:[]};for(let r=0;ro.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(t8._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};t8.languageTriggerKindToVSCodeTriggerKind={[mM.Invoke]:gH.Invoke,[mM.Automatic]:gH.Automatic};let Iz=t8;class Zue{constructor(e,t){this.resultId=e,this.tokens=t}}class Lf{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const n=this._documents.getDocument(e),o=t!==0?this._previousResults.get(t):null;let r=typeof o?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(n,o.resultId,i):await this._provider.provideDocumentSemanticTokens(n,i);return o&&this._previousResults.delete(t),r?(r=Lf._fixProvidedSemanticTokens(r),this._send(Lf._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Lf._isSemanticTokens(e)?Lf._isCorrectSemanticTokens(e)?e:new aN(new Uint32Array(e.data),e.resultId):Lf._isSemanticTokensEdits(e)?Lf._isCorrectSemanticTokensEdits(e)?e:new oz(e.edits.map(t=>new GNe(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!Lf._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,n=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(n,r);for(;a({start:n.start,deleteCount:n.deleteCount,data:n.data}))})}return null}}class Y9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(n,et.to(t),i);return o?this._send(o):null}_send(e){return d9({id:0,type:"full",data:e.data})}}class a1{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=n,this._extension=o,this._cache=new ym("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=o.getWordRangeAtPosition(r)||new Jn(r,r),c=a.with({end:r}),l=new js,d=await this._provider.provideCompletionItems(o,r,n,zEe.to(i));if(!d||n.isCancellationRequested)return;const h=Array.isArray(d)?new tN(d):d,u=a1.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[Ay.completions]:p,[Ay.defaultRanges]:{replace:et.from(a),insert:et.from(c)},[Ay.isIncomplete]:h.isIncomplete||void 0,[Ay.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Ps.fromStrict(e.documentation),[Li.sortText]:e.sortText!==e.label?e.sortText:void 0,[Li.filterText]:e.filterText!==e.label?e.filterText:void 0,[Li.preselect]:e.preselect||void 0,[Li.insertTextRules]:e.keepWhitespace?Yg.KeepWhitespace:Yg.None,[Li.commitCharacters]:e.commitCharacters?.join(""),[Li.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(od.from),[Li.commandIdent]:r?.$ident,[Li.commandId]:r?.id,[Li.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Li.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Li.insertText]=e.insertText:e.insertText instanceof uI&&(a[Li.insertText]=e.insertText.value,a[Li.insertTextRules]|=Yg.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),Jn.isRange(c)?a[Li.range]=et.from(c):c&&(!i?.isEqual(c.inserting)||!n?.isEqual(c.replacing))&&(a[Li.range]={insert:et.from(c.inserting),replace:et.from(c.replacing)}),a}}class jP{async provideInlineCompletions(e,t,i,n){}async provideInlineEdits(e,t,i,n){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,n){}}class rii extends jP{constructor(e,t,i,n){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=n,this._references=new _ot,this._isAdditionsProposedApiEnabled=dl(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[em.Automatic]:uH.Automatic,[em.Explicit]:uH.Invoke}}get supportsHandleEvents(){return dl(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},n);if(!a||n.isCancellationRequested)return;const c=Array.isArray(a)?a:a.items,l=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],d=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let h;return{pid:this._references.createReferenceId({dispose(){h?.dispose()},items:c}),items:c.map((f,p)=>{let m;f.command&&(h||(h=new Z),m=this._commands.toInternal(f.command,h));const v=f.insertText;return{insertText:typeof v=="string"?v:{snippet:v.value},filterText:f.filterText,range:f.range?et.from(f.range):void 0,command:m,idx:p,completeBracketPairs:this._isAdditionsProposedApiEnabled?f.completeBracketPairs:!1}}),commands:l.map(f=>(h||(h=new Z),this._commands.toInternal(f,h))),suppressSuggestions:!1,enableForwardStability:d}}async provideInlineEdits(e,t,i,n){if(!this._provider.provideInlineEdits)return;Ve(this._extension,"inlineCompletionsAdditions");const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideInlineEdits(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],userPrompt:i.userPrompt},n);if(!a||n.isCancellationRequested)return;const c=Array.isArray(a)?a:a.items,l=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],d=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let h;return{pid:this._references.createReferenceId({dispose(){h?.dispose()},items:c}),items:c.map((f,p)=>{let m;f.command&&(h||(h=new Z),m=this._commands.toInternal(f.command,h));const v=f.insertText;return{insertText:typeof v=="string"?v:{snippet:v.value},filterText:f.filterText,range:f.range?et.from(f.range):void 0,command:m,idx:p,completeBracketPairs:this._isAdditionsProposedApiEnabled?f.completeBracketPairs:!1}}),commands:l.map(f=>(h||(h=new Z),this._commands.toInternal(f,h))),suppressSuggestions:!1,enableForwardStability:d}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const n=this._references.get(e)?.items[t];n&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(n,i)}handlePartialAccept(e,t,i,n){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,axe.to(n)))}}class ege{async provideInlineEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(n,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!o||i.isCancellationRequested)return;let r;const a=this._references.createReferenceId({dispose(){r?.dispose()},item:o});let c;o.accepted&&(r||(r=new Z),c=this._commands.toInternal(o.accepted,r));let l;return o.rejected&&(r||(r=new Z),l=this._commands.toInternal(o.rejected,r)),{pid:a,text:o.text,range:et.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,n){this._documents=t,this._provider=i,this._commands=n,this._references=new _ot,this.languageTriggerKindToVSCodeTriggerKind={[L2.Automatic]:IH.Automatic,[L2.Invoke]:IH.Invoke}}}class _ot{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class tge{constructor(e,t){this._documents=e,this._provider=t,this._cache=new ym("SignatureHelp")}async provideSignatureHelp(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,n,a);if(c){const l=this._cache.add([c]);return{...y$.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=y$.to(e.activeSignatureHelp),n=this._cache.get(e.activeSignatureHelp.id,0);n?(t=n,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class qK{constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._logService=n,this._extension=o,this._cache=new ym("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const n=this._documents.getDocument(e),o=et.to(t),r=await this._provider.provideInlayHints(n,o,i);if(!Array.isArray(r)||r.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(r);this._disposables.set(a,new Z);const c={hints:[],cacheId:a};for(let l=0;li.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const n={label:"",cacheId:t,tooltip:Ps.fromStrict(e.tooltip),position:Yo.from(e.position),textEdits:e.textEdits&&e.textEdits.map(od.from),kind:e.kind&&Gte.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")n.label=e.label;else{const o=[];n.label=o;for(const r of e.label){if(!r.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:r.value,tooltip:Ps.fromStrict(r.tooltip)};yp.isLocation(r.location)&&(a.location=hf.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return n}}class Qx{constructor(e,t){this._documents=e,this._provider=t,this._cache=new ym("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(n)||n.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:n.filter(Qx._validateLink).map(XT.from)};{const o=this._cache.add(n),r={links:[],cacheId:o};for(let a=0;a5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const n=await this._provider.resolveDocumentLink(i,t);if(!(!n||!Qx._validateLink(n)))return XT.from(n)}releaseLinks(e){this._cache.delete(e)}}class ige{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentColors(i,t);return Array.isArray(n)?n.map(r=>({color:BH.from(r.color),range:et.from(r.range)})):[]}async provideColorPresentations(e,t,i){const n=this._documents.getDocument(e),o=et.to(t.range),r=BH.to(t.color),a=await this._provider.provideColorPresentations(r,{document:n,range:o},i);if(Array.isArray(a))return a.map(Kte.from)}}class J9e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(n,t,i);if(Array.isArray(o))return o.map(Qte.from)}}class X9e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const n=this._documents.getDocument(e),o=t.map(Yo.to),r=await this._provider.provideSelectionRanges(n,o,i);if(!eo(r))return[];if(r.length!==o.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let c=0;cthis._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideCallsTo(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(n,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>et.from(a))}))}async provideCallsFrom(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(n,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>et.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=gN.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class F4{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new DU(""),this._cache=new Map}async prepareSession(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.prepareTypeHierarchy(n,o,i);if(!r)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(r)?r.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideSupertypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(n,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(n,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=ZT.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class QK{constructor(e,t,i,n,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=n,this._extension=o,this._cache=new ym("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,n,o){const r=this._documents.getDocument(t),a=Yo.to(i),c=B_.toDataTransfer(n,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(r,a,c,o);if(!l)return;const d=H_(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(4584,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind?.value,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?Yu.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Yu.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class Z9e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,n){const o=N.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:N.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>et.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,n);return l?Yu.from(l):null}}class O4{constructor(e,t){this.adapter=e,this.extension=t}}const Yc=class Yc{constructor(e,t,i,n,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=n,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return NH.from(e,this._uriTransformer,t)}_createDisposable(e){return new Qs(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Yc._handlePool++}async _withAdapter(e,t,i,n,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return n;const c=Date.now();r||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const l=i(a.adapter,a.extension);return Promise.resolve(l).catch(d=>{Fr(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{r||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),He.isCancellationToken(o)?Mre(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new O4(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,n){const o=this._addNewAdapter(new lne(this._documents,i),e),r=n&&n.label||Yc._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,lne,n=>n.provideDocumentSymbols(N.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(n,new O4(new GK(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(n,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=Qs.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,GK,n=>n.provideCodeLenses(N.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,GK,n=>n.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,GK,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const n=this._addNewAdapter(new B9e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDefinition(e,t,i,n){return this._withAdapter(e,B9e,o=>o.provideDefinition(N.revive(t),i,n),[],n)}registerDeclarationProvider(e,t,i){const n=this._addNewAdapter(new W9e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDeclaration(e,t,i,n){return this._withAdapter(e,W9e,o=>o.provideDeclaration(N.revive(t),i,n),[],n)}registerImplementationProvider(e,t,i){const n=this._addNewAdapter(new H9e(this._documents,i),e);return this._proxy.$registerImplementationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideImplementation(e,t,i,n){return this._withAdapter(e,H9e,o=>o.provideImplementation(N.revive(t),i,n),[],n)}registerTypeDefinitionProvider(e,t,i){const n=this._addNewAdapter(new U9e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideTypeDefinition(e,t,i,n){return this._withAdapter(e,U9e,o=>o.provideTypeDefinition(N.revive(t),i,n),[],n)}registerHoverProvider(e,t,i,n){const o=this._addNewAdapter(new kz(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,n,o){return this._withAdapter(e,kz,r=>r.provideHover(N.revive(t),i,n,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,kz,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,n){const o=this._addNewAdapter(new V9e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,n){return this._withAdapter(e,V9e,o=>o.provideEvaluatableExpression(N.revive(t),i,n),void 0,n)}registerInlineValuesProvider(e,t,i,n){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new z9e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(r,this._transformDocumentSelector(t,e),o);let a=this._createDisposable(r);if(o!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(o));a=Qs.from(a,c)}return a}$provideInlineValues(e,t,i,n,o){return this._withAdapter(e,z9e,r=>r.provideInlineValues(N.revive(t),i,n,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new $9e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}registerMultiDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new G9e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentHighlights(e,t,i,n){return this._withAdapter(e,$9e,o=>o.provideDocumentHighlights(N.revive(t),i,n),void 0,n)}$provideMultiDocumentHighlights(e,t,i,n,o){return this._withAdapter(e,G9e,r=>r.provideMultiDocumentHighlights(N.revive(t),i,n.map(a=>N.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const n=this._addNewAdapter(new K9e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideLinkedEditingRanges(e,t,i,n){return this._withAdapter(e,K9e,async o=>{const r=await o.provideLinkedEditingRanges(N.revive(t),i,n);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Yc._serializeRegExp(r.wordPattern):void 0}},void 0,n)}registerReferenceProvider(e,t,i){const n=this._addNewAdapter(new q9e(this._documents,i),e);return this._proxy.$registerReferenceSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideReferences(e,t,i,n,o){return this._withAdapter(e,q9e,r=>r.provideReferences(N.revive(t),i,n,o),void 0,o)}registerCodeActionProvider(e,t,i,n){const o=new Z,r=this._addNewAdapter(new OF(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:n?.providedCodeActionKinds?.map(a=>a.value),documentation:n?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},Yc._extLabel(e),Yc._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,n,o){return this._withAdapter(e,OF,r=>r.provideCodeActions(N.revive(t),i,n,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,OF,n=>n.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,OF,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const n=this._addNewAdapter(new Q9e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(n,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(n)}$provideDocumentFormattingEdits(e,t,i,n){return this._withAdapter(e,Q9e,o=>o.provideDocumentFormattingEdits(N.revive(t),i,n),void 0,n)}registerDocumentRangeFormattingEditProvider(e,t,i){const n=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new Xue(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,n),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Xue,r=>r.provideDocumentRangeFormattingEdits(N.revive(t),i,n,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Xue,r=>r.provideDocumentRangesFormattingEdits(N.revive(t),i,n,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,n){const o=this._addNewAdapter(new j9e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),n,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,n,o,r){return this._withAdapter(e,j9e,a=>a.provideOnTypeFormattingEdits(N.revive(t),i,n,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new KK(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,KK,n=>n.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,KK,n=>n.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,KK,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const n=this._addNewAdapter(new $1(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(n,this._transformDocumentSelector(t,e),$1.supportsResolving(i)),this._createDisposable(n)}$provideRenameEdits(e,t,i,n,o){return this._withAdapter(e,$1,r=>r.provideRenameEdits(N.revive(t),i,n,o),void 0,o)}$resolveRenameLocation(e,t,i,n){return this._withAdapter(e,$1,o=>o.resolveRenameLocation(N.revive(t),i,n),void 0,n)}registerNewSymbolNamesProvider(e,t,i){const n=this._addNewAdapter(new Iz(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,Iz,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,n,o){return this._withAdapter(e,Iz,r=>r.provideNewSymbolNames(N.revive(t),i,n,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new Lf(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=Qs.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,n){return this._withAdapter(e,Lf,o=>o.provideDocumentSemanticTokens(N.revive(t),i,n),null,n)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Lf,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new Y9e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,n){return this._withAdapter(e,Y9e,o=>o.provideDocumentRangeSemanticTokens(N.revive(t),i,n),null,n)}registerCompletionItemProvider(e,t,i,n){const o=this._addNewAdapter(new a1(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),n,a1.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,n,o){return this._withAdapter(e,a1,r=>r.provideCompletionItems(N.revive(t),i,n,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,a1,n=>n.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,a1,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,n){const o=new rii(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Sn.toKey(e.identifier.value),n?.yieldTo?.map(a=>Sn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,n,o){return this._withAdapter(e,jP,r=>r.provideInlineCompletions(N.revive(t),i,n,o),void 0,o)}$provideInlineEdits(e,t,i,n,o){return this._withAdapter(e,jP,r=>r.provideInlineEdits(N.revive(t),i,n,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,n){this._withAdapter(e,jP,async o=>{o.handleDidShowCompletionItem(t,i,n)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,n,o){this._withAdapter(e,jP,async r=>{r.handlePartialAccept(t,i,n,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,jP,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const n=new ege(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(n,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,n){return this._withAdapter(e,ege,o=>o.provideInlineEdits(N.revive(t),i,n),void 0,n)}$freeInlineEdit(e,t){this._withAdapter(e,ege,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,n){const o=Array.isArray(n)?{triggerCharacters:n,retriggerCharacters:[]}:n,r=this._addNewAdapter(new tge(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,n,o){return this._withAdapter(e,tge,r=>r.provideSignatureHelp(N.revive(t),i,n,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,tge,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const n=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new qK(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",n,Yc._extLabel(e));let r=this._createDisposable(o);if(n!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(n));r=Qs.from(r,a)}return r}$provideInlayHints(e,t,i,n){return this._withAdapter(e,qK,o=>o.provideInlayHints(N.revive(t),i,n),void 0,n)}$resolveInlayHint(e,t,i){return this._withAdapter(e,qK,n=>n.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,qK,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const n=this._addNewAdapter(new Qx(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(n,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(n)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,Qx,n=>n.provideLinks(N.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,Qx,n=>n.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,Qx,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const n=this._addNewAdapter(new ige(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentColors(e,t,i){return this._withAdapter(e,ige,n=>n.provideColors(N.revive(t),i),[],i)}$provideColorPresentations(e,t,i,n){return this._withAdapter(e,ige,o=>o.provideColorPresentations(N.revive(t),i,n),void 0,n)}registerFoldingRangeProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(n,new O4(new J9e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(n,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=Qs.from(r,a)}return r}$provideFoldingRanges(e,t,i,n){return this._withAdapter(e,J9e,o=>o.provideFoldingRanges(N.revive(t),i,n),void 0,n)}registerSelectionRangeProvider(e,t,i){const n=this._addNewAdapter(new X9e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideSelectionRanges(e,t,i,n){return this._withAdapter(e,X9e,o=>o.provideSelectionRanges(N.revive(t),i,n),[],n)}registerCallHierarchyProvider(e,t,i){const n=this._addNewAdapter(new P4(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareCallHierarchy(e,t,i,n){return this._withAdapter(e,P4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideCallHierarchyIncomingCalls(e,t,i,n){return this._withAdapter(e,P4,o=>o.provideCallsTo(t,i,n),void 0,n)}$provideCallHierarchyOutgoingCalls(e,t,i,n){return this._withAdapter(e,P4,o=>o.provideCallsFrom(t,i,n),void 0,n)}$releaseCallHierarchy(e,t){this._withAdapter(e,P4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const n=this._addNewAdapter(new F4(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareTypeHierarchy(e,t,i,n){return this._withAdapter(e,F4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideTypeHierarchySupertypes(e,t,i,n){return this._withAdapter(e,F4,o=>o.provideSupertypes(t,i,n),void 0,n)}$provideTypeHierarchySubtypes(e,t,i,n){return this._withAdapter(e,F4,o=>o.provideSubtypes(t,i,n),void 0,n)}$releaseTypeHierarchy(e,t){this._withAdapter(e,F4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new O4(new QK(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),dl(e,"documentPaste")&&n?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:n.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,n,o,r){return this._withAdapter(e,QK,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,N.revive(i),n,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,QK,n=>n.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,QK,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const n=this._addNewAdapter(new Z9e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(n,this._transformDocumentSelector(t,e),e.displayName??e.name),this._createDisposable(n)}$provideMappedEdits(e,t,i,n,o){return this._withAdapter(e,Z9e,r=>Promise.resolve(r.provideMappedEdits(t,i,n,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new O4(new N4(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerPasteEditProvider(o,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:n.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:n.copyMimeTypes,pasteMimeTypes:n.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,n,o){return this._withAdapter(e,N4,r=>r.prepareDocumentPaste(N.revive(t),i,n,o),void 0,o)}$providePasteEdits(e,t,i,n,o,r,a){return this._withAdapter(e,N4,c=>c.providePasteEdits(t,N.revive(i),n,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,N4,n=>n.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,N4,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Yc._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Yc._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Yc._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Yc._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Yc._serializeRegExp(e.beforeText),afterText:e.afterText?Yc._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Yc._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Yc._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>nN.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Yc._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:n}=i;if(n&&J1e(n))throw new Error(`Invalid language configuration: wordPattern '${n}' is not allowed to match the empty string.`);n?this._documents.setWordDefinitionFor(t,n):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const o=this._nextHandle(),r={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Yc._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Yc._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Yc._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Yc._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(o,t,r),this._createDisposable(o)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Yc._handlePool=0;let FIe=Yc;class aii{constructor(e){this._registeredTools=new Map,this._allTools=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageModelTools),this._proxy.$getTools().then(t=>{for(const i of t)this._allTools.set(i.name,Mo(i))})}async invokeTool(e,t,i){return await this._proxy.$invokeTool(e,t,i)}async $acceptToolDelta(e){e.added&&this._allTools.set(e.added.name,e.added),e.removed&&this._allTools.delete(e.removed)}get tools(){return Array.from(this._allTools.values()).map(e=>dxe.to(e))}async $invokeTool(e,t,i){const n=this._registeredTools.get(e);if(!n)throw new Error(`Unknown tool ${e}`);return await n.tool.invoke(t,i)}registerTool(e,t,i){return this._registeredTools.set(t,{extension:e,tool:i}),this._proxy.$registerTool(t),Ee(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}}class cii{constructor(e,t,i,n){this._documents=t,this._commands=i,this._uriTransformer=n,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Be.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);const i=this._documents.getDocumentData(e);if(!i)throw new Error(`document '${e.toString()}' NOT found`);return i.document}async tokenAtPosition(e,t){const i=e.version,n=Yo.from(t),o=await this._proxy.$tokensAtPosition(e.uri,n),r={type:LS.Other,range:e.getWordRangeAtPosition(t)??new Jn(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:et.to(o.range),type:NEe.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const n=this._handlePool++,o=this._proxy,r=this._ids,a=`${e.identifier.value}/${t}`;if(r.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);r.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:UT.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!r.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=jy(()=>{d.clear(),this._proxy.$setLanguageStatus(n,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:NH.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===UT.Error?Xe.Error:c.severity===UT.Warning?Xe.Warning:Xe.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),o.$removeLanguageStatus(n),r.delete(a)},get id(){return c.id},get name(){return c.name},set name(f){c.name=f,h()},get selector(){return c.selector},set selector(f){c.selector=f,h()},get text(){return c.text},set text(f){c.text=f,h()},set text2(f){Ve(e,"languageStatusText"),c.text=f,h()},get text2(){return Ve(e,"languageStatusText"),c.text},get detail(){return c.detail},set detail(f){c.detail=f,h()},get severity(){return c.severity},set severity(f){c.severity=f,h()},get accessibilityInformation(){return c.accessibilityInformation},set accessibilityInformation(f){c.accessibilityInformation=f,h()},get command(){return c.command},set command(f){c.command=f,h()},get busy(){return c.busy},set busy(f){c.busy=f,h()}};return h(),u}}function lii(s){return s&&s.title}let OIe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Be.MainThreadMessageService)}showMessage(e,t,i,n,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof n=="string"||lii(n)?a=[n,...o]:(r.modal=n?.modal,r.useCustom=n?.useCustom,r.detail=n?.detail,a=o),r.useCustom&&Ve(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};OIe=D([_(1,Ge)],OIe);class nge{constructor(e,t,i,n){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=n}asApiEvent(){return{range:new Sy(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class BIe{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1}}constructor(e,t,i){this.notebook=e,this._extHostDocument=t,this._cellData=i,this.handle=i.handle,this.uri=N.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(pI.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(HH.to(i.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){const e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw new Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);const i={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:C$.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(n){e._mime=n},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(i)}return this._apiCell}setOutputs(e){this._outputs=e.map(pI.to)}setOutputItems(e,t,i){const n=i.map(UH.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...n),o.items.length>1&&o.items.every(r=>Yit(r.mime)))){const r=new Map,a=[];o.items.forEach(c=>{let l;r.has(c.mime)?l=r.get(c.mime):(l=[],r.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),o.items.length=0,a.forEach(c=>{const l=P9t(r.get(c));o.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(HH.to(e))}setMime(e){}}const hre=class hre{constructor(e,t,i,n,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=n,this.handle=hre._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=o.viewType,this._metadata=Object.freeze(o.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,o.cells]],!0,void 0),this._versionId=o.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){const e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===pe.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(i){return i=e._validateIndex(i),e._cells[i].apiCell},getCells(i){return(i?e._getCells(i):e._cells).map(o=>o.apiCell)},save(){return e._save()},[Symbol.for("debug.description")](){return`NotebookDocument(${this.uri.toString()})`}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,i){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:i});const n={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===Sl.ModelChange?this._spliceNotebookCells(a.changes,!1,n.contentChanges):a.kind===Sl.Move?this._moveCells(a.index,a.length,a.newIdx,n.contentChanges):a.kind===Sl.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Sl.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Sl.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===Sl.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===Sl.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===Sl.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===Sl.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),o.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const r=new Map;for(let a=0;a=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,i=e.end|0;return t<0&&(t=0),i>this._cells.length&&(i=this._cells.length),e.with({start:t,end:i})}_getCells(e){e=this._validateRange(e);const t=[];for(let i=e.start;i{const l=a[2].map(u=>{const f=new BIe(this,this._textDocumentsAndEditors,u);return t||o.push(BIe.asModelAddData(u)),f}),d=new nge(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)r.push(u.uri),d.deletedItems.push(u.apiCell);n.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of n)i.push(a.asApiEvent())}_moveCells(e,t,i,n){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new nge(e,t,o.map(a=>a.apiCell),[]),new nge(i,0,[],o)];for(const a of r)n.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,n){this._cells[e].setOutputItems(t,i,n)}_changeCellLanguage(e,t){const i=this._cells[e];i.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(i.uri,t)}_changeCellMime(e,t){const i=this._cells[e];i.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}};hre._handlePool=0;let WIe=hre;const ure=class ure{constructor(e,t,i,n,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=n,this._viewColumn=r}get apiEditor(){if(!this._editor){const e=this;this._editor={get notebook(){return e.notebookData.apiNotebook},get selection(){return e._selections[0]},set selection(t){this.selections=[t]},get selections(){return e._selections},set selections(t){if(!Array.isArray(t)||!t.every(Sy.isNotebookRange))throw Pi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,Wy.from(t),i??s$.Default)},get viewColumn(){return e._viewColumn},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},ure.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(Wy.from))}_acceptViewColumn(e){this._viewColumn=e}};ure.apiEditorsToExtHost=new WeakMap;let i7=ure;class dii extends V{constructor(e,t,i){super(),this._source=e,this._inputTextBuffer=t,this._outputs=i,this._outputTextBuffers=void 0}_getFullModelRange(e){const t=e.getLineCount();return new F(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw new Error("Illegal value for lineNumber");return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){const e=new n3;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:n}=t.create(Sb.LF);this._inputTextBuffer=i,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new n3;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:n,disposable:o}=i.create(Sb.LF);return this._register(o),n})),this._outputTextBuffers}findInInputs(e){const i=new GC(e,!1,!1,null).parseSearchRequest();if(!i)return[];const n=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(n,i,!0,5e3)}findInOutputs(e){const i=new GC(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(n=>{const o=n.findMatchesLineByLine(this._getFullModelRange(n),i,!0,5e3);if(o.length!==0)return{textBuffer:n,matches:o}}).filter(n=>!!n):[]}}function e$e(s,e){let t=-1;const i=[];let n=[];return s.forEach(r=>{r.range.startLineNumber!==t&&n.length>0&&(i.push([...n]),n=[]),n.push(r),t=r.range.endLineNumber}),n.length>0&&i.push([...n]),i.map(r=>{const a=[],c=r[0].range.startLineNumber,l=r[r.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new d3t(a.join(` `)+` -`,r.map(d=>new O(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const S6e="vs/workbench/api/common/extHostNotebook",oR=class oR{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,s,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=s,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new wi,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new I,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new I,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new I,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new I,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new F_("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Ue.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Ue.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Ue.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===Fs.NotebookCellActionContext){const l=c.notebookEditor?.notebookUri,d=c.cell.handle,u=this._documents.get(l)?.getCell(d);if(u)return u.apiCell}if(c&&c.$mid===Fs.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),oR._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(s=>voe.from(s)).filter(s=>s!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,exclusive:t.exclusive||!1}}registerNotebookCellStatusBarItemProvider(e,t,i){const s=oR._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?oR._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(s,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(s,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new oo(()=>{this._notebookStatusBarItemProviders.delete(s),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(s,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&ok.from(e.content)});return P.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),s=this._documents.get(P.revive(i));return ws(s?.apiNotebook)}async showNotebookDocument(e,t){P.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(ES.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const s=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=s&&this._editors.get(s)?.apiEditor;if(o)return o;throw s?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,s){const o=this._notebookStatusBarItemProviders.get(e),r=P.revive(t),a=this._documents.get(r);if(!a||!o)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await o.provideCellStatusBarItems(c.apiCell,s);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>fIe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,s,o){if(Xv(t))throw new Error("viewType cannot be empty or just whitespace");const r=this._handlePool++;return this._notebookSerializer.set(r,{viewType:t,serializer:i,options:s}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,mIe.from(s),oR._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.deserializeNotebook(t.buffer,i);return new $h(ok.from(o))}async $notebookToData(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.serializeNotebook(ok.to(t.value),i);return ze.wrap(o)}async $saveNotebook(e,t,i,s,o){const r=P.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${r.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(r);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(r.scheme))throw new Ah(g(S6e,0,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Zi.FILE_PERMISSION_DENIED);const l={metadata:YX(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new ej(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=YX(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,s),o.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,o);if(o.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${r.toString()}`),await this._extHostFileSystem.value.writeFile(r,d),this.trace(`Finished write versionId: ${i} ${r.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(r.scheme),u=await this._extHostFileSystem.value.stat(r),f={name:h.basename(r),isFile:(u.type&an.File)!==0,isDirectory:(u.type&an.Directory)!==0,isSymbolicLink:(u.type&an.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&wm.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&wm.Locked),etag:_ee({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,s,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new o1;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const w={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:z1.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(w,f,b=>{b.forEach(C=>{a.has(C)||s.some(S=>m.isFromSettings&&!S.isFromSettings?!1:S.filenamePatterns.some(M=>Wjt(M,C)))||a.add(C)})}).catch(b=>{if(b.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw b})}))))})(i,o,t);const l=new wi;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((w,b)=>w+b.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(b=>p.push({input:b.document.getText(),outputs:b.outputs.flatMap(C=>C.items.map(y=>y.data.toString()))}));else{const w=await this._extHostFileSystem.value.readFile(u),b=ze.fromString(w.toString()),C=await r.deserializeNotebook(b.buffer,o);if(o.isCancellationRequested)return;ok.from(C).cells.forEach(S=>p.push({input:S.source,outputs:S.outputs.flatMap(M=>M.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((w,b)=>{const C=t.contentPattern.pattern,y=new Kii(w.input,void 0,w.outputs),S=y.findInInputs(C),M=y.findInOutputs(C),k=M.flatMap(F=>y6e(F.matches,F.textBuffer)).map((F,N)=>(F.webviewIndex=N,F));if(S.length>0||M.length>0){const F={index:b,contentResults:y6e(S,y.inputTextBuffer),webviewResults:k};f.push(F)}});const v={resource:u,cellResults:f};l.set(u,v);return}catch{return}});return await Promise.all(h),{limitHit:d,results:[...l.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==zv&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(s.apiNotebook));for(const o of this._editors.values())o.notebookData.uri.toString()===i.toString()&&this._editors.delete(o.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const s=P.revive(i.uri);if(this._documents.has(s))throw new Error(`adding EXISTING notebook ${s} `);const o=new OTe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,s,i);t.push(...i.cells.map(r=>FTe.asModelAddData(r))),this._documents.get(s)?.dispose(),this._documents.set(s,o),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(o.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=P.revive(t.documentUri),s=this._documents.get(i);s&&this._createExtHostEditor(s,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const s=t.has(i.id);i._acceptVisibility(s)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=Et.String.with("notebookType","A notebook type"),i=new Vn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new Et("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>ze.wrap(o))],new In("Notebook Data",o=>ok.to(o.value))),s=new Vn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new Et("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new $h(ok.from(o)))],new In("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(s)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};oR._notebookStatusBarItemProviderHandlePool=0;let BTe=oR;class Yii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._onWillSaveNotebookDocumentEvent=new EI}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,s)}}async $participateInSave(e,t,i){const s=P.revive(e),o=this._notebooksAndEditors.getNotebookDocument(s);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:foe.to(t)},i,async(c,l)=>{const d=Date.now(),h=await await Promise.resolve(c);Date.now()-d>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier),!i.isCancellationRequested&&h&&(h instanceof q1?r.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(r.length===0)return!0;const a={edits:[]};for(const c of r){const{edits:l}=lf.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(a))}}class Jii{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new I,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new I,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,s){const r=this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptModelChanged(t.value,i,s);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(P.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let WTe=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new I,this._onDidChangeNotebookEditorVisibleRanges=new I,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(ES.to)),t.selections&&i._acceptSelections(t.selections.selections.map(ES.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(yd.to(e[t]))}};WTe=D([_(0,Ze)],WTe);const Xii=100;let HTe=class{constructor(e,t,i,s,o){this._initData=t,this._extHostNotebook=i,this._commands=s,this._logService=o,this._activeExecutions=new wi,this._activeNotebookExecutions=new wi,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this._onDidChangeCellExecutionState=new I,this.onDidChangeNotebookCellExecutionState=this._onDidChangeCellExecutionState.event,this.id=0,this.variableStore={},this._proxy=e.getProxy(Ue.MainThreadNotebookKernels);const r=new Vn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new Et("options","Select kernel options",c=>!0,c=>{if(c&&"notebookEditor"in c&&"id"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);return{id:c.id,extension:c.extension,notebookEditorId:l}}else if(c&&"notebookEditor"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);if(l===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${c.notebookEditor.notebook.uri.toString()}`);return{notebookEditorId:l}}return c})],In.Void),a=new Vn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[Et.Uri],new In("A promise that resolves to an array of variables",(c,l)=>c.map(d=>({variable:{name:d.name,value:d.value,expression:d.expression,type:d.type,language:d.language},hasNamedChildren:d.hasNamedChildren,indexedChildrenCount:d.indexedChildrenCount}))));this._commands.registerApiCommand(r),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,s,o,r){for(const S of this._kernelData.values())if(S.controller.id===t&&Cn.equals(e.identifier,S.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,c=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const l=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`);let d=!1;const h=new I,u=new I,f={id:xY(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:s||e.identifier.value,preloads:r?r.map(woe.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(S=>{console.log(S),d=!0});let w=0;const b=()=>{if(d)return;const S=++w;Promise.resolve().then(()=>{S===w&&this._proxy.$updateKernel(a,f)})},C=new wi,y={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(S){f.label=S??e.displayName??e.name,b()},get detail(){return f.detail??""},set detail(S){f.detail=S,b()},get description(){return f.description??""},set description(S){f.description=S,b()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(S){f.supportedLanguages=S,b()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(S){f.supportsExecutionOrder=S,b()},get rendererScripts(){return f.preloads?f.preloads.map(woe.to):[]},get executeHandler(){return p},set executeHandler(S){p=S??l},get interruptHandler(){return m},set interruptHandler(S){m=S,f.supportsInterrupt=!!S,b()},set variableProvider(S){Je(e,"notebookVariableProvider"),v=S,f.hasVariableProvider=!!S,S?.onDidChangeVariables(M=>c._proxy.$variablesUpdated(M.uri)),b()},get variableProvider(){return v},createNotebookCellExecution(S){if(d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.notebook.uri.toString()}`);return c._createNotebookCellExecution(S,xY(e.identifier,this.id))},createNotebookExecution(S){if(Je(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.uri.toString()}`);return c._createNotebookExecution(S,xY(e.identifier,this.id))},dispose:()=>{d||(this._logService.trace(`NotebookController[${a}], DISPOSED`),d=!0,this._kernelData.delete(a),h.dispose(),u.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(S,M){M===cG.Hidden&&Je(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,S.uri,M)},onDidReceiveMessage:u.event,postMessage(S,M){return Je(e,"notebookMessaging"),c._proxy.$postMessage(a,M&&c._extHostNotebook.getIdByEditor(M),S)},asWebviewUri(S){return Je(e,"notebookMessaging"),O8(S,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:y,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:C}),y}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return xY(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,s=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),s._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const s=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?s:void 0,r=this;this._kernelSourceActionProviders.set(s,i),this._logService.trace(`NotebookKernelSourceActionProvider[${s}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(s,s,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(s),r._proxy.$removeKernelSourceActionProvider(s,s),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const s=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>pIe.from(r,this._commands.converter,s))}return[]}$acceptNotebookAssociation(e,t,i){const s=this._kernelData.get(e);if(s){const o=this._extHostNotebook.getNotebookDocument(P.revive(t));i?s.associatedNotebooks.set(o.uri,!0):s.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),s.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t)),r=[];for(const a of i){const c=o.getCell(a);c&&r.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,o.uri.toString(),r.length),await s.controller.executeHandler.call(s.controller,r,o.apiNotebook,s.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t));if(s.controller.interruptHandler)await s.controller.interruptHandler.call(s.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(s.controller.interruptHandler){const r=this._activeNotebookExecutions.get(o.uri);this._activeNotebookExecutions.delete(o.uri),i.length&&Array.isArray(r)&&r.length&&r.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,s,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(P.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(s!==void 0){if(h=this.variableStore[s],!h)return}else this.variableStore={};const u=o==="named"?lG.Named:lG.Indexed,f=d.provideVariables(l.apiNotebook,h,u,r,a);let p=0;for await(const m of f){if(a.isCancellationRequested)return;const v={id:this.id++,name:m.variable.name,value:m.variable.value,type:m.variable.type,interfaces:m.variable.interfaces,language:m.variable.language,expression:m.variable.expression,hasNamedChildren:m.hasNamedChildren,indexedChildrenCount:m.indexedChildrenCount,extensionId:c.extensionId.value};if(this.variableStore[v.id]=m.variable,this._proxy.$receiveVariable(t,v),p++>=Xii)return}}$acceptKernelMessageFromRenderer(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getEditorById(t);s.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(P.revive(e)).getCell(t);if(o){const r=i?gIe.to(i):qF.Idle;r!==void 0&&this._onDidChangeCellExecutionState.fire({cell:o.apiCell,state:r})}}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const s=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!s)throw new Error("invalid cell");if(this._activeExecutions.has(s.uri))throw new Error(`duplicate execution for ${s.uri}`);const o=new UTe(t,s,this._proxy);this._activeExecutions.set(s.uri,o);const r=o.onDidChangeState(()=>{o.state===hb.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(s.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),s=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(s)throw new Error(`duplicate cell execution for ${s.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new VTe(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===QA.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};HTe=D([_(4,Ze)],HTe);var hb;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(hb||(hb={}));const Ele=class Ele extends ${get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=Ele.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=hb.Init,this._tokenSource=this._register(new ai),this._collector=new Zii(10,s=>this.update(s)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new $h(t))}verifyStateForOutput(){if(this._state===hb.Init)throw new Error("Must call start before modifying cell output");if(this._state===hb.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=oG.ensureUniqueMimeTypes(t.items,!0);return i===t.items?Y1.from(t):Y1.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const s=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(Kb(e));return this.updateSoon({editType:CI.Output,cellHandle:s,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=oG.ensureUniqueMimeTypes(Kb(e),!0),this.updateSoon({editType:CI.OutputItems,items:e.map(N4.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:CI.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===hb.Resolved||e._state===hb.Started)throw new Error("Cannot call start again");e._state=hb.Started,e._onDidChangeState.fire(),e.update({editType:CI.ExecutionState,runStartTime:i})},end(i,s,o){if(e._state===hb.Resolved)throw new Error("Cannot call resolve twice");e._state=hb.Resolved,e._onDidChangeState.fire(),e._collector.flush();const r=o?{message:o.message,stack:o.stack,location:o?.location?{startLineNumber:o.location.start.line,startColumn:o.location.start.character,endLineNumber:o.location.end.line,endColumn:o.location.end.character}:void 0,uri:o.uri}:void 0;e._proxy.$completeExecution(e._handle,new $h({runEndTime:s,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!0)},replaceOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!1)},appendOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!0)},replaceOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!1)}})}};Ele.HANDLE=0;let UTe=Ele;var QA;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(QA||(QA={}));const xle=class xle extends ${get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=xle.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=QA.Init,this._tokenSource=this._register(new ai),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===QA.Resolved||this._state===QA.Started)throw new Error("Cannot call start again");this._state=QA.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===QA.Resolved)throw new Error("Cannot call resolve twice");this._state=QA.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};xle.HANDLE=0;let VTe=xle;class Zii{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new sd,this.startedTimer=Date.now(),Ta(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function xY(n,e){return`${n.value}/${e}`}class eni{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Ue.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const s=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:s.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(s=>s.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(s,o,r)=>this.getOrCreateEmitterFor(t).event(s,o,r),postMessage:(s,o)=>{gq.apiEditorsToExtHost.has(s)&&([s,o]=[o,s]);const r=o&&gq.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,s)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new I({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class tni{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Ue.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Je(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),Ee(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,s){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,s)}async $readProfile(e,t,i){const s=this.handlers.get(e);if(!s)throw new Error(`Unknown handler with id: ${e}`);return s.readProfile($t(t)?t:P.revive(t),i)}}class ini{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const s=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(s,{location:hIe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(er),this._withProgress(s,i,!!a)}_withProgress(e,t,i){let s;i&&(s=new ai,this._mapHandleToCancellationSource.set(e,s));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),s?.dispose()};let r;try{r=t(new zTe(this._proxy,e),i&&s?s.token:qe.None)}catch(a){throw o(e),a}return r.then(a=>o(e),a=>o(e)),r}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function nni(n,e){return n.message=e.message,typeof e.increment=="number"&&(typeof n.increment=="number"?n.increment+=e.increment:n.increment=e.increment),n}class zTe extends cf{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}zTe.__decorator=D([bxt(100,(n,e)=>nni(n,e),()=>Object.create(null))],zTe.prototype,"throttledReport",null);const Dle=class Dle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const s=P.revive(t),o=this.providers.get(e);return o?Zu(()=>o.provideOriginalResource(s,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,s){const o=Dle.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,D4.from(e,this.uriTransformer),i,s),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};Dle.handlePool=0;let $Te=Dle;function sni(n,e,t){const i=n.getProxy(Ue.MainThreadQuickOpen);class s{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,w=qe.None){this._onDidSelectItem=void 0;const b=Promise.resolve(m),C=++this._instances,y=i.$show(C,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},w),S={},M=y.then(()=>S);return Promise.race([M,b]).then(k=>{if(k===S)return;const F=Cd(p,"quickPickItemTooltip");return b.then(N=>{const z=[];for(let U=0;U{v.onDidSelectItem(N[U])}),i.$setItems(C,z),y.then(U=>{if(typeof U=="number")return N[U];if(Array.isArray(U))return U.map(J=>N[J])})})}).then(void 0,k=>{if(!Na(k))return i.$setError(C,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=qe.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Na(v))return Promise.reject(v)})}async $validateInput(p){if(!this._validateInput)return;const m=await this._validateInput(p);if(!m||typeof m=="string")return m;let v;switch(m.severity){case BM.Info:v=nt.Info;break;case BM.Warning:v=nt.Warning;break;case BM.Error:v=nt.Error;break;default:v=m.message?nt.Error:nt.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=qe.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const w=await this._workspace.getWorkspaceFolders2();if(w)return w.find(b=>b.uri.toString()===v.uri.toString())}createQuickPick(p){const m=new d(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}createInputBox(p){const m=new h(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}$onDidChangeValue(p,m){this._sessions.get(p)?._fireDidChangeValue(m)}$onDidAccept(p){this._sessions.get(p)?._fireDidAccept()}$onDidChangeActive(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeActive(m)}$onDidChangeSelection(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeSelection(m)}$onDidTriggerButton(p,m){this._sessions.get(p)?._fireDidTriggerButton(m)}$onDidTriggerItemButton(p,m,v){const w=this._sessions.get(p);w instanceof d&&w._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extensionId=p,this._onDidDispose=m,this._id=d._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new I,this._onDidChangeValueEmitter=new I,this._onDidTriggerButtonEmitter=new I,this._onDidHideEmitter=new I,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(p){this._title=p,this.update({title:p})}get step(){return this._steps}set step(p){this._steps=p,this.update({step:p})}get totalSteps(){return this._totalSteps}set totalSteps(p){this._totalSteps=p,this.update({totalSteps:p})}get enabled(){return this._enabled}set enabled(p){this._enabled=p,this.update({enabled:p})}get busy(){return this._busy}set busy(p){this._busy=p,this.update({busy:p})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(p){this._ignoreFocusOut=p,this.update({ignoreFocusOut:p})}get value(){return this._value}set value(p){this._value=p,this.update({value:p})}get placeholder(){return this._placeholder}set placeholder(p){this._placeholder=p,this.update({placeholder:p})}get buttons(){return this._buttons}set buttons(p){this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((m,v)=>{const w=m===v4.Back?-1:v;this._handlesToButtons.set(w,m)}),this.update({buttons:p.map((m,v)=>({...l(m.iconPath),tooltip:m.tooltip,handle:m===v4.Back?-1:v}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(p){this._value=p,this._onDidChangeValueEmitter.fire(p)}_fireDidTriggerButton(p){const m=this._handlesToButtons.get(p);m&&this._onDidTriggerButtonEmitter.fire(m)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=St(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(p){if(!this._disposed){for(const m of Object.keys(p)){const v=p[m];this._pendingUpdate[m]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};u._nextId=1;let o=u;function r(f){if(f instanceof fg)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?P.file(p):p,light:typeof m=="string"?P.file(m):m}}function a(f){return typeof f=="object"&&"light"in f?f.light:f}function c(f){return typeof f=="object"&&"dark"in f?f.dark:f}function l(f){const p=r(f);let m,v;return"id"in p?v=$e.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p.identifier,m),this.extension=p,this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new I,this._selectedItems=[],this._onDidChangeSelectionEmitter=new I,this._onDidTriggerItemButtonEmitter=new I,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(p){this._items=p.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),p.forEach((w,b)=>{this._handlesToItems.set(b,w),this._itemsToHandles.set(w,b)});const m=Cd(this.extension,"quickPickItemTooltip"),v=[];for(let w=0;w({...l(y.iconPath),tooltip:y.tooltip,handle:S}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(p){this._canSelectMany=p,this.update({canSelectMany:p})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(p){this._matchOnDescription=p,this.update({matchOnDescription:p})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(p){this._matchOnDetail=p,this.update({matchOnDetail:p})}get sortByLabel(){return this._sortByLabel}set sortByLabel(p){this._sortByLabel=p,this.update({sortByLabel:p})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(p){this._keepScrollPosition=p,this.update({keepScrollPosition:p})}get activeItems(){return this._activeItems}set activeItems(p){this._activeItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({activeItems:this._activeItems.map(m=>this._itemsToHandles.get(m))})}get selectedItems(){return this._selectedItems}set selectedItems(p){this._selectedItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({selectedItems:this._selectedItems.map(m=>this._itemsToHandles.get(m))})}_fireDidChangeActive(p){const m=Vi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Vi(p.map(v=>this._handlesToItems.get(v)));this._selectedItems=m,this._onDidChangeSelectionEmitter.fire(m)}_fireDidTriggerItemButton(p,m){const v=this._handlesToItems.get(p);if(!v||!v.buttons||!v.buttons.length)return;const w=v.buttons[m];w&&this._onDidTriggerItemButtonEmitter.fire({button:w,item:v})}}class h extends o{constructor(p,m){super(p.identifier,m),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(p){this._password=p,this.update({password:p})}get prompt(){return this._prompt}set prompt(p){this._prompt=p,this.update({prompt:p})}get valueSelection(){return this._valueSelection}set valueSelection(p){this._valueSelection=p,this.update({valueSelection:p})}get validationMessage(){return this._validationMessage}set validationMessage(p){this._validationMessage=p,p?typeof p=="string"?this.update({validationMessage:p,severity:nt.Error}):this.update({validationMessage:p.message,severity:p.severity??nt.Error}):this.update({validationMessage:void 0,severity:nt.Ignore})}}return new s(e,t)}var GTe;function A6e(n){return n instanceof P}function oni(n,e){return n.scheme===_e.file&&e.scheme===_e.file&&jr?n.toString()===e.toString():n.toString().toLowerCase()===e.toString().toLowerCase()}function Dme(n){if(n)return typeof n.iconPath=="string"?P.file(n.iconPath):P.isUri(n.iconPath)||$e.isThemeIcon(n.iconPath)?n.iconPath:void 0}function E6e(n){if(n.icon){if(P.isUri(n.icon))return n.icon;if($e.isThemeIcon(n.icon))return n.icon;{const e=n.icon;return{light:e.light,dark:e.dark}}}else return}function kme(n,e){if(!n.iconPath&&!e.iconPath)return 0;if(n.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof n.iconPath=="string"?n.iconPath:P.isUri(n.iconPath)?n.iconPath.fsPath:n.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:P.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return yJ(t,i)}function rni(n,e){let t=0;if(n.strikeThrough!==e.strikeThrough)return n.strikeThrough?1:-1;if(n.faded!==e.faded)return n.faded?1:-1;if(n.tooltip!==e.tooltip)return(n.tooltip||"").localeCompare(e.tooltip||"");if(t=kme(n,e),t!==0)return t;if(n.light&&e.light)t=kme(n.light,e.light);else{if(n.light)return 1;if(e.light)return-1}if(t!==0)return t;if(n.dark&&e.dark)t=kme(n.dark,e.dark);else{if(n.dark)return 1;if(e.dark)return-1}return t}function ani(n,e){if(n.command!==e.command)return n.commandse(this,hy).$setInputBoxValue(this._sourceControlHandle,e)),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this._sequencer.queue(async()=>se(this,hy).$setInputBoxPlaceholder(this._sourceControlHandle,e)),this._placeholder=e}get validateInput(){return Je(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if(Je(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this._sequencer.queue(async()=>se(this,hy).$setValidationProviderIsEnabled(this._sourceControlHandle,!!e))}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxEnablement(this._sourceControlHandle,e)))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxVisibility(this._sourceControlHandle,e)))}get document(){return Je(this._extension,"scmTextDocument"),se(this,kq).getDocument(this._documentUri)}showValidationMessage(e,t){Je(this._extension,"scmValidation"),this._sequencer.queue(async()=>se(this,hy).$showValidationMessage(this._sourceControlHandle,e,t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}}hy=new WeakMap,kq=new WeakMap;const kle=class kle{get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._sequencer.queue(async()=>this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e))}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._sequencer.queue(async()=>this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features))}get features(){return{hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(e,t,i,s,o,r,a,c){this._proxy=e,this._commands=t,this._sequencer=i,this._sourceControlHandle=s,this._id=o,this._label=r,this.multiDiffEditorEnableViewChanges=a,this._extension=c,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new I,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._hideWhenEmpty=void 0,this.handle=kle._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){const i=this._resourceStatesCommandsMap.get(e);return i?Zu(()=>this._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(x6e),i=FRe(this._resourceSnapshot,e,x6e).map(r=>{const a=r.toInsert.map(c=>{const l=this._resourceHandlePool++;this._resourceStatesMap.set(l,c);const d=c.resourceUri;let h;if(c.command)if(c.command.command==="vscode.open"||c.command.command==="vscode.diff"||c.command.command==="vscode.changes"){const F=new Z;h=this._commands.converter.toInternal(c.command,F),this._resourceStatesDisposablesMap.set(l,F)}else this._resourceStatesCommandsMap.set(l,c.command);const u=Cd(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=Dme(c.decorations),v=c.decorations&&Dme(c.decorations.light)||m,w=c.decorations&&Dme(c.decorations.dark)||m,b=[v,w],C=c.decorations&&c.decorations.tooltip||"",y=c.decorations&&!!c.decorations.strikeThrough,S=c.decorations&&!!c.decorations.faded,M=c.contextValue||"";return{rawResource:[l,d,b,C,y,S,M,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),s=i.map(({start:r,deleteCount:a,toInsert:c})=>[r,a,c.map(l=>l.rawResource)]),o=i.reverse();for(const{start:r,deleteCount:a,toInsert:c}of o){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(r,a,...l);for(const h of d)this._resourceStatesMap.delete(h),this._resourceStatesCommandsMap.delete(h),this._resourceStatesDisposablesMap.get(h)?.dispose(),this._resourceStatesDisposablesMap.delete(h)}return this._resourceSnapshot=e,s}dispose(){this._disposed=!0,this._onDidDispose.fire()}};kle._handlePool=0;let qTe=kle;var Ch;const Ile=class Ile{constructor(e,t,i,s,o,r,a){kt(this,Ch);this._extension=e,this._commands=s,this._id=o,this._label=r,this._rootUri=a,this._sequencer=new Yht,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new Dn,this._commitTemplate=void 0,this._acceptInputDisposables=new Dn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new Dn,this._statusBarDisposables=new Dn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=Ile._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,st(this,Ch,i);const c=P.from({scheme:_e.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._sequencer.queue(()=>se(this,Ch).$registerSourceControl(this.handle,o,r,a,c)),this._inputBox=new hni(e,t,se(this,Ch),this._sequencer,this.handle,c)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{count:e})))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Cd(this._extension,"quickDiffProvider")&&(t=e?.label),this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t}))}get historyProvider(){return Je(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Je(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasHistoryProvider:!!e})),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,this._sequencer.queue(async()=>se(this,Ch).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup))}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{commitTemplate:e})))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new Z,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{acceptInputCommand:t}))}get actionButton(){return Je(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Je(this._extension,"scmActionButton"),this._actionButtonDisposables.value=new Z,this._actionButton=e;const t=e!==void 0?{command:this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),secondaryCommands:e.secondaryCommands?.map(i=>i.map(s=>this._commands.converter.toInternal(s,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{actionButton:t??null}))}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&dni(this._statusBarCommands,e))return;this._statusBarDisposables.value=new Z,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{statusBarCommands:t}))}get selected(){return this._selected}createResourceGroup(e,t,i){const s=Cd(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new qTe(se(this,Ch),this._commands,this._sequencer,this.handle,e,t,s,this._extension),r=T.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,s]of this.createdResourceGroups){s.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});T.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),this._sequencer.queue(async()=>se(this,Ch).$unregisterGroup(this.handle,i.handle))}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const r=i._takeResourceStateSnapshot();r.length>0&&t.push([i.handle,r]),this._groups.set(i.handle,i)}this._sequencer.queue(async()=>se(this,Ch).$registerGroups(this.handle,e,t)),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&this._sequencer.queue(async()=>se(this,Ch).$spliceResourceStates(this.handle,e)),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this._sequencer.queue(async()=>se(this,Ch).$unregisterSourceControl(this.handle))}};Ch=new WeakMap,Ile._handlePool=0;let eO=Ile;eO.__decorator=D([INe(100)],eO.prototype,"eventuallyAddResourceGroups",null);eO.__decorator=D([INe(100)],eO.prototype,"eventuallyUpdateResourceStates",null);var eF;let QTe=(eF=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,s){this._commands=t,this._extHostDocuments=i,this.logService=s,this._sourceControls=new Map,this._sourceControlsByExtension=new Ga,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Ue.MainThreadSCM),this._telemetry=e.getProxy(Ue.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===Fs.ScmResource){const r=this._sourceControls.get(o.sourceControlHandle);if(!r)return o;const a=r.getResourceGroup(o.groupHandle);return a?a.getResourceState(o.handle):o}else if(o&&o.$mid===Fs.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===Fs.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,s){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,s),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=GTe._handlePool++,r=new eO(e,this._extHostDocuments,this._proxy,this._commands,t,i,s);this._sourceControls.set(o,r);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(r),this._sourceControlsByExtension.set(e.identifier,a),r}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const s=P.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,s.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Zu(()=>o.quickDiffProvider.provideOriginalResource(s,i)).then(r=>r||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,s){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const o=this._sourceControls.get(e);if(!o)return Promise.resolve(void 0);const r=o.getResourceGroup(t);return r?r.$executeResourceCommand(i,s):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const s=this._sourceControls.get(e);return!s||!s.inputBox.validateInput?Promise.resolve(void 0):Zu(()=>s.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Qs.fromStrict(o.message);return r?Promise.resolve([r,o.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemGroupCommonAncestor(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,s)??void 0}async $provideHistoryItems(e,t,i,s){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,s))?.map(a=>({...a,icon:E6e(a)}))??void 0}async $provideHistoryItemSummary(e,t,i,s){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,s);return r?{...r,icon:E6e(r)}:void 0}async $provideHistoryItemChanges(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,s)??void 0}},GTe=eF,eF._handlePool=0,eF);QTe=GTe=D([_(3,Ze)],QTe);const Lle=class Lle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:at.to(t.selection),resourceUri:P.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=Lle.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,D4.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};Lle.handlePool=0;let jTe=Lle;const Tle=class Tle{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Ue.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideSpeechToTextSession(r.token,i?{language:i}:void 0);a&&(o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideTextToSpeechSession(r.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const s=new Z,o=new ai;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(s.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),s.add(o.token.onCancellationRequested(()=>s.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const s=Tle.ID_POOL++;return this.providers.set(s,i),this.proxy.$registerProvider(s,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(s),this.providers.delete(s)})}};Tle.ID_POOL=1;let KTe=Tle;const Hat="vs/workbench/api/common/extHostStatusBar";var YH,JH;const rR=class rR{constructor(e,t,i,s,o,r=HE.Left,a){kt(this,YH);kt(this,JH);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,st(this,YH,e),st(this,JH,t),o&&s){this._entryId=S7t(s.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?HE.Left:HE.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(rR.ID_GEN++);this._extension=s,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(Kc(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!rR.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new Z,typeof e=="string"?this._command={fromApi:e,internal:se(this,JH).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:se(this,JH).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,se(this,YH).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=g(Hat,0,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=rR.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const s=Qs.fromStrict(this._tooltip);se(this,YH).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,s,this._command?.internal,i,this._backgroundColor,this._alignment===HE.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};YH=new WeakMap,JH=new WeakMap,rR.ID_GEN=0,rR.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new g4("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new g4("statusBarItem.warningForeground")]]);let YTe=rR;class uni{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",HE.Left,Number.MIN_VALUE),this._item.name=g(Hat,1,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new oo(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class gni{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Ue.MainThreadStatusBar),this._commands=t,this._statusMessage=new uni(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,s){return new YTe(this._proxy,this._commands,this._existingItems,e,t,i,s)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let s;return typeof t=="number"?s=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new oo(()=>{i.dispose(),clearTimeout(s)})}}const ly="vs/workbench/contrib/testing/common/constants";var D6e;(function(n){n.ViewletId="workbench.view.extension.test",n.ExplorerViewId="workbench.view.testing",n.OutputPeekContributionId="editor.contrib.testingOutputPeek",n.DecorationsContributionId="editor.contrib.testingDecorations",n.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",n.CoverageViewId="workbench.view.testCoverage",n.ResultsPanelId="workbench.panel.testResults",n.ResultsViewId="workbench.panel.testResults.view",n.MessageLanguageId="vscodeInternalTestMessage"})(D6e||(D6e={}));var k6e;(function(n){n.List="list",n.Tree="true"})(k6e||(k6e={}));var I6e;(function(n){n.ByLocation="location",n.ByStatus="status",n.ByDuration="duration"})(I6e||(I6e={}));Xn.Errored+"",g(ly,0,"Errored"),Xn.Failed+"",g(ly,1,"Failed"),Xn.Passed+"",g(ly,2,"Passed"),Xn.Queued+"",g(ly,3,"Queued"),Xn.Running+"",g(ly,4,"Running"),Xn.Skipped+"",g(ly,5,"Skipped"),Xn.Unset+"",g(ly,6,"Not yet run");Yu.Debug+"",g(ly,8,"Debug"),Yu.Run+"",g(ly,9,"Run"),Yu.Coverage+"",g(ly,10,"Coverage");var JTe;(function(n){n.CancelTestRefreshAction="testing.cancelTestRefresh",n.CancelTestRunAction="testing.cancelRun",n.ClearTestResultsAction="testing.clearTestResults",n.CollapseAllAction="testing.collapseAll",n.ConfigureTestProfilesAction="testing.configureProfile",n.ContinousRunUsingForTest="testing.continuousRunUsingForTest",n.CoverageAtCursor="testing.coverageAtCursor",n.CoverageByUri="testing.coverage.uri",n.CoverageClear="testing.coverage.close",n.CoverageCurrentFile="testing.coverageCurrentFile",n.CoverageFilterToTest="testing.coverageFilterToTest",n.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",n.CoverageLastRun="testing.coverageLastRun",n.CoverageSelectedAction="testing.coverageSelected",n.CoverageToggleToolbar="testing.coverageToggleToolbar",n.CoverageViewChangeSorting="testing.coverageViewChangeSorting",n.DebugAction="testing.debug",n.DebugAllAction="testing.debugAll",n.DebugAtCursor="testing.debugAtCursor",n.DebugByUri="testing.debug.uri",n.DebugCurrentFile="testing.debugCurrentFile",n.DebugFailedTests="testing.debugFailTests",n.DebugLastRun="testing.debugLastRun",n.DebugSelectedAction="testing.debugSelected",n.FilterAction="workbench.actions.treeView.testExplorer.filter",n.GetExplorerSelection="_testing.getExplorerSelection",n.GetSelectedProfiles="testing.getSelectedProfiles",n.GoToTest="testing.editFocusedTest",n.HideTestAction="testing.hideTest",n.OpenCoverage="testing.openCoverage",n.OpenOutputPeek="testing.openOutputPeek",n.RefreshTestsAction="testing.refreshTests",n.ReRunFailedTests="testing.reRunFailTests",n.ReRunLastRun="testing.reRunLastRun",n.RunAction="testing.run",n.RunAllAction="testing.runAll",n.RunAllWithCoverageAction="testing.coverageAll",n.RunAtCursor="testing.runAtCursor",n.RunByUri="testing.run.uri",n.RunCurrentFile="testing.runCurrentFile",n.RunSelectedAction="testing.runSelected",n.RunUsingProfileAction="testing.runUsing",n.RunWithCoverageAction="testing.coverage",n.SearchForTestExtension="testing.searchForTestExtension",n.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",n.ShowMostRecentOutputAction="testing.showMostRecentOutput",n.StartContinousRun="testing.startContinuousRun",n.StopContinousRun="testing.stopContinuousRun",n.TestingSortByDurationAction="testing.sortByDuration",n.TestingSortByLocationAction="testing.sortByLocation",n.TestingSortByStatusAction="testing.sortByStatus",n.TestingViewAsListAction="testing.viewAsList",n.TestingViewAsTreeAction="testing.viewAsTree",n.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",n.ToggleInlineTestOutput="testing.toggleInlineTestOutput",n.UnhideAllTestsAction="testing.unhideAllTests",n.UnhideTestAction="testing.unhideTest"})(JTe||(JTe={}));let fni=0;const L6e=new WeakMap;let XTe=class extends ${constructor(e,t,i,s){super(),this.logService=t,this.commands=i,this.editors=s,this.resultsChangedEmitter=this._register(new I),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new I),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(Ue.MainThreadTesting),this.observer=new bni(this.proxy),this.runTracker=new _ni(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case Fs.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(bn.root(a))?.collection.tree.get(a)?.actual??q7e(o)}case Fs.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(bn.root(c))?.collection.tree.get(c)?.actual??q7e({$mid:Fs.TestItemContext,tests:[r]}),message:P4.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(JTe.GetExplorerSelection),r=a=>{const c=this.controllers.get(bn.root(a));if(c)return bn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(yl)||[],exclude:o?.exclude.map(r).filter(yl)||[]}})}createTestController(e,t,i,s){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const o=new Z,r=o.add(new Eti(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d={items:r.root.children,get label(){return i},set label(u){i=u,r.root.label=u,l.$updateController(t,{label:i})},get refreshHandler(){return s},set refreshHandler(u){s=u,l.$updateController(t,{canRefresh:!!u})},get id(){return t},createRunProfile:(u,f,p,m,v,w)=>{let b=Ed(u);for(;a.has(b);)b++;return new Vat(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,b,u,f,p,m,v,w)},createTestItem(u,f,p){return new MO(t,u,f,p)},createTestRun:(u,f,p=!0)=>this.runTracker.createTestRun(e,t,r,u,f,p),invalidateTestResults:u=>{if(u===void 0)this.proxy.$markTestRetired(void 0);else{const f=u instanceof Array?u:[u];this.proxy.$markTestRetired(f.map(p=>bn.fromExtHostTestItem(p,t).toString()))}},set resolveHandler(u){r.resolveHandler=u},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}};l.$registerTestController(t,i,!!s),o.add(Ee(()=>l.$unregisterTestController(t)));const h={controller:d,collection:r,profiles:a,extension:e,activeProfiles:c};return this.controllers.set(t,h),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(u=>l.$publishDiff(t,u.map(x4.serialize)))),d}createTestObserver(){return this.observer.checkout()}async runTests(e,t=qe.None){const i=Uat(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const s=this.controllers.get(i.controllerId);if(!s)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,targets:[{testIds:e.include?.map(o=>bn.fromExtHostTestItem(o,s.collection.root.id).toString())??[s.collection.root.id],profileGroup:sBe[i.kind],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(o=>o.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t){return(await this.runTracker.getCoverageDetails(e,t))?.map(boe.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){const t=new Map;for(const[i,s]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=s.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!s.includes(l));for(const l of a)r.set(l,!0),o.activeProfiles.add(l);for(const l of c)r.set(l,!1),o.activeProfiles.delete(l);r.size&&t.set(i,r)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(t=>{const i=_Ie.to(t);return L6e.set(i,t.id),i}).concat(this.results).sort((t,i)=>i.completedAt-t.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){const i=this.controllers.get(bn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>x4.deserialize({asCanonicalUri:i=>i},t)))}async $runControllerTests(e,t){return Promise.all(e.map(i=>this.runControllerTestRequest(i,!1,t)))}async $startContinuousRun(e,t){const i=new ai(t),s=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!s.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),s}async $provideTestFollowups(e,t){const i=this.results.find(r=>L6e.get(r)===e.resultId),s=i&&Cni(bn.fromString(e.extId),i?.results);if(!s)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,s,e.taskIndex,e.messageIndex,t);a&&(o=o.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:o.map(r=>{const a=fni++;return this.testFollowups.set(a,r),{title:r.title,id:a}})}$disposeTestFollowups(e){for(const t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){const t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}async runControllerTestRequest(e,t,i){const s=this.controllers.get(e.controllerId);if(!s)return{};const{collection:o,profiles:r,extension:a}=s,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(yl),d=e.excludeExtIds.map(f=>s.collection.tree.get(f)).filter(yl).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===lb.IsChild));if(!l.length)return{};const h=new hG(l.some(f=>f.actual instanceof jOe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=Zjt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,fq.fromInternal(e,s.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await T.toPromise(u.onEnd)}}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}};XTe=D([_(0,gr),_(1,Ze)],XTe);const pni=1e4;var lk;(function(n){n[n.Running=0]="Running",n[n.Cancelling=1]="Cancelling",n[n.Ended=2]="Ended"})(lk||(lk={}));class mni extends ${get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,s,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=s,this.extension=o,this.state=lk.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new I),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new ai(r));const a=this._register(new yn(()=>this.forciblyEndTasks(),pni));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}cancel(){this.state===lk.Running?(this.cts.cancel(),this.state=lk.Cancelling):this.state===lk.Cancelling&&this.forciblyEndTasks()}getCoverageDetails(e,t){const[,i]=bn.fromString(e).path,s=this.publishedCoverage.get(e);if(!s)return[];const o=this.tasks.get(i);if(!o)throw new Error("unreachable: run task was not found");return this.profile?.loadDetailedCoverage?.(o.run,s,t)??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,s=Dr(),o=d=>(h,...u)=>{if(a){this.logService.warn(`Setting the state of test "${h.id}" is a no-op after the run ends.`);return}this.dto.isIncluded(h)&&(this.ensureTestIsKnown(h),d(h,...u))},r=(d,h)=>{const u=h instanceof Array?h.map(P4.from):[P4.from(h)];if(d.uri&&d.range){const f={range:at.from(d.range),uri:d.uri};for(const p of u)p.location=p.location||f}this.proxy.$appendTestMessagesInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),u)};let a=!1;const c=new Map,l={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:d=>{if(a)return;const h=d instanceof uG?d.testItem:void 0;let u;if(h){if(Je(this.extension,"attributableCoverage"),!this.dto.isIncluded(h))throw new Error("Attempted to `addCoverage` for a test item not included in the run");this.ensureTestIsKnown(h),u=c.get(h),u===void 0&&(u=c.size,c.set(h,u))}const f=d.uri.toString(),p=new bn(u!==void 0?[t,s,f,String(u)]:[t,s,f]).toString();this.publishedCoverage.set(p,d),this.proxy.$appendCoverage(t,s,boe.fromFile(i,p,d))},enqueued:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Queued)}),skipped:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Skipped)}),started:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Running)}),errored:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Errored,u)}),failed:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Failed,u)}),passed:o((d,h)=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,this.dto.controllerId).toString(),Xn.Passed,h)}),appendOutput:(d,h,u)=>{a||(u&&(this.dto.isIncluded(u)?this.ensureTestIsKnown(u):u=void 0),this.proxy.$appendOutputToRun(t,s,ze.fromString(d),h&&P_.from(h),u&&bn.fromExtHostTestItem(u,i).toString()))},end:()=>{a||(a=!0,c.clear(),this.proxy.$finishedTestRunTask(t,s),--this.running||this.markEnded())}};return this.running++,this.tasks.set(s,{run:l}),this.proxy.$startedTestRunTask(t,{id:s,name:e,running:!0}),l}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==lk.Ended&&(this.state=lk.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof MO))throw new eoe(e.id);if(this.sharedTestIds.has(bn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const s=J1.from(e);if(t.unshift(s),this.sharedTestIds.has(s.extId)||(this.sharedTestIds.add(s.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class _ni{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t){const i=bn.root(e);return this.trackedById.get(i)?.getCoverageDetails(e,t)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(const[t,{id:i}]of this.tracked)i===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,i,s,o){return this.getTracker(t,i,s,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,s,o,r){const a=this.tracked.get(s);if(a)return a.createRun(o);const c=fq.fromPublic(t,i,s,r),l=Uat(s);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!s.continuous,profile:l&&{group:sBe[l.kind],id:l.profileId},exclude:s.exclude?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:s.include?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:s.preserveFocus??!0,persist:r});const d=this.getTracker(s,c,s.profile,e);return T.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,s,o){const r=new mni(t,this.proxy,this.logService,i,s,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const Uat=n=>{if(n.profile){if(!(n.profile instanceof Vat))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return n.profile}};class fq{static fromPublic(e,t,i,s){return new fq(e,Dr(),i.include?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[e],i.exclude?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[],s,t)}static fromInternal(e,t){return new fq(e.controllerId,e.runId,e.testIds,e.excludeExtIds,!0,t)}constructor(e,t,i,s,o,r){this.controllerId=e,this.id=t,this.isPersisted=o,this.colllection=r,this.includePrefix=i.map(a=>a+qf.Delimiter),this.excludePrefix=s.map(a=>a+qf.Delimiter)}isIncluded(e){const t=bn.fromExtHostTestItem(e,this.controllerId).toString()+qf.Delimiter;for(const i of this.excludePrefix)if(t===i||t.startsWith(i))return!1;for(const i of this.includePrefix)if(t===i||t.startsWith(i))return!0;return!1}}class vni{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,J1.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.has(e)){this.added.delete(e);return}this.updated.delete(e);const t=bn.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){const{added:e,updated:t,removed:i}=this;return{get added(){return[...e].map(s=>s.revived)},get updated(){return[...t].map(s=>s.revived)},get removed(){return[...i].map(s=>s.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class wni extends tKt{constructor(){super(...arguments),this.changeEmitter=new I,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:J1.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new vni(this.changeEmitter)}}class bni{constructor(e){this.proxy=e}checkout(){this.current||(this.current=this.createObserverData());const e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(t=>t.revived)},dispose:cw(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){const e=new wni({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const j5=(n,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(n.controllerId,n.profileId,i)};var ub,jR,Iq,Ym,XH;class Vat{constructor(e,t,i,s,o,r,a,c,l,d=!1,h=void 0,u=!1){kt(this,ub);kt(this,jR);kt(this,Iq);kt(this,Ym);kt(this,XH);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,st(this,ub,e),st(this,XH,t),st(this,jR,i),st(this,Iq,s),t.set(r,this);const f=sBe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),st(this,Ym,{profileId:r,controllerId:o,tag:h?hC.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{se(this,Ym)&&(se(this,ub).$publishTestRunProfile(se(this,Ym)),st(this,Ym,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,j5(this,se(this,ub),se(this,Ym),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,j5(this,se(this,ub),se(this,Ym),{supportsContinuousRun:e}))}get isDefault(){return se(this,jR).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?se(this,jR).add(this.profileId):se(this,jR).delete(this.profileId),j5(this,se(this,ub),se(this,Ym),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,j5(this,se(this,ub),se(this,Ym),{tag:e?hC.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,j5(this,se(this,ub),se(this,Ym),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return T.chain(se(this,Iq),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(yl))}dispose(){se(this,XH)?.delete(this.profileId)&&(st(this,XH,void 0),se(this,ub).$removeTestProfile(this.controllerId,this.profileId)),st(this,Ym,void 0)}}ub=new WeakMap,jR=new WeakMap,Iq=new WeakMap,Ym=new WeakMap,XH=new WeakMap;const sBe={[HM.Coverage]:Yu.Coverage,[HM.Debug]:Yu.Debug,[HM.Run]:Yu.Run};function Cni(n,e){for(let t=0;ts.id===n.path[t]);if(!i)return;if(t===n.path.length-1)return i;e=i.children}}class yni{constructor(e,t){this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new I,this._onDidChangeTextEditorOptions=new I,this._onDidChangeTextEditorVisibleRanges=new I,this._onDidChangeTextEditorViewColumn=new I,this._onDidChangeActiveTextEditor=new I,this._onDidChangeVisibleTextEditors=new I,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(Ue.MainThreadTextEditors),this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i)),this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let s;typeof t=="number"?s={position:yd.from(t),preserveFocus:i}:typeof t=="object"?s={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:s={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,s),r=o&&this._extHostDocumentsAndEditors.getEditor(o);if(r)return r.value;throw o?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new KLe(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const s=t.selections.selections.map(ZS.to);i._acceptSelections(s)}if(t.visibleRanges){const s=Vi(t.visibleRanges.map(at.to));i._acceptVisibleRanges(s)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:oH.to(t.options.lineNumbers)}}),t.selections){const s=HF.fromValue(t.selections.source),o=t.selections.selections.map(ZS.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:s})}if(t.visibleRanges){const s=Vi(t.visibleRanges.map(at.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:s})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const s=yd.to(e[t]);i.value.viewColumn!==s&&(i._acceptViewColumn(s),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:s}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let ZTe=class{constructor(e){this._actual=new Sse(uE.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=uE.Light;break;case"hcDark":t=uE.HighContrast;break;case"hcLight":t=uE.HighContrastLight;break;default:t=uE.Dark}this._actual=new Sse(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};ZTe=D([_(0,gr)],ZTe);class Sni{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Ue.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,s)=>{if(i&&i.$mid===Fs.TimelineActionContext)if(this._providers.get(i.source)&&Cn.equals(s,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:P.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(T6e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,s){return this._providers.get(e)?.provider.provideTimeline(P.revive(t),i,s)}registerTimelineProvider(e,t,i,s){const o=new Z,r=this.convertTimelineItem(t.id,s,o).bind(this);let a;t.onDidChange&&(a=t.onDidChange(l=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...l,id:t.id}),this));const c=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(l,d,h){d?.resetCache&&(o.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=r(l,d);return{...u,source:t.id,items:u.items.map(f)}},dispose(){for(const l of c.values())l.get(t.id)?.clear();a?.dispose(),o.dispose()}},i)}convertTimelineItem(e,t,i){return(s,o)=>{let r;if(o?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=T6e(s);r=a.get(c),r===void 0&&(r=new Map,a.set(c,r))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;r?.set(d,a);let h,u,f;a.iconPath&&(c instanceof fg?f={id:c.id,color:c.color}:P.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return vp.isMarkdownString(l.tooltip)?p=Qs.from(l.tooltip):$t(l.tooltip)?p=l.tooltip:vp.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Qs.from(l.detail)):$t(l.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=l.detail),{...l,id:l.id??void 0,handle:d,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:h,iconDark:u,themeIcon:f,tooltip:p,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),Ee(()=>{for(const s of this._itemsBySourceAndUriMap.values())s.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function T6e(n){return n?.toString()}const Ani="vs/workbench/api/common/extHostTreeViews";function R6e(n,e){if($t(n))return{label:n};if(n&&typeof n=="object"&&typeof n.label=="string"){let t;return Array.isArray(n.highlights)&&(t=n.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:n.label,highlights:t}}}class Eni extends ${constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new wPe;function s(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>s(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>s(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const s=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>s.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const s=t.dragAndDropController?.dropMimeTypes??[],o=t.dragAndDropController?.dragMimeTypes??[],r=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:s,dragMimeTypes:o,hasHandleDrag:r,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},d=this._proxy.$registerTreeViewDataProvider(e,l),h={get onDidCollapseElement(){return c.onDidCollapseElement},get onDidExpandElement(){return c.onDidExpandElement},get selection(){return c.selectedElements},get onDidChangeSelection(){return c.onDidChangeSelection},get activeItem(){return Je(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Je(i,"treeViewActiveItem"),c.onDidChangeActiveItem},get visible(){return c.visible},get onDidChangeVisibility(){return c.onDidChangeVisibility},get onDidChangeCheckboxState(){return c.onDidChangeCheckboxState},get message(){return c.message},set message(u){ah(u)&&Je(i,"treeViewMarkdownMessage"),c.message=u},get title(){return c.title},set title(u){c.title=u},get description(){return c.description},set description(u){c.description=u},get badge(){return c.badge},set badge(u){u!==void 0&&hke.isViewBadge(u)?c.badge={value:Math.floor(Math.abs(u.value)),tooltip:u.tooltip}:u===void 0&&(c.badge=void 0)},reveal:(u,f)=>c.reveal(u,f),dispose:async()=>{await d,this.treeViews.delete(e),c.dispose()}};return this._register(h),h}$getChildren(e,t){const i=this.treeViews.get(e);return i?i.getChildren(t):Promise.reject(new kC(e))}async $handleDrop(e,t,i,s,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new kC(e));const d=rw.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,o,r),l.onDrop(d,s,o)}async addAdditionalTransferItems(e,t,i,s,o){const r=this.treeDragAndDropService.removeDragOperationTransfer(o);if(r)(await r)?.forEach((a,c)=>{a&&e.set(c,a)});else if(o&&t.handleDrag){const a=t.handleDrag(i,e,s);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,s){const o=this.treeViews.get(e);if(!o)return Promise.reject(new kC(e));const r=await this.addAdditionalTransferItems(new h4,o,t,s,i);if(!(!r||s.isCancellationRequested))return rw.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new kC(e);return t.hasResolve}$resolve(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);return s.resolveTreeItem(t,i)}$setExpanded(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new kC(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new kC(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const s=this._register(new eRe(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,s),s}convertArgument(e){const t=this.treeViews.get(e.$treeViewId);return t&&"$treeItemHandle"in e?t.getExtensionElement(e.$treeItemHandle):t&&"$focusedTreeItem"in e&&e.$focusedTreeItem?t.focusedElement:null}}const CW=class CW extends ${get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!hc(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,s,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=s,this.logService=o,this.extension=r,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new I),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new I),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new I),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new I),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new I),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new ai,r.contributes&&r.contributes.views)for(const d in r.contributes.views)for(const h of r.contributes.views[d])h.id===e&&(this._title=h.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(d=>{Array.isArray(d)&&d.length===0||this._onDidChangeData.fire({message:!1,element:d})}));let a,c;const l=T.debounce(this._onDidChangeData.event,(d,h)=>(d||(d={message:!1,elements:[]}),h.element!==!1&&(a||(a=new Promise(u=>c=u),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(h.element)?d.elements.push(...h.element):d.elements.push(h.element)),h.message&&(d.message=!0),d),200,!0);this._register(l(({message:d,elements:h})=>{h.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const u=c;return a=null,this.refresh(h).then(()=>u())})),d&&this.proxy.$setMessage(this.viewId,Qs.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(s=>s.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=hc(t.select)?!0:t.select,s=hc(t.focus)?!1:t.focus,o=hc(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(r=>this.resolveTreeNode(e,r[r.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:r.map(c=>c.item)},{select:i,focus:s,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:s,expand:o})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=Coe.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!Ls(this._selectedHandles,e);this._selectedHandles=e;const s=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),s&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const s=this.getExtensionElement(i.treeItemHandle);return s?{extensionItem:s,treeItem:await this.dataProvider.getTreeItem(s),newState:i.newState?Lb.Checked:Lb.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?Lb.Checked:Lb.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const s=[];for(const o of e){const r=this.getExtensionElement(o);r&&s.push(r)}if(!(!this.dndController?.handleDrag||s.length===0))return await this.dndController.handleDrag(s,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const s=t?this.getExtensionElement(t):void 0;if(!(!s&&t||!this.dndController?.handleDrop))return Zu(()=>this.dndController?.handleDrop?this.dndController.handleDrop(s,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const s=this.nodes.get(i);if(s){const o=await this.dataProvider.resolveTreeItem(s.extensionItem,i,t)??s.extensionItem;return this.validateTreeItem(o),s.item.tooltip=this.getTooltip(o.tooltip),s.item.command=this.getCommand(s.disposableStore,o.command),s.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(s=>(i.push(s),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):Zu(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Zu(()=>this.dataProvider.getTreeItem(e)).then(s=>this.createHandle(e,s,t,!0)).then(s=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(s);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${s} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new ai(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,s=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Vi(s||[]),r=await Promise.all(Vi(o).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=r.map((c,l)=>c?this.createAndRegisterTreeNode(o[l],c,i):null);return Vi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ai,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(o=>this.nodes.get(o));for(const o of i)if(o&&!t.has(o.item.handle)){let r=o;for(;r&&r.parent&&i.findIndex(a=>r&&r.parent&&a&&a.item.handle===r.parent.item.handle)===-1;){const a=this.elements.get(r.parent.item.handle);r=a?this.nodes.get(a):void 0}r&&!r.parent&&t.add(o.item.handle)}const s=[];return t.forEach(o=>{const r=this.elements.get(o);if(r){const a=this.nodes.get(r);a&&(!a.parent||!t.has(a.parent.item.handle))&&s.push(o)}}),s}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(s=>{s&&(t[i]=s.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),Zu(()=>this.dataProvider.getTreeItem(t)).then(s=>{if(s){const o=this.createTreeNode(t,s,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const s=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(s.item.handle))throw new Error(g(Ani,0,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,s),this.addNodeToParentCache(s,i),s}getTooltip(e){return vp.isMarkdownString(e)?Qs.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,s;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,s=e.checkboxState.accessibilityInformation),{isChecked:t===Lb.Checked,tooltip:i,accessibilityInformation:s}}validateTreeItem(e){if(!q6.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const s=this._register(new Z),o=this.createHandle(e,t,i),r=this.getLightIconPath(t);return{item:{handle:o,parentHandle:i?i.item.handle:void 0,label:R6e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(s,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:hc(t.collapsibleState)?zI.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:s,dispose(){s.dispose()}}}getThemeIcon(e){return e.iconPath instanceof fg?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:s},o,r){if(t)return`${CW.ID_HANDLE_PREFIX}/${t}`;const a=R6e(i),c=o?o.item.handle:CW.LABEL_HANDLE_PREFIX;let l=a?a.label:s?ui(s):"";l=l.indexOf("/")!==-1?l.replace("/","//"):l;const d=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,h=this.getChildrenNodes(o)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,r||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg))return typeof e.iconPath=="string"||P.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return P.isUri(e)?e:P.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,s){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const o=this.getChildrenNodes(s)||[],r=o.filter(a=>a.item.handle===i.item.handle)[0];r&&o.splice(o.indexOf(r),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};CW.LABEL_HANDLE_PREFIX="0",CW.ID_HANDLE_PREFIX="1";let eRe=CW;const Rle=class Rle{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Ue.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,s){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=s.schemes.find(r=>!Rle.supportedSchemes.has(r));if(o)throw new Error(`Scheme '${o}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,s.schemes,e,s.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener with id: ${e}`);const o=P.revive(t);return s.canOpenExternalUri(o,i)}async $openUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener id: '${e}'`);return s.openExternalUri(P.revive(t.resolvedUri),{sourceUri:P.revive(t.sourceUri)},i)}};Rle.supportedSchemes=new Set([_e.http,_e.https]);let tRe=Rle;const Mle=class Mle{constructor(e){this.handles=new $v,this.handlers=new Map,this._proxy=e.getProxy(Ue.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const s=Mle.HandlePool++;return this.handles.add(i),this.handlers.set(s,t),this._proxy.$registerUriHandler(s,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(s),this._proxy.$unregisterUriHandler(s)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(P.revive(t))}catch(s){bt(s)}return Promise.resolve(void 0)}async createAppUri(e){return P.revive(await this._proxy.$createAppUri(e))}};Mle.HandlePool=0;let iRe=Mle;var Tk,Rk,Lq,ZH,Tq,KR,eU,JA,tU,iU,Mk,nU,sU;class xni extends ${constructor(t,i,s,o){super();kt(this,Tk);kt(this,Rk);kt(this,Lq);kt(this,ZH);kt(this,Tq);kt(this,KR);kt(this,eU);kt(this,JA);kt(this,tU);kt(this,iU);kt(this,Mk);kt(this,nU);kt(this,sU);st(this,JA,void 0),st(this,tU,!0),st(this,Mk,!1),st(this,nU,this._register(new I)),this.onDidDispose=se(this,nU).event,st(this,sU,this._register(new I)),this.onDidChangeViewState=se(this,sU).event,st(this,Tk,t),st(this,Rk,i),st(this,ZH,s),st(this,Lq,o.viewType),st(this,Tq,o.panelOptions),st(this,JA,o.viewColumn),st(this,KR,o.title),st(this,iU,o.active)}dispose(){se(this,Mk)||(st(this,Mk,!0),se(this,nU).fire(),se(this,Rk).$disposeWebview(se(this,Tk)),se(this,ZH).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),se(this,ZH)}get viewType(){return this.assertNotDisposed(),se(this,Lq)}get title(){return this.assertNotDisposed(),se(this,KR)}set title(t){this.assertNotDisposed(),se(this,KR)!==t&&(st(this,KR,t),se(this,Rk).$setTitle(se(this,Tk),t))}get iconPath(){return this.assertNotDisposed(),se(this,eU)}set iconPath(t){this.assertNotDisposed(),se(this,eU)!==t&&(st(this,eU,t),se(this,Rk).$setIconPath(se(this,Tk),P.isUri(t)?{light:t,dark:t}:t))}get options(){return se(this,Tq)}get viewColumn(){if(this.assertNotDisposed(),!(typeof se(this,JA)=="number"&&se(this,JA)<0))return se(this,JA)}get active(){return this.assertNotDisposed(),se(this,iU)}get visible(){return this.assertNotDisposed(),se(this,tU)}_updateViewState(t){se(this,Mk)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(st(this,iU,t.active),st(this,tU,t.visible),st(this,JA,t.viewColumn),se(this,sU).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),se(this,Rk).$reveal(se(this,Tk),{viewColumn:typeof t>"u"?void 0:yd.from(t),preserveFocus:!!i})}assertNotDisposed(){if(se(this,Mk))throw new Error("Webview is disposed")}}Tk=new WeakMap,Rk=new WeakMap,Lq=new WeakMap,ZH=new WeakMap,Tq=new WeakMap,KR=new WeakMap,eU=new WeakMap,JA=new WeakMap,tU=new WeakMap,iU=new WeakMap,Mk=new WeakMap,nU=new WeakMap,sU=new WeakMap;class oBe extends ${static newHandle(){return Dr()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,s,o={}){const r=typeof s=="object"?s.viewColumn:s,a={viewColumn:yd.from(r),preserveFocus:typeof s=="object"&&!!s.preserveFocus},c=q4(e),l=oBe.newHandle();this._proxy.$createWebviewPanel(Tre(e),l,t,{title:i,panelOptions:Dni(o),webviewOptions:Oat(e,this.workspace,o),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,o,e);return this.createNewWebviewPanel(l,t,i,r,o,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,s)=>{const o=e[i],r=e[s];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const s=this.getWebviewPanel(i);if(!s)continue;const o=e[i];s._updateViewState({active:o.active,visible:o.visible,viewColumn:yd.to(o.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,s){const o=this._serializers.get(t);if(!o)throw new Error(`No serializer found for '${t}'`);const{serializer:r,extension:a}=o,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,s,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,s,o,r,a){const c=new xni(e,this._proxy,r,{viewType:t,title:i,viewColumn:s,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function Dni(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}var Nk,Pk,Rq,oU,Fk,YR,JR,rU,XR,aU,cU;class kni extends ${constructor(t,i,s,o,r,a){super();kt(this,Nk);kt(this,Pk);kt(this,Rq);kt(this,oU);kt(this,Fk);kt(this,YR);kt(this,JR);kt(this,rU);kt(this,XR);kt(this,aU);kt(this,cU);st(this,Fk,!1),st(this,aU,this._register(new I)),this.onDidChangeVisibility=se(this,aU).event,st(this,cU,this._register(new I)),this.onDidDispose=se(this,cU).event,st(this,Rq,s),st(this,JR,o),st(this,Nk,t),st(this,Pk,i),st(this,oU,r),st(this,YR,a)}dispose(){se(this,Fk)||(st(this,Fk,!0),se(this,cU).fire(),se(this,oU).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),se(this,JR)}set title(t){this.assertNotDisposed(),se(this,JR)!==t&&(st(this,JR,t),se(this,Pk).$setWebviewViewTitle(se(this,Nk),t))}get description(){return this.assertNotDisposed(),se(this,rU)}set description(t){this.assertNotDisposed(),se(this,rU)!==t&&(st(this,rU,t),se(this,Pk).$setWebviewViewDescription(se(this,Nk),t))}get visible(){return se(this,YR)}get webview(){return se(this,oU)}get viewType(){return se(this,Rq)}_setVisible(t){t===se(this,YR)||se(this,Fk)||(st(this,YR,t),se(this,aU).fire())}get badge(){return this.assertNotDisposed(),se(this,XR)}set badge(t){this.assertNotDisposed(),!(t?.value===se(this,XR)?.value&&t?.tooltip===se(this,XR)?.tooltip)&&(st(this,XR,Coe.from(t)),se(this,Pk).$setWebviewViewBadge(se(this,Nk),t))}show(t){this.assertNotDisposed(),se(this,Pk).$show(se(this,Nk),!!t)}assertNotDisposed(){if(se(this,Fk))throw new Error("Webview is disposed")}}Nk=new WeakMap,Pk=new WeakMap,Rq=new WeakMap,oU=new WeakMap,Fk=new WeakMap,YR=new WeakMap,JR=new WeakMap,rU=new WeakMap,XR=new WeakMap,aU=new WeakMap,cU=new WeakMap;class Ini{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,s){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(Tre(e),t,{retainContextWhenHidden:s?.retainContextWhenHidden,serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,s,o){const r=this._viewProviders.get(t);if(!r)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=r,l=this._extHostWebview.createNewWebview(e,{},c),d=new kni(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:s},o)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}function Lni(n){const e=n.get(Sg),t=n.get(Kz),i=n.get(fue),s=n.get(_L),o=n.get(dD),r=n.get(mue),a=n.get(hD),c=n.get(pue),l=n.get(gr),d=n.get(KOe),h=n.get(YOe),u=n.get(wp),f=n.get(Ze),p=n.get(OOe),m=n.get(_ue),v=n.get(Nat),w=n.get(ZOe),b=n.get(rj),C=n.get(tBe),y=n.get(JOe),S=n.get(XOe);l.set(et.ExtHostFileSystemInfo,t),l.set(et.ExtHostLogLevelServiceShape,u),l.set(et.ExtHostWorkspace,o),l.set(et.ExtHostConfiguration,a),l.set(et.ExtHostExtensionService,s),l.set(et.ExtHostStorage,d),l.set(et.ExtHostTunnelService,p),l.set(et.ExtHostWindow,v),l.set(et.ExtHostSecretState,w),l.set(et.ExtHostTelemetry,r),l.set(et.ExtHostEditorTabs,b),l.set(et.ExtHostManagedSockets,C),l.set(et.ExtHostAuthentication,y),l.set(et.ExtHostChatProvider,S);const M=l.set(et.ExtHostDecorations,n.get(yat)),k=l.set(et.ExtHostDocumentsAndEditors,n.get(oj)),F=l.set(et.ExtHostCommands,n.get(Yz)),N=l.set(et.ExtHostTerminalService,n.get(Jz)),z=l.set(et.ExtHostTerminalShellIntegration,n.get(Pat)),U=l.set(et.ExtHostDebugService,n.get(Rat)),J=l.set(et.ExtHostSearch,n.get(Mat)),j=l.set(et.ExtHostTask,n.get(xat)),re=l.set(et.ExtHostOutputService,n.get(bat)),me=l.set(et.ExtHostLocalization,n.get(eBe)),De=l.set(et.ExtHostUrls,new iRe(l)),Qe=l.set(et.ExtHostDocuments,new Oii(l,k)),Tt=l.set(et.ExtHostDocumentContentProviders,new MTe(l,k,f)),Oe=l.set(et.ExtHostDocumentSaveParticipant,new Fii(f,Qe,l.getProxy(Ue.MainThreadBulkEdits))),wt=l.set(et.ExtHostNotebook,new BTe(l,F,k,Qe,i,J,f)),Nt=l.set(et.ExtHostNotebookDocuments,new Jii(wt)),Ji=l.set(et.ExtHostNotebookEditors,new WTe(f,wt)),zi=l.set(et.ExtHostNotebookKernels,new HTe(l,e,wt,F,f)),Gn=l.set(et.ExtHostNotebookRenderers,new eni(l,wt)),Ro=l.set(et.ExtHostNotebookDocumentSaveParticipant,new Yii(f,wt,l.getProxy(Ue.MainThreadBulkEdits))),qn=l.set(et.ExtHostEditors,new yni(l,k)),tc=l.set(et.ExtHostTreeViews,new Eni(l.getProxy(Ue.MainThreadTreeViews),F,f)),ys=l.set(et.ExtHostEditorInsets,new bii(l.getProxy(Ue.MainThreadEditorInsets),qn,e.remote)),mr=l.set(et.ExtHostDiagnostics,new RTe(l,f,t,k)),ba=l.set(et.ExtHostLanguages,new Qii(l,Qe,F.converter,c)),ki=l.set(et.ExtHostLanguageFeatures,new NTe(l,c,Qe,F,mr,f,m,r)),gs=l.set(et.ExtHostFileSystem,new Mre(l,ki)),ir=l.set(et.ExtHostFileSystemEventService,new zii(l,f,k)),Hn=l.set(et.ExtHostQuickOpen,sni(l,o,F)),vc=l.set(et.ExtHostSCM,new QTe(l,F,Qe,f)),gh=l.set(et.ExtHostQuickDiff,new $Te(l,c)),Qn=l.set(et.ExtHostShare,new jTe(l,c)),Yh=l.set(et.ExtHostComments,Cii(l,F,Qe)),tl=l.set(et.ExtHostProgress,new ini(l.getProxy(Ue.MainThreadProgress))),Tl=l.set(et.ExtHostLabelService,new Gii(l)),to=l.set(et.ExtHostTheming,new ZTe(l)),Oc=l.set(et.ExtHostTimeline,new Sni(l,F)),rd=l.set(et.ExtHostWebviews,new Aii(l,e.remote,o,f,m)),Jh=l.set(et.ExtHostWebviewPanels,new oBe(l,rd,o)),Af=l.set(et.ExtHostCustomEditors,new Lii(l,Qe,h,rd,Jh)),il=l.set(et.ExtHostWebviewViews,new Ini(l,rd)),Rl=l.set(et.ExtHostTesting,new XTe(l,f,F,k)),Xh=l.set(et.ExtHostUriOpeners,new tRe(l)),ul=l.set(et.ExtHostProfileContentHandlers,new tni(l));l.set(et.ExtHostInteractive,new $ii(l,wt,k,F,f));const ad=l.set(et.ExtHostChatAgents2,new ITe(l,f,F,e.quality)),wc=l.set(et.ExtHostChatVariables,new LTe(l)),Ca=l.set(et.ExtHostAiRelatedInformation,new uii(l)),Ld=l.set(et.ExtHostAiEmbeddingVector,new Wii(l)),fh=l.set(et.ExtHostStatusBar,new gni(l,F.converter)),Fu=l.set(et.ExtHostSpeech,new KTe(l)),bc=l.set(et.ExtHostEmbeddings,new Bii(l)),Zh=Object.values(et);l.assertRegistered(Zh);const Cc=new kTe(l,k),nr=new _ii(l),Rs=new PTe(l,f),Ml=new Pii(l);return fii.register(F),function(Se,Mo,cd){function K(R){return(H,ie,je)=>{const pt=R(is=>{try{H.call(ie,is)}catch(Ss){er(new Error(`[ExtensionListenerError] Extension '${Se.identifier.value}' FAILED to handle event: ${Ss.toString()}`,{cause:Ss})),r.onExtensionError(Se.identifier,Ss)}});return je?.push(pt),pt}}const Le=function(){let R=!Se.isUnderDevelopment;function H(){R||(f.info(`Extension '${Se.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),R=!0)}return function ie(je){if(Array.isArray(je))je.forEach(ie);else if(typeof je=="string")H();else{const pt=je;typeof pt.scheme>"u"&&H(),typeof pt.exclusive=="boolean"&&Je(Se,"documentFiltersExclusive")}return je}}(),ri={getSession(R,H,ie){return typeof ie?.forceNewSession=="object"&&ie.forceNewSession.learnMore&&Je(Se,"authLearnMore"),y.getSession(Se,R,H,ie)},getSessions(R,H){return Je(Se,"authGetSessions"),y.getSessions(Se,R,H)},async hasSession(R,H){return Je(Se,"authSession"),!!await y.getSession(Se,R,H,{silent:!0})},get onDidChangeSessions(){return K(y.onDidChangeSessions)},registerAuthenticationProvider(R,H,ie,je){return y.registerAuthenticationProvider(R,H,ie,je)}},ts={registerCommand(R,H,ie){return F.registerCommand(!0,R,H,ie,void 0,Se)},registerTextEditorCommand(R,H,ie){return F.registerCommand(!0,R,(...je)=>{const pt=qn.getActiveTextEditor();if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}return pt.edit(is=>{H.apply(ie,[pt,is,...je])}).then(is=>{is||f.warn("Edits from command "+R+" were not applied.")},is=>{f.warn("An error occurred while running command "+R,is)})},void 0,void 0,Se)},registerDiffInformationCommand:(R,H,ie)=>(Je(Se,"diffCommand"),F.registerCommand(!0,R,async(...je)=>{const pt=k.activeEditor(!0);if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}const is=await qn.getDiffInformation(pt.id);H.apply(ie,[is,...je])},void 0,void 0,Se)),executeCommand(R,...H){return F.executeCommand(R,...H)},getCommands(R=!1){return F.getCommands(R)}},Os={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return nr.value},get shell(){return N.getDefaultShell(!1)},get onDidChangeShell(){return K(N.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return K(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Je(Se,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Je(Se,"telemetry"),K(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return Aat(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(R,H){return Sat.validateSender(R),r.instantiateLogger(Se,R,H)},openExternal(R,H){return v.openUri(R,{allowTunneling:!!e.remote.authority,allowContributedOpeners:H?.allowContributedOpeners})},async asExternalUri(R){if(R.scheme===e.environment.appUriScheme)return De.createAppUri(R);try{return await v.asExternalUri(R,{allowTunneling:!!e.remote.authority})}catch(H){if(Rx(R,_e.http)||Rx(R,_e.https))return R;throw H}},get remoteName(){return Wde(e.remote.authority)},get remoteAuthority(){return Je(Se,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return K(f.onDidChangeLogLevel)},get appQuality(){return Je(Se,"resolvers"),e.quality},get appCommit(){return Je(Se,"resolvers"),e.commit}},sr={createTestController(R,H,ie){return Rl.createTestController(Se,R,H,ie)},createTestObserver(){return Je(Se,"testObserver"),Rl.createTestObserver()},runTests(R){return Je(Se,"testObserver"),Rl.runTests(R)},registerTestFollowupProvider(R){return Je(Se,"testObserver"),Rl.registerTestFollowupProvider(R)},get onDidChangeTestResults(){return Je(Se,"testObserver"),K(Rl.onResultsChanged)},get testResults(){return Je(Se,"testObserver"),Rl.results}},ya=e.remote.isRemote?$I.Workspace:$I.UI,yc={getExtension(R,H){Cd(Se,"extensionsAny")||(H=!1);const ie=Mo.mine.getExtensionDescription(R);if(ie)return new K3(s,Se.identifier,ie,ya,!1);if(H){const je=Mo.all.getExtensionDescription(R);if(je)return new K3(s,Se.identifier,je,ya,!0)}},get all(){const R=[];for(const H of Mo.mine.getAllExtensionDescriptions())R.push(new K3(s,Se.identifier,H,ya,!1));return R},get allAcrossExtensionHosts(){Je(Se,"extensionsAny");const R=new $v(Mo.mine.getAllExtensionDescriptions().map(ie=>ie.identifier)),H=[];for(const ie of Mo.all.getAllExtensionDescriptions()){const je=!R.has(ie.identifier);H.push(new K3(s,Se.identifier,ie,ya,je))}return H},get onDidChange(){return Cd(Se,"extensionsAny")?K(T.any(Mo.mine.onDidChange,Mo.all.onDidChange)):K(Mo.mine.onDidChange)}},Ou={createDiagnosticCollection(R){return mr.createDiagnosticCollection(Se.identifier,R)},get onDidChangeDiagnostics(){return K(mr.onDidChangeDiagnostics)},getDiagnostics:R=>mr.getDiagnostics(R),getLanguages(){return ba.getLanguages()},setTextDocumentLanguage(R,H){return ba.changeLanguage(R.uri,H)},match(R,H){const ie=uIe.from(R);let je;return FYe(ie)&&(je=wt.notebookDocuments.find(pt=>pt.apiNotebook.getCells().find(is=>is.document===H))?.apiNotebook),fde(ie,H.uri,H.languageId,!0,je?.uri,je?.notebookType)},registerCodeActionsProvider(R,H,ie){return ki.registerCodeActionProvider(Se,Le(R),H,ie)},registerDocumentPasteEditProvider(R,H,ie){return Je(Se,"documentPaste"),ki.registerDocumentPasteEditProvider(Se,Le(R),H,ie)},registerCodeLensProvider(R,H){return ki.registerCodeLensProvider(Se,Le(R),H)},registerDefinitionProvider(R,H){return ki.registerDefinitionProvider(Se,Le(R),H)},registerDeclarationProvider(R,H){return ki.registerDeclarationProvider(Se,Le(R),H)},registerImplementationProvider(R,H){return ki.registerImplementationProvider(Se,Le(R),H)},registerTypeDefinitionProvider(R,H){return ki.registerTypeDefinitionProvider(Se,Le(R),H)},registerHoverProvider(R,H){return ki.registerHoverProvider(Se,Le(R),H,Se.identifier)},registerEvaluatableExpressionProvider(R,H){return ki.registerEvaluatableExpressionProvider(Se,Le(R),H,Se.identifier)},registerInlineValuesProvider(R,H){return ki.registerInlineValuesProvider(Se,Le(R),H,Se.identifier)},registerDocumentHighlightProvider(R,H){return ki.registerDocumentHighlightProvider(Se,Le(R),H)},registerMultiDocumentHighlightProvider(R,H){return ki.registerMultiDocumentHighlightProvider(Se,Le(R),H)},registerLinkedEditingRangeProvider(R,H){return ki.registerLinkedEditingRangeProvider(Se,Le(R),H)},registerReferenceProvider(R,H){return ki.registerReferenceProvider(Se,Le(R),H)},registerRenameProvider(R,H){return ki.registerRenameProvider(Se,Le(R),H)},registerNewSymbolNamesProvider(R,H){return Je(Se,"newSymbolNamesProvider"),ki.registerNewSymbolNamesProvider(Se,Le(R),H)},registerDocumentSymbolProvider(R,H,ie){return ki.registerDocumentSymbolProvider(Se,Le(R),H,ie)},registerWorkspaceSymbolProvider(R){return ki.registerWorkspaceSymbolProvider(Se,R)},registerDocumentFormattingEditProvider(R,H){return ki.registerDocumentFormattingEditProvider(Se,Le(R),H)},registerDocumentRangeFormattingEditProvider(R,H){return ki.registerDocumentRangeFormattingEditProvider(Se,Le(R),H)},registerOnTypeFormattingEditProvider(R,H,ie,...je){return ki.registerOnTypeFormattingEditProvider(Se,Le(R),H,[ie].concat(je))},registerDocumentSemanticTokensProvider(R,H,ie){return ki.registerDocumentSemanticTokensProvider(Se,Le(R),H,ie)},registerDocumentRangeSemanticTokensProvider(R,H,ie){return ki.registerDocumentRangeSemanticTokensProvider(Se,Le(R),H,ie)},registerSignatureHelpProvider(R,H,ie,...je){return typeof ie=="object"?ki.registerSignatureHelpProvider(Se,Le(R),H,ie):ki.registerSignatureHelpProvider(Se,Le(R),H,typeof ie>"u"?[]:[ie,...je])},registerCompletionItemProvider(R,H,...ie){return ki.registerCompletionItemProvider(Se,Le(R),H,ie)},registerInlineCompletionItemProvider(R,H,ie){return H.handleDidShowCompletionItem&&Je(Se,"inlineCompletionsAdditions"),H.handleDidPartiallyAcceptCompletionItem&&Je(Se,"inlineCompletionsAdditions"),ie&&Je(Se,"inlineCompletionsAdditions"),ki.registerInlineCompletionsProvider(Se,Le(R),H,ie)},registerInlineEditProvider(R,H){return Je(Se,"inlineEdit"),ki.registerInlineEditProvider(Se,Le(R),H)},registerDocumentLinkProvider(R,H){return ki.registerDocumentLinkProvider(Se,Le(R),H)},registerColorProvider(R,H){return ki.registerColorProvider(Se,Le(R),H)},registerFoldingRangeProvider(R,H){return ki.registerFoldingRangeProvider(Se,Le(R),H)},registerSelectionRangeProvider(R,H){return ki.registerSelectionRangeProvider(Se,R,H)},registerCallHierarchyProvider(R,H){return ki.registerCallHierarchyProvider(Se,R,H)},registerTypeHierarchyProvider(R,H){return ki.registerTypeHierarchyProvider(Se,R,H)},setLanguageConfiguration:(R,H)=>ki.setLanguageConfiguration(Se,R,H),getTokenInformationAtPosition(R,H){return Je(Se,"tokenInformation"),ba.tokenAtPosition(R,H)},registerInlayHintsProvider(R,H){return ki.registerInlayHintsProvider(Se,R,H)},createLanguageStatusItem(R,H){return ba.createLanguageStatusItem(Se,R,H)},registerDocumentDropEditProvider(R,H,ie){return ki.registerDocumentOnDropEditProvider(Se,R,H,Cd(Se,"documentPaste")?ie:void 0)}},le={get activeTextEditor(){return qn.getActiveTextEditor()},get visibleTextEditors(){return qn.getVisibleTextEditors()},get activeTerminal(){return N.activeTerminal},get terminals(){return N.terminals},async showTextDocument(R,H,ie){P.isUri(R)&&R.scheme===_e.vscodeRemote&&!R.authority&&m.report("workspace.showTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority.");const je=await(P.isUri(R)?Promise.resolve(_r.openTextDocument(R)):Promise.resolve(R));return qn.showTextDocument(je,H,ie)},createTextEditorDecorationType(R){return qn.createTextEditorDecorationType(Se,R)},onDidChangeActiveTextEditor(R,H,ie){return K(qn.onDidChangeActiveTextEditor)(R,H,ie)},onDidChangeVisibleTextEditors(R,H,ie){return K(qn.onDidChangeVisibleTextEditors)(R,H,ie)},onDidChangeTextEditorSelection(R,H,ie){return K(qn.onDidChangeTextEditorSelection)(R,H,ie)},onDidChangeTextEditorOptions(R,H,ie){return K(qn.onDidChangeTextEditorOptions)(R,H,ie)},onDidChangeTextEditorVisibleRanges(R,H,ie){return K(qn.onDidChangeTextEditorVisibleRanges)(R,H,ie)},onDidChangeTextEditorViewColumn(R,H,ie){return K(qn.onDidChangeTextEditorViewColumn)(R,H,ie)},onDidCloseTerminal(R,H,ie){return K(N.onDidCloseTerminal)(R,H,ie)},onDidOpenTerminal(R,H,ie){return K(N.onDidOpenTerminal)(R,H,ie)},onDidChangeActiveTerminal(R,H,ie){return K(N.onDidChangeActiveTerminal)(R,H,ie)},onDidChangeTerminalDimensions(R,H,ie){return Je(Se,"terminalDimensions"),K(N.onDidChangeTerminalDimensions)(R,H,ie)},onDidChangeTerminalState(R,H,ie){return K(N.onDidChangeTerminalState)(R,H,ie)},onDidWriteTerminalData(R,H,ie){return Je(Se,"terminalDataWriteEvent"),K(N.onDidWriteTerminalData)(R,H,ie)},onDidExecuteTerminalCommand(R,H,ie){return Je(Se,"terminalExecuteCommandEvent"),K(N.onDidExecuteTerminalCommand)(R,H,ie)},onDidChangeTerminalShellIntegration(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidChangeTerminalShellIntegration)(R,H,ie)},onDidStartTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidStartTerminalShellExecution)(R,H,ie)},onDidEndTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidEndTerminalShellExecution)(R,H,ie)},get state(){return v.getState()},onDidChangeWindowState(R,H,ie){return K(v.onDidChangeWindowState)(R,H,ie)},showInformationMessage(R,...H){return Rs.showMessage(Se,nt.Info,R,H[0],H.slice(1))},showWarningMessage(R,...H){return Rs.showMessage(Se,nt.Warning,R,H[0],H.slice(1))},showErrorMessage(R,...H){return Rs.showMessage(Se,nt.Error,R,H[0],H.slice(1))},showQuickPick(R,H,ie){return Hn.showQuickPick(Se,R,H,ie)},showWorkspaceFolderPick(R){return Hn.showWorkspaceFolderPick(R)},showInputBox(R,H){return Hn.showInput(R,H)},showOpenDialog(R){return Ml.showOpenDialog(Se,R)},showSaveDialog(R){return Ml.showSaveDialog(R)},createStatusBarItem(R,H,ie){let je,pt,is;return typeof R=="string"?(je=R,pt=H,is=ie):(pt=R,is=H),fh.createStatusBarEntry(Se,je,pt,is)},setStatusBarMessage(R,H){return fh.setStatusBarMessage(R,H)},withScmProgress(R){return m.report("window.withScmProgress",Se,"Use 'withProgress' instead."),tl.withProgress(Se,{location:VI.SourceControl},(H,ie)=>R({report(je){}}))},withProgress(R,H){return tl.withProgress(Se,R,H)},createOutputChannel(R,H){return re.createOutputChannel(R,H,Se)},createWebviewPanel(R,H,ie,je){return Jh.createWebviewPanel(Se,R,H,ie,je)},createWebviewTextEditorInset(R,H,ie,je){return Je(Se,"editorInsets"),ys.createWebviewEditorInset(R,H,ie,je,Se)},createTerminal(R,H,ie){return typeof R=="object"?"pty"in R?N.createExtensionTerminal(R):N.createTerminalFromOptions(R):N.createTerminal(R,H,ie)},registerTerminalLinkProvider(R){return N.registerLinkProvider(R)},registerTerminalProfileProvider(R,H){return N.registerProfileProvider(Se,R,H)},registerTerminalQuickFixProvider(R,H){return Je(Se,"terminalQuickFixProvider"),N.registerTerminalQuickFixProvider(R,Se.identifier.value,H)},registerTreeDataProvider(R,H){return tc.registerTreeDataProvider(R,H,Se)},createTreeView(R,H){return tc.createTreeView(R,H,Se)},registerWebviewPanelSerializer:(R,H)=>Jh.registerWebviewPanelSerializer(Se,R,H),registerCustomEditorProvider:(R,H,ie={})=>Af.registerCustomEditorProvider(Se,R,H,ie),registerFileDecorationProvider(R){return M.registerFileDecorationProvider(R,Se)},registerUriHandler(R){return De.registerUriHandler(Se,R)},createQuickPick(){return Hn.createQuickPick(Se)},createInputBox(){return Hn.createInputBox(Se)},get activeColorTheme(){return to.activeColorTheme},onDidChangeActiveColorTheme(R,H,ie){return K(to.onDidChangeActiveColorTheme)(R,H,ie)},registerWebviewViewProvider(R,H,ie){return il.registerWebviewViewProvider(Se,R,H,ie?.webviewOptions)},get activeNotebookEditor(){return wt.activeNotebookEditor},onDidChangeActiveNotebookEditor(R,H,ie){return K(wt.onDidChangeActiveNotebookEditor)(R,H,ie)},get visibleNotebookEditors(){return wt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return K(wt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(R,H,ie){return K(Ji.onDidChangeNotebookEditorSelection)(R,H,ie)},onDidChangeNotebookEditorVisibleRanges(R,H,ie){return K(Ji.onDidChangeNotebookEditorVisibleRanges)(R,H,ie)},showNotebookDocument(R,H){return wt.showNotebookDocument(R,H)},registerExternalUriOpener(R,H,ie){return Je(Se,"externalUriOpener"),Xh.registerExternalUriOpener(Se.identifier,R,H,ie)},registerProfileContentHandler(R,H){return Je(Se,"profileContentHandlers"),ul.registerProfileContentHandler(Se,R,H)},registerQuickDiffProvider(R,H,ie,je){return Je(Se,"quickDiffProvider"),gh.registerQuickDiffProvider(Le(R),H,ie,je)},get tabGroups(){return b.tabGroups},registerShareProvider(R,H){return Je(Se,"shareProvider"),Qn.registerShareProvider(Le(R),H)}},_r={get rootPath(){return m.report("workspace.rootPath",Se,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(R){throw new cR("rootPath")},getWorkspaceFolder(R){return o.getWorkspaceFolder(R)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(R){throw new cR("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(R){throw new cR("workspaceFile")},updateWorkspaceFolders:(R,H,...ie)=>o.updateWorkspaceFolders(Se,R,H||0,...ie),onDidChangeWorkspaceFolders:function(R,H,ie){return K(o.onDidChangeWorkspace)(R,H,ie)},asRelativePath:(R,H)=>o.getRelativePath(R,H),findFiles:(R,H,ie,je)=>o.findFiles(R,H,ie,Se.identifier,je),findFiles2:(R,H,ie)=>(Je(Se,"findFiles2"),o.findFiles2(R,H,Se.identifier,ie)),findTextInFiles:(R,H,ie,je)=>{Je(Se,"findTextInFiles");let pt,is;return typeof H=="object"?(pt=H,is=ie):(pt={},is=H,je=ie),o.findTextInFiles(R,pt||{},is,Se.identifier,je)},save:R=>o.save(R),saveAs:R=>o.saveAs(R),saveAll:R=>o.saveAll(R),applyEdit(R,H){return Cc.applyWorkspaceEdit(R,Se,H)},createFileSystemWatcher:(R,H,ie,je)=>{let pt;return typeof H=="boolean"?pt={ignoreCreateEvents:!!H,ignoreChangeEvents:!!ie,ignoreDeleteEvents:!!je,correlate:!1}:H&&(Je(Se,"createFileSystemWatcher"),pt={...H,correlate:!0}),ir.createFileSystemWatcher(o,Se,R,pt)},get textDocuments(){return Qe.getAllDocumentData().map(R=>R.document)},set textDocuments(R){throw new cR("textDocuments")},openTextDocument(R){let H;const ie=R;if(typeof R=="string")H=Promise.resolve(P.file(R));else if(P.isUri(R))H=Promise.resolve(R);else if(!ie||typeof ie=="object")H=Qe.createDocumentData(ie);else throw new Error("illegal argument - uriOrFileNameOrOptions");return H.then(je=>(je.scheme===_e.vscodeRemote&&!je.authority&&m.report("workspace.openTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority."),Qe.ensureDocumentData(je).then(pt=>pt.document)))},onDidOpenTextDocument:(R,H,ie)=>K(Qe.onDidAddDocument)(R,H,ie),onDidCloseTextDocument:(R,H,ie)=>K(Qe.onDidRemoveDocument)(R,H,ie),onDidChangeTextDocument:(R,H,ie)=>K(Qe.onDidChangeDocument)(R,H,ie),onDidSaveTextDocument:(R,H,ie)=>K(Qe.onDidSaveDocument)(R,H,ie),onWillSaveTextDocument:(R,H,ie)=>K(Oe.getOnWillSaveTextDocumentEvent(Se))(R,H,ie),get notebookDocuments(){return wt.notebookDocuments.map(R=>R.apiNotebook)},async openNotebookDocument(R,H){let ie;if(P.isUri(R))ie=R,await wt.openNotebookDocument(R);else if(typeof R=="string")ie=P.revive(await wt.createNotebookDocument({viewType:R,content:H}));else throw new Error("Invalid arguments");return wt.getNotebookDocument(ie).apiNotebook},onDidSaveNotebookDocument(R,H,ie){return K(Nt.onDidSaveNotebookDocument)(R,H,ie)},onDidChangeNotebookDocument(R,H,ie){return K(Nt.onDidChangeNotebookDocument)(R,H,ie)},onWillSaveNotebookDocument(R,H,ie){return K(Ro.getOnWillSaveNotebookDocumentEvent(Se))(R,H,ie)},get onDidOpenNotebookDocument(){return K(wt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return K(wt.onDidCloseNotebookDocument)},registerNotebookSerializer(R,H,ie,je){return wt.registerNotebookSerializer(Se,R,H,ie,Cd(Se,"notebookLiveShare")?je:void 0)},onDidChangeConfiguration:(R,H,ie)=>K(cd.onDidChangeConfiguration)(R,H,ie),getConfiguration(R,H){return H=arguments.length===1?void 0:H,cd.getConfiguration(R,H,Se)},registerTextDocumentContentProvider(R,H){return Tt.registerTextDocumentContentProvider(R,H)},registerTaskProvider:(R,H)=>(m.report("window.registerTaskProvider",Se,"Use the corresponding function on the 'tasks' namespace instead"),j.registerTaskProvider(Se,R,H)),registerFileSystemProvider(R,H,ie){return pa(gs.registerFileSystemProvider(Se,R,H,ie),i.addFileSystemProvider(R,H,ie))},get fs(){return i.value},registerFileSearchProvider:(R,H)=>(Je(Se,"fileSearchProvider"),J.registerFileSearchProvider(R,H)),registerTextSearchProvider:(R,H)=>(Je(Se,"textSearchProvider"),J.registerTextSearchProvider(R,H)),registerAITextSearchProvider:(R,H)=>(Je(Se,"aiTextSearchProvider"),Je(Se,"textSearchProvider"),J.registerAITextSearchProvider(R,H)),registerRemoteAuthorityResolver:(R,H)=>(Je(Se,"resolvers"),s.registerRemoteAuthorityResolver(R,H)),registerResourceLabelFormatter:R=>(Je(Se,"resolvers"),Tl.$registerResourceLabelFormatter(R)),getRemoteExecServer:R=>(Je(Se,"resolvers"),s.getRemoteExecServer(R)),onDidCreateFiles:(R,H,ie)=>K(ir.onDidCreateFile)(R,H,ie),onDidDeleteFiles:(R,H,ie)=>K(ir.onDidDeleteFile)(R,H,ie),onDidRenameFiles:(R,H,ie)=>K(ir.onDidRenameFile)(R,H,ie),onWillCreateFiles:(R,H,ie)=>K(ir.getOnWillCreateFileEvent(Se))(R,H,ie),onWillDeleteFiles:(R,H,ie)=>K(ir.getOnWillDeleteFileEvent(Se))(R,H,ie),onWillRenameFiles:(R,H,ie)=>K(ir.getOnWillRenameFileEvent(Se))(R,H,ie),openTunnel:R=>(Je(Se,"tunnels"),p.openTunnel(Se,R).then(H=>{if(!H)throw new Error("cannot open tunnel");return H})),get tunnels(){return Je(Se,"tunnels"),p.getTunnels()},onDidChangeTunnels:(R,H,ie)=>(Je(Se,"tunnels"),K(p.onDidChangeTunnels)(R,H,ie)),registerPortAttributesProvider:(R,H)=>(Je(Se,"portsAttributes"),p.registerPortsAttributesProvider(R,H)),registerTunnelProvider:(R,H)=>(Je(Se,"tunnelFactory"),p.registerTunnelProvider(R,H)),registerTimelineProvider:(R,H)=>(Je(Se,"timeline"),Oc.registerTimelineProvider(R,H,Se.identifier,F.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:R=>(Je(Se,"workspaceTrust"),o.requestWorkspaceTrust(R)),onDidGrantWorkspaceTrust:(R,H,ie)=>K(o.onDidGrantWorkspaceTrust)(R,H,ie),registerEditSessionIdentityProvider:(R,H)=>(Je(Se,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(R,H)),onWillCreateEditSessionIdentity:(R,H,ie)=>(Je(Se,"editSessionIdentityProvider"),K(o.getOnWillCreateEditSessionIdentityEvent(Se))(R,H,ie)),registerCanonicalUriProvider:(R,H)=>(Je(Se,"canonicalUriProvider"),o.registerCanonicalUriProvider(R,H)),getCanonicalUri:(R,H,ie)=>(Je(Se,"canonicalUriProvider"),o.provideCanonicalUri(R,H,ie))},No={get inputBox(){return m.report("scm.inputBox",Se,"Use 'SourceControl.inputBox' instead"),vc.getLastInputBox(Se)},createSourceControl(R,H,ie){return vc.createSourceControl(Se,R,H,ie)}},mn={createCommentController(R,H){return Yh.createCommentController(Se,R,H)}},ve={get activeDebugSession(){return U.activeDebugSession},get activeDebugConsole(){return U.activeDebugConsole},get breakpoints(){return U.breakpoints},get activeStackItem(){return U.activeStackItem},registerDebugVisualizationProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationProvider(Se,R,H)},registerDebugVisualizationTreeProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationTree(Se,R,H)},onDidStartDebugSession(R,H,ie){return K(U.onDidStartDebugSession)(R,H,ie)},onDidTerminateDebugSession(R,H,ie){return K(U.onDidTerminateDebugSession)(R,H,ie)},onDidChangeActiveDebugSession(R,H,ie){return K(U.onDidChangeActiveDebugSession)(R,H,ie)},onDidReceiveDebugSessionCustomEvent(R,H,ie){return K(U.onDidReceiveDebugSessionCustomEvent)(R,H,ie)},onDidChangeBreakpoints(R,H,ie){return K(U.onDidChangeBreakpoints)(R,H,ie)},onDidChangeActiveStackItem(R,H,ie){return K(U.onDidChangeActiveStackItem)(R,H,ie)},registerDebugConfigurationProvider(R,H,ie){return U.registerDebugConfigurationProvider(R,H,ie||x6.Initial)},registerDebugAdapterDescriptorFactory(R,H){return U.registerDebugAdapterDescriptorFactory(Se,R,H)},registerDebugAdapterTrackerFactory(R,H){return U.registerDebugAdapterTrackerFactory(R,H)},startDebugging(R,H,ie){return!ie||typeof ie=="object"&&"configuration"in ie?U.startDebugging(R,H,{parentSession:ie}):U.startDebugging(R,H,ie||{})},stopDebugging(R){return U.stopDebugging(R)},addBreakpoints(R){return U.addBreakpoints(R)},removeBreakpoints(R){return U.removeBreakpoints(R)},asDebugSourceUri(R,H){return U.asDebugSourceUri(R,H)}},ct={registerTaskProvider:(R,H)=>j.registerTaskProvider(Se,R,H),fetchTasks:R=>j.fetchTasks(R),executeTask:R=>j.executeTask(Se,R),get taskExecutions(){return j.taskExecutions},onDidStartTask:(R,H,ie)=>K(j.onDidStartTask)(R,H,ie),onDidEndTask:(R,H,ie)=>K(j.onDidEndTask)(R,H,ie),onDidStartTaskProcess:(R,H,ie)=>K(j.onDidStartTaskProcess)(R,H,ie),onDidEndTaskProcess:(R,H,ie)=>K(j.onDidEndTaskProcess)(R,H,ie)},Ht={createNotebookController(R,H,ie,je,pt){return zi.createNotebookController(Se,R,H,ie,je,Cd(Se,"notebookMessaging")?pt:void 0)},registerNotebookCellStatusBarItemProvider:(R,H)=>wt.registerNotebookCellStatusBarItemProvider(Se,R,H),createRendererMessaging(R){return Gn.createRendererMessaging(Se,R)},createNotebookControllerDetectionTask(R){return Je(Se,"notebookKernelSource"),zi.createNotebookControllerDetectionTask(Se,R)},registerKernelSourceActionProvider(R,H){return Je(Se,"notebookKernelSource"),zi.registerKernelSourceActionProvider(Se,R,H)},onDidChangeNotebookCellExecutionState(R,H,ie){return Je(Se,"notebookCellExecutionState"),K(zi.onDidChangeNotebookCellExecutionState)(R,H,ie)}},Ei={t(...R){if(typeof R[0]=="string"){const H=R.shift(),ie=!R||typeof R[0]!="object"?R:R[0];return me.getMessage(Se.identifier.value,{message:H,args:ie})}return me.getMessage(Se.identifier.value,R[0])},get bundle(){return me.getBundle(Se.identifier.value)},get uri(){return me.getBundleUri(Se.identifier.value)}},Ut={_version:1,transferActiveChat(R){return Je(Se,"interactive"),ad.transferActiveChat(R)}},G={getRelatedInformation(R,H){return Je(Se,"aiRelatedInformation"),Ca.getRelatedInformation(Se,R,H)},registerRelatedInformationProvider(R,H){return Je(Se,"aiRelatedInformation"),Ca.registerRelatedInformationProvider(Se,R,H)},registerEmbeddingVectorProvider(R,H){return Je(Se,"aiRelatedInformation"),Ld.registerEmbeddingVectorProvider(Se,R,H)}},de={_version:1,registerChatResponseProvider(R,H,ie){return Je(Se,"chatProvider"),S.registerLanguageModel(Se,R,H,ie)},registerChatVariableResolver(R,H,ie,je,pt,is,Ss,ld){return Je(Se,"chatVariableResolver"),wc.registerVariableResolver(Se,R,H,ie,je,pt,is,Ss,ld?.id)},registerMappedEditsProvider(R,H){return Je(Se,"mappedEditsProvider"),ki.registerMappedEditsProvider(Se,R,H)},createChatParticipant(R,H){return ad.createChatAgent(Se,R,H)},createDynamicChatParticipant(R,H,ie){return Je(Se,"chatParticipantPrivate"),ad.createDynamicChatAgent(Se,R,H,ie)},attachContext(R,H,ie){return Je(Se,"chatVariableResolver"),wc.attachContext(R,H,ie)}},L={selectChatModels:R=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),Promise.resolve([])):S.selectLanguageModels(Se,R??{}),onDidChangeChatModels:(R,H,ie)=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),T.None(R,H,ie)):S.onDidChangeProviders(R,H,ie),get embeddingModels(){return Je(Se,"embeddings"),bc.embeddingsModels},onDidChangeEmbeddingModels:(R,H,ie)=>(Je(Se,"embeddings"),bc.onDidChange(R,H,ie)),registerEmbeddingsProvider(R,H){return Je(Se,"embeddings"),bc.registerEmbeddingsProvider(Se,R,H)},async computeEmbeddings(R,H,ie){return Je(Se,"embeddings"),bc.computeEmbeddings(R,H,ie)}},ne={registerSpeechProvider(R,H){return Je(Se,"speech"),Fu.registerProvider(Se.identifier,R,H)}};return{version:e.version,ai:G,authentication:ri,commands:ts,comments:mn,chat:de,debug:ve,env:Os,extensions:yc,interactive:Ut,l10n:Ei,languages:Ou,lm:L,notebooks:Ht,scm:No,speech:ne,tasks:ct,tests:sr,window:le,workspace:_r,Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:fOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:pOe,CancellationError:Rc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ja,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CommentThreadApplicability:iG,CompletionItem:H6,CompletionItemKind:nn,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:wm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,VerboseHover:ise,HoverVerbosityAction:dke,IndentAction:qa,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:mOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TerminalShellExecutionCommandLineConfidence:NM,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentPasteTriggerKind:uke,DocumentDropEdit:_se,DocumentDropOrPasteEditKind:u4,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:_Oe,NotebookRendererScript:wOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:vOe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,NotebookVariablesRequestKind:lG,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,TestCoverageCount:kX,FileCoverage:uG,FileCoverage2:uG,StatementCoverage:Tot,BranchCoverage:Rot,DeclarationCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:bOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:COe,TabInputTerminal:yOe,TabInputInteractiveWindow:SOe,TabInputChat:AOe,TabInputTextMultiDiff:Not,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,DebugStackFrame:Cot,DebugThread:yot,RelatedInformationType:Nse,SpeechToTextStatus:Pse,TextToSpeechStatus:bke,PartialAcceptTriggerKind:IR,KeywordRecognitionStatus:Fse,ChatResponseMarkdownPart:Jhe,ChatResponseFileTreePart:Xhe,ChatResponseAnchorPart:Zhe,ChatResponseProgressPart:mG,ChatResponseProgressPart2:Fot,ChatResponseReferencePart:GI,ChatResponseWarningPart:_G,ChatResponseTextEditPart:vG,ChatResponseMarkdownWithVulnerabilitiesPart:fG,ChatResponseCommandButtonPart:eue,ChatResponseDetectedParticipantPart:pG,ChatResponseConfirmationPart:vke,ChatRequestTurn:Oot,ChatResponseTurn:Bot,ChatLocation:cb,LanguageModelChatMessageRole:Iv,LanguageModelChatMessage:v8,LanguageModelChatMessage2:v8,LanguageModelChatSystemMessage:I7t,LanguageModelChatUserMessage:L7t,LanguageModelChatAssistantMessage:T7t,LanguageModelError:qg,NewSymbolName:D7t,NewSymbolNameTag:fke,NewSymbolNameTriggerKind:tG,InlineEdit:R7t,InlineEditTriggerKind:wG}}}var $X;let nRe=class{constructor(e,t,i,s,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=s,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),vs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();vs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new Tni(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(sRe)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(oRe,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};nRe=D([_(2,be),_(3,hD),_(4,_L),_(5,Sg),_(6,Ze)],nRe);var tF;let sRe=(tF=class{constructor(e){if(e.environment.appRoot&&$X.aliased.size){const t=Iu(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",s=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${s})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,s,o]=t,r=$X.aliased.get(s);if(r!==void 0)return console.warn(`${s} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},$X=tF,tF.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),tF);sRe=$X=D([_(0,Sg)],sRe);class Tni{constructor(e,t,i,s,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=s,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new Ga}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let s=this._extApiImpl.get(i.identifier);return s||(s=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,s)),s}if(!this._defaultApiImpl){let s="";this._extensionPaths.forEach((o,r)=>s+=` ${r} -> ${o.identifier.value} +`,r.map(d=>new F(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const y1=class y1{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,n,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=n,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new ui,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new I,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new I,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new I,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new I,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new ym("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Be.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Be.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Be.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===ws.NotebookCellActionContext){const l=c.notebookEditor?.notebookUri,d=c.cell.handle,u=this._documents.get(l)?.getCell(d);if(u)return u.apiCell}if(c&&c.$mid===ws.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),y1._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(n=>Jte.from(n)).filter(n=>n!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,priority:t.exclusive?f$.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const n=y1._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?y1._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(n,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(n,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new Qs(()=>{this._notebookStatusBarItemProviders.delete(n),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(n,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&OE.from(e.content)});return N.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),n=this._documents.get(N.revive(i));return qn(n?.apiNotebook)}async showNotebookDocument(e,t){N.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:xl.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(Wy.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const n=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=n&&this._editors.get(n)?.apiEditor;if(o)return o;throw n?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,n){const o=this._notebookStatusBarItemProviders.get(e),r=N.revive(t),a=this._documents.get(r);if(!a||!o)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await o.provideCellStatusBarItems(c.apiCell,n);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>JEe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,n,o){if(Gu(t))throw new Error("viewType cannot be empty or just whitespace");const r=this._handlePool++;return this._notebookSerializer.set(r,{viewType:t,serializer:i,options:n}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,ZEe.from(n),y1._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.deserializeNotebook(t.buffer,i);return new jd(OE.from(o))}async $notebookToData(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.serializeNotebook(OE.to(t.value),i);return $e.wrap(o)}async $saveNotebook(e,t,i,n,o){const r=N.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${r.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(r);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(r.scheme))throw new Td(g(4585,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Qi.FILE_PERMISSION_DENIED);const l={metadata:wj(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new rG(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=wj(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,n),o.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,o);if(o.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${r.toString()}`),await this._extHostFileSystem.value.writeFile(r,d),this.trace(`Finished write versionId: ${i} ${r.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(r.scheme),u=await this._extHostFileSystem.value.stat(r),f={name:h.basename(r),isFile:(u.type&sn.File)!==0,isDirectory:(u.type&sn.Directory)!==0,isSymbolicLink:(u.type&sn.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&lp.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&lp.Locked),etag:$Y({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,n,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new Dk;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const b={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:cI.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(b,f,w=>{w.forEach(y=>{a.has(y)||n.some(A=>m.isFromSettings&&!A.isFromSettings?!1:A.filenamePatterns.some(L=>Uqt(L,y)))||a.add(y)})}).catch(w=>{if(w.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw w})}))))})(i,o,t);const l=new ui;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((b,w)=>b+w.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(w=>p.push({input:w.document.getText(),outputs:w.outputs.flatMap(y=>y.items.map(C=>C.data.toString()))}));else{const b=await this._extHostFileSystem.value.readFile(u),w=$e.fromString(b.toString()),y=await r.deserializeNotebook(w.buffer,o);if(o.isCancellationRequested)return;OE.from(y).cells.forEach(A=>p.push({input:A.source,outputs:A.outputs.flatMap(L=>L.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((b,w)=>{const y=t.contentPattern.pattern,C=new dii(b.input,void 0,b.outputs),A=C.findInInputs(y),L=C.findInOutputs(y),k=L.flatMap(P=>e$e(P.matches,P.textBuffer)).map((P,R)=>(P.webviewIndex=R,P));if(A.length>0||L.length>0){const P={index:w,contentResults:e$e(A,C.inputTextBuffer),webviewResults:k};f.push(P)}});const v={resource:u,cellResults:f};l.set(u,v);return}catch{return}});return await Promise.all(h),{limitHit:d,results:[...l.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==S_&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(n.apiNotebook));for(const o of this._editors.values())o.notebookData.uri.toString()===i.toString()&&this._editors.delete(o.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const n=N.revive(i.uri);if(this._documents.has(n))throw new Error(`adding EXISTING notebook ${n} `);const o=new WIe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,n,i);t.push(...i.cells.map(r=>BIe.asModelAddData(r))),this._documents.get(n)?.dispose(),this._documents.set(n,o),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(o.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=N.revive(t.documentUri),n=this._documents.get(i);n&&this._createExtHostEditor(n,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const n=t.has(i.id);i._acceptVisibility(n)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=ht.String.with("notebookType","A notebook type"),i=new gn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new ht("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>$e.wrap(o))],new nn("Notebook Data",o=>OE.to(o.value))),n=new gn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new ht("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new jd(OE.from(o)))],new nn("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(n)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};y1._notebookStatusBarItemProviderHandlePool=0;let HIe=y1;class hii{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._onWillSaveNotebookDocumentEvent=new jx}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,n)}}async $participateInSave(e,t,i){const n=N.revive(e),o=this._notebooksAndEditors.getNotebookDocument(n);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:qte.to(t)},i,async(c,l)=>{const d=Date.now(),h=await await Promise.resolve(c);Date.now()-d>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier),!i.isCancellationRequested&&h&&(h instanceof hI?r.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(r.length===0)return!0;const a={edits:[]};for(const c of r){const{edits:l}=Yu.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jd(a))}}class uii{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new I,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new I,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,n){const r=this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptModelChanged(t.value,i,n);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(N.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let UIe=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new I,this._onDidChangeNotebookEditorVisibleRanges=new I,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(Wy.to)),t.selections&&i._acceptSelections(t.selections.selections.map(Wy.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(xl.to(e[t]))}};UIe=D([_(0,Ge)],UIe);const gii=100;let VIe=class{constructor(e,t,i,n,o){this._initData=t,this._extHostNotebook=i,this._commands=n,this._logService=o,this._activeExecutions=new ui,this._activeNotebookExecutions=new ui,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this._onDidChangeCellExecutionState=new I,this.onDidChangeNotebookCellExecutionState=this._onDidChangeCellExecutionState.event,this.id=0,this.variableStore={},this._proxy=e.getProxy(Be.MainThreadNotebookKernels);const r=new gn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new ht("options","Select kernel options",c=>!0,c=>{if(c&&"notebookEditor"in c&&"id"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);return{id:c.id,extension:c.extension,notebookEditorId:l}}else if(c&&"notebookEditor"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);if(l===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${c.notebookEditor.notebook.uri.toString()}`);return{notebookEditorId:l}}return c})],nn.Void),a=new gn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[ht.Uri],new nn("A promise that resolves to an array of variables",(c,l)=>c.map(d=>({variable:{name:d.name,value:d.value,expression:d.expression,type:d.type,language:d.language},hasNamedChildren:d.hasNamedChildren,indexedChildrenCount:d.indexedChildrenCount}))));this._commands.registerApiCommand(r),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,n,o,r){for(const A of this._kernelData.values())if(A.controller.id===t&&Sn.equals(e.identifier,A.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,c=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const l=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`);let d=!1;const h=new I,u=new I,f={id:jK(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:n||e.identifier.value,preloads:r?r.map(Xte.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(A=>{console.log(A),d=!0});let b=0;const w=()=>{if(d)return;const A=++b;Promise.resolve().then(()=>{A===b&&this._proxy.$updateKernel(a,f)})},y=new ui,C={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(A){f.label=A??e.displayName??e.name,w()},get detail(){return f.detail??""},set detail(A){f.detail=A,w()},get description(){return f.description??""},set description(A){f.description=A,w()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(A){f.supportedLanguages=A,w()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(A){f.supportsExecutionOrder=A,w()},get rendererScripts(){return f.preloads?f.preloads.map(Xte.to):[]},get executeHandler(){return p},set executeHandler(A){p=A??l},get interruptHandler(){return m},set interruptHandler(A){m=A,f.supportsInterrupt=!!A,w()},set variableProvider(A){Ve(e,"notebookVariableProvider"),v=A,f.hasVariableProvider=!!A,A?.onDidChangeVariables(L=>c._proxy.$variablesUpdated(L.uri)),w()},get variableProvider(){return v},createNotebookCellExecution(A){if(d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.notebook.uri.toString()}`);return c._createNotebookCellExecution(A,jK(e.identifier,this.id))},createNotebookExecution(A){if(Ve(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.uri.toString()}`);return c._createNotebookExecution(A,jK(e.identifier,this.id))},dispose:()=>{d||(this._logService.trace(`NotebookController[${a}], DISPOSED`),d=!0,this._kernelData.delete(a),h.dispose(),u.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(A,L){L===o$.Hidden&&Ve(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,A.uri,L)},onDidReceiveMessage:u.event,postMessage(A,L){return Ve(e,"notebookMessaging"),c._proxy.$postMessage(a,L&&c._extHostNotebook.getIdByEditor(L),A)},asWebviewUri(A){return Ve(e,"notebookMessaging"),Dz(A,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:C,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:y}),C}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return jK(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,n=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),n._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const n=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?n:void 0,r=this;this._kernelSourceActionProviders.set(n,i),this._logService.trace(`NotebookKernelSourceActionProvider[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(n,n,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(n),r._proxy.$removeKernelSourceActionProvider(n,n),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const n=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>XEe.from(r,this._commands.converter,n))}return[]}$acceptNotebookAssociation(e,t,i){const n=this._kernelData.get(e);if(n){const o=this._extHostNotebook.getNotebookDocument(N.revive(t));i?n.associatedNotebooks.set(o.uri,!0):n.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),n.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.revive(t)),r=[];for(const a of i){const c=o.getCell(a);c&&r.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,o.uri.toString(),r.length),await n.controller.executeHandler.call(n.controller,r,o.apiNotebook,n.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.revive(t));if(n.controller.interruptHandler)await n.controller.interruptHandler.call(n.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(n.controller.interruptHandler){const r=this._activeNotebookExecutions.get(o.uri);this._activeNotebookExecutions.delete(o.uri),i.length&&Array.isArray(r)&&r.length&&r.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,n,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(N.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(n!==void 0){if(h=this.variableStore[n],!h)return}else this.variableStore={};const u=o==="named"?wH.Named:wH.Indexed,f=d.provideVariables(l.apiNotebook,h,u,r,a);let p=0;for await(const m of f){if(a.isCancellationRequested)return;const v={id:this.id++,name:m.variable.name,value:m.variable.value,type:m.variable.type,interfaces:m.variable.interfaces,language:m.variable.language,expression:m.variable.expression,hasNamedChildren:m.hasNamedChildren,indexedChildrenCount:m.indexedChildrenCount,extensionId:c.extensionId.value};if(this.variableStore[v.id]=m.variable,this._proxy.$receiveVariable(t,v),p++>=gii)return}}$acceptKernelMessageFromRenderer(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getEditorById(t);n.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(N.revive(e)).getCell(t);if(o){const r=i?YEe.to(i):cN.Idle;r!==void 0&&this._onDidChangeCellExecutionState.fire({cell:o.apiCell,state:r})}}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const n=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!n)throw new Error("invalid cell");if(this._activeExecutions.has(n.uri))throw new Error(`duplicate execution for ${n.uri}`);const o=new zIe(t,n,this._proxy);this._activeExecutions.set(n.uri,o);const r=o.onDidChangeState(()=>{o.state===Wv.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(n.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),n=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(n)throw new Error(`duplicate cell execution for ${n.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new $Ie(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===JC.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};VIe=D([_(4,Ge)],VIe);var Wv;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(Wv||(Wv={}));const gre=class gre extends V{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=gre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=Wv.Init,this._tokenSource=this._register(new ci),this._collector=new fii(10,n=>this.update(n)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new jd(t))}verifyStateForOutput(){if(this._state===Wv.Init)throw new Error("Must call start before modifying cell output");if(this._state===Wv.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=i$.ensureUniqueMimeTypes(t.items,!0);return i===t.items?pI.from(t):pI.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const n=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(H_(e));return this.updateSoon({editType:$x.Output,cellHandle:n,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=i$.ensureUniqueMimeTypes(H_(e),!0),this.updateSoon({editType:$x.OutputItems,items:e.map(UH.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:$x.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Wv.Resolved||e._state===Wv.Started)throw new Error("Cannot call start again");e._state=Wv.Started,e._onDidChangeState.fire(),e.update({editType:$x.ExecutionState,runStartTime:i})},end(i,n,o){if(e._state===Wv.Resolved)throw new Error("Cannot call resolve twice");e._state=Wv.Resolved,e._onDidChangeState.fire(),e._collector.flush();const r=o?{message:o.message,stack:o.stack,location:o?.location?{startLineNumber:o.location.start.line,startColumn:o.location.start.character,endLineNumber:o.location.end.line,endColumn:o.location.end.character}:void 0,uri:o.uri}:void 0;e._proxy.$completeExecution(e._handle,new jd({runEndTime:n,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!0)},replaceOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!1)},appendOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!0)},replaceOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!1)}})}};gre.HANDLE=0;let zIe=gre;var JC;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(JC||(JC={}));const fre=class fre extends V{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=fre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=JC.Init,this._tokenSource=this._register(new ci),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===JC.Resolved||this._state===JC.Started)throw new Error("Cannot call start again");this._state=JC.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===JC.Resolved)throw new Error("Cannot call resolve twice");this._state=JC.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};fre.HANDLE=0;let $Ie=fre;class fii{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new dc,this.startedTimer=Date.now(),Sr(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function jK(s,e){return`${s.value}/${e}`}class pii{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Be.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const n=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:n.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(n=>n.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(n,o,r)=>this.getOrCreateEmitterFor(t).event(n,o,r),postMessage:(n,o)=>{i7.apiEditorsToExtHost.has(n)&&([n,o]=[o,n]);const r=o&&i7.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,n)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new I({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class mii{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Be.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Ve(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),Ee(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,n){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,n)}async $readProfile(e,t,i){const n=this.handlers.get(e);if(!n)throw new Error(`Unknown handler with id: ${e}`);return n.readProfile(Lt(t)?t:N.revive(t),i)}}class _ii{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const n=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(n,{location:QEe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(No),this._withProgress(n,i,!!a)}_withProgress(e,t,i){let n;i&&(n=new ci,this._mapHandleToCancellationSource.set(e,n));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),n?.dispose()};let r;try{r=t(new GIe(this._proxy,e),i&&n?n.token:He.None)}catch(a){throw o(e),a}return r.then(a=>o(e),a=>o(e)),r}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function vii(s,e){return s.message=e.message,typeof e.increment=="number"&&(typeof s.increment=="number"?s.increment+=e.increment:s.increment=e.increment),s}class GIe extends lu{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}GIe.__decorator=D([bAt(100,(s,e)=>vii(s,e),()=>Object.create(null))],GIe.prototype,"throttledReport",null);const pre=class pre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const n=N.revive(t),o=this.providers.get(e);return o?jh(()=>o.provideOriginalResource(n,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,n){const o=pre.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,NH.from(e,this.uriTransformer),i,n),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};pre.handlePool=0;let KIe=pre;function bii(s,e,t){const i=s.getProxy(Be.MainThreadQuickOpen);class n{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,b=He.None){this._onDidSelectItem=void 0;const w=Promise.resolve(m),y=++this._instances,C=i.$show(y,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},b),A={},L=C.then(()=>A);return Promise.race([L,w]).then(k=>{if(k===A)return;const P=dl(p,"quickPickItemTooltip");return w.then(R=>{const z=[];for(let G=0;G{v.onDidSelectItem(R[G])}),i.$setItems(y,z),C.then(G=>{if(typeof G=="number")return R[G];if(Array.isArray(G))return G.map(Y=>R[Y])})})}).then(void 0,k=>{if(!Fr(k))return i.$setError(y,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=He.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Fr(v))return Promise.reject(v)})}async $validateInput(p){if(!this._validateInput)return;const m=await this._validateInput(p);if(!m||typeof m=="string")return m;let v;switch(m.severity){case qT.Info:v=Xe.Info;break;case qT.Warning:v=Xe.Warning;break;case qT.Error:v=Xe.Error;break;default:v=m.message?Xe.Error:Xe.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=He.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const b=await this._workspace.getWorkspaceFolders2();if(b)return b.find(w=>w.uri.toString()===v.uri.toString())}createQuickPick(p){const m=new d(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}createInputBox(p){const m=new h(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}$onDidChangeValue(p,m){this._sessions.get(p)?._fireDidChangeValue(m)}$onDidAccept(p){this._sessions.get(p)?._fireDidAccept()}$onDidChangeActive(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeActive(m)}$onDidChangeSelection(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeSelection(m)}$onDidTriggerButton(p,m){this._sessions.get(p)?._fireDidTriggerButton(m)}$onDidTriggerItemButton(p,m,v){const b=this._sessions.get(p);b instanceof d&&b._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extension=p,this._onDidDispose=m,this._id=d._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new I,this._onDidChangeValueEmitter=new I,this._onDidTriggerButtonEmitter=new I,this._onDidHideEmitter=new I,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(p){this._title=p,this.update({title:p})}get step(){return this._steps}set step(p){this._steps=p,this.update({step:p})}get totalSteps(){return this._totalSteps}set totalSteps(p){this._totalSteps=p,this.update({totalSteps:p})}get enabled(){return this._enabled}set enabled(p){this._enabled=p,this.update({enabled:p})}get busy(){return this._busy}set busy(p){this._busy=p,this.update({busy:p})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(p){this._ignoreFocusOut=p,this.update({ignoreFocusOut:p})}get value(){return this._value}set value(p){this._value=p,this.update({value:p})}get placeholder(){return this._placeholder}set placeholder(p){this._placeholder=p,this.update({placeholder:p})}get buttons(){return this._buttons}set buttons(p){const m=dl(this._extension,"quickInputButtonLocation");!m&&p.some(v=>v.location)&&console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`),this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((v,b)=>{const w=v===vH.Back?-1:b;this._handlesToButtons.set(w,v)}),this.update({buttons:p.map((v,b)=>({...l(v.iconPath),tooltip:v.tooltip,handle:v===vH.Back?-1:b,location:m?v.location:void 0}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(p){this._value=p,this._onDidChangeValueEmitter.fire(p)}_fireDidTriggerButton(p){const m=this._handlesToButtons.get(p);m&&this._onDidTriggerButtonEmitter.fire(m)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=bt(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(p){if(!this._disposed){for(const m of Object.keys(p)){const v=p[m];this._pendingUpdate[m]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};u._nextId=1;let o=u;function r(f){if(f instanceof uu)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?N.file(p):p,light:typeof m=="string"?N.file(m):m}}function a(f){return typeof f=="object"&&"light"in f?f.light:f}function c(f){return typeof f=="object"&&"dark"in f?f.dark:f}function l(f){const p=r(f);let m,v;return"id"in p?v=We.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p,m),this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new I,this._selectedItems=[],this._onDidChangeSelectionEmitter=new I,this._onDidTriggerItemButtonEmitter=new I,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(p){this._items=p.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),p.forEach((b,w)=>{this._handlesToItems.set(w,b),this._itemsToHandles.set(b,w)});const m=dl(this._extension,"quickPickItemTooltip"),v=[];for(let b=0;b({...l(C.iconPath),tooltip:C.tooltip,handle:A}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(p){this._canSelectMany=p,this.update({canSelectMany:p})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(p){this._matchOnDescription=p,this.update({matchOnDescription:p})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(p){this._matchOnDetail=p,this.update({matchOnDetail:p})}get sortByLabel(){return this._sortByLabel}set sortByLabel(p){this._sortByLabel=p,this.update({sortByLabel:p})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(p){this._keepScrollPosition=p,this.update({keepScrollPosition:p})}get activeItems(){return this._activeItems}set activeItems(p){this._activeItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({activeItems:this._activeItems.map(m=>this._itemsToHandles.get(m))})}get selectedItems(){return this._selectedItems}set selectedItems(p){this._selectedItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({selectedItems:this._selectedItems.map(m=>this._itemsToHandles.get(m))})}_fireDidChangeActive(p){const m=Fi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Fi(p.map(v=>this._handlesToItems.get(v)));this._selectedItems=m,this._onDidChangeSelectionEmitter.fire(m)}_fireDidTriggerItemButton(p,m){const v=this._handlesToItems.get(p);if(!v||!v.buttons||!v.buttons.length)return;const b=v.buttons[m];b&&this._onDidTriggerItemButtonEmitter.fire({button:b,item:v})}}class h extends o{constructor(p,m){super(p,m),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(p){this._password=p,this.update({password:p})}get prompt(){return this._prompt}set prompt(p){this._prompt=p,this.update({prompt:p})}get valueSelection(){return this._valueSelection}set valueSelection(p){this._valueSelection=p,this.update({valueSelection:p})}get validationMessage(){return this._validationMessage}set validationMessage(p){this._validationMessage=p,p?typeof p=="string"?this.update({validationMessage:p,severity:Xe.Error}):this.update({validationMessage:p.message,severity:p.severity??Xe.Error}):this.update({validationMessage:void 0,severity:Xe.Ignore})}}return new n(e,t)}var qIe;function t$e(s){return s instanceof N}function wii(s,e){return s.scheme===pe.file&&e.scheme===pe.file&&pr?s.toString()===e.toString():s.toString().toLowerCase()===e.toString().toLowerCase()}function sge(s){if(s)return typeof s.iconPath=="string"?N.file(s.iconPath):N.isUri(s.iconPath)||We.isThemeIcon(s.iconPath)?s.iconPath:void 0}function i$e(s){if(s){if(N.isUri(s))return s;if(We.isThemeIcon(s))return s;{const e=s;return{light:e.light,dark:e.dark}}}else return}function oge(s){const e=i$e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:i$e(i.icon)}));return{...s,icon:e,labels:t}}function rge(s,e){if(!s.iconPath&&!e.iconPath)return 0;if(s.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof s.iconPath=="string"?s.iconPath:N.isUri(s.iconPath)?s.iconPath.fsPath:s.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:N.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return Kq(t,i)}function yii(s,e){let t=0;if(s.strikeThrough!==e.strikeThrough)return s.strikeThrough?1:-1;if(s.faded!==e.faded)return s.faded?1:-1;if(s.tooltip!==e.tooltip)return(s.tooltip||"").localeCompare(e.tooltip||"");if(t=rge(s,e),t!==0)return t;if(s.light&&e.light)t=rge(s.light,e.light);else{if(s.light)return 1;if(e.light)return-1}if(t!==0)return t;if(s.dark&&e.dark)t=rge(s.dark,e.dark);else{if(s.dark)return 1;if(e.dark)return-1}return t}function Cii(s,e){if(s.command!==e.command)return s.commandthis._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(n$e),i=F1e(this._resourceSnapshot,e,n$e).map(r=>{const a=r.toInsert.map(c=>{const l=this._resourceHandlePool++;this._resourceStatesMap.set(l,c);const d=c.resourceUri;let h;if(c.command)if(c.command.command==="vscode.open"||c.command.command==="vscode.diff"||c.command.command==="vscode.changes"){const P=new Z;h=this._commands.converter.toInternal(c.command,P),this._resourceStatesDisposablesMap.set(l,P)}else this._resourceStatesCommandsMap.set(l,c.command);const u=dl(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=sge(c.decorations),v=c.decorations&&sge(c.decorations.light)||m,b=c.decorations&&sge(c.decorations.dark)||m,w=[v,b],y=c.decorations&&c.decorations.tooltip||"",C=c.decorations&&!!c.decorations.strikeThrough,A=c.decorations&&!!c.decorations.faded,L=c.contextValue||"";return{rawResource:[l,d,w,y,C,A,L,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),n=i.map(({start:r,deleteCount:a,toInsert:c})=>[r,a,c.map(l=>l.rawResource)]),o=i.reverse();for(const{start:r,deleteCount:a,toInsert:c}of o){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(r,a,...l);for(const h of d)this._resourceStatesMap.delete(h),this._resourceStatesCommandsMap.delete(h),this._resourceStatesDisposablesMap.get(h)?.dispose(),this._resourceStatesDisposablesMap.delete(h)}return this._resourceSnapshot=e,n}dispose(){this._disposed=!0,this._onDidDispose.fire()}};mre._handlePool=0;let QIe=mre;var xd;const _re=class _re{constructor(e,t,i,n,o,r,a){Wt(this,xd);this._extension=e,this._commands=n,this._id=o,this._label=r,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new wn,this._commitTemplate=void 0,this._acceptInputDisposables=new wn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new wn,this._statusBarDisposables=new wn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=_re._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,Ct(this,xd,i);const c=N.from({scheme:pe.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new xii(e,t,Ce(this,xd),this.handle,c),Ce(this,xd).$registerSourceControl(this.handle,o,r,a,c)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,Ce(this,xd).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;dl(this._extension,"quickDiffProvider")&&(t=e?.label),Ce(this,xd).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get historyProvider(){return Ve(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Ve(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,Ce(this,xd).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,Ce(this,xd).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Ce(this,xd).$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new Z,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);Ce(this,xd).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return Ve(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Ve(this._extension,"scmActionButton"),this._actionButtonDisposables.value=new Z,this._actionButton=e;const t=e!==void 0?{command:this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),secondaryCommands:e.secondaryCommands?.map(i=>i.map(n=>this._commands.converter.toInternal(n,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;Ce(this,xd).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&Eii(this._statusBarCommands,e))return;this._statusBarDisposables.value=new Z,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));Ce(this,xd).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const n=dl(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new QIe(Ce(this,xd),this._commands,this.handle,e,t,n,this._extension),r=M.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,n]of this.createdResourceGroups){n.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});M.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),Ce(this,xd).$unregisterGroup(this.handle,i.handle)}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const r=i._takeResourceStateSnapshot();r.length>0&&t.push([i.handle,r]),this._groups.set(i.handle,i)}Ce(this,xd).$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&Ce(this,xd).$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),Ce(this,xd).$unregisterSourceControl(this.handle)}};xd=new WeakMap,_re._handlePool=0;let _N=_re;_N.__decorator=D([ULe(100)],_N.prototype,"eventuallyAddResourceGroups",null);_N.__decorator=D([ULe(100)],_N.prototype,"eventuallyUpdateResourceStates",null);var dM;let jIe=(dM=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,n){this._commands=t,this._extHostDocuments=i,this.logService=n,this._sourceControls=new Map,this._sourceControlsByExtension=new va,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Be.MainThreadSCM),this._telemetry=e.getProxy(Be.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===ws.ScmResource){const r=this._sourceControls.get(o.sourceControlHandle);if(!r)return o;const a=r.getResourceGroup(o.groupHandle);return a?a.getResourceState(o.handle):o}else if(o&&o.$mid===ws.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===ws.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,n){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,n),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=qIe._handlePool++,r=new _N(e,this._extHostDocuments,this._proxy,this._commands,t,i,n);this._sourceControls.set(o,r);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(r),this._sourceControlsByExtension.set(e.identifier,a),r}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const n=N.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,n.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):jh(()=>o.quickDiffProvider.provideOriginalResource(n,i)).then(r=>r||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,n){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const o=this._sourceControls.get(e);if(!o)return Promise.resolve(void 0);const r=o.getResourceGroup(t);return r?r.$executeResourceCommand(i,n):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const n=this._sourceControls.get(e);return!n||!n.inputBox.validateInput?Promise.resolve(void 0):jh(()=>n.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Ps.fromStrict(o.message);return r?Promise.resolve([r,o.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemGroupCommonAncestor(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,n)??void 0}async $resolveHistoryItemGroupCommonAncestor2(e,t,i){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor2(t,i)??void 0}async $provideHistoryItems(e,t,i,n){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,n))?.map(a=>oge(a))??void 0}async $provideHistoryItems2(e,t,i){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems2(t,i))?.map(r=>oge(r))??void 0}async $provideHistoryItemSummary(e,t,i,n){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,n);return r?oge(r):void 0}async $provideHistoryItemChanges(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,n)??void 0}},qIe=dM,dM._handlePool=0,dM);jIe=qIe=D([_(3,Ge)],jIe);const vre=class vre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:et.to(t.selection),resourceUri:N.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=vre.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,NH.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};vre.handlePool=0;let YIe=vre;const bre=class bre{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Be.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.provideSpeechToTextSession(r.token,i?{language:i}:void 0);a&&(o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.provideTextToSpeechSession(r.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const n=new Z,o=new ci;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(n.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),n.add(o.token.onCancellationRequested(()=>n.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const n=bre.ID_POOL++;return this.providers.set(n,i),this.proxy.$registerProvider(n,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(n),this.providers.delete(n)})}};bre.ID_POOL=1;let JIe=bre;var e2,t2;const C1=class C1{constructor(e,t,i,n,o,r=TS.Left,a){Wt(this,e2);Wt(this,t2);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,Ct(this,e2,e),Ct(this,t2,t),o&&n){this._entryId=$9t(n.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?TS.Left:TS.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(C1.ID_GEN++);this._extension=n,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(lc(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!C1.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new Z,typeof e=="string"?this._command={fromApi:e,internal:Ce(this,t2).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Ce(this,t2).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,Ce(this,e2).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=g(4587,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=C1.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const n=Ps.fromStrict(this._tooltip);Ce(this,e2).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,n,this._command?.internal,i,this._backgroundColor,this._alignment===TS.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};e2=new WeakMap,t2=new WeakMap,C1.ID_GEN=0,C1.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new dH("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new dH("statusBarItem.warningForeground")]]);let XIe=C1;class Dii{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",TS.Left,Number.MIN_VALUE),this._item.name=g(4588,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new Qs(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class kii{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Be.MainThreadStatusBar),this._commands=t,this._statusMessage=new Dii(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,n){return new XIe(this._proxy,this._commands,this._existingItems,e,t,i,n)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let n;return typeof t=="number"?n=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new Qs(()=>{i.dispose(),clearTimeout(n)})}}class Iii extends V{constructor(e,t){super(),this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new I,this._onDidChangeTextEditorOptions=new I,this._onDidChangeTextEditorVisibleRanges=new I,this._onDidChangeTextEditorViewColumn=new I,this._onDidChangeActiveTextEditor=new I,this._onDidChangeVisibleTextEditors=new I,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(Be.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let n;typeof t=="number"?n={position:xl.from(t),preserveFocus:i}:typeof t=="object"?n={position:xl.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?et.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:n={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,n),r=o&&this._extHostDocumentsAndEditors.getEditor(o);if(r)return r.value;throw o?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new Yke(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const n=t.selections.selections.map(Wb.to);i._acceptSelections(n)}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));i._acceptVisibleRanges(n)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:aB.to(t.options.lineNumbers)}}),t.selections){const n=iN.fromValue(t.selections.source),o=t.selections.selections.map(Wb.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:n})}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:n})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const n=xl.to(e[t]);i.value.viewColumn!==n&&(i._acceptViewColumn(n),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:n}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let ZIe=class{constructor(e){this._actual=new ote(mS.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=mS.Light;break;case"hcDark":t=mS.HighContrast;break;case"hcLight":t=mS.HighContrastLight;break;default:t=mS.Dark}this._actual=new ote(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};ZIe=D([_(0,Jo)],ZIe);class Tii{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Be.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,n)=>{if(i&&i.$mid===ws.TimelineActionContext)if(this._providers.get(i.source)&&Sn.equals(n,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:N.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(s$e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,n){return this._providers.get(e)?.provider.provideTimeline(N.revive(t),i,n)}registerTimelineProvider(e,t,i,n){const o=new Z,r=this.convertTimelineItem(t.id,n,o).bind(this);let a;t.onDidChange&&(a=t.onDidChange(l=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...l,id:t.id}),this));const c=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(l,d,h){d?.resetCache&&(o.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=r(l,d);return{...u,source:t.id,items:u.items.map(f)}},dispose(){for(const l of c.values())l.get(t.id)?.clear();a?.dispose(),o.dispose()}},i)}convertTimelineItem(e,t,i){return(n,o)=>{let r;if(o?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=s$e(n);r=a.get(c),r===void 0&&(r=new Map,a.set(c,r))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;r?.set(d,a);let h,u,f;a.iconPath&&(c instanceof uu?f={id:c.id,color:c.color}:N.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return df.isMarkdownString(l.tooltip)?p=Ps.from(l.tooltip):Lt(l.tooltip)?p=l.tooltip:df.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Ps.from(l.detail)):Lt(l.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=l.detail),{...l,id:l.id??void 0,handle:d,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:h,iconDark:u,themeIcon:f,tooltip:p,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),Ee(()=>{for(const n of this._itemsBySourceAndUriMap.values())n.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function s$e(s){return s?.toString()}function o$e(s,e){if(Lt(s))return{label:s};if(s&&typeof s=="object"&&typeof s.label=="string"){let t;return Array.isArray(s.highlights)&&(t=s.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:s.label,highlights:t}}}class Lii extends V{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new WRe;function n(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>n(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>n(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const n=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>n.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const n=t.dragAndDropController?.dropMimeTypes??[],o=t.dragAndDropController?.dragMimeTypes??[],r=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:n,dragMimeTypes:o,hasHandleDrag:r,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},d=this._proxy.$registerTreeViewDataProvider(e,l),h={get onDidCollapseElement(){return c.onDidCollapseElement},get onDidExpandElement(){return c.onDidExpandElement},get selection(){return c.selectedElements},get onDidChangeSelection(){return c.onDidChangeSelection},get activeItem(){return Ve(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Ve(i,"treeViewActiveItem"),c.onDidChangeActiveItem},get visible(){return c.visible},get onDidChangeVisibility(){return c.onDidChangeVisibility},get onDidChangeCheckboxState(){return c.onDidChangeCheckboxState},get message(){return c.message},set message(u){dd(u)&&Ve(i,"treeViewMarkdownMessage"),c.message=u},get title(){return c.title},set title(u){c.title=u},get description(){return c.description},set description(u){c.description=u},get badge(){return c.badge},set badge(u){u!==void 0&&QAe.isViewBadge(u)?c.badge={value:Math.floor(Math.abs(u.value)),tooltip:u.tooltip}:u===void 0&&(c.badge=void 0)},reveal:(u,f)=>c.reveal(u,f),dispose:async()=>{await d,this.treeViews.delete(e),c.dispose()}};return this._register(h),h}$getChildren(e,t){const i=this.treeViews.get(e);return i?i.getChildren(t):Promise.reject(new tw(e))}async $handleDrop(e,t,i,n,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new tw(e));const d=B_.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,o,r),l.onDrop(d,n,o)}async addAdditionalTransferItems(e,t,i,n,o){const r=this.treeDragAndDropService.removeDragOperationTransfer(o);if(r)(await r)?.forEach((a,c)=>{a&&e.set(c,a)});else if(o&&t.handleDrag){const a=t.handleDrag(i,e,n);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,n){const o=this.treeViews.get(e);if(!o)return Promise.reject(new tw(e));const r=await this.addAdditionalTransferItems(new lH,o,t,n,i);if(!(!r||n.isCancellationRequested))return B_.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new tw(e);return t.hasResolve}$resolve(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);return n.resolveTreeItem(t,i)}$setExpanded(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);n.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);n.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new tw(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new tw(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const n=this._register(new e0e(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,n),n}convertArgument(e){const t=this.treeViews.get(e.$treeViewId);return t&&"$treeItemHandle"in e?t.getExtensionElement(e.$treeItemHandle):t&&"$focusedTreeItem"in e&&e.$focusedTreeItem?t.focusedElement:null}}const EO=class EO extends V{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!ra(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,n,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=n,this.logService=o,this.extension=r,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new I),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new I),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new I),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new I),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new I),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new ci,r.contributes&&r.contributes.views)for(const d in r.contributes.views)for(const h of r.contributes.views[d])h.id===e&&(this._title=h.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(d=>{Array.isArray(d)&&d.length===0||this._onDidChangeData.fire({message:!1,element:d})}));let a,c;const l=M.debounce(this._onDidChangeData.event,(d,h)=>(d||(d={message:!1,elements:[]}),h.element!==!1&&(a||(a=new Promise(u=>c=u),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(h.element)?d.elements.push(...h.element):d.elements.push(h.element)),h.message&&(d.message=!0),d),200,!0);this._register(l(({message:d,elements:h})=>{h.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const u=c;return a=null,this.refresh(h).then(()=>u())})),d&&this.proxy.$setMessage(this.viewId,Ps.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(n=>n.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=ra(t.select)?!0:t.select,n=ra(t.focus)?!1:t.focus,o=ra(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(r=>this.resolveTreeNode(e,r[r.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:r.map(c=>c.item)},{select:i,focus:n,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:n,expand:o})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=eie.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!is(this._selectedHandles,e);this._selectedHandles=e;const n=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),n&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const n=this.getExtensionElement(i.treeItemHandle);return n?{extensionItem:n,treeItem:await this.dataProvider.getTreeItem(n),newState:i.newState?db.Checked:db.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?db.Checked:db.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const n=[];for(const o of e){const r=this.getExtensionElement(o);r&&n.push(r)}if(!(!this.dndController?.handleDrag||n.length===0))return await this.dndController.handleDrag(n,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const n=t?this.getExtensionElement(t):void 0;if(!(!n&&t||!this.dndController?.handleDrop))return jh(()=>this.dndController?.handleDrop?this.dndController.handleDrop(n,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const n=this.nodes.get(i);if(n){const o=await this.dataProvider.resolveTreeItem(n.extensionItem,i,t)??n.extensionItem;return this.validateTreeItem(o),n.item.tooltip=this.getTooltip(o.tooltip),n.item.command=this.getCommand(n.disposableStore,o.command),n.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(n=>(i.push(n),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):jh(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):jh(()=>this.dataProvider.getTreeItem(e)).then(n=>this.createHandle(e,n,t,!0)).then(n=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(n);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${n} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new ci(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,n=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Fi(n||[]),r=await Promise.all(Fi(o).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=r.map((c,l)=>c?this.createAndRegisterTreeNode(o[l],c,i):null);return Fi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ci,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(o=>this.nodes.get(o));for(const o of i)if(o&&!t.has(o.item.handle)){let r=o;for(;r&&r.parent&&i.findIndex(a=>r&&r.parent&&a&&a.item.handle===r.parent.item.handle)===-1;){const a=this.elements.get(r.parent.item.handle);r=a?this.nodes.get(a):void 0}r&&!r.parent&&t.add(o.item.handle)}const n=[];return t.forEach(o=>{const r=this.elements.get(o);if(r){const a=this.nodes.get(r);a&&(!a.parent||!t.has(a.parent.item.handle))&&n.push(o)}}),n}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(n=>{n&&(t[i]=n.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),jh(()=>this.dataProvider.getTreeItem(t)).then(n=>{if(n){const o=this.createTreeNode(t,n,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const n=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(n.item.handle))throw new Error(g(4589,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,n),this.addNodeToParentCache(n,i),n}getTooltip(e){return df.isMarkdownString(e)?Ps.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,n;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,n=e.checkboxState.accessibilityInformation),{isChecked:t===db.Checked,tooltip:i,accessibilityInformation:n}}validateTreeItem(e){if(!$9.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const n=this._register(new Z),o=this.createHandle(e,t,i),r=this.getLightIconPath(t);return{item:{handle:o,parentHandle:i?i.item.handle:void 0,label:o$e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(n,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:ra(t.collapsibleState)?vD.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:n,dispose(){n.dispose()}}}getThemeIcon(e){return e.iconPath instanceof uu?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:n},o,r){if(t)return`${EO.ID_HANDLE_PREFIX}/${t}`;const a=o$e(i),c=o?o.item.handle:EO.LABEL_HANDLE_PREFIX;let l=a?a.label:n?_i(n):"";l=l.indexOf("/")!==-1?l.replace("/","//"):l;const d=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,h=this.getChildrenNodes(o)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,r||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof uu))return typeof e.iconPath=="string"||N.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof uu)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return N.isUri(e)?e:N.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,n){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const o=this.getChildrenNodes(n)||[],r=o.filter(a=>a.item.handle===i.item.handle)[0];r&&o.splice(o.indexOf(r),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const n=this.elements.get(i.item.handle);n&&this.clear(n)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const n=this.elements.get(i.item.handle);n&&this.clear(n)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};EO.LABEL_HANDLE_PREFIX="0",EO.ID_HANDLE_PREFIX="1";let e0e=EO;const wre=class wre{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Be.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,n){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=n.schemes.find(r=>!wre.supportedSchemes.has(r));if(o)throw new Error(`Scheme '${o}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,n.schemes,e,n.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener with id: ${e}`);const o=N.revive(t);return n.canOpenExternalUri(o,i)}async $openUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener id: '${e}'`);return n.openExternalUri(N.revive(t.resolvedUri),{sourceUri:N.revive(t.sourceUri)},i)}};wre.supportedSchemes=new Set([pe.http,pe.https]);let t0e=wre;const yre=class yre{constructor(e){this.handles=new A_,this.handlers=new Map,this._proxy=e.getProxy(Be.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const n=yre.HandlePool++;return this.handles.add(i),this.handlers.set(n,t),this._proxy.$registerUriHandler(n,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(n),this._proxy.$unregisterUriHandler(n)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(N.revive(t))}catch(n){vt(n)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}};yre.HandlePool=0;let i0e=yre;var hx,ux,E7,i2,x7,sT,n2,iS,s2,o2,gx,r2,a2;class Rii extends V{constructor(t,i,n,o){super();Wt(this,hx);Wt(this,ux);Wt(this,E7);Wt(this,i2);Wt(this,x7);Wt(this,sT);Wt(this,n2);Wt(this,iS);Wt(this,s2);Wt(this,o2);Wt(this,gx);Wt(this,r2);Wt(this,a2);Ct(this,iS,void 0),Ct(this,s2,!0),Ct(this,gx,!1),Ct(this,r2,this._register(new I)),this.onDidDispose=Ce(this,r2).event,Ct(this,a2,this._register(new I)),this.onDidChangeViewState=Ce(this,a2).event,Ct(this,hx,t),Ct(this,ux,i),Ct(this,i2,n),Ct(this,E7,o.viewType),Ct(this,x7,o.panelOptions),Ct(this,iS,o.viewColumn),Ct(this,sT,o.title),Ct(this,o2,o.active)}dispose(){Ce(this,gx)||(Ct(this,gx,!0),Ce(this,r2).fire(),Ce(this,ux).$disposeWebview(Ce(this,hx)),Ce(this,i2).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),Ce(this,i2)}get viewType(){return this.assertNotDisposed(),Ce(this,E7)}get title(){return this.assertNotDisposed(),Ce(this,sT)}set title(t){this.assertNotDisposed(),Ce(this,sT)!==t&&(Ct(this,sT,t),Ce(this,ux).$setTitle(Ce(this,hx),t))}get iconPath(){return this.assertNotDisposed(),Ce(this,n2)}set iconPath(t){this.assertNotDisposed(),Ce(this,n2)!==t&&(Ct(this,n2,t),Ce(this,ux).$setIconPath(Ce(this,hx),N.isUri(t)?{light:t,dark:t}:t))}get options(){return Ce(this,x7)}get viewColumn(){if(this.assertNotDisposed(),!(typeof Ce(this,iS)=="number"&&Ce(this,iS)<0))return Ce(this,iS)}get active(){return this.assertNotDisposed(),Ce(this,o2)}get visible(){return this.assertNotDisposed(),Ce(this,s2)}_updateViewState(t){Ce(this,gx)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(Ct(this,o2,t.active),Ct(this,s2,t.visible),Ct(this,iS,t.viewColumn),Ce(this,a2).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),Ce(this,ux).$reveal(Ce(this,hx),{viewColumn:typeof t>"u"?void 0:xl.from(t),preserveFocus:!!i})}assertNotDisposed(){if(Ce(this,gx))throw new Error("Webview is disposed")}}hx=new WeakMap,ux=new WeakMap,E7=new WeakMap,i2=new WeakMap,x7=new WeakMap,sT=new WeakMap,n2=new WeakMap,iS=new WeakMap,s2=new WeakMap,o2=new WeakMap,gx=new WeakMap,r2=new WeakMap,a2=new WeakMap;class UPe extends V{static newHandle(){return ar()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,n,o={}){const r=typeof n=="object"?n.viewColumn:n,a={viewColumn:xl.from(r),preserveFocus:typeof n=="object"&&!!n.preserveFocus},c=QH(e),l=UPe.newHandle();this._proxy.$createWebviewPanel(rne(e),l,t,{title:i,panelOptions:Mii(o),webviewOptions:mot(e,this.workspace,o),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,o,e);return this.createNewWebviewPanel(l,t,i,r,o,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,n)=>{const o=e[i],r=e[n];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const n=this.getWebviewPanel(i);if(!n)continue;const o=e[i];n._updateViewState({active:o.active,visible:o.visible,viewColumn:xl.to(o.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:QH(e)}),new Qs(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,n){const o=this._serializers.get(t);if(!o)throw new Error(`No serializer found for '${t}'`);const{serializer:r,extension:a}=o,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,n,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,n,o,r,a){const c=new Rii(e,this._proxy,r,{viewType:t,title:i,viewColumn:n,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function Mii(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}var fx,px,D7,c2,mx,oT,rT,l2,aT,d2,h2;class Nii extends V{constructor(t,i,n,o,r,a){super();Wt(this,fx);Wt(this,px);Wt(this,D7);Wt(this,c2);Wt(this,mx);Wt(this,oT);Wt(this,rT);Wt(this,l2);Wt(this,aT);Wt(this,d2);Wt(this,h2);Ct(this,mx,!1),Ct(this,d2,this._register(new I)),this.onDidChangeVisibility=Ce(this,d2).event,Ct(this,h2,this._register(new I)),this.onDidDispose=Ce(this,h2).event,Ct(this,D7,n),Ct(this,rT,o),Ct(this,fx,t),Ct(this,px,i),Ct(this,c2,r),Ct(this,oT,a)}dispose(){Ce(this,mx)||(Ct(this,mx,!0),Ce(this,h2).fire(),Ce(this,c2).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),Ce(this,rT)}set title(t){this.assertNotDisposed(),Ce(this,rT)!==t&&(Ct(this,rT,t),Ce(this,px).$setWebviewViewTitle(Ce(this,fx),t))}get description(){return this.assertNotDisposed(),Ce(this,l2)}set description(t){this.assertNotDisposed(),Ce(this,l2)!==t&&(Ct(this,l2,t),Ce(this,px).$setWebviewViewDescription(Ce(this,fx),t))}get visible(){return Ce(this,oT)}get webview(){return Ce(this,c2)}get viewType(){return Ce(this,D7)}_setVisible(t){t===Ce(this,oT)||Ce(this,mx)||(Ct(this,oT,t),Ce(this,d2).fire())}get badge(){return this.assertNotDisposed(),Ce(this,aT)}set badge(t){this.assertNotDisposed(),!(t?.value===Ce(this,aT)?.value&&t?.tooltip===Ce(this,aT)?.tooltip)&&(Ct(this,aT,eie.from(t)),Ce(this,px).$setWebviewViewBadge(Ce(this,fx),t))}show(t){this.assertNotDisposed(),Ce(this,px).$show(Ce(this,fx),!!t)}assertNotDisposed(){if(Ce(this,mx))throw new Error("Webview is disposed")}}fx=new WeakMap,px=new WeakMap,D7=new WeakMap,c2=new WeakMap,mx=new WeakMap,oT=new WeakMap,rT=new WeakMap,l2=new WeakMap,aT=new WeakMap,d2=new WeakMap,h2=new WeakMap;class Pii{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,n){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(rne(e),t,{retainContextWhenHidden:n?.retainContextWhenHidden,serializeBuffersForPostMessage:QH(e)}),new Qs(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,n,o){const r=this._viewProviders.get(t);if(!r)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=r,l=this._extHostWebview.createNewWebview(e,{},c),d=new Nii(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:n},o)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}function Fii(s){const e=s.get(_u),t=s.get(jU),i=s.get(nle),n=s.get(MI),o=s.get(oE),r=s.get(ole),a=s.get(rE),c=s.get(sle),l=s.get(Jo),d=s.get(LPe),h=s.get(RPe),u=s.get(uf),f=s.get(Ge),p=s.get(bPe),m=s.get(rle),v=s.get(got),b=s.get(PPe),w=s.get(fG),y=s.get(OPe),C=s.get(MPe),A=s.get(NPe);l.set(Ye.ExtHostFileSystemInfo,t),l.set(Ye.ExtHostLogLevelServiceShape,u),l.set(Ye.ExtHostWorkspace,o),l.set(Ye.ExtHostConfiguration,a),l.set(Ye.ExtHostExtensionService,n),l.set(Ye.ExtHostStorage,d),l.set(Ye.ExtHostTunnelService,p),l.set(Ye.ExtHostWindow,v),l.set(Ye.ExtHostSecretState,b),l.set(Ye.ExtHostTelemetry,r),l.set(Ye.ExtHostEditorTabs,w),l.set(Ye.ExtHostManagedSockets,y),l.set(Ye.ExtHostAuthentication,C),l.set(Ye.ExtHostChatProvider,A);const L=l.set(Ye.ExtHostDecorations,s.get(Zst)),k=l.set(Ye.ExtHostDocumentsAndEditors,s.get(YU)),P=l.set(Ye.ExtHostCommands,s.get(YN)),R=l.set(Ye.ExtHostTerminalService,s.get(JU)),z=l.set(Ye.ExtHostTerminalShellIntegration,s.get(fot)),G=l.set(Ye.ExtHostDebugService,s.get(hot)),Y=l.set(Ye.ExtHostSearch,s.get(uot)),j=l.set(Ye.ExtHostTask,s.get(not)),ne=l.set(Ye.ExtHostOutputService,s.get(Jst)),ge=l.set(Ye.ExtHostLocalization,s.get(FPe)),De=l.set(Ye.ExtHostUrls,new i0e(l)),Oe=l.set(Ye.ExtHostDocuments,new Jti(l,k)),yt=l.set(Ye.ExtHostDocumentContentProviders,new PIe(l,k,f)),Ne=l.set(Ye.ExtHostDocumentSaveParticipant,new Yti(f,Oe,l.getProxy(Be.MainThreadBulkEdits))),lt=l.set(Ye.ExtHostNotebook,new HIe(l,P,k,Oe,i,Y,f)),xt=l.set(Ye.ExtHostNotebookDocuments,new uii(lt)),Ji=l.set(Ye.ExtHostNotebookEditors,new UIe(f,lt)),Ii=l.set(Ye.ExtHostNotebookKernels,new VIe(l,e,lt,P,f)),ns=l.set(Ye.ExtHostNotebookRenderers,new pii(l,lt)),zs=l.set(Ye.ExtHostNotebookDocumentSaveParticipant,new hii(f,lt,l.getProxy(Be.MainThreadBulkEdits))),Pn=l.set(Ye.ExtHostEditors,new Iii(l,k)),Xr=l.set(Ye.ExtHostTreeViews,new Lii(l.getProxy(Be.MainThreadTreeViews),P,f)),ds=l.set(Ye.ExtHostEditorInsets,new Pti(l.getProxy(Be.MainThreadEditorInsets),Pn,e.remote)),Zo=l.set(Ye.ExtHostDiagnostics,new NIe(l,f,t,k)),Zr=l.set(Ye.ExtHostLanguages,new cii(l,Oe,P.converter,c)),Di=l.set(Ye.ExtHostLanguageFeatures,new FIe(l,c,Oe,P,Zo,f,m,r)),ss=l.set(Ye.ExtHostFileSystem,new cne(l,Di)),Oo=l.set(Ye.ExtHostFileSystemEventService,new nii(l,f,k)),Tn=l.set(Ye.ExtHostQuickOpen,bii(l,o,P)),Ba=l.set(Ye.ExtHostSCM,new jIe(l,P,Oe,f)),vd=l.set(Ye.ExtHostQuickDiff,new KIe(l,c)),Fn=l.set(Ye.ExtHostShare,new YIe(l,c)),th=l.set(Ye.ExtHostComments,Fti(l,P,Oe)),pc=l.set(Ye.ExtHostProgress,new _ii(l.getProxy(Be.MainThreadProgress))),zc=l.set(Ye.ExtHostLabelService,new oii(l)),$s=l.set(Ye.ExtHostTheming,new ZIe(l)),tc=l.set(Ye.ExtHostTimeline,new Tii(l,P)),fl=l.set(Ye.ExtHostWebviews,new Wti(l,e.remote,o,f,m)),ih=l.set(Ye.ExtHostWebviewPanels,new UPe(l,fl,o)),gg=l.set(Ye.ExtHostCustomEditors,new Gti(l,Oe,h,fl,ih)),mc=l.set(Ye.ExtHostWebviewViews,new Pii(l,fl)),$c=l.set(Ye.ExtHostTesting,s.get(cle)),nh=l.set(Ye.ExtHostUriOpeners,new t0e(l)),Dc=l.set(Ye.ExtHostProfileContentHandlers,new mii(l));l.set(Ye.ExtHostInteractive,new sii(l,lt,k,P,f));const pl=l.set(Ye.ExtHostChatAgents2,new LIe(l,f,P,Oe)),ic=l.set(Ye.ExtHostChatVariables,new RIe(l)),Or=l.set(Ye.ExtHostLanguageModelTools,new aii(l)),ml=l.set(Ye.ExtHostAiRelatedInformation,new Dti(l)),sh=l.set(Ye.ExtHostAiEmbeddingVector,new Zti(l)),oh=l.set(Ye.ExtHostStatusBar,new kii(l,P.converter)),Gc=l.set(Ye.ExtHostSpeech,new JIe(l)),Kc=l.set(Ye.ExtHostEmbeddings,new Xti(l)),Wa=Object.values(Ye);l.assertRegistered(Wa);const Bo=new TIe(l,k),Is=new Rti(l),kc=new OIe(l,f),Nh=new jti(l);return Iti.register(P),function(be,Aa,ee){function xe(O){return($,se,Ke)=>{const Bi=O(Wi=>{try{$.call(se,Wi)}catch(ta){No(new Error(`[ExtensionListenerError] Extension '${be.identifier.value}' FAILED to handle event: ${ta.toString()}`,{cause:ta})),r.onExtensionError(be.identifier,ta)}});return Ke?.push(Bi),Bi}}const gt=function(){let O=!be.isUnderDevelopment;function $(){O||(f.info(`Extension '${be.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),O=!0)}return function se(Ke){if(Array.isArray(Ke))Ke.forEach(se);else if(typeof Ke=="string")$();else{const Bi=Ke;typeof Bi.scheme>"u"&&$(),typeof Bi.exclusive=="boolean"&&Ve(be,"documentFiltersExclusive")}return Ke}}(),zn={getSession(O,$,se){return typeof se?.forceNewSession=="object"&&se.forceNewSession.learnMore&&Ve(be,"authLearnMore"),se?.account&&Ve(be,"authGetSessions"),C.getSession(be,O,$,se)},getAccounts(O){return Ve(be,"authGetSessions"),C.getAccounts(O)},async hasSession(O,$){return Ve(be,"authSession"),!!await C.getSession(be,O,$,{silent:!0})},get onDidChangeSessions(){return xe(C.onDidChangeSessions)},registerAuthenticationProvider(O,$,se,Ke){return C.registerAuthenticationProvider(O,$,se,Ke)}},Cs={registerCommand(O,$,se){return P.registerCommand(!0,O,$,se,void 0,be)},registerTextEditorCommand(O,$,se){return P.registerCommand(!0,O,(...Ke)=>{const Bi=Pn.getActiveTextEditor();if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}return Bi.edit(Wi=>{$.apply(se,[Bi,Wi,...Ke])}).then(Wi=>{Wi||f.warn("Edits from command "+O+" were not applied.")},Wi=>{f.warn("An error occurred while running command "+O,Wi)})},void 0,void 0,be)},registerDiffInformationCommand:(O,$,se)=>(Ve(be,"diffCommand"),P.registerCommand(!0,O,async(...Ke)=>{const Bi=k.activeEditor(!0);if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}const Wi=await Pn.getDiffInformation(Bi.id);$.apply(se,[Wi,...Ke])},void 0,void 0,be)),executeCommand(O,...$){return P.executeCommand(O,...$)},getCommands(O=!1){return P.getCommands(O)}},Wo={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return Is.value},get shell(){return R.getDefaultShell(!1)},get onDidChangeShell(){return xe(R.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return xe(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Ve(be,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Ve(be,"telemetry"),xe(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return tot(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(O,$){return eot.validateSender(O),r.instantiateLogger(be,O,$)},openExternal(O,$){return v.openUri(O,{allowTunneling:!!e.remote.authority,allowContributedOpeners:$?.allowContributedOpeners})},async asExternalUri(O){if(O.scheme===e.environment.appUriScheme)return De.createAppUri(O);try{return await v.asExternalUri(O,{allowTunneling:!!e.remote.authority})}catch($){if(AA(O,pe.http)||AA(O,pe.https))return O;throw $}},get remoteName(){return D6(e.remote.authority)},get remoteAuthority(){return Ve(be,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return xe(f.onDidChangeLogLevel)},get appQuality(){return Ve(be,"resolvers"),e.quality},get appCommit(){return Ve(be,"resolvers"),e.commit}},Ha={createTestController(O,$,se){return $c.createTestController(be,O,$,se)},createTestObserver(){return Ve(be,"testObserver"),$c.createTestObserver()},runTests(O){return Ve(be,"testObserver"),$c.runTests(O)},registerTestFollowupProvider(O){return Ve(be,"testObserver"),$c.registerTestFollowupProvider(O)},get onDidChangeTestResults(){return Ve(be,"testObserver"),xe($c.onResultsChanged)},get testResults(){return Ve(be,"testObserver"),$c.results}},ea=e.remote.isRemote?bD.Workspace:bD.UI,Ph={getExtension(O,$){dl(be,"extensionsAny")||($=!1);const se=Aa.mine.getExtensionDescription(O);if(se)return new UV(n,be.identifier,se,ea,!1);if($){const Ke=Aa.all.getExtensionDescription(O);if(Ke)return new UV(n,be.identifier,Ke,ea,!0)}},get all(){const O=[];for(const $ of Aa.mine.getAllExtensionDescriptions())O.push(new UV(n,be.identifier,$,ea,!1));return O},get allAcrossExtensionHosts(){Ve(be,"extensionsAny");const O=new A_(Aa.mine.getAllExtensionDescriptions().map(se=>se.identifier)),$=[];for(const se of Aa.all.getAllExtensionDescriptions()){const Ke=!O.has(se.identifier);$.push(new UV(n,be.identifier,se,ea,Ke))}return $},get onDidChange(){return dl(be,"extensionsAny")?xe(M.any(Aa.mine.onDidChange,Aa.all.onDidChange)):xe(Aa.mine.onDidChange)}},le={createDiagnosticCollection(O){return Zo.createDiagnosticCollection(be.identifier,O)},get onDidChangeDiagnostics(){return xe(Zo.onDidChangeDiagnostics)},getDiagnostics:O=>Zo.getDiagnostics(O),getLanguages(){return Zr.getLanguages()},setTextDocumentLanguage(O,$){return Zr.changeLanguage(O.uri,$)},match(O,$){const se=jEe.from(O);let Ke;return AQe(se)&&(Ke=lt.notebookDocuments.find(Bi=>Bi.apiNotebook.getCells().find(Wi=>Wi.document===$))?.apiNotebook),cae(se,$.uri,$.languageId,!0,Ke?.uri,Ke?.notebookType)},registerCodeActionsProvider(O,$,se){return Di.registerCodeActionProvider(be,gt(O),$,se)},registerDocumentPasteEditProvider(O,$,se){return Ve(be,"documentPaste"),Di.registerDocumentPasteEditProvider(be,gt(O),$,se)},registerCodeLensProvider(O,$){return Di.registerCodeLensProvider(be,gt(O),$)},registerDefinitionProvider(O,$){return Di.registerDefinitionProvider(be,gt(O),$)},registerDeclarationProvider(O,$){return Di.registerDeclarationProvider(be,gt(O),$)},registerImplementationProvider(O,$){return Di.registerImplementationProvider(be,gt(O),$)},registerTypeDefinitionProvider(O,$){return Di.registerTypeDefinitionProvider(be,gt(O),$)},registerHoverProvider(O,$){return Di.registerHoverProvider(be,gt(O),$,be.identifier)},registerEvaluatableExpressionProvider(O,$){return Di.registerEvaluatableExpressionProvider(be,gt(O),$,be.identifier)},registerInlineValuesProvider(O,$){return Di.registerInlineValuesProvider(be,gt(O),$,be.identifier)},registerDocumentHighlightProvider(O,$){return Di.registerDocumentHighlightProvider(be,gt(O),$)},registerMultiDocumentHighlightProvider(O,$){return Di.registerMultiDocumentHighlightProvider(be,gt(O),$)},registerLinkedEditingRangeProvider(O,$){return Di.registerLinkedEditingRangeProvider(be,gt(O),$)},registerReferenceProvider(O,$){return Di.registerReferenceProvider(be,gt(O),$)},registerRenameProvider(O,$){return Di.registerRenameProvider(be,gt(O),$)},registerNewSymbolNamesProvider(O,$){return Ve(be,"newSymbolNamesProvider"),Di.registerNewSymbolNamesProvider(be,gt(O),$)},registerDocumentSymbolProvider(O,$,se){return Di.registerDocumentSymbolProvider(be,gt(O),$,se)},registerWorkspaceSymbolProvider(O){return Di.registerWorkspaceSymbolProvider(be,O)},registerDocumentFormattingEditProvider(O,$){return Di.registerDocumentFormattingEditProvider(be,gt(O),$)},registerDocumentRangeFormattingEditProvider(O,$){return Di.registerDocumentRangeFormattingEditProvider(be,gt(O),$)},registerOnTypeFormattingEditProvider(O,$,se,...Ke){return Di.registerOnTypeFormattingEditProvider(be,gt(O),$,[se].concat(Ke))},registerDocumentSemanticTokensProvider(O,$,se){return Di.registerDocumentSemanticTokensProvider(be,gt(O),$,se)},registerDocumentRangeSemanticTokensProvider(O,$,se){return Di.registerDocumentRangeSemanticTokensProvider(be,gt(O),$,se)},registerSignatureHelpProvider(O,$,se,...Ke){return typeof se=="object"?Di.registerSignatureHelpProvider(be,gt(O),$,se):Di.registerSignatureHelpProvider(be,gt(O),$,typeof se>"u"?[]:[se,...Ke])},registerCompletionItemProvider(O,$,...se){return Di.registerCompletionItemProvider(be,gt(O),$,se)},registerInlineCompletionItemProvider(O,$,se){return $.handleDidShowCompletionItem&&Ve(be,"inlineCompletionsAdditions"),$.handleDidPartiallyAcceptCompletionItem&&Ve(be,"inlineCompletionsAdditions"),se&&Ve(be,"inlineCompletionsAdditions"),Di.registerInlineCompletionsProvider(be,gt(O),$,se)},registerInlineEditProvider(O,$){return Ve(be,"inlineEdit"),Di.registerInlineEditProvider(be,gt(O),$)},registerDocumentLinkProvider(O,$){return Di.registerDocumentLinkProvider(be,gt(O),$)},registerColorProvider(O,$){return Di.registerColorProvider(be,gt(O),$)},registerFoldingRangeProvider(O,$){return Di.registerFoldingRangeProvider(be,gt(O),$)},registerSelectionRangeProvider(O,$){return Di.registerSelectionRangeProvider(be,O,$)},registerCallHierarchyProvider(O,$){return Di.registerCallHierarchyProvider(be,O,$)},registerTypeHierarchyProvider(O,$){return Di.registerTypeHierarchyProvider(be,O,$)},setLanguageConfiguration:(O,$)=>Di.setLanguageConfiguration(be,O,$),getTokenInformationAtPosition(O,$){return Ve(be,"tokenInformation"),Zr.tokenAtPosition(O,$)},registerInlayHintsProvider(O,$){return Di.registerInlayHintsProvider(be,O,$)},createLanguageStatusItem(O,$){return Zr.createLanguageStatusItem(be,O,$)},registerDocumentDropEditProvider(O,$,se){return Di.registerDocumentOnDropEditProvider(be,O,$,dl(be,"documentPaste")?se:void 0)}},dr={get activeTextEditor(){return Pn.getActiveTextEditor()},get visibleTextEditors(){return Pn.getVisibleTextEditors()},get activeTerminal(){return R.activeTerminal},get terminals(){return R.terminals},async showTextDocument(O,$,se){N.isUri(O)&&O.scheme===pe.vscodeRemote&&!O.authority&&m.report("workspace.showTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority.");const Ke=await(N.isUri(O)?Promise.resolve(io.openTextDocument(O)):Promise.resolve(O));return Pn.showTextDocument(Ke,$,se)},createTextEditorDecorationType(O){return Pn.createTextEditorDecorationType(be,O)},onDidChangeActiveTextEditor(O,$,se){return xe(Pn.onDidChangeActiveTextEditor)(O,$,se)},onDidChangeVisibleTextEditors(O,$,se){return xe(Pn.onDidChangeVisibleTextEditors)(O,$,se)},onDidChangeTextEditorSelection(O,$,se){return xe(Pn.onDidChangeTextEditorSelection)(O,$,se)},onDidChangeTextEditorOptions(O,$,se){return xe(Pn.onDidChangeTextEditorOptions)(O,$,se)},onDidChangeTextEditorVisibleRanges(O,$,se){return xe(Pn.onDidChangeTextEditorVisibleRanges)(O,$,se)},onDidChangeTextEditorViewColumn(O,$,se){return xe(Pn.onDidChangeTextEditorViewColumn)(O,$,se)},onDidCloseTerminal(O,$,se){return xe(R.onDidCloseTerminal)(O,$,se)},onDidOpenTerminal(O,$,se){return xe(R.onDidOpenTerminal)(O,$,se)},onDidChangeActiveTerminal(O,$,se){return xe(R.onDidChangeActiveTerminal)(O,$,se)},onDidChangeTerminalDimensions(O,$,se){return Ve(be,"terminalDimensions"),xe(R.onDidChangeTerminalDimensions)(O,$,se)},onDidChangeTerminalState(O,$,se){return xe(R.onDidChangeTerminalState)(O,$,se)},onDidWriteTerminalData(O,$,se){return Ve(be,"terminalDataWriteEvent"),xe(R.onDidWriteTerminalData)(O,$,se)},onDidExecuteTerminalCommand(O,$,se){return Ve(be,"terminalExecuteCommandEvent"),xe(R.onDidExecuteTerminalCommand)(O,$,se)},onDidChangeTerminalShellIntegration(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidChangeTerminalShellIntegration)(O,$,se)},onDidStartTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidStartTerminalShellExecution)(O,$,se)},onDidEndTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidEndTerminalShellExecution)(O,$,se)},get state(){return v.getState()},onDidChangeWindowState(O,$,se){return xe(v.onDidChangeWindowState)(O,$,se)},showInformationMessage(O,...$){return kc.showMessage(be,Xe.Info,O,$[0],$.slice(1))},showWarningMessage(O,...$){return kc.showMessage(be,Xe.Warning,O,$[0],$.slice(1))},showErrorMessage(O,...$){return kc.showMessage(be,Xe.Error,O,$[0],$.slice(1))},showQuickPick(O,$,se){return Tn.showQuickPick(be,O,$,se)},showWorkspaceFolderPick(O){return Tn.showWorkspaceFolderPick(O)},showInputBox(O,$){return Tn.showInput(O,$)},showOpenDialog(O){return Nh.showOpenDialog(be,O)},showSaveDialog(O){return Nh.showSaveDialog(O)},createStatusBarItem(O,$,se){let Ke,Bi,Wi;return typeof O=="string"?(Ke=O,Bi=$,Wi=se):(Bi=O,Wi=$),oh.createStatusBarEntry(be,Ke,Bi,Wi)},setStatusBarMessage(O,$){return oh.setStatusBarMessage(O,$)},withScmProgress(O){return m.report("window.withScmProgress",be,"Use 'withProgress' instead."),pc.withProgress(be,{location:_D.SourceControl},($,se)=>O({report(Ke){}}))},withProgress(O,$){return pc.withProgress(be,O,$)},createOutputChannel(O,$){return ne.createOutputChannel(O,$,be)},createWebviewPanel(O,$,se,Ke){return ih.createWebviewPanel(be,O,$,se,Ke)},createWebviewTextEditorInset(O,$,se,Ke){return Ve(be,"editorInsets"),ds.createWebviewEditorInset(O,$,se,Ke,be)},createTerminal(O,$,se){return typeof O=="object"?"pty"in O?R.createExtensionTerminal(O):R.createTerminalFromOptions(O):R.createTerminal(O,$,se)},registerTerminalLinkProvider(O){return R.registerLinkProvider(O)},registerTerminalProfileProvider(O,$){return R.registerProfileProvider(be,O,$)},registerTerminalQuickFixProvider(O,$){return Ve(be,"terminalQuickFixProvider"),R.registerTerminalQuickFixProvider(O,be.identifier.value,$)},registerTreeDataProvider(O,$){return Xr.registerTreeDataProvider(O,$,be)},createTreeView(O,$){return Xr.createTreeView(O,$,be)},registerWebviewPanelSerializer:(O,$)=>ih.registerWebviewPanelSerializer(be,O,$),registerCustomEditorProvider:(O,$,se={})=>gg.registerCustomEditorProvider(be,O,$,se),registerFileDecorationProvider(O){return L.registerFileDecorationProvider(O,be)},registerUriHandler(O){return De.registerUriHandler(be,O)},createQuickPick(){return Tn.createQuickPick(be)},createInputBox(){return Tn.createInputBox(be)},get activeColorTheme(){return $s.activeColorTheme},onDidChangeActiveColorTheme(O,$,se){return xe($s.onDidChangeActiveColorTheme)(O,$,se)},registerWebviewViewProvider(O,$,se){return mc.registerWebviewViewProvider(be,O,$,se?.webviewOptions)},get activeNotebookEditor(){return lt.activeNotebookEditor},onDidChangeActiveNotebookEditor(O,$,se){return xe(lt.onDidChangeActiveNotebookEditor)(O,$,se)},get visibleNotebookEditors(){return lt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return xe(lt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(O,$,se){return xe(Ji.onDidChangeNotebookEditorSelection)(O,$,se)},onDidChangeNotebookEditorVisibleRanges(O,$,se){return xe(Ji.onDidChangeNotebookEditorVisibleRanges)(O,$,se)},showNotebookDocument(O,$){return lt.showNotebookDocument(O,$)},registerExternalUriOpener(O,$,se){return Ve(be,"externalUriOpener"),nh.registerExternalUriOpener(be.identifier,O,$,se)},registerProfileContentHandler(O,$){return Ve(be,"profileContentHandlers"),Dc.registerProfileContentHandler(be,O,$)},registerQuickDiffProvider(O,$,se,Ke){return Ve(be,"quickDiffProvider"),vd.registerQuickDiffProvider(gt(O),$,se,Ke)},get tabGroups(){return w.tabGroups},registerShareProvider(O,$){return Ve(be,"shareProvider"),Fn.registerShareProvider(gt(O),$)}},io={get rootPath(){return m.report("workspace.rootPath",be,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(O){throw new A1("rootPath")},getWorkspaceFolder(O){return o.getWorkspaceFolder(O)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(O){throw new A1("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(O){throw new A1("workspaceFile")},updateWorkspaceFolders:(O,$,...se)=>o.updateWorkspaceFolders(be,O,$||0,...se),onDidChangeWorkspaceFolders:function(O,$,se){return xe(o.onDidChangeWorkspace)(O,$,se)},asRelativePath:(O,$)=>o.getRelativePath(O,$),findFiles:(O,$,se,Ke)=>o.findFiles(O,$,se,be.identifier,Ke),findFiles2:(O,$,se)=>(Ve(be,"findFiles2"),o.findFiles2(O,$,be.identifier,se)),findFiles2New:(O,$,se)=>{Ve(be,"findFiles2New");const Ke={exclude:$?.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Rw.filesExclude||$?.useExcludeSettings===Rw.searchAndFilesExclude,useDefaultSearchExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Rw.searchAndFilesExclude,maxResults:$?.maxResults,useIgnoreFiles:$?.useIgnoreFiles?.local,useGlobalIgnoreFiles:$?.useIgnoreFiles?.global,useParentIgnoreFiles:$?.useIgnoreFiles?.parent,followSymlinks:$?.followSymlinks};return o.findFiles2(O&&O.length>0?O[0]:void 0,Ke,be.identifier,se)},findTextInFiles:(O,$,se,Ke)=>{Ve(be,"findTextInFiles");let Bi,Wi;return typeof $=="object"?(Bi=$,Wi=se):(Bi={},Wi=$,Ke=se),o.findTextInFiles(O,Bi||{},Wi,be.identifier,Ke)},findTextInFilesNew:(O,$,se)=>{Ve(be,"findTextInFilesNew"),Ve(be,"textSearchProviderNew");let Ke={};$&&(Ke={include:$.include&&$.include.length>0?$.include[0]:void 0,exclude:$.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:$.useExcludeSettings===void 0||$.useExcludeSettings===Rw.filesExclude||$.useExcludeSettings===Rw.searchAndFilesExclude,useSearchExclude:$.useExcludeSettings===void 0||$.useExcludeSettings===Rw.searchAndFilesExclude,maxResults:$.maxResults,useIgnoreFiles:$.useIgnoreFiles?.local,useGlobalIgnoreFiles:$.useIgnoreFiles?.global,useParentIgnoreFiles:$.useIgnoreFiles?.parent,followSymlinks:$.followSymlinks,encoding:$.encoding,previewOptions:$.previewOptions?{matchLines:$.previewOptions?.matchLines??100,charsPerLine:$.previewOptions?.charsPerLine??1e4}:void 0,beforeContext:$.surroundingContext,afterContext:$.surroundingContext});const Bi=Promise.resolve(void 0);return{results:new Qd(async ta=>{const Pl=async fg=>(ta.emitOne(r3t(fg)),fg);await Bi.then(fg=>o.findTextInFiles(O,Ke,Pl,be.identifier,se))}),complete:Bi.then(ta=>({limitHit:ta?.limitHit??!1}))}},save:O=>o.save(O),saveAs:O=>o.saveAs(O),saveAll:O=>o.saveAll(O),applyEdit(O,$){return Bo.applyWorkspaceEdit(O,be,$)},createFileSystemWatcher:(O,$,se,Ke)=>{let Bi;return typeof $=="boolean"?Bi={ignoreCreateEvents:!!$,ignoreChangeEvents:!!se,ignoreDeleteEvents:!!Ke,correlate:!1}:$&&(Ve(be,"createFileSystemWatcher"),Bi={...$,correlate:!0}),Oo.createFileSystemWatcher(o,be,O,Bi)},get textDocuments(){return Oe.getAllDocumentData().map(O=>O.document)},set textDocuments(O){throw new A1("textDocuments")},openTextDocument(O){let $;const se=O;if(typeof O=="string")$=Promise.resolve(N.file(O));else if(N.isUri(O))$=Promise.resolve(O);else if(!se||typeof se=="object")$=Oe.createDocumentData(se);else throw new Error("illegal argument - uriOrFileNameOrOptions");return $.then(Ke=>(Ke.scheme===pe.vscodeRemote&&!Ke.authority&&m.report("workspace.openTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority."),Oe.ensureDocumentData(Ke).then(Bi=>Bi.document)))},onDidOpenTextDocument:(O,$,se)=>xe(Oe.onDidAddDocument)(O,$,se),onDidCloseTextDocument:(O,$,se)=>xe(Oe.onDidRemoveDocument)(O,$,se),onDidChangeTextDocument:(O,$,se)=>xe(Oe.onDidChangeDocument)(O,$,se),onDidSaveTextDocument:(O,$,se)=>xe(Oe.onDidSaveDocument)(O,$,se),onWillSaveTextDocument:(O,$,se)=>xe(Ne.getOnWillSaveTextDocumentEvent(be))(O,$,se),get notebookDocuments(){return lt.notebookDocuments.map(O=>O.apiNotebook)},async openNotebookDocument(O,$){let se;if(N.isUri(O))se=O,await lt.openNotebookDocument(O);else if(typeof O=="string")se=N.revive(await lt.createNotebookDocument({viewType:O,content:$}));else throw new Error("Invalid arguments");return lt.getNotebookDocument(se).apiNotebook},onDidSaveNotebookDocument(O,$,se){return xe(xt.onDidSaveNotebookDocument)(O,$,se)},onDidChangeNotebookDocument(O,$,se){return xe(xt.onDidChangeNotebookDocument)(O,$,se)},onWillSaveNotebookDocument(O,$,se){return xe(zs.getOnWillSaveNotebookDocumentEvent(be))(O,$,se)},get onDidOpenNotebookDocument(){return xe(lt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return xe(lt.onDidCloseNotebookDocument)},registerNotebookSerializer(O,$,se,Ke){return lt.registerNotebookSerializer(be,O,$,se,dl(be,"notebookLiveShare")?Ke:void 0)},onDidChangeConfiguration:(O,$,se)=>xe(ee.onDidChangeConfiguration)(O,$,se),getConfiguration(O,$){return $=arguments.length===1?void 0:$,ee.getConfiguration(O,$,be)},registerTextDocumentContentProvider(O,$){return yt.registerTextDocumentContentProvider(O,$)},registerTaskProvider:(O,$)=>(m.report("window.registerTaskProvider",be,"Use the corresponding function on the 'tasks' namespace instead"),j.registerTaskProvider(be,O,$)),registerFileSystemProvider(O,$,se){return jr(ss.registerFileSystemProvider(be,O,$,se),i.addFileSystemProvider(O,$,se))},get fs(){return i.value},registerFileSearchProvider:(O,$)=>(Ve(be,"fileSearchProvider"),Y.registerFileSearchProvider(O,$)),registerTextSearchProvider:(O,$)=>(Ve(be,"textSearchProvider"),Y.registerTextSearchProvider(O,$)),registerAITextSearchProvider:(O,$)=>(Ve(be,"aiTextSearchProvider"),Ve(be,"textSearchProvider"),Y.registerAITextSearchProvider(O,$)),registerFileSearchProviderNew:(O,$)=>(Ve(be,"fileSearchProviderNew"),{dispose:()=>{}}),registerTextSearchProviderNew:(O,$)=>(Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerAITextSearchProviderNew:(O,$)=>(Ve(be,"aiTextSearchProviderNew"),Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerRemoteAuthorityResolver:(O,$)=>(Ve(be,"resolvers"),n.registerRemoteAuthorityResolver(O,$)),registerResourceLabelFormatter:O=>(Ve(be,"resolvers"),zc.$registerResourceLabelFormatter(O)),getRemoteExecServer:O=>(Ve(be,"resolvers"),n.getRemoteExecServer(O)),onDidCreateFiles:(O,$,se)=>xe(Oo.onDidCreateFile)(O,$,se),onDidDeleteFiles:(O,$,se)=>xe(Oo.onDidDeleteFile)(O,$,se),onDidRenameFiles:(O,$,se)=>xe(Oo.onDidRenameFile)(O,$,se),onWillCreateFiles:(O,$,se)=>xe(Oo.getOnWillCreateFileEvent(be))(O,$,se),onWillDeleteFiles:(O,$,se)=>xe(Oo.getOnWillDeleteFileEvent(be))(O,$,se),onWillRenameFiles:(O,$,se)=>xe(Oo.getOnWillRenameFileEvent(be))(O,$,se),openTunnel:O=>(Ve(be,"tunnels"),p.openTunnel(be,O).then($=>{if(!$)throw new Error("cannot open tunnel");return $})),get tunnels(){return Ve(be,"tunnels"),p.getTunnels()},onDidChangeTunnels:(O,$,se)=>(Ve(be,"tunnels"),xe(p.onDidChangeTunnels)(O,$,se)),registerPortAttributesProvider:(O,$)=>(Ve(be,"portsAttributes"),p.registerPortsAttributesProvider(O,$)),registerTunnelProvider:(O,$)=>(Ve(be,"tunnelFactory"),p.registerTunnelProvider(O,$)),registerTimelineProvider:(O,$)=>(Ve(be,"timeline"),tc.registerTimelineProvider(O,$,be.identifier,P.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:O=>(Ve(be,"workspaceTrust"),o.requestWorkspaceTrust(O)),onDidGrantWorkspaceTrust:(O,$,se)=>xe(o.onDidGrantWorkspaceTrust)(O,$,se),registerEditSessionIdentityProvider:(O,$)=>(Ve(be,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(O,$)),onWillCreateEditSessionIdentity:(O,$,se)=>(Ve(be,"editSessionIdentityProvider"),xe(o.getOnWillCreateEditSessionIdentityEvent(be))(O,$,se)),registerCanonicalUriProvider:(O,$)=>(Ve(be,"canonicalUriProvider"),o.registerCanonicalUriProvider(O,$)),getCanonicalUri:(O,$,se)=>(Ve(be,"canonicalUriProvider"),o.provideCanonicalUri(O,$,se))},un={get inputBox(){return m.report("scm.inputBox",be,"Use 'SourceControl.inputBox' instead"),Ba.getLastInputBox(be)},createSourceControl(O,$,se){return Ba.createSourceControl(be,O,$,se)}},Se={createCommentController(O,$){return th.createCommentController(be,O,$)}},rt={get activeDebugSession(){return G.activeDebugSession},get activeDebugConsole(){return G.activeDebugConsole},get breakpoints(){return G.breakpoints},get activeStackItem(){return G.activeStackItem},registerDebugVisualizationProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationProvider(be,O,$)},registerDebugVisualizationTreeProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationTree(be,O,$)},onDidStartDebugSession(O,$,se){return xe(G.onDidStartDebugSession)(O,$,se)},onDidTerminateDebugSession(O,$,se){return xe(G.onDidTerminateDebugSession)(O,$,se)},onDidChangeActiveDebugSession(O,$,se){return xe(G.onDidChangeActiveDebugSession)(O,$,se)},onDidReceiveDebugSessionCustomEvent(O,$,se){return xe(G.onDidReceiveDebugSessionCustomEvent)(O,$,se)},onDidChangeBreakpoints(O,$,se){return xe(G.onDidChangeBreakpoints)(O,$,se)},onDidChangeActiveStackItem(O,$,se){return xe(G.onDidChangeActiveStackItem)(O,$,se)},registerDebugConfigurationProvider(O,$,se){return G.registerDebugConfigurationProvider(O,$,se||A9.Initial)},registerDebugAdapterDescriptorFactory(O,$){return G.registerDebugAdapterDescriptorFactory(be,O,$)},registerDebugAdapterTrackerFactory(O,$){return G.registerDebugAdapterTrackerFactory(O,$)},startDebugging(O,$,se){return!se||typeof se=="object"&&"configuration"in se?G.startDebugging(O,$,{parentSession:se}):G.startDebugging(O,$,se||{})},stopDebugging(O){return G.stopDebugging(O)},addBreakpoints(O){return G.addBreakpoints(O)},removeBreakpoints(O){return G.removeBreakpoints(O)},asDebugSourceUri(O,$){return G.asDebugSourceUri(O,$)}},Ft={registerTaskProvider:(O,$)=>j.registerTaskProvider(be,O,$),fetchTasks:O=>j.fetchTasks(O),executeTask:O=>j.executeTask(be,O),get taskExecutions(){return j.taskExecutions},onDidStartTask:(O,$,se)=>xe(j.onDidStartTask)(O,$,se),onDidEndTask:(O,$,se)=>xe(j.onDidEndTask)(O,$,se),onDidStartTaskProcess:(O,$,se)=>xe(j.onDidStartTaskProcess)(O,$,se),onDidEndTaskProcess:(O,$,se)=>xe(j.onDidEndTaskProcess)(O,$,se)},Ci={createNotebookController(O,$,se,Ke,Bi){return Ii.createNotebookController(be,O,$,se,Ke,dl(be,"notebookMessaging")?Bi:void 0)},registerNotebookCellStatusBarItemProvider:(O,$)=>lt.registerNotebookCellStatusBarItemProvider(be,O,$),createRendererMessaging(O){return ns.createRendererMessaging(be,O)},createNotebookControllerDetectionTask(O){return Ve(be,"notebookKernelSource"),Ii.createNotebookControllerDetectionTask(be,O)},registerKernelSourceActionProvider(O,$){return Ve(be,"notebookKernelSource"),Ii.registerKernelSourceActionProvider(be,O,$)},onDidChangeNotebookCellExecutionState(O,$,se){return Ve(be,"notebookCellExecutionState"),xe(Ii.onDidChangeNotebookCellExecutionState)(O,$,se)}},Ot={t(...O){if(typeof O[0]=="string"){const $=O.shift(),se=!O||typeof O[0]!="object"?O:O[0];return ge.getMessage(be.identifier.value,{message:$,args:se})}return ge.getMessage(be.identifier.value,O[0])},get bundle(){return ge.getBundle(be.identifier.value)},get uri(){return ge.getBundleUri(be.identifier.value)}},K={_version:1,transferActiveChat(O){return Ve(be,"interactive"),pl.transferActiveChat(O)}},de={getRelatedInformation(O,$){return Ve(be,"aiRelatedInformation"),ml.getRelatedInformation(be,O,$)},registerRelatedInformationProvider(O,$){return Ve(be,"aiRelatedInformation"),ml.registerRelatedInformationProvider(be,O,$)},registerEmbeddingVectorProvider(O,$){return Ve(be,"aiRelatedInformation"),sh.registerEmbeddingVectorProvider(be,O,$)}},T={_version:1,registerChatResponseProvider(O,$,se){return Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)},registerChatVariableResolver(O,$,se,Ke,Bi,Wi,ta,Pl){return Ve(be,"chatVariableResolver"),ic.registerVariableResolver(be,O,$,se,Ke,Bi,Wi,ta,Pl?.id)},registerMappedEditsProvider(O,$){return Ve(be,"mappedEditsProvider"),Di.registerMappedEditsProvider(be,O,$)},createChatParticipant(O,$){return pl.createChatAgent(be,O,$)},createDynamicChatParticipant(O,$,se){return Ve(be,"chatParticipantPrivate"),pl.createDynamicChatAgent(be,O,$,se)}},ie={selectChatModels:O=>A.selectLanguageModels(be,O??{}),onDidChangeChatModels:(O,$,se)=>A.onDidChangeProviders(O,$,se),registerChatModelProvider:(O,$,se)=>(Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)),get embeddingModels(){return Ve(be,"embeddings"),Kc.embeddingsModels},onDidChangeEmbeddingModels:(O,$,se)=>(Ve(be,"embeddings"),Kc.onDidChange(O,$,se)),registerEmbeddingsProvider(O,$){return Ve(be,"embeddings"),Kc.registerEmbeddingsProvider(be,O,$)},async computeEmbeddings(O,$,se){return Ve(be,"embeddings"),Kc.computeEmbeddings(O,$,se)},registerTool(O,$){return Ve(be,"lmTools"),Or.registerTool(be,O,$)},invokeTool(O,$,se){return Ve(be,"lmTools"),Or.invokeTool(O,$,se)},get tools(){return Ve(be,"lmTools"),Or.tools}},ye={registerSpeechProvider(O,$){return Ve(be,"speech"),Gc.registerProvider(be.identifier,O,$)}};return{version:e.version,ai:de,authentication:zn,commands:Cs,comments:Se,chat:T,debug:rt,env:Wo,extensions:Ph,interactive:K,l10n:Ot,languages:le,lm:ie,notebooks:Ci,scm:un,speech:ye,tasks:Ft,tests:Ha,window:dr,workspace:io,Breakpoint:rN,TerminalOutputAnchor:Nee,ChatResultFeedbackKind:CH,ChatVariableLevel:ute,ChatCompletionItem:wnt,CallHierarchyIncomingCall:UNe,CallHierarchyItem:Pce,CallHierarchyOutgoingCall:VNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:YT,CodeAction:N9,CodeActionKind:Sa,CodeActionTriggerKind:nH,CodeLens:P9,Color:sN,ColorInformation:U9,ColorPresentation:V9,ColorThemeKind:mS,CommentMode:tte,CommentState:ite,CommentThreadCollapsibleState:fH,CommentThreadState:pH,CommentThreadApplicability:mH,CommentThreadFocus:_H,CompletionItem:B9,CompletionItemKind:Zi,CompletionItemTag:oH,CompletionList:tN,CompletionTriggerKind:VT,ConfigurationTarget:$T,CustomExecution:Fce,DebugAdapterExecutable:q9,DebugAdapterInlineImplementation:j9,DebugAdapterNamedPipeServer:Q9,DebugAdapterServer:hH,DebugConfigurationProviderTriggerKind:A9,DebugConsoleMode:e$,DebugVisualization:dnt,DecorationRangeBehavior:Hx,Diagnostic:I9,DiagnosticRelatedInformation:XW,DiagnosticSeverity:Bd,DiagnosticTag:Bx,Disposable:Qs,DocumentHighlight:R9,DocumentHighlightKind:ZW,MultiDocumentHighlight:M9,DocumentLink:H9,DocumentSymbol:iH,EndOfLine:D_,EnvironmentVariableMutatorType:HT,EvaluatableExpression:Y9,InlineValueText:J9,InlineValueVariableLookup:X9,InlineValueEvaluatableExpression:Z9,InlineCompletionTriggerKind:uH,EventEmitter:I,ExtensionKind:bD,ExtensionMode:QT,ExternalUriOpenerPriority:lte,FileChangeType:KT,FileDecoration:t$,FileDecoration2:t$,FileSystemError:Jc,FileType:sn,FilePermission:lp,FoldingRange:ete,FoldingRangeKind:Uw,FunctionBreakpoint:Vx,InlineCompletionItem:Uee,InlineCompletionList:Vee,Hover:T9,VerboseHover:L9,HoverVerbosityAction:Pee,IndentAction:yr,Location:yp,MarkdownString:df,OverviewRulerLane:kl,ParameterInformation:Fee,PortAutoForwardAction:dte,Position:bs,ProcessExecution:oN,ProgressLocation:_D,QuickInputButtonLocation:ste,QuickInputButtons:vH,Range:Jn,RelativePattern:GT,Selection:cC,SelectionRange:sH,SemanticTokens:aN,SemanticTokensBuilder:cnt,SemanticTokensEdit:GNe,SemanticTokensEdits:oz,SemanticTokensLegend:nte,ShellExecution:gI,ShellQuoting:Qee,SignatureHelp:Bee,SignatureHelpTriggerKind:Wee,SignatureInformation:Oee,SnippetString:uI,SourceBreakpoint:Ux,StandardTokenType:LS,StatusBarAlignment:TS,SymbolInformation:tH,SymbolKind:_r,SymbolTag:eH,Task:z9,TaskGroup:cH,TaskPanelKind:qee,TaskRevealKind:Kee,TaskScope:fI,TerminalLink:ent,TerminalQuickFixTerminalCommand:int,TerminalQuickFixOpener:tnt,TerminalLocation:Gee,TerminalProfile:nnt,TerminalExitReason:$ee,TerminalShellExecutionCommandLineConfidence:mD,TextDocumentSaveReason:zT,TextEdit:VA,SnippetTextEdit:Nce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:o_,TextEditorRevealType:W9,TextEditorSelectionChangeKind:iN,SyntaxTokenType:nN,TextDocumentChangeReason:aH,ThemeColor:dH,ThemeIcon:uu,TreeItem:$9,TreeItemCheckboxState:db,TreeItemCollapsibleState:vD,TypeHierarchyItem:Oce,UIKind:tv,Uri:N,ViewColumn:rH,WorkspaceEdit:hI,DocumentPasteTriggerKind:Jee,DocumentDropEdit:Yee,DocumentDropOrPasteEditKind:K9,DocumentPasteEdit:ont,InlayHint:O9,InlayHintLabelPart:F9,InlayHintKind:Hee,RemoteAuthorityResolverError:t1,ResolvedAuthority:Zit,ManagedResolvedAuthority:sz,SourceControlInputBoxValidationType:zee,ExtensionRuntime:r$,TimelineItem:ate,NotebookRange:Sy,NotebookCellKind:zx,NotebookCellExecutionState:cN,NotebookCellData:rG,NotebookData:KNe,NotebookRendererScript:QNe,NotebookCellStatusBarAlignment:n$,NotebookEditorRevealType:s$,NotebookCellOutput:i$,NotebookCellOutputItem:qNe,NotebookCellStatusBarItem:hnt,NotebookControllerAffinity:rte,NotebookControllerAffinity2:o$,NotebookEdit:k9,NotebookKernelSourceAction:unt,NotebookVariablesRequestKind:wH,PortAttributes:fnt,LinkedEditingRanges:gnt,TestResultState:cte,TestRunRequest:a$,TestMessage:lN,TestMessage2:lN,TestMessageStackFrame:pnt,TestTag:yH,TestRunProfileKind:jT,TextSearchCompleteMessageType:wee,DataTransfer:lH,DataTransferItem:G9,TestCoverageCount:rz,FileCoverage:dN,FileCoverage2:dN,StatementCoverage:_nt,BranchCoverage:vnt,DeclarationCoverage:bnt,WorkspaceTrustState:ZAe,LanguageStatusSeverity:UT,QuickPickItemKind:bH,InputBoxValidationSeverity:qT,TabInputText:Bce,TabInputTextDiff:c$,TabInputTextMerge:jNe,TabInputCustom:Wce,TabInputNotebook:Hce,TabInputNotebookDiff:Uce,TabInputWebview:YNe,TabInputTerminal:JNe,TabInputInteractiveWindow:XNe,TabInputChat:ZNe,TabInputTextMultiDiff:ePe,TelemetryTrustedValue:Wae,LogLevel:Gn,EditSessionIdentityMatch:vte,InteractiveSessionVoteDirection:eEe,ChatCopyKind:hte,InteractiveEditorResponseFeedbackKind:tEe,DebugStackFrame:zNe,DebugThread:$Ne,RelatedInformationType:fte,SpeechToTextStatus:pte,TextToSpeechStatus:mte,PartialAcceptTriggerKind:Wx,KeywordRecognitionStatus:_te,ChatResponseMarkdownPart:aG,ChatResponseFileTreePart:cG,ChatResponseAnchorPart:lG,ChatResponseProgressPart:EH,ChatResponseProgressPart2:tPe,ChatResponseReferencePart:kb,ChatResponseReferencePart2:kb,ChatResponseCodeCitationPart:d$,ChatResponseWarningPart:xH,ChatResponseTextEditPart:DH,ChatResponseMarkdownWithVulnerabilitiesPart:SH,ChatResponseCommandButtonPart:dG,ChatResponseDetectedParticipantPart:AH,ChatResponseConfirmationPart:l$,ChatResponseReferencePartStatusKind:gte,ChatRequestTurn:iPe,ChatResponseTurn:nPe,ChatLocation:r_,ChatRequestEditorData:sPe,ChatRequestNotebookData:oPe,LanguageModelChatMessageRole:Kp,LanguageModelChatMessage:rPe,LanguageModelChatMessageFunctionResultPart:h$,LanguageModelChatResponseTextPart:kH,LanguageModelChatResponseFunctionUsePart:Vce,LanguageModelError:Mw,NewSymbolName:ant,NewSymbolNameTag:Zee,NewSymbolNameTriggerKind:gH,InlineEdit:ynt,InlineEditTriggerKind:IH,ExcludeSettingOptions:Rw,TextSearchContextNew:WNe,TextSearchMatchNew:BNe,TextSearchCompleteMessageTypeNew:yee}}}var pj;let n0e=class{constructor(e,t,i,n,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=n,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),cs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();cs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new Oii(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(s0e)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(o0e,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};n0e=D([_(2,we),_(3,rE),_(4,MI),_(5,_u),_(6,Ge)],n0e);var hM;let s0e=(hM=class{constructor(e){if(e.environment.appRoot&&pj.aliased.size){const t=Rh(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",n=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${n})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,n,o]=t,r=pj.aliased.get(n);if(r!==void 0)return console.warn(`${n} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},pj=hM,hM.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),hM);s0e=pj=D([_(0,_u)],s0e);class Oii{constructor(e,t,i,n,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=n,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new va}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let n=this._extApiImpl.get(i.identifier);return n||(n=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,n)),n}if(!this._defaultApiImpl){let n="";this._extensionPaths.forEach((o,r)=>n+=` ${r} -> ${o.identifier.value} `),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: -${s}`),this._defaultApiImpl=this._apiFactory(Tet,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let oRe=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(Ue.MainThreadTelemetry);const s=i.getProxy(Ue.MainThreadWindow);this._impl=(o,r)=>{const a=P.parse(o);return r?this.callOriginal(o,r):a.scheme==="http"||a.scheme==="https"?s.$openUri(a,o,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?s.$openUri(a,o,{}):this.callOriginal(o,r)}}load(e,t,i){const s=this._extensionPaths.findSubstr(t);return s&&(this._extensionId=s.identifier.value,this.sendShimmingTelemetry()),this._original=i(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};oRe=D([_(2,gr)],oRe);let rRe=class{constructor(e,t){this._mainThreadConsole=e.getProxy(Ue.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){const i=this,s=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,s,arguments)}})}_handleConsoleCall(e,t,i,s){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:Mni(s,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,s)}};rRe=D([_(0,gr),_(1,Sg)],rRe);const Rni=1e5;function Mni(n,e){const t=[];if(n.length)for(let i=0;i"u")s="undefined";else if(s instanceof Error){const o=s;o.stack?s=o.stack:s=o.toString()}t.push(s)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` +${n}`),this._defaultApiImpl=this._apiFactory(mXe,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let o0e=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(Be.MainThreadTelemetry);const n=i.getProxy(Be.MainThreadWindow);this._impl=(o,r)=>{const a=N.parse(o);return r?this.callOriginal(o,r):a.scheme==="http"||a.scheme==="https"?n.$openUri(a,o,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?n.$openUri(a,o,{}):this.callOriginal(o,r)}}load(e,t,i){const n=this._extensionPaths.findSubstr(t);return n&&(this._extensionId=n.identifier.value,this.sendShimmingTelemetry()),this._original=i(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};o0e=D([_(2,Jo)],o0e);let r0e=class{constructor(e,t){this._mainThreadConsole=e.getProxy(Be.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){const i=this,n=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,n,arguments)}})}_handleConsoleCall(e,t,i,n){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:Wii(n,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,n)}};r0e=D([_(0,Jo),_(1,_u)],r0e);const Bii=1e5;function Wii(s,e){const t=[];if(s.length)for(let i=0;i"u")n="undefined";else if(n instanceof Error){const o=n;o.stack?n=o.stack:n=o.toString()}t.push(n)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` `).slice(3).join(` -`)})}try{const i=Vct(t);return i.length>Rni?"Output omitted for a large object that exceeds the limits":i}catch(i){return`Output omitted for an object that cannot be inspected ('${i.toString()}')`}}let aRe=class extends rRe{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};aRe=D([_(0,gr),_(1,Sg)],aRe);class Nni extends nRe{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const s=i(e);if(s){e=s;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class Pni extends mTe{constructor(){super(...arguments),this.extensionRuntime=dG.Webworker}async _beforeAlmostReadyToRunExtensions(){_9&&this._instaService.createInstance(aRe),this._apiFactory=this._instaService.invokeFunction(Lni),this._fakeModules=this._instaService.createInstance(Nni,this._apiFactory,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark("code/extHost/didInitAPI"),await this._waitForDebuggerAttachment()}_getEntryPoint(e){return e.browser}async _loadCommonJSModule(e,t,i){t=t.with({path:Fni(t.path,".js")});const s=e?.identifier.value;s&&performance.mark(`code/extHost/willFetchExtensionCode/${s}`);const o=P.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),r=await fetch(o.toString(!0));if(s&&performance.mark(`code/extHost/didFetchExtensionCode/${s}`),r.status!==200)throw new Error(r.statusText);const a=await r.text(),c=`${t.toString(!0)}#vscode-extension`,l=`${a} -//# sourceURL=${c}`;let d;try{d=new Function("module","exports","require",l)}catch(p){throw console.error(s?`Loading code for extension ${s} failed: ${p.message}`:`Loading code failed: ${p.message}`),console.error(`${t.toString(!0)}${typeof p.line=="number"?` line ${p.line}`:""}${typeof p.column=="number"?` column ${p.column}`:""}`),console.error(p),p}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);const h={},u={exports:h},f=p=>{const m=this._fakeModules.getModule(p,t);if(m===void 0)throw new Error(`Cannot load module '${p}'`);return m};try{return i.codeLoadingStart(),s&&performance.mark(`code/extHost/willLoadExtensionCode/${s}`),d(u,h,f),u.exports!==h?u.exports:h}finally{s&&performance.mark(`code/extHost/didLoadExtensionCode/${s}`),i.codeLoadingStop()}}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;const t=Date.now()+e;for(;Date.now()o.getApi(r)),e}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i!=null&&this._productService.commit!=null&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:SPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===1?void 0:{configuration:t.configuration??void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:e.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===1,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};cRe=D([_(3,rn),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,Xa),_(10,V_)],cRe);async function Hni(n){return(await zat.p)(n)}sJt(cRe);F4t(async n=>{n.get(ho),Wot(await Hni())});function Uni(n,e,t){return Promise.resolve(void 0)}function Vni(){return new Promise((n,e)=>{try{NJt({...Hei(Pv.file("/tmp")),...Kei(Uni),...rti(),...hti()}).then(()=>{n()})}catch(t){e(t)}})}const zni=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; +`)})}try{const i=Kge(t);return i.length>Bii?"Output omitted for a large object that exceeds the limits":i}catch(i){return`Output omitted for an object that cannot be inspected ('${i.toString()}')`}}let a0e=class extends r0e{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};a0e=D([_(0,Jo),_(1,_u)],a0e);class Hii extends n0e{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const n=i(e);if(n){e=n;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class Uii extends _Ie{constructor(){super(...arguments),this.extensionRuntime=r$.Webworker}async _beforeAlmostReadyToRunExtensions(){c8&&this._instaService.createInstance(a0e),this._apiFactory=this._instaService.invokeFunction(Fii),this._fakeModules=this._instaService.createInstance(Hii,this._apiFactory,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark("code/extHost/didInitAPI"),await this._waitForDebuggerAttachment()}_getEntryPoint(e){return e.browser}async _loadCommonJSModule(e,t,i){t=t.with({path:Vii(t.path,".js")});const n=e?.identifier.value;n&&performance.mark(`code/extHost/willFetchExtensionCode/${n}`);const o=N.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),r=await fetch(o.toString(!0));if(n&&performance.mark(`code/extHost/didFetchExtensionCode/${n}`),r.status!==200)throw new Error(r.statusText);const a=await r.text(),c=`${t.toString(!0)}#vscode-extension`,l=`${a} +//# sourceURL=${c}`;let d;try{d=new Function("module","exports","require",l)}catch(p){throw console.error(n?`Loading code for extension ${n} failed: ${p.message}`:`Loading code failed: ${p.message}`),console.error(`${t.toString(!0)}${typeof p.line=="number"?` line ${p.line}`:""}${typeof p.column=="number"?` column ${p.column}`:""}`),console.error(p),p}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);const h={},u={exports:h},f=p=>{const m=this._fakeModules.getModule(p,t);if(m===void 0)throw new Error(`Cannot load module '${p}'`);return m};try{return i.codeLoadingStart(),n&&performance.mark(`code/extHost/willLoadExtensionCode/${n}`),d(u,h,f),u.exports!==h?u.exports:h}finally{n&&performance.mark(`code/extHost/didLoadExtensionCode/${n}`),i.codeLoadingStop()}}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;const t=Date.now()+e;for(;Date.now()o.getApi(r)),e}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let n;return i!=null&&this._productService.commit!=null&&!xk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,xk.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:ql,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:VRe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===1?void 0:{configuration:t.configuration??void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:e.extensions.toSnapshot(),nlsBaseUrl:n,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===1,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Wn?tv.Web:tv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};c0e=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,uf),_(8,hv),_(9,Er),_(10,Em)],c0e);async function Kii(s){return(await vot.p)(s)}tYt(c0e);_4t(async s=>{s.get(fs),Cnt(await Kii())});let bot=null;const l0e=new wit(!1);function qii(){return new Promise((s,e)=>{try{M8t("slintpad",l0e),LYt({...TZt(),...BZt((t,i,n)=>Promise.resolve(bot.open_model_ref(t))),...dei(),...pei(),...mei(),...yei()},void 0,{workspaceProvider:{trusted:!0,workspace:{folderUri:Yv.parse("slintpad:///")},open:t=>Promise.resolve(!1)}}).then(()=>{Gx.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),Gx.setLanguageConfiguration("slint",{comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],autoCloseBefore:";:.,=}])>` \n ",surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"`",close:"`"},{open:"/**",close:" */"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}},wordPattern:new RegExp("(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"),indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}}),Gx.onLanguage("slint",()=>{Gx.setMonarchTokensProvider("slint",SXt)}),s()})}catch(t){e(t)}})}const Qii=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; export component Demo { VerticalBox { alignment: start; @@ -1003,45 +1052,49 @@ export component Demo { HorizontalLayout { alignment: center; Button { text: "OK!"; } } } } -`;function GX(n,e){return console.assert(e.startsWith("/")),Pv.from({scheme:"user",authority:n+".slint.rs",path:e})}function aj(n,e){return e.scheme==="user"&&e.authority===n+".slint.rs"}function rBe(n,e){return console.assert(aj(n,e)),e.path}var Mq,lU;class $ni{constructor(e,t){kt(this,Mq);kt(this,lU);st(this,lU,e),st(this,Mq,t),console.assert(Object.keys(t).length>0),Object.keys(t).forEach(i=>console.assert(i.startsWith("/")))}from_internal(e){if(!aj(se(this,lU),e))return e;const t=rBe(se(this,lU),e),i=se(this,Mq)[t]||null;return i?Pv.parse(i)??Pv.parse("file:///broken_url"):e}}Mq=new WeakMap,lU=new WeakMap;var dU,hU;class Gni{constructor(e,t){kt(this,dU);kt(this,hU);st(this,hU,e),st(this,dU,t)}from_internal(e){return aj(se(this,hU),e)?Pv.from({scheme:se(this,dU).scheme,authority:se(this,dU).authority,path:rBe(se(this,hU),e)}):e}}dU=new WeakMap,hU=new WeakMap;async function Pre(n,e,t){const i=t??GX(n,"/main.slint");console.assert(aj(n,i));const s=pd.getModel(i);return s!==null?Promise.resolve(s):pd.createModel(e,"slint",i)}self.MonacoEnvironment={getWorker(n,e){return new Worker(new URL(""+new URL("monaco_worker-DczdSAeE.js",import.meta.url).href,import.meta.url),{type:"module"})}};function qni(n){try{const e=n.path;return e.substring(e.lastIndexOf("/")+1)}catch{return n.toString()}}var ZR,XA,gd,uU,ZA,Ok,uy,pv,eM,Nq,Pq,Fq,Oq;const TBe=class TBe extends ot{constructor(t){const i=TBe.createNode();super({node:i});kt(this,ZR);kt(this,XA);kt(this,gd);kt(this,uU);kt(this,ZA);kt(this,Ok);kt(this,uy);kt(this,pv);kt(this,eM);kt(this,Nq);kt(this,Pq);kt(this,Fq);kt(this,Oq);this.auto_compile=!0,st(this,ZR,null),st(this,gd,null),st(this,uU,null),st(this,ZA,null),st(this,uy,[]),st(this,pv,self.crypto.randomUUID()),st(this,eM,{}),this.onPositionChangeCallback=s=>{},st(this,XA,new Map),this.setFlag(ot.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint Code Editor",st(this,Ok,0),st(this,uU,this.setup_editor(this.contentNode,t)),t.file_reader=s=>this.handle_lsp_url_request(se(this,Ok),s),pd.onDidCreateModel(s=>this.add_model_listener(s)),t.show_document_callback=(s,o)=>(this.goto_position(s,o),!0)}static createNode(){const t=document.createElement("div"),i=document.createElement("div");return t.appendChild(i),t}async map_url(t){const i=new URL(t),s=Pv.parse(i.toString()),o=se(this,ZA)?.from_internal(s)??s,r=o.toString();if(aj(se(this,pv),o)){const a=rBe(se(this,pv),o);se(this,eM)[a]=r}return r}get editor(){if(se(this,gd)!==null)return se(this,gd)}dispose(){se(this,uy).forEach(t=>t.dispose()),st(this,uy,[]),se(this,gd)?.dispose(),st(this,gd,null),this.dispose()}get internal_uuid(){return se(this,pv)}get internal_url_prefix(){return GX(se(this,pv),"/").toString()}get contentNode(){return this.node.getElementsByTagName("div")[0]}get current_editor_content(){return se(this,gd)?.getModel()?.getValue()||""}get language_client(){return se(this,uU)}get current_text_document_uri(){return se(this,gd)?.getModel()?.uri.toString()}get current_text_document_version(){return se(this,gd)?.getModel()?.getVersionId()}goto_position(t,i){const s=Pv.parse(t);if(!pd.getModel(s)||!this.set_model(s))return;const o=se(this,gd)?.getModel();let r,a;"start"in i?(r=i.start,a=i.end):(r=i,a=i);const c=TZt(o,{start:r,end:a});c!=null&&(se(this,gd)?.setSelection(c),se(this,gd)?.revealLine(c.startLineNumber))}get open_document_urls(){const t=se(this,ZR)?.toString(),i=[];return t!=null&&i.push(t),pd.getModels().forEach(s=>{const o=s?.uri.toString();o!=null&&o!==t&&i.push(o)}),i}document_contents(t){const i=Pv.parse(t);return pd.getModel(i)?.getValue()}get extra_files(){return se(this,eM)}clear_models(){var t;st(this,Ok,se(this,Ok)+1),st(this,ZA,null),se(this,XA).clear(),st(this,eM,{}),pd.getModels().forEach(i=>i.dispose()),(t=se(this,Oq))==null||t.call(this)}resize_editor(){if(se(this,gd)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;se(this,gd).layout({width:t,height:i})}}get position(){const t=se(this,gd)?.getModel(),i=t?.getVersionId()??-1,s=t?.uri.toString()??"",o=LZt(t,se(this,gd)?.getPosition())??{line:0,character:0};return{uri:s,position:o,version:i}}add_model_listener(t){var s;const i=t.uri;se(this,XA).set(i,null),(s=se(this,Pq))==null||s.call(this,i),pd.getModels().length===1&&(st(this,ZR,i),this.set_model(i),this.language_client?.sendRequest("workspace/executeCommand",{command:"slint/showPreview",arguments:[se(this,ZR)?.toString()??"",""]}))}remove_model(t){var s;se(this,XA).delete(t);const i=pd.getModel(t);i!=null&&(i.dispose(),(s=se(this,Nq))==null||s.call(this,t))}set_model(t){return se(this,gd)?.setModel(pd.getModel(t)),se(this,gd)?.focus(),!0}onResize(t){this.isAttached&&this.resize_editor()}setup_editor(t,i){t.classList.add("edit-area"),QM.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),QM.onLanguage("slint",()=>{QM.setMonarchTokensProvider("slint",EZt)});const s=Wrt(t,{language:"slint",glyphMargin:!0,lightbulb:{enabled:pd.ShowLightbulbIconMode.On}});pd.registerEditorOpener({openCodeEditor:(r,a,c)=>{if(s.setModel(pd.getModel(a)),qrt.isIPosition(c)){const l=c;s.setSelection({startLineNumber:l.lineNumber,startColumn:l.column,endLineNumber:l.lineNumber,endColumn:l.column}),s.revealPosition(l)}else{const l=c;s.setSelection(l),s.revealRange(l)}return!0}});const o=s.setModel;return s.setModel=r=>{const a=s.getModel();a!=null&&se(this,XA).set(a.uri,s.saveViewState());const c=se(this,XA).get(r?.uri);o.apply(s,[r]),c!=null&&s.restoreViewState(c)},st(this,gd,s),se(this,uy).push(s),se(this,uy).push(s.onDidChangeCursorPosition(r=>this.onPositionChangeCallback(this.position))),se(this,uy).push(s.onDidChangeModel(r=>{var a;this.onPositionChangeCallback(this.position),(a=se(this,Fq))==null||a.call(this,r.newModelUrl)})),se(this,uy).push(s.onDidChangeModelContent(r=>this.onPositionChangeCallback(this.position))),i.language_client}set onModelsCleared(t){st(this,Oq,t)}set onModelAdded(t){st(this,Pq,t)}set onModelRemoved(t){st(this,Nq,t)}set onModelSelected(t){st(this,Fq,t)}async handle_lsp_url_request(t,i){if(se(this,ZA)===null)return Promise.resolve("Error: Can not resolve URL.");const s=Pv.parse(i),o=se(this,ZA).from_internal(s);return o===null?Promise.resolve("Error: Can not map URL."):(await this.safely_open_editor_with_url_content(t,o,s,!1))[1]}async safely_open_editor_with_url_content(t,i,s,o){let r=pd.getModel(s);if(r!=null)return[r.uri,r.getValue()];let a="";try{const l=await fetch(i.toString());if(!l.ok)return o&&alert("Failed to download data from "+i+`: -`+l.status+" "+l.statusText),[null,""];a=await l.text()}catch{return o&&alert("Failed to download data from "+i+"."),[null,""]}if(r=pd.getModel(s),r!=null)return[r.uri,r.getValue()];let c=null;return t===se(this,Ok)&&(r=await Pre(this.internal_uuid,a,s),r&&(c=r.uri)),[c,a]}async open_tab_from_url(t){const[i,s,o]=await HZt(se(this,pv),t.toString()),r=Pv.parse(i??t.toString());return st(this,ZA,o??new Gni(se(this,pv),r)),this.safely_open_editor_with_url_content(se(this,Ok),r,GX(se(this,pv),s??r.path),!0)}add_empty_file(t){let i=t;i.startsWith("/")||(i="/"+i);const s=GX(se(this,pv),i);return pd.getModel(s)?!1:(Pre(this.internal_uuid,"",s),!0)}};ZR=new WeakMap,XA=new WeakMap,gd=new WeakMap,uU=new WeakMap,ZA=new WeakMap,Ok=new WeakMap,uy=new WeakMap,pv=new WeakMap,eM=new WeakMap,Nq=new WeakMap,Pq=new WeakMap,Fq=new WeakMap,Oq=new WeakMap;let lRe=TBe;var gb,xa,gy;const RBe=class RBe extends ot{constructor(t){super({node:RBe.createNode()});kt(this,gb);kt(this,xa);kt(this,gy);this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",st(this,gy,new Map);const i=new Yv({spacing:0});st(this,gb,new ZF({name:"Open Documents Tab Bar"})),i.addWidget(se(this,gb)),st(this,xa,new lRe(t)),i.addWidget(se(this,xa)),super.layout=i,se(this,xa).onModelsCleared=()=>{se(this,gb).clearTabs(),se(this,gy).clear()},se(this,xa).onModelAdded=c=>{const l=se(this,gb).addTab({owner:this,label:qni(c)});se(this,gy).set(c,l)},se(this,xa).onModelRemoved=c=>{const l=se(this,gy).get(c);l!=null&&(se(this,gb).removeTab(l),se(this,gy).delete(c))},se(this,xa).onModelSelected=c=>{let l=null;c!==null&&(l=se(this,gy).get(c)??null),se(this,gb).currentTitle!==l&&(se(this,gb).currentTitle=l)},se(this,gb).currentChanged.connect((c,l)=>{const d=l.currentTitle;for(const[h,u]of se(this,gy).entries())u===d&&se(this,xa).set_model(h)});const s=new URLSearchParams(window.location.search),o=s.get("snippet"),r=s.get("load_url"),a=s.get("load_demo");o?(se(this,xa).clear_models(),Pre(se(this,xa).internal_uuid,o)):r?this.project_from_url(r):this.set_demo(a??"")}static createNode(){const t=document.createElement("div"),i=document.createElement("ul");return t.appendChild(i),t}async map_url(t){return se(this,xa).map_url(t)}get current_editor_content(){return se(this,xa).current_editor_content}get language_client(){return se(this,xa).language_client}get current_text_document_uri(){return se(this,xa).current_text_document_uri}get current_text_document_version(){return se(this,xa).current_text_document_version}async project_from_url(t){if(t==null)return null;se(this,xa).clear_models();const i=Pv.parse(t);return(await se(this,xa).open_tab_from_url(i))[0]}known_demos(){return[["","Hello World!"],["examples/gallery/gallery.slint","Gallery"],["examples/printerdemo/ui/printerdemo.slint","Printer Demo"],["examples/energy-monitor/ui/desktop_window.slint","Energy Monitor"],["examples/todo/ui/todo.slint","Todo Demo"],["examples/iot-dashboard/main.slint","IOT Dashboard"]]}goto_position(t,i){se(this,xa).goto_position(t,i)}add_empty_file_to_project(t){se(this,xa).add_empty_file(t)}async set_demo(t){if(t){const i="XXXX_DEFAULT_TAG_XXXX";let s=i.startsWith("XXXX_DEFAULT_TAG_")?"master":i;{let o;(o=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(s="v"+o[1])}await this.project_from_url(`https://raw.githubusercontent.com/slint-ui/slint/${s}/${t}`)}else se(this,xa).clear_models(),await Pre(se(this,xa).internal_uuid,zni)}set onPositionChange(t){se(this,xa).onPositionChangeCallback=t}get position(){return se(this,xa).position}get open_document_urls(){return se(this,xa).open_document_urls}get extra_files(){return se(this,xa).extra_files}document_contents(t){return se(this,xa).document_contents(t)}get internal_url_prefix(){return se(this,xa).internal_url_prefix}};gb=new WeakMap,xa=new WeakMap,gy=new WeakMap;let dRe=RBe;var eE,Bq;class Qni{constructor(e,t){kt(this,eE);kt(this,Bq);st(this,eE,e),st(this,Bq,t),this.onError=se(this,eE).onError,this.onClose=se(this,eE).onClose,this.onPartialMessage=se(this,eE).onPartialMessage}dispose(){se(this,eE).dispose()}listen(e){return se(this,eE).listen(t=>{se(this,Bq).call(this,t)||e(t)})}}eE=new WeakMap,Bq=new WeakMap;var sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function FEi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $at(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var hRe={},uRe={},Ts={},NO={},aBe={},Fre={},hn={},jd={};Object.defineProperty(jd,"__esModule",{value:!0});jd.stringArray=jd.array=jd.func=jd.error=jd.number=jd.string=jd.boolean=void 0;function jni(n){return n===!0||n===!1}jd.boolean=jni;function Gat(n){return typeof n=="string"||n instanceof String}jd.string=Gat;function Kni(n){return typeof n=="number"||n instanceof Number}jd.number=Kni;function Yni(n){return n instanceof Error}jd.error=Yni;function Jni(n){return typeof n=="function"}jd.func=Jni;function qat(n){return Array.isArray(n)}jd.array=qat;function Xni(n){return qat(n)&&n.every(e=>Gat(e))}jd.stringArray=Xni;Object.defineProperty(hn,"__esModule",{value:!0});hn.Message=hn.NotificationType9=hn.NotificationType8=hn.NotificationType7=hn.NotificationType6=hn.NotificationType5=hn.NotificationType4=hn.NotificationType3=hn.NotificationType2=hn.NotificationType1=hn.NotificationType0=hn.NotificationType=hn.RequestType9=hn.RequestType8=hn.RequestType7=hn.RequestType6=hn.RequestType5=hn.RequestType4=hn.RequestType3=hn.RequestType2=hn.RequestType1=hn.RequestType=hn.RequestType0=hn.AbstractMessageSignature=hn.ParameterStructures=hn.ResponseError=hn.ErrorCodes=void 0;const uT=jd;var gRe;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(gRe||(hn.ErrorCodes=gRe={}));class cBe extends Error{constructor(e,t,i){super(t),this.code=uT.number(e)?e:gRe.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,cBe.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}hn.ResponseError=cBe;class df{constructor(e){this.kind=e}static is(e){return e===df.auto||e===df.byName||e===df.byPosition}toString(){return this.kind}}hn.ParameterStructures=df;df.auto=new df("auto");df.byPosition=new df("byPosition");df.byName=new df("byName");class Ll{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return df.auto}}hn.AbstractMessageSignature=Ll;class Zni extends Ll{constructor(e){super(e,0)}}hn.RequestType0=Zni;class esi extends Ll{constructor(e,t=df.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}hn.RequestType=esi;class tsi extends Ll{constructor(e,t=df.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}hn.RequestType1=tsi;class isi extends Ll{constructor(e){super(e,2)}}hn.RequestType2=isi;class nsi extends Ll{constructor(e){super(e,3)}}hn.RequestType3=nsi;class ssi extends Ll{constructor(e){super(e,4)}}hn.RequestType4=ssi;class osi extends Ll{constructor(e){super(e,5)}}hn.RequestType5=osi;class rsi extends Ll{constructor(e){super(e,6)}}hn.RequestType6=rsi;class asi extends Ll{constructor(e){super(e,7)}}hn.RequestType7=asi;class csi extends Ll{constructor(e){super(e,8)}}hn.RequestType8=csi;class lsi extends Ll{constructor(e){super(e,9)}}hn.RequestType9=lsi;class dsi extends Ll{constructor(e,t=df.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}hn.NotificationType=dsi;class hsi extends Ll{constructor(e){super(e,0)}}hn.NotificationType0=hsi;class usi extends Ll{constructor(e,t=df.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}hn.NotificationType1=usi;class gsi extends Ll{constructor(e){super(e,2)}}hn.NotificationType2=gsi;class fsi extends Ll{constructor(e){super(e,3)}}hn.NotificationType3=fsi;class psi extends Ll{constructor(e){super(e,4)}}hn.NotificationType4=psi;class msi extends Ll{constructor(e){super(e,5)}}hn.NotificationType5=msi;class _si extends Ll{constructor(e){super(e,6)}}hn.NotificationType6=_si;class vsi extends Ll{constructor(e){super(e,7)}}hn.NotificationType7=vsi;class wsi extends Ll{constructor(e){super(e,8)}}hn.NotificationType8=wsi;class bsi extends Ll{constructor(e){super(e,9)}}hn.NotificationType9=bsi;var M6e;(function(n){function e(s){const o=s;return o&&uT.string(o.method)&&(uT.string(o.id)||uT.number(o.id))}n.isRequest=e;function t(s){const o=s;return o&&uT.string(o.method)&&s.id===void 0}n.isNotification=t;function i(s){const o=s;return o&&(o.result!==void 0||!!o.error)&&(uT.string(o.id)||uT.number(o.id)||o.id===null)}n.isResponse=i})(M6e||(hn.Message=M6e={}));var kx={},N6e;Object.defineProperty(kx,"__esModule",{value:!0});kx.LRUCache=kx.LinkedMap=kx.Touch=void 0;var Pg;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(Pg||(kx.Touch=Pg={}));class Qat{constructor(){this[N6e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=Pg.None){const i=this._map.get(e);if(i)return t!==Pg.None&&this.touch(i,t),i.value}set(e,t,i=Pg.None){let s=this._map.get(e);if(s)s.value=t,i!==Pg.None&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case Pg.None:this.addItemLast(s);break;case Pg.First:this.addItemFirst(s);break;case Pg.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return i}values(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return i}entries(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return i}[(N6e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==Pg.First&&t!==Pg.Last)){if(t===Pg.First){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Pg.Last){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}kx.LinkedMap=Qat;class Csi extends Qat{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Pg.AsNew){return super.get(e,t)}peek(e){return super.get(e,Pg.None)}set(e,t){return super.set(e,t,Pg.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}kx.LRUCache=Csi;var bue={};Object.defineProperty(bue,"__esModule",{value:!0});bue.Disposable=void 0;var P6e;(function(n){function e(t){return{dispose:t}}n.create=e})(P6e||(bue.Disposable=P6e={}));var tA={},uD={};Object.defineProperty(uD,"__esModule",{value:!0});let fRe;function pRe(){if(fRe===void 0)throw new Error("No runtime abstraction layer installed");return fRe}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");fRe=t}n.install=e})(pRe||(pRe={}));uD.default=pRe;Object.defineProperty(tA,"__esModule",{value:!0});tA.Emitter=tA.Event=void 0;const ysi=uD;var F6e;(function(n){const e={dispose(){}};n.None=function(){return e}})(F6e||(tA.Event=F6e={}));class Ssi{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let s=0,o=this._callbacks.length;s{this._callbacks||(this._callbacks=new Ssi),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=Cue._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}tA.Emitter=Cue;Cue._noop=function(){};var X1={};Object.defineProperty(X1,"__esModule",{value:!0});X1.CancellationTokenSource=X1.CancellationToken=void 0;const Asi=uD,Esi=jd,mRe=tA;var Ore;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:mRe.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:mRe.Event.None});function e(t){const i=t;return i&&(i===n.None||i===n.Cancelled||Esi.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Ore||(X1.CancellationToken=Ore={}));const xsi=Object.freeze(function(n,e){const t=(0,Asi.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}});class O6e{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?xsi:(this._emitter||(this._emitter=new mRe.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Dsi{get token(){return this._token||(this._token=new O6e),this._token}cancel(){this._token?this._token.cancel():this._token=Ore.Cancelled}dispose(){this._token?this._token instanceof O6e&&this._token.dispose():this._token=Ore.None}}X1.CancellationTokenSource=Dsi;var Q4={};Object.defineProperty(Q4,"__esModule",{value:!0});Q4.SharedArrayReceiverStrategy=Q4.SharedArraySenderStrategy=void 0;const ksi=X1;var pq;(function(n){n.Continue=0,n.Cancelled=1})(pq||(pq={}));class Isi{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=pq.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){const i=this.buffers.get(t);if(i===void 0)return;const s=new Int32Array(i,0,1);Atomics.store(s,0,pq.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}Q4.SharedArraySenderStrategy=Isi;class Lsi{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===pq.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Tsi{constructor(e){this.token=new Lsi(e)}cancel(){}dispose(){}}class Rsi{constructor(){this.kind="request"}createCancellationTokenSource(e){const t=e.$cancellationData;return t===void 0?new ksi.CancellationTokenSource:new Tsi(t)}}Q4.SharedArrayReceiverStrategy=Rsi;var YI={},cj={};Object.defineProperty(cj,"__esModule",{value:!0});cj.Semaphore=void 0;const Msi=uD;let Nsi=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Msi.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};cj.Semaphore=Nsi;Object.defineProperty(YI,"__esModule",{value:!0});YI.ReadableStreamMessageReader=YI.AbstractMessageReader=YI.MessageReader=void 0;const _Re=uD,WB=jd,Ime=tA,Psi=cj;var B6e;(function(n){function e(t){let i=t;return i&&WB.func(i.listen)&&WB.func(i.dispose)&&WB.func(i.onError)&&WB.func(i.onClose)&&WB.func(i.onPartialMessage)}n.is=e})(B6e||(YI.MessageReader=B6e={}));class jat{constructor(){this.errorEmitter=new Ime.Emitter,this.closeEmitter=new Ime.Emitter,this.partialMessageEmitter=new Ime.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${WB.string(e.message)?e.message:"unknown"}`)}}YI.AbstractMessageReader=jat;var vRe;(function(n){function e(t){let i,s;const o=new Map;let r;const a=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(const c of t.contentDecoders)o.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(r=t.contentTypeDecoder,a.set(r.name,r)),t.contentTypeDecoders!==void 0)for(const c of t.contentTypeDecoders)a.set(c.name,c)}return r===void 0&&(r=(0,_Re.default)().applicationJson.decoder,a.set(r.name,r)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:r,contentTypeDecoders:a}}n.fromOptions=e})(vRe||(vRe={}));class Fsi extends jat{constructor(e,t){super(),this.readable=e,this.options=vRe.fromOptions(t),this.buffer=(0,_Re.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Psi.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const i=this.buffer.tryReadHeaders(!0);if(!i)return;const s=i.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(i))}`));return}const o=parseInt(s);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=o}const t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(s)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,_Re.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}YI.ReadableStreamMessageReader=Fsi;var JI={};Object.defineProperty(JI,"__esModule",{value:!0});JI.WriteableStreamMessageWriter=JI.AbstractMessageWriter=JI.MessageWriter=void 0;const W6e=uD,X3=jd,Osi=cj,H6e=tA,Bsi="Content-Length: ",U6e=`\r -`;var V6e;(function(n){function e(t){let i=t;return i&&X3.func(i.dispose)&&X3.func(i.onClose)&&X3.func(i.onError)&&X3.func(i.write)}n.is=e})(V6e||(JI.MessageWriter=V6e={}));class Kat{constructor(){this.errorEmitter=new H6e.Emitter,this.closeEmitter=new H6e.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${X3.string(e.message)?e.message:"unknown"}`)}}JI.AbstractMessageWriter=Kat;var wRe;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,W6e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,W6e.default)().applicationJson.encoder}}n.fromOptions=e})(wRe||(wRe={}));class Wsi extends Kat{constructor(e,t){super(),this.writable=e,this.options=wRe.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Osi.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{const s=[];return s.push(Bsi,i.byteLength.toString(),U6e),s.push(U6e),this.doWrite(e,s,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}JI.WriteableStreamMessageWriter=Wsi;var yue={};Object.defineProperty(yue,"__esModule",{value:!0});yue.AbstractMessageBuffer=void 0;const Hsi=13,Usi=10,Vsi=`\r -`;class zsi{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,s=0,o=0;e:for(;ithis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],r=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,r}const t=this.allocNative(e);let i=0,s=0;for(;e>0;){const o=this._chunks[s];if(o.byteLength>e){const r=o.slice(0,e);t.set(r,i),i+=e,this._chunks[s]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}}yue.AbstractMessageBuffer=zsi;var Yat={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.ConnectionOptions=n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.RequestCancellationReceiverStrategy=n.IdCancellationReceiverStrategy=n.ConnectionStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=n.NullLogger=n.ProgressType=n.ProgressToken=void 0;const e=uD,t=jd,i=hn,s=kx,o=tA,r=X1;var a;(function(j){j.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(j){function re(me){return typeof me=="string"||typeof me=="number"}j.is=re})(c||(n.ProgressToken=c={}));var l;(function(j){j.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}n.ProgressType=d;var h;(function(j){function re(me){return t.func(me)}j.is=re})(h||(h={})),n.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var u;(function(j){j[j.Off=0]="Off",j[j.Messages=1]="Messages",j[j.Compact=2]="Compact",j[j.Verbose=3]="Verbose"})(u||(n.Trace=u={}));var f;(function(j){j.Off="off",j.Messages="messages",j.Compact="compact",j.Verbose="verbose"})(f||(n.TraceValues=f={})),function(j){function re(De){if(!t.string(De))return j.Off;switch(De=De.toLowerCase(),De){case"off":return j.Off;case"messages":return j.Messages;case"compact":return j.Compact;case"verbose":return j.Verbose;default:return j.Off}}j.fromString=re;function me(De){switch(De){case j.Off:return"off";case j.Messages:return"messages";case j.Compact:return"compact";case j.Verbose:return"verbose";default:return"off"}}j.toString=me}(u||(n.Trace=u={}));var p;(function(j){j.Text="text",j.JSON="json"})(p||(n.TraceFormat=p={})),function(j){function re(me){return t.string(me)?(me=me.toLowerCase(),me==="json"?j.JSON:j.Text):j.Text}j.fromString=re}(p||(n.TraceFormat=p={}));var m;(function(j){j.type=new i.NotificationType("$/setTrace")})(m||(n.SetTraceNotification=m={}));var v;(function(j){j.type=new i.NotificationType("$/logTrace")})(v||(n.LogTraceNotification=v={}));var w;(function(j){j[j.Closed=1]="Closed",j[j.Disposed=2]="Disposed",j[j.AlreadyListening=3]="AlreadyListening"})(w||(n.ConnectionErrors=w={}));class b extends Error{constructor(re,me){super(me),this.code=re,Object.setPrototypeOf(this,b.prototype)}}n.ConnectionError=b;var C;(function(j){function re(me){const De=me;return De&&t.func(De.cancelUndispatched)}j.is=re})(C||(n.ConnectionStrategy=C={}));var y;(function(j){function re(me){const De=me;return De&&(De.kind===void 0||De.kind==="id")&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(y||(n.IdCancellationReceiverStrategy=y={}));var S;(function(j){function re(me){const De=me;return De&&De.kind==="request"&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(S||(n.RequestCancellationReceiverStrategy=S={}));var M;(function(j){j.Message=Object.freeze({createCancellationTokenSource(me){return new r.CancellationTokenSource}});function re(me){return y.is(me)||S.is(me)}j.is=re})(M||(n.CancellationReceiverStrategy=M={}));var k;(function(j){j.Message=Object.freeze({sendCancellation(me,De){return me.sendNotification(a.type,{id:De})},cleanup(me){}});function re(me){const De=me;return De&&t.func(De.sendCancellation)&&t.func(De.cleanup)}j.is=re})(k||(n.CancellationSenderStrategy=k={}));var F;(function(j){j.Message=Object.freeze({receiver:M.Message,sender:k.Message});function re(me){const De=me;return De&&M.is(De.receiver)&&k.is(De.sender)}j.is=re})(F||(n.CancellationStrategy=F={}));var N;(function(j){function re(me){const De=me;return De&&t.func(De.handleMessage)}j.is=re})(N||(n.MessageStrategy=N={}));var z;(function(j){function re(me){const De=me;return De&&(F.is(De.cancellationStrategy)||C.is(De.connectionStrategy)||N.is(De.messageStrategy))}j.is=re})(z||(n.ConnectionOptions=z={}));var U;(function(j){j[j.New=1]="New",j[j.Listening=2]="Listening",j[j.Closed=3]="Closed",j[j.Disposed=4]="Disposed"})(U||(U={}));function J(j,re,me,De){const Qe=me!==void 0?me:n.NullLogger;let Tt=0,Oe=0,wt=0;const Nt="2.0";let Ji;const zi=new Map;let Gn;const Ro=new Map,qn=new Map;let tc,ys=new s.LinkedMap,mr=new Map,ba=new Set,ki=new Map,gs=u.Off,ir=p.Text,Hn,vc=U.New;const gh=new o.Emitter,Qn=new o.Emitter,Yh=new o.Emitter,tl=new o.Emitter,Tl=new o.Emitter,to=De&&De.cancellationStrategy?De.cancellationStrategy:F.Message;function Oc(ve){if(ve===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ve.toString()}function rd(ve){return ve===null?"res-unknown-"+(++wt).toString():"res-"+ve.toString()}function Jh(){return"not-"+(++Oe).toString()}function Af(ve,ct){i.Message.isRequest(ct)?ve.set(Oc(ct.id),ct):i.Message.isResponse(ct)?ve.set(rd(ct.id),ct):ve.set(Jh(),ct)}function il(ve){}function Rl(){return vc===U.Listening}function Xh(){return vc===U.Closed}function ul(){return vc===U.Disposed}function ad(){(vc===U.New||vc===U.Listening)&&(vc=U.Closed,Qn.fire(void 0))}function wc(ve){gh.fire([ve,void 0,void 0])}function Ca(ve){gh.fire(ve)}j.onClose(ad),j.onError(wc),re.onClose(ad),re.onError(Ca);function Ld(){tc||ys.size===0||(tc=(0,e.default)().timer.setImmediate(()=>{tc=void 0,Fu()}))}function fh(ve){i.Message.isRequest(ve)?Zh(ve):i.Message.isNotification(ve)?nr(ve):i.Message.isResponse(ve)?Cc(ve):Rs(ve)}function Fu(){if(ys.size===0)return;const ve=ys.shift();try{const ct=De?.messageStrategy;N.is(ct)?ct.handleMessage(ve,fh):fh(ve)}finally{Ld()}}const bc=ve=>{try{if(i.Message.isNotification(ve)&&ve.method===a.type.method){const ct=ve.params.id,Ht=Oc(ct),Ei=ys.get(Ht);if(i.Message.isRequest(Ei)){const G=De?.connectionStrategy,de=G&&G.cancelUndispatched?G.cancelUndispatched(Ei,il):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ys.delete(Ht),ki.delete(ct),de.id=Ei.id,cd(de,ve.method,Date.now()),re.write(de).catch(()=>Qe.error("Sending response for canceled message failed."));return}}const Ut=ki.get(ct);if(Ut!==void 0){Ut.cancel(),Le(ve);return}else ba.add(ct)}Af(ys,ve)}finally{Ld()}};function Zh(ve){if(ul())return;function ct(ne,R,H){const ie={jsonrpc:Nt,id:ve.id};ne instanceof i.ResponseError?ie.error=ne.toJson():ie.result=ne===void 0?null:ne,cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ht(ne,R,H){const ie={jsonrpc:Nt,id:ve.id,error:ne.toJson()};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ei(ne,R,H){ne===void 0&&(ne=null);const ie={jsonrpc:Nt,id:ve.id,result:ne};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}K(ve);const Ut=zi.get(ve.method);let G,de;Ut&&(G=Ut.type,de=Ut.handler);const L=Date.now();if(de||Ji){const ne=ve.id??String(Date.now()),R=y.is(to.receiver)?to.receiver.createCancellationTokenSource(ne):to.receiver.createCancellationTokenSource(ve);ve.id!==null&&ba.has(ve.id)&&R.cancel(),ve.id!==null&&ki.set(ne,R);try{let H;if(de)if(ve.params===void 0){if(G!==void 0&&G.numberOfParams!==0){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines ${G.numberOfParams} params but received none.`),ve.method,L);return}H=de(R.token)}else if(Array.isArray(ve.params)){if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byName){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by name but received parameters by position`),ve.method,L);return}H=de(...ve.params,R.token)}else{if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byPosition){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by position but received parameters by name`),ve.method,L);return}H=de(ve.params,R.token)}else Ji&&(H=Ji(ve.method,ve.params,R.token));const ie=H;H?ie.then?ie.then(je=>{ki.delete(ne),ct(je,ve.method,L)},je=>{ki.delete(ne),je instanceof i.ResponseError?Ht(je,ve.method,L):je&&t.string(je.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${je.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}):(ki.delete(ne),ct(H,ve.method,L)):(ki.delete(ne),Ei(H,ve.method,L))}catch(H){ki.delete(ne),H instanceof i.ResponseError?ct(H,ve.method,L):H&&t.string(H.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${H.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}}else Ht(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${ve.method}`),ve.method,L)}function Cc(ve){if(!ul())if(ve.id===null)ve.error?Qe.error(`Received response message without id: Error is: -${JSON.stringify(ve.error,void 0,4)}`):Qe.error("Received response message without id. No further error information provided.");else{const ct=ve.id,Ht=mr.get(ct);if(ri(ve,Ht),Ht!==void 0){mr.delete(ct);try{if(ve.error){const Ei=ve.error;Ht.reject(new i.ResponseError(Ei.code,Ei.message,Ei.data))}else if(ve.result!==void 0)Ht.resolve(ve.result);else throw new Error("Should never happen.")}catch(Ei){Ei.message?Qe.error(`Response handler '${Ht.method}' failed with message: ${Ei.message}`):Qe.error(`Response handler '${Ht.method}' failed unexpectedly.`)}}}}function nr(ve){if(ul())return;let ct,Ht;if(ve.method===a.type.method){const Ei=ve.params.id;ba.delete(Ei),Le(ve);return}else{const Ei=Ro.get(ve.method);Ei&&(Ht=Ei.handler,ct=Ei.type)}if(Ht||Gn)try{if(Le(ve),Ht)if(ve.params===void 0)ct!==void 0&&ct.numberOfParams!==0&&ct.parameterStructures!==i.ParameterStructures.byName&&Qe.error(`Notification ${ve.method} defines ${ct.numberOfParams} params but received none.`),Ht();else if(Array.isArray(ve.params)){const Ei=ve.params;ve.method===l.type.method&&Ei.length===2&&c.is(Ei[0])?Ht({token:Ei[0],value:Ei[1]}):(ct!==void 0&&(ct.parameterStructures===i.ParameterStructures.byName&&Qe.error(`Notification ${ve.method} defines parameters by name but received parameters by position`),ct.numberOfParams!==ve.params.length&&Qe.error(`Notification ${ve.method} defines ${ct.numberOfParams} params but received ${Ei.length} arguments`)),Ht(...Ei))}else ct!==void 0&&ct.parameterStructures===i.ParameterStructures.byPosition&&Qe.error(`Notification ${ve.method} defines parameters by position but received parameters by name`),Ht(ve.params);else Gn&&Gn(ve.method,ve.params)}catch(Ei){Ei.message?Qe.error(`Notification handler '${ve.method}' failed with message: ${Ei.message}`):Qe.error(`Notification handler '${ve.method}' failed unexpectedly.`)}else Yh.fire(ve)}function Rs(ve){if(!ve){Qe.error("Received empty message.");return}Qe.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(ve,null,4)}`);const ct=ve;if(t.string(ct.id)||t.number(ct.id)){const Ht=ct.id,Ei=mr.get(Ht);Ei&&Ei.reject(new Error("The received response has neither a result nor an error property."))}}function Ml(ve){if(ve!=null)switch(gs){case u.Verbose:return JSON.stringify(ve,null,4);case u.Compact:return JSON.stringify(ve);default:return}}function Se(ve){if(!(gs===u.Off||!Hn))if(ir===p.Text){let ct;(gs===u.Verbose||gs===u.Compact)&&ve.params&&(ct=`Params: ${Ml(ve.params)} +`;function EP(s){return console.assert(s.startsWith("/")),Yv.from({scheme:"slintpad",path:s})}function dle(s){return s.scheme==="slintpad"}function VPe(s){return console.assert(dle(s)),s.path}var k7;class jii{constructor(e){Wt(this,k7);Ct(this,k7,e),console.assert(Object.keys(e).length>0),Object.keys(e).forEach(t=>console.assert(t.startsWith("/")))}from_internal(e){if(!dle(e))return e;const t=VPe(e),i=Ce(this,k7)[t]||null;return i?Yv.parse(i)??Yv.parse("file:///broken_url"):e}}k7=new WeakMap;var u2;class Yii{constructor(e){Wt(this,u2);Ct(this,u2,e)}from_internal(e){return dle(e)?Yv.from({scheme:Ce(this,u2).scheme,authority:Ce(this,u2).authority,path:VPe(e)}):e}}u2=new WeakMap;self.MonacoEnvironment={getWorker(s,e){return new Worker(new URL(""+new URL("monaco_worker-CFgjIjpz.js",import.meta.url).href,import.meta.url),{type:"module"})}};function Jii(s){try{const e=s?.path??"";return e.substring(e.lastIndexOf("/")+1)}catch{return s?.toString()??""}}var _x;const uFe=class uFe extends nt{constructor(t){const i=uFe.createNode();super({node:i});Wt(this,_x);this.id=t.object.textEditorModel?.uri.toString()??"",Ct(this,_x,pN.create(this.contentNode,{model:t.object.textEditorModel})),this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label=Jii(t.object.textEditorModel?.uri),this.title.closable=!1,this.title.caption="Slint Code Editor"}static createNode(){const t=document.createElement("div"),i=document.createElement("div");return t.appendChild(i),t}get editor(){return Ce(this,_x)}dispose(){Ce(this,_x).dispose(),this.dispose()}get contentNode(){return this.node.getElementsByTagName("div")[0]}resize_editor(){if(Ce(this,_x)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;Ce(this,_x).layout({width:t,height:i})}}onResize(t){this.isAttached&&this.resize_editor()}};_x=new WeakMap;let d0e=uFe;var cT,nS,sS,I7,T7,vx,g2;class Xii extends nt{constructor(t){super({});Wt(this,cT);Wt(this,nS,new Map);Wt(this,sS,null);Wt(this,I7,null);Wt(this,T7);Wt(this,vx,null);Wt(this,g2,{});Ct(this,T7,0),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",Ct(this,cT,new Zg({spacing:0})),super.layout=Ce(this,cT),Ct(this,I7,t.language_client),bot=this,t.file_reader=i=>this.handle_lsp_url_request(i),this.clear_editors(),this.open_default_content().then(i=>{Ce(this,I7)?.sendRequest("workspace/executeCommand",{command:"slint/showPreview",arguments:[i?.toString()??"",""]})})}async open_default_content(){const t=new URLSearchParams(window.location.search),i=t.get("snippet"),n=t.get("load_url"),o=t.get("load_demo");return i?(this.clear_editors(),Promise.resolve(this.open_file_with_content(EP("/main.slint"),i))):n?this.project_from_url(n):this.set_demo(o??"")}clear_editors(){Ct(this,T7,Ce(this,T7)+1),Ct(this,vx,null),Ce(this,sS)!==null&&Ce(this,cT).removeWidget(Ce(this,sS)),Ct(this,sS,new GXt({addButtonEnabled:!1})),Ce(this,cT).addWidget(Ce(this,sS)),Ce(this,nS).clear(),Ct(this,g2,{})}open_hello_world(){this.clear_editors();const t=EP("/main.slint");return this.open_file_with_content(t,Qii),t}open_file_with_content(t,i){l0e.registerFile(new T8t(t,i)),pN.createModelReference(t).then(n=>this.open_model_ref(n))}open_model_ref(t){const i=new d0e(t);return Ce(this,nS).set(t.object.textEditorModel?.uri??EP("unknown.slint"),i),Ce(this,sS).addWidget(i),i.editor}async map_url(t){const i=new URL(t),n=Yv.parse(i.toString()),o=Ce(this,vx)?.from_internal(n)??n,r=o.toString();if(dle(o)){const a=VPe(o);Ce(this,g2)[a]=r}return r}get current_editor_pane(){const t=Yv.parse(this.current_text_document_uri??"")??EP("broken.slint");return Ce(this,nS).get(t)??Ce(this,nS).entries().next().value[1]}get current_editor(){return this.current_editor_pane.editor}get current_editor_content(){return this.current_editor.getModel()?.getValue()??""}get current_text_document_uri(){return Ce(this,sS).currentWidget?.id}async project_from_url(t){return t==null?null:(this.clear_editors(),Promise.resolve((await this.open_tab_from_url(Yv.parse(t)))[0]))}async open_tab_from_url(t){const[i,n,o]=await RXt(t.toString()),r=Yv.parse(i??t.toString());return Ct(this,vx,o??new Yii(r)),this.safely_open_editor_with_url_content(r,EP(n??r.path),!0)}known_demos(){return[["","Hello World!"],["examples/gallery/gallery.slint","Gallery"],["examples/printerdemo/ui/printerdemo.slint","Printer Demo"],["examples/energy-monitor/ui/desktop_window.slint","Energy Monitor"],["examples/todo/ui/todo.slint","Todo Demo"],["examples/iot-dashboard/main.slint","IOT Dashboard"]]}add_empty_file_to_project(t){let i=t;i.startsWith("/")||(i="/"+i);const n=EP(i);return pN.getModel(n)?!1:(this.open_file_with_content(n,""),!0)}async set_demo(t){if(t){const i="XXXX_DEFAULT_TAG_XXXX";let n=i.startsWith("XXXX_DEFAULT_TAG_")?"master":i;{let o;(o=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(n="v"+o[1])}return this.project_from_url(`https://raw.githubusercontent.com/slint-ui/slint/${n}/${t}`)}else return Promise.resolve(this.open_hello_world())}get open_document_urls(){return new Array(...Ce(this,nS)).map((t,i)=>t.toString())}document_contents(t){const i=Yv.parse(t);return i===void 0?void 0:Ce(this,nS).get(i)?.editor.getModel()?.getValue()}get extra_files(){return Ce(this,g2)}async handle_lsp_url_request(t){if(Ce(this,vx)===null)return Promise.resolve("Error: Can not resolve URL.");const i=Yv.parse(t),n=Ce(this,vx).from_internal(i);return n===null?Promise.resolve("Error: Can not map URL."):(await this.safely_open_editor_with_url_content(n,i,!1))[1]}async safely_open_editor_with_url_content(t,i,n){try{const r=await l0e.readFile(i);return[i,new TextDecoder().decode(r)??""]}catch{}let o="";try{const r=await fetch(t.toString());if(!r.ok)return n&&alert("Failed to download data from "+t+`: +`+r.status+" "+r.statusText),[null,""];o=await r.text()}catch{return n&&alert("Failed to download data from "+t+"."),[null,""]}return this.open_file_with_content(i,o),[i,o]}}cT=new WeakMap,nS=new WeakMap,sS=new WeakMap,I7=new WeakMap,T7=new WeakMap,vx=new WeakMap,g2=new WeakMap;var oS,L7;class Zii{constructor(e,t){Wt(this,oS);Wt(this,L7);Ct(this,oS,e),Ct(this,L7,t),this.onError=Ce(this,oS).onError,this.onClose=Ce(this,oS).onClose,this.onPartialMessage=Ce(this,oS).onPartialMessage}dispose(){Ce(this,oS).dispose()}listen(e){return Ce(this,oS).listen(t=>{Ce(this,L7).call(this,t)||e(t)})}}oS=new WeakMap,L7=new WeakMap;var rd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function WEi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function wot(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var h0e={},u0e={},ps={},JN={},zPe={},dne={},ln={},Yl={};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.stringArray=Yl.array=Yl.func=Yl.error=Yl.number=Yl.string=Yl.boolean=void 0;function eni(s){return s===!0||s===!1}Yl.boolean=eni;function yot(s){return typeof s=="string"||s instanceof String}Yl.string=yot;function tni(s){return typeof s=="number"||s instanceof Number}Yl.number=tni;function ini(s){return s instanceof Error}Yl.error=ini;function nni(s){return typeof s=="function"}Yl.func=nni;function Cot(s){return Array.isArray(s)}Yl.array=Cot;function sni(s){return Cot(s)&&s.every(e=>yot(e))}Yl.stringArray=sni;Object.defineProperty(ln,"__esModule",{value:!0});ln.Message=ln.NotificationType9=ln.NotificationType8=ln.NotificationType7=ln.NotificationType6=ln.NotificationType5=ln.NotificationType4=ln.NotificationType3=ln.NotificationType2=ln.NotificationType1=ln.NotificationType0=ln.NotificationType=ln.RequestType9=ln.RequestType8=ln.RequestType7=ln.RequestType6=ln.RequestType5=ln.RequestType4=ln.RequestType3=ln.RequestType2=ln.RequestType1=ln.RequestType=ln.RequestType0=ln.AbstractMessageSignature=ln.ParameterStructures=ln.ResponseError=ln.ErrorCodes=void 0;const T0=Yl;var g0e;(function(s){s.ParseError=-32700,s.InvalidRequest=-32600,s.MethodNotFound=-32601,s.InvalidParams=-32602,s.InternalError=-32603,s.jsonrpcReservedErrorRangeStart=-32099,s.serverErrorStart=-32099,s.MessageWriteError=-32099,s.MessageReadError=-32098,s.PendingResponseRejected=-32097,s.ConnectionInactive=-32096,s.ServerNotInitialized=-32002,s.UnknownErrorCode=-32001,s.jsonrpcReservedErrorRangeEnd=-32e3,s.serverErrorEnd=-32e3})(g0e||(ln.ErrorCodes=g0e={}));class $Pe extends Error{constructor(e,t,i){super(t),this.code=T0.number(e)?e:g0e.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,$Pe.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}ln.ResponseError=$Pe;class Ju{constructor(e){this.kind=e}static is(e){return e===Ju.auto||e===Ju.byName||e===Ju.byPosition}toString(){return this.kind}}ln.ParameterStructures=Ju;Ju.auto=new Ju("auto");Ju.byPosition=new Ju("byPosition");Ju.byName=new Ju("byName");class Vc{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Ju.auto}}ln.AbstractMessageSignature=Vc;class oni extends Vc{constructor(e){super(e,0)}}ln.RequestType0=oni;class rni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.RequestType=rni;class ani extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.RequestType1=ani;class cni extends Vc{constructor(e){super(e,2)}}ln.RequestType2=cni;class lni extends Vc{constructor(e){super(e,3)}}ln.RequestType3=lni;class dni extends Vc{constructor(e){super(e,4)}}ln.RequestType4=dni;class hni extends Vc{constructor(e){super(e,5)}}ln.RequestType5=hni;class uni extends Vc{constructor(e){super(e,6)}}ln.RequestType6=uni;class gni extends Vc{constructor(e){super(e,7)}}ln.RequestType7=gni;class fni extends Vc{constructor(e){super(e,8)}}ln.RequestType8=fni;class pni extends Vc{constructor(e){super(e,9)}}ln.RequestType9=pni;class mni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.NotificationType=mni;class _ni extends Vc{constructor(e){super(e,0)}}ln.NotificationType0=_ni;class vni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.NotificationType1=vni;class bni extends Vc{constructor(e){super(e,2)}}ln.NotificationType2=bni;class wni extends Vc{constructor(e){super(e,3)}}ln.NotificationType3=wni;class yni extends Vc{constructor(e){super(e,4)}}ln.NotificationType4=yni;class Cni extends Vc{constructor(e){super(e,5)}}ln.NotificationType5=Cni;class Sni extends Vc{constructor(e){super(e,6)}}ln.NotificationType6=Sni;class Ani extends Vc{constructor(e){super(e,7)}}ln.NotificationType7=Ani;class Eni extends Vc{constructor(e){super(e,8)}}ln.NotificationType8=Eni;class xni extends Vc{constructor(e){super(e,9)}}ln.NotificationType9=xni;var r$e;(function(s){function e(n){const o=n;return o&&T0.string(o.method)&&(T0.string(o.id)||T0.number(o.id))}s.isRequest=e;function t(n){const o=n;return o&&T0.string(o.method)&&n.id===void 0}s.isNotification=t;function i(n){const o=n;return o&&(o.result!==void 0||!!o.error)&&(T0.string(o.id)||T0.number(o.id)||o.id===null)}s.isResponse=i})(r$e||(ln.Message=r$e={}));var vA={},a$e;Object.defineProperty(vA,"__esModule",{value:!0});vA.LRUCache=vA.LinkedMap=vA.Touch=void 0;var xu;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(xu||(vA.Touch=xu={}));class Sot{constructor(){this[a$e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=xu.None){const i=this._map.get(e);if(i)return t!==xu.None&&this.touch(i,t),i.value}set(e,t,i=xu.None){let n=this._map.get(e);if(n)n.value=t,i!==xu.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case xu.None:this.addItemLast(n);break;case xu.First:this.addItemFirst(n);break;case xu.Last:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.key,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}values(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.value,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}entries(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:[t.key,t.value],done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}[(a$e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==xu.First&&t!==xu.Last)){if(t===xu.First){if(e===this._head)return;const i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===xu.Last){if(e===this._tail)return;const i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}vA.LinkedMap=Sot;class Dni extends Sot{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=xu.AsNew){return super.get(e,t)}peek(e){return super.get(e,xu.None)}set(e,t){return super.set(e,t,xu.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}vA.LRUCache=Dni;var hle={};Object.defineProperty(hle,"__esModule",{value:!0});hle.Disposable=void 0;var c$e;(function(s){function e(t){return{dispose:t}}s.create=e})(c$e||(hle.Disposable=c$e={}));var dC={},aE={};Object.defineProperty(aE,"__esModule",{value:!0});let f0e;function p0e(){if(f0e===void 0)throw new Error("No runtime abstraction layer installed");return f0e}(function(s){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");f0e=t}s.install=e})(p0e||(p0e={}));aE.default=p0e;Object.defineProperty(dC,"__esModule",{value:!0});dC.Emitter=dC.Event=void 0;const kni=aE;var l$e;(function(s){const e={dispose(){}};s.None=function(){return e}})(l$e||(dC.Event=l$e={}));class Ini{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let n=0,o=this._callbacks.length;n{this._callbacks||(this._callbacks=new Ini),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const n={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),n.dispose=ule._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(n),n}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}dC.Emitter=ule;ule._noop=function(){};var vI={};Object.defineProperty(vI,"__esModule",{value:!0});vI.CancellationTokenSource=vI.CancellationToken=void 0;const Tni=aE,Lni=Yl,m0e=dC;var hne;(function(s){s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:m0e.Event.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:m0e.Event.None});function e(t){const i=t;return i&&(i===s.None||i===s.Cancelled||Lni.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}s.is=e})(hne||(vI.CancellationToken=hne={}));const Rni=Object.freeze(function(s,e){const t=(0,Tni.default)().timer.setTimeout(s.bind(e),0);return{dispose(){t.dispose()}}});class d$e{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Rni:(this._emitter||(this._emitter=new m0e.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Mni{get token(){return this._token||(this._token=new d$e),this._token}cancel(){this._token?this._token.cancel():this._token=hne.Cancelled}dispose(){this._token?this._token instanceof d$e&&this._token.dispose():this._token=hne.None}}vI.CancellationTokenSource=Mni;var jH={};Object.defineProperty(jH,"__esModule",{value:!0});jH.SharedArrayReceiverStrategy=jH.SharedArraySenderStrategy=void 0;const Nni=vI;var n7;(function(s){s.Continue=0,s.Cancelled=1})(n7||(n7={}));class Pni{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=n7.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){const i=this.buffers.get(t);if(i===void 0)return;const n=new Int32Array(i,0,1);Atomics.store(n,0,n7.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}jH.SharedArraySenderStrategy=Pni;class Fni{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n7.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oni{constructor(e){this.token=new Fni(e)}cancel(){}dispose(){}}class Bni{constructor(){this.kind="request"}createCancellationTokenSource(e){const t=e.$cancellationData;return t===void 0?new Nni.CancellationTokenSource:new Oni(t)}}jH.SharedArrayReceiverStrategy=Bni;var ED={},pG={};Object.defineProperty(pG,"__esModule",{value:!0});pG.Semaphore=void 0;const Wni=aE;let Hni=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Wni.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};pG.Semaphore=Hni;Object.defineProperty(ED,"__esModule",{value:!0});ED.ReadableStreamMessageReader=ED.AbstractMessageReader=ED.MessageReader=void 0;const _0e=aE,YP=Yl,age=dC,Uni=pG;var h$e;(function(s){function e(t){let i=t;return i&&YP.func(i.listen)&&YP.func(i.dispose)&&YP.func(i.onError)&&YP.func(i.onClose)&&YP.func(i.onPartialMessage)}s.is=e})(h$e||(ED.MessageReader=h$e={}));class Aot{constructor(){this.errorEmitter=new age.Emitter,this.closeEmitter=new age.Emitter,this.partialMessageEmitter=new age.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${YP.string(e.message)?e.message:"unknown"}`)}}ED.AbstractMessageReader=Aot;var v0e;(function(s){function e(t){let i,n;const o=new Map;let r;const a=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(n=t.contentDecoder,o.set(n.name,n)),t.contentDecoders!==void 0)for(const c of t.contentDecoders)o.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(r=t.contentTypeDecoder,a.set(r.name,r)),t.contentTypeDecoders!==void 0)for(const c of t.contentTypeDecoders)a.set(c.name,c)}return r===void 0&&(r=(0,_0e.default)().applicationJson.decoder,a.set(r.name,r)),{charset:i,contentDecoder:n,contentDecoders:o,contentTypeDecoder:r,contentTypeDecoders:a}}s.fromOptions=e})(v0e||(v0e={}));class Vni extends Aot{constructor(e,t){super(),this.readable=e,this.options=v0e.fromOptions(t),this.buffer=(0,_0e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Uni.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const i=this.buffer.tryReadHeaders(!0);if(!i)return;const n=i.get("content-length");if(!n){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(i))}`));return}const o=parseInt(n);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${n}`));return}this.nextMessageLength=o}const t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,n=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(n)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,_0e.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}ED.ReadableStreamMessageReader=Vni;var xD={};Object.defineProperty(xD,"__esModule",{value:!0});xD.WriteableStreamMessageWriter=xD.AbstractMessageWriter=xD.MessageWriter=void 0;const u$e=aE,zV=Yl,zni=pG,g$e=dC,$ni="Content-Length: ",f$e=`\r +`;var p$e;(function(s){function e(t){let i=t;return i&&zV.func(i.dispose)&&zV.func(i.onClose)&&zV.func(i.onError)&&zV.func(i.write)}s.is=e})(p$e||(xD.MessageWriter=p$e={}));class Eot{constructor(){this.errorEmitter=new g$e.Emitter,this.closeEmitter=new g$e.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${zV.string(e.message)?e.message:"unknown"}`)}}xD.AbstractMessageWriter=Eot;var b0e;(function(s){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,u$e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,u$e.default)().applicationJson.encoder}}s.fromOptions=e})(b0e||(b0e={}));class Gni extends Eot{constructor(e,t){super(),this.writable=e,this.options=b0e.fromOptions(t),this.errorCount=0,this.writeSemaphore=new zni.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{const n=[];return n.push($ni,i.byteLength.toString(),f$e),n.push(f$e),this.doWrite(e,n,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}xD.WriteableStreamMessageWriter=Gni;var gle={};Object.defineProperty(gle,"__esModule",{value:!0});gle.AbstractMessageBuffer=void 0;const Kni=13,qni=10,Qni=`\r +`;class jni{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,n=0,o=0;e:for(;ithis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],r=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,r}const t=this.allocNative(e);let i=0,n=0;for(;e>0;){const o=this._chunks[n];if(o.byteLength>e){const r=o.slice(0,e);t.set(r,i),i+=e,this._chunks[n]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}}gle.AbstractMessageBuffer=jni;var xot={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.ConnectionOptions=s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.RequestCancellationReceiverStrategy=s.IdCancellationReceiverStrategy=s.ConnectionStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=s.NullLogger=s.ProgressType=s.ProgressToken=void 0;const e=aE,t=Yl,i=ln,n=vA,o=dC,r=vI;var a;(function(j){j.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(j){function ne(ge){return typeof ge=="string"||typeof ge=="number"}j.is=ne})(c||(s.ProgressToken=c={}));var l;(function(j){j.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}s.ProgressType=d;var h;(function(j){function ne(ge){return t.func(ge)}j.is=ne})(h||(h={})),s.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var u;(function(j){j[j.Off=0]="Off",j[j.Messages=1]="Messages",j[j.Compact=2]="Compact",j[j.Verbose=3]="Verbose"})(u||(s.Trace=u={}));var f;(function(j){j.Off="off",j.Messages="messages",j.Compact="compact",j.Verbose="verbose"})(f||(s.TraceValues=f={})),function(j){function ne(De){if(!t.string(De))return j.Off;switch(De=De.toLowerCase(),De){case"off":return j.Off;case"messages":return j.Messages;case"compact":return j.Compact;case"verbose":return j.Verbose;default:return j.Off}}j.fromString=ne;function ge(De){switch(De){case j.Off:return"off";case j.Messages:return"messages";case j.Compact:return"compact";case j.Verbose:return"verbose";default:return"off"}}j.toString=ge}(u||(s.Trace=u={}));var p;(function(j){j.Text="text",j.JSON="json"})(p||(s.TraceFormat=p={})),function(j){function ne(ge){return t.string(ge)?(ge=ge.toLowerCase(),ge==="json"?j.JSON:j.Text):j.Text}j.fromString=ne}(p||(s.TraceFormat=p={}));var m;(function(j){j.type=new i.NotificationType("$/setTrace")})(m||(s.SetTraceNotification=m={}));var v;(function(j){j.type=new i.NotificationType("$/logTrace")})(v||(s.LogTraceNotification=v={}));var b;(function(j){j[j.Closed=1]="Closed",j[j.Disposed=2]="Disposed",j[j.AlreadyListening=3]="AlreadyListening"})(b||(s.ConnectionErrors=b={}));class w extends Error{constructor(ne,ge){super(ge),this.code=ne,Object.setPrototypeOf(this,w.prototype)}}s.ConnectionError=w;var y;(function(j){function ne(ge){const De=ge;return De&&t.func(De.cancelUndispatched)}j.is=ne})(y||(s.ConnectionStrategy=y={}));var C;(function(j){function ne(ge){const De=ge;return De&&(De.kind===void 0||De.kind==="id")&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=ne})(C||(s.IdCancellationReceiverStrategy=C={}));var A;(function(j){function ne(ge){const De=ge;return De&&De.kind==="request"&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=ne})(A||(s.RequestCancellationReceiverStrategy=A={}));var L;(function(j){j.Message=Object.freeze({createCancellationTokenSource(ge){return new r.CancellationTokenSource}});function ne(ge){return C.is(ge)||A.is(ge)}j.is=ne})(L||(s.CancellationReceiverStrategy=L={}));var k;(function(j){j.Message=Object.freeze({sendCancellation(ge,De){return ge.sendNotification(a.type,{id:De})},cleanup(ge){}});function ne(ge){const De=ge;return De&&t.func(De.sendCancellation)&&t.func(De.cleanup)}j.is=ne})(k||(s.CancellationSenderStrategy=k={}));var P;(function(j){j.Message=Object.freeze({receiver:L.Message,sender:k.Message});function ne(ge){const De=ge;return De&&L.is(De.receiver)&&k.is(De.sender)}j.is=ne})(P||(s.CancellationStrategy=P={}));var R;(function(j){function ne(ge){const De=ge;return De&&t.func(De.handleMessage)}j.is=ne})(R||(s.MessageStrategy=R={}));var z;(function(j){function ne(ge){const De=ge;return De&&(P.is(De.cancellationStrategy)||y.is(De.connectionStrategy)||R.is(De.messageStrategy))}j.is=ne})(z||(s.ConnectionOptions=z={}));var G;(function(j){j[j.New=1]="New",j[j.Listening=2]="Listening",j[j.Closed=3]="Closed",j[j.Disposed=4]="Disposed"})(G||(G={}));function Y(j,ne,ge,De){const Oe=ge!==void 0?ge:s.NullLogger;let yt=0,Ne=0,lt=0;const xt="2.0";let Ji;const Ii=new Map;let ns;const zs=new Map,Pn=new Map;let Xr,ds=new n.LinkedMap,Zo=new Map,Zr=new Set,Di=new Map,ss=u.Off,Oo=p.Text,Tn,Ba=G.New;const vd=new o.Emitter,Fn=new o.Emitter,th=new o.Emitter,pc=new o.Emitter,zc=new o.Emitter,$s=De&&De.cancellationStrategy?De.cancellationStrategy:P.Message;function tc(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}function fl(Se){return Se===null?"res-unknown-"+(++lt).toString():"res-"+Se.toString()}function ih(){return"not-"+(++Ne).toString()}function gg(Se,rt){i.Message.isRequest(rt)?Se.set(tc(rt.id),rt):i.Message.isResponse(rt)?Se.set(fl(rt.id),rt):Se.set(ih(),rt)}function mc(Se){}function $c(){return Ba===G.Listening}function nh(){return Ba===G.Closed}function Dc(){return Ba===G.Disposed}function pl(){(Ba===G.New||Ba===G.Listening)&&(Ba=G.Closed,Fn.fire(void 0))}function ic(Se){vd.fire([Se,void 0,void 0])}function Or(Se){vd.fire(Se)}j.onClose(pl),j.onError(ic),ne.onClose(pl),ne.onError(Or);function ml(){Xr||ds.size===0||(Xr=(0,e.default)().timer.setImmediate(()=>{Xr=void 0,oh()}))}function sh(Se){i.Message.isRequest(Se)?Kc(Se):i.Message.isNotification(Se)?Bo(Se):i.Message.isResponse(Se)?Wa(Se):Is(Se)}function oh(){if(ds.size===0)return;const Se=ds.shift();try{const rt=De?.messageStrategy;R.is(rt)?rt.handleMessage(Se,sh):sh(Se)}finally{ml()}}const Gc=Se=>{try{if(i.Message.isNotification(Se)&&Se.method===a.type.method){const rt=Se.params.id,Ft=tc(rt),Ci=ds.get(Ft);if(i.Message.isRequest(Ci)){const K=De?.connectionStrategy,de=K&&K.cancelUndispatched?K.cancelUndispatched(Ci,mc):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ds.delete(Ft),Di.delete(rt),de.id=Ci.id,Aa(de,Se.method,Date.now()),ne.write(de).catch(()=>Oe.error("Sending response for canceled message failed."));return}}const Ot=Di.get(rt);if(Ot!==void 0){Ot.cancel(),xe(Se);return}else Zr.add(rt)}gg(ds,Se)}finally{ml()}};function Kc(Se){if(Dc())return;function rt(ie,ye,O){const $={jsonrpc:xt,id:Se.id};ie instanceof i.ResponseError?$.error=ie.toJson():$.result=ie===void 0?null:ie,Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}function Ft(ie,ye,O){const $={jsonrpc:xt,id:Se.id,error:ie.toJson()};Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}function Ci(ie,ye,O){ie===void 0&&(ie=null);const $={jsonrpc:xt,id:Se.id,result:ie};Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}ee(Se);const Ot=Ii.get(Se.method);let K,de;Ot&&(K=Ot.type,de=Ot.handler);const T=Date.now();if(de||Ji){const ie=Se.id??String(Date.now()),ye=C.is($s.receiver)?$s.receiver.createCancellationTokenSource(ie):$s.receiver.createCancellationTokenSource(Se);Se.id!==null&&Zr.has(Se.id)&&ye.cancel(),Se.id!==null&&Di.set(ie,ye);try{let O;if(de)if(Se.params===void 0){if(K!==void 0&&K.numberOfParams!==0){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${K.numberOfParams} params but received none.`),Se.method,T);return}O=de(ye.token)}else if(Array.isArray(Se.params)){if(K!==void 0&&K.parameterStructures===i.ParameterStructures.byName){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,T);return}O=de(...Se.params,ye.token)}else{if(K!==void 0&&K.parameterStructures===i.ParameterStructures.byPosition){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,T);return}O=de(Se.params,ye.token)}else Ji&&(O=Ji(Se.method,Se.params,ye.token));const $=O;O?$.then?$.then(se=>{Di.delete(ie),rt(se,Se.method,T)},se=>{Di.delete(ie),se instanceof i.ResponseError?Ft(se,Se.method,T):se&&t.string(se.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${se.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}):(Di.delete(ie),rt(O,Se.method,T)):(Di.delete(ie),Ci(O,Se.method,T))}catch(O){Di.delete(ie),O instanceof i.ResponseError?rt(O,Se.method,T):O&&t.string(O.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${O.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}}else Ft(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,T)}function Wa(Se){if(!Dc())if(Se.id===null)Se.error?Oe.error(`Received response message without id: Error is: +${JSON.stringify(Se.error,void 0,4)}`):Oe.error("Received response message without id. No further error information provided.");else{const rt=Se.id,Ft=Zo.get(rt);if(gt(Se,Ft),Ft!==void 0){Zo.delete(rt);try{if(Se.error){const Ci=Se.error;Ft.reject(new i.ResponseError(Ci.code,Ci.message,Ci.data))}else if(Se.result!==void 0)Ft.resolve(Se.result);else throw new Error("Should never happen.")}catch(Ci){Ci.message?Oe.error(`Response handler '${Ft.method}' failed with message: ${Ci.message}`):Oe.error(`Response handler '${Ft.method}' failed unexpectedly.`)}}}}function Bo(Se){if(Dc())return;let rt,Ft;if(Se.method===a.type.method){const Ci=Se.params.id;Zr.delete(Ci),xe(Se);return}else{const Ci=zs.get(Se.method);Ci&&(Ft=Ci.handler,rt=Ci.type)}if(Ft||ns)try{if(xe(Se),Ft)if(Se.params===void 0)rt!==void 0&&rt.numberOfParams!==0&&rt.parameterStructures!==i.ParameterStructures.byName&&Oe.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received none.`),Ft();else if(Array.isArray(Se.params)){const Ci=Se.params;Se.method===l.type.method&&Ci.length===2&&c.is(Ci[0])?Ft({token:Ci[0],value:Ci[1]}):(rt!==void 0&&(rt.parameterStructures===i.ParameterStructures.byName&&Oe.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),rt.numberOfParams!==Se.params.length&&Oe.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received ${Ci.length} arguments`)),Ft(...Ci))}else rt!==void 0&&rt.parameterStructures===i.ParameterStructures.byPosition&&Oe.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),Ft(Se.params);else ns&&ns(Se.method,Se.params)}catch(Ci){Ci.message?Oe.error(`Notification handler '${Se.method}' failed with message: ${Ci.message}`):Oe.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else th.fire(Se)}function Is(Se){if(!Se){Oe.error("Received empty message.");return}Oe.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(Se,null,4)}`);const rt=Se;if(t.string(rt.id)||t.number(rt.id)){const Ft=rt.id,Ci=Zo.get(Ft);Ci&&Ci.reject(new Error("The received response has neither a result nor an error property."))}}function kc(Se){if(Se!=null)switch(ss){case u.Verbose:return JSON.stringify(Se,null,4);case u.Compact:return JSON.stringify(Se);default:return}}function Nh(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&Se.params&&(rt=`Params: ${kc(Se.params)} -`),Hn.log(`Sending request '${ve.method} - (${ve.id})'.`,ct)}else ts("send-request",ve)}function Mo(ve){if(!(gs===u.Off||!Hn))if(ir===p.Text){let ct;(gs===u.Verbose||gs===u.Compact)&&(ve.params?ct=`Params: ${Ml(ve.params)} +`),Tn.log(`Sending request '${Se.method} - (${Se.id})'.`,rt)}else zn("send-request",Se)}function be(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&(Se.params?rt=`Params: ${kc(Se.params)} -`:ct=`No parameters provided. +`:rt=`No parameters provided. -`),Hn.log(`Sending notification '${ve.method}'.`,ct)}else ts("send-notification",ve)}function cd(ve,ct,Ht){if(!(gs===u.Off||!Hn))if(ir===p.Text){let Ei;(gs===u.Verbose||gs===u.Compact)&&(ve.error&&ve.error.data?Ei=`Error data: ${Ml(ve.error.data)} +`),Tn.log(`Sending notification '${Se.method}'.`,rt)}else zn("send-notification",Se)}function Aa(Se,rt,Ft){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let Ci;(ss===u.Verbose||ss===u.Compact)&&(Se.error&&Se.error.data?Ci=`Error data: ${kc(Se.error.data)} -`:ve.result?Ei=`Result: ${Ml(ve.result)} +`:Se.result?Ci=`Result: ${kc(Se.result)} -`:ve.error===void 0&&(Ei=`No result returned. +`:Se.error===void 0&&(Ci=`No result returned. -`)),Hn.log(`Sending response '${ct} - (${ve.id})'. Processing request took ${Date.now()-Ht}ms`,Ei)}else ts("send-response",ve)}function K(ve){if(!(gs===u.Off||!Hn))if(ir===p.Text){let ct;(gs===u.Verbose||gs===u.Compact)&&ve.params&&(ct=`Params: ${Ml(ve.params)} +`)),Tn.log(`Sending response '${rt} - (${Se.id})'. Processing request took ${Date.now()-Ft}ms`,Ci)}else zn("send-response",Se)}function ee(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&Se.params&&(rt=`Params: ${kc(Se.params)} -`),Hn.log(`Received request '${ve.method} - (${ve.id})'.`,ct)}else ts("receive-request",ve)}function Le(ve){if(!(gs===u.Off||!Hn||ve.method===v.type.method))if(ir===p.Text){let ct;(gs===u.Verbose||gs===u.Compact)&&(ve.params?ct=`Params: ${Ml(ve.params)} +`),Tn.log(`Received request '${Se.method} - (${Se.id})'.`,rt)}else zn("receive-request",Se)}function xe(Se){if(!(ss===u.Off||!Tn||Se.method===v.type.method))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&(Se.params?rt=`Params: ${kc(Se.params)} -`:ct=`No parameters provided. +`:rt=`No parameters provided. -`),Hn.log(`Received notification '${ve.method}'.`,ct)}else ts("receive-notification",ve)}function ri(ve,ct){if(!(gs===u.Off||!Hn))if(ir===p.Text){let Ht;if((gs===u.Verbose||gs===u.Compact)&&(ve.error&&ve.error.data?Ht=`Error data: ${Ml(ve.error.data)} +`),Tn.log(`Received notification '${Se.method}'.`,rt)}else zn("receive-notification",Se)}function gt(Se,rt){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let Ft;if((ss===u.Verbose||ss===u.Compact)&&(Se.error&&Se.error.data?Ft=`Error data: ${kc(Se.error.data)} -`:ve.result?Ht=`Result: ${Ml(ve.result)} +`:Se.result?Ft=`Result: ${kc(Se.result)} -`:ve.error===void 0&&(Ht=`No result returned. +`:Se.error===void 0&&(Ft=`No result returned. -`)),ct){const Ei=ve.error?` Request failed: ${ve.error.message} (${ve.error.code}).`:"";Hn.log(`Received response '${ct.method} - (${ve.id})' in ${Date.now()-ct.timerStart}ms.${Ei}`,Ht)}else Hn.log(`Received response ${ve.id} without active response promise.`,Ht)}else ts("receive-response",ve)}function ts(ve,ct){if(!Hn||gs===u.Off)return;const Ht={isLSPMessage:!0,type:ve,message:ct,timestamp:Date.now()};Hn.log(Ht)}function Os(){if(Xh())throw new b(w.Closed,"Connection is closed.");if(ul())throw new b(w.Disposed,"Connection is disposed.")}function sr(){if(Rl())throw new b(w.AlreadyListening,"Connection is already listening")}function ya(){if(!Rl())throw new Error("Call listen() first.")}function yc(ve){return ve===void 0?null:ve}function Ou(ve){if(ve!==null)return ve}function le(ve){return ve!=null&&!Array.isArray(ve)&&typeof ve=="object"}function _r(ve,ct){switch(ve){case i.ParameterStructures.auto:return le(ct)?Ou(ct):[yc(ct)];case i.ParameterStructures.byName:if(!le(ct))throw new Error("Received parameters by name but param is not an object literal.");return Ou(ct);case i.ParameterStructures.byPosition:return[yc(ct)];default:throw new Error(`Unknown parameter structure ${ve.toString()}`)}}function No(ve,ct){let Ht;const Ei=ve.numberOfParams;switch(Ei){case 0:Ht=void 0;break;case 1:Ht=_r(ve.parameterStructures,ct[0]);break;default:Ht=[];for(let Ut=0;Ut{Os();let Ht,Ei;if(t.string(ve)){Ht=ve;const G=ct[0];let de=0,L=i.ParameterStructures.auto;i.ParameterStructures.is(G)&&(de=1,L=G);let ne=ct.length;const R=ne-de;switch(R){case 0:Ei=void 0;break;case 1:Ei=_r(L,ct[de]);break;default:if(L===i.ParameterStructures.byName)throw new Error(`Received ${R} parameters for 'by Name' notification parameter structure.`);Ei=ct.slice(de,ne).map(H=>yc(H));break}}else{const G=ct;Ht=ve.method,Ei=No(ve,G)}const Ut={jsonrpc:Nt,method:Ht,params:Ei};return Mo(Ut),re.write(Ut).catch(G=>{throw Qe.error("Sending notification failed."),G})},onNotification:(ve,ct)=>{Os();let Ht;return t.func(ve)?Gn=ve:ct&&(t.string(ve)?(Ht=ve,Ro.set(ve,{type:void 0,handler:ct})):(Ht=ve.method,Ro.set(ve.method,{type:ve,handler:ct}))),{dispose:()=>{Ht!==void 0?Ro.delete(Ht):Gn=void 0}}},onProgress:(ve,ct,Ht)=>{if(qn.has(ct))throw new Error(`Progress handler for token ${ct} already registered`);return qn.set(ct,Ht),{dispose:()=>{qn.delete(ct)}}},sendProgress:(ve,ct,Ht)=>mn.sendNotification(l.type,{token:ct,value:Ht}),onUnhandledProgress:tl.event,sendRequest:(ve,...ct)=>{Os(),ya();let Ht,Ei,Ut;if(t.string(ve)){Ht=ve;const ne=ct[0],R=ct[ct.length-1];let H=0,ie=i.ParameterStructures.auto;i.ParameterStructures.is(ne)&&(H=1,ie=ne);let je=ct.length;r.CancellationToken.is(R)&&(je=je-1,Ut=R);const pt=je-H;switch(pt){case 0:Ei=void 0;break;case 1:Ei=_r(ie,ct[H]);break;default:if(ie===i.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Ei=ct.slice(H,je).map(is=>yc(is));break}}else{const ne=ct;Ht=ve.method,Ei=No(ve,ne);const R=ve.numberOfParams;Ut=r.CancellationToken.is(ne[R])?ne[R]:void 0}const G=Tt++;let de;Ut&&(de=Ut.onCancellationRequested(()=>{const ne=to.sender.sendCancellation(mn,G);return ne===void 0?(Qe.log(`Received no promise from cancellation strategy when cancelling id ${G}`),Promise.resolve()):ne.catch(()=>{Qe.log(`Sending cancellation messages for id ${G} failed`)})}));const L={jsonrpc:Nt,id:G,method:Ht,params:Ei};return Se(L),typeof to.sender.enableCancellation=="function"&&to.sender.enableCancellation(L),new Promise(async(ne,R)=>{const H=pt=>{ne(pt),to.sender.cleanup(G),de?.dispose()},ie=pt=>{R(pt),to.sender.cleanup(G),de?.dispose()},je={method:Ht,timerStart:Date.now(),resolve:H,reject:ie};try{await re.write(L),mr.set(G,je)}catch(pt){throw Qe.error("Sending request failed."),je.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(ve,ct)=>{Os();let Ht=null;return h.is(ve)?(Ht=void 0,Ji=ve):t.string(ve)?(Ht=null,ct!==void 0&&(Ht=ve,zi.set(ve,{handler:ct,type:void 0}))):ct!==void 0&&(Ht=ve.method,zi.set(ve.method,{type:ve,handler:ct})),{dispose:()=>{Ht!==null&&(Ht!==void 0?zi.delete(Ht):Ji=void 0)}}},hasPendingResponse:()=>mr.size>0,trace:async(ve,ct,Ht)=>{let Ei=!1,Ut=p.Text;Ht!==void 0&&(t.boolean(Ht)?Ei=Ht:(Ei=Ht.sendNotification||!1,Ut=Ht.traceFormat||p.Text)),gs=ve,ir=Ut,gs===u.Off?Hn=void 0:Hn=ct,Ei&&!Xh()&&!ul()&&await mn.sendNotification(m.type,{value:u.toString(ve)})},onError:gh.event,onClose:Qn.event,onUnhandledNotification:Yh.event,onDispose:Tl.event,end:()=>{re.end()},dispose:()=>{if(ul())return;vc=U.Disposed,Tl.fire(void 0);const ve=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const ct of mr.values())ct.reject(ve);mr=new Map,ki=new Map,ba=new Set,ys=new s.LinkedMap,t.func(re.dispose)&&re.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Os(),sr(),vc=U.Listening,j.listen(bc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return mn.onNotification(v.type,ve=>{if(gs===u.Off||!Hn)return;const ct=gs===u.Verbose||gs===u.Compact;Hn.log(ve.message,ct?ve.verbose:void 0)}),mn.onNotification(l.type,ve=>{const ct=qn.get(ve.token);ct?ct(ve.value):tl.fire(ve)}),mn}n.createMessageConnection=J})(Yat);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressType=n.ProgressToken=n.createMessageConnection=n.NullLogger=n.ConnectionOptions=n.ConnectionStrategy=n.AbstractMessageBuffer=n.WriteableStreamMessageWriter=n.AbstractMessageWriter=n.MessageWriter=n.ReadableStreamMessageReader=n.AbstractMessageReader=n.MessageReader=n.SharedArrayReceiverStrategy=n.SharedArraySenderStrategy=n.CancellationToken=n.CancellationTokenSource=n.Emitter=n.Event=n.Disposable=n.LRUCache=n.Touch=n.LinkedMap=n.ParameterStructures=n.NotificationType9=n.NotificationType8=n.NotificationType7=n.NotificationType6=n.NotificationType5=n.NotificationType4=n.NotificationType3=n.NotificationType2=n.NotificationType1=n.NotificationType0=n.NotificationType=n.ErrorCodes=n.ResponseError=n.RequestType9=n.RequestType8=n.RequestType7=n.RequestType6=n.RequestType5=n.RequestType4=n.RequestType3=n.RequestType2=n.RequestType1=n.RequestType0=n.RequestType=n.Message=n.RAL=void 0,n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=void 0;const e=hn;Object.defineProperty(n,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(n,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(n,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(n,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(n,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(n,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(n,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(n,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(n,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(n,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(n,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(n,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(n,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(n,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(n,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(n,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(n,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(n,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(n,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(n,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(n,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(n,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(n,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(n,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(n,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(n,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=kx;Object.defineProperty(n,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(n,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(n,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=bue;Object.defineProperty(n,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=tA;Object.defineProperty(n,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(n,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const o=X1;Object.defineProperty(n,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(n,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=Q4;Object.defineProperty(n,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(n,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=YI;Object.defineProperty(n,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(n,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(n,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=JI;Object.defineProperty(n,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(n,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(n,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=yue;Object.defineProperty(n,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Yat;Object.defineProperty(n,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(n,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(n,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(n,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(n,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(n,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(n,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(n,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(n,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(n,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(n,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(n,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(n,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(n,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(n,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(n,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(n,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=uD;n.RAL=h.default})(Fre);Object.defineProperty(aBe,"__esModule",{value:!0});const Ry=Fre;class Sue extends Ry.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Sue.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}Sue.emptyBuffer=new Uint8Array(0);class $si{constructor(e){this.socket=e,this._onData=new Ry.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(s=>{this._onData.fire(new Uint8Array(s))},()=>{(0,Ry.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Gsi{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,t){if(typeof e=="string"){if(t!==void 0&&t!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const qsi=new TextEncoder,Jat=Object.freeze({messageBuffer:Object.freeze({create:n=>new Sue(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(qsi.encode(JSON.stringify(n,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{if(!(n instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(n)))}})}),stream:Object.freeze({asReadableStream:n=>new $si(n),asWritableStream:n=>new Gsi(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){const i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){const t=setTimeout(n,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(n,e,...t){const i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function bRe(){return Jat}(function(n){function e(){Ry.RAL.install(Jat)}n.install=e})(bRe||(bRe={}));aBe.default=bRe;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var u=Object.getOwnPropertyDescriptor(l,d);(!u||("get"in u?!l.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,u)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),t=sh&&sh.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.BrowserMessageWriter=n.BrowserMessageReader=void 0,aBe.default.install();const s=Fre;t(Fre,n);class o extends s.AbstractMessageReader{constructor(l){super(),this._onData=new s.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}n.BrowserMessageReader=o;class r extends s.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}n.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=s.NullLogger),s.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,s.createMessageConnection)(c,l,d,h)}n.createMessageConnection=a})(NO);var z6e=NO,Xat={};const lBe=$at(IZt);var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ProtocolNotificationType=Jo.ProtocolNotificationType0=Jo.ProtocolRequestType=Jo.ProtocolRequestType0=Jo.RegistrationType=Jo.MessageDirection=void 0;const j4=NO;var $6e;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})($6e||(Jo.MessageDirection=$6e={}));class Qsi{constructor(e){this.method=e}}Jo.RegistrationType=Qsi;class jsi extends j4.RequestType0{constructor(e){super(e)}}Jo.ProtocolRequestType0=jsi;class Ksi extends j4.RequestType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolRequestType=Ksi;class Ysi extends j4.NotificationType0{constructor(e){super(e)}}Jo.ProtocolNotificationType0=Ysi;class Jsi extends j4.NotificationType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolNotificationType=Jsi;var Zat={},jl={};Object.defineProperty(jl,"__esModule",{value:!0});jl.objectLiteral=jl.typedArray=jl.stringArray=jl.array=jl.func=jl.error=jl.number=jl.string=jl.boolean=void 0;function Xsi(n){return n===!0||n===!1}jl.boolean=Xsi;function ect(n){return typeof n=="string"||n instanceof String}jl.string=ect;function Zsi(n){return typeof n=="number"||n instanceof Number}jl.number=Zsi;function eoi(n){return n instanceof Error}jl.error=eoi;function toi(n){return typeof n=="function"}jl.func=toi;function tct(n){return Array.isArray(n)}jl.array=tct;function ioi(n){return tct(n)&&n.every(e=>ect(e))}jl.stringArray=ioi;function noi(n,e){return Array.isArray(n)&&n.every(e)}jl.typedArray=noi;function soi(n){return n!==null&&typeof n=="object"}jl.objectLiteral=soi;var Aue={};Object.defineProperty(Aue,"__esModule",{value:!0});Aue.ImplementationRequest=void 0;const G6e=Jo;var q6e;(function(n){n.method="textDocument/implementation",n.messageDirection=G6e.MessageDirection.clientToServer,n.type=new G6e.ProtocolRequestType(n.method)})(q6e||(Aue.ImplementationRequest=q6e={}));var Eue={};Object.defineProperty(Eue,"__esModule",{value:!0});Eue.TypeDefinitionRequest=void 0;const Q6e=Jo;var j6e;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=Q6e.MessageDirection.clientToServer,n.type=new Q6e.ProtocolRequestType(n.method)})(j6e||(Eue.TypeDefinitionRequest=j6e={}));var K4={};Object.defineProperty(K4,"__esModule",{value:!0});K4.DidChangeWorkspaceFoldersNotification=K4.WorkspaceFoldersRequest=void 0;const Bre=Jo;var K6e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Bre.MessageDirection.serverToClient,n.type=new Bre.ProtocolRequestType0(n.method)})(K6e||(K4.WorkspaceFoldersRequest=K6e={}));var Y6e;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Bre.MessageDirection.clientToServer,n.type=new Bre.ProtocolNotificationType(n.method)})(Y6e||(K4.DidChangeWorkspaceFoldersNotification=Y6e={}));var xue={};Object.defineProperty(xue,"__esModule",{value:!0});xue.ConfigurationRequest=void 0;const J6e=Jo;var X6e;(function(n){n.method="workspace/configuration",n.messageDirection=J6e.MessageDirection.serverToClient,n.type=new J6e.ProtocolRequestType(n.method)})(X6e||(xue.ConfigurationRequest=X6e={}));var Y4={};Object.defineProperty(Y4,"__esModule",{value:!0});Y4.ColorPresentationRequest=Y4.DocumentColorRequest=void 0;const Wre=Jo;var Z6e;(function(n){n.method="textDocument/documentColor",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(Z6e||(Y4.DocumentColorRequest=Z6e={}));var eGe;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(eGe||(Y4.ColorPresentationRequest=eGe={}));var J4={};Object.defineProperty(J4,"__esModule",{value:!0});J4.FoldingRangeRefreshRequest=J4.FoldingRangeRequest=void 0;const Hre=Jo;var tGe;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Hre.MessageDirection.clientToServer,n.type=new Hre.ProtocolRequestType(n.method)})(tGe||(J4.FoldingRangeRequest=tGe={}));var iGe;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Hre.MessageDirection.serverToClient,n.type=new Hre.ProtocolRequestType0(n.method)})(iGe||(J4.FoldingRangeRefreshRequest=iGe={}));var Due={};Object.defineProperty(Due,"__esModule",{value:!0});Due.DeclarationRequest=void 0;const nGe=Jo;var sGe;(function(n){n.method="textDocument/declaration",n.messageDirection=nGe.MessageDirection.clientToServer,n.type=new nGe.ProtocolRequestType(n.method)})(sGe||(Due.DeclarationRequest=sGe={}));var kue={};Object.defineProperty(kue,"__esModule",{value:!0});kue.SelectionRangeRequest=void 0;const oGe=Jo;var rGe;(function(n){n.method="textDocument/selectionRange",n.messageDirection=oGe.MessageDirection.clientToServer,n.type=new oGe.ProtocolRequestType(n.method)})(rGe||(kue.SelectionRangeRequest=rGe={}));var XI={};Object.defineProperty(XI,"__esModule",{value:!0});XI.WorkDoneProgressCancelNotification=XI.WorkDoneProgressCreateRequest=XI.WorkDoneProgress=void 0;const ooi=NO,Ure=Jo;var aGe;(function(n){n.type=new ooi.ProgressType;function e(t){return t===n.type}n.is=e})(aGe||(XI.WorkDoneProgress=aGe={}));var cGe;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Ure.MessageDirection.serverToClient,n.type=new Ure.ProtocolRequestType(n.method)})(cGe||(XI.WorkDoneProgressCreateRequest=cGe={}));var lGe;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Ure.MessageDirection.clientToServer,n.type=new Ure.ProtocolNotificationType(n.method)})(lGe||(XI.WorkDoneProgressCancelNotification=lGe={}));var ZI={};Object.defineProperty(ZI,"__esModule",{value:!0});ZI.CallHierarchyOutgoingCallsRequest=ZI.CallHierarchyIncomingCallsRequest=ZI.CallHierarchyPrepareRequest=void 0;const X4=Jo;var dGe;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(dGe||(ZI.CallHierarchyPrepareRequest=dGe={}));var hGe;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(hGe||(ZI.CallHierarchyIncomingCallsRequest=hGe={}));var uGe;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(uGe||(ZI.CallHierarchyOutgoingCallsRequest=uGe={}));var em={};Object.defineProperty(em,"__esModule",{value:!0});em.SemanticTokensRefreshRequest=em.SemanticTokensRangeRequest=em.SemanticTokensDeltaRequest=em.SemanticTokensRequest=em.SemanticTokensRegistrationType=em.TokenFormat=void 0;const Yx=Jo;var gGe;(function(n){n.Relative="relative"})(gGe||(em.TokenFormat=gGe={}));var mq;(function(n){n.method="textDocument/semanticTokens",n.type=new Yx.RegistrationType(n.method)})(mq||(em.SemanticTokensRegistrationType=mq={}));var fGe;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(fGe||(em.SemanticTokensRequest=fGe={}));var pGe;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(pGe||(em.SemanticTokensDeltaRequest=pGe={}));var mGe;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(mGe||(em.SemanticTokensRangeRequest=mGe={}));var _Ge;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Yx.MessageDirection.serverToClient,n.type=new Yx.ProtocolRequestType0(n.method)})(_Ge||(em.SemanticTokensRefreshRequest=_Ge={}));var Iue={};Object.defineProperty(Iue,"__esModule",{value:!0});Iue.ShowDocumentRequest=void 0;const vGe=Jo;var wGe;(function(n){n.method="window/showDocument",n.messageDirection=vGe.MessageDirection.serverToClient,n.type=new vGe.ProtocolRequestType(n.method)})(wGe||(Iue.ShowDocumentRequest=wGe={}));var Lue={};Object.defineProperty(Lue,"__esModule",{value:!0});Lue.LinkedEditingRangeRequest=void 0;const bGe=Jo;var CGe;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=bGe.MessageDirection.clientToServer,n.type=new bGe.ProtocolRequestType(n.method)})(CGe||(Lue.LinkedEditingRangeRequest=CGe={}));var jg={};Object.defineProperty(jg,"__esModule",{value:!0});jg.WillDeleteFilesRequest=jg.DidDeleteFilesNotification=jg.DidRenameFilesNotification=jg.WillRenameFilesRequest=jg.DidCreateFilesNotification=jg.WillCreateFilesRequest=jg.FileOperationPatternKind=void 0;const Ew=Jo;var yGe;(function(n){n.file="file",n.folder="folder"})(yGe||(jg.FileOperationPatternKind=yGe={}));var SGe;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(SGe||(jg.WillCreateFilesRequest=SGe={}));var AGe;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(AGe||(jg.DidCreateFilesNotification=AGe={}));var EGe;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(EGe||(jg.WillRenameFilesRequest=EGe={}));var xGe;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(xGe||(jg.DidRenameFilesNotification=xGe={}));var DGe;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(DGe||(jg.DidDeleteFilesNotification=DGe={}));var kGe;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(kGe||(jg.WillDeleteFilesRequest=kGe={}));var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.MonikerRequest=e0.MonikerKind=e0.UniquenessLevel=void 0;const IGe=Jo;var LGe;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(LGe||(e0.UniquenessLevel=LGe={}));var TGe;(function(n){n.$import="import",n.$export="export",n.local="local"})(TGe||(e0.MonikerKind=TGe={}));var RGe;(function(n){n.method="textDocument/moniker",n.messageDirection=IGe.MessageDirection.clientToServer,n.type=new IGe.ProtocolRequestType(n.method)})(RGe||(e0.MonikerRequest=RGe={}));var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.TypeHierarchySubtypesRequest=t0.TypeHierarchySupertypesRequest=t0.TypeHierarchyPrepareRequest=void 0;const Z4=Jo;var MGe;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(MGe||(t0.TypeHierarchyPrepareRequest=MGe={}));var NGe;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(NGe||(t0.TypeHierarchySupertypesRequest=NGe={}));var PGe;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(PGe||(t0.TypeHierarchySubtypesRequest=PGe={}));var ez={};Object.defineProperty(ez,"__esModule",{value:!0});ez.InlineValueRefreshRequest=ez.InlineValueRequest=void 0;const Vre=Jo;var FGe;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Vre.MessageDirection.clientToServer,n.type=new Vre.ProtocolRequestType(n.method)})(FGe||(ez.InlineValueRequest=FGe={}));var OGe;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Vre.MessageDirection.serverToClient,n.type=new Vre.ProtocolRequestType0(n.method)})(OGe||(ez.InlineValueRefreshRequest=OGe={}));var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.InlayHintRefreshRequest=i0.InlayHintResolveRequest=i0.InlayHintRequest=void 0;const tz=Jo;var BGe;(function(n){n.method="textDocument/inlayHint",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(BGe||(i0.InlayHintRequest=BGe={}));var WGe;(function(n){n.method="inlayHint/resolve",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(WGe||(i0.InlayHintResolveRequest=WGe={}));var HGe;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=tz.MessageDirection.serverToClient,n.type=new tz.ProtocolRequestType0(n.method)})(HGe||(i0.InlayHintRefreshRequest=HGe={}));var Fv={};Object.defineProperty(Fv,"__esModule",{value:!0});Fv.DiagnosticRefreshRequest=Fv.WorkspaceDiagnosticRequest=Fv.DocumentDiagnosticRequest=Fv.DocumentDiagnosticReportKind=Fv.DiagnosticServerCancellationData=void 0;const ict=NO,roi=jl,iz=Jo;var UGe;(function(n){function e(t){const i=t;return i&&roi.boolean(i.retriggerRequest)}n.is=e})(UGe||(Fv.DiagnosticServerCancellationData=UGe={}));var VGe;(function(n){n.Full="full",n.Unchanged="unchanged"})(VGe||(Fv.DocumentDiagnosticReportKind=VGe={}));var zGe;(function(n){n.method="textDocument/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})(zGe||(Fv.DocumentDiagnosticRequest=zGe={}));var $Ge;(function(n){n.method="workspace/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})($Ge||(Fv.WorkspaceDiagnosticRequest=$Ge={}));var GGe;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=iz.MessageDirection.serverToClient,n.type=new iz.ProtocolRequestType0(n.method)})(GGe||(Fv.DiagnosticRefreshRequest=GGe={}));var Ql={};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.DidCloseNotebookDocumentNotification=Ql.DidSaveNotebookDocumentNotification=Ql.DidChangeNotebookDocumentNotification=Ql.NotebookCellArrayChange=Ql.DidOpenNotebookDocumentNotification=Ql.NotebookDocumentSyncRegistrationType=Ql.NotebookDocument=Ql.NotebookCell=Ql.ExecutionSummary=Ql.NotebookCellKind=void 0;const _q=lBe,Hb=jl,iA=Jo;var CRe;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(CRe||(Ql.NotebookCellKind=CRe={}));var yRe;(function(n){function e(s,o){const r={executionOrder:s};return(o===!0||o===!1)&&(r.success=o),r}n.create=e;function t(s){const o=s;return Hb.objectLiteral(o)&&_q.uinteger.is(o.executionOrder)&&(o.success===void 0||Hb.boolean(o.success))}n.is=t;function i(s,o){return s===o?!0:s==null||o===null||o===void 0?!1:s.executionOrder===o.executionOrder&&s.success===o.success}n.equals=i})(yRe||(Ql.ExecutionSummary=yRe={}));var zre;(function(n){function e(o,r){return{kind:o,document:r}}n.create=e;function t(o){const r=o;return Hb.objectLiteral(r)&&CRe.is(r.kind)&&_q.DocumentUri.is(r.document)&&(r.metadata===void 0||Hb.objectLiteral(r.metadata))}n.is=t;function i(o,r){const a=new Set;return o.document!==r.document&&a.add("document"),o.kind!==r.kind&&a.add("kind"),o.executionSummary!==r.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||r.metadata!==void 0)&&!s(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!yRe.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function s(o,r){if(o===r)return!0;if(o==null||r===null||r===void 0||typeof o!=typeof r||typeof o!="object")return!1;const a=Array.isArray(o),c=Array.isArray(r);if(a!==c)return!1;if(a&&c){if(o.length!==r.length)return!1;for(let l=0;l0}le.hasId=_r})(Tt||(n.StaticRegistrationOptions=Tt={}));var Oe;(function(le){function _r(No){const mn=No;return mn&&(mn.documentSelector===null||J.is(mn.documentSelector))}le.is=_r})(Oe||(n.TextDocumentRegistrationOptions=Oe={}));var wt;(function(le){function _r(mn){const ve=mn;return i.objectLiteral(ve)&&(ve.workDoneProgress===void 0||i.boolean(ve.workDoneProgress))}le.is=_r;function No(mn){const ve=mn;return ve&&i.boolean(ve.workDoneProgress)}le.hasWorkDoneProgress=No})(wt||(n.WorkDoneProgressOptions=wt={}));var Nt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Nt||(n.InitializeRequest=Nt={}));var Ji;(function(le){le.unknownProtocolVersion=1})(Ji||(n.InitializeErrorCodes=Ji={}));var zi;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(zi||(n.InitializedNotification=zi={}));var Gn;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(Gn||(n.ShutdownRequest=Gn={}));var Ro;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(Ro||(n.ExitNotification=Ro={}));var qn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(qn||(n.DidChangeConfigurationNotification=qn={}));var tc;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(tc||(n.MessageType=tc={}));var ys;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ys||(n.ShowMessageNotification=ys={}));var mr;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(mr||(n.ShowMessageRequest=mr={}));var ba;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ba||(n.LogMessageNotification=ba={}));var ki;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ki||(n.TelemetryEventNotification=ki={}));var gs;(function(le){le.None=0,le.Full=1,le.Incremental=2})(gs||(n.TextDocumentSyncKind=gs={}));var ir;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(ir||(n.DidOpenTextDocumentNotification=ir={}));var Hn;(function(le){function _r(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}le.isIncremental=_r;function No(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}le.isFull=No})(Hn||(n.TextDocumentContentChangeEvent=Hn={}));var vc;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(vc||(n.DidChangeTextDocumentNotification=vc={}));var gh;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(gh||(n.DidCloseTextDocumentNotification=gh={}));var Qn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Qn||(n.DidSaveTextDocumentNotification=Qn={}));var Yh;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(Yh||(n.TextDocumentSaveReason=Yh={}));var tl;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(tl||(n.WillSaveTextDocumentNotification=tl={}));var Tl;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Tl||(n.WillSaveTextDocumentWaitUntilRequest=Tl={}));var to;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(to||(n.DidChangeWatchedFilesNotification=to={}));var Oc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(Oc||(n.FileChangeType=Oc={}));var rd;(function(le){function _r(No){const mn=No;return i.objectLiteral(mn)&&(t.URI.is(mn.baseUri)||t.WorkspaceFolder.is(mn.baseUri))&&i.string(mn.pattern)}le.is=_r})(rd||(n.RelativePattern=rd={}));var Jh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(Jh||(n.WatchKind=Jh={}));var Af;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Af||(n.PublishDiagnosticsNotification=Af={}));var il;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(il||(n.CompletionTriggerKind=il={}));var Rl;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rl||(n.CompletionRequest=Rl={}));var Xh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Xh||(n.CompletionResolveRequest=Xh={}));var ul;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ul||(n.HoverRequest=ul={}));var ad;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(ad||(n.SignatureHelpTriggerKind=ad={}));var wc;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(wc||(n.SignatureHelpRequest=wc={}));var Ca;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ca||(n.DefinitionRequest=Ca={}));var Ld;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ld||(n.ReferencesRequest=Ld={}));var fh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(fh||(n.DocumentHighlightRequest=fh={}));var Fu;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Fu||(n.DocumentSymbolRequest=Fu={}));var bc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(bc||(n.CodeActionRequest=bc={}));var Zh;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Zh||(n.CodeActionResolveRequest=Zh={}));var Cc;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Cc||(n.WorkspaceSymbolRequest=Cc={}));var nr;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nr||(n.WorkspaceSymbolResolveRequest=nr={}));var Rs;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rs||(n.CodeLensRequest=Rs={}));var Ml;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ml||(n.CodeLensResolveRequest=Ml={}));var Se;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Se||(n.CodeLensRefreshRequest=Se={}));var Mo;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Mo||(n.DocumentLinkRequest=Mo={}));var cd;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(cd||(n.DocumentLinkResolveRequest=cd={}));var K;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(K||(n.DocumentFormattingRequest=K={}));var Le;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Le||(n.DocumentRangeFormattingRequest=Le={}));var ri;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ri||(n.DocumentRangesFormattingRequest=ri={}));var ts;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ts||(n.DocumentOnTypeFormattingRequest=ts={}));var Os;(function(le){le.Identifier=1})(Os||(n.PrepareSupportDefaultBehavior=Os={}));var sr;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(sr||(n.RenameRequest=sr={}));var ya;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ya||(n.PrepareRenameRequest=ya={}));var yc;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(yc||(n.ExecuteCommandRequest=yc={}));var Ou;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ou||(n.ApplyWorkspaceEditRequest=Ou={}))})(Zat);var Rue={};Object.defineProperty(Rue,"__esModule",{value:!0});Rue.createProtocolConnection=void 0;const eqe=NO;function aoi(n,e,t,i){return eqe.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,eqe.createMessageConnection)(n,e,t,i)}Rue.createProtocolConnection=aoi;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.LSPErrorCodes=n.createProtocolConnection=void 0,t(NO,n),t(lBe,n),t(Jo,n),t(Zat,n);var i=Rue;Object.defineProperty(n,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var s;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(s||(n.LSPErrorCodes=s={}))})(Xat);(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.createProtocolConnection=void 0;const i=z6e;t(z6e,n),t(Xat,n);function s(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}n.createProtocolConnection=s})(Ts);var $n={};const as=$at(MQt);var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.asPromise=ea.thenable=ea.typedArray=ea.stringArray=ea.array=ea.func=ea.error=ea.number=ea.string=ea.boolean=void 0;function coi(n){return n===!0||n===!1}ea.boolean=coi;function nct(n){return typeof n=="string"||n instanceof String}ea.string=nct;function loi(n){return typeof n=="number"||n instanceof Number}ea.number=loi;function doi(n){return n instanceof Error}ea.error=doi;function sct(n){return typeof n=="function"}ea.func=sct;function oct(n){return Array.isArray(n)}ea.array=oct;function hoi(n){return oct(n)&&n.every(e=>nct(e))}ea.stringArray=hoi;function uoi(n,e){return Array.isArray(n)&&n.every(e)}ea.typedArray=uoi;function rct(n){return n&&sct(n.then)}ea.thenable=rct;function goi(n){return n instanceof Promise?n:rct(n)?new Promise((e,t)=>{n.then(i=>e(i),i=>t(i))}):Promise.resolve(n)}ea.asPromise=goi;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.generateUuid=Er.parse=Er.isUUID=Er.v4=Er.empty=void 0;class dBe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class bo extends dBe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return bo._oneOf(bo._chars)}constructor(){super([bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-","4",bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._oneOf(bo._timeHighBits),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex()].join(""))}}bo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];bo._timeHighBits=["8","9","a","b"];Er.empty=new dBe("00000000-0000-0000-0000-000000000000");function act(){return new bo}Er.v4=act;const foi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function cct(n){return foi.test(n)}Er.isUUID=cct;function poi(n){if(!cct(n))throw new Error("invalid uuid");return new dBe(n)}Er.parse=poi;function moi(){return act().asHex()}Er.generateUuid=moi;Object.defineProperty($n,"__esModule",{value:!0});$n.WorkspaceFeature=$n.TextDocumentLanguageFeature=$n.TextDocumentEventFeature=$n.DynamicDocumentFeature=$n.DynamicFeature=$n.StaticFeature=$n.ensure=$n.LSPCancellationError=void 0;const YM=as,Lme=Ts,Jf=ea,tqe=Er;class _oi extends YM.CancellationError{constructor(e){super(),this.data=e}}$n.LSPCancellationError=_oi;function voi(n,e){return n[e]===void 0&&(n[e]={}),n[e]}$n.ensure=voi;var iqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))}n.is=e})(iqe||($n.StaticFeature=iqe={}));var nqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))&&Jf.func(i.register)&&Jf.func(i.unregister)&&i.registrationType!==void 0}n.is=e})(nqe||($n.DynamicFeature=nqe={}));class hBe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const s of e){t++;for(const o of YM.workspace.textDocuments)if(YM.languages.match(s,o)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}const i=t>0;return{kind:"document",id:this.registrationType.method,registrations:i,matches:!1}}}$n.DynamicDocumentFeature=hBe;class woi extends hBe{static textDocumentFilter(e,t){for(const i of e)if(YM.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,s,o,r,a){super(e),this._event=t,this._type=i,this._middleware=s,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new YM.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(i=>{this._client.error(`Sending document notification ${this._type.method} failed.`,i)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){const t=async i=>{const s=this._createParams(i);await this._client.sendNotification(this._type,s),this.notificationSent(this.getTextDocument(i),this._type,s)};if(this.matches(e)){const i=this._middleware();return i?i(e,s=>t(s)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(const t of this._selectors.values())if(YM.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}$n.TextDocumentEventFeature=woi;class boi extends hBe{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(const e of this._registrations.values()){const t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(Lme.TextDocumentRegistrationOptions.is(t)){const i=Lme.StaticRegistrationOptions.hasId(t)?t.id:tqe.generateUuid(),s=t.documentSelector??e;if(s)return[i,Object.assign({},t,{documentSelector:s})]}else if(Jf.boolean(t)&&t===!0||Lme.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[tqe.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(const t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&YM.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(i),e)>0)return t.provider}}getAllProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.TextDocumentLanguageFeature=boi;class Coi{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){const e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){const t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.WorkspaceFeature=Coi;var Ix={};const yoi=typeof process=="object"&&process&&process.platform==="win32";var Soi=yoi?{sep:"\\"}:{sep:"/"},Aoi=lct;function lct(n,e,t){n instanceof RegExp&&(n=sqe(n,t)),e instanceof RegExp&&(e=sqe(e,t));var i=dct(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function sqe(n,e){var t=e.match(n);return t?t[0]:null}lct.range=dct;function dct(n,e,t){var i,s,o,r,a,c=t.indexOf(n),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(n,d+1)):i.length==1?a=[i.pop(),l]:(s=i.pop(),s=0?c:l;i.length&&(a=[o,r])}return a}var hct=Aoi,Eoi=koi,uct="\0SLASH"+Math.random()+"\0",gct="\0OPEN"+Math.random()+"\0",uBe="\0CLOSE"+Math.random()+"\0",fct="\0COMMA"+Math.random()+"\0",pct="\0PERIOD"+Math.random()+"\0";function Tme(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function xoi(n){return n.split("\\\\").join(uct).split("\\{").join(gct).split("\\}").join(uBe).split("\\,").join(fct).split("\\.").join(pct)}function Doi(n){return n.split(uct).join("\\").split(gct).join("{").split(uBe).join("}").split(fct).join(",").split(pct).join(".")}function mct(n){if(!n)return[""];var e=[],t=hct("{","}",n);if(!t)return n.split(",");var i=t.pre,s=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+s+"}";var a=mct(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function koi(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Z3(xoi(n),!0).map(Doi)):[]}function Ioi(n){return"{"+n+"}"}function Loi(n){return/^-?0\d/.test(n)}function Toi(n,e){return n<=e}function Roi(n,e){return n>=e}function Z3(n,e){var t=[],i=hct("{","}",n);if(!i)return[n];var s=i.pre,o=i.post.length?Z3(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+uBe+i.post,Z3(n)):[n];var u;if(d)u=i.body.split(/\.\./);else if(u=mct(i.body),u.length===1&&(u=Z3(u[0],!1).map(Ioi),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=Tme(u[0]),m=Tme(u[1]),v=Math.max(u[0].length,u[1].length),w=u.length==3?Math.abs(Tme(u[2])):1,b=Toi,C=m0){var F=new Array(k+1).join("0");S<0?M="-"+F+M.slice(1):M=F+M}}f.push(M)}}else{f=[];for(var N=0;N($re(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Nue(e,t).match(n));var Mue=D_;const SRe=Soi;D_.sep=SRe.sep;const Jw=Symbol("globstar **");D_.GLOBSTAR=Jw;const Moi=Eoi,oqe={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},ARe="[^/]",Rme=ARe+"*?",Noi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Poi="(?:(?!(?:\\/|^)\\.).)*?",_ct=n=>n.split("").reduce((e,t)=>(e[t]=!0,e),{}),rqe=_ct("().*{}+?[]^$\\!"),Foi=_ct("[.("),aqe=/\/+/;D_.filter=(n,e={})=>(t,i,s)=>D_(t,n,e);const SD=(n,e={})=>{const t={};return Object.keys(n).forEach(i=>t[i]=n[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};D_.defaults=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return D_;const e=D_,t=(i,s,o)=>e(i,s,SD(n,o));return t.Minimatch=class extends e.Minimatch{constructor(s,o){super(s,SD(n,o))}},t.Minimatch.defaults=i=>e.defaults(SD(n,i)).Minimatch,t.filter=(i,s)=>e.filter(i,SD(n,s)),t.defaults=i=>e.defaults(SD(n,i)),t.makeRe=(i,s)=>e.makeRe(i,SD(n,s)),t.braceExpand=(i,s)=>e.braceExpand(i,SD(n,s)),t.match=(i,s,o)=>e.match(i,s,SD(n,o)),t};D_.braceExpand=(n,e)=>vct(n,e);const vct=(n,e={})=>($re(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:Moi(n)),Ooi=1024*64,$re=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>Ooi)throw new TypeError("pattern is too long")},Mme=Symbol("subparse");D_.makeRe=(n,e)=>new Nue(n,e||{}).makeRe();D_.match=(n,e,t={})=>{const i=new Nue(e,t);return n=n.filter(s=>i.match(s)),i.options.nonull&&!n.length&&n.push(e),n};const Boi=n=>n.replace(/\\(.)/g,"$1"),Woi=n=>n.replace(/\\([^-\]])/g,"$1"),Hoi=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Uoi=n=>n.replace(/[[\]\\]/g,"\\$&");class Nue{constructor(e,t){$re(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let i=this.globSet=this.braceExpand();t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,i),i=this.globParts=i.map(s=>s.split(aqe)),this.debug(this.pattern,i),i=i.map((s,o,r)=>s.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(s=>s.indexOf(!1)===-1),this.debug(this.pattern,i),this.set=i}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,i=0;for(let s=0;s>> no match, partial?`,e,h,t,u),h===a))}var p;if(typeof l=="string"?(p=d===l,this.debug("string match",l,d,p)):(p=d.match(l),this.debug("pattern match",l,d,p)),!p)return!1}if(o===a&&r===c)return!0;if(o===a)return i;if(r===c)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return vct(this.pattern,this.options)}parse(e,t){$re(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Jw;if(e==="")return"";let s="",o=!1,r=!1;const a=[],c=[];let l,d=!1,h=-1,u=-1,f,p,m,v=e.charAt(0)===".",w=i.dot||v;const b=()=>v?"":w?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=k=>k.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=()=>{if(l){switch(l){case"*":s+=Rme,o=!0;break;case"?":s+=ARe,o=!0;break;default:s+="\\"+l;break}this.debug("clearStateChar %j %j",l,s),l=!1}};for(let k=0,F;k(U||(U="\\"),z+z+U+"|")),this.debug(`tail=%j - %s`,k,k,p,s);const F=p.type==="*"?Rme:p.type==="?"?ARe:"\\"+p.type;o=!0,s=s.slice(0,p.reStart)+F+"\\("+k}y(),r&&(s+="\\\\");const S=Foi[s.charAt(0)];for(let k=c.length-1;k>-1;k--){const F=c[k],N=s.slice(0,F.reStart),z=s.slice(F.reStart,F.reEnd-8);let U=s.slice(F.reEnd);const J=s.slice(F.reEnd-8,F.reEnd)+U,j=N.split(")").length,re=N.split("(").length-j;let me=U;for(let Qe=0;Qe(r=r.map(a=>typeof a=="string"?Hoi(a):a===Jw?Jw:a._src).reduce((a,c)=>(a[a.length-1]===Jw&&c===Jw||a.push(c),a),[]),r.forEach((a,c)=>{a!==Jw||r[c-1]===Jw||(c===0?r.length>1?r[c+1]="(?:\\/|"+i+"\\/)?"+r[c+1]:r[c]=i:c===r.length-1?r[c-1]+="(?:\\/|"+i+")?":(r[c-1]+="(?:\\/|\\/"+i+"\\/)"+r[c+1],r[c+1]=Jw))}),r.filter(a=>a!==Jw).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,s)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const i=this.options;SRe.sep!=="/"&&(e=e.split(SRe.sep).join("/")),e=e.split(aqe),this.debug(this.pattern,"split",e);const s=this.set;this.debug(this.pattern,"set",s);let o;for(let r=e.length-1;r>=0&&(o=e[r],!o);r--);for(let r=0;r{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,s=new Set;H8.fillTabResources(s);const o=new Set,r=new Set(s);for(const a of i.values())s.has(a)?r.delete(a):o.add(a);if(this.open=s,o.size>0){const a=new Set;for(const c of o)a.add(Qo.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(Qo.Uri.parse(c));this._onOpen.fire(a)}};Qo.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=Qo.window.tabGroups.onDidChangeTabs(e):this.disposable={dispose:()=>{}}}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof Qo.Uri?Qo.window.activeTextEditor?.document.uri===e:Qo.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof Qo.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return H8.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const s of Qo.window.tabGroups.all)for(const o of s.tabs){const r=o.input;let a;r instanceof Qo.TabInputText?a=r.uri:r instanceof Qo.TabInputTextDiff?a=r.modified:r instanceof Qo.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Nh;(function(n){n[n.document=1]="document",n[n.workspace=2]="workspace"})(Nh||(Nh={}));var GE;(function(n){function e(t){return t instanceof Qo.Uri?t.toString():t.uri.toString()}n.asKey=e})(GE||(GE={}));class $oi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const s=e===Nh.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof Qo.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=s.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},s.set(o,c)),c}update(e,t,i,s){const o=e===Nh.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof Qo.Uri?[t.toString(),t,i,s]:[t.uri.toString(),t.uri,t.version,i];let d=o.get(r);d===void 0?(d={document:a,pulledVersion:c,resultId:l},o.set(r,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=GE.asKey(t);(e===Nh.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).get(i)?.resultId}getAllResultIds(){const e=[];for(let[t,i]of this.workspacePullStates)this.documentPullStates.has(t)&&(i=this.documentPullStates.get(t)),i.resultId!==void 0&&e.push({uri:t,value:i.resultId});return e}}class Goi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new Qo.EventEmitter,this.provider=this.createProvider(),this.diagnostics=Qo.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new $oi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof Qo.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(i.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},s=>{this.client.error(`Document pull failed for text document ${i.toString()}`,s,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri,s=i?e:e.uri,o=s.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Nh.document,e,t):this.documentStates.track(Nh.document,e);if(r===void 0){const c=new Qo.CancellationTokenSource;this.openRequests.set(o,{state:kg.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:lv.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof ERe.LSPCancellationError&&ql.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:kg.outDated,document:e}),d===void 0&&h instanceof Qo.CancellationError)d={state:kg.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(o),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${o}`),this.diagnostics.delete(s);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Nh.document,e);return}if(d.state===kg.outDated)return;l!==void 0&&(l.kind===lv.DocumentDiagnosticReportKind.full&&this.diagnostics.set(s,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===kg.reschedule&&this.pull(e)}else r.state===kg.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:kg.reschedule,document:r.document})):r.state===kg.outDated&&this.openRequests.set(o,{state:kg.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof Qo.Uri?e:e.uri,i=t.toString(),s=this.openRequests.get(i);this.options.workspaceDiagnostics?s!==void 0?this.openRequests.set(i,{state:kg.reschedule,document:e}):this.pull(e,()=>{this.forget(Nh.document,e)}):(s!==void 0&&(s.state===kg.active&&s.tokenSource.cancel(),this.openRequests.set(i,{state:kg.outDated,document:e})),this.diagnostics.delete(t),this.forget(Nh.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof ERe.LSPCancellationError)&&!ql.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new Qo.CancellationTokenSource;const e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(const i of t.items)i.kind===lv.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Nh.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Nh.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,s)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof Qo.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(ql.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:h.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,l,h,{kind:lv.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,s,o):o(t,i,s)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,s)=>{const o=async l=>l.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,i)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},r=l=>{const d=[];for(const h of l)d.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return d},a=(l,d)=>{const h=(0,zoi.generateUuid)(),u=this.client.onProgress(ql.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){s(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(w){this.client.error("Converting workspace diagnostics failed.",w)}s(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(ql.WorkspaceDiagnosticRequest.type,f,d).then(async p=>{if(d.isCancellationRequested)return{items:[]};const m={items:[]};for(const v of p.items)m.items.push(await o(v));return u.dispose(),s(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,s,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===kg.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:kg.outDated,document:t.document});this.diagnostics.dispose()}}class qoi{constructor(e){this.diagnosticRequestor=e,this.documents=new ql.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=GE.asKey(e);this.documents.has(t)||(this.documents.set(t,e,ql.Touch.Last),this.trigger())}remove(e){const t=GE.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,ql.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=GE.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,ql.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument!==void 0?GE.asKey(this.endDocument):void 0}}class Qoi{constructor(e,t,i){const s=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(s.match!==void 0)return s.match(m,p);for(const v of m)if(ql.TextDocumentFilter.is(v)){if(typeof v=="string"||v.language!==void 0&&v.language!=="*"||v.scheme!==void 0&&v.scheme!=="*"&&v.scheme!==p.scheme)return!1;if(v.pattern!==void 0){const w=new Voi.Minimatch(v.pattern,{noext:!0});if(!w.makeRe()||!w.match(p.fsPath))return!1}}return!0},c=p=>p instanceof Qo.Uri?a(p):Qo.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof Qo.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new Goi(e,t,i),this.backgroundScheduler=new qoi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=Qo.window.activeTextEditor?.document,Qo.window.onDidChangeActiveTextEditor(p=>{const m=this.activeTextDocument;this.activeTextDocument=p?.document,m!==void 0&&d(m),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});const h=e.getFeature(ql.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Nh.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Nh.document,m))continue;const v=m.toString();let w;for(const b of Qo.workspace.textDocuments)if(v===b.uri.toString()){w=b;break}w!==void 0&&c(w)&&this.diagnosticRequestor.pull(w,()=>{d(w)})}}));const u=new Set;for(const p of Qo.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(s.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(s.onChange===!0){const p=e.getFeature(ql.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onType))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(s.onSave===!0){const p=e.getFeature(ql.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onSave))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(ql.DidCloseTextDocumentNotification.method);r.push(f.onNotificationSent(p=>{this.cleanUpDocument(p.textDocument)})),t.onClose(p=>{for(const m of p)this.cleanUpDocument(m)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(const p of Qo.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=Qo.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Nh.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class joi extends ERe.TextDocumentLanguageFeature{constructor(e){super(e,ql.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=DY(DY(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,DY(DY(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(ql.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[s,o]=this.getRegistration(t,e.diagnosticProvider);!s||!o||this.register({id:s,registerOptions:o})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new H8);const t=new Qoi(this._client,this.tabs,e);return[t.disposable,t]}}Ix.DiagnosticFeature=joi;var mu={},Pue={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});vu.forEach=vu.mapAsync=vu.map=vu.clearTestMode=vu.setTestMode=vu.Semaphore=vu.Delayer=void 0;const lj=Ts;class Koi{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,lj.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}}vu.Delayer=Koi;class Yoi{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,lj.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}vu.Semaphore=Yoi;let gBe=!1;function Joi(){gBe=!0}vu.setTestMode=Joi;function Xoi(){gBe=!1}vu.clearTestMode=Xoi;const cqe=15;class fBe{constructor(e=cqe){this.yieldAfter=gBe===!0?Math.max(e,2):Math.max(e,cqe),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){const e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}}async function Zoi(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.map=Zoi;async function eri(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.mapAsync=eri;async function tri(n,e,t,i){if(n.length===0)return;const s=new fBe(i?.yieldAfter);function o(a){s.start();for(let c=a;c{(0,lj.RAL)().timer.setImmediate(()=>{a(o(r))})})}vu.forEach=tri;var Fue={};Object.defineProperty(Fue,"__esModule",{value:!0});const iri=as;class nri extends iri.CompletionItem{constructor(e){super(e)}}Fue.default=nri;var Oue={};Object.defineProperty(Oue,"__esModule",{value:!0});const sri=as;class ori extends sri.CodeLens{constructor(e){super(e)}}Oue.default=ori;var Bue={};Object.defineProperty(Bue,"__esModule",{value:!0});const rri=as;class ari extends rri.DocumentLink{constructor(e,t){super(e,t)}}Bue.default=ari;var Wue={};Object.defineProperty(Wue,"__esModule",{value:!0});const cri=as;class lri extends cri.CodeAction{constructor(e,t){super(e),this.data=t}}Wue.default=lri;var tO={};Object.defineProperty(tO,"__esModule",{value:!0});tO.ProtocolDiagnostic=tO.DiagnosticCode=void 0;const dri=as,Nme=ea;var lqe;(function(n){function e(t){const i=t;return i!=null&&(Nme.number(i.value)||Nme.string(i.value))&&Nme.string(i.target)}n.is=e})(lqe||(tO.DiagnosticCode=lqe={}));class hri extends dri.Diagnostic{constructor(e,t,i,s){super(e,t,i),this.data=s,this.hasDiagnosticCode=!1}}tO.ProtocolDiagnostic=hri;var Hue={};Object.defineProperty(Hue,"__esModule",{value:!0});const uri=as;class gri extends uri.CallHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Hue.default=gri;var Uue={};Object.defineProperty(Uue,"__esModule",{value:!0});const fri=as;class pri extends fri.TypeHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Uue.default=pri;var Vue={};Object.defineProperty(Vue,"__esModule",{value:!0});const kY=as;class mri extends kY.SymbolInformation{constructor(e,t,i,s,o){const r=!(s instanceof kY.Uri);super(e,t,i,r?s:new kY.Location(s,new kY.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}Vue.default=mri;var zue={};Object.defineProperty(zue,"__esModule",{value:!0});const _ri=as;class vri extends _ri.InlayHint{constructor(e,t,i){super(e,t,i)}}zue.default=vri;Object.defineProperty(Pue,"__esModule",{value:!0});Pue.createConverter=void 0;const Td=as,Ms=Ts,OL=ea,dqe=vu,wri=Fue,bri=Oue,Cri=Bue,hqe=Wue,uqe=tO,yri=Hue,Sri=Uue,Ari=Vue,Eri=zue;var xRe;(function(n){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}n.is=e})(xRe||(xRe={}));function xri(n){const t=n||(K=>K.toString());function i(K){return t(K)}function s(K){return{uri:t(K.uri)}}function o(K){return{uri:t(K.uri),languageId:K.languageId,version:K.version,text:K.getText()}}function r(K){return{uri:t(K.uri),version:K.version}}function a(K){return{textDocument:o(K)}}function c(K){const Le=K;return!!Le.document&&!!Le.contentChanges}function l(K){const Le=K;return!!Le.uri&&!!Le.version}function d(K,Le,ri){if(l(K))return{textDocument:{uri:t(K.uri),version:K.version},contentChanges:[{text:K.getText()}]};if(c(K)){const ts=Le,Os=ri;return{textDocument:{uri:t(ts),version:Os},contentChanges:K.contentChanges.map(ya=>{const yc=ya.range;return{range:{start:{line:yc.start.line,character:yc.start.character},end:{line:yc.end.line,character:yc.end.character}},rangeLength:ya.rangeLength,text:ya.text}})}}else throw Error("Unsupported text document change parameter")}function h(K){return{textDocument:s(K)}}function u(K,Le=!1){let ri={textDocument:s(K)};return Le&&(ri.text=K.getText()),ri}function f(K){switch(K){case Td.TextDocumentSaveReason.Manual:return Ms.TextDocumentSaveReason.Manual;case Td.TextDocumentSaveReason.AfterDelay:return Ms.TextDocumentSaveReason.AfterDelay;case Td.TextDocumentSaveReason.FocusOut:return Ms.TextDocumentSaveReason.FocusOut}return Ms.TextDocumentSaveReason.Manual}function p(K){return{textDocument:s(K.document),reason:f(K.reason)}}function m(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function v(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function w(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function b(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function C(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function y(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function S(K,Le){return{textDocument:s(K),position:me(Le)}}function M(K){switch(K){case Td.CompletionTriggerKind.TriggerCharacter:return Ms.CompletionTriggerKind.TriggerCharacter;case Td.CompletionTriggerKind.TriggerForIncompleteCompletions:return Ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return Ms.CompletionTriggerKind.Invoked}}function k(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{triggerKind:M(ri.triggerKind),triggerCharacter:ri.triggerCharacter}}}function F(K){switch(K){case Td.SignatureHelpTriggerKind.Invoke:return Ms.SignatureHelpTriggerKind.Invoked;case Td.SignatureHelpTriggerKind.TriggerCharacter:return Ms.SignatureHelpTriggerKind.TriggerCharacter;case Td.SignatureHelpTriggerKind.ContentChange:return Ms.SignatureHelpTriggerKind.ContentChange}}function N(K){return{label:K.label}}function z(K){return K.map(N)}function U(K){return{label:K.label,parameters:z(K.parameters)}}function J(K){return K.map(U)}function j(K){return K===void 0?K:{signatures:J(K.signatures),activeSignature:K.activeSignature,activeParameter:K.activeParameter}}function re(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{isRetrigger:ri.isRetrigger,triggerCharacter:ri.triggerCharacter,triggerKind:F(ri.triggerKind),activeSignatureHelp:j(ri.activeSignatureHelp)}}}function me(K){return{line:K.line,character:K.character}}function De(K){return K==null?K:{line:K.line>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.line,character:K.character>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.character}}function Qe(K,Le){return dqe.map(K,De,Le)}function Tt(K){return K.map(De)}function Oe(K){return K==null?K:{start:De(K.start),end:De(K.end)}}function wt(K){return K.map(Oe)}function Nt(K){return K==null?K:Ms.Location.create(i(K.uri),Oe(K.range))}function Ji(K){switch(K){case Td.DiagnosticSeverity.Error:return Ms.DiagnosticSeverity.Error;case Td.DiagnosticSeverity.Warning:return Ms.DiagnosticSeverity.Warning;case Td.DiagnosticSeverity.Information:return Ms.DiagnosticSeverity.Information;case Td.DiagnosticSeverity.Hint:return Ms.DiagnosticSeverity.Hint}}function zi(K){if(!K)return;let Le=[];for(let ri of K){let ts=Gn(ri);ts!==void 0&&Le.push(ts)}return Le.length>0?Le:void 0}function Gn(K){switch(K){case Td.DiagnosticTag.Unnecessary:return Ms.DiagnosticTag.Unnecessary;case Td.DiagnosticTag.Deprecated:return Ms.DiagnosticTag.Deprecated;default:return}}function Ro(K){return{message:K.message,location:Nt(K.location)}}function qn(K){return K.map(Ro)}function tc(K){if(K!=null)return OL.number(K)||OL.string(K)?K:{value:K.value,target:i(K.target)}}function ys(K){const Le=Ms.Diagnostic.create(Oe(K.range),K.message),ri=K instanceof uqe.ProtocolDiagnostic?K:void 0;ri!==void 0&&ri.data!==void 0&&(Le.data=ri.data);const ts=tc(K.code);return uqe.DiagnosticCode.is(ts)?ri!==void 0&&ri.hasDiagnosticCode?Le.code=ts:(Le.code=ts.value,Le.codeDescription={href:ts.target}):Le.code=ts,OL.number(K.severity)&&(Le.severity=Ji(K.severity)),Array.isArray(K.tags)&&(Le.tags=zi(K.tags)),K.relatedInformation&&(Le.relatedInformation=qn(K.relatedInformation)),K.source&&(Le.source=K.source),Le}function mr(K,Le){return K==null?K:dqe.map(K,ys,Le)}function ba(K){return K==null?K:K.map(ys)}function ki(K,Le){switch(K){case"$string":return Le;case Ms.MarkupKind.PlainText:return{kind:K,value:Le};case Ms.MarkupKind.Markdown:return{kind:K,value:Le.value};default:return`Unsupported Markup content received. Kind is: ${K}`}}function gs(K){switch(K){case Td.CompletionItemTag.Deprecated:return Ms.CompletionItemTag.Deprecated}}function ir(K){if(K===void 0)return K;const Le=[];for(let ri of K){const ts=gs(ri);ts!==void 0&&Le.push(ts)}return Le}function Hn(K,Le){return Le!==void 0?Le:K+1}function vc(K,Le=!1){let ri,ts;OL.string(K.label)?ri=K.label:(ri=K.label.label,Le&&(K.label.detail!==void 0||K.label.description!==void 0)&&(ts={detail:K.label.detail,description:K.label.description}));let Os={label:ri};ts!==void 0&&(Os.labelDetails=ts);let sr=K instanceof wri.default?K:void 0;K.detail&&(Os.detail=K.detail),K.documentation&&(!sr||sr.documentationFormat==="$string"?Os.documentation=K.documentation:Os.documentation=ki(sr.documentationFormat,K.documentation)),K.filterText&&(Os.filterText=K.filterText),gh(Os,K),OL.number(K.kind)&&(Os.kind=Hn(K.kind,sr&&sr.originalItemKind)),K.sortText&&(Os.sortText=K.sortText),K.additionalTextEdits&&(Os.additionalTextEdits=tl(K.additionalTextEdits)),K.commitCharacters&&(Os.commitCharacters=K.commitCharacters.slice()),K.command&&(Os.command=Ca(K.command)),(K.preselect===!0||K.preselect===!1)&&(Os.preselect=K.preselect);const ya=ir(K.tags);if(sr){if(sr.data!==void 0&&(Os.data=sr.data),sr.deprecated===!0||sr.deprecated===!1){if(sr.deprecated===!0&&ya!==void 0&&ya.length>0){const yc=ya.indexOf(Td.CompletionItemTag.Deprecated);yc!==-1&&ya.splice(yc,1)}Os.deprecated=sr.deprecated}sr.insertTextMode!==void 0&&(Os.insertTextMode=sr.insertTextMode)}return ya!==void 0&&ya.length>0&&(Os.tags=ya),Os.insertTextMode===void 0&&K.keepWhitespace===!0&&(Os.insertTextMode=Ms.InsertTextMode.adjustIndentation),Os}function gh(K,Le){let ri=Ms.InsertTextFormat.PlainText,ts,Os;Le.textEdit?(ts=Le.textEdit.newText,Os=Le.textEdit.range):Le.insertText instanceof Td.SnippetString?(ri=Ms.InsertTextFormat.Snippet,ts=Le.insertText.value):ts=Le.insertText,Le.range&&(Os=Le.range),K.insertTextFormat=ri,Le.fromEdit&&ts!==void 0&&Os!==void 0?K.textEdit=Qn(ts,Os):K.insertText=ts}function Qn(K,Le){return xRe.is(Le)?Ms.InsertReplaceEdit.create(K,Oe(Le.inserting),Oe(Le.replacing)):{newText:K,range:Oe(Le)}}function Yh(K){return{range:Oe(K.range),newText:K.newText}}function tl(K){return K==null?K:K.map(Yh)}function Tl(K){return K<=Td.SymbolKind.TypeParameter?K+1:Ms.SymbolKind.Property}function to(K){return K}function Oc(K){return K.map(to)}function rd(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{includeDeclaration:ri.includeDeclaration}}}async function Jh(K,Le){let ri=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(ri.data=K.data),K.kind!==void 0&&(ri.kind=ul(K.kind)),K.diagnostics!==void 0&&(ri.diagnostics=await mr(K.diagnostics,Le)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(ri.command=Ca(K.command)),K.isPreferred!==void 0&&(ri.isPreferred=K.isPreferred),K.disabled!==void 0&&(ri.disabled={reason:K.disabled.reason}),ri}function Af(K){let Le=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(Le.data=K.data),K.kind!==void 0&&(Le.kind=ul(K.kind)),K.diagnostics!==void 0&&(Le.diagnostics=ba(K.diagnostics)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(Le.command=Ca(K.command)),K.isPreferred!==void 0&&(Le.isPreferred=K.isPreferred),K.disabled!==void 0&&(Le.disabled={reason:K.disabled.reason}),Le}async function il(K,Le){if(K==null)return K;let ri;return K.only&&OL.string(K.only.value)&&(ri=[K.only.value]),Ms.CodeActionContext.create(await mr(K.diagnostics,Le),ri,Xh(K.triggerKind))}function Rl(K){if(K==null)return K;let Le;return K.only&&OL.string(K.only.value)&&(Le=[K.only.value]),Ms.CodeActionContext.create(ba(K.diagnostics),Le,Xh(K.triggerKind))}function Xh(K){switch(K){case Td.CodeActionTriggerKind.Invoke:return Ms.CodeActionTriggerKind.Invoked;case Td.CodeActionTriggerKind.Automatic:return Ms.CodeActionTriggerKind.Automatic;default:return}}function ul(K){if(K!=null)return K.value}function ad(K){return K==null?K:Ms.InlineValueContext.create(K.frameId,Oe(K.stoppedLocation))}function wc(K,Le,ri){return{context:Ms.InlineCompletionContext.create(ri.triggerKind,ri.selectedCompletionInfo),textDocument:s(K),position:De(Le)}}function Ca(K){let Le=Ms.Command.create(K.title,K.command);return K.arguments&&(Le.arguments=K.arguments),Le}function Ld(K){let Le=Ms.CodeLens.create(Oe(K.range));return K.command&&(Le.command=Ca(K.command)),K instanceof bri.default&&K.data&&(Le.data=K.data),Le}function fh(K,Le){const ri={tabSize:K.tabSize,insertSpaces:K.insertSpaces};return Le.trimTrailingWhitespace&&(ri.trimTrailingWhitespace=!0),Le.trimFinalNewlines&&(ri.trimFinalNewlines=!0),Le.insertFinalNewline&&(ri.insertFinalNewline=!0),ri}function Fu(K){return{textDocument:s(K)}}function bc(K){return{textDocument:s(K)}}function Zh(K){let Le=Ms.DocumentLink.create(Oe(K.range));K.target&&(Le.target=i(K.target)),K.tooltip!==void 0&&(Le.tooltip=K.tooltip);let ri=K instanceof Cri.default?K:void 0;return ri&&ri.data&&(Le.data=ri.data),Le}function Cc(K){return{textDocument:s(K)}}function nr(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Oc(K.tags)),K instanceof yri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Rs(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Oc(K.tags)),K instanceof Sri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Ml(K){const Le=K instanceof Ari.default?{name:K.name,kind:Tl(K.kind),location:K.hasRange?Nt(K.location):{uri:t(K.location.uri)},data:K.data}:{name:K.name,kind:Tl(K.kind),location:Nt(K.location)};return K.tags!==void 0&&(Le.tags=Oc(K.tags)),K.containerName!==""&&(Le.containerName=K.containerName),Le}function Se(K){const Le=typeof K.label=="string"?K.label:K.label.map(Mo),ri=Ms.InlayHint.create(De(K.position),Le);return K.kind!==void 0&&(ri.kind=K.kind),K.textEdits!==void 0&&(ri.textEdits=tl(K.textEdits)),K.tooltip!==void 0&&(ri.tooltip=cd(K.tooltip)),K.paddingLeft!==void 0&&(ri.paddingLeft=K.paddingLeft),K.paddingRight!==void 0&&(ri.paddingRight=K.paddingRight),K instanceof Eri.default&&K.data!==void 0&&(ri.data=K.data),ri}function Mo(K){const Le=Ms.InlayHintLabelPart.create(K.value);return K.location!==void 0&&(Le.location=Nt(K.location)),K.command!==void 0&&(Le.command=Ca(K.command)),K.tooltip!==void 0&&(Le.tooltip=cd(K.tooltip)),Le}function cd(K){return typeof K=="string"?K:{kind:Ms.MarkupKind.Markdown,value:K.value}}return{asUri:i,asTextDocumentIdentifier:s,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:w,asWillCreateFilesParams:b,asWillRenameFilesParams:C,asWillDeleteFilesParams:y,asTextDocumentPositionParams:S,asCompletionParams:k,asSignatureHelpParams:re,asWorkerPosition:me,asRange:Oe,asRanges:wt,asPosition:De,asPositions:Qe,asPositionsSync:Tt,asLocation:Nt,asDiagnosticSeverity:Ji,asDiagnosticTag:Gn,asDiagnostic:ys,asDiagnostics:mr,asDiagnosticsSync:ba,asCompletionItem:vc,asTextEdit:Yh,asSymbolKind:Tl,asSymbolTag:to,asSymbolTags:Oc,asReferenceParams:rd,asCodeAction:Jh,asCodeActionSync:Af,asCodeActionContext:il,asCodeActionContextSync:Rl,asInlineValueContext:ad,asCommand:Ca,asCodeLens:Ld,asFormattingOptions:fh,asDocumentSymbolParams:Fu,asCodeLensParams:bc,asDocumentLink:Zh,asDocumentLinkParams:Cc,asCallHierarchyItem:nr,asTypeHierarchyItem:Rs,asInlayHint:Se,asWorkspaceSymbol:Ml,asInlineCompletionParams:wc}}Pue.createConverter=xri;var $ue={};Object.defineProperty($ue,"__esModule",{value:!0});$ue.createConverter=void 0;const li=as,Kn=Ts,dv=ea,kr=vu,Dri=Fue,kri=Oue,Iri=Bue,Lri=Wue,gqe=tO,Tri=Hue,Rri=Uue,Mri=Vue,Nri=zue,fqe=Ts;var qre;(function(n){function e(t){let i=t;return i&&dv.string(i.language)&&dv.string(i.value)}n.is=e})(qre||(qre={}));function Pri(n,e,t){const s=n||(L=>li.Uri.parse(L));function o(L){return s(L)}function r(L){const ne=[];for(const R of L)if(typeof R=="string")ne.push(R);else if(fqe.NotebookCellTextDocumentFilter.is(R))if(typeof R.notebook=="string")ne.push({notebookType:R.notebook,language:R.language});else{const H=R.notebook.notebookType??"*";ne.push({notebookType:H,scheme:R.notebook.scheme,pattern:R.notebook.pattern,language:R.language})}else fqe.TextDocumentFilter.is(R)&&ne.push({language:R.language,scheme:R.scheme,pattern:R.pattern});return ne}async function a(L,ne){return kr.map(L,l,ne)}function c(L){const ne=new Array(L.length);for(let R=0;R0?ne:void 0}function u(L){switch(L){case Kn.DiagnosticTag.Unnecessary:return li.DiagnosticTag.Unnecessary;case Kn.DiagnosticTag.Deprecated:return li.DiagnosticTag.Deprecated;default:return}}function f(L){return L?new li.Position(L.line,L.character):void 0}function p(L){return L?new li.Range(L.start.line,L.start.character,L.end.line,L.end.character):void 0}async function m(L,ne){return kr.map(L,R=>new li.Range(R.start.line,R.start.character,R.end.line,R.end.character),ne)}function v(L){if(L==null)return li.DiagnosticSeverity.Error;switch(L){case Kn.DiagnosticSeverity.Error:return li.DiagnosticSeverity.Error;case Kn.DiagnosticSeverity.Warning:return li.DiagnosticSeverity.Warning;case Kn.DiagnosticSeverity.Information:return li.DiagnosticSeverity.Information;case Kn.DiagnosticSeverity.Hint:return li.DiagnosticSeverity.Hint}return li.DiagnosticSeverity.Error}function w(L){if(dv.string(L))return C(L);if(qre.is(L))return C().appendCodeblock(L.value,L.language);if(Array.isArray(L)){let ne=[];for(let R of L){let H=C();qre.is(R)?H.appendCodeblock(R.value,R.language):H.appendMarkdown(R),ne.push(H)}return ne}else return C(L)}function b(L){if(dv.string(L))return L;switch(L.kind){case Kn.MarkupKind.Markdown:return C(L.value);case Kn.MarkupKind.PlainText:return L.value;default:return`Unsupported Markup content received. Kind is: ${L.kind}`}}function C(L){let ne;if(L===void 0||typeof L=="string")ne=new li.MarkdownString(L);else switch(L.kind){case Kn.MarkupKind.Markdown:ne=new li.MarkdownString(L.value);break;case Kn.MarkupKind.PlainText:ne=new li.MarkdownString,ne.appendText(L.value);break;default:ne=new li.MarkdownString,ne.appendText(`Unsupported Markup content received. Kind is: ${L.kind}`);break}return ne.isTrusted=e,ne.supportHtml=t,ne}function y(L){if(L)return new li.Hover(w(L.contents),p(L.range))}async function S(L,ne,R){if(!L)return;if(Array.isArray(L))return kr.map(L,is=>z(is,ne),R);const H=L,{defaultRange:ie,commitCharacters:je}=M(H,ne),pt=await kr.map(H.items,is=>z(is,je,ie,H.itemDefaults?.insertTextMode,H.itemDefaults?.insertTextFormat,H.itemDefaults?.data),R);return new li.CompletionList(pt,H.isIncomplete)}function M(L,ne){const R=L.itemDefaults?.editRange,H=L.itemDefaults?.commitCharacters??ne;return Kn.Range.is(R)?{defaultRange:p(R),commitCharacters:H}:R!==void 0?{defaultRange:{inserting:p(R.insert),replacing:p(R.replace)},commitCharacters:H}:{defaultRange:void 0,commitCharacters:H}}function k(L){return Kn.CompletionItemKind.Text<=L&&L<=Kn.CompletionItemKind.TypeParameter?[L-1,void 0]:[li.CompletionItemKind.Text,L]}function F(L){switch(L){case Kn.CompletionItemTag.Deprecated:return li.CompletionItemTag.Deprecated}}function N(L){if(L==null)return[];const ne=[];for(const R of L){const H=F(R);H!==void 0&&ne.push(H)}return ne}function z(L,ne,R,H,ie,je){const pt=N(L.tags),is=U(L),Ss=new Dri.default(is);L.detail&&(Ss.detail=L.detail),L.documentation&&(Ss.documentation=b(L.documentation),Ss.documentationFormat=dv.string(L.documentation)?"$string":L.documentation.kind),L.filterText&&(Ss.filterText=L.filterText);const ld=J(L,R,ie);if(ld&&(Ss.insertText=ld.text,Ss.range=ld.range,Ss.fromEdit=ld.fromEdit),dv.number(L.kind)){let[Act,NBe]=k(L.kind);Ss.kind=Act,NBe&&(Ss.originalItemKind=NBe)}L.sortText&&(Ss.sortText=L.sortText),L.additionalTextEdits&&(Ss.additionalTextEdits=De(L.additionalTextEdits));const Eg=L.commitCharacters!==void 0?dv.stringArray(L.commitCharacters)?L.commitCharacters:void 0:ne;Eg&&(Ss.commitCharacters=Eg.slice()),L.command&&(Ss.command=tl(L.command)),(L.deprecated===!0||L.deprecated===!1)&&(Ss.deprecated=L.deprecated,L.deprecated===!0&&pt.push(li.CompletionItemTag.Deprecated)),(L.preselect===!0||L.preselect===!1)&&(Ss.preselect=L.preselect);const Bw=L.data??je;Bw!==void 0&&(Ss.data=Bw),pt.length>0&&(Ss.tags=pt);const Cge=L.insertTextMode??H;return Cge!==void 0&&(Ss.insertTextMode=Cge,Cge===Kn.InsertTextMode.asIs&&(Ss.keepWhitespace=!0)),Ss}function U(L){return Kn.CompletionItemLabelDetails.is(L.labelDetails)?{label:L.label,detail:L.labelDetails.detail,description:L.labelDetails.description}:L.label}function J(L,ne,R){const H=L.insertTextFormat??R;if(L.textEdit!==void 0||ne!==void 0){const[ie,je]=L.textEdit!==void 0?j(L.textEdit):[ne,L.textEditText??L.label];return H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(je),range:ie,fromEdit:!0}:{text:je,range:ie,fromEdit:!0}}else return L.insertText?H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(L.insertText),fromEdit:!1}:{text:L.insertText,fromEdit:!1}:void 0}function j(L){return Kn.InsertReplaceEdit.is(L)?[{inserting:p(L.insert),replacing:p(L.replace)},L.newText]:[p(L.range),L.newText]}function re(L){if(L)return new li.TextEdit(p(L.range),L.newText)}async function me(L,ne){if(L)return kr.map(L,re,ne)}function De(L){if(!L)return;const ne=new Array(L.length);for(let R=0;R0){let R=[];for(let H of L.children)R.push(Qn(H));ne.children=R}return ne}function Yh(L,ne){L.tags=Hn(ne.tags),ne.deprecated&&(L.tags?L.tags.includes(li.SymbolTag.Deprecated)||(L.tags=L.tags.concat(li.SymbolTag.Deprecated)):L.tags=[li.SymbolTag.Deprecated])}function tl(L){let ne={title:L.title,command:L.command};return L.arguments&&(ne.arguments=L.arguments),ne}async function Tl(L,ne){if(L)return kr.map(L,tl,ne)}const to=new Map;to.set(Kn.CodeActionKind.Empty,li.CodeActionKind.Empty),to.set(Kn.CodeActionKind.QuickFix,li.CodeActionKind.QuickFix),to.set(Kn.CodeActionKind.Refactor,li.CodeActionKind.Refactor),to.set(Kn.CodeActionKind.RefactorExtract,li.CodeActionKind.RefactorExtract),to.set(Kn.CodeActionKind.RefactorInline,li.CodeActionKind.RefactorInline),to.set(Kn.CodeActionKind.RefactorRewrite,li.CodeActionKind.RefactorRewrite),to.set(Kn.CodeActionKind.Source,li.CodeActionKind.Source),to.set(Kn.CodeActionKind.SourceOrganizeImports,li.CodeActionKind.SourceOrganizeImports);function Oc(L){if(L==null)return;let ne=to.get(L);if(ne)return ne;let R=L.split(".");ne=li.CodeActionKind.Empty;for(let H of R)ne=ne.append(H);return ne}function rd(L){if(L!=null)return L.map(ne=>Oc(ne))}async function Jh(L,ne){if(L==null)return;let R=new Lri.default(L.title,L.data);return L.kind!==void 0&&(R.kind=Oc(L.kind)),L.diagnostics!==void 0&&(R.diagnostics=c(L.diagnostics)),L.edit!==void 0&&(R.edit=await Xh(L.edit,ne)),L.command!==void 0&&(R.command=tl(L.command)),L.isPreferred!==void 0&&(R.isPreferred=L.isPreferred),L.disabled!==void 0&&(R.disabled={reason:L.disabled.reason}),R}function Af(L,ne){return kr.mapAsync(L,async R=>Kn.Command.is(R)?tl(R):Jh(R,ne),ne)}function il(L){if(!L)return;let ne=new kri.default(p(L.range));return L.command&&(ne.command=tl(L.command)),L.data!==void 0&&L.data!==null&&(ne.data=L.data),ne}async function Rl(L,ne){if(L)return kr.map(L,il,ne)}async function Xh(L,ne){if(!L)return;const R=new Map;if(L.changeAnnotations!==void 0){const je=L.changeAnnotations;await kr.forEach(Object.keys(je),pt=>{const is=ul(je[pt]);R.set(pt,is)},ne)}const H=je=>{if(je!==void 0)return R.get(je)},ie=new li.WorkspaceEdit;if(L.documentChanges){const je=L.documentChanges;await kr.forEach(je,pt=>{if(Kn.CreateFile.is(pt))ie.createFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.RenameFile.is(pt))ie.renameFile(s(pt.oldUri),s(pt.newUri),pt.options,H(pt.annotationId));else if(Kn.DeleteFile.is(pt))ie.deleteFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.TextDocumentEdit.is(pt)){const is=s(pt.textDocument.uri);for(const Ss of pt.edits)Kn.AnnotatedTextEdit.is(Ss)?ie.replace(is,p(Ss.range),Ss.newText,H(Ss.annotationId)):ie.replace(is,p(Ss.range),Ss.newText)}else throw new Error(`Unknown workspace edit change received: -${JSON.stringify(pt,void 0,4)}`)},ne)}else if(L.changes){const je=L.changes;await kr.forEach(Object.keys(je),pt=>{ie.set(s(pt),De(je[pt]))},ne)}return ie}function ul(L){if(L!==void 0)return{label:L.label,needsConfirmation:!!L.needsConfirmation,description:L.description}}function ad(L){let ne=p(L.range),R=L.target?o(L.target):void 0,H=new Iri.default(ne,R);return L.tooltip!==void 0&&(H.tooltip=L.tooltip),L.data!==void 0&&L.data!==null&&(H.data=L.data),H}async function wc(L,ne){if(L)return kr.map(L,ad,ne)}function Ca(L){return new li.Color(L.red,L.green,L.blue,L.alpha)}function Ld(L){return new li.ColorInformation(p(L.range),Ca(L.color))}async function fh(L,ne){if(L)return kr.map(L,Ld,ne)}function Fu(L){let ne=new li.ColorPresentation(L.label);return ne.additionalTextEdits=De(L.additionalTextEdits),L.textEdit&&(ne.textEdit=re(L.textEdit)),ne}async function bc(L,ne){if(L)return kr.map(L,Fu,ne)}function Zh(L){if(L)switch(L){case Kn.FoldingRangeKind.Comment:return li.FoldingRangeKind.Comment;case Kn.FoldingRangeKind.Imports:return li.FoldingRangeKind.Imports;case Kn.FoldingRangeKind.Region:return li.FoldingRangeKind.Region}}function Cc(L){return new li.FoldingRange(L.startLine,L.endLine,Zh(L.kind))}async function nr(L,ne){if(L)return kr.map(L,Cc,ne)}function Rs(L){return new li.SelectionRange(p(L.range),L.parent?Rs(L.parent):void 0)}async function Ml(L,ne){return Array.isArray(L)?kr.map(L,Rs,ne):[]}function Se(L){return Kn.InlineValueText.is(L)?new li.InlineValueText(p(L.range),L.text):Kn.InlineValueVariableLookup.is(L)?new li.InlineValueVariableLookup(p(L.range),L.variableName,L.caseSensitiveLookup):new li.InlineValueEvaluatableExpression(p(L.range),L.expression)}async function Mo(L,ne){return Array.isArray(L)?kr.map(L,Se,ne):[]}async function cd(L,ne){const R=typeof L.label=="string"?L.label:await kr.map(L.label,K,ne),H=new Nri.default(f(L.position),R);return L.kind!==void 0&&(H.kind=L.kind),L.textEdits!==void 0&&(H.textEdits=await me(L.textEdits,ne)),L.tooltip!==void 0&&(H.tooltip=Le(L.tooltip)),L.paddingLeft!==void 0&&(H.paddingLeft=L.paddingLeft),L.paddingRight!==void 0&&(H.paddingRight=L.paddingRight),L.data!==void 0&&(H.data=L.data),H}function K(L){const ne=new li.InlayHintLabelPart(L.value);return L.location!==void 0&&(ne.location=Ji(L.location)),L.tooltip!==void 0&&(ne.tooltip=Le(L.tooltip)),L.command!==void 0&&(ne.command=tl(L.command)),ne}function Le(L){return typeof L=="string"?L:C(L)}async function ri(L,ne){if(Array.isArray(L))return kr.mapAsync(L,cd,ne)}function ts(L){if(L===null)return;const ne=new Tri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Os(L,ne){if(L!==null)return kr.map(L,ts,ne)}async function sr(L,ne){return new li.CallHierarchyIncomingCall(ts(L.from),await m(L.fromRanges,ne))}async function ya(L,ne){if(L!==null)return kr.mapAsync(L,sr,ne)}async function yc(L,ne){return new li.CallHierarchyOutgoingCall(ts(L.to),await m(L.fromRanges,ne))}async function Ou(L,ne){if(L!==null)return kr.mapAsync(L,yc,ne)}async function le(L,ne){if(L!=null)return new li.SemanticTokens(new Uint32Array(L.data),L.resultId)}function _r(L){return new li.SemanticTokensEdit(L.start,L.deleteCount,L.data!==void 0?new Uint32Array(L.data):void 0)}async function No(L,ne){if(L!=null)return new li.SemanticTokensEdits(L.edits.map(_r),L.resultId)}function mn(L){return L}async function ve(L,ne){if(L!=null)return new li.LinkedEditingRanges(await m(L.ranges,ne),ct(L.wordPattern))}function ct(L){if(L!=null)return new RegExp(L)}function Ht(L){if(L===null)return;let ne=new Rri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Ei(L,ne){if(L!==null)return kr.map(L,Ht,ne)}function Ut(L){if(dv.string(L))return L;if(Kn.RelativePattern.is(L)){if(Kn.URI.is(L.baseUri))return new li.RelativePattern(o(L.baseUri),L.pattern);if(Kn.WorkspaceFolder.is(L.baseUri)){const ne=li.workspace.getWorkspaceFolder(o(L.baseUri.uri));return ne!==void 0?new li.RelativePattern(ne,L.pattern):void 0}}}async function G(L,ne){if(!L)return;if(Array.isArray(L))return kr.map(L,ie=>de(ie),ne);const R=L,H=await kr.map(R.items,ie=>de(ie),ne);return new li.InlineCompletionList(H)}function de(L){let ne;typeof L.insertText=="string"?ne=L.insertText:ne=new li.SnippetString(L.insertText.value);let R;L.command&&(R=tl(L.command));const H=new li.InlineCompletionItem(ne,p(L.range),R);return L.filterText&&(H.filterText=L.filterText),H}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:y,asCompletionResult:S,asCompletionItem:z,asTextEdit:re,asTextEdits:me,asSignatureHelp:Qe,asSignatureInformations:Tt,asSignatureInformation:Oe,asParameterInformations:wt,asParameterInformation:Nt,asDeclarationResult:zi,asDefinitionResult:Gn,asLocation:Ji,asReferences:tc,asDocumentHighlights:ys,asDocumentHighlight:mr,asDocumentHighlightKind:ba,asSymbolKind:gs,asSymbolTag:ir,asSymbolTags:Hn,asSymbolInformations:ki,asSymbolInformation:vc,asDocumentSymbols:gh,asDocumentSymbol:Qn,asCommand:tl,asCommands:Tl,asCodeAction:Jh,asCodeActionKind:Oc,asCodeActionKinds:rd,asCodeActionResult:Af,asCodeLens:il,asCodeLenses:Rl,asWorkspaceEdit:Xh,asDocumentLink:ad,asDocumentLinks:wc,asFoldingRangeKind:Zh,asFoldingRange:Cc,asFoldingRanges:nr,asColor:Ca,asColorInformation:Ld,asColorInformations:fh,asColorPresentation:Fu,asColorPresentations:bc,asSelectionRange:Rs,asSelectionRanges:Ml,asInlineValue:Se,asInlineValues:Mo,asInlayHint:cd,asInlayHints:ri,asSemanticTokensLegend:mn,asSemanticTokens:le,asSemanticTokensEdit:_r,asSemanticTokensEdits:No,asCallHierarchyItem:ts,asCallHierarchyItems:Os,asCallHierarchyIncomingCall:sr,asCallHierarchyIncomingCalls:ya,asCallHierarchyOutgoingCall:yc,asCallHierarchyOutgoingCalls:Ou,asLinkedEditingRanges:ve,asTypeHierarchyItem:Ht,asTypeHierarchyItems:Ei,asGlobPattern:Ut,asInlineCompletionResult:G,asInlineCompletionItem:de}}$ue.createConverter=Pri;var dj={};Object.defineProperty(dj,"__esModule",{value:!0});dj.ProgressPart=void 0;const pqe=as,mqe=Ts,_qe=ea;class Fri{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(mqe.WorkDoneProgress.type,this._token,s=>{switch(s.kind){case"begin":this.begin(s);break;case"report":this.report(s);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&pqe.window.withProgress({location:pqe.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,i)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=i,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(mqe.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((s,o)=>{this._resolve=s,this._reject=o})})}report(e){if(this._infinite&&_qe.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(_qe.number(e.percentage)){const t=Math.max(0,Math.min(e.percentage,100)),i=Math.max(0,t-this._reported);this._reported+=i,this._progress!==void 0&&this._progress.report({message:e.message,increment:i})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}}dj.ProgressPart=Fri;var Gue={};Object.defineProperty(Gue,"__esModule",{value:!0});Gue.NotebookDocumentSyncFeature=void 0;const Og=as,Ori=Mue,qE=Ts,Bri=Er,vqe=ea;function wqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}var T2;(function(n){(function(e){function t(h,u){return{version:h.version,uri:u.asUri(h.uri)}}e.asVersionedNotebookDocumentIdentifier=t;function i(h,u,f){const p=qE.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,s(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function s(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=s;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=qE.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=o(h.metadata)),h.executionSummary!==void 0&&vqe.number(h.executionSummary.executionOrder)&&vqe.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case Og.NotebookCellKind.Markup:return qE.NotebookCellKind.Markup;case Og.NotebookCellKind.Code:return qE.NotebookCellKind.Code}}function c(h,u){if(h.has(u))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(u)){const f=[];for(const p of u)if(p!==null&&typeof p=="object"||Array.isArray(p))f.push(c(h,p));else{if(p instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");f.push(p)}return f}else{const f=Object.keys(u),p=Object.create(null);for(const m of f){const v=u[m];if(v!==null&&typeof v=="object"||Array.isArray(v))p[m]=c(h,v);else{if(v instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");p[m]=v}}return p}}function l(h,u){const f=u.asChangeTextDocumentParams(h,h.document.uri,h.document.version);return{document:f.textDocument,changes:f.contentChanges}}e.asTextContentChange=l;function d(h,u){const f=Object.create(null);if(h.metadata&&(f.metadata=n.c2p.asMetadata(h.metadata)),h.cells!==void 0){const p=Object.create(null),m=h.cells;m.structure&&(p.structure={array:{start:m.structure.array.start,deleteCount:m.structure.array.deleteCount,cells:m.structure.array.cells!==void 0?m.structure.array.cells.map(v=>n.c2p.asNotebookCell(v,u)):void 0},didOpen:m.structure.didOpen!==void 0?m.structure.didOpen.map(v=>u.asOpenTextDocumentParams(v.document).textDocument):void 0,didClose:m.structure.didClose!==void 0?m.structure.didClose.map(v=>u.asCloseTextDocumentParams(v.document).textDocument):void 0}),m.data!==void 0&&(p.data=m.data.map(v=>n.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>n.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(n.c2p||(n.c2p={}))})(T2||(T2={}));var DRe;(function(n){function e(a,c,l){const d=a.length,h=c.length;let u=0;for(;u=0&&p>=0&&t(a[f],c[p],l);)f--,p--;const m=f+1-u,v=u===p+1?void 0:c.slice(u,p+1);return v!==void 0?{start:u,deleteCount:m,cells:v}:{start:u,deleteCount:m}}else return ui.document.uri.toString()))}}n.create=e})(jre||(jre={}));class IY{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)),Og.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of Og.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);Og.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&Og.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),Og.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of Og.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return Og.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(Og.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),s=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(s&&o||!s&&!o)return;if(s){const r=this.getMatchingCells(e);if(r!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,r);a!==void 0&&this.doSendChange(a,r).catch(()=>{})}}}else s&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){Og.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){const i=this.notebookSyncInfo.get(e.uri.toString());if(i===void 0)return;const s=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===s.toString());if(o!==-1)if(o===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const r=i.cells.slice(),a=r.splice(o,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:o,deleteCount:1},didClose:a}}},r).catch(()=>{})}}dispose(){for(const e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),i=this.notebookSyncInfo.get(e.uri.toString())){if(i!==void 0)if(t!==void 0){const s=this.asNotebookDocumentChangeEvent(e,void 0,i,t);s!==void 0&&this.doSendChange(s,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){const t=e.notebook,i=this.notebookSyncInfo.get(t.uri.toString());if(i===void 0){if(e.contentChanges.length===0)return;const s=this.getMatchingCells(t);if(s===void 0)return;this.didOpen(t,s,i)}else{const s=this.getMatchingCells(t);if(s===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,s);o!==void 0&&this.doSendChange(o,s).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;const i=e.getCells().filter(s=>t.uris.has(s.document.uri.toString()));this.doSendClose(e,i).catch(()=>{})}async sendDidOpenNotebookDocument(e){const t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){const i=async(o,r)=>{const a=T2.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(qE.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),jre.create(t)),s?.didOpen!==void 0?s.didOpen(e,t,i):i(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){const i=async o=>{try{await this.client.sendNotification(qE.DidChangeNotebookDocumentNotification.type,{notebookDocument:T2.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:T2.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},s=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),jre.create(t??[])),s?.didChange!==void 0?s?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async s=>{try{await this.client.sendNotification(qE.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(s.uri)}})}catch(o){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",o),o}},i=this.client.middleware?.notebooks;return i?.didSave!==void 0?i.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){const i=async(o,r)=>{try{await this.client.sendNotification(qE.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(o.uri)},cellTextDocuments:r.map(a=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(a.document))})}catch(a){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",a),a}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),s?.didClose!==void 0?s.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,s){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=T2.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(s.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)r.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(o.cells=o.cells??{},o.cells.data=a)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&i!==void 0&&s!==void 0){const a=i.cells,c=s,l=DRe.computeDiff(a,c,!1);let d,h;if(l!==void 0){d=l.cells===void 0?new Map:new Map(l.cells.map(p=>[p.document.uri.toString(),p])),h=l.deleteCount===0?new Map:new Map(a.slice(l.start,l.start+l.deleteCount).map(p=>[p.document.uri.toString(),p]));for(const p of Array.from(h.keys()))d.has(p)&&(h.delete(p),d.delete(p));o.cells=o.cells??{};const u=[],f=[];if(d.size>0||h.size>0){for(const p of d.values())u.push(p);for(const p of h.values())f.push(p)}o.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(o).length>1?o:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(const i of this.options.notebookSelector)if(i.notebook===void 0||kRe.matchNotebook(i.notebook,e)){const s=this.filterCells(e,t,i.cells);return s.length===0?void 0:s}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const s=i!==void 0?t.filter(o=>{const r=o.document.languageId;return i.some(a=>a.language==="*"||r===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,s):s}}class FR{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=qE.NotebookDocumentSyncRegistrationType.type,Og.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didOpenNotebookCellTextDocument(i,s)}),Og.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==FR.CellScheme)return;const[s]=this.findNotebookDocumentAndCell(i);if(s!==void 0)for(const o of this.registrations.values())o instanceof IY&&o.didChangeNotebookCellTextDocument(s,t)}),Og.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didCloseNotebookCellTextDocument(i,s)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(const e of this.registrations.values()){const t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){const t=wqe(wqe(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??Bri.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new IY(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){const t=this.registrations.get(e);t&&t.dispose()}clear(){for(const e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==FR.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&Og.languages.match(this.dedicatedChannel,e)>0)return!0;for(const t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(const t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){const t=e.uri.toString();for(const i of Og.workspace.notebookDocuments)for(const s of i.getCells())if(s.document.uri.toString()===t)return[i,s];return[void 0,void 0]}}Gue.NotebookDocumentSyncFeature=FR;FR.CellScheme="vscode-notebook-cell";var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.SyncConfigurationFeature=n0.toJSONObject=n0.ConfigurationFeature=void 0;const dH=as,e$=Ts,Wri=ea,Hri=Er,bqe=$n;class Uri{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(e$.ConfigurationRequest.type,(t,i)=>{let s=r=>{let a=[];for(let c of r.items){let l=c.scopeUri!==void 0&&c.scopeUri!==null?this._client.protocol2CodeConverter.asUri(c.scopeUri):void 0;a.push(this.getConfiguration(l,c.section!==null?c.section:void 0))}return a},o=e.middleware.workspace;return o&&o.configuration?o.configuration(t,i,s):s(t)})}getConfiguration(e,t){let i=null;if(t){let s=t.lastIndexOf(".");if(s===-1)i=JM(dH.workspace.getConfiguration(void 0,e).get(t));else{let o=dH.workspace.getConfiguration(t.substr(0,s),e);o&&(i=JM(o.get(t.substr(s+1))))}}else{let s=dH.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(s))s.has(o)&&(i[o]=JM(s.get(o)))}return i===void 0&&(i=null),i}clear(){}}n0.ConfigurationFeature=Uri;function JM(n){if(n){if(Array.isArray(n))return n.map(JM);if(typeof n=="object"){const e=Object.create(null);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=JM(n[t]));return e}}return n}n0.toJSONObject=JM;class Vri{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return e$.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,bqe.ensure)((0,bqe.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Hri.generateUuid(),registerOptions:{section:e}})}register(e){let t=dH.workspace.onDidChangeConfiguration(i=>{this.onDidChangeConfiguration(e.registerOptions.section,i)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(const e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let i;if(Wri.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const s=async r=>r===void 0?this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,s):s(i)).catch(r=>{this._client.error(`Sending notification ${e$.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=dH.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=dH.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(s,l)[l[l.length-1]]=JM(c)}}return s}}n0.SyncConfigurationFeature=Vri;var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.DidSaveTextDocumentFeature=tm.WillSaveWaitUntilFeature=tm.WillSaveFeature=tm.DidChangeTextDocumentFeature=tm.DidCloseTextDocumentFeature=tm.DidOpenTextDocumentFeature=void 0;const f_=as,ac=Ts,Al=$n,Xz=Er;class zri extends Al.TextDocumentEventFeature{constructor(e,t){super(e,f_.workspace.onDidOpenTextDocument,ac.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return ac.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);f_.workspace.textDocuments.forEach(i=>{const s=i.uri.toString();if(!this._syncedDocuments.has(s)&&f_.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));(o.didOpen?o.didOpen(i,r):r(i)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)}),this._syncedDocuments.set(s,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}tm.DidOpenTextDocumentFeature=zri;class $ri extends Al.TextDocumentEventFeature{constructor(e,t,i){super(e,f_.workspace.onDidCloseTextDocument,ac.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,s=>e.code2ProtocolConverter.asCloseTextDocumentParams(s),s=>s,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return ac.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,i)}unregister(e){const t=this._selectors.get(e);super.unregister(e);const i=this._selectors.values();this._syncedDocuments.forEach(s=>{if(f_.languages.match(t,s)>0&&!this._selectorFilter(i,s)&&!this._client.hasDedicatedTextSynchronizationFeature(s)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(s.uri.toString()),(o.didClose?o.didClose(s,r):r(s)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}tm.DidCloseTextDocumentFeature=$ri;class Gri extends Al.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new f_.EventEmitter,this._onPendingChangeAdded=new f_.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=ac.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return ac.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==ac.TextDocumentSyncKind.None&&this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=f_.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(const e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;const t=e.document.uri,i=e.document.version,s=[];for(const o of this._changeData.values())if(f_.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===ac.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(ac.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,ac.DidChangeTextDocumentNotification.type,l)};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===ac.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(s).then(void 0,o=>{throw this._client.error(`Sending document notification ${ac.DidChangeTextDocumentNotification.type.method} failed`,o),o})}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=ac.TextDocumentSyncKind.None;else{this._syncKind=ac.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===ac.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=ac.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(const i of this._pendingTextDocumentChanges)e.has(i[0])||(t.push(i[1]),this._pendingTextDocumentChanges.delete(i[0]))}return t}getProvider(e){for(const t of this._changeData.values())if(f_.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==ac.TextDocumentSyncKind.Full)switch(e){case ac.TextDocumentSyncKind.Full:this._syncKind=e;break;case ac.TextDocumentSyncKind.Incremental:this._syncKind===ac.TextDocumentSyncKind.None&&(this._syncKind=ac.TextDocumentSyncKind.Incremental);break}}}tm.DidChangeTextDocumentFeature=Gri;class qri extends Al.TextDocumentEventFeature{constructor(e){super(e,f_.workspace.onWillSaveTextDocument,ac.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Al.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return ac.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}tm.WillSaveFeature=qri;class Qri extends Al.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return ac.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=f_.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Al.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=s=>this._client.sendRequest(ac.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(s)).then(async o=>{let r=await this._client.protocol2CodeConverter.asTextEdits(o);return r===void 0?[]:r});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}}tm.WillSaveWaitUntilFeature=Qri;class jri extends Al.TextDocumentEventFeature{constructor(e){super(e,f_.workspace.onDidSaveTextDocument,ac.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Al.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return ac.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const s=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},s)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}tm.DidSaveTextDocumentFeature=jri;var que={};Object.defineProperty(que,"__esModule",{value:!0});que.CompletionItemFeature=void 0;const Kri=as,Go=Ts,Pme=$n,Yri=Er,Jri=[Go.CompletionItemKind.Text,Go.CompletionItemKind.Method,Go.CompletionItemKind.Function,Go.CompletionItemKind.Constructor,Go.CompletionItemKind.Field,Go.CompletionItemKind.Variable,Go.CompletionItemKind.Class,Go.CompletionItemKind.Interface,Go.CompletionItemKind.Module,Go.CompletionItemKind.Property,Go.CompletionItemKind.Unit,Go.CompletionItemKind.Value,Go.CompletionItemKind.Enum,Go.CompletionItemKind.Keyword,Go.CompletionItemKind.Snippet,Go.CompletionItemKind.Color,Go.CompletionItemKind.File,Go.CompletionItemKind.Reference,Go.CompletionItemKind.Folder,Go.CompletionItemKind.EnumMember,Go.CompletionItemKind.Constant,Go.CompletionItemKind.Struct,Go.CompletionItemKind.Event,Go.CompletionItemKind.Operator,Go.CompletionItemKind.TypeParameter];class Xri extends Pme.TextDocumentLanguageFeature{constructor(e){super(e,Go.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Pme.ensure)((0,Pme.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[Go.MarkupKind.Markdown,Go.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[Go.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[Go.InsertTextMode.asIs,Go.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=Go.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Jri},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:Yri.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],s=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,w)=>h.sendRequest(Go.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),w).then(b=>w.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(b,s,w),b=>h.handleFailedRequest(Go.CompletionRequest.type,w,b,null));return u.provideCompletionItem?u.provideCompletionItem(a,c,d,l,f):f(a,c,d,l)},resolveCompletionItem:e.resolveProvider?(a,c)=>{const l=this._client,d=this._client.middleware,h=(u,f)=>l.sendRequest(Go.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(Go.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[Kri.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}que.CompletionItemFeature=Xri;var Que={};Object.defineProperty(Que,"__esModule",{value:!0});Que.HoverFeature=void 0;const Zri=as,K5=Ts,Fme=$n,eai=Er;class tai extends Fme.TextDocumentLanguageFeature{constructor(e){super(e,K5.HoverRequest.type)}fillClientCapabilities(e){const t=(0,Fme.ensure)((0,Fme.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[K5.MarkupKind.Markdown,K5.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:eai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(K5.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(K5.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Zri.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Que.HoverFeature=tai;var jue={};Object.defineProperty(jue,"__esModule",{value:!0});jue.DefinitionFeature=void 0;const iai=as,Ome=Ts,Bme=$n,nai=Er;class sai extends Bme.TextDocumentLanguageFeature{constructor(e){super(e,Ome.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Bme.ensure)((0,Bme.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:nai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Ome.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Ome.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return iai.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}jue.DefinitionFeature=sai;var Kue={};Object.defineProperty(Kue,"__esModule",{value:!0});Kue.SignatureHelpFeature=void 0;const Cqe=as,Y5=Ts,Wme=$n,oai=Er;class rai extends Wme.TextDocumentLanguageFeature{constructor(e){super(e,Y5.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Wme.ensure)((0,Wme.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[Y5.MarkupKind.Markdown,Y5.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.signatureHelpProvider);i&&this.register({id:oai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,s,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(Y5.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(Y5.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,s,r,o,c):c(i,s,r,o)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){const i=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){const s=e.triggerCharacters||[];return Cqe.languages.registerSignatureHelpProvider(i,t,...s)}else{const s={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return Cqe.languages.registerSignatureHelpProvider(i,t,s)}}}Kue.SignatureHelpFeature=rai;var Yue={};Object.defineProperty(Yue,"__esModule",{value:!0});Yue.DocumentHighlightFeature=void 0;const aai=as,Hme=Ts,Ume=$n,cai=Er;class lai extends Ume.TextDocumentLanguageFeature{constructor(e){super(e,Hme.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Ume.ensure)((0,Ume.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:cai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Hme.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(Hme.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(s,o,r,c):c(s,o,r)}};return[aai.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Yue.DocumentHighlightFeature=lai;var pBe={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DocumentSymbolFeature=n.SupportedSymbolTags=n.SupportedSymbolKinds=void 0;const e=as,t=Ts,i=$n,s=Er;n.SupportedSymbolKinds=[t.SymbolKind.File,t.SymbolKind.Module,t.SymbolKind.Namespace,t.SymbolKind.Package,t.SymbolKind.Class,t.SymbolKind.Method,t.SymbolKind.Property,t.SymbolKind.Field,t.SymbolKind.Constructor,t.SymbolKind.Enum,t.SymbolKind.Interface,t.SymbolKind.Function,t.SymbolKind.Variable,t.SymbolKind.Constant,t.SymbolKind.String,t.SymbolKind.Number,t.SymbolKind.Boolean,t.SymbolKind.Array,t.SymbolKind.Object,t.SymbolKind.Key,t.SymbolKind.Null,t.SymbolKind.EnumMember,t.SymbolKind.Struct,t.SymbolKind.Event,t.SymbolKind.Operator,t.SymbolKind.TypeParameter],n.SupportedSymbolTags=[t.SymbolTag.Deprecated];class o extends i.TextDocumentLanguageFeature{constructor(a){super(a,t.DocumentSymbolRequest.type)}fillClientCapabilities(a){let c=(0,i.ensure)((0,i.ensure)(a,"textDocument"),"documentSymbol");c.dynamicRegistration=!0,c.symbolKind={valueSet:n.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:n.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:s.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,w)=>{try{const b=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),w);if(w.isCancellationRequested||b===void 0||b===null)return null;if(b.length===0)return[];{const C=b[0];return t.DocumentSymbol.is(C)?await f.protocol2CodeConverter.asDocumentSymbols(b,w):await f.protocol2CodeConverter.asSymbolInformations(b,w)}}catch(b){return f.handleFailedRequest(t.DocumentSymbolRequest.type,w,b,null)}},m=f.middleware;return m.provideDocumentSymbols?m.provideDocumentSymbols(h,u,p):p(h,u)}},d=a.label!==void 0?{label:a.label}:void 0;return[e.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(c),l,d),l]}}n.DocumentSymbolFeature=o})(pBe);var Jue={};Object.defineProperty(Jue,"__esModule",{value:!0});Jue.WorkspaceSymbolFeature=void 0;const dai=as,J5=Ts,Vme=$n,yqe=pBe,hai=Er;class uai extends Vme.WorkspaceFeature{constructor(e){super(e,J5.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Vme.ensure)((0,Vme.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:yqe.SupportedSymbolKinds},t.tagSupport={valueSet:yqe.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:hai.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(J5.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,s,r):r(i,s)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(J5.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,s,r):r(i,s)}:void 0};return[dai.languages.registerWorkspaceSymbolProvider(t),t]}}Jue.WorkspaceSymbolFeature=uai;var Xue={};Object.defineProperty(Xue,"__esModule",{value:!0});Xue.ReferencesFeature=void 0;const gai=as,zme=Ts,$me=$n,fai=Er;class pai extends $me.TextDocumentLanguageFeature{constructor(e){super(e,zme.ReferencesRequest.type)}fillClientCapabilities(e){(0,$me.ensure)((0,$me.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:fai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(zme.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(zme.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(s,o,r,a,l):l(s,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return gai.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Xue.ReferencesFeature=pai;var Zue={};Object.defineProperty(Zue,"__esModule",{value:!0});Zue.CodeActionFeature=void 0;const mai=as,Hm=Ts,_ai=Er,Gme=$n;class vai extends Gme.TextDocumentLanguageFeature{constructor(e){super(e,Hm.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,Gme.ensure)((0,Gme.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Hm.CodeActionKind.Empty,Hm.CodeActionKind.QuickFix,Hm.CodeActionKind.Refactor,Hm.CodeActionKind.RefactorExtract,Hm.CodeActionKind.RefactorInline,Hm.CodeActionKind.RefactorRewrite,Hm.CodeActionKind.Source,Hm.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:_ai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(s,o,r,a)=>{const c=this._client,l=async(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),context:c.code2ProtocolConverter.asCodeActionContextSync(f)};return c.sendRequest(Hm.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Hm.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(s,o,r,a,l):l(s,o,r,a)},resolveCodeAction:e.resolveProvider?(s,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(Hm.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(Hm.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(s,o,c):c(s,o)}:void 0};return[mai.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}Zue.CodeActionFeature=vai;var ege={};Object.defineProperty(ege,"__esModule",{value:!0});ege.CodeLensFeature=void 0;const Sqe=as,hB=Ts,wai=Er,X5=$n;class bai extends X5.TextDocumentLanguageFeature{constructor(e){super(e,hB.CodeLensRequest.type)}fillClientCapabilities(e){(0,X5.ensure)((0,X5.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,X5.ensure)((0,X5.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(hB.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const s=this.getRegistrationOptions(t,e.codeLensProvider);s&&this.register({id:wai.generateUuid(),registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Sqe.EventEmitter,s={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(hB.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(o,r,c):c(o,r)},resolveCodeLens:e.resolveProvider?(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(hB.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[Sqe.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeCodeLensEmitter:i}]}}ege.CodeLensFeature=bai;var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.DocumentOnTypeFormattingFeature=s0.DocumentRangeFormattingFeature=s0.DocumentFormattingFeature=void 0;const tge=as,Rb=Ts,mBe=Er,Lx=$n;var sz;(function(n){function e(t){const i=tge.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}n.fromConfiguration=e})(sz||(sz={}));class Cai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,sz.fromConfiguration(d))};return a.sendRequest(Rb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(Rb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(s,o,r,c):c(s,o,r)}};return[tge.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentFormattingFeature=Cai;class yai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(s,o,r,a,l):l(s,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:c.code2ProtocolConverter.asRanges(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(s,o,r,a,l):l(s,o,r,a)}),[tge.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentRangeFormattingFeature=yai;class Sai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(o,r,a,c,l)=>{const d=this._client,h=(f,p,m,v,w)=>{let b={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,sz.fromConfiguration(f))};return d.sendRequest(Rb.DocumentOnTypeFormattingRequest.type,b,w).then(C=>w.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(C,w),C=>d.handleFailedRequest(Rb.DocumentOnTypeFormattingRequest.type,w,C,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},s=e.moreTriggerCharacter||[];return[tge.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...s),i]}}s0.DocumentOnTypeFormattingFeature=Sai;var ige={};Object.defineProperty(ige,"__esModule",{value:!0});ige.RenameFeature=void 0;const Aai=as,BL=Ts,Eai=Er,Aqe=ea,qme=$n;class xai extends qme.TextDocumentLanguageFeature{constructor(e){super(e,BL.RenameRequest.type)}fillClientCapabilities(e){let t=(0,qme.ensure)((0,qme.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=BL.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(Aqe.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Eai.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{let m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),position:c.code2ProtocolConverter.asPosition(u),newName:f};return c.sendRequest(BL.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(BL.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(s,o,r,a,l):l(s,o,r,a)},prepareRename:e.prepareProvider?(s,o,r)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(BL.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:BL.Range.is(p)?a.protocol2CodeConverter.asRange(p):this.isDefaultBehavior(p)?p.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):p&&BL.Range.is(p.range)?{range:a.protocol2CodeConverter.asRange(p.range),placeholder:p.placeholder}:Promise.reject(new Error("The element can't be renamed.")),p=>{throw typeof p.message=="string"?new Error(p.message):new Error("The element can't be renamed.")})},l=a.middleware;return l.prepareRename?l.prepareRename(s,o,r,c):c(s,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Aai.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&Aqe.boolean(t.defaultBehavior)}}ige.RenameFeature=xai;var nge={};Object.defineProperty(nge,"__esModule",{value:!0});nge.DocumentLinkFeature=void 0;const Dai=as,Z5=Ts,Qme=$n,kai=Er;class Iai extends Qme.TextDocumentLanguageFeature{constructor(e){super(e,Z5.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,Qme.ensure)((0,Qme.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:kai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(s,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(Z5.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(Z5.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(s,o,a):a(s,o)},resolveDocumentLink:e.resolveProvider?(s,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(Z5.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(Z5.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(s,o,a):a(s,o)}:void 0};return[Dai.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}nge.DocumentLinkFeature=Iai;var sge={};Object.defineProperty(sge,"__esModule",{value:!0});sge.ExecuteCommandFeature=void 0;const Lai=as,jme=Ts,Tai=Er,Eqe=$n;class Rai{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return jme.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Eqe.ensure)((0,Eqe.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Tai.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,s=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(jme.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(jme.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Lai.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,s):s(r,a)));this._commands.set(e.id,o)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}}sge.ExecuteCommandFeature=Rai;var oge={};Object.defineProperty(oge,"__esModule",{value:!0});oge.FileSystemWatcherFeature=void 0;const Mai=as,WL=Ts,LY=$n;class Nai{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return WL.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;const t=[];for(const i of e.registerOptions.watchers){const s=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(s===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&WL.WatchKind.Create)!==0,r=(i.kind&WL.WatchKind.Change)!==0,a=(i.kind&WL.WatchKind.Delete)!==0);const c=Mai.workspace.createFileSystemWatcher(s,!o,!r,!a);this.hookListeners(c,o,r,a,t),t.push(c)}this._watchers.set(e.id,t)}registerRaw(e,t){let i=[];for(let s of t)this.hookListeners(s,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,s,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Changed}),null,o),s&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}oge.FileSystemWatcherFeature=Nai;var rge={};Object.defineProperty(rge,"__esModule",{value:!0});rge.ColorProviderFeature=void 0;const Pai=as,e3=Ts,Kme=$n;class Fai extends Kme.TextDocumentLanguageFeature{constructor(e){super(e,e3.DocumentColorRequest.type)}fillClientCapabilities(e){(0,Kme.ensure)((0,Kme.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.colorProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={color:d,textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:a.code2ProtocolConverter.asRange(h.range)};return a.sendRequest(e3.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(e3.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(s,o,r,c):c(s,o,r)},provideDocumentColors:(s,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(e3.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(e3.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(s,o,a):a(s,o)}};return[Pai.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}rge.ColorProviderFeature=Fai;var age={};Object.defineProperty(age,"__esModule",{value:!0});age.ImplementationFeature=void 0;const Oai=as,Yme=Ts,Jme=$n;class Bai extends Jme.TextDocumentLanguageFeature{constructor(e){super(e,Yme.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Jme.ensure)((0,Jme.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.implementationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Yme.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Yme.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Oai.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}age.ImplementationFeature=Bai;var cge={};Object.defineProperty(cge,"__esModule",{value:!0});cge.TypeDefinitionFeature=void 0;const Wai=as,Xme=Ts,t3=$n;class Hai extends t3.TextDocumentLanguageFeature{constructor(e){super(e,Xme.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.typeDefinitionProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Xme.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Xme.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Wai.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}cge.TypeDefinitionFeature=Hai;var oz={};Object.defineProperty(oz,"__esModule",{value:!0});oz.WorkspaceFoldersFeature=oz.arrayDiff=void 0;const Uai=Er,TY=as,i3=Ts;function Zme(n,e){if(n!=null)return n[e]}function IRe(n,e){return n.filter(t=>e.indexOf(t)<0)}oz.arrayDiff=IRe;class Vai{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return i3.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=TY.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){const t=this._client;t.onRequest(i3.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=TY.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(o,r):r()});const i=Zme(Zme(Zme(e,"workspace"),"workspaceFolders"),"changeNotifications");let s;typeof i=="string"?s=i:i===!0&&(s=Uai.generateUuid()),s&&this.register({id:s,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=IRe(this._initialFolders,e),s=IRe(e,this._initialFolders);(s.length>0||i.length>0)&&(t=this.doSendEvent(s,i))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(i=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(s=>this.asProtocol(s)),removed:t.map(s=>this.asProtocol(s))}};return this._client.sendNotification(i3.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,s=TY.workspace.onDidChangeWorkspaceFolders(o=>{let r=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(o,r):r(o)).catch(l=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,s),this.sendInitialEvent(TY.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}oz.WorkspaceFoldersFeature=Vai;var lge={};Object.defineProperty(lge,"__esModule",{value:!0});lge.FoldingRangeFeature=void 0;const xqe=as,HL=Ts,n3=$n;class zai extends n3.TextDocumentLanguageFeature{constructor(e){super(e,HL.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,n3.ensure)((0,n3.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[HL.FoldingRangeKind.Comment,HL.FoldingRangeKind.Imports,HL.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,n3.ensure)((0,n3.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(HL.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,s]=this.getRegistration(t,e.foldingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new xqe.EventEmitter,s={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(o,r,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(HL.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(HL.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[xqe.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeFoldingRange:i}]}}lge.FoldingRangeFeature=zai;var dge={};Object.defineProperty(dge,"__esModule",{value:!0});dge.DeclarationFeature=void 0;const $ai=as,e_e=Ts,t_e=$n;class Gai extends t_e.TextDocumentLanguageFeature{constructor(e){super(e,e_e.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,t_e.ensure)((0,t_e.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.declarationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(e_e.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(e_e.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return $ai.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}dge.DeclarationFeature=Gai;var hge={};Object.defineProperty(hge,"__esModule",{value:!0});hge.SelectionRangeFeature=void 0;const qai=as,i_e=Ts,n_e=$n;class Qai extends n_e.TextDocumentLanguageFeature{constructor(e){super(e,i_e.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,n_e.ensure)((0,n_e.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.selectionRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(s,o,r)=>{const a=this._client,c=async(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),positions:a.code2ProtocolConverter.asPositionsSync(h,u)};return a.sendRequest(i_e.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(i_e.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return qai.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}hge.SelectionRangeFeature=Qai;var uge={};Object.defineProperty(uge,"__esModule",{value:!0});uge.ProgressFeature=void 0;const Dqe=Ts,jai=dj;function Kai(n,e){return n[e]===void 0&&(n[e]=Object.create(null)),n[e]}class Yai{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:Dqe.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){Kai(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=s=>{this.activeParts.delete(s)},i=s=>{this.activeParts.add(new jai.ProgressPart(this._client,s.token,t))};e.onRequest(Dqe.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}uge.ProgressFeature=Yai;var gge={};Object.defineProperty(gge,"__esModule",{value:!0});gge.CallHierarchyFeature=void 0;const Jai=as,gT=Ts,s_e=$n;class Xai{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(gT.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>s.handleFailedRequest(gT.CallHierarchyPrepareRequest.type,l,h,null))};return o.prepareCallHierarchy?o.prepareCallHierarchy(e,t,i,r):r(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyIncomingCallsRequest.type,a,l,null))};return s.provideCallHierarchyIncomingCalls?s.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return s.provideCallHierarchyOutgoingCalls?s.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class Zai extends s_e.TextDocumentLanguageFeature{constructor(e){super(e,gT.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,s_e.ensure)((0,s_e.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.callHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new Xai(t);return[Jai.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}gge.CallHierarchyFeature=Zai;var fge={};Object.defineProperty(fge,"__esModule",{value:!0});fge.SemanticTokensFeature=void 0;const RY=as,Bs=Ts,s3=$n,eci=ea;class tci extends s3.TextDocumentLanguageFeature{constructor(e){super(e,Bs.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,s3.ensure)((0,s3.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Bs.SemanticTokenTypes.namespace,Bs.SemanticTokenTypes.type,Bs.SemanticTokenTypes.class,Bs.SemanticTokenTypes.enum,Bs.SemanticTokenTypes.interface,Bs.SemanticTokenTypes.struct,Bs.SemanticTokenTypes.typeParameter,Bs.SemanticTokenTypes.parameter,Bs.SemanticTokenTypes.variable,Bs.SemanticTokenTypes.property,Bs.SemanticTokenTypes.enumMember,Bs.SemanticTokenTypes.event,Bs.SemanticTokenTypes.function,Bs.SemanticTokenTypes.method,Bs.SemanticTokenTypes.macro,Bs.SemanticTokenTypes.keyword,Bs.SemanticTokenTypes.modifier,Bs.SemanticTokenTypes.comment,Bs.SemanticTokenTypes.string,Bs.SemanticTokenTypes.number,Bs.SemanticTokenTypes.regexp,Bs.SemanticTokenTypes.operator,Bs.SemanticTokenTypes.decorator],t.tokenModifiers=[Bs.SemanticTokenModifiers.declaration,Bs.SemanticTokenModifiers.definition,Bs.SemanticTokenModifiers.readonly,Bs.SemanticTokenModifiers.static,Bs.SemanticTokenModifiers.deprecated,Bs.SemanticTokenModifiers.abstract,Bs.SemanticTokenModifiers.async,Bs.SemanticTokenModifiers.modification,Bs.SemanticTokenModifiers.documentation,Bs.SemanticTokenModifiers.defaultLibrary],t.formats=[Bs.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,s3.ensure)((0,s3.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Bs.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[s,o]=this.getRegistration(t,e.semanticTokensProvider);!s||!o||this.register({id:s,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=eci.boolean(e.full)?e.full:e.full!==void 0,s=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new RY.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,w=(b,C)=>{const y={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(b)};return m.sendRequest(Bs.SemanticTokensRequest.type,y,C).then(S=>C.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(S,C),S=>m.handleFailedRequest(Bs.SemanticTokensRequest.type,C,S,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,w):w(f,p)},provideDocumentSemanticTokensEdits:s?(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),previousResultId:y};return v.sendRequest(Bs.SemanticTokensDeltaRequest.type,M,S).then(async k=>S.isCancellationRequested?null:Bs.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,S):await v.protocol2CodeConverter.asSemanticTokensEdits(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensDeltaRequest.type,S,k,null))};return w.provideDocumentSemanticTokensEdits?w.provideDocumentSemanticTokensEdits(f,p,m,b):b(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),range:v.code2ProtocolConverter.asRange(y)};return v.sendRequest(Bs.SemanticTokensRangeRequest.type,M,S).then(k=>S.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensRangeRequest.type,S,k,null))};return w.provideDocumentRangeSemanticTokens?w.provideDocumentRangeSemanticTokens(f,p,m,b):b(f,p,m)}}:void 0,l=[],d=this._client,h=d.protocol2CodeConverter.asSemanticTokensLegend(e.legend),u=d.protocol2CodeConverter.asDocumentSelector(t);return r!==void 0&&l.push(RY.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(RY.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new RY.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}fge.SemanticTokensFeature=tci;var im={};Object.defineProperty(im,"__esModule",{value:!0});im.WillDeleteFilesFeature=im.WillRenameFilesFeature=im.WillCreateFilesFeature=im.DidDeleteFilesFeature=im.DidRenameFilesFeature=im.DidCreateFilesFeature=void 0;const Jv=as,ici=Mue,Tx=Ts,nci=Er;function kqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}function sci(n,e){return n[e]}function Iqe(n,e,t){n[e]=t}class XM{constructor(e,t,i,s,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=s,this._serverCapability=o,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){const t=kqe(kqe(e,"workspace"),"fileOperations");Iqe(t,"dynamicRegistration",!0),Iqe(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?sci(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:nci.generateUuid(),registerOptions:{filters:i.filters}})}catch(s){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${s}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const s=new ici.Minimatch(i.pattern.glob,XM.asMinimatchOptions(i.pattern.options));if(!s.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:s,kind:i.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return XM.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async o=>{const r=t(o),a=r.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==r.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(r);if(d===void 0)return this._client.error(`Failed to determine file type for ${r.toString()}.`),!0;if(d===Jv.FileType.File&&l.kind===Tx.FileOperationPatternKind.file||d===Jv.FileType.Directory&&l.kind===Tx.FileOperationPatternKind.folder)return!0}else if(l.kind===Tx.FileOperationPatternKind.folder&&await XM.getFileType(r)===Jv.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),s=e.files.filter((o,r)=>i[r]);return{...e,files:s}}static async getFileType(e){try{return(await Jv.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class wct extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._notificationType=i,this._accessUri=r,this._createParams=a}async send(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=async s=>this._client.sendNotification(this._notificationType,this._createParams(s));return this.doSend(t,i)}}}class bct extends wct{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){const t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);const i=await XM.getFileType(e);return i&&this._fsPathFileTypes.set(t,i),i}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}}class oci extends wct{constructor(e){super(e,Jv.workspace.onDidCreateFiles,Tx.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.didCreateFiles?i.didCreateFiles(e,t):t(e)}}im.DidCreateFilesFeature=oci;class rci extends bct{constructor(e){super(e,Jv.workspace.onDidRenameFiles,Tx.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didRenameFiles?i.didRenameFiles(e,t):t(e)}}im.DidRenameFilesFeature=rci;class aci extends bct{constructor(e){super(e,Jv.workspace.onDidDeleteFiles,Tx.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didDeleteFiles?i.didDeleteFiles(e,t):t(e)}}im.DidDeleteFilesFeature=aci;class _Be extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._requestType=i,this._accessUri=r,this._createParams=a}async send(e){const t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=s=>this._client.sendRequest(this._requestType,this._createParams(s),s.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class cci extends _Be{constructor(e){super(e,Jv.workspace.onWillCreateFiles,Tx.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willCreateFiles?i.willCreateFiles(e,t):t(e)}}im.WillCreateFilesFeature=cci;class lci extends _Be{constructor(e){super(e,Jv.workspace.onWillRenameFiles,Tx.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willRenameFiles?i.willRenameFiles(e,t):t(e)}}im.WillRenameFilesFeature=lci;class dci extends _Be{constructor(e){super(e,Jv.workspace.onWillDeleteFiles,Tx.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willDeleteFiles?i.willDeleteFiles(e,t):t(e)}}im.WillDeleteFilesFeature=dci;var pge={};Object.defineProperty(pge,"__esModule",{value:!0});pge.LinkedEditingFeature=void 0;const hci=as,o_e=Ts,r_e=$n;class uci extends r_e.TextDocumentLanguageFeature{constructor(e){super(e,o_e.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,r_e.ensure)((0,r_e.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(o_e.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(o_e.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return hci.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}pge.LinkedEditingFeature=uci;var mge={};Object.defineProperty(mge,"__esModule",{value:!0});mge.TypeHierarchyFeature=void 0;const gci=as,fT=Ts,a_e=$n;class fci{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(fT.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>s.handleFailedRequest(fT.TypeHierarchyPrepareRequest.type,l,h,null))};return o.prepareTypeHierarchy?o.prepareTypeHierarchy(e,t,i,r):r(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySupertypesRequest.type,a,l,null))};return s.provideTypeHierarchySupertypes?s.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySubtypesRequest.type,a,l,null))};return s.provideTypeHierarchySubtypes?s.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class pci extends a_e.TextDocumentLanguageFeature{constructor(e){super(e,fT.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,a_e.ensure)((0,a_e.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.typeHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new fci(t);return[gci.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}mge.TypeHierarchyFeature=pci;var _ge={};Object.defineProperty(_ge,"__esModule",{value:!0});_ge.InlineValueFeature=void 0;const Lqe=as,MY=Ts,o3=$n;class mci extends o3.TextDocumentLanguageFeature{constructor(e){super(e,MY.InlineValueRequest.type)}fillClientCapabilities(e){(0,o3.ensure)((0,o3.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,o3.ensure)((0,o3.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(MY.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,s]=this.getRegistration(t,e.inlineValueProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Lqe.EventEmitter,s={onDidChangeInlineValues:i.event,provideInlineValues:(o,r,a,c)=>{const l=this._client,d=(u,f,p,m)=>{const v={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(u),range:l.code2ProtocolConverter.asRange(f),context:l.code2ProtocolConverter.asInlineValueContext(p)};return l.sendRequest(MY.InlineValueRequest.type,v,m).then(w=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(w,m),w=>l.handleFailedRequest(MY.InlineValueRequest.type,m,w,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,s),{provider:s,onDidChangeInlineValues:i}]}registerProvider(e,t){return Lqe.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}_ge.InlineValueFeature=mci;var vge={};Object.defineProperty(vge,"__esModule",{value:!0});vge.InlayHintsFeature=void 0;const Tqe=as,uB=Ts,r3=$n;class _ci extends r3.TextDocumentLanguageFeature{constructor(e){super(e,uB.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,r3.ensure)((0,r3.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,r3.ensure)((0,r3.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(uB.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,s]=this.getRegistration(t,e.inlayHintProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Tqe.EventEmitter,s={onDidChangeInlayHints:i.event,provideInlayHints:(o,r,a)=>{const c=this._client,l=async(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u)};try{const m=await c.sendRequest(uB.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(uB.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return s.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(uB.InlayHintResolveRequest.type,a.code2ProtocolConverter.asInlayHint(d),h);if(h.isCancellationRequested)return null;const f=a.protocol2CodeConverter.asInlayHint(u,h);return h.isCancellationRequested?null:f}catch(u){return a.handleFailedRequest(uB.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,s),{provider:s,onDidChangeInlayHints:i}]}registerProvider(e,t){return Tqe.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}vge.InlayHintsFeature=_ci;var wge={};Object.defineProperty(wge,"__esModule",{value:!0});wge.InlineCompletionItemFeature=void 0;const vci=as,c_e=Ts,l_e=$n,wci=Er;class bci extends l_e.TextDocumentLanguageFeature{constructor(e){super(e,c_e.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,l_e.ensure)((0,l_e.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:wci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(s,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(c_e.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(c_e.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(s,o,r,a,d):d(s,o,r,a)}};return[vci.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}wge.InlineCompletionItemFeature=bci;Object.defineProperty(mu,"__esModule",{value:!0});mu.ProposedFeatures=Cct=mu.BaseLanguageClient=mu.MessageTransports=mu.SuspendMode=mu.State=mu.CloseAction=mu.ErrorAction=mu.RevealOutputChannelOn=void 0;const ra=as,Ft=Ts,Cci=Pue,yci=$ue,rb=ea,NY=vu,Rqe=Er,Sci=dj,Vw=$n,Aci=Ix,Mqe=Gue,Nqe=n0,gB=tm,Eci=que,xci=Que,Dci=jue,kci=Kue,Ici=Yue,Lci=pBe,Tci=Jue,Rci=Xue,Mci=Zue,Nci=ege,d_e=s0,Pci=ige,Fci=nge,Oci=sge,Bci=oge,Wci=rge,Hci=age,Uci=cge,Vci=oz,zci=lge,$ci=dge,Gci=hge,qci=uge,Qci=gge,jci=fge,fB=im,Kci=pge,Yci=mge,Jci=_ge,Xci=vge,Zci=wge;var GT;(function(n){n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error",n[n.Never=4]="Never"})(GT||(mu.RevealOutputChannelOn=GT={}));var vq;(function(n){n[n.Continue=1]="Continue",n[n.Shutdown=2]="Shutdown"})(vq||(mu.ErrorAction=vq={}));var o0;(function(n){n[n.DoNotRestart=1]="DoNotRestart",n[n.Restart=2]="Restart"})(o0||(mu.CloseAction=o0={}));var U8;(function(n){n[n.Stopped=1]="Stopped",n[n.Starting=3]="Starting",n[n.Running=2]="Running"})(U8||(mu.State=U8={}));var Pqe;(function(n){n.off="off",n.on="on"})(Pqe||(mu.SuspendMode=Pqe={}));var LRe;(function(n){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&rb.stringArray(t.enabledCommands)?t:!1}n.sanitizeIsTrusted=e})(LRe||(LRe={}));class eli{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:vq.Continue}:{action:vq.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:o0.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:o0.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:o0.Restart})}}var wo;(function(n){n.Initial="initial",n.Starting="starting",n.StartFailed="startFailed",n.Running="running",n.Stopping="stopping",n.Stopped="stopped"})(wo||(wo={}));var Fqe;(function(n){function e(t){return t&&Ft.MessageReader.is(t.reader)&&Ft.MessageWriter.is(t.writer)}n.is=e})(Fqe||(mu.MessageTransports=Fqe={}));class ZM{constructor(e,t,i){this._traceFormat=Ft.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new NY.Semaphore(1),this._id=e,this._name=t,i=i||{};const s={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(s.isTrusted=LRe.sanitizeIsTrusted(i.markdown.isTrusted),s.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??GT.Error,stdioEncoding:i.stdioEncoding??"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler??this.createDefaultErrorHandler(i.connectionOptions?.maxRestartCount),middleware:i.middleware??{},uriConverters:i.uriConverters,workspaceFolder:i.workspaceFolder,connectionOptions:i.connectionOptions,markdown:s,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=wo.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,i.outputChannel?(this._outputChannel=i.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=i.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new NY.Semaphore(1),this._pendingChangeDelayer=new NY.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new NY.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new Ft.Emitter,this._stateChangeEmitter=new Ft.Emitter,this._trace=Ft.Trace.Off,this._tracer={log:(o,r)=>{rb.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=Cci.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=yci.createConverter(i.uriConverters?i.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=ra.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){switch(this.$state){case wo.Starting:return U8.Starting;case wo.Running:return U8.Running;default:return U8.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const s=this._clientOptions.middleware?.sendRequest;if(s!==void 0){let o,r;return t.length===1?Ft.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),s(e,o,r,(a,c,l)=>{const d=[];return c!==void 0&&d.push(c),l!==void 0&&d.push(l),i.sendRequest(a,...d)})}else return i.sendRequest(e,...t)}onRequest(e,t){const i=typeof e=="string"?e:e.method;this._requestHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._requestDisposables.set(i,s.onRequest(e,t)),o={dispose:()=>{const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full;let s;i&&typeof e!="string"&&e.method===Ft.DidOpenTextDocumentNotification.method&&(s=t?.textDocument.uri,this._pendingOpenNotifications.add(s));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),s!==void 0&&this._pendingOpenNotifications.delete(s);const r=this._clientOptions.middleware?.sendNotification;return r?r(e,o.sendNotification.bind(o),t):o.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._notificationDisposables.set(i,s.onNotification(e,t)),o={dispose:()=>{const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}async sendProgress(e,t,i){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(s){throw this.error(`Sending progress for token ${t} failed.`,s),s}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const s=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=Ft.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return s!==void 0?(this._progressDisposables.set(t,s.onProgress(e,t,a)),o={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new eli(this,e??4)}async setTrace(e){this._trace=e;const t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof Ft.ResponseError){const t=e;return` Message: ${t.message} +`)),rt){const Ci=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Tn.log(`Received response '${rt.method} - (${Se.id})' in ${Date.now()-rt.timerStart}ms.${Ci}`,Ft)}else Tn.log(`Received response ${Se.id} without active response promise.`,Ft)}else zn("receive-response",Se)}function zn(Se,rt){if(!Tn||ss===u.Off)return;const Ft={isLSPMessage:!0,type:Se,message:rt,timestamp:Date.now()};Tn.log(Ft)}function Cs(){if(nh())throw new w(b.Closed,"Connection is closed.");if(Dc())throw new w(b.Disposed,"Connection is disposed.")}function Wo(){if($c())throw new w(b.AlreadyListening,"Connection is already listening")}function Ha(){if(!$c())throw new Error("Call listen() first.")}function ea(Se){return Se===void 0?null:Se}function Ph(Se){if(Se!==null)return Se}function le(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}function dr(Se,rt){switch(Se){case i.ParameterStructures.auto:return le(rt)?Ph(rt):[ea(rt)];case i.ParameterStructures.byName:if(!le(rt))throw new Error("Received parameters by name but param is not an object literal.");return Ph(rt);case i.ParameterStructures.byPosition:return[ea(rt)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}function io(Se,rt){let Ft;const Ci=Se.numberOfParams;switch(Ci){case 0:Ft=void 0;break;case 1:Ft=dr(Se.parameterStructures,rt[0]);break;default:Ft=[];for(let Ot=0;Ot{Cs();let Ft,Ci;if(t.string(Se)){Ft=Se;const K=rt[0];let de=0,T=i.ParameterStructures.auto;i.ParameterStructures.is(K)&&(de=1,T=K);let ie=rt.length;const ye=ie-de;switch(ye){case 0:Ci=void 0;break;case 1:Ci=dr(T,rt[de]);break;default:if(T===i.ParameterStructures.byName)throw new Error(`Received ${ye} parameters for 'by Name' notification parameter structure.`);Ci=rt.slice(de,ie).map(O=>ea(O));break}}else{const K=rt;Ft=Se.method,Ci=io(Se,K)}const Ot={jsonrpc:xt,method:Ft,params:Ci};return be(Ot),ne.write(Ot).catch(K=>{throw Oe.error("Sending notification failed."),K})},onNotification:(Se,rt)=>{Cs();let Ft;return t.func(Se)?ns=Se:rt&&(t.string(Se)?(Ft=Se,zs.set(Se,{type:void 0,handler:rt})):(Ft=Se.method,zs.set(Se.method,{type:Se,handler:rt}))),{dispose:()=>{Ft!==void 0?zs.delete(Ft):ns=void 0}}},onProgress:(Se,rt,Ft)=>{if(Pn.has(rt))throw new Error(`Progress handler for token ${rt} already registered`);return Pn.set(rt,Ft),{dispose:()=>{Pn.delete(rt)}}},sendProgress:(Se,rt,Ft)=>un.sendNotification(l.type,{token:rt,value:Ft}),onUnhandledProgress:pc.event,sendRequest:(Se,...rt)=>{Cs(),Ha();let Ft,Ci,Ot;if(t.string(Se)){Ft=Se;const ie=rt[0],ye=rt[rt.length-1];let O=0,$=i.ParameterStructures.auto;i.ParameterStructures.is(ie)&&(O=1,$=ie);let se=rt.length;r.CancellationToken.is(ye)&&(se=se-1,Ot=ye);const Ke=se-O;switch(Ke){case 0:Ci=void 0;break;case 1:Ci=dr($,rt[O]);break;default:if($===i.ParameterStructures.byName)throw new Error(`Received ${Ke} parameters for 'by Name' request parameter structure.`);Ci=rt.slice(O,se).map(Bi=>ea(Bi));break}}else{const ie=rt;Ft=Se.method,Ci=io(Se,ie);const ye=Se.numberOfParams;Ot=r.CancellationToken.is(ie[ye])?ie[ye]:void 0}const K=yt++;let de;Ot&&(de=Ot.onCancellationRequested(()=>{const ie=$s.sender.sendCancellation(un,K);return ie===void 0?(Oe.log(`Received no promise from cancellation strategy when cancelling id ${K}`),Promise.resolve()):ie.catch(()=>{Oe.log(`Sending cancellation messages for id ${K} failed`)})}));const T={jsonrpc:xt,id:K,method:Ft,params:Ci};return Nh(T),typeof $s.sender.enableCancellation=="function"&&$s.sender.enableCancellation(T),new Promise(async(ie,ye)=>{const O=Ke=>{ie(Ke),$s.sender.cleanup(K),de?.dispose()},$=Ke=>{ye(Ke),$s.sender.cleanup(K),de?.dispose()},se={method:Ft,timerStart:Date.now(),resolve:O,reject:$};try{await ne.write(T),Zo.set(K,se)}catch(Ke){throw Oe.error("Sending request failed."),se.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,Ke.message?Ke.message:"Unknown reason")),Ke}})},onRequest:(Se,rt)=>{Cs();let Ft=null;return h.is(Se)?(Ft=void 0,Ji=Se):t.string(Se)?(Ft=null,rt!==void 0&&(Ft=Se,Ii.set(Se,{handler:rt,type:void 0}))):rt!==void 0&&(Ft=Se.method,Ii.set(Se.method,{type:Se,handler:rt})),{dispose:()=>{Ft!==null&&(Ft!==void 0?Ii.delete(Ft):Ji=void 0)}}},hasPendingResponse:()=>Zo.size>0,trace:async(Se,rt,Ft)=>{let Ci=!1,Ot=p.Text;Ft!==void 0&&(t.boolean(Ft)?Ci=Ft:(Ci=Ft.sendNotification||!1,Ot=Ft.traceFormat||p.Text)),ss=Se,Oo=Ot,ss===u.Off?Tn=void 0:Tn=rt,Ci&&!nh()&&!Dc()&&await un.sendNotification(m.type,{value:u.toString(Se)})},onError:vd.event,onClose:Fn.event,onUnhandledNotification:th.event,onDispose:zc.event,end:()=>{ne.end()},dispose:()=>{if(Dc())return;Ba=G.Disposed,zc.fire(void 0);const Se=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const rt of Zo.values())rt.reject(Se);Zo=new Map,Di=new Map,Zr=new Set,ds=new n.LinkedMap,t.func(ne.dispose)&&ne.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Cs(),Wo(),Ba=G.Listening,j.listen(Gc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return un.onNotification(v.type,Se=>{if(ss===u.Off||!Tn)return;const rt=ss===u.Verbose||ss===u.Compact;Tn.log(Se.message,rt?Se.verbose:void 0)}),un.onNotification(l.type,Se=>{const rt=Pn.get(Se.token);rt?rt(Se.value):pc.fire(Se)}),un}s.createMessageConnection=Y})(xot);(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.ProgressType=s.ProgressToken=s.createMessageConnection=s.NullLogger=s.ConnectionOptions=s.ConnectionStrategy=s.AbstractMessageBuffer=s.WriteableStreamMessageWriter=s.AbstractMessageWriter=s.MessageWriter=s.ReadableStreamMessageReader=s.AbstractMessageReader=s.MessageReader=s.SharedArrayReceiverStrategy=s.SharedArraySenderStrategy=s.CancellationToken=s.CancellationTokenSource=s.Emitter=s.Event=s.Disposable=s.LRUCache=s.Touch=s.LinkedMap=s.ParameterStructures=s.NotificationType9=s.NotificationType8=s.NotificationType7=s.NotificationType6=s.NotificationType5=s.NotificationType4=s.NotificationType3=s.NotificationType2=s.NotificationType1=s.NotificationType0=s.NotificationType=s.ErrorCodes=s.ResponseError=s.RequestType9=s.RequestType8=s.RequestType7=s.RequestType6=s.RequestType5=s.RequestType4=s.RequestType3=s.RequestType2=s.RequestType1=s.RequestType0=s.RequestType=s.Message=s.RAL=void 0,s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=void 0;const e=ln;Object.defineProperty(s,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(s,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(s,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(s,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(s,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(s,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(s,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(s,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(s,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(s,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(s,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(s,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(s,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(s,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(s,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(s,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(s,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(s,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(s,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(s,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(s,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(s,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(s,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(s,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(s,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(s,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=vA;Object.defineProperty(s,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(s,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(s,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=hle;Object.defineProperty(s,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const n=dC;Object.defineProperty(s,"Event",{enumerable:!0,get:function(){return n.Event}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return n.Emitter}});const o=vI;Object.defineProperty(s,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(s,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=jH;Object.defineProperty(s,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(s,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=ED;Object.defineProperty(s,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(s,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(s,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=xD;Object.defineProperty(s,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(s,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(s,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=gle;Object.defineProperty(s,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=xot;Object.defineProperty(s,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(s,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(s,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(s,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(s,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(s,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(s,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(s,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(s,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(s,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(s,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(s,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(s,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(s,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(s,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(s,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(s,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=aE;s.RAL=h.default})(dne);Object.defineProperty(zPe,"__esModule",{value:!0});const Xw=dne;class fle extends Xw.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return fle.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}fle.emptyBuffer=new Uint8Array(0);class Yni{constructor(e){this.socket=e,this._onData=new Xw.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(n=>{this._onData.fire(new Uint8Array(n))},()=>{(0,Xw.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Xw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Xw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Xw.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Jni{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Xw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Xw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Xw.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,t){if(typeof e=="string"){if(t!==void 0&&t!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Xni=new TextEncoder,Dot=Object.freeze({messageBuffer:Object.freeze({create:s=>new fle(s)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(s,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Xni.encode(JSON.stringify(s,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(s,e)=>{if(!(s instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(s)))}})}),stream:Object.freeze({asReadableStream:s=>new Yni(s),asWritableStream:s=>new Jni(s)}),console,timer:Object.freeze({setTimeout(s,e,...t){const i=setTimeout(s,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(s,...e){const t=setTimeout(s,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(s,e,...t){const i=setInterval(s,e,...t);return{dispose:()=>clearInterval(i)}}})});function w0e(){return Dot}(function(s){function e(){Xw.RAL.install(Dot)}s.install=e})(w0e||(w0e={}));zPe.default=w0e;(function(s){var e=rd&&rd.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var u=Object.getOwnPropertyDescriptor(l,d);(!u||("get"in u?!l.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,u)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),t=rd&&rd.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.BrowserMessageWriter=s.BrowserMessageReader=void 0,zPe.default.install();const n=dne;t(dne,s);class o extends n.AbstractMessageReader{constructor(l){super(),this._onData=new n.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}s.BrowserMessageReader=o;class r extends n.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}s.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=n.NullLogger),n.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,n.createMessageConnection)(c,l,d,h)}s.createMessageConnection=a})(JN);var m$e=JN,kot={},y0e;(function(s){function e(t){return typeof t=="string"}s.is=e})(y0e||(y0e={}));var une;(function(s){function e(t){return typeof t=="string"}s.is=e})(une||(une={}));var C0e;(function(s){s.MIN_VALUE=-2147483648,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(C0e||(C0e={}));var s7;(function(s){s.MIN_VALUE=0,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(s7||(s7={}));var f_;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=s7.MAX_VALUE),n===Number.MAX_VALUE&&(n=s7.MAX_VALUE),{line:i,character:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&Fe.uinteger(n.line)&&Fe.uinteger(n.character)}s.is=t})(f_||(f_={}));var ul;(function(s){function e(i,n,o,r){if(Fe.uinteger(i)&&Fe.uinteger(n)&&Fe.uinteger(o)&&Fe.uinteger(r))return{start:f_.create(i,n),end:f_.create(o,r)};if(f_.is(i)&&f_.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${o}, ${r}]`)}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&f_.is(n.start)&&f_.is(n.end)}s.is=t})(ul||(ul={}));var o7;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&(Fe.string(n.uri)||Fe.undefined(n.uri))}s.is=t})(o7||(o7={}));var S0e;(function(s){function e(i,n,o,r){return{targetUri:i,targetRange:n,targetSelectionRange:o,originSelectionRange:r}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.targetRange)&&Fe.string(n.targetUri)&&ul.is(n.targetSelectionRange)&&(ul.is(n.originSelectionRange)||Fe.undefined(n.originSelectionRange))}s.is=t})(S0e||(S0e={}));var gne;(function(s){function e(i,n,o,r){return{red:i,green:n,blue:o,alpha:r}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.numberRange(n.red,0,1)&&Fe.numberRange(n.green,0,1)&&Fe.numberRange(n.blue,0,1)&&Fe.numberRange(n.alpha,0,1)}s.is=t})(gne||(gne={}));var A0e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&gne.is(n.color)}s.is=t})(A0e||(A0e={}));var E0e;(function(s){function e(i,n,o){return{label:i,textEdit:n,additionalTextEdits:o}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.undefined(n.textEdit)||Hy.is(n))&&(Fe.undefined(n.additionalTextEdits)||Fe.typedArray(n.additionalTextEdits,Hy.is))}s.is=t})(E0e||(E0e={}));var x0e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(x0e||(x0e={}));var D0e;(function(s){function e(i,n,o,r,a,c){const l={startLine:i,endLine:n};return Fe.defined(o)&&(l.startCharacter=o),Fe.defined(r)&&(l.endCharacter=r),Fe.defined(a)&&(l.kind=a),Fe.defined(c)&&(l.collapsedText=c),l}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.uinteger(n.startLine)&&Fe.uinteger(n.startLine)&&(Fe.undefined(n.startCharacter)||Fe.uinteger(n.startCharacter))&&(Fe.undefined(n.endCharacter)||Fe.uinteger(n.endCharacter))&&(Fe.undefined(n.kind)||Fe.string(n.kind))}s.is=t})(D0e||(D0e={}));var fne;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&o7.is(n.location)&&Fe.string(n.message)}s.is=t})(fne||(fne={}));var k0e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(k0e||(k0e={}));var I0e;(function(s){s.Unnecessary=1,s.Deprecated=2})(I0e||(I0e={}));var T0e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Fe.string(i.href)}s.is=e})(T0e||(T0e={}));var r7;(function(s){function e(i,n,o,r,a,c){let l={range:i,message:n};return Fe.defined(o)&&(l.severity=o),Fe.defined(r)&&(l.code=r),Fe.defined(a)&&(l.source=a),Fe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n;let o=i;return Fe.defined(o)&&ul.is(o.range)&&Fe.string(o.message)&&(Fe.number(o.severity)||Fe.undefined(o.severity))&&(Fe.integer(o.code)||Fe.string(o.code)||Fe.undefined(o.code))&&(Fe.undefined(o.codeDescription)||Fe.string((n=o.codeDescription)===null||n===void 0?void 0:n.href))&&(Fe.string(o.source)||Fe.undefined(o.source))&&(Fe.undefined(o.relatedInformation)||Fe.typedArray(o.relatedInformation,fne.is))}s.is=t})(r7||(r7={}));var vN;(function(s){function e(i,n,...o){let r={title:i,command:n};return Fe.defined(o)&&o.length>0&&(r.arguments=o),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.title)&&Fe.string(n.command)}s.is=t})(vN||(vN={}));var Hy;(function(s){function e(o,r){return{range:o,newText:r}}s.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}s.insert=t;function i(o){return{range:o,newText:""}}s.del=i;function n(o){const r=o;return Fe.objectLiteral(r)&&Fe.string(r.newText)&&ul.is(r.range)}s.is=n})(Hy||(Hy={}));var nL;(function(s){function e(i,n,o){const r={label:i};return n!==void 0&&(r.needsConfirmation=n),o!==void 0&&(r.description=o),r}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(Fe.string(n.description)||n.description===void 0)}s.is=t})(nL||(nL={}));var Qh;(function(s){function e(t){const i=t;return Fe.string(i)}s.is=e})(Qh||(Qh={}));var XC;(function(s){function e(o,r,a){return{range:o,newText:r,annotationId:a}}s.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}s.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}s.del=i;function n(o){const r=o;return Hy.is(r)&&(nL.is(r.annotationId)||Qh.is(r.annotationId))}s.is=n})(XC||(XC={}));var a7;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&c7.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(a7||(a7={}));var YH;(function(s){function e(i,n,o){let r={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="create"&&Fe.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||Fe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Fe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(YH||(YH={}));var JH;(function(s){function e(i,n,o,r){let a={kind:"rename",oldUri:i,newUri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}s.create=e;function t(i){let n=i;return n&&n.kind==="rename"&&Fe.string(n.oldUri)&&Fe.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||Fe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Fe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(JH||(JH={}));var XH;(function(s){function e(i,n,o){let r={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="delete"&&Fe.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||Fe.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||Fe.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(XH||(XH={}));var pne;(function(s){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(n=>Fe.string(n.kind)?YH.is(n)||JH.is(n)||XH.is(n):a7.is(n)))}s.is=e})(pne||(pne={}));class YK{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let n,o;if(i===void 0?n=Hy.insert(e,t):Qh.is(i)?(o=i,n=XC.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=XC.insert(e,t,o)),this.edits.push(n),o!==void 0)return o}replace(e,t,i){let n,o;if(i===void 0?n=Hy.replace(e,t):Qh.is(i)?(o=i,n=XC.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=XC.replace(e,t,o)),this.edits.push(n),o!==void 0)return o}delete(e,t){let i,n;if(t===void 0?i=Hy.del(e):Qh.is(t)?(n=t,i=XC.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=XC.del(e,n)),this.edits.push(i),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class _$e{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let i;if(Qh.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error(`Id ${i} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${i}`);return this._annotations[i]=t,this._size++,i}nextId(){return this._counter++,this._counter.toString()}}class Zni{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new _$e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(a7.is(t)){const i=new YK(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new YK(e.changes[t]);this._textEditChanges[t]=i})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(c7.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let i=this._textEditChanges[t.uri];if(!i){const n=[],o={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(o),i=new YK(n,this._changeAnnotations),this._textEditChanges[t.uri]=i}return i}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let i=[];this._workspaceEdit.changes[e]=i,t=new YK(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new _$e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;nL.is(t)||Qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=YH.create(e,i):(r=Qh.is(n)?n:this._changeAnnotations.manage(n),o=YH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;nL.is(i)||Qh.is(i)?o=i:n=i;let r,a;if(o===void 0?r=JH.create(e,t,n):(a=Qh.is(o)?o:this._changeAnnotations.manage(o),r=JH.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(r),a!==void 0)return a}deleteFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;nL.is(t)||Qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=XH.create(e,i):(r=Qh.is(n)?n:this._changeAnnotations.manage(n),o=XH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var L0e;(function(s){function e(i){return{uri:i}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)}s.is=t})(L0e||(L0e={}));var R0e;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&Fe.integer(n.version)}s.is=t})(R0e||(R0e={}));var c7;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&(n.version===null||Fe.integer(n.version))}s.is=t})(c7||(c7={}));var M0e;(function(s){function e(i,n,o,r){return{uri:i,languageId:n,version:o,text:r}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&Fe.string(n.languageId)&&Fe.integer(n.version)&&Fe.string(n.text)}s.is=t})(M0e||(M0e={}));var mne;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){const i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(mne||(mne={}));var ZH;(function(s){function e(t){const i=t;return Fe.objectLiteral(t)&&mne.is(i.kind)&&Fe.string(i.value)}s.is=e})(ZH||(ZH={}));var N0e;(function(s){s.Text=1,s.Method=2,s.Function=3,s.Constructor=4,s.Field=5,s.Variable=6,s.Class=7,s.Interface=8,s.Module=9,s.Property=10,s.Unit=11,s.Value=12,s.Enum=13,s.Keyword=14,s.Snippet=15,s.Color=16,s.File=17,s.Reference=18,s.Folder=19,s.EnumMember=20,s.Constant=21,s.Struct=22,s.Event=23,s.Operator=24,s.TypeParameter=25})(N0e||(N0e={}));var P0e;(function(s){s.PlainText=1,s.Snippet=2})(P0e||(P0e={}));var F0e;(function(s){s.Deprecated=1})(F0e||(F0e={}));var O0e;(function(s){function e(i,n,o){return{newText:i,insert:n,replace:o}}s.create=e;function t(i){const n=i;return n&&Fe.string(n.newText)&&ul.is(n.insert)&&ul.is(n.replace)}s.is=t})(O0e||(O0e={}));var B0e;(function(s){s.asIs=1,s.adjustIndentation=2})(B0e||(B0e={}));var W0e;(function(s){function e(t){const i=t;return i&&(Fe.string(i.detail)||i.detail===void 0)&&(Fe.string(i.description)||i.description===void 0)}s.is=e})(W0e||(W0e={}));var H0e;(function(s){function e(t){return{label:t}}s.create=e})(H0e||(H0e={}));var U0e;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(U0e||(U0e={}));var l7;(function(s){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s.fromPlainText=e;function t(i){const n=i;return Fe.string(n)||Fe.objectLiteral(n)&&Fe.string(n.language)&&Fe.string(n.value)}s.is=t})(l7||(l7={}));var V0e;(function(s){function e(t){let i=t;return!!i&&Fe.objectLiteral(i)&&(ZH.is(i.contents)||l7.is(i.contents)||Fe.typedArray(i.contents,l7.is))&&(t.range===void 0||ul.is(t.range))}s.is=e})(V0e||(V0e={}));var z0e;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(z0e||(z0e={}));var $0e;(function(s){function e(t,i,...n){let o={label:t};return Fe.defined(i)&&(o.documentation=i),Fe.defined(n)?o.parameters=n:o.parameters=[],o}s.create=e})($0e||($0e={}));var G0e;(function(s){s.Text=1,s.Read=2,s.Write=3})(G0e||(G0e={}));var K0e;(function(s){function e(t,i){let n={range:t};return Fe.number(i)&&(n.kind=i),n}s.create=e})(K0e||(K0e={}));var q0e;(function(s){s.File=1,s.Module=2,s.Namespace=3,s.Package=4,s.Class=5,s.Method=6,s.Property=7,s.Field=8,s.Constructor=9,s.Enum=10,s.Interface=11,s.Function=12,s.Variable=13,s.Constant=14,s.String=15,s.Number=16,s.Boolean=17,s.Array=18,s.Object=19,s.Key=20,s.Null=21,s.EnumMember=22,s.Struct=23,s.Event=24,s.Operator=25,s.TypeParameter=26})(q0e||(q0e={}));var Q0e;(function(s){s.Deprecated=1})(Q0e||(Q0e={}));var j0e;(function(s){function e(t,i,n,o,r){let a={name:t,kind:i,location:{uri:o,range:n}};return r&&(a.containerName=r),a}s.create=e})(j0e||(j0e={}));var Y0e;(function(s){function e(t,i,n,o){return o!==void 0?{name:t,kind:i,location:{uri:n,range:o}}:{name:t,kind:i,location:{uri:n}}}s.create=e})(Y0e||(Y0e={}));var J0e;(function(s){function e(i,n,o,r,a,c){let l={name:i,detail:n,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}s.create=e;function t(i){let n=i;return n&&Fe.string(n.name)&&Fe.number(n.kind)&&ul.is(n.range)&&ul.is(n.selectionRange)&&(n.detail===void 0||Fe.string(n.detail))&&(n.deprecated===void 0||Fe.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}s.is=t})(J0e||(J0e={}));var X0e;(function(s){s.Empty="",s.QuickFix="quickfix",s.Refactor="refactor",s.RefactorExtract="refactor.extract",s.RefactorInline="refactor.inline",s.RefactorRewrite="refactor.rewrite",s.Source="source",s.SourceOrganizeImports="source.organizeImports",s.SourceFixAll="source.fixAll"})(X0e||(X0e={}));var d7;(function(s){s.Invoked=1,s.Automatic=2})(d7||(d7={}));var Z0e;(function(s){function e(i,n,o){let r={diagnostics:i};return n!=null&&(r.only=n),o!=null&&(r.triggerKind=o),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.typedArray(n.diagnostics,r7.is)&&(n.only===void 0||Fe.typedArray(n.only,Fe.string))&&(n.triggerKind===void 0||n.triggerKind===d7.Invoked||n.triggerKind===d7.Automatic)}s.is=t})(Z0e||(Z0e={}));var e1e;(function(s){function e(i,n,o){let r={title:i},a=!0;return typeof n=="string"?(a=!1,r.kind=n):vN.is(n)?r.command=n:r.edit=n,a&&o!==void 0&&(r.kind=o),r}s.create=e;function t(i){let n=i;return n&&Fe.string(n.title)&&(n.diagnostics===void 0||Fe.typedArray(n.diagnostics,r7.is))&&(n.kind===void 0||Fe.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||vN.is(n.command))&&(n.isPreferred===void 0||Fe.boolean(n.isPreferred))&&(n.edit===void 0||pne.is(n.edit))}s.is=t})(e1e||(e1e={}));var t1e;(function(s){function e(i,n){let o={range:i};return Fe.defined(n)&&(o.data=n),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&ul.is(n.range)&&(Fe.undefined(n.command)||vN.is(n.command))}s.is=t})(t1e||(t1e={}));var i1e;(function(s){function e(i,n){return{tabSize:i,insertSpaces:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.uinteger(n.tabSize)&&Fe.boolean(n.insertSpaces)}s.is=t})(i1e||(i1e={}));var n1e;(function(s){function e(i,n,o){return{range:i,target:n,data:o}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&ul.is(n.range)&&(Fe.undefined(n.target)||Fe.string(n.target))}s.is=t})(n1e||(n1e={}));var s1e;(function(s){function e(i,n){return{range:i,parent:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&(n.parent===void 0||s.is(n.parent))}s.is=t})(s1e||(s1e={}));var o1e;(function(s){s.namespace="namespace",s.type="type",s.class="class",s.enum="enum",s.interface="interface",s.struct="struct",s.typeParameter="typeParameter",s.parameter="parameter",s.variable="variable",s.property="property",s.enumMember="enumMember",s.event="event",s.function="function",s.method="method",s.macro="macro",s.keyword="keyword",s.modifier="modifier",s.comment="comment",s.string="string",s.number="number",s.regexp="regexp",s.operator="operator",s.decorator="decorator"})(o1e||(o1e={}));var r1e;(function(s){s.declaration="declaration",s.definition="definition",s.readonly="readonly",s.static="static",s.deprecated="deprecated",s.abstract="abstract",s.async="async",s.modification="modification",s.documentation="documentation",s.defaultLibrary="defaultLibrary"})(r1e||(r1e={}));var a1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}s.is=e})(a1e||(a1e={}));var c1e;(function(s){function e(i,n){return{range:i,text:n}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&Fe.string(n.text)}s.is=t})(c1e||(c1e={}));var l1e;(function(s){function e(i,n,o){return{range:i,variableName:n,caseSensitiveLookup:o}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&Fe.boolean(n.caseSensitiveLookup)&&(Fe.string(n.variableName)||n.variableName===void 0)}s.is=t})(l1e||(l1e={}));var d1e;(function(s){function e(i,n){return{range:i,expression:n}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&(Fe.string(n.expression)||n.expression===void 0)}s.is=t})(d1e||(d1e={}));var h1e;(function(s){function e(i,n){return{frameId:i,stoppedLocation:n}}s.create=e;function t(i){const n=i;return Fe.defined(n)&&ul.is(i.stoppedLocation)}s.is=t})(h1e||(h1e={}));var _ne;(function(s){s.Type=1,s.Parameter=2;function e(t){return t===1||t===2}s.is=e})(_ne||(_ne={}));var vne;(function(s){function e(i){return{value:i}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&(n.tooltip===void 0||Fe.string(n.tooltip)||ZH.is(n.tooltip))&&(n.location===void 0||o7.is(n.location))&&(n.command===void 0||vN.is(n.command))}s.is=t})(vne||(vne={}));var u1e;(function(s){function e(i,n,o){const r={position:i,label:n};return o!==void 0&&(r.kind=o),r}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&f_.is(n.position)&&(Fe.string(n.label)||Fe.typedArray(n.label,vne.is))&&(n.kind===void 0||_ne.is(n.kind))&&n.textEdits===void 0||Fe.typedArray(n.textEdits,Hy.is)&&(n.tooltip===void 0||Fe.string(n.tooltip)||ZH.is(n.tooltip))&&(n.paddingLeft===void 0||Fe.boolean(n.paddingLeft))&&(n.paddingRight===void 0||Fe.boolean(n.paddingRight))}s.is=t})(u1e||(u1e={}));var g1e;(function(s){function e(t){return{kind:"snippet",value:t}}s.createSnippet=e})(g1e||(g1e={}));var f1e;(function(s){function e(t,i,n,o){return{insertText:t,filterText:i,range:n,command:o}}s.create=e})(f1e||(f1e={}));var p1e;(function(s){function e(t){return{items:t}}s.create=e})(p1e||(p1e={}));var m1e;(function(s){s.Invoked=0,s.Automatic=1})(m1e||(m1e={}));var _1e;(function(s){function e(t,i){return{range:t,text:i}}s.create=e})(_1e||(_1e={}));var v1e;(function(s){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}s.create=e})(v1e||(v1e={}));var b1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&une.is(i.uri)&&Fe.string(i.name)}s.is=e})(b1e||(b1e={}));const esi=[` +`,`\r +`,"\r"];var w1e;(function(s){function e(o,r,a,c){return new tsi(o,r,a,c)}s.create=e;function t(o){let r=o;return!!(Fe.defined(r)&&Fe.string(r.uri)&&(Fe.undefined(r.languageId)||Fe.string(r.languageId))&&Fe.uinteger(r.lineCount)&&Fe.func(r.getText)&&Fe.func(r.positionAt)&&Fe.func(r.offsetAt))}s.is=t;function i(o,r){let a=o.getText(),c=n(r,(d,h)=>{let u=d.range.start.line-h.range.start.line;return u===0?d.range.start.character-h.range.start.character:u}),l=a.length;for(let d=c.length-1;d>=0;d--){let h=c[d],u=o.offsetAt(h.range.start),f=o.offsetAt(h.range.end);if(f<=l)a=a.substring(0,u)+h.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=u}return a}s.applyEdits=i;function n(o,r){if(o.length<=1)return o;const a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);n(c,r),n(l,r);let d=0,h=0,u=0;for(;d0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return f_.create(0,e);for(;ie?n=r:i=r+1}let o=i-1;return f_.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],n=e.line+1"u"}s.undefined=i;function n(f){return f===!0||f===!1}s.boolean=n;function o(f){return e.call(f)==="[object String]"}s.string=o;function r(f){return e.call(f)==="[object Number]"}s.number=r;function a(f,p,m){return e.call(f)==="[object Number]"&&p<=f&&f<=m}s.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}s.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}s.uinteger=l;function d(f){return e.call(f)==="[object Function]"}s.func=d;function h(f){return f!==null&&typeof f=="object"}s.objectLiteral=h;function u(f,p){return Array.isArray(f)&&f.every(p)}s.typedArray=u})(Fe||(Fe={}));const isi=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return XC},get ChangeAnnotation(){return nL},get ChangeAnnotationIdentifier(){return Qh},get CodeAction(){return e1e},get CodeActionContext(){return Z0e},get CodeActionKind(){return X0e},get CodeActionTriggerKind(){return d7},get CodeDescription(){return T0e},get CodeLens(){return t1e},get Color(){return gne},get ColorInformation(){return A0e},get ColorPresentation(){return E0e},get Command(){return vN},get CompletionItem(){return H0e},get CompletionItemKind(){return N0e},get CompletionItemLabelDetails(){return W0e},get CompletionItemTag(){return F0e},get CompletionList(){return U0e},get CreateFile(){return YH},get DeleteFile(){return XH},get Diagnostic(){return r7},get DiagnosticRelatedInformation(){return fne},get DiagnosticSeverity(){return k0e},get DiagnosticTag(){return I0e},get DocumentHighlight(){return K0e},get DocumentHighlightKind(){return G0e},get DocumentLink(){return n1e},get DocumentSymbol(){return J0e},get DocumentUri(){return y0e},EOL:esi,get FoldingRange(){return D0e},get FoldingRangeKind(){return x0e},get FormattingOptions(){return i1e},get Hover(){return V0e},get InlayHint(){return u1e},get InlayHintKind(){return _ne},get InlayHintLabelPart(){return vne},get InlineCompletionContext(){return v1e},get InlineCompletionItem(){return f1e},get InlineCompletionList(){return p1e},get InlineCompletionTriggerKind(){return m1e},get InlineValueContext(){return h1e},get InlineValueEvaluatableExpression(){return d1e},get InlineValueText(){return c1e},get InlineValueVariableLookup(){return l1e},get InsertReplaceEdit(){return O0e},get InsertTextFormat(){return P0e},get InsertTextMode(){return B0e},get Location(){return o7},get LocationLink(){return S0e},get MarkedString(){return l7},get MarkupContent(){return ZH},get MarkupKind(){return mne},get OptionalVersionedTextDocumentIdentifier(){return c7},get ParameterInformation(){return z0e},get Position(){return f_},get Range(){return ul},get RenameFile(){return JH},get SelectedCompletionInfo(){return _1e},get SelectionRange(){return s1e},get SemanticTokenModifiers(){return r1e},get SemanticTokenTypes(){return o1e},get SemanticTokens(){return a1e},get SignatureInformation(){return $0e},get StringValue(){return g1e},get SymbolInformation(){return j0e},get SymbolKind(){return q0e},get SymbolTag(){return Q0e},get TextDocument(){return w1e},get TextDocumentEdit(){return a7},get TextDocumentIdentifier(){return L0e},get TextDocumentItem(){return M0e},get TextEdit(){return Hy},get URI(){return une},get VersionedTextDocumentIdentifier(){return R0e},WorkspaceChange:Zni,get WorkspaceEdit(){return pne},get WorkspaceFolder(){return b1e},get WorkspaceSymbol(){return Y0e},get integer(){return C0e},get uinteger(){return s7}},Symbol.toStringTag,{value:"Module"})),GPe=wot(isi);var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.ProtocolNotificationType=Lo.ProtocolNotificationType0=Lo.ProtocolRequestType=Lo.ProtocolRequestType0=Lo.RegistrationType=Lo.MessageDirection=void 0;const eU=JN;var v$e;(function(s){s.clientToServer="clientToServer",s.serverToClient="serverToClient",s.both="both"})(v$e||(Lo.MessageDirection=v$e={}));class nsi{constructor(e){this.method=e}}Lo.RegistrationType=nsi;class ssi extends eU.RequestType0{constructor(e){super(e)}}Lo.ProtocolRequestType0=ssi;class osi extends eU.RequestType{constructor(e){super(e,eU.ParameterStructures.byName)}}Lo.ProtocolRequestType=osi;class rsi extends eU.NotificationType0{constructor(e){super(e)}}Lo.ProtocolNotificationType0=rsi;class asi extends eU.NotificationType{constructor(e){super(e,eU.ParameterStructures.byName)}}Lo.ProtocolNotificationType=asi;var Iot={},ol={};Object.defineProperty(ol,"__esModule",{value:!0});ol.objectLiteral=ol.typedArray=ol.stringArray=ol.array=ol.func=ol.error=ol.number=ol.string=ol.boolean=void 0;function csi(s){return s===!0||s===!1}ol.boolean=csi;function Tot(s){return typeof s=="string"||s instanceof String}ol.string=Tot;function lsi(s){return typeof s=="number"||s instanceof Number}ol.number=lsi;function dsi(s){return s instanceof Error}ol.error=dsi;function hsi(s){return typeof s=="function"}ol.func=hsi;function Lot(s){return Array.isArray(s)}ol.array=Lot;function usi(s){return Lot(s)&&s.every(e=>Tot(e))}ol.stringArray=usi;function gsi(s,e){return Array.isArray(s)&&s.every(e)}ol.typedArray=gsi;function fsi(s){return s!==null&&typeof s=="object"}ol.objectLiteral=fsi;var ple={};Object.defineProperty(ple,"__esModule",{value:!0});ple.ImplementationRequest=void 0;const b$e=Lo;var w$e;(function(s){s.method="textDocument/implementation",s.messageDirection=b$e.MessageDirection.clientToServer,s.type=new b$e.ProtocolRequestType(s.method)})(w$e||(ple.ImplementationRequest=w$e={}));var mle={};Object.defineProperty(mle,"__esModule",{value:!0});mle.TypeDefinitionRequest=void 0;const y$e=Lo;var C$e;(function(s){s.method="textDocument/typeDefinition",s.messageDirection=y$e.MessageDirection.clientToServer,s.type=new y$e.ProtocolRequestType(s.method)})(C$e||(mle.TypeDefinitionRequest=C$e={}));var tU={};Object.defineProperty(tU,"__esModule",{value:!0});tU.DidChangeWorkspaceFoldersNotification=tU.WorkspaceFoldersRequest=void 0;const bne=Lo;var S$e;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=bne.MessageDirection.serverToClient,s.type=new bne.ProtocolRequestType0(s.method)})(S$e||(tU.WorkspaceFoldersRequest=S$e={}));var A$e;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=bne.MessageDirection.clientToServer,s.type=new bne.ProtocolNotificationType(s.method)})(A$e||(tU.DidChangeWorkspaceFoldersNotification=A$e={}));var _le={};Object.defineProperty(_le,"__esModule",{value:!0});_le.ConfigurationRequest=void 0;const E$e=Lo;var x$e;(function(s){s.method="workspace/configuration",s.messageDirection=E$e.MessageDirection.serverToClient,s.type=new E$e.ProtocolRequestType(s.method)})(x$e||(_le.ConfigurationRequest=x$e={}));var iU={};Object.defineProperty(iU,"__esModule",{value:!0});iU.ColorPresentationRequest=iU.DocumentColorRequest=void 0;const wne=Lo;var D$e;(function(s){s.method="textDocument/documentColor",s.messageDirection=wne.MessageDirection.clientToServer,s.type=new wne.ProtocolRequestType(s.method)})(D$e||(iU.DocumentColorRequest=D$e={}));var k$e;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=wne.MessageDirection.clientToServer,s.type=new wne.ProtocolRequestType(s.method)})(k$e||(iU.ColorPresentationRequest=k$e={}));var nU={};Object.defineProperty(nU,"__esModule",{value:!0});nU.FoldingRangeRefreshRequest=nU.FoldingRangeRequest=void 0;const yne=Lo;var I$e;(function(s){s.method="textDocument/foldingRange",s.messageDirection=yne.MessageDirection.clientToServer,s.type=new yne.ProtocolRequestType(s.method)})(I$e||(nU.FoldingRangeRequest=I$e={}));var T$e;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=yne.MessageDirection.serverToClient,s.type=new yne.ProtocolRequestType0(s.method)})(T$e||(nU.FoldingRangeRefreshRequest=T$e={}));var vle={};Object.defineProperty(vle,"__esModule",{value:!0});vle.DeclarationRequest=void 0;const L$e=Lo;var R$e;(function(s){s.method="textDocument/declaration",s.messageDirection=L$e.MessageDirection.clientToServer,s.type=new L$e.ProtocolRequestType(s.method)})(R$e||(vle.DeclarationRequest=R$e={}));var ble={};Object.defineProperty(ble,"__esModule",{value:!0});ble.SelectionRangeRequest=void 0;const M$e=Lo;var N$e;(function(s){s.method="textDocument/selectionRange",s.messageDirection=M$e.MessageDirection.clientToServer,s.type=new M$e.ProtocolRequestType(s.method)})(N$e||(ble.SelectionRangeRequest=N$e={}));var DD={};Object.defineProperty(DD,"__esModule",{value:!0});DD.WorkDoneProgressCancelNotification=DD.WorkDoneProgressCreateRequest=DD.WorkDoneProgress=void 0;const psi=JN,Cne=Lo;var P$e;(function(s){s.type=new psi.ProgressType;function e(t){return t===s.type}s.is=e})(P$e||(DD.WorkDoneProgress=P$e={}));var F$e;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=Cne.MessageDirection.serverToClient,s.type=new Cne.ProtocolRequestType(s.method)})(F$e||(DD.WorkDoneProgressCreateRequest=F$e={}));var O$e;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=Cne.MessageDirection.clientToServer,s.type=new Cne.ProtocolNotificationType(s.method)})(O$e||(DD.WorkDoneProgressCancelNotification=O$e={}));var kD={};Object.defineProperty(kD,"__esModule",{value:!0});kD.CallHierarchyOutgoingCallsRequest=kD.CallHierarchyIncomingCallsRequest=kD.CallHierarchyPrepareRequest=void 0;const sU=Lo;var B$e;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(B$e||(kD.CallHierarchyPrepareRequest=B$e={}));var W$e;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(W$e||(kD.CallHierarchyIncomingCallsRequest=W$e={}));var H$e;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(H$e||(kD.CallHierarchyOutgoingCallsRequest=H$e={}));var Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.SemanticTokensRefreshRequest=Kf.SemanticTokensRangeRequest=Kf.SemanticTokensDeltaRequest=Kf.SemanticTokensRequest=Kf.SemanticTokensRegistrationType=Kf.TokenFormat=void 0;const qA=Lo;var U$e;(function(s){s.Relative="relative"})(U$e||(Kf.TokenFormat=U$e={}));var h7;(function(s){s.method="textDocument/semanticTokens",s.type=new qA.RegistrationType(s.method)})(h7||(Kf.SemanticTokensRegistrationType=h7={}));var V$e;(function(s){s.method="textDocument/semanticTokens/full",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})(V$e||(Kf.SemanticTokensRequest=V$e={}));var z$e;(function(s){s.method="textDocument/semanticTokens/full/delta",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})(z$e||(Kf.SemanticTokensDeltaRequest=z$e={}));var $$e;(function(s){s.method="textDocument/semanticTokens/range",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})($$e||(Kf.SemanticTokensRangeRequest=$$e={}));var G$e;(function(s){s.method="workspace/semanticTokens/refresh",s.messageDirection=qA.MessageDirection.serverToClient,s.type=new qA.ProtocolRequestType0(s.method)})(G$e||(Kf.SemanticTokensRefreshRequest=G$e={}));var wle={};Object.defineProperty(wle,"__esModule",{value:!0});wle.ShowDocumentRequest=void 0;const K$e=Lo;var q$e;(function(s){s.method="window/showDocument",s.messageDirection=K$e.MessageDirection.serverToClient,s.type=new K$e.ProtocolRequestType(s.method)})(q$e||(wle.ShowDocumentRequest=q$e={}));var yle={};Object.defineProperty(yle,"__esModule",{value:!0});yle.LinkedEditingRangeRequest=void 0;const Q$e=Lo;var j$e;(function(s){s.method="textDocument/linkedEditingRange",s.messageDirection=Q$e.MessageDirection.clientToServer,s.type=new Q$e.ProtocolRequestType(s.method)})(j$e||(yle.LinkedEditingRangeRequest=j$e={}));var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.WillDeleteFilesRequest=Wu.DidDeleteFilesNotification=Wu.DidRenameFilesNotification=Wu.WillRenameFilesRequest=Wu.DidCreateFilesNotification=Wu.WillCreateFilesRequest=Wu.FileOperationPatternKind=void 0;const sv=Lo;var Y$e;(function(s){s.file="file",s.folder="folder"})(Y$e||(Wu.FileOperationPatternKind=Y$e={}));var J$e;(function(s){s.method="workspace/willCreateFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(J$e||(Wu.WillCreateFilesRequest=J$e={}));var X$e;(function(s){s.method="workspace/didCreateFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(X$e||(Wu.DidCreateFilesNotification=X$e={}));var Z$e;(function(s){s.method="workspace/willRenameFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(Z$e||(Wu.WillRenameFilesRequest=Z$e={}));var e7e;(function(s){s.method="workspace/didRenameFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(e7e||(Wu.DidRenameFilesNotification=e7e={}));var t7e;(function(s){s.method="workspace/didDeleteFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(t7e||(Wu.DidDeleteFilesNotification=t7e={}));var i7e;(function(s){s.method="workspace/willDeleteFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(i7e||(Wu.WillDeleteFilesRequest=i7e={}));var ID={};Object.defineProperty(ID,"__esModule",{value:!0});ID.MonikerRequest=ID.MonikerKind=ID.UniquenessLevel=void 0;const n7e=Lo;var s7e;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(s7e||(ID.UniquenessLevel=s7e={}));var o7e;(function(s){s.$import="import",s.$export="export",s.local="local"})(o7e||(ID.MonikerKind=o7e={}));var r7e;(function(s){s.method="textDocument/moniker",s.messageDirection=n7e.MessageDirection.clientToServer,s.type=new n7e.ProtocolRequestType(s.method)})(r7e||(ID.MonikerRequest=r7e={}));var TD={};Object.defineProperty(TD,"__esModule",{value:!0});TD.TypeHierarchySubtypesRequest=TD.TypeHierarchySupertypesRequest=TD.TypeHierarchyPrepareRequest=void 0;const oU=Lo;var a7e;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(a7e||(TD.TypeHierarchyPrepareRequest=a7e={}));var c7e;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(c7e||(TD.TypeHierarchySupertypesRequest=c7e={}));var l7e;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(l7e||(TD.TypeHierarchySubtypesRequest=l7e={}));var rU={};Object.defineProperty(rU,"__esModule",{value:!0});rU.InlineValueRefreshRequest=rU.InlineValueRequest=void 0;const Sne=Lo;var d7e;(function(s){s.method="textDocument/inlineValue",s.messageDirection=Sne.MessageDirection.clientToServer,s.type=new Sne.ProtocolRequestType(s.method)})(d7e||(rU.InlineValueRequest=d7e={}));var h7e;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=Sne.MessageDirection.serverToClient,s.type=new Sne.ProtocolRequestType0(s.method)})(h7e||(rU.InlineValueRefreshRequest=h7e={}));var LD={};Object.defineProperty(LD,"__esModule",{value:!0});LD.InlayHintRefreshRequest=LD.InlayHintResolveRequest=LD.InlayHintRequest=void 0;const aU=Lo;var u7e;(function(s){s.method="textDocument/inlayHint",s.messageDirection=aU.MessageDirection.clientToServer,s.type=new aU.ProtocolRequestType(s.method)})(u7e||(LD.InlayHintRequest=u7e={}));var g7e;(function(s){s.method="inlayHint/resolve",s.messageDirection=aU.MessageDirection.clientToServer,s.type=new aU.ProtocolRequestType(s.method)})(g7e||(LD.InlayHintResolveRequest=g7e={}));var f7e;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=aU.MessageDirection.serverToClient,s.type=new aU.ProtocolRequestType0(s.method)})(f7e||(LD.InlayHintRefreshRequest=f7e={}));var v_={};Object.defineProperty(v_,"__esModule",{value:!0});v_.DiagnosticRefreshRequest=v_.WorkspaceDiagnosticRequest=v_.DocumentDiagnosticRequest=v_.DocumentDiagnosticReportKind=v_.DiagnosticServerCancellationData=void 0;const Rot=JN,msi=ol,cU=Lo;var p7e;(function(s){function e(t){const i=t;return i&&msi.boolean(i.retriggerRequest)}s.is=e})(p7e||(v_.DiagnosticServerCancellationData=p7e={}));var m7e;(function(s){s.Full="full",s.Unchanged="unchanged"})(m7e||(v_.DocumentDiagnosticReportKind=m7e={}));var _7e;(function(s){s.method="textDocument/diagnostic",s.messageDirection=cU.MessageDirection.clientToServer,s.type=new cU.ProtocolRequestType(s.method),s.partialResult=new Rot.ProgressType})(_7e||(v_.DocumentDiagnosticRequest=_7e={}));var v7e;(function(s){s.method="workspace/diagnostic",s.messageDirection=cU.MessageDirection.clientToServer,s.type=new cU.ProtocolRequestType(s.method),s.partialResult=new Rot.ProgressType})(v7e||(v_.WorkspaceDiagnosticRequest=v7e={}));var b7e;(function(s){s.method="workspace/diagnostic/refresh",s.messageDirection=cU.MessageDirection.serverToClient,s.type=new cU.ProtocolRequestType0(s.method)})(b7e||(v_.DiagnosticRefreshRequest=b7e={}));var sl={};Object.defineProperty(sl,"__esModule",{value:!0});sl.DidCloseNotebookDocumentNotification=sl.DidSaveNotebookDocumentNotification=sl.DidChangeNotebookDocumentNotification=sl.NotebookCellArrayChange=sl.DidOpenNotebookDocumentNotification=sl.NotebookDocumentSyncRegistrationType=sl.NotebookDocument=sl.NotebookCell=sl.ExecutionSummary=sl.NotebookCellKind=void 0;const u7=GPe,yb=ol,hC=Lo;var y1e;(function(s){s.Markup=1,s.Code=2;function e(t){return t===1||t===2}s.is=e})(y1e||(sl.NotebookCellKind=y1e={}));var C1e;(function(s){function e(n,o){const r={executionOrder:n};return(o===!0||o===!1)&&(r.success=o),r}s.create=e;function t(n){const o=n;return yb.objectLiteral(o)&&u7.uinteger.is(o.executionOrder)&&(o.success===void 0||yb.boolean(o.success))}s.is=t;function i(n,o){return n===o?!0:n==null||o===null||o===void 0?!1:n.executionOrder===o.executionOrder&&n.success===o.success}s.equals=i})(C1e||(sl.ExecutionSummary=C1e={}));var Ane;(function(s){function e(o,r){return{kind:o,document:r}}s.create=e;function t(o){const r=o;return yb.objectLiteral(r)&&y1e.is(r.kind)&&u7.DocumentUri.is(r.document)&&(r.metadata===void 0||yb.objectLiteral(r.metadata))}s.is=t;function i(o,r){const a=new Set;return o.document!==r.document&&a.add("document"),o.kind!==r.kind&&a.add("kind"),o.executionSummary!==r.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||r.metadata!==void 0)&&!n(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!C1e.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}s.diff=i;function n(o,r){if(o===r)return!0;if(o==null||r===null||r===void 0||typeof o!=typeof r||typeof o!="object")return!1;const a=Array.isArray(o),c=Array.isArray(r);if(a!==c)return!1;if(a&&c){if(o.length!==r.length)return!1;for(let l=0;l0}le.hasId=dr})(yt||(s.StaticRegistrationOptions=yt={}));var Ne;(function(le){function dr(io){const un=io;return un&&(un.documentSelector===null||Y.is(un.documentSelector))}le.is=dr})(Ne||(s.TextDocumentRegistrationOptions=Ne={}));var lt;(function(le){function dr(un){const Se=un;return i.objectLiteral(Se)&&(Se.workDoneProgress===void 0||i.boolean(Se.workDoneProgress))}le.is=dr;function io(un){const Se=un;return Se&&i.boolean(Se.workDoneProgress)}le.hasWorkDoneProgress=io})(lt||(s.WorkDoneProgressOptions=lt={}));var xt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(xt||(s.InitializeRequest=xt={}));var Ji;(function(le){le.unknownProtocolVersion=1})(Ji||(s.InitializeErrorCodes=Ji={}));var Ii;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ii||(s.InitializedNotification=Ii={}));var ns;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(ns||(s.ShutdownRequest=ns={}));var zs;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(zs||(s.ExitNotification=zs={}));var Pn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Pn||(s.DidChangeConfigurationNotification=Pn={}));var Xr;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(Xr||(s.MessageType=Xr={}));var ds;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ds||(s.ShowMessageNotification=ds={}));var Zo;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(Zo||(s.ShowMessageRequest=Zo={}));var Zr;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Zr||(s.LogMessageNotification=Zr={}));var Di;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Di||(s.TelemetryEventNotification=Di={}));var ss;(function(le){le.None=0,le.Full=1,le.Incremental=2})(ss||(s.TextDocumentSyncKind=ss={}));var Oo;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Oo||(s.DidOpenTextDocumentNotification=Oo={}));var Tn;(function(le){function dr(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range!==void 0&&(Se.rangeLength===void 0||typeof Se.rangeLength=="number")}le.isIncremental=dr;function io(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range===void 0&&Se.rangeLength===void 0}le.isFull=io})(Tn||(s.TextDocumentContentChangeEvent=Tn={}));var Ba;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ba||(s.DidChangeTextDocumentNotification=Ba={}));var vd;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(vd||(s.DidCloseTextDocumentNotification=vd={}));var Fn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Fn||(s.DidSaveTextDocumentNotification=Fn={}));var th;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(th||(s.TextDocumentSaveReason=th={}));var pc;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(pc||(s.WillSaveTextDocumentNotification=pc={}));var zc;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zc||(s.WillSaveTextDocumentWaitUntilRequest=zc={}));var $s;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})($s||(s.DidChangeWatchedFilesNotification=$s={}));var tc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(tc||(s.FileChangeType=tc={}));var fl;(function(le){function dr(io){const un=io;return i.objectLiteral(un)&&(t.URI.is(un.baseUri)||t.WorkspaceFolder.is(un.baseUri))&&i.string(un.pattern)}le.is=dr})(fl||(s.RelativePattern=fl={}));var ih;(function(le){le.Create=1,le.Change=2,le.Delete=4})(ih||(s.WatchKind=ih={}));var gg;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(gg||(s.PublishDiagnosticsNotification=gg={}));var mc;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(mc||(s.CompletionTriggerKind=mc={}));var $c;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($c||(s.CompletionRequest=$c={}));var nh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nh||(s.CompletionResolveRequest=nh={}));var Dc;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dc||(s.HoverRequest=Dc={}));var pl;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(pl||(s.SignatureHelpTriggerKind=pl={}));var ic;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ic||(s.SignatureHelpRequest=ic={}));var Or;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Or||(s.DefinitionRequest=Or={}));var ml;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ml||(s.ReferencesRequest=ml={}));var sh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(sh||(s.DocumentHighlightRequest=sh={}));var oh;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(oh||(s.DocumentSymbolRequest=oh={}));var Gc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Gc||(s.CodeActionRequest=Gc={}));var Kc;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Kc||(s.CodeActionResolveRequest=Kc={}));var Wa;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wa||(s.WorkspaceSymbolRequest=Wa={}));var Bo;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Bo||(s.WorkspaceSymbolResolveRequest=Bo={}));var Is;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Is||(s.CodeLensRequest=Is={}));var kc;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(kc||(s.CodeLensResolveRequest=kc={}));var Nh;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Nh||(s.CodeLensRefreshRequest=Nh={}));var be;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(be||(s.DocumentLinkRequest=be={}));var Aa;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Aa||(s.DocumentLinkResolveRequest=Aa={}));var ee;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ee||(s.DocumentFormattingRequest=ee={}));var xe;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(xe||(s.DocumentRangeFormattingRequest=xe={}));var gt;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(gt||(s.DocumentRangesFormattingRequest=gt={}));var zn;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zn||(s.DocumentOnTypeFormattingRequest=zn={}));var Cs;(function(le){le.Identifier=1})(Cs||(s.PrepareSupportDefaultBehavior=Cs={}));var Wo;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wo||(s.RenameRequest=Wo={}));var Ha;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ha||(s.PrepareRenameRequest=Ha={}));var ea;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ea||(s.ExecuteCommandRequest=ea={}));var Ph;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ph||(s.ApplyWorkspaceEditRequest=Ph={}))})(Iot);var Sle={};Object.defineProperty(Sle,"__esModule",{value:!0});Sle.createProtocolConnection=void 0;const k7e=JN;function _si(s,e,t,i){return k7e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,k7e.createMessageConnection)(s,e,t,i)}Sle.createProtocolConnection=_si;(function(s){var e=rd&&rd.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=rd&&rd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.LSPErrorCodes=s.createProtocolConnection=void 0,t(JN,s),t(GPe,s),t(Lo,s),t(Iot,s);var i=Sle;Object.defineProperty(s,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var n;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(n||(s.LSPErrorCodes=n={}))})(kot);(function(s){var e=rd&&rd.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=rd&&rd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.createProtocolConnection=void 0;const i=m$e;t(m$e,s),t(kot,s);function n(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}s.createProtocolConnection=n})(ps);var Mn={};const Xn=wot(GKt);var kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.asPromise=kr.thenable=kr.typedArray=kr.stringArray=kr.array=kr.func=kr.error=kr.number=kr.string=kr.boolean=void 0;function vsi(s){return s===!0||s===!1}kr.boolean=vsi;function Mot(s){return typeof s=="string"||s instanceof String}kr.string=Mot;function bsi(s){return typeof s=="number"||s instanceof Number}kr.number=bsi;function wsi(s){return s instanceof Error}kr.error=wsi;function Not(s){return typeof s=="function"}kr.func=Not;function Pot(s){return Array.isArray(s)}kr.array=Pot;function ysi(s){return Pot(s)&&s.every(e=>Mot(e))}kr.stringArray=ysi;function Csi(s,e){return Array.isArray(s)&&s.every(e)}kr.typedArray=Csi;function Fot(s){return s&&Not(s.then)}kr.thenable=Fot;function Ssi(s){return s instanceof Promise?s:Fot(s)?new Promise((e,t)=>{s.then(i=>e(i),i=>t(i))}):Promise.resolve(s)}kr.asPromise=Ssi;var or={};Object.defineProperty(or,"__esModule",{value:!0});or.generateUuid=or.parse=or.isUUID=or.v4=or.empty=void 0;class KPe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class so extends KPe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return so._oneOf(so._chars)}constructor(){super([so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-","4",so._randomHex(),so._randomHex(),so._randomHex(),"-",so._oneOf(so._timeHighBits),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex()].join(""))}}so._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];so._timeHighBits=["8","9","a","b"];or.empty=new KPe("00000000-0000-0000-0000-000000000000");function Oot(){return new so}or.v4=Oot;const Asi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Bot(s){return Asi.test(s)}or.isUUID=Bot;function Esi(s){if(!Bot(s))throw new Error("invalid uuid");return new KPe(s)}or.parse=Esi;function xsi(){return Oot().asHex()}or.generateUuid=xsi;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.WorkspaceFeature=Mn.TextDocumentLanguageFeature=Mn.TextDocumentEventFeature=Mn.DynamicDocumentFeature=Mn.DynamicFeature=Mn.StaticFeature=Mn.ensure=Mn.LSPCancellationError=void 0;const sL=Xn,cge=ps,Ug=kr,I7e=or;class Dsi extends sL.CancellationError{constructor(e){super(),this.data=e}}Mn.LSPCancellationError=Dsi;function ksi(s,e){return s[e]===void 0&&(s[e]={}),s[e]}Mn.ensure=ksi;var T7e;(function(s){function e(t){const i=t;return i!=null&&Ug.func(i.fillClientCapabilities)&&Ug.func(i.initialize)&&Ug.func(i.getState)&&Ug.func(i.clear)&&(i.fillInitializeParams===void 0||Ug.func(i.fillInitializeParams))}s.is=e})(T7e||(Mn.StaticFeature=T7e={}));var L7e;(function(s){function e(t){const i=t;return i!=null&&Ug.func(i.fillClientCapabilities)&&Ug.func(i.initialize)&&Ug.func(i.getState)&&Ug.func(i.clear)&&(i.fillInitializeParams===void 0||Ug.func(i.fillInitializeParams))&&Ug.func(i.register)&&Ug.func(i.unregister)&&i.registrationType!==void 0}s.is=e})(L7e||(Mn.DynamicFeature=L7e={}));class qPe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const n of e){t++;for(const o of sL.workspace.textDocuments)if(sL.languages.match(n,o)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}const i=t>0;return{kind:"document",id:this.registrationType.method,registrations:i,matches:!1}}}Mn.DynamicDocumentFeature=qPe;class Isi extends qPe{static textDocumentFilter(e,t){for(const i of e)if(sL.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,n,o,r,a){super(e),this._event=t,this._type=i,this._middleware=n,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new sL.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(i=>{this._client.error(`Sending document notification ${this._type.method} failed.`,i)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){const t=async i=>{const n=this._createParams(i);await this._client.sendNotification(this._type,n),this.notificationSent(this.getTextDocument(i),this._type,n)};if(this.matches(e)){const i=this._middleware();return i?i(e,n=>t(n)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(const t of this._selectors.values())if(sL.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}Mn.TextDocumentEventFeature=Isi;class Tsi extends qPe{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(const e of this._registrations.values()){const t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(cge.TextDocumentRegistrationOptions.is(t)){const i=cge.StaticRegistrationOptions.hasId(t)?t.id:I7e.generateUuid(),n=t.documentSelector??e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if(Ug.boolean(t)&&t===!0||cge.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Ug.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[I7e.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Ug.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(const t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&sL.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(i),e)>0)return t.provider}}getAllProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}Mn.TextDocumentLanguageFeature=Tsi;class Lsi{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){const e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){const t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}Mn.WorkspaceFeature=Lsi;var bA={};const Rsi=typeof process=="object"&&process&&process.platform==="win32";var Msi=Rsi?{sep:"\\"}:{sep:"/"},Nsi=Wot;function Wot(s,e,t){s instanceof RegExp&&(s=R7e(s,t)),e instanceof RegExp&&(e=R7e(e,t));var i=Hot(s,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+s.length,i[1]),post:t.slice(i[1]+e.length)}}function R7e(s,e){var t=e.match(s);return t?t[0]:null}Wot.range=Hot;function Hot(s,e,t){var i,n,o,r,a,c=t.indexOf(s),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(s===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(s,d+1)):i.length==1?a=[i.pop(),l]:(n=i.pop(),n=0?c:l;i.length&&(a=[o,r])}return a}var Uot=Nsi,Psi=Bsi,Vot="\0SLASH"+Math.random()+"\0",zot="\0OPEN"+Math.random()+"\0",QPe="\0CLOSE"+Math.random()+"\0",$ot="\0COMMA"+Math.random()+"\0",Got="\0PERIOD"+Math.random()+"\0";function lge(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function Fsi(s){return s.split("\\\\").join(Vot).split("\\{").join(zot).split("\\}").join(QPe).split("\\,").join($ot).split("\\.").join(Got)}function Osi(s){return s.split(Vot).join("\\").split(zot).join("{").split(QPe).join("}").split($ot).join(",").split(Got).join(".")}function Kot(s){if(!s)return[""];var e=[],t=Uot("{","}",s);if(!t)return s.split(",");var i=t.pre,n=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+n+"}";var a=Kot(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function Bsi(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),$V(Fsi(s),!0).map(Osi)):[]}function Wsi(s){return"{"+s+"}"}function Hsi(s){return/^-?0\d/.test(s)}function Usi(s,e){return s<=e}function Vsi(s,e){return s>=e}function $V(s,e){var t=[],i=Uot("{","}",s);if(!i)return[s];var n=i.pre,o=i.post.length?$V(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+QPe+i.post,$V(s)):[s];var u;if(d)u=i.body.split(/\.\./);else if(u=Kot(i.body),u.length===1&&(u=$V(u[0],!1).map(Wsi),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=lge(u[0]),m=lge(u[1]),v=Math.max(u[0].length,u[1].length),b=u.length==3?Math.abs(lge(u[2])):1,w=Usi,y=m0){var P=new Array(k+1).join("0");A<0?L="-"+P+L.slice(1):L=P+L}}f.push(L)}}else{f=[];for(var R=0;R(Ene(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ele(e,t).match(s));var Ale=cm;const S1e=Msi;cm.sep=S1e.sep;const Ev=Symbol("globstar **");cm.GLOBSTAR=Ev;const zsi=Psi,M7e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},A1e="[^/]",dge=A1e+"*?",$si="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Gsi="(?:(?!(?:\\/|^)\\.).)*?",qot=s=>s.split("").reduce((e,t)=>(e[t]=!0,e),{}),N7e=qot("().*{}+?[]^$\\!"),Ksi=qot("[.("),P7e=/\/+/;cm.filter=(s,e={})=>(t,i,n)=>cm(t,s,e);const _E=(s,e={})=>{const t={};return Object.keys(s).forEach(i=>t[i]=s[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};cm.defaults=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return cm;const e=cm,t=(i,n,o)=>e(i,n,_E(s,o));return t.Minimatch=class extends e.Minimatch{constructor(n,o){super(n,_E(s,o))}},t.Minimatch.defaults=i=>e.defaults(_E(s,i)).Minimatch,t.filter=(i,n)=>e.filter(i,_E(s,n)),t.defaults=i=>e.defaults(_E(s,i)),t.makeRe=(i,n)=>e.makeRe(i,_E(s,n)),t.braceExpand=(i,n)=>e.braceExpand(i,_E(s,n)),t.match=(i,n,o)=>e.match(i,n,_E(s,o)),t};cm.braceExpand=(s,e)=>Qot(s,e);const Qot=(s,e={})=>(Ene(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:zsi(s)),qsi=1024*64,Ene=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>qsi)throw new TypeError("pattern is too long")},hge=Symbol("subparse");cm.makeRe=(s,e)=>new Ele(s,e||{}).makeRe();cm.match=(s,e,t={})=>{const i=new Ele(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};const Qsi=s=>s.replace(/\\(.)/g,"$1"),jsi=s=>s.replace(/\\([^-\]])/g,"$1"),Ysi=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Jsi=s=>s.replace(/[[\]\\]/g,"\\$&");class Ele{constructor(e,t){Ene(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let i=this.globSet=this.braceExpand();t.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,i),i=this.globParts=i.map(n=>n.split(P7e)),this.debug(this.pattern,i),i=i.map((n,o,r)=>n.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(n=>n.indexOf(!1)===-1),this.debug(this.pattern,i),this.set=i}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,i=0;for(let n=0;n>> no match, partial?`,e,h,t,u),h===a))}var p;if(typeof l=="string"?(p=d===l,this.debug("string match",l,d,p)):(p=d.match(l),this.debug("pattern match",l,d,p)),!p)return!1}if(o===a&&r===c)return!0;if(o===a)return i;if(r===c)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Qot(this.pattern,this.options)}parse(e,t){Ene(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Ev;if(e==="")return"";let n="",o=!1,r=!1;const a=[],c=[];let l,d=!1,h=-1,u=-1,f,p,m,v=e.charAt(0)===".",b=i.dot||v;const w=()=>v?"":b?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=k=>k.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=()=>{if(l){switch(l){case"*":n+=dge,o=!0;break;case"?":n+=A1e,o=!0;break;default:n+="\\"+l;break}this.debug("clearStateChar %j %j",l,n),l=!1}};for(let k=0,P;k(G||(G="\\"),z+z+G+"|")),this.debug(`tail=%j + %s`,k,k,p,n);const P=p.type==="*"?dge:p.type==="?"?A1e:"\\"+p.type;o=!0,n=n.slice(0,p.reStart)+P+"\\("+k}C(),r&&(n+="\\\\");const A=Ksi[n.charAt(0)];for(let k=c.length-1;k>-1;k--){const P=c[k],R=n.slice(0,P.reStart),z=n.slice(P.reStart,P.reEnd-8);let G=n.slice(P.reEnd);const Y=n.slice(P.reEnd-8,P.reEnd)+G,j=R.split(")").length,ne=R.split("(").length-j;let ge=G;for(let Oe=0;Oe(r=r.map(a=>typeof a=="string"?Ysi(a):a===Ev?Ev:a._src).reduce((a,c)=>(a[a.length-1]===Ev&&c===Ev||a.push(c),a),[]),r.forEach((a,c)=>{a!==Ev||r[c-1]===Ev||(c===0?r.length>1?r[c+1]="(?:\\/|"+i+"\\/)?"+r[c+1]:r[c]=i:c===r.length-1?r[c-1]+="(?:\\/|"+i+")?":(r[c-1]+="(?:\\/|\\/"+i+"\\/)"+r[c+1],r[c+1]=Ev))}),r.filter(a=>a!==Ev).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,n)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const i=this.options;S1e.sep!=="/"&&(e=e.split(S1e.sep).join("/")),e=e.split(P7e),this.debug(this.pattern,"split",e);const n=this.set;this.debug(this.pattern,"set",n);let o;for(let r=e.length-1;r>=0&&(o=e[r],!o);r--);for(let r=0;r{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,n=new Set;Tz.fillTabResources(n);const o=new Set,r=new Set(n);for(const a of i.values())n.has(a)?r.delete(a):o.add(a);if(this.open=n,o.size>0){const a=new Set;for(const c of o)a.add(ko.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(ko.Uri.parse(c));this._onOpen.fire(a)}};ko.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=ko.window.tabGroups.onDidChangeTabs(e):this.disposable={dispose:()=>{}}}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof ko.Uri?ko.window.activeTextEditor?.document.uri===e:ko.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof ko.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return Tz.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const n of ko.window.tabGroups.all)for(const o of n.tabs){const r=o.input;let a;r instanceof ko.TabInputText?a=r.uri:r instanceof ko.TabInputTextDiff?a=r.modified:r instanceof ko.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Ud;(function(s){s[s.document=1]="document",s[s.workspace=2]="workspace"})(Ud||(Ud={}));var NS;(function(s){function e(t){return t instanceof ko.Uri?t.toString():t.uri.toString()}s.asKey=e})(NS||(NS={}));class eoi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const n=e===Ud.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof ko.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=n.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},n.set(o,c)),c}update(e,t,i,n){const o=e===Ud.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof ko.Uri?[t.toString(),t,i,n]:[t.uri.toString(),t.uri,t.version,i];let d=o.get(r);d===void 0?(d={document:a,pulledVersion:c,resultId:l},o.set(r,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=NS.asKey(t);(e===Ud.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=NS.asKey(t);return(e===Ud.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=NS.asKey(t);return(e===Ud.document?this.documentPullStates:this.workspacePullStates).get(i)?.resultId}getAllResultIds(){const e=[];for(let[t,i]of this.workspacePullStates)this.documentPullStates.has(t)&&(i=this.documentPullStates.get(t)),i.resultId!==void 0&&e.push({uri:t,value:i.resultId});return e}}class toi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new ko.EventEmitter,this.provider=this.createProvider(),this.diagnostics=ko.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new eoi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof ko.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(i.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;const i=e instanceof ko.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},n=>{this.client.error(`Document pull failed for text document ${i.toString()}`,n,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof ko.Uri,n=i?e:e.uri,o=n.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Ud.document,e,t):this.documentStates.track(Ud.document,e);if(r===void 0){const c=new ko.CancellationTokenSource;this.openRequests.set(o,{state:wu.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof E1e.LSPCancellationError&&nl.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:wu.outDated,document:e}),d===void 0&&h instanceof ko.CancellationError)d={state:wu.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(o),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${o}`),this.diagnostics.delete(n);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Ud.document,e);return}if(d.state===wu.outDated)return;l!==void 0&&(l.kind===Qm.DocumentDiagnosticReportKind.full&&this.diagnostics.set(n,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===wu.reschedule&&this.pull(e)}else r.state===wu.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:wu.reschedule,document:r.document})):r.state===wu.outDated&&this.openRequests.set(o,{state:wu.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof ko.Uri?e:e.uri,i=t.toString(),n=this.openRequests.get(i);this.options.workspaceDiagnostics?n!==void 0?this.openRequests.set(i,{state:wu.reschedule,document:e}):this.pull(e,()=>{this.forget(Ud.document,e)}):(n!==void 0&&(n.state===wu.active&&n.tokenSource.cancel(),this.openRequests.set(i,{state:wu.outDated,document:e})),this.diagnostics.delete(t),this.forget(Ud.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,nl.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof E1e.LSPCancellationError)&&!nl.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,nl.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new ko.CancellationTokenSource;const e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(const i of t.items)i.kind===Qm.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Ud.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Ud.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,n)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof ko.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(nl.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}:h.kind===nl.DocumentDiagnosticReportKind.Full?{kind:Qm.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Qm.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(nl.DocumentDiagnosticRequest.type,l,h,{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,n,o):o(t,i,n)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,n)=>{const o=async l=>l.kind===nl.DocumentDiagnosticReportKind.Full?{kind:Qm.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,i)}:{kind:Qm.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},r=l=>{const d=[];for(const h of l)d.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return d},a=(l,d)=>{const h=(0,Zsi.generateUuid)(),u=this.client.onProgress(nl.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){n(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}n(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(nl.WorkspaceDiagnosticRequest.type,f,d).then(async p=>{if(d.isCancellationRequested)return{items:[]};const m={items:[]};for(const v of p.items)m.items.push(await o(v));return u.dispose(),n(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(nl.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,n,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===wu.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:wu.outDated,document:t.document});this.diagnostics.dispose()}}class ioi{constructor(e){this.diagnosticRequestor=e,this.documents=new nl.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=NS.asKey(e);this.documents.has(t)||(this.documents.set(t,e,nl.Touch.Last),this.trigger())}remove(e){const t=NS.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,nl.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=NS.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,nl.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument!==void 0?NS.asKey(this.endDocument):void 0}}class noi{constructor(e,t,i){const n=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(n.match!==void 0)return n.match(m,p);for(const v of m)if(nl.TextDocumentFilter.is(v)){if(typeof v=="string"||v.language!==void 0&&v.language!=="*"||v.scheme!==void 0&&v.scheme!=="*"&&v.scheme!==p.scheme)return!1;if(v.pattern!==void 0){const b=new Xsi.Minimatch(v.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},c=p=>p instanceof ko.Uri?a(p):ko.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof ko.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new toi(e,t,i),this.backgroundScheduler=new ioi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=ko.window.activeTextEditor?.document,ko.window.onDidChangeActiveTextEditor(p=>{const m=this.activeTextDocument;this.activeTextDocument=p?.document,m!==void 0&&d(m),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});const h=e.getFeature(nl.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Ud.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Ud.document,m))continue;const v=m.toString();let b;for(const w of ko.workspace.textDocuments)if(v===w.uri.toString()){b=w;break}b!==void 0&&c(b)&&this.diagnosticRequestor.pull(b,()=>{d(b)})}}));const u=new Set;for(const p of ko.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(n.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(n.onChange===!0){const p=e.getFeature(nl.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,xne.onType))&&this.diagnosticRequestor.knows(Ud.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(n.onSave===!0){const p=e.getFeature(nl.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,xne.onSave))&&this.diagnosticRequestor.knows(Ud.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(nl.DidCloseTextDocumentNotification.method);r.push(f.onNotificationSent(p=>{this.cleanUpDocument(p.textDocument)})),t.onClose(p=>{for(const m of p)this.cleanUpDocument(m)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(const p of ko.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=ko.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Ud.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class soi extends E1e.TextDocumentLanguageFeature{constructor(e){super(e,nl.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=JK(JK(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,JK(JK(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(nl.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[n,o]=this.getRegistration(t,e.diagnosticProvider);!n||!o||this.register({id:n,registerOptions:o})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new Tz);const t=new noi(this._client,this.tabs,e);return[t.disposable,t]}}bA.DiagnosticFeature=soi;var vh={},xle={},yh={};Object.defineProperty(yh,"__esModule",{value:!0});yh.forEach=yh.mapAsync=yh.map=yh.clearTestMode=yh.setTestMode=yh.Semaphore=yh.Delayer=void 0;const mG=ps;class ooi{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,mG.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}}yh.Delayer=ooi;class roi{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,mG.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}yh.Semaphore=roi;let jPe=!1;function aoi(){jPe=!0}yh.setTestMode=aoi;function coi(){jPe=!1}yh.clearTestMode=coi;const F7e=15;class YPe{constructor(e=F7e){this.yieldAfter=jPe===!0?Math.max(e,2):Math.max(e,F7e),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){const e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}}async function loi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new YPe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,mG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}yh.map=loi;async function doi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new YPe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,mG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}yh.mapAsync=doi;async function hoi(s,e,t,i){if(s.length===0)return;const n=new YPe(i?.yieldAfter);function o(a){n.start();for(let c=a;c{(0,mG.RAL)().timer.setImmediate(()=>{a(o(r))})})}yh.forEach=hoi;var Dle={};Object.defineProperty(Dle,"__esModule",{value:!0});const uoi=Xn;class goi extends uoi.CompletionItem{constructor(e){super(e)}}Dle.default=goi;var kle={};Object.defineProperty(kle,"__esModule",{value:!0});const foi=Xn;class poi extends foi.CodeLens{constructor(e){super(e)}}kle.default=poi;var Ile={};Object.defineProperty(Ile,"__esModule",{value:!0});const moi=Xn;class _oi extends moi.DocumentLink{constructor(e,t){super(e,t)}}Ile.default=_oi;var Tle={};Object.defineProperty(Tle,"__esModule",{value:!0});const voi=Xn;class boi extends voi.CodeAction{constructor(e,t){super(e),this.data=t}}Tle.default=boi;var bN={};Object.defineProperty(bN,"__esModule",{value:!0});bN.ProtocolDiagnostic=bN.DiagnosticCode=void 0;const woi=Xn,uge=kr;var O7e;(function(s){function e(t){const i=t;return i!=null&&(uge.number(i.value)||uge.string(i.value))&&uge.string(i.target)}s.is=e})(O7e||(bN.DiagnosticCode=O7e={}));class yoi extends woi.Diagnostic{constructor(e,t,i,n){super(e,t,i),this.data=n,this.hasDiagnosticCode=!1}}bN.ProtocolDiagnostic=yoi;var Lle={};Object.defineProperty(Lle,"__esModule",{value:!0});const Coi=Xn;class Soi extends Coi.CallHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Lle.default=Soi;var Rle={};Object.defineProperty(Rle,"__esModule",{value:!0});const Aoi=Xn;class Eoi extends Aoi.TypeHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Rle.default=Eoi;var Mle={};Object.defineProperty(Mle,"__esModule",{value:!0});const XK=Xn;class xoi extends XK.SymbolInformation{constructor(e,t,i,n,o){const r=!(n instanceof XK.Uri);super(e,t,i,r?n:new XK.Location(n,new XK.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}Mle.default=xoi;var Nle={};Object.defineProperty(Nle,"__esModule",{value:!0});const Doi=Xn;class koi extends Doi.InlayHint{constructor(e,t,i){super(e,t,i)}}Nle.default=koi;Object.defineProperty(xle,"__esModule",{value:!0});xle.createConverter=void 0;const Fl=Xn,ms=ps,QI=kr,B7e=yh,Ioi=Dle,Toi=kle,Loi=Ile,W7e=Tle,H7e=bN,Roi=Lle,Moi=Rle,Noi=Mle,Poi=Nle;var x1e;(function(s){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}s.is=e})(x1e||(x1e={}));function Foi(s){const t=s||(ee=>ee.toString());function i(ee){return t(ee)}function n(ee){return{uri:t(ee.uri)}}function o(ee){return{uri:t(ee.uri),languageId:ee.languageId,version:ee.version,text:ee.getText()}}function r(ee){return{uri:t(ee.uri),version:ee.version}}function a(ee){return{textDocument:o(ee)}}function c(ee){const xe=ee;return!!xe.document&&!!xe.contentChanges}function l(ee){const xe=ee;return!!xe.uri&&!!xe.version}function d(ee,xe,gt){if(l(ee))return{textDocument:{uri:t(ee.uri),version:ee.version},contentChanges:[{text:ee.getText()}]};if(c(ee)){const zn=xe,Cs=gt;return{textDocument:{uri:t(zn),version:Cs},contentChanges:ee.contentChanges.map(Ha=>{const ea=Ha.range;return{range:{start:{line:ea.start.line,character:ea.start.character},end:{line:ea.end.line,character:ea.end.character}},rangeLength:Ha.rangeLength,text:Ha.text}})}}else throw Error("Unsupported text document change parameter")}function h(ee){return{textDocument:n(ee)}}function u(ee,xe=!1){let gt={textDocument:n(ee)};return xe&&(gt.text=ee.getText()),gt}function f(ee){switch(ee){case Fl.TextDocumentSaveReason.Manual:return ms.TextDocumentSaveReason.Manual;case Fl.TextDocumentSaveReason.AfterDelay:return ms.TextDocumentSaveReason.AfterDelay;case Fl.TextDocumentSaveReason.FocusOut:return ms.TextDocumentSaveReason.FocusOut}return ms.TextDocumentSaveReason.Manual}function p(ee){return{textDocument:n(ee.document),reason:f(ee.reason)}}function m(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function v(ee){return{files:ee.files.map(xe=>({oldUri:t(xe.oldUri),newUri:t(xe.newUri)}))}}function b(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function w(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function y(ee){return{files:ee.files.map(xe=>({oldUri:t(xe.oldUri),newUri:t(xe.newUri)}))}}function C(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function A(ee,xe){return{textDocument:n(ee),position:ge(xe)}}function L(ee){switch(ee){case Fl.CompletionTriggerKind.TriggerCharacter:return ms.CompletionTriggerKind.TriggerCharacter;case Fl.CompletionTriggerKind.TriggerForIncompleteCompletions:return ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return ms.CompletionTriggerKind.Invoked}}function k(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{triggerKind:L(gt.triggerKind),triggerCharacter:gt.triggerCharacter}}}function P(ee){switch(ee){case Fl.SignatureHelpTriggerKind.Invoke:return ms.SignatureHelpTriggerKind.Invoked;case Fl.SignatureHelpTriggerKind.TriggerCharacter:return ms.SignatureHelpTriggerKind.TriggerCharacter;case Fl.SignatureHelpTriggerKind.ContentChange:return ms.SignatureHelpTriggerKind.ContentChange}}function R(ee){return{label:ee.label}}function z(ee){return ee.map(R)}function G(ee){return{label:ee.label,parameters:z(ee.parameters)}}function Y(ee){return ee.map(G)}function j(ee){return ee===void 0?ee:{signatures:Y(ee.signatures),activeSignature:ee.activeSignature,activeParameter:ee.activeParameter}}function ne(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{isRetrigger:gt.isRetrigger,triggerCharacter:gt.triggerCharacter,triggerKind:P(gt.triggerKind),activeSignatureHelp:j(gt.activeSignatureHelp)}}}function ge(ee){return{line:ee.line,character:ee.character}}function De(ee){return ee==null?ee:{line:ee.line>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.line,character:ee.character>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.character}}function Oe(ee,xe){return B7e.map(ee,De,xe)}function yt(ee){return ee.map(De)}function Ne(ee){return ee==null?ee:{start:De(ee.start),end:De(ee.end)}}function lt(ee){return ee.map(Ne)}function xt(ee){return ee==null?ee:ms.Location.create(i(ee.uri),Ne(ee.range))}function Ji(ee){switch(ee){case Fl.DiagnosticSeverity.Error:return ms.DiagnosticSeverity.Error;case Fl.DiagnosticSeverity.Warning:return ms.DiagnosticSeverity.Warning;case Fl.DiagnosticSeverity.Information:return ms.DiagnosticSeverity.Information;case Fl.DiagnosticSeverity.Hint:return ms.DiagnosticSeverity.Hint}}function Ii(ee){if(!ee)return;let xe=[];for(let gt of ee){let zn=ns(gt);zn!==void 0&&xe.push(zn)}return xe.length>0?xe:void 0}function ns(ee){switch(ee){case Fl.DiagnosticTag.Unnecessary:return ms.DiagnosticTag.Unnecessary;case Fl.DiagnosticTag.Deprecated:return ms.DiagnosticTag.Deprecated;default:return}}function zs(ee){return{message:ee.message,location:xt(ee.location)}}function Pn(ee){return ee.map(zs)}function Xr(ee){if(ee!=null)return QI.number(ee)||QI.string(ee)?ee:{value:ee.value,target:i(ee.target)}}function ds(ee){const xe=ms.Diagnostic.create(Ne(ee.range),ee.message),gt=ee instanceof H7e.ProtocolDiagnostic?ee:void 0;gt!==void 0&>.data!==void 0&&(xe.data=gt.data);const zn=Xr(ee.code);return H7e.DiagnosticCode.is(zn)?gt!==void 0&>.hasDiagnosticCode?xe.code=zn:(xe.code=zn.value,xe.codeDescription={href:zn.target}):xe.code=zn,QI.number(ee.severity)&&(xe.severity=Ji(ee.severity)),Array.isArray(ee.tags)&&(xe.tags=Ii(ee.tags)),ee.relatedInformation&&(xe.relatedInformation=Pn(ee.relatedInformation)),ee.source&&(xe.source=ee.source),xe}function Zo(ee,xe){return ee==null?ee:B7e.map(ee,ds,xe)}function Zr(ee){return ee==null?ee:ee.map(ds)}function Di(ee,xe){switch(ee){case"$string":return xe;case ms.MarkupKind.PlainText:return{kind:ee,value:xe};case ms.MarkupKind.Markdown:return{kind:ee,value:xe.value};default:return`Unsupported Markup content received. Kind is: ${ee}`}}function ss(ee){switch(ee){case Fl.CompletionItemTag.Deprecated:return ms.CompletionItemTag.Deprecated}}function Oo(ee){if(ee===void 0)return ee;const xe=[];for(let gt of ee){const zn=ss(gt);zn!==void 0&&xe.push(zn)}return xe}function Tn(ee,xe){return xe!==void 0?xe:ee+1}function Ba(ee,xe=!1){let gt,zn;QI.string(ee.label)?gt=ee.label:(gt=ee.label.label,xe&&(ee.label.detail!==void 0||ee.label.description!==void 0)&&(zn={detail:ee.label.detail,description:ee.label.description}));let Cs={label:gt};zn!==void 0&&(Cs.labelDetails=zn);let Wo=ee instanceof Ioi.default?ee:void 0;ee.detail&&(Cs.detail=ee.detail),ee.documentation&&(!Wo||Wo.documentationFormat==="$string"?Cs.documentation=ee.documentation:Cs.documentation=Di(Wo.documentationFormat,ee.documentation)),ee.filterText&&(Cs.filterText=ee.filterText),vd(Cs,ee),QI.number(ee.kind)&&(Cs.kind=Tn(ee.kind,Wo&&Wo.originalItemKind)),ee.sortText&&(Cs.sortText=ee.sortText),ee.additionalTextEdits&&(Cs.additionalTextEdits=pc(ee.additionalTextEdits)),ee.commitCharacters&&(Cs.commitCharacters=ee.commitCharacters.slice()),ee.command&&(Cs.command=Or(ee.command)),(ee.preselect===!0||ee.preselect===!1)&&(Cs.preselect=ee.preselect);const Ha=Oo(ee.tags);if(Wo){if(Wo.data!==void 0&&(Cs.data=Wo.data),Wo.deprecated===!0||Wo.deprecated===!1){if(Wo.deprecated===!0&&Ha!==void 0&&Ha.length>0){const ea=Ha.indexOf(Fl.CompletionItemTag.Deprecated);ea!==-1&&Ha.splice(ea,1)}Cs.deprecated=Wo.deprecated}Wo.insertTextMode!==void 0&&(Cs.insertTextMode=Wo.insertTextMode)}return Ha!==void 0&&Ha.length>0&&(Cs.tags=Ha),Cs.insertTextMode===void 0&&ee.keepWhitespace===!0&&(Cs.insertTextMode=ms.InsertTextMode.adjustIndentation),Cs}function vd(ee,xe){let gt=ms.InsertTextFormat.PlainText,zn,Cs;xe.textEdit?(zn=xe.textEdit.newText,Cs=xe.textEdit.range):xe.insertText instanceof Fl.SnippetString?(gt=ms.InsertTextFormat.Snippet,zn=xe.insertText.value):zn=xe.insertText,xe.range&&(Cs=xe.range),ee.insertTextFormat=gt,xe.fromEdit&&zn!==void 0&&Cs!==void 0?ee.textEdit=Fn(zn,Cs):ee.insertText=zn}function Fn(ee,xe){return x1e.is(xe)?ms.InsertReplaceEdit.create(ee,Ne(xe.inserting),Ne(xe.replacing)):{newText:ee,range:Ne(xe)}}function th(ee){return{range:Ne(ee.range),newText:ee.newText}}function pc(ee){return ee==null?ee:ee.map(th)}function zc(ee){return ee<=Fl.SymbolKind.TypeParameter?ee+1:ms.SymbolKind.Property}function $s(ee){return ee}function tc(ee){return ee.map($s)}function fl(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{includeDeclaration:gt.includeDeclaration}}}async function ih(ee,xe){let gt=ms.CodeAction.create(ee.title);if(ee instanceof W7e.default&&ee.data!==void 0&&(gt.data=ee.data),ee.kind!==void 0&&(gt.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(gt.diagnostics=await Zo(ee.diagnostics,xe)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(gt.command=Or(ee.command)),ee.isPreferred!==void 0&&(gt.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(gt.disabled={reason:ee.disabled.reason}),gt}function gg(ee){let xe=ms.CodeAction.create(ee.title);if(ee instanceof W7e.default&&ee.data!==void 0&&(xe.data=ee.data),ee.kind!==void 0&&(xe.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(xe.diagnostics=Zr(ee.diagnostics)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(xe.command=Or(ee.command)),ee.isPreferred!==void 0&&(xe.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(xe.disabled={reason:ee.disabled.reason}),xe}async function mc(ee,xe){if(ee==null)return ee;let gt;return ee.only&&QI.string(ee.only.value)&&(gt=[ee.only.value]),ms.CodeActionContext.create(await Zo(ee.diagnostics,xe),gt,nh(ee.triggerKind))}function $c(ee){if(ee==null)return ee;let xe;return ee.only&&QI.string(ee.only.value)&&(xe=[ee.only.value]),ms.CodeActionContext.create(Zr(ee.diagnostics),xe,nh(ee.triggerKind))}function nh(ee){switch(ee){case Fl.CodeActionTriggerKind.Invoke:return ms.CodeActionTriggerKind.Invoked;case Fl.CodeActionTriggerKind.Automatic:return ms.CodeActionTriggerKind.Automatic;default:return}}function Dc(ee){if(ee!=null)return ee.value}function pl(ee){return ee==null?ee:ms.InlineValueContext.create(ee.frameId,Ne(ee.stoppedLocation))}function ic(ee,xe,gt){return{context:ms.InlineCompletionContext.create(gt.triggerKind,gt.selectedCompletionInfo),textDocument:n(ee),position:De(xe)}}function Or(ee){let xe=ms.Command.create(ee.title,ee.command);return ee.arguments&&(xe.arguments=ee.arguments),xe}function ml(ee){let xe=ms.CodeLens.create(Ne(ee.range));return ee.command&&(xe.command=Or(ee.command)),ee instanceof Toi.default&&ee.data&&(xe.data=ee.data),xe}function sh(ee,xe){const gt={tabSize:ee.tabSize,insertSpaces:ee.insertSpaces};return xe.trimTrailingWhitespace&&(gt.trimTrailingWhitespace=!0),xe.trimFinalNewlines&&(gt.trimFinalNewlines=!0),xe.insertFinalNewline&&(gt.insertFinalNewline=!0),gt}function oh(ee){return{textDocument:n(ee)}}function Gc(ee){return{textDocument:n(ee)}}function Kc(ee){let xe=ms.DocumentLink.create(Ne(ee.range));ee.target&&(xe.target=i(ee.target)),ee.tooltip!==void 0&&(xe.tooltip=ee.tooltip);let gt=ee instanceof Loi.default?ee:void 0;return gt&>.data&&(xe.data=gt.data),xe}function Wa(ee){return{textDocument:n(ee)}}function Bo(ee){const xe={name:ee.name,kind:zc(ee.kind),uri:i(ee.uri),range:Ne(ee.range),selectionRange:Ne(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(xe.detail=ee.detail),ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee instanceof Roi.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Is(ee){const xe={name:ee.name,kind:zc(ee.kind),uri:i(ee.uri),range:Ne(ee.range),selectionRange:Ne(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(xe.detail=ee.detail),ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee instanceof Moi.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function kc(ee){const xe=ee instanceof Noi.default?{name:ee.name,kind:zc(ee.kind),location:ee.hasRange?xt(ee.location):{uri:t(ee.location.uri)},data:ee.data}:{name:ee.name,kind:zc(ee.kind),location:xt(ee.location)};return ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee.containerName!==""&&(xe.containerName=ee.containerName),xe}function Nh(ee){const xe=typeof ee.label=="string"?ee.label:ee.label.map(be),gt=ms.InlayHint.create(De(ee.position),xe);return ee.kind!==void 0&&(gt.kind=ee.kind),ee.textEdits!==void 0&&(gt.textEdits=pc(ee.textEdits)),ee.tooltip!==void 0&&(gt.tooltip=Aa(ee.tooltip)),ee.paddingLeft!==void 0&&(gt.paddingLeft=ee.paddingLeft),ee.paddingRight!==void 0&&(gt.paddingRight=ee.paddingRight),ee instanceof Poi.default&&ee.data!==void 0&&(gt.data=ee.data),gt}function be(ee){const xe=ms.InlayHintLabelPart.create(ee.value);return ee.location!==void 0&&(xe.location=xt(ee.location)),ee.command!==void 0&&(xe.command=Or(ee.command)),ee.tooltip!==void 0&&(xe.tooltip=Aa(ee.tooltip)),xe}function Aa(ee){return typeof ee=="string"?ee:{kind:ms.MarkupKind.Markdown,value:ee.value}}return{asUri:i,asTextDocumentIdentifier:n,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:b,asWillCreateFilesParams:w,asWillRenameFilesParams:y,asWillDeleteFilesParams:C,asTextDocumentPositionParams:A,asCompletionParams:k,asSignatureHelpParams:ne,asWorkerPosition:ge,asRange:Ne,asRanges:lt,asPosition:De,asPositions:Oe,asPositionsSync:yt,asLocation:xt,asDiagnosticSeverity:Ji,asDiagnosticTag:ns,asDiagnostic:ds,asDiagnostics:Zo,asDiagnosticsSync:Zr,asCompletionItem:Ba,asTextEdit:th,asSymbolKind:zc,asSymbolTag:$s,asSymbolTags:tc,asReferenceParams:fl,asCodeAction:ih,asCodeActionSync:gg,asCodeActionContext:mc,asCodeActionContextSync:$c,asInlineValueContext:pl,asCommand:Or,asCodeLens:ml,asFormattingOptions:sh,asDocumentSymbolParams:oh,asCodeLensParams:Gc,asDocumentLink:Kc,asDocumentLinkParams:Wa,asCallHierarchyItem:Bo,asTypeHierarchyItem:Is,asInlayHint:Nh,asWorkspaceSymbol:kc,asInlineCompletionParams:ic}}xle.createConverter=Foi;var Ple={};Object.defineProperty(Ple,"__esModule",{value:!0});Ple.createConverter=void 0;const di=Xn,On=ps,jm=kr,hr=yh,Ooi=Dle,Boi=kle,Woi=Ile,Hoi=Tle,U7e=bN,Uoi=Lle,Voi=Rle,zoi=Mle,$oi=Nle,V7e=ps;var Dne;(function(s){function e(t){let i=t;return i&&jm.string(i.language)&&jm.string(i.value)}s.is=e})(Dne||(Dne={}));function Goi(s,e,t){const n=s||(T=>di.Uri.parse(T));function o(T){return n(T)}function r(T){const ie=[];for(const ye of T)if(typeof ye=="string")ie.push(ye);else if(V7e.NotebookCellTextDocumentFilter.is(ye))if(typeof ye.notebook=="string")ie.push({notebookType:ye.notebook,language:ye.language});else{const O=ye.notebook.notebookType??"*";ie.push({notebookType:O,scheme:ye.notebook.scheme,pattern:ye.notebook.pattern,language:ye.language})}else V7e.TextDocumentFilter.is(ye)&&ie.push({language:ye.language,scheme:ye.scheme,pattern:ye.pattern});return ie}async function a(T,ie){return hr.map(T,l,ie)}function c(T){const ie=new Array(T.length);for(let ye=0;ye0?ie:void 0}function u(T){switch(T){case On.DiagnosticTag.Unnecessary:return di.DiagnosticTag.Unnecessary;case On.DiagnosticTag.Deprecated:return di.DiagnosticTag.Deprecated;default:return}}function f(T){return T?new di.Position(T.line,T.character):void 0}function p(T){return T?new di.Range(T.start.line,T.start.character,T.end.line,T.end.character):void 0}async function m(T,ie){return hr.map(T,ye=>new di.Range(ye.start.line,ye.start.character,ye.end.line,ye.end.character),ie)}function v(T){if(T==null)return di.DiagnosticSeverity.Error;switch(T){case On.DiagnosticSeverity.Error:return di.DiagnosticSeverity.Error;case On.DiagnosticSeverity.Warning:return di.DiagnosticSeverity.Warning;case On.DiagnosticSeverity.Information:return di.DiagnosticSeverity.Information;case On.DiagnosticSeverity.Hint:return di.DiagnosticSeverity.Hint}return di.DiagnosticSeverity.Error}function b(T){if(jm.string(T))return y(T);if(Dne.is(T))return y().appendCodeblock(T.value,T.language);if(Array.isArray(T)){let ie=[];for(let ye of T){let O=y();Dne.is(ye)?O.appendCodeblock(ye.value,ye.language):O.appendMarkdown(ye),ie.push(O)}return ie}else return y(T)}function w(T){if(jm.string(T))return T;switch(T.kind){case On.MarkupKind.Markdown:return y(T.value);case On.MarkupKind.PlainText:return T.value;default:return`Unsupported Markup content received. Kind is: ${T.kind}`}}function y(T){let ie;if(T===void 0||typeof T=="string")ie=new di.MarkdownString(T);else switch(T.kind){case On.MarkupKind.Markdown:ie=new di.MarkdownString(T.value);break;case On.MarkupKind.PlainText:ie=new di.MarkdownString,ie.appendText(T.value);break;default:ie=new di.MarkdownString,ie.appendText(`Unsupported Markup content received. Kind is: ${T.kind}`);break}return ie.isTrusted=e,ie.supportHtml=t,ie}function C(T){if(T)return new di.Hover(b(T.contents),p(T.range))}async function A(T,ie,ye){if(!T)return;if(Array.isArray(T))return hr.map(T,Bi=>z(Bi,ie),ye);const O=T,{defaultRange:$,commitCharacters:se}=L(O,ie),Ke=await hr.map(O.items,Bi=>z(Bi,se,$,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data),ye);return new di.CompletionList(Ke,O.isIncomplete)}function L(T,ie){const ye=T.itemDefaults?.editRange,O=T.itemDefaults?.commitCharacters??ie;return On.Range.is(ye)?{defaultRange:p(ye),commitCharacters:O}:ye!==void 0?{defaultRange:{inserting:p(ye.insert),replacing:p(ye.replace)},commitCharacters:O}:{defaultRange:void 0,commitCharacters:O}}function k(T){return On.CompletionItemKind.Text<=T&&T<=On.CompletionItemKind.TypeParameter?[T-1,void 0]:[di.CompletionItemKind.Text,T]}function P(T){switch(T){case On.CompletionItemTag.Deprecated:return di.CompletionItemTag.Deprecated}}function R(T){if(T==null)return[];const ie=[];for(const ye of T){const O=P(ye);O!==void 0&&ie.push(O)}return ie}function z(T,ie,ye,O,$,se){const Ke=R(T.tags),Bi=G(T),Wi=new Ooi.default(Bi);T.detail&&(Wi.detail=T.detail),T.documentation&&(Wi.documentation=w(T.documentation),Wi.documentationFormat=jm.string(T.documentation)?"$string":T.documentation.kind),T.filterText&&(Wi.filterText=T.filterText);const ta=Y(T,ye,$);if(ta&&(Wi.insertText=ta.text,Wi.range=ta.range,Wi.fromEdit=ta.fromEdit),jm.number(T.kind)){let[ert,fFe]=k(T.kind);Wi.kind=ert,fFe&&(Wi.originalItemKind=fFe)}T.sortText&&(Wi.sortText=T.sortText),T.additionalTextEdits&&(Wi.additionalTextEdits=De(T.additionalTextEdits));const Pl=T.commitCharacters!==void 0?jm.stringArray(T.commitCharacters)?T.commitCharacters:void 0:ie;Pl&&(Wi.commitCharacters=Pl.slice()),T.command&&(Wi.command=pc(T.command)),(T.deprecated===!0||T.deprecated===!1)&&(Wi.deprecated=T.deprecated,T.deprecated===!0&&Ke.push(di.CompletionItemTag.Deprecated)),(T.preselect===!0||T.preselect===!1)&&(Wi.preselect=T.preselect);const fg=T.data??se;fg!==void 0&&(Wi.data=fg),Ke.length>0&&(Wi.tags=Ke);const ude=T.insertTextMode??O;return ude!==void 0&&(Wi.insertTextMode=ude,ude===On.InsertTextMode.asIs&&(Wi.keepWhitespace=!0)),Wi}function G(T){return On.CompletionItemLabelDetails.is(T.labelDetails)?{label:T.label,detail:T.labelDetails.detail,description:T.labelDetails.description}:T.label}function Y(T,ie,ye){const O=T.insertTextFormat??ye;if(T.textEdit!==void 0||ie!==void 0){const[$,se]=T.textEdit!==void 0?j(T.textEdit):[ie,T.textEditText??T.label];return O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(se),range:$,fromEdit:!0}:{text:se,range:$,fromEdit:!0}}else return T.insertText?O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(T.insertText),fromEdit:!1}:{text:T.insertText,fromEdit:!1}:void 0}function j(T){return On.InsertReplaceEdit.is(T)?[{inserting:p(T.insert),replacing:p(T.replace)},T.newText]:[p(T.range),T.newText]}function ne(T){if(T)return new di.TextEdit(p(T.range),T.newText)}async function ge(T,ie){if(T)return hr.map(T,ne,ie)}function De(T){if(!T)return;const ie=new Array(T.length);for(let ye=0;ye0){let ye=[];for(let O of T.children)ye.push(Fn(O));ie.children=ye}return ie}function th(T,ie){T.tags=Tn(ie.tags),ie.deprecated&&(T.tags?T.tags.includes(di.SymbolTag.Deprecated)||(T.tags=T.tags.concat(di.SymbolTag.Deprecated)):T.tags=[di.SymbolTag.Deprecated])}function pc(T){let ie={title:T.title,command:T.command};return T.arguments&&(ie.arguments=T.arguments),ie}async function zc(T,ie){if(T)return hr.map(T,pc,ie)}const $s=new Map;$s.set(On.CodeActionKind.Empty,di.CodeActionKind.Empty),$s.set(On.CodeActionKind.QuickFix,di.CodeActionKind.QuickFix),$s.set(On.CodeActionKind.Refactor,di.CodeActionKind.Refactor),$s.set(On.CodeActionKind.RefactorExtract,di.CodeActionKind.RefactorExtract),$s.set(On.CodeActionKind.RefactorInline,di.CodeActionKind.RefactorInline),$s.set(On.CodeActionKind.RefactorRewrite,di.CodeActionKind.RefactorRewrite),$s.set(On.CodeActionKind.Source,di.CodeActionKind.Source),$s.set(On.CodeActionKind.SourceOrganizeImports,di.CodeActionKind.SourceOrganizeImports);function tc(T){if(T==null)return;let ie=$s.get(T);if(ie)return ie;let ye=T.split(".");ie=di.CodeActionKind.Empty;for(let O of ye)ie=ie.append(O);return ie}function fl(T){if(T!=null)return T.map(ie=>tc(ie))}async function ih(T,ie){if(T==null)return;let ye=new Hoi.default(T.title,T.data);return T.kind!==void 0&&(ye.kind=tc(T.kind)),T.diagnostics!==void 0&&(ye.diagnostics=c(T.diagnostics)),T.edit!==void 0&&(ye.edit=await nh(T.edit,ie)),T.command!==void 0&&(ye.command=pc(T.command)),T.isPreferred!==void 0&&(ye.isPreferred=T.isPreferred),T.disabled!==void 0&&(ye.disabled={reason:T.disabled.reason}),ye}function gg(T,ie){return hr.mapAsync(T,async ye=>On.Command.is(ye)?pc(ye):ih(ye,ie),ie)}function mc(T){if(!T)return;let ie=new Boi.default(p(T.range));return T.command&&(ie.command=pc(T.command)),T.data!==void 0&&T.data!==null&&(ie.data=T.data),ie}async function $c(T,ie){if(T)return hr.map(T,mc,ie)}async function nh(T,ie){if(!T)return;const ye=new Map;if(T.changeAnnotations!==void 0){const se=T.changeAnnotations;await hr.forEach(Object.keys(se),Ke=>{const Bi=Dc(se[Ke]);ye.set(Ke,Bi)},ie)}const O=se=>{if(se!==void 0)return ye.get(se)},$=new di.WorkspaceEdit;if(T.documentChanges){const se=T.documentChanges;await hr.forEach(se,Ke=>{if(On.CreateFile.is(Ke))$.createFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.RenameFile.is(Ke))$.renameFile(n(Ke.oldUri),n(Ke.newUri),Ke.options,O(Ke.annotationId));else if(On.DeleteFile.is(Ke))$.deleteFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.TextDocumentEdit.is(Ke)){const Bi=n(Ke.textDocument.uri);for(const Wi of Ke.edits)On.AnnotatedTextEdit.is(Wi)?$.replace(Bi,p(Wi.range),Wi.newText,O(Wi.annotationId)):$.replace(Bi,p(Wi.range),Wi.newText)}else throw new Error(`Unknown workspace edit change received: +${JSON.stringify(Ke,void 0,4)}`)},ie)}else if(T.changes){const se=T.changes;await hr.forEach(Object.keys(se),Ke=>{$.set(n(Ke),De(se[Ke]))},ie)}return $}function Dc(T){if(T!==void 0)return{label:T.label,needsConfirmation:!!T.needsConfirmation,description:T.description}}function pl(T){let ie=p(T.range),ye=T.target?o(T.target):void 0,O=new Woi.default(ie,ye);return T.tooltip!==void 0&&(O.tooltip=T.tooltip),T.data!==void 0&&T.data!==null&&(O.data=T.data),O}async function ic(T,ie){if(T)return hr.map(T,pl,ie)}function Or(T){return new di.Color(T.red,T.green,T.blue,T.alpha)}function ml(T){return new di.ColorInformation(p(T.range),Or(T.color))}async function sh(T,ie){if(T)return hr.map(T,ml,ie)}function oh(T){let ie=new di.ColorPresentation(T.label);return ie.additionalTextEdits=De(T.additionalTextEdits),T.textEdit&&(ie.textEdit=ne(T.textEdit)),ie}async function Gc(T,ie){if(T)return hr.map(T,oh,ie)}function Kc(T){if(T)switch(T){case On.FoldingRangeKind.Comment:return di.FoldingRangeKind.Comment;case On.FoldingRangeKind.Imports:return di.FoldingRangeKind.Imports;case On.FoldingRangeKind.Region:return di.FoldingRangeKind.Region}}function Wa(T){return new di.FoldingRange(T.startLine,T.endLine,Kc(T.kind))}async function Bo(T,ie){if(T)return hr.map(T,Wa,ie)}function Is(T){return new di.SelectionRange(p(T.range),T.parent?Is(T.parent):void 0)}async function kc(T,ie){return Array.isArray(T)?hr.map(T,Is,ie):[]}function Nh(T){return On.InlineValueText.is(T)?new di.InlineValueText(p(T.range),T.text):On.InlineValueVariableLookup.is(T)?new di.InlineValueVariableLookup(p(T.range),T.variableName,T.caseSensitiveLookup):new di.InlineValueEvaluatableExpression(p(T.range),T.expression)}async function be(T,ie){return Array.isArray(T)?hr.map(T,Nh,ie):[]}async function Aa(T,ie){const ye=typeof T.label=="string"?T.label:await hr.map(T.label,ee,ie),O=new $oi.default(f(T.position),ye);return T.kind!==void 0&&(O.kind=T.kind),T.textEdits!==void 0&&(O.textEdits=await ge(T.textEdits,ie)),T.tooltip!==void 0&&(O.tooltip=xe(T.tooltip)),T.paddingLeft!==void 0&&(O.paddingLeft=T.paddingLeft),T.paddingRight!==void 0&&(O.paddingRight=T.paddingRight),T.data!==void 0&&(O.data=T.data),O}function ee(T){const ie=new di.InlayHintLabelPart(T.value);return T.location!==void 0&&(ie.location=Ji(T.location)),T.tooltip!==void 0&&(ie.tooltip=xe(T.tooltip)),T.command!==void 0&&(ie.command=pc(T.command)),ie}function xe(T){return typeof T=="string"?T:y(T)}async function gt(T,ie){if(Array.isArray(T))return hr.mapAsync(T,Aa,ie)}function zn(T){if(T===null)return;const ie=new Uoi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Tn(T.tags)),ie}async function Cs(T,ie){if(T!==null)return hr.map(T,zn,ie)}async function Wo(T,ie){return new di.CallHierarchyIncomingCall(zn(T.from),await m(T.fromRanges,ie))}async function Ha(T,ie){if(T!==null)return hr.mapAsync(T,Wo,ie)}async function ea(T,ie){return new di.CallHierarchyOutgoingCall(zn(T.to),await m(T.fromRanges,ie))}async function Ph(T,ie){if(T!==null)return hr.mapAsync(T,ea,ie)}async function le(T,ie){if(T!=null)return new di.SemanticTokens(new Uint32Array(T.data),T.resultId)}function dr(T){return new di.SemanticTokensEdit(T.start,T.deleteCount,T.data!==void 0?new Uint32Array(T.data):void 0)}async function io(T,ie){if(T!=null)return new di.SemanticTokensEdits(T.edits.map(dr),T.resultId)}function un(T){return T}async function Se(T,ie){if(T!=null)return new di.LinkedEditingRanges(await m(T.ranges,ie),rt(T.wordPattern))}function rt(T){if(T!=null)return new RegExp(T)}function Ft(T){if(T===null)return;let ie=new Voi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Tn(T.tags)),ie}async function Ci(T,ie){if(T!==null)return hr.map(T,Ft,ie)}function Ot(T){if(jm.string(T))return T;if(On.RelativePattern.is(T)){if(On.URI.is(T.baseUri))return new di.RelativePattern(o(T.baseUri),T.pattern);if(On.WorkspaceFolder.is(T.baseUri)){const ie=di.workspace.getWorkspaceFolder(o(T.baseUri.uri));return ie!==void 0?new di.RelativePattern(ie,T.pattern):void 0}}}async function K(T,ie){if(!T)return;if(Array.isArray(T))return hr.map(T,$=>de($),ie);const ye=T,O=await hr.map(ye.items,$=>de($),ie);return new di.InlineCompletionList(O)}function de(T){let ie;typeof T.insertText=="string"?ie=T.insertText:ie=new di.SnippetString(T.insertText.value);let ye;T.command&&(ye=pc(T.command));const O=new di.InlineCompletionItem(ie,p(T.range),ye);return T.filterText&&(O.filterText=T.filterText),O}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:C,asCompletionResult:A,asCompletionItem:z,asTextEdit:ne,asTextEdits:ge,asSignatureHelp:Oe,asSignatureInformations:yt,asSignatureInformation:Ne,asParameterInformations:lt,asParameterInformation:xt,asDeclarationResult:Ii,asDefinitionResult:ns,asLocation:Ji,asReferences:Xr,asDocumentHighlights:ds,asDocumentHighlight:Zo,asDocumentHighlightKind:Zr,asSymbolKind:ss,asSymbolTag:Oo,asSymbolTags:Tn,asSymbolInformations:Di,asSymbolInformation:Ba,asDocumentSymbols:vd,asDocumentSymbol:Fn,asCommand:pc,asCommands:zc,asCodeAction:ih,asCodeActionKind:tc,asCodeActionKinds:fl,asCodeActionResult:gg,asCodeLens:mc,asCodeLenses:$c,asWorkspaceEdit:nh,asDocumentLink:pl,asDocumentLinks:ic,asFoldingRangeKind:Kc,asFoldingRange:Wa,asFoldingRanges:Bo,asColor:Or,asColorInformation:ml,asColorInformations:sh,asColorPresentation:oh,asColorPresentations:Gc,asSelectionRange:Is,asSelectionRanges:kc,asInlineValue:Nh,asInlineValues:be,asInlayHint:Aa,asInlayHints:gt,asSemanticTokensLegend:un,asSemanticTokens:le,asSemanticTokensEdit:dr,asSemanticTokensEdits:io,asCallHierarchyItem:zn,asCallHierarchyItems:Cs,asCallHierarchyIncomingCall:Wo,asCallHierarchyIncomingCalls:Ha,asCallHierarchyOutgoingCall:ea,asCallHierarchyOutgoingCalls:Ph,asLinkedEditingRanges:Se,asTypeHierarchyItem:Ft,asTypeHierarchyItems:Ci,asGlobPattern:Ot,asInlineCompletionResult:K,asInlineCompletionItem:de}}Ple.createConverter=Goi;var _G={};Object.defineProperty(_G,"__esModule",{value:!0});_G.ProgressPart=void 0;const z7e=Xn,$7e=ps,G7e=kr;class Koi{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress($7e.WorkDoneProgress.type,this._token,n=>{switch(n.kind){case"begin":this.begin(n);break;case"report":this.report(n);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&z7e.window.withProgress({location:z7e.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,i)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=i,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification($7e.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((n,o)=>{this._resolve=n,this._reject=o})})}report(e){if(this._infinite&&G7e.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(G7e.number(e.percentage)){const t=Math.max(0,Math.min(e.percentage,100)),i=Math.max(0,t-this._reported);this._reported+=i,this._progress!==void 0&&this._progress.report({message:e.message,increment:i})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}}_G.ProgressPart=Koi;var Fle={};Object.defineProperty(Fle,"__esModule",{value:!0});Fle.NotebookDocumentSyncFeature=void 0;const ku=Xn,qoi=Ale,PS=ps,Qoi=or,K7e=kr;function q7e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}var BF;(function(s){(function(e){function t(h,u){return{version:h.version,uri:u.asUri(h.uri)}}e.asVersionedNotebookDocumentIdentifier=t;function i(h,u,f){const p=PS.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,n(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function n(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=n;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=PS.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=o(h.metadata)),h.executionSummary!==void 0&&K7e.number(h.executionSummary.executionOrder)&&K7e.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case ku.NotebookCellKind.Markup:return PS.NotebookCellKind.Markup;case ku.NotebookCellKind.Code:return PS.NotebookCellKind.Code}}function c(h,u){if(h.has(u))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(u)){const f=[];for(const p of u)if(p!==null&&typeof p=="object"||Array.isArray(p))f.push(c(h,p));else{if(p instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");f.push(p)}return f}else{const f=Object.keys(u),p=Object.create(null);for(const m of f){const v=u[m];if(v!==null&&typeof v=="object"||Array.isArray(v))p[m]=c(h,v);else{if(v instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");p[m]=v}}return p}}function l(h,u){const f=u.asChangeTextDocumentParams(h,h.document.uri,h.document.version);return{document:f.textDocument,changes:f.contentChanges}}e.asTextContentChange=l;function d(h,u){const f=Object.create(null);if(h.metadata&&(f.metadata=s.c2p.asMetadata(h.metadata)),h.cells!==void 0){const p=Object.create(null),m=h.cells;m.structure&&(p.structure={array:{start:m.structure.array.start,deleteCount:m.structure.array.deleteCount,cells:m.structure.array.cells!==void 0?m.structure.array.cells.map(v=>s.c2p.asNotebookCell(v,u)):void 0},didOpen:m.structure.didOpen!==void 0?m.structure.didOpen.map(v=>u.asOpenTextDocumentParams(v.document).textDocument):void 0,didClose:m.structure.didClose!==void 0?m.structure.didClose.map(v=>u.asCloseTextDocumentParams(v.document).textDocument):void 0}),m.data!==void 0&&(p.data=m.data.map(v=>s.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>s.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(s.c2p||(s.c2p={}))})(BF||(BF={}));var D1e;(function(s){function e(a,c,l){const d=a.length,h=c.length;let u=0;for(;u=0&&p>=0&&t(a[f],c[p],l);)f--,p--;const m=f+1-u,v=u===p+1?void 0:c.slice(u,p+1);return v!==void 0?{start:u,deleteCount:m,cells:v}:{start:u,deleteCount:m}}else return ui.document.uri.toString()))}}s.create=e})(Ine||(Ine={}));class ZK{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(kne.asDocumentSelector(t)),ku.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of ku.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);ku.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&ku.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),ku.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of ku.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return ku.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(ku.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),n=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(n&&o||!n&&!o)return;if(n){const r=this.getMatchingCells(e);if(r!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,r);a!==void 0&&this.doSendChange(a,r).catch(()=>{})}}}else n&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){ku.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){const i=this.notebookSyncInfo.get(e.uri.toString());if(i===void 0)return;const n=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===n.toString());if(o!==-1)if(o===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const r=i.cells.slice(),a=r.splice(o,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:o,deleteCount:1},didClose:a}}},r).catch(()=>{})}}dispose(){for(const e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),i=this.notebookSyncInfo.get(e.uri.toString())){if(i!==void 0)if(t!==void 0){const n=this.asNotebookDocumentChangeEvent(e,void 0,i,t);n!==void 0&&this.doSendChange(n,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){const t=e.notebook,i=this.notebookSyncInfo.get(t.uri.toString());if(i===void 0){if(e.contentChanges.length===0)return;const n=this.getMatchingCells(t);if(n===void 0)return;this.didOpen(t,n,i)}else{const n=this.getMatchingCells(t);if(n===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,n);o!==void 0&&this.doSendChange(o,n).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;const i=e.getCells().filter(n=>t.uris.has(n.document.uri.toString()));this.doSendClose(e,i).catch(()=>{})}async sendDidOpenNotebookDocument(e){const t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){const i=async(o,r)=>{const a=BF.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(PS.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),Ine.create(t)),n?.didOpen!==void 0?n.didOpen(e,t,i):i(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){const i=async o=>{try{await this.client.sendNotification(PS.DidChangeNotebookDocumentNotification.type,{notebookDocument:BF.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:BF.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},n=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Ine.create(t??[])),n?.didChange!==void 0?n?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async n=>{try{await this.client.sendNotification(PS.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(n.uri)}})}catch(o){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",o),o}},i=this.client.middleware?.notebooks;return i?.didSave!==void 0?i.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){const i=async(o,r)=>{try{await this.client.sendNotification(PS.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(o.uri)},cellTextDocuments:r.map(a=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(a.document))})}catch(a){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",a),a}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),n?.didClose!==void 0?n.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,n){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=BF.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(n.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)r.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(o.cells=o.cells??{},o.cells.data=a)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&i!==void 0&&n!==void 0){const a=i.cells,c=n,l=D1e.computeDiff(a,c,!1);let d,h;if(l!==void 0){d=l.cells===void 0?new Map:new Map(l.cells.map(p=>[p.document.uri.toString(),p])),h=l.deleteCount===0?new Map:new Map(a.slice(l.start,l.start+l.deleteCount).map(p=>[p.document.uri.toString(),p]));for(const p of Array.from(h.keys()))d.has(p)&&(h.delete(p),d.delete(p));o.cells=o.cells??{};const u=[],f=[];if(d.size>0||h.size>0){for(const p of d.values())u.push(p);for(const p of h.values())f.push(p)}o.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(o).length>1?o:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(const i of this.options.notebookSelector)if(i.notebook===void 0||k1e.matchNotebook(i.notebook,e)){const n=this.filterCells(e,t,i.cells);return n.length===0?void 0:n}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const n=i!==void 0?t.filter(o=>{const r=o.document.languageId;return i.some(a=>a.language==="*"||r===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,n):n}}class G1{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=PS.NotebookDocumentSyncRegistrationType.type,ku.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==G1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof ZK&&o.didOpenNotebookCellTextDocument(i,n)}),ku.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==G1.CellScheme)return;const[n]=this.findNotebookDocumentAndCell(i);if(n!==void 0)for(const o of this.registrations.values())o instanceof ZK&&o.didChangeNotebookCellTextDocument(n,t)}),ku.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==G1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof ZK&&o.didCloseNotebookCellTextDocument(i,n)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(const e of this.registrations.values()){const t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){const t=q7e(q7e(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(kne.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??Qoi.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new ZK(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){const t=this.registrations.get(e);t&&t.dispose()}clear(){for(const e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==G1.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&ku.languages.match(this.dedicatedChannel,e)>0)return!0;for(const t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(const t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){const t=e.uri.toString();for(const i of ku.workspace.notebookDocuments)for(const n of i.getCells())if(n.document.uri.toString()===t)return[i,n];return[void 0,void 0]}}Fle.NotebookDocumentSyncFeature=G1;G1.CellScheme="vscode-notebook-cell";var RD={};Object.defineProperty(RD,"__esModule",{value:!0});RD.SyncConfigurationFeature=RD.toJSONObject=RD.ConfigurationFeature=void 0;const uB=Xn,GV=ps,joi=kr,Yoi=or,Q7e=Mn;class Joi{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(GV.ConfigurationRequest.type,(t,i)=>{let n=r=>{let a=[];for(let c of r.items){let l=c.scopeUri!==void 0&&c.scopeUri!==null?this._client.protocol2CodeConverter.asUri(c.scopeUri):void 0;a.push(this.getConfiguration(l,c.section!==null?c.section:void 0))}return a},o=e.middleware.workspace;return o&&o.configuration?o.configuration(t,i,n):n(t)})}getConfiguration(e,t){let i=null;if(t){let n=t.lastIndexOf(".");if(n===-1)i=oL(uB.workspace.getConfiguration(void 0,e).get(t));else{let o=uB.workspace.getConfiguration(t.substr(0,n),e);o&&(i=oL(o.get(t.substr(n+1))))}}else{let n=uB.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(n))n.has(o)&&(i[o]=oL(n.get(o)))}return i===void 0&&(i=null),i}clear(){}}RD.ConfigurationFeature=Joi;function oL(s){if(s){if(Array.isArray(s))return s.map(oL);if(typeof s=="object"){const e=Object.create(null);for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=oL(s[t]));return e}}return s}RD.toJSONObject=oL;class Xoi{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return GV.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,Q7e.ensure)((0,Q7e.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Yoi.generateUuid(),registerOptions:{section:e}})}register(e){let t=uB.workspace.onDidChangeConfiguration(i=>{this.onDidChangeConfiguration(e.registerOptions.section,i)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(const e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let i;if(joi.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const n=async r=>r===void 0?this._client.sendNotification(GV.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(GV.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,n):n(i)).catch(r=>{this._client.error(`Sending notification ${GV.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=uB.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=uB.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(n,l)[l[l.length-1]]=oL(c)}}return n}}RD.SyncConfigurationFeature=Xoi;var qf={};Object.defineProperty(qf,"__esModule",{value:!0});qf.DidSaveTextDocumentFeature=qf.WillSaveWaitUntilFeature=qf.WillSaveFeature=qf.DidChangeTextDocumentFeature=qf.DidCloseTextDocumentFeature=qf.DidOpenTextDocumentFeature=void 0;const Xp=Xn,Da=ps,Oc=Mn,XU=or;class Zoi extends Oc.TextDocumentEventFeature{constructor(e,t){super(e,Xp.workspace.onDidOpenTextDocument,Da.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return Da.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);Xp.workspace.textDocuments.forEach(i=>{const n=i.uri.toString();if(!this._syncedDocuments.has(n)&&Xp.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));(o.didOpen?o.didOpen(i,r):r(i)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)}),this._syncedDocuments.set(n,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}qf.DidOpenTextDocumentFeature=Zoi;class eri extends Oc.TextDocumentEventFeature{constructor(e,t,i){super(e,Xp.workspace.onDidCloseTextDocument,Da.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return Da.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,i)}unregister(e){const t=this._selectors.get(e);super.unregister(e);const i=this._selectors.values();this._syncedDocuments.forEach(n=>{if(Xp.languages.match(t,n)>0&&!this._selectorFilter(i,n)&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(n.uri.toString()),(o.didClose?o.didClose(n,r):r(n)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}qf.DidCloseTextDocumentFeature=eri;class tri extends Oc.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new Xp.EventEmitter,this._onPendingChangeAdded=new Xp.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=Da.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return Da.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==Da.TextDocumentSyncKind.None&&this.register({id:XU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Xp.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(const e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;const t=e.document.uri,i=e.document.version,n=[];for(const o of this._changeData.values())if(Xp.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===Da.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(Da.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,Da.DidChangeTextDocumentNotification.type,l)};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===Da.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(n).then(void 0,o=>{throw this._client.error(`Sending document notification ${Da.DidChangeTextDocumentNotification.type.method} failed`,o),o})}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=Da.TextDocumentSyncKind.None;else{this._syncKind=Da.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===Da.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=Da.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(const i of this._pendingTextDocumentChanges)e.has(i[0])||(t.push(i[1]),this._pendingTextDocumentChanges.delete(i[0]))}return t}getProvider(e){for(const t of this._changeData.values())if(Xp.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==Da.TextDocumentSyncKind.Full)switch(e){case Da.TextDocumentSyncKind.Full:this._syncKind=e;break;case Da.TextDocumentSyncKind.Incremental:this._syncKind===Da.TextDocumentSyncKind.None&&(this._syncKind=Da.TextDocumentSyncKind.Incremental);break}}}qf.DidChangeTextDocumentFeature=tri;class iri extends Oc.TextDocumentEventFeature{constructor(e){super(e,Xp.workspace.onWillSaveTextDocument,Da.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Oc.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return Da.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}qf.WillSaveFeature=iri;class nri extends Oc.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return Da.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Xp.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Oc.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=n=>this._client.sendRequest(Da.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(n)).then(async o=>{let r=await this._client.protocol2CodeConverter.asTextEdits(o);return r===void 0?[]:r});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}}qf.WillSaveWaitUntilFeature=nri;class sri extends Oc.TextDocumentEventFeature{constructor(e){super(e,Xp.workspace.onDidSaveTextDocument,Da.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Oc.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return Da.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const n=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:XU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}qf.DidSaveTextDocumentFeature=sri;var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});Ole.CompletionItemFeature=void 0;const ori=Xn,xo=ps,gge=Mn,rri=or,ari=[xo.CompletionItemKind.Text,xo.CompletionItemKind.Method,xo.CompletionItemKind.Function,xo.CompletionItemKind.Constructor,xo.CompletionItemKind.Field,xo.CompletionItemKind.Variable,xo.CompletionItemKind.Class,xo.CompletionItemKind.Interface,xo.CompletionItemKind.Module,xo.CompletionItemKind.Property,xo.CompletionItemKind.Unit,xo.CompletionItemKind.Value,xo.CompletionItemKind.Enum,xo.CompletionItemKind.Keyword,xo.CompletionItemKind.Snippet,xo.CompletionItemKind.Color,xo.CompletionItemKind.File,xo.CompletionItemKind.Reference,xo.CompletionItemKind.Folder,xo.CompletionItemKind.EnumMember,xo.CompletionItemKind.Constant,xo.CompletionItemKind.Struct,xo.CompletionItemKind.Event,xo.CompletionItemKind.Operator,xo.CompletionItemKind.TypeParameter];class cri extends gge.TextDocumentLanguageFeature{constructor(e){super(e,xo.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,gge.ensure)((0,gge.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[xo.MarkupKind.Markdown,xo.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[xo.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[xo.InsertTextMode.asIs,xo.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=xo.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:ari},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:rri.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],n=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,b)=>h.sendRequest(xo.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),b).then(w=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(w,n,b),w=>h.handleFailedRequest(xo.CompletionRequest.type,b,w,null));return u.provideCompletionItem?u.provideCompletionItem(a,c,d,l,f):f(a,c,d,l)},resolveCompletionItem:e.resolveProvider?(a,c)=>{const l=this._client,d=this._client.middleware,h=(u,f)=>l.sendRequest(xo.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(xo.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[ori.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}Ole.CompletionItemFeature=cri;var Ble={};Object.defineProperty(Ble,"__esModule",{value:!0});Ble.HoverFeature=void 0;const lri=Xn,B4=ps,fge=Mn,dri=or;class hri extends fge.TextDocumentLanguageFeature{constructor(e){super(e,B4.HoverRequest.type)}fillClientCapabilities(e){const t=(0,fge.ensure)((0,fge.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[B4.MarkupKind.Markdown,B4.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:dri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(B4.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(B4.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return lri.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Ble.HoverFeature=hri;var Wle={};Object.defineProperty(Wle,"__esModule",{value:!0});Wle.DefinitionFeature=void 0;const uri=Xn,pge=ps,mge=Mn,gri=or;class fri extends mge.TextDocumentLanguageFeature{constructor(e){super(e,pge.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,mge.ensure)((0,mge.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:gri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(pge.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(pge.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return uri.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Wle.DefinitionFeature=fri;var Hle={};Object.defineProperty(Hle,"__esModule",{value:!0});Hle.SignatureHelpFeature=void 0;const j7e=Xn,W4=ps,_ge=Mn,pri=or;class mri extends _ge.TextDocumentLanguageFeature{constructor(e){super(e,W4.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,_ge.ensure)((0,_ge.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[W4.MarkupKind.Markdown,W4.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.signatureHelpProvider);i&&this.register({id:pri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,n,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(W4.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(W4.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,n,r,o,c):c(i,n,r,o)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){const i=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){const n=e.triggerCharacters||[];return j7e.languages.registerSignatureHelpProvider(i,t,...n)}else{const n={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return j7e.languages.registerSignatureHelpProvider(i,t,n)}}}Hle.SignatureHelpFeature=mri;var Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});Ule.DocumentHighlightFeature=void 0;const _ri=Xn,vge=ps,bge=Mn,vri=or;class bri extends bge.TextDocumentLanguageFeature{constructor(e){super(e,vge.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,bge.ensure)((0,bge.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:vri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(vge.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(vge.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(n,o,r,c):c(n,o,r)}};return[_ri.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Ule.DocumentHighlightFeature=bri;var JPe={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.DocumentSymbolFeature=s.SupportedSymbolTags=s.SupportedSymbolKinds=void 0;const e=Xn,t=ps,i=Mn,n=or;s.SupportedSymbolKinds=[t.SymbolKind.File,t.SymbolKind.Module,t.SymbolKind.Namespace,t.SymbolKind.Package,t.SymbolKind.Class,t.SymbolKind.Method,t.SymbolKind.Property,t.SymbolKind.Field,t.SymbolKind.Constructor,t.SymbolKind.Enum,t.SymbolKind.Interface,t.SymbolKind.Function,t.SymbolKind.Variable,t.SymbolKind.Constant,t.SymbolKind.String,t.SymbolKind.Number,t.SymbolKind.Boolean,t.SymbolKind.Array,t.SymbolKind.Object,t.SymbolKind.Key,t.SymbolKind.Null,t.SymbolKind.EnumMember,t.SymbolKind.Struct,t.SymbolKind.Event,t.SymbolKind.Operator,t.SymbolKind.TypeParameter],s.SupportedSymbolTags=[t.SymbolTag.Deprecated];class o extends i.TextDocumentLanguageFeature{constructor(a){super(a,t.DocumentSymbolRequest.type)}fillClientCapabilities(a){let c=(0,i.ensure)((0,i.ensure)(a,"textDocument"),"documentSymbol");c.dynamicRegistration=!0,c.symbolKind={valueSet:s.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:s.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:n.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,b)=>{try{const w=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),b);if(b.isCancellationRequested||w===void 0||w===null)return null;if(w.length===0)return[];{const y=w[0];return t.DocumentSymbol.is(y)?await f.protocol2CodeConverter.asDocumentSymbols(w,b):await f.protocol2CodeConverter.asSymbolInformations(w,b)}}catch(w){return f.handleFailedRequest(t.DocumentSymbolRequest.type,b,w,null)}},m=f.middleware;return m.provideDocumentSymbols?m.provideDocumentSymbols(h,u,p):p(h,u)}},d=a.label!==void 0?{label:a.label}:void 0;return[e.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(c),l,d),l]}}s.DocumentSymbolFeature=o})(JPe);var Vle={};Object.defineProperty(Vle,"__esModule",{value:!0});Vle.WorkspaceSymbolFeature=void 0;const wri=Xn,H4=ps,wge=Mn,Y7e=JPe,yri=or;class Cri extends wge.WorkspaceFeature{constructor(e){super(e,H4.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,wge.ensure)((0,wge.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:Y7e.SupportedSymbolKinds},t.tagSupport={valueSet:Y7e.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:yri.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(H4.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(H4.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,r):r(i,n)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(H4.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(H4.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,n,r):r(i,n)}:void 0};return[wri.languages.registerWorkspaceSymbolProvider(t),t]}}Vle.WorkspaceSymbolFeature=Cri;var zle={};Object.defineProperty(zle,"__esModule",{value:!0});zle.ReferencesFeature=void 0;const Sri=Xn,yge=ps,Cge=Mn,Ari=or;class Eri extends Cge.TextDocumentLanguageFeature{constructor(e){super(e,yge.ReferencesRequest.type)}fillClientCapabilities(e){(0,Cge.ensure)((0,Cge.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:Ari.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(yge.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(yge.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(n,o,r,a,l):l(n,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Sri.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}zle.ReferencesFeature=Eri;var $le={};Object.defineProperty($le,"__esModule",{value:!0});$le.CodeActionFeature=void 0;const xri=Xn,xp=ps,Dri=or,Sge=Mn;class kri extends Sge.TextDocumentLanguageFeature{constructor(e){super(e,xp.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,Sge.ensure)((0,Sge.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[xp.CodeActionKind.Empty,xp.CodeActionKind.QuickFix,xp.CodeActionKind.Refactor,xp.CodeActionKind.RefactorExtract,xp.CodeActionKind.RefactorInline,xp.CodeActionKind.RefactorRewrite,xp.CodeActionKind.Source,xp.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:Dri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(n,o,r,a)=>{const c=this._client,l=async(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),context:c.code2ProtocolConverter.asCodeActionContextSync(f)};return c.sendRequest(xp.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(xp.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(n,o,r,a,l):l(n,o,r,a)},resolveCodeAction:e.resolveProvider?(n,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(xp.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(xp.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(n,o,c):c(n,o)}:void 0};return[xri.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}$le.CodeActionFeature=kri;var Gle={};Object.defineProperty(Gle,"__esModule",{value:!0});Gle.CodeLensFeature=void 0;const J7e=Xn,xP=ps,Iri=or,U4=Mn;class Tri extends U4.TextDocumentLanguageFeature{constructor(e){super(e,xP.CodeLensRequest.type)}fillClientCapabilities(e){(0,U4.ensure)((0,U4.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,U4.ensure)((0,U4.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(xP.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register({id:Iri.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new J7e.EventEmitter,n={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(xP.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(xP.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(o,r,c):c(o,r)},resolveCodeLens:e.resolveProvider?(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(xP.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(xP.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[J7e.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeCodeLensEmitter:i}]}}Gle.CodeLensFeature=Tri;var MD={};Object.defineProperty(MD,"__esModule",{value:!0});MD.DocumentOnTypeFormattingFeature=MD.DocumentRangeFormattingFeature=MD.DocumentFormattingFeature=void 0;const Kle=Xn,ub=ps,XPe=or,wA=Mn;var dU;(function(s){function e(t){const i=Kle.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}s.fromConfiguration=e})(dU||(dU={}));class Lri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:XPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(n,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,dU.fromConfiguration(d))};return a.sendRequest(ub.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(ub.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(n,o,r,c):c(n,o,r)}};return[Kle.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}MD.DocumentFormattingFeature=Lri;class Rri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:XPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),options:c.code2ProtocolConverter.asFormattingOptions(f,dU.fromConfiguration(h))};return c.sendRequest(ub.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(ub.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(n,o,r,a,l):l(n,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:c.code2ProtocolConverter.asRanges(u),options:c.code2ProtocolConverter.asFormattingOptions(f,dU.fromConfiguration(h))};return c.sendRequest(ub.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(ub.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(n,o,r,a,l):l(n,o,r,a)}),[Kle.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}MD.DocumentRangeFormattingFeature=Rri;class Mri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:XPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(o,r,a,c,l)=>{const d=this._client,h=(f,p,m,v,b)=>{let w={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,dU.fromConfiguration(f))};return d.sendRequest(ub.DocumentOnTypeFormattingRequest.type,w,b).then(y=>b.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(y,b),y=>d.handleFailedRequest(ub.DocumentOnTypeFormattingRequest.type,b,y,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},n=e.moreTriggerCharacter||[];return[Kle.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...n),i]}}MD.DocumentOnTypeFormattingFeature=Mri;var qle={};Object.defineProperty(qle,"__esModule",{value:!0});qle.RenameFeature=void 0;const Nri=Xn,jI=ps,Pri=or,X7e=kr,Age=Mn;class Fri extends Age.TextDocumentLanguageFeature{constructor(e){super(e,jI.RenameRequest.type)}fillClientCapabilities(e){let t=(0,Age.ensure)((0,Age.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=jI.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(X7e.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Pri.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{let m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),position:c.code2ProtocolConverter.asPosition(u),newName:f};return c.sendRequest(jI.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(jI.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(n,o,r,a,l):l(n,o,r,a)},prepareRename:e.prepareProvider?(n,o,r)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(jI.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:jI.Range.is(p)?a.protocol2CodeConverter.asRange(p):this.isDefaultBehavior(p)?p.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):p&&jI.Range.is(p.range)?{range:a.protocol2CodeConverter.asRange(p.range),placeholder:p.placeholder}:Promise.reject(new Error("The element can't be renamed.")),p=>{throw typeof p.message=="string"?new Error(p.message):new Error("The element can't be renamed.")})},l=a.middleware;return l.prepareRename?l.prepareRename(n,o,r,c):c(n,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Nri.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&X7e.boolean(t.defaultBehavior)}}qle.RenameFeature=Fri;var Qle={};Object.defineProperty(Qle,"__esModule",{value:!0});Qle.DocumentLinkFeature=void 0;const Ori=Xn,V4=ps,Ege=Mn,Bri=or;class Wri extends Ege.TextDocumentLanguageFeature{constructor(e){super(e,V4.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,Ege.ensure)((0,Ege.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:Bri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(n,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(V4.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(V4.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(n,o,a):a(n,o)},resolveDocumentLink:e.resolveProvider?(n,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(V4.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(V4.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(n,o,a):a(n,o)}:void 0};return[Ori.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Qle.DocumentLinkFeature=Wri;var jle={};Object.defineProperty(jle,"__esModule",{value:!0});jle.ExecuteCommandFeature=void 0;const Hri=Xn,xge=ps,Uri=or,Z7e=Mn;class Vri{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return xge.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Z7e.ensure)((0,Z7e.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Uri.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,n=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(xge.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(xge.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Hri.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,n):n(r,a)));this._commands.set(e.id,o)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}}jle.ExecuteCommandFeature=Vri;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});Yle.FileSystemWatcherFeature=void 0;const zri=Xn,YI=ps,eq=Mn;class $ri{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return YI.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,eq.ensure)((0,eq.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,eq.ensure)((0,eq.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;const t=[];for(const i of e.registerOptions.watchers){const n=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(n===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&YI.WatchKind.Create)!==0,r=(i.kind&YI.WatchKind.Change)!==0,a=(i.kind&YI.WatchKind.Delete)!==0);const c=zri.workspace.createFileSystemWatcher(n,!o,!r,!a);this.hookListeners(c,o,r,a,t),t.push(c)}this._watchers.set(e.id,t)}registerRaw(e,t){let i=[];for(let n of t)this.hookListeners(n,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,n,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.FileChangeType.Changed}),null,o),n&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}Yle.FileSystemWatcherFeature=$ri;var Jle={};Object.defineProperty(Jle,"__esModule",{value:!0});Jle.ColorProviderFeature=void 0;const Gri=Xn,z4=ps,Dge=Mn;class Kri extends Dge.TextDocumentLanguageFeature{constructor(e){super(e,z4.DocumentColorRequest.type)}fillClientCapabilities(e){(0,Dge.ensure)((0,Dge.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.colorProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(n,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={color:d,textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:a.code2ProtocolConverter.asRange(h.range)};return a.sendRequest(z4.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(z4.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(n,o,r,c):c(n,o,r)},provideDocumentColors:(n,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(z4.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(z4.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(n,o,a):a(n,o)}};return[Gri.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Jle.ColorProviderFeature=Kri;var Xle={};Object.defineProperty(Xle,"__esModule",{value:!0});Xle.ImplementationFeature=void 0;const qri=Xn,kge=ps,Ige=Mn;class Qri extends Ige.TextDocumentLanguageFeature{constructor(e){super(e,kge.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Ige.ensure)((0,Ige.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.implementationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(kge.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(kge.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return qri.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Xle.ImplementationFeature=Qri;var Zle={};Object.defineProperty(Zle,"__esModule",{value:!0});Zle.TypeDefinitionFeature=void 0;const jri=Xn,Tge=ps,$4=Mn;class Yri extends $4.TextDocumentLanguageFeature{constructor(e){super(e,Tge.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,$4.ensure)((0,$4.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,$4.ensure)((0,$4.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.typeDefinitionProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Tge.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Tge.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return jri.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Zle.TypeDefinitionFeature=Yri;var hU={};Object.defineProperty(hU,"__esModule",{value:!0});hU.WorkspaceFoldersFeature=hU.arrayDiff=void 0;const Jri=or,tq=Xn,G4=ps;function Lge(s,e){if(s!=null)return s[e]}function I1e(s,e){return s.filter(t=>e.indexOf(t)<0)}hU.arrayDiff=I1e;class Xri{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return G4.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=tq.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){const t=this._client;t.onRequest(G4.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=tq.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(o,r):r()});const i=Lge(Lge(Lge(e,"workspace"),"workspaceFolders"),"changeNotifications");let n;typeof i=="string"?n=i:i===!0&&(n=Jri.generateUuid()),n&&this.register({id:n,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=I1e(this._initialFolders,e),n=I1e(e,this._initialFolders);(n.length>0||i.length>0)&&(t=this.doSendEvent(n,i))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(i=>{this._client.error(`Sending notification ${G4.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(n=>this.asProtocol(n)),removed:t.map(n=>this.asProtocol(n))}};return this._client.sendNotification(G4.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,n=tq.workspace.onDidChangeWorkspaceFolders(o=>{let r=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(o,r):r(o)).catch(l=>{this._client.error(`Sending notification ${G4.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,n),this.sendInitialEvent(tq.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}hU.WorkspaceFoldersFeature=Xri;var ede={};Object.defineProperty(ede,"__esModule",{value:!0});ede.FoldingRangeFeature=void 0;const e6e=Xn,JI=ps,K4=Mn;class Zri extends K4.TextDocumentLanguageFeature{constructor(e){super(e,JI.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,K4.ensure)((0,K4.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[JI.FoldingRangeKind.Comment,JI.FoldingRangeKind.Imports,JI.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,K4.ensure)((0,K4.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(JI.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,n]=this.getRegistration(t,e.foldingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new e6e.EventEmitter,n={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(o,r,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(JI.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(JI.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[e6e.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeFoldingRange:i}]}}ede.FoldingRangeFeature=Zri;var tde={};Object.defineProperty(tde,"__esModule",{value:!0});tde.DeclarationFeature=void 0;const eai=Xn,Rge=ps,Mge=Mn;class tai extends Mge.TextDocumentLanguageFeature{constructor(e){super(e,Rge.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,Mge.ensure)((0,Mge.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.declarationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Rge.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Rge.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return eai.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}tde.DeclarationFeature=tai;var ide={};Object.defineProperty(ide,"__esModule",{value:!0});ide.SelectionRangeFeature=void 0;const iai=Xn,Nge=ps,Pge=Mn;class nai extends Pge.TextDocumentLanguageFeature{constructor(e){super(e,Nge.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,Pge.ensure)((0,Pge.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.selectionRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(n,o,r)=>{const a=this._client,c=async(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),positions:a.code2ProtocolConverter.asPositionsSync(h,u)};return a.sendRequest(Nge.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(Nge.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return iai.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}ide.SelectionRangeFeature=nai;var nde={};Object.defineProperty(nde,"__esModule",{value:!0});nde.ProgressFeature=void 0;const t6e=ps,sai=_G;function oai(s,e){return s[e]===void 0&&(s[e]=Object.create(null)),s[e]}class rai{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:t6e.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){oai(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new sai.ProgressPart(this._client,n.token,t))};e.onRequest(t6e.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}nde.ProgressFeature=rai;var sde={};Object.defineProperty(sde,"__esModule",{value:!0});sde.CallHierarchyFeature=void 0;const aai=Xn,L0=ps,Fge=Mn;class cai{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(L0.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>n.handleFailedRequest(L0.CallHierarchyPrepareRequest.type,l,h,null))};return o.prepareCallHierarchy?o.prepareCallHierarchy(e,t,i,r):r(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(L0.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(L0.CallHierarchyIncomingCallsRequest.type,a,l,null))};return n.provideCallHierarchyIncomingCalls?n.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(L0.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(L0.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return n.provideCallHierarchyOutgoingCalls?n.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class lai extends Fge.TextDocumentLanguageFeature{constructor(e){super(e,L0.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,Fge.ensure)((0,Fge.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.callHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new cai(t);return[aai.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}sde.CallHierarchyFeature=lai;var ode={};Object.defineProperty(ode,"__esModule",{value:!0});ode.SemanticTokensFeature=void 0;const iq=Xn,Ss=ps,q4=Mn,dai=kr;class hai extends q4.TextDocumentLanguageFeature{constructor(e){super(e,Ss.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,q4.ensure)((0,q4.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Ss.SemanticTokenTypes.namespace,Ss.SemanticTokenTypes.type,Ss.SemanticTokenTypes.class,Ss.SemanticTokenTypes.enum,Ss.SemanticTokenTypes.interface,Ss.SemanticTokenTypes.struct,Ss.SemanticTokenTypes.typeParameter,Ss.SemanticTokenTypes.parameter,Ss.SemanticTokenTypes.variable,Ss.SemanticTokenTypes.property,Ss.SemanticTokenTypes.enumMember,Ss.SemanticTokenTypes.event,Ss.SemanticTokenTypes.function,Ss.SemanticTokenTypes.method,Ss.SemanticTokenTypes.macro,Ss.SemanticTokenTypes.keyword,Ss.SemanticTokenTypes.modifier,Ss.SemanticTokenTypes.comment,Ss.SemanticTokenTypes.string,Ss.SemanticTokenTypes.number,Ss.SemanticTokenTypes.regexp,Ss.SemanticTokenTypes.operator,Ss.SemanticTokenTypes.decorator],t.tokenModifiers=[Ss.SemanticTokenModifiers.declaration,Ss.SemanticTokenModifiers.definition,Ss.SemanticTokenModifiers.readonly,Ss.SemanticTokenModifiers.static,Ss.SemanticTokenModifiers.deprecated,Ss.SemanticTokenModifiers.abstract,Ss.SemanticTokenModifiers.async,Ss.SemanticTokenModifiers.modification,Ss.SemanticTokenModifiers.documentation,Ss.SemanticTokenModifiers.defaultLibrary],t.formats=[Ss.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,q4.ensure)((0,q4.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Ss.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[n,o]=this.getRegistration(t,e.semanticTokensProvider);!n||!o||this.register({id:n,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=dai.boolean(e.full)?e.full:e.full!==void 0,n=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new iq.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,b=(w,y)=>{const C={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(w)};return m.sendRequest(Ss.SemanticTokensRequest.type,C,y).then(A=>y.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(A,y),A=>m.handleFailedRequest(Ss.SemanticTokensRequest.type,y,A,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,b):b(f,p)},provideDocumentSemanticTokensEdits:n?(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),previousResultId:C};return v.sendRequest(Ss.SemanticTokensDeltaRequest.type,L,A).then(async k=>A.isCancellationRequested?null:Ss.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,A):await v.protocol2CodeConverter.asSemanticTokensEdits(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensDeltaRequest.type,A,k,null))};return b.provideDocumentSemanticTokensEdits?b.provideDocumentSemanticTokensEdits(f,p,m,w):w(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),range:v.code2ProtocolConverter.asRange(C)};return v.sendRequest(Ss.SemanticTokensRangeRequest.type,L,A).then(k=>A.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensRangeRequest.type,A,k,null))};return b.provideDocumentRangeSemanticTokens?b.provideDocumentRangeSemanticTokens(f,p,m,w):w(f,p,m)}}:void 0,l=[],d=this._client,h=d.protocol2CodeConverter.asSemanticTokensLegend(e.legend),u=d.protocol2CodeConverter.asDocumentSelector(t);return r!==void 0&&l.push(iq.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(iq.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new iq.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}ode.SemanticTokensFeature=hai;var Qf={};Object.defineProperty(Qf,"__esModule",{value:!0});Qf.WillDeleteFilesFeature=Qf.WillRenameFilesFeature=Qf.WillCreateFilesFeature=Qf.DidDeleteFilesFeature=Qf.DidRenameFilesFeature=Qf.DidCreateFilesFeature=void 0;const I_=Xn,uai=Ale,yA=ps,gai=or;function i6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}function fai(s,e){return s[e]}function n6e(s,e,t){s[e]=t}class rL{constructor(e,t,i,n,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,this._serverCapability=o,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){const t=i6e(i6e(e,"workspace"),"fileOperations");n6e(t,"dynamicRegistration",!0),n6e(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?fai(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:gai.generateUuid(),registerOptions:{filters:i.filters}})}catch(n){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${n}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const n=new uai.Minimatch(i.pattern.glob,rL.asMinimatchOptions(i.pattern.options));if(!n.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:n,kind:i.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return rL.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async o=>{const r=t(o),a=r.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==r.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(r);if(d===void 0)return this._client.error(`Failed to determine file type for ${r.toString()}.`),!0;if(d===I_.FileType.File&&l.kind===yA.FileOperationPatternKind.file||d===I_.FileType.Directory&&l.kind===yA.FileOperationPatternKind.folder)return!0}else if(l.kind===yA.FileOperationPatternKind.folder&&await rL.getFileType(r)===I_.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((o,r)=>i[r]);return{...e,files:n}}static async getFileType(e){try{return(await I_.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class jot extends rL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o),this._notificationType=i,this._accessUri=r,this._createParams=a}async send(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=async n=>this._client.sendNotification(this._notificationType,this._createParams(n));return this.doSend(t,i)}}}class Yot extends jot{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){const t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);const i=await rL.getFileType(e);return i&&this._fsPathFileTypes.set(t,i),i}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}}class pai extends jot{constructor(e){super(e,I_.workspace.onDidCreateFiles,yA.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.didCreateFiles?i.didCreateFiles(e,t):t(e)}}Qf.DidCreateFilesFeature=pai;class mai extends Yot{constructor(e){super(e,I_.workspace.onDidRenameFiles,yA.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=I_.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didRenameFiles?i.didRenameFiles(e,t):t(e)}}Qf.DidRenameFilesFeature=mai;class _ai extends Yot{constructor(e){super(e,I_.workspace.onDidDeleteFiles,yA.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=I_.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didDeleteFiles?i.didDeleteFiles(e,t):t(e)}}Qf.DidDeleteFilesFeature=_ai;class ZPe extends rL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o),this._requestType=i,this._accessUri=r,this._createParams=a}async send(e){const t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=n=>this._client.sendRequest(this._requestType,this._createParams(n),n.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class vai extends ZPe{constructor(e){super(e,I_.workspace.onWillCreateFiles,yA.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willCreateFiles?i.willCreateFiles(e,t):t(e)}}Qf.WillCreateFilesFeature=vai;class bai extends ZPe{constructor(e){super(e,I_.workspace.onWillRenameFiles,yA.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willRenameFiles?i.willRenameFiles(e,t):t(e)}}Qf.WillRenameFilesFeature=bai;class wai extends ZPe{constructor(e){super(e,I_.workspace.onWillDeleteFiles,yA.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willDeleteFiles?i.willDeleteFiles(e,t):t(e)}}Qf.WillDeleteFilesFeature=wai;var rde={};Object.defineProperty(rde,"__esModule",{value:!0});rde.LinkedEditingFeature=void 0;const yai=Xn,Oge=ps,Bge=Mn;class Cai extends Bge.TextDocumentLanguageFeature{constructor(e){super(e,Oge.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,Bge.ensure)((0,Bge.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Oge.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(Oge.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return yai.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rde.LinkedEditingFeature=Cai;var ade={};Object.defineProperty(ade,"__esModule",{value:!0});ade.TypeHierarchyFeature=void 0;const Sai=Xn,R0=ps,Wge=Mn;class Aai{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(R0.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>n.handleFailedRequest(R0.TypeHierarchyPrepareRequest.type,l,h,null))};return o.prepareTypeHierarchy?o.prepareTypeHierarchy(e,t,i,r):r(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(R0.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(R0.TypeHierarchySupertypesRequest.type,a,l,null))};return n.provideTypeHierarchySupertypes?n.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(R0.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(R0.TypeHierarchySubtypesRequest.type,a,l,null))};return n.provideTypeHierarchySubtypes?n.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class Eai extends Wge.TextDocumentLanguageFeature{constructor(e){super(e,R0.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,Wge.ensure)((0,Wge.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.typeHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new Aai(t);return[Sai.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}ade.TypeHierarchyFeature=Eai;var cde={};Object.defineProperty(cde,"__esModule",{value:!0});cde.InlineValueFeature=void 0;const s6e=Xn,nq=ps,Q4=Mn;class xai extends Q4.TextDocumentLanguageFeature{constructor(e){super(e,nq.InlineValueRequest.type)}fillClientCapabilities(e){(0,Q4.ensure)((0,Q4.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,Q4.ensure)((0,Q4.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(nq.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,n]=this.getRegistration(t,e.inlineValueProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new s6e.EventEmitter,n={onDidChangeInlineValues:i.event,provideInlineValues:(o,r,a,c)=>{const l=this._client,d=(u,f,p,m)=>{const v={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(u),range:l.code2ProtocolConverter.asRange(f),context:l.code2ProtocolConverter.asInlineValueContext(p)};return l.sendRequest(nq.InlineValueRequest.type,v,m).then(b=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,m),b=>l.handleFailedRequest(nq.InlineValueRequest.type,m,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,n),{provider:n,onDidChangeInlineValues:i}]}registerProvider(e,t){return s6e.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}cde.InlineValueFeature=xai;var lde={};Object.defineProperty(lde,"__esModule",{value:!0});lde.InlayHintsFeature=void 0;const o6e=Xn,DP=ps,j4=Mn;class Dai extends j4.TextDocumentLanguageFeature{constructor(e){super(e,DP.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,j4.ensure)((0,j4.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,j4.ensure)((0,j4.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(DP.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,n]=this.getRegistration(t,e.inlayHintProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new o6e.EventEmitter,n={onDidChangeInlayHints:i.event,provideInlayHints:(o,r,a)=>{const c=this._client,l=async(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u)};try{const m=await c.sendRequest(DP.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(DP.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return n.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(DP.InlayHintResolveRequest.type,a.code2ProtocolConverter.asInlayHint(d),h);if(h.isCancellationRequested)return null;const f=a.protocol2CodeConverter.asInlayHint(u,h);return h.isCancellationRequested?null:f}catch(u){return a.handleFailedRequest(DP.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,n),{provider:n,onDidChangeInlayHints:i}]}registerProvider(e,t){return o6e.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lde.InlayHintsFeature=Dai;var dde={};Object.defineProperty(dde,"__esModule",{value:!0});dde.InlineCompletionItemFeature=void 0;const kai=Xn,Hge=ps,Uge=Mn,Iai=or;class Tai extends Uge.TextDocumentLanguageFeature{constructor(e){super(e,Hge.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,Uge.ensure)((0,Uge.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:Iai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(n,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(Hge.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(Hge.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(n,o,r,a,d):d(n,o,r,a)}};return[kai.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}dde.InlineCompletionItemFeature=Tai;Object.defineProperty(vh,"__esModule",{value:!0});vh.ProposedFeatures=Jot=vh.BaseLanguageClient=vh.MessageTransports=vh.SuspendMode=vh.State=vh.CloseAction=vh.ErrorAction=vh.RevealOutputChannelOn=void 0;const Wr=Xn,It=ps,Lai=xle,Rai=Ple,Nv=kr,sq=yh,r6e=or,Mai=_G,pv=Mn,Nai=bA,a6e=Fle,c6e=RD,kP=qf,Pai=Ole,Fai=Ble,Oai=Wle,Bai=Hle,Wai=Ule,Hai=JPe,Uai=Vle,Vai=zle,zai=$le,$ai=Gle,Vge=MD,Gai=qle,Kai=Qle,qai=jle,Qai=Yle,jai=Jle,Yai=Xle,Jai=Zle,Xai=hU,Zai=ede,eci=tde,tci=ide,ici=nde,nci=sde,sci=ode,IP=Qf,oci=rde,rci=ade,aci=cde,cci=lde,lci=dde;var c1;(function(s){s[s.Debug=0]="Debug",s[s.Info=1]="Info",s[s.Warn=2]="Warn",s[s.Error=3]="Error",s[s.Never=4]="Never"})(c1||(vh.RevealOutputChannelOn=c1={}));var g7;(function(s){s[s.Continue=1]="Continue",s[s.Shutdown=2]="Shutdown"})(g7||(vh.ErrorAction=g7={}));var ND;(function(s){s[s.DoNotRestart=1]="DoNotRestart",s[s.Restart=2]="Restart"})(ND||(vh.CloseAction=ND={}));var Lz;(function(s){s[s.Stopped=1]="Stopped",s[s.Starting=3]="Starting",s[s.Running=2]="Running"})(Lz||(vh.State=Lz={}));var l6e;(function(s){s.off="off",s.on="on"})(l6e||(vh.SuspendMode=l6e={}));var T1e;(function(s){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&Nv.stringArray(t.enabledCommands)?t:!1}s.sanitizeIsTrusted=e})(T1e||(T1e={}));class dci{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:g7.Continue}:{action:g7.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:ND.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:ND.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:ND.Restart})}}var no;(function(s){s.Initial="initial",s.Starting="starting",s.StartFailed="startFailed",s.Running="running",s.Stopping="stopping",s.Stopped="stopped"})(no||(no={}));var d6e;(function(s){function e(t){return t&&It.MessageReader.is(t.reader)&&It.MessageWriter.is(t.writer)}s.is=e})(d6e||(vh.MessageTransports=d6e={}));class aL{constructor(e,t,i){this._traceFormat=It.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new sq.Semaphore(1),this._id=e,this._name=t,i=i||{};const n={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(n.isTrusted=T1e.sanitizeIsTrusted(i.markdown.isTrusted),n.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??c1.Error,stdioEncoding:i.stdioEncoding??"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler??this.createDefaultErrorHandler(i.connectionOptions?.maxRestartCount),middleware:i.middleware??{},uriConverters:i.uriConverters,workspaceFolder:i.workspaceFolder,connectionOptions:i.connectionOptions,markdown:n,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=no.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,i.outputChannel?(this._outputChannel=i.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=i.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new sq.Semaphore(1),this._pendingChangeDelayer=new sq.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new sq.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new It.Emitter,this._stateChangeEmitter=new It.Emitter,this._trace=It.Trace.Off,this._tracer={log:(o,r)=>{Nv.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=Lai.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=Rai.createConverter(i.uriConverters?i.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=Wr.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){switch(this.$state){case no.Starting:return Lz.Starting;case no.Running:return Lz.Running;default:return Lz.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const n=this._clientOptions.middleware?.sendRequest;if(n!==void 0){let o,r;return t.length===1?It.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),n(e,o,r,(a,c,l)=>{const d=[];return c!==void 0&&d.push(c),l!==void 0&&d.push(l),i.sendRequest(a,...d)})}else return i.sendRequest(e,...t)}onRequest(e,t){const i=typeof e=="string"?e:e.method;this._requestHandlers.set(i,t);const n=this.activeConnection();let o;return n!==void 0?(this._requestDisposables.set(i,n.onRequest(e,t)),o={dispose:()=>{const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){if(this.$state===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full;let n;i&&typeof e!="string"&&e.method===It.DidOpenTextDocumentNotification.method&&(n=t?.textDocument.uri,this._pendingOpenNotifications.add(n));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),n!==void 0&&this._pendingOpenNotifications.delete(n);const r=this._clientOptions.middleware?.sendNotification;return r?r(e,o.sendNotification.bind(o),t):o.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const n=this.activeConnection();let o;return n!==void 0?(this._notificationDisposables.set(i,n.onNotification(e,t)),o={dispose:()=>{const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}async sendProgress(e,t,i){if(this.$state===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(n){throw this.error(`Sending progress for token ${t} failed.`,n),n}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const n=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=It.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return n!==void 0?(this._progressDisposables.set(t,n.onProgress(e,t,a)),o={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new dci(this,e??4)}async setTrace(e){this._trace=e;const t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof It.ResponseError){const t=e;return` Message: ${t.message} Code: ${t.code} ${t.data?` -`+t.data.toString():""}`}return e instanceof Error?rb.string(e.stack)?e.stack:e.message:rb.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Debug,GT.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Info,GT.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Warning,GT.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Error,GT.Error,"Error",e,t,i)}logOutputMessage(e,t,i,s,o,r){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${s}`),o!=null&&this.outputChannel.appendLine(this.data2String(o)),(r==="force"||r&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,s)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===Ft.MessageType.Error?ra.window.showErrorMessage:e===Ft.MessageType.Warning?ra.window.showWarningMessage:ra.window.showInformationMessage)(t,"Go to output").then(s=>{s!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===wo.Initial||this.$state===wo.Stopping||this.$state===wo.Stopped}needsStop(){return this.$state===wo.Starting||this.$state===wo.Running}activeConnection(){return this.$state===wo.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===wo.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===wo.Stopping)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;const[e,t,i]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?ra.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):ra.languages.createDiagnosticCollection());for(const[s,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(s)||this._pendingNotificationHandlers.set(s,o);for(const[s,o]of this._requestHandlers)this._pendingRequestHandlers.has(s)||this._pendingRequestHandlers.set(s,o);for(const[s,o]of this._progressHandlers)this._pendingProgressHandlers.has(s)||this._pendingProgressHandlers.set(s,o);this.$state=wo.Starting;try{const s=await this.createConnection();s.onNotification(Ft.LogMessageNotification.type,o=>{switch(o.type){case Ft.MessageType.Error:this.error(o.message,void 0,!1);break;case Ft.MessageType.Warning:this.warn(o.message,void 0,!1);break;case Ft.MessageType.Info:this.info(o.message,void 0,!1);break;case Ft.MessageType.Debug:this.debug(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),s.onNotification(Ft.ShowMessageNotification.type,o=>{switch(o.type){case Ft.MessageType.Error:ra.window.showErrorMessage(o.message);break;case Ft.MessageType.Warning:ra.window.showWarningMessage(o.message);break;case Ft.MessageType.Info:ra.window.showInformationMessage(o.message);break;default:ra.window.showInformationMessage(o.message)}}),s.onRequest(Ft.ShowMessageRequest.type,o=>{let r;switch(o.type){case Ft.MessageType.Error:r=ra.window.showErrorMessage;break;case Ft.MessageType.Warning:r=ra.window.showWarningMessage;break;case Ft.MessageType.Info:r=ra.window.showInformationMessage;break;default:r=ra.window.showInformationMessage}let a=o.actions||[];return r(o.message,...a)}),s.onNotification(Ft.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),s.onRequest(Ft.ShowDocumentRequest.type,async o=>{const r=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await ra.env.openExternal(l)};{const d={};return c.selection!==void 0&&(d.selection=this.protocol2CodeConverter.asRange(c.selection)),c.takeFocus===void 0||c.takeFocus===!1?d.preserveFocus=!0:c.takeFocus===!0&&(d.preserveFocus=!1),await ra.window.showTextDocument(l,d),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(o,r):r(o)}),s.listen(),await this.initialize(s),t()}catch(s){this.$state=wo.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,s,"force"),i(s)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((s,o)=>{e=s,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);const t=this._clientOptions.initializationOptions,[i,s]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],o={processId:null,clientInfo:{name:ra.env.appName,version:ra.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(ra.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:rb.func(t)?t():t,trace:Ft.Trace.toString(this._trace),workspaceFolders:s};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const r=Rqe.generateUuid(),a=new Sci.ProgressPart(e,r);o.workDoneToken=r;try{const c=await this.doInitialize(e,o);return a.done(),c}catch(c){throw a.cancel(),c}}else return this.doInitialize(e,o)}async doInitialize(e,t){try{const i=await e.initialize(t);if(i.capabilities.positionEncoding!==void 0&&i.capabilities.positionEncoding!==Ft.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=wo.Running;let s;rb.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===Ft.TextDocumentSyncKind.None?s={openClose:!1,change:Ft.TextDocumentSyncKind.None,save:void 0}:s={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!==void 0&&i.capabilities.textDocumentSync!==null&&(s=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:s}),e.onNotification(Ft.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(Ft.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(Ft.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(Ft.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o));for(const[o,r]of this._pendingNotificationHandlers)this._notificationDisposables.set(o,e.onNotification(o,r));this._pendingNotificationHandlers.clear();for(const[o,r]of this._pendingRequestHandlers)this._requestDisposables.set(o,e.onRequest(o,r));this._pendingRequestHandlers.clear();for(const[o,r]of this._pendingProgressHandlers)this._progressDisposables.set(o,e.onProgress(r.type,o,r.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(Ft.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),i}catch(i){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(i)?this.initialize(e):this.stop():i instanceof Ft.ResponseError&&i.data&&i.data.retry?ra.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(s=>{s&&s.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&ra.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=ra.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t){if(this.$state===wo.Stopped||this.$state===wo.Initial)return;if(this.$state===wo.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}const i=this.activeConnection();if(i===void 0||this.$state!==wo.Running)throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=wo.Stopping,this.cleanUp(e);const s=new Promise(r=>{(0,Ft.RAL)().timer.setTimeout(r,t)}),o=(async r=>(await r.shutdown(),await r.exit(),r))(i);return this._onStop=Promise.race([s,o]).then(r=>{if(r!==void 0)r.end(),r.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},r=>{throw this.error("Stopping server failed",r,!1),r}).finally(()=>{this.$state=wo.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();const t=this._listeners.splice(0,this._listeners.length);for(const i of t)i.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(const i of Array.from(this._features.entries()).map(s=>s[1]).reverse())i.clear();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){const t=this;async function i(o){return t._fileEvents.push(o),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(Ft.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const s=this.clientOptions.middleware?.workspace;(s?.didChangeWatchedFile?s.didChangeWatchedFile(e,i):i(e)).catch(o=>{t.error("Notify file events failed.",o)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{const t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(const i of t){const s=this.code2ProtocolConverter.asChangeTextDocumentParams(i);await e.sendNotification(Ft.DidChangeTextDocumentNotification.type,s),this._didChangeTextDocumentFeature.notificationSent(i,Ft.DidChangeTextDocumentNotification.type,s)}}catch(t){throw this.error("Sending pending changes failed",t,!1),t}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{const e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error("Delivering pending changes failed",e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;const t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,Ft.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;const e=this._diagnosticQueue.entries().next();if(e.done===!0)return;const[t,i]=e.value;this._diagnosticQueue.delete(t);const s=new ra.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:s},this._p2c.asDiagnostics(i,s.token).then(o=>{if(!s.token.isCancellationRequested){const r=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(r,o,(c,l)=>this.setDiagnostics(c,l)):this.setDiagnostics(r,o)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return ra.env.language}async $start(){if(this.$state===wo.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();const e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(s,o,r)=>{this.handleConnectionError(s,o,r).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(s=>this.error("Handling connection close failed",s))};const i=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=ili(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===wo.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:o0.DoNotRestart};if(this.$state!==wo.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===o0.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp("stop"),this.$state===wo.Starting?this.$state=wo.StartFailed:this.$state=wo.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===o0.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=wo.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,i){const s=await this._clientOptions.errorHandler.error(e,t,i);s.action===vq.Shutdown?(this.error(s.message??`Client ${this._name}: connection to server is erroring. +`+t.data.toString():""}`}return e instanceof Error?Nv.string(e.stack)?e.stack:e.message:Nv.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(It.MessageType.Debug,c1.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(It.MessageType.Info,c1.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(It.MessageType.Warning,c1.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(It.MessageType.Error,c1.Error,"Error",e,t,i)}logOutputMessage(e,t,i,n,o,r){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${n}`),o!=null&&this.outputChannel.appendLine(this.data2String(o)),(r==="force"||r&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,n)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===It.MessageType.Error?Wr.window.showErrorMessage:e===It.MessageType.Warning?Wr.window.showWarningMessage:Wr.window.showInformationMessage)(t,"Go to output").then(n=>{n!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===no.Initial||this.$state===no.Stopping||this.$state===no.Stopped}needsStop(){return this.$state===no.Starting||this.$state===no.Running}activeConnection(){return this.$state===no.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===no.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===no.Stopping)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;const[e,t,i]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Wr.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Wr.languages.createDiagnosticCollection());for(const[n,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(n)||this._pendingNotificationHandlers.set(n,o);for(const[n,o]of this._requestHandlers)this._pendingRequestHandlers.has(n)||this._pendingRequestHandlers.set(n,o);for(const[n,o]of this._progressHandlers)this._pendingProgressHandlers.has(n)||this._pendingProgressHandlers.set(n,o);this.$state=no.Starting;try{const n=await this.createConnection();n.onNotification(It.LogMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:this.error(o.message,void 0,!1);break;case It.MessageType.Warning:this.warn(o.message,void 0,!1);break;case It.MessageType.Info:this.info(o.message,void 0,!1);break;case It.MessageType.Debug:this.debug(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),n.onNotification(It.ShowMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:Wr.window.showErrorMessage(o.message);break;case It.MessageType.Warning:Wr.window.showWarningMessage(o.message);break;case It.MessageType.Info:Wr.window.showInformationMessage(o.message);break;default:Wr.window.showInformationMessage(o.message)}}),n.onRequest(It.ShowMessageRequest.type,o=>{let r;switch(o.type){case It.MessageType.Error:r=Wr.window.showErrorMessage;break;case It.MessageType.Warning:r=Wr.window.showWarningMessage;break;case It.MessageType.Info:r=Wr.window.showInformationMessage;break;default:r=Wr.window.showInformationMessage}let a=o.actions||[];return r(o.message,...a)}),n.onNotification(It.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),n.onRequest(It.ShowDocumentRequest.type,async o=>{const r=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await Wr.env.openExternal(l)};{const d={};return c.selection!==void 0&&(d.selection=this.protocol2CodeConverter.asRange(c.selection)),c.takeFocus===void 0||c.takeFocus===!1?d.preserveFocus=!0:c.takeFocus===!0&&(d.preserveFocus=!1),await Wr.window.showTextDocument(l,d),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(o,r):r(o)}),n.listen(),await this.initialize(n),t()}catch(n){this.$state=no.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,n,"force"),i(n)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((n,o)=>{e=n,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);const t=this._clientOptions.initializationOptions,[i,n]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],o={processId:null,clientInfo:{name:Wr.env.appName,version:Wr.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(Wr.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Nv.func(t)?t():t,trace:It.Trace.toString(this._trace),workspaceFolders:n};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const r=r6e.generateUuid(),a=new Mai.ProgressPart(e,r);o.workDoneToken=r;try{const c=await this.doInitialize(e,o);return a.done(),c}catch(c){throw a.cancel(),c}}else return this.doInitialize(e,o)}async doInitialize(e,t){try{const i=await e.initialize(t);if(i.capabilities.positionEncoding!==void 0&&i.capabilities.positionEncoding!==It.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=no.Running;let n;Nv.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===It.TextDocumentSyncKind.None?n={openClose:!1,change:It.TextDocumentSyncKind.None,save:void 0}:n={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!==void 0&&i.capabilities.textDocumentSync!==null&&(n=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:n}),e.onNotification(It.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(It.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(It.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(It.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o));for(const[o,r]of this._pendingNotificationHandlers)this._notificationDisposables.set(o,e.onNotification(o,r));this._pendingNotificationHandlers.clear();for(const[o,r]of this._pendingRequestHandlers)this._requestDisposables.set(o,e.onRequest(o,r));this._pendingRequestHandlers.clear();for(const[o,r]of this._pendingProgressHandlers)this._progressDisposables.set(o,e.onProgress(r.type,o,r.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(It.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),i}catch(i){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(i)?this.initialize(e):this.stop():i instanceof It.ResponseError&&i.data&&i.data.retry?Wr.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(n=>{n&&n.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&Wr.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=Wr.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t){if(this.$state===no.Stopped||this.$state===no.Initial)return;if(this.$state===no.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}const i=this.activeConnection();if(i===void 0||this.$state!==no.Running)throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=no.Stopping,this.cleanUp(e);const n=new Promise(r=>{(0,It.RAL)().timer.setTimeout(r,t)}),o=(async r=>(await r.shutdown(),await r.exit(),r))(i);return this._onStop=Promise.race([n,o]).then(r=>{if(r!==void 0)r.end(),r.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},r=>{throw this.error("Stopping server failed",r,!1),r}).finally(()=>{this.$state=no.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();const t=this._listeners.splice(0,this._listeners.length);for(const i of t)i.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(const i of Array.from(this._features.entries()).map(n=>n[1]).reverse())i.clear();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){const t=this;async function i(o){return t._fileEvents.push(o),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(It.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const n=this.clientOptions.middleware?.workspace;(n?.didChangeWatchedFile?n.didChangeWatchedFile(e,i):i(e)).catch(o=>{t.error("Notify file events failed.",o)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{const t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(const i of t){const n=this.code2ProtocolConverter.asChangeTextDocumentParams(i);await e.sendNotification(It.DidChangeTextDocumentNotification.type,n),this._didChangeTextDocumentFeature.notificationSent(i,It.DidChangeTextDocumentNotification.type,n)}}catch(t){throw this.error("Sending pending changes failed",t,!1),t}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{const e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error("Delivering pending changes failed",e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;const t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,It.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;const e=this._diagnosticQueue.entries().next();if(e.done===!0)return;const[t,i]=e.value;this._diagnosticQueue.delete(t);const n=new Wr.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:n},this._p2c.asDiagnostics(i,n.token).then(o=>{if(!n.token.isCancellationRequested){const r=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(r,o,(c,l)=>this.setDiagnostics(c,l)):this.setDiagnostics(r,o)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Wr.env.language}async $start(){if(this.$state===no.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();const e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(n,o,r)=>{this.handleConnectionError(n,o,r).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(n=>this.error("Handling connection close failed",n))};const i=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=uci(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===no.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:ND.DoNotRestart};if(this.$state!==no.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===ND.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp("stop"),this.$state===no.Starting?this.$state=no.StartFailed:this.$state=no.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===ND.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=no.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,i){const n=await this._clientOptions.errorHandler.error(e,t,i);n.action===g7.Shutdown?(this.error(n.message??`Client ${this._name}: connection to server is erroring. ${e.message} -Shutting down server.`,void 0,s.handled===!0?!1:"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)})):this.error(s.message??`Client ${this._name}: connection to server is erroring. -${e.message}`,void 0,s.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(ra.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=ra.workspace.getConfiguration(this._id);let s=Ft.Trace.Off,o=Ft.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?s=Ft.Trace.fromString(r):(s=Ft.Trace.fromString(i.get("trace.server.verbosity","off")),o=Ft.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=s,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(r=>{this.error("Updating trace failed with error",r,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;rb.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(Ft.DidChangeWatchedFilesNotification.type.method).registerRaw(Rqe.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Vw.DynamicFeature.is(e)){const t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){const t=this.getFeature(Ft.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Mqe.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new Nqe.ConfigurationFeature(this)),this.registerFeature(new gB.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new gB.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new gB.WillSaveFeature(this)),this.registerFeature(new gB.WillSaveWaitUntilFeature(this)),this.registerFeature(new gB.DidSaveTextDocumentFeature(this)),this.registerFeature(new gB.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Bci.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Eci.CompletionItemFeature(this)),this.registerFeature(new xci.HoverFeature(this)),this.registerFeature(new kci.SignatureHelpFeature(this)),this.registerFeature(new Dci.DefinitionFeature(this)),this.registerFeature(new Rci.ReferencesFeature(this)),this.registerFeature(new Ici.DocumentHighlightFeature(this)),this.registerFeature(new Lci.DocumentSymbolFeature(this)),this.registerFeature(new Tci.WorkspaceSymbolFeature(this)),this.registerFeature(new Mci.CodeActionFeature(this)),this.registerFeature(new Nci.CodeLensFeature(this)),this.registerFeature(new d_e.DocumentFormattingFeature(this)),this.registerFeature(new d_e.DocumentRangeFormattingFeature(this)),this.registerFeature(new d_e.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Pci.RenameFeature(this)),this.registerFeature(new Fci.DocumentLinkFeature(this)),this.registerFeature(new Oci.ExecuteCommandFeature(this)),this.registerFeature(new Nqe.SyncConfigurationFeature(this)),this.registerFeature(new Uci.TypeDefinitionFeature(this)),this.registerFeature(new Hci.ImplementationFeature(this)),this.registerFeature(new Wci.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Vci.WorkspaceFoldersFeature(this)),this.registerFeature(new zci.FoldingRangeFeature(this)),this.registerFeature(new $ci.DeclarationFeature(this)),this.registerFeature(new Gci.SelectionRangeFeature(this)),this.registerFeature(new qci.ProgressFeature(this)),this.registerFeature(new Qci.CallHierarchyFeature(this)),this.registerFeature(new jci.SemanticTokensFeature(this)),this.registerFeature(new Kci.LinkedEditingFeature(this)),this.registerFeature(new fB.DidCreateFilesFeature(this)),this.registerFeature(new fB.DidRenameFilesFeature(this)),this.registerFeature(new fB.DidDeleteFilesFeature(this)),this.registerFeature(new fB.WillCreateFilesFeature(this)),this.registerFeature(new fB.WillRenameFilesFeature(this)),this.registerFeature(new fB.WillDeleteFilesFeature(this)),this.registerFeature(new Yci.TypeHierarchyFeature(this)),this.registerFeature(new Jci.InlineValueFeature(this)),this.registerFeature(new Xci.InlayHintsFeature(this)),this.registerFeature(new Aci.DiagnosticFeature(this)),this.registerFeature(new Mqe.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(TRe.createAll(this))}fillInitializeParams(e){for(let t of this._features)rb.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,Vw.ensure)(e,"workspace").applyEdit=!0;const t=(0,Vw.ensure)((0,Vw.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[Ft.ResourceOperationKind.Create,Ft.ResourceOperationKind.Rename,Ft.ResourceOperationKind.Delete],t.failureHandling=Ft.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,Vw.ensure)((0,Vw.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[Ft.DiagnosticTag.Unnecessary,Ft.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const s=(0,Vw.ensure)(e,"window"),o=(0,Vw.ensure)(s,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,Vw.ensure)(s,"showDocument");r.support=!0;const a=(0,Vw.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(ZM.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let c of this._features)c.fillClientCapabilities(e);return e}initializeFeatures(e){const t=this._clientOptions.documentSelector;for(const i of this._features)rb.func(i.preInitialize)&&i.preInitialize(this._capabilities,t);for(const i of this._features)i.initialize(this._capabilities,t)}async handleRegistrationRequest(e){const t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,i=>this.doRegisterCapability(i)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(const t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(const t of e.registrations){const i=this._dynamicFeatures.get(t.method);if(i===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));const s=t.registerOptions??{};s.documentSelector=s.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:s};try{i.register(o)}catch(r){return Promise.reject(r)}}}async handleUnregistrationRequest(e){const t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,i=>this.doUnregisterCapability(i)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(const t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;const i=this._dynamicFeatures.get(t.method);if(!i)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));i.unregister(t.id)}}async handleApplyWorkspaceEdit(e){const t=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),s=new Map;ra.workspace.textDocuments.forEach(r=>s.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(Ft.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=s.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):rb.asPromise(ra.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,s,o=!0){if(i instanceof Ft.ResponseError){if(i.code===Ft.ErrorCodes.PendingResponseRejected||i.code===Ft.ErrorCodes.ConnectionInactive)return s;if(i.code===Ft.LSPErrorCodes.RequestCancelled||i.code===Ft.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return s;throw i.data!==void 0?new Vw.LSPCancellationError(i.data):new ra.CancellationError}else if(i.code===Ft.LSPErrorCodes.ContentModified){if(ZM.RequestsToCancelOnContentModified.has(e.method)||ZM.CancellableResolveCalls.has(e.method))throw new ra.CancellationError;return s}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Cct=mu.BaseLanguageClient=ZM;ZM.RequestsToCancelOnContentModified=new Set([Ft.SemanticTokensRequest.method,Ft.SemanticTokensRangeRequest.method,Ft.SemanticTokensDeltaRequest.method]);ZM.CancellableResolveCalls=new Set([Ft.CompletionResolveRequest.method,Ft.CodeLensResolveRequest.method,Ft.CodeActionResolveRequest.method,Ft.InlayHintResolveRequest.method,Ft.DocumentLinkResolveRequest.method,Ft.WorkspaceSymbolResolveRequest.method]);class tli{error(e){(0,Ft.RAL)().console.error(e)}warn(e){(0,Ft.RAL)().console.warn(e)}info(e){(0,Ft.RAL)().console.info(e)}log(e){(0,Ft.RAL)().console.log(e)}}function ili(n,e,t,i,s){const o=new tli,r=(0,Ft.createProtocolConnection)(n,e,o,s);return r.onError(c=>{t(c[0],c[1],c[2])}),r.onClose(i),{listen:()=>r.listen(),sendRequest:r.sendRequest,onRequest:r.onRequest,hasPendingResponse:r.hasPendingResponse,sendNotification:r.sendNotification,onNotification:r.onNotification,onProgress:r.onProgress,sendProgress:r.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:Ft.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(rb.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(Ft.InitializeRequest.type,c),shutdown:()=>r.sendRequest(Ft.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(Ft.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var TRe;(function(n){function e(t){return[new Zci.InlineCompletionItemFeature(t)]}n.createAll=e})(TRe||(mu.ProposedFeatures=TRe={}));(function(n){var e=sh&&sh.__createBinding||(Object.create?function(s,o,r,a){a===void 0&&(a=r);var c=Object.getOwnPropertyDescriptor(o,r);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(s,a,c)}:function(s,o,r,a){a===void 0&&(a=r),s[a]=o[r]}),t=sh&&sh.__exportStar||function(s,o){for(var r in s)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,s,r)};Object.defineProperty(n,"__esModule",{value:!0}),n.DiagnosticPullMode=n.vsdiag=void 0,t(Ts,n),t($n,n);var i=Ix;Object.defineProperty(n,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(n,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(mu,n)})(uRe);var Kre=Ts;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(r,a,c,l){l===void 0&&(l=c);var d=Object.getOwnPropertyDescriptor(a,c);(!d||("get"in d?!a.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(r,l,d)}:function(r,a,c,l){l===void 0&&(l=c),r[l]=a[c]}),t=sh&&sh.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.LanguageClient=void 0;const i=uRe,s=Kre;t(Kre,n),t(uRe,n);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new s.BrowserMessageReader(this.worker),l=new s.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}n.LanguageClient=o})(hRe);class nli extends Cct{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:s}){super(e??t.toLowerCase(),t,i),this.connectionProvider=s}createMessageTransports(e){return this.connectionProvider.get(e)}}let zt;const pE=new Array(128).fill(void 0);pE.push(void 0,null,!0,!1);function q(n){return pE[n]}let V8=pE.length;function sli(n){n<132||(pE[n]=V8,V8=n)}function l_(n){const e=q(n);return sli(n),e}let Fa=0,t$=null;function qX(){return(t$===null||t$.byteLength===0)&&(t$=new Uint8Array(zt.memory.buffer)),t$}const QX=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},oli=typeof QX.encodeInto=="function"?function(n,e){return QX.encodeInto(n,e)}:function(n,e){const t=QX.encode(n);return e.set(t),{read:n.length,written:t.length}};function Ac(n,e,t){if(t===void 0){const a=QX.encode(n),c=e(a.length,1)>>>0;return qX().subarray(c,c+a.length).set(a),Fa=a.length,c}let i=n.length,s=e(i,1)>>>0;const o=qX();let r=0;for(;r127)break;o[s+r]=a}if(r!==i){r!==0&&(n=n.slice(r)),s=t(s,i,i=r+n.length*3,1)>>>0;const a=qX().subarray(s+r,s+i),c=oli(n,a);r+=c.written,s=t(s,i,r,1)>>>0}return Fa=r,s}function $s(n){return n==null}let pT=null;function Fi(){return(pT===null||pT.buffer.detached===!0||pT.buffer.detached===void 0&&pT.buffer!==zt.memory.buffer)&&(pT=new DataView(zt.memory.buffer)),pT}function tt(n){V8===pE.length&&pE.push(pE.length+1);const e=V8;return V8=pE[e],pE[e]=n,e}const yct=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yct.decode();function no(n,e){return n=n>>>0,yct.decode(qX().subarray(n,n+e))}function RRe(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const s=n.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=n.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(n)){const s=n.length;let o="[";s>0&&(o+=RRe(n[0]));for(let r=1;r1)i=t[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:i}const Yre=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{zt.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function a3(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;try{return i(s.a,s.b,...r)}finally{--s.cnt===0&&(zt.__wbindgen_export_2.get(s.dtor)(s.a,s.b),s.a=0,Yre.unregister(s))}};return o.original=s,Yre.register(o,s,s),o}function c3(n,e,t){zt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3cf0698b1872d41a(n,e,tt(t))}function zw(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;const a=s.a;s.a=0;try{return i(a,s.b,...r)}finally{--s.cnt===0?(zt.__wbindgen_export_2.get(s.dtor)(a,s.b),Yre.unregister(s)):s.a=a}};return o.original=s,Yre.register(o,s,s),o}function Oqe(n,e){zt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h679d01b4e099c0c1(n,e)}function AD(n,e,t){zt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00c9413f2fcf954e(n,e,tt(t))}function Bqe(n,e,t,i){zt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfb9fc20940472abc(n,e,tt(t),tt(i))}function tn(n,e){try{return n.apply(this,e)}catch(t){zt.__wbindgen_exn_store(tt(t))}}function rli(){try{const t=zt.__wbindgen_add_to_stack_pointer(-16);zt.run_event_loop(t);var n=Fi().getInt32(t+4*0,!0),e=Fi().getInt32(t+4*1,!0);if(e)throw l_(n)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}let i$=null;function ali(){return(i$===null||i$.byteLength===0)&&(i$=new Float32Array(zt.memory.buffer)),i$}function PY(n,e){return n=n>>>0,ali().subarray(n/4,n/4+e)}const Wqe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>zt.__wbg_previewconnector_free(n>>>0,1));class bge{static __wrap(e){e=e>>>0;const t=Object.create(bge.prototype);return t.__wbg_ptr=e,Wqe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wqe.unregister(this),e}free(){const e=this.__destroy_into_raw();zt.__wbg_previewconnector_free(e,0)}static create(e,t,i,s){try{const c=zt.__wbindgen_add_to_stack_pointer(-16),l=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),d=Fa;zt.previewconnector_create(c,tt(e),tt(t),l,d,s);var o=Fi().getInt32(c+4*0,!0),r=Fi().getInt32(c+4*1,!0),a=Fi().getInt32(c+4*2,!0);if(a)throw l_(r);return l_(o)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=zt.previewconnector_current_style(this.__wbg_ptr);return l_(e)}show_ui(){try{const s=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_show_ui(s,this.__wbg_ptr);var e=Fi().getInt32(s+4*0,!0),t=Fi().getInt32(s+4*1,!0),i=Fi().getInt32(s+4*2,!0);if(i)throw l_(t);return l_(e)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const s=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_process_lsp_to_preview_message(s,this.__wbg_ptr,tt(e));var t=Fi().getInt32(s+4*0,!0),i=Fi().getInt32(s+4*1,!0);if(i)throw l_(t)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>zt.__wbg_slintserver_free(n>>>0,1));async function cli(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(i){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function lli(){const n={};return n.wbg={},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return tt(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,s;try{i=e,s=t,console.error(no(e,t))}finally{zt.__wbindgen_free(i,s,1)}},n.wbg.__wbindgen_object_drop_ref=function(e){l_(e)},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return q(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return q(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){q(e).attachShader(q(t),q(i))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){q(e).attachShader(q(t),q(i))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,s,o){q(e).bindAttribLocation(q(t),i>>>0,no(s,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,s,o){q(e).bindAttribLocation(q(t),i>>>0,no(s,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){q(e).linkProgram(q(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){q(e).linkProgram(q(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const s=q(e).getProgramParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const s=q(e).getProgramParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbindgen_boolean_get=function(e){const t=q(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){q(e).detachShader(q(t),q(i))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){q(e).detachShader(q(t),q(i))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const s=q(t).getProgramInfoLog(q(i));var o=$s(s)?0:Ac(s,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=Fa;Fi().setInt32(e+4*1,r,!0),Fi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const s=q(t).getProgramInfoLog(q(i));var o=$s(s)?0:Ac(s,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=Fa;Fi().setInt32(e+4*1,r,!0),Fi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,s){q(e).shaderSource(q(t),no(i,s))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,s){q(e).shaderSource(q(t),no(i,s))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){q(e).compileShader(q(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){q(e).compileShader(q(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const s=q(e).getShaderParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const s=q(e).getShaderParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const s=q(t).getShaderInfoLog(q(i));var o=$s(s)?0:Ac(s,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=Fa;Fi().setInt32(e+4*1,r,!0),Fi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const s=q(t).getShaderInfoLog(q(i));var o=$s(s)?0:Ac(s,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=Fa;Fi().setInt32(e+4*1,r,!0),Fi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,s){q(e).uniform2fv(q(t),PY(i,s))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,s){q(e).uniform2fv(q(t),PY(i,s))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){q(e).deleteFramebuffer(q(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){q(e).deleteFramebuffer(q(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){q(e).deleteRenderbuffer(q(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){q(e).deleteRenderbuffer(q(t))},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return tt(e)},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){q(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){q(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return tn(function(e,t,i,s){const o=q(e).getContext(no(t,i),q(s));return $s(o)?0:tt(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=q(e).getSupportedExtensions();return $s(t)?0:tt(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return q(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=q(e)[t>>>0];return tt(i)},n.wbg.__wbindgen_string_get=function(e,t){const i=q(t),s=typeof i=="string"?i:void 0;var o=$s(s)?0:Ac(s,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=Fa;Fi().setInt32(e+4*1,r,!0),Fi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return tn(function(e,t){const i=q(e).getParameter(t>>>0);return tt(i)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return $s(t)?0:tt(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return q(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return q(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,s,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,q(o),r)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,s,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,q(o),r)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,s,o){q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,s,o){q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,s,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,q(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,s,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,q(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,s,o){q(e).scissor(t,i,s,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,s,o){q(e).scissor(t,i,s,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,s,o){q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,s,o){q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){q(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){q(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,s){q(e).uniform4fv(q(t),PY(i,s))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,s){q(e).uniform4fv(q(t),PY(i,s))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){q(e).deleteTexture(q(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){q(e).deleteTexture(q(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){q(e).deleteShader(q(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){q(e).deleteShader(q(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){q(e).deleteProgram(q(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){q(e).deleteProgram(q(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){q(e).useProgram(q(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){q(e).useProgram(q(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){q(e).bindVertexArray(q(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){q(e).bindVertexArrayOES(q(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){q(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){q(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,s){q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,s){q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){q(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){q(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,s){const o=q(e).getUniformLocation(q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,s){const o=q(e).getUniformLocation(q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){q(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){q(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){q(e).uniform1i(q(t),i)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){q(e).uniform1i(q(t),i)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,s,o){q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,s,o){q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){q(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){q(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,s){q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,s){q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,d)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,s,o,r,a){q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,s,o,r,a){q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,s,o){q(e).viewport(t,i,s,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,s,o){q(e).viewport(t,i,s,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,s){q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,s){q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,s){q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,s){q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,s,o){q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,s,o){q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return q(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=q(e).document;return $s(t)?0:tt(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const s=q(e).getElementById(no(t,i));return $s(s)?0:tt(s)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){q(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){q(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return q(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return q(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=q(e).dataset;return tt(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,s){const o=q(t)[no(i,s)];var r=$s(o)?0:Ac(o,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=Fa;Fi().setInt32(e+4*1,a,!0),Fi().setInt32(e+4*0,r,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=q(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=q(e).style;return tt(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return q(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return q(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return q(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return q(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return tn(function(e,t){q(e).before(q(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return tt(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=no(t,i)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var s=$s(i)?0:Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return q(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=q(t).inputType,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){q(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return q(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=q(t).key,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return q(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return q(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return q(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return q(e).getModifierState(no(t,i))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return q(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=q(e).clipboardData;return $s(t)?0:tt(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return tn(function(e,t,i,s){const o=q(t).getData(no(i,s)),r=Ac(o,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=Fa;Fi().setInt32(e+4*1,a,!0),Fi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){q(e).font=no(t,i)},n.wbg.__wbindgen_string_new=function(e,t){const i=no(e,t);return tt(i)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){q(e).fillStyle=q(t)},n.wbg.__wbg_id_8071f78aa2301217=function(e,t){const i=q(t).id,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return q(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return q(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=q(t).currentSrc,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return tn(function(){const e=new Image;return tt(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:no(t,i)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){q(e).onload=q(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){q(e).src=no(t,i)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return tt(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},n.wbg.__wbindgen_number_new=function(e){return tt(e)},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return tt(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},n.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(no(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){q(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){q(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){q(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){q(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,s){q(e).bufferData(t>>>0,q(i),s>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,s){q(e).bufferData(t>>>0,q(i),s>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,s,o){q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,s,o){q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).readPixels(t,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).readPixels(t,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){q(e).deleteVertexArray(q(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){q(e).deleteVertexArrayOES(q(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){q(e).deleteBuffer(q(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){q(e).deleteBuffer(q(t))},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){q(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){q(e).height=t>>>0},n.wbg.__wbg_next_f9cb570345655b9a=function(){return tn(function(e){const t=q(e).next();return tt(t)},arguments)},n.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return q(e).done},n.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=q(e).value;return tt(t)},n.wbg.__wbg_iterator_888179a48810a9fe=function(){return tt(Symbol.iterator)},n.wbg.__wbg_get_224d16597dbbfd96=function(){return tn(function(e,t){const i=Reflect.get(q(e),q(t));return tt(i)},arguments)},n.wbg.__wbindgen_is_function=function(e){return typeof q(e)=="function"},n.wbg.__wbindgen_is_object=function(e){const t=q(e);return typeof t=="object"&&t!==null},n.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=q(e).next;return tt(t)},n.wbg.__wbg_call_1084a111329e68ce=function(){return tn(function(e,t){const i=q(e).call(q(t));return tt(i)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return tn(function(e,t,i){const s=q(e).call(q(t),q(i));return tt(s)},arguments)},n.wbg.__wbg_call_c6fe275aaa60da79=function(){return tn(function(e,t,i,s){const o=q(e).call(q(t),q(i),q(s));return tt(o)},arguments)},n.wbg.__wbindgen_memory=function(){const e=zt.memory;return tt(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return tt(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const s=new Uint8Array(q(e),t>>>0,i>>>0);return tt(s)},n.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return q(e).length},n.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(q(e));return tt(t)},n.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return tn(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return tn(function(){const e=self.self;return tt(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return tn(function(){const e=window.window;return tt(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return tn(function(){const e=globalThis.globalThis;return tt(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return tn(function(){const e=global.global;return tt(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return q(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(no(e,t));return tt(i)},n.wbg.__wbindgen_error_new=function(e,t){const i=new Error(no(e,t));return tt(i)},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return q(e)==q(t)},n.wbg.__wbindgen_number_get=function(e,t){const i=q(t),s=typeof i=="number"?i:void 0;Fi().setFloat64(e+8*1,$s(s)?0:s,!0),Fi().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=q(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=q(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(q(e));return tt(t)},n.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(q(e))},n.wbg.__wbindgen_as_number=function(e){return+q(e)},n.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(q(t)),s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbindgen_bigint_from_i64=function(e){return tt(e)},n.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return tt(t)},n.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},n.wbg.__wbg_new_8608a2b51a5f6737=function(){return tt(new Map)},n.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[l_(t)]=l_(i)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return tt(e)},n.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=l_(i)},n.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const s=q(e).set(q(t),q(i));return tt(s)},n.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},n.wbg.__wbindgen_is_bigint=function(e){return typeof q(e)=="bigint"},n.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=q(t),s=typeof i=="bigint"?i:void 0;Fi().setBigInt64(e+8*1,$s(s)?BigInt(0):s,!0),Fi().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbindgen_jsval_eq=function(e,t){return q(e)===q(t)},n.wbg.__wbindgen_in=function(e,t){return q(e)in q(t)},n.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=q(e)instanceof Map}catch{t=!1}return t},n.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return tt(i)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},s=(r,a)=>{const c=i.a;i.a=0;try{return Bqe(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(s);return tt(o)}finally{i.a=i.b=0}},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return tt(t)},n.wbg.__wbg_platform_509d898d9dce4c23=function(){return tn(function(e,t){const i=q(t).platform,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_previewconnector_new=function(e){const t=bge.__wrap(e);return tt(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(no(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const i=RRe(q(t)),s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return tt(t)},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return tt(t)},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const s=q(e).then(q(t),q(i));return tt(s)},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return tt(i)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return tn(function(e,t,i){const s=q(e).getExtension(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return tn(function(e,t,i){const s=q(e).matchMedia(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return tn(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return tn(function(e,t){return q(e).setTimeout(q(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return tn(function(e,t,i){const s=q(e).createElement(no(t,i));return tt(s)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return tn(function(e,t,i){return q(e).matches(no(t,i))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return tn(function(e,t,i,s,o){q(e).setAttribute(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return tn(function(e){q(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return tn(function(e,t,i,s,o){q(e).fillText(no(t,i),s,o)},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return tn(function(e,t,i){const s=q(e).getContext(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return tn(function(e,t){q(e).addListener(q(t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return tn(function(e,t,i,s,o){q(e).setProperty(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return tn(function(e,t){URL.revokeObjectURL(no(e,t))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=q(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_setData_41207994e2d54785=function(){return tn(function(e,t,i,s,o){q(e).setData(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return tn(function(e,t,i,s){q(e).addEventListener(no(t,i),q(s))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return tn(function(e,t,i,s){q(e).removeEventListener(no(t,i),q(s))},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return tn(function(e,t){q(e).postMessage(q(t))},arguments)},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var s=$s(i)?0:Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return tn(function(){const e=new AbortController;return tt(e)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return tn(function(){const e=new MessageChannel;return tt(e)},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return tt(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return q(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return q(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return q(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=q(e).scheduler;return tt(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return tt(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const s=q(e).postTask(q(t),q(i));return tt(s)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return tt(i)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return tt(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){q(e).onmessage=q(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){q(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=q(e).port2;return tt(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return tn(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return tn(function(e,t,i){return q(e).setTimeout(q(t),i)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(q(e),q(t));return tt(i)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return tt(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return tn(function(e,t,i){q(e).postMessage(q(t),q(i))},arguments)},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=q(t).pointerType,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return tn(function(e,t){q(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},n.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return tt(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return q(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return q(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=q(e).devicePixelContentBoxSize;return tt(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return q(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return q(e).blockSize},n.wbg.__wbindgen_cb_drop=function(e){const t=l_(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return tt(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return tt(i)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=no(t,i)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return tn(function(e,t){const i=new Blob(q(e),q(t));return tt(i)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return tn(function(e,t){const i=URL.createObjectURL(q(t)),s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return tt(t)},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return tn(function(e,t){const i=new Worker(no(e,t));return tt(i)},arguments)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(q(e),q(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){q(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){q(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){q(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){q(e).close()},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=q(e).userAgentData;return $s(t)?0:tt(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return tt(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return tn(function(e,t){const i=q(t).userAgent,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){q(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){q(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){q(e).cancel()},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(l_(e))},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return tt(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(q(e),q(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const s=q(e).animate(q(t),q(i));return tt(s)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return tn(function(e,t){q(e).removeListener(q(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return q(e).contains(q(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){q(e).unobserve(q(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){q(e).observe(q(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){q(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){q(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return tn(function(e,t,i,s){const o=q(t).getPropertyValue(no(i,s)),r=Ac(o,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=Fa;Fi().setInt32(e+4*1,a,!0),Fi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return tn(function(e,t,i,s){const o=q(t).removeProperty(no(i,s)),r=Ac(o,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=Fa;Fi().setInt32(e+4*1,a,!0),Fi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=q(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=q(e).body;return $s(t)?0:tt(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return tn(function(e,t){const i=q(e).appendChild(q(t));return tt(i)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return tn(function(e,t){const i=q(e).getComputedStyle(q(t));return $s(i)?0:tt(i)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return $s(t)?0:tt(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return tn(function(e){const t=new ResizeObserver(q(e));return tt(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){q(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){q(e).observe(q(t),q(i))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return tn(function(e){const t=new IntersectionObserver(q(e));return tt(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){q(e).observe(q(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=q(e).getBoundingClientRect();return tt(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return q(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return q(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return tn(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return tt(t)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return tt(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return tt(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return tt(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return q(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return q(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return q(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return q(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return q(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return q(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=q(t).code,s=Ac(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=Fa;Fi().setInt32(e+4*1,o,!0),Fi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return q(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return q(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return q(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return q(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return q(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return q(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=q(e).getCoalescedEvents();return tt(t)},n.wbg.__wbindgen_closure_wrapper4150=function(e,t,i){const s=a3(e,t,1609,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper4152=function(e,t,i){const s=a3(e,t,1609,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper4153=function(e,t,i){const s=a3(e,t,1609,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper4154=function(e,t,i){const s=a3(e,t,1609,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper4155=function(e,t,i){const s=a3(e,t,1609,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper6480=function(e,t,i){const s=zw(e,t,1832,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper12109=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13276=function(e,t,i){const s=zw(e,t,1832,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper13310=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13331=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13362=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13375=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13392=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13398=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13416=function(e,t,i){const s=zw(e,t,1832,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper13420=function(e,t,i){const s=zw(e,t,1832,Bqe);return tt(s)},n}function dli(n,e){return zt=n.exports,Sct.__wbindgen_wasm_module=e,pT=null,i$=null,t$=null,zt}async function Sct(n){if(zt!==void 0)return zt;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_lsp_wasm_bg-CWnb3MgQ.wasm",import.meta.url).href,import.meta.url));const e=lli();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:i}=await cli(await n,e);return dli(t,i)}function hli(n){return new nli({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:hRe.ErrorAction.Continue}),closed:()=>({action:hRe.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(n)}})}var gU,fU;class uli{constructor(){kt(this,gU);kt(this,fU);const e=new Worker(new URL(""+new URL("lsp_worker-B8ihI9ie.js",import.meta.url).href,import.meta.url),{type:"module"});st(this,fU,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),st(this,gU,Sct())}async wait_for_lsp(){const e=se(this,fU);st(this,fU,null);const t=se(this,gU);st(this,gU,null);const[i,s]=await Promise.all([t,e]);return Promise.resolve(new fli(s))}}gU=new WeakMap,fU=new WeakMap;var pU;class gli{constructor(e){kt(this,pU);st(this,pU,e)}show_ui(){return se(this,pU).show_ui()}current_style(){return se(this,pU).current_style()}}pU=new WeakMap;var Wq,Hq,mU,tM,iM,_U,nM;class fli{constructor(e){kt(this,Wq,null);kt(this,Hq,null);kt(this,mU);kt(this,tM);kt(this,iM);kt(this,_U);kt(this,nM,null);st(this,tM,e),st(this,mU,(s,o)=>!0);const t=new Qni(new Kre.BrowserMessageReader(se(this,tM)),s=>{if(s.method==="slint/lsp_to_preview"){const r=s.params;return se(this,nM)?.process_lsp_to_preview_message(r),!0}if(s.method==="slint/load_file"){const o=s,r=o.params[0];return this.read_url(r).then(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:"",error:void 0})}),!0}if(s.method==="window/showDocument"){const o=s,r=o.params,a=r.selection?.start||{line:1,character:1},c=se(this,mU).call(this,r.uri,a);return i.write({jsonrpc:o.jsonrpc,id:o.id,result:{success:c},error:void 0}),!0}return!1}),i=new Kre.BrowserMessageWriter(se(this,tM));st(this,iM,t),st(this,_U,i)}get lsp_worker(){return se(this,tM)}get lsp_reader(){return se(this,iM)}get lsp_writer(){return se(this,_U)}set file_reader(e){st(this,Hq,e)}set show_document_callback(e){st(this,mU,e)}read_url(e){var t;try{return((t=se(this,Hq))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=se(this,Wq);if(e===null){const t=hli({reader:se(this,iM),writer:se(this,_U)});st(this,Wq,t),t.start(),se(this,iM).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(se(this,nM)===null){try{rli()}catch{}const s=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");st(this,nM,await bge.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,s==="1"))}return new gli(se(this,nM))}}Wq=new WeakMap,Hq=new WeakMap,mU=new WeakMap,tM=new WeakMap,iM=new WeakMap,_U=new WeakMap,nM=new WeakMap;const FY="canvas";var sM;const MBe=class MBe extends ot{constructor(t,i,s){super({node:MBe.createNode()});kt(this,sM,null);this.setFlag(ot.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,s).then(o=>{st(this,sM,o),se(this,sM).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(FY);r.style.width="100%",r.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=FY,i.className=FY,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return se(this,sM)?se(this,sM).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(FY);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};sM=new WeakMap;let MRe=MBe;const pli=new uli,nm=new eA;function mli(n){const e=new aw({commands:nm});e.title.label="Open Demo";for(const t of n.known_demos()){const i="slint:set_demo_"+t[1];nm.addCommand(i,{label:t[1],execute:()=>n.set_demo(t[0])}),e.addItem({command:i})}return e}function _li(){const n=new aw({commands:nm});return n.title.label="Settings",nm.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{jrt()}}),n.addItem({command:"slint:store_github_token"}),n}function vli(n,e){const t=new aw({commands:nm});return t.title.label="Project",nm.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");n.project_from_url(i)}}),nm.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),nm.addCommand("slint:add_file",{label:"Add File",iconClass:"fa-regular fa-file",mnemonic:1,execute:()=>{let i=prompt("Please enter the file name");i!=null&&(i.endsWith(".slint")||(i=i+".slint"),n.add_empty_file_to_project(i))}}),nm.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:mli(n)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:wli(n,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:_li()}),t.addItem({type:"separator"}),nm.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>NZt()}),t.addItem({command:"slint:about"}),t}function wli(n,e){const t=new aw({commands:nm});return t.title.label="Share",nm.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>n.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",n.current_editor_content),i.set("style",e.current_style());const s=new URL(window.location.toString());s.search=i.toString(),C7e(s.toString())}}),nm.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>n.open_document_urls.length>0,execute:async()=>{let i=Y1e();i||await jrt(),i=Y1e(),i?await MZt((s,o)=>{OZt(n,s,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),C7e(r,c.toString())}).catch(r=>RZt(r))}):alert("You need a github access token set up to export as a gist.")}}),t.addItem({command:"slint:create_gist"}),t.addItem({command:"slint:copy_permalink"}),t}const bli=new URLSearchParams(window.location.search),Cli=bli.get("style");function yli(n){const e=new dRe(n),t=new MRe(n,o=>e.map_url(o),Cli??""),i=new lq;i.id="menuBar",i.addMenu(vli(e,t));const s=new $4({orientation:"horizontal"});s.id="main",s.addWidget(e),s.addWidget(t),window.onresize=()=>{s.update()},document.addEventListener("keydown",o=>{nm.processKeydownEvent(o)}),ot.attach(i,document.body),ot.attach(s,document.body)}function Sli(){Vni().then(n=>{pli.wait_for_lsp().then(e=>{yli(e),document.body.getElementsByClassName("loader")[0].remove()}).catch(e=>{console.info("LSP fail:",e);const t=document.createElement("div");t.className="browser-error",t.innerHTML="

      Failed to start the slint language server

      ",document.body.getElementsByClassName("loader")[0].remove(),document.body.appendChild(t)})}).catch(n=>{console.info("Monaco fail:",n)})}window.onload=Sli;export{sh as c,FEi as g}; +Shutting down server.`,void 0,n.handled===!0?!1:"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)})):this.error(n.message??`Client ${this._name}: connection to server is erroring. +${e.message}`,void 0,n.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Wr.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=Wr.workspace.getConfiguration(this._id);let n=It.Trace.Off,o=It.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?n=It.Trace.fromString(r):(n=It.Trace.fromString(i.get("trace.server.verbosity","off")),o=It.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(r=>{this.error("Updating trace failed with error",r,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;Nv.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(It.DidChangeWatchedFilesNotification.type.method).registerRaw(r6e.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),pv.DynamicFeature.is(e)){const t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){const t=this.getFeature(It.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof a6e.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new c6e.ConfigurationFeature(this)),this.registerFeature(new kP.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new kP.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new kP.WillSaveFeature(this)),this.registerFeature(new kP.WillSaveWaitUntilFeature(this)),this.registerFeature(new kP.DidSaveTextDocumentFeature(this)),this.registerFeature(new kP.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Qai.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Pai.CompletionItemFeature(this)),this.registerFeature(new Fai.HoverFeature(this)),this.registerFeature(new Bai.SignatureHelpFeature(this)),this.registerFeature(new Oai.DefinitionFeature(this)),this.registerFeature(new Vai.ReferencesFeature(this)),this.registerFeature(new Wai.DocumentHighlightFeature(this)),this.registerFeature(new Hai.DocumentSymbolFeature(this)),this.registerFeature(new Uai.WorkspaceSymbolFeature(this)),this.registerFeature(new zai.CodeActionFeature(this)),this.registerFeature(new $ai.CodeLensFeature(this)),this.registerFeature(new Vge.DocumentFormattingFeature(this)),this.registerFeature(new Vge.DocumentRangeFormattingFeature(this)),this.registerFeature(new Vge.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Gai.RenameFeature(this)),this.registerFeature(new Kai.DocumentLinkFeature(this)),this.registerFeature(new qai.ExecuteCommandFeature(this)),this.registerFeature(new c6e.SyncConfigurationFeature(this)),this.registerFeature(new Jai.TypeDefinitionFeature(this)),this.registerFeature(new Yai.ImplementationFeature(this)),this.registerFeature(new jai.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Xai.WorkspaceFoldersFeature(this)),this.registerFeature(new Zai.FoldingRangeFeature(this)),this.registerFeature(new eci.DeclarationFeature(this)),this.registerFeature(new tci.SelectionRangeFeature(this)),this.registerFeature(new ici.ProgressFeature(this)),this.registerFeature(new nci.CallHierarchyFeature(this)),this.registerFeature(new sci.SemanticTokensFeature(this)),this.registerFeature(new oci.LinkedEditingFeature(this)),this.registerFeature(new IP.DidCreateFilesFeature(this)),this.registerFeature(new IP.DidRenameFilesFeature(this)),this.registerFeature(new IP.DidDeleteFilesFeature(this)),this.registerFeature(new IP.WillCreateFilesFeature(this)),this.registerFeature(new IP.WillRenameFilesFeature(this)),this.registerFeature(new IP.WillDeleteFilesFeature(this)),this.registerFeature(new rci.TypeHierarchyFeature(this)),this.registerFeature(new aci.InlineValueFeature(this)),this.registerFeature(new cci.InlayHintsFeature(this)),this.registerFeature(new Nai.DiagnosticFeature(this)),this.registerFeature(new a6e.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(L1e.createAll(this))}fillInitializeParams(e){for(let t of this._features)Nv.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,pv.ensure)(e,"workspace").applyEdit=!0;const t=(0,pv.ensure)((0,pv.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[It.ResourceOperationKind.Create,It.ResourceOperationKind.Rename,It.ResourceOperationKind.Delete],t.failureHandling=It.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,pv.ensure)((0,pv.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[It.DiagnosticTag.Unnecessary,It.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const n=(0,pv.ensure)(e,"window"),o=(0,pv.ensure)(n,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,pv.ensure)(n,"showDocument");r.support=!0;const a=(0,pv.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(aL.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let c of this._features)c.fillClientCapabilities(e);return e}initializeFeatures(e){const t=this._clientOptions.documentSelector;for(const i of this._features)Nv.func(i.preInitialize)&&i.preInitialize(this._capabilities,t);for(const i of this._features)i.initialize(this._capabilities,t)}async handleRegistrationRequest(e){const t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,i=>this.doRegisterCapability(i)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(const t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(const t of e.registrations){const i=this._dynamicFeatures.get(t.method);if(i===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));const n=t.registerOptions??{};n.documentSelector=n.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:n};try{i.register(o)}catch(r){return Promise.reject(r)}}}async handleUnregistrationRequest(e){const t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,i=>this.doUnregisterCapability(i)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(const t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;const i=this._dynamicFeatures.get(t.method);if(!i)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));i.unregister(t.id)}}async handleApplyWorkspaceEdit(e){const t=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),n=new Map;Wr.workspace.textDocuments.forEach(r=>n.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(It.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=n.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):Nv.asPromise(Wr.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,n,o=!0){if(i instanceof It.ResponseError){if(i.code===It.ErrorCodes.PendingResponseRejected||i.code===It.ErrorCodes.ConnectionInactive)return n;if(i.code===It.LSPErrorCodes.RequestCancelled||i.code===It.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return n;throw i.data!==void 0?new pv.LSPCancellationError(i.data):new Wr.CancellationError}else if(i.code===It.LSPErrorCodes.ContentModified){if(aL.RequestsToCancelOnContentModified.has(e.method)||aL.CancellableResolveCalls.has(e.method))throw new Wr.CancellationError;return n}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Jot=vh.BaseLanguageClient=aL;aL.RequestsToCancelOnContentModified=new Set([It.SemanticTokensRequest.method,It.SemanticTokensRangeRequest.method,It.SemanticTokensDeltaRequest.method]);aL.CancellableResolveCalls=new Set([It.CompletionResolveRequest.method,It.CodeLensResolveRequest.method,It.CodeActionResolveRequest.method,It.InlayHintResolveRequest.method,It.DocumentLinkResolveRequest.method,It.WorkspaceSymbolResolveRequest.method]);class hci{error(e){(0,It.RAL)().console.error(e)}warn(e){(0,It.RAL)().console.warn(e)}info(e){(0,It.RAL)().console.info(e)}log(e){(0,It.RAL)().console.log(e)}}function uci(s,e,t,i,n){const o=new hci,r=(0,It.createProtocolConnection)(s,e,o,n);return r.onError(c=>{t(c[0],c[1],c[2])}),r.onClose(i),{listen:()=>r.listen(),sendRequest:r.sendRequest,onRequest:r.onRequest,hasPendingResponse:r.hasPendingResponse,sendNotification:r.sendNotification,onNotification:r.onNotification,onProgress:r.onProgress,sendProgress:r.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:It.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(Nv.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(It.InitializeRequest.type,c),shutdown:()=>r.sendRequest(It.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(It.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var L1e;(function(s){function e(t){return[new lci.InlineCompletionItemFeature(t)]}s.createAll=e})(L1e||(vh.ProposedFeatures=L1e={}));(function(s){var e=rd&&rd.__createBinding||(Object.create?function(n,o,r,a){a===void 0&&(a=r);var c=Object.getOwnPropertyDescriptor(o,r);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(n,a,c)}:function(n,o,r,a){a===void 0&&(a=r),n[a]=o[r]}),t=rd&&rd.__exportStar||function(n,o){for(var r in n)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,n,r)};Object.defineProperty(s,"__esModule",{value:!0}),s.DiagnosticPullMode=s.vsdiag=void 0,t(ps,s),t(Mn,s);var i=bA;Object.defineProperty(s,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(s,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(vh,s)})(u0e);var Tne=ps;(function(s){var e=rd&&rd.__createBinding||(Object.create?function(r,a,c,l){l===void 0&&(l=c);var d=Object.getOwnPropertyDescriptor(a,c);(!d||("get"in d?!a.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(r,l,d)}:function(r,a,c,l){l===void 0&&(l=c),r[l]=a[c]}),t=rd&&rd.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(s,"__esModule",{value:!0}),s.LanguageClient=void 0;const i=u0e,n=Tne;t(Tne,s),t(u0e,s);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new n.BrowserMessageReader(this.worker),l=new n.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}s.LanguageClient=o})(h0e);class gci extends Jot{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:n}){super(e??t.toLowerCase(),t,i),this.connectionProvider=n}createMessageTransports(e){return this.connectionProvider.get(e)}}let Vt;const bS=new Array(128).fill(void 0);bS.push(void 0,null,!0,!1);function q(s){return bS[s]}let Rz=bS.length;function fci(s){s<132||(bS[s]=Rz,Rz=s)}function qp(s){const e=q(s);return fci(s),e}let da=0,KV=null;function mj(){return(KV===null||KV.byteLength===0)&&(KV=new Uint8Array(Vt.memory.buffer)),KV}const _j=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},pci=typeof _j.encodeInto=="function"?function(s,e){return _j.encodeInto(s,e)}:function(s,e){const t=_j.encode(s);return e.set(t),{read:s.length,written:t.length}};function Va(s,e,t){if(t===void 0){const a=_j.encode(s),c=e(a.length,1)>>>0;return mj().subarray(c,c+a.length).set(a),da=a.length,c}let i=s.length,n=e(i,1)>>>0;const o=mj();let r=0;for(;r127)break;o[n+r]=a}if(r!==i){r!==0&&(s=s.slice(r)),n=t(n,i,i=r+s.length*3,1)>>>0;const a=mj().subarray(n+r,n+i),c=pci(s,a);r+=c.written,n=t(n,i,r,1)>>>0}return da=r,n}function Ts(s){return s==null}let M0=null;function Ti(){return(M0===null||M0.buffer.detached===!0||M0.buffer.detached===void 0&&M0.buffer!==Vt.memory.buffer)&&(M0=new DataView(Vt.memory.buffer)),M0}function Je(s){Rz===bS.length&&bS.push(bS.length+1);const e=Rz;return Rz=bS[e],bS[e]=s,e}const Xot=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Xot.decode();function Ks(s,e){return s=s>>>0,Xot.decode(mj().subarray(s,s+e))}function R1e(s){const e=typeof s;if(e=="number"||e=="boolean"||s==null)return`${s}`;if(e=="string")return`"${s}"`;if(e=="symbol"){const n=s.description;return n==null?"Symbol":`Symbol(${n})`}if(e=="function"){const n=s.name;return typeof n=="string"&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(s)){const n=s.length;let o="[";n>0&&(o+=R1e(s[0]));for(let r=1;r1)i=t[1];else return toString.call(s);if(i=="Object")try{return"Object("+JSON.stringify(s)+")"}catch{return"Object"}return s instanceof Error?`${s.name}: ${s.message} +${s.stack}`:i}const Lne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{Vt.__wbindgen_export_2.get(s.dtor)(s.a,s.b)});function Y4(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;try{return i(n.a,n.b,...r)}finally{--n.cnt===0&&(Vt.__wbindgen_export_2.get(n.dtor)(n.a,n.b),n.a=0,Lne.unregister(n))}};return o.original=n,Lne.register(o,n,n),o}function J4(s,e,t){Vt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h297e12c63bfef335(s,e,Je(t))}function mv(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;const a=n.a;n.a=0;try{return i(a,n.b,...r)}finally{--n.cnt===0?(Vt.__wbindgen_export_2.get(n.dtor)(a,n.b),Lne.unregister(n)):n.a=a}};return o.original=n,Lne.register(o,n,n),o}function h6e(s,e){Vt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19f0e74ec492e39e(s,e)}function vE(s,e,t){Vt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00c9413f2fcf954e(s,e,Je(t))}function u6e(s,e,t,i){Vt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfb9fc20940472abc(s,e,Je(t),Je(i))}function Xi(s,e){try{return s.apply(this,e)}catch(t){Vt.__wbindgen_exn_store(Je(t))}}function mci(){try{const t=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.run_event_loop(t);var s=Ti().getInt32(t+4*0,!0),e=Ti().getInt32(t+4*1,!0);if(e)throw qp(s)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}let qV=null;function _ci(){return(qV===null||qV.byteLength===0)&&(qV=new Float32Array(Vt.memory.buffer)),qV}function oq(s,e){return s=s>>>0,_ci().subarray(s/4,s/4+e)}const g6e=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>Vt.__wbg_previewconnector_free(s>>>0,1));class hde{static __wrap(e){e=e>>>0;const t=Object.create(hde.prototype);return t.__wbg_ptr=e,g6e.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,g6e.unregister(this),e}free(){const e=this.__destroy_into_raw();Vt.__wbg_previewconnector_free(e,0)}static create(e,t,i,n){try{const c=Vt.__wbindgen_add_to_stack_pointer(-16),l=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),d=da;Vt.previewconnector_create(c,Je(e),Je(t),l,d,n);var o=Ti().getInt32(c+4*0,!0),r=Ti().getInt32(c+4*1,!0),a=Ti().getInt32(c+4*2,!0);if(a)throw qp(r);return qp(o)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=Vt.previewconnector_current_style(this.__wbg_ptr);return qp(e)}show_ui(){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_show_ui(n,this.__wbg_ptr);var e=Ti().getInt32(n+4*0,!0),t=Ti().getInt32(n+4*1,!0),i=Ti().getInt32(n+4*2,!0);if(i)throw qp(t);return qp(e)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_process_lsp_to_preview_message(n,this.__wbg_ptr,Je(e));var t=Ti().getInt32(n+4*0,!0),i=Ti().getInt32(n+4*1,!0);if(i)throw qp(t)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(s=>Vt.__wbg_slintserver_free(s>>>0,1));async function vci(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(i){if(s.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function bci(){const s={};return s.wbg={},s.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Je(e)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,n;try{i=e,n=t,console.error(Ks(e,t))}finally{Vt.__wbindgen_free(i,n,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){qp(e)},s.wbg.__wbg_width_ac5901de11cd9abc=function(e){return q(e).width},s.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return q(e).height},s.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){q(e).attachShader(q(t),q(i))},s.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){q(e).attachShader(q(t),q(i))},s.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,n,o){q(e).bindAttribLocation(q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,n,o){q(e).bindAttribLocation(q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){q(e).linkProgram(q(t))},s.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){q(e).linkProgram(q(t))},s.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbindgen_boolean_get=function(e){const t=q(e);return typeof t=="boolean"?t?1:0:2},s.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){q(e).detachShader(q(t),q(i))},s.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){q(e).detachShader(q(t),q(i))},s.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,n){q(e).shaderSource(q(t),Ks(i,n))},s.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,n){q(e).shaderSource(q(t),Ks(i,n))},s.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){q(e).compileShader(q(t))},s.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){q(e).compileShader(q(t))},s.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,n){q(e).uniform2fv(q(t),oq(i,n))},s.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,n){q(e).uniform2fv(q(t),oq(i,n))},s.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){q(e).deleteFramebuffer(q(t))},s.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){q(e).deleteFramebuffer(q(t))},s.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){q(e).deleteRenderbuffer(q(t))},s.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){q(e).deleteRenderbuffer(q(t))},s.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return Je(e)},s.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){q(e).stencil=t!==0},s.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){q(e).antialias=t!==0},s.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return Xi(function(e,t,i,n){const o=q(e).getContext(Ks(t,i),q(n));return Ts(o)?0:Je(o)},arguments)},s.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},s.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=q(e).getSupportedExtensions();return Ts(t)?0:Je(t)},s.wbg.__wbg_length_ae22078168b726f5=function(e){return q(e).length},s.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=q(e)[t>>>0];return Je(i)},s.wbg.__wbindgen_string_get=function(e,t){const i=q(t),n=typeof i=="string"?i:void 0;var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getParameter_cfaed180705b9280=function(){return Xi(function(e,t){const i=q(e).getParameter(t>>>0);return Je(i)},arguments)},s.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return Ts(t)?0:Je(t)},s.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return q(e).getError()},s.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return q(e).getError()},s.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,n,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(o),r)},s.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,n,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(o),r)},s.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,n,o){q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,n,o){q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,n,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(o))},s.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,n,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(o))},s.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,n,o){q(e).scissor(t,i,n,o)},s.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,n,o){q(e).scissor(t,i,n,o)},s.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,n,o){q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,n,o){q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){q(e).clear(t>>>0)},s.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){q(e).clear(t>>>0)},s.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,n){q(e).uniform4fv(q(t),oq(i,n))},s.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,n){q(e).uniform4fv(q(t),oq(i,n))},s.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){q(e).deleteTexture(q(t))},s.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){q(e).deleteTexture(q(t))},s.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){q(e).deleteShader(q(t))},s.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){q(e).deleteShader(q(t))},s.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){q(e).deleteProgram(q(t))},s.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){q(e).deleteProgram(q(t))},s.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){q(e).useProgram(q(t))},s.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){q(e).useProgram(q(t))},s.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},s.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},s.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},s.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},s.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},s.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},s.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){q(e).bindVertexArray(q(t))},s.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){q(e).bindVertexArrayOES(q(t))},s.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){q(e).disable(t>>>0)},s.wbg.__wbg_disable_8908871f2334e76b=function(e,t){q(e).disable(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,n){q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,n){q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){q(e).enable(t>>>0)},s.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){q(e).enable(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,n){const o=q(e).getUniformLocation(q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,n){const o=q(e).getUniformLocation(q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){q(e).generateMipmap(t>>>0)},s.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){q(e).generateMipmap(t>>>0)},s.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){q(e).uniform1i(q(t),i)},s.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){q(e).uniform1i(q(t),i)},s.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,n,o){q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,n,o){q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},s.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},s.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){q(e).activeTexture(t>>>0)},s.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){q(e).activeTexture(t>>>0)},s.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,n){q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,n){q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,d)},arguments)},s.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,n,o,r,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,n,o,r,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,n,o){q(e).viewport(t,i,n,o)},s.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,n,o){q(e).viewport(t,i,n,o)},s.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,n){q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,n){q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,n){q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,n){q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,n,o){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,n,o){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return q(e).devicePixelRatio},s.wbg.__wbg_document_8554450897a855b9=function(e){const t=q(e).document;return Ts(t)?0:Je(t)},s.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const n=q(e).getElementById(Ks(t,i));return Ts(n)?0:Je(n)},s.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},s.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){q(e).width=t>>>0},s.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){q(e).height=t>>>0},s.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return q(e).clientWidth},s.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return q(e).clientHeight},s.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=q(e).dataset;return Je(t)},s.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,n){const o=q(t)[Ks(i,n)];var r=Ts(o)?0:Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},s.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=q(e)instanceof HTMLInputElement}catch{t=!1}return t},s.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=q(e).style;return Je(t)},s.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return q(e).offsetLeft},s.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return q(e).offsetTop},s.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return q(e).offsetWidth},s.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return q(e).offsetHeight},s.wbg.__wbg_before_ac3792b457802cbf=function(){return Xi(function(e,t){q(e).before(q(t))},arguments)},s.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return Je(t)},s.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=Ks(t,i)},s.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return q(e).isComposing},s.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=q(t).inputType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){q(e).preventDefault()},s.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return q(e).isComposing},s.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=q(t).key,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return q(e).shiftKey},s.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return q(e).ctrlKey},s.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return q(e).altKey},s.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return q(e).getModifierState(Ks(t,i))},s.wbg.__wbg_repeat_8451a79b3608855b=function(e){return q(e).repeat},s.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=q(e).clipboardData;return Ts(t)?0:Je(t)},s.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return Xi(function(e,t,i,n){const o=q(t).getData(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},s.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){q(e).font=Ks(t,i)},s.wbg.__wbindgen_string_new=function(e,t){const i=Ks(e,t);return Je(i)},s.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){q(e).fillStyle=q(t)},s.wbg.__wbg_id_8071f78aa2301217=function(e,t){const i=q(t).id,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return q(e).naturalWidth},s.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return q(e).naturalHeight},s.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=q(t).currentSrc,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_0d5e77f348d88b87=function(){return Xi(function(){const e=new Image;return Je(e)},arguments)},s.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:Ks(t,i)},s.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){q(e).onload=q(t)},s.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){q(e).src=Ks(t,i)},s.wbg.__wbg_new0_65387337a95cf44d=function(){return Je(new Date)},s.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},s.wbg.__wbindgen_number_new=function(e){return Je(e)},s.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return Je(t)},s.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},s.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(Ks(e,t))},s.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){q(e).cullFace(t>>>0)},s.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){q(e).cullFace(t>>>0)},s.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){q(e).frontFace(t>>>0)},s.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){q(e).frontFace(t>>>0)},s.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,n){q(e).bufferData(t>>>0,q(i),n>>>0)},s.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,n){q(e).bufferData(t>>>0,q(i),n>>>0)},s.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,n,o){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,n,o){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).readPixels(t,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).readPixels(t,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){q(e).deleteVertexArray(q(t))},s.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){q(e).deleteVertexArrayOES(q(t))},s.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){q(e).deleteBuffer(q(t))},s.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){q(e).deleteBuffer(q(t))},s.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){q(e).width=t>>>0},s.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){q(e).height=t>>>0},s.wbg.__wbg_next_f9cb570345655b9a=function(){return Xi(function(e){const t=q(e).next();return Je(t)},arguments)},s.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return q(e).done},s.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=q(e).value;return Je(t)},s.wbg.__wbg_iterator_888179a48810a9fe=function(){return Je(Symbol.iterator)},s.wbg.__wbg_get_224d16597dbbfd96=function(){return Xi(function(e,t){const i=Reflect.get(q(e),q(t));return Je(i)},arguments)},s.wbg.__wbindgen_is_function=function(e){return typeof q(e)=="function"},s.wbg.__wbindgen_is_object=function(e){const t=q(e);return typeof t=="object"&&t!==null},s.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=q(e).next;return Je(t)},s.wbg.__wbg_call_1084a111329e68ce=function(){return Xi(function(e,t){const i=q(e).call(q(t));return Je(i)},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return Xi(function(e,t,i){const n=q(e).call(q(t),q(i));return Je(n)},arguments)},s.wbg.__wbg_call_c6fe275aaa60da79=function(){return Xi(function(e,t,i,n){const o=q(e).call(q(t),q(i),q(n));return Je(o)},arguments)},s.wbg.__wbindgen_memory=function(){const e=Vt.memory;return Je(e)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return Je(t)},s.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const n=new Uint8Array(q(e),t>>>0,i>>>0);return Je(n)},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return q(e).length},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(q(e));return Je(t)},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return Xi(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return Xi(function(){const e=self.self;return Je(e)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return Xi(function(){const e=window.window;return Je(e)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return Xi(function(){const e=globalThis.globalThis;return Je(e)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return Xi(function(){const e=global.global;return Je(e)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return q(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(Ks(e,t));return Je(i)},s.wbg.__wbindgen_error_new=function(e,t){const i=new Error(Ks(e,t));return Je(i)},s.wbg.__wbindgen_jsval_loose_eq=function(e,t){return q(e)==q(t)},s.wbg.__wbindgen_number_get=function(e,t){const i=q(t),n=typeof i=="number"?i:void 0;Ti().setFloat64(e+8*1,Ts(n)?0:n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=q(e)instanceof Uint8Array}catch{t=!1}return t},s.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=q(e)instanceof ArrayBuffer}catch{t=!1}return t},s.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(q(e));return Je(t)},s.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(q(e))},s.wbg.__wbindgen_as_number=function(e){return+q(e)},s.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbindgen_bigint_from_i64=function(e){return Je(e)},s.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Je(t)},s.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},s.wbg.__wbg_new_8608a2b51a5f6737=function(){return Je(new Map)},s.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[qp(t)]=qp(i)},s.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return Je(e)},s.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=qp(i)},s.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const n=q(e).set(q(t),q(i));return Je(n)},s.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},s.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return Je(i)},s.wbg.__wbindgen_in=function(e,t){return q(e)in q(t)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},n=(r,a)=>{const c=i.a;i.a=0;try{return u6e(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(n);return Je(o)}finally{i.a=i.b=0}},s.wbg.__wbg_previewconnector_new=function(e){const t=hde.__wrap(e);return Je(t)},s.wbg.__wbindgen_is_bigint=function(e){return typeof q(e)=="bigint"},s.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=q(t),n=typeof i=="bigint"?i:void 0;Ti().setBigInt64(e+8*1,Ts(n)?BigInt(0):n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbindgen_jsval_eq=function(e,t){return q(e)===q(t)},s.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=q(e)instanceof Map}catch{t=!1}return t},s.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return Je(t)},s.wbg.__wbg_platform_509d898d9dce4c23=function(){return Xi(function(e,t){const i=q(t).platform,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(Ks(e,t))},s.wbg.__wbindgen_debug_string=function(e,t){const i=R1e(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return Je(t)},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return Je(t)},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const n=q(e).then(q(t),q(i));return Je(n)},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return Je(i)},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},s.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return Xi(function(e,t,i){const n=q(e).getExtension(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return Xi(function(e,t,i){const n=q(e).matchMedia(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return Xi(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},s.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return Xi(function(e,t){return q(e).setTimeout(q(t))},arguments)},s.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return Xi(function(e,t,i){const n=q(e).createElement(Ks(t,i));return Je(n)},arguments)},s.wbg.__wbg_matches_212d57a200ff58f8=function(){return Xi(function(e,t,i){return q(e).matches(Ks(t,i))},arguments)},s.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return Xi(function(e,t,i,n,o){q(e).setAttribute(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_focus_06621101cc79f5d8=function(){return Xi(function(e){q(e).focus()},arguments)},s.wbg.__wbg_fillText_ae0445d1930428dd=function(){return Xi(function(e,t,i,n,o){q(e).fillText(Ks(t,i),n,o)},arguments)},s.wbg.__wbg_getContext_69ec873410cbba3c=function(){return Xi(function(e,t,i){const n=q(e).getContext(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return Xi(function(e,t){q(e).addListener(q(t))},arguments)},s.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return Xi(function(e,t,i,n,o){q(e).setProperty(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return Xi(function(e,t){URL.revokeObjectURL(Ks(e,t))},arguments)},s.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=q(e)instanceof Window}catch{t=!1}return t},s.wbg.__wbg_setData_41207994e2d54785=function(){return Xi(function(e,t,i,n,o){q(e).setData(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return Xi(function(e,t,i,n){q(e).addEventListener(Ks(t,i),q(n))},arguments)},s.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return Xi(function(e,t,i,n){q(e).removeEventListener(Ks(t,i),q(n))},arguments)},s.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return Xi(function(e,t){q(e).postMessage(q(t))},arguments)},s.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_ebf2727385ee825c=function(){return Xi(function(){const e=new AbortController;return Je(e)},arguments)},s.wbg.__wbg_new_40ff2b042829bc58=function(){return Xi(function(){const e=new MessageChannel;return Je(e)},arguments)},s.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return Je(t)},s.wbg.__wbg_now_abd80e969af37148=function(e){return q(e).now()},s.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return q(e).movementX},s.wbg.__wbg_movementY_3064817f736e8151=function(e){return q(e).movementY},s.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=q(e).scheduler;return Je(t)},s.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return Je(t)},s.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const n=q(e).postTask(q(t),q(i));return Je(n)},s.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return Je(i)},s.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return Je(t)},s.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){q(e).onmessage=q(t)},s.wbg.__wbg_start_f642a950f6c98a0e=function(e){q(e).start()},s.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=q(e).port2;return Je(t)},s.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return Xi(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},s.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return Xi(function(e,t,i){return q(e).setTimeout(q(t),i)},arguments)},s.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(q(e),q(t));return Je(i)},s.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return Je(t)},s.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return Xi(function(e,t,i){q(e).postMessage(q(t),q(i))},arguments)},s.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=q(t).pointerType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},s.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return Xi(function(e,t){q(e).setPointerCapture(t)},arguments)},s.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},s.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},s.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},s.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},s.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},s.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return Je(t)},s.wbg.__wbg_width_e7964a50b174d035=function(e){return q(e).width},s.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return q(e).height},s.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=q(e).devicePixelContentBoxSize;return Je(t)},s.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return q(e).inlineSize},s.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return q(e).blockSize},s.wbg.__wbindgen_cb_drop=function(e){const t=qp(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return Je(e)},s.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return Je(i)},s.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=Ks(t,i)},s.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return Xi(function(e,t){const i=new Blob(q(e),q(t));return Je(i)},arguments)},s.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return Xi(function(e,t){const i=URL.createObjectURL(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return Je(t)},s.wbg.__wbg_new_25d9d4e2932d816f=function(){return Xi(function(e,t){const i=new Worker(Ks(e,t));return Je(i)},arguments)},s.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(q(e),q(t))},s.wbg.__wbg_abort_8659d889a7877ae3=function(e){q(e).abort()},s.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){q(e).cancelIdleCallback(t>>>0)},s.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){q(e).clearTimeout(t)},s.wbg.__wbg_close_87d69f9e9fe928c3=function(e){q(e).close()},s.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=q(e).userAgentData;return Ts(t)?0:Je(t)},s.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return Je(t)},s.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return Xi(function(e,t){const i=q(t).userAgent,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){q(e).disconnect()},s.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){q(e).disconnect()},s.wbg.__wbg_cancel_cba86749f45f30ae=function(e){q(e).cancel()},s.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(qp(e))},s.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},s.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return Je(t)},s.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(q(e),q(t))},s.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const n=q(e).animate(q(t),q(i));return Je(n)},s.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},s.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return Xi(function(e,t){q(e).removeListener(q(t))},arguments)},s.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return q(e).contains(q(t))},s.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){q(e).unobserve(q(t))},s.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){q(e).observe(q(t))},s.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){q(e).webkitExitFullscreen()},s.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){q(e).exitFullscreen()},s.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return Xi(function(e,t,i,n){const o=q(t).getPropertyValue(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return Xi(function(e,t,i,n){const o=q(t).removeProperty(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=q(e).visibilityState;return{hidden:0,visible:1}[t]??2},s.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=q(e).body;return Ts(t)?0:Je(t)},s.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return Xi(function(e,t){const i=q(e).appendChild(q(t));return Je(i)},arguments)},s.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return Xi(function(e,t){const i=q(e).getComputedStyle(q(t));return Ts(i)?0:Je(i)},arguments)},s.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_new_42acb42ec2ace97c=function(){return Xi(function(e){const t=new ResizeObserver(q(e));return Je(t)},arguments)},s.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){q(e).box=["border-box","content-box","device-pixel-content-box"][t]},s.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){q(e).observe(q(t),q(i))},s.wbg.__wbg_new_d0c6c2df51a6d903=function(){return Xi(function(e){const t=new IntersectionObserver(q(e));return Je(t)},arguments)},s.wbg.__wbg_observe_c901133fbef21560=function(e,t){q(e).observe(q(t))},s.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=q(e).getBoundingClientRect();return Je(t)},s.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return q(e).x},s.wbg.__wbg_y_bd4e2c0613413655=function(e){return q(e).y},s.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return Xi(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},s.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return Je(t)},s.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return Je(t)},s.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return Je(t)},s.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return Je(t)},s.wbg.__wbg_button_460cdec9f2512a91=function(e){return q(e).button},s.wbg.__wbg_offsetX_294898d040917c6b=function(e){return q(e).offsetX},s.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return q(e).offsetY},s.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return q(e).deltaX},s.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return q(e).deltaY},s.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return q(e).deltaMode},s.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=q(t).code,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return q(e).location},s.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return q(e).metaKey},s.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return q(e).shiftKey},s.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return q(e).ctrlKey},s.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return q(e).altKey},s.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return q(e).metaKey},s.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=q(e).getCoalescedEvents();return Je(t)},s.wbg.__wbindgen_closure_wrapper4159=function(e,t,i){const n=Y4(e,t,1609,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4161=function(e,t,i){const n=Y4(e,t,1609,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4162=function(e,t,i){const n=Y4(e,t,1609,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4163=function(e,t,i){const n=Y4(e,t,1609,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4164=function(e,t,i){const n=Y4(e,t,1609,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper6455=function(e,t,i){const n=mv(e,t,1827,h6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper12147=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13314=function(e,t,i){const n=mv(e,t,1827,h6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper13348=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13369=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13400=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13413=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13430=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13436=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13454=function(e,t,i){const n=mv(e,t,1827,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13458=function(e,t,i){const n=mv(e,t,1827,u6e);return Je(n)},s}function wci(s,e){return Vt=s.exports,Zot.__wbindgen_wasm_module=e,M0=null,qV=null,KV=null,Vt}async function Zot(s){if(Vt!==void 0)return Vt;typeof s<"u"&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof s>"u"&&(s=new URL(""+new URL("slint_lsp_wasm_bg-DJJWxp_L.wasm",import.meta.url).href,import.meta.url));const e=bci();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:i}=await vci(await s,e);return wci(t,i)}function yci(s){return new gci({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:h0e.ErrorAction.Continue}),closed:()=>({action:h0e.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(s)}})}var f2,p2;class Cci{constructor(){Wt(this,f2);Wt(this,p2);const e=new Worker(new URL(""+new URL("lsp_worker-DlVKdA8Y.js",import.meta.url).href,import.meta.url),{type:"module"});Ct(this,p2,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),Ct(this,f2,Zot({}))}async wait_for_lsp(){const e=Ce(this,p2);Ct(this,p2,null);const t=Ce(this,f2);Ct(this,f2,null);const[i,n]=await Promise.all([t,e]);return Promise.resolve(new Aci(n))}}f2=new WeakMap,p2=new WeakMap;var m2;class Sci{constructor(e){Wt(this,m2);Ct(this,m2,e)}show_ui(){return Ce(this,m2).show_ui()}current_style(){return Ce(this,m2).current_style()}}m2=new WeakMap;var R7,M7,lT,dT,_2,hT;class Aci{constructor(e){Wt(this,R7,null);Wt(this,M7,null);Wt(this,lT);Wt(this,dT);Wt(this,_2);Wt(this,hT,null);Ct(this,lT,e);const t=new Zii(new Tne.BrowserMessageReader(Ce(this,lT)),n=>{if(n.method==="slint/lsp_to_preview"){const r=n.params;return Ce(this,hT)?.process_lsp_to_preview_message(r),!0}if(n.method==="slint/load_file"){const o=n,r=o.params[0];return this.read_url(r).then(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:"",error:void 0})}),!0}return!1}),i=new Tne.BrowserMessageWriter(Ce(this,lT));Ct(this,dT,t),Ct(this,_2,i)}get lsp_worker(){return Ce(this,lT)}get lsp_reader(){return Ce(this,dT)}get lsp_writer(){return Ce(this,_2)}set file_reader(e){Ct(this,M7,e)}read_url(e){var t;try{return((t=Ce(this,M7))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=Ce(this,R7);if(e===null){const t=yci({reader:Ce(this,dT),writer:Ce(this,_2)});Ct(this,R7,t),t.start(),Ce(this,dT).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(Ce(this,hT)===null){try{mci()}catch{}const n=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");Ct(this,hT,await hde.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,n==="1"))}return new Sci(Ce(this,hT))}}R7=new WeakMap,M7=new WeakMap,lT=new WeakMap,dT=new WeakMap,_2=new WeakMap,hT=new WeakMap;const rq="canvas";var uT;const gFe=class gFe extends nt{constructor(t,i,n){super({node:gFe.createNode()});Wt(this,uT,null);this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,n).then(o=>{Ct(this,uT,o),Ce(this,uT).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(rq);r.style.width="100%",r.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=rq,i.className=rq,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return Ce(this,uT)?Ce(this,uT).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(rq);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};uT=new WeakMap;let M1e=gFe;const Eci=new Cci,jf=new lC;function xci(s){const e=new W_({commands:jf});e.title.label="Open Demo";for(const t of s.known_demos()){const i="slint:set_demo_"+t[1];jf.addCommand(i,{label:t[1],execute:()=>s.set_demo(t[0])}),e.addItem({command:i})}return e}function Dci(){const s=new W_({commands:jf});return s.title.label="Settings",jf.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{Ist()}}),s.addItem({command:"slint:store_github_token"}),s}function kci(s,e){const t=new W_({commands:jf});return t.title.label="Project",jf.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");s.project_from_url(i)}}),jf.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),jf.addCommand("slint:add_file",{label:"Add File",iconClass:"fa-regular fa-file",mnemonic:1,execute:()=>{let i=prompt("Please enter the file name");i!=null&&(i.endsWith(".slint")||(i=i+".slint"),s.add_empty_file_to_project(i))}}),jf.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:xci(s)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:Ici(s,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:Dci()}),t.addItem({type:"separator"}),jf.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>xXt()}),t.addItem({command:"slint:about"}),t}function Ici(s,e){const t=new W_({commands:jf});return t.title.label="Share",jf.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>s.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",s.current_editor_content),i.set("style",e.current_style());const n=new URL(window.location.toString());n.search=i.toString(),Y3e(n.toString())}}),jf.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>s.open_document_urls.length>0,execute:async()=>{let i=MDe();i||await Ist(),i=MDe(),i?await EXt((n,o)=>{IXt(s,n,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),Y3e(r,c.toString())}).catch(r=>AXt(r))}):alert("You need a github access token set up to export as a gist.")}}),t.addItem({command:"slint:create_gist"}),t.addItem({command:"slint:copy_permalink"}),t}const Tci=new URLSearchParams(window.location.search),Lci=Tci.get("style");function Rci(s){const e=new Xii(s),t=new M1e(s,o=>e.map_url(o),Lci??""),i=new Y$;i.id="menuBar",i.addMenu(kci(e,t));const n=new KH({orientation:"horizontal"});n.id="main",n.addWidget(e),n.addWidget(t),window.onresize=()=>{n.update()},document.addEventListener("keydown",o=>{jf.processKeydownEvent(o)}),nt.attach(i,document.body),nt.attach(n,document.body)}function Mci(){qii().then(s=>{Eci.wait_for_lsp().then(e=>{Rci(e),document.body.getElementsByClassName("loader")[0].remove()}).catch(e=>{console.info("LSP fail:",e);const t=document.createElement("div");t.className="browser-error",t.innerHTML="

      Failed to start the slint language server

      ",document.body.getElementsByClassName("loader")[0].remove(),document.body.appendChild(t)})}).catch(s=>{console.info("Monaco fail:",s)})}window.onload=Mci;export{rd as c,WEi as g}; diff --git a/snapshots/master/editor/assets/index-W09Wotig.css b/snapshots/master/editor/assets/index-CMBv90J-.css similarity index 93% rename from snapshots/master/editor/assets/index-W09Wotig.css rename to snapshots/master/editor/assets/index-CMBv90J-.css index 2da226ac1..194ac2174 100644 --- a/snapshots/master/editor/assets/index-W09Wotig.css +++ b/snapshots/master/editor/assets/index-CMBv90J-.css @@ -1 +1 @@ -:root{--color_baby_blue: #667cff;--color_blue: #2379f4;--color_dark: #151d21;--color_dark_20: #d0d2d3;--color_dark_40: #a1a5a6;--color_dark_80: #444a4d;--color_dark_gray: #73777a;--color_dark_blue: #250ce8;--color_deep_indigo: #1f284d;--color_focus_blue: #3573d8;--color_gray: #e8e9e9;--color_ice_blue: #0db1ff;--color_light_blue: #f2f4ff;--color_light_gray_2: #b8bbbc;--color_light_purple: #99a8ff;--color_medium_gray: #939393;--color_purple: #6b0dff;--color_white: #ffffff;--error-bg: var(--color_purple);--error-fg: var(--color_light_blue);--highlight-bg: var(--color_focus_blue);--highlight-fg: var(--color_white);--highlight2-bg: var(--color_ice_blue);--highlight2-fg: var(--color_white);--undefined-bg: var(--color_dark_20);--undefined-fg: var(--color_dark);--default-font: 12px Helvetica, Arial, sans-serif}.lm-cursor-backdrop{top:0;left:0;position:fixed;width:200px;height:200px;margin-top:-100px;margin-left:-100px;will-change:transform;z-index:100;scrollbar-width:none;-ms-overflow-style:none;overflow:scroll}.lm-cursor-backdrop:after{content:"";height:1200px;width:1200px;display:block}.lm-cursor-backdrop::-webkit-scrollbar{display:none}.lm-mod-drag-image{top:0;left:0;will-change:transform}.lm-Widget{box-sizing:border-box;position:relative}.lm-Widget.lm-mod-hidden{display:none!important}.lm-AccordionPanel[data-orientation=horizontal]>.lm-AccordionPanel-title{display:block;transform-origin:top left;transform:rotate(-90deg) translate(-100%)}.lm-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-CommandPalette-search{flex:0 0 auto}.lm-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.lm-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-CommandPalette-item{display:flex;flex-direction:row}.lm-CommandPalette-itemIcon{flex:0 0 auto}.lm-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.lm-CommandPalette-itemShortcut{flex:0 0 auto}.lm-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-close-icon{border:1px solid transparent;background-color:transparent;position:absolute;z-index:1;right:3%;top:0;bottom:0;margin:auto;padding:7px 0;display:none;vertical-align:middle;outline:0;cursor:pointer}.lm-close-icon:after{content:"X";display:block;width:15px;height:15px;text-align:center;color:#000;font-weight:400;font-size:12px;cursor:pointer}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.lm-Menu-item{display:table-row}.lm-Menu-item.lm-mod-hidden,.lm-Menu-item.lm-mod-collapsed{display:none!important}.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.lm-Menu-itemLabel{display:table-cell;text-align:left}.lm-Menu-itemShortcut{display:table-cell;text-align:right}.lm-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.lm-MenuBar-item{box-sizing:border-box}.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel{display:inline-block}.lm-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-ScrollBar[data-orientation=horizontal]{flex-direction:row}.lm-ScrollBar[data-orientation=vertical]{flex-direction:column}.lm-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.lm-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.lm-ScrollBar-thumb{box-sizing:border-box;position:absolute}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden;touch-action:none}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:0 0 auto}.lm-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{left:0;transition:left .15s ease}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{top:0;transition:top .15s ease}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box;background:inherit}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.lm-AccordionPanel .lm-AccordionPanel-title{box-sizing:border-box;padding:0 10px;background:#e5e5e5;border:1px solid #c0c0c0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;min-height:22px;max-height:22px;min-width:35px;line-height:20px;margin:0}.lm-AccordionPanel .lm-AccordionPanel-title:focus,.lm-AccordionPanel .lm-AccordionPanel-title:hover{background:#dbdbdb}.lm-AccordionPanel .lm-AccordionPanel-title:focus,.lm-AccordionPanel .lm-AccordionPanel-title:last-of-type:focus:not(.lm-mod-expanded){border:1px solid lightskyblue}.lm-AccordionPanel .lm-AccordionPanel-title:last-of-type:not(.lm-mod-expanded){border-bottom:1px solid #c0c0c0}.lm-AccordionPanel .lm-AccordionPanel-title.lm-mod-expanded .lm-AccordionPanel-titleCollapser:before{content:"";font-family:FontAwesome}.lm-AccordionPanel .lm-AccordionPanel-title .lm-AccordionPanel-titleCollapser:before{content:"";font-family:FontAwesome;position:absolute;right:10px}.lm-AccordionPanel .lm-AccordionPanel-titleLabel{padding:0 5px}.lm-CommandPalette{font-family:sans-serif;background:#f5f5f5}.lm-CommandPalette-search{padding:8px}.lm-CommandPalette-wrapper{padding:4px 6px;background:#fff;border:1px solid #e0e0e0;position:relative}.lm-CommandPalette-input{width:92%;border:none;outline:none;font-size:16px}.lm-CommandPalette-header{padding:4px;color:#757575;font-size:12px;font-weight:600;background:#e1e1e1;cursor:pointer}.lm-CommandPalette-header:hover:before{content:"…";float:right;margin-right:4px}.lm-CommandPalette-header>mark{background-color:transparent;font-weight:700}.lm-CommandPalette-item{padding:4px 8px;color:#757575;font-size:13px;font-weight:500}.lm-CommandPalette-emptyMessage{padding:4px;color:#757575;font-size:12px;font-weight:600;text-align:center}.lm-CommandPalette-item.lm-mod-disabled{color:#00000040}.lm-CommandPalette-item.lm-mod-active{background:#7fdbff}.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled){background:#e5e5e5}.lm-CommandPalette-itemIcon{display:none}.lm-CommandPalette-itemLabel>mark{background-color:transparent;font-weight:700}.lm-CommandPalette-item.lm-mod-disabled mark{color:#0006}.lm-CommandPalette-itemCaption{color:#9e9e9e;font-size:11px;font-weight:400}.lm-DataGrid{min-width:64px;min-height:64px;border:1px solid #a0a0a0}.lm-DataGrid-scrollCorner{background-color:#f0f0f0}.lm-DataGrid-scrollCorner:after{content:"";position:absolute;top:0;left:0;width:1px;height:1px;background-color:#a0a0a0}.lm-DataGrid-cellEditorOccluder{pointer-events:none;position:absolute;overflow:hidden}.lm-DataGrid-cellEditorContainer{pointer-events:auto;position:absolute;background-color:#fff;box-sizing:border-box;box-shadow:0 0 6px #006bf7;border:2px solid #006bf7}.lm-DataGrid-cellEditorContainer.lm-mod-invalid{box-shadow:0 0 6px red;border:2px solid red}.lm-DataGrid-cellEditorContainer>form{width:100%;height:100%;overflow:hidden}.lm-DataGrid-cellEditorWidget{width:100%;height:100%;outline:none;box-sizing:border-box}.lm-DataGrid-cellEditorInput{background-color:#fff;border:0}.lm-DataGrid-cellEditorCheckbox{margin:0}.lm-DataGrid-notification{position:absolute;display:flex;overflow:visible;animation:fade-in .3s ease-out}.lm-DataGrid-notificationContainer{box-shadow:0 2px 5px #999;border-radius:3px;background-color:#fff;color:#000;border:1px solid black;font-family:sans-serif;font-size:13px;padding:4px}@keyframes fade-in{0%{opacity:0}50%{opacity:.7}to{opacity:1}}.lm-DockPanel-overlay{background:#fff9;border:1px dashed black;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-Menu{padding:3px 0;background:#fff;color:#000000de;border:1px solid #c0c0c0;font:12px Helvetica,Arial,sans-serif;box-shadow:0 1px 6px #0003}.lm-Menu-item.lm-mod-active{background:#e5e5e5}.lm-Menu-item.lm-mod-disabled{color:#00000040}.lm-Menu-itemIcon{width:21px;padding:4px 2px}.lm-Menu-itemLabel{padding:4px 35px 4px 2px}.lm-Menu-itemMnemonic{text-decoration:underline}.lm-Menu-itemShortcut{padding:4px 0}.lm-Menu-itemSubmenuIcon{width:16px;padding:4px 0}.lm-Menu-item[data-type=separator]>div{padding:0;height:9px}.lm-Menu-item[data-type=separator]>div:after{content:"";display:block;position:relative;top:4px;border-top:1px solid #dddddd}.lm-Menu-itemIcon:before,.lm-Menu-itemSubmenuIcon:before{font-family:FontAwesome}.lm-Menu-item.lm-mod-toggled>.lm-Menu-itemIcon:before{content:""}.lm-Menu-item[data-type=submenu]>.lm-Menu-itemSubmenuIcon:before{content:""}.lm-MenuBar{padding-left:5px;background:#fafafa;color:#000000de;border-bottom:1px solid #dddddd;font:13px Helvetica,Arial,sans-serif}.lm-MenuBar-menu{transform:translateY(-1px)}.lm-MenuBar-item{padding:4px 8px;border-left:1px solid transparent;border-right:1px solid transparent}.lm-MenuBar-item.lm-mod-active{background:#e5e5e5}.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active{z-index:10001;background:#fff;border-left:1px solid #c0c0c0;border-right:1px solid #c0c0c0;box-shadow:0 0 6px #0003}.lm-MenuBar-item:focus-visible{outline:2px solid #333;outline-offset:-2px}.lm-MenuBar-item[aria-disabled=true]{color:#0000005e}.lm-ScrollBar[data-orientation=horizontal]{min-height:16px;max-height:16px;min-width:45px;border-top:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=vertical]{min-width:16px;max-width:16px;min-height:45px;border-left:1px solid #a0a0a0}.lm-ScrollBar-button{background-color:#f0f0f0;background-position:center center;min-height:15px;max-height:15px;min-width:15px;max-width:15px}.lm-ScrollBar-button:hover{background-color:#dadada}.lm-ScrollBar-button.lm-mod-active{background-color:#cdcdcd}.lm-ScrollBar-track{background:#f0f0f0}.lm-ScrollBar-thumb{background:#cdcdcd}.lm-ScrollBar-thumb:hover{background:#bababa}.lm-ScrollBar-thumb.lm-mod-active{background:#a0a0a0}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-thumb{height:100%;min-width:15px;border-left:1px solid #a0a0a0;border-right:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-thumb{width:100%;min-height:15px;border-top:1px solid #a0a0a0;border-bottom:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-button[data-action=decrement]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABDSURBVChTnctBCgAwCANBf+3z0+YgFExr9TAEAmsA2uRZkWdFnsHd9+Q/HYFBK4rgOzqD74hGEY0iGkU38qzI8w22AMNb74XHwmKSAAAAAElFTkSuQmCC)}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-button[data-action=increment]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABKSURBVChTlctBCsBACARBf+3zTeYg7GJnJIdCbJioqt8wbjBuMGbme2ZvGDVyQ4w9+hqOIOeIhtfT3EBGEDcQjG4gGDcYNxi9ige5y++FbjFqAAAAAABJRU5ErkJggg==)}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-button[data-action=decrement]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABHSURBVChTlctBDgAQDETR3rrHL11IlM+weBGfsYj4hlHBqGBUMCZ37we/YczBsL6lLcyD07BcaDDM/8roFUYFo4JRwXgX1gD97e+FKAUICwAAAABJRU5ErkJggg==)}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-button[data-action=increment]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABDSURBVChTlcsxCgAwCENRb+3xUzIIlUZDhzf4MQHgm4yOjI6MjoxOOzITk/uvjcgNqB1lG9ATyjQgGR0ZHRkdGXeIA38574WaLSX0AAAAAElFTkSuQmCC)}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{min-width:0;min-height:0;align-items:flex-end;border-bottom:1px solid #c0c0c0}.lm-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid #c0c0c0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.lm-TabBar-tabLabel .lm-TabBar-tabInput{padding:0;border:0px;font:12px Helvetica,Arial,sans-serif}.lm-TabBar-tab.lm-mod-current{background:#fff}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tab.lm-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar .lm-TabBar-addButton{padding:0 6px;border-bottom:1px solid #c0c0c0}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon:before{content:"";font-family:FontAwesome}.lm-TabBar .lm-TabBar-addButton:before{content:"";font-family:FontAwesome}.lm-TabBar-tab.lm-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px #0000004d}.content{min-width:50px;min-height:50px;display:flex;flex-direction:column;padding:8px;border:1px solid var(--color_dark_40);border-top:none;background:#fff;box-shadow:1px 1px 2px #0003;font:var(--default-font)}.content>div{flex:1 1 auto;border:1px solid var(--color_dark_80);overflow:auto}.content input{margin:8px}.editor .container{display:flex;flex-direction:column;align-items:stretch}.editor .container .edit-area{flex-shrink:1000;flex-grow:1000}.outline ul{padding-left:1em;list-style-type:none}.outline .outline-tree{margin:4px}.outline .outline-tree{padding-left:4px}.outline .outline-element{margin:0;padding:2px;width:100%;display:block}.outline .outline-element>span{display:block;-webkit-user-select:none;user-select:none}.outline .kind-class.outline-element span:before{font-family:FontAwesome;content:"";padding:2px}.outline .kind-struct.outline-element span:before{font-family:FontAwesome;content:"";padding:2px}.outline .outline-element .active{background:var(--highlight-bg);color:var(--highlight-fg)}.preview-container{padding:0}.properties-editor .element-header{background:var(--highlight-bg);color:var(--highlight-fg);font-size:140%;font-weight:700;width:100%;height:50px}.properties-editor .name-column{white-space:nowrap}.properties-editor .value-column{width:100%}.properties-editor .value-column-content{display:flex}.properties-editor .properties-table{width:100%}.properties-editor .properties-table .group-header td{background-color:var(--highlight-bg);color:var(--highlight-fg);font-weight:700}.properties-editor .properties-table .undefined{background-color:var(--undefined-bg);color:var(--undefined-fg)}.properties-editor .properties-table input{margin:0;border:none;width:100%}.properties-editor .properties-table input.value-changed{color:var(--error-bg)}.welcome>div{padding:1ex}.dialog{font:var(--default-font);padding:0}.dialog .dialog_content{padding:5px}.dialog .titlebar{border-bottom:1px solid black;text-align:right}.dialog .titlebar .close_button{padding:5px}.dialog .button_row{padding:5px;margin-top:10px;text-align:center}.dialog.report_export_url .url{display:flex;align-items:center;justify-content:space-between}.dialog.report_export_url .copy_url{margin-left:5px;padding:5px}.dialog.report_export_url .url .url_text{font-family:monospace}.dialog.manage_github_dialog .description_area{width:300px;height:100px;display:flex;align-items:center}.dialog.manage_github_dialog .current_state{display:flex}.dialog.manage_github_dialog .current_state .forget.button{width:100%}.dialog.manage_github_dialog .current_state input{flex:3 1 0}.dialog.manage_github_dialog .current_state input+span{padding-right:30px}.dialog.manage_github_dialog .current_state input:invalid+span:after{position:absolute;content:"✖";padding-left:5px}.dialog.manage_github_dialog .current_state input:valid+span:after{position:absolute;content:"✓";padding-left:5px}body{display:flex;flex-direction:column;position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:0;overflow:hidden}#menuBar{flex:0 0 auto}#main{flex:1 1 auto}#dock{padding:4px}.browser-error{display:flex;width:100%;height:100%;justify-content:center;align-items:center;background:var(--color_blue);color:var(--color_white)}.loader{display:flex;width:100%;height:100%;justify-content:center;align-items:center;background:var(--color_blue)}.loader-image{width:100px;animation:pulse 1s linear infinite}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(.8)}to{transform:scale(1)}} +:root{--color_baby_blue: #667cff;--color_blue: #2379f4;--color_dark: #151d21;--color_dark_20: #d0d2d3;--color_dark_40: #a1a5a6;--color_dark_80: #444a4d;--color_dark_gray: #73777a;--color_dark_blue: #250ce8;--color_deep_indigo: #1f284d;--color_focus_blue: #3573d8;--color_gray: #e8e9e9;--color_ice_blue: #0db1ff;--color_light_blue: #f2f4ff;--color_light_gray_2: #b8bbbc;--color_light_purple: #99a8ff;--color_medium_gray: #939393;--color_purple: #6b0dff;--color_white: #ffffff;--error-bg: var(--color_purple);--error-fg: var(--color_light_blue);--highlight-bg: var(--color_focus_blue);--highlight-fg: var(--color_white);--highlight2-bg: var(--color_ice_blue);--highlight2-fg: var(--color_white);--undefined-bg: var(--color_dark_20);--undefined-fg: var(--color_dark);--default-font: 12px Helvetica, Arial, sans-serif}.lm-cursor-backdrop{top:0;left:0;position:fixed;width:200px;height:200px;margin-top:-100px;margin-left:-100px;will-change:transform;z-index:100;scrollbar-width:none;-ms-overflow-style:none;overflow:scroll}.lm-cursor-backdrop:after{content:"";height:1200px;width:1200px;display:block}.lm-cursor-backdrop::-webkit-scrollbar{display:none}.lm-mod-drag-image{top:0;left:0;will-change:transform}.lm-Widget{box-sizing:border-box;position:relative}.lm-Widget.lm-mod-hidden{display:none!important}.lm-AccordionPanel[data-orientation=horizontal]>.lm-AccordionPanel-title{display:block;transform-origin:top left;transform:rotate(-90deg) translate(-100%)}.lm-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-CommandPalette-search{flex:0 0 auto}.lm-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.lm-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-CommandPalette-item{display:flex;flex-direction:row}.lm-CommandPalette-itemIcon{flex:0 0 auto}.lm-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.lm-CommandPalette-itemShortcut{flex:0 0 auto}.lm-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-close-icon{border:1px solid transparent;background-color:transparent;position:absolute;z-index:1;right:3%;top:0;bottom:0;margin:auto;padding:7px 0;display:none;vertical-align:middle;outline:0;cursor:pointer}.lm-close-icon:after{content:"X";display:block;width:15px;height:15px;text-align:center;color:#000;font-weight:400;font-size:12px;cursor:pointer}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.lm-Menu-item{display:table-row}.lm-Menu-item.lm-mod-hidden,.lm-Menu-item.lm-mod-collapsed{display:none!important}.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.lm-Menu-itemLabel{display:table-cell;text-align:left}.lm-Menu-itemShortcut{display:table-cell;text-align:right}.lm-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.lm-MenuBar-item{box-sizing:border-box}.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel{display:inline-block}.lm-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-ScrollBar[data-orientation=horizontal]{flex-direction:row}.lm-ScrollBar[data-orientation=vertical]{flex-direction:column}.lm-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.lm-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.lm-ScrollBar-thumb{box-sizing:border-box;position:absolute}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden;touch-action:none}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:0 0 auto}.lm-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{left:0;transition:left .15s ease}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{top:0;transition:top .15s ease}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box;background:inherit}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.lm-AccordionPanel .lm-AccordionPanel-title{box-sizing:border-box;padding:0 10px;background:#e5e5e5;border:1px solid #c0c0c0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;min-height:22px;max-height:22px;min-width:35px;line-height:20px;margin:0}.lm-AccordionPanel .lm-AccordionPanel-title:focus,.lm-AccordionPanel .lm-AccordionPanel-title:hover{background:#dbdbdb}.lm-AccordionPanel .lm-AccordionPanel-title:focus,.lm-AccordionPanel .lm-AccordionPanel-title:last-of-type:focus:not(.lm-mod-expanded){border:1px solid lightskyblue}.lm-AccordionPanel .lm-AccordionPanel-title:last-of-type:not(.lm-mod-expanded){border-bottom:1px solid #c0c0c0}.lm-AccordionPanel .lm-AccordionPanel-title.lm-mod-expanded .lm-AccordionPanel-titleCollapser:before{content:"";font-family:FontAwesome}.lm-AccordionPanel .lm-AccordionPanel-title .lm-AccordionPanel-titleCollapser:before{content:"";font-family:FontAwesome;position:absolute;right:10px}.lm-AccordionPanel .lm-AccordionPanel-titleLabel{padding:0 5px}.lm-CommandPalette{font-family:sans-serif;background:#f5f5f5}.lm-CommandPalette-search{padding:8px}.lm-CommandPalette-wrapper{padding:4px 6px;background:#fff;border:1px solid #e0e0e0;position:relative}.lm-CommandPalette-input{width:92%;border:none;outline:none;font-size:16px}.lm-CommandPalette-header{padding:4px;color:#757575;font-size:12px;font-weight:600;background:#e1e1e1;cursor:pointer}.lm-CommandPalette-header:hover:before{content:"…";float:right;margin-right:4px}.lm-CommandPalette-header>mark{background-color:transparent;font-weight:700}.lm-CommandPalette-item{padding:4px 8px;color:#757575;font-size:13px;font-weight:500}.lm-CommandPalette-emptyMessage{padding:4px;color:#757575;font-size:12px;font-weight:600;text-align:center}.lm-CommandPalette-item.lm-mod-disabled{color:#00000040}.lm-CommandPalette-item.lm-mod-active{background:#7fdbff}.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled){background:#e5e5e5}.lm-CommandPalette-itemIcon{display:none}.lm-CommandPalette-itemLabel>mark{background-color:transparent;font-weight:700}.lm-CommandPalette-item.lm-mod-disabled mark{color:#0006}.lm-CommandPalette-itemCaption{color:#9e9e9e;font-size:11px;font-weight:400}.lm-DataGrid{min-width:64px;min-height:64px;border:1px solid #a0a0a0}.lm-DataGrid-scrollCorner{background-color:#f0f0f0}.lm-DataGrid-scrollCorner:after{content:"";position:absolute;top:0;left:0;width:1px;height:1px;background-color:#a0a0a0}.lm-DataGrid-cellEditorOccluder{pointer-events:none;position:absolute;overflow:hidden}.lm-DataGrid-cellEditorContainer{pointer-events:auto;position:absolute;background-color:#fff;box-sizing:border-box;box-shadow:0 0 6px #006bf7;border:2px solid #006bf7}.lm-DataGrid-cellEditorContainer.lm-mod-invalid{box-shadow:0 0 6px red;border:2px solid red}.lm-DataGrid-cellEditorContainer>form{width:100%;height:100%;overflow:hidden}.lm-DataGrid-cellEditorWidget{width:100%;height:100%;outline:none;box-sizing:border-box}.lm-DataGrid-cellEditorInput{background-color:#fff;border:0}.lm-DataGrid-cellEditorCheckbox{margin:0}.lm-DataGrid-notification{position:absolute;display:flex;overflow:visible;animation:fade-in .3s ease-out}.lm-DataGrid-notificationContainer{box-shadow:0 2px 5px #999;border-radius:3px;background-color:#fff;color:#000;border:1px solid black;font-family:sans-serif;font-size:13px;padding:4px}@keyframes fade-in{0%{opacity:0}50%{opacity:.7}to{opacity:1}}.lm-DockPanel-overlay{background:#fff9;border:1px dashed black;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-Menu{padding:3px 0;background:#fff;color:#000000de;border:1px solid #c0c0c0;font:12px Helvetica,Arial,sans-serif;box-shadow:0 1px 6px #0003}.lm-Menu-item.lm-mod-active{background:#e5e5e5}.lm-Menu-item.lm-mod-disabled{color:#00000040}.lm-Menu-itemIcon{width:21px;padding:4px 2px}.lm-Menu-itemLabel{padding:4px 35px 4px 2px}.lm-Menu-itemMnemonic{text-decoration:underline}.lm-Menu-itemShortcut{padding:4px 0}.lm-Menu-itemSubmenuIcon{width:16px;padding:4px 0}.lm-Menu-item[data-type=separator]>div{padding:0;height:9px}.lm-Menu-item[data-type=separator]>div:after{content:"";display:block;position:relative;top:4px;border-top:1px solid #dddddd}.lm-Menu-itemIcon:before,.lm-Menu-itemSubmenuIcon:before{font-family:FontAwesome}.lm-Menu-item.lm-mod-toggled>.lm-Menu-itemIcon:before{content:""}.lm-Menu-item[data-type=submenu]>.lm-Menu-itemSubmenuIcon:before{content:""}.lm-MenuBar{padding-left:5px;background:#fafafa;color:#000000de;border-bottom:1px solid #dddddd;font:13px Helvetica,Arial,sans-serif}.lm-MenuBar-menu{transform:translateY(-1px)}.lm-MenuBar-item{padding:4px 8px;border-left:1px solid transparent;border-right:1px solid transparent}.lm-MenuBar-item.lm-mod-active{background:#e5e5e5}.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active{z-index:10001;background:#fff;border-left:1px solid #c0c0c0;border-right:1px solid #c0c0c0;box-shadow:0 0 6px #0003}.lm-MenuBar-item:focus-visible{outline:2px solid #333;outline-offset:-2px}.lm-MenuBar-item[aria-disabled=true]{color:#0000005e}.lm-ScrollBar[data-orientation=horizontal]{min-height:16px;max-height:16px;min-width:45px;border-top:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=vertical]{min-width:16px;max-width:16px;min-height:45px;border-left:1px solid #a0a0a0}.lm-ScrollBar-button{background-color:#f0f0f0;background-position:center center;min-height:15px;max-height:15px;min-width:15px;max-width:15px}.lm-ScrollBar-button:hover{background-color:#dadada}.lm-ScrollBar-button.lm-mod-active{background-color:#cdcdcd}.lm-ScrollBar-track{background:#f0f0f0}.lm-ScrollBar-thumb{background:#cdcdcd}.lm-ScrollBar-thumb:hover{background:#bababa}.lm-ScrollBar-thumb.lm-mod-active{background:#a0a0a0}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-thumb{height:100%;min-width:15px;border-left:1px solid #a0a0a0;border-right:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-thumb{width:100%;min-height:15px;border-top:1px solid #a0a0a0;border-bottom:1px solid #a0a0a0}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-button[data-action=decrement]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABDSURBVChTnctBCgAwCANBf+3z0+YgFExr9TAEAmsA2uRZkWdFnsHd9+Q/HYFBK4rgOzqD74hGEY0iGkU38qzI8w22AMNb74XHwmKSAAAAAElFTkSuQmCC)}.lm-ScrollBar[data-orientation=horizontal] .lm-ScrollBar-button[data-action=increment]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABKSURBVChTlctBCsBACARBf+3zTeYg7GJnJIdCbJioqt8wbjBuMGbme2ZvGDVyQ4w9+hqOIOeIhtfT3EBGEDcQjG4gGDcYNxi9ige5y++FbjFqAAAAAABJRU5ErkJggg==)}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-button[data-action=decrement]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABHSURBVChTlctBDgAQDETR3rrHL11IlM+weBGfsYj4hlHBqGBUMCZ37we/YczBsL6lLcyD07BcaDDM/8roFUYFo4JRwXgX1gD97e+FKAUICwAAAABJRU5ErkJggg==)}.lm-ScrollBar[data-orientation=vertical] .lm-ScrollBar-button[data-action=increment]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABDSURBVChTlcsxCgAwCENRb+3xUzIIlUZDhzf4MQHgm4yOjI6MjoxOOzITk/uvjcgNqB1lG9ATyjQgGR0ZHRkdGXeIA38574WaLSX0AAAAAElFTkSuQmCC)}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{min-width:0;min-height:0;align-items:flex-end;border-bottom:1px solid #c0c0c0}.lm-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid #c0c0c0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.lm-TabBar-tabLabel .lm-TabBar-tabInput{padding:0;border:0px;font:12px Helvetica,Arial,sans-serif}.lm-TabBar-tab.lm-mod-current{background:#fff}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tab.lm-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar .lm-TabBar-addButton{padding:0 6px;border-bottom:1px solid #c0c0c0}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon:before{content:"";font-family:FontAwesome}.lm-TabBar .lm-TabBar-addButton:before{content:"";font-family:FontAwesome}.lm-TabBar-tab.lm-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px #0000004d}.content{min-width:50px;min-height:50px;display:flex;flex-direction:column;padding:8px;border:1px solid var(--color_dark_40);border-top:none;background:#fff;box-shadow:1px 1px 2px #0003;font:var(--default-font)}.content>div{flex:1 1 auto;border:1px solid var(--color_dark_80);overflow:auto}.content input{margin:8px}.editor .container{display:flex;flex-direction:column;align-items:stretch}.editor .container .edit-area{flex-shrink:1000;flex-grow:1000}.outline ul{padding-left:1em;list-style-type:none}.outline .outline-tree{margin:4px}.outline .outline-tree{padding-left:4px}.outline .outline-element{margin:0;padding:2px;width:100%;display:block}.outline .outline-element>span{display:block;-webkit-user-select:none;user-select:none}.outline .kind-class.outline-element span:before{font-family:FontAwesome;content:"";padding:2px}.outline .kind-struct.outline-element span:before{font-family:FontAwesome;content:"";padding:2px}.outline .outline-element .active{background:var(--highlight-bg);color:var(--highlight-fg)}.preview-container{padding:0}.properties-editor .element-header{background:var(--highlight-bg);color:var(--highlight-fg);font-size:140%;font-weight:700;width:100%;height:50px}.properties-editor .name-column{white-space:nowrap}.properties-editor .value-column{width:100%}.properties-editor .value-column-content{display:flex}.properties-editor .properties-table{width:100%}.properties-editor .properties-table .group-header td{background-color:var(--highlight-bg);color:var(--highlight-fg);font-weight:700}.properties-editor .properties-table .undefined{background-color:var(--undefined-bg);color:var(--undefined-fg)}.properties-editor .properties-table input{margin:0;border:none;width:100%}.properties-editor .properties-table input.value-changed{color:var(--error-bg)}.welcome>div{padding:1ex}.dialog{font:var(--default-font);padding:0}.dialog .dialog_content{padding:5px}.dialog .titlebar{border-bottom:1px solid black;text-align:right}.dialog .titlebar .close_button{padding:5px}.dialog .button_row{padding:5px;margin-top:10px;text-align:center}.dialog.report_export_url .url{display:flex;align-items:center;justify-content:space-between}.dialog.report_export_url .copy_url{margin-right:5px;padding:5px}.dialog.report_export_url .url .url_text{font-family:monospace}.dialog.manage_github_dialog .description_area{width:300px;height:100px;display:flex;align-items:center}.dialog.manage_github_dialog .current_state{display:flex}.dialog.manage_github_dialog .current_state .forget.button{width:100%}.dialog.manage_github_dialog .current_state input{flex:3 1 0}.dialog.manage_github_dialog .current_state input+span{padding-right:30px}.dialog.manage_github_dialog .current_state input:invalid+span:after{position:absolute;content:"✖";padding-left:5px}.dialog.manage_github_dialog .current_state input:valid+span:after{position:absolute;content:"✓";padding-left:5px}body{display:flex;flex-direction:column;position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:0;overflow:hidden}#menuBar{flex:0 0 auto}#main{flex:1 1 auto}#dock{padding:4px}.browser-error{display:flex;width:100%;height:100%;justify-content:center;align-items:center;background:var(--color_blue);color:var(--color_white)}.loader{display:flex;width:100%;height:100%;justify-content:center;align-items:center;background:var(--color_blue)}.loader-image{width:100px;animation:pulse 1s linear infinite}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(.8)}to{transform:scale(1)}} diff --git a/snapshots/master/editor/assets/index-ZvpXqOGL.js b/snapshots/master/editor/assets/index-ZvpXqOGL.js deleted file mode 100644 index 1be6bbe4d..000000000 --- a/snapshots/master/editor/assets/index-ZvpXqOGL.js +++ /dev/null @@ -1,11 +0,0 @@ -import{g as f1}from"./index-Dy6PDT3p.js";function m1(e,o){for(var i=0;ih[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y={},S={detecting:0,foundIt:1,notMe:2,start:0,error:1,itsMe:2,SHORTCUT_THRESHOLD:.95},d1=S;function M1(){this.reset=function(){this._mState=d1.detecting},this.getCharsetName=function(){return null},this.feed=function(e){},this.getState=function(){return this._mState},this.getConfidence=function(){return 0},this.filterHighBitOnly=function(e){return e=e.replace(/[\x00-\x7F]+/g," "),e},this.filterWithoutEnglishLetters=function(e){return e=e.replace(/[A-Za-z]+/g," "),e},this.filterWithEnglishLetters=function(e){for(var o="",i=!1,h=0,a=0;a"?i=!1:n=="<"&&(i=!0);var l=/[a-zA-Z]/.test(n),T=/^[\x00-\x7F]*$/.test(n);T&&!l&&(a>h&&!i&&(o=o+e.substring(h,a)+" "),h=a+1)}return i||(o=o+e.substring(h)),o}}var J=M1,w={};w.log=function(){};w.setLogger=function(o){w.enabled=!0,w.log=o};var j=S,P0=J,T0=w;function u0(){P0.apply(this);var e=this;function o(){e._mActiveNum=0,e._mProbers=[],e._mBestGuessProber=null}this.reset=function(){u0.prototype.reset.apply(this),this._mActiveNum=0;for(var i=0,h;h=this._mProbers[i];i++)h&&(h.reset(),h.active=!0,this._mActiveNum++);this._mBestGuessProber=null},this.getCharsetName=function(){return!this._mBestGuessProber&&(this.getConfidence(),!this._mBestGuessProber)?null:this._mBestGuessProber.getCharsetName()},this.feed=function(i){for(var h=0,a;a=this._mProbers[h];h++)if(!(!a||!a.active)){var n=a.feed(i);if(n){if(n==j.foundIt)return this._mBestGuessProber=a,this.getState();if(n==j.notMe&&(a.active=!1,this._mActiveNum--,this._mActiveNum<=0))return this._mState=j.notMe,this.getState()}}return this.getState()},this.getConfidence=function(){var i=this.getState();if(i==j.foundIt)return .99;if(i==j.notMe)return .01;var h=0;this._mBestGuessProber=null;for(var a=0,n;n=this._mProbers[a];a++)if(n){if(!n.active){T0.log(n.getCharsetName()+` not active -`);continue}var l=n.getConfidence();T0.log(n.getCharsetName()+" confidence = "+l+` -`),hU.SHORTCUT_THRESHOLD&&(this._mState=U.foundIt),this.getState()},this.getConfidence=function(){return this._mDistributionAnalyzer.getConfidence()}}C0.prototype=new F0;var Z=C0,v=S,T1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],b1=[v.error,v.start,v.start,3,v.error,v.error,v.error,v.error,v.error,v.error,v.itsMe,v.itsMe,v.itsMe,v.itsMe,v.itsMe,v.error,v.error,v.start,v.start,v.start,v.start,v.start,v.start,v.start],S1=[0,1,1,2,0],A1={classTable:T1,classFactor:5,stateTable:b1,charLenTable:S1,name:"Big5"},L={},t0={};t0.JIS_TYPICAL_DISTRIBUTION_RATIO=3;t0.JIS_TABLE_SIZE=4368;t0.JISCharToFreqOrder=[40,1,6,182,152,180,295,2127,285,381,3295,4304,3068,4606,3165,3510,3511,1822,2785,4607,1193,2226,5070,4608,171,2996,1247,18,179,5071,856,1661,1262,5072,619,127,3431,3512,3230,1899,1700,232,228,1294,1298,284,283,2041,2042,1061,1062,48,49,44,45,433,434,1040,1041,996,787,2997,1255,4305,2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928,5081,3296,3432,290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375,1691,3297,4306,4307,4611,452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472,598,618,820,1205,1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172,1875,2043,2149,1793,1382,2973,925,2404,1067,1241,960,1377,2935,1491,919,1217,1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804,2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998,3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161,26,3377,2,3929,20,3691,47,4100,50,17,16,35,268,27,243,42,155,24,154,29,184,4,91,14,92,53,396,33,289,9,37,64,620,21,39,321,5,12,11,52,13,3,208,138,0,7,60,526,141,151,1069,181,275,1591,83,132,1475,126,331,829,15,69,160,59,22,157,55,1079,312,109,38,23,25,10,19,79,5195,61,382,1124,8,30,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,89,62,74,34,2416,112,139,196,271,149,84,607,131,765,46,88,153,683,76,874,101,258,57,80,32,364,121,1508,169,1547,68,235,145,2999,41,360,3027,70,63,31,43,259,262,1383,99,533,194,66,93,846,217,192,56,106,58,565,280,272,311,256,146,82,308,71,100,128,214,655,110,261,104,1140,54,51,36,87,67,3070,185,2618,2936,2020,28,1066,2390,2059,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238,5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247,4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,363,642,2787,2878,2788,2789,2316,3232,2317,3434,2011,165,1942,3930,3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,2044,2060,4621,997,1235,473,1186,4622,920,3378,6115,6116,379,1108,4313,2657,2735,3934,6117,3809,636,3233,573,1026,3693,3435,2974,3300,2298,4105,854,2937,2463,393,2581,2417,539,752,1280,2750,2480,140,1161,440,708,1569,665,2497,1746,1291,1523,3e3,164,1603,847,1331,537,1997,486,508,1693,2418,1970,2227,878,1220,299,1030,969,652,2751,624,1137,3301,2619,65,3302,2045,1761,1859,3120,1930,3694,3516,663,1767,852,835,3695,269,767,2826,2339,1305,896,1150,770,1616,6118,506,1502,2075,1012,2519,775,2520,2975,2340,2938,4314,3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557,175,597,985,3517,2419,2521,1416,3029,585,938,1931,1007,1052,1932,1685,6120,3379,4316,4623,804,599,3121,1333,2128,2539,1159,1554,2032,3810,687,2033,2904,952,675,1467,3436,6121,2241,1096,1786,2440,1543,1924,980,1813,2228,781,2692,1879,728,1918,3696,4624,548,1950,4625,1809,1088,1356,3303,2522,1944,502,972,373,513,2827,586,2377,2391,1003,1976,1631,6122,2464,1084,648,1776,4626,2141,324,962,2012,2177,2076,1384,742,2178,1448,1173,1810,222,102,301,445,125,2420,662,2498,277,200,1476,1165,1068,224,2562,1378,1446,450,1880,659,791,582,4627,2939,3936,1516,1274,555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229,412,2114,1900,2392,3518,512,2597,427,1925,2341,3122,1653,1686,2465,2499,697,330,273,380,2162,951,832,780,991,1301,3073,965,2270,3519,668,2523,2636,1286,535,1407,518,671,957,2658,2378,267,611,2197,3030,6123,248,2299,967,1799,2356,850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879,2829,499,2179,676,4629,557,2329,2214,2090,325,3234,464,811,3001,992,2342,2481,1232,1469,303,2242,466,1070,2163,603,1777,2091,4630,2752,4631,2714,322,2659,1964,1768,481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849,2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634,1604,943,1724,1454,917,868,2215,1169,2940,552,1145,1800,1228,1823,1955,316,1080,2510,361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127,541,1263,1229,1148,2540,545,465,1833,2880,3438,1901,3074,2482,816,3937,713,1788,2500,122,1575,195,1451,2501,1111,6128,859,374,1225,2243,2483,4317,390,1033,3439,3075,2524,1687,266,793,1440,2599,946,779,802,507,897,1081,528,2189,1292,711,1866,1725,1167,1640,753,398,2661,1053,246,348,4318,137,1024,3440,1600,2077,2129,825,4319,698,238,521,187,2300,1157,2423,1641,1605,1464,1610,1097,2541,1260,1436,759,2255,1814,2150,705,3235,409,2563,3304,561,3033,2005,2564,726,1956,2343,3698,4109,949,3812,3813,3520,1669,653,1379,2525,881,2198,632,2256,1027,778,1074,733,1957,514,1481,2466,554,2180,702,3938,1606,1017,1398,6129,1380,3521,921,993,1313,594,449,1489,1617,1166,768,1426,1360,495,1794,3601,1177,3602,1170,4320,2344,476,425,3167,4635,3168,1424,401,2662,1171,3382,1998,1089,4110,477,3169,474,6130,1909,596,2831,1842,494,693,1051,1028,1207,3076,606,2115,727,2790,1473,1115,743,3522,630,805,1532,4321,2021,366,1057,838,684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090,1536,3939,3523,3306,1455,2199,336,369,2331,1035,584,2393,902,718,2600,6131,2753,463,2151,1149,1611,2467,715,1308,3124,1268,343,1413,3236,1517,1347,2663,2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980,872,2368,2441,2943,320,2369,2116,1082,679,1933,3941,2791,3815,625,1143,2023,422,2200,3816,6133,730,1695,356,2257,1626,2301,2858,2637,1627,1778,937,883,2906,2693,3002,1769,1086,400,1063,1325,3307,2792,4111,3077,456,2345,1046,747,6134,1524,884,1094,3383,1474,2164,1059,974,1688,2181,2258,1047,345,1665,1187,358,875,3170,305,660,3524,2190,1334,1135,3171,1540,1649,2542,1527,927,968,2793,885,1972,1850,482,500,2638,1218,1109,1085,2543,1654,2034,876,78,2287,1482,1277,861,1675,1083,1779,724,2754,454,397,1132,1612,2332,893,672,1237,257,2259,2370,135,3384,337,2244,547,352,340,709,2485,1400,788,1138,2511,540,772,1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533,407,576,3308,1254,2071,978,3385,170,136,1201,3125,2664,3172,2394,213,912,873,3603,1713,2202,699,3604,3699,813,3442,493,531,1054,468,2907,1483,304,281,4112,1726,1252,2094,339,2319,2130,2639,756,1563,2944,748,571,2976,1588,2425,2715,1851,1460,2426,1528,1392,1973,3237,288,3309,685,3386,296,892,2716,2216,1570,2245,722,1747,2217,905,3238,1103,6135,1893,1441,1965,251,1805,2371,3700,2601,1919,1078,75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817,524,706,1075,292,3818,1756,2602,317,98,3173,3605,3525,1844,2218,3819,2502,814,567,385,2908,1534,6137,534,1642,3239,797,6138,1670,1529,953,4323,188,1071,538,178,729,3240,2109,1226,1374,2e3,2357,2977,731,2468,1116,2014,2051,6139,1261,1593,803,2859,2736,3443,556,682,823,1541,6140,1369,2289,1706,2794,845,462,2603,2665,1361,387,162,2358,1740,739,1770,1720,1304,1401,3241,1049,627,1571,2427,3526,1877,3942,1852,1500,431,1910,1503,677,297,2795,286,1433,1038,1198,2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442,108,712,4640,2372,866,3701,2755,3242,1348,834,1945,1408,3527,2395,3243,1811,824,994,1179,2110,1548,1453,790,3003,690,4324,4325,2832,2909,3820,1860,3821,225,1748,310,346,1780,2470,821,1993,2717,2796,828,877,3528,2860,2471,1702,2165,2910,2486,1789,453,359,2291,1676,73,1164,1461,1127,3311,421,604,314,1037,589,116,2487,737,837,1180,111,244,735,6142,2261,1861,1362,986,523,418,581,2666,3822,103,855,503,1414,1867,2488,1091,657,1597,979,605,1316,4641,1021,2443,2078,2001,1209,96,587,2166,1032,260,1072,2153,173,94,226,3244,819,2006,4642,4114,2203,231,1744,782,97,2667,786,3387,887,391,442,2219,4326,1425,6143,2694,633,1544,1202,483,2015,592,2052,1958,2472,1655,419,129,4327,3444,3312,1714,1257,3078,4328,1518,1098,865,1310,1019,1885,1512,1734,469,2444,148,773,436,1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643,579,1238,932,2320,353,205,801,115,2428,944,2321,1881,399,2565,1211,678,766,3944,335,2101,1459,1781,1402,3945,2737,2131,1010,844,981,1326,1013,550,1816,1545,2620,1335,1008,371,2881,936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503,416,1643,4330,806,1126,229,591,3946,1314,1981,1576,1837,1666,347,1790,977,3313,764,2861,1853,688,2429,1920,1462,77,595,415,2002,3034,798,1192,4115,6144,2978,4331,3035,2695,2582,2072,2566,430,2430,1727,842,1396,3947,3702,613,377,278,236,1417,3388,3314,3174,757,1869,107,3530,6145,1194,623,2262,207,1253,2167,3446,3948,492,1117,1935,536,1838,2757,1246,4332,696,2095,2406,1393,1572,3175,1782,583,190,253,1390,2230,830,3126,3389,934,3245,1703,1749,2979,1870,2545,1656,2204,869,2346,4116,3176,1817,496,1764,4644,942,1504,404,1903,1122,1580,3606,2945,1022,515,372,1735,955,2431,3036,6146,2797,1110,2302,2798,617,6147,441,762,1771,3447,3607,3608,1904,840,3037,86,939,1385,572,1370,2445,1336,114,3703,898,294,203,3315,703,1583,2274,429,961,4333,1854,1951,3390,2373,3704,4334,1318,1381,966,1911,2322,1006,1155,309,989,458,2718,1795,1372,1203,252,1689,1363,3177,517,1936,168,1490,562,193,3823,1042,4117,1835,551,470,4645,395,489,3448,1871,1465,2583,2641,417,1493,279,1295,511,1236,1119,72,1231,1982,1812,3004,871,1564,984,3449,1667,2696,2096,4646,2347,2833,1673,3609,695,3246,2668,807,1183,4647,890,388,2333,1801,1457,2911,1765,1477,1031,3316,3317,1278,3391,2799,2292,2526,163,3450,4335,2669,1404,1802,6148,2323,2407,1584,1728,1494,1824,1269,298,909,3318,1034,1632,375,776,1683,2061,291,210,1123,809,1249,1002,2642,3038,206,1011,2132,144,975,882,1565,342,667,754,1442,2143,1299,2303,2062,447,626,2205,1221,2739,2912,1144,1214,2206,2584,760,1715,614,950,1281,2670,2621,810,577,1287,2546,4648,242,2168,250,2643,691,123,2644,647,313,1029,689,1357,2946,1650,216,771,1339,1306,808,2063,549,913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079,406,2671,2117,3949,4649,487,1825,2220,6150,2915,448,2348,1073,6151,2397,1707,130,900,1598,329,176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155,3706,1912,1513,1614,6153,1988,646,392,2304,1589,3320,3039,1826,1239,1352,1340,2916,505,2567,1709,1437,2408,2547,906,6154,2672,384,1458,1594,1100,1329,710,423,3531,2064,2231,2622,1989,2673,1087,1882,333,841,3005,1296,2882,2379,580,1937,1827,1293,2585,601,574,249,1772,4118,2079,1120,645,901,1176,1690,795,2207,478,1434,516,1190,1530,761,2080,930,1264,355,435,1552,644,1791,987,220,1364,1163,1121,1538,306,2169,1327,1222,546,2645,218,241,610,1704,3321,1984,1839,1966,2528,451,6155,2586,3707,2568,907,3178,254,2947,186,1845,4650,745,432,1757,428,1633,888,2246,2221,2489,3611,2118,1258,1265,956,3127,1784,4337,2490,319,510,119,457,3612,274,2035,2007,4651,1409,3128,970,2758,590,2800,661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111,485,2491,1429,1156,6156,2548,2183,1495,831,1840,2529,2446,501,1657,307,1894,3247,1341,666,899,2156,1539,2549,1559,886,349,2208,3081,2305,1736,3824,2170,2759,1014,1913,1386,542,1397,2948,490,368,716,362,159,282,2569,1129,1658,1288,1750,2674,276,649,2016,751,1496,658,1818,1284,1862,2209,2087,2512,3451,622,2834,376,117,1060,2053,1208,1721,1101,1443,247,1250,3179,1792,3952,2760,2398,3953,6157,2144,3708,446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082,424,2222,1251,2449,2119,2836,504,1581,4338,602,817,857,3825,2349,2306,357,3826,1470,1883,2883,255,958,929,2917,3248,302,4653,1050,1271,1751,2307,1952,1430,2697,2719,2359,354,3180,777,158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232,3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428,637,931,2721,2145,914,2550,2587,81,2450,612,827,2646,1242,4655,1118,2884,472,1855,3181,3533,3534,569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152,1938,134,1830,471,3710,2276,1112,1535,3323,3453,3535,982,1337,2950,488,826,674,1058,1628,4120,2017,522,2399,211,568,1367,3454,350,293,1872,1139,3249,1399,1946,3006,1300,2360,3324,588,736,6160,2606,744,669,3536,3828,6161,1358,199,723,848,933,851,1939,1505,1514,1338,1618,1831,4656,1634,3613,443,2740,3829,717,1947,491,1914,6162,2551,1542,4121,1025,6163,1099,1223,198,3040,2722,370,410,1905,2589,998,1248,3182,2380,519,1449,4122,1710,947,928,1153,4341,2277,344,2624,1511,615,105,161,1212,1076,1960,3130,2054,1926,1175,1906,2473,414,1873,2801,6164,2309,315,1319,3325,318,2018,2146,2157,963,631,223,4342,4343,2675,479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886,2184,1674,1330,1711,1635,1506,799,219,3250,3083,3954,1677,3713,3326,2081,3614,1652,2073,4657,1147,3041,1752,643,1961,147,1974,3955,6167,1716,2037,918,3007,1994,120,1537,118,609,3184,4345,740,3455,1219,332,1615,3830,6168,1621,2980,1582,783,212,553,2350,3714,1349,2433,2082,4124,889,6169,2310,1275,1410,973,166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658,629,822,3008,763,940,1990,2862,439,2409,1566,1240,1622,926,1282,1907,2764,654,2210,1607,327,1130,3956,1678,1623,6170,2434,2192,686,608,3831,3715,903,3957,3042,6171,2741,1522,1915,1105,1555,2552,1359,323,3251,4346,3457,738,1354,2553,2311,2334,1828,2003,3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847,520,1204,2607,264,4659,836,2677,2102,600,4660,3833,2278,3084,6174,4347,3615,1342,640,532,543,2608,1888,2400,2591,1009,4348,1497,341,1737,3616,2723,1394,529,3252,1321,983,4661,1515,2120,971,2592,924,287,1662,3186,4349,2700,4350,1519,908,1948,2452,156,796,1629,1486,2223,2055,694,4126,1259,1036,3392,1213,2249,2742,1889,1230,3958,1015,910,408,559,3617,4662,746,725,935,4663,3959,3009,1289,563,867,4664,3960,1567,2981,2038,2626,988,2263,2381,4351,143,2374,704,1895,6175,1188,3716,2088,673,3085,2362,4352,484,1608,1921,2765,2918,215,904,3618,3537,894,509,976,3043,2701,3961,4353,2837,2982,498,6176,6177,1102,3538,1332,3393,1487,1636,1637,233,245,3962,383,650,995,3044,460,1520,1206,2352,749,3327,530,700,389,1438,1560,1773,3963,2264,719,2951,2724,3834,870,1832,1644,1e3,839,2474,3717,197,1630,3394,365,2886,3964,1285,2133,734,922,818,1106,732,480,2083,1774,3458,923,2279,1350,221,3086,85,2233,2234,3835,1585,3010,2147,1387,1705,2382,1619,2475,133,239,2802,1991,1016,2084,2383,411,2838,1113,651,1985,1160,3328,990,1863,3087,1048,1276,2647,265,2627,1599,3253,2056,150,638,2019,656,853,326,1479,680,1439,4354,1001,1759,413,3459,3395,2492,1431,459,4355,1125,3329,2265,1953,1450,2065,2863,849,351,2678,3131,3254,3255,1104,1577,227,1351,1645,2453,2193,1421,2887,812,2121,634,95,2435,201,2312,4665,1646,1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189,328,2679,1077,1940,1136,558,1283,964,1195,621,2074,1199,1743,3460,3619,1896,1916,1890,3836,2952,1154,2112,1064,862,378,3011,2066,2113,2803,1568,2839,6178,3088,2919,1941,1660,2004,1992,2194,142,707,1590,1708,1624,1922,1023,1836,1233,1004,2313,789,741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721,593,2840,367,2920,1878,6180,3461,1521,628,1168,692,2211,2649,300,720,2067,2571,2953,3396,959,2504,3966,3539,3462,1977,701,6181,954,1043,800,681,183,3722,1803,1730,3540,4128,2103,815,2314,174,467,230,2454,1093,2134,755,3541,3397,1141,1162,6182,1738,2039,270,3256,2513,1005,1647,2185,3837,858,1679,1897,1719,2954,2324,1806,402,670,167,4129,1498,2158,2104,750,6183,915,189,1680,1551,455,4356,1501,2455,405,1095,2955,338,1586,1266,1819,570,641,1324,237,1556,2650,1388,3723,6184,1368,2384,1343,1978,3089,2436,879,3724,792,1191,758,3012,1411,2135,1322,4357,240,4667,1848,3725,1574,6185,420,3045,1546,1391,714,4358,1967,941,1864,863,664,426,560,1731,2680,1785,2864,1949,2363,403,3330,1415,1279,2136,1697,2335,204,721,2097,3838,90,6186,2085,2505,191,3967,124,2148,1376,1798,1178,1107,1898,1405,860,4359,1243,1272,2375,2983,1558,2456,1638,113,3621,578,1923,2609,880,386,4130,784,2186,2266,1422,2956,2172,1722,497,263,2514,1267,2412,2610,177,2703,3542,774,1927,1344,616,1432,1595,1018,172,4360,2325,911,4361,438,1468,3622,794,3968,2024,2173,1681,1829,2957,945,895,3090,575,2212,2476,475,2401,2681,785,2744,1745,2293,2555,1975,3133,2865,394,4668,3839,635,4131,639,202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457,3727,3134,4362,843,2611,437,916,4669,234,769,1884,3046,3047,3623,833,6187,1639,2250,2402,1355,1185,2010,2047,999,525,1732,1290,1488,2612,948,1578,3728,2413,2477,1216,2725,2159,334,3840,1328,3624,2921,1525,4132,564,1056,891,4363,1444,1698,2385,2251,3729,1365,2281,2235,1717,6188,864,3841,2515,444,527,2767,2922,3625,544,461,6189,566,209,2437,3398,2098,1065,2068,3331,3626,3257,2137,2138,2122,3730,2888,1995,1820,1044,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,4670,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,3187,6238,6239,3969,6240,6241,6242,6243,6244,4671,6245,6246,4672,6247,6248,4133,6249,6250,4364,6251,2923,2556,2613,4673,4365,3970,6252,6253,6254,6255,4674,6256,6257,6258,2768,2353,4366,4675,4676,3188,4367,3463,6259,4134,4677,4678,6260,2267,6261,3842,3332,4368,3543,6262,6263,6264,3013,1954,1928,4135,4679,6265,6266,2478,3091,6267,4680,4369,6268,6269,1699,6270,3544,4136,4681,6271,4137,6272,4370,2804,6273,6274,2593,3971,3972,4682,6275,2236,4683,6276,6277,4684,6278,6279,4138,3973,4685,6280,6281,3258,6282,6283,6284,6285,3974,4686,2841,3975,6286,6287,3545,6288,6289,4139,4687,4140,6290,4141,6291,4142,6292,6293,3333,6294,6295,6296,4371,6297,3399,6298,6299,4372,3976,6300,6301,6302,4373,6303,6304,3843,3731,6305,4688,4374,6306,6307,3259,2294,6308,3732,2530,4143,6309,4689,6310,6311,6312,3048,6313,6314,4690,3733,2237,6315,6316,2282,3334,6317,6318,3844,6319,6320,4691,6321,3400,4692,6322,4693,6323,3049,6324,4375,6325,3977,6326,6327,6328,3546,6329,4694,3335,6330,4695,4696,6331,6332,6333,6334,4376,3978,6335,4697,3979,4144,6336,3980,4698,6337,6338,6339,6340,6341,4699,4700,4701,6342,6343,4702,6344,6345,4703,6346,6347,4704,6348,4705,4706,3135,6349,4707,6350,4708,6351,4377,6352,4709,3734,4145,6353,2506,4710,3189,6354,3050,4711,3981,6355,3547,3014,4146,4378,3735,2651,3845,3260,3136,2224,1986,6356,3401,6357,4712,2594,3627,3137,2573,3736,3982,4713,3628,4714,4715,2682,3629,4716,6358,3630,4379,3631,6359,6360,6361,3983,6362,6363,6364,6365,4147,3846,4717,6366,6367,3737,2842,6368,4718,2628,6369,3261,6370,2386,6371,6372,3738,3984,4719,3464,4720,3402,6373,2924,3336,4148,2866,6374,2805,3262,4380,2704,2069,2531,3138,2806,2984,6375,2769,6376,4721,4722,3403,6377,6378,3548,6379,6380,2705,3092,1979,4149,2629,3337,2889,6381,3338,4150,2557,3339,4381,6382,3190,3263,3739,6383,4151,4723,4152,2558,2574,3404,3191,6384,6385,4153,6386,4724,4382,6387,6388,4383,6389,6390,4154,6391,4725,3985,6392,3847,4155,6393,6394,6395,6396,6397,3465,6398,4384,6399,6400,6401,6402,6403,6404,4156,6405,6406,6407,6408,2123,6409,6410,2326,3192,4726,6411,6412,6413,6414,4385,4157,6415,6416,4158,6417,3093,3848,6418,3986,6419,6420,3849,6421,6422,6423,4159,6424,6425,4160,6426,3740,6427,6428,6429,6430,3987,6431,4727,6432,2238,6433,6434,4386,3988,6435,6436,3632,6437,6438,2843,6439,6440,6441,6442,3633,6443,2958,6444,6445,3466,6446,2364,4387,3850,6447,4388,2959,3340,6448,3851,6449,4728,6450,6451,3264,4729,6452,3193,6453,4389,4390,2706,3341,4730,6454,3139,6455,3194,6456,3051,2124,3852,1602,4391,4161,3853,1158,3854,4162,3989,4392,3990,4731,4732,4393,2040,4163,4394,3265,6457,2807,3467,3855,6458,6459,6460,3991,3468,4733,4734,6461,3140,2960,6462,4735,6463,6464,6465,6466,4736,4737,4738,4739,6467,6468,4164,2403,3856,6469,6470,2770,2844,6471,4740,6472,6473,6474,6475,6476,6477,6478,3195,6479,4741,4395,6480,2867,6481,4742,2808,6482,2493,4165,6483,6484,6485,6486,2295,4743,6487,6488,6489,3634,6490,6491,6492,6493,6494,6495,6496,2985,4744,6497,6498,4745,6499,6500,2925,3141,4166,6501,6502,4746,6503,6504,4747,6505,6506,6507,2890,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,3469,4167,6520,6521,6522,4748,4396,3741,4397,4749,4398,3342,2125,4750,6523,4751,4752,4753,3052,6524,2961,4168,6525,4754,6526,4755,4399,2926,4169,6527,3857,6528,4400,4170,6529,4171,6530,6531,2595,6532,6533,6534,6535,3635,6536,6537,6538,6539,6540,6541,6542,4756,6543,6544,6545,6546,6547,6548,4401,6549,6550,6551,6552,4402,3405,4757,4403,6553,6554,6555,4172,3742,6556,6557,6558,3992,3636,6559,6560,3053,2726,6561,3549,4173,3054,4404,6562,6563,3993,4405,3266,3550,2809,4406,6564,6565,6566,4758,4759,6567,3743,6568,4760,3744,4761,3470,6569,6570,6571,4407,6572,3745,4174,6573,4175,2810,4176,3196,4762,6574,4177,6575,6576,2494,2891,3551,6577,6578,3471,6579,4408,6580,3015,3197,6581,3343,2532,3994,3858,6582,3094,3406,4409,6583,2892,4178,4763,4410,3016,4411,6584,3995,3142,3017,2683,6585,4179,6586,6587,4764,4412,6588,6589,4413,6590,2986,6591,2962,3552,6592,2963,3472,6593,6594,4180,4765,6595,6596,2225,3267,4414,6597,3407,3637,4766,6598,6599,3198,6600,4415,6601,3859,3199,6602,3473,4767,2811,4416,1856,3268,3200,2575,3996,3997,3201,4417,6603,3095,2927,6604,3143,6605,2268,6606,3998,3860,3096,2771,6607,6608,3638,2495,4768,6609,3861,6610,3269,2745,4769,4181,3553,6611,2845,3270,6612,6613,6614,3862,6615,6616,4770,4771,6617,3474,3999,4418,4419,6618,3639,3344,6619,4772,4182,6620,2126,6621,6622,6623,4420,4773,6624,3018,6625,4774,3554,6626,4183,2025,3746,6627,4184,2707,6628,4421,4422,3097,1775,4185,3555,6629,6630,2868,6631,6632,4423,6633,6634,4424,2414,2533,2928,6635,4186,2387,6636,4775,6637,4187,6638,1891,4425,3202,3203,6639,6640,4776,6641,3345,6642,6643,3640,6644,3475,3346,3641,4e3,6645,3144,6646,3098,2812,4188,3642,3204,6647,3863,3476,6648,3864,6649,4426,4001,6650,6651,6652,2576,6653,4189,4777,6654,6655,6656,2846,6657,3477,3205,4002,6658,4003,6659,3347,2252,6660,6661,6662,4778,6663,6664,6665,6666,6667,6668,6669,4779,4780,2048,6670,3478,3099,6671,3556,3747,4004,6672,6673,6674,3145,4005,3748,6675,6676,6677,6678,6679,3408,6680,6681,6682,6683,3206,3207,6684,6685,4781,4427,6686,4782,4783,4784,6687,6688,6689,4190,6690,6691,3479,6692,2746,6693,4428,6694,6695,6696,6697,6698,6699,4785,6700,6701,3208,2727,6702,3146,6703,6704,3409,2196,6705,4429,6706,6707,6708,2534,1996,6709,6710,6711,2747,6712,6713,6714,4786,3643,6715,4430,4431,6716,3557,6717,4432,4433,6718,6719,6720,6721,3749,6722,4006,4787,6723,6724,3644,4788,4434,6725,6726,4789,2772,6727,6728,6729,6730,6731,2708,3865,2813,4435,6732,6733,4790,4791,3480,6734,6735,6736,6737,4436,3348,6738,3410,4007,6739,6740,4008,6741,6742,4792,3411,4191,6743,6744,6745,6746,6747,3866,6748,3750,6749,6750,6751,6752,6753,6754,6755,3867,6756,4009,6757,4793,4794,6758,2814,2987,6759,6760,6761,4437,6762,6763,6764,6765,3645,6766,6767,3481,4192,6768,3751,6769,6770,2174,6771,3868,3752,6772,6773,6774,4193,4795,4438,3558,4796,4439,6775,4797,6776,6777,4798,6778,4799,3559,4800,6779,6780,6781,3482,6782,2893,6783,6784,4194,4801,4010,6785,6786,4440,6787,4011,6788,6789,6790,6791,6792,6793,4802,6794,6795,6796,4012,6797,6798,6799,6800,3349,4803,3483,6801,4804,4195,6802,4013,6803,6804,4196,6805,4014,4015,6806,2847,3271,2848,6807,3484,6808,6809,6810,4441,6811,4442,4197,4443,3272,4805,6812,3412,4016,1579,6813,6814,4017,6815,3869,6816,2964,6817,4806,6818,6819,4018,3646,6820,6821,4807,4019,4020,6822,6823,3560,6824,6825,4021,4444,6826,4198,6827,6828,4445,6829,6830,4199,4808,6831,6832,6833,3870,3019,2458,6834,3753,3413,3350,6835,4809,3871,4810,3561,4446,6836,6837,4447,4811,4812,6838,2459,4448,6839,4449,6840,6841,4022,3872,6842,4813,4814,6843,6844,4815,4200,4201,4202,6845,4023,6846,6847,4450,3562,3873,6848,6849,4816,4817,6850,4451,4818,2139,6851,3563,6852,6853,3351,6854,6855,3352,4024,2709,3414,4203,4452,6856,4204,6857,6858,3874,3875,6859,6860,4819,6861,6862,6863,6864,4453,3647,6865,6866,4820,6867,6868,6869,6870,4454,6871,2869,6872,6873,4821,6874,3754,6875,4822,4205,6876,6877,6878,3648,4206,4455,6879,4823,6880,4824,3876,6881,3055,4207,6882,3415,6883,6884,6885,4208,4209,6886,4210,3353,6887,3354,3564,3209,3485,2652,6888,2728,6889,3210,3755,6890,4025,4456,6891,4825,6892,6893,6894,6895,4211,6896,6897,6898,4826,6899,6900,4212,6901,4827,6902,2773,3565,6903,4828,6904,6905,6906,6907,3649,3650,6908,2849,3566,6909,3567,3100,6910,6911,6912,6913,6914,6915,4026,6916,3355,4829,3056,4457,3756,6917,3651,6918,4213,3652,2870,6919,4458,6920,2438,6921,6922,3757,2774,4830,6923,3356,4831,4832,6924,4833,4459,3653,2507,6925,4834,2535,6926,6927,3273,4027,3147,6928,3568,6929,6930,6931,4460,6932,3877,4461,2729,3654,6933,6934,6935,6936,2175,4835,2630,4214,4028,4462,4836,4215,6937,3148,4216,4463,4837,4838,4217,6938,6939,2850,4839,6940,4464,6941,6942,6943,4840,6944,4218,3274,4465,6945,6946,2710,6947,4841,4466,6948,6949,2894,6950,6951,4842,6952,4219,3057,2871,6953,6954,6955,6956,4467,6957,2711,6958,6959,6960,3275,3101,4843,6961,3357,3569,6962,4844,6963,6964,4468,4845,3570,6965,3102,4846,3758,6966,4847,3878,4848,4849,4029,6967,2929,3879,4850,4851,6968,6969,1733,6970,4220,6971,6972,6973,6974,6975,6976,4852,6977,6978,6979,6980,6981,6982,3759,6983,6984,6985,3486,3487,6986,3488,3416,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,4853,6998,6999,4030,7e3,7001,3211,7002,7003,4221,7004,7005,3571,4031,7006,3572,7007,2614,4854,2577,7008,7009,2965,3655,3656,4855,2775,3489,3880,4222,4856,3881,4032,3882,3657,2730,3490,4857,7010,3149,7011,4469,4858,2496,3491,4859,2283,7012,7013,7014,2365,4860,4470,7015,7016,3760,7017,7018,4223,1917,7019,7020,7021,4471,7022,2776,4472,7023,7024,7025,7026,4033,7027,3573,4224,4861,4034,4862,7028,7029,1929,3883,4035,7030,4473,3058,7031,2536,3761,3884,7032,4036,7033,2966,2895,1968,4474,3276,4225,3417,3492,4226,2105,7034,7035,1754,2596,3762,4227,4863,4475,3763,4864,3764,2615,2777,3103,3765,3658,3418,4865,2296,3766,2815,7036,7037,7038,3574,2872,3277,4476,7039,4037,4477,7040,7041,4038,7042,7043,7044,7045,7046,7047,2537,7048,7049,7050,7051,7052,7053,7054,4478,7055,7056,3767,3659,4228,3575,7057,7058,4229,7059,7060,7061,3660,7062,3212,7063,3885,4039,2460,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,4866,3768,4867,7075,7076,7077,7078,4868,3358,3278,2653,7079,7080,4479,3886,7081,7082,4869,7083,7084,7085,7086,7087,7088,2538,7089,7090,7091,4040,3150,3769,4870,4041,2896,3359,4230,2930,7092,3279,7093,2967,4480,3213,4481,3661,7094,7095,7096,7097,7098,7099,7100,7101,7102,2461,3770,7103,7104,4231,3151,7105,7106,7107,4042,3662,7108,7109,4871,3663,4872,4043,3059,7110,7111,7112,3493,2988,7113,4873,7114,7115,7116,3771,4874,7117,7118,4232,4875,7119,3576,2336,4876,7120,4233,3419,4044,4877,4878,4482,4483,4879,4484,4234,7121,3772,4880,1045,3280,3664,4881,4882,7122,7123,7124,7125,4883,7126,2778,7127,4485,4486,7128,4884,3214,3887,7129,7130,3215,7131,4885,4045,7132,7133,4046,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4235,7144,4886,7145,7146,7147,4887,7148,7149,7150,4487,4047,4488,7151,7152,4888,4048,2989,3888,7153,3665,7154,4049,7155,7156,7157,7158,7159,7160,2931,4889,4890,4489,7161,2631,3889,4236,2779,7162,7163,4891,7164,3060,7165,1672,4892,7166,4893,4237,3281,4894,7167,7168,3666,7169,3494,7170,7171,4050,7172,7173,3104,3360,3420,4490,4051,2684,4052,7174,4053,7175,7176,7177,2253,4054,7178,7179,4895,7180,3152,3890,3153,4491,3216,7181,7182,7183,2968,4238,4492,4055,7184,2990,7185,2479,7186,7187,4493,7188,7189,7190,7191,7192,4896,7193,4897,2969,4494,4898,7194,3495,7195,7196,4899,4495,7197,3105,2731,7198,4900,7199,7200,7201,4056,7202,3361,7203,7204,4496,4901,4902,7205,4497,7206,7207,2315,4903,7208,4904,7209,4905,2851,7210,7211,3577,7212,3578,4906,7213,4057,3667,4907,7214,4058,2354,3891,2376,3217,3773,7215,7216,7217,7218,7219,4498,7220,4908,3282,2685,7221,3496,4909,2632,3154,4910,7222,2337,7223,4911,7224,7225,7226,4912,4913,3283,4239,4499,7227,2816,7228,7229,7230,7231,7232,7233,7234,4914,4500,4501,7235,7236,7237,2686,7238,4915,7239,2897,4502,7240,4503,7241,2516,7242,4504,3362,3218,7243,7244,7245,4916,7246,7247,4505,3363,7248,7249,7250,7251,3774,4506,7252,7253,4917,7254,7255,3284,2991,4918,4919,3219,3892,4920,3106,3497,4921,7256,7257,7258,4922,7259,4923,3364,4507,4508,4059,7260,4240,3498,7261,7262,4924,7263,2992,3893,4060,3220,7264,7265,7266,7267,7268,7269,4509,3775,7270,2817,7271,4061,4925,4510,3776,7272,4241,4511,3285,7273,7274,3499,7275,7276,7277,4062,4512,4926,7278,3107,3894,7279,7280,4927,7281,4513,7282,7283,3668,7284,7285,4242,4514,4243,7286,2058,4515,4928,4929,4516,7287,3286,4244,7288,4517,7289,7290,7291,3669,7292,7293,4930,4931,4932,2355,4933,7294,2633,4518,7295,4245,7296,7297,4519,7298,7299,4520,4521,4934,7300,4246,4522,7301,7302,7303,3579,7304,4247,4935,7305,4936,7306,7307,7308,7309,3777,7310,4523,7311,7312,7313,4248,3580,7314,4524,3778,4249,7315,3581,7316,3287,7317,3221,7318,4937,7319,7320,7321,7322,7323,7324,4938,4939,7325,4525,7326,7327,7328,4063,7329,7330,4940,7331,7332,4941,7333,4526,7334,3500,2780,1741,4942,2026,1742,7335,7336,3582,4527,2388,7337,7338,7339,4528,7340,4250,4943,7341,7342,7343,4944,7344,7345,7346,3020,7347,4945,7348,7349,7350,7351,3895,7352,3896,4064,3897,7353,7354,7355,4251,7356,7357,3898,7358,3779,7359,3780,3288,7360,7361,4529,7362,4946,4530,2027,7363,3899,4531,4947,3222,3583,7364,4948,7365,7366,7367,7368,4949,3501,4950,3781,4951,4532,7369,2517,4952,4252,4953,3155,7370,4954,4955,4253,2518,4533,7371,7372,2712,4254,7373,7374,7375,3670,4956,3671,7376,2389,3502,4065,7377,2338,7378,7379,7380,7381,3061,7382,4957,7383,7384,7385,7386,4958,4534,7387,7388,2993,7389,3062,7390,4959,7391,7392,7393,4960,3108,4961,7394,4535,7395,4962,3421,4536,7396,4963,7397,4964,1857,7398,4965,7399,7400,2176,3584,4966,7401,7402,3422,4537,3900,3585,7403,3782,7404,2852,7405,7406,7407,4538,3783,2654,3423,4967,4539,7408,3784,3586,2853,4540,4541,7409,3901,7410,3902,7411,7412,3785,3109,2327,3903,7413,7414,2970,4066,2932,7415,7416,7417,3904,3672,3424,7418,4542,4543,4544,7419,4968,7420,7421,4255,7422,7423,7424,7425,7426,4067,7427,3673,3365,4545,7428,3110,2559,3674,7429,7430,3156,7431,7432,3503,7433,3425,4546,7434,3063,2873,7435,3223,4969,4547,4548,2898,4256,4068,7436,4069,3587,3786,2933,3787,4257,4970,4971,3788,7437,4972,3064,7438,4549,7439,7440,7441,7442,7443,4973,3905,7444,2874,7445,7446,7447,7448,3021,7449,4550,3906,3588,4974,7450,7451,3789,3675,7452,2578,7453,4070,7454,7455,7456,4258,3676,7457,4975,7458,4976,4259,3790,3504,2634,4977,3677,4551,4260,7459,7460,7461,7462,3907,4261,4978,7463,7464,7465,7466,4979,4980,7467,7468,2213,4262,7469,7470,7471,3678,4981,7472,2439,7473,4263,3224,3289,7474,3908,2415,4982,7475,4264,7476,4983,2655,7477,7478,2732,4552,2854,2875,7479,7480,4265,7481,4553,4984,7482,7483,4266,7484,3679,3366,3680,2818,2781,2782,3367,3589,4554,3065,7485,4071,2899,7486,7487,3157,2462,4072,4555,4073,4985,4986,3111,4267,2687,3368,4556,4074,3791,4268,7488,3909,2783,7489,2656,1962,3158,4557,4987,1963,3159,3160,7490,3112,4988,4989,3022,4990,4991,3792,2855,7491,7492,2971,4558,7493,7494,4992,7495,7496,7497,7498,4993,7499,3426,4559,4994,7500,3681,4560,4269,4270,3910,7501,4075,4995,4271,7502,7503,4076,7504,4996,7505,3225,4997,4272,4077,2819,3023,7506,7507,2733,4561,7508,4562,7509,3369,3793,7510,3590,2508,7511,7512,4273,3113,2994,2616,7513,7514,7515,7516,7517,7518,2820,3911,4078,2748,7519,7520,4563,4998,7521,7522,7523,7524,4999,4274,7525,4564,3682,2239,4079,4565,7526,7527,7528,7529,5e3,7530,7531,5001,4275,3794,7532,7533,7534,3066,5002,4566,3161,7535,7536,4080,7537,3162,7538,7539,4567,7540,7541,7542,7543,7544,7545,5003,7546,4568,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,5004,7557,7558,7559,5005,7560,3795,7561,4569,7562,7563,7564,2821,3796,4276,4277,4081,7565,2876,7566,5006,7567,7568,2900,7569,3797,3912,7570,7571,7572,4278,7573,7574,7575,5007,7576,7577,5008,7578,7579,4279,2934,7580,7581,5009,7582,4570,7583,4280,7584,7585,7586,4571,4572,3913,7587,4573,3505,7588,5010,7589,7590,7591,7592,3798,4574,7593,7594,5011,7595,4281,7596,7597,7598,4282,5012,7599,7600,5013,3163,7601,5014,7602,3914,7603,7604,2734,4575,4576,4577,7605,7606,7607,7608,7609,3506,5015,4578,7610,4082,7611,2822,2901,2579,3683,3024,4579,3507,7612,4580,7613,3226,3799,5016,7614,7615,7616,7617,7618,7619,7620,2995,3290,7621,4083,7622,5017,7623,7624,7625,7626,7627,4581,3915,7628,3291,7629,5018,7630,7631,7632,7633,4084,7634,7635,3427,3800,7636,7637,4582,7638,5019,4583,5020,7639,3916,7640,3801,5021,4584,4283,7641,7642,3428,3591,2269,7643,2617,7644,4585,3592,7645,4586,2902,7646,7647,3227,5022,7648,4587,7649,4284,7650,7651,7652,4588,2284,7653,5023,7654,7655,7656,4589,5024,3802,7657,7658,5025,3508,4590,7659,7660,7661,1969,5026,7662,7663,3684,1821,2688,7664,2028,2509,4285,7665,2823,1841,7666,2689,3114,7667,3917,4085,2160,5027,5028,2972,7668,5029,7669,7670,7671,3593,4086,7672,4591,4087,5030,3803,7673,7674,7675,7676,7677,7678,7679,4286,2366,4592,4593,3067,2328,7680,7681,4594,3594,3918,2029,4287,7682,5031,3919,3370,4288,4595,2856,7683,3509,7684,7685,5032,5033,7686,7687,3804,2784,7688,7689,7690,7691,3371,7692,7693,2877,5034,7694,7695,3920,4289,4088,7696,7697,7698,5035,7699,5036,4290,5037,5038,5039,7700,7701,7702,5040,5041,3228,7703,1760,7704,5042,3229,4596,2106,4089,7705,4597,2824,5043,2107,3372,7706,4291,4090,5044,7707,4091,7708,5045,3025,3805,4598,4292,4293,4294,3373,7709,4599,7710,5046,7711,7712,5047,5048,3806,7713,7714,7715,5049,7716,7717,7718,7719,4600,5050,7720,7721,7722,5051,7723,4295,3429,7724,7725,7726,7727,3921,7728,3292,5052,4092,7729,7730,7731,7732,7733,7734,7735,5053,5054,7736,7737,7738,7739,3922,3685,7740,7741,7742,7743,2635,5055,7744,5056,4601,7745,7746,2560,7747,7748,7749,7750,3923,7751,7752,7753,7754,7755,4296,2903,7756,7757,7758,7759,7760,3924,7761,5057,4297,7762,7763,5058,4298,7764,4093,7765,7766,5059,3925,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,3595,7777,4299,5060,4094,7778,3293,5061,7779,7780,4300,7781,7782,4602,7783,3596,7784,7785,3430,2367,7786,3164,5062,5063,4301,7787,7788,4095,5064,5065,7789,3374,3115,7790,7791,7792,7793,7794,7795,7796,3597,4603,7797,7798,3686,3116,3807,5066,7799,7800,5067,7801,7802,4604,4302,5068,4303,4096,7803,7804,3294,7805,7806,5069,4605,2690,7807,3026,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,3926,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271];var i0={};i0.EUCTW_TYPICAL_DISTRIBUTION_RATIO=.75;i0.EUCTW_TABLE_SIZE=8102;i0.EUCTWCharToFreqOrder=[1,1800,1506,255,1431,198,9,82,6,7310,177,202,3615,1256,2808,110,3735,33,3241,261,76,44,2113,16,2931,2184,1176,659,3868,26,3404,2643,1198,3869,3313,4060,410,2211,302,590,361,1963,8,204,58,4296,7311,1931,63,7312,7313,317,1614,75,222,159,4061,2412,1480,7314,3500,3068,224,2809,3616,3,10,3870,1471,29,2774,1135,2852,1939,873,130,3242,1123,312,7315,4297,2051,507,252,682,7316,142,1914,124,206,2932,34,3501,3173,64,604,7317,2494,1976,1977,155,1990,645,641,1606,7318,3405,337,72,406,7319,80,630,238,3174,1509,263,939,1092,2644,756,1440,1094,3406,449,69,2969,591,179,2095,471,115,2034,1843,60,50,2970,134,806,1868,734,2035,3407,180,995,1607,156,537,2893,688,7320,319,1305,779,2144,514,2374,298,4298,359,2495,90,2707,1338,663,11,906,1099,2545,20,2436,182,532,1716,7321,732,1376,4062,1311,1420,3175,25,2312,1056,113,399,382,1949,242,3408,2467,529,3243,475,1447,3617,7322,117,21,656,810,1297,2295,2329,3502,7323,126,4063,706,456,150,613,4299,71,1118,2036,4064,145,3069,85,835,486,2114,1246,1426,428,727,1285,1015,800,106,623,303,1281,7324,2127,2354,347,3736,221,3503,3110,7325,1955,1153,4065,83,296,1199,3070,192,624,93,7326,822,1897,2810,3111,795,2064,991,1554,1542,1592,27,43,2853,859,139,1456,860,4300,437,712,3871,164,2392,3112,695,211,3017,2096,195,3872,1608,3504,3505,3618,3873,234,811,2971,2097,3874,2229,1441,3506,1615,2375,668,2076,1638,305,228,1664,4301,467,415,7327,262,2098,1593,239,108,300,200,1033,512,1247,2077,7328,7329,2173,3176,3619,2673,593,845,1062,3244,88,1723,2037,3875,1950,212,266,152,149,468,1898,4066,4302,77,187,7330,3018,37,5,2972,7331,3876,7332,7333,39,2517,4303,2894,3177,2078,55,148,74,4304,545,483,1474,1029,1665,217,1869,1531,3113,1104,2645,4067,24,172,3507,900,3877,3508,3509,4305,32,1408,2811,1312,329,487,2355,2247,2708,784,2674,4,3019,3314,1427,1788,188,109,499,7334,3620,1717,1789,888,1217,3020,4306,7335,3510,7336,3315,1520,3621,3878,196,1034,775,7337,7338,929,1815,249,439,38,7339,1063,7340,794,3879,1435,2296,46,178,3245,2065,7341,2376,7342,214,1709,4307,804,35,707,324,3622,1601,2546,140,459,4068,7343,7344,1365,839,272,978,2257,2572,3409,2128,1363,3623,1423,697,100,3071,48,70,1231,495,3114,2193,7345,1294,7346,2079,462,586,1042,3246,853,256,988,185,2377,3410,1698,434,1084,7347,3411,314,2615,2775,4308,2330,2331,569,2280,637,1816,2518,757,1162,1878,1616,3412,287,1577,2115,768,4309,1671,2854,3511,2519,1321,3737,909,2413,7348,4069,933,3738,7349,2052,2356,1222,4310,765,2414,1322,786,4311,7350,1919,1462,1677,2895,1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070,309,1369,1130,2812,364,2230,1653,1299,3881,3512,3882,3883,2646,525,1085,3021,902,2e3,1475,964,4313,421,1844,1415,1057,2281,940,1364,3116,376,4314,4315,1381,7,2520,983,2378,336,1710,2675,1845,321,3414,559,1131,3022,2742,1808,1132,1313,265,1481,1857,7352,352,1203,2813,3247,167,1089,420,2814,776,792,1724,3513,4071,2438,3248,7353,4072,7354,446,229,333,2743,901,3739,1200,1557,4316,2647,1920,395,2744,2676,3740,4073,1835,125,916,3178,2616,4317,7355,7356,3741,7357,7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145,438,2591,2896,2379,3317,1068,958,3023,461,311,2855,2677,4074,1915,3179,4075,1978,383,750,2745,2617,4076,274,539,385,1278,1442,7361,1154,1964,384,561,210,98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257,129,7363,3742,642,523,2776,2777,2648,7364,141,2231,1333,68,176,441,876,907,4077,603,2592,710,171,3417,404,549,18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320,7366,2973,368,7367,146,366,99,871,3627,1543,748,807,1586,1185,22,2258,379,3743,3180,7368,3181,505,1941,2618,1991,1382,2314,7369,380,2357,218,702,1817,1248,3418,3024,3517,3318,3249,7370,2974,3628,930,3250,3744,7371,59,7372,585,601,4078,497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374,749,1836,690,1899,3745,1772,3885,1476,429,1043,1790,2232,2116,917,4079,447,1086,1629,7375,556,7376,7377,2020,1654,844,1090,105,550,966,1758,2815,1008,1782,686,1095,7378,2282,793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746,980,2496,544,353,527,4324,908,2678,2899,7380,381,2619,1942,1348,7381,1341,1252,560,3072,7382,3420,2856,7383,2053,973,886,2080,143,4325,7384,7385,157,3886,496,4081,57,840,540,2038,4326,4327,3421,2117,1445,970,2259,1748,1965,2081,4082,3119,1234,1775,3251,2816,3629,773,1206,2129,1066,2039,1326,3887,1738,1725,4083,279,3120,51,1544,2594,423,1578,2130,2066,173,4328,1879,7386,7387,1583,264,610,3630,4329,2439,280,154,7388,7389,7390,1739,338,1282,3073,693,2857,1411,1074,3747,2440,7391,4330,7392,7393,1240,952,2394,7394,2900,1538,2679,685,1483,4084,2468,1436,953,4085,2054,4331,671,2395,79,4086,2441,3252,608,567,2680,3422,4087,4088,1691,393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672,3748,3182,1464,522,1119,661,1150,216,675,4333,3888,1432,3519,609,4334,2681,2397,7400,7401,7402,4089,3025,0,7403,2469,315,231,2442,301,3319,4335,2380,7404,233,4090,3631,1818,4336,4337,7405,96,1776,1315,2082,7406,257,7407,1809,3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074,363,1655,3183,7409,2975,7410,7411,7412,3889,1567,3890,718,103,3184,849,1443,341,3320,2934,1484,7413,1712,127,67,339,4092,2398,679,1412,821,7414,7415,834,738,351,2976,2146,846,235,1497,1880,418,1992,3749,2710,186,1100,2147,2746,3520,1545,1355,2935,2858,1377,583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358,78,3750,3751,267,1289,2099,2001,1594,4094,348,369,1274,2194,2175,1837,4338,1820,2817,3635,2747,2283,2002,4339,2936,2748,144,3321,882,4340,3892,2749,3423,4341,2901,7417,4095,1726,320,7418,3893,3026,788,2978,7419,2818,1773,1327,2859,3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650,787,2022,506,824,3636,534,323,4343,1044,3322,2023,1900,946,3424,7421,1778,1500,1678,7422,1881,4344,165,243,4345,3637,2521,123,683,4096,764,4346,36,3895,1792,589,2902,816,626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932,891,2083,2903,304,4097,7424,292,2979,2711,3522,691,2100,4098,1115,4347,118,662,7425,611,1156,854,2381,1316,2861,2,386,515,2904,7426,7427,3253,868,2234,1486,855,2651,785,2212,3028,7428,1040,3185,3523,7429,3121,448,7430,1525,7431,2164,4348,7432,3754,7433,4099,2820,3524,3122,503,818,3898,3123,1568,814,676,1444,306,1749,7434,3755,1416,1030,197,1428,805,2821,1501,4349,7435,7436,7437,1993,7438,4350,7439,7440,2195,13,2779,3638,2980,3124,1229,1916,7441,3756,2131,7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445,646,3757,2443,307,7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451,519,7452,128,2132,92,2284,1979,7453,3900,1512,342,3125,2196,7454,2780,2214,1980,3323,7455,290,1656,1317,789,827,2360,7456,3758,4352,562,581,3901,7457,401,4353,2248,94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459,828,1105,4101,1262,1394,7460,4102,605,4356,7461,1783,2862,7462,2822,819,2101,578,2197,2937,7463,1502,436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466,2332,2067,23,4357,193,826,3759,2102,699,1630,4104,3075,390,1793,1064,3526,7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359,137,4106,598,3078,1966,780,104,974,2938,7470,278,899,253,402,572,504,493,1339,7471,3903,1275,4360,2574,2550,7472,3640,3029,3079,2249,565,1334,2713,863,41,7473,7474,4361,7475,1657,2333,19,463,2750,4107,606,7476,2981,3256,1087,2084,1323,2652,2982,7477,1631,1623,1750,4108,2682,7478,2864,791,2714,2653,2334,232,2416,7479,2983,1498,7480,2654,2620,755,1366,3641,3257,3126,2025,1609,119,1917,3427,862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125,817,4110,4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485,2683,733,40,1632,1106,2865,345,4113,841,2524,230,4364,2984,1846,3259,3428,7486,1263,986,3429,7487,735,879,254,1137,857,622,1300,1180,1388,1562,3907,3908,2939,967,2751,2655,1349,592,2133,1692,3324,2985,1994,4114,1679,3909,1901,2185,7488,739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870,2752,2986,7490,435,7491,343,1108,596,17,1751,4365,2235,3430,3643,7492,4366,294,3527,2940,1693,477,979,281,2041,3528,643,2042,3644,2621,2782,2261,1031,2335,2134,2298,3529,4367,367,1249,2552,7493,3530,7494,4368,1283,3325,2004,240,1762,3326,4369,4370,836,1069,3128,474,7495,2148,2525,268,3531,7496,3188,1521,1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118,961,1673,2622,190,2005,2200,3762,4371,4372,7500,570,2497,3645,1490,7501,4373,2623,3260,1956,4374,584,1514,396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910,619,7505,3129,3261,215,2006,2783,2553,3189,4377,3190,4378,763,4119,3763,4379,7506,7507,1957,1767,2941,3328,3646,1174,452,1477,4380,3329,3130,7508,2825,1253,2382,2186,1091,2285,4120,492,7509,638,1169,1824,2135,1752,3911,648,926,1021,1324,4381,520,4382,997,847,1007,892,4383,3764,2262,1871,3647,7510,2400,1784,4384,1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551,30,2263,4122,7511,2026,4386,3534,7512,501,7513,4123,594,3431,2165,1821,3535,3432,3536,3192,829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388,4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389,374,3914,652,4128,4129,375,1140,798,7520,7521,7522,2361,4390,2264,546,1659,138,3031,2445,4391,7523,2250,612,1848,910,796,3765,1740,1371,825,3766,3767,7524,2906,2554,7525,692,444,3032,2624,801,4392,4130,7526,1491,244,1053,3033,4131,4132,340,7527,3915,1041,2987,293,1168,87,1357,7528,1539,959,7529,2236,721,694,4133,3768,219,1478,644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825,730,1515,184,2827,66,4393,7532,1660,2943,246,3332,378,1457,226,3433,975,3917,2944,1264,3537,674,696,7533,163,7534,1141,2417,2166,713,3538,3333,4394,3918,7535,7536,1186,15,7537,1079,1070,7538,1522,3193,3539,276,1050,2716,758,1126,653,2945,3263,7539,2337,889,3540,3919,3081,2989,903,1250,4395,3920,3434,3541,1342,1681,1718,766,3264,286,89,2946,3649,7540,1713,7541,2597,3334,2990,7542,2947,2215,3194,2866,7543,4396,2498,2526,181,387,1075,3921,731,2187,3335,7544,3265,310,313,3435,2299,770,4134,54,3034,189,4397,3082,3769,3922,7545,1230,1617,1849,355,3542,4135,4398,3336,111,4136,3650,1350,3135,3436,3035,4137,2149,3266,3543,7546,2784,3923,3924,2991,722,2008,7547,1071,247,1207,2338,2471,1378,4399,2009,864,1437,1214,4400,373,3770,1142,2216,667,4401,442,2753,2555,3771,3925,1968,4138,3267,1839,837,170,1107,934,1336,1882,7548,7549,2118,4139,2828,743,1569,7550,4402,4140,582,2384,1418,3437,7551,1802,7552,357,1395,1729,3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554,482,2446,4404,7555,7556,1492,833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652,4142,1686,1794,416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867,4405,1610,1584,3036,2419,2754,443,3269,1163,3136,7561,7562,3926,7563,4143,2499,3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145,431,3438,7565,250,97,81,4146,7566,1648,1850,1558,160,848,7567,866,740,1694,7568,2201,2830,3195,4147,4407,3653,1687,950,2472,426,469,3196,3654,3655,3928,7569,7570,1188,424,1995,861,3546,4148,3775,2202,2685,168,1235,3547,4149,7571,2086,1674,4408,3337,3270,220,2557,1009,7572,3776,670,2992,332,1208,717,7573,7574,3548,2447,3929,3338,7575,513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527,3656,3549,815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932,1741,3933,3778,3934,7582,236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411,7585,308,7586,4412,245,4413,1851,2473,1307,2575,430,715,2136,2449,7587,270,199,2869,3935,7588,3551,2718,1753,761,1754,725,1661,1840,4414,3440,3658,7589,7590,587,14,3272,227,2598,326,480,2265,943,2755,3552,291,650,1883,7591,1702,1226,102,1547,62,3441,904,4415,3442,1164,4150,7592,7593,1224,1548,2756,391,498,1493,7594,1386,1419,7595,2055,1177,4416,813,880,1081,2363,566,1145,4417,2286,1001,1035,2558,2599,2238,394,1286,7596,7597,2068,7598,86,1494,1730,3936,491,1588,745,897,2948,843,3340,3937,2757,2870,3273,1768,998,2217,2069,397,1826,1195,1969,3659,2993,3341,284,7599,3782,2500,2137,2119,1903,7600,3938,2150,3939,4151,1036,3443,1904,114,2559,4152,209,1527,7601,7602,2949,2831,2625,2385,2719,3139,812,2560,7603,3274,7604,1559,737,1884,3660,1210,885,28,2686,3553,3783,7605,4153,1004,1779,4418,7606,346,1981,2218,2687,4419,3784,1742,797,1642,3940,1933,1072,1384,2151,896,3941,3275,3661,3197,2871,3554,7607,2561,1958,4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528,2600,161,1178,4156,1982,987,4423,1101,4157,631,3943,1157,3198,2420,1343,1241,1016,2239,2562,372,877,2339,2501,1160,555,1934,911,3944,7611,466,1170,169,1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612,992,2340,3444,1540,2721,1201,2070,2401,1996,2475,7613,4424,528,1922,2188,1503,1873,1570,2364,3342,3276,7614,557,1073,7615,1827,3445,2087,2266,3140,3039,3084,767,3085,2786,4425,1006,4158,4426,2341,1267,2176,3664,3199,778,3945,3200,2722,1597,2657,7616,4427,7617,3446,7618,7619,7620,3277,2689,1433,3278,131,95,1504,3946,723,4159,3141,1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949,4160,2576,248,1634,3785,912,7623,2832,3666,3040,3786,654,53,7624,2996,7625,1688,4428,777,3447,1032,3950,1425,7626,191,820,2120,2833,971,4429,931,3202,135,664,783,3787,1997,772,2908,1935,3951,3788,4430,2909,3203,282,2723,640,1372,3448,1127,922,325,3344,7627,7628,711,2044,7629,7630,3952,2219,2787,1936,3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955,3956,7632,2221,258,3205,4432,101,1227,7633,3280,1755,7634,1391,3281,7635,2910,2056,893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642,878,1325,1780,2788,4433,259,1385,2577,744,1183,2267,4434,7643,3957,2502,7644,684,1024,4162,7645,472,3557,3449,1165,3282,3958,3959,322,2152,881,455,1695,1152,1340,660,554,2153,4435,1058,4436,4163,830,1065,3346,3960,4437,1923,7646,1703,1918,7647,932,2268,122,7648,4438,947,677,7649,3791,2627,297,1905,1924,2269,4439,2317,3283,7650,7651,4164,7652,4165,84,4166,112,989,7653,547,1059,3961,701,3558,1019,7654,4167,7655,3450,942,639,457,2301,2451,993,2951,407,851,494,4440,3347,927,7656,1237,7657,2421,3348,573,4168,680,921,2911,1279,1874,285,790,1448,1983,719,2167,7658,7659,4441,3962,3963,1649,7660,1541,563,7661,1077,7662,3349,3041,3451,511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443,7663,535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169,1238,2578,3086,1259,7665,700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906,4444,2601,3967,781,2422,132,1589,203,147,273,2789,2402,898,1786,2154,3968,3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793,965,7673,1804,2690,1516,3559,1121,1082,1329,3284,3970,1449,3794,65,1128,2835,2913,2759,1590,3795,7674,7675,12,2658,45,976,2579,3144,4447,517,2528,1013,1037,3209,7676,3796,2836,7677,3797,7678,3452,7679,2602,614,1998,2318,3798,3087,2724,2628,7680,2580,4172,599,1269,7681,1810,3669,7682,2691,3088,759,1060,489,1805,3351,3285,1358,7683,7684,2386,1387,1215,2629,2252,490,7685,7686,4173,1759,2387,2343,7687,4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344,874,7688,7689,3454,3670,1858,91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403,3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973,2365,4453,7694,2029,7695,7696,3974,2693,1216,237,2581,4174,2319,3975,3802,4454,4455,2694,3560,3457,445,4456,7697,7698,7699,7700,2761,61,3976,3672,1822,3977,7701,687,2045,935,925,405,2660,703,1096,1859,2725,4457,3978,1876,1367,2695,3352,918,2105,1781,2476,334,3287,1611,1093,4458,564,3146,3458,3673,3353,945,2631,2057,4459,7702,1925,872,4175,7703,3459,2696,3089,349,4176,3674,3979,4460,3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046,782,3981,400,251,4179,1624,7704,7705,277,3676,299,1265,476,1191,3804,2121,4180,4181,1109,205,7706,2582,1e3,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565,107,2477,2157,3982,3460,3147,7711,1533,541,1301,158,753,4182,2872,3562,7712,1696,370,1088,4183,4466,3563,579,327,440,162,2240,269,1937,1374,3461,968,3043,56,1396,3090,2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717,2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985,7722,1076,49,7723,951,3211,3289,3290,450,2837,920,7724,1811,2792,2366,4184,1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472,2388,2604,260,1795,3213,7727,7728,3808,3291,708,7729,3565,1704,7730,3566,1351,1618,3357,2999,1886,944,4185,3358,4186,3044,3359,4187,7731,3678,422,413,1714,3292,500,2058,2345,4188,2479,7732,1344,1910,954,7733,1668,7734,7735,3986,2404,4189,3567,3809,4190,7736,2302,1318,2505,3091,133,3092,2873,4473,629,31,2838,2697,3810,4474,850,949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988,620,3214,981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738,3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743,869,2839,655,3811,3812,3094,3989,3e3,3813,1310,3569,4477,7744,7745,7746,1733,558,4478,3681,335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192,470,2726,2107,2793,913,1054,3990,7747,1027,7748,3046,3991,4479,982,2662,3362,3148,3465,3216,3217,1946,2794,7749,571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089,984,4481,3683,1959,7753,3684,852,923,2795,3466,3685,969,1519,999,2048,2320,1705,7754,3095,615,1662,151,597,3992,2405,2321,1049,275,4482,3686,4193,568,3687,3571,2480,4194,3688,7755,2425,2270,409,3218,7756,1566,2874,3467,1002,769,2840,194,2090,3149,3689,2222,3294,4195,628,1505,7757,7758,1763,2177,3001,3993,521,1161,2584,1787,2203,2406,4483,3994,1625,4196,4197,412,42,3096,464,7759,2632,4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295,1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091,460,7765,4487,7766,3002,962,588,3574,289,3219,2634,1116,52,7767,3047,1796,7768,7769,7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365,465,4489,1572,510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776,7777,4199,536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911,2796,7781,3296,1122,377,3220,7782,360,7783,7784,4200,1529,551,7785,2059,3693,1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404,136,1468,1479,672,1171,3221,2303,271,3151,7787,2762,7788,2049,678,2727,865,1947,4493,7789,2013,3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816,509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010,552,681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154,358,453,736,175,478,1117,905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473,3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298,2918,3049,2179,3474,595,2122,7800,3997,7801,7802,4206,1707,2636,223,3696,1359,751,3098,183,3475,7803,2797,3003,419,2369,633,704,3818,2389,241,7804,7805,7806,838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807,1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605,484,3698,7810,3999,625,4209,2273,3368,1499,4210,4e3,7811,4001,4211,3222,2274,2275,3476,7812,7813,2764,808,2606,3699,3369,4002,4212,3100,2532,526,3370,3821,4213,955,7814,1620,4214,2637,2427,7815,1429,3700,1669,1831,994,928,7816,3578,1260,7817,7818,7819,1948,2288,741,2919,1626,4215,2729,2455,867,1184,362,3371,1392,7820,7821,4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877,1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702,2483,3299,7824,3703,4501,7825,7826,666,1003,3005,1022,3579,4218,7827,4502,1813,2253,574,3822,1603,295,1535,705,3823,4219,283,858,417,7828,7829,3224,4503,4504,3051,1220,1889,1046,2276,2456,4004,1393,1599,689,2567,388,4220,7830,2484,802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833,809,7834,7835,7836,575,2730,3477,956,1552,1469,1144,2323,7837,2324,1560,2457,3580,3226,4005,616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704,3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826,607,2306,3827,762,2878,1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508,2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451,7851,7852,7853,7854,2922,4006,4007,2485,2346,411,4008,4009,3582,3300,3101,4509,1561,2664,1452,4010,1375,7855,7856,47,2959,316,7857,1406,1591,2923,3156,7858,1025,2141,3102,3157,354,2731,884,2224,4225,2407,508,3706,726,3583,996,2428,3584,729,7859,392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800,919,2347,2960,2348,1270,4511,4012,73,7862,7863,647,7864,3228,2843,2255,1550,1346,3006,7865,1332,883,3479,7866,7867,7868,7869,3301,2765,7870,1212,831,1347,4226,4512,2326,3830,1863,3053,720,3831,4513,4514,3832,7871,4227,7872,7873,4515,7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924,669,2208,2665,2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518,3158,518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833,516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961,1422,577,1470,3008,1524,3373,7892,7893,432,4232,3054,3480,7894,2586,1455,2508,2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482,2639,4016,4233,4521,2290,895,924,4234,2170,331,2243,3056,166,1627,3057,1098,7898,1232,2880,2227,3374,4522,657,403,1196,2372,542,3709,3375,1600,4235,3483,7899,4523,2767,3230,576,530,1362,7900,4524,2533,2666,3710,4017,7901,842,3834,7902,2801,2031,1014,4018,213,2700,3376,665,621,4236,7903,3711,2925,2430,7904,2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906,724,2277,600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909,651,4240,7910,1612,4241,2611,7911,2844,7912,2734,2307,3058,7913,716,2459,3059,174,1255,2701,4019,3590,548,1320,1398,728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062,3712,3591,3713,747,7916,635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922,3378,4530,2432,451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925,4246,350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024,488,4532,458,4248,4025,3715,771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487,2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015,2736,7932,1155,1017,3716,3836,7933,3303,2308,201,1864,4253,1430,7934,4026,7935,7936,7937,7938,7939,4254,1604,7940,414,1865,371,2587,4534,4535,3485,2016,3104,4536,1708,960,4255,887,389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580,7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380,2882,4256,7950,4257,2640,3381,2802,673,2703,2460,709,3486,4028,3593,4258,7951,1148,502,634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105,948,3232,121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488,4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803,531,2737,2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017,120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047,2704,1266,7965,1368,4543,2845,649,3383,3841,2539,2738,1102,2846,2669,7966,7967,1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385,2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460,856,7974,3600,7975,2885,2963,7976,2886,3843,7977,4264,632,2510,875,3844,1697,3845,2291,7978,7979,4544,3010,1239,580,4545,4265,7980,914,936,2074,1190,4032,1039,2123,7981,7982,7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033,915,3305,4267,4268,3306,1605,1834,7986,2739,398,3601,4269,3847,4034,328,1912,2847,4035,3848,1331,4270,3011,937,4271,7987,3602,4036,4037,3387,2160,4546,3388,524,742,538,3065,1012,7988,7989,3849,2461,7990,658,1103,225,3850,7991,7992,4547,7993,4548,7994,3236,1243,7995,4038,963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550,8e3,8001,8002,3489,3307,957,3389,2540,2032,1930,2927,2462,870,2018,3604,1746,2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066,8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292,977,2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689,714,4551,3491,8009,2328,3852,533,4273,3605,2181,617,8010,2464,3308,3492,2310,8011,8012,3165,8013,8014,3853,1987,618,427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552,8018,3494,8019,8020,2279,1576,473,3606,4275,3395,972,8021,3607,8022,3067,8023,8024,4553,4554,8025,3727,4041,4042,8026,153,4555,356,8027,1891,2888,4276,2143,408,803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278,8031,2411,3396,752,8032,8033,1961,2964,8034,746,3012,2465,8035,4279,3728,698,4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706,3858,1973,4281,8038,4282,3167,823,1303,1288,1236,2848,3495,4044,3398,774,3859,8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284,344,1173,288,2311,454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563,985,894,8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194,425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053,636,4565,1855,3861,760,1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210,479,8058,8059,832,8060,4049,2489,8061,2965,2490,3731,990,3109,627,1814,2642,4289,1582,4290,2125,2111,3496,4567,8062,799,4291,3170,8063,4568,2112,1737,3013,1018,543,754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889,4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239,1842,3610,1715,481,365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240,433,1894,2063,2075,8077,602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083,3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088,4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094,8095,1895,8096,8097,4580,1896,4054,318,8098,2094,4055,4293,8099,8100,485,8101,938,3862,553,2670,116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104,3613,2929,4056,1747,2930,2968,8105,8106,207,8107,8108,2672,4581,2514,8109,3015,890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114,941,2294,208,3499,4057,2019,330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118,2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122,2493,3016,3734,8123,8124,2192,8125,8126,2162,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741];var s0={};s0.EUCKR_TYPICAL_DISTRIBUTION_RATIO=6;s0.EUCKR_TABLE_SIZE=2352;s0.EUCKRCharToFreqOrder=[13,130,120,1396,481,1719,1720,328,609,212,1721,707,400,299,1722,87,1397,1723,104,536,1117,1203,1724,1267,685,1268,508,1725,1726,1727,1728,1398,1399,1729,1730,1731,141,621,326,1057,368,1732,267,488,20,1733,1269,1734,945,1400,1735,47,904,1270,1736,1737,773,248,1738,409,313,786,429,1739,116,987,813,1401,683,75,1204,145,1740,1741,1742,1743,16,847,667,622,708,1744,1745,1746,966,787,304,129,1747,60,820,123,676,1748,1749,1750,1751,617,1752,626,1753,1754,1755,1756,653,1757,1758,1759,1760,1761,1762,856,344,1763,1764,1765,1766,89,401,418,806,905,848,1767,1768,1769,946,1205,709,1770,1118,1771,241,1772,1773,1774,1271,1775,569,1776,999,1777,1778,1779,1780,337,751,1058,28,628,254,1781,177,906,270,349,891,1079,1782,19,1783,379,1784,315,1785,629,754,1402,559,1786,636,203,1206,1787,710,567,1788,935,814,1789,1790,1207,766,528,1791,1792,1208,1793,1794,1795,1796,1797,1403,1798,1799,533,1059,1404,1405,1156,1406,936,884,1080,1800,351,1801,1802,1803,1804,1805,801,1806,1807,1808,1119,1809,1157,714,474,1407,1810,298,899,885,1811,1120,802,1158,1812,892,1813,1814,1408,659,1815,1816,1121,1817,1818,1819,1820,1821,1822,319,1823,594,545,1824,815,937,1209,1825,1826,573,1409,1022,1827,1210,1828,1829,1830,1831,1832,1833,556,722,807,1122,1060,1834,697,1835,900,557,715,1836,1410,540,1411,752,1159,294,597,1211,976,803,770,1412,1837,1838,39,794,1413,358,1839,371,925,1840,453,661,788,531,723,544,1023,1081,869,91,1841,392,430,790,602,1414,677,1082,457,1415,1416,1842,1843,475,327,1024,1417,795,121,1844,733,403,1418,1845,1846,1847,300,119,711,1212,627,1848,1272,207,1849,1850,796,1213,382,1851,519,1852,1083,893,1853,1854,1855,367,809,487,671,1856,663,1857,1858,956,471,306,857,1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,282,96,574,1872,502,1085,1873,1214,1874,907,1875,1876,827,977,1419,1420,1421,268,1877,1422,1878,1879,1880,308,1881,2,537,1882,1883,1215,1884,1885,127,791,1886,1273,1423,1887,34,336,404,643,1888,571,654,894,840,1889,0,886,1274,122,575,260,908,938,1890,1275,410,316,1891,1892,100,1893,1894,1123,48,1161,1124,1025,1895,633,901,1276,1896,1897,115,816,1898,317,1899,694,1900,909,734,1424,572,866,1425,691,85,524,1010,543,394,841,1901,1902,1903,1026,1904,1905,1906,1907,1908,1909,30,451,651,988,310,1910,1911,1426,810,1216,93,1912,1913,1277,1217,1914,858,759,45,58,181,610,269,1915,1916,131,1062,551,443,1e3,821,1427,957,895,1086,1917,1918,375,1919,359,1920,687,1921,822,1922,293,1923,1924,40,662,118,692,29,939,887,640,482,174,1925,69,1162,728,1428,910,1926,1278,1218,1279,386,870,217,854,1163,823,1927,1928,1929,1930,834,1931,78,1932,859,1933,1063,1934,1935,1936,1937,438,1164,208,595,1938,1939,1940,1941,1219,1125,1942,280,888,1429,1430,1220,1431,1943,1944,1945,1946,1947,1280,150,510,1432,1948,1949,1950,1951,1952,1953,1954,1011,1087,1955,1433,1043,1956,881,1957,614,958,1064,1065,1221,1958,638,1001,860,967,896,1434,989,492,553,1281,1165,1959,1282,1002,1283,1222,1960,1961,1962,1963,36,383,228,753,247,454,1964,876,678,1965,1966,1284,126,464,490,835,136,672,529,940,1088,1435,473,1967,1968,467,50,390,227,587,279,378,598,792,968,240,151,160,849,882,1126,1285,639,1044,133,140,288,360,811,563,1027,561,142,523,1969,1970,1971,7,103,296,439,407,506,634,990,1972,1973,1974,1975,645,1976,1977,1978,1979,1980,1981,236,1982,1436,1983,1984,1089,192,828,618,518,1166,333,1127,1985,818,1223,1986,1987,1988,1989,1990,1991,1992,1993,342,1128,1286,746,842,1994,1995,560,223,1287,98,8,189,650,978,1288,1996,1437,1997,17,345,250,423,277,234,512,226,97,289,42,167,1998,201,1999,2e3,843,836,824,532,338,783,1090,182,576,436,1438,1439,527,500,2001,947,889,2002,2003,2004,2005,262,600,314,447,2006,547,2007,693,738,1129,2008,71,1440,745,619,688,2009,829,2010,2011,147,2012,33,948,2013,2014,74,224,2015,61,191,918,399,637,2016,1028,1130,257,902,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,837,2027,2028,2029,2030,179,874,591,52,724,246,2031,2032,2033,2034,1167,969,2035,1289,630,605,911,1091,1168,2036,2037,2038,1441,912,2039,623,2040,2041,253,1169,1290,2042,1442,146,620,611,577,433,2043,1224,719,1170,959,440,437,534,84,388,480,1131,159,220,198,679,2044,1012,819,1066,1443,113,1225,194,318,1003,1029,2045,2046,2047,2048,1067,2049,2050,2051,2052,2053,59,913,112,2054,632,2055,455,144,739,1291,2056,273,681,499,2057,448,2058,2059,760,2060,2061,970,384,169,245,1132,2062,2063,414,1444,2064,2065,41,235,2066,157,252,877,568,919,789,580,2067,725,2068,2069,1292,2070,2071,1445,2072,1446,2073,2074,55,588,66,1447,271,1092,2075,1226,2076,960,1013,372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085,850,2086,2087,2088,2089,2090,186,2091,1068,180,2092,2093,2094,109,1227,522,606,2095,867,1448,1093,991,1171,926,353,1133,2096,581,2097,2098,2099,1294,1449,1450,2100,596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,804,2118,2119,1230,1231,805,1456,405,1136,2120,2121,2122,2123,2124,720,701,1297,992,1457,927,1004,2125,2126,2127,2128,2129,2130,22,417,2131,303,2132,385,2133,971,520,513,2134,1174,73,1096,231,274,962,1458,673,2135,1459,2136,152,1137,2137,2138,2139,2140,1005,1138,1460,1139,2141,2142,2143,2144,11,374,844,2145,154,1232,46,1461,2146,838,830,721,1233,106,2147,90,428,462,578,566,1175,352,2148,2149,538,1234,124,1298,2150,1462,761,565,2151,686,2152,649,2153,72,173,2154,460,415,2155,1463,2156,1235,305,2157,2158,2159,2160,2161,2162,579,2163,2164,2165,2166,2167,747,2168,2169,2170,2171,1464,669,2172,2173,2174,2175,2176,1465,2177,23,530,285,2178,335,729,2179,397,2180,2181,2182,1030,2183,2184,698,2185,2186,325,2187,2188,369,2189,799,1097,1015,348,2190,1069,680,2191,851,1466,2192,2193,10,2194,613,424,2195,979,108,449,589,27,172,81,1031,80,774,281,350,1032,525,301,582,1176,2196,674,1045,2197,2198,1467,730,762,2199,2200,2201,2202,1468,2203,993,2204,2205,266,1070,963,1140,2206,2207,2208,664,1098,972,2209,2210,2211,1177,1469,1470,871,2212,2213,2214,2215,2216,1471,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,2234,2235,1299,2236,2237,200,2238,477,373,2239,2240,731,825,777,2241,2242,2243,521,486,548,2244,2245,2246,1473,1300,53,549,137,875,76,158,2247,1301,1474,469,396,1016,278,712,2248,321,442,503,767,744,941,1237,1178,1475,2249,82,178,1141,1179,973,2250,1302,2251,297,2252,2253,570,2254,2255,2256,18,450,206,2257,290,292,1142,2258,511,162,99,346,164,735,2259,1476,1477,4,554,343,798,1099,2260,1100,2261,43,171,1303,139,215,2262,2263,717,775,2264,1033,322,216,2265,831,2266,149,2267,1304,2268,2269,702,1238,135,845,347,309,2270,484,2271,878,655,238,1006,1478,2272,67,2273,295,2274,2275,461,2276,478,942,412,2277,1034,2278,2279,2280,265,2281,541,2282,2283,2284,2285,2286,70,852,1071,2287,2288,2289,2290,21,56,509,117,432,2291,2292,331,980,552,1101,148,284,105,393,1180,1239,755,2293,187,2294,1046,1479,2295,340,2296,63,1047,230,2297,2298,1305,763,1306,101,800,808,494,2299,2300,2301,903,2302,37,1072,14,5,2303,79,675,2304,312,2305,2306,2307,2308,2309,1480,6,1307,2310,2311,2312,1,470,35,24,229,2313,695,210,86,778,15,784,592,779,32,77,855,964,2314,259,2315,501,380,2316,2317,83,981,153,689,1308,1481,1482,1483,2318,2319,716,1484,2320,2321,2322,2323,2324,2325,1485,2326,2327,128,57,68,261,1048,211,170,1240,31,2328,51,435,742,2329,2330,2331,635,2332,264,456,2333,2334,2335,425,2336,1486,143,507,263,943,2337,363,920,1487,256,1488,1102,243,601,1489,2338,2339,2340,2341,2342,2343,2344,861,2345,2346,2347,2348,2349,2350,395,2351,1490,1491,62,535,166,225,2352,2353,668,419,1241,138,604,928,2354,1181,2355,1492,1493,2356,2357,2358,1143,2359,696,2360,387,307,1309,682,476,2361,2362,332,12,222,156,2363,232,2364,641,276,656,517,1494,1495,1035,416,736,1496,2365,1017,586,2366,2367,2368,1497,2369,242,2370,2371,2372,1498,2373,965,713,2374,2375,2376,2377,740,982,1499,944,1500,1007,2378,2379,1310,1501,2380,2381,2382,785,329,2383,2384,1502,2385,2386,2387,932,2388,1503,2389,2390,2391,2392,1242,2393,2394,2395,2396,2397,994,950,2398,2399,2400,2401,1504,1311,2402,2403,2404,2405,1049,749,2406,2407,853,718,1144,1312,2408,1182,1505,2409,2410,255,516,479,564,550,214,1506,1507,1313,413,239,444,339,1145,1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414,176,703,497,624,593,921,302,2415,341,165,1103,1512,2416,1513,2417,2418,2419,376,2420,700,2421,2422,2423,258,768,1316,2424,1183,2425,995,608,2426,2427,2428,2429,221,2430,2431,2432,2433,2434,2435,2436,2437,195,323,726,188,897,983,1317,377,644,1050,879,2438,452,2439,2440,2441,2442,2443,2444,914,2445,2446,2447,2448,915,489,2449,1514,1184,2450,2451,515,64,427,495,2452,583,2453,483,485,1038,562,213,1515,748,666,2454,2455,2456,2457,334,2458,780,996,1008,705,1243,2459,2460,2461,2462,2463,114,2464,493,1146,366,163,1516,961,1104,2465,291,2466,1318,1105,2467,1517,365,2468,355,951,1244,2469,1319,2470,631,2471,2472,218,1320,364,320,756,1518,1519,1321,1520,1322,2473,2474,2475,2476,997,2477,2478,2479,2480,665,1185,2481,916,1521,2482,2483,2484,584,684,2485,2486,797,2487,1051,1186,2488,2489,2490,1522,2491,2492,370,2493,1039,1187,65,2494,434,205,463,1188,2495,125,812,391,402,826,699,286,398,155,781,771,585,2496,590,505,1073,2497,599,244,219,917,1018,952,646,1523,2498,1323,2499,2500,49,984,354,741,2501,625,2502,1324,2503,1019,190,357,757,491,95,782,868,2504,2505,2506,2507,2508,2509,134,1524,1074,422,1525,898,2510,161,2511,2512,2513,2514,769,2515,1526,2516,2517,411,1325,2518,472,1527,2519,2520,2521,2522,2523,2524,985,2525,2526,2527,2528,2529,2530,764,2531,1245,2532,2533,25,204,311,2534,496,2535,1052,2536,2537,2538,2539,2540,2541,2542,199,704,504,468,758,657,1528,196,44,839,1246,272,750,2543,765,862,2544,2545,1326,2546,132,615,933,2547,732,2548,2549,2550,1189,1529,2551,283,1247,1053,607,929,2552,2553,2554,930,183,872,616,1040,1147,2555,1148,1020,441,249,1075,2556,2557,2558,466,743,2559,2560,2561,92,514,426,420,526,2562,2563,2564,2565,2566,2567,2568,185,2569,2570,2571,2572,776,1530,658,2573,362,2574,361,922,1076,793,2575,2576,2577,2578,2579,2580,1531,251,2581,2582,2583,2584,1532,54,612,237,1327,2585,2586,275,408,647,111,2587,1533,1106,465,3,458,9,38,2588,107,110,890,209,26,737,498,2589,1534,2590,431,202,88,1535,356,287,1107,660,1149,2591,381,1536,986,1150,445,1248,1151,974,2592,2593,846,2594,446,953,184,1249,1250,727,2595,923,193,883,2596,2597,2598,102,324,539,817,2599,421,1041,2600,832,2601,94,175,197,406,2602,459,2603,2604,2605,2606,2607,330,555,2608,2609,2610,706,1108,389,2611,2612,2613,2614,233,2615,833,558,931,954,1251,2616,2617,1537,546,2618,2619,1009,2620,2621,2622,1538,690,1328,2623,955,2624,1539,2625,2626,772,2627,2628,2629,2630,2631,924,648,863,603,2632,2633,934,1540,864,865,2634,642,1042,670,1190,2635,2636,2637,2638,168,2639,652,873,542,1054,1541,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,1542,880,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,1329,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3e3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,1152,3109,3110,3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,1585,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,1586,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850,3851,3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,3994,3995,3996,3997,3998,3999,4e3,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126,4127,1610,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,4221,4222,4223,4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,1619,4417,4418,4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,4537,4538,4539,4540,4541,4542,4543,975,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,1640,4884,4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644,4981,4982,4983,4984,1645,4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5e3,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,5250,5251,1658,1263,5252,5253,5254,5255,5256,1375,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,1377,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,5730,5731,5732,5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,1678,5774,5775,5776,998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,6303,6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,1266,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,1202,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7e3,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741];var a0={};a0.GB2312_TYPICAL_DISTRIBUTION_RATIO=.9;a0.GB2312_TABLE_SIZE=3760;a0.GB2312CharToFreqOrder=[1671,749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515,572,3191,2205,2361,224,2558,479,1711,963,3162,440,4060,1905,2966,2947,3580,2647,3961,3842,2204,869,4207,970,2678,5626,2944,2956,1479,4048,514,3595,588,1346,2820,3409,249,4088,1746,1873,2047,1774,581,1813,358,1174,3590,1014,1561,4844,2245,670,1636,3112,889,1286,953,556,2327,3060,1290,3141,613,185,3477,1367,850,3820,1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349,388,3098,2091,1360,3585,152,1687,1539,738,1559,59,1232,2925,2267,1388,1249,1741,1679,2960,151,1566,1125,1352,4271,924,4296,385,3166,4459,310,1245,2850,70,3285,2729,3534,3575,2398,3298,3466,1960,2265,217,3647,864,1909,2084,4401,2773,1010,3269,5152,853,3051,3121,1244,4251,1895,364,1499,1540,2313,1180,3655,2268,562,715,2417,3061,544,336,3768,2380,1752,4075,950,280,2425,4382,183,2759,3272,333,4297,2155,1688,2356,1444,1039,4540,736,1177,3349,2443,2368,2144,2225,565,196,1482,3406,927,1335,4147,692,878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,2534,1546,2393,2760,737,2494,13,447,245,2747,38,2765,2129,2589,1079,606,360,471,3755,2890,404,848,699,1785,1236,370,2221,1023,3746,2074,2026,2023,2388,1581,2119,812,1141,3091,2536,1519,804,2053,406,1596,1090,784,548,4414,1806,2264,2936,1100,343,4114,5096,622,3358,743,3668,1510,1626,5020,3567,2513,3195,4115,5627,2489,2991,24,2065,2697,1087,2719,48,1634,315,68,985,2052,198,2239,1347,1107,1439,597,2366,2172,871,3307,919,2487,2790,1867,236,2570,1413,3794,906,3365,3381,1701,1982,1818,1524,2924,1205,616,2586,2072,2004,575,253,3099,32,1365,1182,197,1714,2454,1201,554,3388,3224,2748,756,2587,250,2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153,615,911,1506,1474,2495,1265,1906,2749,3756,3280,2161,898,2714,1759,3450,2243,2444,563,26,3286,2266,3769,3344,2707,3677,611,1402,531,1028,2871,4548,1375,261,2948,835,1190,4134,353,840,2684,1900,3082,1435,2109,1207,1674,329,1872,2781,4055,2686,2104,608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,1681,1153,225,1627,2929,162,2050,2511,3687,1954,124,1859,2431,1684,3032,2894,585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209,256,518,2042,2105,3777,3657,643,2298,1148,1779,190,989,3544,414,11,2135,2063,2979,1471,403,3678,126,770,1563,671,2499,3216,2877,600,1179,307,2805,4937,1268,1297,2694,252,4032,1448,1494,1331,1394,127,2256,222,1647,1035,1481,3056,1915,1048,873,3651,210,33,1608,2516,200,1520,415,102,0,3389,1287,817,91,3299,2940,836,1814,549,2197,1396,1669,2987,3582,2297,2848,4528,1070,687,20,1819,121,1552,1364,1461,1968,2617,3540,2824,2083,177,948,4938,2291,110,4549,2066,648,3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123,208,1804,3159,2992,2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,72,842,1990,212,1233,1154,1586,75,2027,3410,4900,1823,1337,2710,2676,728,2810,1522,3026,4995,157,755,1050,4022,710,785,1936,2194,2085,1406,2777,2400,150,1250,4049,1206,807,1910,534,529,3309,1721,1660,274,39,2827,661,2670,1578,925,3248,3815,1094,4278,4901,4252,41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,887,538,4187,3199,1294,2439,3042,2329,2343,2497,1255,107,543,1527,521,3478,3568,194,5062,15,961,3870,1241,1192,2664,66,5215,3260,2111,1295,1127,2152,3805,4135,901,1164,1976,398,1278,530,1460,748,904,1054,1966,1426,53,2909,509,523,2279,1534,536,1019,239,1685,460,2353,673,1065,2401,3600,4298,2272,1272,2363,284,1753,3679,4064,1695,81,815,2677,2757,2731,1386,859,500,4221,2190,2566,757,1006,2519,2068,1166,1455,337,2654,3203,1863,1682,1914,3025,1252,1409,1366,847,714,2834,2038,3209,964,2970,1901,885,2553,1078,1756,3049,301,1572,3326,688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088,262,1158,1254,389,1641,1812,526,1719,923,2073,1073,1902,468,489,4625,1140,857,2375,3070,3319,2863,380,116,1328,2693,1161,2244,273,1212,1884,2769,3011,1775,1142,461,3066,1200,2147,2212,790,702,2695,4222,1601,1058,434,2338,5153,3640,67,2360,4099,2502,618,3472,1329,416,1132,830,2782,1807,2653,3211,3510,1662,192,2124,296,3979,1739,1611,3684,23,118,324,446,1239,1225,293,2520,3814,3795,2535,3116,17,1074,467,2692,2201,387,2922,45,1326,3055,1645,3659,2817,958,243,1903,2320,1339,2825,1784,3289,356,576,865,2315,2381,3377,3916,1088,3122,1713,1655,935,628,4689,1034,1327,441,800,720,894,1979,2183,1528,5289,2702,1071,4046,3572,2399,1571,3281,79,761,1103,327,134,758,1899,1371,1615,879,442,215,2605,2579,173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,814,4968,3487,1548,2644,1567,1285,2,295,2636,97,946,3576,832,141,4257,3273,760,3821,3521,3156,2607,949,1024,1733,1516,1803,1920,2125,2283,2665,3180,1501,2064,3560,2171,1592,803,3518,1416,732,3897,4258,1363,1362,2458,119,1427,602,1525,2608,1605,1639,3175,694,3064,10,465,76,2e3,4846,4208,444,3781,1619,3353,2206,1273,3796,740,2483,320,1723,2377,3660,2619,1359,1137,1762,1724,2345,2842,1850,1862,912,821,1866,612,2625,1735,2573,3369,1093,844,89,937,930,1424,3564,2413,2972,1004,3046,3019,2011,711,3171,1452,4178,428,801,1943,432,445,2811,206,4136,1472,730,349,73,397,2802,2547,998,1637,1167,789,396,3217,154,1218,716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627,552,3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703,640,1045,1370,1246,4996,371,1575,2436,1621,2210,984,4033,1734,2638,16,4529,663,2755,3255,1451,3917,2257,1253,1955,2234,1263,2951,214,1229,617,485,359,1831,1969,473,2310,750,2058,165,80,2864,2419,361,4344,2416,2479,1134,796,3726,1266,2943,860,2715,938,390,2734,1313,1384,248,202,877,1064,2854,522,3907,279,1602,297,2357,395,3740,137,2075,944,4089,2584,1267,3802,62,1533,2285,178,176,780,2440,201,3707,590,478,1560,4354,2117,1075,30,74,4643,4004,1635,1441,2745,776,2596,238,1077,1692,1912,2844,605,499,1742,3947,241,3053,980,1749,936,2640,4511,2582,515,1543,2162,5322,2892,2993,890,2148,1924,665,1827,3581,1032,968,3163,339,1044,1896,270,583,1791,1720,4367,1194,3488,3669,43,2523,1657,163,2167,290,1209,1622,3378,550,634,2508,2510,695,2634,2384,2512,1476,1414,220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680,854,3227,1299,2976,3172,186,2998,1459,443,1067,3251,1495,321,1932,3054,909,753,1410,1828,436,2441,1119,1587,3164,2186,1258,227,231,1425,1890,3200,3942,247,959,725,5254,2741,577,2158,2079,929,120,174,838,2813,591,1115,417,2024,40,3240,1536,1037,291,4151,2354,632,1298,2406,2500,3535,1825,1846,3451,205,1171,345,4238,18,1163,811,685,2208,1217,425,1312,1508,1175,4308,2552,1033,587,1381,3059,2984,3482,340,1316,4023,3972,792,3176,519,777,4690,918,933,4130,2981,3741,90,3360,2911,2200,5184,4550,609,3079,2030,272,3379,2736,363,3881,1130,1447,286,779,357,1169,3350,3137,1630,1220,2687,2391,747,1277,3688,2618,2682,2601,1156,3196,5290,4034,3102,1689,3596,3128,874,219,2783,798,508,1843,2461,269,1658,1776,1392,1913,2983,3287,2866,2159,2372,829,4076,46,4253,2873,1889,1894,915,1834,1631,2181,2318,298,664,2818,3555,2735,954,3228,3117,527,3511,2173,681,2712,3033,2247,2346,3467,1652,155,2164,3382,113,1994,450,899,494,994,1237,2958,1875,2336,1926,3727,545,1577,1550,633,3473,204,1305,3072,2410,1956,2471,707,2134,841,2195,2196,2663,3843,1026,4940,990,3252,4997,368,1092,437,3212,3258,1933,1829,675,2977,2893,412,943,3723,4644,3294,3283,2230,2373,5154,2389,2241,2661,2323,1404,2524,593,787,677,3008,1275,2059,438,2709,2609,2240,2269,2246,1446,36,1568,1373,3892,1574,2301,1456,3962,693,2276,5216,2035,1143,2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090,424,1694,312,3634,3390,4179,3335,2252,1214,561,1059,3243,2295,2561,975,5155,2321,2751,3772,472,1537,3282,3398,1047,2077,2348,2878,1323,3340,3076,690,2906,51,369,170,3541,1060,2187,2688,3670,2541,1083,1683,928,3918,459,109,4427,599,3744,4286,143,2101,2730,2490,82,1588,3036,2121,281,1860,477,4035,1238,2812,3020,2716,3312,1530,2188,2055,1317,843,636,1808,1173,3495,649,181,1002,147,3641,1159,2414,3750,2289,2795,813,3123,2610,1136,4368,5,3391,4541,2174,420,429,1728,754,1228,2115,2219,347,2223,2733,735,1518,3003,2355,3134,1764,3948,3329,1888,2424,1001,1234,1972,3321,3363,1672,1021,1450,1584,226,765,655,2526,3404,3244,2302,3665,731,594,2184,319,1576,621,658,2656,4299,2099,3864,1279,2071,2598,2739,795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,2591,1084,213,2287,1963,3565,2250,822,793,4574,3187,1772,1789,3050,595,1484,1959,2770,1080,2650,456,422,2996,940,3322,4328,4345,3092,2742,965,2784,739,4124,952,1358,2498,2949,2565,332,2698,2378,660,2260,2473,4194,3856,2919,535,1260,2651,1208,1428,1300,1949,1303,2942,433,2455,2450,1251,1946,614,1269,641,1306,1810,2737,3078,2912,564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,3218,2175,1897,3063,682,1157,4040,4005,1712,1160,1941,1399,394,402,2952,1573,1151,2986,2404,862,299,2033,1489,3006,346,171,2886,3401,1726,2932,168,2533,47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,504,1036,2690,2988,2405,745,5871,849,2397,2056,3081,863,2359,3857,2096,99,1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,35,4879,3742,1296,4228,2280,160,5063,1599,2013,166,520,3479,1646,3345,3012,490,1937,1545,1264,2182,2505,1096,1188,1369,1436,2421,1667,2792,2460,1270,2122,727,3167,2143,806,1706,1012,1800,3037,960,2218,1882,805,139,2456,1139,1521,851,1052,3093,3089,342,2039,744,5097,1468,1502,1585,2087,223,939,326,2140,2577,892,2481,1623,4077,982,3708,135,2131,87,2503,3114,2326,1106,876,1616,547,2997,2831,2093,3441,4530,4314,9,3256,4229,4148,659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,3274,1368,3689,4645,1477,705,3384,3635,1068,1529,2941,1458,3782,1509,100,1656,2548,718,2339,408,1590,2780,3548,1838,4117,3719,1345,3530,717,3442,2778,3220,2898,1892,4590,3614,3371,2043,1998,1224,3483,891,635,584,2559,3355,733,1766,1729,1172,3789,1891,2307,781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,3213,1189,1934,5693,3262,586,3118,1324,1598,517,1564,2217,1868,1893,4445,3728,2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287,338,1993,3129,3489,2689,1809,2815,1997,957,1855,3898,2550,3275,3057,1105,1319,627,1505,1911,1883,3526,698,3629,3456,1833,1431,746,77,1261,2017,2296,1977,1885,125,1334,1600,525,1798,1109,2222,1470,1945,559,2236,1186,3443,2476,1929,1411,2411,3135,1777,3372,2621,1841,1613,3229,668,1430,1839,2643,2916,195,1989,2671,2358,1387,629,3205,2293,5256,4439,123,1310,888,1879,4300,3021,3605,1003,1162,3192,2910,2010,140,2395,2859,55,1082,2012,2901,662,419,2081,1438,680,2774,4654,3912,1620,1731,1625,5035,4065,2328,512,1344,802,5443,2163,2311,2537,524,3399,98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,180,1113,4655,3461,2028,1698,833,2696,1235,1322,1594,4408,3623,3013,3225,2040,3022,541,2881,607,3632,2029,1665,1219,639,1385,1686,1099,2803,3231,1938,3188,2858,427,676,2772,1168,2025,454,3253,2486,3556,230,1950,580,791,1991,1280,1086,1974,2034,630,257,3338,2788,4903,1017,86,4790,966,2789,1995,1696,1131,259,3095,4188,1308,179,1463,5257,289,4107,1248,42,3413,1725,2288,896,1947,774,4474,4254,604,3430,4264,392,2514,2588,452,237,1408,3018,988,4531,1970,3034,3310,540,2370,1562,1288,2990,502,4765,1147,4,1853,2708,207,294,2814,4078,2902,2509,684,34,3105,3532,2551,644,709,2801,2344,573,1727,3573,3557,2021,1081,3100,4315,2100,3681,199,2263,1837,2385,146,3484,1195,2776,3949,997,1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076,493,117,5400,2521,972,1490,2934,1796,4542,2374,1512,2933,2657,413,2888,1135,2762,2314,2156,1355,2369,766,2007,2527,2170,3124,2491,2593,2632,4757,2437,234,3125,3591,1898,1750,1376,1942,3468,3138,570,2127,2145,3276,4131,962,132,1445,4196,19,941,3624,3480,3366,1973,1374,4461,3431,2629,283,2415,2275,808,2887,3620,2112,2563,1353,3610,955,1089,3103,1053,96,88,4097,823,3808,1583,399,292,4091,3313,421,1128,642,4006,903,2539,1877,2082,596,29,4066,1790,722,2157,130,995,1569,769,1485,464,513,2213,288,1923,1101,2453,4316,133,486,2445,50,625,487,2207,57,423,481,2962,159,3729,1558,491,303,482,501,240,2837,112,3648,2392,1783,362,8,3433,3422,610,2793,3277,1390,1284,1654,21,3823,734,367,623,193,287,374,1009,1483,816,476,313,2255,2340,1262,2150,2899,1146,2581,782,2116,1659,2018,1880,255,3586,3314,1110,2867,2137,2564,986,2767,5185,2006,650,158,926,762,881,3157,2717,2362,3587,306,3690,3245,1542,3077,2427,1691,2478,2118,2985,3490,2438,539,2305,983,129,1754,355,4201,2386,827,2923,104,1773,2838,2771,411,2905,3919,376,767,122,1114,828,2422,1817,3506,266,3460,1007,1609,4998,945,2612,4429,2274,726,1247,1964,2914,2199,2070,4002,4108,657,3323,1422,579,455,2764,4737,1222,2895,1670,824,1223,1487,2525,558,861,3080,598,2659,2515,1967,752,2583,2376,2214,4180,977,704,2464,4999,2622,4109,1210,2961,819,1541,142,2284,44,418,457,1126,3730,4347,4626,1644,1876,3671,1864,302,1063,5694,624,723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098,409,1011,2325,3704,2306,818,1732,1383,1824,1844,3757,999,2705,3497,1216,1423,2683,2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343,783,724,191,2434,1354,2220,5065,1763,2752,2472,4152,131,175,2885,3434,92,1466,4920,2616,3871,3872,3866,128,1551,1632,669,1854,3682,4691,4125,1230,188,2973,3290,1302,1213,560,3266,917,763,3909,3249,1760,868,1958,764,1782,2097,145,2277,3774,4462,64,1491,3062,971,2132,3606,2442,221,1226,1617,218,323,1185,3207,3147,571,619,1473,1005,1744,2281,449,1887,2396,3685,275,375,3816,1743,3844,3731,845,1983,2350,4210,1377,773,967,3499,3052,3743,2725,4007,1697,1022,3943,1464,3264,2855,2722,1952,1029,2839,2467,84,4383,2215,820,1391,2015,2448,3672,377,1948,2168,797,2545,3536,2578,2645,94,2874,1678,405,1259,3071,771,546,1315,470,1243,3083,895,2468,981,969,2037,846,4181,653,1276,2928,14,2594,557,3007,2474,156,902,1338,1740,2574,537,2518,973,2282,2216,2433,1928,138,2903,1293,2631,1612,646,3457,839,2935,111,496,2191,2847,589,3186,149,3994,2060,4031,2641,4067,3145,1870,37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,1301,251,2446,2599,2153,872,3246,637,334,3705,831,884,921,3065,3140,4092,2198,1944,246,2964,108,2045,1152,1921,2308,1031,203,3173,4170,1907,3890,810,1401,2003,1690,506,647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,498,666,2613,834,3817,1231,184,2851,1124,883,3197,2261,3710,1765,1553,2658,1178,2639,2351,93,1193,942,2538,2141,4402,235,1821,870,1591,2192,1709,1871,3341,1618,4126,2595,2334,603,651,69,701,268,2662,3411,2555,1380,1606,503,448,254,2371,2646,574,1187,2309,1770,322,2235,1292,1801,305,566,1133,229,2067,2057,706,167,483,2002,2672,3295,1820,3561,3067,316,378,2746,3452,1112,136,1981,507,1651,2917,1117,285,4591,182,2580,3522,1304,335,3303,1835,2504,1795,1792,2248,674,1018,2106,2449,1857,2292,2845,976,3047,1781,2600,2727,1389,1281,52,3152,153,265,3950,672,3485,3951,4463,430,1183,365,278,2169,27,1407,1336,2304,209,1340,1730,2202,1852,2403,2883,979,1737,1062,631,2829,2542,3876,2592,825,2086,2226,3048,3625,352,1417,3724,542,991,431,1351,3938,1861,2294,826,1361,2927,3142,3503,1738,463,2462,2723,582,1916,1595,2808,400,3845,3891,2868,3621,2254,58,2492,1123,910,2160,2614,1372,1603,1196,1072,3385,1700,3267,1980,696,480,2430,920,799,1570,2920,1951,2041,4047,2540,1321,4223,2469,3562,2228,1271,2602,401,2833,3351,2575,5157,907,2312,1256,410,263,3507,1582,996,678,1849,2316,1480,908,3545,2237,703,2322,667,1826,2849,1531,2604,2999,2407,3146,2151,2630,1786,3711,469,3542,497,3899,2409,858,837,4446,3393,1274,786,620,1845,2001,3311,484,308,3367,1204,1815,3691,2332,1532,2557,1842,2020,2724,1927,2333,4440,567,22,1673,2728,4475,1987,1858,1144,1597,101,1832,3601,12,974,3783,4391,951,1412,1,3720,453,4608,4041,528,1041,1027,3230,2628,1129,875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278,144,1758,3040,31,475,1680,366,2685,3184,311,1642,4008,2466,5036,1593,1493,2809,216,1420,1668,233,304,2128,3284,232,1429,1768,1040,2008,3407,2740,2967,2543,242,2133,778,1565,2022,2620,505,2189,2756,1098,2273,372,1614,708,553,2846,2094,2278,169,3626,2835,4161,228,2674,3165,809,1454,1309,466,1705,1095,900,3423,880,2667,3751,5258,2317,3109,2571,4317,2766,1503,1342,866,4447,1118,63,2076,314,1881,1348,1061,172,978,3515,1747,532,511,3970,6,601,905,2699,3300,1751,276,1467,3725,2668,65,4239,2544,2779,2556,1604,578,2451,1802,992,2331,2624,1320,3446,713,1513,1013,103,2786,2447,1661,886,1702,916,654,3574,2031,1556,751,2178,2821,2179,1498,1538,2176,271,914,2251,2080,1325,638,1953,2937,3877,2432,2754,95,3265,1716,260,1227,4083,775,106,1357,3254,426,1607,555,2480,772,1985,244,2546,474,495,1046,2611,1851,2061,71,2089,1675,2590,742,3758,2843,3222,1433,267,2180,2576,2826,2233,2092,3913,2435,956,1745,3075,856,2113,1116,451,3,1988,2896,1398,993,2463,1878,2049,1341,2718,2721,2870,2108,712,2904,4363,2753,2324,277,2872,2349,2649,384,987,435,691,3e3,922,164,3939,652,1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,2530,1434,2408,893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,49,3770,3469,462,318,656,2259,3250,3069,679,1629,2758,344,1138,1104,3120,1836,1283,3115,2154,1437,4448,934,759,1999,794,2862,1038,533,2560,1722,2342,855,2626,1197,1663,4476,3127,85,4240,2528,25,1111,1181,3673,407,3470,4561,2679,2713,768,1925,2841,3986,1544,1165,932,373,1240,2146,1930,2673,721,4766,354,4333,391,2963,187,61,3364,1442,1102,330,1940,1767,341,3809,4118,393,2496,2062,2211,105,331,300,439,913,1332,626,379,3304,1557,328,689,3952,309,1555,931,317,2517,3027,325,569,686,2107,3084,60,1042,1333,2794,264,3177,4014,1628,258,3712,7,4464,1176,1043,1778,683,114,1975,78,1492,383,1886,510,386,645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,1282,1289,4609,697,1453,3044,2666,3611,1856,2412,54,719,1330,568,3778,2459,1748,788,492,551,1191,1e3,488,3394,3763,282,1799,348,2016,1523,3155,2390,1049,382,2019,1788,1170,729,2968,3523,897,3926,2785,2938,3292,350,2319,3238,1718,1717,2655,3453,3143,4465,161,2889,2980,2009,1421,56,1908,1640,2387,2232,1917,1874,2477,4921,148,83,3438,592,4245,2882,1822,1055,741,115,1496,1624,381,1638,4592,1020,516,3214,458,947,4575,1432,211,1514,2926,1865,2142,189,852,1221,1400,1486,882,2299,4036,351,28,1122,700,6479,6480,6481,6482,6483,5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,4211,4154,6280,6488,6489,6490,6281,4212,5037,3374,4171,6491,4562,4807,4722,4827,5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497,6291,3810,4080,5561,3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,4563,4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,3158,5985,4100,867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,4869,5781,3779,6301,5704,5987,5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922,6127,6522,6523,5261,5460,5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920,4809,5e3,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,5463,5890,4973,5999,4741,6133,6134,3607,5570,6e3,4711,3362,3630,4552,5041,6318,6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,4834,3954,6138,5332,3827,4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,4769,4357,5467,3940,4660,4290,6141,4484,4770,4661,3992,6329,4025,4662,5022,4632,4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167,5004,5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,5168,4320,6345,4927,3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,5583,5074,3198,6575,6354,4358,6576,5302,4600,5584,5194,5412,6577,6578,5585,5413,5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375,3702,3178,4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,4249,2804,6584,2270,6585,4e3,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,3760,6589,5473,4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,4713,5594,3829,6169,3887,5417,6170,3653,5474,6368,4216,2971,5228,3790,4579,6369,5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508,4931,5916,4912,5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,4888,3090,3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,3616,5233,6621,6622,6186,4176,6039,6379,6380,3352,5200,5273,2908,5598,5234,3837,5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490,4104,6632,5741,5053,6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,5745,4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,6656,3766,6657,3403,4667,6048,6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651,4615,5488,6207,6408,6051,5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683,4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,5752,5545,5947,4374,6217,4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,4823,5756,5116,6227,3717,5678,4717,5845,6436,5679,5846,6063,5847,6064,3977,3354,6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849,3387,6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,5210,6717,5182,6718,3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,5501,6464,4352,6726,6078,4764,2290,5246,3906,5438,5283,3767,4964,2861,5763,5094,6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161,5248,4353,4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,6752,5692,4720,4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,4866,4899,6099,6100,5559,6478,6765,3599,5868,6101,5869,5870,6275,6766,4527,6767];var o0={};o0.BIG5_TYPICAL_DISTRIBUTION_RATIO=.75;o0.BIG5_TABLE_SIZE=5376;o0.Big5CharToFreqOrder=[1,1801,1506,255,1431,198,9,82,6,5008,177,202,3681,1256,2821,110,3814,33,3274,261,76,44,2114,16,2946,2187,1176,659,3971,26,3451,2653,1198,3972,3350,4202,410,2215,302,590,361,1964,8,204,58,4510,5009,1932,63,5010,5011,317,1614,75,222,159,4203,2417,1480,5012,3555,3091,224,2822,3682,3,10,3973,1471,29,2787,1135,2866,1940,873,130,3275,1123,312,5013,4511,2052,507,252,682,5014,142,1915,124,206,2947,34,3556,3204,64,604,5015,2501,1977,1978,155,1991,645,641,1606,5016,3452,337,72,406,5017,80,630,238,3205,1509,263,939,1092,2654,756,1440,1094,3453,449,69,2987,591,179,2096,471,115,2035,1844,60,50,2988,134,806,1869,734,2036,3454,180,995,1607,156,537,2907,688,5018,319,1305,779,2145,514,2379,298,4512,359,2502,90,2716,1338,663,11,906,1099,2553,20,2441,182,532,1716,5019,732,1376,4204,1311,1420,3206,25,2317,1056,113,399,382,1950,242,3455,2474,529,3276,475,1447,3683,5020,117,21,656,810,1297,2300,2334,3557,5021,126,4205,706,456,150,613,4513,71,1118,2037,4206,145,3092,85,835,486,2115,1246,1426,428,727,1285,1015,800,106,623,303,1281,5022,2128,2359,347,3815,221,3558,3135,5023,1956,1153,4207,83,296,1199,3093,192,624,93,5024,822,1898,2823,3136,795,2065,991,1554,1542,1592,27,43,2867,859,139,1456,860,4514,437,712,3974,164,2397,3137,695,211,3037,2097,195,3975,1608,3559,3560,3684,3976,234,811,2989,2098,3977,2233,1441,3561,1615,2380,668,2077,1638,305,228,1664,4515,467,415,5025,262,2099,1593,239,108,300,200,1033,512,1247,2078,5026,5027,2176,3207,3685,2682,593,845,1062,3277,88,1723,2038,3978,1951,212,266,152,149,468,1899,4208,4516,77,187,5028,3038,37,5,2990,5029,3979,5030,5031,39,2524,4517,2908,3208,2079,55,148,74,4518,545,483,1474,1029,1665,217,1870,1531,3138,1104,2655,4209,24,172,3562,900,3980,3563,3564,4519,32,1408,2824,1312,329,487,2360,2251,2717,784,2683,4,3039,3351,1427,1789,188,109,499,5032,3686,1717,1790,888,1217,3040,4520,5033,3565,5034,3352,1520,3687,3981,196,1034,775,5035,5036,929,1816,249,439,38,5037,1063,5038,794,3982,1435,2301,46,178,3278,2066,5039,2381,5040,214,1709,4521,804,35,707,324,3688,1601,2554,140,459,4210,5041,5042,1365,839,272,978,2262,2580,3456,2129,1363,3689,1423,697,100,3094,48,70,1231,495,3139,2196,5043,1294,5044,2080,462,586,1042,3279,853,256,988,185,2382,3457,1698,434,1084,5045,3458,314,2625,2788,4522,2335,2336,569,2285,637,1817,2525,757,1162,1879,1616,3459,287,1577,2116,768,4523,1671,2868,3566,2526,1321,3816,909,2418,5046,4211,933,3817,4212,2053,2361,1222,4524,765,2419,1322,786,4525,5047,1920,1462,1677,2909,1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213,309,1369,1130,2825,364,2234,1653,1299,3984,3567,3985,3986,2656,525,1085,3041,902,2001,1475,964,4527,421,1845,1415,1057,2286,940,1364,3141,376,4528,4529,1381,7,2527,983,2383,336,1710,2684,1846,321,3461,559,1131,3042,2752,1809,1132,1313,265,1481,1858,5049,352,1203,2826,3280,167,1089,420,2827,776,792,1724,3568,4214,2443,3281,5050,4215,5051,446,229,333,2753,901,3818,1200,1557,4530,2657,1921,395,2754,2685,3819,4216,1836,125,916,3209,2626,4531,5052,5053,3820,5054,5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146,438,2601,2910,2384,3354,1068,958,3043,461,311,2869,2686,4217,1916,3210,4218,1979,383,750,2755,2627,4219,274,539,385,1278,1442,5058,1154,1965,384,561,210,98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257,129,5060,3821,642,523,2789,2790,2658,5061,141,2235,1333,68,176,441,876,907,4220,603,2602,710,171,3464,404,549,18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534,5063,2991,368,5064,146,366,99,871,3693,1543,748,807,1586,1185,22,2263,379,3822,3211,5065,3212,505,1942,2628,1992,1382,2319,5066,380,2362,218,702,1818,1248,3465,3044,3572,3355,3282,5067,2992,3694,930,3283,3823,5068,59,5069,585,601,4221,497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071,749,1837,690,1900,3824,1773,3988,1476,429,1043,1791,2236,2117,917,4222,447,1086,1629,5072,556,5073,5074,2021,1654,844,1090,105,550,966,1758,2828,1008,1783,686,1095,5075,2287,793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825,980,2503,544,353,527,4538,908,2687,2913,5077,381,2629,1943,1348,5078,1341,1252,560,3095,5079,3467,2870,5080,2054,973,886,2081,143,4539,5081,5082,157,3989,496,4224,57,840,540,2039,4540,4541,3468,2118,1445,970,2264,1748,1966,2082,4225,3144,1234,1776,3284,2829,3695,773,1206,2130,1066,2040,1326,3990,1738,1725,4226,279,3145,51,1544,2604,423,1578,2131,2067,173,4542,1880,5083,5084,1583,264,610,3696,4543,2444,280,154,5085,5086,5087,1739,338,1282,3096,693,2871,1411,1074,3826,2445,5088,4544,5089,5090,1240,952,2399,5091,2914,1538,2688,685,1483,4227,2475,1436,953,4228,2055,4545,671,2400,79,4229,2446,3285,608,567,2689,3469,4230,4231,1691,393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672,3827,3213,1464,522,1119,661,1150,216,675,4547,3991,1432,3574,609,4548,2690,2402,5097,5098,5099,4232,3045,0,5100,2476,315,231,2447,301,3356,4549,2385,5101,233,4233,3697,1819,4550,4551,5102,96,1777,1315,2083,5103,257,5104,1810,3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097,363,1655,3214,5106,2993,5107,5108,5109,3992,1567,3993,718,103,3215,849,1443,341,3357,2949,1484,5110,1712,127,67,339,4235,2403,679,1412,821,5111,5112,834,738,351,2994,2147,846,235,1497,1881,418,1993,3828,2719,186,1100,2148,2756,3575,1545,1355,2950,2872,1377,583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363,78,3829,3830,267,1289,2100,2002,1594,4237,348,369,1274,2197,2178,1838,4552,1821,2830,3701,2757,2288,2003,4553,2951,2758,144,3358,882,4554,3995,2759,3470,4555,2915,5114,4238,1726,320,5115,3996,3046,788,2996,5116,2831,1774,1327,2873,3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660,787,2023,506,824,3702,534,323,4557,1044,3359,2024,1901,946,3471,5118,1779,1500,1678,5119,1882,4558,165,243,4559,3703,2528,123,683,4239,764,4560,36,3998,1793,589,2916,816,626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4e3,2874,1370,1228,1933,891,2084,2917,304,4240,5121,292,2997,2720,3577,691,2101,4241,1115,4561,118,662,5122,611,1156,854,2386,1316,2875,2,386,515,2918,5123,5124,3286,868,2238,1486,855,2661,785,2216,3048,5125,1040,3216,3578,5126,3146,448,5127,1525,5128,2165,4562,5129,3833,5130,4242,2833,3579,3147,503,818,4001,3148,1568,814,676,1444,306,1749,5131,3834,1416,1030,197,1428,805,2834,1501,4563,5132,5133,5134,1994,5135,4564,5136,5137,2198,13,2792,3704,2998,3149,1229,1917,5138,3835,2132,5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142,646,3836,2448,307,5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148,519,5149,128,2133,92,2289,1980,5150,4003,1512,342,3150,2199,5151,2793,2218,1981,3360,4244,290,1656,1317,789,827,2365,5152,3837,4566,562,581,4004,5153,401,4567,2252,94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156,828,1105,4245,1262,1394,5157,4246,605,4570,5158,1784,2876,5159,2835,819,2102,578,2200,2952,5160,1502,436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162,5163,2337,2068,23,4571,193,826,3838,2103,699,1630,4248,3098,390,1794,1064,3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573,137,4250,598,3101,1967,780,104,974,2953,5167,278,899,253,402,572,504,493,1339,5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253,565,1334,2722,863,41,5170,5171,4575,5172,1657,2338,19,463,2760,4251,606,5173,2999,3289,1087,2085,1323,2662,3e3,5174,1631,1623,1750,4252,2691,5175,2878,791,2723,2663,2339,232,2421,5176,3001,1498,5177,2664,2630,755,1366,3707,3290,3151,2026,1609,119,1918,3474,862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125,817,4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507,5182,2692,733,40,1632,1106,2879,345,4257,841,2531,230,4578,3002,1847,3292,3475,5183,1263,986,3476,5184,735,879,254,1137,857,622,1300,1180,1388,1562,4010,4011,2954,967,2761,2665,1349,592,2134,1692,3361,3003,1995,4258,1679,4012,1902,2188,5185,739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559,1871,2762,3004,5187,435,5188,343,1108,596,17,1751,4579,2239,3477,3709,5189,4580,294,3582,2955,1693,477,979,281,2042,3583,643,2043,3710,2631,2795,2266,1031,2340,2135,2303,3584,4581,367,1249,2560,5190,3585,5191,4582,1283,3362,2005,240,1762,3363,4583,4584,836,1069,3153,474,5192,2149,2532,268,3586,5193,3219,1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262,961,1673,2632,190,2006,2203,3841,4585,4586,5197,570,2504,3711,1490,5198,4587,2633,3293,1957,4588,584,1514,396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013,619,5202,3154,3294,215,2007,2796,2561,3220,4591,3221,4592,763,4263,3842,4593,5203,5204,1958,1767,2956,3365,3712,1174,452,1477,4594,3366,3155,5205,2838,1253,2387,2189,1091,2290,4264,492,5206,638,1169,1825,2136,1752,4014,648,926,1021,1324,4595,520,4596,997,847,1007,892,4597,3843,2267,1872,3713,2405,1785,4598,1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551,30,2268,4266,5207,2027,4600,3589,5208,501,5209,4267,594,3478,2166,1822,3590,3479,3591,3223,829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602,4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603,374,4017,652,4272,4273,375,1140,798,5216,5217,5218,2366,4604,2269,546,1659,138,3051,2450,4605,5219,2254,612,1849,910,796,3844,1740,1371,825,3845,3846,5220,2920,2562,5221,692,444,3052,2634,801,4606,4274,5222,1491,244,1053,3053,4275,4276,340,5223,4018,1041,3005,293,1168,87,1357,5224,1539,959,5225,2240,721,694,4277,3847,219,1478,644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826,730,1515,184,2840,66,4607,5228,1660,2958,246,3369,378,1457,226,3480,975,4020,2959,1264,3592,674,696,5229,163,5230,1141,2422,2167,713,3593,3370,4608,4021,5231,5232,1186,15,5233,1079,1070,5234,1522,3224,3594,276,1050,2725,758,1126,653,2960,3296,5235,2342,889,3595,4022,3104,3007,903,1250,4609,4023,3481,3596,1342,1681,1718,766,3297,286,89,2961,3715,5236,1713,5237,2607,3371,3008,5238,2962,2219,3225,2880,5239,4610,2505,2533,181,387,1075,4024,731,2190,3372,5240,3298,310,313,3482,2304,770,4278,54,3054,189,4611,3105,3848,4025,5241,1230,1617,1850,355,3597,4279,4612,3373,111,4280,3716,1350,3160,3483,3055,4281,2150,3299,3598,5242,2797,4026,4027,3009,722,2009,5243,1071,247,1207,2343,2478,1378,4613,2010,864,1437,1214,4614,373,3849,1142,2220,667,4615,442,2763,2563,3850,4028,1969,4282,3300,1840,837,170,1107,934,1336,1883,5244,5245,2119,4283,2841,743,1569,5246,4616,4284,582,2389,1418,3484,5247,1803,5248,357,1395,1729,3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250,482,2451,4618,5251,5252,1492,833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718,4286,1686,1795,416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881,4619,1610,1584,3056,2424,2764,443,3302,1163,3161,5257,5258,4029,5259,4287,2506,3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289,431,3485,5261,250,97,81,4290,5262,1648,1851,1558,160,848,5263,866,740,1694,5264,2204,2843,3226,4291,4621,3719,1687,950,2479,426,469,3227,3720,3721,4031,5265,5266,1188,424,1996,861,3601,4292,3854,2205,2694,168,1235,3602,4293,5267,2087,1674,4622,3374,3303,220,2565,1009,5268,3855,670,3010,332,1208,717,5269,5270,3603,2452,4032,3375,5271,513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534,3722,3604,815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035,1741,4036,3857,4037,5278,236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625,5281,308,5282,4626,245,4627,1852,2480,1307,2583,430,715,2137,2454,5283,270,199,2883,4038,5284,3606,2727,1753,761,1754,725,1661,1841,4628,3487,3724,5285,5286,587,14,3305,227,2608,326,480,2270,943,2765,3607,291,650,1884,5287,1702,1226,102,1547,62,3488,904,4629,3489,1164,4294,5288,5289,1224,1548,2766,391,498,1493,5290,1386,1419,5291,2056,1177,4630,813,880,1081,2368,566,1145,4631,2291,1001,1035,2566,2609,2242,394,1286,5292,5293,2069,5294,86,1494,1730,4039,491,1588,745,897,2963,843,3377,4040,2767,2884,3306,1768,998,2221,2070,397,1827,1195,1970,3725,3011,3378,284,5295,3861,2507,2138,2120,1904,5296,4041,2151,4042,4295,1036,3490,1905,114,2567,4296,209,1527,5297,5298,2964,2844,2635,2390,2728,3164,812,2568,5299,3307,5300,1559,737,1885,3726,1210,885,28,2695,3608,3862,5301,4297,1004,1780,4632,5302,346,1982,2222,2696,4633,3863,1742,797,1642,4043,1934,1072,1384,2152,896,4044,3308,3727,3228,2885,3609,5303,2569,1959,4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528,2610,161,1178,4300,1983,987,4637,1101,4301,631,4046,1157,3229,2425,1343,1241,1016,2243,2570,372,877,2344,2508,1160,555,1935,911,4047,5307,466,1170,169,1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308,992,2345,3491,1540,2730,1201,2071,2406,1997,2482,5309,4638,528,1923,2191,1503,1874,1570,2369,3379,3309,5310,557,1073,5311,1828,3492,2088,2271,3165,3059,3107,767,3108,2799,4639,1006,4302,4640,2346,1267,2179,3730,3230,778,4048,3231,2731,1597,2667,5312,4641,5313,3493,5314,5315,5316,3310,2698,1433,3311,131,95,1504,4049,723,4303,3166,1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052,4304,2584,248,1634,3864,912,5319,2845,3732,3060,3865,654,53,5320,3014,5321,1688,4642,777,3494,1032,4053,1425,5322,191,820,2121,2846,971,4643,931,3233,135,664,783,3866,1998,772,2922,1936,4054,3867,4644,2923,3234,282,2732,640,1372,3495,1127,922,325,3381,5323,5324,711,2045,5325,5326,4055,2223,2800,1937,4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058,4059,5328,2225,258,3236,4646,101,1227,5329,3313,1755,5330,1391,3314,5331,2924,2057,893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338,878,1325,1781,2801,4647,259,1385,2585,744,1183,2272,4648,5339,4060,2509,5340,684,1024,4306,5341,472,3612,3496,1165,3315,4061,4062,322,2153,881,455,1695,1152,1340,660,554,2154,4649,1058,4650,4307,830,1065,3383,4063,4651,1924,5342,1703,1919,5343,932,2273,122,5344,4652,947,677,5345,3870,2637,297,1906,1925,2274,4653,2322,3316,5346,5347,4308,5348,4309,84,4310,112,989,5349,547,1059,4064,701,3613,1019,5350,4311,5351,3497,942,639,457,2306,2456,993,2966,407,851,494,4654,3384,927,5352,1237,5353,2426,3385,573,4312,680,921,2925,1279,1875,285,790,1448,1984,719,2168,5354,5355,4655,4065,4066,1649,5356,1541,563,5357,1077,5358,3386,3061,3498,511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657,5359,535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313,1238,2586,3109,1259,5361,700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907,4658,2611,4070,781,2427,132,1589,203,147,273,2802,2407,898,1787,2155,4071,4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872,965,5369,1805,2699,1516,3614,1121,1082,1329,3317,4073,1449,3873,65,1128,2848,2927,2769,1590,3874,5370,5371,12,2668,45,976,2587,3169,4661,517,2535,1013,1037,3240,5372,3875,2849,5373,3876,5374,3499,5375,2612,614,1999,2323,3877,3110,2733,2638,5376,2588,4316,599,1269,5377,1811,3735,5378,2700,3111,759,1060,489,1806,3388,3318,1358,5379,5380,2391,1387,1215,2639,2256,490,5381,5382,4317,1759,2392,2348,5383,4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349,874,5384,5385,3501,3736,1859,91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403,3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076,2370,4667,5390,2030,5391,5392,4077,2702,1216,237,2589,4318,2324,4078,3881,4668,4669,2703,3615,3504,445,4670,5393,5394,5395,5396,2771,61,4079,3738,1823,4080,5397,687,2046,935,925,405,2670,703,1096,1860,2734,4671,4081,1877,1367,2704,3389,918,2106,1782,2483,334,3320,1611,1093,4672,564,3171,3505,3739,3390,945,2641,2058,4673,5398,1926,872,4319,5399,3506,2705,3112,349,4320,3740,4082,4674,3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047,782,4084,400,251,4323,1624,5400,5401,277,3742,299,1265,476,1191,3883,2122,4324,4325,1109,205,5402,2590,1e3,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573,107,2484,2158,4085,3507,3172,5407,1533,541,1301,158,753,4326,2886,3617,5408,1696,370,1088,4327,4680,3618,579,327,440,162,2244,269,1938,1374,3508,968,3063,56,1396,3113,2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413,2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088,5418,1076,49,5419,951,3242,3322,3323,450,2850,920,5420,1812,2805,2371,4328,1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686,2393,2614,260,1796,3244,5423,5424,3887,3324,708,5425,3620,1704,5426,3621,1351,1618,3394,3017,1887,944,4329,3395,4330,3064,3396,4331,5427,3744,422,413,1714,3325,500,2059,2350,4332,2486,5428,1344,1911,954,5429,1668,5430,5431,4089,2409,4333,3622,3888,4334,5432,2307,1318,2512,3114,133,3115,2887,4687,629,31,2851,2706,3889,4688,850,949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091,620,3245,981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434,3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439,869,2852,655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733,558,4692,3747,335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192,470,2735,2108,2806,913,1054,4093,5443,1027,5444,3066,4094,4693,982,2672,3399,3173,3512,3247,3248,1947,2807,5445,571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090,984,4695,3749,1960,5449,3750,852,923,2808,3513,3751,969,1519,999,2049,2325,1705,5450,3118,615,1662,151,597,4095,2410,2326,1049,275,4696,3752,4337,568,3753,3626,2487,4338,3754,5451,2430,2275,409,3249,5452,1566,2888,3514,1002,769,2853,194,2091,3174,3755,2226,3327,4339,628,1505,5453,5454,1763,2180,3019,4096,521,1161,2592,1788,2206,2411,4697,4097,1625,4340,4341,412,42,3119,464,5455,2642,4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328,1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092,460,5461,4701,5462,3020,962,588,3629,289,3250,2644,1116,52,5463,3067,1797,5464,5465,5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402,465,4703,1572,510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472,5473,536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809,5477,3329,1122,377,3251,5478,360,5479,5480,4343,1529,551,5481,2060,3759,1769,2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404,136,1468,1479,672,1171,3252,2308,271,3176,5483,2772,5484,2050,678,2736,865,1948,4707,5485,2014,4098,2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895,509,2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010,552,681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179,358,453,736,175,478,1117,905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632,4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932,3069,2182,3521,595,2123,5496,4100,5497,5498,4349,1707,2646,223,3762,1359,751,3121,183,3522,5499,2810,3021,419,2374,633,704,3897,2394,241,5500,5501,5502,838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136,2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615,484,3764,5506,4102,625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509,2774,808,2616,3765,3406,4105,4355,3123,2539,526,3407,3900,4356,955,5510,1620,4357,2647,2432,5511,1429,3766,1669,1832,994,928,5512,3633,1260,5513,5514,5515,1949,2293,741,2933,1626,4358,2738,2460,867,1184,362,3408,1392,5516,5517,4106,4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292,1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490,3332,5520,3769,4715,5521,5522,666,1003,3023,1022,3634,4361,5523,4716,1814,2257,574,3901,1603,295,1535,705,3902,4362,283,858,417,5524,5525,3255,4717,4718,3071,1220,1890,1046,2281,2461,4107,1393,1599,689,2575,388,4363,5526,2491,802,5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529,809,5530,5531,5532,575,2739,3524,956,1552,1469,1144,2328,5533,2329,1560,2462,3635,3257,4108,616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770,3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905,607,2311,3906,762,2892,1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723,2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451,5545,5546,5547,5548,2936,4109,4110,2492,2351,411,4111,4112,3637,3333,3124,4725,1561,2674,1452,4113,1375,5549,5550,47,2974,316,5551,1406,1591,2937,3181,5552,1025,2142,3125,3182,354,2740,884,2228,4369,2412,508,3772,726,3638,996,2433,3639,729,5553,392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813,919,2352,2975,2353,1270,4727,4115,73,5556,5557,647,5558,3259,2856,2259,1550,1346,3024,5559,1332,883,3526,5560,5561,5562,5563,3334,2775,5564,1212,831,1347,4370,4728,2331,3909,1864,3073,720,3910,4729,4730,3911,5565,4371,5566,5567,4731,5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938,669,2211,2675,2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735,3183,518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912,516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976,1422,577,1470,3026,1524,3410,5585,5586,432,4376,3074,3527,5587,2594,1455,2515,2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529,2649,4119,4377,4738,2295,895,924,4378,2171,331,2247,3076,166,1627,3077,1098,5591,1232,2894,2231,3411,4739,657,403,1196,2377,542,3775,3412,1600,4379,3530,5592,4740,2777,3261,576,530,1362,4741,4742,2540,2676,3776,4120,5593,842,3913,5594,2814,2032,1014,4121,213,2709,3413,665,621,4380,5595,3777,2939,2435,5596,2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597,724,2282,600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600,651,4384,5601,1612,4385,2621,5602,2857,5603,2743,2312,3078,5604,716,2464,3079,174,1255,2710,4122,3645,548,1320,1398,728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082,3778,3646,3779,747,5607,635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613,3415,4749,2437,451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616,4390,350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127,488,4752,458,4392,4128,3781,771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494,2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016,2745,5622,1155,1017,3782,3915,5623,3336,2313,201,1865,4397,1430,5624,4129,5625,5626,5627,5628,5629,4398,1604,5630,414,1866,371,2595,4754,4755,3532,2017,3127,4756,1708,960,4399,887,389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580,5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896,4400,5637,4401,2650,3418,2815,673,2712,2465,709,3533,4131,3648,4402,5638,1148,502,634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128,948,3263,121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133,1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816,531,2746,2545,3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018,120,4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713,1266,5650,1368,4766,2858,649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2e3,5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415,2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460,856,5659,3655,5660,2899,2978,5661,2900,3922,5662,4408,632,2517,875,3923,1697,3924,2296,5663,5664,4767,3028,1239,580,4768,4409,5665,914,936,2075,1190,4136,1039,2124,5666,5667,5668,5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137,915,3338,4411,4412,3339,1605,1835,5671,2748,398,3656,4413,3926,4138,328,1913,2860,4139,3927,1331,4414,3029,937,4415,5672,3657,4140,4141,3424,2161,4770,3425,524,742,538,3085,1012,5673,5674,3928,2466,5675,658,1103,225,3929,5676,5677,4771,5678,4772,5679,3267,1243,5680,4142,963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774,5685,5686,5687,3536,957,3426,2547,2033,1931,2941,2467,870,2019,3659,1746,2780,2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691,3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297,977,2901,2034,4144,1205,3429,5693,1765,3430,3189,2125,1271,714,1689,4775,3538,5694,2333,3931,533,4417,3660,2184,617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699,3932,1988,618,427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703,3541,4777,5704,2284,1576,473,3661,4419,3432,972,5705,3662,5706,3087,5707,5708,4778,4779,5709,3793,4145,4146,5710,153,4780,356,5711,1892,2902,4420,2144,408,803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715,2416,3433,752,5716,5717,1962,3341,2979,5718,746,3030,2470,4783,4423,3794,698,4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715,3937,1974,4425,5721,4426,3192,823,1303,1288,1236,2861,3542,4148,3435,774,3938,5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428,344,1173,288,2316,454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789,985,894,5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194,425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736,636,4791,1856,3940,760,1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213,479,5740,5741,832,5742,4153,2496,5743,2980,2497,3797,990,3132,627,1815,2652,4433,1582,4434,2126,2112,3543,4794,5744,799,4435,3195,5745,4795,2113,1737,3031,1018,543,754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903,4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270,1843,3665,1715,481,365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271,433,1895,2064,2076,5758,602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764,3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769,4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775,5776,1896,5777,5778,4808,1897,4158,318,5779,2095,4159,4437,5780,5781,485,5782,938,3941,553,2680,116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785,3668,2943,4160,1747,2944,2983,5786,5787,207,5788,4809,5789,4810,2521,5790,3033,890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795,941,2299,208,3546,4161,2020,330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798,2522,1613,4812,5799,3345,3945,2523,5800,4162,5801,1637,4163,2471,4813,3946,5802,2500,3034,3800,5803,5804,2195,4814,5805,2163,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,3670,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,4815,6286,6287,6288,6289,6290,6291,6292,4816,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,4817,4818,6312,6313,6314,6315,6316,6317,6318,4819,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,4820,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,3441,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,4440,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,4821,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,3947,3948,6478,6479,6480,6481,3272,4441,6482,6483,6484,6485,4442,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,4822,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,2784,6557,4823,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,3949,6570,6571,6572,4824,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,4825,6584,6585,6586,3950,2785,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,4826,6613,6614,6615,4827,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,4164,6626,6627,6628,6629,6630,6631,6632,6633,6634,3547,6635,4828,6636,6637,6638,6639,6640,6641,6642,3951,2984,6643,6644,6645,6646,6647,6648,6649,4165,6650,4829,6651,6652,4830,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,4831,6663,6664,6665,6666,6667,6668,6669,6670,6671,4166,6672,4832,3952,6673,6674,6675,6676,4833,6677,6678,6679,4167,6680,6681,6682,3198,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,4834,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,4443,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,4444,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,4168,6782,6783,3442,6784,6785,6786,6787,6788,6789,6790,6791,4169,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,4835,6812,6813,6814,4445,6815,6816,4446,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,3548,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,4836,6847,6848,6849,6850,6851,6852,6853,6854,3953,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,3199,6878,6879,6880,6881,6882,4447,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,4170,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,4837,6928,6929,6930,6931,6932,6933,6934,6935,6936,3346,6937,6938,4838,6939,6940,6941,4448,6942,6943,6944,6945,6946,4449,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,3671,6995,6996,6997,6998,4839,6999,7e3,7001,7002,3549,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,4840,7031,7032,7033,7034,7035,7036,7037,7038,4841,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,2985,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,4842,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,4450,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4843,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,4171,4172,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,4844,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,4451,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,4173,7354,7355,4845,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,4846,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,3672,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,4452,7454,3200,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,4847,7475,7476,7477,3133,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,3347,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,4848,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,3801,4849,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,3035,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,4850,7617,7618,3802,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,4851,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,4453,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,3443,7698,7699,7700,7701,7702,4454,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,2472,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,3954,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,3134,7751,7752,4852,7753,7754,7755,4853,7756,7757,7758,7759,7760,4174,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,4854,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,4855,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,3955,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,3444,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,4175,7892,7893,7894,7895,7896,4856,4857,7897,7898,7899,7900,2598,7901,7902,7903,7904,7905,7906,7907,7908,4455,7909,7910,7911,7912,7913,7914,3201,7915,7916,7917,7918,7919,7920,7921,4858,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,4859,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,4860,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,4176,8017,8018,8019,8020,8021,8022,8023,4861,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,4862,4456,8037,8038,8039,8040,4863,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,4864,4177,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,4178,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,4865,4866,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,4179,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,4457,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,3445,8257,8258,8259,8260,8261,8262,4458,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,4459,8273,8274,8275,8276,3550,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,4460,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,4867,8308,8309,8310,8311,8312,3551,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,4868,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,4869,4461,8364,8365,8366,8367,8368,8369,8370,4870,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,4871,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,4462,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,2986,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,4180,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,4872,8565,8566,8567,8568,8569,8570,8571,8572,8573,4873,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,3803,8606,8607,8608,8609,8610,8611,8612,8613,4874,3804,8614,8615,8616,8617,8618,8619,8620,8621,3956,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,2865,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,4463,8657,8658,8659,4875,4876,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,4464,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,2261,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,4181,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,4877,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,4878,8789,4879,8790,8791,8792,4880,8793,8794,8795,8796,8797,8798,8799,8800,8801,4881,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,3957,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,4882,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,3202,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,4465,8925,8926,8927,8928,8929,8930,8931,8932,4883,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,2214,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,4884,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,4885,8993,8994,8995,8996,8997,8998,8999,9e3,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,4182,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,4886,9064,9065,9066,9067,9068,9069,4887,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,3958,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,4888,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,4889,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,4890,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,4466,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,4891,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,4892,9258,9259,9260,9261,4893,4894,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,4467,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,3673,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,4895,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,4468,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,4896,9374,4469,9375,9376,9377,9378,9379,4897,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,4470,9407,2751,9408,9409,3674,3552,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,4898,9422,9423,9424,9425,9426,9427,9428,9429,3959,9430,9431,9432,9433,9434,9435,9436,4471,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,3348,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,4899,9473,9474,9475,9476,9477,4900,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,3349,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,4901,9521,9522,9523,9524,9525,9526,4902,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,3805,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,4903,9603,9604,9605,9606,9607,4904,9608,9609,9610,9611,9612,9613,9614,4905,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,4906,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,4907,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,4183,9673,9674,9675,9676,9677,4908,9678,9679,9680,9681,4909,9682,9683,9684,9685,9686,9687,9688,9689,9690,4910,9691,9692,9693,3675,9694,9695,9696,2945,9697,9698,9699,9700,9701,9702,9703,9704,9705,4911,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,4912,9736,9737,9738,9739,9740,4913,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,4914,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,4915,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,4916,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,4917,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,4472,9893,9894,9895,9896,9897,3806,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,4918,9915,9916,9917,4919,9918,9919,9920,9921,4184,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,4920,9947,9948,9949,9950,9951,9952,9953,9954,9955,4185,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,4921,9966,9967,9968,4473,9969,9970,9971,9972,9973,9974,9975,9976,9977,4474,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999,1e4,10001,10002,10003,10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019,10020,10021,4922,10022,4923,10023,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,4924,10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10060,10061,10062,10063,10064,10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,10085,10086,10087,4475,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,4476,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,2174,10112,10113,10114,10115,10116,10117,10118,10119,10120,10121,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,3807,4186,4925,10141,10142,10143,10144,10145,10146,10147,4477,4187,10148,10149,10150,10151,10152,10153,4188,10154,10155,10156,10157,10158,10159,10160,10161,4926,10162,10163,10164,10165,10166,10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,10183,10184,10185,10186,10187,10188,10189,10190,10191,10192,3203,10193,10194,10195,10196,10197,10198,10199,10200,4478,10201,10202,10203,10204,4479,10205,10206,10207,10208,10209,10210,10211,10212,10213,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10225,10226,10227,10228,10229,10230,10231,10232,10233,10234,4927,10235,10236,10237,10238,10239,10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,4480,4928,4929,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,4930,10335,10336,10337,10338,10339,10340,10341,10342,4931,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,3088,10356,2786,10357,10358,10359,10360,4189,10361,10362,10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,4932,10376,10377,10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10388,10389,10390,10391,10392,4933,10393,10394,10395,4934,10396,10397,10398,10399,10400,10401,10402,10403,10404,10405,10406,10407,10408,10409,10410,10411,10412,3446,10413,10414,10415,10416,10417,10418,10419,10420,10421,10422,10423,4935,10424,10425,10426,10427,10428,10429,10430,4936,10431,10432,10433,10434,10435,10436,10437,10438,10439,10440,10441,10442,10443,4937,10444,10445,10446,10447,4481,10448,10449,10450,10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466,10467,10468,10469,10470,10471,10472,10473,10474,10475,10476,10477,10478,10479,10480,10481,10482,10483,10484,10485,10486,10487,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498,10499,10500,10501,10502,10503,10504,10505,4938,10506,10507,10508,10509,10510,2552,10511,10512,10513,10514,10515,10516,3447,10517,10518,10519,10520,10521,10522,10523,10524,10525,10526,10527,10528,10529,10530,10531,10532,10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,4482,10544,4939,10545,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,3676,4483,10568,10569,10570,10571,10572,3448,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602,10603,10604,10605,10606,10607,10608,10609,10610,10611,10612,10613,10614,10615,10616,10617,10618,10619,10620,10621,10622,10623,10624,10625,10626,10627,4484,10628,10629,10630,10631,10632,4940,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10650,10651,10652,10653,10654,10655,10656,4941,10657,10658,10659,2599,10660,10661,10662,10663,10664,10665,10666,3089,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677,10678,10679,10680,4942,10681,10682,10683,10684,10685,10686,10687,10688,10689,10690,10691,10692,10693,10694,10695,10696,10697,4485,10698,10699,10700,10701,10702,10703,10704,4943,10705,3677,10706,10707,10708,10709,10710,10711,10712,4944,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10724,10725,10726,10727,10728,4945,10729,10730,10731,10732,10733,10734,10735,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10760,10761,4946,10762,10763,10764,10765,10766,10767,4947,4948,10768,10769,10770,10771,10772,10773,10774,10775,10776,10777,10778,10779,10780,10781,10782,10783,10784,10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796,10797,10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,10811,10812,10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,10824,10825,10826,10827,10828,10829,10830,10831,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,10844,10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860,10861,10862,10863,10864,10865,10866,10867,10868,10869,10870,10871,10872,10873,10874,10875,10876,10877,10878,4486,10879,10880,10881,10882,10883,10884,10885,4949,10886,10887,10888,10889,10890,10891,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,10904,10905,10906,10907,10908,10909,10910,10911,10912,10913,10914,10915,10916,10917,10918,10919,4487,10920,10921,10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,4950,10933,10934,10935,10936,10937,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,4488,10950,10951,10952,10953,10954,10955,10956,10957,10958,10959,4190,10960,10961,10962,10963,10964,10965,10966,10967,10968,10969,10970,10971,10972,10973,10974,10975,10976,10977,10978,10979,10980,10981,10982,10983,10984,10985,10986,10987,10988,10989,10990,10991,10992,10993,10994,10995,10996,10997,10998,10999,11e3,11001,11002,11003,11004,11005,11006,3960,11007,11008,11009,11010,11011,11012,11013,11014,11015,11016,11017,11018,11019,11020,11021,11022,11023,11024,11025,11026,11027,11028,11029,11030,11031,11032,4951,11033,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044,11045,11046,11047,4489,11048,11049,11050,11051,4952,11052,11053,11054,11055,11056,11057,11058,4953,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11070,11071,4954,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,3808,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11133,11134,4955,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150,11151,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,4956,11162,11163,11164,11165,11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11176,11177,11178,11179,11180,4957,11181,11182,11183,11184,11185,11186,4958,11187,11188,11189,11190,11191,11192,11193,11194,11195,11196,11197,11198,11199,11200,3678,11201,11202,11203,11204,11205,11206,4191,11207,11208,11209,11210,11211,11212,11213,11214,11215,11216,11217,11218,11219,11220,11221,11222,11223,11224,11225,11226,11227,11228,11229,11230,11231,11232,11233,11234,11235,11236,11237,11238,11239,11240,11241,11242,11243,11244,11245,11246,11247,11248,11249,11250,11251,4959,11252,11253,11254,11255,11256,11257,11258,11259,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11272,11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11284,11285,11286,11287,11288,11289,11290,11291,11292,11293,11294,11295,11296,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,11307,11308,11309,11310,11311,11312,11313,11314,3679,11315,11316,11317,11318,4490,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,4960,11348,11349,11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,3961,4961,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395,11396,11397,4192,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409,11410,11411,4962,11412,11413,11414,11415,11416,11417,11418,11419,11420,11421,11422,11423,11424,11425,11426,11427,11428,11429,11430,11431,11432,11433,11434,11435,11436,11437,11438,11439,11440,11441,11442,11443,11444,11445,11446,11447,11448,11449,11450,11451,11452,11453,11454,11455,11456,11457,11458,11459,11460,11461,11462,11463,11464,11465,11466,11467,11468,11469,4963,11470,11471,4491,11472,11473,11474,11475,4964,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11486,11487,11488,11489,11490,11491,11492,4965,11493,11494,11495,11496,11497,11498,11499,11500,11501,11502,11503,11504,11505,11506,11507,11508,11509,11510,11511,11512,11513,11514,11515,11516,11517,11518,11519,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,3962,11530,11531,11532,11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,11559,11560,11561,11562,11563,11564,4193,4194,11565,11566,11567,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578,11579,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,4966,4195,11592,11593,11594,11595,11596,11597,11598,11599,11600,11601,11602,11603,11604,3090,11605,11606,11607,11608,11609,11610,4967,11611,11612,11613,11614,11615,11616,11617,11618,11619,11620,11621,11622,11623,11624,11625,11626,11627,11628,11629,11630,11631,11632,11633,11634,11635,11636,11637,11638,11639,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,11652,11653,11654,11655,11656,11657,11658,11659,11660,11661,11662,11663,11664,11665,11666,11667,11668,11669,11670,11671,11672,11673,11674,4968,11675,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685,11686,11687,11688,11689,11690,11691,11692,11693,3809,11694,11695,11696,11697,11698,11699,11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,11712,11713,11714,11715,11716,11717,11718,3553,11719,11720,11721,11722,11723,11724,11725,11726,11727,11728,11729,11730,4969,11731,11732,11733,11734,11735,11736,11737,11738,11739,11740,4492,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,4970,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11788,11789,11790,4971,11791,11792,11793,11794,11795,11796,11797,4972,11798,11799,11800,11801,11802,11803,11804,11805,11806,11807,11808,11809,11810,4973,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821,11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,3680,3810,11835,11836,4974,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,11878,11879,11880,11881,11882,11883,11884,4493,11885,11886,11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913,11914,11915,4975,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928,11929,11930,11931,11932,11933,11934,11935,11936,11937,11938,11939,11940,11941,11942,11943,11944,11945,11946,11947,11948,11949,4976,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959,11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,11972,11973,11974,11975,11976,11977,11978,11979,11980,11981,11982,11983,11984,11985,11986,11987,4196,11988,11989,11990,11991,11992,4977,11993,11994,11995,11996,11997,11998,11999,12e3,12001,12002,12003,12004,12005,12006,12007,12008,12009,12010,12011,12012,12013,12014,12015,12016,12017,12018,12019,12020,12021,12022,12023,12024,12025,12026,12027,12028,12029,12030,12031,12032,12033,12034,12035,12036,12037,12038,12039,12040,12041,12042,12043,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053,12054,12055,12056,12057,12058,12059,12060,12061,4978,12062,12063,12064,12065,12066,12067,12068,12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12080,12081,12082,12083,12084,12085,12086,12087,12088,12089,12090,12091,12092,12093,12094,12095,12096,12097,12098,12099,12100,12101,12102,12103,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12116,12117,12118,12119,12120,12121,12122,12123,4979,12124,12125,12126,12127,12128,4197,12129,12130,12131,12132,12133,12134,12135,12136,12137,12138,12139,12140,12141,12142,12143,12144,12145,12146,12147,12148,12149,12150,12151,12152,12153,12154,4980,12155,12156,12157,12158,12159,12160,4494,12161,12162,12163,12164,3811,12165,12166,12167,12168,12169,4495,12170,12171,4496,12172,12173,12174,12175,12176,3812,12177,12178,12179,12180,12181,12182,12183,12184,12185,12186,12187,12188,12189,12190,12191,12192,12193,12194,12195,12196,12197,12198,12199,12200,12201,12202,12203,12204,12205,12206,12207,12208,12209,12210,12211,12212,12213,12214,12215,12216,12217,12218,12219,12220,12221,4981,12222,12223,12224,12225,12226,12227,12228,12229,12230,12231,12232,12233,12234,12235,4982,12236,12237,12238,12239,12240,12241,12242,12243,12244,12245,4983,12246,12247,12248,12249,4984,12250,12251,12252,12253,12254,12255,12256,12257,12258,12259,12260,12261,12262,12263,12264,4985,12265,4497,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12284,12285,12286,12287,4986,12288,12289,12290,12291,12292,12293,12294,12295,12296,2473,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,3963,12320,12321,12322,12323,12324,12325,12326,12327,12328,12329,12330,12331,12332,4987,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354,12355,12356,12357,12358,12359,3964,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,3965,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,4988,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12436,12437,12438,3554,12439,12440,12441,12442,12443,12444,12445,12446,12447,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,4989,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,4990,12481,12482,12483,12484,12485,12486,12487,12488,12489,4498,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539,12540,12541,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,4991,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,3036,12579,12580,12581,12582,12583,3966,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,4499,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695,12696,12697,12698,4992,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12710,12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12722,12723,12724,12725,12726,12727,12728,12729,12730,12731,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742,12743,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,4993,2175,12779,12780,12781,12782,12783,12784,12785,12786,4500,12787,12788,12789,12790,12791,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,4198,3967,12827,12828,12829,12830,12831,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,12842,12843,12844,12845,12846,12847,12848,12849,12850,12851,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,4199,12862,12863,12864,12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,12876,12877,12878,12879,12880,12881,12882,12883,12884,12885,12886,12887,4501,12888,12889,12890,12891,12892,12893,12894,12895,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,4994,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,12924,12925,12926,12927,12928,12929,12930,12931,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942,12943,12944,12945,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,1772,12957,12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,12970,12971,12972,12973,12974,12975,12976,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,12989,12990,12991,12992,12993,12994,12995,12996,12997,4502,12998,4503,12999,13e3,13001,13002,13003,4504,13004,13005,13006,13007,13008,13009,13010,13011,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,3449,13030,13031,13032,13033,13034,13035,13036,13037,13038,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049,13050,13051,13052,13053,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065,13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13078,13079,13080,13081,13082,13083,13084,13085,13086,13087,13088,13089,13090,13091,13092,13093,13094,13095,13096,13097,13098,13099,13100,13101,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113,13114,13115,13116,13117,13118,3968,13119,4995,13120,13121,13122,13123,13124,13125,13126,13127,4505,13128,13129,13130,13131,13132,13133,13134,4996,4506,13135,13136,13137,13138,13139,4997,13140,13141,13142,13143,13144,13145,13146,13147,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13159,4998,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170,13171,13172,13173,13174,13175,13176,4999,13177,13178,13179,13180,13181,13182,13183,13184,13185,13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13196,13197,13198,13199,13200,13201,13202,13203,13204,13205,13206,5e3,13207,13208,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13219,13220,13221,13222,13223,13224,13225,13226,13227,4200,5001,13228,13229,13230,13231,13232,13233,13234,13235,13236,13237,13238,13239,13240,3969,13241,13242,13243,13244,3970,13245,13246,13247,13248,13249,13250,13251,13252,13253,13254,13255,13256,13257,13258,13259,13260,13261,13262,13263,13264,13265,13266,13267,13268,3450,13269,13270,13271,13272,13273,13274,13275,13276,5002,13277,13278,13279,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,3813,13303,13304,13305,13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13316,13317,13318,13319,13320,13321,13322,13323,13324,13325,13326,13327,13328,4507,13329,13330,13331,13332,13333,13334,13335,13336,13337,13338,13339,13340,13341,5003,13342,13343,13344,13345,13346,13347,13348,13349,13350,13351,13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13362,13363,13364,13365,13366,13367,5004,13368,13369,13370,13371,13372,13373,13374,13375,13376,13377,13378,13379,13380,13381,13382,13383,13384,13385,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13398,13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13410,13411,13412,13413,13414,13415,13416,13417,13418,13419,13420,13421,13422,13423,13424,13425,13426,13427,13428,13429,13430,13431,13432,4508,13433,13434,13435,4201,13436,13437,13438,13439,13440,13441,13442,13443,13444,13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,5005,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,4509,13471,13472,13473,13474,13475,13476,13477,13478,13479,13480,13481,13482,13483,13484,13485,13486,13487,13488,13489,13490,13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13506,13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13518,13519,13520,13521,13522,13523,13524,13525,13526,13527,13528,13529,13530,13531,13532,13533,13534,13535,13536,13537,13538,13539,13540,13541,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13552,13553,13554,13555,13556,13557,13558,13559,13560,13561,13562,13563,13564,13565,13566,13567,13568,13569,13570,13571,13572,13573,13574,13575,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586,13587,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13600,13601,13602,13603,13604,13605,13606,13607,13608,13609,13610,13611,13612,13613,13614,13615,13616,13617,13618,13619,13620,13621,13622,13623,13624,13625,13626,13627,13628,13629,13630,13631,13632,13633,13634,13635,13636,13637,13638,13639,13640,13641,13642,5006,13643,13644,13645,13646,13647,13648,13649,13650,13651,5007,13652,13653,13654,13655,13656,13657,13658,13659,13660,13661,13662,13663,13664,13665,13666,13667,13668,13669,13670,13671,13672,13673,13674,13675,13676,13677,13678,13679,13680,13681,13682,13683,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13696,13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13708,13709,13710,13711,13712,13713,13714,13715,13716,13717,13718,13719,13720,13721,13722,13723,13724,13725,13726,13727,13728,13729,13730,13731,13732,13733,13734,13735,13736,13737,13738,13739,13740,13741,13742,13743,13744,13745,13746,13747,13748,13749,13750,13751,13752,13753,13754,13755,13756,13757,13758,13759,13760,13761,13762,13763,13764,13765,13766,13767,13768,13769,13770,13771,13772,13773,13774,3273,13775,13776,13777,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13790,13791,13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13802,13803,13804,13805,13806,13807,13808,13809,13810,13811,13812,13813,13814,13815,13816,13817,13818,13819,13820,13821,13822,13823,13824,13825,13826,13827,13828,13829,13830,13831,13832,13833,13834,13835,13836,13837,13838,13839,13840,13841,13842,13843,13844,13845,13846,13847,13848,13849,13850,13851,13852,13853,13854,13855,13856,13857,13858,13859,13860,13861,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871,13872,13873,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,13886,13887,13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13902,13903,13904,13905,13906,13907,13908,13909,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919,13920,13921,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,13932,13933,13934,13935,13936,13937,13938,13939,13940,13941,13942,13943,13944,13945,13946,13947,13948,13949,13950,13951,13952,13953,13954,13955,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967,13968,13969,13970,13971,13972];var K=t0,n0=i0,h0=s0,l0=a0,c0=o0;function E(){var e=1024,o=.99,i=.01,h=3,a=this;function n(){a._mCharToFreqOrder=null,a._mTableSize=null,a._mTypicalDistributionRatio=null,a.reset()}this.reset=function(){this._mDone=!1,this._mTotalChars=0,this._mFreqChars=0},this.feed=function(l,T){if(T==2)var A=this.getOrder(l);else A=-1;A>=0&&(this._mTotalChars++,Athis._mCharToFreqOrder[A]&&this._mFreqChars++)},this.getConfidence=function(){if(this._mTotalChars<=0||this._mFreqChars<=h)return i;if(this._mTotalChars!=this._mFreqChars){var l=this._mFreqChars/((this._mTotalChars-this._mFreqChars)*this._mTypicalDistributionRatio);if(le},this.getOrder=function(l){return-1},n()}L.CharDistributionAnalysis=E;function w0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=n0.EUCTWCharToFreqOrder,e._mTableSize=n0.EUCTW_TABLE_SIZE,e._mTypicalDistributionRatio=n0.EUCTW_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=196?94*(i.charCodeAt(0)-196)+i.charCodeAt(1)-161:-1},o()}w0.prototype=new E;L.EUCTWDistributionAnalysis=w0;function N0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=h0.EUCKRCharToFreqOrder,e._mTableSize=h0.EUCKR_TABLE_SIZE,e._mTypicalDistributionRatio=h0.EUCKR_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=176?94*(i.charCodeAt(0)-176)+i.charCodeAt(1)-161:-1},o()}N0.prototype=new E;L.EUCKRDistributionAnalysis=N0;function D0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=l0.GB2312CharToFreqOrder,e._mTableSize=l0.GB2312_TABLE_SIZE,e._mTypicalDistributionRatio=l0.GB2312_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=176&&i.charCodeAt(1)>=161?94*(i.charCodeAt(0)-176)+i.charCodeAt(1)-161:-1},o()}D0.prototype=new E;L.GB2312DistributionAnalysis=D0;function B0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=c0.Big5CharToFreqOrder,e._mTableSize=c0.BIG5_TABLE_SIZE,e._mTypicalDistributionRatio=c0.BIG5_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=164?i.charCodeAt(1)>=161?157*(i.charCodeAt(0)-164)+i.charCodeAt(1)-161+63:157*(i.charCodeAt(0)-164)+i.charCodeAt(1)-64:-1},o()}B0.prototype=new E;L.Big5DistributionAnalysis=B0;function U0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=K.JISCharToFreqOrder,e._mTableSize=K.JIS_TABLE_SIZE,e._mTypicalDistributionRatio=K.JIS_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){if(i.charCodeAt(0)>=129&&i.charCodeAt(0)<=159)var h=188*(i.charCodeAt(0)-129);else if(i.charCodeAt(0)>=224&&i.charCodeAt(0)<=239)h=188*(i.charCodeAt(0)-224+31);else return-1;return h+=i.charCodeAt(1)-64,(i.charCodeAt(1)<64||i.charCodeAt(1)===127||i.charCodeAt(1)>252)&&(h=-1),h},o()}U0.prototype=new E;L.SJISDistributionAnalysis=U0;function x0(){E.apply(this);var e=this;function o(){e._mCharToFreqOrder=K.JISCharToFreqOrder,e._mTableSize=K.JIS_TABLE_SIZE,e._mTypicalDistributionRatio=K.JIS_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i[0]>=" "?94*(i.charCodeAt(0)-161)+i.charCodeAt(1)-161:-1},o()}x0.prototype=new E;L.EUCJPDistributionAnalysis=x0;var p1=G,$0=Z,O1=A1,y1=L.Big5DistributionAnalysis;function H0(){$0.apply(this);var e=this;function o(){e._mCodingSM=new p1(O1),e._mDistributionAnalyzer=new y1,e.reset()}this.getCharsetName=function(){return"Big5"},o()}H0.prototype=new $0;var I1=H0,t=S,L1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,9,8,8,10,11,11,11,11,11,11,11,12,13,13,13,14,15,0,0],E1=[t.error,t.start,t.error,t.error,t.error,t.error,12,10,9,11,8,7,6,5,4,3,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.error,t.error,5,5,5,5,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,5,5,5,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,7,7,7,7,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,7,7,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,9,9,9,9,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,9,9,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,12,12,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,12,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.start,t.start,t.start,t.start,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error],P1=[0,1,0,0,0,0,2,3,3,3,4,4,5,5,6,6],R1={classTable:L1,classFactor:16,stateTable:E1,charLenTable:P1,name:"UTF-8"},F1=G,G0=J,x=S,w1=R1;function _0(){G0.apply(this);var e=.5,o=this;function i(){o._mCodingSM=new F1(w1),o.reset()}this.reset=function(){_0.prototype.reset.apply(this),this._mCodingSM.reset(),this._mNumOfMBChar=0,this._mMBCharLen=0,this._mFullLen=0,this._mBasicAsciiLen=0},this.getCharsetName=function(){return"UTF-8"},this.feed=function(h){this._mFullLen+=h.length;for(var a=0,n;a=2?(this._mNumOfMBChar++,this._mMBCharLen+=this._mCodingSM.getCurrentCharLen()):n.charCodeAt(0)<128&&this._mBasicAsciiLen++)}return this.getState()==x.detecting&&this.getConfidence()>x.SHORTCUT_THRESHOLD&&(this._mState=x.foundIt),this.getState()},this.getConfidence=function(){var h=.99,a=0,n=this._mFullLen-this._mBasicAsciiLen;return n>0&&(a=this._mMBCharLen/n),this._mNumOfMBChar<6&&a<=.6?(h*=Math.pow(e,this._mNumOfMBChar),1-h):h},i()}_0.prototype=new G0;var N1=_0,g=S,D1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],B1=[g.error,g.start,g.start,3,g.error,g.error,g.error,g.error,g.error,g.error,g.error,g.error,g.itsMe,g.itsMe,g.itsMe,g.itsMe,g.itsMe,g.itsMe,g.error,g.error,g.start,g.start,g.start,g.start],U1=[0,1,1,2,0,0],x1={classTable:D1,classFactor:6,stateTable:B1,charLenTable:U1,name:"Shift_JIS"},f0={};(function(e){e.jp2CharContext=[[0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1],[2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],[0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3,2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4],[1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4],[0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3],[0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3,5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3],[0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3],[0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4],[0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3,1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3],[2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4],[0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3],[0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5,5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5],[0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3],[2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5],[0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0,0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4],[1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4],[0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3],[0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0,3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3],[0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3],[0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5],[0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1,0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4],[0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5],[0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3],[0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4,4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4],[0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4],[0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4],[0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1,0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1],[0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],[1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3],[0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1,1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0],[0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3],[0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3],[0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4,3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5],[0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4],[2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5],[0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4,4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3],[0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3],[0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3],[0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3,5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3],[0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4],[0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4],[0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0,0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2],[0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3],[0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3],[0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3],[0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4],[0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3],[0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4],[0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3],[0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3],[0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4],[0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4],[0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3],[2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4],[0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4],[0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2,3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3],[0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4],[0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4],[1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3,2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4],[0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3],[0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2],[0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1,2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2],[0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3],[0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3],[0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4,4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5],[0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3],[0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4],[1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2,3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4],[0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1,2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2],[0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3],[0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1]];function o(){var a=6,n=-1,l=100,T=1e3,A=4,k=this;function N(){k.reset()}this.reset=function(){this._mTotalRel=0,this._mRelSample=[];for(var P=0;PM)this._mNeedToSkipCharNum=O-M,this._mLastCharOrder=-1;else{if(b!=-1&&this._mLastCharOrder!=-1){if(this._mTotalRel+=1,this._mTotalRel>T){this._mDone=!0;break}this._mRelSample[e.jp2CharContext[this._mLastCharOrder][b]]+=1}this._mLastCharOrder=b}}},this.gotEnoughData=function(){return this._mTotalRel>l},this.getConfidence=function(){return this._mTotalRel>A?(this._mTotalRel-this._mRelSample[0])/this._mTotalRel:n},this.getOrder=function(P){return[-1,1]},N()}function i(){this.getOrder=function(a){if(!a)return[-1,1];if(a.charCodeAt(0)>=129&&a.charCodeAt(0)<=159||a.charCodeAt(0)>=224&&a.charCodeAt(0)<=252)var n=2;else n=1;return a.length>1&&a.charCodeAt(0)==130&&a.charCodeAt(1)>=159&&a.charCodeAt(0)<=241?[a.charCodeAt(1)-159,n]:[-1,n]}}i.prototype=new o,e.SJISContextAnalysis=i;function h(){this.getOrder=function(a){if(!a)return[-1,1];if(a.charCodeAt(0)>=142||a.charCodeAt(0)>=161&&a.charCodeAt(0)<=254)var n=2;else a.charCodeAt(0)==143?n=3:n=1;return a.length>1&&a.charCodeAt(0)==164&&a.charCodeAt(1)>=161&&a.charCodeAt(1)<=243?[a.charCodeAt(1)-161,n]:[-1,n]}}h.prototype=new o,e.EUCJPContextAnalysis=h})(f0);var $1=G,q0=Z,H1=x1,G1=L.SJISDistributionAnalysis,q1=f0.SJISContextAnalysis,$=S,J1=w;function m0(){q0.apply(this);var e=this;function o(){e._mCodingSM=new $1(H1),e._mDistributionAnalyzer=new G1,e._mContextAnalyzer=new q1,e.reset()}this.reset=function(){m0.prototype.reset.apply(this),this._mContextAnalyzer.reset()},this.getCharsetName=function(){return"SHIFT_JIS"},this.feed=function(i){for(var h=i.length,a=0;a$.SHORTCUT_THRESHOLD&&(this._mState=$.foundIt),this.getState()},this.getConfidence=function(){var i=this._mContextAnalyzer.getConfidence(),h=this._mDistributionAnalyzer.getConfidence();return Math.max(i,h)},o()}m0.prototype=new q0;var k1=m0,C=S,z1=[4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,4,4,4,4,4,4,4,4,4,4,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5],W1=[3,4,3,5,C.start,C.error,C.error,C.error,C.error,C.error,C.error,C.error,C.itsMe,C.itsMe,C.itsMe,C.itsMe,C.itsMe,C.itsMe,C.start,C.error,C.start,C.error,C.error,C.error,C.error,C.error,C.start,C.error,C.error,C.error,3,C.error,3,C.error,C.error,C.error,C.start,C.start,C.start,C.start],K1=[2,2,2,3,1,0],Z1={classTable:z1,classFactor:6,stateTable:W1,charLenTable:K1,name:"EUC-JP"},j1=G,J0=Z,V1=L.EUCJPDistributionAnalysis,Y1=f0.EUCJPContextAnalysis,X1=Z1,H=S,Q1=w;function d0(){J0.apply(this);var e=this;function o(){e._mCodingSM=new j1(X1),e._mDistributionAnalyzer=new V1,e._mContextAnalyzer=new Y1,e.reset()}this.reset=function(){d0.prototype.reset.apply(this),this._mContextAnalyzer.reset()},this.getCharsetName=function(){return"EUC-JP"},this.feed=function(i){for(var h=i.length,a=0;aH.SHORTCUT_THRESHOLD&&(this._mState=H.foundIt),this.getState()},this.getConfidence=function(){var i=this._mContextAnalyzer.getConfidence(),h=this._mDistributionAnalyzer.getConfidence();return Math.max(i,h)},o()}d0.prototype=new J0;var r2=d0,c=S,e2=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0],t2=[c.error,c.start,c.start,c.start,c.start,c.start,3,c.error,c.error,c.error,c.error,c.error,c.error,c.error,c.itsMe,c.itsMe,c.itsMe,c.itsMe,c.itsMe,c.itsMe,c.itsMe,c.error,c.error,c.start,4,c.error,c.start,c.start,c.error,c.error,c.error,c.error,c.error,c.error,5,c.error,c.error,c.error,c.itsMe,c.error,c.error,c.error,c.start,c.start,c.start,c.start,c.start,c.start],i2=[0,1,1,1,1,1,2],s2={classTable:e2,classFactor:7,stateTable:t2,charLenTable:i2,name:"GB2312"},k0=Z,a2=G,o2=s2,n2=L.GB2312DistributionAnalysis;function z0(){k0.apply(this);var e=this;function o(){e._mCodingSM=new a2(o2),e._mDistributionAnalyzer=new n2,e.reset()}this.getCharsetName=function(){return"GB2312"},o()}z0.prototype=new k0;var h2=z0,y=S,l2=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],c2=[y.error,y.start,3,y.error,y.error,y.error,y.error,y.error,y.itsMe,y.itsMe,y.itsMe,y.itsMe,y.error,y.error,y.start,y.start],u2=[0,1,2,0],C2={classTable:l2,classFactor:4,stateTable:c2,charLenTable:u2,name:"EUC-KR"},_2=G,W0=Z,f2=L.EUCKRDistributionAnalysis,m2=C2;function K0(){W0.apply(this);var e=this;function o(){e._mCodingSM=new _2(m2),e._mDistributionAnalyzer=new f2,e.reset()}this.getCharsetName=function(){return"EUC-KR"},o()}K0.prototype=new W0;var d2=K0,u=S,M2=[2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,4,4,4,4,4,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],v2=[u.error,u.error,u.start,3,3,3,4,u.error,u.error,u.error,u.error,u.error,u.error,u.error,u.itsMe,u.itsMe,u.itsMe,u.itsMe,u.itsMe,u.itsMe,u.itsMe,u.error,u.start,u.error,u.start,u.start,u.start,u.error,u.error,u.error,u.error,u.error,5,u.error,u.error,u.error,u.start,u.error,u.start,u.start,u.start,u.error,u.start,u.start,u.start,u.start,u.start,u.start],g2=[0,0,1,2,2,2,3],T2={classTable:M2,classFactor:7,stateTable:v2,charLenTable:g2,name:"x-euc-tw"},b2=G,Z0=Z,S2=L.EUCTWDistributionAnalysis,A2=T2;function j0(){Z0.apply(this);var e=this;function o(){e._mCodingSM=new b2(A2),e._mDistributionAnalyzer=new S2,e.reset()}this.getCharsetName=function(){return"EUC-TW"},o()}j0.prototype=new Z0;var p2=j0,V0=R0,O2=I1,y2=N1,I2=k1,L2=r2,E2=h2,P2=d2,R2=p2;function Y0(){V0.apply(this),this._mProbers=[new y2,new I2,new L2,new E2,new P2,new O2,new R2],this.reset()}Y0.prototype=new V0;var F2=Y0,X0=J,S0=S,A0=w;function M0(e,o,i){X0.apply(this);var h=64,a=1024,n=.95,l=.05,T=250,A=4,k=A-1,N=this;function P(M,O,D){N._mModel=M,N._mReversed=O,N._mNameProber=D,N.reset()}this.reset=function(){M0.prototype.reset.apply(this),this._mLastOrder=255,this._mSeqCounters=[];for(var M=0;Ma){var B=this.getConfidence();B>n?A0.log(this._mModel.charsetName+" confidence = "+B+`, we have a winner -`):B0&&(M=1*this._mSeqCounters[k]/this._mTotalSeqs/this._mModel.mTypicalPositiveRatio,M*=this._mFreqChar/this._mTotalChar,M>=1&&(M=.99)),M},o=o!==void 0?o:!1,i=i!==void 0?i:null,P(e,o,i)}M0.prototype=new X0;var w2=M0,Q0={};(function(e){e.win1255_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,69,91,79,80,92,89,97,90,68,111,112,82,73,95,85,78,121,86,71,67,102,107,84,114,103,115,253,253,253,253,253,253,50,74,60,61,42,76,70,64,53,105,93,56,65,54,49,66,110,51,43,44,63,81,77,98,75,108,253,253,253,253,253,124,202,203,204,205,40,58,206,207,208,209,210,211,212,213,214,215,83,52,47,46,72,32,94,216,113,217,109,218,219,220,221,34,116,222,118,100,223,224,117,119,104,125,225,226,87,99,227,106,122,123,228,55,229,230,101,231,232,120,233,48,39,57,234,30,59,41,88,33,37,36,31,29,35,235,62,28,236,126,237,238,38,45,239,240,241,242,243,127,244,245,246,247,248,249,250,9,8,20,16,3,2,24,14,22,1,25,15,4,11,6,23,12,19,13,26,18,27,21,17,7,10,5,251,252,128,96,253],e.HebrewLangModel=[0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0,3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,1,2,1,3,1,1,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,1,2,2,1,3,1,2,1,1,2,2,0,0,2,2,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,2,3,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,3,2,2,2,1,2,2,2,2,1,2,1,1,2,2,0,1,2,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2,0,2,1,2,2,2,0,0,2,1,0,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,3,2,2,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,2,0,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,2,3,2,1,2,1,1,1,0,1,1,1,1,1,3,0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,1,2,3,3,2,3,3,3,3,2,3,2,1,2,0,2,1,2,0,2,0,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,1,2,2,3,3,2,3,2,3,2,2,3,1,2,2,0,2,2,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,2,2,3,3,3,3,1,3,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,3,2,2,2,1,2,2,0,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,1,3,2,3,3,2,3,3,2,2,1,2,2,2,2,2,2,0,2,1,2,1,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,2,3,3,2,3,3,3,3,2,3,2,3,3,3,3,3,2,2,2,2,2,2,2,1,0,2,0,1,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,1,2,3,3,3,3,3,3,3,2,3,2,3,2,1,2,3,0,2,1,2,2,0,2,1,1,2,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,1,3,1,2,2,2,1,2,3,3,1,2,1,2,2,2,2,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,1,3,3,3,1,2,2,2,2,1,1,2,2,2,2,2,2,0,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,2,2,3,3,3,2,1,2,3,2,3,2,2,2,2,1,2,1,1,1,2,2,0,2,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,3,1,2,2,2,2,3,2,3,1,1,2,2,1,2,2,1,1,0,2,2,2,2,0,1,0,1,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,2,2,1,2,2,2,2,2,2,2,1,2,2,1,2,2,1,1,1,1,1,1,1,1,2,1,1,0,3,3,3,0,3,0,2,2,2,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,1,1,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,0,2,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,2,2,2,1,2,2,2,1,1,2,2,2,2,2,2,2,1,2,2,1,0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,1,1,1,1,2,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,2,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,1,2,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,1,2,1,2,1,2,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,2,1,2,1,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,1,1,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,2,1,2,2,2,0,2,0,2,0,1,1,2,1,1,1,1,2,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,2,2,0,1,0,0,1,1,2,2,1,2,0,2,0,0,0,1,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,1,2,0,2,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,1,2,2,0,0,1,0,0,0,1,0,0,1,1,1,2,1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,2,1,0,2,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1,2,1,1,2,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,0,0,2,1,1,2,0,2,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,2,2,1,2,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,1,1,1,0,2,1,1,0,0,0,2,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,0,2,1,1,0,1,0,0,0,1,1,0,1,2,2,1,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,0,1,2,1,0,2,0,0,0,1,1,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,2,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,2,1,1,1,1,1,0,1,0,0,0,0,1,0,1,0,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0],e.Win1255HebrewModel={charToOrderMap:e.win1255_CharToOrderMap,precedenceMatrix:e.HebrewLangModel,mTypicalPositiveRatio:.984004,keepEnglishLetter:!1,charsetName:"windows-1255"}})(Q0);var r1=J,q=S;Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var o=this.length>>>0,i=Number(arguments[1])||0;for(i=i<0?Math.ceil(i):Math.floor(i),i<0&&(i+=o);i=k)return M;if(b<=-k)return P;var p=this._mLogicalProber.getConfidence()-this._mVisualProber.getConfidence();return p>N?M:p<-N||b<0?P:M},this.getState=function(){return this._mLogicalProber.getState()==q.notMe&&this._mVisualProber.getState()==q.notMe?q.notMe:q.detecting},D()}e1.prototype=new r1;var N2=e1,t1={};(function(e){e.KOI8R_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,68,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,27,3,21,28,13,2,39,19,26,4,23,11,8,12,5,1,15,16,9,7,6,14,24,10,17,18,20,25,30,29,22,54,59,37,44,58,41,48,53,46,55,42,60,36,49,38,31,34,35,43,45,32,40,52,56,33,61,62,51,57,47,63,50,70],e.win1251_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,68,247,248,249,250,251,252,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16],e.latin5_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255],e.macCyrillic_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,68,16,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,255],e.IBM855_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,68,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,27,59,54,70,3,37,21,44,28,58,13,41,2,48,39,53,19,46,218,219,220,221,222,223,224,26,55,4,42,225,226,227,228,23,60,229,230,231,232,233,234,235,11,36,236,237,238,239,240,241,242,243,8,49,12,38,5,31,1,34,15,244,245,246,247,35,16,248,43,9,45,7,32,6,40,14,52,24,56,10,33,17,61,249,250,18,62,20,51,25,57,30,47,29,63,22,50,251,252,255],e.IBM866_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255],e.RussianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,0,2,2,3,3,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,1,2,3,2,2,3,2,3,3,3,3,2,2,3,0,3,2,2,3,1,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,3,3,3,3,2,2,2,0,3,3,3,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,2,3,2,2,0,1,3,2,1,2,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,1,3,0,1,1,1,1,2,1,1,0,2,2,2,1,2,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,2,2,2,2,1,3,2,3,2,3,2,1,2,2,0,1,1,2,1,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,2,2,2,2,0,2,2,2,2,3,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,2,3,2,2,3,3,3,3,3,3,3,3,3,1,3,2,0,0,3,3,3,3,2,3,3,3,3,2,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,2,3,3,0,2,1,0,3,2,3,2,3,0,0,1,2,0,0,1,0,1,2,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,2,3,3,3,3,2,3,3,3,3,1,2,2,0,0,2,3,2,2,2,3,2,3,2,2,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,2,3,2,3,0,1,2,3,3,2,0,2,3,0,0,2,3,2,2,0,1,3,1,3,2,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,0,2,3,3,3,3,3,3,3,3,2,1,3,2,0,0,2,2,3,3,3,2,3,3,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,2,2,2,3,3,0,0,1,1,1,1,1,2,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,0,3,2,3,3,2,3,2,0,2,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,2,2,2,3,1,3,2,3,1,1,2,1,0,2,2,2,2,1,3,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,2,3,3,3,3,3,1,2,2,1,3,1,0,3,0,0,3,0,0,0,1,1,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,1,1,3,3,3,2,2,1,2,2,3,1,1,2,0,0,2,2,1,3,0,0,2,1,1,2,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,3,3,1,2,2,2,1,2,1,3,3,1,1,2,1,2,1,2,2,0,2,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,1,3,2,2,3,2,0,3,2,0,3,0,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,3,3,2,2,2,3,3,1,2,1,2,1,0,1,0,1,1,0,1,0,0,2,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,1,1,2,1,2,3,3,2,2,1,2,2,3,0,2,1,0,0,2,2,3,2,1,2,2,2,2,2,3,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,1,0,1,1,2,2,1,1,3,0,0,1,3,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,3,3,3,2,0,0,0,2,1,0,1,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,2,3,2,2,2,1,2,2,2,1,2,1,0,0,1,1,1,0,2,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,0,0,0,1,0,0,0,0,3,0,1,2,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,0,1,2,0,0,1,1,2,1,0,1,1,1,1,0,1,1,1,1,0,1,0,0,1,0,0,1,1,0,2,2,3,2,2,2,3,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,0,1,0,1,1,1,0,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,0,3,3,3,2,2,2,2,3,2,2,1,1,2,2,2,2,1,1,3,1,2,1,2,0,0,1,1,0,1,0,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0,2,0,0,1,0,3,2,2,2,2,1,2,1,2,1,2,0,0,0,2,1,2,2,1,1,2,2,0,1,1,0,2,1,1,1,1,1,0,1,1,1,2,1,1,1,2,1,0,1,2,1,1,1,1,0,1,1,1,0,0,1,0,0,1,1,3,2,2,2,1,1,1,2,3,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,2,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,3,2,3,2,1,2,2,2,2,1,0,0,0,2,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,2,1,1,1,2,1,0,2,0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,3,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,0,0,0,2,1,2,1,1,1,2,2,0,0,0,1,2,1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,2,3,2,3,3,2,0,1,1,1,0,0,1,0,2,0,1,1,3,1,0,0,0,0,0,0,0,1,0,0,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0,2,3,3,3,3,1,2,2,2,2,0,1,1,0,2,1,1,1,2,1,0,1,1,0,0,1,0,1,0,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,2,0,0,1,1,2,2,1,0,0,2,0,1,1,3,0,0,1,0,0,0,0,0,1,0,1,2,1,1,1,2,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,3,2,3,2,1,0,0,2,2,2,0,1,0,2,0,1,1,1,0,1,0,0,0,3,0,1,1,0,0,2,1,1,1,1,0,1,1,0,0,0,0,1,1,0,1,0,0,2,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0,3,1,2,1,1,2,2,2,2,2,2,1,2,2,1,1,0,0,0,2,2,2,0,0,0,1,2,1,0,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,1,1,1,0,1,0,1,1,0,1,1,1,0,0,1,3,0,0,0,0,2,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,1,3,3,2,2,0,0,0,2,2,0,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,1,0,0,2,1,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,2,3,2,3,2,0,0,0,0,1,1,0,0,0,2,0,2,0,2,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,2,0,1,2,1,0,1,1,2,1,1,1,1,1,2,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,3,2,2,2,1,0,0,2,2,1,0,1,2,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,3,1,2,2,2,2,2,2,1,1,0,0,0,1,0,1,0,2,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,2,0,0,1,0,3,2,1,2,1,2,2,0,1,0,0,0,2,1,0,0,2,1,1,1,1,0,2,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,2,2,2,2,1,0,0,1,0,0,0,0,0,2,0,1,1,1,1,0,0,0,0,1,0,1,2,0,0,2,0,1,0,1,1,1,2,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,0,2,1,2,2,2,0,3,0,1,1,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,2,2,3,2,2,0,0,1,1,2,0,1,2,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,2,1,1,2,1,2,2,2,2,2,1,2,2,0,1,0,0,0,1,2,2,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,2,2,2,2,0,1,0,2,2,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,2,2,2,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,0,1,0,0,1,1,2,0,0,0,0,1,0,1,0,0,1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,1,1,2,0,2,1,1,1,1,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],e.Koi8rModel={charToOrderMap:e.KOI8R_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"KOI8-R"},e.Win1251CyrillicModel={charToOrderMap:e.win1251_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"windows-1251"},e.Latin5CyrillicModel={charToOrderMap:e.latin5_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"ISO-8859-5"},e.MacCyrillicModel={charToOrderMap:e.macCyrillic_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"x-mac-cyrillic"},e.Ibm866Model={charToOrderMap:e.IBM866_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM866"},e.Ibm855Model={charToOrderMap:e.IBM855_CharToOrderMap,precedenceMatrix:e.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM855"}})(t1);var i1={};(function(e){e.Latin7_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,90,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253,253,247,248,61,36,46,71,73,253,54,253,108,123,110,31,51,43,41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253],e.win1253_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,61,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253,253,247,253,253,36,46,71,73,253,54,253,108,123,110,31,51,43,41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253],e.GreekLangModel=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,3,0,3,2,3,3,0,3,2,3,3,3,0,0,3,0,3,0,3,3,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,3,2,2,3,3,3,3,3,3,3,3,0,3,3,3,3,0,2,3,3,0,3,3,3,3,2,3,3,3,0,2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,2,1,3,3,3,3,2,3,3,2,3,3,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,2,3,3,0,2,0,1,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,0,0,0,0,3,3,0,3,1,3,3,3,0,3,3,0,3,3,3,3,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,0,3,3,3,3,3,0,3,2,2,2,3,0,2,3,3,3,3,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,2,3,3,3,3,0,3,1,3,3,3,3,2,3,3,3,3,3,3,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,0,0,0,3,3,2,3,3,3,3,3,0,0,3,2,3,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,0,3,3,0,2,3,0,3,0,3,3,3,0,0,3,0,3,0,2,2,3,3,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,2,3,3,3,3,0,3,3,3,3,3,0,3,3,2,3,2,3,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,3,3,3,3,3,0,2,3,2,3,2,2,2,3,2,3,3,2,3,0,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,3,3,2,3,3,0,0,3,0,3,0,0,0,3,2,0,3,0,3,0,0,2,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,0,0,0,3,3,0,3,3,3,0,0,1,2,3,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,0,3,2,2,3,3,0,3,3,3,3,3,2,1,3,0,3,2,3,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,2,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,3,0,3,2,3,0,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,2,0,3,2,3,0,0,3,2,3,0,2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,3,3,3,3,3,3,0,2,3,0,3,0,0,0,3,3,0,3,0,2,0,0,2,3,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,3,0,3,3,2,3,0,3,3,3,3,3,3,0,3,3,3,0,2,3,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,3,3,0,3,0,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,3,3,3,3,3,0,0,3,0,2,0,0,0,3,3,0,3,0,3,0,0,2,0,2,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0,3,0,2,0,3,2,0,3,2,3,2,3,0,0,3,2,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,3,3,0,0,0,3,0,2,1,0,0,3,2,2,2,0,3,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,2,0,3,0,3,0,3,3,0,2,1,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,0,3,3,3,3,3,3,0,2,3,0,3,0,0,0,2,1,0,2,2,3,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,2,3,0,0,1,3,0,2,0,0,0,0,3,0,1,0,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,0,3,0,0,0,3,2,0,3,2,3,3,3,0,0,3,0,3,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,0,2,0,2,3,3,2,2,2,2,3,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,0,0,0,0,0,0,2,3,0,2,0,2,3,2,0,0,3,0,3,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,2,3,0,2,0,3,0,0,0,2,0,0,0,0,1,2,0,2,0,2,0,0,2,0,2,0,2,2,0,0,1,0,2,2,2,0,2,2,2,0,2,2,2,0,0,2,0,0,1,0,0,0,0,0,2,0,3,3,2,0,0,0,0,0,0,1,3,0,2,0,2,2,2,0,0,2,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,2,0,2,2,0,2,0,2,2,0,2,0,2,2,2,0,0,0,0,0,0,2,3,0,0,0,2,0,1,2,0,0,0,0,2,2,0,0,0,2,1,0,2,2,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,2,1,0,2,3,2,2,3,2,3,2,0,0,3,3,3,0,0,3,2,0,0,0,1,1,0,2,0,2,2,0,2,0,2,0,2,2,0,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,0,2,0,1,0,0,0,0,0,3,0,3,3,2,2,0,3,0,0,0,2,2,0,2,2,2,1,2,0,0,1,2,2,0,0,3,0,0,0,2,0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,2,2,0,1,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,2,0,0,0,2,0,2,3,3,0,2,0,0,0,0,0,0,2,2,2,0,2,2,0,2,0,2,0,2,2,0,0,2,2,2,2,1,0,0,2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,3,2,3,0,0,0,3,0,0,2,2,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,2,0,2,2,2,2,2,0,0,0,2,0,0,0,0,2,0,1,0,0,2,0,1,0,0,0,0,2,2,2,0,2,2,0,1,2,0,2,2,2,0,2,2,2,2,1,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,2,0,2,2,0,0,0,0,1,2,1,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,0,2,0,0,0,2,2,0,2,0,0,0,1,0,0,2,0,2,0,2,2,0,0,0,0,0,0,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,2,3,2,2,0,0,0,0,0,0,1,3,0,2,0,2,2,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,3,2,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,1,0,0,2,1,2,0,2,2,0,1,0,0,1,0,0,0,2,0,0,0,0,0,0,0,3,0,2,2,2,0,0,2,0,0,0,2,0,0,0,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,2,0,1,2,0,0,0,1,2,2,1,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,2,2,0,2,0,0,2,0,0,0,0,1,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,1,2,2,0,2,0,0,0,0,2,0,0,0,2,0,0,3,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,2,0,2,2,0,0,2,2,2,2,2,0,1,2,0,0,0,2,2,0,1,0,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2,0,1,2,0,0,0,0,2,2,1,0,1,0,1,0,2,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,0,0,1,0,0,0,0,0,0,2,0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,2,2,2,0,0,0,2,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,2,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,2,0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,3,0,0,0,2,2,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e.Latin7GreekModel={charToOrderMap:e.Latin7_CharToOrderMap,precedenceMatrix:e.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1,charsetName:"ISO-8859-7"},e.Win1253GreekModel={charToOrderMap:e.win1253_CharToOrderMap,precedenceMatrix:e.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1,charsetName:"windows-1253"}})(i1);var s1={};(function(e){e.TIS620CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,182,106,107,100,183,184,185,101,94,186,187,108,109,110,111,188,189,190,89,95,112,113,191,192,193,194,253,253,253,253,253,253,64,72,73,114,74,115,116,102,81,201,117,90,103,78,82,96,202,91,79,84,104,105,97,98,92,203,253,253,253,253,253,209,210,211,212,213,88,214,215,216,217,218,219,220,118,221,222,223,224,99,85,83,225,226,227,228,229,230,231,232,233,234,235,236,5,30,237,24,238,75,8,26,52,34,51,119,47,58,57,49,53,55,43,20,19,44,14,48,3,17,25,39,62,31,54,45,9,16,2,61,15,239,12,42,46,18,21,76,4,66,63,22,10,1,36,23,13,40,27,32,35,86,240,241,242,243,244,11,28,41,29,33,245,50,37,6,7,67,77,38,93,246,247,68,56,59,65,69,60,70,80,71,87,248,249,250,251,252,253],e.ThaiLangModel=[0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3,0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2,3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3,0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2,3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,2,2,3,3,3,3,1,2,3,3,3,3,3,2,2,2,2,3,3,2,2,3,3,2,2,3,2,3,2,2,3,3,1,2,3,1,2,2,3,3,1,0,2,1,0,0,3,1,2,1,0,0,1,0,0,0,0,0,0,1,0,1,3,3,3,3,3,3,2,2,3,3,3,3,2,3,2,2,3,3,2,2,3,2,2,2,2,1,1,3,1,2,1,1,3,2,1,0,2,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,2,2,3,2,3,3,2,3,1,1,2,3,2,2,2,3,2,2,2,2,2,1,2,1,2,2,1,1,3,3,2,1,0,1,2,2,0,1,3,0,0,0,1,1,0,0,0,0,0,2,3,0,0,2,1,1,3,3,2,3,3,2,0,0,3,3,0,3,3,0,2,2,3,1,2,2,1,1,1,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,0,0,3,3,0,2,3,0,2,1,2,2,2,2,1,2,0,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,2,0,2,2,1,3,2,1,3,2,1,2,3,2,2,3,0,2,3,2,2,1,2,2,2,2,1,2,2,0,0,0,0,2,0,1,2,0,1,1,1,0,1,0,3,1,1,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,3,2,2,2,3,2,2,3,2,2,1,2,3,2,2,3,1,3,2,2,2,3,2,2,2,3,3,2,1,3,0,1,1,1,0,2,1,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,3,0,3,3,3,3,3,0,0,3,0,2,2,3,3,3,3,3,0,0,0,1,1,3,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,2,3,0,0,0,3,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,3,3,3,3,0,0,2,3,0,0,3,0,3,3,2,3,3,3,3,3,0,0,3,3,3,0,0,0,3,3,0,0,3,0,0,0,0,2,0,0,2,1,1,3,0,0,1,0,0,2,3,0,1,0,0,0,0,0,0,0,1,0,3,3,3,3,2,3,3,3,3,3,3,3,1,2,1,3,3,2,2,1,2,2,2,3,1,1,2,0,2,1,2,1,2,2,1,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,3,0,2,1,2,3,3,3,0,2,0,2,2,0,2,1,3,2,2,1,2,1,0,0,2,2,1,0,2,1,2,2,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,3,1,1,3,0,2,3,1,1,3,2,1,1,2,0,2,2,3,2,1,1,1,1,1,2,3,0,0,1,3,1,2,1,2,0,3,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,1,1,3,2,3,3,3,1,3,2,1,3,2,1,3,2,2,2,2,1,3,3,1,2,1,3,1,2,3,0,2,1,1,3,2,2,2,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,3,2,3,3,2,3,2,3,2,3,3,2,1,0,3,2,2,2,1,2,2,2,1,2,2,1,2,1,1,2,2,2,3,0,1,3,1,1,1,1,0,1,1,0,2,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,3,2,2,1,1,3,2,3,2,3,2,0,3,2,2,1,2,0,2,2,2,1,2,2,2,2,1,3,2,1,2,2,1,0,2,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,3,1,2,3,3,2,2,3,0,1,1,2,0,3,3,2,2,3,0,1,1,3,0,0,0,0,3,1,0,3,3,0,2,0,2,1,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,0,1,3,1,1,2,1,2,1,1,3,1,1,0,2,3,1,1,1,1,1,1,1,1,3,1,1,2,2,2,2,1,1,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,2,1,1,2,1,3,3,2,3,2,2,3,2,2,3,1,2,2,1,2,0,3,2,1,2,2,2,2,2,1,3,2,1,2,2,2,1,1,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,1,3,3,0,2,1,0,3,2,0,0,3,1,0,1,1,0,1,0,0,0,0,0,1,1,0,0,1,0,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,2,2,3,0,0,1,3,0,3,2,0,3,2,2,3,3,3,3,3,1,0,2,2,2,0,2,2,1,2,0,2,3,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0,2,3,1,3,3,2,3,3,0,3,3,0,3,2,2,3,2,3,3,3,0,0,2,2,3,0,1,1,1,3,0,0,3,0,0,0,2,2,0,1,3,0,1,2,2,2,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,3,2,3,3,2,0,3,3,2,2,3,1,3,2,1,3,2,0,1,2,2,0,2,3,2,1,0,3,0,0,0,0,3,0,0,2,3,1,3,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,2,2,2,1,2,0,1,3,1,1,3,1,3,0,0,2,1,1,1,1,2,1,1,1,0,2,1,0,1,1,2,0,0,0,3,1,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,3,1,0,0,0,1,0,3,3,3,3,2,2,2,2,2,1,3,1,1,1,2,0,1,1,2,1,2,1,3,2,0,0,3,1,1,1,1,1,3,1,0,2,3,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,3,3,0,2,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,3,0,0,1,2,0,0,2,0,3,3,2,3,3,3,2,3,0,0,2,2,2,0,0,0,2,2,0,0,1,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,1,2,3,1,3,3,0,0,1,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,2,3,1,2,3,1,0,3,0,2,2,1,0,2,1,1,2,0,1,0,0,1,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,0,1,1,1,3,1,2,2,2,2,2,2,1,1,1,1,0,3,1,0,1,3,1,1,1,1,1,1,0,2,0,1,3,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,3,0,2,2,1,3,3,2,3,3,0,1,1,0,2,2,1,2,1,3,3,1,0,0,3,2,0,0,0,0,2,1,0,1,0,0,0,0,1,2,0,1,1,3,1,1,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,3,0,0,3,0,3,1,0,1,1,1,3,2,0,0,0,3,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,1,3,2,1,3,3,1,2,2,0,1,2,1,0,1,2,0,0,0,0,0,3,0,0,0,3,0,0,0,0,3,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,2,0,3,3,3,2,2,0,1,1,0,1,3,0,0,0,2,2,0,0,0,0,3,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,1,2,0,0,2,1,0,3,1,0,1,2,0,1,1,1,1,3,0,0,3,1,1,0,2,2,1,1,0,2,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3,1,2,0,0,2,2,0,1,2,0,1,0,1,3,1,2,1,0,0,0,2,0,3,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,1,2,2,0,0,0,2,0,2,1,0,1,1,0,1,1,1,2,1,0,0,1,1,1,0,2,1,1,1,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,2,0,1,3,1,1,1,1,0,0,0,0,3,2,0,1,0,0,0,1,2,0,0,0,1,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,3,2,2,0,0,0,1,0,0,0,0,2,3,2,1,2,2,3,0,0,0,2,3,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,3,3,2,2,0,1,0,0,0,0,2,0,2,0,1,0,0,0,1,1,0,0,0,2,1,0,1,0,1,1,0,0,0,1,0,2,0,0,1,0,3,0,1,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,0,0,1,0,0,0,0,0,1,1,2,0,0,0,0,1,0,0,1,3,1,0,0,0,0,1,1,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,3,3,1,1,1,1,2,3,0,0,2,1,1,1,1,1,0,2,1,1,0,0,0,2,1,0,1,2,1,1,0,1,2,1,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,0,0,0,0,0,0,1,2,1,0,1,1,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,3,0,1,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0,3,3,0,0,1,1,2,0,0,1,2,1,0,1,1,1,0,1,1,0,0,2,1,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,1,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,2,0,1,2,0,0,1,1,0,2,0,1,0,0,1,0,0,0,0,1,0,0,0,2,0,0,0,0,1,0,0,1,0,1,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,2,1,3,0,0,0,0,1,1,0,0,0,0,0,0,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,1,0,0,2,0,0,2,0,0,1,1,2,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e.TIS620ThaiModel={charToOrderMap:e.TIS620CharToOrderMap,precedenceMatrix:e.ThaiLangModel,mTypicalPositiveRatio:.926386,keepEnglishLetter:!1,charsetName:"TIS-620"}})(s1);var a1={};(function(e){e.Latin2_HungarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,71,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253,253,253,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,75,198,199,200,201,202,203,204,205,79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,81,222,78,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,69,63,239,240,241,82,14,74,242,70,80,243,72,244,15,83,77,84,30,76,85,245,246,247,25,73,42,24,248,249,250,31,56,29,251,252,253],e.win1250HungarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,72,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253,253,253,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,78,181,69,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,76,198,199,200,201,202,203,204,205,81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,83,222,80,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,70,63,239,240,241,84,14,75,242,71,82,243,73,244,15,85,79,86,30,77,87,245,246,247,25,74,42,24,248,249,250,31,56,29,251,252,253],e.HungarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2,3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3,2,2,3,2,3,2,0,3,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2,0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,3,2,1,3,2,2,3,2,1,3,2,2,1,0,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,3,2,2,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,1,3,3,3,3,3,2,2,1,3,3,3,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,1,3,2,2,2,3,1,1,3,3,1,1,0,3,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,2,3,3,3,3,3,1,2,3,2,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,1,3,3,2,2,1,3,3,3,1,1,3,1,2,3,2,3,2,2,2,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,2,2,3,2,1,0,3,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,1,0,3,3,3,3,0,2,3,0,0,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,2,2,2,2,3,3,0,1,2,3,2,3,2,2,3,2,1,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,1,2,3,3,3,2,1,2,3,3,2,2,2,3,2,3,3,1,3,3,1,1,0,2,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,1,2,2,2,2,3,3,3,1,1,1,3,3,1,1,3,1,1,3,2,1,2,3,1,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,1,2,1,1,3,3,1,1,1,1,3,3,1,1,2,2,1,2,1,1,2,2,1,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,1,1,2,1,1,3,3,1,0,1,1,3,3,2,0,1,1,2,3,1,0,2,2,1,0,0,1,3,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,1,3,3,3,3,3,1,2,3,2,3,3,2,1,1,3,2,3,2,1,2,2,0,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,2,2,2,2,3,1,2,2,1,1,3,3,0,3,2,1,2,3,2,1,3,3,1,1,0,2,1,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,2,3,3,3,2,1,1,3,3,1,1,1,2,2,3,2,3,2,2,2,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,3,3,3,3,3,0,0,3,3,2,3,0,0,0,2,3,3,1,0,1,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,3,3,3,3,3,1,2,3,3,2,2,1,1,0,3,3,2,2,1,2,2,1,0,2,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,2,1,3,1,2,3,3,2,2,1,1,2,2,1,1,1,1,3,2,1,1,1,1,2,1,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,3,3,1,1,1,1,1,3,3,3,0,1,1,3,3,1,1,1,1,1,2,2,0,3,1,1,2,0,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,1,0,1,2,1,2,2,0,1,2,3,1,2,0,0,0,2,1,1,1,1,1,2,0,0,1,1,0,0,0,0,1,2,1,2,2,2,1,2,1,2,0,2,0,2,2,1,1,2,1,1,2,1,1,1,0,1,0,0,0,1,1,0,1,1,1,2,3,2,3,3,0,1,2,2,3,1,0,1,0,2,1,2,2,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,2,2,1,0,0,3,2,3,2,0,0,0,1,1,3,0,0,1,1,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,1,0,1,3,2,3,1,1,1,0,1,1,1,1,1,3,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,2,2,2,1,0,1,2,3,3,2,0,0,0,2,1,1,1,2,1,1,1,0,1,1,1,0,0,0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,1,1,0,0,1,1,3,2,2,1,0,0,1,1,2,2,0,3,0,1,2,1,1,0,0,1,1,1,0,1,1,1,1,0,2,1,1,1,2,2,1,1,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,3,1,1,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,3,3,1,0,0,1,2,2,1,0,0,0,0,2,0,0,1,1,1,0,2,1,1,1,2,1,1,1,1,1,1,2,1,1,0,1,1,0,1,1,1,0,1,2,1,1,0,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,2,2,0,0,0,0,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,1,0,2,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,3,2,2,0,1,0,1,0,2,3,2,0,0,1,2,2,1,0,0,1,1,1,0,0,2,1,0,1,2,2,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,0,2,1,0,1,1,0,1,1,1,0,1,1,2,1,1,0,1,2,2,2,0,0,1,0,0,2,2,1,1,0,0,2,1,1,0,0,0,1,2,0,0,2,1,0,0,2,1,1,1,2,1,1,1,1,2,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,1,2,3,0,0,0,1,0,3,2,1,0,0,1,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,2,1,1,1,0,0,0,1,0,1,1,1,1,1,2,0,0,1,0,0,0,2,0,0,1,1,1,1,1,1,1,1,0,1,3,0,0,2,1,2,2,1,0,0,2,1,2,2,0,0,0,2,1,1,1,0,1,1,0,0,1,1,2,0,0,0,1,2,1,2,2,1,1,2,1,2,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,0,0,1,1,3,2,0,0,0,1,0,2,2,2,0,0,0,2,2,1,0,0,0,0,3,1,1,1,1,0,0,2,1,1,1,2,1,0,1,1,1,0,1,1,1,1,1,1,1,0,2,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,1,2,3,2,0,0,0,1,0,2,2,0,0,0,0,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,1,0,2,1,1,1,1,2,1,2,1,2,0,1,1,1,0,2,1,1,1,2,1,1,1,1,0,1,1,1,1,1,0,1,3,1,1,2,2,2,3,2,1,1,2,2,1,1,0,1,0,2,2,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,2,2,0,0,0,0,2,2,1,0,0,0,1,1,0,0,1,2,0,0,2,1,1,1,2,2,1,1,1,2,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,1,1,0,1,2,1,1,1,0,1,1,0,0,1,2,3,2,1,0,0,2,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,1,2,1,2,1,2,1,1,1,2,0,2,1,1,1,0,1,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,3,2,0,0,0,0,0,1,1,2,1,0,0,1,1,1,0,0,0,0,2,0,0,1,1,0,0,2,1,1,1,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,2,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,1,1,1,0,2,2,2,0,0,0,3,2,1,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,0,0,1,1,1,0,1,0,1,2,1,0,2,1,1,2,2,1,1,2,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,0,1,2,3,0,0,0,1,0,2,2,0,0,0,0,2,2,0,0,0,0,0,1,0,0,1,0,0,0,2,0,1,0,2,1,1,1,1,1,0,2,0,0,0,1,2,1,1,1,1,0,1,2,0,1,0,1,0,1,1,1,0,1,0,1,2,2,2,0,0,0,1,0,2,1,2,0,0,0,1,1,2,0,0,0,0,1,0,0,1,1,0,0,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,1,2,2,0,0,0,1,0,2,2,2,0,0,0,1,1,0,0,0,0,0,1,1,0,2,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,1,0,0,1,0,1,2,1,0,0,1,1,1,2,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,0,0,0,2,1,2,1,1,1,1,1,2,0,2,0,1,1,0,1,2,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,1,1,0,1,2,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,2,1,0,1,2,2,1,1,1,1,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,0,0,0,0,1,1,0,0,0,0,2,1,0,0,0,0,0,2,0,0,2,2,0,0,2,0,0,1,2,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,2,0,0,3,1,0,2,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0,1,2,1,0,1,1,1,2,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,2,0,0,0,2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,1,0,1,2,1,1,1,2,1,1,1,0,1,1,2,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,2,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0,1,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,2,0,0,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,2,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,2,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0],e.Latin2HungarianModel={charToOrderMap:e.Latin2_HungarianCharToOrderMap,precedenceMatrix:e.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"ISO-8859-2"},e.Win1250HungarianModel={charToOrderMap:e.win1250HungarianCharToOrderMap,precedenceMatrix:e.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"windows-1250"}})(a1);var o1={};(function(e){e.Latin5_BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,81,226,227,228,229,230,105,231,232,233,234,235,236,45,237,238,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,239,67,240,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,241,42,16,62,242,243,244,58,245,98,246,247,248,249,250,251,91,252,253],e.win1251BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220,221,78,64,83,121,98,117,105,222,223,224,225,226,227,228,229,88,230,231,232,233,122,89,106,234,235,236,237,238,45,239,240,73,80,118,114,241,242,243,244,245,62,58,246,247,248,249,250,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,251,67,252,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,253,42,16],e.BulgarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2,3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3,3,3,3,2,2,2,1,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,2,2,3,3,1,1,2,3,3,2,3,3,3,3,2,1,2,0,2,0,3,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,1,3,3,3,3,3,2,3,2,3,3,3,3,3,2,3,3,1,3,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,1,3,3,2,3,2,2,2,0,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,3,3,1,2,2,3,2,1,1,2,0,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,3,1,2,3,2,2,2,3,3,3,3,3,2,2,3,1,2,0,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,3,3,3,3,2,3,3,3,2,3,3,2,3,2,2,2,3,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,1,1,1,2,2,1,3,1,3,2,2,3,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,2,3,2,2,3,1,2,1,1,1,2,3,1,3,1,2,2,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,2,2,3,3,1,2,3,1,1,3,3,3,3,1,2,2,1,1,1,0,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,2,2,3,3,3,2,2,1,1,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,0,1,2,1,3,3,2,3,3,3,3,3,2,3,2,1,0,3,1,2,1,2,1,2,3,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,1,3,3,2,3,3,2,2,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,3,3,3,3,3,2,1,1,2,1,3,3,0,3,1,1,1,1,3,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,1,1,3,1,3,3,2,3,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,2,3,2,1,1,1,1,1,3,1,3,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,2,0,3,2,0,3,0,2,0,0,2,1,3,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,1,1,1,2,1,1,2,1,1,1,2,2,1,2,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,3,1,1,2,1,3,2,1,1,0,1,2,3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,2,2,1,0,1,0,0,1,0,0,0,2,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,2,3,2,3,3,1,3,2,1,1,1,2,1,1,2,1,3,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,2,3,2,2,2,3,1,2,2,1,1,2,1,1,2,2,0,1,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,1,0,2,2,1,3,2,1,0,0,2,0,2,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,1,2,0,2,3,1,2,3,2,0,1,3,1,2,1,1,1,0,0,1,0,0,2,2,2,3,2,2,2,2,1,2,1,1,2,2,1,1,2,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1,3,3,3,3,3,2,1,2,2,1,2,0,2,0,1,0,1,2,1,2,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,2,3,3,1,1,3,1,0,3,2,1,0,0,0,1,2,0,2,0,1,0,0,0,1,0,1,2,1,2,2,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,0,1,2,1,1,1,0,0,0,0,0,1,1,0,0,3,1,0,1,0,2,3,2,2,2,3,2,2,2,2,2,1,0,2,1,2,1,1,1,0,1,2,1,2,2,2,1,1,1,2,2,2,2,1,2,1,1,0,1,2,1,2,2,2,1,1,1,0,1,1,1,1,2,0,1,0,0,0,0,2,3,2,3,3,0,0,2,1,0,2,1,0,0,0,0,2,3,0,2,0,0,0,0,0,1,0,0,2,0,1,2,2,1,2,1,2,2,1,1,1,2,1,1,1,0,1,2,2,1,1,1,1,1,0,1,1,1,0,0,1,2,0,0,3,3,2,2,3,0,2,3,1,1,2,0,0,0,1,0,0,2,0,2,0,0,0,1,0,1,0,1,2,0,2,2,1,1,1,1,2,1,0,1,2,2,2,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,0,2,3,2,3,3,0,0,3,0,1,1,0,1,0,0,0,2,2,1,2,0,0,0,0,0,0,0,0,2,0,1,2,2,2,1,1,1,1,1,2,2,2,1,0,2,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,3,3,3,3,2,2,2,2,2,0,2,1,1,1,1,2,1,2,1,1,0,2,0,1,0,1,0,0,2,0,1,2,1,1,1,1,1,1,1,2,2,1,1,0,2,0,1,0,2,0,0,1,1,1,0,0,2,0,0,0,1,1,0,0,2,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,0,0,0,1,2,0,1,2,2,2,2,1,1,2,1,1,2,2,2,1,2,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,2,3,3,3,3,0,2,2,0,2,1,0,0,0,1,1,1,2,0,2,0,0,0,3,0,0,0,0,2,0,2,2,1,1,1,2,1,2,1,1,2,2,2,1,2,0,1,1,1,0,1,1,1,1,0,2,1,0,0,0,1,1,0,0,2,3,3,3,3,0,2,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,0,0,0,0,0,0,2,0,1,2,1,1,1,2,1,1,1,1,2,2,2,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,3,3,2,2,3,0,1,0,1,0,0,0,0,0,0,0,1,1,0,3,0,0,0,0,0,0,0,0,1,0,2,2,1,1,1,1,1,2,1,1,2,2,1,2,2,1,0,1,1,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,3,1,0,1,0,2,2,2,2,3,2,1,1,1,2,3,0,0,1,0,2,1,1,0,1,1,1,1,2,1,1,1,1,2,2,1,2,1,2,2,1,1,0,1,2,1,2,2,1,1,1,0,0,1,1,1,2,1,0,1,0,0,0,0,2,1,0,1,0,3,1,2,2,2,2,1,2,2,1,1,1,0,2,1,2,2,1,1,2,1,1,0,2,1,1,1,1,2,2,2,2,2,2,2,1,2,0,1,1,0,2,1,1,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0,2,1,1,1,1,2,2,2,2,1,2,2,2,1,2,2,1,1,2,1,2,3,2,2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,1,2,0,1,2,1,1,0,1,0,1,2,1,2,0,0,0,1,1,0,0,0,1,0,0,2,1,1,0,0,1,1,0,1,1,1,1,0,2,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,2,0,0,0,0,1,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1,1,2,2,2,2,1,1,2,1,2,1,1,1,0,2,1,2,1,1,1,0,2,1,1,1,1,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,1,1,0,0,2,2,2,2,2,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1,2,3,1,2,1,0,1,1,0,2,2,2,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,2,2,2,2,2,0,0,2,0,0,2,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,0,2,2,1,1,1,1,1,0,0,1,2,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,2,0,1,1,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,3,2,0,0,1,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,2,1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,1,2,2,2,1,2,1,2,2,1,1,2,1,1,1,0,1,1,1,1,2,0,1,0,1,1,1,1,0,1,1,1,1,2,1,1,1,1,1,1,0,0,1,2,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,3,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,1,0,0,1,0,2,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,1,0,2,0,1,0,0,1,1,2,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,1,1,0,2,1,0,1,1,1,0,0,1,0,2,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,1,2,1,1,1,1,1,1,2,2,1,0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0,1,1,2,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,2,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],e.Latin5BulgarianModel={charToOrderMap:e.Latin5_BulgarianCharToOrderMap,precedenceMatrix:e.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"ISO-8859-5"},e.Win1251BulgarianModel={charToOrderMap:e.win1251BulgarianCharToOrderMap,precedenceMatrix:e.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"windows-1251"}})(o1);var I=w2,n1=R0,p0=Q0.Win1255HebrewModel,D2=N2,z=t1,O0=i1,B2=s1.TIS620ThaiModel,y0=a1,I0=o1;function h1(){n1.apply(this);var e=this;function o(){e._mProbers=[new I(z.Win1251CyrillicModel),new I(z.Koi8rModel),new I(z.Latin5CyrillicModel),new I(z.MacCyrillicModel),new I(z.Ibm866Model),new I(z.Ibm855Model),new I(O0.Latin7GreekModel),new I(O0.Win1253GreekModel),new I(I0.Latin5BulgarianModel),new I(I0.Win1251BulgarianModel),new I(y0.Latin2HungarianModel),new I(y0.Win1250HungarianModel),new I(B2)];var i=new D2,h=new I(p0,!1,i),a=new I(p0,!0,i);i.setModelProbers(h,a),e._mProbers.push(i,h,a),e.reset()}o()}h1.prototype=new n1;var U2=h1,l1=J,L0=S,V=0,s=1,_=2,f=3,m=4,R=5,d=6,F=7,x2=[s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,s,s,s,s,s,s,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,s,s,s,s,s,s,V,s,F,s,s,s,s,s,s,R,s,R,V,R,V,V,s,s,s,s,s,s,s,s,s,F,s,F,V,F,R,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,m,m,m,m,m,m,R,R,m,m,m,m,m,m,m,m,R,R,m,m,m,m,m,s,m,m,m,m,m,R,R,R,d,d,d,d,d,d,F,F,d,d,d,d,d,d,d,d,F,F,d,d,d,d,d,s,d,d,d,d,d,F,F,F],$2=[0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,0,3,3,3,1,1,3,3,0,3,3,3,1,2,1,2,0,3,3,3,3,3,3,3,0,3,1,3,1,1,1,3,0,3,1,3,1,1,3,3];function v0(){l1.apply(this);var e=4,o=8,i=this;function h(){i.reset()}this.reset=function(){this._mLastCharClass=s,this._mFreqCounter=[];for(var a=0;a0&&(this.results=[this.result]),this._mBOM.length>3&&(this._mGotData=!0)),this.result.encoding&&this.result.confidence>0){this.done=!0;return}if(this._mInputState==o.pureAscii&&(this._highBitDetector.test(a)?this._mInputState=o.highbyte:this._escDetector.test(this._mLastChar+a)&&(this._mInputState=o.escAscii)),this._mLastChar=a.slice(-1),this._mInputState==o.escAscii)this._mEscCharsetProber||(this._mEscCharsetProber=new i3),this._mEscCharsetProber.feed(a)==E0.foundIt&&(this.result={encoding:this._mEscCharsetProber.getCharsetName(),confidence:this._mEscCharsetProber.getConfidence()},this.results=[this.result],this.done=!0);else if(this._mInputState==o.highbyte){this._mCharsetProbers.length==0&&(this._mCharsetProbers=[new r3,new e3,new t3]);for(var l=0,T;T=this._mCharsetProbers[l];l++)if(T.feed(a)==E0.foundIt){this.result={encoding:T.getCharsetName(),confidence:T.getConfidence()},this.results=[this.result],this.done=!0;break}}}}},this.close=function(){if(!this.done){if(this._mBOM.length===0){W.log(`no data received! -`);return}if(this.done=!0,this._mInputState==o.pureAscii)return W.log("pure ascii"),this.result={encoding:"ascii",confidence:1},this.results.push(this.result),this.result;if(this._mInputState==o.highbyte){for(var a=0,n;n=this._mCharsetProbers[a];a++)!n||!n.getCharsetName()||(this.results.push({encoding:n.getCharsetName(),confidence:n.getConfidence()}),W.log(n.getCharsetName()+" confidence "+n.getConfidence()));if(this.results.sort(function(T,A){return A.confidence-T.confidence}),this.results.length>0){var l=this.results[0];if(l.confidence>=e.minimumThreshold)return this.result=l,l}}if(W.enabled){W.log(`no probers hit minimum threshhold -`);for(var a=0,n;n=this._mCharsetProbers[a];a++)n&&W.log(n.getCharsetName()+" confidence = "+n.getConfidence()+` -`)}}},h()}var a3=s3,u1=a3,o3=w.setLogger;Y.detect=function(e,o){var i=C1(e,o);return i.result};Y.detectAll=function(e,o){var i=C1(e,o);return i.results};Y.UniversalDetector=u1;Y.enableDebug=function(){o3(console.log.bind(console))};function C1(e,o){var i=new u1(o);return i.reset(),typeof Buffer=="function"&&e instanceof Buffer?i.feed(e.toString("binary")):i.feed(e),i.close(),i}var _1=Y;const n3=f1(_1),l3=m1({__proto__:null,default:n3},[_1]);export{l3 as i}; diff --git a/snapshots/master/editor/assets/layout.contribution.darwin-gdaUfoJf.js b/snapshots/master/editor/assets/layout.contribution.darwin-gdaUfoJf.js new file mode 100644 index 000000000..48fcaebde --- /dev/null +++ b/snapshots/master/editor/assets/layout.contribution.darwin-gdaUfoJf.js @@ -0,0 +1 @@ +import{K as e}from"./_.contribution-BThlLkzn.js";e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.US",lang:"en",localizedName:"U.S.",isUSStandard:!0},secondaryLayouts:[{id:"com.apple.keylayout.ABC",lang:"en",localizedName:"ABC"},{id:"com.sogou.inputmethod.sogou.pinyin",lang:"zh-Hans",localizedName:"Pinyin - Simplified"},{id:"com.apple.inputmethod.Kotoeri.Roman",lang:"en",localizedName:"Romaji"},{id:"com.apple.inputmethod.Kotoeri.Japanese",lang:"ja",localizedName:"Hiragana"},{id:"com.apple.keylayout.Australian",lang:"en",localizedName:"Australian"},{id:"com.apple.keylayout.Canadian",lang:"en",localizedName:"Canadian English"},{id:"com.apple.keylayout.Brazilian",lang:"pt",localizedName:"Brazilian"}],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","´",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","˝",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","ˆ","ˆ",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","Â",0],KeyN:["n","N","˜","˜",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","ˇ",0],KeyU:["u","U","¨","¨",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","˛",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","¸",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","^","§","fl",0],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",0],Backquote:["`","~","`","`",4],Comma:[",","<","≤","¯",0],Period:[".",">","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.inputmethod.SCIM.ITABC",lang:"zh-Hans",localizedName:"搜狗拼音"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","´",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","˝",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","ˆ","ˆ",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","Â",0],KeyN:["n","N","˜","˜",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","ˇ",0],KeyU:["u","U","¨","¨",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","˛",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","¸",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","¥","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","","§","fl",0],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["【","「","“","”",0],BracketRight:["】","」","‘","’",0],Backslash:["、","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",0],Backquote:["·","~","`","`",4],Comma:[",","《","≤","¯",0],Period:["。","》","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.British",lang:"en",localizedName:"British"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","‰",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","Ì",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","^","È",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","˜",0],KeyN:["n","N","~","ˆ",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","Â",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","Ê",0],KeyU:["u","U","¨","Ë",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","Ù",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","Û",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","€","™",0],Digit3:["3","£","#","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","^","§","fl",0],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",0],Backquote:["`","~","`","Ÿ",4],Comma:[",","<","≤","¯",0],Period:[".",">","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","","",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.Spanish-ISO",lang:"es",localizedName:"Spanish - ISO"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","ß","",0],KeyC:["c","C","©"," ",0],KeyD:["d","D","∂","∆",0],KeyE:["e","E","€","€",0],KeyF:["f","F","ƒ","fi",0],KeyG:["g","G","","fl",0],KeyH:["h","H","™"," ",0],KeyI:["i","I"," "," ",0],KeyJ:["j","J","¶","¯",0],KeyK:["k","K","§","ˇ",0],KeyL:["l","L"," ","˘",0],KeyM:["m","M","µ","˚",0],KeyN:["n","N"," ","˙",0],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®"," ",0],KeyS:["s","S","∫"," ",0],KeyT:["t","T","†","‡",0],KeyU:["u","U"," "," ",0],KeyV:["v","V","√","◊",0],KeyW:["w","W","æ","Æ",0],KeyX:["x","X","∑","›",0],KeyY:["y","Y","¥"," ",0],KeyZ:["z","Z","Ω","‹",0],Digit1:["1","!","|","ı",0],Digit2:["2",'"',"@","˝",0],Digit3:["3","·","#","•",0],Digit4:["4","$","¢","£",0],Digit5:["5","%","∞","‰",0],Digit6:["6","&","¬"," ",0],Digit7:["7","/","÷","⁄",0],Digit8:["8","(","“","‘",0],Digit9:["9",")","”","’",0],Digit0:["0","=","≠","≈",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["'","?","´","¸",0],Equal:["¡","¿","‚","˛",0],BracketLeft:["`","^","[","ˆ",3],BracketRight:["+","*","]","±",0],Backslash:["ç","Ç","}","»",0],Semicolon:["ñ","Ñ","~","˜",4],Quote:["´","¨","{","«",3],Backquote:["<",">","≤","≥",0],Comma:[",",";","„","",0],Period:[".",":","…","…",0],Slash:["-","_","–","—",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[",",",",",",",",0],IntlBackslash:["º","ª","\\","°",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.google.inputmethod.Japanese.Roman",lang:"en",localizedName:"Alphanumeric (Google)"},secondaryLayouts:[],mapping:{KeyA:["a","A","¯","̄",4],KeyB:["b","B","˘","̆",4],KeyC:["c","C","¸","̧",4],KeyD:["d","D","ð","Ð",0],KeyE:["e","E","´","́",4],KeyF:["f","F","ƒ","",0],KeyG:["g","G","©","‸",8],KeyH:["h","H","ˍ","̱",4],KeyI:["i","I","ʼ","̛",4],KeyJ:["j","J","˝","̋",4],KeyK:["k","K","˚","̊",4],KeyL:["l","L","-","̵",4],KeyM:["m","M","˛","̨",4],KeyN:["n","N","˜","̃",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P",",","̦",4],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","",0],KeyT:["t","T","þ","Þ",0],KeyU:["u","U","¨","̈",4],KeyV:["v","V","ˇ","̌",4],KeyW:["w","W","˙","̇",4],KeyX:["x","X",".","̣",4],KeyY:["y","Y","¥","",0],KeyZ:["z","Z","ˀ","̉",4],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","§","†",0],Digit6:["6","^","ˆ","̂",4],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","№",8],Quote:["'",'"',"æ","Æ",0],Backquote:["`","~","`","̀",4],Comma:[",","<","≤","„",0],Period:[".",">","≥","ʔ",8],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.German",lang:"de",localizedName:"German"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","‹",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","™",0],KeyE:["e","E","€","‰",0],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","Ì",0],KeyH:["h","H","ª","Ó",0],KeyI:["i","I","⁄","Û",0],KeyJ:["j","J","º","ı",0],KeyK:["k","K","∆","ˆ",0],KeyL:["l","L","@","fl",0],KeyM:["m","M","µ","˘",0],KeyN:["n","N","~","›",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","«","»",0],KeyR:["r","R","®","¸",0],KeyS:["s","S","‚","Í",0],KeyT:["t","T","†","˝",0],KeyU:["u","U","¨","Á",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","Ù",0],KeyY:["z","Z","Ω","ˇ",0],KeyZ:["y","Y","¥","‡",0],Digit1:["1","!","¡","¬",0],Digit2:["2",'"',"“","”",0],Digit3:["3","§","¶","#",0],Digit4:["4","$","¢","£",0],Digit5:["5","%","[","fi",0],Digit6:["6","&","]","^",8],Digit7:["7","/","|","\\",0],Digit8:["8","(","{","˜",0],Digit9:["9",")","}","·",0],Digit0:["0","=","≠","¯",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["ß","?","¿","˙",0],Equal:["´","`","'","˚",3],BracketLeft:["ü","Ü","•","°",0],BracketRight:["+","*","±","",0],Backslash:["#","'","‘","’",0],Semicolon:["ö","Ö","œ","Œ",0],Quote:["ä","Ä","æ","Æ",0],Backquote:["<",">","≤","≥",0],Comma:[",",";","∞","˛",0],Period:[".",":","…","÷",0],Slash:["-","_","–","—",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[",",",",".",".",0],IntlBackslash:["^","°","„","“",1],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.USInternational-PC",lang:"en",localizedName:"U.S. International - PC"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","´",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","˝",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","ˆ","ˆ",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","Â",0],KeyN:["n","N","˜","˜",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","ˇ",0],KeyU:["u","U","¨","¨",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","˛",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","¸",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","ˆ","§","fl",2],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",3],Backquote:["`","˜","`","`",7],Comma:[",","<","≤","¯",0],Period:[".",">","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.USExtended",lang:"en",localizedName:"ABC - Extended"},secondaryLayouts:[],mapping:{KeyA:["a","A","¯","̄",4],KeyB:["b","B","˘","̆",4],KeyC:["c","C","¸","̧",4],KeyD:["d","D","ð","Ð",0],KeyE:["e","E","´","́",4],KeyF:["f","F","ƒ","",0],KeyG:["g","G","©","‸",8],KeyH:["h","H","ˍ","̱",4],KeyI:["i","I","ʼ","̛",4],KeyJ:["j","J","˝","̋",4],KeyK:["k","K","˚","̊",4],KeyL:["l","L","-","̵",4],KeyM:["m","M","˛","̨",4],KeyN:["n","N","˜","̃",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P",",","̦",4],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","",0],KeyT:["t","T","þ","Þ",0],KeyU:["u","U","¨","̈",4],KeyV:["v","V","ˇ","̌",4],KeyW:["w","W","˙","̇",4],KeyX:["x","X",".","̣",4],KeyY:["y","Y","¥","",0],KeyZ:["z","Z","ˀ","̉",4],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","§","†",0],Digit6:["6","^","ˆ","̂",4],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","№",8],Quote:["'",'"',"æ","Æ",0],Backquote:["`","~","`","̀",4],Comma:[",","<","≤","„",0],Period:[".",">","≥","ʔ",8],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.French",lang:"fr",localizedName:"French"},secondaryLayouts:[],mapping:{KeyA:["q","Q","‡","Ω",0],KeyB:["b","B","ß","∫",0],KeyC:["c","C","©","¢",0],KeyD:["d","D","∂","∆",0],KeyE:["e","E","ê","Ê",0],KeyF:["f","F","ƒ","·",0],KeyG:["g","G","fi","fl",0],KeyH:["h","H","Ì","Î",0],KeyI:["i","I","î","ï",0],KeyJ:["j","J","Ï","Í",0],KeyK:["k","K","È","Ë",0],KeyL:["l","L","¬","|",0],KeyM:[",","?","∞","¿",0],KeyN:["n","N","~","ı",4],KeyO:["o","O","œ","Œ",0],KeyP:["p","P","π","∏",0],KeyQ:["a","A","æ","Æ",0],KeyR:["r","R","®","‚",0],KeyS:["s","S","Ò","∑",0],KeyT:["t","T","†","™",0],KeyU:["u","U","º","ª",0],KeyV:["v","V","◊","√",0],KeyW:["z","Z","Â","Å",0],KeyX:["x","X","≈","⁄",0],KeyY:["y","Y","Ú","Ÿ",0],KeyZ:["w","W","‹","›",0],Digit1:["&","1","","´",8],Digit2:["é","2","ë","„",0],Digit3:['"',"3","“","”",0],Digit4:["'","4","‘","’",0],Digit5:["(","5","{","[",0],Digit6:["§","6","¶","å",0],Digit7:["è","7","«","»",0],Digit8:["!","8","¡","Û",0],Digit9:["ç","9","Ç","Á",0],Digit0:["à","0","ø","Ø",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:[")","°","}","]",0],Equal:["-","_","—","–",0],BracketLeft:["^","¨","ô","Ô",3],BracketRight:["$","*","€","¥",0],Backslash:["`","£","@","#",1],Semicolon:["m","M","µ","Ó",0],Quote:["ù","%","Ù","‰",0],Backquote:["<",">","≤","≥",0],Comma:[";",".","…","•",0],Period:[":","/","÷","\\",0],Slash:["=","+","≠","±",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[",",".",",",".",0],IntlBackslash:["@","#","•","Ÿ",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.inputmethod.Kotoeri.Japanese",lang:"ja",localizedName:"Hiragana"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","´",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","˝",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","ˆ","ˆ",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","Â",0],KeyN:["n","N","˜","˜",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","ˇ",0],KeyU:["u","U","¨","¨",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","˛",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","¸",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","^","§","fl",0],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",0],Backquote:["`","~","`","`",4],Comma:[",","<","≤","¯",0],Period:[".",">","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.PolishPro",lang:"pl",localizedName:"Polish - Pro"},secondaryLayouts:[],mapping:{KeyA:["a","A","ą","Ą",0],KeyB:["b","B","ļ","ű",0],KeyC:["c","C","ć","Ć",0],KeyD:["d","D","∂","Ž",0],KeyE:["e","E","ę","Ę",0],KeyF:["f","F","ń","ž",0],KeyG:["g","G","©","Ū",0],KeyH:["h","H","ķ","Ó",0],KeyI:["i","I","^","ť",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","Ż","ū",0],KeyL:["l","L","ł","Ł",0],KeyM:["m","M","Ķ","ų",0],KeyN:["n","N","ń","Ń",0],KeyO:["o","O","ó","Ó",0],KeyP:["p","P","Ļ","ł",0],KeyQ:["q","Q","Ō","ő",0],KeyR:["r","R","®","£",0],KeyS:["s","S","ś","Ś",0],KeyT:["t","T","†","ś",0],KeyU:["u","U","¨","Ť",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","ź","Ź",0],KeyY:["y","Y","ī","Á",0],KeyZ:["z","Z","ż","Ż",0],Digit1:["1","!","Ń","ŕ",0],Digit2:["2","@","™","Ř",0],Digit3:["3","#","€","‹",0],Digit4:["4","$","ß","›",0],Digit5:["5","%","į","ř",0],Digit6:["6","^","§","Ŗ",0],Digit7:["7","&","¶","ŗ",0],Digit8:["8","*","•","°",0],Digit9:["9","(","Ľ","Š",0],Digit0:["0",")","ľ","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","Ī",0],BracketLeft:["[","{","„","”",0],BracketRight:["]","}","‚","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"ĺ","ģ",0],Backquote:["`","~","`","Ŕ",4],Comma:[",","<","≤","Ý",0],Period:[".",">","≥","ý",0],Slash:["/","?","÷","ņ",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","£","¬","¬",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.Italian-Pro",lang:"it",localizedName:"Italian"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","Í",0],KeyC:["c","C","©","Á",0],KeyD:["d","D","∂","˘",0],KeyE:["e","E","€","È",0],KeyF:["f","F","ƒ","˙",0],KeyG:["g","G","∞","˚",0],KeyH:["h","H","∆","¸",0],KeyI:["i","I","œ","Œ",0],KeyJ:["j","J","ª","˝",0],KeyK:["k","K","º","˛",0],KeyL:["l","L","¬","ˇ",0],KeyM:["m","M","µ","Ú",0],KeyN:["n","N","˜","Ó",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","„","‚",0],KeyR:["r","R","®","Ì",0],KeyS:["s","S","ß","¯",0],KeyT:["t","T","™","Ò",0],KeyU:["u","U","¨","Ù",4],KeyV:["v","V","√","É",0],KeyW:["w","W","Ω","À",0],KeyX:["x","X","†","‡",0],KeyY:["y","Y","æ","Æ",0],KeyZ:["z","Z","∑"," ",0],Digit1:["1","!","«","»",0],Digit2:["2",'"',"“","”",0],Digit3:["3","£","‘","’",0],Digit4:["4","$","¥","¢",0],Digit5:["5","%","~","‰",0],Digit6:["6","&","‹","›",0],Digit7:["7","/","÷","⁄",0],Digit8:["8","(","´","",4],Digit9:["9",")","`"," ",4],Digit0:["0","=","≠","≈",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["'","?","¡","¿",0],Equal:["ì","^","ˆ","±",4],BracketLeft:["è","é","[","{",0],BracketRight:["+","*","]","}",0],Backslash:["ù","§","¶","◊",0],Semicolon:["ò","ç","@","Ç",0],Quote:["à","°","#","∞",0],Backquote:["<",">","≤","≥",0],Comma:[",",";","…"," ",0],Period:[".",":","•","·",0],Slash:["-","_","–","—",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[",",".",",",".",0],IntlBackslash:["\\","|","`","ı",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.Russian",lang:"ru",localizedName:"Russian"},secondaryLayouts:[],mapping:{KeyA:["ф","Ф","ƒ","ƒ",0],KeyB:["и","И","и","И",0],KeyC:["с","С","≠","≠",0],KeyD:["в","В","ћ","Ћ",0],KeyE:["у","У","ќ","Ќ",0],KeyF:["а","А","÷","÷",0],KeyG:["п","П","©","©",0],KeyH:["р","Р","₽","₽",0],KeyI:["ш","Ш","ѕ","Ѕ",0],KeyJ:["о","О","°","•",0],KeyK:["л","Л","љ","Љ",0],KeyL:["д","Д","∆","∆",0],KeyM:["ь","Ь","~","~",0],KeyN:["т","Т","™","™",0],KeyO:["щ","Щ","ў","Ў",0],KeyP:["з","З","‘","’",0],KeyQ:["й","Й","ј","Ј",0],KeyR:["к","К","®","®",0],KeyS:["ы","Ы","ы","Ы",0],KeyT:["е","Е","†","†",0],KeyU:["г","Г","ѓ","Ѓ",0],KeyV:["м","М","µ","µ",0],KeyW:["ц","Ц","џ","Џ",0],KeyX:["ч","Ч","≈","≈",0],KeyY:["н","Н","њ","Њ",0],KeyZ:["я","Я","ђ","Ђ",0],Digit1:["1","!","!","|",0],Digit2:["2",'"',"@",'"',0],Digit3:["3","№","#","£",0],Digit4:["4","%","$","€",0],Digit5:["5",":","%","∞",0],Digit6:["6",",","^","¬",0],Digit7:["7",".","&","¶",0],Digit8:["8",";","*","√",0],Digit9:["9","(","{","'",0],Digit0:["0",")","}","`",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","»","«",0],BracketLeft:["х","Х","“","”",0],BracketRight:["ъ","Ъ","ъ","Ъ",0],Backslash:["ё","Ё","ё","Ё",0],Semicolon:["ж","Ж","…","…",0],Quote:["э","Э","э","Э",0],Backquote:["]","[","]","[",0],Comma:["б","Б","≤","<",0],Period:["ю","Ю","≥",">",0],Slash:["/","?","“","„",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[",",".",",",",",0],IntlBackslash:[">","<","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.Brazilian-Pro",lang:"pt"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["b","B","∫","ı",0],KeyC:["c","C","ç","Ç",0],KeyD:["d","D","∂","Î",0],KeyE:["e","E","´","´",4],KeyF:["f","F","ƒ","Ï",0],KeyG:["g","G","©","˝",0],KeyH:["h","H","˙","Ó",0],KeyI:["i","I","ˆ","ˆ",4],KeyJ:["j","J","∆","Ô",0],KeyK:["k","K","˚","",0],KeyL:["l","L","¬","Ò",0],KeyM:["m","M","µ","Â",0],KeyN:["n","N","˜","˜",4],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","π","∏",0],KeyQ:["q","Q","œ","Œ",0],KeyR:["r","R","®","‰",0],KeyS:["s","S","ß","Í",0],KeyT:["t","T","†","ˇ",0],KeyU:["u","U","¨","¨",4],KeyV:["v","V","√","◊",0],KeyW:["w","W","∑","„",0],KeyX:["x","X","≈","˛",0],KeyY:["y","Y","¥","Á",0],KeyZ:["z","Z","Ω","¸",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","ˆ","§","fl",2],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","–","—",0],Equal:["=","+","≠","±",0],BracketLeft:["[","{","“","”",0],BracketRight:["]","}","‘","’",0],Backslash:["\\","|","«","»",0],Semicolon:[";",":","…","Ú",0],Quote:["'",'"',"æ","Æ",3],Backquote:["`","˜","`","`",7],Comma:[",","<","≤","¯",0],Period:[".",">","≥","˘",0],Slash:["/","?","÷","¿",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.inputmethod.Korean.2SetKorean",lang:"ko",localizedName:"2-Set Korean"},secondaryLayouts:[],mapping:{KeyA:["ㅁ","ㅁ","a","A",0],KeyB:["ㅠ","ㅠ","b","B",0],KeyC:["ㅊ","ㅊ","c","C",0],KeyD:["ㅇ","ㅇ","d","D",0],KeyE:["ㄷ","ㄸ","e","E",0],KeyF:["ㄹ","ㄹ","f","F",0],KeyG:["ㅎ","ㅎ","g","G",0],KeyH:["ㅗ","ㅗ","h","H",0],KeyI:["ㅑ","ㅑ","i","I",0],KeyJ:["ㅓ","ㅓ","j","J",0],KeyK:["ㅏ","ㅏ","k","K",0],KeyL:["ㅣ","ㅣ","l","L",0],KeyM:["ㅡ","ㅡ","m","M",0],KeyN:["ㅜ","ㅜ","n","N",0],KeyO:["ㅐ","ㅒ","o","O",0],KeyP:["ㅔ","ㅖ","p","P",0],KeyQ:["ㅂ","ㅃ","q","Q",0],KeyR:["ㄱ","ㄲ","r","R",0],KeyS:["ㄴ","ㄴ","s","S",0],KeyT:["ㅅ","ㅆ","t","T",0],KeyU:["ㅕ","ㅕ","u","U",0],KeyV:["ㅍ","ㅍ","v","V",0],KeyW:["ㅈ","ㅉ","w","W",0],KeyX:["ㅌ","ㅌ","x","X",0],KeyY:["ㅛ","ㅛ","y","Y",0],KeyZ:["ㅋ","ㅋ","z","Z",0],Digit1:["1","!","1","!",0],Digit2:["2","@","2","@",0],Digit3:["3","#","3","#",0],Digit4:["4","$","4","$",0],Digit5:["5","%","5","%",0],Digit6:["6","^","6","^",0],Digit7:["7","&","7","&",0],Digit8:["8","*","8","*",0],Digit9:["9","(","9","(",0],Digit0:["0",")","0",")",0],Enter:[],Escape:["","","","‌",0],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["-","_","-","_",0],Equal:["=","+","=","+",0],BracketLeft:["[","{","[","{",0],BracketRight:["]","}","]","}",0],Backslash:["\\","|","\\","|",0],Semicolon:[";",":",";",":",0],Quote:["'",'"',"'",'"',0],Backquote:["₩","~","`","~",0],Comma:[",","<",",","<",0],Period:[".",">",".",">",0],Slash:["/","?","/","?",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});e.INSTANCE.registerKeyboardLayout({layout:{id:"com.apple.keylayout.Dvorak",localizedName:"Dvorak",lang:"en"},secondaryLayouts:[],mapping:{KeyA:["a","A","å","Å",0],KeyB:["x","X","≈","˛",0],KeyC:["j","J","∆","Ô",0],KeyD:["e","E","´","´",4],KeyE:[".",">","≥","˘",0],KeyF:["u","U","¨","¨",4],KeyG:["i","I","ˆ","ˆ",4],KeyH:["d","D","∂","Î",0],KeyI:["c","C","ç","Ç",0],KeyJ:["h","H","˙","Ó",0],KeyK:["t","T","†","ˇ",0],KeyL:["n","N","˜","˜",4],KeyM:["m","M","µ","Â",0],KeyN:["b","B","∫","ı",0],KeyO:["r","R","®","‰",0],KeyP:["l","L","¬","Ò",0],KeyQ:["'",'"',"æ","Æ",0],KeyR:["p","P","π","∏",0],KeyS:["o","O","ø","Ø",0],KeyT:["y","Y","¥","Á",0],KeyU:["g","G","©","˝",0],KeyV:["k","K","˚","",0],KeyW:[",","<","≤","¯",0],KeyX:["q","Q","œ","Œ",0],KeyY:["f","F","ƒ","Ï",0],KeyZ:[";",":","…","Ú",0],Digit1:["1","!","¡","⁄",0],Digit2:["2","@","™","€",0],Digit3:["3","#","£","‹",0],Digit4:["4","$","¢","›",0],Digit5:["5","%","∞","fi",0],Digit6:["6","^","§","fl",0],Digit7:["7","&","¶","‡",0],Digit8:["8","*","•","°",0],Digit9:["9","(","ª","·",0],Digit0:["0",")","º","‚",0],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," "," "," ",0],Minus:["[","{","“","”",0],Equal:["]","}","‘","’",0],BracketLeft:["/","?","÷","¿",0],BracketRight:["=","+","≠","±",0],Backslash:["\\","|","«","»",0],Semicolon:["s","S","ß","Í",0],Quote:["-","_","–","—",0],Backquote:["`","~","`","`",4],Comma:["w","W","∑","„",0],Period:["v","V","√","◊",0],Slash:["z","Z","Ω","¸",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["1","1","1","1",0],Numpad2:["2","2","2","2",0],Numpad3:["3","3","3","3",0],Numpad4:["4","4","4","4",0],Numpad5:["5","5","5","5",0],Numpad6:["6","6","6","6",0],Numpad7:["7","7","7","7",0],Numpad8:["8","8","8","8",0],Numpad9:["9","9","9","9",0],Numpad0:["0","0","0","0",0],NumpadDecimal:[".",".",".",".",0],IntlBackslash:["§","±","§","±",0],ContextMenu:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],AudioVolumeMute:[],AudioVolumeUp:["","=","","=",0],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[]}});export{e as KeyboardLayoutContribution}; diff --git a/snapshots/master/editor/assets/layout.contribution.linux-xMjRz7iy.js b/snapshots/master/editor/assets/layout.contribution.linux-xMjRz7iy.js new file mode 100644 index 000000000..f34c126ae --- /dev/null +++ b/snapshots/master/editor/assets/layout.contribution.linux-xMjRz7iy.js @@ -0,0 +1 @@ +import{K as e}from"./_.contribution-BThlLkzn.js";e.INSTANCE.registerKeyboardLayout({layout:{model:"pc105",group:0,layout:"us",variant:"",options:"",rules:"evdev",isUSStandard:!0},secondaryLayouts:[{model:"pc105",group:0,layout:"cn",variant:"",options:"",rules:"evdev"}],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","a","A",0],KeyB:["b","B","b","B",0],KeyC:["c","C","c","C",0],KeyD:["d","D","d","D",0],KeyE:["e","E","e","E",0],KeyF:["f","F","f","F",0],KeyG:["g","G","g","G",0],KeyH:["h","H","h","H",0],KeyI:["i","I","i","I",0],KeyJ:["j","J","j","J",0],KeyK:["k","K","k","K",0],KeyL:["l","L","l","L",0],KeyM:["m","M","m","M",0],KeyN:["n","N","n","N",0],KeyO:["o","O","o","O",0],KeyP:["p","P","p","P",0],KeyQ:["q","Q","q","Q",0],KeyR:["r","R","r","R",0],KeyS:["s","S","s","S",0],KeyT:["t","T","t","T",0],KeyU:["u","U","u","U",0],KeyV:["v","V","v","V",0],KeyW:["w","W","w","W",0],KeyX:["x","X","x","X",0],KeyY:["y","Y","y","Y",0],KeyZ:["z","Z","z","Z",0],Digit1:["1","!","1","!",0],Digit2:["2","@","2","@",0],Digit3:["3","#","3","#",0],Digit4:["4","$","4","$",0],Digit5:["5","%","5","%",0],Digit6:["6","^","6","^",0],Digit7:["7","&","7","&",0],Digit8:["8","*","8","*",0],Digit9:["9","(","9","(",0],Digit0:["0",")","0",")",0],Enter:["\r","\r","\r","\r",0],Escape:["\x1B","\x1B","\x1B","\x1B",0],Backspace:["\b","\b","\b","\b",0],Tab:[" ",""," ","",0],Space:[" "," "," "," ",0],Minus:["-","_","-","_",0],Equal:["=","+","=","+",0],BracketLeft:["[","{","[","{",0],BracketRight:["]","}","]","}",0],Backslash:["\\","|","\\","|",0],Semicolon:[";",":",";",":",0],Quote:["'",'"',"'",'"',0],Backquote:["`","~","`","~",0],Comma:[",","<",",","<",0],Period:[".",">",".",">",0],Slash:["/","?","/","?",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:["","","","",0],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:["\r","\r","\r","\r",0],Numpad1:["","1","","1",0],Numpad2:["","2","","2",0],Numpad3:["","3","","3",0],Numpad4:["","4","","4",0],Numpad5:["","5","","5",0],Numpad6:["","6","","6",0],Numpad7:["","7","","7",0],Numpad8:["","8","","8",0],Numpad9:["","9","","9",0],Numpad0:["","0","","0",0],NumpadDecimal:["",".","",".",0],IntlBackslash:["<",">","|","¦",0],ContextMenu:[],Power:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Open:[],Help:[],Select:[],Again:[],Undo:[],Cut:[],Copy:[],Paste:[],Find:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[".",".",".",".",0],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],Lang5:[],NumpadParenLeft:["(","(","(","(",0],NumpadParenRight:[")",")",")",")",0],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],BrightnessUp:[],BrightnessDown:[],MediaPlay:[],MediaRecord:[],MediaFastForward:[],MediaRewind:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],SelectTask:[],LaunchScreenSaver:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[],MailReply:[],MailForward:[],MailSend:[]}});e.INSTANCE.registerKeyboardLayout({layout:{model:"pc105",group:0,layout:"es",variant:"",options:"",rules:"evdev"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","æ","Æ",0],KeyB:["b","B","”","’",0],KeyC:["c","C","¢","©",0],KeyD:["d","D","ð","Ð",0],KeyE:["e","E","€","¢",0],KeyF:["f","F","đ","ª",0],KeyG:["g","G","ŋ","Ŋ",0],KeyH:["h","H","ħ","Ħ",0],KeyI:["i","I","→","ı",0],KeyJ:["j","J","̉","̛",0],KeyK:["k","K","ĸ","&",0],KeyL:["l","L","ł","Ł",0],KeyM:["m","M","µ","º",0],KeyN:["n","N","n","N",0],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","þ","Þ",0],KeyQ:["q","Q","@","Ω",0],KeyR:["r","R","¶","®",0],KeyS:["s","S","ß","§",0],KeyT:["t","T","ŧ","Ŧ",0],KeyU:["u","U","↓","↑",0],KeyV:["v","V","“","‘",0],KeyW:["w","W","ł","Ł",0],KeyX:["x","X","»",">",0],KeyY:["y","Y","←","¥",0],KeyZ:["z","Z","«","<",0],Digit1:["1","!","|","¡",0],Digit2:["2",'"',"@","⅛",0],Digit3:["3","·","#","£",0],Digit4:["4","$","~","$",0],Digit5:["5","%","½","⅜",0],Digit6:["6","&","¬","⅝",0],Digit7:["7","/","{","⅞",0],Digit8:["8","(","[","™",0],Digit9:["9",")","]","±",0],Digit0:["0","=","}","°",0],Enter:["\r","\r","\r","\r",0],Escape:["\x1B","\x1B","\x1B","\x1B",0],Backspace:["\b","\b","\b","\b",0],Tab:[" ",""," ","",0],Space:[" "," "," "," ",0],Minus:["'","?","\\","¿",0],Equal:["¡","¿","̃","~",0],BracketLeft:["̀","̂","[","̊",0],BracketRight:["+","*","]","̄",0],Backslash:["ç","Ç","}","̆",0],Semicolon:["ñ","Ñ","~","̋",0],Quote:["́","̈","{","{",0],Backquote:["º","ª","\\","\\",0],Comma:[",",";","─","×",0],Period:[".",":","·","÷",0],Slash:["-","_","̣","̇",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:["","","","",0],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","/","/",0],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:["\r","\r","\r","\r",0],Numpad1:["","1","","1",0],Numpad2:["","2","","2",0],Numpad3:["","3","","3",0],Numpad4:["","4","","4",0],Numpad5:["","5","","5",0],Numpad6:["","6","","6",0],Numpad7:["","7","","7",0],Numpad8:["","8","","8",0],Numpad9:["","9","","9",0],Numpad0:["","0","","0",0],NumpadDecimal:["",".","",".",0],IntlBackslash:["<",">","|","¦",0],ContextMenu:[],Power:[],NumpadEqual:["=","=","=","=",0],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Open:[],Help:[],Select:[],Again:[],Undo:[],Cut:[],Copy:[],Paste:[],Find:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[".",".",".",".",0],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],Lang5:[],NumpadParenLeft:["(","(","(","(",0],NumpadParenRight:[")",")",")",")",0],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],BrightnessUp:[],BrightnessDown:[],MediaPlay:[],MediaRecord:[],MediaFastForward:[],MediaRewind:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],SelectTask:[],LaunchScreenSaver:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[],MailReply:[],MailForward:[],MailSend:[]}});e.INSTANCE.registerKeyboardLayout({layout:{model:"pc104",group:0,layout:"de",variant:"",options:"",rules:"base"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","æ","Æ",0],KeyB:["b","B","“","‘",0],KeyC:["c","C","¢","©",0],KeyD:["d","D","ð","Ð",0],KeyE:["e","E","€","€",0],KeyF:["f","F","đ","ª",0],KeyG:["g","G","ŋ","Ŋ",0],KeyH:["h","H","ħ","Ħ",0],KeyI:["i","I","→","ı",0],KeyJ:["j","J","̣","̇",0],KeyK:["k","K","ĸ","&",0],KeyL:["l","L","ł","Ł",0],KeyM:["m","M","µ","º",0],KeyN:["n","N","”","’",0],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","þ","Þ",0],KeyQ:["q","Q","@","Ω",0],KeyR:["r","R","¶","®",0],KeyS:["s","S","ſ","ẞ",0],KeyT:["t","T","ŧ","Ŧ",0],KeyU:["u","U","↓","↑",0],KeyV:["v","V","„","‚",0],KeyW:["w","W","ł","Ł",0],KeyX:["x","X","«","‹",0],KeyY:["z","Z","←","¥",0],KeyZ:["y","Y","»","›",0],Digit1:["1","!","¹","¡",0],Digit2:["2",'"',"²","⅛",0],Digit3:["3","§","³","£",0],Digit4:["4","$","¼","¤",0],Digit5:["5","%","½","⅜",0],Digit6:["6","&","¬","⅝",0],Digit7:["7","/","{","⅞",0],Digit8:["8","(","[","™",0],Digit9:["9",")","]","±",0],Digit0:["0","=","}","°",0],Enter:["\r","\r","\r","\r",0],Escape:["\x1B","\x1B","\x1B","\x1B",0],Backspace:["\b","\b","\b","\b",0],Tab:[" ",""," ","",0],Space:[" "," "," "," ",0],Minus:["ß","?","\\","¿",0],Equal:["́","̀","̧","̨",0],BracketLeft:["ü","Ü","̈","̊",0],BracketRight:["+","*","~","¯",0],Backslash:["#","'","’","̆",0],Semicolon:["ö","Ö","̋","̣",0],Quote:["ä","Ä","̂","̌",0],Backquote:["̂","°","′","″",0],Comma:[",",";","·","×",0],Period:[".",":","…","÷",0],Slash:["-","_","–","—",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:["","","","",0],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:["/","/","/","/",0],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:[],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["","1","","1",0],Numpad2:["","2","","2",0],Numpad3:["","3","","3",0],Numpad4:["","4","","4",0],Numpad5:["","5","","5",0],Numpad6:["","6","","6",0],Numpad7:["","7","","7",0],Numpad8:["","8","","8",0],Numpad9:["","9","","9",0],Numpad0:["","0","","0",0],NumpadDecimal:["",",","",",",0],IntlBackslash:["<",">","|","̱",0],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Open:[],Help:[],Select:[],Again:[],Undo:[],Cut:[],Copy:[],Paste:[],Find:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],Lang5:[],NumpadParenLeft:[],NumpadParenRight:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:["\r","\r","\r","\r",0],MetaRight:[".",".",".",".",0],BrightnessUp:[],BrightnessDown:[],MediaPlay:[],MediaRecord:[],MediaFastForward:[],MediaRewind:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],SelectTask:[],LaunchScreenSaver:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[],MailReply:[],MailForward:[],MailSend:[]}});e.INSTANCE.registerKeyboardLayout({layout:{model:"pc104",group:0,layout:"fr",variant:"",options:"",rules:"base"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["q","Q","@","Ω",0],KeyB:["b","B","”","’",0],KeyC:["c","C","¢","©",0],KeyD:["d","D","ð","Ð",0],KeyE:["e","E","€","¢",0],KeyF:["f","F","đ","ª",0],KeyG:["g","G","ŋ","Ŋ",0],KeyH:["h","H","ħ","Ħ",0],KeyI:["i","I","→","ı",0],KeyJ:["j","J","̉","̛",0],KeyK:["k","K","ĸ","&",0],KeyL:["l","L","ł","Ł",0],KeyM:[",","?","́","̋",0],KeyN:["n","N","n","N",0],KeyO:["o","O","ø","Ø",0],KeyP:["p","P","þ","Þ",0],KeyQ:["a","A","æ","Æ",0],KeyR:["r","R","¶","®",0],KeyS:["s","S","ß","§",0],KeyT:["t","T","ŧ","Ŧ",0],KeyU:["u","U","↓","↑",0],KeyV:["v","V","“","‘",0],KeyW:["z","Z","«","<",0],KeyX:["x","X","»",">",0],KeyY:["y","Y","←","¥",0],KeyZ:["w","W","ł","Ł",0],Digit1:["&","1","¹","¡",0],Digit2:["é","2","~","⅛",0],Digit3:['"',"3","#","£",0],Digit4:["'","4","{","$",0],Digit5:["(","5","[","⅜",0],Digit6:["-","6","|","⅝",0],Digit7:["è","7","`","⅞",0],Digit8:["_","8","\\","™",0],Digit9:["ç","9","^","±",0],Digit0:["à","0","@","°",0],Enter:["\r","\r","\r","\r",0],Escape:["\x1B","\x1B","\x1B","\x1B",0],Backspace:["\b","\b","\b","\b",0],Tab:[" ",""," ","",0],Space:[" "," "," "," ",0],Minus:[")","°","]","¿",0],Equal:["=","+","}","̨",0],BracketLeft:["̂","̈","̈","̊",0],BracketRight:["$","£","¤","̄",0],Backslash:["*","µ","̀","̆",0],Semicolon:["m","M","µ","º",0],Quote:["ù","%","̂","̌",0],Backquote:["²","~","¬","¬",0],Comma:[";",".","─","×",0],Period:[":","/","·","÷",0],Slash:["!","§","̣","̇",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:["","","","",0],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:["/","/","/","/",0],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:[],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["","1","","1",0],Numpad2:["","2","","2",0],Numpad3:["","3","","3",0],Numpad4:["","4","","4",0],Numpad5:["","5","","5",0],Numpad6:["","6","","6",0],Numpad7:["","7","","7",0],Numpad8:["","8","","8",0],Numpad9:["","9","","9",0],Numpad0:["","0","","0",0],NumpadDecimal:["",".","",".",0],IntlBackslash:["<",">","|","¦",0],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Open:[],Help:[],Select:[],Again:[],Undo:[],Cut:[],Copy:[],Paste:[],Find:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],Lang5:[],NumpadParenLeft:[],NumpadParenRight:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:["\r","\r","\r","\r",0],MetaRight:[".",".",".",".",0],BrightnessUp:[],BrightnessDown:[],MediaPlay:[],MediaRecord:[],MediaFastForward:[],MediaRewind:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],SelectTask:[],LaunchScreenSaver:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[],MailReply:[],MailForward:[],MailSend:[]}});e.INSTANCE.registerKeyboardLayout({layout:{model:"pc104",group:0,layout:"ru",variant:",",options:"",rules:"base"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["ф","Ф","ф","Ф",0],KeyB:["и","И","и","И",0],KeyC:["с","С","с","С",0],KeyD:["в","В","в","В",0],KeyE:["у","У","у","У",0],KeyF:["а","А","а","А",0],KeyG:["п","П","п","П",0],KeyH:["р","Р","р","Р",0],KeyI:["ш","Ш","ш","Ш",0],KeyJ:["о","О","о","О",0],KeyK:["л","Л","л","Л",0],KeyL:["д","Д","д","Д",0],KeyM:["ь","Ь","ь","Ь",0],KeyN:["т","Т","т","Т",0],KeyO:["щ","Щ","щ","Щ",0],KeyP:["з","З","з","З",0],KeyQ:["й","Й","й","Й",0],KeyR:["к","К","к","К",0],KeyS:["ы","Ы","ы","Ы",0],KeyT:["е","Е","е","Е",0],KeyU:["г","Г","г","Г",0],KeyV:["м","М","м","М",0],KeyW:["ц","Ц","ц","Ц",0],KeyX:["ч","Ч","ч","Ч",0],KeyY:["н","Н","н","Н",0],KeyZ:["я","Я","я","Я",0],Digit1:["1","!","1","!",0],Digit2:["2",'"',"2",'"',0],Digit3:["3","№","3","№",0],Digit4:["4",";","4",";",0],Digit5:["5","%","5","%",0],Digit6:["6",":","6",":",0],Digit7:["7","?","7","?",0],Digit8:["8","*","₽","",0],Digit9:["9","(","9","(",0],Digit0:["0",")","0",")",0],Enter:["\r","\r","\r","\r",0],Escape:["\x1B","\x1B","\x1B","\x1B",0],Backspace:["\b","\b","\b","\b",0],Tab:[" ",""," ","",0],Space:[" "," "," "," ",0],Minus:["-","_","-","_",0],Equal:["=","+","=","+",0],BracketLeft:["х","Х","х","Х",0],BracketRight:["ъ","Ъ","ъ","Ъ",0],Backslash:["\\","/","\\","/",0],Semicolon:["ж","Ж","ж","Ж",0],Quote:["э","Э","э","Э",0],Backquote:["ё","Ё","ё","Ё",0],Comma:["б","Б","б","Б",0],Period:["ю","Ю","ю","Ю",0],Slash:[".",",",".",",",0],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:["","","","",0],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:["/","/","/","/",0],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:[],NumpadMultiply:["*","*","*","*",0],NumpadSubtract:["-","-","-","-",0],NumpadAdd:["+","+","+","+",0],NumpadEnter:[],Numpad1:["","1","","1",0],Numpad2:["","2","","2",0],Numpad3:["","3","","3",0],Numpad4:["","4","","4",0],Numpad5:["","5","","5",0],Numpad6:["","6","","6",0],Numpad7:["","7","","7",0],Numpad8:["","8","","8",0],Numpad9:["","9","","9",0],Numpad0:["","0","","0",0],NumpadDecimal:["",",","",",",0],IntlBackslash:["/","|","|","¦",0],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Open:[],Help:[],Select:[],Again:[],Undo:[],Cut:[],Copy:[],Paste:[],Find:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],Lang5:[],NumpadParenLeft:[],NumpadParenRight:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:["\r","\r","\r","\r",0],MetaRight:[".",".",".",".",0],BrightnessUp:[],BrightnessDown:[],MediaPlay:[],MediaRecord:[],MediaFastForward:[],MediaRewind:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],SelectTask:[],LaunchScreenSaver:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[],MailReply:[],MailForward:[],MailSend:[]}});export{e as KeyboardLayoutContribution}; diff --git a/snapshots/master/editor/assets/layout.contribution.win-DZRWibbm.js b/snapshots/master/editor/assets/layout.contribution.win-DZRWibbm.js new file mode 100644 index 000000000..84edd4c7b --- /dev/null +++ b/snapshots/master/editor/assets/layout.contribution.win-DZRWibbm.js @@ -0,0 +1 @@ +import{K as e}from"./_.contribution-BThlLkzn.js";e.INSTANCE.registerKeyboardLayout({layout:{name:"00000409",id:"",text:"US",isUSStandard:!0},secondaryLayouts:[{name:"00000804",id:"",text:"Chinese (Simplified) - US Keyboard"},{name:"00000411",id:"",text:"Japanese"},{name:"00000412",id:"",text:"Korean"},{name:"00000404",id:"",text:"Chinese (Traditional) - US Keyboard"}],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2","@","","",0,"VK_2"],Digit3:["3","#","","",0,"VK_3"],Digit4:["4","$","","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","^","","",0,"VK_6"],Digit7:["7","&","","",0,"VK_7"],Digit8:["8","*","","",0,"VK_8"],Digit9:["9","(","","",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","","",0,"VK_OEM_MINUS"],Equal:["=","+","","",0,"VK_OEM_PLUS"],BracketLeft:["[","{","","",0,"VK_OEM_4"],BracketRight:["]","}","","",0,"VK_OEM_6"],Backslash:["\\","|","","",0,"VK_OEM_5"],Semicolon:[";",":","","",0,"VK_OEM_1"],Quote:["'",'"',"","",0,"VK_OEM_7"],Backquote:["`","~","","",0,"VK_OEM_3"],Comma:[",","<","","",0,"VK_OEM_COMMA"],Period:[".",">","","",0,"VK_OEM_PERIOD"],Slash:["/","?","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000080A",id:"",text:"Latin American"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","@","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"","",0,"VK_2"],Digit3:["3","#","","",0,"VK_3"],Digit4:["4","$","","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","","",0,"VK_7"],Digit8:["8","(","","",0,"VK_8"],Digit9:["9",")","","",0,"VK_9"],Digit0:["0","=","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["'","?","\\","",0,"VK_OEM_4"],Equal:["¿","¡","","",0,"VK_OEM_6"],BracketLeft:["´","¨","","",0,"VK_OEM_1"],BracketRight:["+","*","~","",0,"VK_OEM_PLUS"],Backslash:["}","]","`","",0,"VK_OEM_2"],Semicolon:["ñ","Ñ","","",0,"VK_OEM_3"],Quote:["{","[","^","",0,"VK_OEM_7"],Backquote:["|","°","¬","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00004009",id:"",text:"India"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","ā","Ā",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","ḍ","Ḍ",0,"VK_D"],KeyE:["e","E","ē","Ē",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","ṅ","Ṅ",0,"VK_G"],KeyH:["h","H","ḥ","Ḥ",0,"VK_H"],KeyI:["i","I","ī","Ī",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","l̥","L̥",0,"VK_L"],KeyM:["m","M","ṁ","Ṁ",0,"VK_M"],KeyN:["n","N","ṇ","Ṇ",0,"VK_N"],KeyO:["o","O","ō","Ō",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","æ","Æ",0,"VK_Q"],KeyR:["r","R","r̥","R̥",0,"VK_R"],KeyS:["s","S","ś","Ś",0,"VK_S"],KeyT:["t","T","ṭ","Ṭ",0,"VK_T"],KeyU:["u","U","ū","Ū",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","ṣ","Ṣ",0,"VK_X"],KeyY:["y","Y","ñ","Ñ",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2","@","","",0,"VK_2"],Digit3:["3","#","","",0,"VK_3"],Digit4:["4","$","₹","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","^","","ˆ",0,"VK_6"],Digit7:["7","&","","",0,"VK_7"],Digit8:["8","*","","",0,"VK_8"],Digit9:["9","(","","˘",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","-","ˍ",0,"VK_OEM_MINUS"],Equal:["=","+","","",0,"VK_OEM_PLUS"],BracketLeft:["[","{","","",0,"VK_OEM_4"],BracketRight:["]","}","","",0,"VK_OEM_6"],Backslash:["\\","|","","",0,"VK_OEM_5"],Semicolon:[";",":","","",0,"VK_OEM_1"],Quote:["'",'"',"","",0,"VK_OEM_7"],Backquote:["`","~","","~",0,"VK_OEM_3"],Comma:[",","<",",","<",0,"VK_OEM_COMMA"],Period:[".",">",".","",0,"VK_OEM_PERIOD"],Slash:["/","?","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000407",id:"",text:"German"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","µ","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","@","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["z","Z","","",0,"VK_Z"],KeyZ:["y","Y","","",0,"VK_Y"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"²","",0,"VK_2"],Digit3:["3","§","³","",0,"VK_3"],Digit4:["4","$","","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["ß","?","\\","ẞ",0,"VK_OEM_4"],Equal:["´","`","","",0,"VK_OEM_6"],BracketLeft:["ü","Ü","","",0,"VK_OEM_1"],BracketRight:["+","*","~","",0,"VK_OEM_PLUS"],Backslash:["#","'","","",0,"VK_OEM_2"],Semicolon:["ö","Ö","","",0,"VK_OEM_3"],Quote:["ä","Ä","","",0,"VK_OEM_7"],Backquote:["^","°","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","|","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000809",id:"",text:"United Kingdom"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","á","Á",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","é","É",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","í","Í",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","ó","Ó",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","ú","Ú",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"","",0,"VK_2"],Digit3:["3","£","","",0,"VK_3"],Digit4:["4","$","€","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","^","","",0,"VK_6"],Digit7:["7","&","","",0,"VK_7"],Digit8:["8","*","","",0,"VK_8"],Digit9:["9","(","","",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","","",0,"VK_OEM_MINUS"],Equal:["=","+","","",0,"VK_OEM_PLUS"],BracketLeft:["[","{","","",0,"VK_OEM_4"],BracketRight:["]","}","","",0,"VK_OEM_6"],Backslash:["#","~","\\","|",0,"VK_OEM_7"],Semicolon:[";",":","","",0,"VK_OEM_1"],Quote:["'","@","","",0,"VK_OEM_3"],Backquote:["`","¬","¦","",0,"VK_OEM_8"],Comma:[",","<","","",0,"VK_OEM_COMMA"],Period:[".",">","","",0,"VK_OEM_PERIOD"],Slash:["/","?","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_5"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000040C",id:"",text:"French"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["q","Q","","",0,"VK_Q"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:[",","?","","",0,"VK_OEM_COMMA"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["a","A","","",0,"VK_A"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["z","Z","","",0,"VK_Z"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["w","W","","",0,"VK_W"],Digit1:["&","1","","",0,"VK_1"],Digit2:["é","2","~","",0,"VK_2"],Digit3:['"',"3","#","",0,"VK_3"],Digit4:["'","4","{","",0,"VK_4"],Digit5:["(","5","[","",0,"VK_5"],Digit6:["-","6","|","",0,"VK_6"],Digit7:["è","7","`","",0,"VK_7"],Digit8:["_","8","\\","",0,"VK_8"],Digit9:["ç","9","^","",0,"VK_9"],Digit0:["à","0","@","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:[")","°","]","",0,"VK_OEM_4"],Equal:["=","+","}","",0,"VK_OEM_PLUS"],BracketLeft:["^","¨","","",0,"VK_OEM_6"],BracketRight:["$","£","¤","",0,"VK_OEM_1"],Backslash:["*","µ","","",0,"VK_OEM_5"],Semicolon:["m","M","","",0,"VK_M"],Quote:["ù","%","","",0,"VK_OEM_3"],Backquote:["²","","","",0,"VK_OEM_7"],Comma:[";",".","","",0,"VK_OEM_PERIOD"],Period:[":","/","","",0,"VK_OEM_2"],Slash:["!","§","","",0,"VK_OEM_8"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000416",id:"",text:"Portuguese (Brazilian ABNT)"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","₢","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","°","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","/","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","?","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","¹","",0,"VK_1"],Digit2:["2","@","²","",0,"VK_2"],Digit3:["3","#","³","",0,"VK_3"],Digit4:["4","$","£","",0,"VK_4"],Digit5:["5","%","¢","",0,"VK_5"],Digit6:["6","¨","¬","",0,"VK_6"],Digit7:["7","&","","",0,"VK_7"],Digit8:["8","*","","",0,"VK_8"],Digit9:["9","(","","",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","","",0,"VK_OEM_MINUS"],Equal:["=","+","§","",0,"VK_OEM_PLUS"],BracketLeft:["´","`","","",0,"VK_OEM_4"],BracketRight:["[","{","ª","",0,"VK_OEM_6"],Backslash:["]","}","º","",0,"VK_OEM_5"],Semicolon:["ç","Ç","","",0,"VK_OEM_1"],Quote:["~","^","","",0,"VK_OEM_7"],Backquote:["'",'"',"","",0,"VK_OEM_3"],Comma:[",","<","","",0,"VK_OEM_COMMA"],Period:[".",">","","",0,"VK_OEM_PERIOD"],Slash:[";",":","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[".",".","","",0,"VK_ABNT_C2"],IntlRo:["/","?","°","",0,"VK_ABNT_C1"],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000040A",id:"",text:"Spanish"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","|","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","·","#","",0,"VK_3"],Digit4:["4","$","~","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","¬","",0,"VK_6"],Digit7:["7","/","","",0,"VK_7"],Digit8:["8","(","","",0,"VK_8"],Digit9:["9",")","","",0,"VK_9"],Digit0:["0","=","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["'","?","","",0,"VK_OEM_4"],Equal:["¡","¿","","",0,"VK_OEM_6"],BracketLeft:["`","^","[","",0,"VK_OEM_1"],BracketRight:["+","*","]","",0,"VK_OEM_PLUS"],Backslash:["ç","Ç","}","",0,"VK_OEM_2"],Semicolon:["ñ","Ñ","","",0,"VK_OEM_3"],Quote:["´","¨","{","",0,"VK_OEM_7"],Backquote:["º","ª","\\","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00020409",id:"0001",text:"United States-International"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","á","Á",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","©","¢",0,"VK_C"],KeyD:["d","D","ð","Ð",0,"VK_D"],KeyE:["e","E","é","É",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","í","Í",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","ø","Ø",0,"VK_L"],KeyM:["m","M","µ","",0,"VK_M"],KeyN:["n","N","ñ","Ñ",0,"VK_N"],KeyO:["o","O","ó","Ó",0,"VK_O"],KeyP:["p","P","ö","Ö",0,"VK_P"],KeyQ:["q","Q","ä","Ä",0,"VK_Q"],KeyR:["r","R","®","",0,"VK_R"],KeyS:["s","S","ß","§",0,"VK_S"],KeyT:["t","T","þ","Þ",0,"VK_T"],KeyU:["u","U","ú","Ú",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","å","Å",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","ü","Ü",0,"VK_Y"],KeyZ:["z","Z","æ","Æ",0,"VK_Z"],Digit1:["1","!","¡","¹",0,"VK_1"],Digit2:["2","@","²","",0,"VK_2"],Digit3:["3","#","³","",0,"VK_3"],Digit4:["4","$","¤","£",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","^","¼","",0,"VK_6"],Digit7:["7","&","½","",0,"VK_7"],Digit8:["8","*","¾","",0,"VK_8"],Digit9:["9","(","‘","",0,"VK_9"],Digit0:["0",")","’","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","¥","",0,"VK_OEM_MINUS"],Equal:["=","+","×","÷",0,"VK_OEM_PLUS"],BracketLeft:["[","{","«","",0,"VK_OEM_4"],BracketRight:["]","}","»","",0,"VK_OEM_6"],Backslash:["\\","|","¬","¦",0,"VK_OEM_5"],Semicolon:[";",":","¶","°",0,"VK_OEM_1"],Quote:["'",'"',"´","¨",0,"VK_OEM_7"],Backquote:["`","~","","",0,"VK_OEM_3"],Comma:[",","<","ç","Ç",0,"VK_OEM_COMMA"],Period:[".",">","","",0,"VK_OEM_PERIOD"],Slash:["/","?","¿","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000419",id:"",text:"Russian"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["ф","Ф","","",0,"VK_A"],KeyB:["и","И","","",0,"VK_B"],KeyC:["с","С","","",0,"VK_C"],KeyD:["в","В","","",0,"VK_D"],KeyE:["у","У","","",0,"VK_E"],KeyF:["а","А","","",0,"VK_F"],KeyG:["п","П","","",0,"VK_G"],KeyH:["р","Р","","",0,"VK_H"],KeyI:["ш","Ш","","",0,"VK_I"],KeyJ:["о","О","","",0,"VK_J"],KeyK:["л","Л","","",0,"VK_K"],KeyL:["д","Д","","",0,"VK_L"],KeyM:["ь","Ь","","",0,"VK_M"],KeyN:["т","Т","","",0,"VK_N"],KeyO:["щ","Щ","","",0,"VK_O"],KeyP:["з","З","","",0,"VK_P"],KeyQ:["й","Й","","",0,"VK_Q"],KeyR:["к","К","","",0,"VK_R"],KeyS:["ы","Ы","","",0,"VK_S"],KeyT:["е","Е","","",0,"VK_T"],KeyU:["г","Г","","",0,"VK_U"],KeyV:["м","М","","",0,"VK_V"],KeyW:["ц","Ц","","",0,"VK_W"],KeyX:["ч","Ч","","",0,"VK_X"],KeyY:["н","Н","","",0,"VK_Y"],KeyZ:["я","Я","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"","",0,"VK_2"],Digit3:["3","№","","",0,"VK_3"],Digit4:["4",";","","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6",":","","",0,"VK_6"],Digit7:["7","?","","",0,"VK_7"],Digit8:["8","*","₽","",0,"VK_8"],Digit9:["9","(","","",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","","",0,"VK_OEM_MINUS"],Equal:["=","+","","",0,"VK_OEM_PLUS"],BracketLeft:["х","Х","","",0,"VK_OEM_4"],BracketRight:["ъ","Ъ","","",0,"VK_OEM_6"],Backslash:["\\","/","","",0,"VK_OEM_5"],Semicolon:["ж","Ж","","",0,"VK_OEM_1"],Quote:["э","Э","","",0,"VK_OEM_7"],Backquote:["ё","Ё","","",0,"VK_OEM_3"],Comma:["б","Б","","",0,"VK_OEM_COMMA"],Period:["ю","Ю","","",0,"VK_OEM_PERIOD"],Slash:[".",",","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","/","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000415",id:"",text:"Polish (Programmers)"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","ą","Ą",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","ć","Ć",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","ę","Ę",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","ł","Ł",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","ń","Ń",0,"VK_N"],KeyO:["o","O","ó","Ó",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","ś","Ś",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","€","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","ź","Ź",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","ż","Ż",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2","@","","",0,"VK_2"],Digit3:["3","#","","",0,"VK_3"],Digit4:["4","$","","",0,"VK_4"],Digit5:["5","%","","",0,"VK_5"],Digit6:["6","^","","",0,"VK_6"],Digit7:["7","&","","",0,"VK_7"],Digit8:["8","*","","",0,"VK_8"],Digit9:["9","(","","",0,"VK_9"],Digit0:["0",")","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["-","_","","",0,"VK_OEM_MINUS"],Equal:["=","+","","",0,"VK_OEM_PLUS"],BracketLeft:["[","{","","",0,"VK_OEM_4"],BracketRight:["]","}","","",0,"VK_OEM_6"],Backslash:["\\","|","","",0,"VK_OEM_5"],Semicolon:[";",":","","",0,"VK_OEM_1"],Quote:["'",'"',"","",0,"VK_OEM_7"],Backquote:["`","~","","",0,"VK_OEM_3"],Comma:[",","<","","",0,"VK_OEM_COMMA"],Period:[".",">","","",0,"VK_OEM_PERIOD"],Slash:["/","?","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000410",id:"",text:"Italian"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"","",0,"VK_2"],Digit3:["3","£","","",0,"VK_3"],Digit4:["4","$","","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","","",0,"VK_7"],Digit8:["8","(","","",0,"VK_8"],Digit9:["9",")","","",0,"VK_9"],Digit0:["0","=","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["'","?","","",0,"VK_OEM_4"],Equal:["ì","^","","",0,"VK_OEM_6"],BracketLeft:["è","é","[","{",0,"VK_OEM_1"],BracketRight:["+","*","]","}",0,"VK_OEM_PLUS"],Backslash:["ù","§","","",0,"VK_OEM_2"],Semicolon:["ò","ç","@","",0,"VK_OEM_3"],Quote:["à","°","#","",0,"VK_OEM_7"],Backquote:["\\","|","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000041D",id:"",text:"Swedish"},secondaryLayouts:[{name:"0000040B",id:"",text:"Finnish"}],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","µ","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","#","£","",0,"VK_3"],Digit4:["4","¤","$","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["+","?","\\","",0,"VK_OEM_PLUS"],Equal:["´","`","","",0,"VK_OEM_4"],BracketLeft:["å","Å","","",0,"VK_OEM_6"],BracketRight:["¨","^","~","",0,"VK_OEM_1"],Backslash:["'","*","","",0,"VK_OEM_2"],Semicolon:["ö","Ö","","",0,"VK_OEM_3"],Quote:["ä","Ä","","",0,"VK_OEM_7"],Backquote:["§","½","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","|","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000041F",id:"",text:"Turkish Q"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","æ","Æ",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["ı","I","i","İ",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","@","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","ß","",0,"VK_S"],KeyT:["t","T","₺","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!",">","",0,"VK_1"],Digit2:["2","'","£","",0,"VK_2"],Digit3:["3","^","#","",0,"VK_3"],Digit4:["4","+","$","",0,"VK_4"],Digit5:["5","%","½","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["*","?","\\","",0,"VK_OEM_8"],Equal:["-","_","|","",0,"VK_OEM_MINUS"],BracketLeft:["ğ","Ğ","¨","",0,"VK_OEM_4"],BracketRight:["ü","Ü","~","",0,"VK_OEM_6"],Backslash:[",",";","`","",0,"VK_OEM_COMMA"],Semicolon:["ş","Ş","´","",0,"VK_OEM_1"],Quote:["i","İ","","",0,"VK_OEM_7"],Backquote:['"',"é","<","",0,"VK_OEM_3"],Comma:["ö","Ö","","",0,"VK_OEM_2"],Period:["ç","Ç","","",0,"VK_OEM_5"],Slash:[".",":","","",0,"VK_OEM_PERIOD"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","|","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000816",id:"",text:"Portuguese"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","#","£","",0,"VK_3"],Digit4:["4","$","§","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["'","?","","",0,"VK_OEM_4"],Equal:["«","»","","",0,"VK_OEM_6"],BracketLeft:["+","*","¨","",0,"VK_OEM_PLUS"],BracketRight:["´","`","]","",0,"VK_OEM_1"],Backslash:["~","^","","",0,"VK_OEM_2"],Semicolon:["ç","Ç","","",0,"VK_OEM_3"],Quote:["º","ª","","",0,"VK_OEM_7"],Backquote:["\\","|","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000406",id:"",text:"Danish"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","µ","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","#","£","",0,"VK_3"],Digit4:["4","¤","$","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["+","?","","",0,"VK_OEM_PLUS"],Equal:["´","`","|","",0,"VK_OEM_4"],BracketLeft:["å","Å","","",0,"VK_OEM_6"],BracketRight:["¨","^","~","",0,"VK_OEM_1"],Backslash:["'","*","","",0,"VK_OEM_2"],Semicolon:["æ","Æ","","",0,"VK_OEM_3"],Quote:["ø","Ø","","",0,"VK_OEM_7"],Backquote:["½","§","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","\\","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000414",id:"",text:"Norwegian"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","µ","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["z","Z","","",0,"VK_Z"],Digit1:["1","!","","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","#","£","",0,"VK_3"],Digit4:["4","¤","$","",0,"VK_4"],Digit5:["5","%","€","",0,"VK_5"],Digit6:["6","&","","",0,"VK_6"],Digit7:["7","/","{","",0,"VK_7"],Digit8:["8","(","[","",0,"VK_8"],Digit9:["9",")","]","",0,"VK_9"],Digit0:["0","=","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["+","?","","",0,"VK_OEM_PLUS"],Equal:["\\","`","´","",0,"VK_OEM_4"],BracketLeft:["å","Å","","",0,"VK_OEM_6"],BracketRight:["¨","^","~","",0,"VK_OEM_1"],Backslash:["'","*","","",0,"VK_OEM_2"],Semicolon:["ø","Ø","","",0,"VK_OEM_3"],Quote:["æ","Æ","","",0,"VK_OEM_7"],Backquote:["|","§","","",0,"VK_OEM_5"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000041E",id:"",text:"Thai Kedmanee"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["ฟ","ฤ","","",0,"VK_A"],KeyB:["ิ","ฺ","","",0,"VK_B"],KeyC:["แ","ฉ","","",0,"VK_C"],KeyD:["ก","ฏ","","",0,"VK_D"],KeyE:["ำ","ฎ","","",0,"VK_E"],KeyF:["ด","โ","","",0,"VK_F"],KeyG:["เ","ฌ","","",0,"VK_G"],KeyH:["้","็","","",0,"VK_H"],KeyI:["ร","ณ","","",0,"VK_I"],KeyJ:["่","๋","","",0,"VK_J"],KeyK:["า","ษ","","",0,"VK_K"],KeyL:["ส","ศ","","",0,"VK_L"],KeyM:["ท","?","","",0,"VK_M"],KeyN:["ื","์","","",0,"VK_N"],KeyO:["น","ฯ","","",0,"VK_O"],KeyP:["ย","ญ","","",0,"VK_P"],KeyQ:["ๆ","๐","","",0,"VK_Q"],KeyR:["พ","ฑ","","",0,"VK_R"],KeyS:["ห","ฆ","","",0,"VK_S"],KeyT:["ะ","ธ","","",0,"VK_T"],KeyU:["ี","๊","","",0,"VK_U"],KeyV:["อ","ฮ","","",0,"VK_V"],KeyW:["ไ",'"',"","",0,"VK_W"],KeyX:["ป",")","","",0,"VK_X"],KeyY:["ั","ํ","","",0,"VK_Y"],KeyZ:["ผ","(","","",0,"VK_Z"],Digit1:["ๅ","+","","",0,"VK_1"],Digit2:["/","๑","","",0,"VK_2"],Digit3:["-","๒","","",0,"VK_3"],Digit4:["ภ","๓","","",0,"VK_4"],Digit5:["ถ","๔","","",0,"VK_5"],Digit6:["ุ","ู","","",0,"VK_6"],Digit7:["ึ","฿","","",0,"VK_7"],Digit8:["ค","๕","","",0,"VK_8"],Digit9:["ต","๖","","",0,"VK_9"],Digit0:["จ","๗","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["ข","๘","","",0,"VK_OEM_MINUS"],Equal:["ช","๙","","",0,"VK_OEM_PLUS"],BracketLeft:["บ","ฐ","","",0,"VK_OEM_4"],BracketRight:["ล",",","","",0,"VK_OEM_6"],Backslash:["ฃ","ฅ","","",0,"VK_OEM_5"],Semicolon:["ว","ซ","","",0,"VK_OEM_1"],Quote:["ง",".","","",0,"VK_OEM_7"],Backquote:["_","%","","",0,"VK_OEM_3"],Comma:["ม","ฒ","","",0,"VK_OEM_COMMA"],Period:["ใ","ฬ","","",0,"VK_OEM_PERIOD"],Slash:["ฝ","ฦ","","",0,"VK_OEM_2"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["ฃ","ฅ","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"0000040E",id:"",text:"Hungarian"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","ä","",0,"VK_A"],KeyB:["b","B","{","",0,"VK_B"],KeyC:["c","C","&","",0,"VK_C"],KeyD:["d","D","Đ","",0,"VK_D"],KeyE:["e","E","Ä","",0,"VK_E"],KeyF:["f","F","[","",0,"VK_F"],KeyG:["g","G","]","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","Í","",0,"VK_I"],KeyJ:["j","J","í","",0,"VK_J"],KeyK:["k","K","ł","",0,"VK_K"],KeyL:["l","L","Ł","",0,"VK_L"],KeyM:["m","M","<","",0,"VK_M"],KeyN:["n","N","}","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","\\","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","đ","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","€","",0,"VK_U"],KeyV:["v","V","@","",0,"VK_V"],KeyW:["w","W","|","",0,"VK_W"],KeyX:["x","X","#","",0,"VK_X"],KeyY:["z","Z","","",0,"VK_Z"],KeyZ:["y","Y",">","",0,"VK_Y"],Digit1:["1","'","~","",0,"VK_1"],Digit2:["2",'"',"ˇ","",0,"VK_2"],Digit3:["3","+","^","",0,"VK_3"],Digit4:["4","!","˘","",0,"VK_4"],Digit5:["5","%","°","",0,"VK_5"],Digit6:["6","/","˛","",0,"VK_6"],Digit7:["7","=","`","",0,"VK_7"],Digit8:["8","(","˙","",0,"VK_8"],Digit9:["9",")","´","",0,"VK_9"],Digit0:["ö","Ö","˝","",0,"VK_OEM_3"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["ü","Ü","¨","",0,"VK_OEM_2"],Equal:["ó","Ó","¸","",0,"VK_OEM_PLUS"],BracketLeft:["ő","Ő","÷","",0,"VK_OEM_4"],BracketRight:["ú","Ú","×","",0,"VK_OEM_6"],Backslash:["ű","Ű","¤","",0,"VK_OEM_5"],Semicolon:["é","É","$","",0,"VK_OEM_1"],Quote:["á","Á","ß","",0,"VK_OEM_7"],Backquote:["0","§","","",0,"VK_0"],Comma:[",","?",";","",0,"VK_OEM_COMMA"],Period:[".",":",">","",0,"VK_OEM_PERIOD"],Slash:["-","_","*","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["í","Í","<","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000807",id:"",text:"Swiss German"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["w","W","","",0,"VK_W"],KeyX:["x","X","","",0,"VK_X"],KeyY:["z","Z","","",0,"VK_Z"],KeyZ:["y","Y","","",0,"VK_Y"],Digit1:["1","+","¦","",0,"VK_1"],Digit2:["2",'"',"@","",0,"VK_2"],Digit3:["3","*","#","",0,"VK_3"],Digit4:["4","ç","°","",0,"VK_4"],Digit5:["5","%","§","",0,"VK_5"],Digit6:["6","&","¬","",0,"VK_6"],Digit7:["7","/","|","",0,"VK_7"],Digit8:["8","(","¢","",0,"VK_8"],Digit9:["9",")","","",0,"VK_9"],Digit0:["0","=","","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["'","?","´","",0,"VK_OEM_4"],Equal:["^","`","~","",0,"VK_OEM_6"],BracketLeft:["ü","è","[","",0,"VK_OEM_1"],BracketRight:["¨","!","]","",0,"VK_OEM_3"],Backslash:["$","£","}","",0,"VK_OEM_8"],Semicolon:["ö","é","","",0,"VK_OEM_7"],Quote:["ä","à","{","",0,"VK_OEM_5"],Backquote:["§","°","","",0,"VK_OEM_2"],Comma:[",",";","","",0,"VK_OEM_COMMA"],Period:[".",":","","",0,"VK_OEM_PERIOD"],Slash:["-","_","","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","\\","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000813",id:"",text:"Belgian (Period)"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["q","Q","","",0,"VK_Q"],KeyB:["b","B","","",0,"VK_B"],KeyC:["c","C","","",0,"VK_C"],KeyD:["d","D","","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","","",0,"VK_F"],KeyG:["g","G","","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","","",0,"VK_K"],KeyL:["l","L","","",0,"VK_L"],KeyM:[",","?","","",0,"VK_OEM_COMMA"],KeyN:["n","N","","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["a","A","","",0,"VK_A"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","","",0,"VK_V"],KeyW:["z","Z","","",0,"VK_Z"],KeyX:["x","X","","",0,"VK_X"],KeyY:["y","Y","","",0,"VK_Y"],KeyZ:["w","W","","",0,"VK_W"],Digit1:["&","1","|","",0,"VK_1"],Digit2:["é","2","@","",0,"VK_2"],Digit3:['"',"3","#","",0,"VK_3"],Digit4:["'","4","{","",0,"VK_4"],Digit5:["(","5","[","",0,"VK_5"],Digit6:["§","6","^","",0,"VK_6"],Digit7:["è","7","","",0,"VK_7"],Digit8:["!","8","","",0,"VK_8"],Digit9:["ç","9","{","",0,"VK_9"],Digit0:["à","0","}","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:[")","°","","",0,"VK_OEM_4"],Equal:["-","_","","",0,"VK_OEM_MINUS"],BracketLeft:["^","¨","[","",0,"VK_OEM_6"],BracketRight:["$","*","]","",0,"VK_OEM_1"],Backslash:["µ","£","`","`",0,"VK_OEM_5"],Semicolon:["m","M","","",0,"VK_M"],Quote:["ù","%","´","´",0,"VK_OEM_3"],Backquote:["²","³","","",0,"VK_OEM_7"],Comma:[";",".","","",0,"VK_OEM_PERIOD"],Period:[":","/","","",0,"VK_OEM_2"],Slash:["=","+","~","~",0,"VK_OEM_PLUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["<",">","\\","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});e.INSTANCE.registerKeyboardLayout({layout:{name:"00000405",id:"",text:"Czech"},secondaryLayouts:[],mapping:{Sleep:[],WakeUp:[],KeyA:["a","A","","",0,"VK_A"],KeyB:["b","B","{","",0,"VK_B"],KeyC:["c","C","&","",0,"VK_C"],KeyD:["d","D","Đ","",0,"VK_D"],KeyE:["e","E","€","",0,"VK_E"],KeyF:["f","F","[","",0,"VK_F"],KeyG:["g","G","]","",0,"VK_G"],KeyH:["h","H","","",0,"VK_H"],KeyI:["i","I","","",0,"VK_I"],KeyJ:["j","J","","",0,"VK_J"],KeyK:["k","K","ł","",0,"VK_K"],KeyL:["l","L","Ł","",0,"VK_L"],KeyM:["m","M","","",0,"VK_M"],KeyN:["n","N","}","",0,"VK_N"],KeyO:["o","O","","",0,"VK_O"],KeyP:["p","P","","",0,"VK_P"],KeyQ:["q","Q","\\","",0,"VK_Q"],KeyR:["r","R","","",0,"VK_R"],KeyS:["s","S","đ","",0,"VK_S"],KeyT:["t","T","","",0,"VK_T"],KeyU:["u","U","","",0,"VK_U"],KeyV:["v","V","@","",0,"VK_V"],KeyW:["w","W","|","",0,"VK_W"],KeyX:["x","X","#","",0,"VK_X"],KeyY:["z","Z","","",0,"VK_Z"],KeyZ:["y","Y","","",0,"VK_Y"],Digit1:["+","1","~","",0,"VK_1"],Digit2:["ě","2","ˇ","",0,"VK_2"],Digit3:["š","3","^","",0,"VK_3"],Digit4:["č","4","˘","",0,"VK_4"],Digit5:["ř","5","°","",0,"VK_5"],Digit6:["ž","6","˛","",0,"VK_6"],Digit7:["ý","7","`","",0,"VK_7"],Digit8:["á","8","˙","",0,"VK_8"],Digit9:["í","9","´","",0,"VK_9"],Digit0:["é","0","˝","",0,"VK_0"],Enter:[],Escape:[],Backspace:[],Tab:[],Space:[" "," ","","",0,"VK_SPACE"],Minus:["=","%","¨","",0,"VK_OEM_PLUS"],Equal:["´","ˇ","¸","",0,"VK_OEM_2"],BracketLeft:["ú","/","÷","",0,"VK_OEM_4"],BracketRight:[")","(","×","",0,"VK_OEM_6"],Backslash:["¨","'","¤","",0,"VK_OEM_5"],Semicolon:["ů",'"',"$","",0,"VK_OEM_1"],Quote:["§","!","ß","",0,"VK_OEM_7"],Backquote:[";","°","","",0,"VK_OEM_3"],Comma:[",","?","<","",0,"VK_OEM_COMMA"],Period:[".",":",">","",0,"VK_OEM_PERIOD"],Slash:["-","_","*","",0,"VK_OEM_MINUS"],CapsLock:[],F1:[],F2:[],F3:[],F4:[],F5:[],F6:[],F7:[],F8:[],F9:[],F10:[],F11:[],F12:[],PrintScreen:[],ScrollLock:[],Pause:[],Insert:[],Home:[],PageUp:[],Delete:[],End:[],PageDown:[],ArrowRight:[],ArrowLeft:[],ArrowDown:[],ArrowUp:[],NumLock:[],NumpadDivide:["/","/","","",0,"VK_DIVIDE"],NumpadMultiply:["*","*","","",0,"VK_MULTIPLY"],NumpadSubtract:["-","-","","",0,"VK_SUBTRACT"],NumpadAdd:["+","+","","",0,"VK_ADD"],NumpadEnter:[],Numpad1:[],Numpad2:[],Numpad3:[],Numpad4:[],Numpad5:[],Numpad6:[],Numpad7:[],Numpad8:[],Numpad9:[],Numpad0:[],NumpadDecimal:[],IntlBackslash:["\\","|","","",0,"VK_OEM_102"],ContextMenu:[],Power:[],NumpadEqual:[],F13:[],F14:[],F15:[],F16:[],F17:[],F18:[],F19:[],F20:[],F21:[],F22:[],F23:[],F24:[],Help:[],Undo:[],Cut:[],Copy:[],Paste:[],AudioVolumeMute:[],AudioVolumeUp:[],AudioVolumeDown:[],NumpadComma:[],IntlRo:[],KanaMode:[],IntlYen:[],Convert:[],NonConvert:[],Lang1:[],Lang2:[],Lang3:[],Lang4:[],ControlLeft:[],ShiftLeft:[],AltLeft:[],MetaLeft:[],ControlRight:[],ShiftRight:[],AltRight:[],MetaRight:[],MediaTrackNext:[],MediaTrackPrevious:[],MediaStop:[],Eject:[],MediaPlayPause:[],MediaSelect:[],LaunchMail:[],LaunchApp2:[],LaunchApp1:[],BrowserSearch:[],BrowserHome:[],BrowserBack:[],BrowserForward:[],BrowserStop:[],BrowserRefresh:[],BrowserFavorites:[]}});export{e as KeyboardLayoutContribution}; diff --git a/snapshots/master/editor/assets/lsp_worker-B8ihI9ie.js b/snapshots/master/editor/assets/lsp_worker-DlVKdA8Y.js similarity index 98% rename from snapshots/master/editor/assets/lsp_worker-B8ihI9ie.js rename to snapshots/master/editor/assets/lsp_worker-DlVKdA8Y.js index 6a93e5e8b..049c77aa1 100644 --- a/snapshots/master/editor/assets/lsp_worker-B8ihI9ie.js +++ b/snapshots/master/editor/assets/lsp_worker-DlVKdA8Y.js @@ -1,5 +1,5 @@ (function(){"use strict";let p;const Ve=new Array(128).fill(void 0);Ve.push(void 0,null,!0,!1);function s(t){return Ve[t]}let Gt=Ve.length;function $c(t){t<132||(Ve[t]=Gt,Gt=t)}function fe(t){const e=s(t);return $c(t),e}let B=0,Zt=null;function Mn(){return(Zt===null||Zt.byteLength===0)&&(Zt=new Uint8Array(p.memory.buffer)),Zt}const On=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hc=typeof On.encodeInto=="function"?function(t,e){return On.encodeInto(t,e)}:function(t,e){const n=On.encode(t);return e.set(n),{read:t.length,written:n.length}};function U(t,e,n){if(n===void 0){const d=On.encode(t),f=e(d.length,1)>>>0;return Mn().subarray(f,f+d.length).set(d),B=d.length,f}let r=t.length,i=e(r,1)>>>0;const o=Mn();let c=0;for(;c127)break;o[i+c]=d}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;const d=Mn().subarray(i+c,i+r),f=Hc(t,d);c+=f.written,i=n(i,r,c,1)>>>0}return B=c,i}function j(t){return t==null}let mt=null;function P(){return(mt===null||mt.buffer.detached===!0||mt.buffer.detached===void 0&&mt.buffer!==p.memory.buffer)&&(mt=new DataView(p.memory.buffer)),mt}function g(t){Gt===Ve.length&&Ve.push(Ve.length+1);const e=Gt;return Gt=Ve[e],Ve[e]=t,e}const yo=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yo.decode();function F(t,e){return t=t>>>0,yo.decode(Mn().subarray(t,t+e))}function Vr(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){const i=t.length;let o="[";i>0&&(o+=Vr(t[0]));for(let c=1;c1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}const En=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{p.__wbindgen_export_2.get(t.dtor)(t.a,t.b)});function en(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;try{return r(i.a,i.b,...c)}finally{--i.cnt===0&&(p.__wbindgen_export_2.get(i.dtor)(i.a,i.b),i.a=0,En.unregister(i))}};return o.original=i,En.register(o,i,i),o}function tn(t,e,n){p._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3cf0698b1872d41a(t,e,g(n))}function Ee(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;const d=i.a;i.a=0;try{return r(d,i.b,...c)}finally{--i.cnt===0?(p.__wbindgen_export_2.get(i.dtor)(d,i.b),En.unregister(i)):i.a=d}};return o.original=i,En.register(o,i,i),o}function vo(t,e){p._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h679d01b4e099c0c1(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00c9413f2fcf954e(t,e,g(n))}function Ro(t,e,n,r){p._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfb9fc20940472abc(t,e,g(n),g(r))}function S(t,e){try{return t.apply(this,e)}catch(n){p.__wbindgen_exn_store(g(n))}}function xc(t,e,n,r){try{const d=p.__wbindgen_add_to_stack_pointer(-16);p.create(d,g(t),g(e),g(n),g(r));var i=P().getInt32(d+4*0,!0),o=P().getInt32(d+4*1,!0),c=P().getInt32(d+4*2,!0);if(c)throw fe(o);return Jr.__wrap(i)}finally{p.__wbindgen_add_to_stack_pointer(16)}}let nn=null;function zc(){return(nn===null||nn.byteLength===0)&&(nn=new Float32Array(p.memory.buffer)),nn}function Nn(t,e){return t=t>>>0,zc().subarray(t/4,t/4+e)}const Do=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_previewconnector_free(t>>>0,1));class Ur{static __wrap(e){e=e>>>0;const n=Object.create(Ur.prototype);return n.__wbg_ptr=e,Do.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Do.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_previewconnector_free(e,0)}static create(e,n,r,i){try{const f=p.__wbindgen_add_to_stack_pointer(-16),_=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),w=B;p.previewconnector_create(f,g(e),g(n),_,w,i);var o=P().getInt32(f+4*0,!0),c=P().getInt32(f+4*1,!0),d=P().getInt32(f+4*2,!0);if(d)throw fe(c);return fe(o)}finally{p.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=p.previewconnector_current_style(this.__wbg_ptr);return fe(e)}show_ui(){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_show_ui(i,this.__wbg_ptr);var e=P().getInt32(i+4*0,!0),n=P().getInt32(i+4*1,!0),r=P().getInt32(i+4*2,!0);if(r)throw fe(n);return fe(e)}finally{p.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_process_lsp_to_preview_message(i,this.__wbg_ptr,g(e));var n=P().getInt32(i+4*0,!0),r=P().getInt32(i+4*1,!0);if(r)throw fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}}const To=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_slintserver_free(t>>>0,1));class Jr{static __wrap(e){e=e>>>0;const n=Object.create(Jr.prototype);return n.__wbg_ptr=e,To.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,To.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_slintserver_free(e,0)}process_preview_to_lsp_message(e){const n=p.slintserver_process_preview_to_lsp_message(this.__wbg_ptr,g(e));return fe(n)}server_initialize_result(e){try{const o=p.__wbindgen_add_to_stack_pointer(-16);p.slintserver_server_initialize_result(o,this.__wbg_ptr,g(e));var n=P().getInt32(o+4*0,!0),r=P().getInt32(o+4*1,!0),i=P().getInt32(o+4*2,!0);if(i)throw fe(r);return fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}reload_document(e,n,r){const i=U(e,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_reload_document(this.__wbg_ptr,i,o,g(n),r);return fe(c)}handle_request(e,n,r){const i=U(n,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_handle_request(this.__wbg_ptr,g(e),i,o,g(r));return fe(c)}reload_config(){const e=p.slintserver_reload_config(this.__wbg_ptr);return fe(e)}}async function Bc(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function Vc(){const t={};return t.wbg={},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return g(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=s(n).stack,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(F(e,n))}finally{p.__wbindgen_free(r,i,1)}},t.wbg.__wbindgen_object_drop_ref=function(e){fe(e)},t.wbg.__wbg_width_ac5901de11cd9abc=function(e){return s(e).width},t.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return s(e).height},t.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbindgen_boolean_get=function(e){const n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_createShader_af087106532661d9=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return g(e)},t.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,n){s(e).stencil=n!==0},t.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,n){s(e).antialias=n!==0},t.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return S(function(e,n,r,i){const o=s(e).getContext(F(n,r),s(i));return j(o)?0:g(o)},arguments)},t.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let n;try{n=s(e)instanceof WebGL2RenderingContext}catch{n=!1}return n},t.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const n=s(e).getSupportedExtensions();return j(n)?0:g(n)},t.wbg.__wbg_length_ae22078168b726f5=function(e){return s(e).length},t.wbg.__wbg_get_3baa728f9d58d3f6=function(e,n){const r=s(e)[n>>>0];return g(r)},t.wbg.__wbindgen_string_get=function(e,n){const r=s(n),i=typeof r=="string"?r:void 0;var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getParameter_cfaed180705b9280=function(){return S(function(e,n){const r=s(e).getParameter(n>>>0);return g(r)},arguments)},t.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const n=s(e).createVertexArrayOES();return j(n)?0:g(n)},t.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const n=s(e).createVertexArray();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return s(e).getError()},t.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return s(e).getError()},t.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_scissor_d06b14c4966727fa=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,n){s(e).bindVertexArray(s(n))},t.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,n){s(e).bindVertexArrayOES(s(n))},t.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_disable_d73e59fee5b5e973=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disable_8908871f2334e76b=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_enable_68b3fa03a633259a=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enable_541ed84c1e7d269d=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texParameteri_531d0268109950ba=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,w)},arguments)},t.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_viewport_536c78dd69c44351=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilMask_702162181d88081f=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilOp_2418383669ca9228=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return s(e).devicePixelRatio},t.wbg.__wbg_document_8554450897a855b9=function(e){const n=s(e).document;return j(n)?0:g(n)},t.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,n,r){const i=s(e).getElementById(F(n,r));return j(i)?0:g(i)},t.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let n;try{n=s(e)instanceof HTMLCanvasElement}catch{n=!1}return n},t.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return s(e).clientWidth},t.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return s(e).clientHeight},t.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const n=s(e).dataset;return g(n)},t.wbg.__wbg_get_9a60fce5bf7da364=function(e,n,r,i){const o=s(n)[F(r,i)];var c=j(o)?0:U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},t.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let n;try{n=s(e)instanceof HTMLInputElement}catch{n=!1}return n},t.wbg.__wbg_style_e06c9e03355741e9=function(e){const n=s(e).style;return g(n)},t.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return s(e).offsetLeft},t.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return s(e).offsetTop},t.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return s(e).offsetWidth},t.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return s(e).offsetHeight},t.wbg.__wbg_before_ac3792b457802cbf=function(){return S(function(e,n){s(e).before(s(n))},arguments)},t.wbg.__wbindgen_object_clone_ref=function(e){const n=s(e);return g(n)},t.wbg.__wbg_setvalue_688819688274bec0=function(e,n,r){s(e).value=F(n,r)},t.wbg.__wbg_data_edba00a6420faae3=function(e,n){const r=s(n).data;var i=j(r)?0:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return s(e).isComposing},t.wbg.__wbg_inputType_dc144c8251b0d194=function(e,n){const r=s(n).inputType,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){s(e).preventDefault()},t.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return s(e).isComposing},t.wbg.__wbg_key_a626396efbca2b95=function(e,n){const r=s(n).key,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return s(e).altKey},t.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,n,r){return s(e).getModifierState(F(n,r))},t.wbg.__wbg_repeat_8451a79b3608855b=function(e){return s(e).repeat},t.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const n=s(e).clipboardData;return j(n)?0:g(n)},t.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return S(function(e,n,r,i){const o=s(n).getData(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let n;try{n=s(e)instanceof CanvasRenderingContext2D}catch{n=!1}return n},t.wbg.__wbg_setfont_931e1f36bec6a342=function(e,n,r){s(e).font=F(n,r)},t.wbg.__wbindgen_string_new=function(e,n){const r=F(e,n);return g(r)},t.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,n){s(e).fillStyle=s(n)},t.wbg.__wbg_id_8071f78aa2301217=function(e,n){const r=s(n).id,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return s(e).naturalWidth},t.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return s(e).naturalHeight},t.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,n){const r=s(n).currentSrc,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_src_707c2de7cbb580c7=function(e,n){const r=s(n).src,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_0d5e77f348d88b87=function(){return S(function(){const e=new Image;return g(e)},arguments)},t.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,n,r){s(e).crossOrigin=n===0?void 0:F(n,r)},t.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,n){s(e).onload=s(n)},t.wbg.__wbg_setsrc_129ba95151116b01=function(e,n,r){s(e).src=F(n,r)},t.wbg.__wbg_new0_65387337a95cf44d=function(){return g(new Date)},t.wbg.__wbg_getTime_91058879093a1589=function(e){return s(e).getTime()},t.wbg.__wbindgen_number_new=function(e){return g(e)},t.wbg.__wbg_new_7982fb43cfca37ae=function(e){const n=new Date(s(e));return g(n)},t.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return s(e).getTimezoneOffset()},t.wbg.__wbg_log_2f54632e0e18c089=function(e,n){console.log(F(e,n))},t.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_bufferData_0db2a74470353a96=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_bufferData_94ce174a81b32961=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,n){s(e).deleteVertexArray(s(n))},t.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,n){s(e).deleteVertexArrayOES(s(n))},t.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_setwidth_84b579903fae1a52=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_6ae385769cc2e592=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_next_f9cb570345655b9a=function(){return S(function(e){const n=s(e).next();return g(n)},arguments)},t.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return s(e).done},t.wbg.__wbg_value_6d39332ab4788d86=function(e){const n=s(e).value;return g(n)},t.wbg.__wbg_iterator_888179a48810a9fe=function(){return g(Symbol.iterator)},t.wbg.__wbg_get_224d16597dbbfd96=function(){return S(function(e,n){const r=Reflect.get(s(e),s(n));return g(r)},arguments)},t.wbg.__wbindgen_is_function=function(e){return typeof s(e)=="function"},t.wbg.__wbindgen_is_object=function(e){const n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_next_de3e9db4440638b2=function(e){const n=s(e).next;return g(n)},t.wbg.__wbg_call_1084a111329e68ce=function(){return S(function(e,n){const r=s(e).call(s(n));return g(r)},arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return S(function(e,n,r){const i=s(e).call(s(n),s(r));return g(i)},arguments)},t.wbg.__wbg_call_c6fe275aaa60da79=function(){return S(function(e,n,r,i){const o=s(e).call(s(n),s(r),s(i));return g(o)},arguments)},t.wbg.__wbindgen_memory=function(){const e=p.memory;return g(e)},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const n=s(e).buffer;return g(n)},t.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,n,r){const i=new Uint8Array(s(e),n>>>0,r>>>0);return g(i)},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return s(e).length},t.wbg.__wbg_new_ea1883e1e5e86686=function(e){const n=new Uint8Array(s(e));return g(n)},t.wbg.__wbg_set_d1e79e2388520f18=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbg_set_eacc7d73fefaafdf=function(){return S(function(e,n,r){return Reflect.set(s(e),s(n),s(r))},arguments)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return S(function(){const e=self.self;return g(e)},arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return S(function(){const e=window.window;return g(e)},arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return S(function(){const e=globalThis.globalThis;return g(e)},arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return S(function(){const e=global.global;return g(e)},arguments)},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,n){const r=new Function(F(e,n));return g(r)},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(F(e,n));return g(r)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_number_get=function(e,n){const r=s(n),i=typeof r=="number"?r:void 0;P().setFloat64(e+8*1,j(i)?0:i,!0),P().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const n=Object.entries(s(e));return g(n)},t.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(s(e))},t.wbg.__wbindgen_as_number=function(e){return+s(e)},t.wbg.__wbg_String_b9412f8799faab3e=function(e,n){const r=String(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},t.wbg.__wbg_new_8608a2b51a5f6737=function(){return g(new Map)},t.wbg.__wbg_set_f975102236d3c502=function(e,n,r){s(e)[fe(n)]=fe(r)},t.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return g(e)},t.wbg.__wbg_set_673dda6c73d19609=function(e,n,r){s(e)[n>>>0]=fe(r)},t.wbg.__wbg_set_49185437f0ab06f8=function(e,n,r){const i=s(e).set(s(n),s(r));return g(i)},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbindgen_is_bigint=function(e){return typeof s(e)=="bigint"},t.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const r=s(n),i=typeof r=="bigint"?r:void 0;P().setBigInt64(e+8*1,j(i)?BigInt(0):i,!0),P().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbindgen_jsval_eq=function(e,n){return s(e)===s(n)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let n;try{n=s(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,n){const r=s(e)[s(n)];return g(r)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,n){try{var r={a:e,b:n},i=(c,d)=>{const f=r.a;r.a=0;try{return Ro(f,r.b,c,d)}finally{r.a=f}};const o=new Promise(i);return g(o)}finally{r.a=r.b=0}},t.wbg.__wbg_navigator_6210380287bf8581=function(e){const n=s(e).navigator;return g(n)},t.wbg.__wbg_platform_509d898d9dce4c23=function(){return S(function(e,n){const r=s(n).platform,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(n)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(F(e,n))},t.wbg.__wbindgen_debug_string=function(e,n){const r=Vr(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const n=s(e).queueMicrotask;return g(n)},t.wbg.__wbg_resolve_570458cb99d56a43=function(e){const n=Promise.resolve(s(e));return g(n)},t.wbg.__wbg_then_876bb3c633745cc6=function(e,n,r){const i=s(e).then(s(n),s(r));return g(i)},t.wbg.__wbg_then_95e6edc0f89b73b1=function(e,n){const r=s(e).then(s(n));return g(r)},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(s(e))},t.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return S(function(e,n,r){const i=s(e).getExtension(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return S(function(e,n,r){const i=s(e).matchMedia(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return S(function(e,n){s(e).cancelAnimationFrame(n)},arguments)},t.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return S(function(e,n){return s(e).setTimeout(s(n))},arguments)},t.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return S(function(e,n,r){const i=s(e).createElement(F(n,r));return g(i)},arguments)},t.wbg.__wbg_matches_212d57a200ff58f8=function(){return S(function(e,n,r){return s(e).matches(F(n,r))},arguments)},t.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return S(function(e,n,r,i,o){s(e).setAttribute(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_focus_06621101cc79f5d8=function(){return S(function(e){s(e).focus()},arguments)},t.wbg.__wbg_fillText_ae0445d1930428dd=function(){return S(function(e,n,r,i,o){s(e).fillText(F(n,r),i,o)},arguments)},t.wbg.__wbg_getContext_69ec873410cbba3c=function(){return S(function(e,n,r){const i=s(e).getContext(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return S(function(e,n){s(e).addListener(s(n))},arguments)},t.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return S(function(e,n,r,i,o){s(e).setProperty(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return S(function(e,n){URL.revokeObjectURL(F(e,n))},arguments)},t.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let n;try{n=s(e)instanceof Window}catch{n=!1}return n},t.wbg.__wbg_setData_41207994e2d54785=function(){return S(function(e,n,r,i,o){s(e).setData(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return S(function(e,n,r,i){s(e).addEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return S(function(e,n,r,i){s(e).removeEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return S(function(e,n){s(e).postMessage(s(n))},arguments)},t.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,n){const r=s(n).data;var i=j(r)?0:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_ebf2727385ee825c=function(){return S(function(){const e=new AbortController;return g(e)},arguments)},t.wbg.__wbg_new_40ff2b042829bc58=function(){return S(function(){const e=new MessageChannel;return g(e)},arguments)},t.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const n=s(e).performance;return g(n)},t.wbg.__wbg_now_abd80e969af37148=function(e){return s(e).now()},t.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return s(e).movementX},t.wbg.__wbg_movementY_3064817f736e8151=function(e){return s(e).movementY},t.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const n=s(e).signal;return g(n)},t.wbg.__wbg_postTask_99464245f349be5a=function(e,n,r){const i=s(e).postTask(s(n),s(r));return g(i)},t.wbg.__wbg_catch_a279b1da46d132d8=function(e,n){const r=s(e).catch(s(n));return g(r)},t.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const n=s(e).port1;return g(n)},t.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,n){s(e).onmessage=s(n)},t.wbg.__wbg_start_f642a950f6c98a0e=function(e){s(e).start()},t.wbg.__wbg_port2_7d887905fa4a6677=function(e){const n=s(e).port2;return g(n)},t.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return S(function(e,n){return s(e).requestIdleCallback(s(n))},arguments)},t.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return S(function(e,n,r){return s(e).setTimeout(s(n),r)},arguments)},t.wbg.__wbg_of_99c2a118200b1e62=function(e,n){const r=Array.of(s(e),s(n));return g(r)},t.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const n=Array.of(s(e));return g(n)},t.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return S(function(e,n,r){s(e).postMessage(s(n),s(r))},arguments)},t.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,n){const r=s(n).pointerType,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return s(e).pointerId},t.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return S(function(e,n){s(e).setPointerCapture(n)},arguments)},t.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return s(e).pressure},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return s(e).persisted},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const n=s(e).contentRect;return g(n)},t.wbg.__wbg_width_e7964a50b174d035=function(e){return s(e).width},t.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return s(e).height},t.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const n=s(e).devicePixelContentBoxSize;return g(n)},t.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return s(e).inlineSize},t.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return s(e).blockSize},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return g(e)},t.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,n){const r=Object.getOwnPropertyDescriptor(s(e),s(n));return g(r)},t.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,n,r){s(e).type=F(n,r)},t.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return S(function(e,n){const r=new Blob(s(e),s(n));return g(r)},arguments)},t.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return S(function(e,n){const r=URL.createObjectURL(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const n=s(e).Window;return g(n)},t.wbg.__wbg_new_25d9d4e2932d816f=function(){return S(function(e,n){const r=new Worker(F(e,n));return g(r)},arguments)},t.wbg.__wbg_error_9ce09486992d3ac5=function(e,n){console.error(s(e),s(n))},t.wbg.__wbg_abort_8659d889a7877ae3=function(e){s(e).abort()},t.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,n){s(e).cancelIdleCallback(n>>>0)},t.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,n){s(e).clearTimeout(n)},t.wbg.__wbg_close_87d69f9e9fe928c3=function(e){s(e).close()},t.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const n=s(e).userAgentData;return j(n)?0:g(n)},t.wbg.__wbg_brands_982de08b35281a98=function(e){const n=s(e).brands;return g(n)},t.wbg.__wbg_brand_cdcf0249d44027a8=function(e,n){const r=s(n).brand,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return S(function(e,n){const r=s(n).userAgent,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){s(e).disconnect()},t.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){s(e).disconnect()},t.wbg.__wbg_cancel_cba86749f45f30ae=function(e){s(e).cancel()},t.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},t.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){s(e).webkitRequestFullscreen()},t.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const n=s(e).requestFullscreen();return g(n)},t.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const n=s(e).webkitFullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const n=s(e).fullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_is_009b1ef508712fda=function(e,n){return Object.is(s(e),s(n))},t.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,n,r){const i=s(e).animate(s(n),s(r));return g(i)},t.wbg.__wbg_play_5896e5851ba90aa2=function(e){s(e).play()},t.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return S(function(e,n){s(e).removeListener(s(n))},arguments)},t.wbg.__wbg_contains_4f87c5405416b4fd=function(e,n){return s(e).contains(s(n))},t.wbg.__wbg_unobserve_e67452df241a602d=function(e,n){s(e).unobserve(s(n))},t.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){s(e).webkitExitFullscreen()},t.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){s(e).exitFullscreen()},t.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return S(function(e,n,r,i){const o=s(n).getPropertyValue(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return S(function(e,n,r,i){const o=s(n).removeProperty(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const n=s(e).visibilityState;return{hidden:0,visible:1}[n]??2},t.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const n=s(e).body;return j(n)?0:g(n)},t.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return S(function(e,n){const r=s(e).appendChild(s(n));return g(r)},arguments)},t.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return S(function(e,n){const r=s(e).getComputedStyle(s(n));return j(r)?0:g(r)},arguments)},t.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const n=s(e).activeElement;return j(n)?0:g(n)},t.wbg.__wbg_new_42acb42ec2ace97c=function(){return S(function(e){const n=new ResizeObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,n){s(e).box=["border-box","content-box","device-pixel-content-box"][n]},t.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,n,r){s(e).observe(s(n),s(r))},t.wbg.__wbg_new_d0c6c2df51a6d903=function(){return S(function(e){const n=new IntersectionObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_observe_c901133fbef21560=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const n=s(e).getBoundingClientRect();return g(n)},t.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return s(e).x},t.wbg.__wbg_y_bd4e2c0613413655=function(e){return s(e).y},t.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return S(function(e,n){return s(e).requestAnimationFrame(s(n))},arguments)},t.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_button_460cdec9f2512a91=function(e){return s(e).button},t.wbg.__wbg_offsetX_294898d040917c6b=function(e){return s(e).offsetX},t.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return s(e).offsetY},t.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return s(e).deltaX},t.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return s(e).deltaY},t.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return s(e).deltaMode},t.wbg.__wbg_code_01dc6af887ca9ecb=function(e,n){const r=s(n).code,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return s(e).location},t.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return s(e).metaKey},t.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return s(e).altKey},t.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return s(e).metaKey},t.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const n=s(e).getCoalescedEvents();return g(n)},t.wbg.__wbindgen_closure_wrapper4150=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4152=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4153=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4154=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4155=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6480=function(e,n,r){const i=Ee(e,n,1832,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12109=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13276=function(e,n,r){const i=Ee(e,n,1832,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper13310=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13331=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13362=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13375=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13392=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13398=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13416=function(e,n,r){const i=Ee(e,n,1832,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13420=function(e,n,r){const i=Ee(e,n,1832,Ro);return g(i)},t}function Uc(t,e){return p=t.exports,Po.__wbindgen_wasm_module=e,mt=null,nn=null,Zt=null,p}async function Po(t){if(p!==void 0)return p;typeof t<"u"&&Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof t>"u"&&(t=new URL(""+new URL("slint_lsp_wasm_bg-CWnb3MgQ.wasm",self.location.href).href,self.location.href));const e=Vc();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bc(await t,e);return Uc(n,r)}var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var ko={},Xr={},Ue={},ie={},wt={},Qr={},jn={},q={},le={};Object.defineProperty(le,"__esModule",{value:!0}),le.stringArray=le.array=le.func=le.error=le.number=le.string=le.boolean=void 0;function Xc(t){return t===!0||t===!1}le.boolean=Xc;function So(t){return typeof t=="string"||t instanceof String}le.string=So;function Qc(t){return typeof t=="number"||t instanceof Number}le.number=Qc;function Yc(t){return t instanceof Error}le.error=Yc;function Kc(t){return typeof t=="function"}le.func=Kc;function Co(t){return Array.isArray(t)}le.array=Co;function Gc(t){return Co(t)&&t.every(e=>So(e))}le.stringArray=Gc,Object.defineProperty(q,"__esModule",{value:!0}),q.Message=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType=q.RequestType0=q.AbstractMessageSignature=q.ParameterStructures=q.ResponseError=q.ErrorCodes=void 0;const pt=le;var Yr;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Yr||(q.ErrorCodes=Yr={}));class Kr extends Error{constructor(e,n,r){super(n),this.code=pt.number(e)?e:Yr.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Kr.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}q.ResponseError=Kr;class pe{constructor(e){this.kind=e}static is(e){return e===pe.auto||e===pe.byName||e===pe.byPosition}toString(){return this.kind}}q.ParameterStructures=pe,pe.auto=new pe("auto"),pe.byPosition=new pe("byPosition"),pe.byName=new pe("byName");class Y{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return pe.auto}}q.AbstractMessageSignature=Y;class Zc extends Y{constructor(e){super(e,0)}}q.RequestType0=Zc;class ea extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType=ea;class ta extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType1=ta;class na extends Y{constructor(e){super(e,2)}}q.RequestType2=na;class ra extends Y{constructor(e){super(e,3)}}q.RequestType3=ra;class ia extends Y{constructor(e){super(e,4)}}q.RequestType4=ia;class oa extends Y{constructor(e){super(e,5)}}q.RequestType5=oa;class sa extends Y{constructor(e){super(e,6)}}q.RequestType6=sa;class ca extends Y{constructor(e){super(e,7)}}q.RequestType7=ca;class aa extends Y{constructor(e){super(e,8)}}q.RequestType8=aa;class ua extends Y{constructor(e){super(e,9)}}q.RequestType9=ua;class da extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType=da;class la extends Y{constructor(e){super(e,0)}}q.NotificationType0=la;class fa extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType1=fa;class ga extends Y{constructor(e){super(e,2)}}q.NotificationType2=ga;class _a extends Y{constructor(e){super(e,3)}}q.NotificationType3=_a;class ba extends Y{constructor(e){super(e,4)}}q.NotificationType4=ba;class ha extends Y{constructor(e){super(e,5)}}q.NotificationType5=ha;class ma extends Y{constructor(e){super(e,6)}}q.NotificationType6=ma;class wa extends Y{constructor(e){super(e,7)}}q.NotificationType7=wa;class pa extends Y{constructor(e){super(e,8)}}q.NotificationType8=pa;class ya extends Y{constructor(e){super(e,9)}}q.NotificationType9=ya;var qo;(function(t){function e(i){const o=i;return o&&pt.string(o.method)&&(pt.string(o.id)||pt.number(o.id))}t.isRequest=e;function n(i){const o=i;return o&&pt.string(o.method)&&i.id===void 0}t.isNotification=n;function r(i){const o=i;return o&&(o.result!==void 0||!!o.error)&&(pt.string(o.id)||pt.number(o.id)||o.id===null)}t.isResponse=r})(qo||(q.Message=qo={}));var Je={},Mo;Object.defineProperty(Je,"__esModule",{value:!0}),Je.LRUCache=Je.LinkedMap=Je.Touch=void 0;var ye;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(ye||(Je.Touch=ye={}));class Oo{constructor(){this[Mo]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=ye.None){const r=this._map.get(e);if(r)return n!==ye.None&&this.touch(r,n),r.value}set(e,n,r=ye.None){let i=this._map.get(e);if(i)i.value=n,r!==ye.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case ye.None:this.addItemLast(i);break;case ye.First:this.addItemFirst(i);break;case ye.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Mo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ye.First&&n!==ye.Last)){if(n===ye.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===ye.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}Je.LinkedMap=Oo;class va extends Oo{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=ye.AsNew){return super.get(e,n)}peek(e){return super.get(e,ye.None)}set(e,n){return super.set(e,n,ye.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Je.LRUCache=va;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.Disposable=void 0;var Eo;(function(t){function e(n){return{dispose:n}}t.create=e})(Eo||(Fn.Disposable=Eo={}));var Ae={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});let Gr;function Zr(){if(Gr===void 0)throw new Error("No runtime abstraction layer installed");return Gr}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Gr=n}t.install=e})(Zr||(Zr={})),Xe.default=Zr,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.Emitter=Ae.Event=void 0;const Ra=Xe;var No;(function(t){const e={dispose(){}};t.None=function(){return e}})(No||(Ae.Event=No={}));class Da{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i{this._callbacks||(this._callbacks=new Da),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=In._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Ae.Emitter=In,In._noop=function(){};var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.CancellationTokenSource=et.CancellationToken=void 0;const Ta=Xe,Pa=le,ei=Ae;var An;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ei.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ei.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||Pa.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(An||(et.CancellationToken=An={}));const ka=Object.freeze(function(t,e){const n=(0,Ta.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class jo{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ka:(this._emitter||(this._emitter=new ei.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Sa{get token(){return this._token||(this._token=new jo),this._token}cancel(){this._token?this._token.cancel():this._token=An.Cancelled}dispose(){this._token?this._token instanceof jo&&this._token.dispose():this._token=An.None}}et.CancellationTokenSource=Sa;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.SharedArrayReceiverStrategy=qt.SharedArraySenderStrategy=void 0;const Ca=et;var rn;(function(t){t.Continue=0,t.Cancelled=1})(rn||(rn={}));class qa{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=rn.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,rn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}qt.SharedArraySenderStrategy=qa;class Ma{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===rn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oa{constructor(e){this.token=new Ma(e)}cancel(){}dispose(){}}class Ea{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new Ca.CancellationTokenSource:new Oa(n)}}qt.SharedArrayReceiverStrategy=Ea;var tt={},on={};Object.defineProperty(on,"__esModule",{value:!0}),on.Semaphore=void 0;const Na=Xe;class ja{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Na.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}on.Semaphore=ja,Object.defineProperty(tt,"__esModule",{value:!0}),tt.ReadableStreamMessageReader=tt.AbstractMessageReader=tt.MessageReader=void 0;const ti=Xe,Mt=le,ni=Ae,Fa=on;var Fo;(function(t){function e(n){let r=n;return r&&Mt.func(r.listen)&&Mt.func(r.dispose)&&Mt.func(r.onError)&&Mt.func(r.onClose)&&Mt.func(r.onPartialMessage)}t.is=e})(Fo||(tt.MessageReader=Fo={}));class Io{constructor(){this.errorEmitter=new ni.Emitter,this.closeEmitter=new ni.Emitter,this.partialMessageEmitter=new ni.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Mt.string(e.message)?e.message:"unknown"}`)}}tt.AbstractMessageReader=Io;var ri;(function(t){function e(n){let r,i;const o=new Map;let c;const d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(const f of n.contentDecoders)o.set(f.name,f);if(n.contentTypeDecoder!==void 0&&(c=n.contentTypeDecoder,d.set(c.name,c)),n.contentTypeDecoders!==void 0)for(const f of n.contentTypeDecoders)d.set(f.name,f)}return c===void 0&&(c=(0,ti.default)().applicationJson.decoder,d.set(c.name,c)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:c,contentTypeDecoders:d}}t.fromOptions=e})(ri||(ri={}));class Ia extends Io{constructor(e,n){super(),this.readable=e,this.options=ri.fromOptions(n),this.buffer=(0,ti.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Fa.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property. +${t.stack}`:r}const En=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{p.__wbindgen_export_2.get(t.dtor)(t.a,t.b)});function en(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;try{return r(i.a,i.b,...c)}finally{--i.cnt===0&&(p.__wbindgen_export_2.get(i.dtor)(i.a,i.b),i.a=0,En.unregister(i))}};return o.original=i,En.register(o,i,i),o}function tn(t,e,n){p._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h297e12c63bfef335(t,e,g(n))}function Ee(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;const d=i.a;i.a=0;try{return r(d,i.b,...c)}finally{--i.cnt===0?(p.__wbindgen_export_2.get(i.dtor)(d,i.b),En.unregister(i)):i.a=d}};return o.original=i,En.register(o,i,i),o}function vo(t,e){p._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19f0e74ec492e39e(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00c9413f2fcf954e(t,e,g(n))}function Ro(t,e,n,r){p._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfb9fc20940472abc(t,e,g(n),g(r))}function S(t,e){try{return t.apply(this,e)}catch(n){p.__wbindgen_exn_store(g(n))}}function xc(t,e,n,r){try{const d=p.__wbindgen_add_to_stack_pointer(-16);p.create(d,g(t),g(e),g(n),g(r));var i=P().getInt32(d+4*0,!0),o=P().getInt32(d+4*1,!0),c=P().getInt32(d+4*2,!0);if(c)throw fe(o);return Jr.__wrap(i)}finally{p.__wbindgen_add_to_stack_pointer(16)}}let nn=null;function zc(){return(nn===null||nn.byteLength===0)&&(nn=new Float32Array(p.memory.buffer)),nn}function Nn(t,e){return t=t>>>0,zc().subarray(t/4,t/4+e)}const Do=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_previewconnector_free(t>>>0,1));class Ur{static __wrap(e){e=e>>>0;const n=Object.create(Ur.prototype);return n.__wbg_ptr=e,Do.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Do.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_previewconnector_free(e,0)}static create(e,n,r,i){try{const f=p.__wbindgen_add_to_stack_pointer(-16),_=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),w=B;p.previewconnector_create(f,g(e),g(n),_,w,i);var o=P().getInt32(f+4*0,!0),c=P().getInt32(f+4*1,!0),d=P().getInt32(f+4*2,!0);if(d)throw fe(c);return fe(o)}finally{p.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=p.previewconnector_current_style(this.__wbg_ptr);return fe(e)}show_ui(){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_show_ui(i,this.__wbg_ptr);var e=P().getInt32(i+4*0,!0),n=P().getInt32(i+4*1,!0),r=P().getInt32(i+4*2,!0);if(r)throw fe(n);return fe(e)}finally{p.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_process_lsp_to_preview_message(i,this.__wbg_ptr,g(e));var n=P().getInt32(i+4*0,!0),r=P().getInt32(i+4*1,!0);if(r)throw fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}}const To=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_slintserver_free(t>>>0,1));class Jr{static __wrap(e){e=e>>>0;const n=Object.create(Jr.prototype);return n.__wbg_ptr=e,To.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,To.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_slintserver_free(e,0)}process_preview_to_lsp_message(e){const n=p.slintserver_process_preview_to_lsp_message(this.__wbg_ptr,g(e));return fe(n)}server_initialize_result(e){try{const o=p.__wbindgen_add_to_stack_pointer(-16);p.slintserver_server_initialize_result(o,this.__wbg_ptr,g(e));var n=P().getInt32(o+4*0,!0),r=P().getInt32(o+4*1,!0),i=P().getInt32(o+4*2,!0);if(i)throw fe(r);return fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}reload_document(e,n,r){const i=U(e,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_reload_document(this.__wbg_ptr,i,o,g(n),r);return fe(c)}handle_request(e,n,r){const i=U(n,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_handle_request(this.__wbg_ptr,g(e),i,o,g(r));return fe(c)}reload_config(){const e=p.slintserver_reload_config(this.__wbg_ptr);return fe(e)}}async function Bc(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function Vc(){const t={};return t.wbg={},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return g(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=s(n).stack,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(F(e,n))}finally{p.__wbindgen_free(r,i,1)}},t.wbg.__wbindgen_object_drop_ref=function(e){fe(e)},t.wbg.__wbg_width_ac5901de11cd9abc=function(e){return s(e).width},t.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return s(e).height},t.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbindgen_boolean_get=function(e){const n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_createShader_af087106532661d9=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return g(e)},t.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,n){s(e).stencil=n!==0},t.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,n){s(e).antialias=n!==0},t.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return S(function(e,n,r,i){const o=s(e).getContext(F(n,r),s(i));return j(o)?0:g(o)},arguments)},t.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let n;try{n=s(e)instanceof WebGL2RenderingContext}catch{n=!1}return n},t.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const n=s(e).getSupportedExtensions();return j(n)?0:g(n)},t.wbg.__wbg_length_ae22078168b726f5=function(e){return s(e).length},t.wbg.__wbg_get_3baa728f9d58d3f6=function(e,n){const r=s(e)[n>>>0];return g(r)},t.wbg.__wbindgen_string_get=function(e,n){const r=s(n),i=typeof r=="string"?r:void 0;var o=j(i)?0:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getParameter_cfaed180705b9280=function(){return S(function(e,n){const r=s(e).getParameter(n>>>0);return g(r)},arguments)},t.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const n=s(e).createVertexArrayOES();return j(n)?0:g(n)},t.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const n=s(e).createVertexArray();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return s(e).getError()},t.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return s(e).getError()},t.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_scissor_d06b14c4966727fa=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,n){s(e).bindVertexArray(s(n))},t.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,n){s(e).bindVertexArrayOES(s(n))},t.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_disable_d73e59fee5b5e973=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disable_8908871f2334e76b=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_enable_68b3fa03a633259a=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enable_541ed84c1e7d269d=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texParameteri_531d0268109950ba=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,w)},arguments)},t.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_viewport_536c78dd69c44351=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilMask_702162181d88081f=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilOp_2418383669ca9228=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return s(e).devicePixelRatio},t.wbg.__wbg_document_8554450897a855b9=function(e){const n=s(e).document;return j(n)?0:g(n)},t.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,n,r){const i=s(e).getElementById(F(n,r));return j(i)?0:g(i)},t.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let n;try{n=s(e)instanceof HTMLCanvasElement}catch{n=!1}return n},t.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return s(e).clientWidth},t.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return s(e).clientHeight},t.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const n=s(e).dataset;return g(n)},t.wbg.__wbg_get_9a60fce5bf7da364=function(e,n,r,i){const o=s(n)[F(r,i)];var c=j(o)?0:U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},t.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let n;try{n=s(e)instanceof HTMLInputElement}catch{n=!1}return n},t.wbg.__wbg_style_e06c9e03355741e9=function(e){const n=s(e).style;return g(n)},t.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return s(e).offsetLeft},t.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return s(e).offsetTop},t.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return s(e).offsetWidth},t.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return s(e).offsetHeight},t.wbg.__wbg_before_ac3792b457802cbf=function(){return S(function(e,n){s(e).before(s(n))},arguments)},t.wbg.__wbindgen_object_clone_ref=function(e){const n=s(e);return g(n)},t.wbg.__wbg_setvalue_688819688274bec0=function(e,n,r){s(e).value=F(n,r)},t.wbg.__wbg_data_edba00a6420faae3=function(e,n){const r=s(n).data;var i=j(r)?0:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return s(e).isComposing},t.wbg.__wbg_inputType_dc144c8251b0d194=function(e,n){const r=s(n).inputType,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){s(e).preventDefault()},t.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return s(e).isComposing},t.wbg.__wbg_key_a626396efbca2b95=function(e,n){const r=s(n).key,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return s(e).altKey},t.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,n,r){return s(e).getModifierState(F(n,r))},t.wbg.__wbg_repeat_8451a79b3608855b=function(e){return s(e).repeat},t.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const n=s(e).clipboardData;return j(n)?0:g(n)},t.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return S(function(e,n,r,i){const o=s(n).getData(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let n;try{n=s(e)instanceof CanvasRenderingContext2D}catch{n=!1}return n},t.wbg.__wbg_setfont_931e1f36bec6a342=function(e,n,r){s(e).font=F(n,r)},t.wbg.__wbindgen_string_new=function(e,n){const r=F(e,n);return g(r)},t.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,n){s(e).fillStyle=s(n)},t.wbg.__wbg_id_8071f78aa2301217=function(e,n){const r=s(n).id,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return s(e).naturalWidth},t.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return s(e).naturalHeight},t.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,n){const r=s(n).currentSrc,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_src_707c2de7cbb580c7=function(e,n){const r=s(n).src,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_0d5e77f348d88b87=function(){return S(function(){const e=new Image;return g(e)},arguments)},t.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,n,r){s(e).crossOrigin=n===0?void 0:F(n,r)},t.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,n){s(e).onload=s(n)},t.wbg.__wbg_setsrc_129ba95151116b01=function(e,n,r){s(e).src=F(n,r)},t.wbg.__wbg_new0_65387337a95cf44d=function(){return g(new Date)},t.wbg.__wbg_getTime_91058879093a1589=function(e){return s(e).getTime()},t.wbg.__wbindgen_number_new=function(e){return g(e)},t.wbg.__wbg_new_7982fb43cfca37ae=function(e){const n=new Date(s(e));return g(n)},t.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return s(e).getTimezoneOffset()},t.wbg.__wbg_log_2f54632e0e18c089=function(e,n){console.log(F(e,n))},t.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_bufferData_0db2a74470353a96=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_bufferData_94ce174a81b32961=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,n){s(e).deleteVertexArray(s(n))},t.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,n){s(e).deleteVertexArrayOES(s(n))},t.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_setwidth_84b579903fae1a52=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_6ae385769cc2e592=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_next_f9cb570345655b9a=function(){return S(function(e){const n=s(e).next();return g(n)},arguments)},t.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return s(e).done},t.wbg.__wbg_value_6d39332ab4788d86=function(e){const n=s(e).value;return g(n)},t.wbg.__wbg_iterator_888179a48810a9fe=function(){return g(Symbol.iterator)},t.wbg.__wbg_get_224d16597dbbfd96=function(){return S(function(e,n){const r=Reflect.get(s(e),s(n));return g(r)},arguments)},t.wbg.__wbindgen_is_function=function(e){return typeof s(e)=="function"},t.wbg.__wbindgen_is_object=function(e){const n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_next_de3e9db4440638b2=function(e){const n=s(e).next;return g(n)},t.wbg.__wbg_call_1084a111329e68ce=function(){return S(function(e,n){const r=s(e).call(s(n));return g(r)},arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return S(function(e,n,r){const i=s(e).call(s(n),s(r));return g(i)},arguments)},t.wbg.__wbg_call_c6fe275aaa60da79=function(){return S(function(e,n,r,i){const o=s(e).call(s(n),s(r),s(i));return g(o)},arguments)},t.wbg.__wbindgen_memory=function(){const e=p.memory;return g(e)},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const n=s(e).buffer;return g(n)},t.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,n,r){const i=new Uint8Array(s(e),n>>>0,r>>>0);return g(i)},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return s(e).length},t.wbg.__wbg_new_ea1883e1e5e86686=function(e){const n=new Uint8Array(s(e));return g(n)},t.wbg.__wbg_set_d1e79e2388520f18=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbg_set_eacc7d73fefaafdf=function(){return S(function(e,n,r){return Reflect.set(s(e),s(n),s(r))},arguments)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return S(function(){const e=self.self;return g(e)},arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return S(function(){const e=window.window;return g(e)},arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return S(function(){const e=globalThis.globalThis;return g(e)},arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return S(function(){const e=global.global;return g(e)},arguments)},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,n){const r=new Function(F(e,n));return g(r)},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(F(e,n));return g(r)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_number_get=function(e,n){const r=s(n),i=typeof r=="number"?r:void 0;P().setFloat64(e+8*1,j(i)?0:i,!0),P().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const n=Object.entries(s(e));return g(n)},t.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(s(e))},t.wbg.__wbindgen_as_number=function(e){return+s(e)},t.wbg.__wbg_String_b9412f8799faab3e=function(e,n){const r=String(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},t.wbg.__wbg_new_8608a2b51a5f6737=function(){return g(new Map)},t.wbg.__wbg_set_f975102236d3c502=function(e,n,r){s(e)[fe(n)]=fe(r)},t.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return g(e)},t.wbg.__wbg_set_673dda6c73d19609=function(e,n,r){s(e)[n>>>0]=fe(r)},t.wbg.__wbg_set_49185437f0ab06f8=function(e,n,r){const i=s(e).set(s(n),s(r));return g(i)},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,n){const r=s(e)[s(n)];return g(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,n){try{var r={a:e,b:n},i=(c,d)=>{const f=r.a;r.a=0;try{return Ro(f,r.b,c,d)}finally{r.a=f}};const o=new Promise(i);return g(o)}finally{r.a=r.b=0}},t.wbg.__wbg_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(n)},t.wbg.__wbindgen_is_bigint=function(e){return typeof s(e)=="bigint"},t.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const r=s(n),i=typeof r=="bigint"?r:void 0;P().setBigInt64(e+8*1,j(i)?BigInt(0):i,!0),P().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbindgen_jsval_eq=function(e,n){return s(e)===s(n)},t.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let n;try{n=s(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_navigator_6210380287bf8581=function(e){const n=s(e).navigator;return g(n)},t.wbg.__wbg_platform_509d898d9dce4c23=function(){return S(function(e,n){const r=s(n).platform,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(F(e,n))},t.wbg.__wbindgen_debug_string=function(e,n){const r=Vr(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const n=s(e).queueMicrotask;return g(n)},t.wbg.__wbg_resolve_570458cb99d56a43=function(e){const n=Promise.resolve(s(e));return g(n)},t.wbg.__wbg_then_876bb3c633745cc6=function(e,n,r){const i=s(e).then(s(n),s(r));return g(i)},t.wbg.__wbg_then_95e6edc0f89b73b1=function(e,n){const r=s(e).then(s(n));return g(r)},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(s(e))},t.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return S(function(e,n,r){const i=s(e).getExtension(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return S(function(e,n,r){const i=s(e).matchMedia(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return S(function(e,n){s(e).cancelAnimationFrame(n)},arguments)},t.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return S(function(e,n){return s(e).setTimeout(s(n))},arguments)},t.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return S(function(e,n,r){const i=s(e).createElement(F(n,r));return g(i)},arguments)},t.wbg.__wbg_matches_212d57a200ff58f8=function(){return S(function(e,n,r){return s(e).matches(F(n,r))},arguments)},t.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return S(function(e,n,r,i,o){s(e).setAttribute(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_focus_06621101cc79f5d8=function(){return S(function(e){s(e).focus()},arguments)},t.wbg.__wbg_fillText_ae0445d1930428dd=function(){return S(function(e,n,r,i,o){s(e).fillText(F(n,r),i,o)},arguments)},t.wbg.__wbg_getContext_69ec873410cbba3c=function(){return S(function(e,n,r){const i=s(e).getContext(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return S(function(e,n){s(e).addListener(s(n))},arguments)},t.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return S(function(e,n,r,i,o){s(e).setProperty(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return S(function(e,n){URL.revokeObjectURL(F(e,n))},arguments)},t.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let n;try{n=s(e)instanceof Window}catch{n=!1}return n},t.wbg.__wbg_setData_41207994e2d54785=function(){return S(function(e,n,r,i,o){s(e).setData(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return S(function(e,n,r,i){s(e).addEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return S(function(e,n,r,i){s(e).removeEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return S(function(e,n){s(e).postMessage(s(n))},arguments)},t.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,n){const r=s(n).data;var i=j(r)?0:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_ebf2727385ee825c=function(){return S(function(){const e=new AbortController;return g(e)},arguments)},t.wbg.__wbg_new_40ff2b042829bc58=function(){return S(function(){const e=new MessageChannel;return g(e)},arguments)},t.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const n=s(e).performance;return g(n)},t.wbg.__wbg_now_abd80e969af37148=function(e){return s(e).now()},t.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return s(e).movementX},t.wbg.__wbg_movementY_3064817f736e8151=function(e){return s(e).movementY},t.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const n=s(e).signal;return g(n)},t.wbg.__wbg_postTask_99464245f349be5a=function(e,n,r){const i=s(e).postTask(s(n),s(r));return g(i)},t.wbg.__wbg_catch_a279b1da46d132d8=function(e,n){const r=s(e).catch(s(n));return g(r)},t.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const n=s(e).port1;return g(n)},t.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,n){s(e).onmessage=s(n)},t.wbg.__wbg_start_f642a950f6c98a0e=function(e){s(e).start()},t.wbg.__wbg_port2_7d887905fa4a6677=function(e){const n=s(e).port2;return g(n)},t.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return S(function(e,n){return s(e).requestIdleCallback(s(n))},arguments)},t.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return S(function(e,n,r){return s(e).setTimeout(s(n),r)},arguments)},t.wbg.__wbg_of_99c2a118200b1e62=function(e,n){const r=Array.of(s(e),s(n));return g(r)},t.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const n=Array.of(s(e));return g(n)},t.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return S(function(e,n,r){s(e).postMessage(s(n),s(r))},arguments)},t.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,n){const r=s(n).pointerType,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return s(e).pointerId},t.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return S(function(e,n){s(e).setPointerCapture(n)},arguments)},t.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return s(e).pressure},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return s(e).persisted},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const n=s(e).contentRect;return g(n)},t.wbg.__wbg_width_e7964a50b174d035=function(e){return s(e).width},t.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return s(e).height},t.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const n=s(e).devicePixelContentBoxSize;return g(n)},t.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return s(e).inlineSize},t.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return s(e).blockSize},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return g(e)},t.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,n){const r=Object.getOwnPropertyDescriptor(s(e),s(n));return g(r)},t.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,n,r){s(e).type=F(n,r)},t.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return S(function(e,n){const r=new Blob(s(e),s(n));return g(r)},arguments)},t.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return S(function(e,n){const r=URL.createObjectURL(s(n)),i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const n=s(e).Window;return g(n)},t.wbg.__wbg_new_25d9d4e2932d816f=function(){return S(function(e,n){const r=new Worker(F(e,n));return g(r)},arguments)},t.wbg.__wbg_error_9ce09486992d3ac5=function(e,n){console.error(s(e),s(n))},t.wbg.__wbg_abort_8659d889a7877ae3=function(e){s(e).abort()},t.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,n){s(e).cancelIdleCallback(n>>>0)},t.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,n){s(e).clearTimeout(n)},t.wbg.__wbg_close_87d69f9e9fe928c3=function(e){s(e).close()},t.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const n=s(e).userAgentData;return j(n)?0:g(n)},t.wbg.__wbg_brands_982de08b35281a98=function(e){const n=s(e).brands;return g(n)},t.wbg.__wbg_brand_cdcf0249d44027a8=function(e,n){const r=s(n).brand,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return S(function(e,n){const r=s(n).userAgent,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){s(e).disconnect()},t.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){s(e).disconnect()},t.wbg.__wbg_cancel_cba86749f45f30ae=function(e){s(e).cancel()},t.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},t.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){s(e).webkitRequestFullscreen()},t.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const n=s(e).requestFullscreen();return g(n)},t.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const n=s(e).webkitFullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const n=s(e).fullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_is_009b1ef508712fda=function(e,n){return Object.is(s(e),s(n))},t.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,n,r){const i=s(e).animate(s(n),s(r));return g(i)},t.wbg.__wbg_play_5896e5851ba90aa2=function(e){s(e).play()},t.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return S(function(e,n){s(e).removeListener(s(n))},arguments)},t.wbg.__wbg_contains_4f87c5405416b4fd=function(e,n){return s(e).contains(s(n))},t.wbg.__wbg_unobserve_e67452df241a602d=function(e,n){s(e).unobserve(s(n))},t.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){s(e).webkitExitFullscreen()},t.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){s(e).exitFullscreen()},t.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return S(function(e,n,r,i){const o=s(n).getPropertyValue(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return S(function(e,n,r,i){const o=s(n).removeProperty(F(r,i)),c=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const n=s(e).visibilityState;return{hidden:0,visible:1}[n]??2},t.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const n=s(e).body;return j(n)?0:g(n)},t.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return S(function(e,n){const r=s(e).appendChild(s(n));return g(r)},arguments)},t.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return S(function(e,n){const r=s(e).getComputedStyle(s(n));return j(r)?0:g(r)},arguments)},t.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const n=s(e).activeElement;return j(n)?0:g(n)},t.wbg.__wbg_new_42acb42ec2ace97c=function(){return S(function(e){const n=new ResizeObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,n){s(e).box=["border-box","content-box","device-pixel-content-box"][n]},t.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,n,r){s(e).observe(s(n),s(r))},t.wbg.__wbg_new_d0c6c2df51a6d903=function(){return S(function(e){const n=new IntersectionObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_observe_c901133fbef21560=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const n=s(e).getBoundingClientRect();return g(n)},t.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return s(e).x},t.wbg.__wbg_y_bd4e2c0613413655=function(e){return s(e).y},t.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return S(function(e,n){return s(e).requestAnimationFrame(s(n))},arguments)},t.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_button_460cdec9f2512a91=function(e){return s(e).button},t.wbg.__wbg_offsetX_294898d040917c6b=function(e){return s(e).offsetX},t.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return s(e).offsetY},t.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return s(e).deltaX},t.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return s(e).deltaY},t.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return s(e).deltaMode},t.wbg.__wbg_code_01dc6af887ca9ecb=function(e,n){const r=s(n).code,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return s(e).location},t.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return s(e).metaKey},t.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return s(e).altKey},t.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return s(e).metaKey},t.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const n=s(e).getCoalescedEvents();return g(n)},t.wbg.__wbindgen_closure_wrapper4159=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4161=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4162=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4163=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4164=function(e,n,r){const i=en(e,n,1609,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6455=function(e,n,r){const i=Ee(e,n,1827,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12147=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13314=function(e,n,r){const i=Ee(e,n,1827,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper13348=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13369=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13400=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13413=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13430=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13436=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13454=function(e,n,r){const i=Ee(e,n,1827,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13458=function(e,n,r){const i=Ee(e,n,1827,Ro);return g(i)},t}function Uc(t,e){return p=t.exports,Po.__wbindgen_wasm_module=e,mt=null,nn=null,Zt=null,p}async function Po(t){if(p!==void 0)return p;typeof t<"u"&&Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof t>"u"&&(t=new URL(""+new URL("slint_lsp_wasm_bg-DJJWxp_L.wasm",self.location.href).href,self.location.href));const e=Vc();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bc(await t,e);return Uc(n,r)}var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var ko={},Xr={},Ue={},ie={},wt={},Qr={},jn={},q={},le={};Object.defineProperty(le,"__esModule",{value:!0}),le.stringArray=le.array=le.func=le.error=le.number=le.string=le.boolean=void 0;function Xc(t){return t===!0||t===!1}le.boolean=Xc;function So(t){return typeof t=="string"||t instanceof String}le.string=So;function Qc(t){return typeof t=="number"||t instanceof Number}le.number=Qc;function Yc(t){return t instanceof Error}le.error=Yc;function Kc(t){return typeof t=="function"}le.func=Kc;function Co(t){return Array.isArray(t)}le.array=Co;function Gc(t){return Co(t)&&t.every(e=>So(e))}le.stringArray=Gc,Object.defineProperty(q,"__esModule",{value:!0}),q.Message=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType=q.RequestType0=q.AbstractMessageSignature=q.ParameterStructures=q.ResponseError=q.ErrorCodes=void 0;const pt=le;var Yr;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Yr||(q.ErrorCodes=Yr={}));class Kr extends Error{constructor(e,n,r){super(n),this.code=pt.number(e)?e:Yr.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Kr.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}q.ResponseError=Kr;class pe{constructor(e){this.kind=e}static is(e){return e===pe.auto||e===pe.byName||e===pe.byPosition}toString(){return this.kind}}q.ParameterStructures=pe,pe.auto=new pe("auto"),pe.byPosition=new pe("byPosition"),pe.byName=new pe("byName");class Y{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return pe.auto}}q.AbstractMessageSignature=Y;class Zc extends Y{constructor(e){super(e,0)}}q.RequestType0=Zc;class ea extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType=ea;class ta extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType1=ta;class na extends Y{constructor(e){super(e,2)}}q.RequestType2=na;class ra extends Y{constructor(e){super(e,3)}}q.RequestType3=ra;class ia extends Y{constructor(e){super(e,4)}}q.RequestType4=ia;class oa extends Y{constructor(e){super(e,5)}}q.RequestType5=oa;class sa extends Y{constructor(e){super(e,6)}}q.RequestType6=sa;class ca extends Y{constructor(e){super(e,7)}}q.RequestType7=ca;class aa extends Y{constructor(e){super(e,8)}}q.RequestType8=aa;class ua extends Y{constructor(e){super(e,9)}}q.RequestType9=ua;class da extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType=da;class la extends Y{constructor(e){super(e,0)}}q.NotificationType0=la;class fa extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType1=fa;class ga extends Y{constructor(e){super(e,2)}}q.NotificationType2=ga;class _a extends Y{constructor(e){super(e,3)}}q.NotificationType3=_a;class ba extends Y{constructor(e){super(e,4)}}q.NotificationType4=ba;class ha extends Y{constructor(e){super(e,5)}}q.NotificationType5=ha;class ma extends Y{constructor(e){super(e,6)}}q.NotificationType6=ma;class wa extends Y{constructor(e){super(e,7)}}q.NotificationType7=wa;class pa extends Y{constructor(e){super(e,8)}}q.NotificationType8=pa;class ya extends Y{constructor(e){super(e,9)}}q.NotificationType9=ya;var qo;(function(t){function e(i){const o=i;return o&&pt.string(o.method)&&(pt.string(o.id)||pt.number(o.id))}t.isRequest=e;function n(i){const o=i;return o&&pt.string(o.method)&&i.id===void 0}t.isNotification=n;function r(i){const o=i;return o&&(o.result!==void 0||!!o.error)&&(pt.string(o.id)||pt.number(o.id)||o.id===null)}t.isResponse=r})(qo||(q.Message=qo={}));var Je={},Mo;Object.defineProperty(Je,"__esModule",{value:!0}),Je.LRUCache=Je.LinkedMap=Je.Touch=void 0;var ye;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(ye||(Je.Touch=ye={}));class Oo{constructor(){this[Mo]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=ye.None){const r=this._map.get(e);if(r)return n!==ye.None&&this.touch(r,n),r.value}set(e,n,r=ye.None){let i=this._map.get(e);if(i)i.value=n,r!==ye.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case ye.None:this.addItemLast(i);break;case ye.First:this.addItemFirst(i);break;case ye.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Mo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ye.First&&n!==ye.Last)){if(n===ye.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===ye.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}Je.LinkedMap=Oo;class va extends Oo{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=ye.AsNew){return super.get(e,n)}peek(e){return super.get(e,ye.None)}set(e,n){return super.set(e,n,ye.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Je.LRUCache=va;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.Disposable=void 0;var Eo;(function(t){function e(n){return{dispose:n}}t.create=e})(Eo||(Fn.Disposable=Eo={}));var Ae={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});let Gr;function Zr(){if(Gr===void 0)throw new Error("No runtime abstraction layer installed");return Gr}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Gr=n}t.install=e})(Zr||(Zr={})),Xe.default=Zr,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.Emitter=Ae.Event=void 0;const Ra=Xe;var No;(function(t){const e={dispose(){}};t.None=function(){return e}})(No||(Ae.Event=No={}));class Da{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i{this._callbacks||(this._callbacks=new Da),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=In._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Ae.Emitter=In,In._noop=function(){};var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.CancellationTokenSource=et.CancellationToken=void 0;const Ta=Xe,Pa=le,ei=Ae;var An;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ei.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ei.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||Pa.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(An||(et.CancellationToken=An={}));const ka=Object.freeze(function(t,e){const n=(0,Ta.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class jo{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ka:(this._emitter||(this._emitter=new ei.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Sa{get token(){return this._token||(this._token=new jo),this._token}cancel(){this._token?this._token.cancel():this._token=An.Cancelled}dispose(){this._token?this._token instanceof jo&&this._token.dispose():this._token=An.None}}et.CancellationTokenSource=Sa;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.SharedArrayReceiverStrategy=qt.SharedArraySenderStrategy=void 0;const Ca=et;var rn;(function(t){t.Continue=0,t.Cancelled=1})(rn||(rn={}));class qa{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=rn.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,rn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}qt.SharedArraySenderStrategy=qa;class Ma{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===rn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oa{constructor(e){this.token=new Ma(e)}cancel(){}dispose(){}}class Ea{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new Ca.CancellationTokenSource:new Oa(n)}}qt.SharedArrayReceiverStrategy=Ea;var tt={},on={};Object.defineProperty(on,"__esModule",{value:!0}),on.Semaphore=void 0;const Na=Xe;class ja{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Na.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}on.Semaphore=ja,Object.defineProperty(tt,"__esModule",{value:!0}),tt.ReadableStreamMessageReader=tt.AbstractMessageReader=tt.MessageReader=void 0;const ti=Xe,Mt=le,ni=Ae,Fa=on;var Fo;(function(t){function e(n){let r=n;return r&&Mt.func(r.listen)&&Mt.func(r.dispose)&&Mt.func(r.onError)&&Mt.func(r.onClose)&&Mt.func(r.onPartialMessage)}t.is=e})(Fo||(tt.MessageReader=Fo={}));class Io{constructor(){this.errorEmitter=new ni.Emitter,this.closeEmitter=new ni.Emitter,this.partialMessageEmitter=new ni.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Mt.string(e.message)?e.message:"unknown"}`)}}tt.AbstractMessageReader=Io;var ri;(function(t){function e(n){let r,i;const o=new Map;let c;const d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(const f of n.contentDecoders)o.set(f.name,f);if(n.contentTypeDecoder!==void 0&&(c=n.contentTypeDecoder,d.set(c.name,c)),n.contentTypeDecoders!==void 0)for(const f of n.contentTypeDecoders)d.set(f.name,f)}return c===void 0&&(c=(0,ti.default)().applicationJson.decoder,d.set(c.name,c)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:c,contentTypeDecoders:d}}t.fromOptions=e})(ri||(ri={}));class Ia extends Io{constructor(e,n){super(),this.readable=e,this.options=ri.fromOptions(n),this.buffer=(0,ti.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Fa.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property. ${JSON.stringify(Object.fromEntries(r))}`));return}const o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}const n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ti.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}tt.ReadableStreamMessageReader=Ia;var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.WriteableStreamMessageWriter=nt.AbstractMessageWriter=nt.MessageWriter=void 0;const Ao=Xe,sn=le,Aa=on,Lo=Ae,La="Content-Length: ",Wo=`\r `;var $o;(function(t){function e(n){let r=n;return r&&sn.func(r.dispose)&&sn.func(r.onClose)&&sn.func(r.onError)&&sn.func(r.write)}t.is=e})($o||(nt.MessageWriter=$o={}));class Ho{constructor(){this.errorEmitter=new Lo.Emitter,this.closeEmitter=new Lo.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${sn.string(e.message)?e.message:"unknown"}`)}}nt.AbstractMessageWriter=Ho;var ii;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Ao.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Ao.default)().applicationJson.encoder}}t.fromOptions=e})(ii||(ii={}));class Wa extends Ho{constructor(e,n){super(),this.writable=e,this.options=ii.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Aa.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{const i=[];return i.push(La,r.byteLength.toString(),Wo),i.push(Wo),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}}nt.WriteableStreamMessageWriter=Wa;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.AbstractMessageBuffer=void 0;const $a=13,Ha=10,xa=`\r `;class za{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;r{let v=w.range.start.line-k.range.start.line;return v===0?w.range.start.character-k.range.start.character:v}),_=d.length;for(let w=f.length-1;w>=0;w--){let k=f[w],v=o.offsetAt(k.range.start),M=o.offsetAt(k.range.end);if(M<=_)d=d.substring(0,v)+k.newText+d.substring(M,d.length);else throw new Error("Overlapping edit");_=v}return d}t.applyEdits=r;function i(o,c){if(o.length<=1)return o;const d=o.length/2|0,f=o.slice(0,d),_=o.slice(d);i(f,c),i(_,c);let w=0,k=0,v=0;for(;w0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ke.create(0,e);for(;re?i=c:r=c+1}let o=r-1;return ke.create(o,e-n[o])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(M){return M===!0||M===!1}t.boolean=i;function o(M){return e.call(M)==="[object String]"}t.string=o;function c(M){return e.call(M)==="[object Number]"}t.number=c;function d(M,W,be){return e.call(M)==="[object Number]"&&W<=M&&M<=be}t.numberRange=d;function f(M){return e.call(M)==="[object Number]"&&-2147483648<=M&&M<=2147483647}t.integer=f;function _(M){return e.call(M)==="[object Number]"&&0<=M&&M<=2147483647}t.uinteger=_;function w(M){return e.call(M)==="[object Function]"}t.func=w;function k(M){return M!==null&&typeof M=="object"}t.objectLiteral=k;function v(M,W){return Array.isArray(M)&&M.every(W)}t.typedArray=v})(l||(l={}));var Ya=Object.freeze({__proto__:null,get AnnotatedTextEdit(){return Qe},get ChangeAnnotation(){return vt},get ChangeAnnotationIdentifier(){return he},get CodeAction(){return Wi},get CodeActionContext(){return Li},get CodeActionKind(){return Ai},get CodeActionTriggerKind(){return gn},get CodeDescription(){return bi},get CodeLens(){return $i},get Color(){return Hn},get ColorInformation(){return ui},get ColorPresentation(){return di},get Command(){return yt},get CompletionItem(){return Pi},get CompletionItemKind(){return pi},get CompletionItemLabelDetails(){return Ti},get CompletionItemTag(){return vi},get CompletionList(){return ki},get CreateFile(){return Ot},get DeleteFile(){return Nt},get Diagnostic(){return un},get DiagnosticRelatedInformation(){return xn},get DiagnosticSeverity(){return gi},get DiagnosticTag(){return _i},get DocumentHighlight(){return Oi},get DocumentHighlightKind(){return Mi},get DocumentLink(){return xi},get DocumentSymbol(){return Ii},get DocumentUri(){return si},EOL:Xa,get FoldingRange(){return fi},get FoldingRangeKind(){return li},get FormattingOptions(){return Hi},get Hover(){return Si},get InlayHint(){return Ki},get InlayHintKind(){return Un},get InlayHintLabelPart(){return Jn},get InlineCompletionContext(){return ro},get InlineCompletionItem(){return Zi},get InlineCompletionList(){return eo},get InlineCompletionTriggerKind(){return to},get InlineValueContext(){return Yi},get InlineValueEvaluatableExpression(){return Qi},get InlineValueText(){return Ji},get InlineValueVariableLookup(){return Xi},get InsertReplaceEdit(){return Ri},get InsertTextFormat(){return yi},get InsertTextMode(){return Di},get Location(){return an},get LocationLink(){return ai},get MarkedString(){return fn},get MarkupContent(){return jt},get MarkupKind(){return Vn},get OptionalVersionedTextDocumentIdentifier(){return ln},get ParameterInformation(){return Ci},get Position(){return ke},get Range(){return Z},get RenameFile(){return Et},get SelectedCompletionInfo(){return no},get SelectionRange(){return zi},get SemanticTokenModifiers(){return Vi},get SemanticTokenTypes(){return Bi},get SemanticTokens(){return Ui},get SignatureInformation(){return qi},get StringValue(){return Gi},get SymbolInformation(){return ji},get SymbolKind(){return Ei},get SymbolTag(){return Ni},get TextDocument(){return oo},get TextDocumentEdit(){return dn},get TextDocumentIdentifier(){return hi},get TextDocumentItem(){return wi},get TextEdit(){return We},get URI(){return $n},get VersionedTextDocumentIdentifier(){return mi},WorkspaceChange:Ja,get WorkspaceEdit(){return zn},get WorkspaceFolder(){return io},get WorkspaceSymbol(){return Fi},get integer(){return ci},get uinteger(){return cn}}),so=Jc(Ya),H={};Object.defineProperty(H,"__esModule",{value:!0}),H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const Ft=wt;var Jo;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Jo||(H.MessageDirection=Jo={}));class Ka{constructor(e){this.method=e}}H.RegistrationType=Ka;class Ga extends Ft.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=Ga;class Za extends Ft.RequestType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolRequestType=Za;class eu extends Ft.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=eu;class tu extends Ft.NotificationType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolNotificationType=tu;var Xo={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.objectLiteral=ee.typedArray=ee.stringArray=ee.array=ee.func=ee.error=ee.number=ee.string=ee.boolean=void 0;function nu(t){return t===!0||t===!1}ee.boolean=nu;function Qo(t){return typeof t=="string"||t instanceof String}ee.string=Qo;function ru(t){return typeof t=="number"||t instanceof Number}ee.number=ru;function iu(t){return t instanceof Error}ee.error=iu;function ou(t){return typeof t=="function"}ee.func=ou;function Yo(t){return Array.isArray(t)}ee.array=Yo;function su(t){return Yo(t)&&t.every(e=>Qo(e))}ee.stringArray=su;function cu(t,e){return Array.isArray(t)&&t.every(e)}ee.typedArray=cu;function au(t){return t!==null&&typeof t=="object"}ee.objectLiteral=au;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ImplementationRequest=void 0;const Ko=H;var Go;(function(t){t.method="textDocument/implementation",t.messageDirection=Ko.MessageDirection.clientToServer,t.type=new Ko.ProtocolRequestType(t.method)})(Go||(Xn.ImplementationRequest=Go={}));var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.TypeDefinitionRequest=void 0;const Zo=H;var es;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(es||(Qn.TypeDefinitionRequest=es={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.DidChangeWorkspaceFoldersNotification=It.WorkspaceFoldersRequest=void 0;const Yn=H;var ts;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Yn.MessageDirection.serverToClient,t.type=new Yn.ProtocolRequestType0(t.method)})(ts||(It.WorkspaceFoldersRequest=ts={}));var ns;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Yn.MessageDirection.clientToServer,t.type=new Yn.ProtocolNotificationType(t.method)})(ns||(It.DidChangeWorkspaceFoldersNotification=ns={}));var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.ConfigurationRequest=void 0;const rs=H;var is;(function(t){t.method="workspace/configuration",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(is||(Kn.ConfigurationRequest=is={}));var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.ColorPresentationRequest=At.DocumentColorRequest=void 0;const Gn=H;var os;(function(t){t.method="textDocument/documentColor",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(os||(At.DocumentColorRequest=os={}));var ss;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(ss||(At.ColorPresentationRequest=ss={}));var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.FoldingRangeRefreshRequest=Lt.FoldingRangeRequest=void 0;const Zn=H;var cs;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Zn.MessageDirection.clientToServer,t.type=new Zn.ProtocolRequestType(t.method)})(cs||(Lt.FoldingRangeRequest=cs={}));var as;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Zn.MessageDirection.serverToClient,t.type=new Zn.ProtocolRequestType0(t.method)})(as||(Lt.FoldingRangeRefreshRequest=as={}));var er={};Object.defineProperty(er,"__esModule",{value:!0}),er.DeclarationRequest=void 0;const us=H;var ds;(function(t){t.method="textDocument/declaration",t.messageDirection=us.MessageDirection.clientToServer,t.type=new us.ProtocolRequestType(t.method)})(ds||(er.DeclarationRequest=ds={}));var tr={};Object.defineProperty(tr,"__esModule",{value:!0}),tr.SelectionRangeRequest=void 0;const ls=H;var fs;(function(t){t.method="textDocument/selectionRange",t.messageDirection=ls.MessageDirection.clientToServer,t.type=new ls.ProtocolRequestType(t.method)})(fs||(tr.SelectionRangeRequest=fs={}));var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.WorkDoneProgressCancelNotification=rt.WorkDoneProgressCreateRequest=rt.WorkDoneProgress=void 0;const uu=wt,nr=H;var gs;(function(t){t.type=new uu.ProgressType;function e(n){return n===t.type}t.is=e})(gs||(rt.WorkDoneProgress=gs={}));var _s;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=nr.MessageDirection.serverToClient,t.type=new nr.ProtocolRequestType(t.method)})(_s||(rt.WorkDoneProgressCreateRequest=_s={}));var bs;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=nr.MessageDirection.clientToServer,t.type=new nr.ProtocolNotificationType(t.method)})(bs||(rt.WorkDoneProgressCancelNotification=bs={}));var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.CallHierarchyOutgoingCallsRequest=it.CallHierarchyIncomingCallsRequest=it.CallHierarchyPrepareRequest=void 0;const Wt=H;var hs;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(hs||(it.CallHierarchyPrepareRequest=hs={}));var ms;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ms||(it.CallHierarchyIncomingCallsRequest=ms={}));var ws;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ws||(it.CallHierarchyOutgoingCallsRequest=ws={}));var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.SemanticTokensRefreshRequest=Te.SemanticTokensRangeRequest=Te.SemanticTokensDeltaRequest=Te.SemanticTokensRequest=Te.SemanticTokensRegistrationType=Te.TokenFormat=void 0;const Ye=H;var ps;(function(t){t.Relative="relative"})(ps||(Te.TokenFormat=ps={}));var _n;(function(t){t.method="textDocument/semanticTokens",t.type=new Ye.RegistrationType(t.method)})(_n||(Te.SemanticTokensRegistrationType=_n={}));var ys;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(ys||(Te.SemanticTokensRequest=ys={}));var vs;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(vs||(Te.SemanticTokensDeltaRequest=vs={}));var Rs;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(Rs||(Te.SemanticTokensRangeRequest=Rs={}));var Ds;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ye.MessageDirection.serverToClient,t.type=new Ye.ProtocolRequestType0(t.method)})(Ds||(Te.SemanticTokensRefreshRequest=Ds={}));var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.ShowDocumentRequest=void 0;const Ts=H;var Ps;(function(t){t.method="window/showDocument",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType(t.method)})(Ps||(rr.ShowDocumentRequest=Ps={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.LinkedEditingRangeRequest=void 0;const ks=H;var Ss;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(Ss||(ir.LinkedEditingRangeRequest=Ss={}));var ve={};Object.defineProperty(ve,"__esModule",{value:!0}),ve.WillDeleteFilesRequest=ve.DidDeleteFilesNotification=ve.DidRenameFilesNotification=ve.WillRenameFilesRequest=ve.DidCreateFilesNotification=ve.WillCreateFilesRequest=ve.FileOperationPatternKind=void 0;const Se=H;var Cs;(function(t){t.file="file",t.folder="folder"})(Cs||(ve.FileOperationPatternKind=Cs={}));var qs;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(qs||(ve.WillCreateFilesRequest=qs={}));var Ms;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ms||(ve.DidCreateFilesNotification=Ms={}));var Os;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(Os||(ve.WillRenameFilesRequest=Os={}));var Es;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Es||(ve.DidRenameFilesNotification=Es={}));var Ns;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ns||(ve.DidDeleteFilesNotification=Ns={}));var js;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(js||(ve.WillDeleteFilesRequest=js={}));var ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.MonikerRequest=ot.MonikerKind=ot.UniquenessLevel=void 0;const Fs=H;var Is;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Is||(ot.UniquenessLevel=Is={}));var As;(function(t){t.$import="import",t.$export="export",t.local="local"})(As||(ot.MonikerKind=As={}));var Ls;(function(t){t.method="textDocument/moniker",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(Ls||(ot.MonikerRequest=Ls={}));var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.TypeHierarchySubtypesRequest=st.TypeHierarchySupertypesRequest=st.TypeHierarchyPrepareRequest=void 0;const $t=H;var Ws;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Ws||(st.TypeHierarchyPrepareRequest=Ws={}));var $s;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})($s||(st.TypeHierarchySupertypesRequest=$s={}));var Hs;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Hs||(st.TypeHierarchySubtypesRequest=Hs={}));var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.InlineValueRefreshRequest=Ht.InlineValueRequest=void 0;const or=H;var xs;(function(t){t.method="textDocument/inlineValue",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolRequestType(t.method)})(xs||(Ht.InlineValueRequest=xs={}));var zs;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=or.MessageDirection.serverToClient,t.type=new or.ProtocolRequestType0(t.method)})(zs||(Ht.InlineValueRefreshRequest=zs={}));var ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.InlayHintRefreshRequest=ct.InlayHintResolveRequest=ct.InlayHintRequest=void 0;const xt=H;var Bs;(function(t){t.method="textDocument/inlayHint",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Bs||(ct.InlayHintRequest=Bs={}));var Vs;(function(t){t.method="inlayHint/resolve",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Vs||(ct.InlayHintResolveRequest=Vs={}));var Us;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=xt.MessageDirection.serverToClient,t.type=new xt.ProtocolRequestType0(t.method)})(Us||(ct.InlayHintRefreshRequest=Us={}));var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DiagnosticRefreshRequest=Ce.WorkspaceDiagnosticRequest=Ce.DocumentDiagnosticRequest=Ce.DocumentDiagnosticReportKind=Ce.DiagnosticServerCancellationData=void 0;const Js=wt,du=ee,zt=H;var Xs;(function(t){function e(n){const r=n;return r&&du.boolean(r.retriggerRequest)}t.is=e})(Xs||(Ce.DiagnosticServerCancellationData=Xs={}));var Qs;(function(t){t.Full="full",t.Unchanged="unchanged"})(Qs||(Ce.DocumentDiagnosticReportKind=Qs={}));var Ys;(function(t){t.method="textDocument/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ys||(Ce.DocumentDiagnosticRequest=Ys={}));var Ks;(function(t){t.method="workspace/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ks||(Ce.WorkspaceDiagnosticRequest=Ks={}));var Gs;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=zt.MessageDirection.serverToClient,t.type=new zt.ProtocolRequestType0(t.method)})(Gs||(Ce.DiagnosticRefreshRequest=Gs={}));var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.DidCloseNotebookDocumentNotification=te.DidSaveNotebookDocumentNotification=te.DidChangeNotebookDocumentNotification=te.NotebookCellArrayChange=te.DidOpenNotebookDocumentNotification=te.NotebookDocumentSyncRegistrationType=te.NotebookDocument=te.NotebookCell=te.ExecutionSummary=te.NotebookCellKind=void 0;const bn=so,Ne=ee,$e=H;var co;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(co||(te.NotebookCellKind=co={}));var ao;(function(t){function e(i,o){const c={executionOrder:i};return(o===!0||o===!1)&&(c.success=o),c}t.create=e;function n(i){const o=i;return Ne.objectLiteral(o)&&bn.uinteger.is(o.executionOrder)&&(o.success===void 0||Ne.boolean(o.success))}t.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=r})(ao||(te.ExecutionSummary=ao={}));var sr;(function(t){function e(o,c){return{kind:o,document:c}}t.create=e;function n(o){const c=o;return Ne.objectLiteral(c)&&co.is(c.kind)&&bn.DocumentUri.is(c.document)&&(c.metadata===void 0||Ne.objectLiteral(c.metadata))}t.is=n;function r(o,c){const d=new Set;return o.document!==c.document&&d.add("document"),o.kind!==c.kind&&d.add("kind"),o.executionSummary!==c.executionSummary&&d.add("executionSummary"),(o.metadata!==void 0||c.metadata!==void 0)&&!i(o.metadata,c.metadata)&&d.add("metadata"),(o.executionSummary!==void 0||c.executionSummary!==void 0)&&!ao.equals(o.executionSummary,c.executionSummary)&&d.add("executionSummary"),d}t.diff=r;function i(o,c){if(o===c)return!0;if(o==null||c===null||c===void 0||typeof o!=typeof c||typeof o!="object")return!1;const d=Array.isArray(o),f=Array.isArray(c);if(d!==f)return!1;if(d&&f){if(o.length!==c.length)return!1;for(let _=0;_0}a.hasId=ce})(Tr||(t.StaticRegistrationOptions=Tr={}));var Pr;(function(a){function ce(ae){const E=ae;return E&&(E.documentSelector===null||wn.is(E.documentSelector))}a.is=ce})(Pr||(t.TextDocumentRegistrationOptions=Pr={}));var kr;(function(a){function ce(E){const u=E;return r.objectLiteral(u)&&(u.workDoneProgress===void 0||r.boolean(u.workDoneProgress))}a.is=ce;function ae(E){const u=E;return u&&r.boolean(u.workDoneProgress)}a.hasWorkDoneProgress=ae})(kr||(t.WorkDoneProgressOptions=kr={}));var ft;(function(a){a.method="initialize",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ft||(t.InitializeRequest=ft={}));var gt;(function(a){a.unknownProtocolVersion=1})(gt||(t.InitializeErrorCodes=gt={}));var Tt;(function(a){a.method="initialized",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Tt||(t.InitializedNotification=Tt={}));var _t;(function(a){a.method="shutdown",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType0(a.method)})(_t||(t.ShutdownRequest=_t={}));var Pt;(function(a){a.method="exit",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType0(a.method)})(Pt||(t.ExitNotification=Pt={}));var kt;(function(a){a.method="workspace/didChangeConfiguration",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(kt||(t.DidChangeConfigurationNotification=kt={}));var Qt;(function(a){a.Error=1,a.Warning=2,a.Info=3,a.Log=4,a.Debug=5})(Qt||(t.MessageType=Qt={}));var He;(function(a){a.method="window/showMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(He||(t.ShowMessageNotification=He={}));var xe;(function(a){a.method="window/showMessageRequest",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(xe||(t.ShowMessageRequest=xe={}));var St;(function(a){a.method="window/logMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(St||(t.LogMessageNotification=St={}));var Oe;(function(a){a.method="telemetry/event",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(Oe||(t.TelemetryEventNotification=Oe={}));var J;(function(a){a.None=0,a.Full=1,a.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));var ze;(function(a){a.method="textDocument/didOpen",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(ze||(t.DidOpenTextDocumentNotification=ze={}));var ne;(function(a){function ce(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range!==void 0&&(u.rangeLength===void 0||typeof u.rangeLength=="number")}a.isIncremental=ce;function ae(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range===void 0&&u.rangeLength===void 0}a.isFull=ae})(ne||(t.TextDocumentContentChangeEvent=ne={}));var je;(function(a){a.method="textDocument/didChange",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(je||(t.DidChangeTextDocumentNotification=je={}));var Yt;(function(a){a.method="textDocument/didClose",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Yt||(t.DidCloseTextDocumentNotification=Yt={}));var pn;(function(a){a.method="textDocument/didSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(pn||(t.DidSaveTextDocumentNotification=pn={}));var yn;(function(a){a.Manual=1,a.AfterDelay=2,a.FocusOut=3})(yn||(t.TextDocumentSaveReason=yn={}));var vn;(function(a){a.method="textDocument/willSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(vn||(t.WillSaveTextDocumentNotification=vn={}));var Rn;(function(a){a.method="textDocument/willSaveWaitUntil",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Rn||(t.WillSaveTextDocumentWaitUntilRequest=Rn={}));var Fe;(function(a){a.method="workspace/didChangeWatchedFiles",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Fe||(t.DidChangeWatchedFilesNotification=Fe={}));var Dn;(function(a){a.Created=1,a.Changed=2,a.Deleted=3})(Dn||(t.FileChangeType=Dn={}));var Sr;(function(a){function ce(ae){const E=ae;return r.objectLiteral(E)&&(n.URI.is(E.baseUri)||n.WorkspaceFolder.is(E.baseUri))&&r.string(E.pattern)}a.is=ce})(Sr||(t.RelativePattern=Sr={}));var Cr;(function(a){a.Create=1,a.Change=2,a.Delete=4})(Cr||(t.WatchKind=Cr={}));var qr;(function(a){a.method="textDocument/publishDiagnostics",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(qr||(t.PublishDiagnosticsNotification=qr={}));var Mr;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.TriggerForIncompleteCompletions=3})(Mr||(t.CompletionTriggerKind=Mr={}));var Tn;(function(a){a.method="textDocument/completion",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Tn||(t.CompletionRequest=Tn={}));var Pn;(function(a){a.method="completionItem/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Pn||(t.CompletionResolveRequest=Pn={}));var Ke;(function(a){a.method="textDocument/hover",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ke||(t.HoverRequest=Ke={}));var kn;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.ContentChange=3})(kn||(t.SignatureHelpTriggerKind=kn={}));var Or;(function(a){a.method="textDocument/signatureHelp",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Or||(t.SignatureHelpRequest=Or={}));var Er;(function(a){a.method="textDocument/definition",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Er||(t.DefinitionRequest=Er={}));var Sn;(function(a){a.method="textDocument/references",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Sn||(t.ReferencesRequest=Sn={}));var Cn;(function(a){a.method="textDocument/documentHighlight",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Cn||(t.DocumentHighlightRequest=Cn={}));var Nr;(function(a){a.method="textDocument/documentSymbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Nr||(t.DocumentSymbolRequest=Nr={}));var jr;(function(a){a.method="textDocument/codeAction",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(jr||(t.CodeActionRequest=jr={}));var Fr;(function(a){a.method="codeAction/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Fr||(t.CodeActionResolveRequest=Fr={}));var Ir;(function(a){a.method="workspace/symbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ir||(t.WorkspaceSymbolRequest=Ir={}));var Ar;(function(a){a.method="workspaceSymbol/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ar||(t.WorkspaceSymbolResolveRequest=Ar={}));var Lr;(function(a){a.method="textDocument/codeLens",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Lr||(t.CodeLensRequest=Lr={}));var Ie;(function(a){a.method="codeLens/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ie||(t.CodeLensResolveRequest=Ie={}));var Wr;(function(a){a.method="workspace/codeLens/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(Wr||(t.CodeLensRefreshRequest=Wr={}));var $r;(function(a){a.method="textDocument/documentLink",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})($r||(t.DocumentLinkRequest=$r={}));var Ct;(function(a){a.method="documentLink/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ct||(t.DocumentLinkResolveRequest=Ct={}));var Hr;(function(a){a.method="textDocument/formatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Hr||(t.DocumentFormattingRequest=Hr={}));var Kt;(function(a){a.method="textDocument/rangeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Kt||(t.DocumentRangeFormattingRequest=Kt={}));var xr;(function(a){a.method="textDocument/rangesFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(xr||(t.DocumentRangesFormattingRequest=xr={}));var Ge;(function(a){a.method="textDocument/onTypeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ge||(t.DocumentOnTypeFormattingRequest=Ge={}));var bt;(function(a){a.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var zr;(function(a){a.method="textDocument/rename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(zr||(t.RenameRequest=zr={}));var Br;(function(a){a.method="textDocument/prepareRename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Br||(t.PrepareRenameRequest=Br={}));var ht;(function(a){a.method="workspace/executeCommand",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ht||(t.ExecuteCommandRequest=ht={}));var qn;(function(a){a.method="workspace/applyEdit",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType("workspace/applyEdit")})(qn||(t.ApplyWorkspaceEditRequest=qn={}))}(Xo);var ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.createProtocolConnection=void 0;const cc=wt;function lu(t,e,n,r){return cc.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,cc.createMessageConnection)(t,e,n,r)}ar.createProtocolConnection=lu,function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(wt,t),n(so,t),n(H,t),n(Xo,t);var r=ar;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Vo),function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Bo;n(Bo,t),n(Vo,t);function i(o,c,d,f){return(0,r.createMessageConnection)(o,c,d,f)}t.createProtocolConnection=i}(ie),Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SemanticTokensBuilder=Ue.SemanticTokensDiff=Ue.SemanticTokensFeature=void 0;const ur=ie,fu=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ur.SemanticTokensRefreshRequest.type),on:e=>{const n=ur.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{const n=ur.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{const n=ur.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ue.SemanticTokensFeature=fu;class ac{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){const e=this.originalSequence.length,n=this.modifiedSequence.length;let r=0;for(;r=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i0&&(c-=this._prevLine,c===0&&(d-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=d,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new ac(this._prevData,this._data).computeDiff()}:this.build()}}Ue.SemanticTokensBuilder=gu;var dr={};Object.defineProperty(dr,"__esModule",{value:!0}),dr.InlineCompletionFeature=void 0;const _u=ie,bu=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(_u.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};dr.InlineCompletionFeature=bu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.TextDocuments=void 0;const Rt=ie;class hu{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Rt.Emitter,this._onDidOpen=new Rt.Emitter,this._onDidClose=new Rt.Emitter,this._onDidSave=new Rt.Emitter,this._onWillSave=new Rt.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Rt.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);const c=Object.freeze({document:o});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,o=r.contentChanges;if(o.length===0)return;const{version:c}=i;if(c==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let d=this._syncedDocuments.get(i.uri);d!==void 0&&(d=this._configuration.update(d,o,c),this._syncedDocuments.set(i.uri,d),this._onDidChangeContent.fire(Object.freeze({document:d})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Rt.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}hn.TextDocuments=hu;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NotebookDocuments=Dt.NotebookSyncFeature=void 0;const qe=ie,uc=hn,mu=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(qe.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(qe.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(qe.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(qe.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Dt.NotebookSyncFeature=mu;class Vt{onDidOpenTextDocument(e){return this.openHandler=e,qe.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qe.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qe.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Vt.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Vt.NULL_DISPOSE}onDidSaveTextDocument(){return Vt.NULL_DISPOSE}}Vt.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class wu{constructor(e){e instanceof uc.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new uc.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qe.Emitter,this._onDidChange=new qe.Emitter,this._onDidSave=new qe.Emitter,this._onDidClose=new qe.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){const n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const n=new Vt,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;const c=o.metadata;let d=!1;const f=i.change;f.metadata!==void 0&&(d=!0,o.metadata=f.metadata);const _=[],w=[],k=[],v=[];if(f.cells!==void 0){const $=f.cells;if($.structure!==void 0){const b=$.structure.array;if(o.cells.splice(b.start,b.deleteCount,...b.cells!==void 0?b.cells:[]),$.structure.didOpen!==void 0)for(const h of $.structure.didOpen)n.openTextDocument({textDocument:h}),_.push(h.uri);if($.structure.didClose)for(const h of $.structure.didClose)n.closeTextDocument({textDocument:h}),w.push(h.uri)}if($.data!==void 0){const b=new Map($.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){const T=b.get(o.cells[h].document);if(T!==void 0){const ge=o.cells.splice(h,1,T);if(k.push({old:ge[0],new:T}),b.delete(T.document),b.size===0)break}}}if($.textContent!==void 0)for(const b of $.textContent)n.changeTextDocument({textDocument:b.document,contentChanges:b.changes}),v.push(b.document.uri)}this.updateCellMap(o);const M={notebookDocument:o};d&&(M.metadata={old:c,new:o.metadata});const W=[];for(const $ of _)W.push(this.getNotebookCell($));const be=[];for(const $ of w)be.push(this.getNotebookCell($));const me=[];for(const $ of v)me.push(this.getNotebookCell($));(W.length>0||be.length>0||k.length>0||me.length>0)&&(M.cells={added:W,removed:be,changed:{data:k,textContent:me}}),(M.metadata!==void 0||M.cells!==void 0)&&this._onDidChange.fire(M)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(const c of i.cellTextDocuments)n.closeTextDocument({textDocument:c});this.notebookDocuments.delete(i.notebookDocument.uri);for(const c of o.cells)this.notebookCellMap.delete(c.document)}})),qe.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}Dt.NotebookDocuments=wu;var z={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.thenable=oe.typedArray=oe.stringArray=oe.array=oe.func=oe.error=oe.number=oe.string=oe.boolean=void 0;function pu(t){return t===!0||t===!1}oe.boolean=pu;function dc(t){return typeof t=="string"||t instanceof String}oe.string=dc;function yu(t){return typeof t=="number"||t instanceof Number}oe.number=yu;function vu(t){return t instanceof Error}oe.error=vu;function lc(t){return typeof t=="function"}oe.func=lc;function fc(t){return Array.isArray(t)}oe.array=fc;function Ru(t){return fc(t)&&t.every(e=>dc(e))}oe.stringArray=Ru;function Du(t,e){return Array.isArray(t)&&t.every(e)}oe.typedArray=Du;function Tu(t){return t&&lc(t.then)}oe.thenable=Tu;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.generateUuid=Pe.parse=Pe.isUUID=Pe.v4=Pe.empty=void 0;class uo{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class L extends uo{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return L._oneOf(L._chars)}constructor(){super([L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-","4",L._randomHex(),L._randomHex(),L._randomHex(),"-",L._oneOf(L._timeHighBits),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex()].join(""))}}L._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],L._timeHighBits=["8","9","a","b"],Pe.empty=new uo("00000000-0000-0000-0000-000000000000");function gc(){return new L}Pe.v4=gc;const Pu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _c(t){return Pu.test(t)}Pe.isUUID=_c;function ku(t){if(!_c(t))throw new Error("invalid uuid");return new uo(t)}Pe.parse=ku;function Su(){return gc().asHex()}Pe.generateUuid=Su;var at={};Object.defineProperty(at,"__esModule",{value:!0}),at.attachPartialResult=at.ProgressFeature=at.attachWorkDone=void 0;const ut=ie,Cu=Pe;class dt{constructor(e,n){this._connection=e,this._token=n,dt.Instances.set(this._token,this)}begin(e,n,r,i){let o={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,o)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,r)}done(){dt.Instances.delete(this._token),this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,{kind:"end"})}}dt.Instances=new Map;class bc extends dt{constructor(e,n){super(e,n),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class lo{constructor(){}begin(){}report(){}done(){}}class hc extends lo{constructor(){super(),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function qu(t,e){if(e===void 0||e.workDoneToken===void 0)return new lo;const n=e.workDoneToken;return delete e.workDoneToken,new dt(t,n)}at.attachWorkDone=qu;const Mu=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ut.WorkDoneProgressCancelNotification.type,n=>{let r=dt.Instances.get(n.token);(r instanceof bc||r instanceof hc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new lo:new dt(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Cu.generateUuid)();return this.connection.sendRequest(ut.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bc(this.connection,e))}else return Promise.resolve(new hc)}};at.ProgressFeature=Mu;var fo;(function(t){t.type=new ut.ProgressType})(fo||(fo={}));class Ou{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(fo.type,this._token,e)}}function Eu(t,e){if(e===void 0||e.partialResultToken===void 0)return;const n=e.partialResultToken;return delete e.partialResultToken,new Ou(t,n)}at.attachPartialResult=Eu;var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.ConfigurationFeature=void 0;const Nu=ie,ju=oe,Fu=t=>class extends t{getConfiguration(e){return e?ju.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Nu.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};lr.ConfigurationFeature=Fu;var fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.WorkspaceFoldersFeature=void 0;const gr=ie,Iu=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new gr.Emitter,this.connection.onNotification(gr.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);const n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(gr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(gr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};fr.WorkspaceFoldersFeature=Iu;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.CallHierarchyFeature=void 0;const go=ie,Au=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(go.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{const n=go.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{const n=go.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};_r.CallHierarchyFeature=Au;var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.ShowDocumentFeature=void 0;const Lu=ie,Wu=t=>class extends t{showDocument(e){return this.connection.sendRequest(Lu.ShowDocumentRequest.type,e)}};br.ShowDocumentFeature=Wu;var hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.FileOperationsFeature=void 0;const Ut=ie,$u=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ut.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ut.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ut.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ut.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ut.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ut.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};hr.FileOperationsFeature=$u;var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.LinkedEditingRangeFeature=void 0;const Hu=ie,xu=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Hu.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};mr.LinkedEditingRangeFeature=xu;var wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.TypeHierarchyFeature=void 0;const _o=ie,zu=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(_o.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{const n=_o.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{const n=_o.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wr.TypeHierarchyFeature=zu;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.InlineValueFeature=void 0;const mc=ie,Bu=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(mc.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(mc.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};pr.InlineValueFeature=Bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.FoldingRangeFeature=void 0;const wc=ie,Vu=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(wc.FoldingRangeRefreshRequest.type),on:e=>{const n=wc.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};yr.FoldingRangeFeature=Vu;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.InlayHintFeature=void 0;const bo=ie,Uu=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(bo.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(bo.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(bo.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};vr.InlayHintFeature=Uu;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.DiagnosticFeature=void 0;const mn=ie,Ju=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(mn.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(mn.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(mn.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.WorkspaceDiagnosticRequest.partialResult,n)))}}};Rr.DiagnosticFeature=Ju;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.MonikerFeature=void 0;const Xu=ie,Qu=t=>class extends t{get moniker(){return{on:e=>{const n=Xu.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Dr.MonikerFeature=Qu,Object.defineProperty(z,"__esModule",{value:!0}),z.createConnection=z.combineFeatures=z.combineNotebooksFeatures=z.combineLanguagesFeatures=z.combineWorkspaceFeatures=z.combineWindowFeatures=z.combineClientFeatures=z.combineTracerFeatures=z.combineTelemetryFeatures=z.combineConsoleFeatures=z._NotebooksImpl=z._LanguagesImpl=z.BulkUnregistration=z.BulkRegistration=z.ErrorMessageTracker=void 0;const D=ie,Me=oe,ho=Pe,N=at,Yu=lr,Ku=fr,Gu=_r,Zu=Ue,ed=br,td=hr,nd=mr,rd=wr,id=pr,od=yr,sd=vr,cd=Rr,ad=Dt,ud=Dr;function mo(t){if(t!==null)return t}class dd{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}}z.ErrorMessageTracker=dd;class pc{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(D.MessageType.Error,e)}warn(e){this.send(D.MessageType.Warning,e)}info(e){this.send(D.MessageType.Info,e)}log(e){this.send(D.MessageType.Log,e)}debug(e){this.send(D.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(D.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,D.RAL)().console.error("Sending log message failed")})}}class ld{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:D.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showWarningMessage(e,...n){let r={type:D.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showInformationMessage(e,...n){let r={type:D.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}}const yc=(0,ed.ShowDocumentFeature)((0,N.ProgressFeature)(ld));var vc;(function(t){function e(){return new Rc}t.create=e})(vc||(z.BulkRegistration=vc={}));class Rc{constructor(){this._registrations=[],this._registered=new Set}add(e,n){const r=Me.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);const i=ho.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}}var Dc;(function(t){function e(){return new wo(void 0,[])}t.create=e})(Dc||(z.BulkUnregistration=Dc={}));class wo{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(D.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){const n=Me.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(D.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}}class Tc{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Rc?this.registerMany(e):e instanceof wo?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){const i=Me.string(n)?n:n.method,o=ho.generateUuid();let c={registrations:[{id:o,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(D.RegistrationRequest.type,c).then(d=>(e.add({id:o,method:i}),e),d=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(d)))}registerSingle2(e,n){const r=Me.string(e)?e:e.method,i=ho.generateUuid();let o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(D.RegistrationRequest.type,o).then(c=>D.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(c)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(D.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(D.RegistrationRequest.type,n).then(()=>new wo(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}}class fd{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(D.ApplyWorkspaceEditRequest.type,r)}}const Pc=(0,td.FileOperationsFeature)((0,Ku.WorkspaceFoldersFeature)((0,Yu.ConfigurationFeature)(fd)));class kc{constructor(){this._trace=D.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==D.Trace.Off&&this.connection.sendNotification(D.LogTraceNotification.type,{message:e,verbose:this._trace===D.Trace.Verbose?n:void 0}).catch(()=>{})}}class Sc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(D.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class Cc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._LanguagesImpl=Cc;const qc=(0,od.FoldingRangeFeature)((0,ud.MonikerFeature)((0,cd.DiagnosticFeature)((0,sd.InlayHintFeature)((0,id.InlineValueFeature)((0,rd.TypeHierarchyFeature)((0,nd.LinkedEditingRangeFeature)((0,Zu.SemanticTokensFeature)((0,Gu.CallHierarchyFeature)(Cc)))))))));class Mc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._NotebooksImpl=Mc;const Oc=(0,ad.NotebookSyncFeature)(Mc);function Ec(t,e){return function(n){return e(t(n))}}z.combineConsoleFeatures=Ec;function Nc(t,e){return function(n){return e(t(n))}}z.combineTelemetryFeatures=Nc;function jc(t,e){return function(n){return e(t(n))}}z.combineTracerFeatures=jc;function Fc(t,e){return function(n){return e(t(n))}}z.combineClientFeatures=Fc;function Ic(t,e){return function(n){return e(t(n))}}z.combineWindowFeatures=Ic;function Ac(t,e){return function(n){return e(t(n))}}z.combineWorkspaceFeatures=Ac;function Lc(t,e){return function(n){return e(t(n))}}z.combineLanguagesFeatures=Lc;function Wc(t,e){return function(n){return e(t(n))}}z.combineNotebooksFeatures=Wc;function gd(t,e){function n(i,o,c){return i&&o?c(i,o):i||o}return{__brand:"features",console:n(t.console,e.console,Ec),tracer:n(t.tracer,e.tracer,jc),telemetry:n(t.telemetry,e.telemetry,Nc),client:n(t.client,e.client,Fc),window:n(t.window,e.window,Ic),workspace:n(t.workspace,e.workspace,Ac),languages:n(t.languages,e.languages,Lc),notebooks:n(t.notebooks,e.notebooks,Wc)}}z.combineFeatures=gd;function _d(t,e,n){const r=n&&n.console?new(n.console(pc)):new pc,i=t(r);r.rawAttach(i);const o=n&&n.tracer?new(n.tracer(kc)):new kc,c=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,d=n&&n.client?new(n.client(Tc)):new Tc,f=n&&n.window?new(n.window(yc)):new yc,_=n&&n.workspace?new(n.workspace(Pc)):new Pc,w=n&&n.languages?new(n.languages(qc)):new qc,k=n&&n.notebooks?new(n.notebooks(Oc)):new Oc,v=[r,o,c,d,f,_,w,k];function M(b){return b instanceof Promise?b:Me.thenable(b)?new Promise((h,T)=>{b.then(ge=>h(ge),ge=>T(ge))}):Promise.resolve(b)}let W,be,me,$={listen:()=>i.listen(),sendRequest:(b,...h)=>i.sendRequest(Me.string(b)?b:b.method,...h),onRequest:(b,h)=>i.onRequest(b,h),sendNotification:(b,h)=>{const T=Me.string(b)?b:b.method;return i.sendNotification(T,h)},onNotification:(b,h)=>i.onNotification(b,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:b=>(be=b,{dispose:()=>{be=void 0}}),onInitialized:b=>i.onNotification(D.InitializedNotification.type,b),onShutdown:b=>(W=b,{dispose:()=>{W=void 0}}),onExit:b=>(me=b,{dispose:()=>{me=void 0}}),get console(){return r},get telemetry(){return c},get tracer(){return o},get client(){return d},get window(){return f},get workspace(){return _},get languages(){return w},get notebooks(){return k},onDidChangeConfiguration:b=>i.onNotification(D.DidChangeConfigurationNotification.type,b),onDidChangeWatchedFiles:b=>i.onNotification(D.DidChangeWatchedFilesNotification.type,b),__textDocumentSync:void 0,onDidOpenTextDocument:b=>i.onNotification(D.DidOpenTextDocumentNotification.type,b),onDidChangeTextDocument:b=>i.onNotification(D.DidChangeTextDocumentNotification.type,b),onDidCloseTextDocument:b=>i.onNotification(D.DidCloseTextDocumentNotification.type,b),onWillSaveTextDocument:b=>i.onNotification(D.WillSaveTextDocumentNotification.type,b),onWillSaveTextDocumentWaitUntil:b=>i.onRequest(D.WillSaveTextDocumentWaitUntilRequest.type,b),onDidSaveTextDocument:b=>i.onNotification(D.DidSaveTextDocumentNotification.type,b),sendDiagnostics:b=>i.sendNotification(D.PublishDiagnosticsNotification.type,b),onHover:b=>i.onRequest(D.HoverRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onCompletion:b=>i.onRequest(D.CompletionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCompletionResolve:b=>i.onRequest(D.CompletionResolveRequest.type,b),onSignatureHelp:b=>i.onRequest(D.SignatureHelpRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDeclaration:b=>i.onRequest(D.DeclarationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDefinition:b=>i.onRequest(D.DefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onTypeDefinition:b=>i.onRequest(D.TypeDefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onImplementation:b=>i.onRequest(D.ImplementationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onReferences:b=>i.onRequest(D.ReferencesRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentHighlight:b=>i.onRequest(D.DocumentHighlightRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentSymbol:b=>i.onRequest(D.DocumentSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbol:b=>i.onRequest(D.WorkspaceSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:b=>i.onRequest(D.WorkspaceSymbolResolveRequest.type,b),onCodeAction:b=>i.onRequest(D.CodeActionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeActionResolve:b=>i.onRequest(D.CodeActionResolveRequest.type,(h,T)=>b(h,T)),onCodeLens:b=>i.onRequest(D.CodeLensRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeLensResolve:b=>i.onRequest(D.CodeLensResolveRequest.type,(h,T)=>b(h,T)),onDocumentFormatting:b=>i.onRequest(D.DocumentFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:b=>i.onRequest(D.DocumentRangeFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:b=>i.onRequest(D.DocumentOnTypeFormattingRequest.type,(h,T)=>b(h,T)),onRenameRequest:b=>i.onRequest(D.RenameRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onPrepareRename:b=>i.onRequest(D.PrepareRenameRequest.type,(h,T)=>b(h,T)),onDocumentLinks:b=>i.onRequest(D.DocumentLinkRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentLinkResolve:b=>i.onRequest(D.DocumentLinkResolveRequest.type,(h,T)=>b(h,T)),onDocumentColor:b=>i.onRequest(D.DocumentColorRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onColorPresentation:b=>i.onRequest(D.ColorPresentationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onFoldingRanges:b=>i.onRequest(D.FoldingRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onSelectionRanges:b=>i.onRequest(D.SelectionRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onExecuteCommand:b=>i.onRequest(D.ExecuteCommandRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let b of v)b.attach($);return i.onRequest(D.InitializeRequest.type,b=>{e.initialize(b),Me.string(b.trace)&&(o.trace=D.Trace.fromString(b.trace));for(let h of v)h.initialize(b.capabilities);if(be){let h=be(b,new D.CancellationTokenSource().token,(0,N.attachWorkDone)(i,b),void 0);return M(h).then(T=>{if(T instanceof D.ResponseError)return T;let ge=T;ge||(ge={capabilities:{}});let se=ge.capabilities;se||(se={},ge.capabilities=se),se.textDocumentSync===void 0||se.textDocumentSync===null?se.textDocumentSync=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None:!Me.number(se.textDocumentSync)&&!Me.number(se.textDocumentSync.change)&&(se.textDocumentSync.change=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None);for(let we of v)we.fillServerCapabilities(se);return ge})}else{let h={capabilities:{textDocumentSync:D.TextDocumentSyncKind.None}};for(let T of v)T.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(D.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,W)return W(new D.CancellationTokenSource().token)}),i.onNotification(D.ExitNotification.type,()=>{try{me&&me()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(D.SetTraceNotification.type,b=>{o.trace=D.Trace.fromString(b.value)}),$}z.createConnection=_d,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,k){k===void 0&&(k=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,k,v)}:function(f,_,w,k){k===void 0&&(k=w),f[k]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Ue;Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=dr;n(ie,t);const o=hn;Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const c=Dt;Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),n(z,t);var d;(function(f){f.all={__brand:"features",languages:i.InlineCompletionFeature}})(d||(t.ProposedFeatures=d={}))}(Xr);var bd=ie;(function(t){var e=de&&de.__createBinding||(Object.create?function(d,f,_,w){w===void 0&&(w=_);var k=Object.getOwnPropertyDescriptor(f,_);(!k||("get"in k?!f.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(d,w,k)}:function(d,f,_,w){w===void 0&&(w=_),d[w]=f[_]}),n=de&&de.__exportStar||function(d,f){for(var _ in d)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&e(f,d,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=void 0;const r=Xr;n(bd,t),n(Xr,t);let i=!1;const o={initialize:d=>{},get shutdownReceived(){return i},set shutdownReceived(d){i=d},exit:d=>{}};function c(d,f,_,w){let k,v,M,W;d!==void 0&&d.__brand==="features"&&(k=d,d=f,f=_,_=w),r.ConnectionStrategy.is(d)||r.ConnectionOptions.is(d)?W=d:(v=d,M=f,W=_);const be=me=>(0,r.createProtocolConnection)(v,M,me,W);return(0,r.createConnection)(be,o,k)}t.createConnection=c})(ko);var po=ko;Po().then(()=>{const t=new po.BrowserMessageReader(self),e=new po.BrowserMessageWriter(self);let n;const r=po.createConnection(t,e);function i(d,f){return r.sendNotification(d,f),!0}async function o(d,f){return await r.sendRequest(d,f)}async function c(d){return await r.sendRequest("slint/load_file",d)}r.onInitialize(d=>(n=xc(d,i,o,c),n.server_initialize_result(d.capabilities))),r.onRequest(async(d,f,_)=>await n.handle_request(_,d,f)),r.onNotification("slint/preview_to_lsp",async d=>{await n.process_preview_to_lsp_message(d)}),r.onDidChangeTextDocument(async d=>{await n.reload_document(d.contentChanges[d.contentChanges.length-1].text,d.textDocument.uri,d.textDocument.version)}),r.onDidOpenTextDocument(async d=>{await n.reload_document(d.textDocument.text,d.textDocument.uri,d.textDocument.version)}),r.onDidChangeConfiguration(async d=>{await n.reload_config()}),r.listen(),self.postMessage("OK")})})(); +`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ke.create(0,e);for(;re?i=c:r=c+1}let o=r-1;return ke.create(o,e-n[o])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(M){return M===!0||M===!1}t.boolean=i;function o(M){return e.call(M)==="[object String]"}t.string=o;function c(M){return e.call(M)==="[object Number]"}t.number=c;function d(M,W,be){return e.call(M)==="[object Number]"&&W<=M&&M<=be}t.numberRange=d;function f(M){return e.call(M)==="[object Number]"&&-2147483648<=M&&M<=2147483647}t.integer=f;function _(M){return e.call(M)==="[object Number]"&&0<=M&&M<=2147483647}t.uinteger=_;function w(M){return e.call(M)==="[object Function]"}t.func=w;function k(M){return M!==null&&typeof M=="object"}t.objectLiteral=k;function v(M,W){return Array.isArray(M)&&M.every(W)}t.typedArray=v})(l||(l={}));var Ya=Object.freeze({__proto__:null,get AnnotatedTextEdit(){return Qe},get ChangeAnnotation(){return vt},get ChangeAnnotationIdentifier(){return he},get CodeAction(){return Wi},get CodeActionContext(){return Li},get CodeActionKind(){return Ai},get CodeActionTriggerKind(){return gn},get CodeDescription(){return bi},get CodeLens(){return $i},get Color(){return Hn},get ColorInformation(){return ui},get ColorPresentation(){return di},get Command(){return yt},get CompletionItem(){return Pi},get CompletionItemKind(){return pi},get CompletionItemLabelDetails(){return Ti},get CompletionItemTag(){return vi},get CompletionList(){return ki},get CreateFile(){return Ot},get DeleteFile(){return Nt},get Diagnostic(){return un},get DiagnosticRelatedInformation(){return xn},get DiagnosticSeverity(){return gi},get DiagnosticTag(){return _i},get DocumentHighlight(){return Oi},get DocumentHighlightKind(){return Mi},get DocumentLink(){return xi},get DocumentSymbol(){return Ii},get DocumentUri(){return si},EOL:Xa,get FoldingRange(){return fi},get FoldingRangeKind(){return li},get FormattingOptions(){return Hi},get Hover(){return Si},get InlayHint(){return Ki},get InlayHintKind(){return Un},get InlayHintLabelPart(){return Jn},get InlineCompletionContext(){return ro},get InlineCompletionItem(){return Zi},get InlineCompletionList(){return eo},get InlineCompletionTriggerKind(){return to},get InlineValueContext(){return Yi},get InlineValueEvaluatableExpression(){return Qi},get InlineValueText(){return Ji},get InlineValueVariableLookup(){return Xi},get InsertReplaceEdit(){return Ri},get InsertTextFormat(){return yi},get InsertTextMode(){return Di},get Location(){return an},get LocationLink(){return ai},get MarkedString(){return fn},get MarkupContent(){return jt},get MarkupKind(){return Vn},get OptionalVersionedTextDocumentIdentifier(){return ln},get ParameterInformation(){return Ci},get Position(){return ke},get Range(){return Z},get RenameFile(){return Et},get SelectedCompletionInfo(){return no},get SelectionRange(){return zi},get SemanticTokenModifiers(){return Vi},get SemanticTokenTypes(){return Bi},get SemanticTokens(){return Ui},get SignatureInformation(){return qi},get StringValue(){return Gi},get SymbolInformation(){return ji},get SymbolKind(){return Ei},get SymbolTag(){return Ni},get TextDocument(){return oo},get TextDocumentEdit(){return dn},get TextDocumentIdentifier(){return hi},get TextDocumentItem(){return wi},get TextEdit(){return We},get URI(){return $n},get VersionedTextDocumentIdentifier(){return mi},WorkspaceChange:Ja,get WorkspaceEdit(){return zn},get WorkspaceFolder(){return io},get WorkspaceSymbol(){return Fi},get integer(){return ci},get uinteger(){return cn}}),so=Jc(Ya),H={};Object.defineProperty(H,"__esModule",{value:!0}),H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const Ft=wt;var Jo;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Jo||(H.MessageDirection=Jo={}));class Ka{constructor(e){this.method=e}}H.RegistrationType=Ka;class Ga extends Ft.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=Ga;class Za extends Ft.RequestType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolRequestType=Za;class eu extends Ft.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=eu;class tu extends Ft.NotificationType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolNotificationType=tu;var Xo={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.objectLiteral=ee.typedArray=ee.stringArray=ee.array=ee.func=ee.error=ee.number=ee.string=ee.boolean=void 0;function nu(t){return t===!0||t===!1}ee.boolean=nu;function Qo(t){return typeof t=="string"||t instanceof String}ee.string=Qo;function ru(t){return typeof t=="number"||t instanceof Number}ee.number=ru;function iu(t){return t instanceof Error}ee.error=iu;function ou(t){return typeof t=="function"}ee.func=ou;function Yo(t){return Array.isArray(t)}ee.array=Yo;function su(t){return Yo(t)&&t.every(e=>Qo(e))}ee.stringArray=su;function cu(t,e){return Array.isArray(t)&&t.every(e)}ee.typedArray=cu;function au(t){return t!==null&&typeof t=="object"}ee.objectLiteral=au;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ImplementationRequest=void 0;const Ko=H;var Go;(function(t){t.method="textDocument/implementation",t.messageDirection=Ko.MessageDirection.clientToServer,t.type=new Ko.ProtocolRequestType(t.method)})(Go||(Xn.ImplementationRequest=Go={}));var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.TypeDefinitionRequest=void 0;const Zo=H;var es;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(es||(Qn.TypeDefinitionRequest=es={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.DidChangeWorkspaceFoldersNotification=It.WorkspaceFoldersRequest=void 0;const Yn=H;var ts;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Yn.MessageDirection.serverToClient,t.type=new Yn.ProtocolRequestType0(t.method)})(ts||(It.WorkspaceFoldersRequest=ts={}));var ns;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Yn.MessageDirection.clientToServer,t.type=new Yn.ProtocolNotificationType(t.method)})(ns||(It.DidChangeWorkspaceFoldersNotification=ns={}));var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.ConfigurationRequest=void 0;const rs=H;var is;(function(t){t.method="workspace/configuration",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(is||(Kn.ConfigurationRequest=is={}));var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.ColorPresentationRequest=At.DocumentColorRequest=void 0;const Gn=H;var os;(function(t){t.method="textDocument/documentColor",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(os||(At.DocumentColorRequest=os={}));var ss;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(ss||(At.ColorPresentationRequest=ss={}));var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.FoldingRangeRefreshRequest=Lt.FoldingRangeRequest=void 0;const Zn=H;var cs;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Zn.MessageDirection.clientToServer,t.type=new Zn.ProtocolRequestType(t.method)})(cs||(Lt.FoldingRangeRequest=cs={}));var as;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Zn.MessageDirection.serverToClient,t.type=new Zn.ProtocolRequestType0(t.method)})(as||(Lt.FoldingRangeRefreshRequest=as={}));var er={};Object.defineProperty(er,"__esModule",{value:!0}),er.DeclarationRequest=void 0;const us=H;var ds;(function(t){t.method="textDocument/declaration",t.messageDirection=us.MessageDirection.clientToServer,t.type=new us.ProtocolRequestType(t.method)})(ds||(er.DeclarationRequest=ds={}));var tr={};Object.defineProperty(tr,"__esModule",{value:!0}),tr.SelectionRangeRequest=void 0;const ls=H;var fs;(function(t){t.method="textDocument/selectionRange",t.messageDirection=ls.MessageDirection.clientToServer,t.type=new ls.ProtocolRequestType(t.method)})(fs||(tr.SelectionRangeRequest=fs={}));var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.WorkDoneProgressCancelNotification=rt.WorkDoneProgressCreateRequest=rt.WorkDoneProgress=void 0;const uu=wt,nr=H;var gs;(function(t){t.type=new uu.ProgressType;function e(n){return n===t.type}t.is=e})(gs||(rt.WorkDoneProgress=gs={}));var _s;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=nr.MessageDirection.serverToClient,t.type=new nr.ProtocolRequestType(t.method)})(_s||(rt.WorkDoneProgressCreateRequest=_s={}));var bs;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=nr.MessageDirection.clientToServer,t.type=new nr.ProtocolNotificationType(t.method)})(bs||(rt.WorkDoneProgressCancelNotification=bs={}));var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.CallHierarchyOutgoingCallsRequest=it.CallHierarchyIncomingCallsRequest=it.CallHierarchyPrepareRequest=void 0;const Wt=H;var hs;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(hs||(it.CallHierarchyPrepareRequest=hs={}));var ms;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ms||(it.CallHierarchyIncomingCallsRequest=ms={}));var ws;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ws||(it.CallHierarchyOutgoingCallsRequest=ws={}));var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.SemanticTokensRefreshRequest=Te.SemanticTokensRangeRequest=Te.SemanticTokensDeltaRequest=Te.SemanticTokensRequest=Te.SemanticTokensRegistrationType=Te.TokenFormat=void 0;const Ye=H;var ps;(function(t){t.Relative="relative"})(ps||(Te.TokenFormat=ps={}));var _n;(function(t){t.method="textDocument/semanticTokens",t.type=new Ye.RegistrationType(t.method)})(_n||(Te.SemanticTokensRegistrationType=_n={}));var ys;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(ys||(Te.SemanticTokensRequest=ys={}));var vs;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(vs||(Te.SemanticTokensDeltaRequest=vs={}));var Rs;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(Rs||(Te.SemanticTokensRangeRequest=Rs={}));var Ds;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ye.MessageDirection.serverToClient,t.type=new Ye.ProtocolRequestType0(t.method)})(Ds||(Te.SemanticTokensRefreshRequest=Ds={}));var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.ShowDocumentRequest=void 0;const Ts=H;var Ps;(function(t){t.method="window/showDocument",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType(t.method)})(Ps||(rr.ShowDocumentRequest=Ps={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.LinkedEditingRangeRequest=void 0;const ks=H;var Ss;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(Ss||(ir.LinkedEditingRangeRequest=Ss={}));var ve={};Object.defineProperty(ve,"__esModule",{value:!0}),ve.WillDeleteFilesRequest=ve.DidDeleteFilesNotification=ve.DidRenameFilesNotification=ve.WillRenameFilesRequest=ve.DidCreateFilesNotification=ve.WillCreateFilesRequest=ve.FileOperationPatternKind=void 0;const Se=H;var Cs;(function(t){t.file="file",t.folder="folder"})(Cs||(ve.FileOperationPatternKind=Cs={}));var qs;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(qs||(ve.WillCreateFilesRequest=qs={}));var Ms;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ms||(ve.DidCreateFilesNotification=Ms={}));var Os;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(Os||(ve.WillRenameFilesRequest=Os={}));var Es;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Es||(ve.DidRenameFilesNotification=Es={}));var Ns;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ns||(ve.DidDeleteFilesNotification=Ns={}));var js;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(js||(ve.WillDeleteFilesRequest=js={}));var ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.MonikerRequest=ot.MonikerKind=ot.UniquenessLevel=void 0;const Fs=H;var Is;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Is||(ot.UniquenessLevel=Is={}));var As;(function(t){t.$import="import",t.$export="export",t.local="local"})(As||(ot.MonikerKind=As={}));var Ls;(function(t){t.method="textDocument/moniker",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(Ls||(ot.MonikerRequest=Ls={}));var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.TypeHierarchySubtypesRequest=st.TypeHierarchySupertypesRequest=st.TypeHierarchyPrepareRequest=void 0;const $t=H;var Ws;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Ws||(st.TypeHierarchyPrepareRequest=Ws={}));var $s;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})($s||(st.TypeHierarchySupertypesRequest=$s={}));var Hs;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Hs||(st.TypeHierarchySubtypesRequest=Hs={}));var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.InlineValueRefreshRequest=Ht.InlineValueRequest=void 0;const or=H;var xs;(function(t){t.method="textDocument/inlineValue",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolRequestType(t.method)})(xs||(Ht.InlineValueRequest=xs={}));var zs;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=or.MessageDirection.serverToClient,t.type=new or.ProtocolRequestType0(t.method)})(zs||(Ht.InlineValueRefreshRequest=zs={}));var ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.InlayHintRefreshRequest=ct.InlayHintResolveRequest=ct.InlayHintRequest=void 0;const xt=H;var Bs;(function(t){t.method="textDocument/inlayHint",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Bs||(ct.InlayHintRequest=Bs={}));var Vs;(function(t){t.method="inlayHint/resolve",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Vs||(ct.InlayHintResolveRequest=Vs={}));var Us;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=xt.MessageDirection.serverToClient,t.type=new xt.ProtocolRequestType0(t.method)})(Us||(ct.InlayHintRefreshRequest=Us={}));var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DiagnosticRefreshRequest=Ce.WorkspaceDiagnosticRequest=Ce.DocumentDiagnosticRequest=Ce.DocumentDiagnosticReportKind=Ce.DiagnosticServerCancellationData=void 0;const Js=wt,du=ee,zt=H;var Xs;(function(t){function e(n){const r=n;return r&&du.boolean(r.retriggerRequest)}t.is=e})(Xs||(Ce.DiagnosticServerCancellationData=Xs={}));var Qs;(function(t){t.Full="full",t.Unchanged="unchanged"})(Qs||(Ce.DocumentDiagnosticReportKind=Qs={}));var Ys;(function(t){t.method="textDocument/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ys||(Ce.DocumentDiagnosticRequest=Ys={}));var Ks;(function(t){t.method="workspace/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ks||(Ce.WorkspaceDiagnosticRequest=Ks={}));var Gs;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=zt.MessageDirection.serverToClient,t.type=new zt.ProtocolRequestType0(t.method)})(Gs||(Ce.DiagnosticRefreshRequest=Gs={}));var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.DidCloseNotebookDocumentNotification=te.DidSaveNotebookDocumentNotification=te.DidChangeNotebookDocumentNotification=te.NotebookCellArrayChange=te.DidOpenNotebookDocumentNotification=te.NotebookDocumentSyncRegistrationType=te.NotebookDocument=te.NotebookCell=te.ExecutionSummary=te.NotebookCellKind=void 0;const bn=so,Ne=ee,$e=H;var co;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(co||(te.NotebookCellKind=co={}));var ao;(function(t){function e(i,o){const c={executionOrder:i};return(o===!0||o===!1)&&(c.success=o),c}t.create=e;function n(i){const o=i;return Ne.objectLiteral(o)&&bn.uinteger.is(o.executionOrder)&&(o.success===void 0||Ne.boolean(o.success))}t.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=r})(ao||(te.ExecutionSummary=ao={}));var sr;(function(t){function e(o,c){return{kind:o,document:c}}t.create=e;function n(o){const c=o;return Ne.objectLiteral(c)&&co.is(c.kind)&&bn.DocumentUri.is(c.document)&&(c.metadata===void 0||Ne.objectLiteral(c.metadata))}t.is=n;function r(o,c){const d=new Set;return o.document!==c.document&&d.add("document"),o.kind!==c.kind&&d.add("kind"),o.executionSummary!==c.executionSummary&&d.add("executionSummary"),(o.metadata!==void 0||c.metadata!==void 0)&&!i(o.metadata,c.metadata)&&d.add("metadata"),(o.executionSummary!==void 0||c.executionSummary!==void 0)&&!ao.equals(o.executionSummary,c.executionSummary)&&d.add("executionSummary"),d}t.diff=r;function i(o,c){if(o===c)return!0;if(o==null||c===null||c===void 0||typeof o!=typeof c||typeof o!="object")return!1;const d=Array.isArray(o),f=Array.isArray(c);if(d!==f)return!1;if(d&&f){if(o.length!==c.length)return!1;for(let _=0;_0}a.hasId=ce})(Tr||(t.StaticRegistrationOptions=Tr={}));var Pr;(function(a){function ce(ae){const E=ae;return E&&(E.documentSelector===null||wn.is(E.documentSelector))}a.is=ce})(Pr||(t.TextDocumentRegistrationOptions=Pr={}));var kr;(function(a){function ce(E){const u=E;return r.objectLiteral(u)&&(u.workDoneProgress===void 0||r.boolean(u.workDoneProgress))}a.is=ce;function ae(E){const u=E;return u&&r.boolean(u.workDoneProgress)}a.hasWorkDoneProgress=ae})(kr||(t.WorkDoneProgressOptions=kr={}));var ft;(function(a){a.method="initialize",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ft||(t.InitializeRequest=ft={}));var gt;(function(a){a.unknownProtocolVersion=1})(gt||(t.InitializeErrorCodes=gt={}));var Tt;(function(a){a.method="initialized",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Tt||(t.InitializedNotification=Tt={}));var _t;(function(a){a.method="shutdown",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType0(a.method)})(_t||(t.ShutdownRequest=_t={}));var Pt;(function(a){a.method="exit",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType0(a.method)})(Pt||(t.ExitNotification=Pt={}));var kt;(function(a){a.method="workspace/didChangeConfiguration",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(kt||(t.DidChangeConfigurationNotification=kt={}));var Qt;(function(a){a.Error=1,a.Warning=2,a.Info=3,a.Log=4,a.Debug=5})(Qt||(t.MessageType=Qt={}));var He;(function(a){a.method="window/showMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(He||(t.ShowMessageNotification=He={}));var xe;(function(a){a.method="window/showMessageRequest",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(xe||(t.ShowMessageRequest=xe={}));var St;(function(a){a.method="window/logMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(St||(t.LogMessageNotification=St={}));var Oe;(function(a){a.method="telemetry/event",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(Oe||(t.TelemetryEventNotification=Oe={}));var J;(function(a){a.None=0,a.Full=1,a.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));var ze;(function(a){a.method="textDocument/didOpen",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(ze||(t.DidOpenTextDocumentNotification=ze={}));var ne;(function(a){function ce(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range!==void 0&&(u.rangeLength===void 0||typeof u.rangeLength=="number")}a.isIncremental=ce;function ae(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range===void 0&&u.rangeLength===void 0}a.isFull=ae})(ne||(t.TextDocumentContentChangeEvent=ne={}));var je;(function(a){a.method="textDocument/didChange",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(je||(t.DidChangeTextDocumentNotification=je={}));var Yt;(function(a){a.method="textDocument/didClose",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Yt||(t.DidCloseTextDocumentNotification=Yt={}));var pn;(function(a){a.method="textDocument/didSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(pn||(t.DidSaveTextDocumentNotification=pn={}));var yn;(function(a){a.Manual=1,a.AfterDelay=2,a.FocusOut=3})(yn||(t.TextDocumentSaveReason=yn={}));var vn;(function(a){a.method="textDocument/willSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(vn||(t.WillSaveTextDocumentNotification=vn={}));var Rn;(function(a){a.method="textDocument/willSaveWaitUntil",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Rn||(t.WillSaveTextDocumentWaitUntilRequest=Rn={}));var Fe;(function(a){a.method="workspace/didChangeWatchedFiles",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Fe||(t.DidChangeWatchedFilesNotification=Fe={}));var Dn;(function(a){a.Created=1,a.Changed=2,a.Deleted=3})(Dn||(t.FileChangeType=Dn={}));var Sr;(function(a){function ce(ae){const E=ae;return r.objectLiteral(E)&&(n.URI.is(E.baseUri)||n.WorkspaceFolder.is(E.baseUri))&&r.string(E.pattern)}a.is=ce})(Sr||(t.RelativePattern=Sr={}));var Cr;(function(a){a.Create=1,a.Change=2,a.Delete=4})(Cr||(t.WatchKind=Cr={}));var qr;(function(a){a.method="textDocument/publishDiagnostics",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(qr||(t.PublishDiagnosticsNotification=qr={}));var Mr;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.TriggerForIncompleteCompletions=3})(Mr||(t.CompletionTriggerKind=Mr={}));var Tn;(function(a){a.method="textDocument/completion",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Tn||(t.CompletionRequest=Tn={}));var Pn;(function(a){a.method="completionItem/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Pn||(t.CompletionResolveRequest=Pn={}));var Ke;(function(a){a.method="textDocument/hover",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ke||(t.HoverRequest=Ke={}));var kn;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.ContentChange=3})(kn||(t.SignatureHelpTriggerKind=kn={}));var Or;(function(a){a.method="textDocument/signatureHelp",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Or||(t.SignatureHelpRequest=Or={}));var Er;(function(a){a.method="textDocument/definition",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Er||(t.DefinitionRequest=Er={}));var Sn;(function(a){a.method="textDocument/references",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Sn||(t.ReferencesRequest=Sn={}));var Cn;(function(a){a.method="textDocument/documentHighlight",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Cn||(t.DocumentHighlightRequest=Cn={}));var Nr;(function(a){a.method="textDocument/documentSymbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Nr||(t.DocumentSymbolRequest=Nr={}));var jr;(function(a){a.method="textDocument/codeAction",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(jr||(t.CodeActionRequest=jr={}));var Fr;(function(a){a.method="codeAction/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Fr||(t.CodeActionResolveRequest=Fr={}));var Ir;(function(a){a.method="workspace/symbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ir||(t.WorkspaceSymbolRequest=Ir={}));var Ar;(function(a){a.method="workspaceSymbol/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ar||(t.WorkspaceSymbolResolveRequest=Ar={}));var Lr;(function(a){a.method="textDocument/codeLens",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Lr||(t.CodeLensRequest=Lr={}));var Ie;(function(a){a.method="codeLens/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ie||(t.CodeLensResolveRequest=Ie={}));var Wr;(function(a){a.method="workspace/codeLens/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(Wr||(t.CodeLensRefreshRequest=Wr={}));var $r;(function(a){a.method="textDocument/documentLink",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})($r||(t.DocumentLinkRequest=$r={}));var Ct;(function(a){a.method="documentLink/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ct||(t.DocumentLinkResolveRequest=Ct={}));var Hr;(function(a){a.method="textDocument/formatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Hr||(t.DocumentFormattingRequest=Hr={}));var Kt;(function(a){a.method="textDocument/rangeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Kt||(t.DocumentRangeFormattingRequest=Kt={}));var xr;(function(a){a.method="textDocument/rangesFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(xr||(t.DocumentRangesFormattingRequest=xr={}));var Ge;(function(a){a.method="textDocument/onTypeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ge||(t.DocumentOnTypeFormattingRequest=Ge={}));var bt;(function(a){a.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var zr;(function(a){a.method="textDocument/rename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(zr||(t.RenameRequest=zr={}));var Br;(function(a){a.method="textDocument/prepareRename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Br||(t.PrepareRenameRequest=Br={}));var ht;(function(a){a.method="workspace/executeCommand",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ht||(t.ExecuteCommandRequest=ht={}));var qn;(function(a){a.method="workspace/applyEdit",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType("workspace/applyEdit")})(qn||(t.ApplyWorkspaceEditRequest=qn={}))}(Xo);var ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.createProtocolConnection=void 0;const cc=wt;function lu(t,e,n,r){return cc.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,cc.createMessageConnection)(t,e,n,r)}ar.createProtocolConnection=lu,function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(wt,t),n(so,t),n(H,t),n(Xo,t);var r=ar;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Vo),function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Bo;n(Bo,t),n(Vo,t);function i(o,c,d,f){return(0,r.createMessageConnection)(o,c,d,f)}t.createProtocolConnection=i}(ie),Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SemanticTokensBuilder=Ue.SemanticTokensDiff=Ue.SemanticTokensFeature=void 0;const ur=ie,fu=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ur.SemanticTokensRefreshRequest.type),on:e=>{const n=ur.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{const n=ur.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{const n=ur.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ue.SemanticTokensFeature=fu;class ac{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){const e=this.originalSequence.length,n=this.modifiedSequence.length;let r=0;for(;r=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i0&&(c-=this._prevLine,c===0&&(d-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=d,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new ac(this._prevData,this._data).computeDiff()}:this.build()}}Ue.SemanticTokensBuilder=gu;var dr={};Object.defineProperty(dr,"__esModule",{value:!0}),dr.InlineCompletionFeature=void 0;const _u=ie,bu=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(_u.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};dr.InlineCompletionFeature=bu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.TextDocuments=void 0;const Rt=ie;class hu{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Rt.Emitter,this._onDidOpen=new Rt.Emitter,this._onDidClose=new Rt.Emitter,this._onDidSave=new Rt.Emitter,this._onWillSave=new Rt.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Rt.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);const c=Object.freeze({document:o});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,o=r.contentChanges;if(o.length===0)return;const{version:c}=i;if(c==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let d=this._syncedDocuments.get(i.uri);d!==void 0&&(d=this._configuration.update(d,o,c),this._syncedDocuments.set(i.uri,d),this._onDidChangeContent.fire(Object.freeze({document:d})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Rt.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}hn.TextDocuments=hu;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NotebookDocuments=Dt.NotebookSyncFeature=void 0;const qe=ie,uc=hn,mu=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(qe.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(qe.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(qe.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(qe.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Dt.NotebookSyncFeature=mu;class Vt{onDidOpenTextDocument(e){return this.openHandler=e,qe.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qe.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qe.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Vt.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Vt.NULL_DISPOSE}onDidSaveTextDocument(){return Vt.NULL_DISPOSE}}Vt.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class wu{constructor(e){e instanceof uc.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new uc.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qe.Emitter,this._onDidChange=new qe.Emitter,this._onDidSave=new qe.Emitter,this._onDidClose=new qe.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){const n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const n=new Vt,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;const c=o.metadata;let d=!1;const f=i.change;f.metadata!==void 0&&(d=!0,o.metadata=f.metadata);const _=[],w=[],k=[],v=[];if(f.cells!==void 0){const $=f.cells;if($.structure!==void 0){const b=$.structure.array;if(o.cells.splice(b.start,b.deleteCount,...b.cells!==void 0?b.cells:[]),$.structure.didOpen!==void 0)for(const h of $.structure.didOpen)n.openTextDocument({textDocument:h}),_.push(h.uri);if($.structure.didClose)for(const h of $.structure.didClose)n.closeTextDocument({textDocument:h}),w.push(h.uri)}if($.data!==void 0){const b=new Map($.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){const T=b.get(o.cells[h].document);if(T!==void 0){const ge=o.cells.splice(h,1,T);if(k.push({old:ge[0],new:T}),b.delete(T.document),b.size===0)break}}}if($.textContent!==void 0)for(const b of $.textContent)n.changeTextDocument({textDocument:b.document,contentChanges:b.changes}),v.push(b.document.uri)}this.updateCellMap(o);const M={notebookDocument:o};d&&(M.metadata={old:c,new:o.metadata});const W=[];for(const $ of _)W.push(this.getNotebookCell($));const be=[];for(const $ of w)be.push(this.getNotebookCell($));const me=[];for(const $ of v)me.push(this.getNotebookCell($));(W.length>0||be.length>0||k.length>0||me.length>0)&&(M.cells={added:W,removed:be,changed:{data:k,textContent:me}}),(M.metadata!==void 0||M.cells!==void 0)&&this._onDidChange.fire(M)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(const c of i.cellTextDocuments)n.closeTextDocument({textDocument:c});this.notebookDocuments.delete(i.notebookDocument.uri);for(const c of o.cells)this.notebookCellMap.delete(c.document)}})),qe.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}Dt.NotebookDocuments=wu;var z={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.thenable=oe.typedArray=oe.stringArray=oe.array=oe.func=oe.error=oe.number=oe.string=oe.boolean=void 0;function pu(t){return t===!0||t===!1}oe.boolean=pu;function dc(t){return typeof t=="string"||t instanceof String}oe.string=dc;function yu(t){return typeof t=="number"||t instanceof Number}oe.number=yu;function vu(t){return t instanceof Error}oe.error=vu;function lc(t){return typeof t=="function"}oe.func=lc;function fc(t){return Array.isArray(t)}oe.array=fc;function Ru(t){return fc(t)&&t.every(e=>dc(e))}oe.stringArray=Ru;function Du(t,e){return Array.isArray(t)&&t.every(e)}oe.typedArray=Du;function Tu(t){return t&&lc(t.then)}oe.thenable=Tu;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.generateUuid=Pe.parse=Pe.isUUID=Pe.v4=Pe.empty=void 0;class uo{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class L extends uo{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return L._oneOf(L._chars)}constructor(){super([L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-","4",L._randomHex(),L._randomHex(),L._randomHex(),"-",L._oneOf(L._timeHighBits),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex()].join(""))}}L._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],L._timeHighBits=["8","9","a","b"],Pe.empty=new uo("00000000-0000-0000-0000-000000000000");function gc(){return new L}Pe.v4=gc;const Pu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _c(t){return Pu.test(t)}Pe.isUUID=_c;function ku(t){if(!_c(t))throw new Error("invalid uuid");return new uo(t)}Pe.parse=ku;function Su(){return gc().asHex()}Pe.generateUuid=Su;var at={};Object.defineProperty(at,"__esModule",{value:!0}),at.attachPartialResult=at.ProgressFeature=at.attachWorkDone=void 0;const ut=ie,Cu=Pe;class dt{constructor(e,n){this._connection=e,this._token=n,dt.Instances.set(this._token,this)}begin(e,n,r,i){let o={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,o)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,r)}done(){dt.Instances.delete(this._token),this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,{kind:"end"})}}dt.Instances=new Map;class bc extends dt{constructor(e,n){super(e,n),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class lo{constructor(){}begin(){}report(){}done(){}}class hc extends lo{constructor(){super(),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function qu(t,e){if(e===void 0||e.workDoneToken===void 0)return new lo;const n=e.workDoneToken;return delete e.workDoneToken,new dt(t,n)}at.attachWorkDone=qu;const Mu=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ut.WorkDoneProgressCancelNotification.type,n=>{let r=dt.Instances.get(n.token);(r instanceof bc||r instanceof hc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new lo:new dt(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Cu.generateUuid)();return this.connection.sendRequest(ut.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bc(this.connection,e))}else return Promise.resolve(new hc)}};at.ProgressFeature=Mu;var fo;(function(t){t.type=new ut.ProgressType})(fo||(fo={}));class Ou{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(fo.type,this._token,e)}}function Eu(t,e){if(e===void 0||e.partialResultToken===void 0)return;const n=e.partialResultToken;return delete e.partialResultToken,new Ou(t,n)}at.attachPartialResult=Eu;var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.ConfigurationFeature=void 0;const Nu=ie,ju=oe,Fu=t=>class extends t{getConfiguration(e){return e?ju.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Nu.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};lr.ConfigurationFeature=Fu;var fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.WorkspaceFoldersFeature=void 0;const gr=ie,Iu=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new gr.Emitter,this.connection.onNotification(gr.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);const n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(gr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(gr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};fr.WorkspaceFoldersFeature=Iu;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.CallHierarchyFeature=void 0;const go=ie,Au=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(go.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{const n=go.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{const n=go.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};_r.CallHierarchyFeature=Au;var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.ShowDocumentFeature=void 0;const Lu=ie,Wu=t=>class extends t{showDocument(e){return this.connection.sendRequest(Lu.ShowDocumentRequest.type,e)}};br.ShowDocumentFeature=Wu;var hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.FileOperationsFeature=void 0;const Ut=ie,$u=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ut.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ut.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ut.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ut.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ut.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ut.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};hr.FileOperationsFeature=$u;var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.LinkedEditingRangeFeature=void 0;const Hu=ie,xu=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Hu.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};mr.LinkedEditingRangeFeature=xu;var wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.TypeHierarchyFeature=void 0;const _o=ie,zu=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(_o.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{const n=_o.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{const n=_o.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wr.TypeHierarchyFeature=zu;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.InlineValueFeature=void 0;const mc=ie,Bu=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(mc.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(mc.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};pr.InlineValueFeature=Bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.FoldingRangeFeature=void 0;const wc=ie,Vu=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(wc.FoldingRangeRefreshRequest.type),on:e=>{const n=wc.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};yr.FoldingRangeFeature=Vu;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.InlayHintFeature=void 0;const bo=ie,Uu=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(bo.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(bo.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(bo.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};vr.InlayHintFeature=Uu;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.DiagnosticFeature=void 0;const mn=ie,Ju=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(mn.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(mn.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(mn.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.WorkspaceDiagnosticRequest.partialResult,n)))}}};Rr.DiagnosticFeature=Ju;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.MonikerFeature=void 0;const Xu=ie,Qu=t=>class extends t{get moniker(){return{on:e=>{const n=Xu.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Dr.MonikerFeature=Qu,Object.defineProperty(z,"__esModule",{value:!0}),z.createConnection=z.combineFeatures=z.combineNotebooksFeatures=z.combineLanguagesFeatures=z.combineWorkspaceFeatures=z.combineWindowFeatures=z.combineClientFeatures=z.combineTracerFeatures=z.combineTelemetryFeatures=z.combineConsoleFeatures=z._NotebooksImpl=z._LanguagesImpl=z.BulkUnregistration=z.BulkRegistration=z.ErrorMessageTracker=void 0;const D=ie,Me=oe,ho=Pe,N=at,Yu=lr,Ku=fr,Gu=_r,Zu=Ue,ed=br,td=hr,nd=mr,rd=wr,id=pr,od=yr,sd=vr,cd=Rr,ad=Dt,ud=Dr;function mo(t){if(t!==null)return t}class dd{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}}z.ErrorMessageTracker=dd;class pc{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(D.MessageType.Error,e)}warn(e){this.send(D.MessageType.Warning,e)}info(e){this.send(D.MessageType.Info,e)}log(e){this.send(D.MessageType.Log,e)}debug(e){this.send(D.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(D.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,D.RAL)().console.error("Sending log message failed")})}}class ld{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:D.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showWarningMessage(e,...n){let r={type:D.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showInformationMessage(e,...n){let r={type:D.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}}const yc=(0,ed.ShowDocumentFeature)((0,N.ProgressFeature)(ld));var vc;(function(t){function e(){return new Rc}t.create=e})(vc||(z.BulkRegistration=vc={}));class Rc{constructor(){this._registrations=[],this._registered=new Set}add(e,n){const r=Me.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);const i=ho.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}}var Dc;(function(t){function e(){return new wo(void 0,[])}t.create=e})(Dc||(z.BulkUnregistration=Dc={}));class wo{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(D.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){const n=Me.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(D.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}}class Tc{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Rc?this.registerMany(e):e instanceof wo?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){const i=Me.string(n)?n:n.method,o=ho.generateUuid();let c={registrations:[{id:o,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(D.RegistrationRequest.type,c).then(d=>(e.add({id:o,method:i}),e),d=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(d)))}registerSingle2(e,n){const r=Me.string(e)?e:e.method,i=ho.generateUuid();let o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(D.RegistrationRequest.type,o).then(c=>D.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(c)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(D.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(D.RegistrationRequest.type,n).then(()=>new wo(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}}class fd{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(D.ApplyWorkspaceEditRequest.type,r)}}const Pc=(0,td.FileOperationsFeature)((0,Ku.WorkspaceFoldersFeature)((0,Yu.ConfigurationFeature)(fd)));class kc{constructor(){this._trace=D.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==D.Trace.Off&&this.connection.sendNotification(D.LogTraceNotification.type,{message:e,verbose:this._trace===D.Trace.Verbose?n:void 0}).catch(()=>{})}}class Sc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(D.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class Cc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._LanguagesImpl=Cc;const qc=(0,od.FoldingRangeFeature)((0,ud.MonikerFeature)((0,cd.DiagnosticFeature)((0,sd.InlayHintFeature)((0,id.InlineValueFeature)((0,rd.TypeHierarchyFeature)((0,nd.LinkedEditingRangeFeature)((0,Zu.SemanticTokensFeature)((0,Gu.CallHierarchyFeature)(Cc)))))))));class Mc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._NotebooksImpl=Mc;const Oc=(0,ad.NotebookSyncFeature)(Mc);function Ec(t,e){return function(n){return e(t(n))}}z.combineConsoleFeatures=Ec;function Nc(t,e){return function(n){return e(t(n))}}z.combineTelemetryFeatures=Nc;function jc(t,e){return function(n){return e(t(n))}}z.combineTracerFeatures=jc;function Fc(t,e){return function(n){return e(t(n))}}z.combineClientFeatures=Fc;function Ic(t,e){return function(n){return e(t(n))}}z.combineWindowFeatures=Ic;function Ac(t,e){return function(n){return e(t(n))}}z.combineWorkspaceFeatures=Ac;function Lc(t,e){return function(n){return e(t(n))}}z.combineLanguagesFeatures=Lc;function Wc(t,e){return function(n){return e(t(n))}}z.combineNotebooksFeatures=Wc;function gd(t,e){function n(i,o,c){return i&&o?c(i,o):i||o}return{__brand:"features",console:n(t.console,e.console,Ec),tracer:n(t.tracer,e.tracer,jc),telemetry:n(t.telemetry,e.telemetry,Nc),client:n(t.client,e.client,Fc),window:n(t.window,e.window,Ic),workspace:n(t.workspace,e.workspace,Ac),languages:n(t.languages,e.languages,Lc),notebooks:n(t.notebooks,e.notebooks,Wc)}}z.combineFeatures=gd;function _d(t,e,n){const r=n&&n.console?new(n.console(pc)):new pc,i=t(r);r.rawAttach(i);const o=n&&n.tracer?new(n.tracer(kc)):new kc,c=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,d=n&&n.client?new(n.client(Tc)):new Tc,f=n&&n.window?new(n.window(yc)):new yc,_=n&&n.workspace?new(n.workspace(Pc)):new Pc,w=n&&n.languages?new(n.languages(qc)):new qc,k=n&&n.notebooks?new(n.notebooks(Oc)):new Oc,v=[r,o,c,d,f,_,w,k];function M(b){return b instanceof Promise?b:Me.thenable(b)?new Promise((h,T)=>{b.then(ge=>h(ge),ge=>T(ge))}):Promise.resolve(b)}let W,be,me,$={listen:()=>i.listen(),sendRequest:(b,...h)=>i.sendRequest(Me.string(b)?b:b.method,...h),onRequest:(b,h)=>i.onRequest(b,h),sendNotification:(b,h)=>{const T=Me.string(b)?b:b.method;return i.sendNotification(T,h)},onNotification:(b,h)=>i.onNotification(b,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:b=>(be=b,{dispose:()=>{be=void 0}}),onInitialized:b=>i.onNotification(D.InitializedNotification.type,b),onShutdown:b=>(W=b,{dispose:()=>{W=void 0}}),onExit:b=>(me=b,{dispose:()=>{me=void 0}}),get console(){return r},get telemetry(){return c},get tracer(){return o},get client(){return d},get window(){return f},get workspace(){return _},get languages(){return w},get notebooks(){return k},onDidChangeConfiguration:b=>i.onNotification(D.DidChangeConfigurationNotification.type,b),onDidChangeWatchedFiles:b=>i.onNotification(D.DidChangeWatchedFilesNotification.type,b),__textDocumentSync:void 0,onDidOpenTextDocument:b=>i.onNotification(D.DidOpenTextDocumentNotification.type,b),onDidChangeTextDocument:b=>i.onNotification(D.DidChangeTextDocumentNotification.type,b),onDidCloseTextDocument:b=>i.onNotification(D.DidCloseTextDocumentNotification.type,b),onWillSaveTextDocument:b=>i.onNotification(D.WillSaveTextDocumentNotification.type,b),onWillSaveTextDocumentWaitUntil:b=>i.onRequest(D.WillSaveTextDocumentWaitUntilRequest.type,b),onDidSaveTextDocument:b=>i.onNotification(D.DidSaveTextDocumentNotification.type,b),sendDiagnostics:b=>i.sendNotification(D.PublishDiagnosticsNotification.type,b),onHover:b=>i.onRequest(D.HoverRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onCompletion:b=>i.onRequest(D.CompletionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCompletionResolve:b=>i.onRequest(D.CompletionResolveRequest.type,b),onSignatureHelp:b=>i.onRequest(D.SignatureHelpRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDeclaration:b=>i.onRequest(D.DeclarationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDefinition:b=>i.onRequest(D.DefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onTypeDefinition:b=>i.onRequest(D.TypeDefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onImplementation:b=>i.onRequest(D.ImplementationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onReferences:b=>i.onRequest(D.ReferencesRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentHighlight:b=>i.onRequest(D.DocumentHighlightRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentSymbol:b=>i.onRequest(D.DocumentSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbol:b=>i.onRequest(D.WorkspaceSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:b=>i.onRequest(D.WorkspaceSymbolResolveRequest.type,b),onCodeAction:b=>i.onRequest(D.CodeActionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeActionResolve:b=>i.onRequest(D.CodeActionResolveRequest.type,(h,T)=>b(h,T)),onCodeLens:b=>i.onRequest(D.CodeLensRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeLensResolve:b=>i.onRequest(D.CodeLensResolveRequest.type,(h,T)=>b(h,T)),onDocumentFormatting:b=>i.onRequest(D.DocumentFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:b=>i.onRequest(D.DocumentRangeFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:b=>i.onRequest(D.DocumentOnTypeFormattingRequest.type,(h,T)=>b(h,T)),onRenameRequest:b=>i.onRequest(D.RenameRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onPrepareRename:b=>i.onRequest(D.PrepareRenameRequest.type,(h,T)=>b(h,T)),onDocumentLinks:b=>i.onRequest(D.DocumentLinkRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentLinkResolve:b=>i.onRequest(D.DocumentLinkResolveRequest.type,(h,T)=>b(h,T)),onDocumentColor:b=>i.onRequest(D.DocumentColorRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onColorPresentation:b=>i.onRequest(D.ColorPresentationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onFoldingRanges:b=>i.onRequest(D.FoldingRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onSelectionRanges:b=>i.onRequest(D.SelectionRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onExecuteCommand:b=>i.onRequest(D.ExecuteCommandRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let b of v)b.attach($);return i.onRequest(D.InitializeRequest.type,b=>{e.initialize(b),Me.string(b.trace)&&(o.trace=D.Trace.fromString(b.trace));for(let h of v)h.initialize(b.capabilities);if(be){let h=be(b,new D.CancellationTokenSource().token,(0,N.attachWorkDone)(i,b),void 0);return M(h).then(T=>{if(T instanceof D.ResponseError)return T;let ge=T;ge||(ge={capabilities:{}});let se=ge.capabilities;se||(se={},ge.capabilities=se),se.textDocumentSync===void 0||se.textDocumentSync===null?se.textDocumentSync=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None:!Me.number(se.textDocumentSync)&&!Me.number(se.textDocumentSync.change)&&(se.textDocumentSync.change=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None);for(let we of v)we.fillServerCapabilities(se);return ge})}else{let h={capabilities:{textDocumentSync:D.TextDocumentSyncKind.None}};for(let T of v)T.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(D.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,W)return W(new D.CancellationTokenSource().token)}),i.onNotification(D.ExitNotification.type,()=>{try{me&&me()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(D.SetTraceNotification.type,b=>{o.trace=D.Trace.fromString(b.value)}),$}z.createConnection=_d,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,k){k===void 0&&(k=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,k,v)}:function(f,_,w,k){k===void 0&&(k=w),f[k]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Ue;Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=dr;n(ie,t);const o=hn;Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const c=Dt;Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),n(z,t);var d;(function(f){f.all={__brand:"features",languages:i.InlineCompletionFeature}})(d||(t.ProposedFeatures=d={}))}(Xr);var bd=ie;(function(t){var e=de&&de.__createBinding||(Object.create?function(d,f,_,w){w===void 0&&(w=_);var k=Object.getOwnPropertyDescriptor(f,_);(!k||("get"in k?!f.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(d,w,k)}:function(d,f,_,w){w===void 0&&(w=_),d[w]=f[_]}),n=de&&de.__exportStar||function(d,f){for(var _ in d)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&e(f,d,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=void 0;const r=Xr;n(bd,t),n(Xr,t);let i=!1;const o={initialize:d=>{},get shutdownReceived(){return i},set shutdownReceived(d){i=d},exit:d=>{}};function c(d,f,_,w){let k,v,M,W;d!==void 0&&d.__brand==="features"&&(k=d,d=f,f=_,_=w),r.ConnectionStrategy.is(d)||r.ConnectionOptions.is(d)?W=d:(v=d,M=f,W=_);const be=me=>(0,r.createProtocolConnection)(v,M,me,W);return(0,r.createConnection)(be,o,k)}t.createConnection=c})(ko);var po=ko;Po({}).then(()=>{const t=new po.BrowserMessageReader(self),e=new po.BrowserMessageWriter(self);let n;const r=po.createConnection(t,e);function i(d,f){return r.sendNotification(d,f),!0}async function o(d,f){return await r.sendRequest(d,f)}async function c(d){return await r.sendRequest("slint/load_file",d)}r.onInitialize(d=>(n=xc(d,i,o,c),n.server_initialize_result(d.capabilities))),r.onRequest(async(d,f,_)=>await n.handle_request(_,d,f)),r.onNotification("slint/preview_to_lsp",async d=>{await n.process_preview_to_lsp_message(d)}),r.onDidChangeTextDocument(async d=>{await n.reload_document(d.contentChanges[d.contentChanges.length-1].text,d.textDocument.uri,d.textDocument.version)}),r.onDidOpenTextDocument(async d=>{await n.reload_document(d.textDocument.text,d.textDocument.uri,d.textDocument.version)}),r.onDidChangeConfiguration(async d=>{await n.reload_config()}),r.listen(),self.postMessage("OK")})})(); diff --git a/snapshots/master/editor/assets/monaco_worker-CFgjIjpz.js b/snapshots/master/editor/assets/monaco_worker-CFgjIjpz.js new file mode 100644 index 000000000..c7d4f2bda --- /dev/null +++ b/snapshots/master/editor/assets/monaco_worker-CFgjIjpz.js @@ -0,0 +1,29 @@ +(function(){"use strict";class Br{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ye.isErrorNoTelemetry(t)?new Ye(t.message+` + +`+t.stack):new Error(t.message+` + +`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(n=>{n(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const Pr=new Br;function It(e){yr(e)||Pr.onUnexpectedError(e)}function Zn(e){if(e instanceof Error){const{name:t,message:n}=e,i=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:i,noTelemetry:Ye.isErrorNoTelemetry(e)}}return e}const cn="Canceled";function yr(e){return e instanceof Or?!0:e instanceof Error&&e.name===cn&&e.message===cn}class Or extends Error{constructor(){super(cn),this.name=this.message}}class Ye extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Ye)return t;const n=new Ye;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}}class ce extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,ce.prototype)}}function Vr(e,t){const n=this;let i=!1,s;return function(){return i||(i=!0,s=e.apply(n,arguments)),s}}function Qe(e,t){const n=gt(e,t);return n===-1?void 0:e[n]}function gt(e,t,n=0,i=e.length){let s=n,r=i;for(;si===s){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let i=0,s=e.length;i0}e.isGreaterThan=i;function s(r){return r===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(hn||(hn={}));function _t(e,t){return(n,i)=>t(e(n),e(i))}const bt=(e,t)=>e-t;function jr(e){return(t,n)=>-e(t,n)}const ot=class ot{constructor(t){this.iterate=t}forEach(t){this.iterate(n=>(t(n),!0))}toArray(){const t=[];return this.iterate(n=>(t.push(n),!0)),t}filter(t){return new ot(n=>this.iterate(i=>t(i)?n(i):!0))}map(t){return new ot(n=>this.iterate(i=>n(t(i))))}some(t){let n=!1;return this.iterate(i=>(n=t(i),!n)),n}findFirst(t){let n;return this.iterate(i=>t(i)?(n=i,!1):!0),n}findLast(t){let n;return this.iterate(i=>(t(i)&&(n=i),!0)),n}findLastMaxBy(t){let n,i=!0;return this.iterate(s=>((i||hn.isGreaterThan(t(s,n)))&&(i=!1,n=s),!0)),n}};ot.empty=new ot(t=>{});let Jn=ot;function Xr(e,t){const n=Object.create(null);for(const i of e){const s=t(i);let r=n[s];r||(r=n[s]=[]),r.push(i)}return n}var Kn,Cn;class Yr{constructor(t,n){this.uri=t,this.value=n}}function Qr(e){return Array.isArray(e)}const ze=class ze{constructor(t,n){if(this[Kn]="ResourceMap",t instanceof ze)this.map=new Map(t.map),this.toKey=n??ze.defaultToKey;else if(Qr(t)){this.map=new Map,this.toKey=n??ze.defaultToKey;for(const[i,s]of t)this.set(i,s)}else this.map=new Map,this.toKey=t??ze.defaultToKey}set(t,n){return this.map.set(this.toKey(t),new Yr(t,n)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,n){typeof n<"u"&&(t=t.bind(n));for(const[i,s]of this.map)t(s.value,s.uri,this)}*values(){for(const t of this.map.values())yield t.value}*keys(){for(const t of this.map.values())yield t.uri}*entries(){for(const t of this.map.values())yield[t.uri,t.value]}*[(Kn=Symbol.toStringTag,Symbol.iterator)](){for(const[,t]of this.map)yield[t.uri,t.value]}};ze.defaultToKey=t=>t.toString();let ei=ze;var ae;(function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"})(ae||(ae={}));class Zr{constructor(){this[Cn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,n=ae.None){const i=this._map.get(t);if(i)return n!==ae.None&&this.touch(i,n),i.value}set(t,n,i=ae.None){let s=this._map.get(t);if(s)s.value=n,i!==ae.None&&this.touch(s,i);else{switch(s={key:t,value:n,next:void 0,previous:void 0},i){case ae.None:this.addItemLast(s);break;case ae.AsOld:this.addItemFirst(s);break;case ae.AsNew:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(t,s),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){const n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){const i=this._state;let s=this._head;for(;s;){if(n?t.bind(n)(s.value,s.key,this):t(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.key,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}values(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.value,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}entries(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:[i.key,i.value],done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}[(Cn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,i=this.size;for(;n&&i>t;)this._map.delete(n.key),n=n.next,i--;this._head=n,this._size=i,n&&(n.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._tail,i=this.size;for(;n&&i>t;)this._map.delete(n.key),n=n.previous,i--;this._tail=n,this._size=i,n&&(n.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{const n=t.next,i=t.previous;if(!n||!i)throw new Error("Invalid list");n.previous=i,i.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ae.AsOld&&n!==ae.AsNew)){if(n===ae.AsOld){if(t===this._head)return;const i=t.next,s=t.previous;t===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===ae.AsNew){if(t===this._tail)return;const i=t.next,s=t.previous;t===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){const t=[];return this.forEach((n,i)=>{t.push([i,n])}),t}fromJSON(t){this.clear();for(const[n,i]of t)this.set(n,i)}}class Jr extends Zr{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=ae.AsNew){return super.get(t,n)}peek(t){return super.get(t,ae.None)}set(t,n){return super.set(t,n,ae.AsNew),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class Kr extends Jr{constructor(t,n=1){super(t,n)}trim(t){this.trimOld(t)}set(t,n){return super.set(t,n),this.checkTrim(),this}}class ti{constructor(){this.map=new Map}add(t,n){let i=this.map.get(t);i||(i=new Set,this.map.set(t,i)),i.add(n)}delete(t,n){const i=this.map.get(t);i&&(i.delete(n),i.size===0&&this.map.delete(t))}forEach(t,n){const i=this.map.get(t);i&&i.forEach(n)}get(t){const n=this.map.get(t);return n||new Set}}var Bt;(function(e){function t(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}e.is=t;const n=Object.freeze([]);function i(){return n}e.empty=i;function*s(p){yield p}e.single=s;function r(p){return t(p)?p:s(p)}e.wrap=r;function a(p){return p||n}e.from=a;function*u(p){for(let w=p.length-1;w>=0;w--)yield p[w]}e.reverse=u;function o(p){return!p||p[Symbol.iterator]().next().done===!0}e.isEmpty=o;function c(p){return p[Symbol.iterator]().next().value}e.first=c;function h(p,w){let D=0;for(const T of p)if(w(T,D++))return!0;return!1}e.some=h;function f(p,w){for(const D of p)if(w(D))return D}e.find=f;function*_(p,w){for(const D of p)w(D)&&(yield D)}e.filter=_;function*b(p,w){let D=0;for(const T of p)yield w(T,D++)}e.map=b;function*L(p,w){let D=0;for(const T of p)yield*w(T,D++)}e.flatMap=L;function*N(...p){for(const w of p)yield*w}e.concat=N;function A(p,w,D){let T=D;for(const I of p)T=w(T,I);return T}e.reduce=A;function*x(p,w,D=p.length){for(w<0&&(w+=p.length),D<0?D+=p.length:D>p.length&&(D=p.length);wi.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,n){let i;if(n)i=n;else{const o=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,o).isSingleton);if(c.length===0)return;const h=new Set(c.map(f=>f.value));if(i=c.filter(f=>!(f.parent&&h.has(f.parent))),i.length===0)throw new Error("There are cyclic diposable chains!")}if(!i)return;function s(o){function c(f,_){for(;f.length>0&&_.some(b=>typeof b=="string"?b===f[0]:f[0].match(b));)f.shift()}const h=o.source.split(` +`).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}const r=new ti;for(const o of i){const c=s(o);for(let h=0;h<=c.length;h++)r.add(c.slice(0,h).join(` +`),o)}i.sort(_t(o=>o.idx,bt));let a="",u=0;for(const o of i.slice(0,t)){u++;const c=s(o),h=[];for(let f=0;fs(A)[f]),A=>A);delete N[c[f]];for(const[A,x]of Object.entries(N))h.unshift(` - stacktraces of ${x.length} other leaks continue with ${A}`);h.unshift(_)}a+=` + + +==================== Leaking disposable ${u}/${i.length}: ${o.value.constructor.name} ==================== +${h.join(` +`)} +============================================================ + +`}return i.length>t&&(a+=` + + +... and ${i.length-t} more leaking disposables + +`),{leaks:i,details:a}}};tn.idx=0;let ni=tn;function _a(e){return e}function ba(e,t){}function ii(e){if(Bt.is(e)){const t=[];for(const n of e)if(n)try{n.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Cr(...e){return Pt(()=>ii(e))}function Pt(e){return{dispose:Vr(()=>{e()})}}const nn=class nn{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ii(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?nn.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&this._toDispose.delete(t)}};nn.DISABLE_DISPOSED_WARNING=!1;let dt=nn;const Qn=class Qn{constructor(){this._store=new dt,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Qn.None=Object.freeze({dispose(){}});let Ze=Qn;const ct=class ct{constructor(t){this.element=t,this.next=ct.Undefined,this.prev=ct.Undefined}};ct.Undefined=new ct(void 0);let J=ct;class el{constructor(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===J.Undefined}clear(){let t=this._first;for(;t!==J.Undefined;){const n=t.next;t.prev=J.Undefined,t.next=J.Undefined,t=n}this._first=J.Undefined,this._last=J.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,n){const i=new J(t);if(this._first===J.Undefined)this._first=i,this._last=i;else if(n){const r=this._last;this._last=i,i.prev=r,r.next=i}else{const r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==J.Undefined){const t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==J.Undefined){const t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==J.Undefined&&t.next!==J.Undefined){const n=t.prev;n.next=t.next,t.next.prev=n}else t.prev===J.Undefined&&t.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):t.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):t.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==J.Undefined;)yield t.element,t=t.next}}const tl=globalThis.performance&&typeof globalThis.performance.now=="function";class yt{static create(t){return new yt(t)}constructor(t){this._now=tl&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var mn;(function(e){e.None=()=>Ze.None;function t(E,v){return f(E,()=>{},0,void 0,!0,void 0,v)}e.defer=t;function n(E){return(v,S=null,M)=>{let O=!1,q;return q=E(X=>{if(!O)return q?q.dispose():O=!0,v.call(S,X)},null,M),O&&q.dispose(),q}}e.once=n;function i(E,v,S){return c((M,O=null,q)=>E(X=>M.call(O,v(X)),null,q),S)}e.map=i;function s(E,v,S){return c((M,O=null,q)=>E(X=>{v(X),M.call(O,X)},null,q),S)}e.forEach=s;function r(E,v,S){return c((M,O=null,q)=>E(X=>v(X)&&M.call(O,X),null,q),S)}e.filter=r;function a(E){return E}e.signal=a;function u(...E){return(v,S=null,M)=>{const O=Cr(...E.map(q=>q(X=>v.call(S,X))));return h(O,M)}}e.any=u;function o(E,v,S,M){let O=S;return i(E,q=>(O=v(O,q),O),M)}e.reduce=o;function c(E,v){let S;const M={onWillAddFirstListener(){S=E(O.fire,O)},onDidRemoveLastListener(){S?.dispose()}},O=new Ee(M);return v?.add(O),O.event}function h(E,v){return v instanceof Array?v.push(E):v&&v.add(E),E}function f(E,v,S=100,M=!1,O=!1,q,X){let le,oe,mt,un=0,kt;const ha={leakWarningThreshold:q,onWillAddFirstListener(){le=E(ma=>{un++,oe=v(oe,ma),M&&!mt&&(on.fire(oe),oe=void 0),kt=()=>{const ga=oe;oe=void 0,mt=void 0,(!M||un>1)&&on.fire(ga),un=0},typeof S=="number"?(clearTimeout(mt),mt=setTimeout(kt,S)):mt===void 0&&(mt=0,queueMicrotask(kt))})},onWillRemoveListener(){O&&un>0&&kt?.()},onDidRemoveLastListener(){kt=void 0,le.dispose()}},on=new Ee(ha);return X?.add(on),on.event}e.debounce=f;function _(E,v=0,S){return e.debounce(E,(M,O)=>M?(M.push(O),M):[O],v,void 0,!0,void 0,S)}e.accumulate=_;function b(E,v=(M,O)=>M===O,S){let M=!0,O;return r(E,q=>{const X=M||!v(q,O);return M=!1,O=q,X},S)}e.latch=b;function L(E,v,S){return[e.filter(E,v,S),e.filter(E,M=>!v(M),S)]}e.split=L;function N(E,v=!1,S=[],M){let O=S.slice(),q=E(oe=>{O?O.push(oe):le.fire(oe)});M&&M.add(q);const X=()=>{O?.forEach(oe=>le.fire(oe)),O=null},le=new Ee({onWillAddFirstListener(){q||(q=E(oe=>le.fire(oe)),M&&M.add(q))},onDidAddFirstListener(){O&&(v?setTimeout(X):X())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return M&&M.add(le),le.event}e.buffer=N;function A(E,v){return(M,O,q)=>{const X=v(new R);return E(function(le){const oe=X.evaluate(le);oe!==x&&M.call(O,oe)},void 0,q)}}e.chain=A;const x=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(v){return this.steps.push(v),this}forEach(v){return this.steps.push(S=>(v(S),S)),this}filter(v){return this.steps.push(S=>v(S)?S:x),this}reduce(v,S){let M=S;return this.steps.push(O=>(M=v(M,O),M)),this}latch(v=(S,M)=>S===M){let S=!0,M;return this.steps.push(O=>{const q=S||!v(O,M);return S=!1,M=O,q?O:x}),this}evaluate(v){for(const S of this.steps)if(v=S(v),v===x)break;return v}}function U(E,v,S=M=>M){const M=(...le)=>X.fire(S(...le)),O=()=>E.on(v,M),q=()=>E.removeListener(v,M),X=new Ee({onWillAddFirstListener:O,onDidRemoveLastListener:q});return X.event}e.fromNodeEventEmitter=U;function p(E,v,S=M=>M){const M=(...le)=>X.fire(S(...le)),O=()=>E.addEventListener(v,M),q=()=>E.removeEventListener(v,M),X=new Ee({onWillAddFirstListener:O,onDidRemoveLastListener:q});return X.event}e.fromDOMEventEmitter=p;function w(E){return new Promise(v=>n(E)(v))}e.toPromise=w;function D(E){const v=new Ee;return E.then(S=>{v.fire(S)},()=>{v.fire(void 0)}).finally(()=>{v.dispose()}),v.event}e.fromPromise=D;function T(E,v){return E(S=>v.fire(S))}e.forward=T;function I(E,v,S){return v(S),E(M=>v(M))}e.runAndSubscribe=I;class ${constructor(v,S){this._observable=v,this._counter=0,this._hasChanged=!1;const M={onWillAddFirstListener:()=>{v.addObserver(this)},onDidRemoveLastListener:()=>{v.removeObserver(this)}};this.emitter=new Ee(M),S&&S.add(this.emitter)}beginUpdate(v){this._counter++}handlePossibleChange(v){}handleChange(v,S){this._hasChanged=!0}endUpdate(v){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ie(E,v){return new $(E,v).emitter.event}e.fromObservable=ie;function z(E){return(v,S,M)=>{let O=0,q=!1;const X={beginUpdate(){O++},endUpdate(){O--,O===0&&(E.reportChanges(),q&&(q=!1,v.call(S)))},handlePossibleChange(){},handleChange(){q=!0}};E.addObserver(X),E.reportChanges();const le={dispose(){E.removeObserver(X)}};return M instanceof dt?M.add(le):Array.isArray(M)&&M.push(le),le}}e.fromObservableLight=z})(mn||(mn={}));const ft=class ft{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${ft._idPool++}`,ft.all.add(this)}start(t){this._stopWatch=new yt,this.listenerCount=t}stop(){if(this._stopWatch){const t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};ft.all=new Set,ft._idPool=0;let gn=ft,nl=-1;const sn=class sn{constructor(t,n,i=(sn._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,n){const i=this.threshold;if(i<=0||n{const r=this._stacks.get(t.value)||0;this._stacks.set(t.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(const[i,s]of this._stacks)(!t||n{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);const o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new sl(`${u}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||It)(c),Ze.None}if(this._disposed)return Ze.None;n&&(t=t.bind(n));const s=new dn(t);let r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=bn.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof dn?(this._deliveryQueue??=new al,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;const a=Pt(()=>{r?.(),this._removeListener(s)});return i instanceof dt?i.add(a):Array.isArray(i)&&i.push(a),a},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,i=n.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*ll<=n.length){let r=0;for(let a=0;a0}}class al{constructor(){this.i=-1,this.end=0}enqueue(t,n,i){this.i=0,this.end=i,this.current=t,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function ul(e){return typeof e=="string"}function ol(e){let t=[];for(;Object.prototype!==e;)t=t.concat(Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return t}function Ln(e){const t=[];for(const n of ol(e))typeof e[n]=="function"&&t.push(n);return t}function cl(e,t){const n=s=>function(){const r=Array.prototype.slice.call(arguments,0);return t(s,r)},i={};for(const s of e)i[s]=n(s);return i}const Je="en";let Lt=!1,Nt=!1,Ot=!1,si=!1,Vt,Ht=Je,ri=Je,fl,De;const We=globalThis;let me;typeof We.vscode<"u"&&typeof We.vscode.process<"u"?me=We.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(me=process);const hl=typeof me?.versions?.electron=="string"&&me?.type==="renderer";if(typeof me=="object"){Lt=me.platform==="win32",Nt=me.platform==="darwin",Ot=me.platform==="linux",Ot&&me.env.SNAP&&me.env.SNAP_REVISION,me.env.CI||me.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Vt=Je,Ht=Je;const e=me.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e);Vt=t.userLocale,ri=t.osLocale,Ht=t.resolvedLanguage||Je,fl=t.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!hl?(De=navigator.userAgent,Lt=De.indexOf("Windows")>=0,Nt=De.indexOf("Macintosh")>=0,si=(De.indexOf("Macintosh")>=0||De.indexOf("iPad")>=0||De.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ot=De.indexOf("Linux")>=0,De?.indexOf("Mobi")>=0,Ht=globalThis._VSCODE_NLS_LANGUAGE||Je,Vt=navigator.language.toLowerCase(),ri=Vt):console.error("Unable to resolve platform.");var Ke;(function(e){e[e.Web=0]="Web",e[e.Mac=1]="Mac",e[e.Linux=2]="Linux",e[e.Windows=3]="Windows"})(Ke||(Ke={})),Ke.Web,Nt?Ke.Mac:Lt?Ke.Windows:Ot&&Ke.Linux;const pt=Lt,ml=Nt,Re=De,Ie=Ht;var li;(function(e){function t(){return Ie}e.value=t;function n(){return Ie.length===2?Ie==="en":Ie.length>=3?Ie[0]==="e"&&Ie[1]==="n"&&Ie[2]==="-":!1}e.isDefaultVariant=n;function i(){return Ie==="en"}e.isDefault=i})(li||(li={}));const gl=typeof We.postMessage=="function"&&!We.importScripts;(()=>{if(gl){const e=[];We.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i{const i=++t;e.push({id:i,callback:n}),We.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var wt;(function(e){e[e.Windows=1]="Windows",e[e.Macintosh=2]="Macintosh",e[e.Linux=3]="Linux"})(wt||(wt={})),Nt||si?wt.Macintosh:Lt?wt.Windows:wt.Linux;const _l=!!(Re&&Re.indexOf("Chrome")>=0);Re&&Re.indexOf("Firefox")>=0,!_l&&Re&&Re.indexOf("Safari")>=0,Re&&Re.indexOf("Edg/")>=0,Re&&Re.indexOf("Android")>=0;const ai=Object.freeze(function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var qt;(function(e){function t(n){return n===e.None||n===e.Cancelled||n instanceof Wt?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:mn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ai})})(qt||(qt={}));class Wt{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ai:(this._emitter||(this._emitter=new Ee),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class bl{constructor(t){this._token=void 0,this._parentListener=void 0,this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Wt),this._token}cancel(){this._token?this._token instanceof Wt&&this._token.cancel():this._token=qt.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Wt&&this._token.dispose():this._token=qt.None}}function dl(e){return e}class Ll{constructor(t,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof t=="function"?(this._fn=t,this._computeKey=dl):(this._fn=n,this._computeKey=t.getCacheKey)}get(t){const n=this._computeKey(t);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(t)),this.lastCache}}var d;(function(e){e[e.Null=0]="Null",e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.LineFeed=10]="LineFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.DoubleQuote=34]="DoubleQuote",e[e.Hash=35]="Hash",e[e.DollarSign=36]="DollarSign",e[e.PercentSign=37]="PercentSign",e[e.Ampersand=38]="Ampersand",e[e.SingleQuote=39]="SingleQuote",e[e.OpenParen=40]="OpenParen",e[e.CloseParen=41]="CloseParen",e[e.Asterisk=42]="Asterisk",e[e.Plus=43]="Plus",e[e.Comma=44]="Comma",e[e.Dash=45]="Dash",e[e.Period=46]="Period",e[e.Slash=47]="Slash",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.Colon=58]="Colon",e[e.Semicolon=59]="Semicolon",e[e.LessThan=60]="LessThan",e[e.Equals=61]="Equals",e[e.GreaterThan=62]="GreaterThan",e[e.QuestionMark=63]="QuestionMark",e[e.AtSign=64]="AtSign",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.OpenSquareBracket=91]="OpenSquareBracket",e[e.Backslash=92]="Backslash",e[e.CloseSquareBracket=93]="CloseSquareBracket",e[e.Caret=94]="Caret",e[e.Underline=95]="Underline",e[e.BackTick=96]="BackTick",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.OpenCurlyBrace=123]="OpenCurlyBrace",e[e.Pipe=124]="Pipe",e[e.CloseCurlyBrace=125]="CloseCurlyBrace",e[e.Tilde=126]="Tilde",e[e.NoBreakSpace=160]="NoBreakSpace",e[e.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",e[e.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",e[e.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",e[e.U_Combining_Tilde=771]="U_Combining_Tilde",e[e.U_Combining_Macron=772]="U_Combining_Macron",e[e.U_Combining_Overline=773]="U_Combining_Overline",e[e.U_Combining_Breve=774]="U_Combining_Breve",e[e.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",e[e.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",e[e.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",e[e.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",e[e.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",e[e.U_Combining_Caron=780]="U_Combining_Caron",e[e.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",e[e.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",e[e.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",e[e.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",e[e.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",e[e.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",e[e.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",e[e.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",e[e.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",e[e.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",e[e.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",e[e.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",e[e.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",e[e.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",e[e.U_Combining_Horn=795]="U_Combining_Horn",e[e.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",e[e.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",e[e.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",e[e.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",e[e.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",e[e.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",e[e.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",e[e.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",e[e.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",e[e.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",e[e.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",e[e.U_Combining_Cedilla=807]="U_Combining_Cedilla",e[e.U_Combining_Ogonek=808]="U_Combining_Ogonek",e[e.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",e[e.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",e[e.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",e[e.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",e[e.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",e[e.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",e[e.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",e[e.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",e[e.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",e[e.U_Combining_Low_Line=818]="U_Combining_Low_Line",e[e.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",e[e.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",e[e.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",e[e.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",e[e.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",e[e.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",e[e.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",e[e.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",e[e.U_Combining_Square_Below=827]="U_Combining_Square_Below",e[e.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",e[e.U_Combining_X_Above=829]="U_Combining_X_Above",e[e.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",e[e.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",e[e.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",e[e.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",e[e.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",e[e.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",e[e.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",e[e.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",e[e.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",e[e.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",e[e.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",e[e.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",e[e.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",e[e.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",e[e.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",e[e.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",e[e.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",e[e.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",e[e.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",e[e.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",e[e.U_Combining_Fermata=850]="U_Combining_Fermata",e[e.U_Combining_X_Below=851]="U_Combining_X_Below",e[e.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",e[e.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",e[e.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",e[e.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",e[e.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",e[e.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",e[e.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",e[e.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",e[e.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",e[e.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",e[e.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",e[e.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",e[e.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",e[e.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",e[e.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",e[e.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",e[e.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",e[e.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",e[e.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",e[e.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",e[e.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",e[e.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",e[e.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",e[e.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",e[e.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",e[e.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",e[e.LINE_SEPARATOR=8232]="LINE_SEPARATOR",e[e.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",e[e.NEXT_LINE=133]="NEXT_LINE",e[e.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",e[e.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",e[e.U_DIAERESIS=168]="U_DIAERESIS",e[e.U_MACRON=175]="U_MACRON",e[e.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",e[e.U_CEDILLA=184]="U_CEDILLA",e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",e[e.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",e[e.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",e[e.U_BREVE=728]="U_BREVE",e[e.U_DOT_ABOVE=729]="U_DOT_ABOVE",e[e.U_RING_ABOVE=730]="U_RING_ABOVE",e[e.U_OGONEK=731]="U_OGONEK",e[e.U_SMALL_TILDE=732]="U_SMALL_TILDE",e[e.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",e[e.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",e[e.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",e[e.U_GREEK_TONOS=900]="U_GREEK_TONOS",e[e.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",e[e.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",e[e.U_GREEK_PSILI=8127]="U_GREEK_PSILI",e[e.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",e[e.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",e[e.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",e[e.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",e[e.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",e[e.U_GREEK_VARIA=8175]="U_GREEK_VARIA",e[e.U_GREEK_OXIA=8189]="U_GREEK_OXIA",e[e.U_GREEK_DASIA=8190]="U_GREEK_DASIA",e[e.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",e[e.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",e[e.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",e[e.U_OVERLINE=8254]="U_OVERLINE",e[e.UTF8_BOM=65279]="UTF8_BOM",e[e.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",e[e.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"})(d||(d={}));class ui{constructor(t){this.executor=t,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(t){this._error=t}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var be;(function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",e[e.MAX_UINT_8=255]="MAX_UINT_8",e[e.MAX_UINT_16=65535]="MAX_UINT_16",e[e.MAX_UINT_32=4294967295]="MAX_UINT_32",e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"})(be||(be={}));function oi(e){return e<0?0:e>be.MAX_UINT_8?be.MAX_UINT_8:e|0}function Ce(e){return e<0?0:e>be.MAX_UINT_32?be.MAX_UINT_32:e|0}function Nl(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function pl(e){return e.split(/\r\n|\r|\n/)}function wl(e){for(let t=0,n=e.length;t=0;n--){const i=e.charCodeAt(n);if(i!==d.Space&&i!==d.Tab)return n}return-1}function ci(e){return e>=d.A&&e<=d.Z}function Gt(e){return 55296<=e&&e<=56319}function Nn(e){return 56320<=e&&e<=57343}function fi(e,t){return(e-55296<<10)+(t-56320)+65536}function Al(e,t,n){const i=e.charCodeAt(n);if(Gt(i)&&n+1JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}')),Ue.cache=new Ll({getCacheKey:JSON.stringify},t=>{function n(h){const f=new Map;for(let _=0;_!h.startsWith("_")&&h in r);a.length===0&&(a=["_default"]);let u;for(const h of a){const f=n(r[h]);u=s(u,f)}const o=n(r._common),c=i(o,u);return new Ue(c)}),Ue._locales=new ui(()=>Object.keys(Ue.ambiguousCharacterData.value).filter(t=>!t.startsWith("_")));let Et=Ue;const je=class je{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(je.getRawData())),this._data}static isInvisibleCharacter(t){return je.getData().has(t)}static containsInvisibleCharacter(t){for(let n=0;n{this._pendingReplies[i]={resolve:s,reject:r},this._send(new Ul(this._workerId,i,t,n))})}listen(t,n){let i=null;const s=new Ee({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Dl(this._workerId,i,t,n))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Ml(this._workerId,i)),i=null}});return s.event}handleMessage(t){!t||!t.vsWorker||this._workerId!==-1&&t.vsWorker!==this._workerId||this._handleMessage(t)}_handleMessage(t){switch(t.type){case fe.Reply:return this._handleReplyMessage(t);case fe.Request:return this._handleRequestMessage(t);case fe.SubscribeEvent:return this._handleSubscribeEventMessage(t);case fe.Event:return this._handleEventMessage(t);case fe.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(t)}}_handleReplyMessage(t){if(!this._pendingReplies[t.seq]){console.warn("Got reply to unknown seq");return}const n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let i=t.err;t.err.$isError&&(i=new Error,i.name=t.err.name,i.message=t.err.message,i.stack=t.err.stack),n.reject(i);return}n.resolve(t.res)}_handleRequestMessage(t){const n=t.req;this._handler.handleMessage(t.method,t.args).then(s=>{this._send(new gi(this._workerId,n,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=Zn(s.detail)),this._send(new gi(this._workerId,n,void 0,Zn(s)))})}_handleSubscribeEventMessage(t){const n=t.req,i=this._handler.handleEvent(t.eventName,t.arg)(s=>{this._send(new Tl(this._workerId,n,s))});this._pendingEvents.set(n,i)}_handleEventMessage(t){if(!this._pendingEmitters.has(t.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(t.req).fire(t.event)}_handleUnsubscribeEventMessage(t){if(!this._pendingEvents.has(t.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(t.req).dispose(),this._pendingEvents.delete(t.req)}_send(t){const n=[];if(t.type===fe.Request)for(let i=0;ifunction(){const u=Array.prototype.slice.call(arguments,0);return t(a,u)},s=a=>function(u){return n(a,u)},r={};for(const a of e){if(bi(a)){r[a]=s(a);continue}if(_i(a)){r[a]=n(a,void 0);continue}r[a]=i(a)}return r}class Il{constructor(t,n){this._requestHandlerFactory=n,this._requestHandler=null,this._protocol=new Fl({sendMessage:(i,s)=>{t(i,s)},handleMessage:(i,s)=>this._handleMessage(i,s),handleEvent:(i,s)=>this._handleEvent(i,s)})}onmessage(t){this._protocol.handleMessage(t)}_handleMessage(t,n){if(t===vl)return this.initialize(n[0],n[1],n[2],n[3]);if(!this._requestHandler||typeof this._requestHandler[t]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+t));try{return Promise.resolve(this._requestHandler[t].apply(this._requestHandler,n))}catch(i){return Promise.reject(i)}}_handleEvent(t,n){if(!this._requestHandler)throw new Error("Missing requestHandler");if(bi(t)){const i=this._requestHandler[t].call(this._requestHandler,n);if(typeof i!="function")throw new Error(`Missing dynamic event ${t} on request handler.`);return i}if(_i(t)){const i=this._requestHandler[t];if(typeof i!="function")throw new Error(`Missing event ${t} on request handler.`);return i}throw new Error(`Malformed event name ${t}`)}initialize(t,n,i,s){this._protocol.setWorkerId(t);const u=kl(s,(o,c)=>this._protocol.sendMessage(o,c),(o,c)=>this._protocol.listen(o,c));return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(u),Promise.resolve(Ln(this._requestHandler))):(n&&(typeof n.baseUrl<"u"&&delete n.baseUrl,typeof n.paths<"u"&&typeof n.paths.vs<"u"&&delete n.paths.vs,typeof n.trustedTypesPolicy<"u"&&delete n.trustedTypesPolicy,n.catchError=!0,globalThis.require.config(n)),new Promise((o,c)=>{(void 0)([i],f=>{if(this._requestHandler=f.create(u),!this._requestHandler){c(new Error("No RequestHandler!"));return}o(Ln(this._requestHandler))},c)}))}}class Se{constructor(t,n,i,s){this.originalStart=t,this.originalLength=n,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function di(e,t){return(t<<5)-t+e|0}function Sl(e,t){t=di(149417,t);for(let n=0,i=e.length;n>>i)>>>0}function Li(e,t=0,n=e.byteLength,i=0){for(let s=0;sn.toString(16).padStart(2,"0")).join(""):Bl((e>>>0).toString(16),t/4)}const rn=class rn{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(de.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){const n=t.length;if(n===0)return;const i=this._buff;let s=this._buffLen,r=this._leftoverHighSurrogate,a,u;for(r!==0?(a=r,u=-1,r=0):(a=t.charCodeAt(0),u=0);;){let o=a;if(Gt(a))if(u+1>>6,t[n++]=128|(i&63)>>>0):i<65536?(t[n++]=224|(i&61440)>>>12,t[n++]=128|(i&4032)>>>6,t[n++]=128|(i&63)>>>0):(t[n++]=240|(i&1835008)>>>18,t[n++]=128|(i&258048)>>>12,t[n++]=128|(i&4032)>>>6,t[n++]=128|(i&63)>>>0),n>=de.BLOCK_SIZE&&(this._step(),n-=de.BLOCK_SIZE,this._totalLen+=de.BLOCK_SIZE,t[0]=t[de.BLOCK_SIZE+0],t[1]=t[de.BLOCK_SIZE+1],t[2]=t[de.BLOCK_SIZE+2]),n}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,de.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),xt(this._h0)+xt(this._h1)+xt(this._h2)+xt(this._h3)+xt(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Li(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Li(this._buff));const t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){const t=rn._bigBlock32,n=this._buffDV;for(let f=0;f<64;f+=4)t.setUint32(f,n.getUint32(f,!1),!1);for(let f=64;f<320;f+=4)t.setUint32(f,pn(t.getUint32(f-12,!1)^t.getUint32(f-32,!1)^t.getUint32(f-56,!1)^t.getUint32(f-64,!1),1),!1);let i=this._h0,s=this._h1,r=this._h2,a=this._h3,u=this._h4,o,c,h;for(let f=0;f<80;f++)f<20?(o=s&r|~s&a,c=1518500249):f<40?(o=s^r^a,c=1859775393):f<60?(o=s&r|s&a|r&a,c=2400959708):(o=s^r^a,c=3395469782),h=pn(i,5)+o+u+c+t.getUint32(f*4,!1)&4294967295,u=a,a=r,r=pn(s,30),s=i,i=h;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+a&4294967295,this._h4=this._h4+u&4294967295}};rn._bigBlock32=new DataView(new ArrayBuffer(320));let Ni=rn;class pi{constructor(t){this.source=t}getElements(){const t=this.source,n=new Int32Array(t.length);for(let i=0,s=t.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Se(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=be.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=be.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_originalCount++}AddModifiedElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Be{constructor(t,n,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=t,this._modifiedSequence=n;const[s,r,a]=Be._getElements(t),[u,o,c]=Be._getElements(n);this._hasStrings=a&&c,this._originalStringElements=s,this._originalElementsOrHash=r,this._modifiedStringElements=u,this._modifiedElementsOrHash=o,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(Be._isStringArray(n)){const i=new Int32Array(n.length);for(let s=0,r=n.length;s=t&&s>=i&&this.ElementsAreEqual(n,s);)n--,s--;if(t>n||i>s){let f;return i<=s?(et.Assert(t===n+1,"originalStart should only be one more than originalEnd"),f=[new Se(t,0,i,s-i+1)]):t<=n?(et.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[new Se(t,n-t+1,i,0)]):(et.Assert(t===n+1,"originalStart should only be one more than originalEnd"),et.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[]),f}const a=[0],u=[0],o=this.ComputeRecursionPoint(t,n,i,s,a,u,r),c=a[0],h=u[0];if(o!==null)return o;if(!r[0]){const f=this.ComputeDiffRecursive(t,c,i,h,r);let _=[];return r[0]?_=[new Se(c+1,n-(c+1)+1,h+1,s-(h+1)+1)]:_=this.ComputeDiffRecursive(c+1,n,h+1,s,r),this.ConcatenateChanges(f,_)}return[new Se(t,n-t+1,i,s-i+1)]}WALKTRACE(t,n,i,s,r,a,u,o,c,h,f,_,b,L,N,A,x,R){let U=null,p=null,w=new wi,D=n,T=i,I=b[0]-A[0]-s,$=be.MIN_SAFE_SMALL_INTEGER,ie=this.m_forwardHistory.length-1;do{const z=I+t;z===D||z=0&&(c=this.m_forwardHistory[ie],t=c[0],D=1,T=c.length-1)}while(--ie>=-1);if(U=w.getReverseChanges(),R[0]){let z=b[0]+1,E=A[0]+1;if(U!==null&&U.length>0){const v=U[U.length-1];z=Math.max(z,v.getOriginalEnd()),E=Math.max(E,v.getModifiedEnd())}p=[new Se(z,_-z+1,E,N-E+1)]}else{w=new wi,D=a,T=u,I=b[0]-A[0]-o,$=be.MAX_SAFE_SMALL_INTEGER,ie=x?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const z=I+r;z===D||z=h[z+1]?(f=h[z+1]-1,L=f-I-o,f>$&&w.MarkNextChange(),$=f+1,w.AddOriginalElement(f+1,L+1),I=z+1-r):(f=h[z-1],L=f-I-o,f>$&&w.MarkNextChange(),$=f,w.AddModifiedElement(f+1,L+1),I=z-1-r),ie>=0&&(h=this.m_reverseHistory[ie],r=h[0],D=1,T=h.length-1)}while(--ie>=-1);p=w.getChanges()}return this.ConcatenateChanges(U,p)}ComputeRecursionPoint(t,n,i,s,r,a,u){let o=0,c=0,h=0,f=0,_=0,b=0;t--,i--,r[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const L=n-t+(s-i),N=L+1,A=new Int32Array(N),x=new Int32Array(N),R=s-i,U=n-t,p=t-i,w=n-s,T=(U-R)%2===0;A[R]=t,x[U]=n,u[0]=!1;for(let I=1;I<=L/2+1;I++){let $=0,ie=0;h=this.ClipDiagonalBound(R-I,I,R,N),f=this.ClipDiagonalBound(R+I,I,R,N);for(let E=h;E<=f;E+=2){E===h||E$+ie&&($=o,ie=c),!T&&Math.abs(E-U)<=I-1&&o>=x[E])return r[0]=o,a[0]=c,v<=x[E]&&Te.MaxDifferencesHistory>0&&I<=Te.MaxDifferencesHistory+1?this.WALKTRACE(R,h,f,p,U,_,b,w,A,x,o,n,r,c,s,a,T,u):null}const z=($-t+(ie-i)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate($,z))return u[0]=!0,r[0]=$,a[0]=ie,z>0&&Te.MaxDifferencesHistory>0&&I<=Te.MaxDifferencesHistory+1?this.WALKTRACE(R,h,f,p,U,_,b,w,A,x,o,n,r,c,s,a,T,u):(t++,i++,[new Se(t,n-t+1,i,s-i+1)]);_=this.ClipDiagonalBound(U-I,I,U,N),b=this.ClipDiagonalBound(U+I,I,U,N);for(let E=_;E<=b;E+=2){E===_||E=x[E+1]?o=x[E+1]-1:o=x[E-1],c=o-(E-U)-w;const v=o;for(;o>t&&c>i&&this.ElementsAreEqual(o,c);)o--,c--;if(x[E]=o,T&&Math.abs(E-R)<=I&&o<=A[E])return r[0]=o,a[0]=c,v>=A[E]&&Te.MaxDifferencesHistory>0&&I<=Te.MaxDifferencesHistory+1?this.WALKTRACE(R,h,f,p,U,_,b,w,A,x,o,n,r,c,s,a,T,u):null}if(I<=Te.MaxDifferencesHistory){let E=new Int32Array(f-h+2);E[0]=R-h+1,tt.Copy2(A,h,E,1,f-h+1),this.m_forwardHistory.push(E),E=new Int32Array(b-_+2),E[0]=U-_+1,tt.Copy2(x,_,E,1,b-_+1),this.m_reverseHistory.push(E)}}return this.WALKTRACE(R,h,f,p,U,_,b,w,A,x,o,n,r,c,s,a,T,u)}PrettifyChanges(t){for(let n=0;n0,u=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;n--){const i=t[n];let s=0,r=0;if(n>0){const f=t[n-1];s=f.originalStart+f.originalLength,r=f.modifiedStart+f.modifiedLength}const a=i.originalLength>0,u=i.modifiedLength>0;let o=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let f=1;;f++){const _=i.originalStart-f,b=i.modifiedStart-f;if(_c&&(c=N,o=f)}i.originalStart-=o,i.modifiedStart-=o;const h=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],h)){t[n-1]=h[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,i=t.length;n0&&b>o&&(o=b,c=f,h=_)}return o>0?[c,h]:null}_contiguousSequenceScore(t,n,i){let s=0;for(let r=0;r=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const i=t+n;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const i=t+n;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(t,n,i,s){const r=this._OriginalRegionIsBoundary(t,n)?1:0,a=this._ModifiedRegionIsBoundary(i,s)?1:0;return r+a}ConcatenateChanges(t,n){const i=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],i)){const s=new Array(t.length+n.length-1);return tt.Copy(t,0,s,0,t.length-1),s[t.length-1]=i[0],tt.Copy(n,1,s,t.length,n.length-1),s}else{const s=new Array(t.length+n.length);return tt.Copy(t,0,s,0,t.length),tt.Copy(n,0,s,t.length,n.length),s}}ChangesOverlap(t,n,i){if(et.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),et.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const s=t.originalStart;let r=t.originalLength;const a=t.modifiedStart;let u=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(r=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(u=n.modifiedStart+n.modifiedLength-t.modifiedStart),i[0]=new Se(s,r,a,u),!0}else return i[0]=null,!1}ClipDiagonalBound(t,n,i,s){if(t>=0&&t=Vl&&e<=ql||e>=Hl&&e<=Wl}function zt(e,t,n,i){let s="",r=0,a=-1,u=0,o=0;for(let c=0;c<=e.length;++c){if(c2){const h=s.lastIndexOf(n);h===-1?(s="",r=0):(s=s.slice(0,h),r=s.length-1-s.lastIndexOf(n)),a=c,u=0;continue}else if(s.length!==0){s="",r=0,a=c,u=0;continue}}t&&(s+=s.length>0?`${n}..`:"..",r=2)}else s.length>0?s+=`${n}${e.slice(a+1,c)}`:s=e.slice(a+1,c),r=c-a-1;a=c,u=0}else o===Pe&&u!==-1?++u:u=-1}return s}function zl(e){return e?`${e[0]==="."?"":"."}${e}`:""}function xi(e,t){$l(t,"pathObject");const n=t.dir||t.root,i=t.base||`${t.name||""}${zl(t.ext)}`;return n?n===t.root?`${n}${i}`:`${n}${e}${i}`:i}const ne={resolve(...e){let t="",n="",i=!1;for(let s=e.length-1;s>=-1;s--){let r;if(s>=0){if(r=e[s],ee(r,`paths[${s}]`),r.length===0)continue}else t.length===0?r=$t():(r=yl[`=${t}`]||$t(),(r===void 0||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&r.charCodeAt(2)===he)&&(r=`${t}\\`));const a=r.length;let u=0,o="",c=!1;const h=r.charCodeAt(0);if(a===1)H(h)&&(u=1,c=!0);else if(H(h))if(c=!0,H(r.charCodeAt(1))){let f=2,_=f;for(;f2&&H(r.charCodeAt(2))&&(c=!0,u=3));if(o.length>0)if(t.length>0){if(o.toLowerCase()!==t.toLowerCase())continue}else t=o;if(i){if(t.length>0)break}else if(n=`${r.slice(u)}\\${n}`,i=c,c&&t.length>0)break}return n=zt(n,!i,"\\",H),i?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){ee(e,"path");const t=e.length;if(t===0)return".";let n=0,i,s=!1;const r=e.charCodeAt(0);if(t===1)return An(r)?"\\":e;if(H(r))if(s=!0,H(e.charCodeAt(1))){let u=2,o=u;for(;u2&&H(e.charCodeAt(2))&&(s=!0,n=3));let a=n0&&H(e.charCodeAt(t-1))&&(a+="\\"),i===void 0?s?`\\${a}`:a:s?`${i}\\${a}`:`${i}${a}`},isAbsolute(e){ee(e,"path");const t=e.length;if(t===0)return!1;const n=e.charCodeAt(0);return H(n)||t>2&&Oe(n)&&e.charCodeAt(1)===ye&&H(e.charCodeAt(2))},join(...e){if(e.length===0)return".";let t,n;for(let r=0;r0&&(t===void 0?t=n=a:t+=`\\${a}`)}if(t===void 0)return".";let i=!0,s=0;if(typeof n=="string"&&H(n.charCodeAt(0))){++s;const r=n.length;r>1&&H(n.charCodeAt(1))&&(++s,r>2&&(H(n.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(t=`\\${t.slice(s)}`)}return ne.normalize(t)},relative(e,t){if(ee(e,"from"),ee(t,"to"),e===t)return"";const n=ne.resolve(e),i=ne.resolve(t);if(n===i||(e=n.toLowerCase(),t=i.toLowerCase(),e===t))return"";let s=0;for(;ss&&e.charCodeAt(r-1)===he;)r--;const a=r-s;let u=0;for(;uu&&t.charCodeAt(o-1)===he;)o--;const c=o-u,h=ah){if(t.charCodeAt(u+_)===he)return i.slice(u+_+1);if(_===2)return i.slice(u+_)}a>h&&(e.charCodeAt(s+_)===he?f=_:_===2&&(f=3)),f===-1&&(f=0)}let b="";for(_=s+f+1;_<=r;++_)(_===r||e.charCodeAt(_)===he)&&(b+=b.length===0?"..":"\\..");return u+=f,b.length>0?`${b}${i.slice(u,o)}`:(i.charCodeAt(u)===he&&++u,i.slice(u,o))},toNamespacedPath(e){if(typeof e!="string"||e.length===0)return e;const t=ne.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===he){if(t.charCodeAt(1)===he){const n=t.charCodeAt(2);if(n!==Gl&&n!==Pe)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Oe(t.charCodeAt(0))&&t.charCodeAt(1)===ye&&t.charCodeAt(2)===he)return`\\\\?\\${t}`;return e},dirname(e){ee(e,"path");const t=e.length;if(t===0)return".";let n=-1,i=0;const s=e.charCodeAt(0);if(t===1)return H(s)?e:".";if(H(s)){if(n=i=1,H(e.charCodeAt(1))){let u=2,o=u;for(;u2&&H(e.charCodeAt(2))?3:2,i=n);let r=-1,a=!0;for(let u=t-1;u>=i;--u)if(H(e.charCodeAt(u))){if(!a){r=u;break}}else a=!1;if(r===-1){if(n===-1)return".";r=n}return e.slice(0,r)},basename(e,t){t!==void 0&&ee(t,"suffix"),ee(e,"path");let n=0,i=-1,s=!0,r;if(e.length>=2&&Oe(e.charCodeAt(0))&&e.charCodeAt(1)===ye&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let a=t.length-1,u=-1;for(r=e.length-1;r>=n;--r){const o=e.charCodeAt(r);if(H(o)){if(!s){n=r+1;break}}else u===-1&&(s=!1,u=r+1),a>=0&&(o===t.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=u))}return n===i?i=u:i===-1&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=n;--r)if(H(e.charCodeAt(r))){if(!s){n=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":e.slice(n,i)},extname(e){ee(e,"path");let t=0,n=-1,i=0,s=-1,r=!0,a=0;e.length>=2&&e.charCodeAt(1)===ye&&Oe(e.charCodeAt(0))&&(t=i=2);for(let u=e.length-1;u>=t;--u){const o=e.charCodeAt(u);if(H(o)){if(!r){i=u+1;break}continue}s===-1&&(r=!1,s=u+1),o===Pe?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===i+1?"":e.slice(n,s)},format:xi.bind(null,"\\"),parse(e){ee(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;const n=e.length;let i=0,s=e.charCodeAt(0);if(n===1)return H(s)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(H(s)){if(i=1,H(e.charCodeAt(1))){let f=2,_=f;for(;f0&&(t.root=e.slice(0,i));let r=-1,a=i,u=-1,o=!0,c=e.length-1,h=0;for(;c>=i;--c){if(s=e.charCodeAt(c),H(s)){if(!o){a=c+1;break}continue}u===-1&&(o=!1,u=c+1),s===Pe?r===-1?r=c:h!==1&&(h=1):r!==-1&&(h=-1)}return u!==-1&&(r===-1||h===0||h===1&&r===u-1&&r===a+1?t.base=t.name=e.slice(a,u):(t.name=e.slice(a,r),t.base=e.slice(a,u),t.ext=e.slice(r,u))),a>0&&a!==i?t.dir=e.slice(0,a-1):t.dir=t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},jl=(()=>{if(Le){const e=/\\/g;return()=>{const t=$t().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>$t()})(),re={resolve(...e){let t="",n=!1;for(let i=e.length-1;i>=-1&&!n;i--){const s=i>=0?e[i]:jl();ee(s,`paths[${i}]`),s.length!==0&&(t=`${s}/${t}`,n=s.charCodeAt(0)===se)}return t=zt(t,!n,"/",An),n?`/${t}`:t.length>0?t:"."},normalize(e){if(ee(e,"path"),e.length===0)return".";const t=e.charCodeAt(0)===se,n=e.charCodeAt(e.length-1)===se;return e=zt(e,!t,"/",An),e.length===0?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute(e){return ee(e,"path"),e.length>0&&e.charCodeAt(0)===se},join(...e){if(e.length===0)return".";let t;for(let n=0;n0&&(t===void 0?t=i:t+=`/${i}`)}return t===void 0?".":re.normalize(t)},relative(e,t){if(ee(e,"from"),ee(t,"to"),e===t||(e=re.resolve(e),t=re.resolve(t),e===t))return"";const n=1,i=e.length,s=i-n,r=1,a=t.length-r,u=su){if(t.charCodeAt(r+c)===se)return t.slice(r+c+1);if(c===0)return t.slice(r+c)}else s>u&&(e.charCodeAt(n+c)===se?o=c:c===0&&(o=0));let h="";for(c=n+o+1;c<=i;++c)(c===i||e.charCodeAt(c)===se)&&(h+=h.length===0?"..":"/..");return`${h}${t.slice(r+o)}`},toNamespacedPath(e){return e},dirname(e){if(ee(e,"path"),e.length===0)return".";const t=e.charCodeAt(0)===se;let n=-1,i=!0;for(let s=e.length-1;s>=1;--s)if(e.charCodeAt(s)===se){if(!i){n=s;break}}else i=!1;return n===-1?t?"/":".":t&&n===1?"//":e.slice(0,n)},basename(e,t){t!==void 0&&ee(t,"ext"),ee(e,"path");let n=0,i=-1,s=!0,r;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let a=t.length-1,u=-1;for(r=e.length-1;r>=0;--r){const o=e.charCodeAt(r);if(o===se){if(!s){n=r+1;break}}else u===-1&&(s=!1,u=r+1),a>=0&&(o===t.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=u))}return n===i?i=u:i===-1&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===se){if(!s){n=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":e.slice(n,i)},extname(e){ee(e,"path");let t=-1,n=0,i=-1,s=!0,r=0;for(let a=e.length-1;a>=0;--a){const u=e.charCodeAt(a);if(u===se){if(!s){n=a+1;break}continue}i===-1&&(s=!1,i=a+1),u===Pe?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||i===-1||r===0||r===1&&t===i-1&&t===n+1?"":e.slice(t,i)},format:xi.bind(null,"/"),parse(e){ee(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;const n=e.charCodeAt(0)===se;let i;n?(t.root="/",i=1):i=0;let s=-1,r=0,a=-1,u=!0,o=e.length-1,c=0;for(;o>=i;--o){const h=e.charCodeAt(o);if(h===se){if(!u){r=o+1;break}continue}a===-1&&(u=!1,a=o+1),h===Pe?s===-1?s=o:c!==1&&(c=1):s!==-1&&(c=-1)}if(a!==-1){const h=r===0&&n?1:r;s===-1||c===0||c===1&&s===a-1&&s===r+1?t.base=t.name=e.slice(h,a):(t.name=e.slice(h,s),t.base=e.slice(h,a),t.ext=e.slice(s,a))}return r>0?t.dir=e.slice(0,r-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};re.win32=ne.win32=ne,re.posix=ne.posix=re,Le?ne.normalize:re.normalize,Le?ne.isAbsolute:re.isAbsolute,Le?ne.join:re.join,Le?ne.resolve:re.resolve,Le?ne.relative:re.relative,Le?ne.dirname:re.dirname,Le?ne.basename:re.basename,Le?ne.extname:re.extname,Le?ne.parse:re.parse,Le?ne.sep:re.sep,Le?ne.delimiter:re.delimiter;const Xl=/^\w[\w\d+.-]*$/,Yl=/^\//,Ql=/^\/\//;function Zl(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!Xl.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!Yl.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Ql.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Jl(e,t){return!e&&!t?"file":e}function Kl(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==Ae&&(t=Ae+t):t=Ae;break}return t}const Y="",Ae="/",Cl=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class $e{static isUri(t){return t instanceof $e?!0:t?typeof t.authority=="string"&&typeof t.fragment=="string"&&typeof t.path=="string"&&typeof t.query=="string"&&typeof t.scheme=="string"&&typeof t.fsPath=="string"&&typeof t.with=="function"&&typeof t.toString=="function":!1}constructor(t,n,i,s,r,a=!1){typeof t=="object"?(this.scheme=t.scheme||Y,this.authority=t.authority||Y,this.path=t.path||Y,this.query=t.query||Y,this.fragment=t.fragment||Y):(this.scheme=Jl(t,a),this.authority=n||Y,this.path=Kl(this.scheme,i||Y),this.query=s||Y,this.fragment=r||Y,Zl(this,a))}get fsPath(){return xn(this,!1)}with(t){if(!t)return this;let{scheme:n,authority:i,path:s,query:r,fragment:a}=t;return n===void 0?n=this.scheme:n===null&&(n=Y),i===void 0?i=this.authority:i===null&&(i=Y),s===void 0?s=this.path:s===null&&(s=Y),r===void 0?r=this.query:r===null&&(r=Y),a===void 0?a=this.fragment:a===null&&(a=Y),n===this.scheme&&i===this.authority&&s===this.path&&r===this.query&&a===this.fragment?this:new nt(n,i,s,r,a)}static parse(t,n=!1){const i=Cl.exec(t);return i?new nt(i[2]||Y,jt(i[4]||Y),jt(i[5]||Y),jt(i[7]||Y),jt(i[9]||Y),n):new nt(Y,Y,Y,Y,Y)}static file(t){let n=Y;if(pt&&(t=t.replace(/\\/g,Ae)),t[0]===Ae&&t[1]===Ae){const i=t.indexOf(Ae,2);i===-1?(n=t.substring(2),t=Ae):(n=t.substring(2,i),t=t.substring(i)||Ae)}return new nt("file",n,t,Y,Y)}static from(t,n){return new nt(t.scheme,t.authority,t.path,t.query,t.fragment,n)}static joinPath(t,...n){if(!t.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return pt&&t.scheme==="file"?i=$e.file(ne.join(xn(t,!0),...n)).path:i=re.join(t.path,...n),t.with({path:i})}toString(t=!1){return Rn(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof $e)return t;{const n=new nt(t);return n._formatted=t.external??null,n._fsPath=t._sep===Ri?t.fsPath??null:null,n}}else return t}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}}const Ri=pt?1:void 0;class nt extends $e{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=xn(this,!1)),this._fsPath}toString(t=!1){return t?Rn(this,!0):(this._formatted||(this._formatted=Rn(this,!1)),this._formatted)}toJSON(){const t={$mid:wn.Uri};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=Ri),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const vi={[d.Colon]:"%3A",[d.Slash]:"%2F",[d.QuestionMark]:"%3F",[d.Hash]:"%23",[d.OpenSquareBracket]:"%5B",[d.CloseSquareBracket]:"%5D",[d.AtSign]:"%40",[d.ExclamationMark]:"%21",[d.DollarSign]:"%24",[d.Ampersand]:"%26",[d.SingleQuote]:"%27",[d.OpenParen]:"%28",[d.CloseParen]:"%29",[d.Asterisk]:"%2A",[d.Plus]:"%2B",[d.Comma]:"%2C",[d.Semicolon]:"%3B",[d.Equals]:"%3D",[d.Space]:"%20"};function Ui(e,t,n){let i,s=-1;for(let r=0;r=d.a&&a<=d.z||a>=d.A&&a<=d.Z||a>=d.Digit0&&a<=d.Digit9||a===d.Dash||a===d.Period||a===d.Underline||a===d.Tilde||t&&a===d.Slash||n&&a===d.OpenSquareBracket||n&&a===d.CloseSquareBracket||n&&a===d.Colon)s!==-1&&(i+=encodeURIComponent(e.substring(s,r)),s=-1),i!==void 0&&(i+=e.charAt(r));else{i===void 0&&(i=e.substr(0,r));const u=vi[a];u!==void 0?(s!==-1&&(i+=encodeURIComponent(e.substring(s,r)),s=-1),i+=u):s===-1&&(s=r)}}return s!==-1&&(i+=encodeURIComponent(e.substring(s))),i!==void 0?i:e}function e1(e){let t;for(let n=0;n1&&e.scheme==="file"?n=`//${e.authority}${e.path}`:e.path.charCodeAt(0)===d.Slash&&(e.path.charCodeAt(1)>=d.A&&e.path.charCodeAt(1)<=d.Z||e.path.charCodeAt(1)>=d.a&&e.path.charCodeAt(1)<=d.z)&&e.path.charCodeAt(2)===d.Colon?t?n=e.path.substr(1):n=e.path[1].toLowerCase()+e.path.substr(2):n=e.path,pt&&(n=n.replace(/\//g,"\\")),n}function Rn(e,t){const n=t?e1:Ui;let i="",{scheme:s,authority:r,path:a,query:u,fragment:o}=e;if(s&&(i+=s,i+=":"),(r||s==="file")&&(i+=Ae,i+=Ae),r){let c=r.indexOf("@");if(c!==-1){const h=r.substr(0,c);r=r.substr(c+1),c=h.lastIndexOf(":"),c===-1?i+=n(h,!1,!1):(i+=n(h.substr(0,c),!1,!1),i+=":",i+=n(h.substr(c+1),!1,!0)),i+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?i+=n(r,!1,!0):(i+=n(r.substr(0,c),!1,!0),i+=r.substr(c))}if(a){if(a.length>=3&&a.charCodeAt(0)===d.Slash&&a.charCodeAt(2)===d.Colon){const c=a.charCodeAt(1);c>=d.A&&c<=d.Z&&(a=`/${String.fromCharCode(c+32)}:${a.substr(3)}`)}else if(a.length>=2&&a.charCodeAt(1)===d.Colon){const c=a.charCodeAt(0);c>=d.A&&c<=d.Z&&(a=`${String.fromCharCode(c+32)}:${a.substr(2)}`)}i+=n(a,!0,!1)}return u&&(i+="?",i+=n(u,!1,!1)),o&&(i+="#",i+=t?o:Ui(o,!1,!1)),i}function Di(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+Di(e.substr(3)):e}}const Ti=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function jt(e){return e.match(Ti)?e.replace(Ti,t=>Di(t)):e}class j{constructor(t,n){this.lineNumber=t,this.column=n}with(t=this.lineNumber,n=this.column){return t===this.lineNumber&&n===this.column?this:new j(t,n)}delta(t=0,n=0){return this.with(this.lineNumber+t,this.column+n)}equals(t){return j.equals(this,t)}static equals(t,n){return!t&&!n?!0:!!t&&!!n&&t.lineNumber===n.lineNumber&&t.column===n.column}isBefore(t){return j.isBefore(this,t)}static isBefore(t,n){return t.lineNumberi||t===i&&n>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=t,this.endColumn=n):(this.startLineNumber=t,this.startColumn=n,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return k.isEmpty(this)}static isEmpty(t){return t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn}containsPosition(t){return k.containsPosition(this,t)}static containsPosition(t,n){return!(n.lineNumbert.endLineNumber||n.lineNumber===t.startLineNumber&&n.columnt.endColumn)}static strictContainsPosition(t,n){return!(n.lineNumbert.endLineNumber||n.lineNumber===t.startLineNumber&&n.column<=t.startColumn||n.lineNumber===t.endLineNumber&&n.column>=t.endColumn)}containsRange(t){return k.containsRange(this,t)}static containsRange(t,n){return!(n.startLineNumbert.endLineNumber||n.endLineNumber>t.endLineNumber||n.startLineNumber===t.startLineNumber&&n.startColumnt.endColumn)}strictContainsRange(t){return k.strictContainsRange(this,t)}static strictContainsRange(t,n){return!(n.startLineNumbert.endLineNumber||n.endLineNumber>t.endLineNumber||n.startLineNumber===t.startLineNumber&&n.startColumn<=t.startColumn||n.endLineNumber===t.endLineNumber&&n.endColumn>=t.endColumn)}plusRange(t){return k.plusRange(this,t)}static plusRange(t,n){let i,s,r,a;return n.startLineNumbert.endLineNumber?(r=n.endLineNumber,a=n.endColumn):n.endLineNumber===t.endLineNumber?(r=n.endLineNumber,a=Math.max(n.endColumn,t.endColumn)):(r=t.endLineNumber,a=t.endColumn),new k(i,s,r,a)}intersectRanges(t){return k.intersectRanges(this,t)}static intersectRanges(t,n){let i=t.startLineNumber,s=t.startColumn,r=t.endLineNumber,a=t.endColumn;const u=n.startLineNumber,o=n.startColumn,c=n.endLineNumber,h=n.endColumn;return ic?(r=c,a=h):r===c&&(a=Math.min(a,h)),i>r||i===r&&s>a?null:new k(i,s,r,a)}equalsRange(t){return k.equalsRange(this,t)}static equalsRange(t,n){return!t&&!n?!0:!!t&&!!n&&t.startLineNumber===n.startLineNumber&&t.startColumn===n.startColumn&&t.endLineNumber===n.endLineNumber&&t.endColumn===n.endColumn}getEndPosition(){return k.getEndPosition(this)}static getEndPosition(t){return new j(t.endLineNumber,t.endColumn)}getStartPosition(){return k.getStartPosition(this)}static getStartPosition(t){return new j(t.startLineNumber,t.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(t,n){return new k(this.startLineNumber,this.startColumn,t,n)}setStartPosition(t,n){return new k(t,n,this.endLineNumber,this.endColumn)}collapseToStart(){return k.collapseToStart(this)}static collapseToStart(t){return new k(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return k.collapseToEnd(this)}static collapseToEnd(t){return new k(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new k(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}static fromPositions(t,n=t){return new k(t.lineNumber,t.column,n.lineNumber,n.column)}static lift(t){return t?new k(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(t){return t&&typeof t.startLineNumber=="number"&&typeof t.startColumn=="number"&&typeof t.endLineNumber=="number"&&typeof t.endColumn=="number"}static areIntersectingOrTouching(t,n){return!(t.endLineNumbert.startLineNumber}toJSON(){return this}}class t1{constructor(t){this.values=t,this.prefixSum=new Uint32Array(t.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(t,n){t=Ce(t);const i=this.values,s=this.prefixSum,r=n.length;return r===0?!1:(this.values=new Uint32Array(i.length+r),this.values.set(i.subarray(0,t),0),this.values.set(i.subarray(t),t+r),this.values.set(n,t),t-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(t,n){return t=Ce(t),n=Ce(n),this.values[t]===n?!1:(this.values[t]=n,t-1=i.length)return!1;const r=i.length-t;return n>=r&&(n=r),n===0?!1:(this.values=new Uint32Array(i.length-n),this.values.set(i.subarray(0,t),0),this.values.set(i.subarray(t+n),t),this.prefixSum=new Uint32Array(this.values.length),t-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(t){return t<0?0:(t=Ce(t),this._getPrefixSum(t))}_getPrefixSum(t){if(t<=this.prefixSumValidIndex[0])return this.prefixSum[t];let n=this.prefixSumValidIndex[0]+1;n===0&&(this.prefixSum[0]=this.values[0],n++),t>=this.values.length&&(t=this.values.length-1);for(let i=n;i<=t;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],t),this.prefixSum[t]}getIndexOf(t){t=Math.floor(t),this.getTotalSum();let n=0,i=this.values.length-1,s=0,r=0,a=0;for(;n<=i;)if(s=n+(i-n)/2|0,r=this.prefixSum[s],a=r-this.values[s],t=r)n=s+1;else break;return new n1(s,t-a)}}class n1{constructor(t,n){this.index=t,this.remainder=n,this._prefixSumIndexOfResultBrand=void 0,this.index=t,this.remainder=n}}class i1{constructor(t,n,i,s){this._uri=t,this._lines=n,this._eol=i,this._versionId=s,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(t){t.eol&&t.eol!==this._eol&&(this._eol=t.eol,this._lineStarts=null);const n=t.changes;for(const i of n)this._acceptDeleteRange(i.range),this._acceptInsertText(new j(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=t.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const t=this._eol.length,n=this._lines.length,i=new Uint32Array(n);for(let s=0;s/?";function r1(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of s1)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}const Mi=r1();function Fi(e){let t=Mi;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const ki=new el;ki.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function vn(e,t,n,i,s){if(t=Fi(t),s||(s=Bt.first(ki)),n.length>s.maxLen){let c=e-s.maxLen/2;return c<0?c=0:i+=c,n=n.substring(c,e+s.maxLen/2),vn(e,t,n,i,s)}const r=Date.now(),a=e-1-i;let u=-1,o=null;for(let c=1;!(Date.now()-r>=s.timeBudget);c++){const h=a-s.windowSize*c;t.lastIndex=Math.max(0,h);const f=l1(t,n,a,u);if(!f&&o||(o=f,h<=0))break;u=h}if(o){const c={word:o[0],startColumn:i+1+o.index,endColumn:i+1+o.index+o[0].length};return t.lastIndex=0,c}return null}function l1(e,t,n,i){let s;for(;s=e.exec(t);){const r=s.index||0;if(r<=n&&e.lastIndex>=n)return s;if(i>0&&r>i)return null}return null}class Un{constructor(t){const n=oi(t);this._defaultValue=n,this._asciiMap=Un._createAsciiMap(n),this._map=new Map}static _createAsciiMap(t){const n=new Uint8Array(256);return n.fill(t),n}set(t,n){const i=oi(n);t>=0&&t<256?this._asciiMap[t]=i:this._map.set(t,i)}get(t){return t>=0&&t<256?this._asciiMap[t]:this._map.get(t)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var Ii;(function(e){e[e.False=0]="False",e[e.True=1]="True"})(Ii||(Ii={}));var P;(function(e){e[e.Invalid=0]="Invalid",e[e.Start=1]="Start",e[e.H=2]="H",e[e.HT=3]="HT",e[e.HTT=4]="HTT",e[e.HTTP=5]="HTTP",e[e.F=6]="F",e[e.FI=7]="FI",e[e.FIL=8]="FIL",e[e.BeforeColon=9]="BeforeColon",e[e.AfterColon=10]="AfterColon",e[e.AlmostThere=11]="AlmostThere",e[e.End=12]="End",e[e.Accept=13]="Accept",e[e.LastKnownState=14]="LastKnownState"})(P||(P={}));class a1{constructor(t,n,i){const s=new Uint8Array(t*n);for(let r=0,a=t*n;rn&&(n=o),u>i&&(i=u),c>i&&(i=c)}n++,i++;const s=new a1(i,n,P.Invalid);for(let r=0,a=t.length;r=this._maxCharCode?P.Invalid:this._states.get(t,n)}}let Dn=null;function o1(){return Dn===null&&(Dn=new u1([[P.Start,d.h,P.H],[P.Start,d.H,P.H],[P.Start,d.f,P.F],[P.Start,d.F,P.F],[P.H,d.t,P.HT],[P.H,d.T,P.HT],[P.HT,d.t,P.HTT],[P.HT,d.T,P.HTT],[P.HTT,d.p,P.HTTP],[P.HTT,d.P,P.HTTP],[P.HTTP,d.s,P.BeforeColon],[P.HTTP,d.S,P.BeforeColon],[P.HTTP,d.Colon,P.AfterColon],[P.F,d.i,P.FI],[P.F,d.I,P.FI],[P.FI,d.l,P.FIL],[P.FI,d.L,P.FIL],[P.FIL,d.e,P.BeforeColon],[P.FIL,d.E,P.BeforeColon],[P.BeforeColon,d.Colon,P.AfterColon],[P.AfterColon,d.Slash,P.AlmostThere],[P.AlmostThere,d.Slash,P.End]])),Dn}var Q;(function(e){e[e.None=0]="None",e[e.ForceTermination=1]="ForceTermination",e[e.CannotEndIn=2]="CannotEndIn"})(Q||(Q={}));let Rt=null;function c1(){if(Rt===null){Rt=new Un(Q.None);const e=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let n=0;ns);if(s>0){const u=n.charCodeAt(s-1),o=n.charCodeAt(a);(u===d.OpenParen&&o===d.CloseParen||u===d.OpenSquareBracket&&o===d.CloseSquareBracket||u===d.OpenCurlyBrace&&o===d.CloseCurlyBrace)&&a--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:a+2},url:n.substring(s,a+1)}}static computeLinks(t,n=o1()){const i=c1(),s=[];for(let r=1,a=t.getLineCount();r<=a;r++){const u=t.getLineContent(r),o=u.length;let c=0,h=0,f=0,_=P.Start,b=!1,L=!1,N=!1,A=!1;for(;c=0?(s+=i?1:-1,s<0?s=t.length-1:s%=t.length,t[s]):null}};ln.INSTANCE=new ln;let Tn=ln;var m;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(m||(m={}));var g;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.None=0]="None",e[e.Hyper=1]="Hyper",e[e.Super=2]="Super",e[e.Fn=3]="Fn",e[e.FnLock=4]="FnLock",e[e.Suspend=5]="Suspend",e[e.Resume=6]="Resume",e[e.Turbo=7]="Turbo",e[e.Sleep=8]="Sleep",e[e.WakeUp=9]="WakeUp",e[e.KeyA=10]="KeyA",e[e.KeyB=11]="KeyB",e[e.KeyC=12]="KeyC",e[e.KeyD=13]="KeyD",e[e.KeyE=14]="KeyE",e[e.KeyF=15]="KeyF",e[e.KeyG=16]="KeyG",e[e.KeyH=17]="KeyH",e[e.KeyI=18]="KeyI",e[e.KeyJ=19]="KeyJ",e[e.KeyK=20]="KeyK",e[e.KeyL=21]="KeyL",e[e.KeyM=22]="KeyM",e[e.KeyN=23]="KeyN",e[e.KeyO=24]="KeyO",e[e.KeyP=25]="KeyP",e[e.KeyQ=26]="KeyQ",e[e.KeyR=27]="KeyR",e[e.KeyS=28]="KeyS",e[e.KeyT=29]="KeyT",e[e.KeyU=30]="KeyU",e[e.KeyV=31]="KeyV",e[e.KeyW=32]="KeyW",e[e.KeyX=33]="KeyX",e[e.KeyY=34]="KeyY",e[e.KeyZ=35]="KeyZ",e[e.Digit1=36]="Digit1",e[e.Digit2=37]="Digit2",e[e.Digit3=38]="Digit3",e[e.Digit4=39]="Digit4",e[e.Digit5=40]="Digit5",e[e.Digit6=41]="Digit6",e[e.Digit7=42]="Digit7",e[e.Digit8=43]="Digit8",e[e.Digit9=44]="Digit9",e[e.Digit0=45]="Digit0",e[e.Enter=46]="Enter",e[e.Escape=47]="Escape",e[e.Backspace=48]="Backspace",e[e.Tab=49]="Tab",e[e.Space=50]="Space",e[e.Minus=51]="Minus",e[e.Equal=52]="Equal",e[e.BracketLeft=53]="BracketLeft",e[e.BracketRight=54]="BracketRight",e[e.Backslash=55]="Backslash",e[e.IntlHash=56]="IntlHash",e[e.Semicolon=57]="Semicolon",e[e.Quote=58]="Quote",e[e.Backquote=59]="Backquote",e[e.Comma=60]="Comma",e[e.Period=61]="Period",e[e.Slash=62]="Slash",e[e.CapsLock=63]="CapsLock",e[e.F1=64]="F1",e[e.F2=65]="F2",e[e.F3=66]="F3",e[e.F4=67]="F4",e[e.F5=68]="F5",e[e.F6=69]="F6",e[e.F7=70]="F7",e[e.F8=71]="F8",e[e.F9=72]="F9",e[e.F10=73]="F10",e[e.F11=74]="F11",e[e.F12=75]="F12",e[e.PrintScreen=76]="PrintScreen",e[e.ScrollLock=77]="ScrollLock",e[e.Pause=78]="Pause",e[e.Insert=79]="Insert",e[e.Home=80]="Home",e[e.PageUp=81]="PageUp",e[e.Delete=82]="Delete",e[e.End=83]="End",e[e.PageDown=84]="PageDown",e[e.ArrowRight=85]="ArrowRight",e[e.ArrowLeft=86]="ArrowLeft",e[e.ArrowDown=87]="ArrowDown",e[e.ArrowUp=88]="ArrowUp",e[e.NumLock=89]="NumLock",e[e.NumpadDivide=90]="NumpadDivide",e[e.NumpadMultiply=91]="NumpadMultiply",e[e.NumpadSubtract=92]="NumpadSubtract",e[e.NumpadAdd=93]="NumpadAdd",e[e.NumpadEnter=94]="NumpadEnter",e[e.Numpad1=95]="Numpad1",e[e.Numpad2=96]="Numpad2",e[e.Numpad3=97]="Numpad3",e[e.Numpad4=98]="Numpad4",e[e.Numpad5=99]="Numpad5",e[e.Numpad6=100]="Numpad6",e[e.Numpad7=101]="Numpad7",e[e.Numpad8=102]="Numpad8",e[e.Numpad9=103]="Numpad9",e[e.Numpad0=104]="Numpad0",e[e.NumpadDecimal=105]="NumpadDecimal",e[e.IntlBackslash=106]="IntlBackslash",e[e.ContextMenu=107]="ContextMenu",e[e.Power=108]="Power",e[e.NumpadEqual=109]="NumpadEqual",e[e.F13=110]="F13",e[e.F14=111]="F14",e[e.F15=112]="F15",e[e.F16=113]="F16",e[e.F17=114]="F17",e[e.F18=115]="F18",e[e.F19=116]="F19",e[e.F20=117]="F20",e[e.F21=118]="F21",e[e.F22=119]="F22",e[e.F23=120]="F23",e[e.F24=121]="F24",e[e.Open=122]="Open",e[e.Help=123]="Help",e[e.Select=124]="Select",e[e.Again=125]="Again",e[e.Undo=126]="Undo",e[e.Cut=127]="Cut",e[e.Copy=128]="Copy",e[e.Paste=129]="Paste",e[e.Find=130]="Find",e[e.AudioVolumeMute=131]="AudioVolumeMute",e[e.AudioVolumeUp=132]="AudioVolumeUp",e[e.AudioVolumeDown=133]="AudioVolumeDown",e[e.NumpadComma=134]="NumpadComma",e[e.IntlRo=135]="IntlRo",e[e.KanaMode=136]="KanaMode",e[e.IntlYen=137]="IntlYen",e[e.Convert=138]="Convert",e[e.NonConvert=139]="NonConvert",e[e.Lang1=140]="Lang1",e[e.Lang2=141]="Lang2",e[e.Lang3=142]="Lang3",e[e.Lang4=143]="Lang4",e[e.Lang5=144]="Lang5",e[e.Abort=145]="Abort",e[e.Props=146]="Props",e[e.NumpadParenLeft=147]="NumpadParenLeft",e[e.NumpadParenRight=148]="NumpadParenRight",e[e.NumpadBackspace=149]="NumpadBackspace",e[e.NumpadMemoryStore=150]="NumpadMemoryStore",e[e.NumpadMemoryRecall=151]="NumpadMemoryRecall",e[e.NumpadMemoryClear=152]="NumpadMemoryClear",e[e.NumpadMemoryAdd=153]="NumpadMemoryAdd",e[e.NumpadMemorySubtract=154]="NumpadMemorySubtract",e[e.NumpadClear=155]="NumpadClear",e[e.NumpadClearEntry=156]="NumpadClearEntry",e[e.ControlLeft=157]="ControlLeft",e[e.ShiftLeft=158]="ShiftLeft",e[e.AltLeft=159]="AltLeft",e[e.MetaLeft=160]="MetaLeft",e[e.ControlRight=161]="ControlRight",e[e.ShiftRight=162]="ShiftRight",e[e.AltRight=163]="AltRight",e[e.MetaRight=164]="MetaRight",e[e.BrightnessUp=165]="BrightnessUp",e[e.BrightnessDown=166]="BrightnessDown",e[e.MediaPlay=167]="MediaPlay",e[e.MediaRecord=168]="MediaRecord",e[e.MediaFastForward=169]="MediaFastForward",e[e.MediaRewind=170]="MediaRewind",e[e.MediaTrackNext=171]="MediaTrackNext",e[e.MediaTrackPrevious=172]="MediaTrackPrevious",e[e.MediaStop=173]="MediaStop",e[e.Eject=174]="Eject",e[e.MediaPlayPause=175]="MediaPlayPause",e[e.MediaSelect=176]="MediaSelect",e[e.LaunchMail=177]="LaunchMail",e[e.LaunchApp2=178]="LaunchApp2",e[e.LaunchApp1=179]="LaunchApp1",e[e.SelectTask=180]="SelectTask",e[e.LaunchScreenSaver=181]="LaunchScreenSaver",e[e.BrowserSearch=182]="BrowserSearch",e[e.BrowserHome=183]="BrowserHome",e[e.BrowserBack=184]="BrowserBack",e[e.BrowserForward=185]="BrowserForward",e[e.BrowserStop=186]="BrowserStop",e[e.BrowserRefresh=187]="BrowserRefresh",e[e.BrowserFavorites=188]="BrowserFavorites",e[e.ZoomToggle=189]="ZoomToggle",e[e.MailReply=190]="MailReply",e[e.MailForward=191]="MailForward",e[e.MailSend=192]="MailSend",e[e.MAX_VALUE=193]="MAX_VALUE"})(g||(g={}));class Mn{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,n){this._keyCodeToStr[t]=n,this._strToKeyCode[n.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||m.Unknown}}const Yt=new Mn,Fn=new Mn,kn=new Mn,h1=new Array(230),m1=Object.create(null),g1=Object.create(null),In=[];for(let e=0;e<=g.MAX_VALUE;e++)m.DependsOnKbLayout;for(let e=0;e<=m.MAX_VALUE;e++)In[e]=g.DependsOnKbLayout;(function(){const e="",t=[[1,g.None,"None",m.Unknown,"unknown",0,"VK_UNKNOWN",e,e],[1,g.Hyper,"Hyper",m.Unknown,e,0,e,e,e],[1,g.Super,"Super",m.Unknown,e,0,e,e,e],[1,g.Fn,"Fn",m.Unknown,e,0,e,e,e],[1,g.FnLock,"FnLock",m.Unknown,e,0,e,e,e],[1,g.Suspend,"Suspend",m.Unknown,e,0,e,e,e],[1,g.Resume,"Resume",m.Unknown,e,0,e,e,e],[1,g.Turbo,"Turbo",m.Unknown,e,0,e,e,e],[1,g.Sleep,"Sleep",m.Unknown,e,0,"VK_SLEEP",e,e],[1,g.WakeUp,"WakeUp",m.Unknown,e,0,e,e,e],[0,g.KeyA,"KeyA",m.KeyA,"A",65,"VK_A",e,e],[0,g.KeyB,"KeyB",m.KeyB,"B",66,"VK_B",e,e],[0,g.KeyC,"KeyC",m.KeyC,"C",67,"VK_C",e,e],[0,g.KeyD,"KeyD",m.KeyD,"D",68,"VK_D",e,e],[0,g.KeyE,"KeyE",m.KeyE,"E",69,"VK_E",e,e],[0,g.KeyF,"KeyF",m.KeyF,"F",70,"VK_F",e,e],[0,g.KeyG,"KeyG",m.KeyG,"G",71,"VK_G",e,e],[0,g.KeyH,"KeyH",m.KeyH,"H",72,"VK_H",e,e],[0,g.KeyI,"KeyI",m.KeyI,"I",73,"VK_I",e,e],[0,g.KeyJ,"KeyJ",m.KeyJ,"J",74,"VK_J",e,e],[0,g.KeyK,"KeyK",m.KeyK,"K",75,"VK_K",e,e],[0,g.KeyL,"KeyL",m.KeyL,"L",76,"VK_L",e,e],[0,g.KeyM,"KeyM",m.KeyM,"M",77,"VK_M",e,e],[0,g.KeyN,"KeyN",m.KeyN,"N",78,"VK_N",e,e],[0,g.KeyO,"KeyO",m.KeyO,"O",79,"VK_O",e,e],[0,g.KeyP,"KeyP",m.KeyP,"P",80,"VK_P",e,e],[0,g.KeyQ,"KeyQ",m.KeyQ,"Q",81,"VK_Q",e,e],[0,g.KeyR,"KeyR",m.KeyR,"R",82,"VK_R",e,e],[0,g.KeyS,"KeyS",m.KeyS,"S",83,"VK_S",e,e],[0,g.KeyT,"KeyT",m.KeyT,"T",84,"VK_T",e,e],[0,g.KeyU,"KeyU",m.KeyU,"U",85,"VK_U",e,e],[0,g.KeyV,"KeyV",m.KeyV,"V",86,"VK_V",e,e],[0,g.KeyW,"KeyW",m.KeyW,"W",87,"VK_W",e,e],[0,g.KeyX,"KeyX",m.KeyX,"X",88,"VK_X",e,e],[0,g.KeyY,"KeyY",m.KeyY,"Y",89,"VK_Y",e,e],[0,g.KeyZ,"KeyZ",m.KeyZ,"Z",90,"VK_Z",e,e],[0,g.Digit1,"Digit1",m.Digit1,"1",49,"VK_1",e,e],[0,g.Digit2,"Digit2",m.Digit2,"2",50,"VK_2",e,e],[0,g.Digit3,"Digit3",m.Digit3,"3",51,"VK_3",e,e],[0,g.Digit4,"Digit4",m.Digit4,"4",52,"VK_4",e,e],[0,g.Digit5,"Digit5",m.Digit5,"5",53,"VK_5",e,e],[0,g.Digit6,"Digit6",m.Digit6,"6",54,"VK_6",e,e],[0,g.Digit7,"Digit7",m.Digit7,"7",55,"VK_7",e,e],[0,g.Digit8,"Digit8",m.Digit8,"8",56,"VK_8",e,e],[0,g.Digit9,"Digit9",m.Digit9,"9",57,"VK_9",e,e],[0,g.Digit0,"Digit0",m.Digit0,"0",48,"VK_0",e,e],[1,g.Enter,"Enter",m.Enter,"Enter",13,"VK_RETURN",e,e],[1,g.Escape,"Escape",m.Escape,"Escape",27,"VK_ESCAPE",e,e],[1,g.Backspace,"Backspace",m.Backspace,"Backspace",8,"VK_BACK",e,e],[1,g.Tab,"Tab",m.Tab,"Tab",9,"VK_TAB",e,e],[1,g.Space,"Space",m.Space,"Space",32,"VK_SPACE",e,e],[0,g.Minus,"Minus",m.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,g.Equal,"Equal",m.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,g.BracketLeft,"BracketLeft",m.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,g.BracketRight,"BracketRight",m.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,g.Backslash,"Backslash",m.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,g.IntlHash,"IntlHash",m.Unknown,e,0,e,e,e],[0,g.Semicolon,"Semicolon",m.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,g.Quote,"Quote",m.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,g.Backquote,"Backquote",m.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,g.Comma,"Comma",m.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,g.Period,"Period",m.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,g.Slash,"Slash",m.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,g.CapsLock,"CapsLock",m.CapsLock,"CapsLock",20,"VK_CAPITAL",e,e],[1,g.F1,"F1",m.F1,"F1",112,"VK_F1",e,e],[1,g.F2,"F2",m.F2,"F2",113,"VK_F2",e,e],[1,g.F3,"F3",m.F3,"F3",114,"VK_F3",e,e],[1,g.F4,"F4",m.F4,"F4",115,"VK_F4",e,e],[1,g.F5,"F5",m.F5,"F5",116,"VK_F5",e,e],[1,g.F6,"F6",m.F6,"F6",117,"VK_F6",e,e],[1,g.F7,"F7",m.F7,"F7",118,"VK_F7",e,e],[1,g.F8,"F8",m.F8,"F8",119,"VK_F8",e,e],[1,g.F9,"F9",m.F9,"F9",120,"VK_F9",e,e],[1,g.F10,"F10",m.F10,"F10",121,"VK_F10",e,e],[1,g.F11,"F11",m.F11,"F11",122,"VK_F11",e,e],[1,g.F12,"F12",m.F12,"F12",123,"VK_F12",e,e],[1,g.PrintScreen,"PrintScreen",m.Unknown,e,0,e,e,e],[1,g.ScrollLock,"ScrollLock",m.ScrollLock,"ScrollLock",145,"VK_SCROLL",e,e],[1,g.Pause,"Pause",m.PauseBreak,"PauseBreak",19,"VK_PAUSE",e,e],[1,g.Insert,"Insert",m.Insert,"Insert",45,"VK_INSERT",e,e],[1,g.Home,"Home",m.Home,"Home",36,"VK_HOME",e,e],[1,g.PageUp,"PageUp",m.PageUp,"PageUp",33,"VK_PRIOR",e,e],[1,g.Delete,"Delete",m.Delete,"Delete",46,"VK_DELETE",e,e],[1,g.End,"End",m.End,"End",35,"VK_END",e,e],[1,g.PageDown,"PageDown",m.PageDown,"PageDown",34,"VK_NEXT",e,e],[1,g.ArrowRight,"ArrowRight",m.RightArrow,"RightArrow",39,"VK_RIGHT","Right",e],[1,g.ArrowLeft,"ArrowLeft",m.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",e],[1,g.ArrowDown,"ArrowDown",m.DownArrow,"DownArrow",40,"VK_DOWN","Down",e],[1,g.ArrowUp,"ArrowUp",m.UpArrow,"UpArrow",38,"VK_UP","Up",e],[1,g.NumLock,"NumLock",m.NumLock,"NumLock",144,"VK_NUMLOCK",e,e],[1,g.NumpadDivide,"NumpadDivide",m.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE",e,e],[1,g.NumpadMultiply,"NumpadMultiply",m.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[1,g.NumpadSubtract,"NumpadSubtract",m.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[1,g.NumpadAdd,"NumpadAdd",m.NumpadAdd,"NumPad_Add",107,"VK_ADD",e,e],[1,g.NumpadEnter,"NumpadEnter",m.Enter,e,0,e,e,e],[1,g.Numpad1,"Numpad1",m.Numpad1,"NumPad1",97,"VK_NUMPAD1",e,e],[1,g.Numpad2,"Numpad2",m.Numpad2,"NumPad2",98,"VK_NUMPAD2",e,e],[1,g.Numpad3,"Numpad3",m.Numpad3,"NumPad3",99,"VK_NUMPAD3",e,e],[1,g.Numpad4,"Numpad4",m.Numpad4,"NumPad4",100,"VK_NUMPAD4",e,e],[1,g.Numpad5,"Numpad5",m.Numpad5,"NumPad5",101,"VK_NUMPAD5",e,e],[1,g.Numpad6,"Numpad6",m.Numpad6,"NumPad6",102,"VK_NUMPAD6",e,e],[1,g.Numpad7,"Numpad7",m.Numpad7,"NumPad7",103,"VK_NUMPAD7",e,e],[1,g.Numpad8,"Numpad8",m.Numpad8,"NumPad8",104,"VK_NUMPAD8",e,e],[1,g.Numpad9,"Numpad9",m.Numpad9,"NumPad9",105,"VK_NUMPAD9",e,e],[1,g.Numpad0,"Numpad0",m.Numpad0,"NumPad0",96,"VK_NUMPAD0",e,e],[1,g.NumpadDecimal,"NumpadDecimal",m.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[0,g.IntlBackslash,"IntlBackslash",m.IntlBackslash,"OEM_102",226,"VK_OEM_102",e,e],[1,g.ContextMenu,"ContextMenu",m.ContextMenu,"ContextMenu",93,e,e,e],[1,g.Power,"Power",m.Unknown,e,0,e,e,e],[1,g.NumpadEqual,"NumpadEqual",m.Unknown,e,0,e,e,e],[1,g.F13,"F13",m.F13,"F13",124,"VK_F13",e,e],[1,g.F14,"F14",m.F14,"F14",125,"VK_F14",e,e],[1,g.F15,"F15",m.F15,"F15",126,"VK_F15",e,e],[1,g.F16,"F16",m.F16,"F16",127,"VK_F16",e,e],[1,g.F17,"F17",m.F17,"F17",128,"VK_F17",e,e],[1,g.F18,"F18",m.F18,"F18",129,"VK_F18",e,e],[1,g.F19,"F19",m.F19,"F19",130,"VK_F19",e,e],[1,g.F20,"F20",m.F20,"F20",131,"VK_F20",e,e],[1,g.F21,"F21",m.F21,"F21",132,"VK_F21",e,e],[1,g.F22,"F22",m.F22,"F22",133,"VK_F22",e,e],[1,g.F23,"F23",m.F23,"F23",134,"VK_F23",e,e],[1,g.F24,"F24",m.F24,"F24",135,"VK_F24",e,e],[1,g.Open,"Open",m.Unknown,e,0,e,e,e],[1,g.Help,"Help",m.Unknown,e,0,e,e,e],[1,g.Select,"Select",m.Unknown,e,0,e,e,e],[1,g.Again,"Again",m.Unknown,e,0,e,e,e],[1,g.Undo,"Undo",m.Unknown,e,0,e,e,e],[1,g.Cut,"Cut",m.Unknown,e,0,e,e,e],[1,g.Copy,"Copy",m.Unknown,e,0,e,e,e],[1,g.Paste,"Paste",m.Unknown,e,0,e,e,e],[1,g.Find,"Find",m.Unknown,e,0,e,e,e],[1,g.AudioVolumeMute,"AudioVolumeMute",m.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[1,g.AudioVolumeUp,"AudioVolumeUp",m.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[1,g.AudioVolumeDown,"AudioVolumeDown",m.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[1,g.NumpadComma,"NumpadComma",m.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[0,g.IntlRo,"IntlRo",m.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1",e,e],[1,g.KanaMode,"KanaMode",m.Unknown,e,0,e,e,e],[0,g.IntlYen,"IntlYen",m.Unknown,e,0,e,e,e],[1,g.Convert,"Convert",m.Unknown,e,0,e,e,e],[1,g.NonConvert,"NonConvert",m.Unknown,e,0,e,e,e],[1,g.Lang1,"Lang1",m.Unknown,e,0,e,e,e],[1,g.Lang2,"Lang2",m.Unknown,e,0,e,e,e],[1,g.Lang3,"Lang3",m.Unknown,e,0,e,e,e],[1,g.Lang4,"Lang4",m.Unknown,e,0,e,e,e],[1,g.Lang5,"Lang5",m.Unknown,e,0,e,e,e],[1,g.Abort,"Abort",m.Unknown,e,0,e,e,e],[1,g.Props,"Props",m.Unknown,e,0,e,e,e],[1,g.NumpadParenLeft,"NumpadParenLeft",m.Unknown,e,0,e,e,e],[1,g.NumpadParenRight,"NumpadParenRight",m.Unknown,e,0,e,e,e],[1,g.NumpadBackspace,"NumpadBackspace",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryStore,"NumpadMemoryStore",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryRecall,"NumpadMemoryRecall",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryClear,"NumpadMemoryClear",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryAdd,"NumpadMemoryAdd",m.Unknown,e,0,e,e,e],[1,g.NumpadMemorySubtract,"NumpadMemorySubtract",m.Unknown,e,0,e,e,e],[1,g.NumpadClear,"NumpadClear",m.Clear,"Clear",12,"VK_CLEAR",e,e],[1,g.NumpadClearEntry,"NumpadClearEntry",m.Unknown,e,0,e,e,e],[1,g.None,e,m.Ctrl,"Ctrl",17,"VK_CONTROL",e,e],[1,g.None,e,m.Shift,"Shift",16,"VK_SHIFT",e,e],[1,g.None,e,m.Alt,"Alt",18,"VK_MENU",e,e],[1,g.None,e,m.Meta,"Meta",91,"VK_COMMAND",e,e],[1,g.ControlLeft,"ControlLeft",m.Ctrl,e,0,"VK_LCONTROL",e,e],[1,g.ShiftLeft,"ShiftLeft",m.Shift,e,0,"VK_LSHIFT",e,e],[1,g.AltLeft,"AltLeft",m.Alt,e,0,"VK_LMENU",e,e],[1,g.MetaLeft,"MetaLeft",m.Meta,e,0,"VK_LWIN",e,e],[1,g.ControlRight,"ControlRight",m.Ctrl,e,0,"VK_RCONTROL",e,e],[1,g.ShiftRight,"ShiftRight",m.Shift,e,0,"VK_RSHIFT",e,e],[1,g.AltRight,"AltRight",m.Alt,e,0,"VK_RMENU",e,e],[1,g.MetaRight,"MetaRight",m.Meta,e,0,"VK_RWIN",e,e],[1,g.BrightnessUp,"BrightnessUp",m.Unknown,e,0,e,e,e],[1,g.BrightnessDown,"BrightnessDown",m.Unknown,e,0,e,e,e],[1,g.MediaPlay,"MediaPlay",m.Unknown,e,0,e,e,e],[1,g.MediaRecord,"MediaRecord",m.Unknown,e,0,e,e,e],[1,g.MediaFastForward,"MediaFastForward",m.Unknown,e,0,e,e,e],[1,g.MediaRewind,"MediaRewind",m.Unknown,e,0,e,e,e],[1,g.MediaTrackNext,"MediaTrackNext",m.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[1,g.MediaTrackPrevious,"MediaTrackPrevious",m.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[1,g.MediaStop,"MediaStop",m.MediaStop,"MediaStop",178,"VK_MEDIA_STOP",e,e],[1,g.Eject,"Eject",m.Unknown,e,0,e,e,e],[1,g.MediaPlayPause,"MediaPlayPause",m.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[1,g.MediaSelect,"MediaSelect",m.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[1,g.LaunchMail,"LaunchMail",m.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[1,g.LaunchApp2,"LaunchApp2",m.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[1,g.LaunchApp1,"LaunchApp1",m.Unknown,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[1,g.SelectTask,"SelectTask",m.Unknown,e,0,e,e,e],[1,g.LaunchScreenSaver,"LaunchScreenSaver",m.Unknown,e,0,e,e,e],[1,g.BrowserSearch,"BrowserSearch",m.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[1,g.BrowserHome,"BrowserHome",m.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[1,g.BrowserBack,"BrowserBack",m.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[1,g.BrowserForward,"BrowserForward",m.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[1,g.BrowserStop,"BrowserStop",m.Unknown,e,0,"VK_BROWSER_STOP",e,e],[1,g.BrowserRefresh,"BrowserRefresh",m.Unknown,e,0,"VK_BROWSER_REFRESH",e,e],[1,g.BrowserFavorites,"BrowserFavorites",m.Unknown,e,0,"VK_BROWSER_FAVORITES",e,e],[1,g.ZoomToggle,"ZoomToggle",m.Unknown,e,0,e,e,e],[1,g.MailReply,"MailReply",m.Unknown,e,0,e,e,e],[1,g.MailForward,"MailForward",m.Unknown,e,0,e,e,e],[1,g.MailSend,"MailSend",m.Unknown,e,0,e,e,e],[1,g.None,e,m.KEY_IN_COMPOSITION,"KeyInComposition",229,e,e,e],[1,g.None,e,m.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2",e,e],[1,g.None,e,m.OEM_8,"OEM_8",223,"VK_OEM_8",e,e],[1,g.None,e,m.Unknown,e,0,"VK_KANA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HANGUL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_JUNJA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_FINAL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HANJA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_KANJI",e,e],[1,g.None,e,m.Unknown,e,0,"VK_CONVERT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_NONCONVERT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ACCEPT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_MODECHANGE",e,e],[1,g.None,e,m.Unknown,e,0,"VK_SELECT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PRINT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EXECUTE",e,e],[1,g.None,e,m.Unknown,e,0,"VK_SNAPSHOT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HELP",e,e],[1,g.None,e,m.Unknown,e,0,"VK_APPS",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PROCESSKEY",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PACKET",e,e],[1,g.None,e,m.Unknown,e,0,"VK_DBE_SBCSCHAR",e,e],[1,g.None,e,m.Unknown,e,0,"VK_DBE_DBCSCHAR",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ATTN",e,e],[1,g.None,e,m.Unknown,e,0,"VK_CRSEL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EXSEL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EREOF",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PLAY",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ZOOM",e,e],[1,g.None,e,m.Unknown,e,0,"VK_NONAME",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PA1",e,e],[1,g.None,e,m.Unknown,e,0,"VK_OEM_CLEAR",e,e]],n=[],i=[];for(const s of t){const[r,a,u,o,c,h,f,_,b]=s;if(i[a]||(i[a]=!0,m1[u]=a,g1[u.toLowerCase()]=a,r&&o!==m.Unknown&&o!==m.Enter&&o!==m.Ctrl&&o!==m.Shift&&o!==m.Alt&&o!==m.Meta&&(In[o]=a)),!n[o]){if(n[o]=!0,!c)throw new Error(`String representation missing for key code ${o} around scan code ${u}`);Yt.define(o,c),Fn.define(o,_||c),kn.define(o,b||_||c)}h&&(h1[h]=o)}In[m.Enter]=g.Enter})();var Si;(function(e){function t(u){return Yt.keyCodeToStr(u)}e.toString=t;function n(u){return Yt.strToKeyCode(u)}e.fromString=n;function i(u){return Fn.keyCodeToStr(u)}e.toUserSettingsUS=i;function s(u){return kn.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function r(u){return Fn.strToKeyCode(u)||kn.strToKeyCode(u)}e.fromUserSettings=r;function a(u){if(u>=m.Numpad0&&u<=m.NumpadDivide)return null;switch(u){case m.UpArrow:return"Up";case m.DownArrow:return"Down";case m.LeftArrow:return"Left";case m.RightArrow:return"Right"}return Yt.keyCodeToStr(u)}e.toElectronAccelerator=a})(Si||(Si={}));var it;(function(e){e[e.CtrlCmd=2048]="CtrlCmd",e[e.Shift=1024]="Shift",e[e.Alt=512]="Alt",e[e.WinCtrl=256]="WinCtrl"})(it||(it={}));function _1(e,t){const n=(t&65535)<<16>>>0;return(e|n)>>>0}var Ve;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(Ve||(Ve={}));class ge extends k{constructor(t,n,i,s){super(t,n,i,s),this.selectionStartLineNumber=t,this.selectionStartColumn=n,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(t){return ge.selectionsEqual(this,t)}static selectionsEqual(t,n){return t.selectionStartLineNumber===n.selectionStartLineNumber&&t.selectionStartColumn===n.selectionStartColumn&&t.positionLineNumber===n.positionLineNumber&&t.positionColumn===n.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?Ve.LTR:Ve.RTL}setEndPosition(t,n){return this.getDirection()===Ve.LTR?new ge(this.startLineNumber,this.startColumn,t,n):new ge(t,n,this.startLineNumber,this.startColumn)}getPosition(){return new j(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new j(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,n){return this.getDirection()===Ve.LTR?new ge(t,n,this.endLineNumber,this.endColumn):new ge(this.endLineNumber,this.endColumn,t,n)}static fromPositions(t,n=t){return new ge(t.lineNumber,t.column,n.lineNumber,n.column)}static fromRange(t,n){return n===Ve.LTR?new ge(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new ge(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new ge(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)}static selectionsArrEqual(t,n){if(t&&!n||!t&&n)return!1;if(!t&&!n)return!0;if(t.length!==n.length)return!1;for(let i=0,s=t.length;i{this._tokenizationSupports.get(t)===n&&(this._tokenizationSupports.delete(t),this.handleChange([t]))})}get(t){return this._tokenizationSupports.get(t)||null}registerFactory(t,n){this._factories.get(t)?.dispose();const i=new N1(this,t,n);return this._factories.set(t,i),Pt(()=>{const s=this._factories.get(t);!s||s!==i||(this._factories.delete(t),s.dispose())})}async getOrCreate(t){const n=this.get(t);if(n)return n;const i=this._factories.get(t);return!i||i.isResolved?null:(await i.resolve(),this.get(t))}isResolved(t){if(this.get(t))return!0;const i=this._factories.get(t);return!!(!i||i.isResolved)}setColorMap(t){this._colorMap=t,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Qt.DefaultBackground?this._colorMap[Qt.DefaultBackground]:null}}class N1 extends Ze{get isResolved(){return this._isResolved}constructor(t,n,i){super(),this._registry=t,this._languageId=n,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const t=await this._factory.tokenizationSupport;this._isResolved=!0,t&&!this._isDisposed&&this._register(this._registry.register(this._languageId,t))}}const p1=globalThis._VSCODE_NLS_LANGUAGE==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Hi(e,t){let n;return t.length===0?n=e:n=e.replace(/\{(\d+)\}/g,(i,s)=>{const r=s[0],a=t[r];let u=i;return typeof a=="string"?u=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(u=String(a)),u}),p1&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function Z(e,t,...n){return Hi(typeof e=="number"?w1(e,t):t,n)}function w1(e,t){const n=globalThis._VSCODE_NLS_MESSAGES?.[e];if(typeof n!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${e} !!!`)}return n}class E1{constructor(t,n,i){this.offset=t,this.type=n,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}var qi;(function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"})(qi||(qi={}));var F;(function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"})(F||(F={}));var Wi;(function(e){const t=new Map;t.set(F.Method,B.symbolMethod),t.set(F.Function,B.symbolFunction),t.set(F.Constructor,B.symbolConstructor),t.set(F.Field,B.symbolField),t.set(F.Variable,B.symbolVariable),t.set(F.Class,B.symbolClass),t.set(F.Struct,B.symbolStruct),t.set(F.Interface,B.symbolInterface),t.set(F.Module,B.symbolModule),t.set(F.Property,B.symbolProperty),t.set(F.Event,B.symbolEvent),t.set(F.Operator,B.symbolOperator),t.set(F.Unit,B.symbolUnit),t.set(F.Value,B.symbolValue),t.set(F.Enum,B.symbolEnum),t.set(F.Constant,B.symbolConstant),t.set(F.Enum,B.symbolEnum),t.set(F.EnumMember,B.symbolEnumMember),t.set(F.Keyword,B.symbolKeyword),t.set(F.Snippet,B.symbolSnippet),t.set(F.Text,B.symbolText),t.set(F.Color,B.symbolColor),t.set(F.File,B.symbolFile),t.set(F.Reference,B.symbolReference),t.set(F.Customcolor,B.symbolCustomColor),t.set(F.Folder,B.symbolFolder),t.set(F.TypeParameter,B.symbolTypeParameter),t.set(F.User,B.account),t.set(F.Issue,B.issues);function n(r){let a=t.get(r);return a||(console.info("No codicon found for CompletionItemKind "+r),a=B.symbolProperty),a}e.toIcon=n;const i=new Map;i.set("method",F.Method),i.set("function",F.Function),i.set("constructor",F.Constructor),i.set("field",F.Field),i.set("variable",F.Variable),i.set("class",F.Class),i.set("struct",F.Struct),i.set("interface",F.Interface),i.set("module",F.Module),i.set("property",F.Property),i.set("event",F.Event),i.set("operator",F.Operator),i.set("unit",F.Unit),i.set("value",F.Value),i.set("constant",F.Constant),i.set("enum",F.Enum),i.set("enum-member",F.EnumMember),i.set("enumMember",F.EnumMember),i.set("keyword",F.Keyword),i.set("snippet",F.Snippet),i.set("text",F.Text),i.set("color",F.Color),i.set("file",F.File),i.set("reference",F.Reference),i.set("customcolor",F.Customcolor),i.set("folder",F.Folder),i.set("type-parameter",F.TypeParameter),i.set("typeParameter",F.TypeParameter),i.set("account",F.User),i.set("issue",F.Issue);function s(r,a){let u=i.get(r);return typeof u>"u"&&!a&&(u=F.Property),u}e.fromString=s})(Wi||(Wi={}));var Gi;(function(e){e[e.Deprecated=1]="Deprecated"})(Gi||(Gi={}));var $i;(function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"})($i||($i={}));var zi;(function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"})(zi||(zi={}));var ji;(function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(ji||(ji={}));var Xi;(function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"})(Xi||(Xi={}));var Yi;(function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"})(Yi||(Yi={}));var Qi;(function(e){e[e.Automatic=0]="Automatic",e[e.PasteAs=1]="PasteAs"})(Qi||(Qi={}));var Zi;(function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"})(Zi||(Zi={}));var Ji;(function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"})(Ji||(Ji={}));var y;(function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"})(y||(y={})),y.Array+"",Z(1658,"array"),y.Boolean+"",Z(1659,"boolean"),y.Class+"",Z(1660,"class"),y.Constant+"",Z(1661,"constant"),y.Constructor+"",Z(1662,"constructor"),y.Enum+"",Z(1663,"enumeration"),y.EnumMember+"",Z(1664,"enumeration member"),y.Event+"",Z(1665,"event"),y.Field+"",Z(1666,"field"),y.File+"",Z(1667,"file"),y.Function+"",Z(1668,"function"),y.Interface+"",Z(1669,"interface"),y.Key+"",Z(1670,"key"),y.Method+"",Z(1671,"method"),y.Module+"",Z(1672,"module"),y.Namespace+"",Z(1673,"namespace"),y.Null+"",Z(1674,"null"),y.Number+"",Z(1675,"number"),y.Object+"",Z(1676,"object"),y.Operator+"",Z(1677,"operator"),y.Package+"",Z(1678,"package"),y.Property+"",Z(1679,"property"),y.String+"",Z(1680,"string"),y.Struct+"",Z(1681,"struct"),y.TypeParameter+"",Z(1682,"type parameter"),y.Variable+"",Z(1683,"variable");var Ki;(function(e){e[e.Deprecated=1]="Deprecated"})(Ki||(Ki={}));var Ci;(function(e){const t=new Map;t.set(y.File,B.symbolFile),t.set(y.Module,B.symbolModule),t.set(y.Namespace,B.symbolNamespace),t.set(y.Package,B.symbolPackage),t.set(y.Class,B.symbolClass),t.set(y.Method,B.symbolMethod),t.set(y.Property,B.symbolProperty),t.set(y.Field,B.symbolField),t.set(y.Constructor,B.symbolConstructor),t.set(y.Enum,B.symbolEnum),t.set(y.Interface,B.symbolInterface),t.set(y.Function,B.symbolFunction),t.set(y.Variable,B.symbolVariable),t.set(y.Constant,B.symbolConstant),t.set(y.String,B.symbolString),t.set(y.Number,B.symbolNumber),t.set(y.Boolean,B.symbolBoolean),t.set(y.Array,B.symbolArray),t.set(y.Object,B.symbolObject),t.set(y.Key,B.symbolKey),t.set(y.Null,B.symbolNull),t.set(y.EnumMember,B.symbolEnumMember),t.set(y.Struct,B.symbolStruct),t.set(y.Event,B.symbolEvent),t.set(y.Operator,B.symbolOperator),t.set(y.TypeParameter,B.symbolTypeParameter);function n(i){let s=t.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=B.symbolProperty),s}e.toIcon=n})(Ci||(Ci={}));const we=class we{static fromValue(t){switch(t){case"comment":return we.Comment;case"imports":return we.Imports;case"region":return we.Region}return new we(t)}constructor(t){this.value=t}};we.Comment=new we("comment"),we.Imports=new we("imports"),we.Region=new we("region");let es=we;var ts;(function(e){e[e.AIGenerated=1]="AIGenerated"})(ts||(ts={}));var ns;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(ns||(ns={}));var is;(function(e){function t(n){return!n||typeof n!="object"?!1:typeof n.id=="string"&&typeof n.title=="string"}e.is=t})(is||(is={}));var ss;(function(e){e[e.Collapsed=0]="Collapsed",e[e.Expanded=1]="Expanded"})(ss||(ss={}));var rs;(function(e){e[e.Unresolved=0]="Unresolved",e[e.Resolved=1]="Resolved"})(rs||(rs={}));var ls;(function(e){e[e.Current=0]="Current",e[e.Outdated=1]="Outdated"})(ls||(ls={}));var as;(function(e){e[e.Editing=0]="Editing",e[e.Preview=1]="Preview"})(as||(as={}));var us;(function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"})(us||(us={})),new L1;var os;(function(e){e[e.None=0]="None",e[e.Option=1]="Option",e[e.Default=2]="Default",e[e.Preferred=3]="Preferred"})(os||(os={}));var cs;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(cs||(cs={}));var fs;(function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"})(fs||(fs={}));var hs;(function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"})(hs||(hs={}));var ms;(function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"})(ms||(ms={}));var gs;(function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"})(gs||(gs={}));var _s;(function(e){e[e.Deprecated=1]="Deprecated"})(_s||(_s={}));var bs;(function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(bs||(bs={}));var ds;(function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"})(ds||(ds={}));var Ls;(function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"})(Ls||(Ls={}));var Ns;(function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(Ns||(Ns={}));var ps;(function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"})(ps||(ps={}));var ws;(function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"})(ws||(ws={}));var Es;(function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.inlineEdit=63]="inlineEdit",e[e.letterSpacing=64]="letterSpacing",e[e.lightbulb=65]="lightbulb",e[e.lineDecorationsWidth=66]="lineDecorationsWidth",e[e.lineHeight=67]="lineHeight",e[e.lineNumbers=68]="lineNumbers",e[e.lineNumbersMinChars=69]="lineNumbersMinChars",e[e.linkedEditing=70]="linkedEditing",e[e.links=71]="links",e[e.matchBrackets=72]="matchBrackets",e[e.minimap=73]="minimap",e[e.mouseStyle=74]="mouseStyle",e[e.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=76]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",e[e.multiCursorModifier=78]="multiCursorModifier",e[e.multiCursorPaste=79]="multiCursorPaste",e[e.multiCursorLimit=80]="multiCursorLimit",e[e.occurrencesHighlight=81]="occurrencesHighlight",e[e.overviewRulerBorder=82]="overviewRulerBorder",e[e.overviewRulerLanes=83]="overviewRulerLanes",e[e.padding=84]="padding",e[e.pasteAs=85]="pasteAs",e[e.parameterHints=86]="parameterHints",e[e.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",e[e.placeholder=88]="placeholder",e[e.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",e[e.quickSuggestions=90]="quickSuggestions",e[e.quickSuggestionsDelay=91]="quickSuggestionsDelay",e[e.readOnly=92]="readOnly",e[e.readOnlyMessage=93]="readOnlyMessage",e[e.renameOnType=94]="renameOnType",e[e.renderControlCharacters=95]="renderControlCharacters",e[e.renderFinalNewline=96]="renderFinalNewline",e[e.renderLineHighlight=97]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=99]="renderValidationDecorations",e[e.renderWhitespace=100]="renderWhitespace",e[e.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",e[e.roundedSelection=102]="roundedSelection",e[e.rulers=103]="rulers",e[e.scrollbar=104]="scrollbar",e[e.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=106]="scrollBeyondLastLine",e[e.scrollPredominantAxis=107]="scrollPredominantAxis",e[e.selectionClipboard=108]="selectionClipboard",e[e.selectionHighlight=109]="selectionHighlight",e[e.selectOnLineNumbers=110]="selectOnLineNumbers",e[e.showFoldingControls=111]="showFoldingControls",e[e.showUnused=112]="showUnused",e[e.snippetSuggestions=113]="snippetSuggestions",e[e.smartSelect=114]="smartSelect",e[e.smoothScrolling=115]="smoothScrolling",e[e.stickyScroll=116]="stickyScroll",e[e.stickyTabStops=117]="stickyTabStops",e[e.stopRenderingLineAfter=118]="stopRenderingLineAfter",e[e.suggest=119]="suggest",e[e.suggestFontSize=120]="suggestFontSize",e[e.suggestLineHeight=121]="suggestLineHeight",e[e.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",e[e.suggestSelection=123]="suggestSelection",e[e.tabCompletion=124]="tabCompletion",e[e.tabIndex=125]="tabIndex",e[e.unicodeHighlighting=126]="unicodeHighlighting",e[e.unusualLineTerminators=127]="unusualLineTerminators",e[e.useShadowDOM=128]="useShadowDOM",e[e.useTabStops=129]="useTabStops",e[e.wordBreak=130]="wordBreak",e[e.wordSegmenterLocales=131]="wordSegmenterLocales",e[e.wordSeparators=132]="wordSeparators",e[e.wordWrap=133]="wordWrap",e[e.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=136]="wordWrapColumn",e[e.wordWrapOverride1=137]="wordWrapOverride1",e[e.wordWrapOverride2=138]="wordWrapOverride2",e[e.wrappingIndent=139]="wrappingIndent",e[e.wrappingStrategy=140]="wrappingStrategy",e[e.showDeprecated=141]="showDeprecated",e[e.inlayHints=142]="inlayHints",e[e.editorClassName=143]="editorClassName",e[e.pixelRatio=144]="pixelRatio",e[e.tabFocusMode=145]="tabFocusMode",e[e.layoutInfo=146]="layoutInfo",e[e.wrappingInfo=147]="wrappingInfo",e[e.defaultColorDecorators=148]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(Es||(Es={}));var As;(function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(As||(As={}));var xs;(function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"})(xs||(xs={}));var Rs;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"})(Rs||(Rs={}));var vs;(function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"})(vs||(vs={}));var Us;(function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"})(Us||(Us={}));var Ds;(function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"})(Ds||(Ds={}));var Ts;(function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"})(Ts||(Ts={}));var Ms;(function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"})(Ms||(Ms={}));var Fs;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(Fs||(Fs={}));var Sn;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(Sn||(Sn={}));var Bn;(function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"})(Bn||(Bn={}));var Pn;(function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"})(Pn||(Pn={}));var ks;(function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"})(ks||(ks={}));var Is;(function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"})(Is||(Is={}));var Ss;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Ss||(Ss={}));var Bs;(function(e){e[e.AIGenerated=1]="AIGenerated"})(Bs||(Bs={}));var Ps;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(Ps||(Ps={}));var ys;(function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"})(ys||(ys={}));var Os;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"})(Os||(Os={}));var Vs;(function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"})(Vs||(Vs={}));var Hs;(function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"})(Hs||(Hs={}));var qs;(function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"})(qs||(qs={}));var Ws;(function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"})(Ws||(Ws={}));var Gs;(function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"})(Gs||(Gs={}));var $s;(function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"})($s||($s={}));var yn;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(yn||(yn={}));var zs;(function(e){e.Off="off",e.OnCode="onCode",e.On="on"})(zs||(zs={}));var js;(function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"})(js||(js={}));var Xs;(function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"})(Xs||(Xs={}));var Ys;(function(e){e[e.Deprecated=1]="Deprecated"})(Ys||(Ys={}));var Qs;(function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"})(Qs||(Qs={}));var Zs;(function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"})(Zs||(Zs={}));var Js;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Js||(Js={}));var Ks;(function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"})(Ks||(Ks={}));const ht=class ht{static chord(t,n){return _1(t,n)}};ht.CtrlCmd=it.CtrlCmd,ht.Shift=it.Shift,ht.Alt=it.Alt,ht.WinCtrl=it.WinCtrl;let On=ht;function A1(){return{editor:void 0,languages:void 0,CancellationTokenSource:bl,Emitter:Ee,KeyCode:Sn,KeyMod:On,Position:j,Range:k,Selection:ge,SelectionDirection:yn,MarkerSeverity:Bn,MarkerTag:Pn,Uri:$e,Token:E1}}var st;(function(e){e[e.Regular=0]="Regular",e[e.Whitespace=1]="Whitespace",e[e.WordSeparator=2]="WordSeparator"})(st||(st={})),new Kr(10);var Cs;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"})(Cs||(Cs={}));var er;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"})(er||(er={}));var tr;(function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"})(tr||(tr={}));var nr;(function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"})(nr||(nr={}));var ir;(function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"})(ir||(ir={}));var sr;(function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(sr||(sr={}));var rr;(function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(rr||(rr={}));var lr;(function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"})(lr||(lr={}));var ar;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(ar||(ar={}));var ur;(function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"})(ur||(ur={}));var or;(function(e){e[e.FIRST_LINE_DETECTION_LENGTH_LIMIT=1e3]="FIRST_LINE_DETECTION_LENGTH_LIMIT"})(or||(or={}));function x1(e,t,n,i,s){if(i===0)return!0;const r=t.charCodeAt(i-1);if(e.get(r)!==st.Regular||r===d.CarriageReturn||r===d.LineFeed)return!0;if(s>0){const a=t.charCodeAt(i);if(e.get(a)!==st.Regular)return!0}return!1}function R1(e,t,n,i,s){if(i+s===n)return!0;const r=t.charCodeAt(i+s);if(e.get(r)!==st.Regular||r===d.CarriageReturn||r===d.LineFeed)return!0;if(s>0){const a=t.charCodeAt(i+s-1);if(e.get(a)!==st.Regular)return!0}return!1}function v1(e,t,n,i,s){return x1(e,t,n,i,s)&&R1(e,t,n,i,s)}class U1{constructor(t,n){this._wordSeparators=t,this._searchRegex=n,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(t){this._searchRegex.lastIndex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(t){const n=t.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===n||(i=this._searchRegex.exec(t),!i))return null;const s=i.index,r=i[0].length;if(s===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){Al(t,n,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=r,!this._wordSeparators||v1(this._wordSeparators,t,n,s,r))return i}while(i);return null}}function D1(e,t="Unreachable"){throw new Error(t)}function Zt(e){if(!e()){debugger;e(),It(new ce("Assertion Failed"))}}function cr(e,t){let n=0;for(;n0){const $=R.charCodeAt(p-1);Gt($)&&p--}if(w+1=1e3){f=!0;break e}h.push(new k(A,p+1,A,w+1))}}while(_)}return{ranges:h,hasMore:f,ambiguousCharacterCount:b,invisibleCharacterCount:L,nonBasicAsciiCharacterCount:N}}static computeUnicodeHighlightReason(t,n){const i=new fr(n);switch(i.shouldHighlightNonBasicASCII(t,null)){case ue.None:return null;case ue.Invisible:return{kind:vt.Invisible};case ue.Ambiguous:{const r=t.codePointAt(0),a=i.ambiguousCharacters.getPrimaryConfusable(r),u=Et.getLocales().filter(o=>!Et.getInstance(new Set([...n.allowedLocales,o])).isAmbiguous(r));return{kind:vt.Ambiguous,confusableWith:String.fromCodePoint(a),notAmbiguousInLocales:u}}case ue.NonBasicASCII:return{kind:vt.NonBasicAscii}}}}function M1(e,t){return`[${Nl(e.map(i=>String.fromCodePoint(i)).join(""))}]`}var vt;(function(e){e[e.Ambiguous=0]="Ambiguous",e[e.Invisible=1]="Invisible",e[e.NonBasicAscii=2]="NonBasicAscii"})(vt||(vt={}));class fr{constructor(t){this.options=t,this.allowedCodePoints=new Set(t.allowedCodePoints),this.ambiguousCharacters=Et.getInstance(new Set(t.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const t=new Set;if(this.options.invisibleCharacters)for(const n of At.codePoints)hr(String.fromCodePoint(n))||t.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())t.add(n);for(const n of this.allowedCodePoints)t.delete(n);return t}shouldHighlightNonBasicASCII(t,n){const i=t.codePointAt(0);if(this.allowedCodePoints.has(i))return ue.None;if(this.options.nonBasicASCII)return ue.NonBasicASCII;let s=!1,r=!1;if(n)for(const a of n){const u=a.codePointAt(0),o=Rl(a);s=s||o,!o&&!this.ambiguousCharacters.isAmbiguous(u)&&!At.isInvisibleCharacter(u)&&(r=!0)}return!s&&r?ue.None:this.options.invisibleCharacters&&!hr(t)&&At.isInvisibleCharacter(i)?ue.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?ue.Ambiguous:ue.None}}function hr(e){return e===" "||e===` +`||e===" "}var ue;(function(e){e[e.None=0]="None",e[e.NonBasicASCII=1]="NonBasicASCII",e[e.Invisible=2]="Invisible",e[e.Ambiguous=3]="Ambiguous"})(ue||(ue={}));class Jt{constructor(t,n,i){this.changes=t,this.moves=n,this.hitTimeout=i}}class Vn{constructor(t,n){this.lineRangeMapping=t,this.changes=n}flip(){return new Vn(this.lineRangeMapping.flip(),this.changes.map(t=>t.flip()))}}class W{static addRange(t,n){let i=0;for(;in))return new W(t,n)}static ofLength(t){return new W(0,t)}static ofStartAndLength(t,n){return new W(t,t+n)}constructor(t,n){if(this.start=t,this.endExclusive=n,t>n)throw new ce(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new W(this.start+t,this.endExclusive+t)}deltaStart(t){return new W(this.start+t,this.endExclusive)}deltaEnd(t){return new W(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(t){return this.start===t.start&&this.endExclusive===t.endExclusive}containsRange(t){return this.start<=t.start&&t.endExclusive<=this.endExclusive}contains(t){return this.start<=t&&t=t.endExclusive}slice(t){return t.slice(this.start,this.endExclusive)}substring(t){return t.substring(this.start,this.endExclusive)}clip(t){if(this.isEmpty)throw new ce(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,t))}clipCyclic(t){if(this.isEmpty)throw new ce(`Invalid clipping range: ${this.toString()}`);return t=this.endExclusive?this.start+(t-this.start)%this.length:t}map(t){const n=[];for(let i=this.start;in)throw new ce(`startLineNumber ${t} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=t,this.endLineNumberExclusive=n}contains(t){return this.startLineNumber<=t&&ts.endLineNumberExclusive>=t.startLineNumber),i=gt(this._normalizedRanges,s=>s.startLineNumber<=t.endLineNumberExclusive)+1;if(n===i)this._normalizedRanges.splice(n,0,t);else if(n===i-1){const s=this._normalizedRanges[n];this._normalizedRanges[n]=s.join(t)}else{const s=this._normalizedRanges[n].join(this._normalizedRanges[i-1]).join(t);this._normalizedRanges.splice(n,i-n,s)}}contains(t){const n=Qe(this._normalizedRanges,i=>i.startLineNumber<=t);return!!n&&n.endLineNumberExclusive>t}intersects(t){const n=Qe(this._normalizedRanges,i=>i.startLineNumbert.startLineNumber}getUnion(t){if(this._normalizedRanges.length===0)return t;if(t._normalizedRanges.length===0)return this;const n=[];let i=0,s=0,r=null;for(;i=a.startLineNumber?r=new V(r.startLineNumber,Math.max(r.endLineNumberExclusive,a.endLineNumberExclusive)):(n.push(r),r=a)}return r!==null&&n.push(r),new ve(n)}subtractFrom(t){const n=fn(this._normalizedRanges,a=>a.endLineNumberExclusive>=t.startLineNumber),i=gt(this._normalizedRanges,a=>a.startLineNumber<=t.endLineNumberExclusive)+1;if(n===i)return new ve([t]);const s=[];let r=t.startLineNumber;for(let a=n;ar&&s.push(new V(r,u.startLineNumber)),r=u.endLineNumberExclusive}return rt.toString()).join(", ")}getIntersection(t){const n=[];let i=0,s=0;for(;in.delta(t)))}}const _e=class _e{static lengthDiffNonNegative(t,n){return n.isLessThan(t)?_e.zero:t.lineCount===n.lineCount?new _e(0,n.columnCount-t.columnCount):new _e(n.lineCount-t.lineCount,n.columnCount)}static betweenPositions(t,n){return t.lineNumber===n.lineNumber?new _e(0,n.column-t.column):new _e(n.lineNumber-t.lineNumber,n.column-1)}static ofRange(t){return _e.betweenPositions(t.getStartPosition(),t.getEndPosition())}static ofText(t){let n=0,i=0;for(const s of t)s===` +`?(n++,i=0):i++;return new _e(n,i)}constructor(t,n){this.lineCount=t,this.columnCount=n}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(t){return this.lineCount!==t.lineCount?this.lineCountt.lineCount:this.columnCount>t.columnCount}isGreaterThanOrEqualTo(t){return this.lineCount!==t.lineCount?this.lineCount>t.lineCount:this.columnCount>=t.columnCount}equals(t){return this.lineCount===t.lineCount&&this.columnCount===t.columnCount}compare(t){return this.lineCount!==t.lineCount?this.lineCount-t.lineCount:this.columnCount-t.columnCount}add(t){return t.lineCount===0?new _e(this.lineCount,this.columnCount+t.columnCount):new _e(this.lineCount+t.lineCount,t.columnCount)}createRange(t){return this.lineCount===0?new k(t.lineNumber,t.column,t.lineNumber,t.column+this.columnCount):new k(t.lineNumber,t.column,t.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new k(1,1,this.lineCount+1,this.columnCount+1)}addToPosition(t){return this.lineCount===0?new j(t.lineNumber,t.column+this.columnCount):new j(t.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};_e.zero=new _e(0,0);let mr=_e;class F1{constructor(t,n){this.range=t,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(t,n){return t.range.equalsRange(n.range)&&t.text===n.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}class Ne{static inverse(t,n,i){const s=[];let r=1,a=1;for(const o of t){const c=new Ne(new V(r,o.original.startLineNumber),new V(a,o.modified.startLineNumber));c.modified.isEmpty||s.push(c),r=o.original.endLineNumberExclusive,a=o.modified.endLineNumberExclusive}const u=new Ne(new V(r,n+1),new V(a,i+1));return u.modified.isEmpty||s.push(u),s}static clip(t,n,i){const s=[];for(const r of t){const a=r.original.intersect(n),u=r.modified.intersect(i);a&&!a.isEmpty&&u&&!u.isEmpty&&s.push(new Ne(a,u))}return s}constructor(t,n){this.original=t,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ne(this.modified,this.original)}join(t){return new Ne(this.original.join(t.original),this.modified.join(t.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const t=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(t&&n)return new xe(t,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new ce("not a valid diff");return new xe(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new xe(new k(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new k(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(t,n){if(gr(this.original.endLineNumberExclusive,t)&&gr(this.modified.endLineNumberExclusive,n))return new xe(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new xe(k.fromPositions(new j(this.original.startLineNumber,1),rt(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),k.fromPositions(new j(this.modified.startLineNumber,1),rt(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new xe(k.fromPositions(rt(new j(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),rt(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),k.fromPositions(rt(new j(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),rt(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new ce}}function rt(e,t){if(e.lineNumber<1)return new j(1,1);if(e.lineNumber>t.length)return new j(t.length,t[t.length-1].length+1);const n=t[e.lineNumber-1];return e.column>n.length+1?new j(e.lineNumber,n.length+1):e}function gr(e,t){return e>=1&&e<=t.length}class Me extends Ne{static fromRangeMappings(t){const n=V.join(t.map(s=>V.fromRangeInclusive(s.originalRange))),i=V.join(t.map(s=>V.fromRangeInclusive(s.modifiedRange)));return new Me(n,i,t)}constructor(t,n,i){super(t,n),this.innerChanges=i}flip(){return new Me(this.modified,this.original,this.innerChanges?.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new Me(this.original,this.modified,[this.toRangeMapping()])}}class xe{static assertSorted(t){for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new xe(this.modifiedRange,this.originalRange)}toTextEdit(t){const n=t.getValueOfRange(this.modifiedRange);return new F1(this.originalRange,n)}}const k1=3;class I1{computeDiff(t,n,i){const r=new dr(t,n,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let u=null;for(const o of r.changes){let c;o.originalEndLineNumber===0?c=new V(o.originalStartLineNumber+1,o.originalStartLineNumber+1):c=new V(o.originalStartLineNumber,o.originalEndLineNumber+1);let h;o.modifiedEndLineNumber===0?h=new V(o.modifiedStartLineNumber+1,o.modifiedStartLineNumber+1):h=new V(o.modifiedStartLineNumber,o.modifiedEndLineNumber+1);let f=new Me(c,h,o.charChanges?.map(_=>new xe(new k(_.originalStartLineNumber,_.originalStartColumn,_.originalEndLineNumber,_.originalEndColumn),new k(_.modifiedStartLineNumber,_.modifiedStartColumn,_.modifiedEndLineNumber,_.modifiedEndColumn))));u&&(u.modified.endLineNumberExclusive===f.modified.startLineNumber||u.original.endLineNumberExclusive===f.original.startLineNumber)&&(f=new Me(u.original.join(f.original),u.modified.join(f.modified),u.innerChanges&&f.innerChanges?u.innerChanges.concat(f.innerChanges):void 0),a.pop()),a.push(f),u=f}return Zt(()=>cr(a,(o,c)=>c.original.startLineNumber-o.original.endLineNumberExclusive===c.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive(t===d.LineFeed?"\\n":String.fromCharCode(t))+`-(${this._lineNumbers[n]},${this._columns[n]})`).join(", ")+"]"}_assertIndex(t,n){if(t<0||t>=n.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(t){return t>0&&t===this._lineNumbers.length?this.getEndLineNumber(t-1):(this._assertIndex(t,this._lineNumbers),this._lineNumbers[t])}getEndLineNumber(t){return t===-1?this.getStartLineNumber(t+1):(this._assertIndex(t,this._lineNumbers),this._charCodes[t]===d.LineFeed?this._lineNumbers[t]+1:this._lineNumbers[t])}getStartColumn(t){return t>0&&t===this._columns.length?this.getEndColumn(t-1):(this._assertIndex(t,this._columns),this._columns[t])}getEndColumn(t){return t===-1?this.getStartColumn(t+1):(this._assertIndex(t,this._columns),this._charCodes[t]===d.LineFeed?1:this._columns[t]+1)}}class lt{constructor(t,n,i,s,r,a,u,o){this.originalStartLineNumber=t,this.originalStartColumn=n,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=r,this.modifiedStartColumn=a,this.modifiedEndLineNumber=u,this.modifiedEndColumn=o}static createFromDiffChange(t,n,i){const s=n.getStartLineNumber(t.originalStart),r=n.getStartColumn(t.originalStart),a=n.getEndLineNumber(t.originalStart+t.originalLength-1),u=n.getEndColumn(t.originalStart+t.originalLength-1),o=i.getStartLineNumber(t.modifiedStart),c=i.getStartColumn(t.modifiedStart),h=i.getEndLineNumber(t.modifiedStart+t.modifiedLength-1),f=i.getEndColumn(t.modifiedStart+t.modifiedLength-1);return new lt(s,r,a,u,o,c,h,f)}}function B1(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let i=1,s=e.length;i0&&n.originalLength<20&&n.modifiedLength>0&&n.modifiedLength<20&&r()){const b=i.createCharSequence(t,n.originalStart,n.originalStart+n.originalLength-1),L=s.createCharSequence(t,n.modifiedStart,n.modifiedStart+n.modifiedLength-1);if(b.getElements().length>0&&L.getElements().length>0){let N=_r(b,L,r,!0).changes;u&&(N=B1(N)),_=[];for(let A=0,x=N.length;A1&&N>1;){const A=_.charCodeAt(L-2),x=b.charCodeAt(N-2);if(A!==x)break;L--,N--}(L>1||N>1)&&this._pushTrimWhitespaceCharChange(s,r+1,1,L,a+1,1,N)}{let L=qn(_,1),N=qn(b,1);const A=_.length+1,x=b.length+1;for(;L!0;const t=Date.now();return()=>Date.now()-t{i.push(C.fromOffsetPairs(s?s.getEndExclusives():ke.zero,r?r.getStarts():new ke(n,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+n)))}),i}static fromOffsetPairs(t,n){return new C(new W(t.offset1,n.offset1),new W(t.offset2,n.offset2))}static assertSorted(t){let n;for(const i of t){if(n&&!(n.seq1Range.endExclusive<=i.seq1Range.start&&n.seq2Range.endExclusive<=i.seq2Range.start))throw new ce("Sequence diffs must be sorted");n=i}}constructor(t,n){this.seq1Range=t,this.seq2Range=n}swap(){return new C(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(t){return new C(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))}delta(t){return t===0?this:new C(this.seq1Range.delta(t),this.seq2Range.delta(t))}deltaStart(t){return t===0?this:new C(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))}deltaEnd(t){return t===0?this:new C(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))}intersectsOrTouches(t){return this.seq1Range.intersectsOrTouches(t.seq1Range)||this.seq2Range.intersectsOrTouches(t.seq2Range)}intersect(t){const n=this.seq1Range.intersect(t.seq1Range),i=this.seq2Range.intersect(t.seq2Range);if(!(!n||!i))return new C(n,i)}getStarts(){return new ke(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new ke(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const Xe=class Xe{constructor(t,n){this.offset1=t,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(t){return t===0?this:new Xe(this.offset1+t,this.offset2+t)}equals(t){return this.offset1===t.offset1&&this.offset2===t.offset2}};Xe.zero=new Xe(0,0),Xe.max=new Xe(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let ke=Xe;const an=class an{isValid(){return!0}};an.instance=new an;let Dt=an;class P1{constructor(t){if(this.timeout=t,this.startTime=Date.now(),this.valid=!0,t<=0)throw new ce("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Wn{constructor(t,n){this.width=t,this.height=n,this.array=[],this.array=new Array(t*n)}get(t,n){return this.array[t+n*this.width]}set(t,n,i){this.array[t+n*this.width]=i}}function Gn(e){return e===d.Space||e===d.Tab}const Ft=class Ft{static getKey(t){let n=this.chrKeys.get(t);return n===void 0&&(n=this.chrKeys.size,this.chrKeys.set(t,n)),n}constructor(t,n,i){this.range=t,this.lines=n,this.source=i,this.histogram=[];let s=0;for(let r=t.startLineNumber-1;r0&&N>0&&a.get(L-1,N-1)===3&&(R+=u.get(L-1,N-1)),R+=s?s(L,N):1):R=-1;const U=Math.max(A,x,R);if(U===R){const p=L>0&&N>0?u.get(L-1,N-1):0;u.set(L,N,p+1),a.set(L,N,3)}else U===A?(u.set(L,N,0),a.set(L,N,1)):U===x&&(u.set(L,N,0),a.set(L,N,2));r.set(L,N,U)}const o=[];let c=t.length,h=n.length;function f(L,N){(L+1!==c||N+1!==h)&&o.push(new C(new W(L+1,c),new W(N+1,h))),c=L,h=N}let _=t.length-1,b=n.length-1;for(;_>=0&&b>=0;)a.get(_,b)===3?(f(_,b),_--,b--):a.get(_,b)===1?_--:b--;return f(-1,-1),o.reverse(),new Fe(o,!1)}}class Nr{compute(t,n,i=Dt.instance){if(t.length===0||n.length===0)return Fe.trivial(t,n);const s=t,r=n;function a(N,A){for(;Ns.length||p>r.length)continue;const w=a(U,p);o.set(h,w);const D=U===x?c.get(h+1):c.get(h-1);if(c.set(h,w!==U?new pr(D,U,p,w-U):D),o.get(h)===s.length&&o.get(h)-h===r.length)break e}}let f=c.get(h);const _=[];let b=s.length,L=r.length;for(;;){const N=f?f.x+f.length:0,A=f?f.y+f.length:0;if((N!==b||A!==L)&&_.push(new C(new W(N,b),new W(A,L))),!f)break;b=f.x,L=f.y,f=f.prev}return _.reverse(),new Fe(_,!1)}}class pr{constructor(t,n,i,s){this.prev=t,this.x=n,this.y=i,this.length=s}}class O1{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){if(t<0){if(t=-t-1,t>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[t]=n}else{if(t>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[t]=n}}}class V1{constructor(){this.positiveArr=[],this.negativeArr=[]}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){t<0?(t=-t-1,this.negativeArr[t]=n):this.positiveArr[t]=n}}class Ct{constructor(t,n,i){this.lines=t,this.range=n,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let s=this.range.startLineNumber;s<=this.range.endLineNumber;s++){let r=t[s-1],a=0;s===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,r=r.substring(a)),this.lineStartOffsets.push(a);let u=0;if(!i){const c=r.trimStart();u=r.length-c.length,r=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(u);const o=s===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-u,r.length):r.length;for(let c=0;cString.fromCharCode(n)).join("")}getElement(t){return this.elements[t]}get length(){return this.elements.length}getBoundaryScore(t){const n=Er(t>0?this.elements[t-1]:-1),i=Er(tr<=t),s=t-this.firstElementOffsetByLineIdx[i];return new j(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+s+(s===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(t){const n=this.translateOffset(t.start,"right"),i=this.translateOffset(t.endExclusive,"left");return i.isBefore(n)?k.fromPositions(i,i):k.fromPositions(n,i)}findWordContaining(t){if(t<0||t>=this.elements.length||!$n(this.elements[t]))return;let n=t;for(;n>0&&$n(this.elements[n-1]);)n--;let i=t;for(;is<=t.start)??0,i=Hr(this.firstElementOffsetByLineIdx,s=>t.endExclusive<=s)??this.elements.length;return new W(n,i)}}function $n(e){return e>=d.a&&e<=d.z||e>=d.A&&e<=d.Z||e>=d.Digit0&&e<=d.Digit9}var K;(function(e){e[e.WordLower=0]="WordLower",e[e.WordUpper=1]="WordUpper",e[e.WordNumber=2]="WordNumber",e[e.End=3]="End",e[e.Other=4]="Other",e[e.Separator=5]="Separator",e[e.Space=6]="Space",e[e.LineBreakCR=7]="LineBreakCR",e[e.LineBreakLF=8]="LineBreakLF"})(K||(K={}));const H1={[K.WordLower]:0,[K.WordUpper]:0,[K.WordNumber]:0,[K.End]:10,[K.Other]:2,[K.Separator]:30,[K.Space]:3,[K.LineBreakCR]:10,[K.LineBreakLF]:10};function wr(e){return H1[e]}function Er(e){return e===d.LineFeed?K.LineBreakLF:e===d.CarriageReturn?K.LineBreakCR:Gn(e)?K.Space:e>=d.a&&e<=d.z?K.WordLower:e>=d.A&&e<=d.Z?K.WordUpper:e>=d.Digit0&&e<=d.Digit9?K.WordNumber:e===-1?K.End:e===d.Comma||e===d.Semicolon?K.Separator:K.Other}function q1(e,t,n,i,s,r){let{moves:a,excludedChanges:u}=G1(e,t,n,r);if(!r.isValid())return[];const o=e.filter(h=>!u.has(h)),c=$1(o,i,s,t,n,r);return zr(a,c),a=z1(a),a=a.filter(h=>{const f=h.original.toOffsetRange().slice(t).map(b=>b.trim());return f.join(` +`).length>=15&&W1(f,b=>b.length>=2)>=2}),a=j1(e,a),a}function W1(e,t){let n=0;for(const i of e)t(i)&&n++;return n}function G1(e,t,n,i){const s=[],r=e.filter(o=>o.modified.isEmpty&&o.original.length>=3).map(o=>new Kt(o.original,t,o)),a=new Set(e.filter(o=>o.original.isEmpty&&o.modified.length>=3).map(o=>new Kt(o.modified,n,o))),u=new Set;for(const o of r){let c=-1,h;for(const f of a){const _=o.computeSimilarity(f);_>c&&(c=_,h=f)}if(c>.9&&h&&(a.delete(h),s.push(new Ne(o.range,h.range)),u.add(o.source),u.add(h.source)),!i.isValid())return{moves:s,excludedChanges:u}}return{moves:s,excludedChanges:u}}function $1(e,t,n,i,s,r){const a=[],u=new ti;for(const _ of e)for(let b=_.original.startLineNumber;b<_.original.endLineNumberExclusive-2;b++){const L=`${t[b-1]}:${t[b+1-1]}:${t[b+2-1]}`;u.add(L,{range:new V(b,b+3)})}const o=[];e.sort(_t(_=>_.modified.startLineNumber,bt));for(const _ of e){let b=[];for(let L=_.modified.startLineNumber;L<_.modified.endLineNumberExclusive-2;L++){const N=`${n[L-1]}:${n[L+1-1]}:${n[L+2-1]}`,A=new V(L,L+3),x=[];u.forEach(N,({range:R})=>{for(const p of b)if(p.originalLineRange.endLineNumberExclusive+1===R.endLineNumberExclusive&&p.modifiedLineRange.endLineNumberExclusive+1===A.endLineNumberExclusive){p.originalLineRange=new V(p.originalLineRange.startLineNumber,R.endLineNumberExclusive),p.modifiedLineRange=new V(p.modifiedLineRange.startLineNumber,A.endLineNumberExclusive),x.push(p);return}const U={modifiedLineRange:A,originalLineRange:R};o.push(U),x.push(U)}),b=x}if(!r.isValid())return[]}o.sort(jr(_t(_=>_.modifiedLineRange.length,bt)));const c=new ve,h=new ve;for(const _ of o){const b=_.modifiedLineRange.startLineNumber-_.originalLineRange.startLineNumber,L=c.subtractFrom(_.modifiedLineRange),N=h.subtractFrom(_.originalLineRange).getWithDelta(b),A=L.getIntersection(N);for(const x of A.ranges){if(x.length<3)continue;const R=x,U=x.delta(-b);a.push(new Ne(U,R)),c.addRange(R),h.addRange(U)}}a.sort(_t(_=>_.original.startLineNumber,bt));const f=new St(e);for(let _=0;_D.original.startLineNumber<=b.original.startLineNumber),N=Qe(e,D=>D.modified.startLineNumber<=b.modified.startLineNumber),A=Math.max(b.original.startLineNumber-L.original.startLineNumber,b.modified.startLineNumber-N.modified.startLineNumber),x=f.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumberi.length||T>s.length||c.contains(T)||h.contains(D)||!Ar(i[D-1],s[T-1],r))break}p>0&&(h.addRange(new V(b.original.startLineNumber-p,b.original.startLineNumber)),c.addRange(new V(b.modified.startLineNumber-p,b.modified.startLineNumber)));let w;for(w=0;wi.length||T>s.length||c.contains(T)||h.contains(D)||!Ar(i[D-1],s[T-1],r))break}w>0&&(h.addRange(new V(b.original.endLineNumberExclusive,b.original.endLineNumberExclusive+w)),c.addRange(new V(b.modified.endLineNumberExclusive,b.modified.endLineNumberExclusive+w))),(p>0||w>0)&&(a[_]=new Ne(new V(b.original.startLineNumber-p,b.original.endLineNumberExclusive+w),new V(b.modified.startLineNumber-p,b.modified.endLineNumberExclusive+w)))}return a}function Ar(e,t,n){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const s=new Nr().compute(new Ct([e],new k(1,1,1,e.length),!1),new Ct([t],new k(1,1,1,t.length),!1),n);let r=0;const a=C.invert(s.diffs,e.length);for(const h of a)h.seq1Range.forEach(f=>{Gn(e.charCodeAt(f))||r++});function u(h){let f=0;for(let _=0;_t.length?e:t);return r/o>.6&&o>10}function z1(e){if(e.length===0)return e;e.sort(_t(n=>n.original.startLineNumber,bt));const t=[e[0]];for(let n=1;n=0&&a>=0&&r+a<=2){t[t.length-1]=i.join(s);continue}t.push(s)}return t}function j1(e,t){const n=new St(e);return t=t.filter(i=>{const s=n.findLastMonotonous(u=>u.original.startLineNumberu.modified.startLineNumber0&&(u=u.delta(c))}s.push(u)}return i.length>0&&s.push(i[i.length-1]),s}function X1(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(let i=0;i0?n[i-1]:void 0,r=n[i],a=i+1=i.start&&e.seq2Range.start-a>=s.start&&n.isStronglyEqual(e.seq2Range.start-a,e.seq2Range.endExclusive-a)&&a<100;)a++;a--;let u=0;for(;e.seq1Range.start+uc&&(c=L,o=h)}return e.delta(o)}function Y1(e,t,n){const i=[];for(const s of n){const r=i[i.length-1];if(!r){i.push(s);continue}s.seq1Range.start-r.seq1Range.endExclusive<=2||s.seq2Range.start-r.seq2Range.endExclusive<=2?i[i.length-1]=new C(r.seq1Range.join(s.seq1Range),r.seq2Range.join(s.seq2Range)):i.push(s)}return i}function Q1(e,t,n){const i=C.invert(n,e.length),s=[];let r=new ke(0,0);function a(o,c){if(o.offset10;){const A=i[0];if(!(A.seq1Range.intersects(_.seq1Range)||A.seq2Range.intersects(_.seq2Range)))break;const R=e.findWordContaining(A.seq1Range.start),U=t.findWordContaining(A.seq2Range.start),p=new C(R,U),w=p.intersect(A);if(L+=w.seq1Range.length,N+=w.seq2Range.length,_=_.join(p),_.seq1Range.endExclusive>=A.seq1Range.endExclusive)i.shift();else break}L+N<(_.seq1Range.length+_.seq2Range.length)*2/3&&s.push(_),r=_.getEndExclusives()}for(;i.length>0;){const o=i.shift();o.seq1Range.isEmpty||(a(o.getStarts(),o),a(o.getEndExclusives().delta(-1),o))}return Z1(n,s)}function Z1(e,t){const n=[];for(;e.length>0||t.length>0;){const i=e[0],s=t[0];let r;i&&(!s||i.seq1Range.start0&&n[n.length-1].seq1Range.endExclusive>=r.seq1Range.start?n[n.length-1]=n[n.length-1].join(r):n.push(r)}return n}function J1(e,t,n){let i=n;if(i.length===0)return i;let s=0,r;do{r=!1;const a=[i[0]];for(let u=1;u5||b.seq1Range.length+b.seq2Range.length>5)};const o=i[u],c=a[a.length-1];h(c,o)?(r=!0,a[a.length-1]=a[a.length-1].join(o)):a.push(o)}i=a}while(s++<10&&r);return i}function K1(e,t,n){let i=n;if(i.length===0)return i;let s=0,r;do{r=!1;const u=[i[0]];for(let o=1;o5||N.length>500)return!1;const x=e.getText(N).trim();if(x.length>20||x.split(/\r\n|\r|\n/).length>1)return!1;const R=e.countLinesIn(b.seq1Range),U=b.seq1Range.length,p=t.countLinesIn(b.seq2Range),w=b.seq2Range.length,D=e.countLinesIn(L.seq1Range),T=L.seq1Range.length,I=t.countLinesIn(L.seq2Range),$=L.seq2Range.length,ie=2*40+50;function z(E){return Math.min(E,ie)}return Math.pow(Math.pow(z(R*40+U),1.5)+Math.pow(z(p*40+w),1.5),1.5)+Math.pow(Math.pow(z(D*40+T),1.5)+Math.pow(z(I*40+$),1.5),1.5)>(ie**1.5)**1.5*1.3};const c=i[o],h=u[u.length-1];f(h,c)?(r=!0,u[u.length-1]=u[u.length-1].join(c)):u.push(c)}i=u}while(s++<10&&r);const a=[];return $r(i,(u,o,c)=>{let h=o;function f(x){return x.length>0&&x.trim().length<=3&&o.seq1Range.length+o.seq2Range.length>100}const _=e.extendToFullLines(o.seq1Range),b=e.getText(new W(_.start,o.seq1Range.start));f(b)&&(h=h.deltaStart(-b.length));const L=e.getText(new W(o.seq1Range.endExclusive,_.endExclusive));f(L)&&(h=h.deltaEnd(L.length));const N=C.fromOffsetPairs(u?u.getEndExclusives():ke.zero,c?c.getStarts():ke.max),A=h.intersect(N);a.length>0&&A.getStarts().equals(a[a.length-1].getEndExclusives())?a[a.length-1]=a[a.length-1].join(A):a.push(A)}),a}class Ur{constructor(t,n){this.trimmedHash=t,this.lines=n}getElement(t){return this.trimmedHash[t]}get length(){return this.trimmedHash.length}getBoundaryScore(t){const n=t===0?0:Dr(this.lines[t-1]),i=t===this.lines.length?0:Dr(this.lines[t]);return 1e3-(n+i)}getText(t){return this.lines.slice(t.start,t.endExclusive).join(` +`)}isStronglyEqual(t,n){return this.lines[t]===this.lines[n]}}function Dr(e){let t=0;for(;tw===D))return new Jt([],[],!1);if(t.length===1&&t[0].length===0||n.length===1&&n[0].length===0)return new Jt([new Me(new V(1,t.length+1),new V(1,n.length+1),[new xe(new k(1,1,t.length,t[t.length-1].length+1),new k(1,1,n.length,n[n.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Dt.instance:new P1(i.maxComputationTimeMs),r=!i.ignoreTrimWhitespace,a=new Map;function u(w){let D=a.get(w);return D===void 0&&(D=a.size,a.set(w,D)),D}const o=t.map(w=>u(w.trim())),c=n.map(w=>u(w.trim())),h=new Ur(o,t),f=new Ur(c,n),_=h.length+f.length<1700?this.dynamicProgrammingDiffing.compute(h,f,s,(w,D)=>t[w]===n[D]?n[D].length===0?.1:1+Math.log(1+n[D].length):.99):this.myersDiffingAlgorithm.compute(h,f,s);let b=_.diffs,L=_.hitTimeout;b=xr(h,f,b),b=J1(h,f,b);const N=[],A=w=>{if(r)for(let D=0;Dw.seq1Range.start-x===w.seq2Range.start-R);const D=w.seq1Range.start-x;A(D),x=w.seq1Range.endExclusive,R=w.seq2Range.endExclusive;const T=this.refineDiff(t,n,w,s,r);T.hitTimeout&&(L=!0);for(const I of T.mappings)N.push(I)}A(t.length-x);const U=Tr(N,t,n);let p=[];return i.computeMoves&&(p=this.computeMoves(U,t,n,o,c,s,r)),Zt(()=>{function w(T,I){if(T.lineNumber<1||T.lineNumber>I.length)return!1;const $=I[T.lineNumber-1];return!(T.column<1||T.column>$.length+1)}function D(T,I){return!(T.startLineNumber<1||T.startLineNumber>I.length+1||T.endLineNumberExclusive<1||T.endLineNumberExclusive>I.length+1)}for(const T of U){if(!T.innerChanges)return!1;for(const I of T.innerChanges)if(!(w(I.modifiedRange.getStartPosition(),n)&&w(I.modifiedRange.getEndPosition(),n)&&w(I.originalRange.getStartPosition(),t)&&w(I.originalRange.getEndPosition(),t)))return!1;if(!D(T.modified,n)||!D(T.original,t))return!1}return!0}),new Jt(U,p,L)}computeMoves(t,n,i,s,r,a,u){return q1(t,n,i,s,r,a).map(h=>{const f=this.refineDiff(n,i,new C(h.original.toOffsetRange(),h.modified.toOffsetRange()),a,u),_=Tr(f.mappings,n,i,!0);return new Vn(h,_)})}refineDiff(t,n,i,s,r){const u=ta(i).toRangeMapping2(t,n),o=new Ct(t,u.originalRange,r),c=new Ct(n,u.modifiedRange,r),h=o.length+c.length<500?this.dynamicProgrammingDiffing.compute(o,c,s):this.myersDiffingAlgorithm.compute(o,c,s);let f=h.diffs;return f=xr(o,c,f),f=Q1(o,c,f),f=Y1(o,c,f),f=K1(o,c,f),{mappings:f.map(b=>new xe(o.translateRange(b.seq1Range),c.translateRange(b.seq2Range))),hitTimeout:h.hitTimeout}}}function Tr(e,t,n,i=!1){const s=[];for(const r of Wr(e.map(a=>ea(a,t,n)),(a,u)=>a.original.overlapOrTouch(u.original)||a.modified.overlapOrTouch(u.modified))){const a=r[0],u=r[r.length-1];s.push(new Me(a.original.join(u.original),a.modified.join(u.modified),r.map(o=>o.innerChanges[0])))}return Zt(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||n.length-s[s.length-1].modified.endLineNumberExclusive!==t.length-s[s.length-1].original.endLineNumberExclusive)?!1:cr(s,(r,a)=>a.original.startLineNumber-r.original.endLineNumberExclusive===a.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=n[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(i=1);const r=new V(e.originalRange.startLineNumber+i,e.originalRange.endLineNumber+1+s),a=new V(e.modifiedRange.startLineNumber+i,e.modifiedRange.endLineNumber+1+s);return new Me(r,a,[e])}function ta(e){return new Ne(new V(e.seq1Range.start+1,e.seq1Range.endExclusive+1),new V(e.seq2Range.start+1,e.seq2Range.endExclusive+1))}const zn={getLegacy:()=>new I1,getDefault:()=>new C1};function He(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}class te{constructor(t,n,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,t))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a}}class pe{constructor(t,n,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,t),0)|0,this.s=He(Math.max(Math.min(1,n),0),3),this.l=He(Math.max(Math.min(1,i),0),3),this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.h===n.h&&t.s===n.s&&t.l===n.l&&t.a===n.a}static fromRGBA(t){const n=t.r/255,i=t.g/255,s=t.b/255,r=t.a,a=Math.max(n,i,s),u=Math.min(n,i,s);let o=0,c=0;const h=(u+a)/2,f=a-u;if(f>0){switch(c=Math.min(h<=.5?f/(2*h):f/(2-2*h),1),a){case n:o=(i-s)/f+(i1&&(i-=1),i<1/6?t+(n-t)*6*i:i<1/2?n:i<2/3?t+(n-t)*(2/3-i)*6:t}static toRGBA(t){const n=t.h/360,{s:i,l:s,a:r}=t;let a,u,o;if(i===0)a=u=o=s;else{const c=s<.5?s*(1+i):s+i-s*i,h=2*s-c;a=pe._hue2rgb(h,c,n+1/3),u=pe._hue2rgb(h,c,n),o=pe._hue2rgb(h,c,n-1/3)}return new te(Math.round(a*255),Math.round(u*255),Math.round(o*255),r)}}class at{constructor(t,n,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,t),0)|0,this.s=He(Math.max(Math.min(1,n),0),3),this.v=He(Math.max(Math.min(1,i),0),3),this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.h===n.h&&t.s===n.s&&t.v===n.v&&t.a===n.a}static fromRGBA(t){const n=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(n,i,s),a=Math.min(n,i,s),u=r-a,o=r===0?0:u/r;let c;return u===0?c=0:r===n?c=((i-s)/u%6+6)%6:r===i?c=(s-n)/u+2:c=(n-i)/u+4,new at(Math.round(c*60),o,r,t.a)}static toRGBA(t){const{h:n,s:i,v:s,a:r}=t,a=s*i,u=a*(1-Math.abs(n/60%2-1)),o=s-a;let[c,h,f]=[0,0,0];return n<60?(c=a,h=u):n<120?(c=u,h=a):n<180?(h=a,f=u):n<240?(h=u,f=a):n<300?(c=u,f=a):n<=360&&(c=a,f=u),c=Math.round((c+o)*255),h=Math.round((h+o)*255),f=Math.round((f+o)*255),new te(c,h,f,r)}}const G=class G{static fromHex(t){return G.Format.CSS.parseHex(t)||G.red}static equals(t,n){return!t&&!n?!0:!t||!n?!1:t.equals(n)}get hsla(){return this._hsla?this._hsla:pe.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:at.fromRGBA(this.rgba)}constructor(t){if(t)if(t instanceof te)this.rgba=t;else if(t instanceof pe)this._hsla=t,this.rgba=pe.toRGBA(t);else if(t instanceof at)this._hsva=t,this.rgba=at.toRGBA(t);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(t){return!!t&&te.equals(this.rgba,t.rgba)&&pe.equals(this.hsla,t.hsla)&&at.equals(this.hsva,t.hsva)}getRelativeLuminance(){const t=G._relativeLuminanceForComponent(this.rgba.r),n=G._relativeLuminanceForComponent(this.rgba.g),i=G._relativeLuminanceForComponent(this.rgba.b),s=.2126*t+.7152*n+.0722*i;return He(s,4)}static _relativeLuminanceForComponent(t){const n=t/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}getContrastRatio(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return n>i}isDarkerThan(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return nG._flatten(s,i));return G._flatten(this,n)}static _flatten(t,n){const i=1-t.rgba.a;return new G(new te(i*n.rgba.r+t.rgba.a*t.rgba.r,i*n.rgba.g+t.rgba.a*t.rgba.g,i*n.rgba.b+t.rgba.a*t.rgba.b))}toString(){return this._toString||(this._toString=G.Format.CSS.format(this)),this._toString}static getLighterColor(t,n,i){if(t.isLighterThan(n))return t;i=i||.5;const s=t.getRelativeLuminance(),r=n.getRelativeLuminance();return i=i*(r-s)/r,t.lighten(i)}static getDarkerColor(t,n,i){if(t.isDarkerThan(n))return t;i=i||.5;const s=t.getRelativeLuminance(),r=n.getRelativeLuminance();return i=i*(s-r)/s,t.darken(i)}};G.white=new G(new te(255,255,255,1)),G.black=new G(new te(0,0,0,1)),G.red=new G(new te(255,0,0,1)),G.blue=new G(new te(0,0,255,1)),G.green=new G(new te(0,255,0,1)),G.cyan=new G(new te(0,255,255,1)),G.lightgrey=new G(new te(211,211,211,1)),G.transparent=new G(new te(0,0,0,0));let ut=G;(function(e){(function(t){(function(n){function i(b){return b.rgba.a===1?`rgb(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b})`:e.Format.CSS.formatRGBA(b)}n.formatRGB=i;function s(b){return`rgba(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b}, ${+b.rgba.a.toFixed(2)})`}n.formatRGBA=s;function r(b){return b.hsla.a===1?`hsl(${b.hsla.h}, ${(b.hsla.s*100).toFixed(2)}%, ${(b.hsla.l*100).toFixed(2)}%)`:e.Format.CSS.formatHSLA(b)}n.formatHSL=r;function a(b){return`hsla(${b.hsla.h}, ${(b.hsla.s*100).toFixed(2)}%, ${(b.hsla.l*100).toFixed(2)}%, ${b.hsla.a.toFixed(2)})`}n.formatHSLA=a;function u(b){const L=b.toString(16);return L.length!==2?"0"+L:L}function o(b){return`#${u(b.rgba.r)}${u(b.rgba.g)}${u(b.rgba.b)}`}n.formatHex=o;function c(b,L=!1){return L&&b.rgba.a===1?e.Format.CSS.formatHex(b):`#${u(b.rgba.r)}${u(b.rgba.g)}${u(b.rgba.b)}${u(Math.round(b.rgba.a*255))}`}n.formatHexA=c;function h(b){return b.isOpaque()?e.Format.CSS.formatHex(b):e.Format.CSS.formatRGBA(b)}n.format=h;function f(b){const L=b.length;if(L===0||b.charCodeAt(0)!==d.Hash)return null;if(L===7){const N=16*_(b.charCodeAt(1))+_(b.charCodeAt(2)),A=16*_(b.charCodeAt(3))+_(b.charCodeAt(4)),x=16*_(b.charCodeAt(5))+_(b.charCodeAt(6));return new e(new te(N,A,x,1))}if(L===9){const N=16*_(b.charCodeAt(1))+_(b.charCodeAt(2)),A=16*_(b.charCodeAt(3))+_(b.charCodeAt(4)),x=16*_(b.charCodeAt(5))+_(b.charCodeAt(6)),R=16*_(b.charCodeAt(7))+_(b.charCodeAt(8));return new e(new te(N,A,x,R/255))}if(L===4){const N=_(b.charCodeAt(1)),A=_(b.charCodeAt(2)),x=_(b.charCodeAt(3));return new e(new te(16*N+N,16*A+A,16*x+x))}if(L===5){const N=_(b.charCodeAt(1)),A=_(b.charCodeAt(2)),x=_(b.charCodeAt(3)),R=_(b.charCodeAt(4));return new e(new te(16*N+N,16*A+A,16*x+x,(16*R+R)/255))}return null}n.parseHex=f;function _(b){switch(b){case d.Digit0:return 0;case d.Digit1:return 1;case d.Digit2:return 2;case d.Digit3:return 3;case d.Digit4:return 4;case d.Digit5:return 5;case d.Digit6:return 6;case d.Digit7:return 7;case d.Digit8:return 8;case d.Digit9:return 9;case d.a:return 10;case d.A:return 10;case d.b:return 11;case d.B:return 11;case d.c:return 12;case d.C:return 12;case d.d:return 13;case d.D:return 13;case d.e:return 14;case d.E:return 14;case d.f:return 15;case d.F:return 15}return 0}})(t.CSS||(t.CSS={}))})(e.Format||(e.Format={}))})(ut||(ut={}));function Mr(e){const t=[];for(const n of e){const i=Number(n);(i||i===0&&n.replace(/\s/g,"")!=="")&&t.push(i)}return t}function jn(e,t,n,i){return{red:e/255,blue:n/255,green:t/255,alpha:i}}function Tt(e,t){const n=t.index,i=t[0].length;if(!n)return;const s=e.positionAt(n);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+i}}function na(e,t){if(!e)return;const n=ut.Format.CSS.parseHex(t);if(n)return{range:e,color:jn(n.rgba.r,n.rgba.g,n.rgba.b,n.rgba.a)}}function Fr(e,t,n){if(!e||t.length!==1)return;const s=t[0].values(),r=Mr(s);return{range:e,color:jn(r[0],r[1],r[2],n?r[3]:1)}}function kr(e,t,n){if(!e||t.length!==1)return;const s=t[0].values(),r=Mr(s),a=new ut(new pe(r[0],r[1]/100,r[2]/100,n?r[3]:1));return{range:e,color:jn(a.rgba.r,a.rgba.g,a.rgba.b,a.rgba.a)}}function Mt(e,t){return typeof e=="string"?[...e.matchAll(t)]:e.findMatches(t)}function ia(e){const t=[],i=Mt(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const s of i){const r=s.filter(c=>c!==void 0),a=r[1],u=r[2];if(!u)continue;let o;if(a==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;o=Fr(Tt(e,s),Mt(u,c),!1)}else if(a==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;o=Fr(Tt(e,s),Mt(u,c),!0)}else if(a==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;o=kr(Tt(e,s),Mt(u,c),!1)}else if(a==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;o=kr(Tt(e,s),Mt(u,c),!0)}else a==="#"&&(o=na(Tt(e,s),a+u));o&&t.push(o)}return t}function sa(e){return!e||typeof e.getValue!="function"||typeof e.positionAt!="function"?[]:ia(e)}const Ir=new RegExp("\\bMARK:\\s*(.*)$","d"),ra=/^-+|-+$/g;function la(e,t){let n=[];if(t.findRegionSectionHeaders&&t.foldingRules?.markers){const i=aa(e,t);n=n.concat(i)}if(t.findMarkSectionHeaders){const i=ua(e);n=n.concat(i)}return n}function aa(e,t){const n=[],i=e.getLineCount();for(let s=1;s<=i;s++){const r=e.getLineContent(s),a=r.match(t.foldingRules.markers.start);if(a){const u={startLineNumber:s,startColumn:a[0].length+1,endLineNumber:s,endColumn:r.length+1};if(u.endColumn>u.startColumn){const o={range:u,...Sr(r.substring(a[0].length)),shouldBeInComments:!1};(o.text||o.hasSeparatorLine)&&n.push(o)}}}return n}function ua(e){const t=[],n=e.getLineCount();for(let i=1;i<=n;i++){const s=e.getLineContent(i);oa(s,i,t)}return t}function oa(e,t,n){Ir.lastIndex=0;const i=Ir.exec(e);if(i){const s=i.indices[1][0]+1,r=i.indices[1][1]+1,a={startLineNumber:t,startColumn:s,endLineNumber:t,endColumn:r};if(a.endColumn>a.startColumn){const u={range:a,...Sr(i[1]),shouldBeInComments:!0};(u.text||u.hasSeparatorLine)&&n.push(u)}}}function Sr(e){e=e.trim();const t=e.startsWith("-");return e=e.replace(ra,""),{text:e,hasSeparatorLine:t}}class ca extends i1{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(t){const n=[];for(let i=0;ithis._lines.length)n=this._lines.length,i=this._lines[n-1].length+1,s=!0;else{const r=this._lines[n-1].length+1;i<1?(i=1,s=!0):i>r&&(i=r,s=!0)}return s?{lineNumber:n,column:i}:t}}const qe=class qe{constructor(t,n){this._host=t,this._models=Object.create(null),this._foreignModuleFactory=n,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(t){return this._models[t]}_getModels(){const t=[];return Object.keys(this._models).forEach(n=>t.push(this._models[n])),t}acceptNewModel(t){this._models[t.url]=new ca($e.parse(t.url),t.lines,t.EOL,t.versionId)}acceptModelChanged(t,n){if(!this._models[t])return;this._models[t].onEvents(n)}acceptRemovedModel(t){this._models[t]&&delete this._models[t]}async computeUnicodeHighlights(t,n,i){const s=this._getModel(t);return s?T1.computeUnicodeHighlights(s,n,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(t,n){const i=this._getModel(t);return i?la(i,n):[]}async computeDiff(t,n,i,s){const r=this._getModel(t),a=this._getModel(n);return!r||!a?null:qe.computeDiff(r,a,i,s)}static computeDiff(t,n,i,s){const r=s==="advanced"?zn.getDefault():zn.getLegacy(),a=t.getLinesContent(),u=n.getLinesContent(),o=r.computeDiff(a,u,i),c=o.changes.length>0?!1:this._modelsAreIdentical(t,n);function h(f){return f.map(_=>[_.original.startLineNumber,_.original.endLineNumberExclusive,_.modified.startLineNumber,_.modified.endLineNumberExclusive,_.innerChanges?.map(b=>[b.originalRange.startLineNumber,b.originalRange.startColumn,b.originalRange.endLineNumber,b.originalRange.endColumn,b.modifiedRange.startLineNumber,b.modifiedRange.startColumn,b.modifiedRange.endLineNumber,b.modifiedRange.endColumn])])}return{identical:c,quitEarly:o.hitTimeout,changes:h(o.changes),moves:o.moves.map(f=>[f.lineRangeMapping.original.startLineNumber,f.lineRangeMapping.original.endLineNumberExclusive,f.lineRangeMapping.modified.startLineNumber,f.lineRangeMapping.modified.endLineNumberExclusive,h(f.changes)])}}static _modelsAreIdentical(t,n){const i=t.getLineCount(),s=n.getLineCount();if(i!==s)return!1;for(let r=1;r<=i;r++){const a=t.getLineContent(r),u=n.getLineContent(r);if(a!==u)return!1}return!0}async computeDirtyDiff(t,n,i){const s=this._getModel(t),r=this._getModel(n);if(!s||!r)return null;const a=s.getLinesContent(),u=r.getLinesContent();return new dr(a,u,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(t,n,i){const s=this._getModel(t);if(!s)return n;const r=[];let a;n=n.slice(0).sort((o,c)=>{if(o.range&&c.range)return k.compareRangesUsingStarts(o.range,c.range);const h=o.range?0:1,f=c.range?0:1;return h-f});let u=0;for(let o=1;oqe._diffLimit){r.push({range:o,text:c});continue}const _=Pl(f,c,i),b=s.offsetAt(k.lift(o).getStartPosition());for(const L of _){const N=s.positionAt(b+L.originalStart),A=s.positionAt(b+L.originalStart+L.originalLength),x={text:c.substr(L.modifiedStart,L.modifiedLength),range:{startLineNumber:N.lineNumber,startColumn:N.column,endLineNumber:A.lineNumber,endColumn:A.column}};s.getValueInRange(x.range)!==x.text&&r.push(x)}}return typeof a=="number"&&r.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}computeHumanReadableDiff(t,n,i){const s=this._getModel(t);if(!s)return n;const r=[];let a;n=n.slice(0).sort((u,o)=>{if(u.range&&o.range)return k.compareRangesUsingStarts(u.range,o.range);const c=u.range?0:1,h=o.range?0:1;return c-h});for(let{range:u,text:o,eol:c}of n){let N=function(x,R){return new j(x.lineNumber+R.lineNumber-1,R.lineNumber===1?x.column+R.column-1:R.column)},A=function(x,R){const U=[];for(let p=R.startLineNumber;p<=R.endLineNumber;p++){const w=x[p-1];p===R.startLineNumber&&p===R.endLineNumber?U.push(w.substring(R.startColumn-1,R.endColumn-1)):p===R.startLineNumber?U.push(w.substring(R.startColumn-1)):p===R.endLineNumber?U.push(w.substring(0,R.endColumn-1)):U.push(w)}return U};if(typeof c=="number"&&(a=c),k.isEmpty(u)&&!o)continue;const h=s.getValueInRange(u);if(o=o.replace(/\r\n|\n|\r/g,s.eol),h===o)continue;if(Math.max(o.length,h.length)>qe._diffLimit){r.push({range:u,text:o});continue}const f=h.split(/\r\n|\n|\r/),_=o.split(/\r\n|\n|\r/),b=zn.getDefault().computeDiff(f,_,i),L=k.lift(u).getStartPosition();for(const x of b.changes)if(x.innerChanges)for(const R of x.innerChanges)r.push({range:k.fromPositions(N(L,R.originalRange.getStartPosition()),N(L,R.originalRange.getEndPosition())),text:A(_,R.modifiedRange).join(s.eol)});else throw new ce("The experimental diff algorithm always produces inner changes")}return typeof a=="number"&&r.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async computeLinks(t){const n=this._getModel(t);return n?f1(n):null}async computeDefaultDocumentColors(t){const n=this._getModel(t);return n?sa(n):null}async textualSuggest(t,n,i,s){const r=new yt,a=new RegExp(i,s),u=new Set;e:for(const o of t){const c=this._getModel(o);if(c){for(const h of c.words(a))if(!(h===n||!isNaN(Number(h)))&&(u.add(h),u.size>qe._suggestionsLimit))break e}}return{words:Array.from(u),duration:r.elapsed()}}async computeWordRanges(t,n,i,s){const r=this._getModel(t);if(!r)return Object.create(null);const a=new RegExp(i,s),u=Object.create(null);for(let o=n.startLineNumber;othis._host.fhr(u,o)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(a,n),Promise.resolve(Ln(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(t,n){if(!this._foreignModule||typeof this._foreignModule[t]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+t));try{return Promise.resolve(this._foreignModule[t].apply(this._foreignModule,n))}catch(i){return Promise.reject(i)}}};qe._diffLimit=1e5,qe._suggestionsLimit=1e4;let Xn=qe;typeof importScripts=="function"&&(globalThis.monaco=A1());let Yn=!1;function fa(e){if(Yn)return;Yn=!0;const t=new Il(n=>{globalThis.postMessage(n)},n=>new Xn(n,e));globalThis.onmessage=n=>{t.onmessage(n.data)}}globalThis.onmessage=e=>{Yn||fa(null)}})(); diff --git a/snapshots/master/editor/assets/monaco_worker-DczdSAeE.js b/snapshots/master/editor/assets/monaco_worker-DczdSAeE.js deleted file mode 100644 index 3c8088db0..000000000 --- a/snapshots/master/editor/assets/monaco_worker-DczdSAeE.js +++ /dev/null @@ -1,29 +0,0 @@ -(function(){"use strict";class Mr{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ye.isErrorNoTelemetry(t)?new Ye(t.message+` - -`+t.stack):new Error(t.message+` - -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(n=>{n(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const Fr=new Mr;function kt(e){kr(e)||Fr.onUnexpectedError(e)}function Xn(e){if(e instanceof Error){const{name:t,message:n}=e,i=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:i,noTelemetry:Ye.isErrorNoTelemetry(e)}}return e}const un="Canceled";function kr(e){return e instanceof Ir?!0:e instanceof Error&&e.name===un&&e.message===un}class Ir extends Error{constructor(){super(un),this.name=this.message}}class Ye extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Ye)return t;const n=new Ye;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}}class Ne extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ne.prototype)}}function Sr(e,t){const n=this;let i=!1,s;return function(){return i||(i=!0,s=e.apply(n,arguments)),s}}function Qe(e,t){const n=mt(e,t);return n===-1?void 0:e[n]}function mt(e,t,n=0,i=e.length){let s=n,r=i;for(;si===s){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let i=0,s=e.length;i0}e.isGreaterThan=i;function s(r){return r===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(cn||(cn={}));function gt(e,t){return(n,i)=>t(e(n),e(i))}const _t=(e,t)=>e-t;function qr(e){return(t,n)=>-e(t,n)}const ut=class ut{constructor(t){this.iterate=t}forEach(t){this.iterate(n=>(t(n),!0))}toArray(){const t=[];return this.iterate(n=>(t.push(n),!0)),t}filter(t){return new ut(n=>this.iterate(i=>t(i)?n(i):!0))}map(t){return new ut(n=>this.iterate(i=>n(t(i))))}some(t){let n=!1;return this.iterate(i=>(n=t(i),!n)),n}findFirst(t){let n;return this.iterate(i=>t(i)?(n=i,!1):!0),n}findLast(t){let n;return this.iterate(i=>(t(i)&&(n=i),!0)),n}findLastMaxBy(t){let n,i=!0;return this.iterate(s=>((i||cn.isGreaterThan(t(s,n)))&&(i=!1,n=s),!0)),n}};ut.empty=new ut(t=>{});let Yn=ut;function Wr(e,t){const n=Object.create(null);for(const i of e){const s=t(i);let r=n[s];r||(r=n[s]=[]),r.push(i)}return n}var Qn,Zn;class Gr{constructor(t,n){this.uri=t,this.value=n}}function zr(e){return Array.isArray(e)}const $e=class $e{constructor(t,n){if(this[Qn]="ResourceMap",t instanceof $e)this.map=new Map(t.map),this.toKey=n??$e.defaultToKey;else if(zr(t)){this.map=new Map,this.toKey=n??$e.defaultToKey;for(const[i,s]of t)this.set(i,s)}else this.map=new Map,this.toKey=t??$e.defaultToKey}set(t,n){return this.map.set(this.toKey(t),new Gr(t,n)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,n){typeof n<"u"&&(t=t.bind(n));for(const[i,s]of this.map)t(s.value,s.uri,this)}*values(){for(const t of this.map.values())yield t.value}*keys(){for(const t of this.map.values())yield t.uri}*entries(){for(const t of this.map.values())yield[t.uri,t.value]}*[(Qn=Symbol.toStringTag,Symbol.iterator)](){for(const[,t]of this.map)yield[t.uri,t.value]}};$e.defaultToKey=t=>t.toString();let Jn=$e;var ae;(function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"})(ae||(ae={}));class $r{constructor(){this[Zn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,n=ae.None){const i=this._map.get(t);if(i)return n!==ae.None&&this.touch(i,n),i.value}set(t,n,i=ae.None){let s=this._map.get(t);if(s)s.value=n,i!==ae.None&&this.touch(s,i);else{switch(s={key:t,value:n,next:void 0,previous:void 0},i){case ae.None:this.addItemLast(s);break;case ae.AsOld:this.addItemFirst(s);break;case ae.AsNew:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(t,s),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){const n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){const i=this._state;let s=this._head;for(;s;){if(n?t.bind(n)(s.value,s.key,this):t(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.key,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}values(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.value,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}entries(){const t=this,n=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(t._state!==n)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:[i.key,i.value],done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}[(Zn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,i=this.size;for(;n&&i>t;)this._map.delete(n.key),n=n.next,i--;this._head=n,this._size=i,n&&(n.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._tail,i=this.size;for(;n&&i>t;)this._map.delete(n.key),n=n.previous,i--;this._tail=n,this._size=i,n&&(n.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{const n=t.next,i=t.previous;if(!n||!i)throw new Error("Invalid list");n.previous=i,i.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ae.AsOld&&n!==ae.AsNew)){if(n===ae.AsOld){if(t===this._head)return;const i=t.next,s=t.previous;t===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===ae.AsNew){if(t===this._tail)return;const i=t.next,s=t.previous;t===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){const t=[];return this.forEach((n,i)=>{t.push([i,n])}),t}fromJSON(t){this.clear();for(const[n,i]of t)this.set(n,i)}}class jr extends $r{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=ae.AsNew){return super.get(t,n)}peek(t){return super.get(t,ae.None)}set(t,n){return super.set(t,n,ae.AsNew),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class Xr extends jr{constructor(t,n=1){super(t,n)}trim(t){this.trimOld(t)}set(t,n){return super.set(t,n),this.checkTrim(),this}}class Kn{constructor(){this.map=new Map}add(t,n){let i=this.map.get(t);i||(i=new Set,this.map.set(t,i)),i.add(n)}delete(t,n){const i=this.map.get(t);i&&(i.delete(n),i.size===0&&this.map.delete(t))}forEach(t,n){const i=this.map.get(t);i&&i.forEach(n)}get(t){const n=this.map.get(t);return n||new Set}}var St;(function(e){function t(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}e.is=t;const n=Object.freeze([]);function i(){return n}e.empty=i;function*s(p){yield p}e.single=s;function r(p){return t(p)?p:s(p)}e.wrap=r;function a(p){return p||n}e.from=a;function*u(p){for(let R=p.length-1;R>=0;R--)yield p[R]}e.reverse=u;function o(p){return!p||p[Symbol.iterator]().next().done===!0}e.isEmpty=o;function c(p){return p[Symbol.iterator]().next().value}e.first=c;function h(p,R){for(const E of p)if(R(E))return!0;return!1}e.some=h;function f(p,R){for(const E of p)if(R(E))return E}e.find=f;function*_(p,R){for(const E of p)R(E)&&(yield E)}e.filter=_;function*b(p,R){let E=0;for(const F of p)yield R(F,E++)}e.map=b;function*L(...p){for(const R of p)yield*R}e.concat=L;function N(p,R,E){let F=E;for(const k of p)F=R(F,k);return F}e.reduce=N;function*A(p,R,E=p.length){for(R<0&&(R+=p.length),E<0?E+=p.length:E>p.length&&(E=p.length);Ri.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,n){let i;if(n)i=n;else{const o=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,o).isSingleton);if(c.length===0)return;const h=new Set(c.map(f=>f.value));if(i=c.filter(f=>!(f.parent&&h.has(f.parent))),i.length===0)throw new Error("There are cyclic diposable chains!")}if(!i)return;function s(o){function c(f,_){for(;f.length>0&&_.some(b=>typeof b=="string"?b===f[0]:f[0].match(b));)f.shift()}const h=o.source.split(` -`).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}const r=new Kn;for(const o of i){const c=s(o);for(let h=0;h<=c.length;h++)r.add(c.slice(0,h).join(` -`),o)}i.sort(gt(o=>o.idx,_t));let a="",u=0;for(const o of i.slice(0,t)){u++;const c=s(o),h=[];for(let f=0;fs(A)[f]),A=>A);delete N[c[f]];for(const[A,x]of Object.entries(N))h.unshift(` - stacktraces of ${x.length} other leaks continue with ${A}`);h.unshift(_)}a+=` - - -==================== Leaking disposable ${u}/${i.length}: ${o.value.constructor.name} ==================== -${h.join(` -`)} -============================================================ - -`}return i.length>t&&(a+=` - - -... and ${i.length-t} more leaking disposables - -`),{leaks:i,details:a}}};en.idx=0;let Cn=en;function oa(e){return e}function ca(e,t){}function ei(e){if(St.is(e)){const t=[];for(const n of e)if(n)try{n.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Yr(...e){return Bt(()=>ei(e))}function Bt(e){return{dispose:Sr(()=>{e()})}}const tn=class tn{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ei(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?tn.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&this._toDispose.delete(t)}};tn.DISABLE_DISPOSED_WARNING=!1;let bt=tn;const jn=class jn{constructor(){this._store=new bt,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};jn.None=Object.freeze({dispose(){}});let Ze=jn;const ot=class ot{constructor(t){this.element=t,this.next=ot.Undefined,this.prev=ot.Undefined}};ot.Undefined=new ot(void 0);let Z=ot;class Qr{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let t=this._first;for(;t!==Z.Undefined;){const n=t.next;t.prev=Z.Undefined,t.next=Z.Undefined,t=n}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,n){const i=new Z(t);if(this._first===Z.Undefined)this._first=i,this._last=i;else if(n){const r=this._last;this._last=i,i.prev=r,r.next=i}else{const r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Z.Undefined){const t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==Z.Undefined){const t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==Z.Undefined&&t.next!==Z.Undefined){const n=t.prev;n.next=t.next,t.next.prev=n}else t.prev===Z.Undefined&&t.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):t.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):t.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==Z.Undefined;)yield t.element,t=t.next}}const Zr=globalThis.performance&&typeof globalThis.performance.now=="function";class Pt{static create(t){return new Pt(t)}constructor(t){this._now=Zr&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var fn;(function(e){e.None=()=>Ze.None;function t(U,w){return f(U,()=>{},0,void 0,!0,void 0,w)}e.defer=t;function n(U){return(w,D=null,T)=>{let y=!1,q;return q=U($=>{if(!y)return q?q.dispose():y=!0,w.call(D,$)},null,T),y&&q.dispose(),q}}e.once=n;function i(U,w,D){return c((T,y=null,q)=>U($=>T.call(y,w($)),null,q),D)}e.map=i;function s(U,w,D){return c((T,y=null,q)=>U($=>{w($),T.call(y,$)},null,q),D)}e.forEach=s;function r(U,w,D){return c((T,y=null,q)=>U($=>w($)&&T.call(y,$),null,q),D)}e.filter=r;function a(U){return U}e.signal=a;function u(...U){return(w,D=null,T)=>{const y=Yr(...U.map(q=>q($=>w.call(D,$))));return h(y,T)}}e.any=u;function o(U,w,D,T){let y=D;return i(U,q=>(y=w(y,q),y),T)}e.reduce=o;function c(U,w){let D;const T={onWillAddFirstListener(){D=U(y.fire,y)},onDidRemoveLastListener(){D?.dispose()}},y=new we(T);return w?.add(y),y.event}function h(U,w){return w instanceof Array?w.push(U):w&&w.add(U),U}function f(U,w,D=100,T=!1,y=!1,q,$){let le,oe,ht,ln=0,Ft;const la={leakWarningThreshold:q,onWillAddFirstListener(){le=U(aa=>{ln++,oe=w(oe,aa),T&&!ht&&(an.fire(oe),oe=void 0),Ft=()=>{const ua=oe;oe=void 0,ht=void 0,(!T||ln>1)&&an.fire(ua),ln=0},typeof D=="number"?(clearTimeout(ht),ht=setTimeout(Ft,D)):ht===void 0&&(ht=0,queueMicrotask(Ft))})},onWillRemoveListener(){y&&ln>0&&Ft?.()},onDidRemoveLastListener(){Ft=void 0,le.dispose()}},an=new we(la);return $?.add(an),an.event}e.debounce=f;function _(U,w=0,D){return e.debounce(U,(T,y)=>T?(T.push(y),T):[y],w,void 0,!0,void 0,D)}e.accumulate=_;function b(U,w=(T,y)=>T===y,D){let T=!0,y;return r(U,q=>{const $=T||!w(q,y);return T=!1,y=q,$},D)}e.latch=b;function L(U,w,D){return[e.filter(U,w,D),e.filter(U,T=>!w(T),D)]}e.split=L;function N(U,w=!1,D=[],T){let y=D.slice(),q=U(oe=>{y?y.push(oe):le.fire(oe)});T&&T.add(q);const $=()=>{y?.forEach(oe=>le.fire(oe)),y=null},le=new we({onWillAddFirstListener(){q||(q=U(oe=>le.fire(oe)),T&&T.add(q))},onDidAddFirstListener(){y&&(w?setTimeout($):$())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return T&&T.add(le),le.event}e.buffer=N;function A(U,w){return(T,y,q)=>{const $=w(new v);return U(function(le){const oe=$.evaluate(le);oe!==x&&T.call(y,oe)},void 0,q)}}e.chain=A;const x=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(w){return this.steps.push(w),this}forEach(w){return this.steps.push(D=>(w(D),D)),this}filter(w){return this.steps.push(D=>w(D)?D:x),this}reduce(w,D){let T=D;return this.steps.push(y=>(T=w(T,y),T)),this}latch(w=(D,T)=>D===T){let D=!0,T;return this.steps.push(y=>{const q=D||!w(y,T);return D=!1,T=y,q?y:x}),this}evaluate(w){for(const D of this.steps)if(w=D(w),w===x)break;return w}}function p(U,w,D=T=>T){const T=(...le)=>$.fire(D(...le)),y=()=>U.on(w,T),q=()=>U.removeListener(w,T),$=new we({onWillAddFirstListener:y,onDidRemoveLastListener:q});return $.event}e.fromNodeEventEmitter=p;function R(U,w,D=T=>T){const T=(...le)=>$.fire(D(...le)),y=()=>U.addEventListener(w,T),q=()=>U.removeEventListener(w,T),$=new we({onWillAddFirstListener:y,onDidRemoveLastListener:q});return $.event}e.fromDOMEventEmitter=R;function E(U){return new Promise(w=>n(U)(w))}e.toPromise=E;function F(U){const w=new we;return U.then(D=>{w.fire(D)},()=>{w.fire(void 0)}).finally(()=>{w.dispose()}),w.event}e.fromPromise=F;function k(U,w,D){return w(D),U(T=>w(T))}e.runAndSubscribe=k;class I{constructor(w,D){this._observable=w,this._counter=0,this._hasChanged=!1;const T={onWillAddFirstListener:()=>{w.addObserver(this)},onDidRemoveLastListener:()=>{w.removeObserver(this)}};this.emitter=new we(T),D&&D.add(this.emitter)}beginUpdate(w){this._counter++}handlePossibleChange(w){}handleChange(w,D){this._hasChanged=!0}endUpdate(w){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function z(U,w){return new I(U,w).emitter.event}e.fromObservable=z;function ie(U){return(w,D,T)=>{let y=0,q=!1;const $={beginUpdate(){y++},endUpdate(){y--,y===0&&(U.reportChanges(),q&&(q=!1,w.call(D)))},handlePossibleChange(){},handleChange(){q=!0}};U.addObserver($),U.reportChanges();const le={dispose(){U.removeObserver($)}};return T instanceof bt?T.add(le):Array.isArray(T)&&T.push(le),le}}e.fromObservableLight=ie})(fn||(fn={}));const ct=class ct{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${ct._idPool++}`,ct.all.add(this)}start(t){this._stopWatch=new Pt,this.listenerCount=t}stop(){if(this._stopWatch){const t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};ct.all=new Set,ct._idPool=0;let hn=ct,Jr=-1;class Kr{constructor(t,n,i=Math.random().toString(18).slice(2,5)){this._errorHandler=t,this.threshold=n,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,n){const i=this.threshold;if(i<=0||n{const r=this._stacks.get(t.value)||0;this._stacks.set(t.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(const[i,s]of this._stacks)(!t||n{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);const o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new el(`${u}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||kt)(c),Ze.None}if(this._disposed)return Ze.None;n&&(t=t.bind(n));const s=new gn(t);let r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=mn.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof gn?(this._deliveryQueue??=new il,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;const a=Bt(()=>{r?.(),this._removeListener(s)});return i instanceof bt?i.add(a):Array.isArray(i)&&i.push(a),a},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,i=n.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*nl<=n.length){let r=0;for(let a=0;a0}}class il{constructor(){this.i=-1,this.end=0}enqueue(t,n,i){this.i=0,this.end=i,this.current=t,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function sl(e){return typeof e=="string"}function rl(e){let t=[];for(;Object.prototype!==e;)t=t.concat(Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return t}function _n(e){const t=[];for(const n of rl(e))typeof e[n]=="function"&&t.push(n);return t}function ll(e,t){const n=s=>function(){const r=Array.prototype.slice.call(arguments,0);return t(s,r)},i={};for(const s of e)i[s]=n(s);return i}let al=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ul(e,t){let n;return t.length===0?n=e:n=e.replace(/\{(\d+)\}/g,(i,s)=>{const r=s[0],a=t[r];let u=i;return typeof a=="string"?u=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(u=String(a)),u}),al&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}let ol={};function Y(e,t,n,...i){const s=typeof t=="object"?t.key:t,r=(ol[e]??{})[s]??n;return ul(r,i)}const Je="en";let dt=!1,Lt=!1,yt=!1,ti=!1,Ot,Vt=Je,ni=Je,Ue;const We=globalThis;let he;typeof We.vscode<"u"&&typeof We.vscode.process<"u"?he=We.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(he=process);const cl=typeof he?.versions?.electron=="string"&&he?.type==="renderer";if(typeof he=="object"){dt=he.platform==="win32",Lt=he.platform==="darwin",yt=he.platform==="linux",yt&&he.env.SNAP&&he.env.SNAP_REVISION,he.env.CI||he.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ot=Je,Vt=Je;const e=he.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];Ot=t.locale,ni=t.osLocale,Vt=n||Je}catch{}}else typeof navigator=="object"&&!cl?(Ue=navigator.userAgent,dt=Ue.indexOf("Windows")>=0,Lt=Ue.indexOf("Macintosh")>=0,ti=(Ue.indexOf("Macintosh")>=0||Ue.indexOf("iPad")>=0||Ue.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,yt=Ue.indexOf("Linux")>=0,Ue?.indexOf("Mobi")>=0,Ot=Je,Vt=Ot,ni=navigator.language):console.error("Unable to resolve platform.");var Ke;(function(e){e[e.Web=0]="Web",e[e.Mac=1]="Mac",e[e.Linux=2]="Linux",e[e.Windows=3]="Windows"})(Ke||(Ke={})),Ke.Web,Lt?Ke.Mac:dt?Ke.Windows:yt&&Ke.Linux;const pt=dt,fl=Lt,xe=Ue,ke=Vt;var ii;(function(e){function t(){return ke}e.value=t;function n(){return ke.length===2?ke==="en":ke.length>=3?ke[0]==="e"&&ke[1]==="n"&&ke[2]==="-":!1}e.isDefaultVariant=n;function i(){return ke==="en"}e.isDefault=i})(ii||(ii={}));const hl=typeof We.postMessage=="function"&&!We.importScripts;(()=>{if(hl){const e=[];We.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i{const i=++t;e.push({id:i,callback:n}),We.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var Nt;(function(e){e[e.Windows=1]="Windows",e[e.Macintosh=2]="Macintosh",e[e.Linux=3]="Linux"})(Nt||(Nt={})),Lt||ti?Nt.Macintosh:dt?Nt.Windows:Nt.Linux;const ml=!!(xe&&xe.indexOf("Chrome")>=0);xe&&xe.indexOf("Firefox")>=0,!ml&&xe&&xe.indexOf("Safari")>=0,xe&&xe.indexOf("Edg/")>=0,xe&&xe.indexOf("Android")>=0;const si=Object.freeze(function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var Ht;(function(e){function t(n){return n===e.None||n===e.Cancelled||n instanceof qt?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:fn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:si})})(Ht||(Ht={}));class qt{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?si:(this._emitter||(this._emitter=new we),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class gl{constructor(t){this._token=void 0,this._parentListener=void 0,this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new qt),this._token}cancel(){this._token?this._token instanceof qt&&this._token.cancel():this._token=Ht.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof qt&&this._token.dispose():this._token=Ht.None}}function _l(e){return e}class bl{constructor(t,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof t=="function"?(this._fn=t,this._computeKey=_l):(this._fn=n,this._computeKey=t.getCacheKey)}get(t){const n=this._computeKey(t);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(t)),this.lastCache}}var d;(function(e){e[e.Null=0]="Null",e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.LineFeed=10]="LineFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.DoubleQuote=34]="DoubleQuote",e[e.Hash=35]="Hash",e[e.DollarSign=36]="DollarSign",e[e.PercentSign=37]="PercentSign",e[e.Ampersand=38]="Ampersand",e[e.SingleQuote=39]="SingleQuote",e[e.OpenParen=40]="OpenParen",e[e.CloseParen=41]="CloseParen",e[e.Asterisk=42]="Asterisk",e[e.Plus=43]="Plus",e[e.Comma=44]="Comma",e[e.Dash=45]="Dash",e[e.Period=46]="Period",e[e.Slash=47]="Slash",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.Colon=58]="Colon",e[e.Semicolon=59]="Semicolon",e[e.LessThan=60]="LessThan",e[e.Equals=61]="Equals",e[e.GreaterThan=62]="GreaterThan",e[e.QuestionMark=63]="QuestionMark",e[e.AtSign=64]="AtSign",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.OpenSquareBracket=91]="OpenSquareBracket",e[e.Backslash=92]="Backslash",e[e.CloseSquareBracket=93]="CloseSquareBracket",e[e.Caret=94]="Caret",e[e.Underline=95]="Underline",e[e.BackTick=96]="BackTick",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.OpenCurlyBrace=123]="OpenCurlyBrace",e[e.Pipe=124]="Pipe",e[e.CloseCurlyBrace=125]="CloseCurlyBrace",e[e.Tilde=126]="Tilde",e[e.NoBreakSpace=160]="NoBreakSpace",e[e.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",e[e.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",e[e.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",e[e.U_Combining_Tilde=771]="U_Combining_Tilde",e[e.U_Combining_Macron=772]="U_Combining_Macron",e[e.U_Combining_Overline=773]="U_Combining_Overline",e[e.U_Combining_Breve=774]="U_Combining_Breve",e[e.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",e[e.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",e[e.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",e[e.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",e[e.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",e[e.U_Combining_Caron=780]="U_Combining_Caron",e[e.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",e[e.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",e[e.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",e[e.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",e[e.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",e[e.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",e[e.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",e[e.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",e[e.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",e[e.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",e[e.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",e[e.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",e[e.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",e[e.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",e[e.U_Combining_Horn=795]="U_Combining_Horn",e[e.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",e[e.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",e[e.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",e[e.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",e[e.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",e[e.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",e[e.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",e[e.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",e[e.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",e[e.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",e[e.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",e[e.U_Combining_Cedilla=807]="U_Combining_Cedilla",e[e.U_Combining_Ogonek=808]="U_Combining_Ogonek",e[e.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",e[e.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",e[e.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",e[e.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",e[e.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",e[e.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",e[e.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",e[e.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",e[e.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",e[e.U_Combining_Low_Line=818]="U_Combining_Low_Line",e[e.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",e[e.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",e[e.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",e[e.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",e[e.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",e[e.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",e[e.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",e[e.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",e[e.U_Combining_Square_Below=827]="U_Combining_Square_Below",e[e.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",e[e.U_Combining_X_Above=829]="U_Combining_X_Above",e[e.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",e[e.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",e[e.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",e[e.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",e[e.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",e[e.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",e[e.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",e[e.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",e[e.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",e[e.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",e[e.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",e[e.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",e[e.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",e[e.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",e[e.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",e[e.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",e[e.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",e[e.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",e[e.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",e[e.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",e[e.U_Combining_Fermata=850]="U_Combining_Fermata",e[e.U_Combining_X_Below=851]="U_Combining_X_Below",e[e.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",e[e.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",e[e.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",e[e.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",e[e.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",e[e.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",e[e.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",e[e.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",e[e.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",e[e.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",e[e.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",e[e.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",e[e.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",e[e.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",e[e.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",e[e.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",e[e.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",e[e.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",e[e.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",e[e.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",e[e.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",e[e.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",e[e.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",e[e.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",e[e.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",e[e.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",e[e.LINE_SEPARATOR=8232]="LINE_SEPARATOR",e[e.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",e[e.NEXT_LINE=133]="NEXT_LINE",e[e.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",e[e.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",e[e.U_DIAERESIS=168]="U_DIAERESIS",e[e.U_MACRON=175]="U_MACRON",e[e.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",e[e.U_CEDILLA=184]="U_CEDILLA",e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",e[e.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",e[e.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",e[e.U_BREVE=728]="U_BREVE",e[e.U_DOT_ABOVE=729]="U_DOT_ABOVE",e[e.U_RING_ABOVE=730]="U_RING_ABOVE",e[e.U_OGONEK=731]="U_OGONEK",e[e.U_SMALL_TILDE=732]="U_SMALL_TILDE",e[e.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",e[e.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",e[e.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",e[e.U_GREEK_TONOS=900]="U_GREEK_TONOS",e[e.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",e[e.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",e[e.U_GREEK_PSILI=8127]="U_GREEK_PSILI",e[e.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",e[e.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",e[e.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",e[e.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",e[e.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",e[e.U_GREEK_VARIA=8175]="U_GREEK_VARIA",e[e.U_GREEK_OXIA=8189]="U_GREEK_OXIA",e[e.U_GREEK_DASIA=8190]="U_GREEK_DASIA",e[e.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",e[e.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",e[e.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",e[e.U_OVERLINE=8254]="U_OVERLINE",e[e.UTF8_BOM=65279]="UTF8_BOM",e[e.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",e[e.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"})(d||(d={}));class ri{constructor(t){this.executor=t,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(t){this._error=t}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var _e;(function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",e[e.MAX_UINT_8=255]="MAX_UINT_8",e[e.MAX_UINT_16=65535]="MAX_UINT_16",e[e.MAX_UINT_32=4294967295]="MAX_UINT_32",e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"})(_e||(_e={}));function li(e){return e<0?0:e>_e.MAX_UINT_8?_e.MAX_UINT_8:e|0}function Ce(e){return e<0?0:e>_e.MAX_UINT_32?_e.MAX_UINT_32:e|0}function dl(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Ll(e){return e.split(/\r\n|\r|\n/)}function pl(e){for(let t=0,n=e.length;t=0;n--){const i=e.charCodeAt(n);if(i!==d.Space&&i!==d.Tab)return n}return-1}function ai(e){return e>=d.A&&e<=d.Z}function Wt(e){return 55296<=e&&e<=56319}function bn(e){return 56320<=e&&e<=57343}function ui(e,t){return(e-55296<<10)+(t-56320)+65536}function wl(e,t,n){const i=e.charCodeAt(n);if(Wt(i)&&n+1JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}')),ve.cache=new bl({getCacheKey:JSON.stringify},t=>{function n(h){const f=new Map;for(let _=0;_!h.startsWith("_")&&h in r);a.length===0&&(a=["_default"]);let u;for(const h of a){const f=n(r[h]);u=s(u,f)}const o=n(r._common),c=i(o,u);return new ve(c)}),ve._locales=new ri(()=>Object.keys(ve.ambiguousCharacterData.value).filter(t=>!t.startsWith("_")));let wt=ve;const je=class je{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(je.getRawData())),this._data}static isInvisibleCharacter(t){return je.getData().has(t)}static containsInvisibleCharacter(t){for(let n=0;n{this._pendingReplies[i]={resolve:s,reject:r},this._send(new Rl(this._workerId,i,t,n))})}listen(t,n){let i=null;const s=new we({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new vl(this._workerId,i,t,n))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Dl(this._workerId,i)),i=null}});return s.event}handleMessage(t){!t||!t.vsWorker||this._workerId!==-1&&t.vsWorker!==this._workerId||this._handleMessage(t)}_handleMessage(t){switch(t.type){case ce.Reply:return this._handleReplyMessage(t);case ce.Request:return this._handleRequestMessage(t);case ce.SubscribeEvent:return this._handleSubscribeEventMessage(t);case ce.Event:return this._handleEventMessage(t);case ce.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(t)}}_handleReplyMessage(t){if(!this._pendingReplies[t.seq]){console.warn("Got reply to unknown seq");return}const n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let i=t.err;t.err.$isError&&(i=new Error,i.name=t.err.name,i.message=t.err.message,i.stack=t.err.stack),n.reject(i);return}n.resolve(t.res)}_handleRequestMessage(t){const n=t.req;this._handler.handleMessage(t.method,t.args).then(s=>{this._send(new fi(this._workerId,n,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=Xn(s.detail)),this._send(new fi(this._workerId,n,void 0,Xn(s)))})}_handleSubscribeEventMessage(t){const n=t.req,i=this._handler.handleEvent(t.eventName,t.arg)(s=>{this._send(new Ul(this._workerId,n,s))});this._pendingEvents.set(n,i)}_handleEventMessage(t){if(!this._pendingEmitters.has(t.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(t.req).fire(t.event)}_handleUnsubscribeEventMessage(t){if(!this._pendingEvents.has(t.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(t.req).dispose(),this._pendingEvents.delete(t.req)}_send(t){const n=[];if(t.type===ce.Request)for(let i=0;ifunction(){const u=Array.prototype.slice.call(arguments,0);return t(a,u)},s=a=>function(u){return n(a,u)},r={};for(const a of e){if(mi(a)){r[a]=s(a);continue}if(hi(a)){r[a]=n(a,void 0);continue}r[a]=i(a)}return r}class Fl{constructor(t,n){this._requestHandlerFactory=n,this._requestHandler=null,this._protocol=new Tl({sendMessage:(i,s)=>{t(i,s)},handleMessage:(i,s)=>this._handleMessage(i,s),handleEvent:(i,s)=>this._handleEvent(i,s)})}onmessage(t){this._protocol.handleMessage(t)}_handleMessage(t,n){if(t===xl)return this.initialize(n[0],n[1],n[2],n[3]);if(!this._requestHandler||typeof this._requestHandler[t]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+t));try{return Promise.resolve(this._requestHandler[t].apply(this._requestHandler,n))}catch(i){return Promise.reject(i)}}_handleEvent(t,n){if(!this._requestHandler)throw new Error("Missing requestHandler");if(mi(t)){const i=this._requestHandler[t].call(this._requestHandler,n);if(typeof i!="function")throw new Error(`Missing dynamic event ${t} on request handler.`);return i}if(hi(t)){const i=this._requestHandler[t];if(typeof i!="function")throw new Error(`Missing event ${t} on request handler.`);return i}throw new Error(`Malformed event name ${t}`)}initialize(t,n,i,s){this._protocol.setWorkerId(t);const u=Ml(s,(o,c)=>this._protocol.sendMessage(o,c),(o,c)=>this._protocol.listen(o,c));return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(u),Promise.resolve(_n(this._requestHandler))):(n&&(typeof n.baseUrl<"u"&&delete n.baseUrl,typeof n.paths<"u"&&typeof n.paths.vs<"u"&&delete n.paths.vs,typeof n.trustedTypesPolicy<"u"&&delete n.trustedTypesPolicy,n.catchError=!0,globalThis.require.config(n)),new Promise((o,c)=>{(void 0)([i],f=>{if(this._requestHandler=f.create(u),!this._requestHandler){c(new Error("No RequestHandler!"));return}o(_n(this._requestHandler))},c)}))}}class Ie{constructor(t,n,i,s){this.originalStart=t,this.originalLength=n,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function gi(e,t){return(t<<5)-t+e|0}function kl(e,t){t=gi(149417,t);for(let n=0,i=e.length;n>>i)>>>0}function _i(e,t=0,n=e.byteLength,i=0){for(let s=0;sn.toString(16).padStart(2,"0")).join(""):Il((e>>>0).toString(16),t/4)}const nn=class nn{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(be.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){const n=t.length;if(n===0)return;const i=this._buff;let s=this._buffLen,r=this._leftoverHighSurrogate,a,u;for(r!==0?(a=r,u=-1,r=0):(a=t.charCodeAt(0),u=0);;){let o=a;if(Wt(a))if(u+1>>6,t[n++]=128|(i&63)>>>0):i<65536?(t[n++]=224|(i&61440)>>>12,t[n++]=128|(i&4032)>>>6,t[n++]=128|(i&63)>>>0):(t[n++]=240|(i&1835008)>>>18,t[n++]=128|(i&258048)>>>12,t[n++]=128|(i&4032)>>>6,t[n++]=128|(i&63)>>>0),n>=be.BLOCK_SIZE&&(this._step(),n-=be.BLOCK_SIZE,this._totalLen+=be.BLOCK_SIZE,t[0]=t[be.BLOCK_SIZE+0],t[1]=t[be.BLOCK_SIZE+1],t[2]=t[be.BLOCK_SIZE+2]),n}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,be.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),At(this._h0)+At(this._h1)+At(this._h2)+At(this._h3)+At(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,_i(this._buff,this._buffLen),this._buffLen>56&&(this._step(),_i(this._buff));const t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){const t=nn._bigBlock32,n=this._buffDV;for(let f=0;f<64;f+=4)t.setUint32(f,n.getUint32(f,!1),!1);for(let f=64;f<320;f+=4)t.setUint32(f,dn(t.getUint32(f-12,!1)^t.getUint32(f-32,!1)^t.getUint32(f-56,!1)^t.getUint32(f-64,!1),1),!1);let i=this._h0,s=this._h1,r=this._h2,a=this._h3,u=this._h4,o,c,h;for(let f=0;f<80;f++)f<20?(o=s&r|~s&a,c=1518500249):f<40?(o=s^r^a,c=1859775393):f<60?(o=s&r|s&a|r&a,c=2400959708):(o=s^r^a,c=3395469782),h=dn(i,5)+o+u+c+t.getUint32(f*4,!1)&4294967295,u=a,a=r,r=dn(s,30),s=i,i=h;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+a&4294967295,this._h4=this._h4+u&4294967295}};nn._bigBlock32=new DataView(new ArrayBuffer(320));let bi=nn;class di{constructor(t){this.source=t}getElements(){const t=this.source,n=new Int32Array(t.length);for(let i=0,s=t.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Ie(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=_e.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=_e.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_originalCount++}AddModifiedElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Se{constructor(t,n,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=t,this._modifiedSequence=n;const[s,r,a]=Se._getElements(t),[u,o,c]=Se._getElements(n);this._hasStrings=a&&c,this._originalStringElements=s,this._originalElementsOrHash=r,this._modifiedStringElements=u,this._modifiedElementsOrHash=o,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(Se._isStringArray(n)){const i=new Int32Array(n.length);for(let s=0,r=n.length;s=t&&s>=i&&this.ElementsAreEqual(n,s);)n--,s--;if(t>n||i>s){let f;return i<=s?(et.Assert(t===n+1,"originalStart should only be one more than originalEnd"),f=[new Ie(t,0,i,s-i+1)]):t<=n?(et.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[new Ie(t,n-t+1,i,0)]):(et.Assert(t===n+1,"originalStart should only be one more than originalEnd"),et.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[]),f}const a=[0],u=[0],o=this.ComputeRecursionPoint(t,n,i,s,a,u,r),c=a[0],h=u[0];if(o!==null)return o;if(!r[0]){const f=this.ComputeDiffRecursive(t,c,i,h,r);let _=[];return r[0]?_=[new Ie(c+1,n-(c+1)+1,h+1,s-(h+1)+1)]:_=this.ComputeDiffRecursive(c+1,n,h+1,s,r),this.ConcatenateChanges(f,_)}return[new Ie(t,n-t+1,i,s-i+1)]}WALKTRACE(t,n,i,s,r,a,u,o,c,h,f,_,b,L,N,A,x,v){let p=null,R=null,E=new Li,F=n,k=i,I=b[0]-A[0]-s,z=_e.MIN_SAFE_SMALL_INTEGER,ie=this.m_forwardHistory.length-1;do{const U=I+t;U===F||U=0&&(c=this.m_forwardHistory[ie],t=c[0],F=1,k=c.length-1)}while(--ie>=-1);if(p=E.getReverseChanges(),v[0]){let U=b[0]+1,w=A[0]+1;if(p!==null&&p.length>0){const D=p[p.length-1];U=Math.max(U,D.getOriginalEnd()),w=Math.max(w,D.getModifiedEnd())}R=[new Ie(U,_-U+1,w,N-w+1)]}else{E=new Li,F=a,k=u,I=b[0]-A[0]-o,z=_e.MAX_SAFE_SMALL_INTEGER,ie=x?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const U=I+r;U===F||U=h[U+1]?(f=h[U+1]-1,L=f-I-o,f>z&&E.MarkNextChange(),z=f+1,E.AddOriginalElement(f+1,L+1),I=U+1-r):(f=h[U-1],L=f-I-o,f>z&&E.MarkNextChange(),z=f,E.AddModifiedElement(f+1,L+1),I=U-1-r),ie>=0&&(h=this.m_reverseHistory[ie],r=h[0],F=1,k=h.length-1)}while(--ie>=-1);R=E.getChanges()}return this.ConcatenateChanges(p,R)}ComputeRecursionPoint(t,n,i,s,r,a,u){let o=0,c=0,h=0,f=0,_=0,b=0;t--,i--,r[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const L=n-t+(s-i),N=L+1,A=new Int32Array(N),x=new Int32Array(N),v=s-i,p=n-t,R=t-i,E=n-s,k=(p-v)%2===0;A[v]=t,x[p]=n,u[0]=!1;for(let I=1;I<=L/2+1;I++){let z=0,ie=0;h=this.ClipDiagonalBound(v-I,I,v,N),f=this.ClipDiagonalBound(v+I,I,v,N);for(let w=h;w<=f;w+=2){w===h||wz+ie&&(z=o,ie=c),!k&&Math.abs(w-p)<=I-1&&o>=x[w])return r[0]=o,a[0]=c,D<=x[w]&&De.MaxDifferencesHistory>0&&I<=De.MaxDifferencesHistory+1?this.WALKTRACE(v,h,f,R,p,_,b,E,A,x,o,n,r,c,s,a,k,u):null}const U=(z-t+(ie-i)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(z,U))return u[0]=!0,r[0]=z,a[0]=ie,U>0&&De.MaxDifferencesHistory>0&&I<=De.MaxDifferencesHistory+1?this.WALKTRACE(v,h,f,R,p,_,b,E,A,x,o,n,r,c,s,a,k,u):(t++,i++,[new Ie(t,n-t+1,i,s-i+1)]);_=this.ClipDiagonalBound(p-I,I,p,N),b=this.ClipDiagonalBound(p+I,I,p,N);for(let w=_;w<=b;w+=2){w===_||w=x[w+1]?o=x[w+1]-1:o=x[w-1],c=o-(w-p)-E;const D=o;for(;o>t&&c>i&&this.ElementsAreEqual(o,c);)o--,c--;if(x[w]=o,k&&Math.abs(w-v)<=I&&o<=A[w])return r[0]=o,a[0]=c,D>=A[w]&&De.MaxDifferencesHistory>0&&I<=De.MaxDifferencesHistory+1?this.WALKTRACE(v,h,f,R,p,_,b,E,A,x,o,n,r,c,s,a,k,u):null}if(I<=De.MaxDifferencesHistory){let w=new Int32Array(f-h+2);w[0]=v-h+1,tt.Copy2(A,h,w,1,f-h+1),this.m_forwardHistory.push(w),w=new Int32Array(b-_+2),w[0]=p-_+1,tt.Copy2(x,_,w,1,b-_+1),this.m_reverseHistory.push(w)}}return this.WALKTRACE(v,h,f,R,p,_,b,E,A,x,o,n,r,c,s,a,k,u)}PrettifyChanges(t){for(let n=0;n0,u=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;n--){const i=t[n];let s=0,r=0;if(n>0){const f=t[n-1];s=f.originalStart+f.originalLength,r=f.modifiedStart+f.modifiedLength}const a=i.originalLength>0,u=i.modifiedLength>0;let o=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let f=1;;f++){const _=i.originalStart-f,b=i.modifiedStart-f;if(_c&&(c=N,o=f)}i.originalStart-=o,i.modifiedStart-=o;const h=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],h)){t[n-1]=h[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,i=t.length;n0&&b>o&&(o=b,c=f,h=_)}return o>0?[c,h]:null}_contiguousSequenceScore(t,n,i){let s=0;for(let r=0;r=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const i=t+n;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const i=t+n;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(t,n,i,s){const r=this._OriginalRegionIsBoundary(t,n)?1:0,a=this._ModifiedRegionIsBoundary(i,s)?1:0;return r+a}ConcatenateChanges(t,n){const i=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],i)){const s=new Array(t.length+n.length-1);return tt.Copy(t,0,s,0,t.length-1),s[t.length-1]=i[0],tt.Copy(n,1,s,t.length,n.length-1),s}else{const s=new Array(t.length+n.length);return tt.Copy(t,0,s,0,t.length),tt.Copy(n,0,s,t.length,n.length),s}}ChangesOverlap(t,n,i){if(et.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),et.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const s=t.originalStart;let r=t.originalLength;const a=t.modifiedStart;let u=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(r=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(u=n.modifiedStart+n.modifiedLength-t.modifiedStart),i[0]=new Ie(s,r,a,u),!0}else return i[0]=null,!1}ClipDiagonalBound(t,n,i,s){if(t>=0&&t=yl&&e<=Vl||e>=Ol&&e<=Hl}function zt(e,t,n,i){let s="",r=0,a=-1,u=0,o=0;for(let c=0;c<=e.length;++c){if(c2){const h=s.lastIndexOf(n);h===-1?(s="",r=0):(s=s.slice(0,h),r=s.length-1-s.lastIndexOf(n)),a=c,u=0;continue}else if(s.length!==0){s="",r=0,a=c,u=0;continue}}t&&(s+=s.length>0?`${n}..`:"..",r=2)}else s.length>0?s+=`${n}${e.slice(a+1,c)}`:s=e.slice(a+1,c),r=c-a-1;a=c,u=0}else o===Be&&u!==-1?++u:u=-1}return s}function wi(e,t){Wl(t,"pathObject");const n=t.dir||t.root,i=t.base||`${t.name||""}${t.ext||""}`;return n?n===t.root?`${n}${i}`:`${n}${e}${i}`:i}const ne={resolve(...e){let t="",n="",i=!1;for(let s=e.length-1;s>=-1;s--){let r;if(s>=0){if(r=e[s],C(r,"path"),r.length===0)continue}else t.length===0?r=Gt():(r=Bl[`=${t}`]||Gt(),(r===void 0||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&r.charCodeAt(2)===fe)&&(r=`${t}\\`));const a=r.length;let u=0,o="",c=!1;const h=r.charCodeAt(0);if(a===1)H(h)&&(u=1,c=!0);else if(H(h))if(c=!0,H(r.charCodeAt(1))){let f=2,_=f;for(;f2&&H(r.charCodeAt(2))&&(c=!0,u=3));if(o.length>0)if(t.length>0){if(o.toLowerCase()!==t.toLowerCase())continue}else t=o;if(i){if(t.length>0)break}else if(n=`${r.slice(u)}\\${n}`,i=c,c&&t.length>0)break}return n=zt(n,!i,"\\",H),i?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){C(e,"path");const t=e.length;if(t===0)return".";let n=0,i,s=!1;const r=e.charCodeAt(0);if(t===1)return Nn(r)?"\\":e;if(H(r))if(s=!0,H(e.charCodeAt(1))){let u=2,o=u;for(;u2&&H(e.charCodeAt(2))&&(s=!0,n=3));let a=n0&&H(e.charCodeAt(t-1))&&(a+="\\"),i===void 0?s?`\\${a}`:a:s?`${i}\\${a}`:`${i}${a}`},isAbsolute(e){C(e,"path");const t=e.length;if(t===0)return!1;const n=e.charCodeAt(0);return H(n)||t>2&&ye(n)&&e.charCodeAt(1)===Pe&&H(e.charCodeAt(2))},join(...e){if(e.length===0)return".";let t,n;for(let r=0;r0&&(t===void 0?t=n=a:t+=`\\${a}`)}if(t===void 0)return".";let i=!0,s=0;if(typeof n=="string"&&H(n.charCodeAt(0))){++s;const r=n.length;r>1&&H(n.charCodeAt(1))&&(++s,r>2&&(H(n.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(t=`\\${t.slice(s)}`)}return ne.normalize(t)},relative(e,t){if(C(e,"from"),C(t,"to"),e===t)return"";const n=ne.resolve(e),i=ne.resolve(t);if(n===i||(e=n.toLowerCase(),t=i.toLowerCase(),e===t))return"";let s=0;for(;ss&&e.charCodeAt(r-1)===fe;)r--;const a=r-s;let u=0;for(;uu&&t.charCodeAt(o-1)===fe;)o--;const c=o-u,h=ah){if(t.charCodeAt(u+_)===fe)return i.slice(u+_+1);if(_===2)return i.slice(u+_)}a>h&&(e.charCodeAt(s+_)===fe?f=_:_===2&&(f=3)),f===-1&&(f=0)}let b="";for(_=s+f+1;_<=r;++_)(_===r||e.charCodeAt(_)===fe)&&(b+=b.length===0?"..":"\\..");return u+=f,b.length>0?`${b}${i.slice(u,o)}`:(i.charCodeAt(u)===fe&&++u,i.slice(u,o))},toNamespacedPath(e){if(typeof e!="string"||e.length===0)return e;const t=ne.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===fe){if(t.charCodeAt(1)===fe){const n=t.charCodeAt(2);if(n!==ql&&n!==Be)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(ye(t.charCodeAt(0))&&t.charCodeAt(1)===Pe&&t.charCodeAt(2)===fe)return`\\\\?\\${t}`;return e},dirname(e){C(e,"path");const t=e.length;if(t===0)return".";let n=-1,i=0;const s=e.charCodeAt(0);if(t===1)return H(s)?e:".";if(H(s)){if(n=i=1,H(e.charCodeAt(1))){let u=2,o=u;for(;u2&&H(e.charCodeAt(2))?3:2,i=n);let r=-1,a=!0;for(let u=t-1;u>=i;--u)if(H(e.charCodeAt(u))){if(!a){r=u;break}}else a=!1;if(r===-1){if(n===-1)return".";r=n}return e.slice(0,r)},basename(e,t){t!==void 0&&C(t,"ext"),C(e,"path");let n=0,i=-1,s=!0,r;if(e.length>=2&&ye(e.charCodeAt(0))&&e.charCodeAt(1)===Pe&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let a=t.length-1,u=-1;for(r=e.length-1;r>=n;--r){const o=e.charCodeAt(r);if(H(o)){if(!s){n=r+1;break}}else u===-1&&(s=!1,u=r+1),a>=0&&(o===t.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=u))}return n===i?i=u:i===-1&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=n;--r)if(H(e.charCodeAt(r))){if(!s){n=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":e.slice(n,i)},extname(e){C(e,"path");let t=0,n=-1,i=0,s=-1,r=!0,a=0;e.length>=2&&e.charCodeAt(1)===Pe&&ye(e.charCodeAt(0))&&(t=i=2);for(let u=e.length-1;u>=t;--u){const o=e.charCodeAt(u);if(H(o)){if(!r){i=u+1;break}continue}s===-1&&(r=!1,s=u+1),o===Be?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===i+1?"":e.slice(n,s)},format:wi.bind(null,"\\"),parse(e){C(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;const n=e.length;let i=0,s=e.charCodeAt(0);if(n===1)return H(s)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(H(s)){if(i=1,H(e.charCodeAt(1))){let f=2,_=f;for(;f0&&(t.root=e.slice(0,i));let r=-1,a=i,u=-1,o=!0,c=e.length-1,h=0;for(;c>=i;--c){if(s=e.charCodeAt(c),H(s)){if(!o){a=c+1;break}continue}u===-1&&(o=!1,u=c+1),s===Be?r===-1?r=c:h!==1&&(h=1):r!==-1&&(h=-1)}return u!==-1&&(r===-1||h===0||h===1&&r===u-1&&r===a+1?t.base=t.name=e.slice(a,u):(t.name=e.slice(a,r),t.base=e.slice(a,u),t.ext=e.slice(r,u))),a>0&&a!==i?t.dir=e.slice(0,a-1):t.dir=t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},Gl=(()=>{if(de){const e=/\\/g;return()=>{const t=Gt().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>Gt()})(),re={resolve(...e){let t="",n=!1;for(let i=e.length-1;i>=-1&&!n;i--){const s=i>=0?e[i]:Gl();C(s,"path"),s.length!==0&&(t=`${s}/${t}`,n=s.charCodeAt(0)===se)}return t=zt(t,!n,"/",Nn),n?`/${t}`:t.length>0?t:"."},normalize(e){if(C(e,"path"),e.length===0)return".";const t=e.charCodeAt(0)===se,n=e.charCodeAt(e.length-1)===se;return e=zt(e,!t,"/",Nn),e.length===0?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute(e){return C(e,"path"),e.length>0&&e.charCodeAt(0)===se},join(...e){if(e.length===0)return".";let t;for(let n=0;n0&&(t===void 0?t=i:t+=`/${i}`)}return t===void 0?".":re.normalize(t)},relative(e,t){if(C(e,"from"),C(t,"to"),e===t||(e=re.resolve(e),t=re.resolve(t),e===t))return"";const n=1,i=e.length,s=i-n,r=1,a=t.length-r,u=su){if(t.charCodeAt(r+c)===se)return t.slice(r+c+1);if(c===0)return t.slice(r+c)}else s>u&&(e.charCodeAt(n+c)===se?o=c:c===0&&(o=0));let h="";for(c=n+o+1;c<=i;++c)(c===i||e.charCodeAt(c)===se)&&(h+=h.length===0?"..":"/..");return`${h}${t.slice(r+o)}`},toNamespacedPath(e){return e},dirname(e){if(C(e,"path"),e.length===0)return".";const t=e.charCodeAt(0)===se;let n=-1,i=!0;for(let s=e.length-1;s>=1;--s)if(e.charCodeAt(s)===se){if(!i){n=s;break}}else i=!1;return n===-1?t?"/":".":t&&n===1?"//":e.slice(0,n)},basename(e,t){t!==void 0&&C(t,"ext"),C(e,"path");let n=0,i=-1,s=!0,r;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let a=t.length-1,u=-1;for(r=e.length-1;r>=0;--r){const o=e.charCodeAt(r);if(o===se){if(!s){n=r+1;break}}else u===-1&&(s=!1,u=r+1),a>=0&&(o===t.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=u))}return n===i?i=u:i===-1&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===se){if(!s){n=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":e.slice(n,i)},extname(e){C(e,"path");let t=-1,n=0,i=-1,s=!0,r=0;for(let a=e.length-1;a>=0;--a){const u=e.charCodeAt(a);if(u===se){if(!s){n=a+1;break}continue}i===-1&&(s=!1,i=a+1),u===Be?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||i===-1||r===0||r===1&&t===i-1&&t===n+1?"":e.slice(t,i)},format:wi.bind(null,"/"),parse(e){C(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;const n=e.charCodeAt(0)===se;let i;n?(t.root="/",i=1):i=0;let s=-1,r=0,a=-1,u=!0,o=e.length-1,c=0;for(;o>=i;--o){const h=e.charCodeAt(o);if(h===se){if(!u){r=o+1;break}continue}a===-1&&(u=!1,a=o+1),h===Be?s===-1?s=o:c!==1&&(c=1):s!==-1&&(c=-1)}if(a!==-1){const h=r===0&&n?1:r;s===-1||c===0||c===1&&s===a-1&&s===r+1?t.base=t.name=e.slice(h,a):(t.name=e.slice(h,s),t.base=e.slice(h,a),t.ext=e.slice(s,a))}return r>0?t.dir=e.slice(0,r-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};re.win32=ne.win32=ne,re.posix=ne.posix=re,de?ne.normalize:re.normalize,de?ne.isAbsolute:re.isAbsolute,de?ne.join:re.join,de?ne.resolve:re.resolve,de?ne.relative:re.relative,de?ne.dirname:re.dirname,de?ne.basename:re.basename,de?ne.extname:re.extname,de?ne.parse:re.parse,de?ne.sep:re.sep,de?ne.delimiter:re.delimiter;const zl=/^\w[\w\d+.-]*$/,$l=/^\//,jl=/^\/\//;function Xl(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!zl.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!$l.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(jl.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Yl(e,t){return!e&&!t?"file":e}function Ql(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==Ee&&(t=Ee+t):t=Ee;break}return t}const j="",Ee="/",Zl=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ze{static isUri(t){return t instanceof ze?!0:t?typeof t.authority=="string"&&typeof t.fragment=="string"&&typeof t.path=="string"&&typeof t.query=="string"&&typeof t.scheme=="string"&&typeof t.fsPath=="string"&&typeof t.with=="function"&&typeof t.toString=="function":!1}constructor(t,n,i,s,r,a=!1){typeof t=="object"?(this.scheme=t.scheme||j,this.authority=t.authority||j,this.path=t.path||j,this.query=t.query||j,this.fragment=t.fragment||j):(this.scheme=Yl(t,a),this.authority=n||j,this.path=Ql(this.scheme,i||j),this.query=s||j,this.fragment=r||j,Xl(this,a))}get fsPath(){return wn(this,!1)}with(t){if(!t)return this;let{scheme:n,authority:i,path:s,query:r,fragment:a}=t;return n===void 0?n=this.scheme:n===null&&(n=j),i===void 0?i=this.authority:i===null&&(i=j),s===void 0?s=this.path:s===null&&(s=j),r===void 0?r=this.query:r===null&&(r=j),a===void 0?a=this.fragment:a===null&&(a=j),n===this.scheme&&i===this.authority&&s===this.path&&r===this.query&&a===this.fragment?this:new nt(n,i,s,r,a)}static parse(t,n=!1){const i=Zl.exec(t);return i?new nt(i[2]||j,$t(i[4]||j),$t(i[5]||j),$t(i[7]||j),$t(i[9]||j),n):new nt(j,j,j,j,j)}static file(t){let n=j;if(pt&&(t=t.replace(/\\/g,Ee)),t[0]===Ee&&t[1]===Ee){const i=t.indexOf(Ee,2);i===-1?(n=t.substring(2),t=Ee):(n=t.substring(2,i),t=t.substring(i)||Ee)}return new nt("file",n,t,j,j)}static from(t,n){return new nt(t.scheme,t.authority,t.path,t.query,t.fragment,n)}static joinPath(t,...n){if(!t.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return pt&&t.scheme==="file"?i=ze.file(ne.join(wn(t,!0),...n)).path:i=re.join(t.path,...n),t.with({path:i})}toString(t=!1){return En(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof ze)return t;{const n=new nt(t);return n._formatted=t.external??null,n._fsPath=t._sep===Ei?t.fsPath??null:null,n}}else return t}}const Ei=pt?1:void 0;class nt extends ze{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=wn(this,!1)),this._fsPath}toString(t=!1){return t?En(this,!0):(this._formatted||(this._formatted=En(this,!1)),this._formatted)}toJSON(){const t={$mid:Ln.Uri};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=Ei),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const Ai={[d.Colon]:"%3A",[d.Slash]:"%2F",[d.QuestionMark]:"%3F",[d.Hash]:"%23",[d.OpenSquareBracket]:"%5B",[d.CloseSquareBracket]:"%5D",[d.AtSign]:"%40",[d.ExclamationMark]:"%21",[d.DollarSign]:"%24",[d.Ampersand]:"%26",[d.SingleQuote]:"%27",[d.OpenParen]:"%28",[d.CloseParen]:"%29",[d.Asterisk]:"%2A",[d.Plus]:"%2B",[d.Comma]:"%2C",[d.Semicolon]:"%3B",[d.Equals]:"%3D",[d.Space]:"%20"};function xi(e,t,n){let i,s=-1;for(let r=0;r=d.a&&a<=d.z||a>=d.A&&a<=d.Z||a>=d.Digit0&&a<=d.Digit9||a===d.Dash||a===d.Period||a===d.Underline||a===d.Tilde||t&&a===d.Slash||n&&a===d.OpenSquareBracket||n&&a===d.CloseSquareBracket||n&&a===d.Colon)s!==-1&&(i+=encodeURIComponent(e.substring(s,r)),s=-1),i!==void 0&&(i+=e.charAt(r));else{i===void 0&&(i=e.substr(0,r));const u=Ai[a];u!==void 0?(s!==-1&&(i+=encodeURIComponent(e.substring(s,r)),s=-1),i+=u):s===-1&&(s=r)}}return s!==-1&&(i+=encodeURIComponent(e.substring(s))),i!==void 0?i:e}function Jl(e){let t;for(let n=0;n1&&e.scheme==="file"?n=`//${e.authority}${e.path}`:e.path.charCodeAt(0)===d.Slash&&(e.path.charCodeAt(1)>=d.A&&e.path.charCodeAt(1)<=d.Z||e.path.charCodeAt(1)>=d.a&&e.path.charCodeAt(1)<=d.z)&&e.path.charCodeAt(2)===d.Colon?t?n=e.path.substr(1):n=e.path[1].toLowerCase()+e.path.substr(2):n=e.path,pt&&(n=n.replace(/\//g,"\\")),n}function En(e,t){const n=t?Jl:xi;let i="",{scheme:s,authority:r,path:a,query:u,fragment:o}=e;if(s&&(i+=s,i+=":"),(r||s==="file")&&(i+=Ee,i+=Ee),r){let c=r.indexOf("@");if(c!==-1){const h=r.substr(0,c);r=r.substr(c+1),c=h.lastIndexOf(":"),c===-1?i+=n(h,!1,!1):(i+=n(h.substr(0,c),!1,!1),i+=":",i+=n(h.substr(c+1),!1,!0)),i+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?i+=n(r,!1,!0):(i+=n(r.substr(0,c),!1,!0),i+=r.substr(c))}if(a){if(a.length>=3&&a.charCodeAt(0)===d.Slash&&a.charCodeAt(2)===d.Colon){const c=a.charCodeAt(1);c>=d.A&&c<=d.Z&&(a=`/${String.fromCharCode(c+32)}:${a.substr(3)}`)}else if(a.length>=2&&a.charCodeAt(1)===d.Colon){const c=a.charCodeAt(0);c>=d.A&&c<=d.Z&&(a=`${String.fromCharCode(c+32)}:${a.substr(2)}`)}i+=n(a,!0,!1)}return u&&(i+="?",i+=n(u,!1,!1)),o&&(i+="#",i+=t?o:xi(o,!1,!1)),i}function Ri(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+Ri(e.substr(3)):e}}const vi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $t(e){return e.match(vi)?e.replace(vi,t=>Ri(t)):e}class te{constructor(t,n){this.lineNumber=t,this.column=n}with(t=this.lineNumber,n=this.column){return t===this.lineNumber&&n===this.column?this:new te(t,n)}delta(t=0,n=0){return this.with(this.lineNumber+t,this.column+n)}equals(t){return te.equals(this,t)}static equals(t,n){return!t&&!n?!0:!!t&&!!n&&t.lineNumber===n.lineNumber&&t.column===n.column}isBefore(t){return te.isBefore(this,t)}static isBefore(t,n){return t.lineNumberi||t===i&&n>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=t,this.endColumn=n):(this.startLineNumber=t,this.startColumn=n,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return O.isEmpty(this)}static isEmpty(t){return t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn}containsPosition(t){return O.containsPosition(this,t)}static containsPosition(t,n){return!(n.lineNumbert.endLineNumber||n.lineNumber===t.startLineNumber&&n.columnt.endColumn)}static strictContainsPosition(t,n){return!(n.lineNumbert.endLineNumber||n.lineNumber===t.startLineNumber&&n.column<=t.startColumn||n.lineNumber===t.endLineNumber&&n.column>=t.endColumn)}containsRange(t){return O.containsRange(this,t)}static containsRange(t,n){return!(n.startLineNumbert.endLineNumber||n.endLineNumber>t.endLineNumber||n.startLineNumber===t.startLineNumber&&n.startColumnt.endColumn)}strictContainsRange(t){return O.strictContainsRange(this,t)}static strictContainsRange(t,n){return!(n.startLineNumbert.endLineNumber||n.endLineNumber>t.endLineNumber||n.startLineNumber===t.startLineNumber&&n.startColumn<=t.startColumn||n.endLineNumber===t.endLineNumber&&n.endColumn>=t.endColumn)}plusRange(t){return O.plusRange(this,t)}static plusRange(t,n){let i,s,r,a;return n.startLineNumbert.endLineNumber?(r=n.endLineNumber,a=n.endColumn):n.endLineNumber===t.endLineNumber?(r=n.endLineNumber,a=Math.max(n.endColumn,t.endColumn)):(r=t.endLineNumber,a=t.endColumn),new O(i,s,r,a)}intersectRanges(t){return O.intersectRanges(this,t)}static intersectRanges(t,n){let i=t.startLineNumber,s=t.startColumn,r=t.endLineNumber,a=t.endColumn;const u=n.startLineNumber,o=n.startColumn,c=n.endLineNumber,h=n.endColumn;return ic?(r=c,a=h):r===c&&(a=Math.min(a,h)),i>r||i===r&&s>a?null:new O(i,s,r,a)}equalsRange(t){return O.equalsRange(this,t)}static equalsRange(t,n){return!t&&!n?!0:!!t&&!!n&&t.startLineNumber===n.startLineNumber&&t.startColumn===n.startColumn&&t.endLineNumber===n.endLineNumber&&t.endColumn===n.endColumn}getEndPosition(){return O.getEndPosition(this)}static getEndPosition(t){return new te(t.endLineNumber,t.endColumn)}getStartPosition(){return O.getStartPosition(this)}static getStartPosition(t){return new te(t.startLineNumber,t.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(t,n){return new O(this.startLineNumber,this.startColumn,t,n)}setStartPosition(t,n){return new O(t,n,this.endLineNumber,this.endColumn)}collapseToStart(){return O.collapseToStart(this)}static collapseToStart(t){return new O(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return O.collapseToEnd(this)}static collapseToEnd(t){return new O(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new O(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}static fromPositions(t,n=t){return new O(t.lineNumber,t.column,n.lineNumber,n.column)}static lift(t){return t?new O(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(t){return t&&typeof t.startLineNumber=="number"&&typeof t.startColumn=="number"&&typeof t.endLineNumber=="number"&&typeof t.endColumn=="number"}static areIntersectingOrTouching(t,n){return!(t.endLineNumbert.startLineNumber}toJSON(){return this}}class Kl{constructor(t){this.values=t,this.prefixSum=new Uint32Array(t.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(t,n){t=Ce(t);const i=this.values,s=this.prefixSum,r=n.length;return r===0?!1:(this.values=new Uint32Array(i.length+r),this.values.set(i.subarray(0,t),0),this.values.set(i.subarray(t),t+r),this.values.set(n,t),t-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(t,n){return t=Ce(t),n=Ce(n),this.values[t]===n?!1:(this.values[t]=n,t-1=i.length)return!1;const r=i.length-t;return n>=r&&(n=r),n===0?!1:(this.values=new Uint32Array(i.length-n),this.values.set(i.subarray(0,t),0),this.values.set(i.subarray(t+n),t),this.prefixSum=new Uint32Array(this.values.length),t-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(t){return t<0?0:(t=Ce(t),this._getPrefixSum(t))}_getPrefixSum(t){if(t<=this.prefixSumValidIndex[0])return this.prefixSum[t];let n=this.prefixSumValidIndex[0]+1;n===0&&(this.prefixSum[0]=this.values[0],n++),t>=this.values.length&&(t=this.values.length-1);for(let i=n;i<=t;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],t),this.prefixSum[t]}getIndexOf(t){t=Math.floor(t),this.getTotalSum();let n=0,i=this.values.length-1,s=0,r=0,a=0;for(;n<=i;)if(s=n+(i-n)/2|0,r=this.prefixSum[s],a=r-this.values[s],t=r)n=s+1;else break;return new Cl(s,t-a)}}class Cl{constructor(t,n){this.index=t,this.remainder=n,this._prefixSumIndexOfResultBrand=void 0,this.index=t,this.remainder=n}}class e1{constructor(t,n,i,s){this._uri=t,this._lines=n,this._eol=i,this._versionId=s,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(t){t.eol&&t.eol!==this._eol&&(this._eol=t.eol,this._lineStarts=null);const n=t.changes;for(const i of n)this._acceptDeleteRange(i.range),this._acceptInsertText(new te(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=t.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const t=this._eol.length,n=this._lines.length,i=new Uint32Array(n);for(let s=0;s/?";function n1(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of t1)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}const Ui=n1();function Di(e){let t=Ui;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const Ti=new Qr;Ti.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function An(e,t,n,i,s){if(t=Di(t),s||(s=St.first(Ti)),n.length>s.maxLen){let c=e-s.maxLen/2;return c<0?c=0:i+=c,n=n.substring(c,e+s.maxLen/2),An(e,t,n,i,s)}const r=Date.now(),a=e-1-i;let u=-1,o=null;for(let c=1;!(Date.now()-r>=s.timeBudget);c++){const h=a-s.windowSize*c;t.lastIndex=Math.max(0,h);const f=i1(t,n,a,u);if(!f&&o||(o=f,h<=0))break;u=h}if(o){const c={word:o[0],startColumn:i+1+o.index,endColumn:i+1+o.index+o[0].length};return t.lastIndex=0,c}return null}function i1(e,t,n,i){let s;for(;s=e.exec(t);){const r=s.index||0;if(r<=n&&e.lastIndex>=n)return s;if(i>0&&r>i)return null}return null}class xn{constructor(t){const n=li(t);this._defaultValue=n,this._asciiMap=xn._createAsciiMap(n),this._map=new Map}static _createAsciiMap(t){const n=new Uint8Array(256);return n.fill(t),n}set(t,n){const i=li(n);t>=0&&t<256?this._asciiMap[t]=i:this._map.set(t,i)}get(t){return t>=0&&t<256?this._asciiMap[t]:this._map.get(t)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var Mi;(function(e){e[e.False=0]="False",e[e.True=1]="True"})(Mi||(Mi={}));var B;(function(e){e[e.Invalid=0]="Invalid",e[e.Start=1]="Start",e[e.H=2]="H",e[e.HT=3]="HT",e[e.HTT=4]="HTT",e[e.HTTP=5]="HTTP",e[e.F=6]="F",e[e.FI=7]="FI",e[e.FIL=8]="FIL",e[e.BeforeColon=9]="BeforeColon",e[e.AfterColon=10]="AfterColon",e[e.AlmostThere=11]="AlmostThere",e[e.End=12]="End",e[e.Accept=13]="Accept",e[e.LastKnownState=14]="LastKnownState"})(B||(B={}));class s1{constructor(t,n,i){const s=new Uint8Array(t*n);for(let r=0,a=t*n;rn&&(n=o),u>i&&(i=u),c>i&&(i=c)}n++,i++;const s=new s1(i,n,B.Invalid);for(let r=0,a=t.length;r=this._maxCharCode?B.Invalid:this._states.get(t,n)}}let Rn=null;function l1(){return Rn===null&&(Rn=new r1([[B.Start,d.h,B.H],[B.Start,d.H,B.H],[B.Start,d.f,B.F],[B.Start,d.F,B.F],[B.H,d.t,B.HT],[B.H,d.T,B.HT],[B.HT,d.t,B.HTT],[B.HT,d.T,B.HTT],[B.HTT,d.p,B.HTTP],[B.HTT,d.P,B.HTTP],[B.HTTP,d.s,B.BeforeColon],[B.HTTP,d.S,B.BeforeColon],[B.HTTP,d.Colon,B.AfterColon],[B.F,d.i,B.FI],[B.F,d.I,B.FI],[B.FI,d.l,B.FIL],[B.FI,d.L,B.FIL],[B.FIL,d.e,B.BeforeColon],[B.FIL,d.E,B.BeforeColon],[B.BeforeColon,d.Colon,B.AfterColon],[B.AfterColon,d.Slash,B.AlmostThere],[B.AlmostThere,d.Slash,B.End]])),Rn}var X;(function(e){e[e.None=0]="None",e[e.ForceTermination=1]="ForceTermination",e[e.CannotEndIn=2]="CannotEndIn"})(X||(X={}));let xt=null;function a1(){if(xt===null){xt=new xn(X.None);const e=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let n=0;ns);if(s>0){const u=n.charCodeAt(s-1),o=n.charCodeAt(a);(u===d.OpenParen&&o===d.CloseParen||u===d.OpenSquareBracket&&o===d.CloseSquareBracket||u===d.OpenCurlyBrace&&o===d.CloseCurlyBrace)&&a--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:a+2},url:n.substring(s,a+1)}}static computeLinks(t,n=l1()){const i=a1(),s=[];for(let r=1,a=t.getLineCount();r<=a;r++){const u=t.getLineContent(r),o=u.length;let c=0,h=0,f=0,_=B.Start,b=!1,L=!1,N=!1,A=!1;for(;c=0?(s+=i?1:-1,s<0?s=t.length-1:s%=t.length,t[s]):null}};sn.INSTANCE=new sn;let vn=sn;var m;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(m||(m={}));var g;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.None=0]="None",e[e.Hyper=1]="Hyper",e[e.Super=2]="Super",e[e.Fn=3]="Fn",e[e.FnLock=4]="FnLock",e[e.Suspend=5]="Suspend",e[e.Resume=6]="Resume",e[e.Turbo=7]="Turbo",e[e.Sleep=8]="Sleep",e[e.WakeUp=9]="WakeUp",e[e.KeyA=10]="KeyA",e[e.KeyB=11]="KeyB",e[e.KeyC=12]="KeyC",e[e.KeyD=13]="KeyD",e[e.KeyE=14]="KeyE",e[e.KeyF=15]="KeyF",e[e.KeyG=16]="KeyG",e[e.KeyH=17]="KeyH",e[e.KeyI=18]="KeyI",e[e.KeyJ=19]="KeyJ",e[e.KeyK=20]="KeyK",e[e.KeyL=21]="KeyL",e[e.KeyM=22]="KeyM",e[e.KeyN=23]="KeyN",e[e.KeyO=24]="KeyO",e[e.KeyP=25]="KeyP",e[e.KeyQ=26]="KeyQ",e[e.KeyR=27]="KeyR",e[e.KeyS=28]="KeyS",e[e.KeyT=29]="KeyT",e[e.KeyU=30]="KeyU",e[e.KeyV=31]="KeyV",e[e.KeyW=32]="KeyW",e[e.KeyX=33]="KeyX",e[e.KeyY=34]="KeyY",e[e.KeyZ=35]="KeyZ",e[e.Digit1=36]="Digit1",e[e.Digit2=37]="Digit2",e[e.Digit3=38]="Digit3",e[e.Digit4=39]="Digit4",e[e.Digit5=40]="Digit5",e[e.Digit6=41]="Digit6",e[e.Digit7=42]="Digit7",e[e.Digit8=43]="Digit8",e[e.Digit9=44]="Digit9",e[e.Digit0=45]="Digit0",e[e.Enter=46]="Enter",e[e.Escape=47]="Escape",e[e.Backspace=48]="Backspace",e[e.Tab=49]="Tab",e[e.Space=50]="Space",e[e.Minus=51]="Minus",e[e.Equal=52]="Equal",e[e.BracketLeft=53]="BracketLeft",e[e.BracketRight=54]="BracketRight",e[e.Backslash=55]="Backslash",e[e.IntlHash=56]="IntlHash",e[e.Semicolon=57]="Semicolon",e[e.Quote=58]="Quote",e[e.Backquote=59]="Backquote",e[e.Comma=60]="Comma",e[e.Period=61]="Period",e[e.Slash=62]="Slash",e[e.CapsLock=63]="CapsLock",e[e.F1=64]="F1",e[e.F2=65]="F2",e[e.F3=66]="F3",e[e.F4=67]="F4",e[e.F5=68]="F5",e[e.F6=69]="F6",e[e.F7=70]="F7",e[e.F8=71]="F8",e[e.F9=72]="F9",e[e.F10=73]="F10",e[e.F11=74]="F11",e[e.F12=75]="F12",e[e.PrintScreen=76]="PrintScreen",e[e.ScrollLock=77]="ScrollLock",e[e.Pause=78]="Pause",e[e.Insert=79]="Insert",e[e.Home=80]="Home",e[e.PageUp=81]="PageUp",e[e.Delete=82]="Delete",e[e.End=83]="End",e[e.PageDown=84]="PageDown",e[e.ArrowRight=85]="ArrowRight",e[e.ArrowLeft=86]="ArrowLeft",e[e.ArrowDown=87]="ArrowDown",e[e.ArrowUp=88]="ArrowUp",e[e.NumLock=89]="NumLock",e[e.NumpadDivide=90]="NumpadDivide",e[e.NumpadMultiply=91]="NumpadMultiply",e[e.NumpadSubtract=92]="NumpadSubtract",e[e.NumpadAdd=93]="NumpadAdd",e[e.NumpadEnter=94]="NumpadEnter",e[e.Numpad1=95]="Numpad1",e[e.Numpad2=96]="Numpad2",e[e.Numpad3=97]="Numpad3",e[e.Numpad4=98]="Numpad4",e[e.Numpad5=99]="Numpad5",e[e.Numpad6=100]="Numpad6",e[e.Numpad7=101]="Numpad7",e[e.Numpad8=102]="Numpad8",e[e.Numpad9=103]="Numpad9",e[e.Numpad0=104]="Numpad0",e[e.NumpadDecimal=105]="NumpadDecimal",e[e.IntlBackslash=106]="IntlBackslash",e[e.ContextMenu=107]="ContextMenu",e[e.Power=108]="Power",e[e.NumpadEqual=109]="NumpadEqual",e[e.F13=110]="F13",e[e.F14=111]="F14",e[e.F15=112]="F15",e[e.F16=113]="F16",e[e.F17=114]="F17",e[e.F18=115]="F18",e[e.F19=116]="F19",e[e.F20=117]="F20",e[e.F21=118]="F21",e[e.F22=119]="F22",e[e.F23=120]="F23",e[e.F24=121]="F24",e[e.Open=122]="Open",e[e.Help=123]="Help",e[e.Select=124]="Select",e[e.Again=125]="Again",e[e.Undo=126]="Undo",e[e.Cut=127]="Cut",e[e.Copy=128]="Copy",e[e.Paste=129]="Paste",e[e.Find=130]="Find",e[e.AudioVolumeMute=131]="AudioVolumeMute",e[e.AudioVolumeUp=132]="AudioVolumeUp",e[e.AudioVolumeDown=133]="AudioVolumeDown",e[e.NumpadComma=134]="NumpadComma",e[e.IntlRo=135]="IntlRo",e[e.KanaMode=136]="KanaMode",e[e.IntlYen=137]="IntlYen",e[e.Convert=138]="Convert",e[e.NonConvert=139]="NonConvert",e[e.Lang1=140]="Lang1",e[e.Lang2=141]="Lang2",e[e.Lang3=142]="Lang3",e[e.Lang4=143]="Lang4",e[e.Lang5=144]="Lang5",e[e.Abort=145]="Abort",e[e.Props=146]="Props",e[e.NumpadParenLeft=147]="NumpadParenLeft",e[e.NumpadParenRight=148]="NumpadParenRight",e[e.NumpadBackspace=149]="NumpadBackspace",e[e.NumpadMemoryStore=150]="NumpadMemoryStore",e[e.NumpadMemoryRecall=151]="NumpadMemoryRecall",e[e.NumpadMemoryClear=152]="NumpadMemoryClear",e[e.NumpadMemoryAdd=153]="NumpadMemoryAdd",e[e.NumpadMemorySubtract=154]="NumpadMemorySubtract",e[e.NumpadClear=155]="NumpadClear",e[e.NumpadClearEntry=156]="NumpadClearEntry",e[e.ControlLeft=157]="ControlLeft",e[e.ShiftLeft=158]="ShiftLeft",e[e.AltLeft=159]="AltLeft",e[e.MetaLeft=160]="MetaLeft",e[e.ControlRight=161]="ControlRight",e[e.ShiftRight=162]="ShiftRight",e[e.AltRight=163]="AltRight",e[e.MetaRight=164]="MetaRight",e[e.BrightnessUp=165]="BrightnessUp",e[e.BrightnessDown=166]="BrightnessDown",e[e.MediaPlay=167]="MediaPlay",e[e.MediaRecord=168]="MediaRecord",e[e.MediaFastForward=169]="MediaFastForward",e[e.MediaRewind=170]="MediaRewind",e[e.MediaTrackNext=171]="MediaTrackNext",e[e.MediaTrackPrevious=172]="MediaTrackPrevious",e[e.MediaStop=173]="MediaStop",e[e.Eject=174]="Eject",e[e.MediaPlayPause=175]="MediaPlayPause",e[e.MediaSelect=176]="MediaSelect",e[e.LaunchMail=177]="LaunchMail",e[e.LaunchApp2=178]="LaunchApp2",e[e.LaunchApp1=179]="LaunchApp1",e[e.SelectTask=180]="SelectTask",e[e.LaunchScreenSaver=181]="LaunchScreenSaver",e[e.BrowserSearch=182]="BrowserSearch",e[e.BrowserHome=183]="BrowserHome",e[e.BrowserBack=184]="BrowserBack",e[e.BrowserForward=185]="BrowserForward",e[e.BrowserStop=186]="BrowserStop",e[e.BrowserRefresh=187]="BrowserRefresh",e[e.BrowserFavorites=188]="BrowserFavorites",e[e.ZoomToggle=189]="ZoomToggle",e[e.MailReply=190]="MailReply",e[e.MailForward=191]="MailForward",e[e.MailSend=192]="MailSend",e[e.MAX_VALUE=193]="MAX_VALUE"})(g||(g={}));class Un{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,n){this._keyCodeToStr[t]=n,this._strToKeyCode[n.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||m.Unknown}}const Xt=new Un,Dn=new Un,Tn=new Un,o1=new Array(230),c1=Object.create(null),f1=Object.create(null),Mn=[];for(let e=0;e<=g.MAX_VALUE;e++)m.DependsOnKbLayout;for(let e=0;e<=m.MAX_VALUE;e++)Mn[e]=g.DependsOnKbLayout;(function(){const e="",t=[[1,g.None,"None",m.Unknown,"unknown",0,"VK_UNKNOWN",e,e],[1,g.Hyper,"Hyper",m.Unknown,e,0,e,e,e],[1,g.Super,"Super",m.Unknown,e,0,e,e,e],[1,g.Fn,"Fn",m.Unknown,e,0,e,e,e],[1,g.FnLock,"FnLock",m.Unknown,e,0,e,e,e],[1,g.Suspend,"Suspend",m.Unknown,e,0,e,e,e],[1,g.Resume,"Resume",m.Unknown,e,0,e,e,e],[1,g.Turbo,"Turbo",m.Unknown,e,0,e,e,e],[1,g.Sleep,"Sleep",m.Unknown,e,0,"VK_SLEEP",e,e],[1,g.WakeUp,"WakeUp",m.Unknown,e,0,e,e,e],[0,g.KeyA,"KeyA",m.KeyA,"A",65,"VK_A",e,e],[0,g.KeyB,"KeyB",m.KeyB,"B",66,"VK_B",e,e],[0,g.KeyC,"KeyC",m.KeyC,"C",67,"VK_C",e,e],[0,g.KeyD,"KeyD",m.KeyD,"D",68,"VK_D",e,e],[0,g.KeyE,"KeyE",m.KeyE,"E",69,"VK_E",e,e],[0,g.KeyF,"KeyF",m.KeyF,"F",70,"VK_F",e,e],[0,g.KeyG,"KeyG",m.KeyG,"G",71,"VK_G",e,e],[0,g.KeyH,"KeyH",m.KeyH,"H",72,"VK_H",e,e],[0,g.KeyI,"KeyI",m.KeyI,"I",73,"VK_I",e,e],[0,g.KeyJ,"KeyJ",m.KeyJ,"J",74,"VK_J",e,e],[0,g.KeyK,"KeyK",m.KeyK,"K",75,"VK_K",e,e],[0,g.KeyL,"KeyL",m.KeyL,"L",76,"VK_L",e,e],[0,g.KeyM,"KeyM",m.KeyM,"M",77,"VK_M",e,e],[0,g.KeyN,"KeyN",m.KeyN,"N",78,"VK_N",e,e],[0,g.KeyO,"KeyO",m.KeyO,"O",79,"VK_O",e,e],[0,g.KeyP,"KeyP",m.KeyP,"P",80,"VK_P",e,e],[0,g.KeyQ,"KeyQ",m.KeyQ,"Q",81,"VK_Q",e,e],[0,g.KeyR,"KeyR",m.KeyR,"R",82,"VK_R",e,e],[0,g.KeyS,"KeyS",m.KeyS,"S",83,"VK_S",e,e],[0,g.KeyT,"KeyT",m.KeyT,"T",84,"VK_T",e,e],[0,g.KeyU,"KeyU",m.KeyU,"U",85,"VK_U",e,e],[0,g.KeyV,"KeyV",m.KeyV,"V",86,"VK_V",e,e],[0,g.KeyW,"KeyW",m.KeyW,"W",87,"VK_W",e,e],[0,g.KeyX,"KeyX",m.KeyX,"X",88,"VK_X",e,e],[0,g.KeyY,"KeyY",m.KeyY,"Y",89,"VK_Y",e,e],[0,g.KeyZ,"KeyZ",m.KeyZ,"Z",90,"VK_Z",e,e],[0,g.Digit1,"Digit1",m.Digit1,"1",49,"VK_1",e,e],[0,g.Digit2,"Digit2",m.Digit2,"2",50,"VK_2",e,e],[0,g.Digit3,"Digit3",m.Digit3,"3",51,"VK_3",e,e],[0,g.Digit4,"Digit4",m.Digit4,"4",52,"VK_4",e,e],[0,g.Digit5,"Digit5",m.Digit5,"5",53,"VK_5",e,e],[0,g.Digit6,"Digit6",m.Digit6,"6",54,"VK_6",e,e],[0,g.Digit7,"Digit7",m.Digit7,"7",55,"VK_7",e,e],[0,g.Digit8,"Digit8",m.Digit8,"8",56,"VK_8",e,e],[0,g.Digit9,"Digit9",m.Digit9,"9",57,"VK_9",e,e],[0,g.Digit0,"Digit0",m.Digit0,"0",48,"VK_0",e,e],[1,g.Enter,"Enter",m.Enter,"Enter",13,"VK_RETURN",e,e],[1,g.Escape,"Escape",m.Escape,"Escape",27,"VK_ESCAPE",e,e],[1,g.Backspace,"Backspace",m.Backspace,"Backspace",8,"VK_BACK",e,e],[1,g.Tab,"Tab",m.Tab,"Tab",9,"VK_TAB",e,e],[1,g.Space,"Space",m.Space,"Space",32,"VK_SPACE",e,e],[0,g.Minus,"Minus",m.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,g.Equal,"Equal",m.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,g.BracketLeft,"BracketLeft",m.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,g.BracketRight,"BracketRight",m.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,g.Backslash,"Backslash",m.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,g.IntlHash,"IntlHash",m.Unknown,e,0,e,e,e],[0,g.Semicolon,"Semicolon",m.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,g.Quote,"Quote",m.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,g.Backquote,"Backquote",m.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,g.Comma,"Comma",m.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,g.Period,"Period",m.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,g.Slash,"Slash",m.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,g.CapsLock,"CapsLock",m.CapsLock,"CapsLock",20,"VK_CAPITAL",e,e],[1,g.F1,"F1",m.F1,"F1",112,"VK_F1",e,e],[1,g.F2,"F2",m.F2,"F2",113,"VK_F2",e,e],[1,g.F3,"F3",m.F3,"F3",114,"VK_F3",e,e],[1,g.F4,"F4",m.F4,"F4",115,"VK_F4",e,e],[1,g.F5,"F5",m.F5,"F5",116,"VK_F5",e,e],[1,g.F6,"F6",m.F6,"F6",117,"VK_F6",e,e],[1,g.F7,"F7",m.F7,"F7",118,"VK_F7",e,e],[1,g.F8,"F8",m.F8,"F8",119,"VK_F8",e,e],[1,g.F9,"F9",m.F9,"F9",120,"VK_F9",e,e],[1,g.F10,"F10",m.F10,"F10",121,"VK_F10",e,e],[1,g.F11,"F11",m.F11,"F11",122,"VK_F11",e,e],[1,g.F12,"F12",m.F12,"F12",123,"VK_F12",e,e],[1,g.PrintScreen,"PrintScreen",m.Unknown,e,0,e,e,e],[1,g.ScrollLock,"ScrollLock",m.ScrollLock,"ScrollLock",145,"VK_SCROLL",e,e],[1,g.Pause,"Pause",m.PauseBreak,"PauseBreak",19,"VK_PAUSE",e,e],[1,g.Insert,"Insert",m.Insert,"Insert",45,"VK_INSERT",e,e],[1,g.Home,"Home",m.Home,"Home",36,"VK_HOME",e,e],[1,g.PageUp,"PageUp",m.PageUp,"PageUp",33,"VK_PRIOR",e,e],[1,g.Delete,"Delete",m.Delete,"Delete",46,"VK_DELETE",e,e],[1,g.End,"End",m.End,"End",35,"VK_END",e,e],[1,g.PageDown,"PageDown",m.PageDown,"PageDown",34,"VK_NEXT",e,e],[1,g.ArrowRight,"ArrowRight",m.RightArrow,"RightArrow",39,"VK_RIGHT","Right",e],[1,g.ArrowLeft,"ArrowLeft",m.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",e],[1,g.ArrowDown,"ArrowDown",m.DownArrow,"DownArrow",40,"VK_DOWN","Down",e],[1,g.ArrowUp,"ArrowUp",m.UpArrow,"UpArrow",38,"VK_UP","Up",e],[1,g.NumLock,"NumLock",m.NumLock,"NumLock",144,"VK_NUMLOCK",e,e],[1,g.NumpadDivide,"NumpadDivide",m.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE",e,e],[1,g.NumpadMultiply,"NumpadMultiply",m.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[1,g.NumpadSubtract,"NumpadSubtract",m.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[1,g.NumpadAdd,"NumpadAdd",m.NumpadAdd,"NumPad_Add",107,"VK_ADD",e,e],[1,g.NumpadEnter,"NumpadEnter",m.Enter,e,0,e,e,e],[1,g.Numpad1,"Numpad1",m.Numpad1,"NumPad1",97,"VK_NUMPAD1",e,e],[1,g.Numpad2,"Numpad2",m.Numpad2,"NumPad2",98,"VK_NUMPAD2",e,e],[1,g.Numpad3,"Numpad3",m.Numpad3,"NumPad3",99,"VK_NUMPAD3",e,e],[1,g.Numpad4,"Numpad4",m.Numpad4,"NumPad4",100,"VK_NUMPAD4",e,e],[1,g.Numpad5,"Numpad5",m.Numpad5,"NumPad5",101,"VK_NUMPAD5",e,e],[1,g.Numpad6,"Numpad6",m.Numpad6,"NumPad6",102,"VK_NUMPAD6",e,e],[1,g.Numpad7,"Numpad7",m.Numpad7,"NumPad7",103,"VK_NUMPAD7",e,e],[1,g.Numpad8,"Numpad8",m.Numpad8,"NumPad8",104,"VK_NUMPAD8",e,e],[1,g.Numpad9,"Numpad9",m.Numpad9,"NumPad9",105,"VK_NUMPAD9",e,e],[1,g.Numpad0,"Numpad0",m.Numpad0,"NumPad0",96,"VK_NUMPAD0",e,e],[1,g.NumpadDecimal,"NumpadDecimal",m.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[0,g.IntlBackslash,"IntlBackslash",m.IntlBackslash,"OEM_102",226,"VK_OEM_102",e,e],[1,g.ContextMenu,"ContextMenu",m.ContextMenu,"ContextMenu",93,e,e,e],[1,g.Power,"Power",m.Unknown,e,0,e,e,e],[1,g.NumpadEqual,"NumpadEqual",m.Unknown,e,0,e,e,e],[1,g.F13,"F13",m.F13,"F13",124,"VK_F13",e,e],[1,g.F14,"F14",m.F14,"F14",125,"VK_F14",e,e],[1,g.F15,"F15",m.F15,"F15",126,"VK_F15",e,e],[1,g.F16,"F16",m.F16,"F16",127,"VK_F16",e,e],[1,g.F17,"F17",m.F17,"F17",128,"VK_F17",e,e],[1,g.F18,"F18",m.F18,"F18",129,"VK_F18",e,e],[1,g.F19,"F19",m.F19,"F19",130,"VK_F19",e,e],[1,g.F20,"F20",m.F20,"F20",131,"VK_F20",e,e],[1,g.F21,"F21",m.F21,"F21",132,"VK_F21",e,e],[1,g.F22,"F22",m.F22,"F22",133,"VK_F22",e,e],[1,g.F23,"F23",m.F23,"F23",134,"VK_F23",e,e],[1,g.F24,"F24",m.F24,"F24",135,"VK_F24",e,e],[1,g.Open,"Open",m.Unknown,e,0,e,e,e],[1,g.Help,"Help",m.Unknown,e,0,e,e,e],[1,g.Select,"Select",m.Unknown,e,0,e,e,e],[1,g.Again,"Again",m.Unknown,e,0,e,e,e],[1,g.Undo,"Undo",m.Unknown,e,0,e,e,e],[1,g.Cut,"Cut",m.Unknown,e,0,e,e,e],[1,g.Copy,"Copy",m.Unknown,e,0,e,e,e],[1,g.Paste,"Paste",m.Unknown,e,0,e,e,e],[1,g.Find,"Find",m.Unknown,e,0,e,e,e],[1,g.AudioVolumeMute,"AudioVolumeMute",m.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[1,g.AudioVolumeUp,"AudioVolumeUp",m.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[1,g.AudioVolumeDown,"AudioVolumeDown",m.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[1,g.NumpadComma,"NumpadComma",m.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[0,g.IntlRo,"IntlRo",m.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1",e,e],[1,g.KanaMode,"KanaMode",m.Unknown,e,0,e,e,e],[0,g.IntlYen,"IntlYen",m.Unknown,e,0,e,e,e],[1,g.Convert,"Convert",m.Unknown,e,0,e,e,e],[1,g.NonConvert,"NonConvert",m.Unknown,e,0,e,e,e],[1,g.Lang1,"Lang1",m.Unknown,e,0,e,e,e],[1,g.Lang2,"Lang2",m.Unknown,e,0,e,e,e],[1,g.Lang3,"Lang3",m.Unknown,e,0,e,e,e],[1,g.Lang4,"Lang4",m.Unknown,e,0,e,e,e],[1,g.Lang5,"Lang5",m.Unknown,e,0,e,e,e],[1,g.Abort,"Abort",m.Unknown,e,0,e,e,e],[1,g.Props,"Props",m.Unknown,e,0,e,e,e],[1,g.NumpadParenLeft,"NumpadParenLeft",m.Unknown,e,0,e,e,e],[1,g.NumpadParenRight,"NumpadParenRight",m.Unknown,e,0,e,e,e],[1,g.NumpadBackspace,"NumpadBackspace",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryStore,"NumpadMemoryStore",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryRecall,"NumpadMemoryRecall",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryClear,"NumpadMemoryClear",m.Unknown,e,0,e,e,e],[1,g.NumpadMemoryAdd,"NumpadMemoryAdd",m.Unknown,e,0,e,e,e],[1,g.NumpadMemorySubtract,"NumpadMemorySubtract",m.Unknown,e,0,e,e,e],[1,g.NumpadClear,"NumpadClear",m.Clear,"Clear",12,"VK_CLEAR",e,e],[1,g.NumpadClearEntry,"NumpadClearEntry",m.Unknown,e,0,e,e,e],[1,g.None,e,m.Ctrl,"Ctrl",17,"VK_CONTROL",e,e],[1,g.None,e,m.Shift,"Shift",16,"VK_SHIFT",e,e],[1,g.None,e,m.Alt,"Alt",18,"VK_MENU",e,e],[1,g.None,e,m.Meta,"Meta",91,"VK_COMMAND",e,e],[1,g.ControlLeft,"ControlLeft",m.Ctrl,e,0,"VK_LCONTROL",e,e],[1,g.ShiftLeft,"ShiftLeft",m.Shift,e,0,"VK_LSHIFT",e,e],[1,g.AltLeft,"AltLeft",m.Alt,e,0,"VK_LMENU",e,e],[1,g.MetaLeft,"MetaLeft",m.Meta,e,0,"VK_LWIN",e,e],[1,g.ControlRight,"ControlRight",m.Ctrl,e,0,"VK_RCONTROL",e,e],[1,g.ShiftRight,"ShiftRight",m.Shift,e,0,"VK_RSHIFT",e,e],[1,g.AltRight,"AltRight",m.Alt,e,0,"VK_RMENU",e,e],[1,g.MetaRight,"MetaRight",m.Meta,e,0,"VK_RWIN",e,e],[1,g.BrightnessUp,"BrightnessUp",m.Unknown,e,0,e,e,e],[1,g.BrightnessDown,"BrightnessDown",m.Unknown,e,0,e,e,e],[1,g.MediaPlay,"MediaPlay",m.Unknown,e,0,e,e,e],[1,g.MediaRecord,"MediaRecord",m.Unknown,e,0,e,e,e],[1,g.MediaFastForward,"MediaFastForward",m.Unknown,e,0,e,e,e],[1,g.MediaRewind,"MediaRewind",m.Unknown,e,0,e,e,e],[1,g.MediaTrackNext,"MediaTrackNext",m.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[1,g.MediaTrackPrevious,"MediaTrackPrevious",m.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[1,g.MediaStop,"MediaStop",m.MediaStop,"MediaStop",178,"VK_MEDIA_STOP",e,e],[1,g.Eject,"Eject",m.Unknown,e,0,e,e,e],[1,g.MediaPlayPause,"MediaPlayPause",m.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[1,g.MediaSelect,"MediaSelect",m.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[1,g.LaunchMail,"LaunchMail",m.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[1,g.LaunchApp2,"LaunchApp2",m.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[1,g.LaunchApp1,"LaunchApp1",m.Unknown,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[1,g.SelectTask,"SelectTask",m.Unknown,e,0,e,e,e],[1,g.LaunchScreenSaver,"LaunchScreenSaver",m.Unknown,e,0,e,e,e],[1,g.BrowserSearch,"BrowserSearch",m.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[1,g.BrowserHome,"BrowserHome",m.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[1,g.BrowserBack,"BrowserBack",m.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[1,g.BrowserForward,"BrowserForward",m.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[1,g.BrowserStop,"BrowserStop",m.Unknown,e,0,"VK_BROWSER_STOP",e,e],[1,g.BrowserRefresh,"BrowserRefresh",m.Unknown,e,0,"VK_BROWSER_REFRESH",e,e],[1,g.BrowserFavorites,"BrowserFavorites",m.Unknown,e,0,"VK_BROWSER_FAVORITES",e,e],[1,g.ZoomToggle,"ZoomToggle",m.Unknown,e,0,e,e,e],[1,g.MailReply,"MailReply",m.Unknown,e,0,e,e,e],[1,g.MailForward,"MailForward",m.Unknown,e,0,e,e,e],[1,g.MailSend,"MailSend",m.Unknown,e,0,e,e,e],[1,g.None,e,m.KEY_IN_COMPOSITION,"KeyInComposition",229,e,e,e],[1,g.None,e,m.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2",e,e],[1,g.None,e,m.OEM_8,"OEM_8",223,"VK_OEM_8",e,e],[1,g.None,e,m.Unknown,e,0,"VK_KANA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HANGUL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_JUNJA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_FINAL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HANJA",e,e],[1,g.None,e,m.Unknown,e,0,"VK_KANJI",e,e],[1,g.None,e,m.Unknown,e,0,"VK_CONVERT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_NONCONVERT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ACCEPT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_MODECHANGE",e,e],[1,g.None,e,m.Unknown,e,0,"VK_SELECT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PRINT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EXECUTE",e,e],[1,g.None,e,m.Unknown,e,0,"VK_SNAPSHOT",e,e],[1,g.None,e,m.Unknown,e,0,"VK_HELP",e,e],[1,g.None,e,m.Unknown,e,0,"VK_APPS",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PROCESSKEY",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PACKET",e,e],[1,g.None,e,m.Unknown,e,0,"VK_DBE_SBCSCHAR",e,e],[1,g.None,e,m.Unknown,e,0,"VK_DBE_DBCSCHAR",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ATTN",e,e],[1,g.None,e,m.Unknown,e,0,"VK_CRSEL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EXSEL",e,e],[1,g.None,e,m.Unknown,e,0,"VK_EREOF",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PLAY",e,e],[1,g.None,e,m.Unknown,e,0,"VK_ZOOM",e,e],[1,g.None,e,m.Unknown,e,0,"VK_NONAME",e,e],[1,g.None,e,m.Unknown,e,0,"VK_PA1",e,e],[1,g.None,e,m.Unknown,e,0,"VK_OEM_CLEAR",e,e]],n=[],i=[];for(const s of t){const[r,a,u,o,c,h,f,_,b]=s;if(i[a]||(i[a]=!0,c1[u]=a,f1[u.toLowerCase()]=a,r&&o!==m.Unknown&&o!==m.Enter&&o!==m.Ctrl&&o!==m.Shift&&o!==m.Alt&&o!==m.Meta&&(Mn[o]=a)),!n[o]){if(n[o]=!0,!c)throw new Error(`String representation missing for key code ${o} around scan code ${u}`);Xt.define(o,c),Dn.define(o,_||c),Tn.define(o,b||_||c)}h&&(o1[h]=o)}Mn[m.Enter]=g.Enter})();var Fi;(function(e){function t(u){return Xt.keyCodeToStr(u)}e.toString=t;function n(u){return Xt.strToKeyCode(u)}e.fromString=n;function i(u){return Dn.keyCodeToStr(u)}e.toUserSettingsUS=i;function s(u){return Tn.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function r(u){return Dn.strToKeyCode(u)||Tn.strToKeyCode(u)}e.fromUserSettings=r;function a(u){if(u>=m.Numpad0&&u<=m.NumpadDivide)return null;switch(u){case m.UpArrow:return"Up";case m.DownArrow:return"Down";case m.LeftArrow:return"Left";case m.RightArrow:return"Right"}return Xt.keyCodeToStr(u)}e.toElectronAccelerator=a})(Fi||(Fi={}));var it;(function(e){e[e.CtrlCmd=2048]="CtrlCmd",e[e.Shift=1024]="Shift",e[e.Alt=512]="Alt",e[e.WinCtrl=256]="WinCtrl"})(it||(it={}));function h1(e,t){const n=(t&65535)<<16>>>0;return(e|n)>>>0}var Oe;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(Oe||(Oe={}));class me extends O{constructor(t,n,i,s){super(t,n,i,s),this.selectionStartLineNumber=t,this.selectionStartColumn=n,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(t){return me.selectionsEqual(this,t)}static selectionsEqual(t,n){return t.selectionStartLineNumber===n.selectionStartLineNumber&&t.selectionStartColumn===n.selectionStartColumn&&t.positionLineNumber===n.positionLineNumber&&t.positionColumn===n.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?Oe.LTR:Oe.RTL}setEndPosition(t,n){return this.getDirection()===Oe.LTR?new me(this.startLineNumber,this.startColumn,t,n):new me(t,n,this.startLineNumber,this.startColumn)}getPosition(){return new te(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new te(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,n){return this.getDirection()===Oe.LTR?new me(t,n,this.endLineNumber,this.endColumn):new me(this.endLineNumber,this.endColumn,t,n)}static fromPositions(t,n=t){return new me(t.lineNumber,t.column,n.lineNumber,n.column)}static fromRange(t,n){return n===Oe.LTR?new me(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new me(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new me(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)}static selectionsArrEqual(t,n){if(t&&!n||!t&&n)return!1;if(!t&&!n)return!0;if(t.length!==n.length)return!1;for(let i=0,s=t.length;i{this._tokenizationSupports.get(t)===n&&(this._tokenizationSupports.delete(t),this.handleChange([t]))})}get(t){return this._tokenizationSupports.get(t)||null}registerFactory(t,n){this._factories.get(t)?.dispose();const i=new b1(this,t,n);return this._factories.set(t,i),Bt(()=>{const s=this._factories.get(t);!s||s!==i||(this._factories.delete(t),s.dispose())})}async getOrCreate(t){const n=this.get(t);if(n)return n;const i=this._factories.get(t);return!i||i.isResolved?null:(await i.resolve(),this.get(t))}isResolved(t){if(this.get(t))return!0;const i=this._factories.get(t);return!!(!i||i.isResolved)}setColorMap(t){this._colorMap=t,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Yt.DefaultBackground?this._colorMap[Yt.DefaultBackground]:null}}class b1 extends Ze{get isResolved(){return this._isResolved}constructor(t,n,i){super(),this._registry=t,this._languageId=n,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const t=await this._factory.tokenizationSupport;this._isResolved=!0,t&&!this._isDisposed&&this._register(this._registry.register(this._languageId,t))}}const Q="vs/editor/common/languages";class d1{constructor(t,n,i){this.offset=t,this.type=n,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}var yi;(function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"})(yi||(yi={}));var M;(function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"})(M||(M={}));var Oi;(function(e){const t=new Map;t.set(M.Method,S.symbolMethod),t.set(M.Function,S.symbolFunction),t.set(M.Constructor,S.symbolConstructor),t.set(M.Field,S.symbolField),t.set(M.Variable,S.symbolVariable),t.set(M.Class,S.symbolClass),t.set(M.Struct,S.symbolStruct),t.set(M.Interface,S.symbolInterface),t.set(M.Module,S.symbolModule),t.set(M.Property,S.symbolProperty),t.set(M.Event,S.symbolEvent),t.set(M.Operator,S.symbolOperator),t.set(M.Unit,S.symbolUnit),t.set(M.Value,S.symbolValue),t.set(M.Enum,S.symbolEnum),t.set(M.Constant,S.symbolConstant),t.set(M.Enum,S.symbolEnum),t.set(M.EnumMember,S.symbolEnumMember),t.set(M.Keyword,S.symbolKeyword),t.set(M.Snippet,S.symbolSnippet),t.set(M.Text,S.symbolText),t.set(M.Color,S.symbolColor),t.set(M.File,S.symbolFile),t.set(M.Reference,S.symbolReference),t.set(M.Customcolor,S.symbolCustomColor),t.set(M.Folder,S.symbolFolder),t.set(M.TypeParameter,S.symbolTypeParameter),t.set(M.User,S.account),t.set(M.Issue,S.issues);function n(r){let a=t.get(r);return a||(console.info("No codicon found for CompletionItemKind "+r),a=S.symbolProperty),a}e.toIcon=n;const i=new Map;i.set("method",M.Method),i.set("function",M.Function),i.set("constructor",M.Constructor),i.set("field",M.Field),i.set("variable",M.Variable),i.set("class",M.Class),i.set("struct",M.Struct),i.set("interface",M.Interface),i.set("module",M.Module),i.set("property",M.Property),i.set("event",M.Event),i.set("operator",M.Operator),i.set("unit",M.Unit),i.set("value",M.Value),i.set("constant",M.Constant),i.set("enum",M.Enum),i.set("enum-member",M.EnumMember),i.set("enumMember",M.EnumMember),i.set("keyword",M.Keyword),i.set("snippet",M.Snippet),i.set("text",M.Text),i.set("color",M.Color),i.set("file",M.File),i.set("reference",M.Reference),i.set("customcolor",M.Customcolor),i.set("folder",M.Folder),i.set("type-parameter",M.TypeParameter),i.set("typeParameter",M.TypeParameter),i.set("account",M.User),i.set("issue",M.Issue);function s(r,a){let u=i.get(r);return typeof u>"u"&&!a&&(u=M.Property),u}e.fromString=s})(Oi||(Oi={}));var Vi;(function(e){e[e.Deprecated=1]="Deprecated"})(Vi||(Vi={}));var Hi;(function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"})(Hi||(Hi={}));var qi;(function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"})(qi||(qi={}));var Wi;(function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(Wi||(Wi={}));var Gi;(function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"})(Gi||(Gi={}));var zi;(function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"})(zi||(zi={}));var $i;(function(e){e[e.Automatic=0]="Automatic",e[e.PasteAs=1]="PasteAs"})($i||($i={}));var ji;(function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"})(ji||(ji={}));var Xi;(function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"})(Xi||(Xi={}));var P;(function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"})(P||(P={})),P.Array+"",Y(Q,0,"array"),P.Boolean+"",Y(Q,1,"boolean"),P.Class+"",Y(Q,2,"class"),P.Constant+"",Y(Q,3,"constant"),P.Constructor+"",Y(Q,4,"constructor"),P.Enum+"",Y(Q,5,"enumeration"),P.EnumMember+"",Y(Q,6,"enumeration member"),P.Event+"",Y(Q,7,"event"),P.Field+"",Y(Q,8,"field"),P.File+"",Y(Q,9,"file"),P.Function+"",Y(Q,10,"function"),P.Interface+"",Y(Q,11,"interface"),P.Key+"",Y(Q,12,"key"),P.Method+"",Y(Q,13,"method"),P.Module+"",Y(Q,14,"module"),P.Namespace+"",Y(Q,15,"namespace"),P.Null+"",Y(Q,16,"null"),P.Number+"",Y(Q,17,"number"),P.Object+"",Y(Q,18,"object"),P.Operator+"",Y(Q,19,"operator"),P.Package+"",Y(Q,20,"package"),P.Property+"",Y(Q,21,"property"),P.String+"",Y(Q,22,"string"),P.Struct+"",Y(Q,23,"struct"),P.TypeParameter+"",Y(Q,24,"type parameter"),P.Variable+"",Y(Q,25,"variable");var Yi;(function(e){e[e.Deprecated=1]="Deprecated"})(Yi||(Yi={}));var Qi;(function(e){const t=new Map;t.set(P.File,S.symbolFile),t.set(P.Module,S.symbolModule),t.set(P.Namespace,S.symbolNamespace),t.set(P.Package,S.symbolPackage),t.set(P.Class,S.symbolClass),t.set(P.Method,S.symbolMethod),t.set(P.Property,S.symbolProperty),t.set(P.Field,S.symbolField),t.set(P.Constructor,S.symbolConstructor),t.set(P.Enum,S.symbolEnum),t.set(P.Interface,S.symbolInterface),t.set(P.Function,S.symbolFunction),t.set(P.Variable,S.symbolVariable),t.set(P.Constant,S.symbolConstant),t.set(P.String,S.symbolString),t.set(P.Number,S.symbolNumber),t.set(P.Boolean,S.symbolBoolean),t.set(P.Array,S.symbolArray),t.set(P.Object,S.symbolObject),t.set(P.Key,S.symbolKey),t.set(P.Null,S.symbolNull),t.set(P.EnumMember,S.symbolEnumMember),t.set(P.Struct,S.symbolStruct),t.set(P.Event,S.symbolEvent),t.set(P.Operator,S.symbolOperator),t.set(P.TypeParameter,S.symbolTypeParameter);function n(i){let s=t.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=S.symbolProperty),s}e.toIcon=n})(Qi||(Qi={}));const pe=class pe{static fromValue(t){switch(t){case"comment":return pe.Comment;case"imports":return pe.Imports;case"region":return pe.Region}return new pe(t)}constructor(t){this.value=t}};pe.Comment=new pe("comment"),pe.Imports=new pe("imports"),pe.Region=new pe("region");let Zi=pe;var Ji;(function(e){e[e.AIGenerated=1]="AIGenerated"})(Ji||(Ji={}));var Ki;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(Ki||(Ki={}));var Ci;(function(e){function t(n){return!n||typeof n!="object"?!1:typeof n.id=="string"&&typeof n.title=="string"}e.is=t})(Ci||(Ci={}));var es;(function(e){e[e.Collapsed=0]="Collapsed",e[e.Expanded=1]="Expanded"})(es||(es={}));var ts;(function(e){e[e.Unresolved=0]="Unresolved",e[e.Resolved=1]="Resolved"})(ts||(ts={}));var ns;(function(e){e[e.Current=0]="Current",e[e.Outdated=1]="Outdated"})(ns||(ns={}));var is;(function(e){e[e.Editing=0]="Editing",e[e.Preview=1]="Preview"})(is||(is={}));var ss;(function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"})(ss||(ss={})),new _1;var rs;(function(e){e[e.None=0]="None",e[e.Option=1]="Option",e[e.Default=2]="Default",e[e.Preferred=3]="Preferred"})(rs||(rs={}));var ls;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(ls||(ls={}));var as;(function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"})(as||(as={}));var us;(function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"})(us||(us={}));var os;(function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"})(os||(os={}));var cs;(function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"})(cs||(cs={}));var fs;(function(e){e[e.Deprecated=1]="Deprecated"})(fs||(fs={}));var hs;(function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(hs||(hs={}));var ms;(function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"})(ms||(ms={}));var gs;(function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"})(gs||(gs={}));var _s;(function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(_s||(_s={}));var bs;(function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"})(bs||(bs={}));var ds;(function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"})(ds||(ds={}));var Ls;(function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.inlineEdit=63]="inlineEdit",e[e.letterSpacing=64]="letterSpacing",e[e.lightbulb=65]="lightbulb",e[e.lineDecorationsWidth=66]="lineDecorationsWidth",e[e.lineHeight=67]="lineHeight",e[e.lineNumbers=68]="lineNumbers",e[e.lineNumbersMinChars=69]="lineNumbersMinChars",e[e.linkedEditing=70]="linkedEditing",e[e.links=71]="links",e[e.matchBrackets=72]="matchBrackets",e[e.minimap=73]="minimap",e[e.mouseStyle=74]="mouseStyle",e[e.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=76]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",e[e.multiCursorModifier=78]="multiCursorModifier",e[e.multiCursorPaste=79]="multiCursorPaste",e[e.multiCursorLimit=80]="multiCursorLimit",e[e.occurrencesHighlight=81]="occurrencesHighlight",e[e.overviewRulerBorder=82]="overviewRulerBorder",e[e.overviewRulerLanes=83]="overviewRulerLanes",e[e.padding=84]="padding",e[e.pasteAs=85]="pasteAs",e[e.parameterHints=86]="parameterHints",e[e.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",e[e.quickSuggestions=89]="quickSuggestions",e[e.quickSuggestionsDelay=90]="quickSuggestionsDelay",e[e.readOnly=91]="readOnly",e[e.readOnlyMessage=92]="readOnlyMessage",e[e.renameOnType=93]="renameOnType",e[e.renderControlCharacters=94]="renderControlCharacters",e[e.renderFinalNewline=95]="renderFinalNewline",e[e.renderLineHighlight=96]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=98]="renderValidationDecorations",e[e.renderWhitespace=99]="renderWhitespace",e[e.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",e[e.roundedSelection=101]="roundedSelection",e[e.rulers=102]="rulers",e[e.scrollbar=103]="scrollbar",e[e.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=105]="scrollBeyondLastLine",e[e.scrollPredominantAxis=106]="scrollPredominantAxis",e[e.selectionClipboard=107]="selectionClipboard",e[e.selectionHighlight=108]="selectionHighlight",e[e.selectOnLineNumbers=109]="selectOnLineNumbers",e[e.showFoldingControls=110]="showFoldingControls",e[e.showUnused=111]="showUnused",e[e.snippetSuggestions=112]="snippetSuggestions",e[e.smartSelect=113]="smartSelect",e[e.smoothScrolling=114]="smoothScrolling",e[e.stickyScroll=115]="stickyScroll",e[e.stickyTabStops=116]="stickyTabStops",e[e.stopRenderingLineAfter=117]="stopRenderingLineAfter",e[e.suggest=118]="suggest",e[e.suggestFontSize=119]="suggestFontSize",e[e.suggestLineHeight=120]="suggestLineHeight",e[e.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",e[e.suggestSelection=122]="suggestSelection",e[e.tabCompletion=123]="tabCompletion",e[e.tabIndex=124]="tabIndex",e[e.unicodeHighlighting=125]="unicodeHighlighting",e[e.unusualLineTerminators=126]="unusualLineTerminators",e[e.useShadowDOM=127]="useShadowDOM",e[e.useTabStops=128]="useTabStops",e[e.wordBreak=129]="wordBreak",e[e.wordSegmenterLocales=130]="wordSegmenterLocales",e[e.wordSeparators=131]="wordSeparators",e[e.wordWrap=132]="wordWrap",e[e.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=135]="wordWrapColumn",e[e.wordWrapOverride1=136]="wordWrapOverride1",e[e.wordWrapOverride2=137]="wordWrapOverride2",e[e.wrappingIndent=138]="wrappingIndent",e[e.wrappingStrategy=139]="wrappingStrategy",e[e.showDeprecated=140]="showDeprecated",e[e.inlayHints=141]="inlayHints",e[e.editorClassName=142]="editorClassName",e[e.pixelRatio=143]="pixelRatio",e[e.tabFocusMode=144]="tabFocusMode",e[e.layoutInfo=145]="layoutInfo",e[e.wrappingInfo=146]="wrappingInfo",e[e.defaultColorDecorators=147]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(Ls||(Ls={}));var ps;(function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(ps||(ps={}));var Ns;(function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"})(Ns||(Ns={}));var ws;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"})(ws||(ws={}));var Es;(function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"})(Es||(Es={}));var As;(function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"})(As||(As={}));var xs;(function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"})(xs||(xs={}));var Rs;(function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"})(Rs||(Rs={}));var vs;(function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"})(vs||(vs={}));var Us;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(Us||(Us={}));var Fn;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(Fn||(Fn={}));var kn;(function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"})(kn||(kn={}));var In;(function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"})(In||(In={}));var Ds;(function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"})(Ds||(Ds={}));var Ts;(function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"})(Ts||(Ts={}));var Ms;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Ms||(Ms={}));var Fs;(function(e){e[e.AIGenerated=1]="AIGenerated"})(Fs||(Fs={}));var ks;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(ks||(ks={}));var Is;(function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"})(Is||(Is={}));var Ss;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"})(Ss||(Ss={}));var Bs;(function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"})(Bs||(Bs={}));var Ps;(function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"})(Ps||(Ps={}));var ys;(function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"})(ys||(ys={}));var Os;(function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"})(Os||(Os={}));var Vs;(function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"})(Vs||(Vs={}));var Hs;(function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"})(Hs||(Hs={}));var Sn;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(Sn||(Sn={}));var qs;(function(e){e.Off="off",e.OnCode="onCode",e.On="on"})(qs||(qs={}));var Ws;(function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"})(Ws||(Ws={}));var Gs;(function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"})(Gs||(Gs={}));var zs;(function(e){e[e.Deprecated=1]="Deprecated"})(zs||(zs={}));var $s;(function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"})($s||($s={}));var js;(function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"})(js||(js={}));var Xs;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Xs||(Xs={}));var Ys;(function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"})(Ys||(Ys={}));const ft=class ft{static chord(t,n){return h1(t,n)}};ft.CtrlCmd=it.CtrlCmd,ft.Shift=it.Shift,ft.Alt=it.Alt,ft.WinCtrl=it.WinCtrl;let Bn=ft;function L1(){return{editor:void 0,languages:void 0,CancellationTokenSource:gl,Emitter:we,KeyCode:Fn,KeyMod:Bn,Position:te,Range:O,Selection:me,SelectionDirection:Sn,MarkerSeverity:kn,MarkerTag:In,Uri:ze,Token:d1}}var st;(function(e){e[e.Regular=0]="Regular",e[e.Whitespace=1]="Whitespace",e[e.WordSeparator=2]="WordSeparator"})(st||(st={})),new Xr(10);var Qs;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"})(Qs||(Qs={}));var Zs;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"})(Zs||(Zs={}));var Js;(function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"})(Js||(Js={}));var Ks;(function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"})(Ks||(Ks={}));var Cs;(function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"})(Cs||(Cs={}));var er;(function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(er||(er={}));var tr;(function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(tr||(tr={}));var nr;(function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"})(nr||(nr={}));var ir;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(ir||(ir={}));var sr;(function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"})(sr||(sr={}));var rr;(function(e){e[e.FIRST_LINE_DETECTION_LENGTH_LIMIT=1e3]="FIRST_LINE_DETECTION_LENGTH_LIMIT"})(rr||(rr={}));function p1(e,t,n,i,s){if(i===0)return!0;const r=t.charCodeAt(i-1);if(e.get(r)!==st.Regular||r===d.CarriageReturn||r===d.LineFeed)return!0;if(s>0){const a=t.charCodeAt(i);if(e.get(a)!==st.Regular)return!0}return!1}function N1(e,t,n,i,s){if(i+s===n)return!0;const r=t.charCodeAt(i+s);if(e.get(r)!==st.Regular||r===d.CarriageReturn||r===d.LineFeed)return!0;if(s>0){const a=t.charCodeAt(i+s-1);if(e.get(a)!==st.Regular)return!0}return!1}function w1(e,t,n,i,s){return p1(e,t,n,i,s)&&N1(e,t,n,i,s)}class E1{constructor(t,n){this._wordSeparators=t,this._searchRegex=n,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(t){this._searchRegex.lastIndex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(t){const n=t.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===n||(i=this._searchRegex.exec(t),!i))return null;const s=i.index,r=i[0].length;if(s===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){wl(t,n,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=r,!this._wordSeparators||w1(this._wordSeparators,t,n,s,r))return i}while(i);return null}}function A1(e,t="Unreachable"){throw new Error(t)}function Qt(e){if(!e()){debugger;e(),kt(new Ne("Assertion Failed"))}}function lr(e,t){let n=0;for(;n0){const z=v.charCodeAt(R-1);Wt(z)&&R--}if(E+1=1e3){f=!0;break e}h.push(new O(A,R+1,A,E+1))}}while(_)}return{ranges:h,hasMore:f,ambiguousCharacterCount:b,invisibleCharacterCount:L,nonBasicAsciiCharacterCount:N}}static computeUnicodeHighlightReason(t,n){const i=new ar(n);switch(i.shouldHighlightNonBasicASCII(t,null)){case ue.None:return null;case ue.Invisible:return{kind:Rt.Invisible};case ue.Ambiguous:{const r=t.codePointAt(0),a=i.ambiguousCharacters.getPrimaryConfusable(r),u=wt.getLocales().filter(o=>!wt.getInstance(new Set([...n.allowedLocales,o])).isAmbiguous(r));return{kind:Rt.Ambiguous,confusableWith:String.fromCodePoint(a),notAmbiguousInLocales:u}}case ue.NonBasicASCII:return{kind:Rt.NonBasicAscii}}}}function R1(e,t){return`[${dl(e.map(i=>String.fromCodePoint(i)).join(""))}]`}var Rt;(function(e){e[e.Ambiguous=0]="Ambiguous",e[e.Invisible=1]="Invisible",e[e.NonBasicAscii=2]="NonBasicAscii"})(Rt||(Rt={}));class ar{constructor(t){this.options=t,this.allowedCodePoints=new Set(t.allowedCodePoints),this.ambiguousCharacters=wt.getInstance(new Set(t.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const t=new Set;if(this.options.invisibleCharacters)for(const n of Et.codePoints)ur(String.fromCodePoint(n))||t.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())t.add(n);for(const n of this.allowedCodePoints)t.delete(n);return t}shouldHighlightNonBasicASCII(t,n){const i=t.codePointAt(0);if(this.allowedCodePoints.has(i))return ue.None;if(this.options.nonBasicASCII)return ue.NonBasicASCII;let s=!1,r=!1;if(n)for(const a of n){const u=a.codePointAt(0),o=Al(a);s=s||o,!o&&!this.ambiguousCharacters.isAmbiguous(u)&&!Et.isInvisibleCharacter(u)&&(r=!0)}return!s&&r?ue.None:this.options.invisibleCharacters&&!ur(t)&&Et.isInvisibleCharacter(i)?ue.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?ue.Ambiguous:ue.None}}function ur(e){return e===" "||e===` -`||e===" "}var ue;(function(e){e[e.None=0]="None",e[e.NonBasicASCII=1]="NonBasicASCII",e[e.Invisible=2]="Invisible",e[e.Ambiguous=3]="Ambiguous"})(ue||(ue={}));class Zt{constructor(t,n,i){this.changes=t,this.moves=n,this.hitTimeout=i}}class Pn{constructor(t,n){this.lineRangeMapping=t,this.changes=n}flip(){return new Pn(this.lineRangeMapping.flip(),this.changes.map(t=>t.flip()))}}class W{static addRange(t,n){let i=0;for(;in))return new W(t,n)}static ofLength(t){return new W(0,t)}static ofStartAndLength(t,n){return new W(t,t+n)}constructor(t,n){if(this.start=t,this.endExclusive=n,t>n)throw new Ne(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new W(this.start+t,this.endExclusive+t)}deltaStart(t){return new W(this.start+t,this.endExclusive)}deltaEnd(t){return new W(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(t){return this.start===t.start&&this.endExclusive===t.endExclusive}containsRange(t){return this.start<=t.start&&t.endExclusive<=this.endExclusive}contains(t){return this.start<=t&&t=t.endExclusive}slice(t){return t.slice(this.start,this.endExclusive)}substring(t){return t.substring(this.start,this.endExclusive)}clip(t){if(this.isEmpty)throw new Ne(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,t))}clipCyclic(t){if(this.isEmpty)throw new Ne(`Invalid clipping range: ${this.toString()}`);return t=this.endExclusive?this.start+(t-this.start)%this.length:t}map(t){const n=[];for(let i=this.start;in)throw new Ne(`startLineNumber ${t} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=t,this.endLineNumberExclusive=n}contains(t){return this.startLineNumber<=t&&ts.endLineNumberExclusive>=t.startLineNumber),i=mt(this._normalizedRanges,s=>s.startLineNumber<=t.endLineNumberExclusive)+1;if(n===i)this._normalizedRanges.splice(n,0,t);else if(n===i-1){const s=this._normalizedRanges[n];this._normalizedRanges[n]=s.join(t)}else{const s=this._normalizedRanges[n].join(this._normalizedRanges[i-1]).join(t);this._normalizedRanges.splice(n,i-n,s)}}contains(t){const n=Qe(this._normalizedRanges,i=>i.startLineNumber<=t);return!!n&&n.endLineNumberExclusive>t}intersects(t){const n=Qe(this._normalizedRanges,i=>i.startLineNumbert.startLineNumber}getUnion(t){if(this._normalizedRanges.length===0)return t;if(t._normalizedRanges.length===0)return this;const n=[];let i=0,s=0,r=null;for(;i=a.startLineNumber?r=new V(r.startLineNumber,Math.max(r.endLineNumberExclusive,a.endLineNumberExclusive)):(n.push(r),r=a)}return r!==null&&n.push(r),new Re(n)}subtractFrom(t){const n=on(this._normalizedRanges,a=>a.endLineNumberExclusive>=t.startLineNumber),i=mt(this._normalizedRanges,a=>a.startLineNumber<=t.endLineNumberExclusive)+1;if(n===i)return new Re([t]);const s=[];let r=t.startLineNumber;for(let a=n;ar&&s.push(new V(r,u.startLineNumber)),r=u.endLineNumberExclusive}return rt.toString()).join(", ")}getIntersection(t){const n=[];let i=0,s=0;for(;in.delta(t)))}}const ge=class ge{static lengthDiffNonNegative(t,n){return n.isLessThan(t)?ge.zero:t.lineCount===n.lineCount?new ge(0,n.columnCount-t.columnCount):new ge(n.lineCount-t.lineCount,n.columnCount)}static betweenPositions(t,n){return t.lineNumber===n.lineNumber?new ge(0,n.column-t.column):new ge(n.lineNumber-t.lineNumber,n.column-1)}static ofRange(t){return ge.betweenPositions(t.getStartPosition(),t.getEndPosition())}static ofText(t){let n=0,i=0;for(const s of t)s===` -`?(n++,i=0):i++;return new ge(n,i)}constructor(t,n){this.lineCount=t,this.columnCount=n}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(t){return this.lineCount!==t.lineCount?this.lineCountt.lineCount:this.columnCount>t.columnCount}isGreaterThanOrEqualTo(t){return this.lineCount!==t.lineCount?this.lineCount>t.lineCount:this.columnCount>=t.columnCount}equals(t){return this.lineCount===t.lineCount&&this.columnCount===t.columnCount}compare(t){return this.lineCount!==t.lineCount?this.lineCount-t.lineCount:this.columnCount-t.columnCount}add(t){return t.lineCount===0?new ge(this.lineCount,this.columnCount+t.columnCount):new ge(this.lineCount+t.lineCount,t.columnCount)}createRange(t){return this.lineCount===0?new O(t.lineNumber,t.column,t.lineNumber,t.column+this.columnCount):new O(t.lineNumber,t.column,t.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new O(1,1,this.lineCount+1,this.columnCount+1)}addToPosition(t){return this.lineCount===0?new te(t.lineNumber,t.column+this.columnCount):new te(t.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};ge.zero=new ge(0,0);let or=ge;class v1{constructor(t,n){this.range=t,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(t,n){return t.range.equalsRange(n.range)&&t.text===n.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}class Ae{static inverse(t,n,i){const s=[];let r=1,a=1;for(const o of t){const c=new Ae(new V(r,o.original.startLineNumber),new V(a,o.modified.startLineNumber));c.modified.isEmpty||s.push(c),r=o.original.endLineNumberExclusive,a=o.modified.endLineNumberExclusive}const u=new Ae(new V(r,n+1),new V(a,i+1));return u.modified.isEmpty||s.push(u),s}static clip(t,n,i){const s=[];for(const r of t){const a=r.original.intersect(n),u=r.modified.intersect(i);a&&!a.isEmpty&&u&&!u.isEmpty&&s.push(new Ae(a,u))}return s}constructor(t,n){this.original=t,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ae(this.modified,this.original)}join(t){return new Ae(this.original.join(t.original),this.modified.join(t.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const t=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(t&&n)return new Ve(t,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ne("not a valid diff");return new Ve(new O(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new O(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ve(new O(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new O(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}}class Te extends Ae{static fromRangeMappings(t){const n=V.join(t.map(s=>V.fromRangeInclusive(s.originalRange))),i=V.join(t.map(s=>V.fromRangeInclusive(s.modifiedRange)));return new Te(n,i,t)}constructor(t,n,i){super(t,n),this.innerChanges=i}flip(){return new Te(this.modified,this.original,this.innerChanges?.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new Te(this.original,this.modified,[this.toRangeMapping()])}}class Ve{constructor(t,n){this.originalRange=t,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Ve(this.modifiedRange,this.originalRange)}toTextEdit(t){const n=t.getValueOfRange(this.modifiedRange);return new v1(this.originalRange,n)}}const U1=3;class D1{computeDiff(t,n,i){const r=new hr(t,n,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let u=null;for(const o of r.changes){let c;o.originalEndLineNumber===0?c=new V(o.originalStartLineNumber+1,o.originalStartLineNumber+1):c=new V(o.originalStartLineNumber,o.originalEndLineNumber+1);let h;o.modifiedEndLineNumber===0?h=new V(o.modifiedStartLineNumber+1,o.modifiedStartLineNumber+1):h=new V(o.modifiedStartLineNumber,o.modifiedEndLineNumber+1);let f=new Te(c,h,o.charChanges?.map(_=>new Ve(new O(_.originalStartLineNumber,_.originalStartColumn,_.originalEndLineNumber,_.originalEndColumn),new O(_.modifiedStartLineNumber,_.modifiedStartColumn,_.modifiedEndLineNumber,_.modifiedEndColumn))));u&&(u.modified.endLineNumberExclusive===f.modified.startLineNumber||u.original.endLineNumberExclusive===f.original.startLineNumber)&&(f=new Te(u.original.join(f.original),u.modified.join(f.modified),u.innerChanges&&f.innerChanges?u.innerChanges.concat(f.innerChanges):void 0),a.pop()),a.push(f),u=f}return Qt(()=>lr(a,(o,c)=>c.original.startLineNumber-o.original.endLineNumberExclusive===c.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive(t===d.LineFeed?"\\n":String.fromCharCode(t))+`-(${this._lineNumbers[n]},${this._columns[n]})`).join(", ")+"]"}_assertIndex(t,n){if(t<0||t>=n.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(t){return t>0&&t===this._lineNumbers.length?this.getEndLineNumber(t-1):(this._assertIndex(t,this._lineNumbers),this._lineNumbers[t])}getEndLineNumber(t){return t===-1?this.getStartLineNumber(t+1):(this._assertIndex(t,this._lineNumbers),this._charCodes[t]===d.LineFeed?this._lineNumbers[t]+1:this._lineNumbers[t])}getStartColumn(t){return t>0&&t===this._columns.length?this.getEndColumn(t-1):(this._assertIndex(t,this._columns),this._columns[t])}getEndColumn(t){return t===-1?this.getStartColumn(t+1):(this._assertIndex(t,this._columns),this._charCodes[t]===d.LineFeed?1:this._columns[t]+1)}}class rt{constructor(t,n,i,s,r,a,u,o){this.originalStartLineNumber=t,this.originalStartColumn=n,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=r,this.modifiedStartColumn=a,this.modifiedEndLineNumber=u,this.modifiedEndColumn=o}static createFromDiffChange(t,n,i){const s=n.getStartLineNumber(t.originalStart),r=n.getStartColumn(t.originalStart),a=n.getEndLineNumber(t.originalStart+t.originalLength-1),u=n.getEndColumn(t.originalStart+t.originalLength-1),o=i.getStartLineNumber(t.modifiedStart),c=i.getStartColumn(t.modifiedStart),h=i.getEndLineNumber(t.modifiedStart+t.modifiedLength-1),f=i.getEndColumn(t.modifiedStart+t.modifiedLength-1);return new rt(s,r,a,u,o,c,h,f)}}function M1(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let i=1,s=e.length;i0&&n.originalLength<20&&n.modifiedLength>0&&n.modifiedLength<20&&r()){const b=i.createCharSequence(t,n.originalStart,n.originalStart+n.originalLength-1),L=s.createCharSequence(t,n.modifiedStart,n.modifiedStart+n.modifiedLength-1);if(b.getElements().length>0&&L.getElements().length>0){let N=cr(b,L,r,!0).changes;u&&(N=M1(N)),_=[];for(let A=0,x=N.length;A1&&N>1;){const A=_.charCodeAt(L-2),x=b.charCodeAt(N-2);if(A!==x)break;L--,N--}(L>1||N>1)&&this._pushTrimWhitespaceCharChange(s,r+1,1,L,a+1,1,N)}{let L=On(_,1),N=On(b,1);const A=_.length+1,x=b.length+1;for(;L!0;const t=Date.now();return()=>Date.now()-t{i.push(K.fromOffsetPairs(s?s.getEndExclusives():Fe.zero,r?r.getStarts():new Fe(n,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+n)))}),i}static fromOffsetPairs(t,n){return new K(new W(t.offset1,n.offset1),new W(t.offset2,n.offset2))}constructor(t,n){this.seq1Range=t,this.seq2Range=n}swap(){return new K(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(t){return new K(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))}delta(t){return t===0?this:new K(this.seq1Range.delta(t),this.seq2Range.delta(t))}deltaStart(t){return t===0?this:new K(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))}deltaEnd(t){return t===0?this:new K(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))}intersectsOrTouches(t){return this.seq1Range.intersectsOrTouches(t.seq1Range)||this.seq2Range.intersectsOrTouches(t.seq2Range)}intersect(t){const n=this.seq1Range.intersect(t.seq1Range),i=this.seq2Range.intersect(t.seq2Range);if(!(!n||!i))return new K(n,i)}getStarts(){return new Fe(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Fe(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const Xe=class Xe{constructor(t,n){this.offset1=t,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(t){return t===0?this:new Xe(this.offset1+t,this.offset2+t)}equals(t){return this.offset1===t.offset1&&this.offset2===t.offset2}};Xe.zero=new Xe(0,0),Xe.max=new Xe(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let Fe=Xe;const rn=class rn{isValid(){return!0}};rn.instance=new rn;let Ut=rn;class F1{constructor(t){if(this.timeout=t,this.startTime=Date.now(),this.valid=!0,t<=0)throw new Ne("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Vn{constructor(t,n){this.width=t,this.height=n,this.array=[],this.array=new Array(t*n)}get(t,n){return this.array[t+n*this.width]}set(t,n,i){this.array[t+n*this.width]=i}}function Hn(e){return e===d.Space||e===d.Tab}const Mt=class Mt{static getKey(t){let n=this.chrKeys.get(t);return n===void 0&&(n=this.chrKeys.size,this.chrKeys.set(t,n)),n}constructor(t,n,i){this.range=t,this.lines=n,this.source=i,this.histogram=[];let s=0;for(let r=t.startLineNumber-1;r0&&N>0&&a.get(L-1,N-1)===3&&(v+=u.get(L-1,N-1)),v+=s?s(L,N):1):v=-1;const p=Math.max(A,x,v);if(p===v){const R=L>0&&N>0?u.get(L-1,N-1):0;u.set(L,N,R+1),a.set(L,N,3)}else p===A?(u.set(L,N,0),a.set(L,N,1)):p===x&&(u.set(L,N,0),a.set(L,N,2));r.set(L,N,p)}const o=[];let c=t.length,h=n.length;function f(L,N){(L+1!==c||N+1!==h)&&o.push(new K(new W(L+1,c),new W(N+1,h))),c=L,h=N}let _=t.length-1,b=n.length-1;for(;_>=0&&b>=0;)a.get(_,b)===3?(f(_,b),_--,b--):a.get(_,b)===1?_--:b--;return f(-1,-1),o.reverse(),new Me(o,!1)}}class gr{compute(t,n,i=Ut.instance){if(t.length===0||n.length===0)return Me.trivial(t,n);const s=t,r=n;function a(N,A){for(;Ns.length||R>r.length)continue;const E=a(p,R);o.set(h,E);const F=p===x?c.get(h+1):c.get(h-1);if(c.set(h,E!==p?new _r(F,p,R,E-p):F),o.get(h)===s.length&&o.get(h)-h===r.length)break e}}let f=c.get(h);const _=[];let b=s.length,L=r.length;for(;;){const N=f?f.x+f.length:0,A=f?f.y+f.length:0;if((N!==b||A!==L)&&_.push(new K(new W(N,b),new W(A,L))),!f)break;b=f.x,L=f.y,f=f.prev}return _.reverse(),new Me(_,!1)}}class _r{constructor(t,n,i,s){this.prev=t,this.x=n,this.y=i,this.length=s}}class I1{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){if(t<0){if(t=-t-1,t>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[t]=n}else{if(t>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[t]=n}}}class S1{constructor(){this.positiveArr=[],this.negativeArr=[]}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){t<0?(t=-t-1,this.negativeArr[t]=n):this.positiveArr[t]=n}}class Kt{constructor(t,n,i){this.lines=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;n.start>0&&n.endExclusive>=t.length&&(n=new W(n.start-1,n.endExclusive),s=!0),this.lineRange=n,this.firstCharOffsetByLine[0]=0;for(let r=this.lineRange.start;rString.fromCharCode(n)).join("")}getElement(t){return this.elements[t]}get length(){return this.elements.length}getBoundaryScore(t){const n=dr(t>0?this.elements[t-1]:-1),i=dr(ti<=t);return new te(this.lineRange.start+n+1,t-this.firstCharOffsetByLine[n]+this.additionalOffsetByLine[n]+1)}translateRange(t){return O.fromPositions(this.translateOffset(t.start),this.translateOffset(t.endExclusive))}findWordContaining(t){if(t<0||t>=this.elements.length||!qn(this.elements[t]))return;let n=t;for(;n>0&&qn(this.elements[n-1]);)n--;let i=t;for(;is<=t.start)??0,i=Br(this.firstCharOffsetByLine,s=>t.endExclusive<=s)??this.elements.length;return new W(n,i)}}function qn(e){return e>=d.a&&e<=d.z||e>=d.A&&e<=d.Z||e>=d.Digit0&&e<=d.Digit9}var J;(function(e){e[e.WordLower=0]="WordLower",e[e.WordUpper=1]="WordUpper",e[e.WordNumber=2]="WordNumber",e[e.End=3]="End",e[e.Other=4]="Other",e[e.Separator=5]="Separator",e[e.Space=6]="Space",e[e.LineBreakCR=7]="LineBreakCR",e[e.LineBreakLF=8]="LineBreakLF"})(J||(J={}));const B1={[J.WordLower]:0,[J.WordUpper]:0,[J.WordNumber]:0,[J.End]:10,[J.Other]:2,[J.Separator]:30,[J.Space]:3,[J.LineBreakCR]:10,[J.LineBreakLF]:10};function br(e){return B1[e]}function dr(e){return e===d.LineFeed?J.LineBreakLF:e===d.CarriageReturn?J.LineBreakCR:Hn(e)?J.Space:e>=d.a&&e<=d.z?J.WordLower:e>=d.A&&e<=d.Z?J.WordUpper:e>=d.Digit0&&e<=d.Digit9?J.WordNumber:e===-1?J.End:e===d.Comma||e===d.Semicolon?J.Separator:J.Other}function P1(e,t,n,i,s,r){let{moves:a,excludedChanges:u}=O1(e,t,n,r);if(!r.isValid())return[];const o=e.filter(h=>!u.has(h)),c=V1(o,i,s,t,n,r);return Hr(a,c),a=H1(a),a=a.filter(h=>{const f=h.original.toOffsetRange().slice(t).map(b=>b.trim());return f.join(` -`).length>=15&&y1(f,b=>b.length>=2)>=2}),a=q1(e,a),a}function y1(e,t){let n=0;for(const i of e)t(i)&&n++;return n}function O1(e,t,n,i){const s=[],r=e.filter(o=>o.modified.isEmpty&&o.original.length>=3).map(o=>new Jt(o.original,t,o)),a=new Set(e.filter(o=>o.original.isEmpty&&o.modified.length>=3).map(o=>new Jt(o.modified,n,o))),u=new Set;for(const o of r){let c=-1,h;for(const f of a){const _=o.computeSimilarity(f);_>c&&(c=_,h=f)}if(c>.9&&h&&(a.delete(h),s.push(new Ae(o.range,h.range)),u.add(o.source),u.add(h.source)),!i.isValid())return{moves:s,excludedChanges:u}}return{moves:s,excludedChanges:u}}function V1(e,t,n,i,s,r){const a=[],u=new Kn;for(const _ of e)for(let b=_.original.startLineNumber;b<_.original.endLineNumberExclusive-2;b++){const L=`${t[b-1]}:${t[b+1-1]}:${t[b+2-1]}`;u.add(L,{range:new V(b,b+3)})}const o=[];e.sort(gt(_=>_.modified.startLineNumber,_t));for(const _ of e){let b=[];for(let L=_.modified.startLineNumber;L<_.modified.endLineNumberExclusive-2;L++){const N=`${n[L-1]}:${n[L+1-1]}:${n[L+2-1]}`,A=new V(L,L+3),x=[];u.forEach(N,({range:v})=>{for(const R of b)if(R.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&R.modifiedLineRange.endLineNumberExclusive+1===A.endLineNumberExclusive){R.originalLineRange=new V(R.originalLineRange.startLineNumber,v.endLineNumberExclusive),R.modifiedLineRange=new V(R.modifiedLineRange.startLineNumber,A.endLineNumberExclusive),x.push(R);return}const p={modifiedLineRange:A,originalLineRange:v};o.push(p),x.push(p)}),b=x}if(!r.isValid())return[]}o.sort(qr(gt(_=>_.modifiedLineRange.length,_t)));const c=new Re,h=new Re;for(const _ of o){const b=_.modifiedLineRange.startLineNumber-_.originalLineRange.startLineNumber,L=c.subtractFrom(_.modifiedLineRange),N=h.subtractFrom(_.originalLineRange).getWithDelta(b),A=L.getIntersection(N);for(const x of A.ranges){if(x.length<3)continue;const v=x,p=x.delta(-b);a.push(new Ae(p,v)),c.addRange(v),h.addRange(p)}}a.sort(gt(_=>_.original.startLineNumber,_t));const f=new It(e);for(let _=0;_F.original.startLineNumber<=b.original.startLineNumber),N=Qe(e,F=>F.modified.startLineNumber<=b.modified.startLineNumber),A=Math.max(b.original.startLineNumber-L.original.startLineNumber,b.modified.startLineNumber-N.modified.startLineNumber),x=f.findLastMonotonous(F=>F.original.startLineNumberF.modified.startLineNumberi.length||k>s.length||c.contains(k)||h.contains(F)||!Lr(i[F-1],s[k-1],r))break}R>0&&(h.addRange(new V(b.original.startLineNumber-R,b.original.startLineNumber)),c.addRange(new V(b.modified.startLineNumber-R,b.modified.startLineNumber)));let E;for(E=0;Ei.length||k>s.length||c.contains(k)||h.contains(F)||!Lr(i[F-1],s[k-1],r))break}E>0&&(h.addRange(new V(b.original.endLineNumberExclusive,b.original.endLineNumberExclusive+E)),c.addRange(new V(b.modified.endLineNumberExclusive,b.modified.endLineNumberExclusive+E))),(R>0||E>0)&&(a[_]=new Ae(new V(b.original.startLineNumber-R,b.original.endLineNumberExclusive+E),new V(b.modified.startLineNumber-R,b.modified.endLineNumberExclusive+E)))}return a}function Lr(e,t,n){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const s=new gr().compute(new Kt([e],new W(0,1),!1),new Kt([t],new W(0,1),!1),n);let r=0;const a=K.invert(s.diffs,e.length);for(const h of a)h.seq1Range.forEach(f=>{Hn(e.charCodeAt(f))||r++});function u(h){let f=0;for(let _=0;_t.length?e:t);return r/o>.6&&o>10}function H1(e){if(e.length===0)return e;e.sort(gt(n=>n.original.startLineNumber,_t));const t=[e[0]];for(let n=1;n=0&&a>=0&&r+a<=2){t[t.length-1]=i.join(s);continue}t.push(s)}return t}function q1(e,t){const n=new It(e);return t=t.filter(i=>{const s=n.findLastMonotonous(u=>u.original.startLineNumberu.modified.startLineNumber0&&(u=u.delta(c))}s.push(u)}return i.length>0&&s.push(i[i.length-1]),s}function W1(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(let i=0;i0?n[i-1]:void 0,r=n[i],a=i+1=i.start&&e.seq2Range.start-a>=s.start&&n.isStronglyEqual(e.seq2Range.start-a,e.seq2Range.endExclusive-a)&&a<100;)a++;a--;let u=0;for(;e.seq1Range.start+uc&&(c=L,o=h)}return e.delta(o)}function G1(e,t,n){const i=[];for(const s of n){const r=i[i.length-1];if(!r){i.push(s);continue}s.seq1Range.start-r.seq1Range.endExclusive<=2||s.seq2Range.start-r.seq2Range.endExclusive<=2?i[i.length-1]=new K(r.seq1Range.join(s.seq1Range),r.seq2Range.join(s.seq2Range)):i.push(s)}return i}function z1(e,t,n){const i=K.invert(n,e.length),s=[];let r=new Fe(0,0);function a(o,c){if(o.offset10;){const A=i[0];if(!(A.seq1Range.intersects(_.seq1Range)||A.seq2Range.intersects(_.seq2Range)))break;const v=e.findWordContaining(A.seq1Range.start),p=t.findWordContaining(A.seq2Range.start),R=new K(v,p),E=R.intersect(A);if(L+=E.seq1Range.length,N+=E.seq2Range.length,_=_.join(R),_.seq1Range.endExclusive>=A.seq1Range.endExclusive)i.shift();else break}L+N<(_.seq1Range.length+_.seq2Range.length)*2/3&&s.push(_),r=_.getEndExclusives()}for(;i.length>0;){const o=i.shift();o.seq1Range.isEmpty||(a(o.getStarts(),o),a(o.getEndExclusives().delta(-1),o))}return $1(n,s)}function $1(e,t){const n=[];for(;e.length>0||t.length>0;){const i=e[0],s=t[0];let r;i&&(!s||i.seq1Range.start0&&n[n.length-1].seq1Range.endExclusive>=r.seq1Range.start?n[n.length-1]=n[n.length-1].join(r):n.push(r)}return n}function j1(e,t,n){let i=n;if(i.length===0)return i;let s=0,r;do{r=!1;const a=[i[0]];for(let u=1;u5||b.seq1Range.length+b.seq2Range.length>5)};const o=i[u],c=a[a.length-1];h(c,o)?(r=!0,a[a.length-1]=a[a.length-1].join(o)):a.push(o)}i=a}while(s++<10&&r);return i}function X1(e,t,n){let i=n;if(i.length===0)return i;let s=0,r;do{r=!1;const u=[i[0]];for(let o=1;o5||N.length>500)return!1;const x=e.getText(N).trim();if(x.length>20||x.split(/\r\n|\r|\n/).length>1)return!1;const v=e.countLinesIn(b.seq1Range),p=b.seq1Range.length,R=t.countLinesIn(b.seq2Range),E=b.seq2Range.length,F=e.countLinesIn(L.seq1Range),k=L.seq1Range.length,I=t.countLinesIn(L.seq2Range),z=L.seq2Range.length,ie=2*40+50;function U(w){return Math.min(w,ie)}return Math.pow(Math.pow(U(v*40+p),1.5)+Math.pow(U(R*40+E),1.5),1.5)+Math.pow(Math.pow(U(F*40+k),1.5)+Math.pow(U(I*40+z),1.5),1.5)>(ie**1.5)**1.5*1.3};const c=i[o],h=u[u.length-1];f(h,c)?(r=!0,u[u.length-1]=u[u.length-1].join(c)):u.push(c)}i=u}while(s++<10&&r);const a=[];return Vr(i,(u,o,c)=>{let h=o;function f(x){return x.length>0&&x.trim().length<=3&&o.seq1Range.length+o.seq2Range.length>100}const _=e.extendToFullLines(o.seq1Range),b=e.getText(new W(_.start,o.seq1Range.start));f(b)&&(h=h.deltaStart(-b.length));const L=e.getText(new W(o.seq1Range.endExclusive,_.endExclusive));f(L)&&(h=h.deltaEnd(L.length));const N=K.fromOffsetPairs(u?u.getEndExclusives():Fe.zero,c?c.getStarts():Fe.max),A=h.intersect(N);a.length>0&&A.getStarts().equals(a[a.length-1].getEndExclusives())?a[a.length-1]=a[a.length-1].join(A):a.push(A)}),a}class Er{constructor(t,n){this.trimmedHash=t,this.lines=n}getElement(t){return this.trimmedHash[t]}get length(){return this.trimmedHash.length}getBoundaryScore(t){const n=t===0?0:Ar(this.lines[t-1]),i=t===this.lines.length?0:Ar(this.lines[t]);return 1e3-(n+i)}getText(t){return this.lines.slice(t.start,t.endExclusive).join(` -`)}isStronglyEqual(t,n){return this.lines[t]===this.lines[n]}}function Ar(e){let t=0;for(;tE===F))return new Zt([],[],!1);if(t.length===1&&t[0].length===0||n.length===1&&n[0].length===0)return new Zt([new Te(new V(1,t.length+1),new V(1,n.length+1),[new Ve(new O(1,1,t.length,t[t.length-1].length+1),new O(1,1,n.length,n[n.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Ut.instance:new F1(i.maxComputationTimeMs),r=!i.ignoreTrimWhitespace,a=new Map;function u(E){let F=a.get(E);return F===void 0&&(F=a.size,a.set(E,F)),F}const o=t.map(E=>u(E.trim())),c=n.map(E=>u(E.trim())),h=new Er(o,t),f=new Er(c,n),_=h.length+f.length<1700?this.dynamicProgrammingDiffing.compute(h,f,s,(E,F)=>t[E]===n[F]?n[F].length===0?.1:1+Math.log(1+n[F].length):.99):this.myersDiffingAlgorithm.compute(h,f,s);let b=_.diffs,L=_.hitTimeout;b=pr(h,f,b),b=j1(h,f,b);const N=[],A=E=>{if(r)for(let F=0;FE.seq1Range.start-x===E.seq2Range.start-v);const F=E.seq1Range.start-x;A(F),x=E.seq1Range.endExclusive,v=E.seq2Range.endExclusive;const k=this.refineDiff(t,n,E,s,r);k.hitTimeout&&(L=!0);for(const I of k.mappings)N.push(I)}A(t.length-x);const p=xr(N,t,n);let R=[];return i.computeMoves&&(R=this.computeMoves(p,t,n,o,c,s,r)),Qt(()=>{function E(k,I){if(k.lineNumber<1||k.lineNumber>I.length)return!1;const z=I[k.lineNumber-1];return!(k.column<1||k.column>z.length+1)}function F(k,I){return!(k.startLineNumber<1||k.startLineNumber>I.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>I.length+1)}for(const k of p){if(!k.innerChanges)return!1;for(const I of k.innerChanges)if(!(E(I.modifiedRange.getStartPosition(),n)&&E(I.modifiedRange.getEndPosition(),n)&&E(I.originalRange.getStartPosition(),t)&&E(I.originalRange.getEndPosition(),t)))return!1;if(!F(k.modified,n)||!F(k.original,t))return!1}return!0}),new Zt(p,R,L)}computeMoves(t,n,i,s,r,a,u){return P1(t,n,i,s,r,a).map(h=>{const f=this.refineDiff(n,i,new K(h.original.toOffsetRange(),h.modified.toOffsetRange()),a,u),_=xr(f.mappings,n,i,!0);return new Pn(h,_)})}refineDiff(t,n,i,s,r){const a=new Kt(t,i.seq1Range,r),u=new Kt(n,i.seq2Range,r),o=a.length+u.length<500?this.dynamicProgrammingDiffing.compute(a,u,s):this.myersDiffingAlgorithm.compute(a,u,s);let c=o.diffs;return c=pr(a,u,c),c=z1(a,u,c),c=G1(a,u,c),c=X1(a,u,c),{mappings:c.map(f=>new Ve(a.translateRange(f.seq1Range),u.translateRange(f.seq2Range))),hitTimeout:o.hitTimeout}}}function xr(e,t,n,i=!1){const s=[];for(const r of yr(e.map(a=>Q1(a,t,n)),(a,u)=>a.original.overlapOrTouch(u.original)||a.modified.overlapOrTouch(u.modified))){const a=r[0],u=r[r.length-1];s.push(new Te(a.original.join(u.original),a.modified.join(u.modified),r.map(o=>o.innerChanges[0])))}return Qt(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||n.length-s[s.length-1].modified.endLineNumberExclusive!==t.length-s[s.length-1].original.endLineNumberExclusive)?!1:lr(s,(r,a)=>a.original.startLineNumber-r.original.endLineNumberExclusive===a.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=n[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(i=1);const r=new V(e.originalRange.startLineNumber+i,e.originalRange.endLineNumber+1+s),a=new V(e.modifiedRange.startLineNumber+i,e.modifiedRange.endLineNumber+1+s);return new Te(r,a,[e])}const Wn={getLegacy:()=>new D1,getDefault:()=>new Y1};function He(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}class ee{constructor(t,n,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,t))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a}}class Le{constructor(t,n,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,t),0)|0,this.s=He(Math.max(Math.min(1,n),0),3),this.l=He(Math.max(Math.min(1,i),0),3),this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.h===n.h&&t.s===n.s&&t.l===n.l&&t.a===n.a}static fromRGBA(t){const n=t.r/255,i=t.g/255,s=t.b/255,r=t.a,a=Math.max(n,i,s),u=Math.min(n,i,s);let o=0,c=0;const h=(u+a)/2,f=a-u;if(f>0){switch(c=Math.min(h<=.5?f/(2*h):f/(2-2*h),1),a){case n:o=(i-s)/f+(i1&&(i-=1),i<1/6?t+(n-t)*6*i:i<1/2?n:i<2/3?t+(n-t)*(2/3-i)*6:t}static toRGBA(t){const n=t.h/360,{s:i,l:s,a:r}=t;let a,u,o;if(i===0)a=u=o=s;else{const c=s<.5?s*(1+i):s+i-s*i,h=2*s-c;a=Le._hue2rgb(h,c,n+1/3),u=Le._hue2rgb(h,c,n),o=Le._hue2rgb(h,c,n-1/3)}return new ee(Math.round(a*255),Math.round(u*255),Math.round(o*255),r)}}class lt{constructor(t,n,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,t),0)|0,this.s=He(Math.max(Math.min(1,n),0),3),this.v=He(Math.max(Math.min(1,i),0),3),this.a=He(Math.max(Math.min(1,s),0),3)}static equals(t,n){return t.h===n.h&&t.s===n.s&&t.v===n.v&&t.a===n.a}static fromRGBA(t){const n=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(n,i,s),a=Math.min(n,i,s),u=r-a,o=r===0?0:u/r;let c;return u===0?c=0:r===n?c=((i-s)/u%6+6)%6:r===i?c=(s-n)/u+2:c=(n-i)/u+4,new lt(Math.round(c*60),o,r,t.a)}static toRGBA(t){const{h:n,s:i,v:s,a:r}=t,a=s*i,u=a*(1-Math.abs(n/60%2-1)),o=s-a;let[c,h,f]=[0,0,0];return n<60?(c=a,h=u):n<120?(c=u,h=a):n<180?(h=a,f=u):n<240?(h=u,f=a):n<300?(c=u,f=a):n<=360&&(c=a,f=u),c=Math.round((c+o)*255),h=Math.round((h+o)*255),f=Math.round((f+o)*255),new ee(c,h,f,r)}}const G=class G{static fromHex(t){return G.Format.CSS.parseHex(t)||G.red}static equals(t,n){return!t&&!n?!0:!t||!n?!1:t.equals(n)}get hsla(){return this._hsla?this._hsla:Le.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:lt.fromRGBA(this.rgba)}constructor(t){if(t)if(t instanceof ee)this.rgba=t;else if(t instanceof Le)this._hsla=t,this.rgba=Le.toRGBA(t);else if(t instanceof lt)this._hsva=t,this.rgba=lt.toRGBA(t);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(t){return!!t&&ee.equals(this.rgba,t.rgba)&&Le.equals(this.hsla,t.hsla)&<.equals(this.hsva,t.hsva)}getRelativeLuminance(){const t=G._relativeLuminanceForComponent(this.rgba.r),n=G._relativeLuminanceForComponent(this.rgba.g),i=G._relativeLuminanceForComponent(this.rgba.b),s=.2126*t+.7152*n+.0722*i;return He(s,4)}static _relativeLuminanceForComponent(t){const n=t/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}getContrastRatio(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return n>i}isDarkerThan(t){const n=this.getRelativeLuminance(),i=t.getRelativeLuminance();return nG._flatten(s,i));return G._flatten(this,n)}static _flatten(t,n){const i=1-t.rgba.a;return new G(new ee(i*n.rgba.r+t.rgba.a*t.rgba.r,i*n.rgba.g+t.rgba.a*t.rgba.g,i*n.rgba.b+t.rgba.a*t.rgba.b))}toString(){return this._toString||(this._toString=G.Format.CSS.format(this)),this._toString}static getLighterColor(t,n,i){if(t.isLighterThan(n))return t;i=i||.5;const s=t.getRelativeLuminance(),r=n.getRelativeLuminance();return i=i*(r-s)/r,t.lighten(i)}static getDarkerColor(t,n,i){if(t.isDarkerThan(n))return t;i=i||.5;const s=t.getRelativeLuminance(),r=n.getRelativeLuminance();return i=i*(s-r)/s,t.darken(i)}};G.white=new G(new ee(255,255,255,1)),G.black=new G(new ee(0,0,0,1)),G.red=new G(new ee(255,0,0,1)),G.blue=new G(new ee(0,0,255,1)),G.green=new G(new ee(0,255,0,1)),G.cyan=new G(new ee(0,255,255,1)),G.lightgrey=new G(new ee(211,211,211,1)),G.transparent=new G(new ee(0,0,0,0));let at=G;(function(e){(function(t){(function(n){function i(b){return b.rgba.a===1?`rgb(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b})`:e.Format.CSS.formatRGBA(b)}n.formatRGB=i;function s(b){return`rgba(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b}, ${+b.rgba.a.toFixed(2)})`}n.formatRGBA=s;function r(b){return b.hsla.a===1?`hsl(${b.hsla.h}, ${(b.hsla.s*100).toFixed(2)}%, ${(b.hsla.l*100).toFixed(2)}%)`:e.Format.CSS.formatHSLA(b)}n.formatHSL=r;function a(b){return`hsla(${b.hsla.h}, ${(b.hsla.s*100).toFixed(2)}%, ${(b.hsla.l*100).toFixed(2)}%, ${b.hsla.a.toFixed(2)})`}n.formatHSLA=a;function u(b){const L=b.toString(16);return L.length!==2?"0"+L:L}function o(b){return`#${u(b.rgba.r)}${u(b.rgba.g)}${u(b.rgba.b)}`}n.formatHex=o;function c(b,L=!1){return L&&b.rgba.a===1?e.Format.CSS.formatHex(b):`#${u(b.rgba.r)}${u(b.rgba.g)}${u(b.rgba.b)}${u(Math.round(b.rgba.a*255))}`}n.formatHexA=c;function h(b){return b.isOpaque()?e.Format.CSS.formatHex(b):e.Format.CSS.formatRGBA(b)}n.format=h;function f(b){const L=b.length;if(L===0||b.charCodeAt(0)!==d.Hash)return null;if(L===7){const N=16*_(b.charCodeAt(1))+_(b.charCodeAt(2)),A=16*_(b.charCodeAt(3))+_(b.charCodeAt(4)),x=16*_(b.charCodeAt(5))+_(b.charCodeAt(6));return new e(new ee(N,A,x,1))}if(L===9){const N=16*_(b.charCodeAt(1))+_(b.charCodeAt(2)),A=16*_(b.charCodeAt(3))+_(b.charCodeAt(4)),x=16*_(b.charCodeAt(5))+_(b.charCodeAt(6)),v=16*_(b.charCodeAt(7))+_(b.charCodeAt(8));return new e(new ee(N,A,x,v/255))}if(L===4){const N=_(b.charCodeAt(1)),A=_(b.charCodeAt(2)),x=_(b.charCodeAt(3));return new e(new ee(16*N+N,16*A+A,16*x+x))}if(L===5){const N=_(b.charCodeAt(1)),A=_(b.charCodeAt(2)),x=_(b.charCodeAt(3)),v=_(b.charCodeAt(4));return new e(new ee(16*N+N,16*A+A,16*x+x,(16*v+v)/255))}return null}n.parseHex=f;function _(b){switch(b){case d.Digit0:return 0;case d.Digit1:return 1;case d.Digit2:return 2;case d.Digit3:return 3;case d.Digit4:return 4;case d.Digit5:return 5;case d.Digit6:return 6;case d.Digit7:return 7;case d.Digit8:return 8;case d.Digit9:return 9;case d.a:return 10;case d.A:return 10;case d.b:return 11;case d.B:return 11;case d.c:return 12;case d.C:return 12;case d.d:return 13;case d.D:return 13;case d.e:return 14;case d.E:return 14;case d.f:return 15;case d.F:return 15}return 0}})(t.CSS||(t.CSS={}))})(e.Format||(e.Format={}))})(at||(at={}));function Rr(e){const t=[];for(const n of e){const i=Number(n);(i||i===0&&n.replace(/\s/g,"")!=="")&&t.push(i)}return t}function Gn(e,t,n,i){return{red:e/255,blue:n/255,green:t/255,alpha:i}}function Dt(e,t){const n=t.index,i=t[0].length;if(!n)return;const s=e.positionAt(n);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+i}}function Z1(e,t){if(!e)return;const n=at.Format.CSS.parseHex(t);if(n)return{range:e,color:Gn(n.rgba.r,n.rgba.g,n.rgba.b,n.rgba.a)}}function vr(e,t,n){if(!e||t.length!==1)return;const s=t[0].values(),r=Rr(s);return{range:e,color:Gn(r[0],r[1],r[2],n?r[3]:1)}}function Ur(e,t,n){if(!e||t.length!==1)return;const s=t[0].values(),r=Rr(s),a=new at(new Le(r[0],r[1]/100,r[2]/100,n?r[3]:1));return{range:e,color:Gn(a.rgba.r,a.rgba.g,a.rgba.b,a.rgba.a)}}function Tt(e,t){return typeof e=="string"?[...e.matchAll(t)]:e.findMatches(t)}function J1(e){const t=[],i=Tt(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const s of i){const r=s.filter(c=>c!==void 0),a=r[1],u=r[2];if(!u)continue;let o;if(a==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;o=vr(Dt(e,s),Tt(u,c),!1)}else if(a==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;o=vr(Dt(e,s),Tt(u,c),!0)}else if(a==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;o=Ur(Dt(e,s),Tt(u,c),!1)}else if(a==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;o=Ur(Dt(e,s),Tt(u,c),!0)}else a==="#"&&(o=Z1(Dt(e,s),a+u));o&&t.push(o)}return t}function K1(e){return!e||typeof e.getValue!="function"||typeof e.positionAt!="function"?[]:J1(e)}const Dr=new RegExp("\\bMARK:\\s*(.*)$","d"),C1=/^-+|-+$/g;function ea(e,t){let n=[];if(t.findRegionSectionHeaders&&t.foldingRules?.markers){const i=ta(e,t);n=n.concat(i)}if(t.findMarkSectionHeaders){const i=na(e);n=n.concat(i)}return n}function ta(e,t){const n=[],i=e.getLineCount();for(let s=1;s<=i;s++){const r=e.getLineContent(s),a=r.match(t.foldingRules.markers.start);if(a){const u={startLineNumber:s,startColumn:a[0].length+1,endLineNumber:s,endColumn:r.length+1};if(u.endColumn>u.startColumn){const o={range:u,...Tr(r.substring(a[0].length)),shouldBeInComments:!1};(o.text||o.hasSeparatorLine)&&n.push(o)}}}return n}function na(e){const t=[],n=e.getLineCount();for(let i=1;i<=n;i++){const s=e.getLineContent(i);ia(s,i,t)}return t}function ia(e,t,n){Dr.lastIndex=0;const i=Dr.exec(e);if(i){const s=i.indices[1][0]+1,r=i.indices[1][1]+1,a={startLineNumber:t,startColumn:s,endLineNumber:t,endColumn:r};if(a.endColumn>a.startColumn){const u={range:a,...Tr(i[1]),shouldBeInComments:!0};(u.text||u.hasSeparatorLine)&&n.push(u)}}}function Tr(e){e=e.trim();const t=e.startsWith("-");return e=e.replace(C1,""),{text:e,hasSeparatorLine:t}}class sa extends e1{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(t){const n=[];for(let i=0;ithis._lines.length)n=this._lines.length,i=this._lines[n-1].length+1,s=!0;else{const r=this._lines[n-1].length+1;i<1?(i=1,s=!0):i>r&&(i=r,s=!0)}return s?{lineNumber:n,column:i}:t}}const qe=class qe{constructor(t,n){this._host=t,this._models=Object.create(null),this._foreignModuleFactory=n,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(t){return this._models[t]}_getModels(){const t=[];return Object.keys(this._models).forEach(n=>t.push(this._models[n])),t}acceptNewModel(t){this._models[t.url]=new sa(ze.parse(t.url),t.lines,t.EOL,t.versionId)}acceptModelChanged(t,n){if(!this._models[t])return;this._models[t].onEvents(n)}acceptRemovedModel(t){this._models[t]&&delete this._models[t]}async computeUnicodeHighlights(t,n,i){const s=this._getModel(t);return s?x1.computeUnicodeHighlights(s,n,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(t,n){const i=this._getModel(t);return i?ea(i,n):[]}async computeDiff(t,n,i,s){const r=this._getModel(t),a=this._getModel(n);return!r||!a?null:qe.computeDiff(r,a,i,s)}static computeDiff(t,n,i,s){const r=s==="advanced"?Wn.getDefault():Wn.getLegacy(),a=t.getLinesContent(),u=n.getLinesContent(),o=r.computeDiff(a,u,i),c=o.changes.length>0?!1:this._modelsAreIdentical(t,n);function h(f){return f.map(_=>[_.original.startLineNumber,_.original.endLineNumberExclusive,_.modified.startLineNumber,_.modified.endLineNumberExclusive,_.innerChanges?.map(b=>[b.originalRange.startLineNumber,b.originalRange.startColumn,b.originalRange.endLineNumber,b.originalRange.endColumn,b.modifiedRange.startLineNumber,b.modifiedRange.startColumn,b.modifiedRange.endLineNumber,b.modifiedRange.endColumn])])}return{identical:c,quitEarly:o.hitTimeout,changes:h(o.changes),moves:o.moves.map(f=>[f.lineRangeMapping.original.startLineNumber,f.lineRangeMapping.original.endLineNumberExclusive,f.lineRangeMapping.modified.startLineNumber,f.lineRangeMapping.modified.endLineNumberExclusive,h(f.changes)])}}static _modelsAreIdentical(t,n){const i=t.getLineCount(),s=n.getLineCount();if(i!==s)return!1;for(let r=1;r<=i;r++){const a=t.getLineContent(r),u=n.getLineContent(r);if(a!==u)return!1}return!0}async computeDirtyDiff(t,n,i){const s=this._getModel(t),r=this._getModel(n);if(!s||!r)return null;const a=s.getLinesContent(),u=r.getLinesContent();return new hr(a,u,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(t,n,i){const s=this._getModel(t);if(!s)return n;const r=[];let a;n=n.slice(0).sort((o,c)=>{if(o.range&&c.range)return O.compareRangesUsingStarts(o.range,c.range);const h=o.range?0:1,f=c.range?0:1;return h-f});let u=0;for(let o=1;oqe._diffLimit){r.push({range:o,text:c});continue}const _=Sl(f,c,i),b=s.offsetAt(O.lift(o).getStartPosition());for(const L of _){const N=s.positionAt(b+L.originalStart),A=s.positionAt(b+L.originalStart+L.originalLength),x={text:c.substr(L.modifiedStart,L.modifiedLength),range:{startLineNumber:N.lineNumber,startColumn:N.column,endLineNumber:A.lineNumber,endColumn:A.column}};s.getValueInRange(x.range)!==x.text&&r.push(x)}}return typeof a=="number"&&r.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}computeHumanReadableDiff(t,n,i){const s=this._getModel(t);if(!s)return n;const r=[];let a;n=n.slice(0).sort((u,o)=>{if(u.range&&o.range)return O.compareRangesUsingStarts(u.range,o.range);const c=u.range?0:1,h=o.range?0:1;return c-h});for(let{range:u,text:o,eol:c}of n){let N=function(x,v){return new te(x.lineNumber+v.lineNumber-1,v.lineNumber===1?x.column+v.column-1:v.column)},A=function(x,v){const p=[];for(let R=v.startLineNumber;R<=v.endLineNumber;R++){const E=x[R-1];R===v.startLineNumber&&R===v.endLineNumber?p.push(E.substring(v.startColumn-1,v.endColumn-1)):R===v.startLineNumber?p.push(E.substring(v.startColumn-1)):R===v.endLineNumber?p.push(E.substring(0,v.endColumn-1)):p.push(E)}return p};if(typeof c=="number"&&(a=c),O.isEmpty(u)&&!o)continue;const h=s.getValueInRange(u);if(o=o.replace(/\r\n|\n|\r/g,s.eol),h===o)continue;if(Math.max(o.length,h.length)>qe._diffLimit){r.push({range:u,text:o});continue}const f=h.split(/\r\n|\n|\r/),_=o.split(/\r\n|\n|\r/),b=Wn.getDefault().computeDiff(f,_,i),L=O.lift(u).getStartPosition();for(const x of b.changes)if(x.innerChanges)for(const v of x.innerChanges)r.push({range:O.fromPositions(N(L,v.originalRange.getStartPosition()),N(L,v.originalRange.getEndPosition())),text:A(_,v.modifiedRange).join(s.eol)});else throw new Ne("The experimental diff algorithm always produces inner changes")}return typeof a=="number"&&r.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async computeLinks(t){const n=this._getModel(t);return n?u1(n):null}async computeDefaultDocumentColors(t){const n=this._getModel(t);return n?K1(n):null}async textualSuggest(t,n,i,s){const r=new Pt,a=new RegExp(i,s),u=new Set;e:for(const o of t){const c=this._getModel(o);if(c){for(const h of c.words(a))if(!(h===n||!isNaN(Number(h)))&&(u.add(h),u.size>qe._suggestionsLimit))break e}}return{words:Array.from(u),duration:r.elapsed()}}async computeWordRanges(t,n,i,s){const r=this._getModel(t);if(!r)return Object.create(null);const a=new RegExp(i,s),u=Object.create(null);for(let o=n.startLineNumber;othis._host.fhr(u,o)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(a,n),Promise.resolve(_n(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(t,n){if(!this._foreignModule||typeof this._foreignModule[t]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+t));try{return Promise.resolve(this._foreignModule[t].apply(this._foreignModule,n))}catch(i){return Promise.reject(i)}}};qe._diffLimit=1e5,qe._suggestionsLimit=1e4;let zn=qe;typeof importScripts=="function"&&(globalThis.monaco=L1());let $n=!1;function ra(e){if($n)return;$n=!0;const t=new Fl(n=>{globalThis.postMessage(n)},n=>new zn(n,e));globalThis.onmessage=n=>{t.onmessage(n.data)}}globalThis.onmessage=e=>{$n||ra(null)}})(); diff --git a/snapshots/master/editor/assets/preview-G-IKvGBB.js b/snapshots/master/editor/assets/preview-DFNGEPhn.js similarity index 92% rename from snapshots/master/editor/assets/preview-G-IKvGBB.js rename to snapshots/master/editor/assets/preview-DFNGEPhn.js index a0b1926d3..f3e5719ca 100644 --- a/snapshots/master/editor/assets/preview-G-IKvGBB.js +++ b/snapshots/master/editor/assets/preview-DFNGEPhn.js @@ -1,5 +1,5 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";let a;const v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);function r(n){return v[n]}let C=v.length;function Z(n){n<132||(v[n]=C,C=n)}function h(n){const e=r(n);return Z(n),e}const J=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&J.decode();let P=null;function M(){return(P===null||P.byteLength===0)&&(P=new Uint8Array(a.memory.buffer)),P}function s(n,e){return n=n>>>0,J.decode(M().subarray(n,n+e))}function b(n){C===v.length&&v.push(v.length+1);const e=C;return C=v[e],v[e]=n,e}let l=0;const L=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ee=typeof L.encodeInto=="function"?function(n,e){return L.encodeInto(n,e)}:function(n,e){const t=L.encode(n);return e.set(t),{read:n.length,written:t.length}};function m(n,e,t){if(t===void 0){const g=L.encode(n),d=e(g.length,1)>>>0;return M().subarray(d,d+g.length).set(g),l=g.length,d}let _=n.length,c=e(_,1)>>>0;const o=M();let i=0;for(;i<_;i++){const g=n.charCodeAt(i);if(g>127)break;o[c+i]=g}if(i!==_){i!==0&&(n=n.slice(i)),c=t(c,_,_=i+n.length*3,1)>>>0;const g=M().subarray(c+i,c+_),d=ee(n,g);i+=d.written,c=t(c,_,i,1)>>>0}return l=i,c}function w(n){return n==null}let A=null;function u(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==a.memory.buffer)&&(A=new DataView(a.memory.buffer)),A}function B(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const c=n.description;return c==null?"Symbol":`Symbol(${c})`}if(e=="function"){const c=n.name;return typeof c=="string"&&c.length>0?`Function(${c})`:"Function"}if(Array.isArray(n)){const c=n.length;let o="[";c>0&&(o+=B(n[0]));for(let i=1;i1)_=t[1];else return toString.call(n);if(_=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:_}const D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{a.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function k(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;try{return _(c.a,c.b,...i)}finally{--c.cnt===0&&(a.__wbindgen_export_2.get(c.dtor)(c.a,c.b),c.a=0,D.unregister(c))}};return o.original=c,D.register(o,c,c),o}function T(n,e,t){a._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h90c32fc406a81877(n,e,b(t))}function x(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;const g=c.a;c.a=0;try{return _(g,c.b,...i)}finally{--c.cnt===0?(a.__wbindgen_export_2.get(c.dtor)(g,c.b),D.unregister(c)):c.a=g}};return o.original=c,D.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h690f3c5ed23d3d95(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h000ca7aabf02b323(n,e,b(t))}function X(n,e,t,_){a._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h58c9f705aaa6eaaf(n,e,b(t),b(_))}function f(n,e){try{return n.apply(this,e)}catch(t){a.__wbindgen_exn_store(b(t))}}function te(n,e,t,_){const c=m(n,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l,i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l,d=m(t,a.__wbindgen_malloc,a.__wbindgen_realloc),p=l,y=a.compile_from_string_with_style(c,o,i,g,d,p,w(_)?0:b(_));return h(y)}function ne(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);return n.ptr}let R=null;function re(){return(R===null||R.byteLength===0)&&(R=new Float32Array(a.memory.buffer)),R}function O(n,e){return n=n>>>0,re().subarray(n/4,n/4+e)}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_compilationresult_free(n>>>0,1));class V{static __wrap(e){e=e>>>0;const t=Object.create(V.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_compilationresult_free(e,0)}get component(){const e=a.compilationresult_component(this.__wbg_ptr);return e===0?void 0:z.__wrap(e)}get diagnostics(){const e=a.compilationresult_diagnostics(this.__wbg_ptr);return h(e)}get error_string(){let e,t;try{const o=a.__wbindgen_add_to_stack_pointer(-16);a.compilationresult_error_string(o,this.__wbg_ptr);var _=u().getInt32(o+4*0,!0),c=u().getInt32(o+4*1,!0);return e=_,t=c,s(_,c)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(e,t,1)}}}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedcompiledcomp_free(n>>>0,1));class z{static __wrap(e){e=e>>>0;const t=Object.create(z.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedcompiledcomp_free(e,0)}run(e){const t=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),_=l;a.wrappedcompiledcomp_run(this.__wbg_ptr,t,_)}create(e){try{const o=a.__wbindgen_add_to_stack_pointer(-16),i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;a.wrappedcompiledcomp_create(o,this.__wbg_ptr,i,g);var t=u().getInt32(o+4*0,!0),_=u().getInt32(o+4*1,!0),c=u().getInt32(o+4*2,!0);if(c)throw h(_);return h(t)}finally{a.__wbindgen_add_to_stack_pointer(16)}}create_with_existing_window(e){try{const i=a.__wbindgen_add_to_stack_pointer(-16);ne(e,W);var t=e.__destroy_into_raw();a.wrappedcompiledcomp_create_with_existing_window(i,this.__wbg_ptr,t);var _=u().getInt32(i+4*0,!0),c=u().getInt32(i+4*1,!0),o=u().getInt32(i+4*2,!0);if(o)throw h(c);return h(_)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}const G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedinstance_free(n>>>0,1));class W{static __wrap(e){e=e>>>0;const t=Object.create(W.prototype);return t.__wbg_ptr=e,G.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedinstance_free(e,0)}show(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_show(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}hide(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_hide(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}async function _e(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(_){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_);else throw _}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function ce(){const n={};return n.wbg={},n.wbg.__wbindgen_object_drop_ref=function(e){h(e)},n.wbg.__wbindgen_string_new=function(e,t){const _=s(e,t);return b(_)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return b(e)},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return b(e)},n.wbg.__wbindgen_number_new=function(e){return b(e)},n.wbg.__wbg_push_37c89022f34c01ca=function(e,t){return r(e).push(r(t))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return b(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const _=r(t).stack,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let _,c;try{_=e,c=t,console.error(s(e,t))}finally{a.__wbindgen_free(_,c,1)}},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return r(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return r(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbindgen_boolean_get=function(e){const t=r(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){r(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){r(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return f(function(e,t,_,c){const o=r(e).getContext(s(t,_),r(c));return w(o)?0:b(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=r(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=r(e).getSupportedExtensions();return w(t)?0:b(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return r(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const _=r(e)[t>>>0];return b(_)},n.wbg.__wbindgen_string_get=function(e,t){const _=r(t),c=typeof _=="string"?_:void 0;var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return f(function(e,t){const _=r(e).getParameter(t>>>0);return b(_)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=r(e).createVertexArrayOES();return w(t)?0:b(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=r(e).createVertexArray();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return r(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return r(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){r(e).bindVertexArray(r(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){r(e).bindVertexArrayOES(r(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,y)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return r(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=r(e).document;return w(t)?0:b(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,_){const c=r(e).getElementById(s(t,_));return w(c)?0:b(c)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=r(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return r(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return r(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=r(e).dataset;return b(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,_,c){const o=r(t)[s(_,c)];var i=w(o)?0:m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=r(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=r(e).style;return b(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return r(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return r(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return r(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return r(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return f(function(e,t){r(e).before(r(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=r(e);return b(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,_){r(e).value=s(t,_)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return r(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const _=r(t).inputType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){r(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return r(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const _=r(t).key,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return r(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,_){return r(e).getModifierState(s(t,_))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return r(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=r(e).clipboardData;return w(t)?0:b(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return f(function(e,t,_,c){const o=r(t).getData(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=r(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,_){r(e).font=s(t,_)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){r(e).fillStyle=r(t)},n.wbg.__wbg_id_8071f78aa2301217=function(e,t){const _=r(t).id,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return r(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return r(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const _=r(t).currentSrc,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const _=r(t).src,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return f(function(){const e=new Image;return b(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,_){r(e).crossOrigin=t===0?void 0:s(t,_)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){r(e).onload=r(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,_){r(e).src=s(t,_)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return b(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return r(e).getTime()},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(r(e));return b(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return r(e).getTimezoneOffset()},n.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(s(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){r(e).deleteVertexArray(r(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){r(e).deleteVertexArrayOES(r(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_call_1084a111329e68ce=function(){return f(function(e,t){const _=r(e).call(r(t));return b(_)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return f(function(e,t,_){const c=r(e).call(r(t),r(_));return b(c)},arguments)},n.wbg.__wbindgen_memory=function(){const e=a.memory;return b(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=r(e).buffer;return b(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,_){const c=new Uint8Array(r(e),t>>>0,_>>>0);return b(c)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return f(function(e,t,_){return Reflect.set(r(e),r(t),r(_))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return f(function(){const e=self.self;return b(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return f(function(){const e=window.window;return b(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return f(function(){const e=globalThis.globalThis;return b(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return f(function(){const e=global.global;return b(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return r(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const _=new Function(s(e,t));return b(_)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var _={a:e,b:t},c=(i,g)=>{const d=_.a;_.a=0;try{return X(d,_.b,i,g)}finally{_.a=d}};const o=new Promise(c);return b(o)}finally{_.a=_.b=0}},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_wrappedinstance_new=function(e){const t=W.__wrap(e);return b(t)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(s(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const _=B(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=r(e).queueMicrotask;return b(t)},n.wbg.__wbindgen_is_function=function(e){return typeof r(e)=="function"},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(r(e));return b(t)},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const _=r(e).then(r(t));return b(_)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(r(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return f(function(e,t,_){const c=r(e).getExtension(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return f(function(e,t,_){const c=r(e).matchMedia(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return f(function(e,t){r(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return f(function(e,t){return r(e).setTimeout(r(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return f(function(e,t,_){const c=r(e).createElement(s(t,_));return b(c)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return f(function(e,t,_){return r(e).matches(s(t,_))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return f(function(e,t,_,c,o){r(e).setAttribute(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return f(function(e){r(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return f(function(e,t,_,c,o){r(e).fillText(s(t,_),c,o)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return f(function(e,t){r(e).addListener(r(t))},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return f(function(e,t,_){const c=r(e).getContext(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return f(function(){const e=new MessageChannel;return b(e)},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return f(function(e,t){r(e).postMessage(r(t))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return f(function(e,t){URL.revokeObjectURL(s(e,t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return f(function(e,t,_,c,o){r(e).setProperty(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_setData_41207994e2d54785=function(){return f(function(e,t,_,c,o){r(e).setData(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=r(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return f(function(){const e=new AbortController;return b(e)},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return f(function(e,t,_,c){r(e).addEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return f(function(e,t,_,c){r(e).removeEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=r(e).performance;return b(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return r(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return r(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return r(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=r(e).signal;return b(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,_){const c=r(e).postTask(r(t),r(_));return b(c)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const _=r(e).catch(r(t));return b(_)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=r(e).port1;return b(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){r(e).onmessage=r(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){r(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=r(e).port2;return b(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return f(function(e,t){return r(e).requestIdleCallback(r(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return f(function(e,t,_){return r(e).setTimeout(r(t),_)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const _=Array.of(r(e),r(t));return b(_)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(r(e));return b(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return f(function(e,t,_){r(e).postMessage(r(t),r(_))},arguments)},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const _=r(t).pointerType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=r(e).contentRect;return b(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return r(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return r(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=r(e).devicePixelContentBoxSize;return b(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return r(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return r(e).blockSize},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return r(e).persisted},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return b(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const _=Object.getOwnPropertyDescriptor(r(e),r(t));return b(_)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=r(e).Window;return b(t)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,_){r(e).type=s(t,_)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return f(function(e,t){const _=new Blob(r(e),r(t));return b(_)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return f(function(e,t){const _=URL.createObjectURL(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(r(e),r(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){r(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){r(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){r(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){r(e).close()},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=r(e).navigator;return b(t)},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=r(e).userAgentData;return w(t)?0:b(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=r(e).brands;return b(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const _=r(t).brand,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return f(function(e,t){const _=r(t).userAgent,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){r(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){r(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){r(e).cancel()},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(h(e))},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){r(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=r(e).requestFullscreen();return b(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=r(e).webkitFullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=r(e).fullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(r(e),r(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,_){const c=r(e).animate(r(t),r(_));return b(c)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){r(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return f(function(e,t){r(e).removeListener(r(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return r(e).contains(r(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){r(e).unobserve(r(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){r(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){r(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return f(function(e,t,_,c){const o=r(t).getPropertyValue(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return f(function(e,t,_,c){const o=r(t).removeProperty(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=r(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=r(e).body;return w(t)?0:b(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return f(function(e,t){const _=r(e).appendChild(r(t));return b(_)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return f(function(e,t){const _=r(e).getComputedStyle(r(t));return w(_)?0:b(_)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=r(e).activeElement;return w(t)?0:b(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return f(function(e){const t=new ResizeObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){r(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,_){r(e).observe(r(t),r(_))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return f(function(e){const t=new IntersectionObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=r(e).getBoundingClientRect();return b(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return r(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return r(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return f(function(e,t){return r(e).requestAnimationFrame(r(t))},arguments)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;return b(t)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return r(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return r(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return r(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return r(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return r(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return r(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const _=r(t).code,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return r(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return r(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return r(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return r(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=r(e).getCoalescedEvents();return b(t)},n.wbg.__wbindgen_closure_wrapper1183=function(e,t,_){const c=k(e,t,168,T);return b(c)},n.wbg.__wbindgen_closure_wrapper1185=function(e,t,_){const c=k(e,t,168,T);return b(c)},n.wbg.__wbindgen_closure_wrapper1186=function(e,t,_){const c=k(e,t,168,T);return b(c)},n.wbg.__wbindgen_closure_wrapper1187=function(e,t,_){const c=k(e,t,168,T);return b(c)},n.wbg.__wbindgen_closure_wrapper1188=function(e,t,_){const c=k(e,t,168,T);return b(c)},n.wbg.__wbindgen_closure_wrapper3353=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6384=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8473=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8507=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8512=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8517=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8556=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8576=function(e,t,_){const c=x(e,t,378,X);return b(c)},n.wbg.__wbindgen_closure_wrapper8584=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8588=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8618=function(e,t,_){const c=x(e,t,378,S);return b(c)},n}function oe(n,e){return a=n.exports,Q.__wbindgen_wasm_module=e,A=null,R=null,P=null,a}async function Q(n){if(a!==void 0)return a;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_wasm_interpreter_bg-qVF2mWkT.wasm",import.meta.url).href,import.meta.url));const e=ce();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await _e(await n,e);return oe(t,_)}(async function(){await Q();let n="";const e=new Map;let t=` +import"./modulepreload-polyfill-B5Qt9EMX.js";let a;const v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);function r(n){return v[n]}let C=v.length;function Z(n){n<132||(v[n]=C,C=n)}function h(n){const e=r(n);return Z(n),e}const J=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&J.decode();let R=null;function M(){return(R===null||R.byteLength===0)&&(R=new Uint8Array(a.memory.buffer)),R}function s(n,e){return n=n>>>0,J.decode(M().subarray(n,n+e))}function b(n){C===v.length&&v.push(v.length+1);const e=C;return C=v[e],v[e]=n,e}let l=0;const D=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ee=typeof D.encodeInto=="function"?function(n,e){return D.encodeInto(n,e)}:function(n,e){const t=D.encode(n);return e.set(t),{read:n.length,written:t.length}};function m(n,e,t){if(t===void 0){const g=D.encode(n),d=e(g.length,1)>>>0;return M().subarray(d,d+g.length).set(g),l=g.length,d}let _=n.length,c=e(_,1)>>>0;const o=M();let i=0;for(;i<_;i++){const g=n.charCodeAt(i);if(g>127)break;o[c+i]=g}if(i!==_){i!==0&&(n=n.slice(i)),c=t(c,_,_=i+n.length*3,1)>>>0;const g=M().subarray(c+i,c+_),d=ee(n,g);i+=d.written,c=t(c,_,i,1)>>>0}return l=i,c}function w(n){return n==null}let A=null;function u(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==a.memory.buffer)&&(A=new DataView(a.memory.buffer)),A}function B(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const c=n.description;return c==null?"Symbol":`Symbol(${c})`}if(e=="function"){const c=n.name;return typeof c=="string"&&c.length>0?`Function(${c})`:"Function"}if(Array.isArray(n)){const c=n.length;let o="[";c>0&&(o+=B(n[0]));for(let i=1;i1)_=t[1];else return toString.call(n);if(_=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +${n.stack}`:_}const L=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{a.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function k(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;try{return _(c.a,c.b,...i)}finally{--c.cnt===0&&(a.__wbindgen_export_2.get(c.dtor)(c.a,c.b),c.a=0,L.unregister(c))}};return o.original=c,L.register(o,c,c),o}function P(n,e,t){a._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0456cc3c37fad44d(n,e,b(t))}function x(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;const g=c.a;c.a=0;try{return _(g,c.b,...i)}finally{--c.cnt===0?(a.__wbindgen_export_2.get(c.dtor)(g,c.b),L.unregister(c)):c.a=g}};return o.original=c,L.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h764ee0df8c4026b9(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h000ca7aabf02b323(n,e,b(t))}function Y(n,e,t,_){a._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h58c9f705aaa6eaaf(n,e,b(t),b(_))}function f(n,e){try{return n.apply(this,e)}catch(t){a.__wbindgen_exn_store(b(t))}}function te(n,e,t,_){const c=m(n,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l,i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l,d=m(t,a.__wbindgen_malloc,a.__wbindgen_realloc),p=l,y=a.compile_from_string_with_style(c,o,i,g,d,p,w(_)?0:b(_));return h(y)}function ne(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);return n.ptr}let T=null;function re(){return(T===null||T.byteLength===0)&&(T=new Float32Array(a.memory.buffer)),T}function O(n,e){return n=n>>>0,re().subarray(n/4,n/4+e)}const X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_compilationresult_free(n>>>0,1));class V{static __wrap(e){e=e>>>0;const t=Object.create(V.prototype);return t.__wbg_ptr=e,X.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_compilationresult_free(e,0)}get component(){const e=a.compilationresult_component(this.__wbg_ptr);return e===0?void 0:z.__wrap(e)}get diagnostics(){const e=a.compilationresult_diagnostics(this.__wbg_ptr);return h(e)}get error_string(){let e,t;try{const o=a.__wbindgen_add_to_stack_pointer(-16);a.compilationresult_error_string(o,this.__wbg_ptr);var _=u().getInt32(o+4*0,!0),c=u().getInt32(o+4*1,!0);return e=_,t=c,s(_,c)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(e,t,1)}}}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedcompiledcomp_free(n>>>0,1));class z{static __wrap(e){e=e>>>0;const t=Object.create(z.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedcompiledcomp_free(e,0)}run(e){const t=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),_=l;a.wrappedcompiledcomp_run(this.__wbg_ptr,t,_)}create(e){try{const o=a.__wbindgen_add_to_stack_pointer(-16),i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;a.wrappedcompiledcomp_create(o,this.__wbg_ptr,i,g);var t=u().getInt32(o+4*0,!0),_=u().getInt32(o+4*1,!0),c=u().getInt32(o+4*2,!0);if(c)throw h(_);return h(t)}finally{a.__wbindgen_add_to_stack_pointer(16)}}create_with_existing_window(e){try{const i=a.__wbindgen_add_to_stack_pointer(-16);ne(e,W);var t=e.__destroy_into_raw();a.wrappedcompiledcomp_create_with_existing_window(i,this.__wbg_ptr,t);var _=u().getInt32(i+4*0,!0),c=u().getInt32(i+4*1,!0),o=u().getInt32(i+4*2,!0);if(o)throw h(c);return h(_)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}const G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedinstance_free(n>>>0,1));class W{static __wrap(e){e=e>>>0;const t=Object.create(W.prototype);return t.__wbg_ptr=e,G.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedinstance_free(e,0)}show(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_show(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}hide(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_hide(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}async function _e(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(_){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_);else throw _}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function ce(){const n={};return n.wbg={},n.wbg.__wbindgen_object_drop_ref=function(e){h(e)},n.wbg.__wbindgen_string_new=function(e,t){const _=s(e,t);return b(_)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return b(e)},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return b(e)},n.wbg.__wbindgen_number_new=function(e){return b(e)},n.wbg.__wbg_push_37c89022f34c01ca=function(e,t){return r(e).push(r(t))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return b(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const _=r(t).stack,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let _,c;try{_=e,c=t,console.error(s(e,t))}finally{a.__wbindgen_free(_,c,1)}},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return r(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return r(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbindgen_boolean_get=function(e){const t=r(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){r(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){r(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return f(function(e,t,_,c){const o=r(e).getContext(s(t,_),r(c));return w(o)?0:b(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=r(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=r(e).getSupportedExtensions();return w(t)?0:b(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return r(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const _=r(e)[t>>>0];return b(_)},n.wbg.__wbindgen_string_get=function(e,t){const _=r(t),c=typeof _=="string"?_:void 0;var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return f(function(e,t){const _=r(e).getParameter(t>>>0);return b(_)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=r(e).createVertexArrayOES();return w(t)?0:b(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=r(e).createVertexArray();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return r(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return r(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){r(e).bindVertexArray(r(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){r(e).bindVertexArrayOES(r(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,y)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return r(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=r(e).document;return w(t)?0:b(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,_){const c=r(e).getElementById(s(t,_));return w(c)?0:b(c)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=r(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return r(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return r(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=r(e).dataset;return b(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,_,c){const o=r(t)[s(_,c)];var i=w(o)?0:m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=r(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=r(e).style;return b(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return r(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return r(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return r(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return r(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return f(function(e,t){r(e).before(r(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=r(e);return b(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,_){r(e).value=s(t,_)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return r(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const _=r(t).inputType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){r(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return r(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const _=r(t).key,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return r(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,_){return r(e).getModifierState(s(t,_))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return r(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=r(e).clipboardData;return w(t)?0:b(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return f(function(e,t,_,c){const o=r(t).getData(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=r(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,_){r(e).font=s(t,_)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){r(e).fillStyle=r(t)},n.wbg.__wbg_id_8071f78aa2301217=function(e,t){const _=r(t).id,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return r(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return r(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const _=r(t).currentSrc,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const _=r(t).src,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return f(function(){const e=new Image;return b(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,_){r(e).crossOrigin=t===0?void 0:s(t,_)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){r(e).onload=r(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,_){r(e).src=s(t,_)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return b(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return r(e).getTime()},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(r(e));return b(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return r(e).getTimezoneOffset()},n.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(s(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){r(e).deleteVertexArray(r(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){r(e).deleteVertexArrayOES(r(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_call_1084a111329e68ce=function(){return f(function(e,t){const _=r(e).call(r(t));return b(_)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return f(function(e,t,_){const c=r(e).call(r(t),r(_));return b(c)},arguments)},n.wbg.__wbindgen_memory=function(){const e=a.memory;return b(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=r(e).buffer;return b(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,_){const c=new Uint8Array(r(e),t>>>0,_>>>0);return b(c)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return f(function(e,t,_){return Reflect.set(r(e),r(t),r(_))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return f(function(){const e=self.self;return b(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return f(function(){const e=window.window;return b(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return f(function(){const e=globalThis.globalThis;return b(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return f(function(){const e=global.global;return b(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return r(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const _=new Function(s(e,t));return b(_)},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var _={a:e,b:t},c=(i,g)=>{const d=_.a;_.a=0;try{return Y(d,_.b,i,g)}finally{_.a=d}};const o=new Promise(c);return b(o)}finally{_.a=_.b=0}},n.wbg.__wbg_wrappedinstance_new=function(e){const t=W.__wrap(e);return b(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(s(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const _=B(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=r(e).queueMicrotask;return b(t)},n.wbg.__wbindgen_is_function=function(e){return typeof r(e)=="function"},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(r(e));return b(t)},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const _=r(e).then(r(t));return b(_)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(r(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return f(function(e,t,_){const c=r(e).getExtension(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return f(function(e,t,_){const c=r(e).matchMedia(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return f(function(e,t){r(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return f(function(e,t){return r(e).setTimeout(r(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return f(function(e,t,_){const c=r(e).createElement(s(t,_));return b(c)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return f(function(e,t,_){return r(e).matches(s(t,_))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return f(function(e,t,_,c,o){r(e).setAttribute(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return f(function(e){r(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return f(function(e,t,_,c,o){r(e).fillText(s(t,_),c,o)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return f(function(e,t){r(e).addListener(r(t))},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return f(function(e,t,_){const c=r(e).getContext(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return f(function(){const e=new MessageChannel;return b(e)},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return f(function(e,t){r(e).postMessage(r(t))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return f(function(e,t){URL.revokeObjectURL(s(e,t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return f(function(e,t,_,c,o){r(e).setProperty(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_setData_41207994e2d54785=function(){return f(function(e,t,_,c,o){r(e).setData(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=r(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return f(function(){const e=new AbortController;return b(e)},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return f(function(e,t,_,c){r(e).addEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return f(function(e,t,_,c){r(e).removeEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=r(e).performance;return b(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return r(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return r(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return r(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=r(e).signal;return b(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,_){const c=r(e).postTask(r(t),r(_));return b(c)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const _=r(e).catch(r(t));return b(_)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=r(e).port1;return b(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){r(e).onmessage=r(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){r(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=r(e).port2;return b(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return f(function(e,t){return r(e).requestIdleCallback(r(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return f(function(e,t,_){return r(e).setTimeout(r(t),_)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const _=Array.of(r(e),r(t));return b(_)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(r(e));return b(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return f(function(e,t,_){r(e).postMessage(r(t),r(_))},arguments)},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const _=r(t).pointerType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=r(e).contentRect;return b(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return r(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return r(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=r(e).devicePixelContentBoxSize;return b(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return r(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return r(e).blockSize},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return r(e).persisted},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return b(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const _=Object.getOwnPropertyDescriptor(r(e),r(t));return b(_)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=r(e).Window;return b(t)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,_){r(e).type=s(t,_)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return f(function(e,t){const _=new Blob(r(e),r(t));return b(_)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return f(function(e,t){const _=URL.createObjectURL(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(r(e),r(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){r(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){r(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){r(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){r(e).close()},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=r(e).navigator;return b(t)},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=r(e).userAgentData;return w(t)?0:b(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=r(e).brands;return b(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const _=r(t).brand,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return f(function(e,t){const _=r(t).userAgent,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){r(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){r(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){r(e).cancel()},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(h(e))},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){r(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=r(e).requestFullscreen();return b(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=r(e).webkitFullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=r(e).fullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(r(e),r(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,_){const c=r(e).animate(r(t),r(_));return b(c)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){r(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return f(function(e,t){r(e).removeListener(r(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return r(e).contains(r(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){r(e).unobserve(r(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){r(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){r(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return f(function(e,t,_,c){const o=r(t).getPropertyValue(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return f(function(e,t,_,c){const o=r(t).removeProperty(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=r(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=r(e).body;return w(t)?0:b(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return f(function(e,t){const _=r(e).appendChild(r(t));return b(_)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return f(function(e,t){const _=r(e).getComputedStyle(r(t));return w(_)?0:b(_)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=r(e).activeElement;return w(t)?0:b(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return f(function(e){const t=new ResizeObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){r(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,_){r(e).observe(r(t),r(_))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return f(function(e){const t=new IntersectionObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=r(e).getBoundingClientRect();return b(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return r(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return r(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return f(function(e,t){return r(e).requestAnimationFrame(r(t))},arguments)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;return b(t)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return r(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return r(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return r(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return r(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return r(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return r(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const _=r(t).code,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return r(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return r(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return r(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return r(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=r(e).getCoalescedEvents();return b(t)},n.wbg.__wbindgen_closure_wrapper1203=function(e,t,_){const c=k(e,t,171,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1205=function(e,t,_){const c=k(e,t,171,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1206=function(e,t,_){const c=k(e,t,171,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1207=function(e,t,_){const c=k(e,t,171,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1208=function(e,t,_){const c=k(e,t,171,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3349=function(e,t,_){const c=x(e,t,376,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6344=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8480=function(e,t,_){const c=x(e,t,376,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8514=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8519=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8524=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8563=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8583=function(e,t,_){const c=x(e,t,376,Y);return b(c)},n.wbg.__wbindgen_closure_wrapper8591=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8595=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8625=function(e,t,_){const c=x(e,t,376,S);return b(c)},n}function oe(n,e){return a=n.exports,Q.__wbindgen_wasm_module=e,A=null,T=null,R=null,a}async function Q(n){if(a!==void 0)return a;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_wasm_interpreter_bg-RHRDY7xP.wasm",import.meta.url).href,import.meta.url));const e=ce();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await _e(await n,e);return oe(t,_)}(async function(){await Q();let n="";const e=new Map;let t=` import { SpinBox, Button, CheckBox, Slider, GroupBox } from "std-widgets.slint"; export Demo := Window { width: 300px; // Width in logical pixels. All 'px' units are automatically scaled with screen resolution. @@ -13,4 +13,4 @@ export Demo := Window { source: @image-url("https://slint.dev/logo/slint-logo-full-light.svg"); } } -`;function _(){const p=document.getElementById("preview");setTimeout(function(){c(t,n,p)},1)}async function c(p,y,j){const q="canvas_"+Math.random().toString(36).slice(2,11),E=document.createElement("canvas");E.width=800,E.height=600,E.id=q,j.innerHTML="",j.appendChild(E);const{component:U,error_string:K}=await te(p,y,d,async I=>{const F=e.get(I);if(F===void 0){const H=await(await fetch(I)).text();return e.set(I,H),H}return F});if(K!==""){const I=document.createTextNode(K),F=document.createElement("pre");F.appendChild(I),j.innerHTML="
      "+F.innerHTML+"
      "}else{const I=document.getElementById("spinner");I!==null&&I.remove()}U!==void 0&&U.run(q)}const o=new URLSearchParams(window.location.search),i=o.get("snippet"),g=o.get("load_url"),d=o.get("style")||"";i?t=i:g&&(n=g,t=await(await fetch(g)).text()),_()})(); +`;function _(){const p=document.getElementById("preview");setTimeout(function(){c(t,n,p)},1)}async function c(p,y,j){const q="canvas_"+Math.random().toString(36).slice(2,11),E=document.createElement("canvas");E.width=800,E.height=600,E.id=q,j.innerHTML="",j.appendChild(E);const{component:U,error_string:H}=await te(p,y,d,async I=>{const F=e.get(I);if(F===void 0){const K=await(await fetch(I)).text();return e.set(I,K),K}return F});if(H!==""){const I=document.createTextNode(H),F=document.createElement("pre");F.appendChild(I),j.innerHTML="
      "+F.innerHTML+"
      "}else{const I=document.getElementById("spinner");I!==null&&I.remove()}U!==void 0&&U.run(q)}const o=new URLSearchParams(window.location.search),i=o.get("snippet"),g=o.get("load_url"),d=o.get("style")||"";i?t=i:g&&(n=g,t=await(await fetch(g)).text()),_()})(); diff --git a/snapshots/master/editor/assets/slint_lsp_wasm_bg-CWnb3MgQ.wasm b/snapshots/master/editor/assets/slint_lsp_wasm_bg-DJJWxp_L.wasm similarity index 63% rename from snapshots/master/editor/assets/slint_lsp_wasm_bg-CWnb3MgQ.wasm rename to snapshots/master/editor/assets/slint_lsp_wasm_bg-DJJWxp_L.wasm index c51576970..d9f325a0b 100644 Binary files a/snapshots/master/editor/assets/slint_lsp_wasm_bg-CWnb3MgQ.wasm and b/snapshots/master/editor/assets/slint_lsp_wasm_bg-DJJWxp_L.wasm differ diff --git a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-qVF2mWkT.wasm b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-RHRDY7xP.wasm similarity index 66% rename from snapshots/master/editor/assets/slint_wasm_interpreter_bg-qVF2mWkT.wasm rename to snapshots/master/editor/assets/slint_wasm_interpreter_bg-RHRDY7xP.wasm index 51771b757..b8db36f5b 100644 Binary files a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-qVF2mWkT.wasm and b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-RHRDY7xP.wasm differ diff --git a/snapshots/master/editor/index.html b/snapshots/master/editor/index.html index b9a64bdc9..b521224d7 100644 --- a/snapshots/master/editor/index.html +++ b/snapshots/master/editor/index.html @@ -1,34 +1,25 @@ - - - SlintPad - - - - + + + - - - - + + + - -
      - -
      - - + SlintPad + + + + + + +
      + +
      + + + \ No newline at end of file diff --git a/snapshots/master/editor/preview.html b/snapshots/master/editor/preview.html index b829bcd17..9d2585c5c 100644 --- a/snapshots/master/editor/preview.html +++ b/snapshots/master/editor/preview.html @@ -31,7 +31,7 @@ touch-action: none; } - + diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts index c84f31c7c..eebbac579 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts @@ -124,8 +124,8 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h90c32fc406a81877: (a: number, b: number, c: number) => void; - readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h690f3c5ed23d3d95: (a: number, b: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0456cc3c37fad44d: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h764ee0df8c4026b9: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h000ca7aabf02b323: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h58c9f705aaa6eaaf: (a: number, b: number, c: number, d: number) => void; readonly __wbindgen_free: (a: number, b: number, c: number) => void; diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js index 54fdf154b..169ce0775 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h90c32fc406a81877(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0456cc3c37fad44d(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -237,7 +237,7 @@ function makeMutClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_37(arg0, arg1) { - wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h690f3c5ed23d3d95(arg0, arg1); + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h764ee0df8c4026b9(arg0, arg1); } function __wbg_adapter_40(arg0, arg1, arg2) { @@ -1411,6 +1411,14 @@ function __wbg_get_imports() { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; + imports.wbg.__wbg_then_876bb3c633745cc6 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_compilationresult_new = function(arg0) { + const ret = CompilationResult.__wrap(arg0); + return addHeapObject(ret); + }; imports.wbg.__wbg_new_b85e72ed1bfd57f9 = function(arg0, arg1) { try { var state0 = {a: arg0, b: arg1}; @@ -1429,18 +1437,10 @@ function __wbg_get_imports() { state0.a = state0.b = 0; } }; - imports.wbg.__wbg_then_876bb3c633745cc6 = function(arg0, arg1, arg2) { - const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }; imports.wbg.__wbg_wrappedinstance_new = function(arg0) { const ret = WrappedInstance.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_compilationresult_new = function(arg0) { - const ret = CompilationResult.__wrap(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbindgen_throw = function(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }; @@ -1954,68 +1954,68 @@ function __wbg_get_imports() { const ret = getObject(arg0).getCoalescedEvents(); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1183 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1203 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1185 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1205 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1186 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1206 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1187 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1207 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1188 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1208 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 171, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3353 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3349 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6384 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper6344 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8473 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper8480 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8507 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8514 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8512 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8519 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8517 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8524 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8556 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8563 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8576 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_53); + imports.wbg.__wbindgen_closure_wrapper8583 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8584 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8591 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8588 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8595 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8618 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 378, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8625 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); return addHeapObject(ret); }; diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm index 51771b757..b8db36f5b 100644 Binary files a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm and b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm differ diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts index 89900874a..917f7cb52 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts @@ -23,8 +23,8 @@ export function run_event_loop(a: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h90c32fc406a81877(a: number, b: number, c: number): void; -export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h690f3c5ed23d3d95(a: number, b: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0456cc3c37fad44d(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h764ee0df8c4026b9(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h000ca7aabf02b323(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h58c9f705aaa6eaaf(a: number, b: number, c: number, d: number): void; export function __wbindgen_free(a: number, b: number, c: number): void;